query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
output git DiffChunkLine content
public function outputChunk(DiffChunk $diffChunk) { //var_dump($diffChunkLine); return implode($diffChunk->getLines(), "\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function html_shortlog($repo, $count) {\n echo '<table>';\n $c = git_commit($repo, \"HEAD\");\n for ($i = 0; $i < $count && $c; $i++) {\n\n $date = date('D n/j/y G:i', intval($c['date']));\n $commit_id = $c['commit_id'];\n $parent_id = $c['parent'];\n\n $commit_message = short_desc($c['message'], 110);\n $diff = \"<a href=\\\"\" . sanitized_url() . \"p={$_GET['p']}&a=commitdiff&h=$commit_id&hb=$parent_id\\\">commitdiff</a>\";\n echo \"<tr><td>$date</td><td>{$c['author']}</td><td>$commit_message</td><td>$diff</td></tr>\\n\";\n $c = git_commit($repo, $parent_id);\n }\n echo '</table>';\n}", "public function generateUnifiedDiff()\n {\n if ( ! $this->operations) {\n return \"\";\n }\n\n if ($this->lines === null) {\n $hunk = Hunk::forEmptyFile();\n return (string)$this->operations[0]->perform($hunk);\n }\n\n $hunks = array();\n\n foreach ($this->getLineGroups() as $lineGroup) {\n $start = min($lineGroup);\n $end = max($lineGroup);\n\n $hunk = Hunk::forLines($start, $end, $this->lines);\n\n foreach ($this->operations as $line => $operation) {\n if ( ! in_array($line, $lineGroup)) {\n continue;\n }\n\n $hunk = $operation->perform($hunk);\n }\n\n $hunks[] = $hunk;\n }\n\n $output = \"\";\n\n if ($this->path) {\n $output .= \"--- a/\" . $this->path . \"\\n\";\n $output .= \"+++ b/\" . $this->path . \"\\n\";\n }\n\n $output .= implode(\"\\n\", $hunks);\n\n return $output;\n }", "function html_diff($proj, $commit, $parent, $repos) {\n $repo = get_repo_path($proj, $repos);\n $out = array();\n exec(\"GIT_DIR=$repo/.git git diff $parent $commit\", $out);\n\n echo '<div class=\"gitcode\">';\n echo '<b>diff</b><br>';\n echo highlight_code(implode(\"\\n\", $out));\n echo '</div><br>';\n}", "public function diff()\n {\n return trim(implode(\"\\n\", $this->git('diff')));\n }", "private function getMarkedUpDiffText( array $unifiedDiff ) {\n\t\t$lastUser = $this->getArticle()->getPage()->getUserText();\n\n\t\t$output = '';\n\t\tforeach ( $unifiedDiff as $key => $currentLine ) {\n\t\t\tforeach ( $currentLine as $changeSet ) {\n\t\t\t\tswitch ( $changeSet['action'] ) {\n\t\t\t\t\tcase 'add':\n\t\t\t\t\t\t$class = 'mw-twocolconflict-diffchange-own';\n\t\t\t\t\t\tif ( $this->hasConflictInLine( $currentLine ) ) {\n\t\t\t\t\t\t\t$class .= ' mw-twocolconflict-diffchange-conflict';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$output .= '<div class=\"' . $class . '\">' .\n\t\t\t\t\t\t\t'<div class=\"mw-twocolconflict-diffchange-title\">' .\n\t\t\t\t\t\t\t'<span mw-twocolconflict-diffchange-title-pseudo=\"' .\n\t\t\t\t\t\t\t$this->context->msg( 'twoColConflict-diffchange-own-title' )->escaped() .\n\t\t\t\t\t\t\t'\" unselectable=\"on\">' . // used by IE9\n\t\t\t\t\t\t\t'</span>' .\n\t\t\t\t\t\t\t'</div>' .\n\t\t\t\t\t\t\t$changeSet['new'] .\n\t\t\t\t\t\t\t'</div>' . \"\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'delete':\n\t\t\t\t\t\t$class = 'mw-twocolconflict-diffchange-foreign';\n\t\t\t\t\t\tif ( $this->hasConflictInLine( $currentLine ) ) {\n\t\t\t\t\t\t\t$class .= ' mw-twocolconflict-diffchange-conflict';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$output .= '<div class=\"' . $class . '\">' .\n\t\t\t\t\t\t\t'<div class=\"mw-twocolconflict-diffchange-title\">' .\n\t\t\t\t\t\t\t'<span mw-twocolconflict-diffchange-title-pseudo=\"' .\n\t\t\t\t\t\t\t$this->context->msg(\n\t\t\t\t\t\t\t\t'twoColConflict-diffchange-foreign-title',\n\t\t\t\t\t\t\t\t$lastUser\n\t\t\t\t\t\t\t)->escaped() .\n\t\t\t\t\t\t\t'\" unselectable=\"on\">' . // used by IE9\n\t\t\t\t\t\t\t'</span>' .\n\t\t\t\t\t\t\t'</div>' .\n\t\t\t\t\t\t\t$changeSet['old'] .\n\t\t\t\t\t\t\t'</div>';\n\n\t\t\t\t\t\tif ( !$this->hasConflictInLine( $currentLine ) ) {\n\t\t\t\t\t\t\t$output .= \"\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'copy':\n\t\t\t\t\t\t$output .= '<div class=\"mw-twocolconflict-diffchange-same\">' .\n\t\t\t\t\t\t\t$this->addUnchangedText( $changeSet['copy'] ) .\n\t\t\t\t\t\t\t'</div>' . \"\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this->normalizeMarkedUpText( $output );\n\t}", "public function getOutputLines();", "protected function getGitRevision() {}", "public function outputContent(Object $object, $ref = 'HEAD')\n {\n $output = $this->pygmentize->format($this->getGit()->outputRawContent($object, $ref), $object->getName());\n $this->logger->info($output);\n $matches = array();\n preg_match(\"'<div class=\\\"highlight\\\"><pre>(.*)\\n</pre></div>'si\", $output, $matches);\n $arrContent = preg_split('/\\n/', $matches[1]);\n $arrOutput = array();\n $arrNumbers = array();\n foreach ($arrContent as $i => $line) {\n $arrNumbers[] = '<div class=\"number\">'.($i + 1).'</div>';\n $arrOutput[] = '<div class=\"ln\">'.$line.'</div>';\n }\n\n return array(\n 'line_numbers' => implode($arrNumbers),\n 'content' => implode($arrOutput)\n );\n }", "function _versioncontrol_git_process_commits($repository, $revision, &$branches_per_commit, &$existing_revs) {\n $rev_shell = escapeshellarg($revision);\n $command = \"git log $rev_shell --numstat --summary --pretty=format:\\\"%H%n%P%n%aN <%ae>%n%ct%n%s%n%b%nENDOFOUTPUTGITMESSAGEHERE\\\" -n 1 --\";\n $logs = _versioncontrol_git_log_exec($command);\n _versioncontrol_git_log_parse_commits($repository, $logs, $branches_per_commit, $existing_revs); // Parse the info from the raw output.\n}", "function write_plain($repos) {\n $repo = get_repo_path($_GET['p'], $repos);\n $hash = $_GET['h'];\n header(\"Content-Type: text/plain\");\n $str = system(\"GIT_DIR=$repo/.git git cat-file blob $hash\");\n echo $str;\n die();\n}", "function get_composer_content($commit, $filename) {\n\n return json_decode(shell_exec('git show ' . $commit . ':' . $filename));\n}", "public function output_commit( $args )\n\t{\n\t\t$url = 'https://github.com/' . $args['repository'] . '/commit/' . $args['commit'];\n\n\t\tob_start();\n\t\t?>\n\t\t\t<div class=\"commit\">\n\t\t\t\t<header>\n\t\t\t\t<h1>Commit by <span class=\"author\"><?php echo esc_html( $args['author'] ); ?></span> at\n\t\t\t\t\t<time>\n\t\t\t\t\t\t<?php echo human_time_diff( strtotime( $args['date'] ), time() ); ?> ago\n\t\t\t\t\t</time>\n\t\t\t\t\t(<a href=\"<?php echo esc_url( $url ); ?>\" class=\"diff\">view diff</a>)\n\t\t\t\t</h1>\n\t\t\t\t</header>\n\t\t\t\t<div class=\"body\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$body = htmlentities( $args['body'] );\n\t\t\t\t\t\techo nl2br( $this->link_issue_hash( $body, $args['repository'] ) );\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t\treturn ob_get_clean();\n\t}", "function diff($text1, $text2) {\n__autoload('TextDiff');\ninclude_once 'Text/Diff.php';\ninclude_once 'Text/Diff/Renderer.php';\ninclude_once 'Text/Diff/Renderer/unified.php';\n\n\n $vtext1 = chunk_split(strip_tags($text1, '<p><div>'), 1, \"\\n\");\n $vtext2 = chunk_split(strip_tags($text2, '<p><div>'), 1, \"\\n\");\n\n $vlines1 = str_split($vtext1, 2);\n $vlines2 = str_split($vtext2, 2);\n $text1 = str_replace(\"\\n\",\" \\n\",$text1);\n $text2 = str_replace(\"\\n\",\" \\n\",$text2);\n\n $vlines1 = explode(\" \", $text1);\n $vlines2 = explode(\" \", $text2);\n $diff = new Text_Diff($vlines1, $vlines2);\n $renderer = new Text_Diff_Renderer_inline();\n $html = html_entity_decode($renderer->render($diff));\n\n return preg_replace(array('#(<ins>|<del>)(<[^\\>]+>)#i', '#(</[^\\>]+>)(</ins>|</del>)#i'), '$2$1', $html);\n}", "public static function show_diff() {\r\n\t\tcheck_admin_referer('plugin-name-action_wpidenonce'); \r\n\t\tif ( !is_super_admin() )\r\n\t\t\twp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');\r\n\t\t\r\n error_reporting(E_ALL);\r\n ini_set(\"display_errors\", 1);\r\n \r\n require_once('git/autoload.php.dist');\r\n //use TQ\\Git\\Cli\\Binary;\r\n //use TQ\\Git\\Repository\\Repository;\r\n \r\n $root = apply_filters( 'wpide_filesystem_root', WP_CONTENT_DIR ) . \"/\"; \r\n \r\n //check repo path entered or die\r\n if ( !strlen($_POST['gitpath']) ) \r\n die(\"Error: Path to your git repository is required!\");\r\n \r\n \r\n $repo_path = $root . sanitize_text_field( $_POST['gitpath'] );\r\n $gitbinary = sanitize_text_field( stripslashes($_POST['gitbinary']) );\r\n \r\n if ( $gitbinary===\"I'll guess..\" ){ //the binary path\r\n \r\n $thebinary = TQ\\Git\\Cli\\Binary::locateBinary();\r\n $git = TQ\\Git\\Repository\\Repository::open($repo_path, new TQ\\Git\\Cli\\Binary( $thebinary ) );\r\n \r\n }else{\r\n \r\n $git = TQ\\Git\\Repository\\Repository::open($repo_path, new TQ\\Git\\Cli\\Binary( $_POST['gitbinary'] ) );\r\n \r\n }\r\n \r\n $file = sanitize_text_field( base64_decode( $_POST['file']) );\r\n \r\n //generate a diff using the built in WordPress code\r\n $args = array(\r\n 'title' => 'Differences',\r\n 'title_left' => 'Old Version',\r\n \t'title_right' => 'New Version'\r\n );\r\n \r\n $contents = file_get_contents($repo_path . \"/\" . $file); //the git library isn't using the WP filesystem API so should we here? should we fullstop?\r\n $contents2 = $git->showFile( $file, 'HEAD@{1}');\r\n \r\n $diff_table = wp_text_diff($contents2, $contents, $args); \r\n echo \"<strong>Diff</strong>\" . $diff_table;\r\n\r\n \r\n\t\tdie(); // this is required to return a proper result\r\n\t}", "public function outputContent(TreeObject $treeObject, $ref = 'HEAD')\n {\n $output = $this->pygmentize->format($this->repository->outputRawContent($treeObject, $ref), $treeObject->getName());\n $matches = array();\n preg_match(\"'<div class=\\\"highlight\\\"><pre>(.*)\\n</pre></div>'si\", $output, $matches);\n $arrContent = preg_split('/\\n/', $matches[1]);\n $arrOutput = array();\n $arrNumbers = array();\n foreach ($arrContent as $i => $line) {\n $arrNumbers[] = '<div class=\"number\">'.($i + 1).'</div>';\n $arrOutput[] = '<div class=\"ln\">'.$line.'</div>';\n }\n\n return array(\n 'line_numbers' => implode($arrNumbers),\n 'content' => implode($arrOutput)\n );\n }", "public function visualizeEntityContentDiff( EntityContentDiff $diff ) {\n\t\t$html = '';\n\t\t$html .= $this->visualizeRedirectDiff( $diff->getRedirectDiff() );\n\t\t$html .= $this->visualizeEntityDiff( $diff->getEntityDiff() );\n\t\treturn $html;\n\t}", "public function getTextOutput()\n {\n $patchLevel = $this->getPatchLevel();\n\n $commands = array(sprintf('-- Patch level %d structural changes', $patchLevel));\n $lastLocation = '';\n $lastName = '';\n $noOutput = true;\n foreach ($this->getStructuralPatches($patchLevel) as $patch) {\n if ($patch['gpa_location'] != $lastLocation) {\n $commands[] = sprintf(\"\\n-- DATABASE LOCATION: %s\", $patch['gpa_location']);\n $lastLocation = $patch['gpa_location'];\n }\n if ($patch['gpa_name'] != $lastName) {\n $commands[] = sprintf(\"\\n-- PATCH: %s\", $patch['gpa_name']);\n $lastName = $patch['gpa_name'];\n }\n $commands[] = $patch['gpa_sql'] . ';';\n $noOutput = false;\n }\n\n if ($noOutput) {\n $commands[] = sprintf(\"\\n-- No structural changes in patchlevel %d\", $patchLevel);\n }\n $commands[] = '';\n\n return implode(\"\\n\", $commands);\n }", "public function render()\n\t{\n\t\t$changes = parent::render();\n\t\t$html = '';\n\t\tif(empty($changes)) {\n\t\t\treturn $html;\n\t\t}\n\n\t\t$html .= '<table class=\"Differences DifferencesInline\">';\n\t\t$html .= '<thead>';\n\t\t$html .= '</thead>';\n\t\tforeach($changes as $i => $blocks) {\n\t\t\t// If this is a separate block, we're condensing code so output ...,\n\t\t\t// indicating a significant portion of the code has been collapsed as\n\t\t\t// it is the same\n\t\t\tif($i > 0) {\n\t\t\t\t$html .= '<tbody class=\"Skipped\">';\n\t\t\t\t$html .= '<th>&hellip;</th>';\n\t\t\t\t$html .= '<th>&hellip;</th>';\n\t\t\t\t$html .= '<td>&#xA0;</td>';\n\t\t\t\t$html .= '</tbody>';\n\t\t\t}\n\n\t\t\tforeach($blocks as $change) {\n\t\t\t\t$html .= '<tbody class=\"Change'.ucfirst($change['tag']).'\">';\n\t\t\t\t// Added lines only on the right side\n\t\t\t\tif($change['tag'] == 'insert') {\n\t\t\t\t\tforeach($change['changed']['lines'] as $no => $line) {\n\t\t\t\t\t\t$html .= '<tr>';\n\t\t\t\t\t\t$html .= '<td class=\"Right\"><ins>'.$line.'</ins>&#xA0;</td>';\n\t\t\t\t\t\t$html .= '</tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Show deleted lines only on the left side\n\t\t\t\telse if($change['tag'] == 'delete') {\n\t\t\t\t\tforeach($change['base']['lines'] as $no => $line) {\n\t\t\t\t\t\t$html .= '<tr>';\n\t\t\t\t\t\t$html .= '<td class=\"Left\"><del>'.$line.'</del>&#xA0;</td>';\n\t\t\t\t\t\t$html .= '</tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Show modified lines on both sides\n\t\t\t\telse if($change['tag'] == 'replace') {\n\t\t\t\t\tforeach($change['base']['lines'] as $no => $line) {\n\t\t\t\t\t\t$html .= '<tr>';\n\t\t\t\t\t\t$html .= '<td class=\"Left\"><span>'.$line.'</span></td>';\n\t\t\t\t\t\t$html .= '</tr>';\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach($change['changed']['lines'] as $no => $line) {\n\t\t\t\t\t\t$html .= '<tr>';\n\t\t\t\t\t\t$html .= '<td class=\"Right\"><span>'.$line.'</span></td>';\n\t\t\t\t\t\t$html .= '</tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$html .= '</tbody>';\n\t\t\t}\n\t\t}\n\t\t$html .= '</table>';\n\t\treturn $html;\n\t}", "function html_desc($repo, $proj) {\n\n // Check if the git repo has a description file\n if(file_exists(\"$repo/.git/description\")){\n $desc = short_desc(file_get_contents(\"$repo/.git/description\"));\n }else{\n $desc = \"No description\";\n }\n $owner = get_file_owner($repo);\n $last = get_last($repo);\n $git_clone_url = 'http://'.$_SERVER['HTTP_HOST'].'/git/'.$proj;\n \n echo \"<table>\";\n echo \"<tr><td>description</td><td>$desc</td></tr>\";\n echo \"<tr><td>owner</td><td>$owner</td></tr>\";\n echo \"<tr><td>last change</td><td>$last</td></tr>\";\n echo \"<tr><td>URL</td><td>$git_clone_url</td></tr>\";\n echo \"</table>\";\n}", "public function theme_page()\n\t{\n\t\t$repository = $this->git_repository();\n\n\t\texec( 'cd ' . $this->theme_dir . '; git log --no-merges --decorate=full -n 20 ', $output );\n\n\t\t$formatted = '';\n\t\t$commit = array();\n\n\t\tforeach( $output as $line )\n\t\t{\n\t\t\tif ( preg_match( '/^commit ([^ ]+)/', $line, $matches ) )\n\t\t\t{\n\t\t\t\tif ( $commit )\n\t\t\t\t{\n\t\t\t\t\t$formatted .= $this->output_commit( $commit );\n\t\t\t\t}//end if\n\n\t\t\t\t$commit = array(\n\t\t\t\t\t'commit' => $matches[1],\n\t\t\t\t\t'repository' => $repository,\n\t\t\t\t);\n\t\t\t}//end if\n\t\t\telseif ( preg_match( '/^Author: ([^<]+)/', $line, $matches ) )\n\t\t\t{\n\t\t\t\t$commit['author'] = trim( $matches[1] );\n\t\t\t}//end elseif\n\t\t\telseif ( preg_match( '/^Date: (.+)$/', $line, $matches ) )\n\t\t\t{\n\t\t\t\t$commit['date'] = $matches[1];\n\t\t\t}//end elseif\n\t\t\telseif ( preg_match( '/^Merge: (.+)$/', $line, $matches ) )\n\t\t\t{\n\t\t\t\t$commit['merge'] = $matches[1];\n\t\t\t}//end elseif\n\t\t\telse\n\t\t\t{\n\t\t\t\t$commit['body'] .= $line . \"\\n\";\n\t\t\t}//end else\n\t\t}//end foreach\n\n\t\t$formatted .= $this->output_commit( $commit );\n\n\t\t?>\n\t\t<div class=\"wrap go-git\">\n\t\t\t<?php screen_icon('options-general'); ?>\n\t\t\t<h2>Theme Git Info</h2>\n\t\t\t<div class=\"current-branch\">\n\t\t\t\t<h3>Branch: <span class=\"branch\"><?php echo $this->git_working_branch(); ?></span> on <a href=\"https://github.com/<?php echo $repository; ?>\"><?php echo $repository; ?></a></h3>\n\t\t\t\t<div class=\"status\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$statuses = $this->git_working_branch_status();\n\n\t\t\t\t\t\t$final_status = '';\n\t\t\t\t\t\tforeach ( $statuses as $remote => $status )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ( ! $status['behind'] && ! $status['ahead'] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}//end if\n\n\t\t\t\t\t\t\tif ( $status['behind'] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$final_status .= $status['behind'] . ' commit' . ($status['behind'] > 1 ? 's' : '') . ' behind ' . $remote . '. ';\n\t\t\t\t\t\t\t}//end if\n\n\t\t\t\t\t\t\tif ( $status['ahead'] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$final_status .= $status['ahead'] . ' commit' . ($status['ahead'] > 1 ? 's' : '') . ' ahead of ' . $remote . '. ';\n\t\t\t\t\t\t\t}//end if\n\t\t\t\t\t\t}//end foreach\n\n\t\t\t\t\t\tif ( ! $final_status )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$final_status = 'This branch is in sync with all of its remotes.';\n\t\t\t\t\t\t}//end if\n\n\t\t\t\t\t\techo $final_status;\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<?php echo $formatted; ?>\n\t\t</div>\n\t\t<?php\n\t}", "protected function generateDiffContent($fileName) {\n\t\t$localLangDiff = NULL;\n\t\t$metaDiff = NULL;\n\t\t// set backup file\n\t\t$metaArray = $this->backupService->getBackupObj()->getMetaInfos(3);\n\t\t$informations = array(\n\t\t\t'absPath' => Typo3Lib::fixFilePath(\n\t\t\t\tPATH_site . '/' .\n\t\t\t\t$metaArray[$fileName]['pathBackup']\n\t\t\t),\n\t\t\t'relFile' => $fileName,\n\t\t);\n\t\t$this->backupService->getBackupObj()->setVar($informations);\n\n\t\t// exec diff\n\t\t// read original file\n\t\t$this->configurationService->initFileObject(\n\t\t\t$this->backupService->getBackupObj()->getVar('langFile'),\n\t\t\tTypo3Lib::fixFilePath(PATH_site . '/' . $this->backupService->getBackupObj()->getVar('extPath'))\n\t\t);\n\n\t\t// read backup file\n\t\t$this->backupService->getBackupObj()->readFile();\n\n\t\t// get language data\n\t\t$originalLocalLang = $this->configurationService->getFileObj()->getLocalLangData();\n\t\t$backupLocalLang = $this->backupService->getBackupObj()->getLocalLangData();\n\n\t\t// get meta data\n\t\t$origMeta = $this->configurationService->getFileObj()->getMetaData();\n\t\t$backupMeta = $this->backupService->getBackupObj()->getMetaData();\n\n\t\tSgLib::fixMetaAttributes($origMeta);\n\t\tunset($originalLocalLang['trans-unit']);\n\t\t$localLangDiff = Functions::getBackupDiff(0, $originalLocalLang, $backupLocalLang);\n\t\t$metaDiff = Functions::getMetaDiff(0, $origMeta, $backupMeta);\n\n\t\t// generate diff\n\t\tif (count($localLangDiff)) {\n\t\t\t$this->outputManageBackupsDiff(\n\t\t\t\t$localLangDiff, $metaDiff, $originalLocalLang, $backupLocalLang,\n\t\t\t\t$this->configurationService->getFileObj()->getOriginLangData(),\n\t\t\t\t$this->backupService->getBackupObj()->getOriginLangData(),\n\t\t\t\t$origMeta, $backupMeta\n\t\t\t);\n\t\t}\n\t}", "private function getLastCommitMessage()\n {\n // hash\n // subject\n // body\n $process = new Process('git log -1 --format=\"%h%n%s%n%b\"');\n $process->run();\n\n return \\trim($process->getOutput());\n }", "private function renderDiff($lines1, $lines2): string\n {\n if (!is_array($lines1)) {\n $lines1 = explode(\"\\n\", $lines1);\n }\n if (!is_array($lines2)) {\n $lines2 = explode(\"\\n\", $lines2);\n }\n foreach ($lines1 as $i => $line) {\n $lines1[$i] = rtrim($line, \"\\r\\n\");\n }\n foreach ($lines2 as $i => $line) {\n $lines2[$i] = rtrim($line, \"\\r\\n\");\n }\n\n $renderer = new DiffRendererHtmlInline();\n $diff = new Diff($lines1, $lines2);\n\n return $diff->render($renderer);\n }", "private function showDiffStyle() {\n\t\t$this->getOutput()->addModuleStyles( 'mediawiki.action.history.diff' );\n\t}", "public function git_log($options=\"\")\n\t\t{\n\t\t\t$cmd=\"git log \".$options;\n\t\t\t//$last_line=system ($cmd , $retval);\n\t\t\t$last_line=exec ($cmd , $output , $retval);\n\t\t\tcheck_error($cmd,$retval);\n\t\t\tout_table($output);\n\t\t}", "public function render() {\n\t\t$logs = $this->logger->get_logs();\n\t\tforeach ( $logs as $log_id => $gist ) {\n\t\t\techo '<div class=\"b6go-gist-debug\">';\n\t\t\tforeach ( $gist as $entry ) {\n\t\t\t\t// Don't wpautop tabular data, as it adds <br> between line number spans.\n\t\t\t\techo ( false === strpos( $entry['message'], '<table' ) ) ? wpautop ( $entry['message'] ) : $entry['message'];\n\t\t\t}\n\t\t\techo '</div>';\n\t\t}\n\t\t?>\n\t\t<style type=\"text/css\">\n\t\t.b6go-gist-debug { margin: 2em 0; padding: 10px; background: #e8e8e8;}\n\t\t#querylist .b6go-gist-debug .gist .gist-file .gist-data .line_data pre {\n\t\t\toverflow: auto;\n\t\t\tword-wrap: normal;\n\t\t\t-moz-tab-size: 4;\n\t\t\t-o-tab-size: 4;\n\t\t\ttab-size: 4;}\n\t\t.b6go-gist-debug .gist .gist-file .gist-data .line_numbers span {font-size: 12px;}\n\t\t#querylist .b6go-gist-debug h2 {border: 0; float: none; font-size: 22px; text-align: left; margin: 0 !important; padding-left: 0;}\n\t\t</style>\n\t\t<?php\n\t}", "function git_commit($repo, $cid) {\n $out = array();\n $commit = array();\n\n if (strlen($cid) <= 0) {\n return 0;\n }\n exec(\"GIT_DIR=$repo/.git git rev-list --header --max-count=1 $cid\", $out);\n\n\n if (!empty($out)) {\n\n $commit[\"commit_id\"] = $out[0];\n\n\n $g = explode(\" \", $out[1]);\n\n $commit[\"tree\"] = $g[1];\n\n\n\n\n $g = explode(\" \", $out[2]);\n $commit[\"parent\"] = $g[1];\n\n\n\n\n $g = explode(\" \", $out[3]);\n\n if (isset($g[3])) {\n\n\n // $commit['author'] = $g[1].' '.$g[2];\n /* variable number of strings for the name */\n /*\n for ($i = 0; $g[$i][0] != '<' && $i < 5; $i++) {\n // $commit[\"author\"] = $g[1];\n\n $commit[\"author\"] = \" $g[$i] \";\n }\n */\n\n for ($i = 1; $g[$i][0] != '<' && $i < 5; $i++) {\n\n\n $commit[\"author\"] = $g[1];\n $commit[\"author\"] .= ' ' . $g[2];\n // $commit[\"author\"] = \"\";\n // $commit[\"author\"] .= \" $g[$i] \";\n }\n\n // $commit['author'] = $g[1].' '.$g[2];\n\n\n\n /* add the email */\n\n $commit[\"date\"] = \"{$g[++$i]} {$g[++$i]}\";\n // $commit[\"date\"] = $g[5];s\n $commit[\"message\"] = \"\";\n $size = count($out);\n\n\n\n for (; $i < $size - 1; $i++) {\n $commit[\"message\"] .= $out[$i];\n }\n return $commit;\n }\n }\n}", "function logAllToRevision($log)\n{\n $revisions = array();\n if ($log != \"\" && preg_match_all('/commit\\s+(\\w{40})\\n/i', $log, $matches)) {\n $data = preg_split('/commit\\s+\\w{40}\\n/i', $log);\n foreach ($matches[1] as $k => $match) {\n preg_match('/Author:\\s+([^\\n]+)\\n/i', $data[$k + 1], $author);\n if (isset($author[1])) {\n $author = htmlentities($author[1]);\n $data[$k + 1] = preg_replace('/Author:\\s+[^\\n]+\\n/i', '', $data[$k + 1]);\n } else $author = '';\n\n preg_match('/Date:\\s+([^\\n]+)\\n/i', $data[$k + 1], $date);\n if (isset($date[1])) {\n $date = $date[1];\n $data[$k + 1] = preg_replace('/Date:\\s+[^\\n]+\\n/i', '', $data[$k + 1]);\n } else $date = '';\n\n $comment = trim($data[$k + 1]);\n\n $revisions[$match] = array(\n 'hash' => $match,\n 'author' => $author,\n 'date' => $date, //date('Y-m-d H:i:s', strtotime($date))\n 'comment' => $comment\n );\n }\n }\n return $revisions;\n}", "function git_ls_tree($repo, $tree) {\n $ary = array();\n\n $out = array();\n //Have to strip the \\t between hash and file\n exec(\"GIT_DIR=$repo/.git git ls-tree $tree | sed -e 's/\\t/ /g'\", $out);\n\n foreach ($out as $line) {\n $entry = array();\n $arr = explode(\" \", $line);\n $entry['perm'] = $arr[0];\n $entry['type'] = $arr[1];\n $entry['hash'] = $arr[2];\n $entry['file'] = $arr[3];\n $ary[] = $entry;\n }\n return $ary;\n}", "private function getUnifiedDiff() {\n\t\t$currentText = $this->toEditText( $this->getCurrentContent() );\n\t\t$yourText = $this->textbox1;\n\n\t\t$currentLines = explode( \"\\n\", $currentText );\n\t\t$yourLines = explode( \"\\n\", str_replace( \"\\r\\n\", \"\\n\", $yourText ) );\n\n\t\treturn $this->getLineBasedUnifiedDiff( $currentLines, $yourLines );\n\t}" ]
[ "0.58935595", "0.5771478", "0.5690661", "0.5257246", "0.52250886", "0.52140003", "0.5173087", "0.5094269", "0.5065596", "0.50597435", "0.50582755", "0.50370955", "0.49841663", "0.49563992", "0.4903894", "0.48786676", "0.48729935", "0.4847911", "0.48276314", "0.4826947", "0.4792645", "0.47680065", "0.47236377", "0.4721039", "0.4712925", "0.47089234", "0.47050717", "0.47002918", "0.46947184", "0.46508464" ]
0.7083244
1
/ MiningBuddy ( $Header: /usr/home/mining/cvs/mining/functions/html/showEvents.php,v 1.19 2008/01/02 20:01:32 mining Exp $ Copyright (c) 20052008 Christian Reiss. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
function showEvents() { // Lets import some globals, shall we? global $MySelf; global $DB; global $TIMEMARK; $delta = $TIMEMARK -259200; // is the events module active? if (!getConfig("events")) { makeNotice("The admin has deactivated the events module.", "warning", "Module not active"); } // Load all events. $EVENTS_DS = $DB->query("SELECT * FROM events WHERE starttime >= '" . $delta . "' ORDER BY starttime ASC"); // .. right? if ($EVENTS_DS->numRows() >= 1) { // Lets keep in mind: We have events. $haveEvents = true; while ($event = $EVENTS_DS->fetchRow()) { // get the date. $date = date("d.m.y", $event[starttime]); // open up a new table for each day. if ($date != $previousdate) { $workday = date("l", $event[starttime]); if ($beenhere) { $html .= $temp->flush(); $html .= "<br>"; } $beenhere = true; // We need an additional row if we are allowed to delete events. if ($MySelf->canDeleteEvents()) { $temp = new table(8, true); } else { $temp = new table(7, true); } $temp->addHeader(">> Events for " . $workday . ", the " . $date); $previousdate = $date; $temp->addRow("#060622"); $temp->addCol("ID"); $temp->addCol("Starttime"); $temp->addCol("Starts in / Runs for"); $temp->addCol("Mission Type"); $temp->addCol("Short Description"); $temp->addCol("System"); $temp->addCol("Security"); if ($MySelf->canDeleteEvents()) { $temp->addCol("Delete"); } } // Add Event to the current database. $temp->addRow(); $temp->addCol("<a href=\"index.php?action=showevent&id=" . $event[id] . "\">" . str_pad($event[id], 4, "0", STR_PAD_LEFT) . "</a>"); $temp->addCol(date("d.m.y H:i", $event[starttime])); $delta = $TIMEMARK - $event[starttime]; if ($TIMEMARK > $event[starttime]) { // Event underway. $temp->addCol("<font color=\"#00ff00\">" . numberToString($delta) . "</font>"); } else { // Event not started yet. $delta = $delta * -1; $temp->addCol("<font color=\"#ffff00\">" . numberToString($delta) . "</font>"); } $temp->addCol($event[type]); $temp->addCol($event[sdesc]); $temp->addCol($event[system]); $temp->addCol($event[security]); if ($MySelf->canDeleteEvents()) { $temp->addCol("<a href=\"index.php?action=deleteevent&id=$event[id]\">delete event</a>"); } } } // Lets recall, did we have events scheduled? if ($haveEvents) { // We do! $html = "<h2>Scheduled Events</h2>" . $html . $temp->flush(); } else { // We dont! $html = "<h2>Scheduled Events</h2><b>There are currently no scheduled events in the database.</b>"; } // Return what we got. return ($html); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ShowEvents()\n {\n $this->ReadEvents();\n echo\n $this->H(1,$this->MyLanguage_GetMessage(\"Events_Table_Title\")).\n $this->EventsHtmlTable(),\n \"\";\n }", "function DisplayEvents()\r\n\t{\t\r\n\t\tglobal $_GET;\r\n\t\tglobal $_POST;\r\n\t\tglobal $_REQUEST;\r\n\t\tglobal $_SETTINGS;\r\n\t\tglobal $_SESSION;\t\r\n\t\t\r\n\t\t//\r\n\t\t// PAGE FLAG\r\n\t\t//\r\n\t\t$flag = $_SETTINGS['events_page_clean_url'];\r\n\t\tif($flag == $_REQUEST['page']){\r\n\t\t\t\r\n\t\t\t//\r\n\t\t\t// DEBUG SECTION\r\n\t\t\t//\r\n\t\t\tif($_SETTINGS['debug'] == 1){\r\n\t\t\t\techo \"<br>PAGE: \".$_REQUEST['page'].\"<br>\";\r\n\t\t\t\techo \"<br>FORM1: \".$_REQUEST['FORM1'].\"<br>\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//\r\n\t\t\t// IF FORM1 CALENDAR\r\n\t\t\t//\r\n\t\t\tif($_REQUEST['FORM1'] == 'calendar'){\r\n\t\t\t\t$this->DisplayCalendarOfEvents();\r\n\t\t\t}\r\n\t\t\t//\r\n\t\t\t// ELSE DISPLAY EVENTS BY DEFAULT\r\n\t\t\t//\r\n\t\t\telse {\t\t\r\n\t\t\t\techo \"<div class='events'>\";\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t// CHECK FOR A CATEGORY\r\n\t\t\t\tif($_REQUEST['form1'] != ''){\r\n\t\t\t\t\r\n\t\t\t\t\t$form1Array = explode(\":\",$_REQUEST['FORM1']);\r\n\t\t\t\t\t$categoryName = $form1Array[0];\r\n\t\t\t\t\t$pageNum = $form1Array[1];\r\n\t\t\t\t\t$eventName = $form1Array[2];\r\n\t\t\t\t\t\r\n\t\t\t\t\t$cagegorySQL = \"AND ec.name='\".$categoryName.\"' \";\r\n\t\t\t\t\t$nameSQL = \"AND ev.name='\".$eventName.\"' \";\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// PAGINATION\r\n\t\t\t\t$page = 1; // start page\t\t\t\r\n\t\t\t\t$size = 4; // records per page\r\n\t\t\t\t$select = \t\"SELECT * FROM events \".\r\n\t\t\t\t\t\t\t\"WHERE events.active='1' \".\r\n\t\t\t\t\t\t\t\"AND events.published='1' \".\r\n\t\t\t\t\t\t\t\"\".$_SETTINGS['demosqland'].\" \".\r\n\t\t\t\t\t\t\t\"ORDER BY events.date DESC \";\t\r\n\t\t\t\t$total_records = mysql_num_rows(doQuery($select)); // total records\r\n\t\t\t\tif($pageNum){ $page = (int) $pageNum; } // current page\r\n\t\t\t\t$pagination = new Pagination();\r\n\t\t\t\t$pagination->setLink(\"\".$_SETTINGS['website'].\"/\".$_REQUEST['page'].\"/\".$categoryName.\":%s\");\r\n\t\t\t\t$pagination->setPage($page);\r\n\t\t\t\t$pagination->setSize($size);\r\n\t\t\t\t$pagination->setTotalRecords($total_records);\r\n\t\t\t\t$select2 = \t$select.$pagination->getLimitSql();\t\t\t\t\r\n\t\t\t\t$result = doQuery($select);\r\n\t\t\t\t\r\n\t\t\t\t$i=0;\r\n\t\t\t\twhile ($row = mysql_fetch_array($result)){\r\n\t\t\t\t\t\r\n\t\t\t\t\techo \"<div class='event_cont'>\";\r\n\t\t\t\t\t\r\n\t\t\t\t\techo \"<div class='eventmaps' id='eventmap\".$i.\"'></div>\";\r\n\t\t\t\t\techo \"<div class='event_cont_img_box'><img src='\".$_SETTINGS['website'].\"uploads/\".$row['image'].\"' class='event_cont_img' alt='' /></div>\";\r\n\t\t\t\t\t\r\n\t\t\t\t\techo \"<strong>\".$row['title'].\"</strong>\";\r\n\t\t\t\t\techo \"<label>\".TimestampIntoDate($row['date']).\"</label>\";\r\n\t\t\t\t\techo \"<label>\".$row['location'].\"</label>\";\r\n\t\t\t\t\t\r\n\t\t\t\t\techo \"\".truncateString($row['content'], 300, $stopanywhere=false).\"\";\r\n\t\t\t\t\t\r\n\t\t\t\t\techo \"<ul class='event_list'>\";\r\n\t\t\t\t\techo \"<li><b>Location:</b> \".$row['location'].\"</li>\";\r\n\t\t\t\t\techo \"<li><b>Address:</b> \".$row['address'].\"</li>\";\r\n\t\t\t\t\techo \"<li><b>Openings:</b></li>\";\r\n\t\t\t\t\techo \"<li><b>Price:</b> $\".$row['price'].\"</li>\";\t\t\t\t\t\r\n\t\t\t\t\techo \"</ul>\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t// CHECKOUT FORM\r\n\t\t\t\t\tif($row['price'] != 0){\r\n\t\t\t\t\t\techo\t\"<form class='product-form' method='post'>\".\r\n\t\t\t\t\t\t\t\t\"<input class='hidden' type='hidden' name='pid' value='\".$product_id.\"' >\".\r\n\t\t\t\t\t\t\t\t\"<input type='hidden' class='qtyinput' name='qty' value='1' size='2' >\";\r\n\t\t\t\t\t\techo\t\"<input type='submit' name='ADDTOCART' class='event-submit' value='Attend This Event'>\";\r\n\t\t\t\t\t\techo\t\"<input type='button' class='event-directions' value='Get Directions'>\".\r\n\t\t\t\t\t\t\t\t\"</form>\";\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\techo\t\"<form>\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\techo\t\"<input type='submit' name='ATTENDEVENT' class='event-submit' value='Attend This Event'>\";\r\n\t\t\t\t\t\techo\t\"<input type='button' class='event-directions' value='Get Directions'>\".\r\n\t\t\t\t\t\t\t\t\"</form>\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\techo \"</div>\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif($i==0){\r\n\t\t\t\t\techo \"There are currently no events listed\";\t\t\t\r\n\t\t\t\t}\r\n\r\n\t\t\t\t?>\r\n\t\t\t\t\r\n\t\t\t\t<?\r\n\t\t\t\t\r\n\t\t\t\t$navigation = $pagination->create_links();\r\n\t\t\t\techo $navigation; // will draw our page navigation\r\n\t\t\t\r\n\t\t\t\techo \"</div>\";\t\r\n\t\t\t\techo \"<div id='map_canvas'></div>\";\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function viewEvents();", "function listEventInfo() {\n\t\t$query = \"SELECT e_description, c_name, tag_name, start_datetime, end_datetime, capacity, v.name AS vname, address,o.name AS oname, v.address, v.city, v.state, v.postal_code \n\t\tFROM yam14.F_event e, yam14.F_venue v, yam14.F_category c, yam14.F_topic t, yam14.F_organizer o\n\t\tWHERE e.venue_id = v.v_id \n\t\tAND c.c_id = e.c_id \n\t\tAND t.tag_id = e.tag_id \n\t\tAND o.o_id = e.organizer_id\n\t\tAND e.e_id = $this->eid ;\";\n\t\t\n\t\t$result = mysql_query($query);\n\t\tif (!$result) {\n\t\t\t$message='Invalid Query' .mysql_errno().\" \\n\";\n\t\t $message .= 'Whole Query' . $query;\n\t\t die($message);\n\t\t}//end if\n\t\t\n\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t$this->category = $row['c_name'];\n\t\t\t$this->tag = $row['tag_name'];\n\t\t\t$this->description = $row['e_description'];\n\t\t\t$this->startdate = date('l, M d, Y',strtotime($row['start_datetime']));\n\t\t\t$this->starttime = date('H:i A',strtotime($row['start_datetime']));\n\t\t\t$this->enddate = date('l, M d, Y',strtotime($row['end_datetime']));\n\t\t\t$this->endtime =date('H:i A',strtotime($row['end_datetime']));\n\t\t\t$this->capacity = $row['capacity'];\n\t\t\t$this->venue = $row['vname'];\n\t\t\t$this->address = $row['address'] . \", \" . $row['city'] . \", \" . $row['state'] . \" \" . $row['postal_code'];\n\t\t\t$this->organizer = $row['oname'];\n\t\t\techo \"<hr />\";\n\t\t\techo \"<div class=\\\"panel panel-default\\\">\";\n\t\t\techo \t\"<div class=\\\"panel-heading\\\">\";\n\t\t\techo \t\"<h3 class=\\\"panel-title\\\">Event Information</h3>\";\n\t\t\techo \t\"</div>\";\n\t\t\techo \t\"<div class=\\\"panel-body\\\">\";\n\t\t\techo \"<p><b>Description: </b>$this->description</p>\";\n\t\t\techo \t\"<p><b>Category: </b>$this->category</p>\";\n\t\t\techo \t\"<p><b>Topic: </b>$this->tag</p>\";\n\t\t\techo \t\"<p><b>Start Date: </b>$this->startdate</p>\";\n\t\t\techo \t\"<p><b>Start Time: </b>$this->starttime</p>\";\n\t\t\techo \t\"<p><b>End Date: </b>$this->enddate</p>\";\n\t\t\techo \t\"<p><b>End Time: </b>$this->endtime</p>\";\n\t\t\techo \t\"<p><b>Capacity: </b>$this->capacity</p>\";\n\t\t\techo \t\"<p><b>Organizer: </b>$this->organizer</p>\";\n\t\t\techo \t\"<p><b>Location: </b>$this->venue</p>\";\n\t\t\techo \t\"<p><b>Address: </b>$this->address</p>\";\n\t\t\t\n\t\t\techo \t\"</div>\";\n\t\t\techo \t\"</div>\";\n\t\t\t\t\n\t\t\t\n\t\t\t\t\t\t\n\t\t}\t\n\t\t\n\t\tmysql_free_result($result);\n\t}", "function showEvent() \n {\n if (isset($_SESSION['eventid']) AND isset($_SESSION['eventguest'])) {\n // event und gast informationen\n echo \"<div class=''>\";\n echo \"<div class='rightBody'>\";\n $this->askUserForZusage($_SESSION['eventid']);\n $this->askUserForCount($_SESSION['eventid']);\n $this->showSmallGuestList();\n echo \"</div>\";\n echo \"<div class='innerBody'>\";\n echo \"<ul class='finanzNAV'>\";\n $this->eventAdministration();\n echo \"</ul>\";\n $eventname = $this->getEventname($_SESSION['eventid']);\n echo \"<h1><a href='event.php'>\" .$eventname . \"</a></h1>\";\n echo \"<h2>Willkommen \" . $this->getGuestName($_SESSION['eventguest']) . \"</h2>\";\n $this->showWelcomeMessage($_SESSION['eventid']);\n $this->showCountdowns($_SESSION['eventid']);\n $this->showBlogMessages($_SESSION['eventid']);\n echo \"</div>\";\n echo \"</div>\";\n \n }\n }", "function aidtransparency_print_events()\r\n{\r\n $events = new IATI_Event_Collection();\r\n if( $events->findPosts() > 0 ) :\r\n ?>\r\n <ol>\r\n <?php\r\n foreach ($events->getPosts() as $event) :\r\n ?>\r\n <li><a href=\"<?php echo get_permalink($event->ID); ?>\" title=\"<?php echo $event->post_title; ?>\"><?php echo $event->post_title; ?></a>\r\n <span class=\"when\"><?php echo $event->getWhere(); ?> </span>\r\n </li>\r\n <?php endforeach; ?>\r\n </ol>\r\n <?php endif;\r\n}", "function DisplayCalendarOfEvents()\r\n\t{\r\n\t\tglobal $_SETTINGS;\r\n\t\techo \"<div id='calendar'></div>\";\t\r\n\t}", "function show_calendar_events()\n\t{\n\t\t$stats_html = \"\";\n\t\t\n\t\tif ($this->ipsclass->vars['show_birthdays'] or $this->ipsclass->vars['show_calendar'] )\n\t\t{\n\t\t\t$a = explode( ',', gmdate( 'Y,n,j,G,i,s', time() + $this->ipsclass->get_time_offset() ) );\n\t\t\n\t\t\t$day = $a[2];\n\t\t\t$month = $a[1];\n\t\t\t$year = $a[0];\n\t\t\t\n\t\t\t$birthstring = \"\";\n\t\t\t$count = 0;\n\t\t\t$users = array();\n\t\t\t\n\t\t\tif ( $this->ipsclass->vars['show_birthdays'] )\n\t\t\t{\n\t\t\t\tif ( is_array($this->ipsclass->cache['birthdays']) AND count( $this->ipsclass->cache['birthdays'] ) )\n\t\t\t\t{\n\t\t\t\t\tforeach( $this->ipsclass->cache['birthdays'] as $u )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( $u['bday_day'] == $day and $u['bday_month'] == $month )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$users[] = $u;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if( $day == 28 && $month == 2 && !date(\"L\") )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ( $u['bday_day'] == \"29\" and $u['bday_month'] == $month )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$users[] = $u;\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//-----------------------------------------\n\t\t\t\t// Spin and print...\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\tforeach ( $users as $user )\n\t\t\t\t{\n\t\t\t\t\t$birthstring .= \"<a href='{$this->ipsclass->base_url}showuser={$user['id']}'>{$user['members_display_name']}</a>\";\n\t\t\t\t\t\n\t\t\t\t\tif ($user['bday_year'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$pyear = $year - $user['bday_year'];\n\t\t\t\t\t\t$birthstring .= \"(<b>$pyear</b>)\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$birthstring .= $this->sep_char.\"\\n\";\n\t\t\t\t\t\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Fix up string...\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$birthstring = preg_replace( \"/\".$this->sep_char.\"$/\", \"\", trim($birthstring) );\n\t\t\t\t\n\t\t\t\t$lang = $this->ipsclass->lang['no_birth_users'];\n\t\t\t\t\n\t\t\t\tif ($count > 0)\n\t\t\t\t{\n\t\t\t\t\t$lang = ($count > 1) ? $this->ipsclass->lang['birth_users'] : $this->ipsclass->lang['birth_user'];\n\t\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->birthdays( $birthstring, $count, $lang );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$count = \"\";\n\t\t\t\t\t\n\t\t\t\t\tif ( ! $this->ipsclass->vars['autohide_bday'] )\n\t\t\t\t\t{\n\t\t\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->birthdays( $birthstring, $count, $lang );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Are we viewing the calendar?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ($this->ipsclass->vars['show_calendar'])\n\t\t{\n\t\t\t$this->ipsclass->vars['calendar_limit'] = intval($this->ipsclass->vars['calendar_limit']) < 2 ? 1 : intval($this->ipsclass->vars['calendar_limit']);\n\t\t\t\n\t\t\t$our_unix = gmmktime( 0, 0, 0, $month, $day, $year);\n\t\t\t$max_date = $our_unix + ($this->ipsclass->vars['calendar_limit'] * 86400);\n\t\t\t$events = array();\n\t\t\t$show_events = array();\n\t\t\t\n\t\t\tif( $this->ipsclass->member['org_perm_id'] )\n\t\t\t{\n\t\t\t\t$member_permission_groups = explode( \",\", $this->ipsclass->clean_perm_string( $this->ipsclass->member['org_perm_id'] ) );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$member_permission_groups = explode( \",\", $this->ipsclass->clean_perm_string( $this->ipsclass->member['g_perm_id'] ) );\n\t\t\t\t\n\t\t\t\tif( isset($this->ipsclass->member['mgroup_others']) AND $this->ipsclass->member['mgroup_others'] )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->member['mgroup_others'] = $this->ipsclass->clean_perm_string($this->ipsclass->member['mgroup_others']);\n\t\t\t\t\t\n\t\t\t\t\t$mgroup_others = explode( \",\", $this->ipsclass->member['mgroup_others'] );\n\t\t\t\t\t\n\t\t\t\t\tif( count($mgroup_others) )\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach( $mgroup_others as $mgroup )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif( $mgroup )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$member_permission_groups = array_merge( $member_permission_groups, explode( \",\", $this->ipsclass->clean_perm_string( $this->ipsclass->cache['group_cache'][$mgroup]['g_perm_id'] ) ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( is_array($this->ipsclass->cache['calendar']) AND count( $this->ipsclass->cache['calendar'] ) )\n\t\t\t{\n\t\t\t\tforeach( $this->ipsclass->cache['calendar'] as $u )\n\t\t\t\t{\n\t\t\t\t\t$set_offset = 0;\n\n\t\t\t\t\tif( $u['event_timeset'] && !($u['event_recurring'] == 0 AND $u['event_unix_to']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$set_offset = isset($this->ipsclass->member['time_offset']) ? $this->ipsclass->member['time_offset'] * 3600 : 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$u['_unix_from'] = $u['event_unix_from'] - $set_offset;\n\t\t\t\t\t$u['_unix_to'] = $u['event_unix_to'] - $set_offset;\n\t\t\t\t\t\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Private?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\n\t\t\t\t\tif ( $u['event_private'] == 1 and $this->ipsclass->member['id'] != $u['event_member_id'] )\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\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Got perms?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\n\t\t\t\t\tif ( $u['event_perms'] != \"*\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_perms = explode( \",\", $this->ipsclass->clean_perm_string( $u['event_perms'] ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$check = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( count($event_perms) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach( $event_perms as $mgroup_perm )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( in_array( $mgroup_perm, $member_permission_groups ) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$check = 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( !$check )\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\t\t\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Got calendar perms?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\n\t\t\t\t\tif ( $u['_perm_read'] != \"*\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$read_perms = explode( \",\", $this->ipsclass->clean_perm_string( $u['_perm_read'] ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$check = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( count($read_perms) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach( $read_perms as $mgroup_perm )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( in_array( $mgroup_perm, $member_permission_groups ) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$check = 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( !$check )\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\t\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// In range?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t\tif ( $u['event_recurring'] == 0 AND ( ( $u['event_unix_to'] >= $our_unix AND $u['event_unix_from'] <= $max_date )\n\t\t\t\t\t\tOR ( $u['event_unix_to'] == 0 AND $u['event_unix_from'] >= $our_unix AND $u['event_unix_from'] <= $max_date ) ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$u['event_activetime'] = $u['_unix_from'];\n\t\t\t\t\t\t$events[ str_pad( $u['event_unix_from'].$u['event_id'], 15, \"0\" ) ] = $u;\n\t\t\t\t\t}\n\t\t\t\t\telseif( $u['event_recurring'] > 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$cust_range_s = $u['event_unix_from'];\n\n\t\t\t\t\t\twhile( $cust_range_s < $u['event_unix_to'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif( $cust_range_s >= $our_unix AND $cust_range_s <= $max_date )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$u['event_activetime'] = $cust_range_s;\n\t\t\t\t\t\t\t\t$events[ str_pad( $cust_range_s.$u['event_id'], 15, \"0\" ) ] = $u;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif( $u['event_recurring'] == \"1\" )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cust_range_s += 604800;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif ( $u['event_recurring'] == \"2\" )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cust_range_s += 18144000;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cust_range_s += 31536000;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\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\t//-----------------------------------------\n\t\t\t// Print...\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tksort($events);\n\t\t\t\n\t\t\tforeach( $events as $event )\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Recurring?\n\t\t\t\t//-----------------------------------------\n\n\t\t\t\t$c_time = '';\n\t\t\t\t$c_time = gmdate( 'j-F-y', $event['event_activetime'] );\n\t\t\t\t\n\t\t\t\t$show_events[] = \"<a href='{$this->ipsclass->base_url}act=calendar&amp;code=showevent&amp;calendar_id={$event['event_calendar_id']}&amp;event_id={$event['event_id']}' title='$c_time'>\".$event['event_title'].\"</a>\";\n\t\t\t}\n\t\t\t\n\t\t\t$this->ipsclass->lang['calender_f_title'] = sprintf( $this->ipsclass->lang['calender_f_title'], $this->ipsclass->vars['calendar_limit'] );\n\t\t\t\n\t\t\tif ( count($show_events) > 0 )\n\t\t\t{\n\t\t\t\t$event_string = implode( $this->sep_char.' ', $show_events );\n\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->calendar_events( $event_string );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( ! $this->ipsclass->vars['autohide_calendar'] )\n\t\t\t\t{\n\t\t\t\t\t$event_string = $this->ipsclass->lang['no_calendar_events'];\n\t\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->calendar_events( $event_string );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\treturn $stats_html;\n\t\n\t}", "function main_content()\n{\n?>\n <h2>Events</h2>\n\n <div class=\"box\"><b>Where and When</b><br />\n Events take place in Room 86-01 of Portland State's \n <a href=\"http://www.fap.pdx.edu/floorplans/detail2.php?buildingID=12\">Fourth Avenue Building (FAB)</a>\n from 4:30pm to 5:30pm, unless circumstances dictate otherwise.</div>\n<?php\n\n// Are you looking for the events?\n/* To add the functionality the events section now enjoys, unfortunatly I\n * had to break the normal design style and add all the event handling to\n * the body.php script, with the actual events information stored in the \n * events_list.php script. \n * \n * events are stored in events_list.php for two reasons; so that the\n * sidebar can access them without accessing this page every time, and\n * so there is one file that is purely events information. In the future,\n * if we ever use a database to store events information, the \n * events_list.php script is the only script that would need to change.\n * \n * I would have gone with just using SQL, but it's easier to show new\n * people how to edit a text file than it is to create, maintain, and use\n * a secure form or other interface for SQL. Anyone can edit a text file,\n * but not everyone can use SQL.\n *\n * So why not call events_list.php from here and use this page to display\n * it? honestly I couldn't figure out how to. I tried and tried, but \n * aparently my understanding of php is not good enough to get it to work.\n * It seems to have something to do with how the main_content function is\n * actually run in body.php causing some scope issues. Anyways I suffered\n * enough trying to make it work that way. Give it a try if you feel like\n * it, I'm done struggling with it for now.\n *\n*/\n\n\n// Google calendar, which is now redundant.\n/*\n <!--<iframe src=\"https://www.google.com/calendar/embed?height=400&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=psuacm%40cs.pdx.edu&amp;color=%23B1440E&amp;ctz=America%2FLos_Angeles\" style=\" border-width:0 \" width=\"600\" height=\"400\" frameborder=\"0\" scrolling=\"no\"></iframe>\n\n <p>\n Sign up for the\n <a href=\"https://mailhost.cecs.pdx.edu/cgi-bin/mailman/listinfo/acm-members\">ACM Mailing List</a>\n to get messages about upcoming events.\n </p>-->\n*/\n}", "function render($events){\n\t\t// in the weekly event view\n\t\t$number_of_events=sizeof($events);\n\t\t$i=0;\n\t\t$return_val=\"\";\n\t\twhile($i<$number_of_events){\n\t\t\t$next_event=$events[$i];\n\t\t\t$return_val=$return_val.\"<a href=\\\"event_display_detail.php?event_id=\";\n\t\t\t$return_val=$return_val.($next_event->get_id());\n\t\t\t$return_val=$return_val.\"&amp;day=\".$next_event->get_start_day();\n\t\t\t$return_val.=\"&amp;month=\".$next_event->get_start_month();\n\t\t\t$return_val.=\"&amp;year=\".$next_event->get_start_year();\n\t\t\t$return_val.=\"\\\" class=\\\"eventTitle\\\">\";\n\t\t\t$return_val=$return_val.(htmlspecialchars($next_event->get_title()));\n\t\t\t$return_val=$return_val.\"</a><br />\";\n\n\t\t\t$start_time_obj=$next_event->get_start_time_object();\n\t\t\t$display_timerange=$start_time_obj->get_display_time();\n\t\t\tif ($next_event->get_duration()>0){\n\t\t\t\t$end_time_obj=$next_event->get_end_time_object();\n\t\t\t\t$display_timerange=$display_timerange.\" - \".$end_time_obj->get_display_time();\n\n\t\t\t}\n\n\t\t\t$return_val=$return_val.$display_timerange.\"<br />\";\n\t\t\tif (strlen(trim($next_event->get_event_type_name()))>0){\n\t\t\t\t$return_val=$return_val.htmlspecialchars($next_event->get_event_type_name()).\"<br />\";\n\t\t\t}\n\t\t\tif (strlen(trim($next_event->get_location_name()))>0){\n\t\t\t\t$return_val=$return_val.htmlspecialchars($next_event->get_location_name()).\"<br />\";\n\t\t\t}\n\t\t\t$return_val=$return_val.\"<br />\";\n\t\t\t$i=$i+1;\n\t\t}\n\t\tif (strlen($return_val)==0){\n\t\t\treturn \"&nbsp;\";\n\t\t}\n\t\treturn $return_val;\n\t}", "function obj_do_cx_events_list( $events ) {\n\tif (is_array($events) ) {\n echo '<div class=\"event-list-grid\">';\n foreach ($events as $event ) {\n obj_do_cx_event_item_output($event);\n }\n echo '</div>';\n }\n}", "public static function events();", "function getEvents($date = ''){\r\n\t//Include db configuration file\r\n\tinclude 'dbConfig.php';\r\n\t$eventListHTML = '';\r\n\t$date = $date?$date:date(\"Y-m-d\");\r\n\t//Get events based on the current date\r\n\t$result = $db->query(\"SELECT title FROM cakemaker WHERE date = '\".$date.\"' AND status = 1\");\r\n\tif($result->num_rows > 0){\r\n\t\t$eventListHTML = '<h2>Events on '.date(\"l, d M Y\",strtotime($date)).'</h2>';\r\n\t\t$eventListHTML .= '<ul>';\r\n\t\twhile($row = $result->fetch_assoc()){ \r\n $eventListHTML .= '<li>'.$row['title'].'</li>';\r\n }\r\n\t\t$eventListHTML .= '</ul>';\r\n\t}\r\n\techo $eventListHTML;\r\n}", "function obj_cx_events_list_inner( $events, $bottom_banner, $pagination, $event_list_deets = null ) {\n echo '<h3 class=\"section-title green\">Upcoming events</h3>';\n obj_do_cx_events_list_filter( $events );\n obj_do_cx_events_list( $events );\n obj_do_cx_event_bottom_banner_output( $bottom_banner );\n obj_do_cx_events_list_pagination( $pagination );\n}", "function printEvents($args = array()) {\n\t \t$echo = true;\n\t \t$before = $after = '';\n\n\t \t$template = get_option('fse_template');\n\t \t$showend = get_option('fse_show_enddate');\n\n\t \tif (isset($_GET['wpcal-page'])) {\n\t \t\t$args['page'] = intval($_GET['wpcal-page']);\n\t \t} else {\n\t \t\t$args['page'] = 1;\n\t \t}\n\t \t$pagination = get_option('fse_pagination');\n\n\t \tforeach($args as $k => $a) {\n\t \t\tswitch($k) {\n\t \t\t\tcase 'echo':\n\t \t\t\t\t$echo = ($a == true ? true : false);\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'before':\n\t \t\t\t\t$before = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'after':\n\t \t\t\t\t$after = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'template':\n\t \t\t\t\t$template = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'alwaysshowenddate':\n\t \t\t\t\t$showend = ($a == true ? true : false);\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'pagination':\n\t \t\t\t\t$pagination = ($a == true ? true : false); // Allow type cast using == instead of ===$\n\t \t\t\t\tbreak;\n\t \t\t}\n\t \t}\n\n\t \t$ret = '';\n\t \t$evt = $this->getEventsExternal($args);\n\n\t \tif ($pagination) {\n\t \t\t$args['count'] = true;\n\t \t\t$count = $this->getEventsExternal($args);\n\n\t \t\t// If no pagination is needed, disabled it\n\t \t\tif (count($evt) == $count) {\n\t \t\t\t$pagination = false;\n\t \t\t}\n\t \t}\n\n\t \tforeach($evt as $e) {\n\t \t\t$ret .= $this->filterContent($template, $e);\n\t \t}\n\n\t \t$pagstr = '';\n\t \tif ($pagination) {\n\t \t\t$pagstr = $this->getEventsPagination($count, $args);\n\t \t}\n\n\t \t$ret = $pagstr.$before.$ret.$after.$pagstr;\n\n\t \tif ($echo == true)\n\t \t\techo $ret;\n\t \telse\n\t \t\treturn $ret;\n\t }", "function showEventList($groupId, $title) {\n\t\n\t//read config file for this portlet\n\t$config = new ConfigReader();\n\t$config->loadConfigFile('assets/core/config/widgets/showGroup/event_list.properties');\n\t\n\t$maxDisplay = $config->readValue('maxDisplay');\n\t$showSummary = $config->readValue('displaySummary');\n\t$w = $config->readValue('maxImageSizeX');\n\t$h = $config->readValue('maxImageSizeY');\n\t\n\t//create user groups validation object\n\t$userGroup = new CategoryUserGroupValidator();\n\t$excludeCategories = $userGroup->viewCategoryExclusionList('events');\n\t\n\t$return .= \"\t\t\t\t<div id=\\\"event_list\\\">\\n\";\n\t$return .= \"\t\t\t\t\t<div class=\\\"header\\\">$title</div>\\n\";\n\t$return .= \"\t\t\t\t\t<div class=\\\"body\\\">\\n\";\n\t$return .= \"\t\t\t\t\t\t<div id=\\\"upcoming_events_container\\\">\\n\";\n\t\n\t$todaysDate = getdate();\n\t\n\t$month = $todaysDate['mon'];\n\t$day = $todaysDate['mday'];\n\t$year = $todaysDate['year'];\n\t\n\t$getDate = $todaysDate['year'] . \"-\" . $todaysDate['mon'] . \"-\" . $todaysDate['mday'] . \" 00:00:00\";\n\t\n\t$s = 0;\n\t\n\t$result = mysql_query(\"SELECT events.id FROM events LEFT JOIN groupsMembers ON events.groupId = groupsMembers.parentId WHERE events.groupId = '{$groupId}' AND events.startDate >= '{$getDate}' AND events.publishState = 'Published'$excludeCategories AND ((events.private = '1' AND groupsMembers.parentId = events.groupId AND groupsMembers.username = '{$_SESSION['username']}' AND groupsMembers.status = 'approved') OR (events.private = '0')) GROUP BY events.id\");\n\t$totalRows = mysql_num_rows($result);\n\t\n\t//if there's nothing to display, just exit (remove this test to display \"no events currently scheduled\" message)\n\tif ($totalRows == 0) {\n\t\t\n\t\treturn;\n\t\t\n\t}\n\t\n\t$showTotalPages = ceil($totalRows / $maxDisplay);\n\n\tif ($totalRows > 0) {\n\n\t\t$showCurrentPage = floor($s / $maxDisplay) + 1;\n\n\t} else {\n\n\t\t$showCurrentPage = 0;\n\n\t}\n\t\n\t$result = mysql_query(\"SELECT events.id, events.title, events.summary, events.summaryImage, DATE_FORMAT(startDate, '%M %d, %Y %h:%i %p') AS newStartDate, DATE_FORMAT(expireDate, '%M %d, %Y %h:%i %p') AS newExpireDate FROM events LEFT JOIN groupsMembers ON events.groupId = groupsMembers.parentId WHERE events.groupId = '{$groupId}' AND events.startDate >= '{$getDate}' AND events.publishState = 'Published'$excludeCategories AND ((events.private = '1' AND groupsMembers.parentId = events.groupId AND groupsMembers.username = '{$_SESSION['username']}' AND groupsMembers.status = 'approved') OR (events.private = '0')) GROUP BY events.id ORDER BY startDate ASC, title ASC LIMIT $maxDisplay\");\n\t$count = mysql_num_rows($result);\n\t\n\tif ($count > 0) {\n\t\t\n\t\twhile ($row = mysql_fetch_object($result)) {\n\t\t\t\n\t\t\t$x++;\n\t\t\t\n\t\t\tif ($x < $count) {\n\t\t\t\t\n\t\t\t\t$style = \" event_item_row_separator\";\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$style = \"\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$title = htmlentities($row->title);\n\t\t\t\n\t\t\tif (trim($row->summaryImage) != \"\") {\n\t\t\t\t\n\t\t\t\t$image = \"\t\t\t\t\t\t\t<div class=\\\"summary_image\\\">\\n<a href=\\\"/events/id/$row->id\\\"><img src=\\\"/file.php?load=$row->summaryImage&w=$w&h=$h\\\"></a></div>\\n\";\n\t\t\t\t$imageOffsetClass = \" image_offset\";\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$image = \"\";\n\t\t\t\t$imageOffsetClass = \"\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$return .= \"\t\t\t\t\t\t<div class=\\\"event_item$style\\\">\\n\";\n\t\t\t$return .= \"$image\";\n\t\t\t$return .= \"\t\t\t\t\t\t\t<div class=\\\"details_container$imageOffsetClass\\\">\\n\";\n\t\t\t$return .= \"\t\t\t\t\t\t\t\t<div class=\\\"title\\\"><a href=\\\"/events/id/$row->id\\\">$title</a></div>\\n\";\n\t\t\t$return .= \"\t\t\t\t\t\t\t\t<table border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\">\\n\";\n\t\t\t$return .= \"\t\t\t\t\t\t\t\t\t<tr><td class=\\\"start_date\\\">$row->newStartDate</td></tr><tr><td class=\\\"end_date\\\">$row->newExpireDate</td></tr>\\n\";\n\t\t\t$return .= \"\t\t\t\t\t\t\t\t</table>\\n\";\n\t\t\t\n\t\t\tif ($showSummary == \"true\") {\n\t\t\t\t\n\t\t\t\t$summary = preg_replace(\"/\\\\n/\", \"<br>\", htmlentities($row->summary));\n\t\t\t\t\t\n\t\t\t\t$return .= \"\t\t\t\t\t\t\t<div class=\\\"summary\\\">\\n\";\n\t\t\t\t$return .= \"\t\t\t\t\t\t\t\t$summary\\n\";\n\t\t\t\t$return .= \"\t\t\t\t\t\t\t</div>\\n\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$return .= \"\t\t\t\t\t\t\t</div>\\n\";\n\t\t\t$return .= \"\t\t\t\t\t\t</div>\\n\";\n\t\t\t\n\t\t}\n\t\t\n\t\t$return .= \"<div id=\\\"event_list_navigation\\\">\";\n\t\t$return .= \"\t<div class=\\\"totals\\\">$totalRows Events</div><div class=\\\"navigation\\\"><div class=\\\"pages\\\">Page: $showCurrentPage of $showTotalPages</div><div class=\\\"previous\\\"><a href=\\\"javascript:regenerateEventList('$s', 'b');\\\">Previous</a></div><div class=\\\"next\\\"><a href=\\\"javascript:regenerateEventList('$s', 'n');\\\">Next</a></div></div>\";\n\t\t$return .= \"</div>\";\n\t\t\n\t} else {\n\t\t\n\t\t$return .= \"\t\t\t\t\t\t\t<div class=\\\"event_item\\\">No events are currently scheduled.</div>\\n\";\n\t\t\n\t}\n\t\n\t$return .= \"\t\t\t\t\t\t</div>\\n\";\n\t$return .= \"\t\t\t\t\t</div>\\n\";\n\t$return .= \"\t\t\t\t</div>\\n\";\n\t\n\treturn($return);\n\t\n}", "public function viewAllEvents();", "function getEvents($date = '') {\r\n //Include db configuration file\r\n include 'dbConfig.php';\r\n $eventListHTML = '';\r\n $date = $date ? $date : date(\"Y-m-d\");\r\n //Get events based on the current date\r\n $result = $db->query(\"SELECT title FROM floralbookings WHERE date = '\" . $date . \"' AND status = 1\");\r\n if ($result->num_rows > 0) {\r\n $eventListHTML = '<h2>Events on ' . date(\"l, d M Y\", strtotime($date)) . '</h2>';\r\n $eventListHTML .= '<ul>';\r\n while ($row = $result->fetch_assoc()) {\r\n $eventListHTML .= '<li>' . $row['title'] . '</li>';\r\n }\r\n $eventListHTML .= '</ul>';\r\n }\r\n echo $eventListHTML;\r\n}", "public function indexAction() {\n\t\t$this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();\n\t\tif (!Engine_Api::_()->core()->hasSubject()) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\t\t// Get subject and check auth\n\t\t$subject = Engine_Api::_()->core()->getSubject('event');\n\t\tif (!$subject->authorization()->isAllowed($viewer, 'view')) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\n\t\t// Prepare data\n\t\t$this->view->event = $event = $subject;\n\t\t$limit =$this->_getParam('max',5);\n\t\t$currentDay = date('Y') . '-' . date('m') . '-' . date('d');\n\t\t\n\t\t$table = Engine_Api::_()->getItemTable('event');\n\t\t$select = $table->select()\n ->where('category_id = ?', $event->category_id)\n ->where('event_id != ?', $event->getIdentity())\n ->order(\"DATEDIFF('{$currentDay}', starttime) DESC\")\n ->limit($limit);\n\n\t\t$showedEvents = $table->fetchAll($select);\n\t\t$this->view->showedEvents = $showedEvents;\n\t\t// Hide if nothing to show\n\t\tif( count($showedEvents) <= 0 ) {\n\t return $this->setNoRender();\n\t }\n }", "function display() {\n\t\t$events = $this->events;\n\t\tif (!$events) return '';\n\t\t$olddate = '';\n\t\t$displaystring .= '<div class=\"gw-post\">';\n\n\t\tforeach($events as $event) {\n\t\t\t$start = $event['starttime'];\n\t\t\t// check for new dates\n\t\t\t$newdate = date('l, n/j/y', $start);\n\t\t\tif (strcmp($newdate, $olddate)) {\n\t\t\t\t// $newdate != $olddate\n\t\t\t\t$displaystring .= '<div class=\"gw-date-wrap\"><div class=\"gw-date\">' . $newdate . '</div></div>';\n\t\t\t\t$olddate = $newdate;\n\t\t\t}\n\t\t\tif ($event['isfeatured']) {\n\t\t\t $displaystring .= '<div class=\"gw-featured\">';\n\t\t\t}\n\t\t\tif ($event['post_link']) {\n\t\t\t $displaystring .= '<a href=\"'.$event['post_link'].'\">';\n\t\t\t}\n\t\t\t$displaystring .= '<div class=\"gw-event ' . $event['tag'] . '\">';\n\t\t\t$displaystring .= '<span class=\"gw-bullet\">&nbsp;</span><div class=\"gw-time\">' . date('g:i a', $start) . '</div>';\n\t\t\t$displaystring .= '<div class=\"gw-title\">' . $event['title'];\n\t\t\tif ($event['location']) {\n\t\t\t\t$displaystring .= ' @ ' . $event['location'] . $this->displayMap($event['address']);\n\t\t\t}\n\t\t\t$displaystring .= '</div>'; //close .gw-title\n\t\t\t$displaystring .= '</div>'; // close .gw-event \n\t\t\tif ($event['post_link']) {\n\t\t\t $displaystring .= '</a>';\n\t\t\t}\n\t\t\tif ($event['isfeatured']) {\n\t\t\t $displaystring .= '</div>';\n\t\t\t}\n\t\t\t\n\n\t\t} // end foreach\n\t\t\n\t\t$displaystring .= '</div>'; // close .textwidget\n\t\treturn $displaystring;\n\t}", "function displayLatestEvents()\n\t{\n\t\t$viewname = $this->getTheme();\n\n\t\t$cfg = JEVConfig::getInstance();\n\n\t\t// override global start now setting so that timelimit plugin can use it!\n\t\t$compparams = ComponentHelper::getParams(JEV_COM_COMPONENT);\n\t\t$startnow = $compparams->get(\"startnow\", 0);\n\t\t$compparams->set(\"startnow\", $this->modparams->get(\"startnow\", 0));\n\t\t$this->getLatestEventsData();\n\t\t$compparams->set(\"startnow\", $startnow);\n\n\t\t$content = \"\";\n\n\t\t$k = 0;\n\t\tif (isset($this->eventsByRelDay) && count($this->eventsByRelDay))\n\t\t{\n\t\t\t$content .= $this->getModuleHeader('<table class=\"mod_events_latest_table jevbootstrap\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">');\n\n\t\t\t// Now to display these events, we just start at the smallest index of the $this->eventsByRelDay array\n\t\t\t// and work our way up.\n\n\t\t\t$firstTime = true;\n\n\t\t\t// initialize name of com_jevents module and task defined to view\n\t\t\t// event detail. Note that these could change in future com_event\n\t\t\t// component revisions!! Note that the '$this->itemId' can be left out in\n\t\t\t// the link parameters for event details below since the event.php\n\t\t\t// component handler will fetch its own id from the db menu table\n\t\t\t// anyways as far as I understand it.\n\n\t\t\t$this->processFormatString();\n\n\t\t\tforeach ($this->eventsByRelDay as $relDay => $daysEvents)\n\t\t\t{\n\n\t\t\t\treset($daysEvents);\n\n\t\t\t\t// get all of the events for this day\n\t\t\t\tforeach ($daysEvents as $dayEvent)\n\t\t\t\t{\n\n\t\t\t\t\tif ($this->processTemplate($content, $dayEvent))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$eventcontent = \"\";\n\n\t\t\t\t\t// generate output according custom string\n\t\t\t\t\tforeach ($this->splitCustomFormat as $condtoken)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tif (isset($condtoken['cond']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($condtoken['cond'] == 'a' && !$dayEvent->alldayevent())\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == '!a' && $dayEvent->alldayevent())\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == 'e' && !($dayEvent->noendtime() || $dayEvent->alldayevent()))\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == '!e' && ($dayEvent->noendtime() || $dayEvent->alldayevent()))\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == '!m' && $dayEvent->getUnixStartDate() != $dayEvent->getUnixEndDate())\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\telse if ($condtoken['cond'] == 'm' && $dayEvent->getUnixStartDate() == $dayEvent->getUnixEndDate())\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach ($condtoken['data'] as $token)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($match);\n\t\t\t\t\t\t\tunset($dateParm);\n\t\t\t\t\t\t\t$dateParm = \"\";\n\t\t\t\t\t\t\t$match = '';\n\t\t\t\t\t\t\tif (is_array($token))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$match = $token['keyword'];\n\t\t\t\t\t\t\t\t$dateParm = isset($token['dateParm']) ? trim($token['dateParm']) : \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (strpos($token, '${') !== false)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$match = $token;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$eventcontent .= $token;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->processMatch($eventcontent, $match, $dayEvent, $dateParm, $relDay);\n\t\t\t\t\t\t} // end of foreach\n\t\t\t\t\t} // end of foreach\n\n\t\t\t\t\tif ($firstTime)\n\t\t\t\t\t\t$eventrow = '<tr class=\"jevrow' . $k . '\"><td class=\"mod_events_latest_first\">%s' . \"</td></tr>\\n\";\n\t\t\t\t\telse\n\t\t\t\t\t\t$eventrow = '<tr class=\"jevrow' . $k . '\"><td class=\"mod_events_latest\">%s' . \"</td></tr>\\n\";\n\n\t\t\t\t\t$templaterow = $this->modparams->get(\"modlatest_templaterow\") ? $this->modparams->get(\"modlatest_templaterow\") : $eventrow;\n\t\t\t\t\t$content .= str_replace(\"%s\", $eventcontent, $templaterow);\n\n\t\t\t\t\t$firstTime = false;\n\t\t\t\t} // end of foreach\n\t\t\t\t$k++;\n\t\t\t\t$k %= 2;\n\t\t\t} // end of foreach\n\t\t\t$content .= $this->getModuleFooter(\"</table>\\n\");\n\t\t}\n\t\telse if ($this->modparams->get(\"modlatest_NoEvents\", 1))\n\t\t{\n\t\t\t$content .= $this->modparams->get(\"modlatest_templatetop\") || $this->modparams->get(\"modlatest_templatetop\") ? $this->modparams->get(\"modlatest_templatetop\") : '<table class=\"mod_events_latest_table jevbootstrap\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">';\n\t\t\t$templaterow = $this->modparams->get(\"modlatest_templaterow\") ? $this->modparams->get(\"modlatest_templaterow\") : '<tr><td class=\"mod_events_latest_noevents\">%s</td></tr>' . \"\\n\";\n\t\t\t$content .= str_replace(\"%s\", Text::_('JEV_NO_EVENTS'), $templaterow);\n\t\t\t$content .= $this->modparams->get(\"modlatest_templatebottom\") ? $this->modparams->get(\"modlatest_templatebottom\") : \"</table>\\n\";\n\t\t}\n\n\t\t$callink_HTML = '<div class=\"mod_events_latest_callink\">'\n\t\t\t. $this->getCalendarLink()\n\t\t\t. '</div>';\n\n\t\tif ($this->linkToCal == 1)\n\t\t\t$content = $callink_HTML . $content;\n\t\tif ($this->linkToCal == 2)\n\t\t\t$content .= $callink_HTML;\n\n\t\tif ($this->displayRSS)\n\t\t{\n\t\t\t$rssimg = Uri::root() . \"media/system/images/livemarks.png\";\n\t\t\t$callink_HTML = '<div class=\"mod_events_latest_rsslink\">'\n\t\t\t\t. '<a href=\"' . $this->rsslink . '\" title=\"' . Text::_(\"RSS_FEED\") . '\" target=\"_blank\">'\n\t\t\t\t. '<img src=\"' . $rssimg . '\" alt=\"' . Text::_(\"RSS_FEED\") . '\" />'\n\t\t\t\t. Text::_(\"SUBSCRIBE_TO_RSS_FEED\")\n\t\t\t\t. '</a>'\n\t\t\t\t. '</div>';\n\t\t\t$content .= $callink_HTML;\n\t\t}\n\n\t\tif ($this->modparams->get(\"contentplugins\", 0))\n\t\t{\n\t\t\t$eventdata = new stdClass();\n\t\t\t$eventdata->text = $content;\n\t\t\tFactory::getApplication()->triggerEvent('onContentPrepare', array('com_jevents', &$eventdata, &$this->modparams, 0));\n\t\t\t$content = $eventdata->text;\n\t\t}\n\n\t\treturn $content;\n\n\t}", "function insert_events( $events ){\n\t// Informationen zu den Events holen\n\t$results = eventoni_fetch('',false,$events);\n\n\t// Falls keine Informationen zu Events gefunden, aus Methode rausspringen\n\tif( $results['total'] <= 0 )\n\t{\n\t\treturn;\n\t}\n\n\t// HTML Code erstellen\n\t$result = '';\n\t$result.= '<div class=\"events-container\">';\n\t$result.= '<img src=\"'.get_bloginfo('wpurl').'/wp-content/plugins/eventoni-events/img/logo.png\" />';\n\n\t// Jedes Event durchlaufen\n\tforeach($results['xml'] as $event)\n\t{\n\t\t// Berechnung der Zeitangabe und Tageszeit als Wort\n\t\t$datetime = strtotime($event->start_date.' '.$event->start_time);\n\t\t$hours = getdate($datetime);\n\t\t$hour = $hours['hours'];\n\t\t$tageszeit = '';\n\t\tif( $hour < 6 ){\n\t\t\t$tageszeit = 'nachts';\n\t\t} else if( $hour < 12 ){\n\t\t\t$tageszeit = 'morgens';\n\t\t} else if( $hour < 14 ){\n\t\t\t$tageszeit = 'mittags';\n\t\t} else if( $hour < 18 ){\n\t\t\t$tageszeit = 'nachmittags';\n\t\t} else if( $hour < 22 ){\n\t\t\t$tageszeit = 'abends';\n\t\t} else {\n\t\t\t$tageszeit = 'nachts';\n\t\t}\n\t\t$result.= ' <div class=\"event-item\">';\n\t\t$result.= '<a class=\"event-item-link\" href=\"'.$event->permalink.'\">';\n\n\t\t// Falls kein Vorschaubild vorhanden, nehme Standardbild\n\t\tif(isset($event->media_list->media->thumbnail_url)) {\n\t\t\t$result.= '<img width=\"60px\" height\"60px\" align=\"left\" src=\"'.$event->media_list->media->thumbnail_url.'\"/>';\n\t\t} else {\n\t\t\t$result.= '<img width=\"60px\" height\"60px\" align=\"left\" src=\"http://static.eventoni.com/images/image-blank.png\"/>';\n\t\t}\n\t\t$result.= '</a>';\n\t\t$result.= '\t <div class=\"event-item-content\">';\n\t\t$result.= '\t\t<div class=\"event-item-content-date\">'.date( \"d.m.Y\", $datetime ).', '.date( \"H:i \\U\\h\\\\r\", $datetime ).'</div>';\n\t\t$result.= '\t\t<div class=\"event-item-content-city\"><img src=\"'.get_bloginfo('wpurl').'/wp-content/plugins/eventoni-events/img/my_location.png\"/> '.$event->location->city.'</div>';\n\t\t$result.= '\t </div>';\n\t\t$result.= '\t <div class=\"event-item-content-name\"><b><a class=\"event-item-link\" href=\"'.$event->permalink.'\">'.$event->title.'</a></b></div>';\n\t\t$result.= '<div style=\"float:right\"><a class=\"facebook_link\" href=\"http://www.facebook.com/sharer.php?u='.$event->permalink.'&t=Dieses Event musst Du gesehen haben: \" target=\"_blank\"><img src=\"'.get_bloginfo('wpurl').'/wp-content/plugins/eventoni-events/img/facebook.png\" /></a></div>';\n\t\t$result.= '<div style=\"float:right\"><a class=\"twitter_link\" href=\"http://twitter.com/home?status=Dieses Event musst Du gesehen haben: '.$event->permalink.'\" target=\"_blank\"><img src=\"'.get_bloginfo('wpurl').'/wp-content/plugins/eventoni-events/img/twitter.png\" /></a></div>';\n\t\t$result.= ' </div>';\n\n\t}\n\t$result.= '</div>';\n\n\t// HTML code zurückgeben\n\treturn $result;\n}", "public function showEvent()\n {\n switch($this->logo){\n case 'default':\n $logo = '<img src=\"public/img/default/event.png\" alt=\"WorldEsport logo\">';\n break;\n default:\n $logo = '<img src=\"inc/img/imgempevents.php?imgname='. $this->logo .'&u='. $this->currentUser->pk_iduser .'\" alt=\"WorldEsport employee events logo\">';\n }\n\n //test de la presence de description ou non\n switch($this->description){\n case true:\n $description = '<div class=\"info-line collapse\" id=\"collapse'. substr(str_replace($this->unauthorizedChar,'',$this->name),0,15) . str_replace($this->unauthorizedChar,'',$this->startdate) .'\">\n <p class=\"info-decription\">' . $this->description . '</p>\n </div>';\n $btcollapse = '<div class=\"bt-more-container\">\n <button class=\"share-button bt\" data-toggle=\"collapse\" href=\"#collapse'. substr(str_replace($this->unauthorizedChar,'',$this->name),0,15) . str_replace($this->unauthorizedChar,'',$this->startdate) .'\">\n '. $this->langFile[$this->pageName]->bt_myprofile_gamer_moredetails .'\n </button>\n </div>';\n break;\n default:\n $description = '<div class=\"info-line collapse\">\n <p class=\"info-decription\">' . $this->description . '</p>\n </div>';\n $btcollapse = '';\n }\n\n $content = ' <div class=\"profile-elem profil-event-container col-md-12\" data-elem=\"'.$this->id.'\">\n <div class=\"profile-aside-container\">\n <div class=\"loader-container loader-elem-bloc loader-profile-elem\">\n <div class=\"loader-double-container\">\n <span class=\"loader loader-double\">\n </span>\n </div>\n </div>\n <div class=\"edit-container\">\n <div class=\"edit-ico-container\">\n <div class=\"edit-gear edit-profile-bloc-elem ico-gear\"></div> \n </div>\n <div class=\"edit-options\">\n \n </div>\n </div>\n <div class=\"profile-bloc-elem-left col-md-9\">\n <div class=\"infos-container col-md-12\">\n <div class=\"info-line\">\n <p class=\"info\">'. $this->name .'</p>\n </div>\n <div class=\"info-line\">\n <p class=\"info\">'. $this->jobtitle .' '. $this->langGenerals->word_at .' </p><p class=\"info\">'. $this->company .'</p>\n </div> \n <div class=\"info-line\">\n <p class=\"info\">' . $this->dayStart . ' ' . $this->monthStart . ' ' . $this->yearStart . ' - </p><p class=\"info\">' . $this->dayEnd . ' ' . $this->monthEnd . ' ' . $this->yearEnd . '</p>\n </div>\n '. $description .' \n </div> \n '. $btcollapse .' \n </div> \n <div class=\"profile-bloc-elem-right col-md-3\">\n <div class=\"pic\">\n '. $logo .'\n </div>\n </div>\n </div> \n </div>';\n\n return $content;\n }", "function render_list($events,$detail_flag){\n\t\t$number_of_events=sizeof($events);\n\t\t$i=0;\n\t\t$return_val=\"\";\n\n\t\t$return_val=$return_val.\"<table>\";\n\t\twhile($i<$number_of_events){\n\t\t\t$next_event=$events[$i];\n\n\t\t\t$return_val=$return_val.'<tr><td class=\"eventText\">';\n\n\t\t\tif ($detail_flag==\"off\") {\n\t\t\t\t$return_val=$return_val.\"<b>\";\n\t\t\t}\n\t\t\t$return_val=$return_val.\"(\".($i+1).\")&nbsp;&nbsp;\";\n\t\t\tif ($detail_flag==\"on\") {\n\t\t\t\t$return_val=$return_val.\"<a href=\\\"#\".($i+1).\"\\\">\";\n\t\t\t}\n\t\t\t$return_val=$return_val.(htmlspecialchars($next_event->get_title()));\n\t\t\tif ($detail_flag==\"off\") {\n\t\t\t\t$return_val=$return_val.\"</b>\";\n\t\t\t}\n\n\t\t\tif ($detail_flag==\"on\") {\n\t\t\t\t$return_val=$return_val.\"</a>\";\n\t\t\t}\n\n\t\t\t$return_val=$return_val.'<br />';\n\t\t\t$date=$next_event->get_start_date_object();\n\t\t\t$return_val=$return_val.date(\"D\", $date->timestamp).\"&nbsp;\";\n\t\t\t$return_val=$return_val.date(\"M\", $date->timestamp).\".&nbsp;\";\n\t\t\t$return_val=$return_val.$next_event->get_start_day().\",&nbsp;\";\n\n\t\t\t$start_time_obj=$next_event->get_start_time_object();\n\t\t\t$display_timerange=$start_time_obj->get_display_time();\n\t\t\tif ($next_event->get_duration()>0){\n\t\t\t\t$end_time_obj=$next_event->get_end_time_object();\n\t\t\t\t$display_timerange=$display_timerange.\" - \".$end_time_obj->get_display_time();\n\t\t\t}\n\n\t\t\t$return_val=$return_val.$display_timerange.\"&nbsp;-&nbsp;\";\n\t\t\tif (strlen(trim($next_event->get_location_name()))>0){\n\t\t\t\t$return_val=$return_val.htmlspecialchars($next_event->get_location_name()).\"&nbsp;\";\n\t\t\t}\n\n\t\t\t$return_val=$return_val.'<br />';\n\t\t\t$return_val=$return_val.'Event Topic:&nbsp;&nbsp;'.(htmlspecialchars($next_event->get_event_topic_name()));\n\n\t\t\t$return_val=$return_val.'<br />';\n\t\t\t$return_val=$return_val.'Event Type:&nbsp;&nbsp;'.(htmlspecialchars($next_event->get_event_type_name()));\n\n\t\t\t$return_val=$return_val.\"</td></tr>\";\n\t\t\t$i=$i+1;\n\t\t}\n\n\t\tif ($detail_flag==\"on\") {\n\n\t\t\tif ($number_of_events >0)\n\t\t\t\t$return_val=$return_val.\"<tr><td>---------------------------------------------------</td></tr>\";\n\t\t\t$i=0;\n\n\t\t\twhile($i<$number_of_events){\n\t\t\t\t$next_event=$events[$i];\n\n\t\t\t\t$return_val=$return_val.'<tr><td class=\"eventText\"><b>';\n\t\t\t\t$return_val=$return_val.'<a name=\"'.($i+1).'\"></a>';\n\t\t\t\t$return_val=$return_val.\"(\".($i+1).\")&nbsp;&nbsp;\";\n\t\t\t\t$return_val=$return_val.(htmlspecialchars($next_event->get_title()));\n\t\t\t\t$return_val=$return_val.\"</b></td></tr>\";\n\n\t\t\t\t$return_val=$return_val.'<tr><td class=\"eventText\">';\n\t\t\t\t$date=$next_event->get_start_date_object();\n\n\t\t\t\t$return_val=$return_val.date(\"D\", $date->timestamp).\"&nbsp;\";\n\t\t\t\t$return_val=$return_val.date(\"M\", $date->timestamp).\".&nbsp;\";\n\t\t\t\t$return_val=$return_val.$next_event->get_start_day().\",&nbsp;\";\n\n\t\t\t\t$start_time_obj=$next_event->get_start_time_object();\n\t\t\t\t$display_timerange=$start_time_obj->get_display_time();\n\t\t\t\tif ($next_event->get_duration()>0){\n\t\t\t\t\t$end_time_obj=$next_event->get_end_time_object();\n\t\t\t\t\t$display_timerange=$display_timerange.\" - \".$end_time_obj->get_display_time();\n\t\t\t\t}\n\n\t\t\t\t$return_val=$return_val.$display_timerange;\n\t\t\t\t$return_val=$return_val.'<br />';\n\n\t\t\t\tif (strlen(trim($next_event->get_location_name()))>0){\n\t\t\t\t$return_val=$return_val.htmlspecialchars($next_event->get_location_name()).\"&nbsp;\";\n\t\t\t\t}\n\n\t\t\t\t$return_val=$return_val.'<br />';\n\n\t\t\t\t$return_val=$return_val.(htmlspecialchars($next_event->get_location_details()));\n\t\t\t\t$return_val=$return_val.'</td></tr>';\n\n\t\t\t\t$return_val=$return_val.'<tr><td class=\"eventText\">';\n\t\t\t\t$return_val=$return_val.\"Contact:<br />\";\n\n\t\t\t\tif (strlen(trim($next_event->get_contact_name()))>0){\n\t\t\t\t\t$return_val=$return_val.htmlspecialchars($next_event->get_contact_name()).\"<br />\";\n\t\t\t\t}\n\t\t\t\tif (strlen(trim($next_event->get_contact_phone()))>0){\n\t\t\t\t\t$return_val=$return_val.htmlspecialchars($next_event->get_contact_phone()).\"<br />\";\n\t\t\t\t}\n\t\t\t\tif (strlen(trim($next_event->get_contact_email()))>0){\n\t\t\t\t\t$return_val=$return_val.htmlspecialchars($next_event->get_contact_email()).\"<br />\";\n\t\t\t\t}\n\n\t\t\t\t$return_val=$return_val.'</td><tr>';\n\n\t\t\t\t$return_val=$return_val.'<tr><td>&nbsp;</td></tr>';\n\n\t\t\t\t$return_val=$return_val.'<tr><td class=\"eventText\">';\n\t\t\t\t$return_val=$return_val.(nl2br($next_event->get_description()));\n\t\t\t\t$return_val=$return_val.'</td></tr>';\n\n\t\t\t\t$return_val=$return_val.\"<tr><td>&nbsp;</td></tr>\";\n\t\t\t\t$i=$i+1;\n\t\t\t}\n\t\t}\n\n\t\t$return_val=$return_val.'</table>';\n\n\t\tif (strlen($return_val)==0){\n\t\t\treturn \"&nbsp;\";\n\t\t}\n\t\treturn $return_val;\n\t}", "function wp_print_community_events_markup()\n {\n }", "public function actionEvents()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('events');\n\t}", "function listEventTitle($e_id) {\n\t\t$e_id = mysql_real_escape_string($e_id);\n\t\t$this->eid = $e_id;\n\t\t$query = \"SELECT e_title, v.name, start_datetime, end_datetime \n\t\tFROM yam14.F_event e, yam14.F_venue v \n\t\tWHERE e.venue_id = v.v_id\n\t\tAND e_id = $this->eid;\";\n\t\t\n\t\t$result = mysql_query($query);\n\t\tif (!$result) {\n\t\t\t$message='Invalid Query' .mysql_errno().\" \\n\";\n\t\t $message .= 'Whole Query' . $query;\n\t\t die($message);\n\t\t}//end if\n\t\t\n\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t\n\t\t\t$this->title = $row['e_title'];\n\t\t\t$this->venue = $row['name'];\n\t\t\t$this->startdate = date('l, M d, Y',strtotime($row['start_datetime']));\n\t\t\t$this->starttime = date('H:i A',strtotime($row['start_datetime']));\n\t\t\t$this->enddate = date('l, M d, Y',strtotime($row['end_datetime']));\n\t\t\t$this->endtime =date('H:i A',strtotime($row['end_datetime']));\n\t\t\t\n\t\t\techo \"<div>\";\n\t\t\techo \"<h3>$this->title</h3>\";\n\t\t\techo \"<h4>$this->venue</h4>\";\n\t\t\techo \"<h4>From $this->startdate $this->starttime </h4><h4>To $this->enddate $this->endtime </h4>\";\n\t\t\techo \"<hr />\";\n\t\t\techo \"</div>\";\n\t\t}\t\n\t\t\n\t\tmysql_free_result($result);\n\t\t\n\t}", "private function makeDayEventListHTML()\n\t{\n\t\t$showtext = \"\";\n\t\tforeach($this->eventItems as $item) {\n\t\t\tif($item['date'] == $this->curYear.'-'.$this->curMonth.'-'.$this->dayOfMonth) {\n\t\t\t\t$category = (strlen($item['cat']) > 0 ? 'Category: '.$item['cat'].' - ' : '');\n\t\t\t\t$outevents[$n]['category'] = $item['cat'];\n\t\t\t\t\n\t\t\t\tif($item['stdurl']) {\n\t\t\t\t\t$href = '<a href=\"'.$item['url'].'?id='.$item['id'].'\" title=\"'.$category.$item['desc'].'\">'.$item['text'].'</a>';\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'].'?id='.$item['id'];\n\t\t\t\t} else {\n\t\t\t\t\t$href = (strlen($item['url']) > 0 ? '<a href=\"'.$item['url'].'\" title=\"'.$category.$item['desc'].'\">'.$item['text'].'</a>' : $item['text']);\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$style = (strlen($item['catcolor']) > 0 ? ' style=\"background-color:#'.str_replace('#','',$item['catcolor']).';\" ' : ' style=\"background-color:#eeeeee;\" ');\n\t\t\t\t\n\t\t\t\t$showtext .= \"\\n\\t\\t\\t<div class=\\\"dayContent\\\"\".$style.\">\".$href.\"</div>\\n\\t\\t\";\n\t\t\t\t\n\t\t\t\t$outevents[$n]['summary'] = $item['text'];\n\t\t\t\t$outevents[$n]['description'] = $item['desc'];\n\t\t\t\t$outevents[$n]['categorycolor'] = (strlen($item['catcolor']) > 0 ? str_replace('#','',$item['catcolor']) : '#eeeeee');\n\t\t\t}\n\t\t\t$n++;\n\t\t}\n\t\treturn $showtext;\n\t}", "public function show(events $events)\n {\n //\n }", "public function getEvents();" ]
[ "0.7772302", "0.74917644", "0.7270854", "0.72544175", "0.71525925", "0.7111285", "0.71041787", "0.70760643", "0.700652", "0.6831481", "0.6783804", "0.671174", "0.66664046", "0.66620207", "0.6639366", "0.6624541", "0.66156113", "0.6591692", "0.6563447", "0.65535104", "0.65090454", "0.64896894", "0.64773154", "0.6425224", "0.6365839", "0.63007516", "0.6291708", "0.6285954", "0.627457", "0.62646776" ]
0.7623232
1
create html form for edit an existing platform and assign platform values to it
function editPlatformForm($id) { global $mysqli; $sql="SELECT * FROM platforms WHERE platformID=$id"; $result=$mysqli->query($sql)or die("query failed due to ".mysqli_error()); if($result->num_rows==0)//redirect if unknown id { logError("unkown platform id"); header("location:./platform.php"); exit(); } else {//load platform content to be edited $row=$result->fetch_assoc(); $name=$row['platformName']; $icon= $row['platformIcon']; $id=$row['platformID']; echo '<form action="./platform.php?action=update&id='.$id.'" method="post" enctype="multipart/form-data" id="editForm"> <label>Platform Name :</label><input type="text" name="name" value="'.$name.'" /><br /> <label>Platform Icon :</label><input type="file" value="upload" name="icon" /><br /> <input type="submit" name="submit" value="submit" /> </form>'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function form()\n {\n $form = new Form(new Platform());\n\n $form->text('platform_number', __('Platform number'))\n ->creationRules(['required', 'max:30', 'unique:platforms'])\n ->updateRules(['required', 'max:30']);\n $form->text('platform_name', __('Platform name'))\n ->creationRules(['required', 'max:30', 'unique:platforms'])\n ->updateRules(['required', 'max:30']);\n\n $form->footer(function ($footer){\n $footer->disableEditingCheck();\n });\n\n return $form;\n }", "protected function createComponentEditForm() {\r\n\t\t$form = new Form;\r\n\t\t$form->getElementPrototype()->class(\"formWide\");\r\n\t\t$options = array(0 => \"Default\", 1 => \"Odkaz na obsah\", 3 => \"Odkaz na položku menu\");\r\n\t\t// easy way how to create url slug\r\n\t\t$form->addText(\"title\", \"Název:\")\r\n\t\t\t\t->setAttribute('onchange', '\r\n\t\t\t\t\t\t\tvar nodiac = { \"á\": \"a\", \"č\": \"c\", \"ď\": \"d\", \"é\": \"e\", \"ě\": \"e\", \"í\": \"i\", \"ň\": \"n\", \"ó\": \"o\", \"ř\": \"r\", \"š\": \"s\", \"ť\": \"t\", \"ú\": \"u\", \"ů\": \"u\", \"ý\": \"y\", \"ž\": \"z\" };\r\n\t\t\t\t\t\t\ts = $(\"#frmeditForm-title\").val().toLowerCase();\r\n\t\t\t\t\t\t\tvar s2 = \"\";\r\n\t\t\t\t\t\t\tfor (var i=0; i < s.length; i++) {\r\n\t\t\t\t\t\t\t\ts2 += (typeof nodiac[s.charAt(i)] != \"undefined\" ? nodiac[s.charAt(i)] : s.charAt(i));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresult=s2.replace(/[^a-z0-9_]+/g, \"-\").replace(/^-|-$/g, \"\");\r\n\t\t\t\t\t\t\t$(\"#frmeditForm-url\").val(result);\r\n\t\t\t\t\t\t');\r\n\t\t$form->addText(\"url\", \"url:\")->setAttribute(\"readonly\", \"readonly\");\r\n\t\tif (!$this->onlyTree) {\r\n\t\t\t$form->addSelect(\"target_type\", \"Cíl:\", $options);\r\n\t\t\t$content = $this->prepareContentSelectBox();\r\n\t\t\t$menuContent = $this->prepareMenuContentSelectBox();\r\n\t\t\t$form->addSelect(\"target_id\", \"Odkazovaný obsah:\", $content)->setPrompt(\"Pouze při zvolení výše\");\r\n\t\t\t$form->addSelect(\"target_menu\", \"Odk. položka menu:\", $menuContent)->setPrompt(\"Pouze při zvolení výše\");\r\n\t\t}\r\n\t\t$form->addHidden(\"parent_id\", $this->parent_id);\r\n\t\t$form->addHidden(\"edit_id\", $this->edit_id);\r\n\t\t//filling form\r\n\t\tif ($this->edit_id or $this->edit_id === \"0\") {\r\n\t\t\t$defFromDb = $this->closureModel->getItemById($this->edit_id);\r\n\t\t\t$defaults = new \\Nette\\ArrayHash;\r\n\t\t\tforeach ($defFromDb as $key => $value) {\r\n\t\t\t\t$defaults->$key = $value;\r\n\t\t\t}\r\n\t\t\tif ($this->edit_id === \"0\") {\r\n\t\t\t\t$form[\"title\"]->setDisabled();\r\n\t\t\t}\r\n\t\t\tif (!$this->onlyTree) {\r\n\t\t\t\t$t = $defaults->target;\r\n\t\t\t\tif (!Validators::isNumericInt($t)) {\r\n\t\t\t\t\t$menuItem = $this->checkTargetMenuItemExists($t);\r\n\t\t\t\t\tif ($menuItem) {\r\n\t\t\t\t\t\t$defaults->target_type = 3;\r\n\t\t\t\t\t\t$defaults->target_menu = $menuItem;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$contentId = $this->checkTargetContentExists($t);\r\n\t\t\t\t\t\t$defaults->target_type = 1;\r\n\t\t\t\t\t\t$defaults->target_id = $contentId;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$form[\"target_menu\"]->getControlPrototype()->addClass(\"formFieldInvisible\");\r\n\t\t\t\t} elseif ($t <= 0) {\r\n\t\t\t\t\t$defaults->target_type = 0;\r\n\t\t\t\t\t$form[\"target_menu\"]->getControlPrototype()->addClass(\"formFieldInvisible\");\r\n\t\t\t\t\t$form[\"target_id\"]->getControlPrototype()->addClass(\"formFieldInvisible\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$defaults->target = null;\r\n\t\t\t$form->setDefaults($defaults);\r\n\t\t}\r\n\r\n\t\t$form->addSubmit('save', 'Save')\r\n\t\t\t\t\t\t->setAttribute('onclick', '$(\"#frmeditForm-title\").trigger(\"change\")')\r\n\t\t\t\t->onClick[] = callback($this, 'editFormSubmitted');\r\n\t\t$form->setRenderer(new \\Kdyby\\BootstrapFormRenderer\\BootstrapRenderer());\r\n\t\treturn $form;\r\n\t}", "function newPlatformForm()\n{\n echo '<form action=\"./platform.php?action=add\" method=\"post\" enctype=\"multipart/form-data\" id=\"editForm\">\n <label>Platform Name :</label><input type=\"text\" name=\"name\" /><br />\n <label>Platform Icon :</label><input type=\"file\" value=\"upload\" name=\"icon\" /><br />\n <input type=\"submit\" name=\"submit\" value=\"submit\" />\n </form>';\n}", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "function makeForm() {\n if($this->table_title != '' ) {\n $db_obj = new db_class();\n $desc_table = $db_obj->tableDescription($this->table_title);\n $db_obj->closeDB();\n \n// showArray($desc_table);\n echo '<form id=\"generic_edit_form\" method=\"POST\" >';\n echo '<input type=\"hidden\" name=\"title_input\" value=\"name\"> '; // THIS MUST BE HERE FOR CLONABLE FORMS!!!\n echo '<input type=\"hidden\" name=\"table\" value=\"vendors\">'; // THE TABLE MUST BE LABELED\n echo '<b>This is a generic input</b> <input type=\"text\" name=\"generic\">' . \"\\n\";\n \n echo '<br><br><input type=\"submit\" >';\n echo '</form>';\n } else {\n echo '<h2>hello, form<h2>';\n }\n }", "public function edit(Platform $platform)\n {\n return view('platforms.edit', ['platform' => $platform]);\n }", "public function display_edit_form(){\n echo \"<form action='../../Controllers/charity_controller.class.php?action=update' method='post'>\";\n echo \"<input type='hidden' name='id' value=\".$this->id.\" />\";\n echo \"Name: <input type='text' name='name' value=\".$this->name.\" /><br />\";\n echo \"Description: <textarea name='description'>\".$this->description.\"</textarea><br />\";\n echo \"<input type='submit' value='Update' />\";\n echo \"</form>\";\n }", "public function createComponentEditForm($val){\n\t\t$form = new \\Nette\\Application\\UI\\Form();\n\t\t$url = $this->link('pages:edit');\n\t\t$form->setAction($url);\n\t\t$form->addText('name', 'Název:')->setRequired('Zadejte název.')->setDefaultValue($val->name);\n\t\t$form->addText('title', 'Popis:')->setRequired('Zadejte popis.')->setDefaultValue($val->title);\n\t\t$form->addText('metadata', 'Klíčová slova:')->setRequired('Zadejte klíčová slova.')->setDefaultValue($val->metadata);\n\t\t$form->addText('rewrite', 'Adresa:')->setDefaultValue($val->rewrite);\n\t\t$form->addCheckbox('active', 'Aktivní')->setDefaultValue($val->active);\n\t\t$form->addText('order', 'Pořadí:')->setDefaultValue($val->order)->addRule(Form::NUMERIC, 'Musí být číslo.');\n\t\t$form->addHidden('id', $val->id);\n\t\t$form->addSubmit('submit', 'Vytvořit');\n\t\t$form->onSubmit[] = callback($this, 'editFormSubmitted');\n\t\treturn $form;\n\t}", "public function edit()\n\t{\n\t//mnot finished\n\t\techo '<div id=\"content\">';\n\t\t$this->par->load(\"form2\",\"fb\");\n\t\t$fb = $this->par->fb;\n\t\t$fb->_init(false,\" id=\\\"forms\\\"\",false,true);//autofill=false, validate = true\n\t\t\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'label' => 'Project Name:',\n\t\t\t\t'name' => 'name',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'User ID',\n\t\t\t\t'name' => 'userID',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'Start Month',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'name' => 'start_month',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'Start Day(e.g., 01)',\n\t\t\t\t'name' => 'start_day',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'Start Year',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'name' => 'start_year',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'End Month',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'name' => 'End_month',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'End Day(e.g., 01)',\n\t\t\t\t'name' => 'End_day',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'End Year',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'name' => 'End_year',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'Possible Domain:',\n\t\t\t\t'name' => 'domain'\n\t\t\t),array(\n\t\t\t\t'label' => 'Possible Host:',\n\t\t\t\t'name' => 'host'\n\t\t\t)\n\t\t);\n\t\t\n\t\t$fb->set_select(\"start_month\",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\t\t$year= date('Y');\n\t\t$fb->set_select(\"start_year\",array(($year-1)=>$year-1,($year)=>$year,($year+1)=>$year+1,($year+2)=>$year+2,($year+3)=>$year+3,($year+4)=>$year+4));\n\t\t$fb->set_select(\"End_month\",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\t\t$year= date('Y');\n\t\t$fb->set_select(\"End_year\",array(($year-1)=>$year-1,($year)=>$year,($year+1)=>$year+1,($year+2)=>$year+2,($year+3)=>$year+3,($year+4)=>$year+4));\n\t\t\n\t\t$fb->set_inputs($params);\n\t\tif($fb->error == TRUE)\n\t\t{\n\t\t\t$fb->display();\n\t\t}\n\t\telse\n\t\t{\t\n $inputs = $fb->get_inputs();\n var_dump($inputs);\n\t\t\t$this->par->DB->update_projects($inputs);\n\t\t\t$this->view();\n\t\t}\t\n\t\techo '</div>';\n\t}", "public function createComponentEditForm(){\n $frm = $this->formFactory->create();\n $listingID = $this->hlp->sess(\"listing\")->listingID;\n \n //query database for listing type\n $FE = $this->listings->isFE($listingID);\n $MS = $this->listings->isMultisig($listingID);\n \n //checkbox value rendering logic\n $checkVal = array();\n \n if ($MS){\n $checkVal[\"ms\"] = \"ms\";\n }\n \n if ($FE){\n $checkVal[\"fe\"] = \"fe\";\n }\n \n $this->lHelp->constructCheckboxList($frm)->setValue($checkVal);\n \n //discard option array\n unset($checkVal);\n\n $cnt = count ($this->postageOptions); \n $session = $this->hlp->sess(\"postage\");\n\n \n for ($i = 0; $i<$cnt; $i++){\n\n $frm->addText(\"postage\" . $i, \"Doprava\");\n $frm->addText(\"pprice\" . $i, \"Cena dopravy\");\n\n }\n \n //additional postage textboxes logic\n $counter = $session->counterEdit;\n $values = $session->values;\n \n if (!is_null($counter)){\n \n $frm->addGroup(\"Postage\");\n \n for ($i =0; $i<$counter; $i++){\n $frm->addText(\"postage\" .$i. \"X\", \"Doprava\"); \n $frm->addText(\"pprice\" .$i. \"X\", \"Cena\");\n }\n }\n \n $frm->addSubmit(\"submit\", \"Upravit\");\n $frm->addSubmit(\"add_postage\", \"Přidat dopravu\")->onClick[] = \n \n function() use($listingID) {\n \n //inline onlclick handler, that counts postage options\n $session = $this->hlp->sess(\"postage\");\n $counter = &$session->counterEdit;\n \n if ($counter <= self::MAX_POSTAGE_OPTIONS){\n $counter++;\n } else {\n $this->flashMessage(\"Dosáhli jste maxima poštovních možností.\");\n }\n \n $form = $this->getComponent(\"editForm\");\n $session->values = $form->getValues(TRUE);\n \n $this->redirect(\"Listings:editListing\", $listingID);\n };\n \n $this->lHelp->fillForm($frm, $values); \n $frm->onSuccess[] = array($this, 'editSuccess');\n $frm->onValidate[] = array($this, 'editValidate');\n \n return $frm; \n }", "public function edit()\n {\n $this->title = sprintf('%s: %s', _('Edit'), $this->obj->get('name'));\n unset($this->headerData);\n $this->attributes = array(\n array(),\n array(),\n );\n $this->templates = array(\n '${field}',\n '${input}',\n );\n $fields = array(\n _('LDAP Connection Name') => '<input class=\"smaller\" type=\"text\" '\n . sprintf(\n 'id=\"name\" name=\"name\" value=\"%s\"/>',\n (\n $_REQUEST['name'] ?\n $_REQUEST['name'] :\n $this->obj->get('name')\n )\n ),\n _('LDAP Server Description') => '<textarea name=\"description\">'\n . (\n $_REQUEST['description'] ?\n $_REQUEST['description'] :\n $this->obj->get('description')\n )\n . '</textarea>',\n _('LDAP Server Address') => '<input class=\"smaller\" type=\"text\" '\n . sprintf(\n 'id=\"address\" name=\"address\" value=\"%s\"/>',\n (\n $_REQUEST['address'] ?\n $_REQUEST['address'] :\n $this->obj->get('address')\n )\n ),\n _('LDAP Server Port') => '<select id=\"port\" name=\"port\">'\n . sprintf(\n '<option value=\"\">- %s -</option>',\n self::$foglang['PleaseSelect']\n )\n . sprintf(\n '<option value=\"389\"%s>389</option>',\n (\n $_REQUEST['port'] == 389 ?\n ' selected' :\n (\n $this->obj->get('port') == 389 ?\n ' selected' :\n ''\n )\n )\n )\n . sprintf(\n '<option value=\"636\"%s>636</option>',\n (\n $_REQUEST['port'] == 636 ?\n ' selected' :\n (\n $this->obj->get('port') == 636 ?\n ' selected' :\n ''\n )\n )\n )\n . '</select>',\n _('Use Group Matching (recommended)') => '<select id=\"useGroupMatch\" '\n . 'name=\"useGroupMatch\">'\n . sprintf(\n '<option value=\"0\"%s>%s</option>',\n (\n $_REQUEST['useGroupMatch'] < 1 ?\n ' selected' :\n (\n $this->obj->get('useGroupMatch') < 1 ?\n ' selected' :\n ''\n )\n ),\n _('No')\n )\n . sprintf(\n '<option value=\"1\"%s>%s</option>',\n (\n $_REQUEST['useGroupMatch'] > 0 ?\n ' selected' :\n (\n $this->obj->get('useGroupMatch') > 0 ?\n ' selected' :\n ''\n )\n ),\n _('Yes')\n )\n . '</select>',\n _('Search Base DN') => '<input class=\"smaller\" type=\"text\" '\n . sprintf(\n 'id=\"searchDN\" name=\"searchDN\" value=\"%s\"/>',\n (\n $_REQUEST['searchDN'] ?\n $_REQUEST['searchDN'] :\n $this->obj->get('searchDN')\n )\n ),\n _('Group Search DN') => '<input class=\"smaller\" type=\"text\" '\n . sprintf(\n 'id=\"grpSearchDN\" name=\"grpSearchDN\" value=\"%s\"/>',\n (\n $_REQUEST['grpSearchDN'] ?\n $_REQUEST['grpSearchDN'] :\n $this->obj->get('grpSearchDN')\n )\n ),\n _('Admin Group') => '<input class=\"smaller\" type=\"text\" '\n . sprintf(\n 'id=\"adminGroup\" name=\"adminGroup\" value=\"%s\"/>',\n (\n $_REQUEST['adminGroup'] ?\n $_REQUEST['adminGroup'] :\n $this->obj->get('adminGroup')\n )\n ),\n _('Mobile Group') => '<input class=\"smaller\" type=\"text\" '\n . sprintf(\n 'id=\"userGroup\" name=\"userGroup\" value=\"%s\"/>',\n (\n $_REQUEST['userGroup'] ?\n $_REQUEST['userGroup'] :\n $this->obj->get('userGroup')\n )\n ),\n _('Initial Template') => '<select class=\"smaller\" '\n . 'id=\"inittemplate\">'\n . '<option value=\"pick\" selected >Pick a template</option>'\n . '<option value=\"msad\">Microsoft AD</option>'\n . '<option value=\"open\">OpenLDAP</option>'\n . '<option value=\"edir\">Generic LDAP</option>'\n . '</select>',\n _('User Name Attribute') => '<input class=\"smaller\" type=\"text\" '\n . sprintf(\n 'id=\"userNamAttr\" name=\"userNamAttr\" value=\"%s\"/>',\n (\n $_REQUEST['userNamAttr'] ?\n $_REQUEST['userNamAttr'] :\n $this->obj->get('userNamAttr')\n )\n ),\n _('Group Member Attribute') => '<input class=\"smaller\" type=\"text\" '\n . sprintf(\n 'id=\"grpMemberAttr\" name=\"grpMemberAttr\" value=\"%s\"/>',\n (\n $_REQUEST['grpMemberAttr'] ?\n $_REQUEST['grpMemberAttr'] :\n $this->obj->get('grpMemberAttr')\n )\n ),\n _('Search Scope') => '<select id=\"searchScope\" name=\"searchScope\">'\n . sprintf(\n '<option value=\"\">- %s -</option>',\n self::$foglang['PleaseSelect']\n )\n . sprintf(\n '<option value=\"0\"%s>%s</option>',\n (\n isset($_REQUEST['searchScope'])\n && $_REQUEST['searchScope'] == 0 ?\n ' selected' :\n (\n $this->obj->get('searchScope') == 0 ?\n ' selected' :\n ''\n )\n ),\n _('Base only')\n )\n . sprintf(\n '<option value=\"1\"%s>%s</option>',\n (\n $_REQUEST['searchScope'] == 1 ?\n ' selected' :\n (\n $this->obj->get('searchScope') == 1 ?\n ' selected' :\n ''\n )\n ),\n _('Base and subtree')\n )\n . sprintf(\n '<option value=\"2\"%s>%s</option>',\n (\n $_REQUEST['searchScope'] == 2 ?\n ' selected' :\n (\n $this->obj->get('searchScope') == 2 ?\n ' selected' :\n ''\n )\n ),\n _('Subtree and below')\n )\n . '</select>',\n _('Bind DN') => '<input class=\"smaller\" type=\"text\" '\n . sprintf(\n 'id=\"bindDN\" name=\"bindDN\" value=\"%s\"/>',\n (\n $_REQUEST['bindDN'] ?\n $_REQUEST['bindDN'] :\n $this->obj->get('bindDN')\n )\n ),\n _('Bind Password') => '<input class=\"smaller\" type=\"password\" '\n . sprintf(\n 'id=\"bindPwd\" name=\"bindPwd\" value=\"%s\"/>',\n (\n $_REQUEST['bindPwd'] ?\n $_REQUEST['bindPwd'] :\n $this->obj->get('bindPwd')\n )\n ),\n '&nbsp;' => sprintf(\n '<input class=\"smaller\" name=\"update\" type=\"submit\" value=\"%s\"/>',\n _('Update')\n ),\n );\n foreach ((array)$fields as $field => &$input) {\n $this->data[] = array(\n 'field' => $field,\n 'input' => $input,\n );\n unset($input);\n }\n unset($fields);\n self::$HookManager->processEvent(\n 'LDAP_EDIT',\n array(\n 'headerData' => &$this->headerData,\n 'data' => &$this->data,\n 'templates' => &$this->templates,\n 'attributes' => &$this->attributes\n )\n );\n printf('<form method=\"post\" action=\"%s\">', $this->formAction);\n $this->render();\n echo '</form>';\n }", "public function add_edit_form(){\n\n $_id = $_GET['id']; \n $tblName = $this->get_tbl_name();\n\n $source = DB::table($tblName)->where('id',$_id)->get();\n\n $source_first = $source[0];\n\n // mhtml::dump($source_first);\n\n\n $struct = $this->struct;\n\n mhtml::startForm(\"edit\",\"backend_edit.php\");\n\n // loop througth fields\n foreach ($this->edit as $key => $field) {\n\n $kind = $struct[$field] ;\n if($kind == 'string') {$kind = 'text' ;} \n $value = $source_first[$field];\n\n mhtml::field($this->virtual_names[$field],$field,$kind,$value);\n\n }\n\n // add secret field for password\n if(isset($this->edit_secret)){\n if($this->edit_secret == true ){\n\n Logger::warn(\"we use one secret only on secret[0] in secret array in model\");\n $virtual_pass = $this->virtual_names[$this->secret[0]];\n mhtml::field($virtual_pass,$this->secret[0],'password');\n\n }\n }\n\n \n\n\n\n\n // mhtml::field('user name ','user_name','text',\"mohammed\");\n // mhtml::field('passwording','password','password');\n // mhtml::field('age','age','number');\n\n mhtml::field_id_model();\n\n mhtml::submitForm();\n\n mhtml::endForm();\n\n }", "public function form(){\n \t \tif($this->layoutWidgetInfo){\n \t\t$setting = json_decode($this->layoutWidgetInfo->setting, true);\n \t}\n\n \t//default option(type[text], cols[3-9], rows[1], label[$key], name[$key], value[$setting[$k]])\n \t//add option(class, id, stype, styleRow, required, placeholder, attr, [options, code])\n \t$settingForm = array(\n \t\t'layout_widget_id' \t=> array('type' => 'hidden', 'value' => $this->layoutWidgetInfo->layoutWidgetId),\n \t\t'widget_controller' => array('type' => 'hidden', 'value' => $this->widgetController),\n \t\t'header' \t=> array('type' => 'custom', 'value' => \"<h4 class='widget_header col-md-12'>{$this->widgetController}</h4>\", 'label' => ''),\n\n \t\t'title' => array(),\n \t\t'class'\t=> array(),\n 'bg_color'\t=> array('label' => 'Màu nền', 'class' => 'ColorPickerSliders',\n 'addElement' => '<a href=\"index.php?r=admin/help/view&helpId=4\" target=\"_blank\">Xem thêm</a>'),\n \t\t'category_id'\t=> array('type' => 'select_category', 'label' => 'Category', 'required' => true,\n \t\t\t\t'options' => CategoryExt::getCategoryList()),\n \t\t'style'\t=> array('type' => 'select', 'options' => $this->settingDefault['style']),\n \t\t'order_by' => array('type' => 'select', 'options' => $this->settingDefault['order_by']),\n \t\t'order_direction' => array('type' => 'select', 'options' => $this->settingDefault['order_direction']),\n \t);\n\n \t$settingAll = array(\n \t\t'cols' => '3-9'\n \t);\n\n \t//render setting from\n \tTemplateHelper::renderForm($settingForm, $setting, $settingAll);\n TemplateHelper::getTemplate('layout/_extra/add_setting.php', $setting);\n TemplateHelper::getTemplate('layout/_extra/color_picker.php');\n \t}", "public function form()\n {\n $this->switch('footer_remove', Support::trans('main.footer_remove'))\n ->default(admin_setting('footer_remove'));\n $defaultColors = [\n 'default' => '墨蓝',\n 'blue' => '蓝',\n 'blue-light' => '亮蓝',\n 'green' => '墨绿',\n ];\n foreach (explode(\",\", ServiceProvider::setting('additional_theme_colors')) as $value) {\n if (!empty($value)) {\n [$k, $v] = explode(\":\", $value);\n $defaultColors[$k] = $v;\n }\n }\n\n $this->radio('theme_color', Support::trans('main.theme_color'))\n ->options($defaultColors)\n ->default(admin_setting('theme_color'));\n $this->radio('sidebar_style', Support::trans('main.sidebar_style'))\n ->options([\n 'default' => '默认',\n 'sidebar-separate' => '菜单分离',\n 'horizontal_menu' => '水平菜单'\n ])\n ->default(admin_setting('sidebar_style'));\n $this->switch('grid_row_actions_right', Support::trans('main.grid_row_actions_right'))\n ->help('启用后表格行操作按钮将永远贴着最右侧。')\n ->default(admin_setting('grid_row_actions_right'));\n }", "private function buildGitHubWForm(&$form) {\n $git_settings = $this->configFactory->get('simple_git.settings');\n\n $form['git_hub'] = [\n '#type' => 'fieldset',\n '#title' => $this->t('GitHub Web settings'),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n ];\n\n $form['git_hub']['git_hub_app_id'] = [\n '#type' => 'textfield',\n '#title' => $this->t('GitHub App Web Id'),\n '#description' => $this->t('GitHub App Web Id value'),\n '#default_value' => $git_settings->get(\n ModuleConstantInterface::GIT_TYPE_GITHUB\n )['app_id'],\n ];\n\n $form['git_hub']['git_hub_app_secret'] = [\n '#type' => 'textfield',\n '#title' => $this->t('GitHub App Web Secret'),\n '#description' => $this->t('GitHub App Web Secret value'),\n '#default_value' => $git_settings->get(\n ModuleConstantInterface::GIT_TYPE_GITHUB\n )['app_secret'],\n ];\n\n $form['git_hub']['git_hub_app_url_redirect'] = [\n '#type' => 'textfield',\n '#title' => $this->t('GitHub URL Web Redirect'),\n '#description' => $this->t('GitHub URL Web Redirect value'),\n '#default_value' => $git_settings->get(\n ModuleConstantInterface::GIT_TYPE_GITHUB\n )['app_url_redirect'],\n ];\n\n $form['git_hub']['git_hub_app_name'] = [\n '#type' => 'textfield',\n '#title' => $this->t('GitHub App Web Name'),\n '#description' => $this->t('GitHub App Web Name'),\n '#default_value' => $git_settings->get(\n ModuleConstantInterface::GIT_TYPE_GITHUB\n )['app_name'],\n ];\n\n }", "function ccdev_hosting_form($form, &$form_state, $entity) {\n $form['site_name'] = array(\n '#type' => 'textfield',\n '#title' => t('Site Name'),\n '#required' => TRUE,\n '#default_value' => $entity->site_name,\n );\n $form['site_domain'] = array(\n '#type' => 'textfield',\n '#title' => t('Site Domain'),\n '#required' => TRUE,\n '#default_value' => $entity->site_domain,\n );\n $form['site_description'] = array(\n '#type' => 'textfield',\n '#title' => t('Description'),\n '#required' => FALSE,\n '#default_value' => $entity->site_description,\n );\n $form['site_cms'] = array(\n '#type' => 'textfield',\n '#title' => t('Site CMS'),\n '#required' => TRUE,\n '#default_value' => $entity->site_cms,\n );\n $form['group_price'] = array(\n '#type' => 'textfield',\n '#title' => t('Package'),\n '#required' => TRUE,\n '#default_value' => $entity->group_price,\n );\n\n $form['basic_entity'] = array(\n '#type' => 'value',\n '#value' => $entity,\n );\n field_attach_form('ccdev_hosting', $entity, $form, $form_state);\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Create Host'),\n '#weight' => 100,\n );\n\n return $form;\n}", "public function getEditForm();", "public function form()\n {\n\n $this->hidden('key', '字段名')->rules('required');\n $this->editor('val', '平台规则')->rules('required');\n }", "function display_machine_type_edit_form($user, $id=false) {\r\n if (!($id === false)) {\r\n try {\r\n $machineType = new MachineType($user->dbConn, $id);\r\n } catch (Exception $e) {\r\n $id = false;\r\n }\r\n }\r\n echo \"<form action='machine_type.php\".(($id === false) ? \"\" : \"?id=\".intval($id)).\"' method='POST' class='form-horizontal'>\r\n <fieldset>\r\n <div class='control-group'>\r\n <label class='control-label' for='machine_type[name]'>Name</label>\r\n <div class='controls'>\r\n <input name='machine_type[name]' type='text' class='input-xlarge' id='machine_type[name]'\".(($id === false) ? \"\" : \" value='\".escape_output($machineType->name).\"'\").\">\r\n </div>\r\n </div>\r\n <div class='control-group'>\r\n <label class='control-label' for='machine_type[description]'>Description</label>\r\n <div class='controls'>\r\n <input name='machine_type[description]' type='text' class='input-xlarge' id='machine_type[description]'\".(($id === false) ? \"\" : \" value='\".escape_output($machineType->description).\"'\").\">\r\n </div>\r\n </div>\r\n <div class='form-actions'>\r\n <button type='submit' class='btn btn-primary'>\".(($id === false) ? \"Add Machine Type\" : \"Save changes\").\"</button>\r\n <a href='#' onClick='window.location.replace(document.referrer);' class='btn'>\".(($id === false) ? \"Go back\" : \"Discard changes\").\"</a>\r\n </div>\r\n </fieldset>\\n</form>\\n\";\r\n}", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "protected function form($hasEdit=false)\n {\n $form = new Form(new Elevator);\n $pj=Project::where('status','>=',0);\n $city=getCity();$brand=getBrand();\n if($city!='*'){\n $pj->whereIn('city_id',$city);\n }\n if($brand!='*'){\n $pj->whereIn('brand',$brand);\n }\n $pj=$pj->get();\n $arr=Arr::pluck($pj, 'name','id');\n //var_dump($pj,$arr);\n $form->select('pid','项目')->options($arr)->required();\n $form->text('region','梯号');\n $form->divide();\n $form->hidden('did','DID');\n $form->hidden('did_old','DID');\n $form->hidden('status','status');\n if($hasEdit){\n $form->display('device','已选电梯设备')->with(function ($value) {\n $text=deviceName($value).' <a id=\"device\">点击修改</a>';\n$html=<<<HTML\n$text\n<script>\n$(function(){\n var device=$('#device').parents('.form-group');\n console.log(device);\n device.next().hide().next().hide().next().hide().next().hide();\n device.on('click',function(){\n $('select[name=\"q_brand_set\"]').trigger('change');\n device.next().show().next().show().next().show().next().show();\n })\n});\n</script>\nHTML;\n\n\n return $html;\n });\n }\n $dsArr=[];\n if($brand!='*'){\n foreach(Device::whereIn('brand',$brand)->groupBy('brand','brand_set')->get() as $d){\n $dsArr[$d->brand.'/'.$d->brand_set]=$d->brand.'/'.$d->brand_set;\n }\n }else{\n foreach(Device::groupBy('brand','brand_set')->get() as $d){\n $dsArr[$d->brand.'/'.$d->brand_set]=$d->brand.'/'.$d->brand_set;\n }\n }\n\n if($hasEdit){\n $form->select('q_brand_set','品牌系列')->options($dsArr)\n ->load('q_dload', '/admin/device/options/dload');\n\n $form->select('q_dload','载重')->load('q_speedup', '/admin/device/options/speedup');\n $form->select('q_speedup','速度')->load('layer_number', '/admin/device/options/floor');\n $form->select('layer_number','层站');\n }else{\n $form->select('q_brand_set','品牌系列')->options($dsArr)->required()\n ->load('q_dload', '/admin/device/options/dload');\n\n $form->select('q_dload','载重')->required()->load('q_speedup', '/admin/device/options/speedup');\n $form->select('q_speedup','速度')->required()->load('layer_number', '/admin/device/options/floor');\n $form->select('layer_number','层站')->required();\n }\n\n //$form->number('layer_number','层站')->min(1)->required()->default(2);\n $form->divide();\n\n $form->number('num','电梯数量')->min(1)->required();\n $form->number('height','提升高度(m)')->min(1)->required()->help('总爬升高度');\n //$form->number('layer_number','层数')->min(1)->required();\n $form->number('layer_number_site','站数')->min(1)->required();\n $form->number('layer_number_door','门数')->min(1)->required();\n $form->number('pit_depth','底坑深度(mm)');\n $form->number('top_height','顶层高度(mm)');\n\n $form->number('hall_width','厅门尺寸(mm)宽');\n $form->number('hall_height','厅门尺寸(mm)高');\n\n $form->number('car_width','轿厢尺寸(mm)宽');\n $form->number('car_height','轿厢尺寸(mm)高');\n $form->number('car_depth','轿厢尺寸(mm)深');\n\n $states = [\n 'on' => ['value' => 1, 'text' => '有', 'color' => 'success'],\n 'off' => ['value' => 0, 'text' => '没有', 'color' => 'danger'],\n ];\n $form->switch('has_through_door','是否有贯通门')->states($states);\n $form->text('desc','电梯说明');\n\n $form->divide();\n //$form->file('file_1','附件1');\n $form->largefile('file_1', '附件1');\n $form->html(function (){\n if($this->file_1){\n return '<a href=\"'.(str_replace('//dt.','//dtfile.',url($this->file_1))).'\" target=\"_blank\">附件1: '.$this->file_1.'</a>';\n }\n }, $label = '');\n $form->largefile('file_2','附件2');\n $form->html(function (){\n if($this->file_2){\n return '<a href=\"'.(str_replace('//dt.','//dtfile.',url($this->file_2))).'\" target=\"_blank\">附件2: '.$this->file_2.'</a>';\n }\n }, $label = '');\n $form->largefile('file_3','附件3');\n $form->html(function (){\n if($this->file_3){\n return '<a href=\"'.(str_replace('//dt.','//dtfile.',url($this->file_3))).'\" target=\"_blank\">附件3: '.$this->file_3.'</a>';\n }\n }, $label = '');\n\n //忽略字段\n //$form->ignore(['_brand']);\n $form->saving(function (Form $form){\n //$form->did=$form->did>0?$form->did:$form->model()->did;\n $form->did='';\n if($form->layer_number){\n list($form->q_brand_set,$form->q_dload,$form->q_speedup,$form->layer_number)=explode('@',$form->layer_number);\n if($form->q_brand_set && $form->q_dload && $form->q_speedup && $form->layer_number){\n $q_brand_set=explode('/',$form->q_brand_set);\n $query=[\n 'brand'=>array_shift($q_brand_set),\n 'brand_set'=>implode('/',$q_brand_set),\n 'dload'=>$form->q_dload,\n 'speedup'=>$form->q_speedup,\n 'floor'=>$form->layer_number,\n ];\n //DB::connection()->enableQueryLog();\n $did=Device::where($query)->value('id');\n //dd($did,DB::getQueryLog());\n //throw new Exception(DB::getQueryLog());\n if($did){\n $form->did=$did;\n }else{\n throw new Exception('未找到电梯设备,请核对电梯参数');\n }\n }else{\n throw new Exception('请完善电梯参数');\n }\n }else{\n $form->did=$form->model()->did;\n $form->q_brand_set=$form->model()->q_brand_set;\n $form->q_dload=$form->model()->q_dload;\n $form->q_speedup=$form->model()->q_speedup;\n $form->layer_number=$form->model()->layer_number;\n }\n if(!$form->did){\n throw new Exception('未找到电梯设备,请核对电梯参数');\n }\n $form->did_old=$form->did;\n if($form->model()->did){\n $form->did_old=$form->model()->did;\n }\n });\n $form->tools(function (Form\\Tools $tools) {\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n });\n return $form;\n }", "function theme_devshop_projects_create_settings_form($vars) {\n $form = $vars['form'];\n $rows = array();\n $header = array();\n foreach (element_children($form['environments']) as $env_name) {\n $row = array();\n $header['primary'] = 'Primary';\n $header['name'] = 'Name';\n $header['git_ref'] = t('Branch/Tag');\n\n $name_element = $form['environments'][$env_name]['name'];\n $git_ref_element = $form['environments'][$env_name]['git_ref'];\n $settings_element = $form['environments'][$env_name]['settings'];\n\n $primary_radio = $form['primary_environment'][$env_name];\n $primary_radio['#title'] = '';\n $primary_radio['#attributes']['class'][] = 'pull-right';\n \n $row[] = drupal_render($primary_radio);\n $row[] = drupal_render($name_element);\n $row[] = drupal_render($git_ref_element);\n\n foreach (element_children($settings_element) as $setting) {\n if (!isset($header[$setting])) {\n $header[$setting] = isset($form['environments'][$env_name]['settings'][$setting]['#title']) ? $form['environments'][$env_name]['settings'][$setting]['#title'] : '';\n }\n $form['environments'][$env_name]['settings'][$setting]['#title'] = '';\n\n $element = $form['environments'][$env_name]['settings'][$setting];\n $row[] = drupal_render($element);\n }\n $rows[] = $row;\n }\n $output = theme('table', array(\n 'header' => $header,\n 'rows' => $rows,\n 'attributes' => array(\n 'class' => array('table', 'project-environments-table'),\n )\n ));\n return $output;\n}", "private function buildGitLabWForm(&$form) {\n $git_settings = $this->configFactory->get('simple_git.settings');\n\n $form['git_lab'] = [\n '#type' => 'fieldset',\n '#title' => $this->t('GitLab Web settings'),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n ];\n\n $form['git_lab']['git_lab_app_id'] = [\n '#type' => 'textfield',\n '#title' => $this->t('GitLab App Web Id'),\n '#description' => $this->t('GitLab App Web Id value'),\n '#default_value' => $git_settings->get(\n ModuleConstantInterface::GIT_TYPE_GITLAB\n )['app_id'],\n ];\n\n $form['git_lab']['git_lab_app_secret'] = [\n '#type' => 'textfield',\n '#title' => $this->t('GitLab App Web Secret'),\n '#description' => $this->t('GitLab App Web Secret value'),\n '#default_value' => $git_settings->get(\n ModuleConstantInterface::GIT_TYPE_GITLAB\n )['app_secret'],\n ];\n\n $form['git_lab']['git_lab_app_url_redirect'] = [\n '#type' => 'textfield',\n '#title' => $this->t('GitLab URL Web Redirect'),\n '#description' => $this->t('GitLab URL Web Redirect value'),\n '#default_value' => $git_settings->get(\n ModuleConstantInterface::GIT_TYPE_GITLAB\n )['app_url_redirect'],\n ];\n\n }", "protected function form()\n {\n return Admin::form(PlatformFile::class, function (Form $form) {\n\n $form->display('id', 'ID');\n $form->multipleSelect('platform_ids', '主机')->options(Platform::all()->pluck('platform_name', 'id'))->attribute(['required'=>'required']);\n $form->multipleSelect('file_ids', '软件')->options(File::all()->pluck('name', 'id'))->attribute(['required'=>'required']);\n $form->text('upload_path', '上传路径');\n\n $form->display('created_at', 'Created At');\n $form->display('updated_at', 'Updated At');\n\n $form->setAction('/admin/platform-file-application');\n });\n }", "protected function _prepareForm()\n {\n $model = Mage::registry('maduranga_wall');\n\n $form = new Varien_Data_Form(array(\n 'id' => 'edit_form',\n 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),\n 'method' => 'post',\n 'enctype' => 'multipart/form-data'\n ));\n\n $fieldset = $form->addFieldset('base_fieldset', array(\n 'legend' => $this->__('Visualizer Background Information'),\n 'class' => 'fieldset-wide',\n ));\n\n if ($model->getId()) {\n $fieldset->addField('id', 'hidden', array(\n 'name' => 'id',\n ));\n }\n\n $fieldset->addField('name', 'text', array(\n 'name' => 'name',\n 'label' => $this->__('Name'),\n 'title' => $this->__('Name'),\n 'required' => true,\n ));\n\n $fieldset->addField('image', 'file', array(\n 'name' => 'image',\n 'label' => $this->__('Background Image'),\n 'title' => $this->__('Background Image'),\n 'required' => true,\n ));\n\n $fieldset->addField('status', 'select', array(\n 'label' => $this->__('Status'),\n 'name' => 'status',\n 'required' => true,\n 'values' => array(\n array(\n 'value' => 1,\n 'label' => $this->__('Enable'),\n ),\n\n array(\n 'value' => 0,\n 'label' => $this->__('Disable'),\n ),\n ),\n ));\n\n $form->setValues($model->getData());\n $form->setUseContainer(true);\n $this->setForm($form);\n\n return parent::_prepareForm();\n }", "function buildForm(){\n\t\t# menampilkan form\n\t}", "function do_form(){\n\t\tob_start();\n\t\t\n\t\t$op = ($this->id_base == $this->id)? __('Add', JCF_TEXTDOMAIN) : __('Edit', JCF_TEXTDOMAIN);\n\t\t?>\n\t\t<div class=\"jcf_edit_field\">\n\t\t\t<h3 class=\"header\"><?php echo $op . ' ' . $this->title; ?></h3>\n\t\t\t<div class=\"jcf_inner_content\">\n\t\t\t\t<form action=\"#\" method=\"post\" id=\"jcform_edit_field\">\n\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<input type=\"hidden\" name=\"field_id\" value=\"<?php echo $this->id; ?>\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"field_number\" value=\"<?php echo $this->number; ?>\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"field_id_base\" value=\"<?php echo $this->id_base; ?>\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"fieldset_id\" value=\"<?php echo $this->fieldset_id; ?>\" />\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->form( $this->instance );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// need to add slug field too\n\t\t\t\t\t\t\t$slug = esc_attr($this->slug);\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<label for=\"<?php echo $this->get_field_id('slug'); ?>\"><?php _e('Slug:', JCF_TEXTDOMAIN); ?></label>\n\t\t\t\t\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id('slug'); ?>\" name=\"<?php echo $this->get_field_name('slug'); ?>\" type=\"text\" value=\"<?php echo $slug; ?>\" />\n\t\t\t\t\t\t\t<br/><small><?php _e('Machine name, will be used for postmeta field name.', JCF_TEXTDOMAIN); ?></small>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t// enabled field\n\t\t\t\t\t\t\tif( $this->is_new ){\n\t\t\t\t\t\t\t\t$this->instance['enabled'] = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<label for=\"<?php echo $this->get_field_id('enabled'); ?>\">\n\t\t\t\t\t\t\t\t<input class=\"checkbox\" type=\"checkbox\" \n\t\t\t\t\t\t\t\t\t\tid=\"<?php echo $this->get_field_id('enabled'); ?>\"\n\t\t\t\t\t\t\t\t\t\tname=\"<?php echo $this->get_field_name('enabled'); ?>\"\n\t\t\t\t\t\t\t\t\t\tvalue=\"1\" <?php checked(true, @$this->instance['enabled']); ?> />\n\t\t\t\t\t\t\t\t<?php _e('Enabled', JCF_TEXTDOMAIN); ?></label>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"field-control-actions\">\n\t\t\t\t\t\t\t<div class=\"alignleft\">\n\t\t\t\t\t\t\t\t<?php if( $op != __('Add', JCF_TEXTDOMAIN) ) : ?>\n\t\t\t\t\t\t\t\t<a href=\"#remove\" class=\"field-control-remove\"><?php _e('Delete', JCF_TEXTDOMAIN); ?></a> |\n\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t<a href=\"#close\" class=\"field-control-close\"><?php _e('Close', JCF_TEXTDOMAIN); ?></a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"alignright\">\n\t\t\t\t\t\t\t\t<?php echo print_loader_img(); ?>\n\t\t\t\t\t\t\t\t<input type=\"submit\" value=\"<?php _e('Save', JCF_TEXTDOMAIN); ?>\" class=\"button-primary\" name=\"savefield\">\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<br class=\"clear\"/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</fieldset>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\t\t\n\t\t$html = ob_get_clean();\n\t\treturn $html;\n\t}", "protected function form()\n {\n $form = new Form(new $this->currentModel);\n \n $form->display('id', 'ID');\n $form->select('company_id', '公司名称')->options(Company::getSelectOptions());\n $form->text('project_name', '项目名称');\n $form->image('project_photo', '项目图片')->uniqueName()->move('public/photo/images/custom_thum/');\n $form->url('link_url', '项目链接');\n $form->radio('display', '公开度')->options(['0' => '公开', '-1'=> '保密'])->default('0');\n //$form->display('created_at', 'Created At');\n //$form->display('updated_at', 'Updated At');\n\n return $form;\n }", "public function formEnvironment()\n {\n\n // Todo\n // - add : define params : ports, id, dockerfile, passwords (+ check & error message -> ex : ports)\n // - edit (warning : volumes erased and add copy source if first delete then reconstruct => check commented \"formEnvironment\" method)\n\n if (\n //(!isset($_POST['webserverTrigger']) || empty($_POST['webserverTrigger'])) && // Todo : when webserver not embedded in php\n (!isset($_POST['phpTrigger']) || empty($_POST['phpTrigger'])) &&\n (!isset($_POST['mysqlTrigger']) || empty($_POST['mysqlTrigger'])) &&\n (!isset($_POST['sftp']) || empty($_POST['sftp']))\n ) {\n // Todo : proper error (display error flash ?!)\n exit ('no options choosen');\n }\n\n\n // Todo more params setable\n // Todo Errors\n // Todo Mails (params env.php)\n // Todo Facto\n // Todo : Warning session problem (db empty & exemple : no logout)\n // Todo : Warning ion_auth_users_groups delete cascade (+check all)\n\n\n // Load models\n $this->load->model('Environments_model');\n $this->load->model('Mysqlversions_model');\n $this->load->model('Phpversions_model');\n\n // Load helpers\n $this->load->helpers('Security_helper');\n\n // Load libs\n $this->load->library('zip');\n\n // User id\n $userId = $this->ion_auth->user()->row()->id;\n if (!isset($userId) || empty($userId)) {\n // Todo : proper error (display error flash ?!)\n exit ('no user id');\n }\n\n // 1. Instantiate environment\n $environment = new stdClass();\n\n // 2. Set userId\n $environment->{Environments_model::userId} = $userId;\n\n // 3. Set folder uniqId\n $phpUniqueId = uniqid();\n $environment->{Environments_model::folder} = $phpUniqueId;\n //Custom id management $environment->{Environments_model::folder} = (isset($_POST['customId']) && !empty($_POST['customId'])) ? strtolower(str_replace(' ', '_', trim($_POST['customId']))) : uniqid();\n\n // 4. Get $_POST params\n // Set name\n $environment->{Environments_model::name} = (isset($_POST['name']) && !empty($_POST['name'])) ? trim($_POST['name']) : $phpUniqueId;\n // Set webserver\n // Todo : $_POST['webserverTrigger']\n\n\n // Set php\n $environment->{Environments_model::phpVersionId} = (isset($_POST['phpTrigger']) && !empty($_POST['phpTrigger']) && isset($_POST['phpVersion']) && !empty($_POST['phpVersion']) && $_POST['phpVersion'] != \"--\" && $_POST['phpVersion'] != \"custom\") ? $_POST['phpVersion'] : null;\n if (isset($environment->{Environments_model::phpVersionId}) && !empty($environment->{Environments_model::phpVersionId})) {\n $environment->{Environments_model::phpPort} = (isset($_POST['phpPort']) && !empty($_POST['phpPort'])) ? /*$this->TODOchekAvailablePort($_POST['phpPort'])*/ $_POST['phpPort'] : $this->getAvailablePort();// Todo\n $environment->{Environments_model::phpSSLPort} = (isset($_POST['phpSSLPort']) && !empty($_POST['phpSSLPort'])) ? /*$this->TODOchekAvailablePort($_POST['phpSSLPort'])*/ $_POST['phpSSLPort'] : $this->getAvailablePort();// Todo\n // Todo : $environment->{Environments_model::phpDockerfile} = (isset($_POST['phpDockerfile']) && !empty($_POST['phpDockerfile'])) ? $_POST['phpDockerfile'] : null;\n }\n\n\t\tif (isset($environment->{Environments_model::phpVersionId}) && !empty($environment->{Environments_model::phpVersionId}) && $environment->{Environments_model::phpVersionId} == 1) {\n\t\t\t$environment->{Environments_model::webserver} = \"nginx\";\n\t\t} else {\n\t\t\t$environment->{Environments_model::webserver} = \"apache\";\n\t\t}\n\n // Set mysql\n $environment->{Environments_model::mysqlVersionId} = (isset($_POST['mysqlTrigger']) && !empty($_POST['mysqlTrigger']) && isset($_POST['mysqlVersion']) && !empty($_POST['mysqlVersion']) && $_POST['mysqlVersion'] != \"--\" && $_POST['mysqlVersion'] != \"custom\") ? $_POST['mysqlVersion'] : null;\n if (isset($environment->{Environments_model::mysqlVersionId}) && !empty($environment->{Environments_model::mysqlVersionId})) {\n $environment->{Environments_model::mysqlUser} = (isset($_POST['mysqlUser']) && !empty($_POST['mysqlUser'])) ? $_POST['mysqlUser'] : 'root';// Todo\n $environment->{Environments_model::mysqlPassword} = (isset($_POST['mysqlPassword']) && !empty($_POST['mysqlPassword'])) ? $_POST['mysqlPassword'] : randomPassword();// Todo\n $environment->{Environments_model::mysqlPort} = (isset($_POST['mysqlPort']) && !empty($_POST['mysqlPort'])) ? /*$this->TODOchekAvailablePort($_POST['mysqlPort'])*/ $_POST['mysqlPort'] : $this->getAvailablePort();// Todo\n // Todo : $environment->{Environments_model::mysqlDockerfile} = (isset($_POST['mysqlDockerfile']) && !empty($_POST['mysqlDockerfile'])) ? $_POST['mysqlDockerfile'] : null;\n }\n\n // Set phpmyadmin\n $environment->{Environments_model::hasPma} = (isset($_POST['mysqlTrigger']) && !empty($_POST['mysqlTrigger']) && isset($_POST['mysqlVersion']) && !empty($_POST['mysqlVersion']) && isset($_POST['pma']) && !empty($_POST['pma'])) ? true : false;\n if (isset($environment->{Environments_model::hasPma}) && !empty($environment->{Environments_model::hasPma})) {\n $environment->{Environments_model::pmaPort} = (isset($_POST['pmaPort']) && !empty($_POST['pmaPort'])) ? /*$this->TODOchekAvailablePort($_POST['pmaPort'])*/ $_POST['pmaPort'] : $this->getAvailablePort();// Todo\n }\n\n // Set sftp\n $environment->{Environments_model::hasSftp} = (isset($_POST['sftp']) && !empty($_POST['sftp'])) ? true : false;\n if (isset($environment->{Environments_model::hasSftp}) && !empty($environment->{Environments_model::hasSftp})) {\n //$environment->{Environments_model::sftpUser} = (isset($_POST['sftpUser']) && !empty($_POST['sftpUser'])) ? $_POST['sftpUser'] : $environment->{Environments_model::folder};// Todo\n $environment->{Environments_model::sftpUser} = strtolower(str_replace(' ', '_', trim($environment->{Environments_model::name})));\n $environment->{Environments_model::sftpPassword} = (isset($_POST['sftpPassword']) && !empty($_POST['sftpPassword'])) ? $_POST['sftpPassword'] : randomPassword();// Todo\n $environment->{Environments_model::sftpPort} = (isset($_POST['sftpPort']) && !empty($_POST['sftpPort'])) ? /*$this->TODOchekAvailablePort($_POST['sftpPort'])*/ $_POST['sftpPort'] : $this->getAvailablePort();// Todo\n }\n\n // Set xDebug\n if ($_POST['xDebugTrigger']) {\n $environment->{Environments_model::xDebugRemoteHost} = (isset($_POST['xDebugRemoteHost']) && !empty($_POST['xDebugRemoteHost'])) ? $_POST['xDebugRemoteHost'] : '0.0.0.0';\n }\n\n // 5. Generate docker compose\n $isProjectDockerFolderCreated = $this->generateProjectDockerFolder($environment);\n\n // Steps 6/7\n if ($isProjectDockerFolderCreated) {\n\n\t\t\t// 6. Check git\n\t\t\tif (isset($_POST['repositoryGit']) && !empty($_POST['repositoryGit'])) {\n\n\t\t\t\t$repositoryGit = $_POST['repositoryGit'];\n\n\t\t\t\t// 1a (optional). Check if repo has credentials (then add it in url)\n\t\t\t\tif (isset($_POST['gitCredentialsUsername']) && !empty($_POST['gitCredentialsUsername'])) {\n\n\t\t\t\t\tif (isset($_POST['gitCredentialsPass']) && !empty($_POST['gitCredentialsPass'])) {\n\n\t\t\t\t\t\t$tagOne = \"https://\";\n\t\t\t\t\t\t$tagTwo = \"@\";\n\n\t\t\t\t\t\t$repositoryGit = preg_replace('#('.preg_quote($tagOne).')(.*?)('.preg_quote($tagTwo).')#si', '$1'. $_POST['gitCredentialsUsername'] . ':' . $_POST['gitCredentialsPass'] .'$3', $repositoryGit);\n\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// todo error\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\ttry {\n\n\t\t\t\t\trequire(APPPATH . 'third_party/czproject/git-php/src/GitRepository.php');\n\n\t\t\t\t\t$folderName = strtolower(str_replace(' ', '_', trim($environment->{Environments_model::name})));\n\n\t\t\t\t\tunlink(ABSOLUTE_ENVS_FOLDER . \"/\" . $folderName . \"/src/index.php\");\n\t\t\t\t\t$dockerComposePath = ABSOLUTE_ENVS_FOLDER . \"/\" . $folderName . \"/src\";\n\n\t\t\t\t\t$repo = Cz\\Git\\GitRepository::cloneRepository($repositoryGit, $dockerComposePath);\n\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t// todo error\n\t\t\t\t\t//var_dump($e);\n\t\t\t\t}\n\n\n\t\t\t\t$environment->{Environments_model::repositoryGit} = $repositoryGit;\n\n\t\t\t}\n\n\t\t\t// 7. Add environment\n\t\t\t$environmentId = $this->Environments_model->insertEnvironment($environment);\n\n if (isset($environmentId) && $environmentId != -1) {\n\n // 7. Start docker compose\n $folderName = strtolower(str_replace(' ', '_', trim($environment->{Environments_model::name})));\n $dockerComposePath = INNER_ENVS_FOLDER . \"/\" . $folderName . \"/\";\n $this->startEnvironment($dockerComposePath);\n\n // Todo send admin mail ?!\n redirect('environments');\n\n } else {\n // Todo : proper error (display error flash ?!)\n exit('Error insert env add || update !');\n }\n } else {\n // Todo : proper error (display error flash ?!)\n exit('Error docker compose file !');\n }\n\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }" ]
[ "0.65197957", "0.6516744", "0.6510068", "0.6313426", "0.6255375", "0.6170459", "0.6157507", "0.6131804", "0.60929084", "0.60749304", "0.60099643", "0.59534705", "0.59241176", "0.5880785", "0.58767986", "0.58713436", "0.5847425", "0.5841499", "0.58395755", "0.58373535", "0.5834594", "0.5826645", "0.5823848", "0.58206177", "0.5806365", "0.58062696", "0.57710457", "0.57699656", "0.5767125", "0.57652795" ]
0.6697918
0
delete platfom from platforms table
function delPlatform($id) { global $mysqli; $sql="DELETE FROM platforms WHERE platformID=$id "; $mysqli->query($sql)or die("query failed due to ".mysqli_error()); logSuccess("platform deleted successfully"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteById($platformcodeId);", "abstract protected function platformDeleteStatement($table);", "public function deleteDatabaseStructure( );", "function lp_delete_table(){\r\n\tglobal $wpdb;\r\n\t$charset_collation = $wpdb->get_charset_collate();\r\n\t$table_name = $wpdb->prefix.'like_post';\r\n\r\n $sql = \"DROP TABLE IF EXISTS $table_name;\";\r\n $wpdb->query($sql);\r\n\r\n delete_option('lp_showing_year');\r\n}", "public function destroy(Platform $platform)\n {\n $platform->delete();\n\n return back();\n }", "function delete() {\n\t\t$sql = \"DELETE FROM \".$this->hr_db.\".hr_amphur\n\t\t\t\tWHERE amph_id=?\";\n\t\t$this->hr->query($sql, array($this->amph_id));\n\t}", "public function delete($perifericos);", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }", "public function delete(Physiotherapist $physiotherapist){\n $sql = $this->db->prepare(\"DELETE FROM hora_fisio where id=?\");\n $sql->execute(array($physiotherapist->getID()));\n }", "function delete() {\n\t\t$sqlStatements = array();\n\t\t$sqlStatements[] = \"DROP TABLE IF EXISTS tags\";\n\t\t$sqlStatements[] = \"DROP TABLE IF EXISTS siteViews\";\n\t\texecuteSqlStatements($sqlStatements);\n\t}", "function uninstall() {\nunsubscribeFromEvent($this->name, 'HOURLY');\nSQLExec('DROP TABLE IF EXISTS camshoter_devices');\nSQLExec('DROP TABLE IF EXISTS camshoter_config');\nSQLExec('DROP TABLE IF EXISTS camshoter_recognize');\nSQLExec('DROP TABLE IF EXISTS camshoter_people');\n\n\n parent::uninstall();\n\n }", "public function delete(Platform $platform)\n {\n if ($platform->delete()) {\n return true;\n }\n\n throw new GeneralException(trans('exceptions.backend.platforms.delete_error'));\n }", "public function destroy(tbl_project $tbl_project)\n {\n //\n }", "function removeSwitchTrigger($dserial) {\n\t$query = sprintf(\"DELETE FROM SwitchTriggers WHERE switchserial=%s\",\n\t\tmysql_real_escape_string($dserial)\n\t);\n\t\n\tdb_query($query);\n}", "static function uninstall()\n\t{\n\t\tglobal $wpdb;\n\n\t\tdelete_option( 'jumplead_version' );\n\t\tdelete_option( 'jumplead_tracker_id' );\n\t\tdelete_option( 'jumplead_capture_comments' );\n\n\t\t// @codingStandardsIgnoreStart\n\t\t$wpdb->query( 'DROP TABLE IF EXISTS ' . self::$tableFieldMapping );\n\t\t// @codingStandardsIgnoreEnd\n\t}", "function uninstall() {\n $rec = SQLSELECT('Select distinct LINKED_OBJECT,LINKED_PROPERTY from myconditions');\n $total = count($rec);\n if ($total) {\n for($i=0;$i<$total;$i++) {\n removeLinkedProperty($rec[$i]['LINKED_OBJECT'], $rec[$i]['LINKED_PROPERTY'], 'myrules');\n }\n }\n SQLExec('DROP TABLE IF EXISTS myrules');\n SQLExec('DROP TABLE IF EXISTS myconditions');\n SQLExec('DROP TABLE IF EXISTS myactions');\n\n parent::uninstall();\n }", "function base_clear(){\n $tables = array(\n 'oc_product',\n 'oc_product_image',\n 'oc_manufacturer',\n 'oc_manufacturer_description',\n 'oc_product_description',\n 'oc_product_to_category',\n 'oc_product_attribute',\n 'oc_attribute',\n 'oc_attribute_description',\n // 'oc_attribute_value',\n // 'oc_category',\n // 'oc_category_description',\n 'oc_product_to_store',\n // 'oc_category_to_store',\n 'oc_manufacturer_to_store',\n 'oc_product_to_layout',\n // 'oc_category_to_layout',\n );\n foreach ($tables as $table)\n {\n sDb::query(\"TRUNCATE TABLE $table\");\n echo \"Таблица $table очищена\\n\";\n }\n}", "function free_thewiki_table($id){\n\t\tglobal $wpdb;\n\t\t$table = $wpdb->prefix.'wiki';\n\t\t$wpdb->query(\"DELETE FROM $table WHERE `post_id`=$id \");\n\t\t\n\t}", "public function uninstall()\n\t{\n\t\t$this->db->query(\"\n\t\t\tDROP TABLE \".Kohana::config('database.default.table_prefix').\"sharing_site;\n\t\t\t\");\n\t\t$this->db->query(\"\n\t\t\tDROP TABLE \".Kohana::config('database.default.table_prefix').\"sharing_incident;\n\t\t\t\");\n\n\t}", "function delBuildingHandler() {\n global $inputs;\n $sql = \"DELETE FROM building WHERE id = \" . $inputs['id'];\n execSql($sql);\n formatOutput(true, 'delete success');\n}", "function deletePartition() {\n\n global $connection_production;\n\n if (isset($_POST['delete_league'])) {\n\n echo 'working';\n }\n }", "public function delete($machucdanh){\n\t\tglobal $db;\n\t\tmysqli_query($db,\"delete from chucdanh where machucdanh=$machucdanh; \");\n\t}", "function DeletePlaces($idGame)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"DELETE FROM fishermenland.place WHERE fkGamePlace = '$idGame'\");\n}", "public function clean(){\n\t\t$sql = 'DELETE FROM compra_coletiva';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function uninstall()\r\n\t{\r\n\t\t// ini untuk menghapus tabel beserta semua datanya\r\n\t\t// hati-hati, sebaiknya gunakan ini hanya dalam proses development\r\n\t\t// setelah semua modul dipasang online, komentari semua baris kode hapus tabel ini -\r\n\t\t// dan biarkan user menghapus tabel secara manual\r\n\t\t$this->dbforge->drop_table('ipro_jobs');\r\n\t\t$this->dbforge->drop_table('ipro_job_category');\r\n\t\t$this->dbforge->drop_table('ipro_skill');\r\n\t\t$this->dbforge->drop_table('ipro_budget');\r\n\t\t$this->dbforge->drop_table('ipro_language');\r\n\t\t$this->dbforge->drop_table('ipro_jobs_language');\r\n\t\t$this->dbforge->drop_table('ipro_jobs_skill');\r\n\r\n\t\treturn true;\r\n\t}", "protected function deletePatch() {\n\t\t$sql = \"DELETE FROM\t\twcf\".WCF_N.\"_\".$this->type.\"template_patch \n\t\t\tWHERE\t\t\tpackageID = \".$this->packageID;\n\t\tWCF::getDB()->sendQuery($sql);\n\t}", "function deleteTeamFromPartition() {\n global $connection_production;\n if (isset($_POST['delete_team_partition'])) {\n $post_partition_id_set = $_POST['partition_id_set'];\n $team_id = $_POST['team_id'];\n $p_f_sm_id = $_POST['p_f_sm_id'];\n\n $sql_delete_p_f_sm_id = \"DELETE FROM partition_franchise_sm WHERE id=?\";\n\n $stmt_delete_p_f_sm_id = $connection_production->prepare($sql_delete_p_f_sm_id);\n $stmt_delete_p_f_sm_id->bind_param(\"i\", $p_f_sm_id);\n $stmt_delete_p_f_sm_id->execute();\n $last_delete_p_f_sm_id = $connection_production->insert_id;\n $stmt_delete_p_f_sm_id->close();\n\n $update_string = 'partition: '.$post_partition_id_set.' deleted team parition association id: '.$p_f_sm_id.', removed team id: '.$team_id;\n insertChange($_SESSION['account_id'], 'partition', 'delete team', $post_partition_id_set, $update_string);\n header(\"location: categories.php?source=update_partition&partition_id=\".$post_partition_id_set.\"#partition_teams\");\n }\n }", "public function uninstall() {\r\n\tforeach ($this->getModel() AS $model) {\r\n\t $this->getEntity($model->getName())->deleteTable();\r\n\t}\r\n }", "public function deleteSystemType()\r\n{\r\n $query_string = \"DELETE FROM system_type \";\r\n $query_string .= \"WHERE systemtypeid = :systemtypeid \";\r\n\r\n return $query_string;\r\n}", "function remove() {\n $keys = \"\";\n $keys_array = $this->keys();\n for ($i = 0; $i < sizeof($keys_array); $i ++) {\n $keys .= \"'\" . $keys_array[$i] . \"',\";\n }\n $keys = substr($keys, 0, - 1);\n \n if (MODULE_PAYMENT_CGP_DROP_TABLE === 'True') {\n tep_db_query(\"DROP TABLE IF EXISTS `CGP_orders_table`\");\n }\n \n tep_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key IN (\" . $keys . \")\");\n }" ]
[ "0.6479251", "0.60560787", "0.58929604", "0.57621294", "0.5667425", "0.56584334", "0.5554934", "0.5511369", "0.5505877", "0.54978275", "0.54888195", "0.54655534", "0.5438904", "0.5415529", "0.5412757", "0.5387609", "0.53848165", "0.5369056", "0.53464377", "0.53305924", "0.53228503", "0.5306113", "0.53017217", "0.5297692", "0.5296975", "0.5293103", "0.5291621", "0.5282845", "0.52809757", "0.52749276" ]
0.70832175
0
Solidifies the temporary password into the permenant password
public function ConvertTemporaryPassword() { if ( ($this->TempPassword) && ($this->TempPasswordSalt) ) { $this->Password = $this->TempPassword; $this->PasswordSalt = $this->TempPasswordSalt; $this->TempPassword = null; $this->TempPasswordSalt = null; $this->write(); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function temp_pass(){\n\treturn 'password199';\n}", "public function initPassword() {\n\t\t$this->salt = mt_rand();\n\t\t$clearPassword = mt_rand();\n\t\t$this->password = sha1($this->salt . $clearPassword);\n\t\treturn $clearPassword;\t\n\t}", "function saltPassword($tempPassword)\n{\n\t$salt1 = \"qm\\$h*\";\n\t$salt2 = \"pg!@\";\n\t$token = hash('ripemd128', \"$salt1$tempPassword$salt2\");\n\treturn $token;\n}", "function userSetTemporaryPassword($email) {\n\tqbLogin();\n\tglobal $qb;\n\tglobal $temp_password;\n\t$response = $qb->DoQuery(C_DBID_USERS, \"{'\".C_FID_USER_EMAIL.\"'.EX.'\".$email.\"'}\", 'a');\n\tif (isset($response[0]['3'])) {\n\t\t// Generate and encrypt a temporary password\n\t\t//$temp_password = random_string(10);\n\t\t$temp_password = random_str(10);\n\t\t//$temp_password = substr(bin2hex(openssl_random_pseudo_bytes(128)),0,10);\n\t\t$enc_temp_password = encrypt($temp_password);\n\t\t$fields = array(\n\t\t\tarray(\n\t\t\t\t'fid' => C_FID_USER_TEMPORARY_PASSWORD,\n\t\t\t\t'value' => $enc_temp_password\n\t\t\t)\n\t\t);\n\t\t$qb->EditRecord(C_DBID_USERS, $response[0]['3'], $fields); // Save the temporary password in QuickBase\n\t\tsendMail($email, null, 'forgot', $temp_password); // Send the user their temporary password\n\t}\n}", "public function necesitaCambiarPassword();", "function send_tempPass($email){\n\n\n $temp_pass = generate_temp_pass();\n $insert_to_db_pass = md5($temp_pass);\n $username = $_SESSION['username'];\n $email = htmlspecialchars($email);\n \n change_to_temp($insert_to_db_pass,$_SESSION['email'],$username);\n $to = $_SESSION['email'];\n\n $subject = \"Temporary Password\";\n\n //message to the user!\n $message = \"\n <html>\n <body style='background: #3B653D;'>\n <div>\n <h1 style = 'color:#ffffff; font-size:32px; text-align: center;'> Here is your account temporary password info $email !<br></h1>\n \n <span style = 'color:#ffffff;' font-size:20px;'> Temporary Password: $temp_pass </span><br>\n <span><a style = 'color:#ffffff;' href =http://farvlu.farmingdale.edu/~foxrc/BCS350_Project/change_password_link.php> Click here to change password </a> </span>\n \n </div>\n </body>\n </html>\";\n $headers = \"MIME-Version: 1.0\" . PHP_EOL;\n $headers .= \"Content-type:text/html;charset=UTF-8\" . PHP_EOL;\n $headers .= \"From: [email protected]\". PHP_EOL;\n mail($to,$subject,$message,$headers);\n\n}", "public function CreatePassword($plain) {\n $tmppassw = md5(\"De e la bara so himla fint va?\".$plain);\n\t$tmppassw = substr($tmppassw,6).substr($tmppassw,0,5);\n\treturn md5($plain);\n }", "public static function renderPassword();", "function password_recovery()\n\t{\n\n\n\t}", "private function generate_pass()\n {\n echo password_hash('admin', PASSWORD_BCRYPT);\n }", "public function getSecuredPassword();", "function enforce_temporary_passwords($member)\n{\n if ((get_forum_type() == 'cns') && (running_script('index')) && ($member != db_get_first_id()) && (!$GLOBALS['IS_ACTUALLY_ADMIN']) && ($GLOBALS['FORUM_DRIVER']->get_member_row_field($member, 'm_password_compat_scheme') == 'temporary') && (get_page_name() != 'lost_password') && ((get_page_name() != 'members') || (get_param_string('type', 'browse') != 'view'))) {\n require_code('users_active_actions');\n _enforce_temporary_passwords($member);\n }\n}", "function getPassword(){\n $options = sciploreDataAccessBundle::getGeneralOptions();\n //$options = $container->get('sciplore.options')->getGeneralOptions();\n $require_password = $options['authentifiaction_requires_password']; \n if($require_password==1){\n return $this->passphrase;\n }\n else{\n //hardcoded random default password. Must be sent by the authentification form in a hidden field.\n return 'WnDadvfhWqoJnHuXtyxwZxGbfHsXrNwI3Idns4d2Ie9BnEjYnr14ijyCr0YPg7i';\n }\n }", "public function encryptPass()\n {\n return \"RASAHolaRSSA\";\n }", "public function olvidoPassword(){\n\t}", "function generatePassword() {\n // 57 prefixes\n $aPrefix = array('aero', 'anti', 'ante', 'ande', 'auto', \n 'ba', 'be', 'bi', 'bio', 'bo', 'bu', 'by', \n 'ca', 'ce', 'ci', 'cou', 'co', 'cu', 'cy', \n 'da', 'de', 'di', 'duo', 'dy', \n 'eco', 'ergo', 'exa', \n 'geo', 'gyno', \n 'he', 'hy', 'ki',\n 'intra', \n 'ma', 'mi', 'me', 'mo', 'my', \n 'na', 'ni', 'ne', 'no', 'ny', \n 'omni', \n 'pre', 'pro', 'per', \n 'sa', 'se', 'si', 'su', 'so', 'sy', \n 'ta', 'te', 'tri',\n 'uni');\n\n // 30 suffices\n $aSuffix = array('acy', 'al', 'ance', 'ate', 'able', 'an', \n 'dom', \n 'ence', 'er', 'en',\n 'fy', 'ful', \n 'ment', 'ness',\n 'ist', 'ity', 'ify', 'ize', 'ise', 'ible', 'ic', 'ical', 'ous', 'ish', 'ive', \n 'less', \n 'sion',\n 'tion', 'ty', \n 'or');\n\n // 8 vowel sounds \n $aVowels = array('a', 'o', 'e', 'i', 'y', 'u', 'ou', 'oo'); \n\n // 20 random consonants \n $aConsonants = array('w', 'r', 't', 'p', 's', 'd', 'f', 'g', 'h', 'j', \n 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm', 'qu');\n\n // Some consonants can be doubled\n $aDoubles = array('n', 'm', 't', 's');\n\n // \"Salt\"\n $aSalt = array('!', '#', '%', '?');\n\n $pwd = $aPrefix[array_rand($aPrefix)];\n\n // add random consonant(s)\n $c = $aConsonants[array_rand($aConsonants)];\n if ( in_array( $c, $aDoubles ) ) {\n // 33% chance of doubling it\n if (rand(0, 2) == 1) { \n $c .= $c;\n }\n }\n $pwd .= $c;\n\n // add random vowel\n $pwd .= $aVowels[array_rand($aVowels)];\n\n $pwdSuffix = $aSuffix[array_rand($aSuffix)];\n // If the suffix begins with a vovel, add one or more consonants\n if ( in_array( $pwdSuffix[0], $aVowels ) ) {\n $pwd .= $aConsonants[array_rand($aConsonants)];\n }\n $pwd .= $pwdSuffix;\n\n $pwd .= rand(2, 999);\n # $pwd .= $aSalt[array_rand($aSalt)];\n\n // 50% chance of capitalizing the first letter\n if (rand(0, 1) == 1) {\n $pwd = ucfirst($pwd);\n }\n return $pwd;\n }", "public function generateSecurePassword()\n {\n\n try {\n // Generate the random salt, \n // replace byte por byte for utf8 support\n $this->_salt = strtr(base64_encode(mcrypt_create_iv(22, MCRYPT_DEV_URANDOM)), '+', '.');\n\n // generate the password with the salt\n $this->password = password_hash($this->password, PASSWORD_BCRYPT, ['salt' => $this->_salt]);\n } catch (\\Exception $ex) {\n \\kerana\\Exceptions::showError('LoginError', $ex);\n }\n }", "public function password() {\n return Hash::make('MonsterRXBOCS');\n }", "protected function getConfiguredPassword() {}", "protected function changePassword() {}", "public function ClearTemporaryPassword()\n\t{\n\t\tif ( ($this->TempPassword) || ($this->TempPasswordSalt) )\n\t\t{\n\t\t\t$this->TempPassword = null;\n\t\t\t$this->TempPasswordSalt = null;\n\t\t\t$this->write();\n\t\t}\n\t\treturn $this;\n\t}", "function generateEncryptedPassword($userinfo) {\r\n if (!class_exists('PasswordHash')) {\r\n require_once JFUSION_PLUGIN_PATH . DS . $this->getJname() . DS . 'PasswordHash.php';\r\n }\r\n $t_hasher = new PasswordHash(8, true);\r\n $check = $t_hasher->CheckPassword($userinfo->password_clear, $userinfo->password);\r\n\r\n if ($check) {\r\n //password is correct and return the phpbb3 password hash\r\n return $userinfo->password;\r\n } else {\r\n //no phpbb3 encryption used and return the phpbb2 password hash\r\n\t\t\t$password_old_format = addslashes($userinfo->password_clear);\r\n\r\n\t\t\tif ($t_hasher->CheckPassword($userinfo->password_clear, md5($this->utf8_to_cp1252($password_old_format)))) {\r\n\t\t\t\t//password is correct\r\n\t\t\t\treturn $userinfo->password;\r\n\t\t\t} elseif ($t_hasher->CheckPassword($userinfo->password_clear, md5($password_old_format))) {\r\n\t\t\t\t//password is correct\r\n\t\t\t\treturn $userinfo->password;\t\t\t\t\r\n\t\t\t} elseif (md5($this->utf8_to_cp1252($password_old_format)) === $userinfo->password) {\r\n\t\t\t\t//password is correct\r\n\t\t\t\treturn $userinfo->password;\t\t\t\t\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t//ah who cares lets just a md5 standar encryption\r\n\t\t\t\t$encrypt_password = md5($password_old_format);\r\n return $encrypt_password;\r\n\t\t\t}\t\t\t\t\r\n\r\n }\r\n }", "function generatePassword() {\n\t//* (c) Hitech Scripts 2003\n\t//* For more information, visit http://www.hitech-scripts.com\n\t//* modified for phpgiftreg by Chris Clonch\n\tmt_srand((double) microtime() * 1000000);\n\t$newstring = \"\";\n\tif ($GLOBALS[\"OPT\"][\"password_length\"] > 0) {\n\t\twhile(strlen($newstring) < $GLOBALS[\"OPT\"][\"password_length\"]) {\n\t\t\tswitch (mt_rand(1,3)) {\n\t\t\t\tcase 1: $newstring .= chr(mt_rand(48,57)); break; // 0-9\n\t\t\t\tcase 2: $newstring .= chr(mt_rand(65,90)); break; // A-Z\n\t\t\t\tcase 3: $newstring .= chr(mt_rand(97,122)); break; // a-z\n\t\t\t}\n\t\t}\n\t}\n\treturn $newstring;\n}", "function encrypt_password($plain) {\n $password = '';\n\n for ($i=0; $i<10; $i++) {\n $password .= $this->random2();\n }\n\n $salt = substr(md5($password), 0, 2);\n\n $password = md5($salt . $plain) . ':' . $salt;\n\n return $password;\n }", "public function encodePassword(string $raw): string;", "function encrypt_password($plain) {\n $password = '';\n\n for ($i = 0; $i < 10; $i++) {\n $password .= $this->rand();\n }\n\n $salt = substr(md5($password), 0, 2);\n\n $password = md5($salt . $plain) . ':' . $salt;\n\n return $password;\n }", "public function esig_mail_get_password() {\n\n $esig_options = get_option('esig_mail_options');\n $temp_password = $esig_options['smtp_settings']['password'];\n $password = \"\";\n if (!$temp_password) {\n return $password;\n }\n\n $decoded_pass = base64_decode($temp_password);\n\n if (base64_encode($decoded_pass) === $temp_password) { //it might be encoded\n $password = base64_decode($temp_password);\n } else { //not encoded\n $password = $temp_password;\n }\n return $password;\n }", "function _hash_password($password)\n {\n //return altered pw\n\n }", "public function create_password() {\n\t\tif(!empty($this->request->params['named']['email'])){\n\t\t\t$email = $this->request->params['named']['email'];\n\t\t}\n\t\t\n\t\t$authUserData = $this->Auth->user();\n\t\tif(empty($authUserData)){\n\t\t\t$this->Session->setFlash(__('There was an error logging you in and setting up a password. Your temporary password has been sent to your email address.', true));\n\t\t\t//Send the temporary password to the user's email address\n\t\t\t$options = array(\n\t\t\t\t\t\t\t\t'layout'=>'temporary_password',\n\t\t\t\t\t\t\t\t'subject'=>'Your Temporary Password',\n\t\t\t\t\t\t\t\t'view'=>'default'\n\t\t\t\t\t\t\t\t);\n\t\t\t$viewVars = array('temp_password'=>$authUserData['User']['email'],'user'=>$user);\n\n\t\t\t//Send the email\n\t\t\t$this->_sendEmail($email,$options,$viewVars);\n\t\t\t$this->redirect(array('controller'=>'users','action'=>'login'));\n\t\t}\n\t\t\n\t\t$user = $this->User->find('first',array('conditions'=>array('email'=>$authUserData['User']['email'])));\n\t\tif (!empty($this->request->data)) {\n\t\t\t$this->request->data['User']['id'] = $user['User']['id']; //Get the logged in user's id\n\t\t\tif ($this->User->verifyNewPassword($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('Password created.', true));\n\t\t\t\t$this->redirect(array('controller'=>'uploads','action'=>'index'));\n\t\t\t}\n\t\t}\n\t}", "function sanitizePassword() {\n // If there is a password confirmation we put it to the checker, too\n $passCheckerInput = (strlen($this->passwordConf) > 0) ?\n array($this->password, $this->passwordConf) : $this->password;\n $passwordChecker = new PasswordChecker($passCheckerInput);\n if ($passwordChecker->getRelevance()) {\n $this->password = htmlspecialchars($this->password);\n } else {\n die(\"Error. Check your form data\");\n }\n }" ]
[ "0.7096385", "0.6645637", "0.66241175", "0.6456425", "0.6315426", "0.6308458", "0.629177", "0.62652874", "0.6196825", "0.6174643", "0.61710614", "0.61566466", "0.61452216", "0.6140846", "0.6128573", "0.6106052", "0.60904795", "0.6075013", "0.60732186", "0.60632324", "0.606169", "0.6055542", "0.6045504", "0.6034691", "0.6033225", "0.60171926", "0.6006572", "0.60059446", "0.5996444", "0.5994057" ]
0.71860015
0
begin here; enter into a directory and recursively look into it.
function dir_enter($entry_dir='/', $depth=0) { $found = 0; # Remove the last trailing slash and void dual writing $entry_dir = preg_replace('/\/$/i', '', $entry_dir); $skip_list = array( '.', # self '..', # parent ); if($dir_handle = opendir($entry_dir)) { while(false !== ($filename = readdir($dir_handle))) { if(in_array($filename, $skip_list)) { continue; } $full_file_path = "{$entry_dir}/{$filename}"; if(is_dir($full_file_path)) { # Need to loop here inside the directory fecho(str_repeat(' ', $depth)); # depth marker #fecho("{$full_file_path}"); fecho("{$filename}"); # Recurse through the file $function = __FUNCTION__; $found += $function($full_file_path, $depth+1); } else { #fecho(str_repeat(' ', $depth)); # depth marker #fecho("{$full_file_path}"); #fecho("{$filename}"); ++$found; process_file($full_file_path, $depth); } } closedir($dir_handle); } return $found; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rScanDir($scanMe) {\r\n\t\tglobal $path, $tmpPath, $cur_folder, $tags2;\r\n\t\tforeach($scanMe as $folder)\r\n\t\t{\r\n\t\t\tif(is_dir($path.$tmpPath.$folder) && $folder !=\".\" && $folder !=\"..\")\r\n\t\t\t{\r\n\t\t\t\t$cur_folder[] = $tmpPath.$folder;\r\n\t\t\t\techo \"getTagString input:\".$tmpPath.$folder.\"<br/>\";\r\n\t\t\t\t$tags2[] = getTagString($tmpPath.$folder);\r\n\t\t\t\t$tmpPath .= $folder.\"/\";\r\n\t\t\t\trScanDir(scandir($path.$tmpPath));\r\n\t\t\t}\r\n\t\t}\r\n\t\t$tmpPath = substr($tmpPath, 0, strrpos($tmpPath, \"/\"));\r\n\t\t$tmpPath = substr($tmpPath, 0, strrpos($tmpPath, \"/\")+1);\r\n\t}", "protected function pushd($dir) {\n array_push($this->pwd_stack, getcwd());\n chdir($dir);\n }", "function searchFolder( $current_folder, $folder_to_find, &$matches )\n{\n if ( !( $handle = opendir( $current_folder ) ) ) die( \"Cannot open $current_folder.\" );\n\n while ( $entry = readdir( $handle ) ) {\n if ( is_dir( \"$current_folder/$entry\" ) ) {\n if ( $entry != \".\" && $entry != \"..\" ) {\n\n // This entry is a valid folder\n // If it matches our folder name, add it to the list of matches\n if ( $entry == $folder_to_find ) $matches[] = \"$current_folder/$entry\";\n\n // Search this folder\n searchFolder( \"$current_folder/$entry\", $folder_to_find, $matches );\n }\n }\n }\n closedir( $handle );\n}", "function fs_get_tree($dir_path) {\n #echo \"top of fs_get_tree, dir_path=$dir_path\\n\";\n { $old_cwd = getcwd();\n chdir($dir_path);\n #echo \" did chdir to '$dir_path'\\n\";\n\n {\n $fh = opendir('.');\n #echo \" opendir\\n\";\n\n $results = array();\n $n = 0;\n $dirs_to_crawl = array();\n while (true) {\n #echo \" loop\\n\";\n if ($n > 500) {\n #echo \"--- n > LIMIT (n=$n), break\\n\";\n break;\n }\n $n++;\n $file = readdir($fh);\n #echo \" file = '$file'\\n\";\n if (!$file) {\n break;\n }\n if ($file == '.'\n || $file == '..'\n || $file == '.git' #todo #fixme don't assume\n ) {\n #echo \"--- . or .., continuing\\n\";\n continue;\n }\n if (is_dir($file)) {\n #echo \"--- adding $file to dirs, n=$n\\n\";\n $dirs_to_crawl[] = $file;\n }\n $results[$file] = null;\n }\n closedir($fh);\n }\n\n #echo \"\\nnow looping thru dirs_to_crawl\\n\";\n foreach ($dirs_to_crawl as $dir) {\n #echo \" dir = $dir\\n\";\n $results[$dir] = fs_get_tree($dir);\n }\n\n chdir($old_cwd);\n }\n\n return $results;\n }", "function include_dir($dir){\n if ( ( $dh = opendir( $dir ) ) !== false ){\n while ( ( $entry = readdir( $dh ) ) !== false ){\n if ( $entry != \".\" && $entry != \"..\" ){\n if ( is_file( $dir.$entry ) ){\n require_once ( $dir.$entry );\n }\n }\n }\n }else{\n echo \"BAD DIRECTORY\";\n }\n }", "function recurseDir($dir) {\r\n if(is_dir($dir)) {\r\n if($dh = opendir($dir)){\r\n while($file = readdir($dh)){\r\n if($file != '.' && $file != '..' && $file != \"Thumbs.db\"){\r\n //This builds the complete file path\r\n $filePath = $dir . \"/\" . $file;\r\n //if statement to see if its a directory or file\r\n if(is_dir($filePath)){\r\n //This splits the file path and returns and array\r\n $parentDirPath = explode(\"/\",$filePath);\r\n //this figures out what the parent directory is\r\n $parentDir = count($parentDirPath) -2;\r\n //This figures out waht the current directory is most like to be removed\r\n //$curDir = count($parentDirPath) -2;\r\n //This gets the last part of the file path and sets the name of the directory or file\r\n $name = end($parentDirPath);\r\n //This is test code to tell what the code is doing will be removed for actual db population\r\n echo $name . \" Is a Directory and its parent directory is \" . $parentDirPath[$parentDir] . \"<br / >\";\r\n //This escapes all characters for the db queries\r\n $name = mysql_real_escape_string($name);\r\n //This escapes the parent dir for the query below\r\n $parentDir = mysql_real_escape_string($parentDirPath[$parentDir]);\r\n //$parentDir = $parentDirPath[$parentDir];\r\n $dir = mysql_real_escape_string($dir);\r\n //Build the query to get the parent directory id\r\n $getParentDirId = mysql_query(\"SELECT id FROM directories WHERE name = '$parentDir' \")\r\n or die(mysql_error());\r\n //While loop to set the parent id for use\r\n while($row = mysql_fetch_array($getParentDirId)){\r\n $parentDirId = $row[id];\r\n }\r\n echo \"parent id \" . $parentDirId;\r\n //Build the query to check if the file already exists in the dg\r\n $checkExists = mysql_query(\"SELECT COUNT(id) AS 'exists' FROM directories WHERE name = '$name' AND parent = '$parentDirId' AND path = '$dir'\")\r\n or die(mysql_error());\r\n //While loop to set the exists variable\r\n while($row = mysql_fetch_array($checkExists)){\r\n $exists = $row[exists];\r\n echo \" This is the $exists\";\r\n\r\n //If statment that checks the exists variable to see if it needs to add the current information to the db\r\n if($exists <1){\r\n //Query to insert data into database\r\n $result = mysql_query(\"INSERT INTO directories (id,path, name, parent) VALUES (NULL,'$dir', '$name', '$parentDirId]') \") or die(mysql_error());\r\n }\r\n }\r\n //Since this is a directory this calls the function again to loop back through a subfolder\r\n recurseDir($filePath);\r\n\r\n }elseif(is_file($filePath)){\r\n //This splits the filepath and returns and array\r\n $parentDirPath = explode(\"/\",$filePath);\r\n //This gets the paretnt dir to the file might not be needed\r\n $parentDir = count($parentDirPath) -3;\r\n //This gets the directory that the file is located\r\n $curDir = count($parentDirPath) -2;\r\n //This gets the last part of the file path and sets the name of the directory or file\r\n $name = end($parentDirPath);\r\n //This returns the filesize in MB need to write function to have it do gb & kb depending on size\r\n $fileSize = round(filesize($filePath) /1048576);\r\n //This splits the filename from the extension and returns and array\r\n $getExtentsion = explode(\".\", $name);\r\n //This sets the extension\r\n $extenstion = $getExtentsion[1];\r\n //This sets the filename\r\n $fileName = $getExtentsion[0];\r\n //This is test code to tell what the code is doing will be removed for actual db population\r\n /* echo \"<br />\\t\\t\" . $fileName . \" Is a file Located in \" . $parentDirPath[$curDir] . \" The parent directory is \" . $parentDirPath[$parentDir] .\r\n \" and a file size of \" . $fileSize . \" MB and an extenstion of \" . $extenstion . \"<br />\";*/\r\n /*echo \"<br />\\t\\t\" . $fileName . \" Is Located in \" . $parentDirPath[$curDir] . \" parent directory is \" . $parentDirPath[$parentDir] .\r\n \" size of \" . $fileSize . \" MB extenstion \" . $extenstion . \"<br />\";*/\r\n //echo \"this is what you are trying to echo \" . $directory_tree_file['pDir'];\r\n\r\n }else{\r\n //echo $filePath . \" WTF?<br />\";\r\n }\r\n\r\n }\r\n }//End while\r\n }\r\n closedir($dh);\r\n }\r\n}", "protected static function _scanForPlugins(){\n\t\t$directory = __DIR__ . Config::$pluginsDirectory;\n\t\t$handle = opendir( $directory );\n\n\t\t// check to make sure we could open the directory handle\n\t\tif( !$handle )\n\t\t\treturn;\n\n\t\t// now begin looping through all of the contents of the plugin directory\n\t\twhile( ( $dir = readdir( $handle ) ) !== false ){\n\t\t\tif( $dir === '.' || $dir === '..' )\n\t\t\t\tcontinue;\n\n\t\t\t// now we need to verify that the current \"file\" is a directory before continuing\n\t\t\tif( !is_dir( $directory . $dir ) )\n\t\t\t\tcontinue;\n\n\t\t\t// expect a class file to exist in the format \"class-<DirectoryName>.php\"\n\t\t\t$classFile = $directory . $dir . '/' . $dir . '.php';\n\t\t\tif( !file_exists( $classFile ) )\n\t\t\t\tcontinue;\n\n\t\t\t// now actually include the code\n\t\t\trequire_once( $classFile );\n\n\t\t\t// now expect the class name to match whatever the $dir name was\n\t\t\tif( !class_exists( $dir ) )\n\t\t\t\tcontinue;\n\n\t\t\t// now we can instantiate the class name and store it now\n\t\t\tself::$_plugins[] = new $dir();\n\t\t}\n\t}", "function searchDir($base_dir=\"./\",$p=\"\",$f=\"\",$allowed_depth=-1){\n\t$contents=array();\n\n\t# trim all input arguments for whitespace\n\t$base_dir=trim($base_dir);\n\t$p=trim($p);\n\t$f=trim($f);\n\n # if base dir is not given, use the this\n\tif($base_dir==\"\")$base_dir=\"./\";\n\n\t# if last character of basedir lacks a \"/\" then add one\n\tif(substr($base_dir,-1)!=\"/\")$base_dir.=\"/\";\n\n\t# remove the \"../\" and \"./\" directories, and trim all \"./\"\n\t$p=str_replace(array(\"../\",\"./\"),\"\",trim($p,\"./\"));\n\n\t# add the requested path to the base directory string\n\t$p=$base_dir.$p;\n\n\t#if p is not a directory, meaning it is a file, get the path to it\n\tif(!is_dir($p))$p=dirname($p);\n\n\t#if the last character of p is not a \"/\" then add one\n\tif(substr($p,-1)!=\"/\")$p.=\"/\";\n\n\t# if caps are set on allowed depth (allowed depth>-1) count the dirs\n\tif($allowed_depth>-1){\n\t\t$allowed_depth=count(explode(\"/\",$base_dir))+ $allowed_depth-1;\n\t\t$p=implode(\"/\",array_slice(explode(\"/\",$p),0,$allowed_depth));\n\t\tif(substr($p,-1)!=\"/\")$p.=\"/\";\n\t}\n\n\t# if f is empty, create an empty array, if not explode and store elements\n\t$filter=($f==\"\")?array():explode(\",\",strtolower($f));\n\n\t# store the files in the files array, and shut up while scanning\n\t$files=@scandir($p);\n\n\t# if there are no files after scan, return an empty array and the path\n\tif(!$files)return array(\"contents\"=>array(),\"currentPath\"=>$p);\n\n\t# iterate through all files found\n\tfor ($i=0;$i<count($files);$i++){\n\n\t\t# gather name and path of each file\n\t\t$fName=$files[$i];\n\t\t$fPath=$p.$fName;\n\n\t\t# check if the file is a directory and tag it as directory\n\t\t# each file is tagged as a folder by default\n\t\t$isDir=is_dir($fPath);\n\t\t$add=false;\n\t\t$fType=\"folder\";\n\n\t\t# if the file is a file\n\t\tif(!$isDir){\n\n\t\t\t# extract extension from filename\n\t\t\t$ft=strtolower(substr($files[$i],strrpos($files[$i],\".\")+1));\n\t\t\t$fType=$ft;\n\n\t\t\t# if there is anything in the filter that matches, add it\n\t\t\tif($f!=\"\"){\n\t\t\t\tif(in_array($ft,$filter))$add=true;\n\t\t\t}else{\n\t\t\t\t$add=true;\n\t\t\t}\n\t\t# if the file is a folder\n\t\t}else{\n\t\t\tif($fName==\".\")continue;\n\t\t\t$add=true;\n\n\t\t\t# filter it, and discard if bad\n\t\t\tif($f!=\"\"){\n\t\t\t\tif(!in_array($fType,$filter))$add=false;\n\t\t\t}\n\n\t\t\t# if the file is the \"..\" folder\n\t\t\tif($fName==\"..\"){\n\t\t\t\t# if we are in the base dir, no not add upper directory option\n\t\t\t\tif($p==$base_dir){\n\t\t\t\t\t$add=false;\n\t\t\t\t}else $add=true;\n\n\t\t\t\t# explode the path by path steps\n\t\t\t\t$tempar=explode(\"/\",$fPath);\n\t\t\t\t# remove last two elements, so the file references parent dir\n\t\t\t\tarray_splice($tempar,-2);\n\t\t\t\t# implode the array, to recreate the path string\n\t\t\t\t$fPath=implode(\"/\",$tempar);\n\t\t\t\t# if for some reason, this reference is shorter than basedir, deny it!\n\t\t\t\tif(strlen($fPath)<= strlen($base_dir))$fPath=\"\";\n\t\t\t}\n\t\t}\n\n\t\t# if the created fPath is non-zero, append to basedir\n\t\tif($fPath!=\"\")$fPath=substr($fPath,strlen($base_dir));\n\t\t# if approved to add, add path, name and type to contents[] array\n\t\tif($add)$contents[]=array(\"fPath\"=>$fPath,\"fName\"=>$fName,\"fType\"=>$fType);\n\t}\n\n\t# if p is shorter than base_dir, deny it! Else, cut away base_dir and use it\n\t$p=(strlen($p)<= strlen($base_dir))?$p=\"\":substr($p,strlen($base_dir));\n\t# return the final contents and its respective path\n\treturn array(\"contents\"=>$contents,\"currentPath\"=>$p);\n}", "function searchDir($root,$path,&$data)\n\t{\n\t\t$full_path = $root.$path;\n\t\tif(is_dir($full_path))\n\t\t{\n\t\t\t$dp=dir($full_path);\n\t\t\twhile($file=$dp->read())\n\t\t\t{\n\t\t\t\tif($file!='.'&& $file!='..')\n\t\t\t\t{\n\t\t\t\t\tsearchDir($root,$path.'/'.$file,$data);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$dp->close();\n\t\t}\n\t\tif(is_file($full_path))\n\t\t{\n\t\t\t$data[]=$path;\n\t\t}\n\t}", "protected function scanDir()\n {\n $this->moduleList = [];\n foreach ($this->getVendorList() as $vendorName) {\n $this->moduleList[$vendorName] = [];\n }\n\n $this->readModules();\n }", "function scan_directory_recursively($directory, $filter=FALSE)\n{\n\tif(substr($directory,-1) == '/')\n\t{\n\t\t$directory = substr($directory,0,-1);\n\t}\n\tif(!file_exists($directory) || !is_dir($directory))\n\t{\n\t\treturn FALSE;\n\t}elseif(is_readable($directory))\n\t{\n\t\t$directory_list = opendir($directory);\n\t\twhile($file = readdir($directory_list))\n\t\t{\n\t\t\tif($file != '.' && $file != '..' && $file != '.DS_Store' && $file != '.svn')\n\t\t\t{\n\t\t\t\t$path = $directory.'/'.$file;\n\t\t\t\tif(is_readable($path))\n\t\t\t\t{\n\t\t\t\t\t$subdirectories = explode('/',$path);\n\t\t\t\t\tif(is_dir($path))\n\t\t\t\t\t{\n\t\t\t\t\t\t$directory_tree[] = array(\n\t\t\t\t\t\t\t'path' => $path,\n\t\t\t\t\t\t\t'name' => end($subdirectories),\n\t\t\t\t\t\t\t'modified'\t=> filemtime($path),\n\t\t\t\t\t\t\t'kind' => 'directory',\n\t\t\t\t\t\t\t'content' => scan_directory_recursively($path, $filter));\n\t\t\t\t\t}elseif(is_file($path))\n\t\t\t\t\t{\n\t\t\t\t\t\t$extension = end(explode('.',end($subdirectories)));\n\t\t\t\t\t\tif($filter === FALSE || $filter == $extension)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Get metadata and image dimensions\n\t\t\t\t\t\t\t$size = getimagesize($path, $info);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Get containing directory of file\n\t\t\t\t\t\t\t$directory_array = explode('/', $path);\n\t\t\t\t\t\t\t$parent_folder = min($directory_array);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Reset title, caption, tags\n\t\t\t\t\t\t\t$title = $caption = $taglist = $tags = '';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$directory_tree[] = array(\n\t\t\t\t\t\t\t'path'\t\t=> dirname($path),\n\t\t\t\t\t\t\t'group'\t\t=> $parent_folder,\n\t\t\t\t\t\t\t'file'\t\t=> end($subdirectories),\n\t\t\t\t\t\t\t'extension' => $extension,\n\t\t\t\t\t\t\t'size'\t\t=> filesize($path),\n\t\t\t\t\t\t\t'width'\t\t=> $size[0],\n\t\t\t\t\t\t\t'height'\t=> $size[1],\n\t\t\t\t\t\t\t'modified'\t=> filemtime($path),\n\t\t\t\t\t\t\t'title'\t\t=> $title,\n\t\t\t\t\t\t\t'caption'\t=> $caption,\n\t\t\t\t\t\t\t'tags'\t\t=> $tags,\n\t\t\t\t\t\t\t'kind'\t\t=> 'file');\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\tclosedir($directory_list); \n\t\treturn $directory_tree;\n\t}else{\n\t\treturn FALSE;\t\n\t}\n}", "private function directoryScan($dir) {\n\t\t\n\t\t// check for the validity of input / working directory\n\t\t\n\t\tif (!is_dir($dir)) {\n\t\t\tdie(\"'$dir' is not a directory.\".LE);\n\t\t}\n\t\t\n\t\t// listing directory contents\n\t\t\n\t\t$result = [];\n\t\t\n\t\t$root = scandir($dir);\n\t\tforeach($root as $value)\n\t\t{\n\t\t\t// removing dots & output directory\n\t\t\t\n\t\t\tif($value === '.' || $value === '..') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// listing only files\n\t\t\t\n\t\t\tif(is_file(\"$dir\".DS.\"$value\")) {\n\t\t\t\t$result[$value]=\"$dir\".DS.\"$value\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// recursive call to self(this method) so we can get files listing recursively\n\t\t\t\n\t\t\tforeach($this->directoryScan(\"$dir\".DS.\"$value\") as $value1)\n\t\t\t{\n\t\t\t\t$result[basename($value1)]=$value1;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "function print_dir_contents($dir_path, $parent_dir)\r\n{\r\n if (is_null($parent_dir)) {\r\n $dir_contents = glob(\"*\");\r\n } else {\r\n $dir_contents = glob(\"$dir_path/*\");\r\n }\r\n\r\n foreach ($dir_contents as $item) {\r\n if (is_dir($item)): ?>\r\n <li><a href=\"<?=$item?>\"><?=$item?>/</a></li>\r\n <ul>\r\n <?php print_dir_contents($item, $dir_path); ?>\r\n </ul>\r\n <?php else: ?>\r\n <li><a href=\"<?=$item?>\"><?=str_replace($dir_path . '/', '', $item)?></a></li>\r\n <?php endif;\r\n }\r\n}", "public function taskContinue(): void\n {\n $directory = $this->getDirectory();\n if (!$directory) {\n throw new RuntimeException('Not Found', 404);\n }\n\n if ($directory->getObject() instanceof PageInterface) {\n $this->continuePages($directory);\n } else {\n $this->continue($directory);\n }\n }", "static function AJAX_Scan() {\n\t\t$list = RecursiveScanDir(__DIR__);\n\t\tusort($list, \"strnatcasecmp\");\n\t\t\n\t\t// No files?\n\t\tif (!$list || !count($list)) die(\"No .php files located in this<br />folder and/or subfolders\");\n\t\t\n\t\t// For each file we'll present something nice\n\t\t$out = \"\";\n\t\tforeach($list as $file) {\n\t\t\t\n\t\t\t// If Mode is set to 1, we need to parse the file and check the completion\n\t\t\t$analysis = \"\";\n\t\t\tif ($_POST['Mode']) {\n\t\t\t\t$analysis = DocBlock::AnalyzeFile($file);\n\t\t\t}\n\t\t\t\n\t\t\t$out .= \"\n\t\t\t\t$analysis<a href='#' data-filename='\".rawurlencode($file).\"' class='filelink'>$file</a><br />\n\t\t\t\";\n\t\t}\n\t\t\n\t\t// Ouptut\n\t\techo $out;\n\t\t\n\t\t// Exit \"Gracefully\"\n\t\texit(0);\n\t}", "function dir_recursive($dir,$username) {\r\n \r\n echo \"<ul id='tree'>\";\r\n $n =0;\r\n foreach(scandir($dir) as $file) {\r\n \r\n $n++;\r\n if ('.' === $file || '..' === $file || '.DS_Store' === $file) continue;\r\n \r\n if (is_dir($dir.'/'.$file)) {\r\n\r\n\r\n //echo $dir.'/'.$file.'<br>';\r\n \r\n echo \"<li id='\".$file.\"' class='treeLi' title='\".$dir.'/'.$file.\"' onclick='getFolderNode(this.title,this.id)'><i class='fas fa-folder mr-2 iconNav'></i>$file</li>\";\r\n\r\n dir_recursive($dir.'/'.$file,$username);\r\n\r\n } else {\r\n //echo $file.'<br>';\r\n }\r\n\r\n }\r\n echo \"</ul>\"; \r\n}", "function dir_list($file)\n{\n $file_list = scandir($file);\n foreach($file_list as $item)\n {\n if($item == '.' || $item == '..')continue;\n \n $file_path = $file . '/' . $item;\n if(is_dir($file_path))\n {\n echo \"<font color='red'>$file_path</font><br/>\";\n dir_list($file_path);\n }\n else{\n echo $file_path . \"<br>\";\n }\n }\n}", "function scan_directory($dir, $ext = '*', $recurse = true) {\n $files = array ();\n if ($handle = opendir($dir)) {\n while (false !== ($file = readdir($handle))) {\n if ($file == '.' || $file == '..' ||\n $file == 'CVS' || preg_match('|^\\.|', $file)) {\n continue;\n }\n if (is_link($dir . '/' . $file)) {\n continue;\n }\n if (is_dir ($dir . '/' . $file)) {\n if ($recurse == true)\n $files = array_merge($files, scan_directory ($dir . '/' . $file, $ext));\n } else {\n if($ext == get_file_extension($file) || $ext == '*') {\n $files[] = $dir . '/' . $file;\n }\n }\n }\n closedir($handle);\n }\n return $files;\n}", "function m_walk_dir( $root, $callback, $recursive = true, $level = 0 ) {\r\n $dh = @opendir( $root );\r\n if( false === $dh ) {\r\n return false;\r\n }\r\n while( $file = readdir( $dh )) {\r\n if( \".\" == $file || \"..\" == $file ){\r\n continue;\r\n }\r\n //echo \"## DEBUG:$level - $file<br/>\"; \r\n\r\n //echo \"Level: $level\";\r\n call_user_func( $callback,$level, \"{$root}/{$file}\", $file );\r\n if( false !== $recursive && is_dir( \"{$root}/{$file}\" )) {\r\n m_walk_dir( \"{$root}/{$file}\", $callback, $recursive, $level+1 );\r\n }\r\n }\r\n closedir( $dh );\r\n return true;\r\n}", "function CheckDir($dir, $startWith = '')\n{\n global $count;\n global $pruned;\n $count++;\n \n echo \"\\r$count ($pruned): Checking $dir \";\n \n $started = false;\n if( !strlen($startWith) )\n $started = true;\n\n // see if this is a directory we need to prune\n if( $started && is_dir(\"$dir/video_2\") )\n {\n PruneDir($dir);\n }\n else\n {\n // recurse into any directories\n $f = scandir($dir);\n foreach( $f as $file )\n {\n if( !$started && $file == $startWith )\n $started = true;\n \n if( $started && is_dir(\"$dir/$file\") && $file != '.' && $file != '..' )\n CheckDir(\"$dir/$file\");\n }\n unset($f);\n }\n}", "function searchFile($directory, $file)\n{\n // Blacklisted directory names - not doing so will provoke an endless loop\n $blacklist = array ( '.idea', '.git', '.', '..');\n\n // Getting a handle on the directory\n $dir_handle = opendir($directory);\n\n // Looping on all the directorie's entry to find the right file\n while(false !== ($entry = readdir($dir_handle)))\n {\n //if($entry != '.' && $entry != '..' && $entry != '.idea' && $entry != '.git')\n if(!in_array($entry, $blacklist))\n {\n // if it's a directory - call back the same function recursively\n if(is_dir($directory. DIRECTORY_SEPARATOR .$entry))\n {\n searchFile($directory . DIRECTORY_SEPARATOR . $entry, $file);\n }\n // If it's a file, test against class name to know if it is the right file\n else if(str_replace(\".php\", \"\", $entry) == get_class_name($file))\n {\n $path = $directory . DIRECTORY_SEPARATOR . $entry;\n add_to_cache($file, $path);\n\n return;\n }\n }\n }\n\n closedir($dir_handle);\n\n\n}", "function check_dir($dir)\n {\n global $docdir, $lang;\n \n // Collect files and diretcories in these arrays\n $directories = array();\n $files = array();\n \n // Open and traverse the directory\n $handle = @opendir($dir);\n while ($file = @readdir($handle)) {\n if (preg_match(\"/^\\.{1,2}/\",$file) || $file == 'CVS')\n continue;\n\n // Collect files and directories\n if (is_dir($dir.$file)) { $directories[] = $file; }\n else { $files[] = $file; }\n\n }\n @closedir($handle);\n \n // Sort files and directories\n sort($directories);\n sort($files);\n \n // Files first...\n $file_cnt = 0;\n foreach ($files as $file) {\n if (check_file($dir.$file, $file_cnt)) { $file_cnt++; }\n }\n\n // than the subdirs\n foreach ($directories as $file) {\n check_dir($dir.$file.\"/\");\n }\n }", "function GetContents($dir,$files=array()) \n{\n if(!($res=opendir($dir))) exit(\"$dir doesn't exist!\");\n while(($file=readdir($res))==TRUE) \n if($file!=\".\" && $file!=\"..\")\n if(is_dir(\"$dir/$file\")) $files=GetContents(\"$dir/$file\",$files);\n else array_push($files,\"$dir/$file\");\n \n closedir($res);\n return $files;\n}", "protected function _Recusive_Load_Dir($dir) {\r\n if (!is_dir($dir)) { return; }\r\n // Load each of the field shortcodes\r\n foreach (new DirectoryIterator($dir) as $FileInfo) {\r\n // If this is a directory dot\r\n if ($FileInfo->isDot()) { continue; }\r\n // If this is a directory\r\n if ($FileInfo->isDir()) { \r\n // Load the directory\r\n $this->_Recusive_Load_Dir($FileInfo->getPathname());\r\n } // Otherwise load the file\r\n else {\r\n // If this is not false\r\n if (stripos($FileInfo->getFilename(),'.tpl') !== false) { continue; } \r\n // If this is not false\r\n if (stripos($FileInfo->getFilename(),'.php') === false) { continue; } \r\n // Include the file\r\n require_once($FileInfo->getPathname());\r\n }\r\n }\r\n }", "static public function scan_dir($dir = '', $partial = '')\n\t\t{\n\t\t$d = dir($dir);\n\t\twhile ($file = $d->read())\n\t\t\t{\n\t\t\t$full = \"$dir/$file\";\n\t\t\tif (preg_match(\"/^\\./\", $file)) continue;\n\t\t\tif (is_dir($full)) self::scan_dir($full, $partial);\n\t\t\telse {\n\t\t\t\t$class = str_replace('.php', '', $full);\n\t\t\t\t$class = str_replace($partial, '', $class);\n\t\t\t\t$class = str_replace('/', '\\\\', $class);\n\n\t\t\t\tif ($class != \"\\\\Model\\\\Model\"\n\t\t\t\t\t&& strpos($class, 'Model') !== false\n\t\t\t\t\t&& class_exists($class)\n\t\t\t\t\t&& get_parent_class($class) == 'Model'\n\t\t\t\t\t) {\n\t\t\t\t\techo \"\\n\\nFound $class.\";\n\t\t\t\t\t$model = new $class();\n\t\t\t\t\t\\Model\\Create::create($model->my_table(), $model->my_columns());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private function __scanDir($dir) {\n\n if ($dir == '/') {\n $dir = $this->startDirectory;\n $this->__currentDirectory = $dir;\n }\n\n $strippedDir = str_replace('/', '', $dir);\n\n $dir = ltrim($dir, \"/\");\n\n // Prevent listing blacklisted directories\n if (in_array($strippedDir, $this->ignoredDirectories)) {\n return false;\n }\n\n if (! file_exists($dir) || !is_dir($dir)) {\n return false;\n }\n\n return scandir($dir);\n }", "function list_dir($chdir,$id_item_parent1,$mon_dir=\"\")\r\n{\r\n\t global $id_item,$mon_path,$rep;\r\n\r\n\t $var_retour = \"\"; \r\n\t unset($sdirs);\r\n\t unset($sfiles);\r\n\t chdir($chdir);\r\n \r\n\t $self = basename($_SERVER['PHP_SELF']);\r\n\t $handle = opendir('.');\r\n\t while ($file = readdir($handle))\r\n\t {\r\n //echo($file.\"<br>\");\r\n\t \tif(is_dir($file) && $file != \".\" && $file != \"..\")\r\n\t \t{ $sdirs[] = $file; }\r\n\t\telseif (is_file($file))\r\n\t\t{ $sfiles[] = $file; }\r\n\t }\r\n\t \r\n\t $dir = getcwd();\r\n\t $dir1 = str_replace($root, \"\", $dir);\r\n\t $count = substr_count($dir1, \"/\") + substr_count($dir1, \"\\\\\");\r\n \r\n\t if(is_array($sdirs))\r\n\t {\r\n\t\t sort($sdirs);\r\n\t \t reset($sdirs);\r\n\t\t \r\n\t \t for($y=0; $y<sizeof($sdirs); $y++)\r\n\t \t {\r\n\t\t\t $id_item++;\r\n\t\t\t // on n'affiche pas les répertoires\r\n\t\t\t //echo htmlentities($sdirs[$y]);\r\n \r\n\t\t\t $cwd1[0] = $dir;\r\n\t \t\t $cwd1[1] = $sdirs[$y];\r\n\t\t\t $chdir = join(\"/\", $cwd1);\r\n\t\t\t \r\n\t\t\t $var_retour = $var_retour.list_dir($chdir,$id_item,$chdir);\r\n\t\t }\r\n\t }\r\n\t \t\t \r\n\t chdir($chdir);\r\n\t \r\n\t if(is_array($sfiles))\r\n\t {\r\n\t \t sort($sfiles);\r\n\t \t reset($sfiles);\r\n\t\t \r\n\t\t $sizeof = sizeof($sfiles);\r\n\t\t \r\n\t\t for($y=0; $y<$sizeof; $y++)\r\n\t\t {\r\n\t\t\t $id_item++;\r\n\t\t\t if ($mon_dir) {\r\n\t\t\t\t $nom_path = str_replace($mon_path,\"\",$mon_dir).\"/\";\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t $nom_path = $rep;\r\n\t\t\t }\r\n\r\n\t\t\t$var_retour = $var_retour.\"<option value=\\\"\".$sfiles[$y].\"\\\">\".$sfiles[$y].\"</option>\"; \r\n\t\t }\r\n\t }\r\n\r\n\t return $var_retour;\r\n}", "function browse($dir) {\nglobal $filenames;\n if ($handle = opendir($dir)) {\n while (false !== ($file = readdir($handle))) {\n if ($file != \".\" && $file != \"..\" && is_file($dir.'/'.$file)) {\n $filenames[] = $dir.'/'.$file;\n }\n else if ($file != \".\" && $file != \"..\" && is_dir($dir.'/'.$file)) {\n browse($dir.'/'.$file);\n }\n }\n closedir($handle);\n }\n return $filenames;\n}", "function scanDir($cfg) //$view, $tdir , $subdir='', $match)\n {\n $ff = HTML_FlexyFramework::get();\n \n $subdir = $cfg['subdir'];\n $scandir = $cfg['tdir']. (empty($subdir) ? '' : '/') . $subdir;\n \n if (in_array($subdir, $cfg['skipdir'])) {\n return array();\n }\n // skip dom_templates\n \n if (!file_exists($scandir)) {\n return array();\n }\n $dh = opendir($scandir);\n if(!$dh){\n return array(); // something went wrong!?\n }\n $ret = array();\n \n while (($fn = readdir($dh)) !== false) {\n // do we care that it will try and parse the template directory??? - not really..\n // as we are only looking for php files..\n if(empty($fn) || $fn[0] == '.'){\n continue;\n }\n \n $fullpath = $scandir.(empty($scandir) ? '' : \"/\").$fn;\n // echo \"filename: $fullpath \\n\";\n \n if (is_link($fullpath)) {\n continue;\n }\n \n if(is_dir($fullpath)){\n // then recursively call self...\n $cfg['subdir'] = $subdir . (empty($subdir) ? '' : '/') . $fn;\n $children = $this->scanDir($cfg);\n if (count($children)) {\n $ret = array_merge($ret, $children);\n \n }\n continue;\n \n }\n \n if (!preg_match($cfg['match'], $fn) || !is_file($fullpath)) {\n continue;\n }\n \n \n \n $ret[] = $subdir . (empty($subdir) ? '' : '/'). $fn; /// this used to be strtolower?? why???\n\n \n \n }\n// print_r($ret);\n \n return $ret;\n \n \n \n \n }", "public function in_default_dir($src)\n {\n }" ]
[ "0.5582389", "0.5535926", "0.5441885", "0.5426914", "0.5365969", "0.536421", "0.5345124", "0.52839905", "0.527695", "0.52621114", "0.5251651", "0.52430516", "0.52245325", "0.5203092", "0.5202012", "0.5191469", "0.5188438", "0.5171857", "0.5151295", "0.5150924", "0.5150247", "0.5147414", "0.51338124", "0.5118906", "0.5096912", "0.5095318", "0.5073724", "0.50716263", "0.507117", "0.5070087" ]
0.71078455
0
$Id: date_tools.wizard.inc,v 1.1.2.3 2010/04/13 19:32:28 karens Exp $
function date_tools_wizard_form() { $form = array(); $form['type'] = array( '#type' => 'fieldset', '#title' => t('Content type'), ); $form['type']['type_name'] = array( '#type' => 'textfield', '#default_value' => 'date', '#title' => t('Content type name'), '#description' => t('Machine-readable name. Allowed values: (a-z, 0-9, _). If this is not an existing content type, the content type will be created.'), ); $form['type']['name'] = array( '#type' => 'textfield', '#default_value' => t('Date'), '#title' => t('Content type label'), '#description' => t('The human-readable name for this content type. Only needed when creating a new content type.'), ); $form['type']['type_description'] = array( '#type' => 'textarea', '#default_value' => t('A date content type that is linked to a Views calendar.'), '#title' => t('Content type description'), '#description' => t('A description for the content type. Only needed when creating a new content type.'), ); $form['field'] = array( '#type' => 'fieldset', '#title' => t('Date field'), ); $form['field']['field_name'] = array( '#type' => 'textfield', '#default_value' => 'date', '#field_prefix' => 'field_', '#title' => t('Date field name'), '#description' => t('Machine-readable name. Allowed values: (a-z, 0-9, _) Must not be an existing field name.'), ); $form['field']['label'] = array( '#tree' => TRUE, '#type' => 'textfield', '#default_value' => t('Date'), '#title' => t('Date field label'), '#description' => t('The human-readable label for this field.'), ); $form['field']['widget_type'] = array( '#type' => 'select', '#options' => date_tools_wizard_widget_types(), '#default_value' => 'date_select', '#title' => t('Date widget type'), ); $form['field']['repeat'] = array( '#type' => 'select', '#default_value' => 0, '#options' => array(0 => t('No'), 1 => t('Yes')), '#title' => t('Show repeating date options'), ); $form['field']['advanced'] = array( '#type' => 'fieldset', '#collapsible' => TRUE, '#collapsed' => TRUE, '#title' => t('Advanced options'), ); $form['field']['advanced']['field_type'] = array( '#type' => 'select', '#options' => date_tools_wizard_field_types(), '#default_value' => 'datetime', '#title' => t('Date field type'), '#description' => t("The recommend type is Datetime, except for historical dates or dates with only year or month granularity. Older or incomplete dates should use the Date type (an ISO date)."), ); $form['field']['advanced']['granularity'] = array( '#type' => 'select', '#options' => date_granularity_names(), '#default_value' => array('month', 'day', 'year', 'hour', 'minute'), '#title' => t('Granularity'), '#multiple' => TRUE, ); $form['field']['advanced']['tz_handling'] = array( '#type' => 'select', '#options' => date_tools_wizard_tz_handling(), '#default_value' => 'site', '#title' => t('Date timezone handling'), '#description' => t("Timezone handling should be set to 'none' for granularity without time elements.") ); $form['calendar'] = array( '#type' => 'select', '#default_value' => 1, '#options' => array(0 => t('No'), 1 => t('Yes')), '#title' => t('Create a calendar for this date field'), ); $form['blocks'] = array( '#type' => 'select', '#options' => array(0 => t('No'), 1 => t('Yes')), '#default_value' => 0, '#title' => t('Add calendar blocks to the current theme'), ); $form['submit'] = array( '#type' => 'submit', '#value' => t('Save'), ); return $form; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildCalendarMenu($automated, &$year, &$day, &$month, &$hour, &$min)\n{\n $today = getdate();\n $tday = $today['mday'];\n if ($tday < 10){\n $tday = \"0$tday\";\n }\n $tmonth = $today['month'];\n $ttmon = $today['mon'];\n if ($ttmon < 10){\n $ttmon = \"0$ttmon\";\n }\n $tyear = $today['year'];\n $thour = $today['hours'];\n if ($thour < 10){\n $thour = \"0$thour\";\n }\n $tmin = $today['minutes'];\n if ($tmin < 10){\n $tmin = \"0$tmin\";\n }\n $tsec = $today['seconds'];\n if ($tsec < 10){\n $tsec = \"0$tsec\";\n }\n $date = \"$tmonth $tday, $tyear @ $thour:$tmin:$tsec\"; /* ML get the language from the queue table */\n $formatted_date = ml_ftime(_DATETIMELONG, mktime($today['hours'],$today['minutes'],$today['seconds'],$today['mon'],$today['mday'],$today['year']));\n if(!$automated){\n echo _NOWIS.': '.pnVarPrepForDisplay($formatted_date).'<br />';\n echo _HOUR.': <select name=\"hour\">';\n $hour = 0;\n $cero = '0';\n while ($hour <= 23) {\n $dummy = $hour;\n if ($hour < 10) {\n $hour = \"$cero$hour\";\n }\n echo '<option>'.pnVarPrepForDisplay($hour).'</option>';\n $hour = $dummy;\n $hour++;\n }\n echo \"</select>&nbsp;\";\n echo \": <select name=\\\"min\\\">\";\n $min = 0;\n while ($min <= 59) {\n if (($min == 0) OR ($min == 5)) {\n $min = \"0$min\";\n }\n echo \"<option>\".pnVarPrepForDisplay($min).\"</option>\";\n $min = $min + 5;\n }\n echo \"</select>&nbsp;&nbsp;\";\n $day = 1;\n echo _DAY.': <select name=\"day\">';\n while ($day <= 31) {\n if ($tday==$day) {\n $sel = 'selected=\"selected\"';\n } else {\n $sel = '';\n }\n echo '<option '.$sel.'>'.pnVarPrepForDisplay($day).'</option>';\n $day++;\n }\n echo '</select>&nbsp;&nbsp;';\n $month = 1;\n echo _MONTH.': <select name=\"month\">';\n while ($month <= 12) {\n if ($ttmon==$month) {\n $sel = 'selected=\"selected\"';\n } else {\n $sel = '';\n }\n echo '<option '.$sel.'>'.pnVarPrepForDisplay($month).'</option>';\n $month++;\n }\n echo '</select>&nbsp;&nbsp;';\n $date = getdate();\n $formatted_date = ml_ftime(_DATETIMELONG, mktime($date['hours'],$date['minutes'],$date['seconds'],$date['mon'],$date['mday'],$date['year']));\n $year = $date['year'];\n echo _YEAR.': <input type=\"text\" name=\"year\" value=\"'.pnVarPrepForDisplay($year).'\" size=\"5\" maxlength=\"4\" /><br />';\n } else {\n echo _NOWIS.': '.pnVarPrepForDisplay($formatted_date).'<br />';\n echo _HOUR.': <select name=\"hour\">';\n $xhour = 0;\n $cero = '0';\n while ($xhour <= 23) {\n $dummy = $xhour;\n if ($xhour < 10) {\n $xhour = \"$cero$xhour\";\n }\n if ($xhour == $hour) {\n $sel = 'selected=\"selected\"';\n } else {\n $sel = '';\n }\n echo '<option '.$sel.'>'.pnVarPrepForDisplay($xhour).'</option>';\n $xhour = $dummy;\n $xhour++;\n }\n echo '</select>&nbsp;';\n echo ': <select name=\"min\">';\n $xmin = 0;\n while ($xmin <= 59) {\n if (($xmin == 0) OR ($xmin == 5)) {\n $xmin = \"0$xmin\";\n }\n if ($xmin == $min) {\n $sel = 'selected=\"selected\"';\n } else {\n $sel = '';\n }\n echo '<option '.$sel.'>'.pnVarPrepForDisplay($xmin).'</option>';\n $xmin = $xmin + 5;\n }\n echo '</select>&nbsp;';\n $xday = 1;\n echo _DAY.': <select name=\"day\">';\n while ($xday <= 31) {\n if ($xday == $day) {\n $sel = 'selected=\"selected\"';\n } else {\n $sel = '';\n }\n echo '<option '.$sel.'>'.pnVarPrepForDisplay($xday).'</option>';\n $xday++;\n }\n echo '</select>&nbsp;';\n $xmonth = 1;\n echo _MONTH.': <select name=\"month\">';\n while ($xmonth <= 12) {\n if ($xmonth == $month) {\n $sel = 'selected=\"selected\"';\n } else {\n $sel = '';\n }\n echo '<option '.$sel.'>'.pnVarPrepForDisplay($xmonth).'</option>';\n $xmonth++;\n }\n echo '</select>&nbsp;';\n echo _YEAR.': <input type=\"text\" name=\"year\" value=\"'.pnVarPrepForDisplay($year).'\" size=\"5\" maxlength=\"4\" /><br />';\n }\n}", "function the_date_xml()\n {\n }", "function dms_get_date($var_name, $current_value = -1)\n\t{\n\tif($current_value != -1)\n\t\t{\n\t\t$month = (int)strftime(\"%m\",$current_value);\n\t\t$day = (int)strftime(\"%d\",$current_value);\n\t\t$year = (int)strftime(\"%Y\",$current_value);\n\t\t}\n\t\t\n// Get Month\n\tprint \"<select name='slct_\".$var_name.\"_month'>\\r\";\n\tfor($index = 1;$index <= 12; $index++)\n\t\t{\n\t\t$selected = \"\";\n\t\tif( ($current_value != -1) && ($index == $month) ) $selected = \"SELECTED\";\n\t\tprint \" <option \".$selected.\">\".$index.\"</option>\\r\";\n\t\t}\n\tprint \"</select>\\r\";\n\n\tprint \"/&nbsp;\";\n\t\n// Get Day\n\tprint \"<select name='slct_\".$var_name.\"_day'>\\r\";\n\tfor($index = 1;$index <= 31; $index++)\n\t\t{\n\t\t$selected = \"\";\n\t\tif( ($current_value != -1) && ($index == $day) ) $selected = \"SELECTED\";\n\t\tprint \" <option \".$selected.\">\".$index.\"</option>\\r\";\n\t\t}\n\tprint \"</select>\\r\";\n\n\tprint \"/&nbsp;\";\n\t\n// Get Year\n\tprint \"<select name='slct_\".$var_name.\"_year'>\\r\";\n\tfor($index = 2007;$index <= 2030; $index++)\n\t\t{\n\t\t$selected = \"\";\n\t\tif( ($current_value != -1) && ($index == $year) ) $selected = \"SELECTED\";\n\t\tprint \" <option \".$selected.\">\".$index.\"</option>\\r\";\n\t\t}\n\tprint \"</select>\\r\";\n\t}", "function date_tools_wizard_required_modules($options = array()) {\n $options = date_tools_wizard_options($options);\n $modules = array(\n 'date_timezone', 'date_api', 'content', 'date', \n 'calendar', 'views', 'views_ui',\n );\n if (in_array('popups', $options)) {\n $modules = array_merge($modules, array('date_popup', 'jcalendar'));\n }\n if (in_array('repeat', $options)) {\n $modules = array_merge($modules, array('date_repeat'));\n }\n return $modules;\n}", "private function _init_date()\n\t{\n\t\t$this->date->init($this->EE->TMPL->fetch_param('date'));\n\t\t$this->_log(sprintf(\"Working date set to %s %s\", $this->date->date(), $this->date->time()));\n\t}", "function print_date_selection_set( $p_name, $p_format, $p_date = 0, $p_default_disable = false, $p_allow_blank = false, $p_year_start = 0, $p_year_end = 0, $p_input_css = \"input-sm\" ) {\n\tif( $p_date != 0 ) {\n\t\t$t_date = date( $p_format, $p_date );\n\t} else {\n\t\t$t_date = '';\n\t}\n\n\t$t_disable = '';\n\tif( $p_default_disable == true ) {\n\t\t$t_disable = ' readonly=\"readonly\"';\n\t}\n\n \techo '<input ' . helper_get_tab_index() . ' type=\"text\" name=\"' . $p_name . '_date\" ' .\n\t\t' class=\"datetimepicker ' . $p_input_css . '\" ' . $t_disable .\n\t\t' data-picker-locale=\"' . lang_get_current_datetime_locale() . '\"' .\n\t\t' data-picker-format=\"' . convert_date_format_to_momentjs( $p_format ) . '\"' .\n\t\t' size=\"16\" maxlength=\"20\" value=\"' . $t_date . '\" />';\n\techo '<i class=\"fa fa-calendar fa-xlg datetimepicker\"></i>';\n}", "function selectDateEntry($display,$namePre,$month,$day,$year,$errors)\n{\n\t$returnVal = \"<tr>\n\t\t<td>$display:</td>\n\t\t<td>\n\t\t\t<select name='$namePre\" . \"Month'>\";\n\t\t\tfor ($i=1; $i<=12; $i++)\n\t\t\t{\n\t\t\t\tif ($i == $month)\n\t\t\t\t{\n\t\t\t\t\t$returnVal .= \"<option value='$i' selected>\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$returnVal .= \"<option value='$i'>\";\n\t\t\t\t}\n\t\t\t\t$returnVal .= monthAsString($i) . \"</option>\";\n\t\t\t}\n\t\t\t$returnVal .= \"</select>\n\t\t\t<select name='$namePre\" . \"Day'>\";\n\t\t\tfor ($i=1; $i<=31; $i++)\n\t\t\t{\n\t\t\t\tif ($i == $day)\n\t\t\t\t{\n\t\t\t\t\t$returnVal .= \"<option value='$i' selected>\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$returnVal .= \"<option value='$i'>$i</option>\";\n\t\t\t\t}\n\t\t\t\t$returnVal .= \"$i</option>\";\n\t\t\t}\n\t\t\t$returnVal .= \"</select>\n\t\t\t<select name='$namePre\" . \"Year'>\";\n\t\t\tfor ($i=date('Y'); $i>=1900; $i=$i-1)\n\t\t\t{\n\t\t\t\tif ($i == $year)\n\t\t\t\t{\n\t\t\t\t\t$returnVal .= \"<option value='$i' selected>\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$returnVal .= \"<option value='$i'>$i</option>\";\n\t\t\t\t}\n\t\t\t\t$returnVal .= \"$i</option>\";\n\t\t\t}\n\t\t\t$returnVal .= \"</select>\n\t\t</td>\n\t</tr>\";\n\n\tif (array_key_exists($namePre . 'Date',$errors))\n\t{\n\t\t$returnVal .= addErrorRow($namePre . 'Date',$errors);\n\t}\n\treturn $returnVal;\n}", "function page_dates() {\r\n \t\tglobal $admin_lang, $extern_action, $extern_sure, $extern_topic, $extern_date, $extern_place, $extern_id, $_SERVER, $actual_user_id, $actual_user_showname;\r\n\t\t\r\n\t\tif(!isset($extern_action))\r\n\t\t\t$extern_action = '';\r\n\t\t\r\n\t\t$out = \"\\t\\t\\t<h3>\" . $admin_lang['dates'] . \"</h3><hr />\\r\\n\";\r\n\t\t\r\n\t\t//\r\n\t\t// delete the selected entrie\r\n\t\t//\r\n\t\tif($extern_action == \"delete\") {\r\n\t\t\tif(isset($extern_sure)) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\tif($extern_sure == 1)\r\n\t\t\t\t\tdb_result(\"DELETE FROM \" . DB_PREFIX . \"dates WHERE date_id=\" . $extern_id);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$result = db_result(\"SELECT * FROM \" . DB_PREFIX . \"dates WHERE date_id=\" . $extern_id);\r\n\t\t\t\t$row = mysql_fetch_object($result);\r\n\t\t\t\t$out .= \"Den News Eintrag &quot;\" . $row->date_topic . \"&quot; wirklich löschen?<br />\r\n\t\t\t<a href=\\\"admin.php?page=dates&amp;action=delete&amp;id=\" . $extern_id . \"&amp;sure=1\\\" title=\\\"Wirklich Löschen\\\">ja</a> &nbsp;&nbsp;&nbsp;&nbsp;\r\n\t\t\t<a href=\\\"admin.php?page=dates\\\" title=\\\"Nicht Löschen\\\">nein</a>\";\r\n\t\t\t\r\n\t\t\t\treturn $out;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//\r\n\t\t// add a new entrie\r\n\t\t//\r\n\t\telseif($extern_action == \"new\") {\r\n\t\t\tif($extern_topic != \"\" && $extern_place != \"\" && $extern_date != \"\") {\r\n\t\t\t\t$date = explode(\".\", $extern_date);\r\n\t\t\t\tdb_result(\"INSERT INTO \".DB_PREFIX.\"dates (date_topic, date_place, date_date, date_creator) VALUES ('\".$extern_topic.\"', '\".$extern_place.\"', '\".mktime(0, 0, 0, $date[1], $date[0], $date[2]).\"', '$actual_user_id')\");\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t//\r\n\t\t// update the selected entrie\r\n\t\t//\r\n\t\telseif($extern_action == \"update\") { \r\n\t\t\tif($extern_topic != \"\" && $extern_place != \"\" && $extern_date != \"\" && $extern_id != 0) {\r\n\t\t\t\t$date = explode(\".\", $extern_date);\r\n\t\t\t\tdb_result(\"UPDATE \".DB_PREFIX.\"dates SET date_topic= '\".$extern_topic.\"', date_place= '\".$extern_place.\"', date_date='\".mktime(0, 0, 0, $date[1], $date[0], $date[2]).\"' WHERE date_id=\".$extern_id);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif($extern_action != \"edit\") {\r\n\t\t\t$out .= \"\\t\\t\\t<form method=\\\"post\\\" action=\\\"admin.php\\\">\r\n\t\t\t\t<input type=\\\"hidden\\\" name=\\\"page\\\" value=\\\"dates\\\" />\r\n\t\t\t\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"new\\\" />\r\n\t\t\t\t<table>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>\" . $admin_lang['date'] . \": <span class=\\\"info\\\">Dies ist das Datum, an dem die Veranstaltung stattfindet (Format: TT.MM.YYYY, Beispiel: 05.11.2005)</span></td>\r\n\t\t\t\t\t\t<td><input type=\\\"text\\\" name=\\\"date\\\" maxlength=\\\"10\\\" value=\\\"\\\" /></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>\" . $admin_lang['location'] . \": <span class=\\\"info\\\">Gemeint ist hier der Ort an welchem die Veranstaltung stattfindet.</span></td>\r\n\t\t\t\t\t\t<td><input type=\\\"text\\\" name=\\\"place\\\" maxlength=\\\"60\\\" value=\\\"\\\" /></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>\" . $admin_lang['topic'] . \": <span class=\\\"info\\\">Dies ist die Beschreibung des Termins</span></td>\r\n\t\t\t\t\t\t<td><input type=\\\"text\\\" name=\\\"topic\\\" maxlength=\\\"150\\\" /></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>Eingelogt als \" . $actual_user_showname . \" &nbsp;</td><td><input type=\\\"submit\\\" class=\\\"button\\\" value=\\\"Senden\\\" />&nbsp;<input type=\\\"reset\\\" class=\\\"button\\\" value=\\\"Zurücksetzen\\\" /></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t\t<br />\r\n\t\t\t</form>\\r\\n\";\r\n\t\t}\r\n\t\t\t$out .= \"\\t\\t\\t<form method=\\\"post\\\" action=\\\"admin.php\\\">\r\n\t\t\t\t<input type=\\\"hidden\\\" name=\\\"page\\\" value=\\\"dates\\\" />\r\n\t\t\t\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"update\\\" />\r\n\t\t\t\t<table>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>\" . $admin_lang['date'] . \":</td>\r\n\t\t\t\t\t\t<td>\" . $admin_lang['location'] . \":</td>\r\n\t\t\t\t\t\t<td>\" . $admin_lang['topic'] . \":</td>\r\n\t\t\t\t\t\t<td>\" . $admin_lang['creator'] . \":</td>\r\n\t\t\t\t\t\t<td>\" . $admin_lang['actions'] . \":</td>\r\n\t\t\t\t\t</tr>\\r\\n\";\r\n\t\t//\r\n\t\t// write all news entries\r\n\t\t//\r\n\t\t$result = db_result(\"SELECT * FROM \" . DB_PREFIX . \"dates ORDER BY date_date ASC\");\r\n\t\twhile($row = mysql_fetch_object($result)) {\r\n\t\t\t//\r\n\t\t\t// show an editform for the selected entrie\r\n\t\t\t//\r\n\t\t\tif($extern_id == $row->date_id && $extern_action == \"edit\") {\r\n\t\t\t\t$out .= \"\\t\\t\\t\\t\\t<tr id=\\\"dateid\" . $row->date_id . \"\\\">\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<input type=\\\"hidden\\\" name=\\\"id\\\" value=\\\"\".$row->date_id.\"\\\" />\r\n\t\t\t\t\t\t\t<input type=\\\"text\\\" name=\\\"date\\\" maxlength=\\\"10\\\" value=\\\"\" . date(\"d.m.Y\", $row->date_date) . \"\\\" />\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<input type=\\\"text\\\" name=\\\"place\\\" maxlength=\\\"60\\\" value=\\\"\" . $row->date_place . \"\\\" />\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<input type=\\\"text\\\" name=\\\"topic\\\" value=\\\"\" . $row->date_topic . \"\\\" maxlength=\\\"150\\\" />\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\" . getUserByID($row->date_creator) . \"\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<input type=\\\"submit\\\" value=\\\"Speichern\\\" class=\\\"button\\\" />\r\n\t\t\t\t\t\t\t&nbsp;<a href=\\\"admin.php?page=dates&amp;action=delete&amp;id=\".$row->date_id.\"\\\" title=\\\"Löschen\\\">Löschen</a>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\";\r\n\t\t\t}\r\n\t\t\t//\r\n\t\t\t// show only the entrie\r\n\t\t\t//\r\n\t\t\telse {\r\n\t\t\t\t$out .= \"\\t\\t\\t\\t\\t<tr ID=\\\"dateid\" . $row->date_id . \"\\\">\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\" . date(\"d.m.Y\", $row->date_date) . \"\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\" . $row->date_place . \"\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\" . nl2br($row->date_topic) . \"\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\" . getUserByID($row->date_creator) . \"\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td colspan=\\\"2\\\">\r\n\t\t\t\t\t\t\t<a href=\\\"admin.php?page=dates&amp;action=edit&amp;id=\".$row->date_id.\"#dateid\".$row->date_id.\"\\\" title=\\\"Bearbeiten\\\">Bearbeiten</a>\r\n\t\t\t\t\t\t\t&nbsp;<a href=\\\"admin.php?page=dates&amp;action=delete&amp;id=\".$row->date_id.\"\\\" title=\\\"Löschen\\\">Löschen</a>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\\r\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t$out .= \"\\t\\t\\t\\t</table>\r\n\t\t\t</form>\";\r\n\t\r\n\t\treturn $out;\r\n \t}", "function wc_marketplace_date2() {\n global $wmp;\n $wmp->output_report_date2();\n }", "public function stdWrap_dateDataProvider() {}", "function wp_checkdate($month, $day, $year, $source_date)\n {\n }", "function DateDropDowns($name,$sel,$attr,$class_time,$class_date,$showdate,$tag_between,$p=array(),$return=false) {\n\tif (!is_array($p)) {\n\t\t$p = array();\t\n\t}\n\tif (is_array($sel)) {\n\t\t$sel = sprintf('%04d-%02d-%02d %02d:%02d:00', $sel['Year'],$sel['Month'],$sel['Day'],$sel['Hour'],$sel['Minute']);\n\t}\n\telseif (is_numeric($sel)) {\n\t\t$sel = Date::td($sel);\n\t}\n\t$tag_sep = ' ';\n\tif (is_array($tag_between)) {\n\t\t$tag_sep = $tag_between[1];\n\t\t$tag_between = $tag_between[0];\t\n\t}\n\tif (!isset($p['hour_next'])) $p['hour_next'] = 0;\n\tif (!isset($p['minute_next'])) $p['minute_next'] = 0;\n\n\t\n\tif (!isset($p['empty'])) $p['empty'] = false;\n\t\n\tif (!$sel || $sel=='0000-00-00 00:00:00') {\n\t\tif (!$p['empty']) {\n\t\t\t$sel = Date::now($p['year_next'],$p['month_next'],$p['day_next'],$p['hour_next'],$p['minute_next']);\n\t\t}\n\t}\n\t$year_sel = $month_sel = $day_sel = $minute_sel = $hour_sel = '';\n\t$l = strlen($sel);\n\tif ($l==19 || $l==10) {\n\t\t$year_sel = (int)substr($sel, 0, 4);\n\t\t$month_sel = (int)substr($sel, 5, 2);\n\t\t$day_sel = (int)substr($sel, 8, 2);\n\t\tif ($l!=10) {\n\t\t\t$hour_sel = (int)substr($sel, 11, 2);\n\t\t\t$minute_sel = (int)substr($sel, 14, 2);\n\t\t}\n\t} elseif ($l==8) {\n\t\t$hour_sel = (int)substr($sel, 0, 2);\n\t\t$minute_sel = (int)substr($sel, 3, 2);\n\t}\n\tif (!$p['empty']) {\n\t\tif (!$day_sel) $day_sel = Date::day();\n\t\tif (!$month_sel) $day_sel = date('m');\n\t\tif (!$year_sel) $year_sel = date('Y');\n\t\tif (!$hour_sel) $hour_sel = Date::hour();\n\t\tif (!$minute_sel) $minute_sel = Date::minute();\n\t}\n\telseif ($l!=19 && $l!=10) {\n\t\t$hour_sel = -1;\n\t\t$minute_sel = -1;\n\t}\n\t$time = $date = '';\t\n\t$attr = ' style=\"width:auto\"'.$attr;\n\t\n\tif (!$p['hour_from']) $p['hour_from'] = 0;\n\tif (!$p['hour_to']) $p['hour_to'] = 23;\n\tif (!$p['minute_from']) $p['minute_from'] = 0;\n\tif (!$p['minute_to']) $p['minute_to'] = 59;\n\tif (!$p['month_from']) $p['month_from'] = 1;\n\tif (!$p['month_to']) $p['month_to'] = 12;\n\tif (!$p['day_from']) $p['day_from'] = 1;\n\t\n\tif (!$p['day_to']) {\n\t\tif (!$p['day_to']) $p['day_to'] = 31;\n\t}\n\t$e = '';\n\t\n\tif (strpos($name,'[')) $e = ']';\n\tif ($showdate=='front' || $showdate=='left' || $showdate=='end' || $showdate=='right' || $showdate=='no_date') {\n\t\t// Hours\n\t\t$time .= '<select name=\"'.$name.'Hour'.$e.'\" id=\"'.name2id($name.'Hour'.$e).'\" class=\"'.$class_time.' select-hour\"'.$attr.'>';\n\t\tif ($p['empty']) $time .= '<option value=\"\"></option>';\n\t\t$time .= dateToOpts($p['hour_from'],$p['hour_to'],$p['hour_step'],0,23,$hour_sel,'hour',false,@$p['now']);\n\t\t$time .= '</select>';\n\t\t// Minutes\n\t\t$time .= ' <select name=\"'.$name.'Minute'.$e.'\" id=\"'.name2id($name.'Minute'.$e).'\" class=\"'.$class_time.' select-minute\"'.$attr.'>';\n\t\tif ($p['empty']) $time .= '<option value=\"\"></option>';\n\t\t$time .= dateToOpts($p['minute_from'],$p['minute_to'],$p['minute_step'],0,59,$minute_sel,'minute',false,@$p['now']);\n\t\t$time .= '</select>';\n\t}\n\t\n\tif ($showdate!='no_date') {\n\t\tif ($showdate=='front' || $showdate=='left') $date .= $tag_between;\n\t\t// Days\n\t\t$date .= '<select name=\"'.$name.'Day'.$e.'\" id=\"'.name2id($name.'Day'.$e).'\" class=\"'.$class_date.' select-day\"'.$attr.'>';\n\t\tif ($p['empty']) $date .= '<option value=\"\"'.(!$day_sel?' selected disabled':'').'>'.lang('_Day').'</option>';\n\t\t$date .= dateToOpts($p['day_from'],$p['day_to'],$p['day_step'],0,$p['day_to'],$day_sel,'day');\n\t\t$date .= '</select>';\n\t\t// Months\n\t\t$date .= $tag_sep.'<select name=\"'.$name.'Month'.$e.'\" id=\"'.name2id($name.'Month'.$e).'\" class=\"'.$class_date.' select-month\"'.$attr.'>';\n\t\tif ($p['empty']) $date .= '<option value=\"\"'.(!$month_sel?' selected disabled':'').'>'.lang('_Month').'</option>';\n\t\tif (!isset($p['months']) || !$p['months']) $p['months'] = Data::getArray('arr:months_med');\n\t\t$date .= dateToOpts($p['month_from'],$p['month_to'],$p['month_step'],1,12,$month_sel,'month',$p['months']);\n\t\t$date .= '</select>';\n\t\t// Years\n\t\tif ($p['year_from']-$p['year_to']<>0) {\n\t\t\t$date .= $tag_sep.'<select name=\"'.$name.'Year'.$e.'\" id=\"'.name2id($name.'Year'.$e).'\" class=\"'.$class_date.' select-year\"'.$attr.'>';\n\t\t\tif ($p['empty']) $date .= '<option value=\"\"'.(!$year_sel?' selected disabled':'').'>'.lang('_Year').'</option>';\n\t\t\t$date .= dateToOpts($p['year_from'],$p['year_to'],$p['year_step'],date('Y')-TOTAL_YEARS,date('Y')+TOTAL_YEARS,$year_sel,'year');\n\t\t\t$date .= '</select>';\n\t\t}\n\t\tif ($showdate=='end' || $showdate=='right') $date .= $tag_between;\n\t}\n\t\n\tif ($showdate=='front') $ret = $time.$date; else $ret = $date.$time;\n\tif ($return) return $ret; else echo $ret;\n}", "function form_date($variable='date', $date='', $nopop = false) {\n\n\tglobal $request;\n\n\t/***********\n\t* Select the current date\n\t***********/\n\n\t// use now\n\tif ($date == 'NOW') {\n\n\t\t$date = convert_gmt_timestamp_to_local_input(TIMENOW);\n\n\t// use the value submitted by form\n\t} elseif ($date == 'FORM') {\n\n\t\t$date = $request->getArrayString($variable);\n\n\t// use a numeric\n\t} elseif (is_numeric($date) AND $date > 0) {\n\t\t$date = convert_gmt_timestamp_to_local_input($date);\n\t}\n\n\t// the other option is an array for $date; which all the others are converted to so it is covered\n\tif (dpcheckdate($date)) {\n\t\t$month = $date['month'];\n\t\t$day = $date['day'];\n\t\t$year = $date['year'];\n\t}\n\n\t// we load the javascript & css if this is first time here\n\tif (!defined('DESKPRO_JSLOADED_DATA')) {\n\t\t$html .= get_javascript('./../3rdparty/selectcalendar/calendar.js');\n\t\t$html .= get_javascript('./../3rdparty/selectcalendar/lang/calendar-en.js');\n\t\t$html .= get_javascript('./../3rdparty/selectcalendar/calendar-setup.js');\n\t\t$html .= get_css('./../3rdparty/selectcalendar/calendar-win2k-cold-1.css');\n\t\tdefine('DESKPRO_JSLOADED_DATA', 1);\n\t}\n\n\t// random button link\n\t$button = 'data' . dp_rand(1,1000000);\n\n\t// the html for creating the calendar\n\t$html .= \"\n\t<table cellspacing=\\\"0\\\" cellpadding=\\\"0\\\"><tr>\n\t\t<td style=\\\"padding-right:4px\\\">\" . form_select_day($variable . '[day]', $day, $variable . '_day') . \"</td>\n\t\t<td style=\\\"padding-right:4px\\\">\" . form_select_month($variable . '[month]', $month, $variable . '_month'). \"</td>\n\t\t<td style=\\\"padding-right:4px\\\">\" . form_select_year($variable . '[year]', $year, $variable . '_year') . \"</td>\n\t\t<td style=\\\"padding-right:4px\\\">\n\n\t<input style=\\\"display:none\\\" type=\\\"text\\\" value=\\\"$current\\\" name=\\\"$variable\" . \"_selector\\\" id=\\\"$variable\\\" /></td>\";\n\n\tif (!$nopop) {\n\n\t\t$html .= \"<td>\" . html_image('icons/view_calendar.gif', '', \"id=\\\"$button\\\" title=\\\"Date selector\\\"\n onmouseover=\\\"this.style.background='red';\\\" onmouseout=\\\"this.style.background=''\\\"\");\n\n\t\tif ($time) {\n\n\t\t\t$html .= \"\n\t\t\t<script type=\\\"text/javascript\\\">\n\t\t\t\tCalendar.setup({\n\t\t\t\t\tinputField : \\\"$variable\" . \"_selector\\\",\n\t\t\t\t\tifFormat : \\\"%Y-%m-%d %H:%M\\\",\n\t\t\t\t\tshowsTime : true,\n\t\t\t\t\tbutton : \\\"$button\\\",\n\t\t\t\t\tsingleClick : true,\n\t\t\t\t\talign\t\t\t:\t'Bl',\n\t\t\t\t\tstep : 1,\n\t\t\t\t\tonSelect : onSelect\n\t\t\t\t});\n\t\t\t</script>\n\t\t\t\";\n\n\t\t} else {\n\n\t\t\t$html .= \"\n\t\t\t<script type=\\\"text/javascript\\\">\n\t\t\t\tCalendar.setup({\n\t\t\t\t\tinputField : \\\"$variable\\\",\n\t\t\t\t\tifFormat : \\\"%Y-%m-%d\\\",\n\t\t\t\t\tshowsTime : false,\n\t\t\t\t\tbutton : \\\"$button\\\",\n\t\t\t\t\tsingleClick : true,\n\t\t\t\t\talign\t\t\t:\t'Bl',\n\t\t\t\t\tstep : 1,\n\t\t\t\t\tonSelect : onSelect\n\t\t\t\t});\n\t\t\t</script>\n\t\t\t\";\n\n\t\t}\n\n\t\t$html .= \"</td>\";\n\n\t}\n\n\t$html .= \"</tr></table>\";\n\n\treturn $html;\n}", "function wc_marketplace_date() {\n global $wmp;\n $wmp->output_report_date();\n }", "function action_date_title()\n{\n\treturn time();\n}", "function calendar($url,$class='') {\n\n\tglobal $width;\n\tglobal $cell_width;\n\tglobal $legend_height;\n\tglobal $entry_color;\n\tglobal $entry_background_color;\n\tglobal $today_color;\n\tglobal $today_background_color;\n\tglobal $l_calendar;\n\tglobal $blog_script;\n\tglobal $lang;\n\tglobal $mysql_table;\n\t\n\tif ($_GET['date'] != '') {\n\t\t$MyDate = intval($_GET['date']);\n\t\t$year = substr($MyDate,0,4);\n\t\t$month = substr($MyDate,4,-2);\n\t} else {\n\t\t$month = date(\"n\");\n\t\t$year = date(\"Y\");\n\t}\n\t\n\t$prev = $month - 1;\n\t$next = $month + 1;\n\t$yearP = $year;\n\t$yearN = $year;\n\tif ($prev == \"0\") { $yearP--; $prev = \"12\"; }\n\tif ($prev < 10) $prev = '0'.$prev;\n\tif ($next == \"13\") { $yearN++; $next = \"1\"; }\n\tif ($next < 10) $next = '0'.$next;\n\n\t$transform_month = array(\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"11\",\"12\");\n\t$into_month = array('Janvier','F&eacute;vrier','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','D&eacute;cembre');\n\t\n\tfor ($l = 0; $l < 12; $l++) {\n\t\tif ($month == $transform_month[$l]) {\n\t\t\t$month_word = $into_month[$l];\n\t\t}\n\t}\n\n\t$output .= '<table style=\"width: '.$width.'; height: '.$legend_height.'\" class=\"'.$class.'\">\n\t<tr>\n\t\t<!--<td style=\"width: 10%; text-align: left;\"><a href=\"'.$url.'&date='.$yearP.$prev.'00\">&laquo;</a></td>-->\n\t\t<td colspan=\"7\"><b>'.strtoupper($month_word).' '.$year.'</b></td>\n\t\t<!--<td style=\"width: 10%; text-align: right;\"><a href=\"'.$url.'&date='.$yearN.$next.'00\">&raquo;</a></td>-->\n\t</tr>\n\t<tr align=\"center\">\n\t\t<td><b>L</b></td>\n\t\t<td><b>M</b></td>\n\t\t<td><b>M</b></td>\n\t\t<td><b>J</b></td>\n\t\t<td><b>V</b></td>\n\t\t<td><b>S</b></td>\n\t\t<td><b>D</b></td>\n\t</tr>\n\t<tr align=\"center\">';\n\t\n\t$no_days = date(\"t\", mktime(0, 0, 0, $month, 1, $year));\n\t$first_day = date(\"w\", mktime(0, 0, 0, $month, 1, $year));\n\t$today_day = date(\"j\");\n\t$today_month = date(\"n\");\n\t$today_year = date(\"Y\");\n\t\n\tif ($first_day == \"0\") $first_day = \"7\";\n\t\n\tfor ($i = 0; $i < $first_day-1; $i++) $output .= '<td style=\"width:'.$cell_width.';\">&nbsp;</td>';\n\n\tfor ($i = 1; $i <= $no_days; $i++) {\n\t\t//$result = mysql_query(\"SELECT id FROM blog WHERE DAYOFMONTH(timestamp)='$i' AND MONTH(timestamp) = '$month' AND YEAR(timestamp) = '$year' ORDER BY id DESC;\");\n\t\t$selectDate = $year.$month.($i<10?'0'.$i:$i);\n\t\t$result = mysql_query(\"SELECT id FROM blog WHERE datepubli='$selectDate' LIMIT 1 \");\n\t\t$num = mysql_num_rows($result);\n\t\t//$res = mysql_fetch_array($result);\n\t\n\t\tif ($first_day == \"8\") { $first_day = \"1\"; $output .= '<tr style=\"width: '.$width.';\" align=\"center\">'; }\n\t\tif ($i < 10) $space = ' '; else $space = '';\n\t\n\t\tif ($i == $today_day && $month == $today_month && $year == $today_year) \n\t\t\t$style = 'background-color: '.$today_background_color.'; color: '.$today_color.'; font-weight: bold;';\n\t\telse $style = '';\n\t\tif (intval($_GET['date']) == $selectDate) $style .= 'border:1px solid #000000;';\n\t\t\n\t\tif ($num < 1) $output .= '<td style=\"'.$style.' width: '.$cell_width.';\">'.$i.'</td>';\n\t\telse $output .= '<td style=\"background-color:'.$entry_background_color.';'.$style.'width: '.$cell_width.';color: '.$entry_color.';\"><a href=\"'.$url.'&date='.$selectDate.'\" style=\"color: '.$today_color.'\" title=\"Voir le sujet posté à cette date\">'.$i.'</a></td>';\n\t\t\n\t\tif ($first_day == \"7\") $output .= '</tr>';\n\t\t$first_day++;\n\t}\n\t\n\t$output .= '</table>';\n\t\n\treturn $output;\n\n}", "function BeforeShowEdit(&$xt, &$templatefile, $values, &$pageObject)\n{\n\n\t\t$dbDate = db2time( $values[\"DateField\"] );\n$dbEndDate = db2time( $values[\"EndDate\"] );\n$recur = 0; \nif (comparedates( $dbEndDate, $dbDate) != 0) {\n\t\t\t$recur = 1;\n}\n$eid=$_REQUEST[\"editid1\"];\n$xt->assign(\"delete_button\",true);\n$xt->assign(\"hshow\",false);\n$xt->assign(\"deleteAttr\",\"recid=\".$eid.\" days=\".$_SESSION[\"days\"].\" mon=\".$_SESSION[\"mon\"].\" yr=\".$_SESSION[\"yr\"].\" recur=\".$recur);\n\n;\t\t\n}", "function cfdef_input_date( $p_field_def, $p_custom_field_value ) {\n\tprint_date_selection_set( 'custom_field_' . $p_field_def['id'], config_get( 'short_date_format' ), $p_custom_field_value, false, true );\n}", "function validate_date_picker_field($field)\n {\n }", "function _field_date($fval) \n {\n // if $fval is not already split up, we assume std. date string // YYYY-MM-DD\n if (is_array($fval)) {\n $f_date = &$fval;\n }\n elseif ($fval) {\n $f_date = split('-', $fval, 3);\n }\n else {\n $f_date = array('','','');\n }\n\n $res = \"<span id=\\\"\" . $this->name . \"\\\">\";\n\n for ($i=1; $i<32; $i++) { $days[sprintf(\"%02d\", $i)] = $i; }\n\n $months_abbr = array(\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\");\n for ($i=1; $i<13; $i++) { $months[sprintf(\"%02d\", $i)] = $months_abbr[$i-1]; }\n\n $fmonths = new formex_field($this->fex, $this->name.'_month', array('Months', 'select', $months));\n $res .= $fmonths->get_html($f_date[1]);\n\n if (isset($this->attribs) and !isset($this->attribs['suppress_day'])) {\n $fdays = new formex_field($this->fex, $this->name.'_day', array('Dates', 'select', $days));\n $res .= $fdays->get_html($f_date[2]);\n }\n\n $year_range = null;\n $this_year = date('Y');\n if (isset($this->opts) and is_numeric($this->opts)) { // int val will be this year +\n $year_range = $this->_array_stringify(range($this_year, $this_year+$this->opts));\n }\n elseif (isset($this->attribs) && is_array($this->attribs)) { // exact range specified\n $begin = (isset($this->attribs['year_begin']))? $this->attribs['year_begin'] : $this_year;\n $end = $this_year;\n if (isset($this->attribs['year_end'])) {\n if (substr($this->attribs['year_end'], 0, 4) == 'now+') {\n $end = $this_year + intval(substr($this->attribs['year_end'], 4));\n }\n elseif (substr($this->attribs['year_end'], 0, 4) == 'now-') {\n $end = $this_year - intval(substr($this->attribs['year_end'], 4));\n }\n elseif (substr($this->attribs['year_end'], 0, 1) == '+') {\n $end = $begin + intval(substr($this->attribs['year_end'], 1));\n }\n elseif (substr($this->attribs['year_end'], 0, 1) == '-') {\n $end = $begin - intval(substr($this->attribs['year_end'], 1));\n }\n else {\n $end = intval($this->attribs['year_end']);\n }\n }\n\n if ($begin != $end) {\n $year_range = $this->_array_stringify(range($begin, $end));\n }\n }\n\n if ($year_range) { // dropdown w/ that range\n $fyears = new formex_field($this->fex, $this->name.'_year', array('Years', 'select', $year_range));\n }\n else { // 4-space text field\n $fyears = new formex_field($this->fex, $this->name.'_year', array('Years', 'text', null, array('size'=>4)));\n }\n $res .= $fyears->get_html($f_date[0]);\n unset($fmonths, $fdays, $fyears);\n $res .= \"</span>\";\n\n return $res;\n }", "function TableRowDateOptionBox($date, $action, $dictionary, $fieldname=\"date\", $dateformat=\"Y-m-d H:i\", $title=\"\",\n\t\t$classtdTitle=\"inputParamName\", $classtdValue=\"inputParamValue\")\n{\n $stringUtils = new StringUtils ();\n $dateUtils = new DateUtils ();\n $result = '';\n\n if (isset($action))\n {\n\t \t$result = '<tr>';\n\t\t// First field contains the name\n\t\t$result .= '<td class=\"'.$classtdTitle.'\">'.$stringUtils->urlEncodeQuotes($title).':</td>';\n\t\t// Second field contains the value\n\t\t$result .= '<td class=\"'.$classtdValue.'\">';\n\t switch ($action)\n\t {\n\t \tcase 'add':\n\t \t\t$date = date ('Y-m-d');\n\t \tcase 'modify':\n\t $result .= '<select name=\"'.$fieldname.'_Month\">';\n\t\t\t\t$result .= monthOptionBox ($dictionary, $dateUtils->getMonthFromDate($date));\n\t\t\t\t$result .= '</select>';\n\t\t\t\t$result .= '<select name=\"'.$fieldname.'_Day\">';\n\t\t\t\t$result .= dayOptionBox ($dictionary, $dateUtils->getDayInMonthFromDate($date));\n\t\t\t\t$result .= '</select>';\n\t\t\t\t$result .= '<select name=\"'.$fieldname.'_Year\">';\n\t\t\t\t$result .= yearOptionBox($dateUtils->getYearFromDate($date), 10, 10);\n\t\t\t\t$result .= '</select>';\n\t \t\tbreak;\n\t\t\tcase 'show':\n\t\t\t\t$result .= date($dateformat, strtotime($date));\n\t\t}\n\t\t$result .= '</td>';\n\t\t$result .= '</tr>';\n\t}\n\n\treturn $result;\n}", "function _addMetadataFields()\n {\n $config =& NDB_Config::singleton();\n $this->dateOptions = array(\n 'language' => 'en',\n 'format' => 'YMd',\n 'minYear' => $config->getSetting('startYear'),\n 'maxYear' => $config->getSetting('endYear'),\n 'addEmptyOption' => true,\n 'emptyOptionValue' => null\n );\n\n $this->form->addElement('date', 'Date_taken', 'Date of Administration', $this->dateOptions);\n\n $examiners = $this->_getExaminerNames();\n $this->form->addElement('select', 'Examiner', 'Radiologist', $examiners);\n\n \t$this->form->addGroupRule('Date_taken', 'Date of Administration is required', 'required');\n\n $this->form->registerRule('checkdate', 'callback', '_checkDate');\n $this->form->addRule('Date_taken', 'Date of Administration is invalid', 'checkdate');\n\n $this->form->addRule('Examiner', 'Examiner is required', 'required');\n }", "function turnitintooltwo_generate_part_dates($renewdates, $datetype, $part, $i) {\n if ($renewdates) {\n switch ($datetype) {\n case 'start':\n return gmdate(\"Y-m-d\\TH:i:s\\Z\", time());\n case 'due':\n case 'post':\n return gmdate(\"Y-m-d\\TH:i:s\\Z\", strtotime(\"+1 week\"));\n default:\n return NULL;\n }\n } else {\n $attribute = \"dt\".$datetype.$i;\n return gmdate(\"Y-m-d\\TH:i:s\\Z\", $part->$attribute);\n }\n}", "function wpsp_tour_valid_date( $valid_from, $valid_end ) {\n \n printf( '%1$s %2$s <strong>%3$s</strong> %4$s <strong>%5$s</strong>',\n sprintf( '<span class=\"label\">%s</span>', esc_html__( 'Valid date:', 'discovertravel' ) ),\n sprintf( '%s', esc_html__( 'From', 'discovertravel' ) ),\n date(\"d F Y\", strtotime($valid_from)),\n sprintf( '%s ', esc_html__( 'to', 'discovertravel' ) ),\n date(\"d F Y\", strtotime($valid_end))\n );\n}", "function enableDatePicker($startYear=false,$endYear=false,$link=false,$button=false){\n\tif ($link) $this->urlPicker=$link;\n\telse $this->urlPicker=$_SERVER['PHP_SELF'];\n\tif ($startYear && $endYear){\n\t\tif ($startYear>=$this->startYear && $startYear<$this->endYear) $this->startYear=$startYear;\n\t\tif ($endYear>$this->startYear && $endYear<=$this->endYear) $this->endYear=$endYear;\n\t}\n\tif ($button) $this->selBtn=$button;\n$this->datePicker=true;\n}", "function cp_v2_framework_datepicker_admin_styles( $hook ) {\r\n\r\n\t$cp_page = strpos( $hook, CP_PRO_SLUG );\r\n\t$dev_mode = get_option( 'cp_dev_mode' );\r\n\tif ( '1' === $dev_mode ) {\r\n\t\twp_enqueue_script( 'cp-datetime-script', plugins_url( 'datetimepicker.js', __FILE__ ), array( 'cp-datetimepicker-script' ), '1.0.0', true );\r\n\t}\r\n\r\n}", "function drawFieldStartDate() {\r\n global $projectDate,$startDate; ?> \r\n <div dojoType=\"dijit.form.DateTextBox\"\r\n \t<?php if (sessionValueExists('browserLocaleDateFormatJs')) {\r\n\t\t\techo ' constraints=\"{datePattern:\\''.getSessionValue('browserLocaleDateFormatJs').'\\'}\" ';\r\n\t\t}?>\r\n id=\"startDatePlanView\" name=\"startDatePlanView\"\r\n invalidMessage=\"<?php echo i18n('messageInvalidDate')?>\"\r\n type=\"text\" maxlength=\"10\" \r\n <?php if ($projectDate) {echo 'disabled'; } ?> \r\n style=\"width:100px; text-align: center;\" class=\"input roundedLeft\"\r\n hasDownArrow=\"true\"\r\n value=\"<?php if(sessionValueExists('startDatePlanView') and !$projectDate){ echo getSessionValue('startDatePlanView'); }else{ echo $startDate; } ?>\" >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n saveDataToSession('startDatePlanView',formatDate(dijit.byId('startDatePlanView').get(\"value\")), true);\r\n refreshJsonPlanning();\r\n </script>\r\n </div>\r\n<?php \r\n}", "function generate_calendar($year, $month, $days = array(), $day_name_length = 3, $first_day = 0, $prev_link, $next_link)\n{\n\n\t$first_of_month = gmmktime(0,0,0,$month,1,$year);\n\t#remember that mktime will automatically correct if invalid dates are entered\n\t# for instance, mktime(0,0,0,12,32,1997) will be the date for Jan 1, 1998\n\t# this provides a built in \"rounding\" feature to generate_calendar()\n\n\t$day_names = array(); #generate all the day names according to the current locale\n\tfor($n=0,$t=(3+$first_day)*86400; $n<7; $n++,$t+=86400) #January 4, 1970 was a Sunday\n\t\t$day_names[$n] = ucfirst(gmstrftime('%A',$t)); #%A means full textual day name\n\n\tlist($month, $year, $month_name, $weekday) = explode(',',gmstrftime('%m,%Y,%B,%w',$first_of_month));\n\t$weekday = ($weekday + 7 - $first_day) % 7; #adjust for $first_day\n\t$title = htmlentities(ucfirst($month_name)).'&nbsp;'.$year; #note that some locales don't capitalize month and day names\t\n\t\n\n\n\t#Begin calendar. Uses a real <caption>. See http://diveintomark.org/archives/2002/07/03\n\t\n\t$calendar = '<div id=\"calendar-box\"><table class=\"calendar\">'.\"\\n\".\n\t\t'<caption class=\"calendar-month\">'.$prev_link.'&nbsp;&nbsp;&nbsp;&nbsp;';\n\n\t$calendar .= '<form class=\"cal-select\" method=\"GET\" action=\"manage.php\">\n\t\t\t\t\t<input type=\"hidden\" name=\"display\" value=\"month\" />\n\t\t\t\t\t<select name=\"month\">';\n\t$months = array(1=>'January',2=>'February',3=>'March',4=>'April',5=>'May',6=>'June',7=>'July',8=>'August',9=>'September',10=>'October',11=>'November',12=>'December');\n\t\n\tfor ($x = 1; $x <= 12; $x++)\n\t{\n\t\tif (isset($_GET['month']) || isset($_SESSION['lastMonthViewMonth']))\n\t\t{\n\t\t\tif (isset($_GET['month'])) { $m = $_GET['month']; } else { $m = $_SESSION['lastMonthViewMonth']; }\n\t\t\tif ($m == $x)\n\t\t\t\t$calendar .= '<option value=\"'.$x.'\" SELECTED>'.$months[$x].'</option>';\n\t\t\telse\n\t\t\t\t$calendar .= '<option value=\"'.$x.'\">'.$months[$x].'</option>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (date('n', time()) == $x)\n\t\t\t\t$calendar .= '<option value=\"'.$x.'\" SELECTED>'.$months[$x].'</option>';\n\t\t\telse\n\t\t\t\t$calendar .= '<option value=\"'.$x.'\">'.$months[$x].'</option>';\n\t\t}\n\t\t\n\t}\n\t$calendar .= '</select> <select name=\"year\">';\n\tfor ($x = 2010; $x <= 2070; $x++)\n\t{\t\n\t\tif (isset($_GET['year']) || isset($_SESSION['lastMonthViewYear']))\n\t\t{\n\t\t\tif (isset($_GET['year'])) { $y = $_GET['year']; } else { $y = $_SESSION['lastMonthViewYear']; }\n\t\t\tif ($y == $x)\n\t\t\t\t$calendar .= '<option value=\"'.$x.'\" SELECTED>'.$x.'</option>';\n\t\t\telse\n\t\t\t\t$calendar .= '<option value=\"'.$x.'\">'.$x.'</option>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (date('Y', time()) == $x)\n\t\t\t\t$calendar .= '<option value=\"'.$x.'\" SELECTED>'.$x.'</option>';\n\t\t\telse\n\t\t\t\t$calendar .= '<option value=\"'.$x.'\">'.$x.'</option>';\n\t\t}\n\t}\n\t$calendar .= '</select> <input type=\"submit\" value=\"view\" /></form>';\n\t\n\t$calendar .= '&nbsp;&nbsp;&nbsp;&nbsp;'.$next_link.\"</caption>\\n<tr class=\\\"day-names-row\\\">\";\n\n\tif($day_name_length){ #if the day names should be shown ($day_name_length > 0)\n\t\t#if day_name_length is >3, the full name of the day will be printed\n\t\tforeach($day_names as $d)\n\t\t\t$calendar .= '<th abbr=\"'.htmlentities($d).'\">'.htmlentities($day_name_length < 4 ? substr($d,0,$day_name_length) : $d).'</th>';\n\t\t$calendar .= \"</tr>\\n<tr class=\\\"day-row\\\">\";\n\t}\n\t\n\t// begin calendar days\n\tif($weekday > 0) $calendar .= '<td colspan=\"'.$weekday.'\">&nbsp;</td>'; #initial 'empty' days\n\tfor($day=1,$days_in_month=gmdate('t',$first_of_month); $day<=$days_in_month; $day++,$weekday++){\n\t\tif($weekday == 7){\n\t\t\t$weekday = 0; #start a new week\n\t\t\t$calendar .= \"</tr>\\n<tr class=\\\"day-row\\\">\";\n\t\t}\n\t\tif(isset($days[$day]) and is_array($days[$day]))\n\t\t{\n\t\t\t@list($classes, $content) = $days[$day];\n\t\t\tif(is_null($content)) $content = $day;\n\t\t\t$calendar .= '<td'.($classes ? ' class=\"'.htmlspecialchars($classes).'\">' : '>').\n\t\t\t\t($content).'</td></a>';\n\t\t}\n\t\telse $calendar .= '<td>'.$day.'</td>';\n\t}\n\tif($weekday != 7) $calendar .= '<td colspan=\"'.(7-$weekday).'\">&nbsp;</td>'; #remaining \"empty\" days\n\n\treturn $calendar.\"</tr>\\n</table></div>\\n\";\n}", "function drawOptionSaveDates() {\r\n global $projectDate, $saveDates; ?>\r\n <span title=\"<?php echo i18n('saveDates')?>\" dojoType=\"dijit.form.CheckBox\"\r\n type=\"checkbox\" id=\"listSaveDates\" name=\"listSaveDates\" class=\"whiteCheck\"\r\n <?php if ($projectDate) {echo 'disabled'; } ?> \r\n <?php if ( $saveDates) {echo 'checked=\"checked\"'; } ?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n refreshJsonPlanning();\r\n </script>\r\n </span>\r\n <span for=\"listSaveDates\"><?php echo i18n(\"saveDates\");?></span>\r\n<?php \r\n}", "function form_date($field, $options){\n $defaults = array(\n 'wrap' => true,\n 'label' => true,\n 'class' => array('date', 'input'),\n 'minYear' => date('Y') - 10,\n 'maxYear' => date('Y') + 10,\n 'months' => array(\n 1 => 'January',\n 2 => 'February',\n 3 => 'March',\n 4 => 'April',\n 5 => 'May',\n 6 => 'June',\n 7 => 'July',\n 8 => 'August',\n 9 => 'September',\n 10 => 'October',\n 11 => 'November',\n 12 => 'December'\n ),\n 'days' => array(\n 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8,\n 9 => 9, 10 => 10, 11 => 11, 12 => 12, 13 => 13, 14 => 14, 15 => 15,\n 16 => 16, 17 => 17, 18 => 18, 19 => 19, 20 => 20, 21 => 21, 22 => 22,\n 23 => 23, 24 => 24, 25 => 25, 26 => 26, 27 => 27, 28 => 28, 29 => 29,\n 30 => 30, 31 => 31\n ),\n 'separator' => '-'\n );\n\n $options = array_merge($defaults, $options);\n\n $years = array();\n for($i = $options['minYear']; $i <= $options['maxYear']; $i++) {\n $years[$i] = $i;\n }\n\n if(empty($_POST[$field . '[day]'])) {\n $today = date('j');\n if(!empty($options['days'][$today])) {\n $_POST[$field . '[day]'] = $today;\n }\n }\n\n $output = form_select(\n $field . '[day]',\n array(\n 'wrap' => false,\n 'label' => false,\n 'options' => $options['days']\n )\n );\n\n $output .= $options['separator'];\n\n if(empty($_POST[$field . '[month]'])) {\n $today = date('n');\n if(!empty($options['months'][$today])) {\n $_POST[$field . '[month]'] = $today;\n }\n }\n\n $output .= form_select(\n $field . '[month]',\n array(\n 'wrap' => false,\n 'label' => false,\n 'options' => $options['months']\n )\n );\n\n $output .= $options['separator'];\n\n if(empty($_POST[$field . '[year]'])) {\n $today = date('Y');\n if(!empty($years[$today])) {\n $_POST[$field . '[year]'] = $today;\n }\n }\n\n $output .= form_select(\n $field . '[year]',\n array(\n 'wrap' => false,\n 'label' => false,\n 'options' => $years\n )\n );\n\n if($options['wrap']) {\n $options['field'] = $field;\n $output = form__wrap($output, $options);\n }\n\n $error = form_error_message($field);\n if(!empty($error)) {\n $output .= $error;\n }\n\n return html__output($output);\n}" ]
[ "0.5917911", "0.580177", "0.5774291", "0.5772451", "0.5765203", "0.57464576", "0.56581205", "0.5607564", "0.5486344", "0.548297", "0.54729545", "0.5466339", "0.54312253", "0.54105157", "0.5367814", "0.5366112", "0.53398126", "0.53395337", "0.53387785", "0.53224725", "0.53220177", "0.53189677", "0.53140664", "0.5307944", "0.5293031", "0.529062", "0.52905905", "0.52897835", "0.5284945", "0.5270801" ]
0.6345225
0
Perform a transaction using reference Transaction ID
public function doReferenceTransaction($ref) { $nvpstr = '&REFERENCEID=' . $ref . '&AMT=10' . '&PAYMENTACTION=Sale&REQCONFIRMSHIPPING=0'; $this->hash_call('DoReferenceTransaction', $nvpstr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function transaction();", "public function transaction();", "public function getTransactionID();", "public function doTransaction()\n\t{\n\t\t$this->initRequest();\n\n\t\t$this->setTransaction([\n\t\t\t'ReportTxnDetail' => [\n\t\t\t\t'TxnId' => $this->TxnId\n\t\t\t]\n\t\t]);\n\t\t\n\t\treturn $this->Transaction();\n\t}", "function insert_transaction($subscriptionid = 0, $projectid = 0, $buynowid = 0, $user_id = 0, $p2b_user_id = 0, $storeid = 0, $orderid = 0, $description = '', $amount, $paid, $status, $invoicetype, $paymethod, $createdate, $duedate, $paiddate, $custommessage, $archive, $ispurchaseorder = 0, $returnid = 0, $transactionidx = '', $isdeposit = 0, $iswithdraw = 0, $dontprocesstax = 0)\n {\n global $ilance, $ilconfig;\n $subscriptionid = isset($subscriptionid) ? intval($subscriptionid) : '0';\n $projectid = isset($projectid) ? intval($projectid) : '0';\n $buynowid = isset($buynowid) ? intval($buynowid) : '0';\n $user_id = isset($user_id) ? intval($user_id) : '0';\n $p2b_user_id = isset($p2b_user_id) ? intval($p2b_user_id) : '0';\n $storeid = isset($storeid) ? intval($storeid) : '0';\n $orderid = isset($orderid) ? intval($orderid) : '0';\n $description = isset($description) ? $description : 'No transaction description provided';\n $amount = isset($amount) ? $amount : '0.00';\n $paid = isset($paid) ? $paid : '0.00';\n $status = isset($status) ? $status : 'unpaid';\n $invoicetype = isset($invoicetype) ? $invoicetype : 'debit';\n $paymethod = isset($paymethod) ? $paymethod : 'account';\n $ipaddress = IPADDRESS;\n $referer = REFERRER;\n $createdate = DATETIME24H;\n $duedate = isset($duedate) ? $duedate : DATETIME24H;\n $paiddate = isset($paiddate) ? $paiddate : '';\n $custommessage = isset($custommessage) ? $custommessage : 'No memo or administrative comments';\n $archive = isset($archive) ? intval($archive) : '0';\n $ispurchaseorder = isset($ispurchaseorder) ? $ispurchaseorder : '0';\n // withdraw and deposit related transactions\n $iswithdraw \t = isset($iswithdraw) \t ? intval($iswithdraw) : '0';\n $isdeposit \t = isset($isdeposit) \t ? intval($isdeposit) : '0';\n $totalamount = '0.00';\n $transactionid = (isset($transactionidx) AND !empty($transactionidx)) ? $transactionidx : $ilance->accounting_payment->construct_transaction_id();\n $currencyid = $this->currencyid == '0' ? $ilconfig['globalserverlocale_defaultcurrency'] : $this->currencyid;\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"invoices\n (invoiceid, currency_id, subscriptionid, projectid, buynowid, user_id, p2b_user_id, storeid, orderid, description, amount, paid, totalamount, status, paymethod, ipaddress, referer, createdate, duedate, paiddate, custommessage, transactionid, archive, ispurchaseorder, isdeposit, iswithdraw)\n VALUES(\n NULL,\n '\" . intval($currencyid) . \"',\n '\" . intval($subscriptionid) . \"',\n '\" . intval($projectid) . \"',\n '\" . intval($buynowid) . \"',\n '\" . intval($user_id) . \"',\n '\" . intval($p2b_user_id) . \"',\n '\" . intval($storeid) . \"',\n '\" . intval($orderid) . \"',\n '\" . $ilance->db->escape_string($description) . \"',\n '\" . $ilance->db->escape_string($amount) . \"',\n '\" . $ilance->db->escape_string($paid) . \"',\n '\" . $ilance->db->escape_string($totalamount) . \"',\n '\" . $ilance->db->escape_string($status) . \"',\n '\" . $ilance->db->escape_string($paymethod) . \"',\n '\" . $ilance->db->escape_string($ipaddress) . \"',\n '\" . $ilance->db->escape_string($referer) . \"',\n '\" . $ilance->db->escape_string($createdate) . \"',\n '\" . $ilance->db->escape_string($duedate) . \"',\n '\" . $ilance->db->escape_string($paiddate) . \"',\n '\" . $ilance->db->escape_string($custommessage) . \"',\n '\" . $ilance->db->escape_string($transactionid) . \"',\n '\" . $ilance->db->escape_string($archive) . \"',\n '\" . intval($ispurchaseorder) . \"',\n '\" . intval($isdeposit) . \"',\n '\" . intval($iswithdraw) . \"')\n \", 0, null, __FILE__, __LINE__); \n // fetch new last invoice id\n $invoiceid = $ilance->db->insert_id();\n \n // do we skip the taxation support for this transaction?\n // we do this in some situations where the tax needs to be applied before the txn is created\n // for situations like escrow fees that we must already know how much to charge the customer for taxes\n // if we don't do this then the txn may have double taxes added to the overall amount\n // and situations like this usually mean that an unpaid transaction is being created (and tax) is\n // auto-applied\n \n // taxation support: is user taxable for this invoice type?\n // this code block will run if a transaction being created is unpaid waiting for payment from the customer\n if ($ilance->tax->is_taxable($user_id, $invoicetype) AND isset($dontprocesstax) AND $dontprocesstax == 0)\n {\n // fetch tax amount to charge for this invoice type\n $taxamount = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 0);\n // fetch total amount to hold within the \"totalamount\" field\n $totalamount = ($amount + $taxamount);\n // fetch tax bit to display when outputing tax infos\n $taxinfo = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 1);\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\" . $totalamount . \"',\";\n }\n // member is taxable for this invoice type\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET istaxable = '1',\n $extra\n totalamount = '\" . sprintf(\"%01.2f\", $totalamount) . \"',\n taxamount = '\" . sprintf(\"%01.2f\", $taxamount) . \"',\n taxinfo = '\" . $ilance->db->escape_string($taxinfo) . \"',\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else\n {\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\".$totalamount.\"',\";\n }\n // customer not taxable > update totalamount value\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET totalamount = '\" . sprintf(\"%01.2f\", $amount) . \"',\n $extra\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n } \n if (isset($returnid) AND $returnid > 0)\n {\n return intval($invoiceid);\n }\n }", "public function performTransaction( $client_id, $toAccount, $amount,$transNo, $transactionType ) {\n $stmt = $this->conn->stmt_init ();\n $stmt->prepare ( \"call performTransaction(?, ?, ?, ?, ?)\" );\n $stmt->bind_param ( 'isdsi', $client_id, $toAccount, $amount, $transNo, $transactionType );\n $stmt->execute ();\n\n return $stmt->get_result ();\n }", "public function getTransactionId();", "public function getTransactionId();", "function insert_transaction_record()\n\t{\n\t\t$invoice_id = strtotime('now');\n\t\t\n\t\t$data = array(\n\t\t 'user_id' => $this->user_id,\n\t\t 'invoice_id' => $invoice_id,\n\t\t 'product_id' => $this->auction_id,\t\t \t\t\n\t\t 'credit_debit' => 'DEBIT',\t\t \n\t\t 'transaction_name' =>'Bid Fee For auction ID: '.$this->auction_id,\n\t\t 'transaction_date' => $this->general->get_local_time('time'),\n\t\t 'transaction_type' => 'bid',\n\t\t 'transaction_status' => 'Completed',\t\t \n\t\t 'payment_method' => 'direct',\n\t\t 'amount'=>$this->user_bid_amt,\n\t\t 'pay_type' => $this->payment_type,\n\t \t);\n\t\t\n\t\t$this->db->insert('transaction', $data);\n\t\treturn $this->db->insert_id(); \t\n\t}", "public function transaction(callable $callback);", "abstract protected function _start_transaction();", "public function action_account_transaction() {\n $package = Model::factory('package');\n $invoice_id = explode('/', $_SERVER['REQUEST_URI']);\n $transaction_info = $package->account_transaction($invoice_id[3]);\n $this->template->title = CLOUD_SITENAME . ' | Account';\n $this->template->page_title = __('account_transaction_details');\n $this->meta_description = \"\";\n $this->template->content = View::factory(\"admin/package_plan/account_transaction\")\n ->bind('transaction_info', $transaction_info);\n }", "function get_transaction_id()\n {\n return $this->platnosci_post_vars['txn_id']; \n }", "public function getTransactionId() { return $this->transactionId; }", "public function getTxnId()\n {\n return $this->response['result']['id'];\n }", "public function getTransactionId()\n {\n return $this->transactionId++;\n }", "public function beginTransaction();", "public function beginTransaction();", "public function beginTransaction();", "abstract public function commitTransaction();", "public function getTransactionID()\n\t{\n\t\treturn $this->transaction_id;\n\t}", "public function transaction($id, array $optional = [])\n {\n return $this->client->resource('Bill.Transaction', $this->getVersion())\n ->show($id, $optional);\n }", "public function addTransactionId($id_order, $id_transaction)\r\n\t{\r\n\t\tif (version_compare(_PS_VERSION_, '1.5', '>='))\r\n\t\t{\r\n\t\t\t$new_order = new Order((int)$id_order);\r\n\t\t\tif (Validate::isLoadedObject($new_order))\r\n\t\t\t{\r\n\t\t\t\t$payment = $new_order->getOrderPaymentCollection();\r\n\t\t\t\tif (isset($payment[0]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$payment[0]->transaction_id = pSQL($id_transaction);\r\n\t\t\t\t\t$payment[0]->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static function transaction($transactionId) {\n //Get information on a single transaction\n\t\t\treturn self::get(self::transaction_index() . $transactionId);\n\t\t}", "public function transfert()\n {\n\n $account = \\Stripe\\Account::create([\n 'country' => 'US',\n 'type' => 'custom',\n 'requested_capabilities' => ['card_payments', 'transfers'],\n ]);\n\n $transfer = Transfer::create([\n 'amount' => 7000,\n 'currency' => 'usd',\n 'destination' => $account->id,\n 'transfer_group' => '{ORDER10}',\n ]);\n }", "public function getTransactionReference()\n {\n if (!isset($this->data['error'])) {\n return $this->data['transactionResponse']['transactionId'];\n }\n\n return null;\n }", "public function beginTransaction():void;", "public function transaction(User $user)\n {\n }", "public function transaction(callable $run, $attempts=1);", "public function RefundTxn() {\r\n\r\n $ch = curl_init();\r\n\r\n $CURLParameters = http_build_query(array(\r\n // Our default parameters!\r\n \"key\" => $this->key,\r\n \"appid\" => $this->game,\r\n // This can vary from request to request, sometimes its steamid or steamids or even an array.\r\n \"steamid\" => $this->steamid,\r\n // Custom Queries below here.\r\n \"orderid\" => $this->orderid,\r\n ));\r\n\r\n curl_setopt($ch, CURLOPT_URL, \"https://partner.steam-api.com/\" . $this->interface . \"/RefundTxn/v2/\");\r\n\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($ch, CURLOPT_POST, 1);\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, $CURLParameters);\r\n $CURLResponse = json_decode(curl_exec($ch));\r\n $CURLResponseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\r\n curl_close($ch);\r\n\r\n\r\n // Error handling improved!\r\n\r\n if ($CURLResponseCode != 200) {\r\n if ($CURLResponseCode == 400) {\r\n throw new exceptions\\SteamRequestParameterException(\"The Order ID or another parameter is invalid!\");\r\n }\r\n if ($CURLResponseCode == 401) {\r\n throw new exceptions\\SteamException(\"App ID or API Key is invalid.\");\r\n }\r\n throw new exceptions\\SteamRequestException(\"$CURLResponseCode Request Error.\");\r\n }\r\n\r\n if ($CURLResponse->response->result == \"OK\") {\r\n return true;\r\n }\r\n\r\n throw new exceptions\\SteamRequestException(json_encode($CURLResponse->response->error));\r\n }" ]
[ "0.66291356", "0.66291356", "0.6206243", "0.6113751", "0.6025251", "0.601474", "0.58320236", "0.58320236", "0.58200777", "0.5808117", "0.5742156", "0.5729479", "0.5701541", "0.5692495", "0.56885374", "0.56446946", "0.56387526", "0.56387526", "0.56387526", "0.5631671", "0.56303483", "0.55863285", "0.55768955", "0.557597", "0.5575671", "0.5563249", "0.5562838", "0.55544317", "0.5535655", "0.55309916" ]
0.6816867
0
This function will take NVPString and convert it to an Associative Array and it will decode the response. It is useful to search for a particular key and displaying arrays.
private function deformatNVP($nvpstr) { $intial=0; $nvpArray = array(); while(strlen($nvpstr)){ //position of Key $keypos= strpos($nvpstr,'='); //position of value $valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr); /*getting the Key and Value values and storing in a Associative Array*/ $keyval=substr($nvpstr, $intial, $keypos); $valval=substr($nvpstr, $keypos+1, $valuepos-$keypos-1); //decoding the response $nvpArray[urldecode($keyval)] = urldecode($valval); $nvpstr = substr($nvpstr, $valuepos+1, strlen($nvpstr)); } return $nvpArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function deformatNVP($nvpstr){\r\n \r\n $intial=0;\r\n $nvpArray = array(); \r\n \r\n while(strlen($nvpstr)){\r\n //postion of Key\r\n $keypos= strpos($nvpstr,'=');\r\n //position of value\r\n $valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\r\n \r\n /*getting the Key and Value values and storing in a Associative Array*/\r\n $keyval=substr($nvpstr,$intial,$keypos);\r\n $valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\r\n //decoding the respose\r\n $nvpArray[urldecode($keyval)] =urldecode( $valval);\r\n $nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\r\n }\r\n return $nvpArray;\r\n }", "function deformatNVP($nvpstr){\n\t\n\t\t$intial=0;\n\t\t$nvpArray = array();\n\t\n\t\n\t\twhile(strlen($nvpstr)){\n\t\t\t//postion of Key\n\t\t\t$keypos= strpos($nvpstr,'=');\n\t\t\t//position of value\n\t\t\t$valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\n\t\n\t\t\t/*getting the Key and Value values and storing in a Associative Array*/\n\t\t\t$keyval=substr($nvpstr,$intial,$keypos);\n\t\t\t$valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\n\t\t\t//decoding the respose\n\t\t\t$nvpArray[urldecode($keyval)] =urldecode( $valval);\n\t\t\t$nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\n\t\t}\n\t\treturn $nvpArray;\n\t}", "public function deformatNVP($nvpstr)\r\n {\r\n $intial=0;\r\n $nvpArray = array();\r\n\r\n while(strlen($nvpstr))\r\n {\r\n //postion of Key\r\n $keypos= strpos($nvpstr,'=');\r\n //position of value\r\n $valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\r\n\r\n /*getting the Key and Value values and storing in a Associative Array*/\r\n $keyval=substr($nvpstr,$intial,$keypos);\r\n $valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\r\n //decoding the respose\r\n $nvpArray[urldecode($keyval)] =urldecode( $valval);\r\n $nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\r\n }\r\n return $nvpArray;\r\n }", "function deformatNVP($nvpstr)\n\t{\n\n\t\t$intial=0;\n\t\t$nvpArray = array();\n\n\n\t\twhile(strlen($nvpstr)){\n\t\t\t//postion of Key\n\t\t\t$keypos= strpos($nvpstr,'=');\n\t\t\t//position of value\n\t\t\t$valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\n\n\t\t\t/*getting the Key and Value values and storing in a Associative Array*/\n\t\t\t$keyval=substr($nvpstr,$intial,$keypos);\n\t\t\t$valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\n\t\t\t//decoding the respose\n\t\t\t$nvpArray[urldecode($keyval)] =urldecode( $valval);\n\t\t\t$nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\n\t\t }\n\t\treturn $nvpArray;\n\t}", "public function deformatNVP($smsstr){ \n \n $intial=0; \n $smsArray = array(); \n \n \n while(strlen($smsstr)){ \n //postion of Key \n $keypos= strpos($smsstr,'='); \n //position of value \n $valuepos = strpos($smsstr,'&') ? strpos($smsstr,'&'): strlen($smsstr); \n \n /*getting the Key and Value values and storing in a Associative Array*/ \n $keyval=substr($smsstr,$intial,$keypos); \n $valval=substr($smsstr,$keypos+1,$valuepos-$keypos-1); \n //decoding the respose \n $smsArray[urldecode($keyval)] =urldecode( $valval); \n $smsstr=substr($smsstr,$valuepos+1,strlen($smsstr)); \n } \n return $smsArray; \n }", "private function deformatNVP($nvpstr)\n {\n $intial=0;\n $nvpArray = array();\n\n while(strlen($nvpstr))\n {\n //postion of Key\n $keypos= strpos($nvpstr,'=');\n //position of value\n $valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\n\n /*getting the Key and Value values and storing in a Associative Array*/\n $keyval=substr($nvpstr,$intial,$keypos);\n $valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\n //decoding the respose\n $nvpArray[urldecode($keyval)] =urldecode( $valval);\n $nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\n }\n return $nvpArray;\n }", "public function deformatNVP($nvpstr)\n {\n $intial=0;\n $nvpArray = array();\n \n \n while (strlen($nvpstr)) {\n //postion of Key\n $keypos= strpos($nvpstr, '=');\n //position of value\n $valuepos = strpos($nvpstr, '&') ? strpos($nvpstr, '&'): strlen($nvpstr);\n \n /*getting the Key and Value values and storing in a Associative Array*/\n $keyval=substr($nvpstr, $intial, $keypos);\n $valval=substr($nvpstr, $keypos+1, $valuepos-$keypos-1);\n //decoding the respose\n $nvpArray[urldecode($keyval)] =urldecode($valval);\n $nvpstr=substr($nvpstr, $valuepos+1, strlen($nvpstr));\n }\n return $nvpArray;\n }", "function parse_response_array($string) {\n $response_string_array = explode(\"&\", $string);\n\n $proper_array = array();\n\n foreach ($response_string_array as $value) {\n list($key, $val) = explode(\"=\", $value);\n\n $val = urldecode($val);\n\n $proper_array[\"$key\"] = $val;\n }\n unset($key);\n unset($val);\n\n return $proper_array;\n }", "function deformat_nvp($nvpstr)\n\t{\n\t\t$intial=0;\n\t\t$nvparray = array();\n\t\twhile(strlen($nvpstr)){\n\t\t\t//postion of Key\n\t\t\t$keypos= strpos($nvpstr,'=');\n\t\t\t//position of value\n\t\t\t$valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\n\t\t\t/*getting the Key and Value values and storing in a Associative Array*/\n\t\t\t$keyval=substr($nvpstr,$intial,$keypos);\n\t\t\t$valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\n\t\t\t//decoding the respose\n\t\t\t$nvparray[urldecode($keyval)] = urldecode($valval);\n\t\t\t$nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\n\t\t}\n\t\treturn $nvparray;\n\t}", "function oAuthParseResponse($responseString) {\n\t\t$r = array ();\n\t\tforeach ( explode ( '&', $responseString ) as $param ) {\n\t\t\t$pair = explode ( '=', $param, 2 );\n\t\t\tif (count ( $pair ) != 2)\n\t\t\t\tcontinue;\n\t\t\t$r [urldecode ( $pair [0] )] = urldecode ( $pair [1] );\n\t\t}\n\t\treturn $r;\n\t}", "private function _readNvp($string)\r\n\t{\r\n\t\twhile (strlen($string))\r\n\t\t{\r\n\t\t\t$keypos = strpos($string, '=');\r\n\t\t\t$valuepos = strpos($string, '&') ? strpos($string, '&') : strlen($string);\r\n\t\t\t$nvp_array[urldecode(substr($string, 0, $keypos))] = urldecode(substr($string, $keypos + 1, $valuepos - $keypos - 1));\r\n\t\t\t$string = substr($string, $valuepos + 1, strlen($string));\r\n\t\t}\r\n\r\n\t\treturn $nvp_array;\r\n\t}", "private static function strToArray($nvp)\r\n\t {\r\n\t\t $temp_array = array();\r\n\t\t $nvp = explode('&' , trim($nvp , '&'));\r\n\t\t foreach($nvp as $value)\r\n\t\t {\r\n if (empty($value)) continue;\r\n\t\t\t $temp_array2 = explode('=' , $value);\r\n\t\t\t if (empty($temp_array2[1])) continue;\r\n\t\t\t $temp_array[$temp_array2[0]] = $temp_array2[1];\r\n\t\t }\r\n\t\t return $temp_array;\r\n\t }", "abstract public static function decode($string): array;", "function icedrive_response_to_array($response)\r\n {\r\n libxml_use_internal_errors(true);\r\n $xml = simplexml_load_string(str_replace(':', '', $response));\r\n $xml = json_encode($xml);\r\n $xml = json_decode($xml, true);\r\n return $xml;\r\n }", "public function FormatPDTResponseInAssociativeArray($pdtMessage)\n {\n $pdtMessage = urldecode(substr($pdtMessage, 7));\n \n // Convert text response to associative array\n $out = [];\n preg_match_all('/^([^=\\s]++)=(.*+)/m', $pdtMessage, $out, PREG_PATTERN_ORDER);\n $msgInAssocArray = array_combine($out[1], $out[2]);\n ksort($msgInAssocArray);\n\treturn $msgInAssocArray;\n }", "public function parse2array() {\n\t\t/**\n\t\t * Thanks to Vladimir Struchkov <great_boba yahoo com> for providing the\n\t\t * code to extract base64 encoded values\n\t\t */\n\n\t\t$arr1 = explode( \"\\n\", str_replace( \"\\r\", '', $this->rawdata ) );\n\t\t$i = $j = 0;\n\t\t$arr2 = array();\n\n\t\t/* First pass, rawdata is splitted into raw blocks */\n\t\tforeach ( $arr1 as $v ) {\n\t\t\tif ( trim( $v ) == '' ) {\n\t\t\t\t++ $i;\n\t\t\t\t$j = 0;\n\t\t\t} else {\n\t\t\t\t$arr2[ $i ][ $j ++ ] = $v;\n\t\t\t}\n\t\t}\n\n\t\t/* Second pass, raw blocks are updated with their name/value pairs */\n\t\tforeach ( $arr2 as $k1 => $v1 ) {\n\t\t\t$i = 0;\n\t\t\t$decode = false;\n\t\t\tforeach ( $v1 as $v2 ) {\n\t\t\t\tif ( ereg( '::', $v2 ) ) { // base64 encoded, chunk start\n\t\t\t\t\t$decode = true;\n\t\t\t\t\t$arr = explode( ':', str_replace( '::', ':', $v2 ) );\n\t\t\t\t\t$i = $arr[0];\n\t\t\t\t\t$this->entries[ $k1 ][ $i ] = base64_decode( $arr[1] );\n\t\t\t\t} elseif ( ereg( ':', $v2 ) ) {\n\t\t\t\t\t$decode = false;\n\t\t\t\t\t$arr = explode( ':', $v2 );\n\t\t\t\t\t$count = count( $arr );\n\t\t\t\t\tif ( $count != 2 ) {\n\t\t\t\t\t\tfor ( $i = $count - 1; $i > 1; -- $i ) {\n\t\t\t\t\t\t\t$arr[ $i - 1 ] .= ':' . $arr[ $i ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$i = $arr[0];\n\t\t\t\t\t$this->entries[ $k1 ][ $i ] = $arr[1];\n\t\t\t\t} else {\n\t\t\t\t\tif ( $decode ) { // base64 encoded, next chunk\n\t\t\t\t\t\t$this->entries[ $k1 ][ $i ] .= base64_decode( $v2 );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->entries[ $k1 ][ $i ] = $v2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static function deformatNVP( $nvpstr ) {\r\n\t\t\tparse_str( $nvpstr, $nvpArray );\r\n\r\n\t\t\treturn $nvpArray;\r\n\t\t}", "public function associativeStringArrayValue($key);", "private function parse($body)\n {\n parse_str($body, $response_array);\n $response = array();\n foreach ($response_array as $k => $v) {\n $key = str_replace('VP', '', $k);\n $response[$key] = $v;\n }\n\n return $response;\n }", "function decodeKeyValuePair($pair)\n{\n\t$operators = array(\"==\", \"!=\", \"<>\", \">=\", \"<=\", \"=\", \"<\", \">\");\n\n\tstatic $s_regex = null;\n\tif ($s_regex === null)\n\t{\n\t\t$s_regex = '/'.implode('|', array_map('preg_quote', $operators)).'/';\n\t}\n\n\tlist($key, $value) = preg_split($s_regex, $pair);\n\n\treturn array($key => stripQuotes($value));\n}", "function parseAssoc($returnArray, $key, $haystack) { //simple parse of url style concatenations & as delimiter = as key = value;\n\t$associations = explode(\"&\", $haystack);\n\tforeach ($associations as $association) {\n\t\t$assoc = explode(\"=\", $association);\n\t\tif (isset($assoc[1])) { //was there a key/value pair\n\t\t\tif (is_array($assoc[1])) { $returnArray[$key][$assoc[0]] = implode('',$assoc[1]); } //if array (happens with textarea)\n\t\t\telse { $returnArray[$key][$assoc[0]] = $assoc[1]; }\n\t\t}\n\t}\n\treturn($returnArray);\n}", "function parseResponse($response) {\r\n\t\t$begin = 0;\r\n\t\t$end = 0;\r\n\t\t$start = null;\r\n\t\t$value = null;\r\n\t\t$map;\r\n\t\t// responseMap = new HashMap();\r\n\t\t$response = trim ( $response );\r\n\t\t$pos = strpos ( $response, \"<\" ) == 0;\r\n\t\tif ($response == null || (strlen ( $response ) < 0) || $pos === false) {\r\n\t\t\t// // echo \"returned\";\r\n\t\t\treturn null;\r\n\t\t} else {\r\n\t\t\t// // echo \"else \";\r\n\t\t\tdo {\r\n\t\t\t\t\r\n\t\t\t\tif ((strpos ( $response, '<' ) !== false) && (strpos ( $response, '>' ) !== false)) {\r\n\t\t\t\t\t$start = substr ( $response, ($ind = strpos ( $response, \"<\" )) + 1, ((strpos ( $response, \">\" ) - 1) - $ind) );\r\n\t\t\t\t\t$mapKey = substr ( $response, ($ind = strpos ( $response, \">\" )) + 1, ((strpos ( $response, \"</\" . $start . \">\" ) - 1) - $ind) );\r\n\t\t\t\t\t// // echo \"<br/> strrsdfdpos\".(strrpos($response,\">\"));\r\n\t\t\t\t\t$response = substr ( $response, $from = strpos ( $response, \"</\" . $start . \">\" ) + strlen ( $start ) + 3, strrpos ( $response, \">\" ) - $from + 1 );\r\n\t\t\t\t\t// // echo \"<br/> from \".$from;\r\n\t\t\t\t\t// // echo \"<br/> start------- \".$start;\r\n\t\t\t\t\t// // echo \"--------\".$mapKey;\r\n\t\t\t\t\t$maps [$start] = $mapKey;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// // echo \"------ response====\".htmlspecialchars($response).\"<br/>\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// // echo \"here\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t} while ( strlen ( $response ) > 0 );\r\n\t\t}\r\n\t\t\r\n\t\t// // echo \"<br/>MAPPPPPPPS \".var_dump($maps);\r\n\t\treturn $maps;\r\n\t}", "function str_to_array($str,$key){\n\t\t//remove the . from last line\n\t\t$str = trim($str,'.');\n\t\treturn explode($key,$str);\n\t}", "function parse_oid2($string)\n{\n $result = array();\n $matches = array();\n\n // Match OID - If wrapped in double-quotes ('\"'), must escape '\"', else must escape ' ' (space) or '[' - Other escaping is optional\n $match_count = preg_match('/^(?:((?!\")(?:[^\\\\\\\\\\\\[ ]|(?:\\\\\\\\.))+)|(?:\"((?:[^\\\\\\\\\\\"]|(?:\\\\\\\\.))+)\"))/', $string, $matches);\n if (null !== $match_count && $match_count > 0)\n {\n // [1] = unquoted, [2] = quoted\n $value = strlen($matches[1]) > 0 ? $matches[1] : $matches[2];\n $result[] = stripslashes($value);\n\n // I do this (vs keeping track of offset) to use ^ in regex\n $string = substr($string, strlen($matches[0]));\n\n // Match indexes (optional) - If wrapped in double-quotes ('\"'), must escape '\"', else must escape ']' - Other escaping is optional\n while (true)\n {\n $match_count = preg_match('/^\\\\[(?:((?!\")(?:[^\\\\\\\\\\\\]]|(?:\\\\\\\\.))+)|(?:\"((?:[^\\\\\\\\\\\"]|(?:\\\\\\\\.))+)\"))\\\\]/', $string, $matches);\n if (null !== $match_count && $match_count > 0)\n {\n // [1] = unquoted, [2] = quoted\n $value = strlen($matches[1]) > 0 ? $matches[1] : $matches[2];\n $result[] = stripslashes($value);\n\n // I do this (vs keeping track of offset) to use ^ in regex\n $string = substr($string, strlen($matches[0]));\n }\n else\n {\n break;\n }\n } // while\n\n // Match value - Skips leading ' ' characters - If remainder is wrapped in double-quotes ('\"'), must escape '\"', other escaping is optional\n $match_count = preg_match('/^\\\\s+(?:((?!\")(?:[^\\\\\\\\]|(?:\\\\\\\\.))+)|(?:\"((?:[^\\\\\\\\\\\"]|(?:\\\\\\\\.))+)\"))$/', $string, $matches);\n if (null !== $match_count && $match_count > 0)\n {\n // [1] = unquoted, [2] = quoted\n $value = strlen($matches[1]) > 0 ? $matches[1] : $matches[2];\n\n $result[] = stripslashes($value);\n\n if (strlen($string) != strlen($matches[0])) { echo \"Length error!\"; return null; }\n\n return $result;\n }\n }\n\n // All or nothing\n return null;\n}", "public function get_assoc()\n {\n $out = array('name' => $this->displayname);\n $typemap = $this->typemap;\n\n // copy name fields to output array\n foreach (array('firstname','surname','middlename','nickname','organization') as $col) {\n if (strlen($this->$col)) {\n $out[$col] = $this->$col;\n }\n }\n\n if ($this->raw['N'][0][3])\n $out['prefix'] = $this->raw['N'][0][3];\n if ($this->raw['N'][0][4])\n $out['suffix'] = $this->raw['N'][0][4];\n\n // convert from raw vcard data into associative data for Roundcube\n foreach (array_flip(self::$fieldmap) as $tag => $col) {\n foreach ((array)$this->raw[$tag] as $i => $raw) {\n if (is_array($raw)) {\n $k = -1;\n $key = $col;\n $subtype = '';\n\n if (!empty($raw['type'])) {\n $combined = join(',', self::array_filter((array)$raw['type'], 'internet,pref', true));\n $combined = strtoupper($combined);\n\n if ($typemap[$combined]) {\n $subtype = $typemap[$combined];\n }\n else if ($typemap[$raw['type'][++$k]]) {\n $subtype = $typemap[$raw['type'][$k]];\n }\n else {\n $subtype = strtolower($raw['type'][$k]);\n }\n\n while ($k < count($raw['type']) && ($subtype == 'internet' || $subtype == 'pref')) {\n $subtype = $typemap[$raw['type'][++$k]] ?: strtolower($raw['type'][$k]);\n }\n }\n\n // read vcard 2.1 subtype\n if (!$subtype) {\n foreach ($raw as $k => $v) {\n if (!is_numeric($k) && $v === true && ($k = strtolower($k))\n && !in_array($k, array('pref','internet','voice','base64'))\n ) {\n $k_uc = strtoupper($k);\n $subtype = $typemap[$k_uc] ?: $k;\n break;\n }\n }\n }\n\n // force subtype if none set\n if (!$subtype && preg_match('/^(email|phone|address|website)/', $key)) {\n $subtype = 'other';\n }\n\n if ($subtype) {\n $key .= ':' . $subtype;\n }\n\n // split ADR values into assoc array\n if ($tag == 'ADR') {\n list(,, $value['street'], $value['locality'], $value['region'], $value['zipcode'], $value['country']) = $raw;\n $out[$key][] = $value;\n }\n else {\n $out[$key][] = $raw[0];\n }\n }\n else {\n $out[$col][] = $raw;\n }\n }\n }\n\n // handle special IM fields as used by Apple\n foreach ($this->immap as $tag => $type) {\n foreach ((array)$this->raw[$tag] as $i => $raw) {\n $out['im:'.$type][] = $raw[0];\n }\n }\n\n // copy photo data\n if ($this->raw['PHOTO']) {\n $out['photo'] = $this->raw['PHOTO'][0][0];\n }\n\n return $out;\n }", "function StrToArray($Qstr)\r\n\t{\r\n\t$finalArr=array();\r\n\t\t\r\n\t\t$qryArr=split(\"&\",$Qstr);\r\n\t\t\r\n\t\t\tif(!empty($Qstr))\r\n\t\t\t{\r\n\t\t\t\r\n\t\t\t\tforeach($qryArr as $item)\r\n\t\t\t\t{\r\n\t\t\t\t\t$Qarr=split(\"=\",$item);\r\n\t\t\t\t\tif(count($Qarr)==2)\r\n\t\t\t\t\t$finalArr[$Qarr[0]]=$Qarr[1];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn $finalArr;\r\n\t\t\t}\r\n\t}", "private function decode($str) {\n if ($this->return_assoc) {\n return json_decode($str, true);\n }\n\n return json_decode($str);\n }", "function toArray($str)\n\t{\n\t\t$tmpItemArr = array_filter(explode('-dlm-',$str));\n\t\tforeach ($tmpItemArr as &$value) {\n \t\t$ItemArr = explode('-spl-', $value);\n\t\t\t$arr[$ItemArr[0]]['id'] = &$ItemArr[0]; // Item ID\n\t\t\t$arr[$ItemArr[0]]['qty'] = &$ItemArr[1]; // Item Quantity\n\t\t\t$arr[$ItemArr[0]]['cp'] = &$ItemArr[2]; // Item custom price\n\t\t\t$arr[$ItemArr[0]]['order'] = &$ItemArr[3]; // Item order\n\t\t}\n\t\treturn $arr;\n\t}", "private static function vcard_decode($vcard)\n {\n // Perform RFC2425 line unfolding and split lines\n $vcard = preg_replace(array(\"/\\r/\", \"/\\n\\s+/\"), '', $vcard);\n $lines = explode(\"\\n\", $vcard);\n $result = array();\n\n for ($i=0; $i < count($lines); $i++) {\n if (!($pos = strpos($lines[$i], ':'))) {\n continue;\n }\n\n $prefix = substr($lines[$i], 0, $pos);\n $data = substr($lines[$i], $pos+1);\n\n if (preg_match('/^(BEGIN|END)$/i', $prefix)) {\n continue;\n }\n\n // convert 2.1-style \"EMAIL;internet;home:\" to 3.0-style \"EMAIL;TYPE=internet;TYPE=home:\"\n if ($result['VERSION'][0] == \"2.1\"\n && preg_match('/^([^;]+);([^:]+)/', $prefix, $regs2)\n && !preg_match('/^TYPE=/i', $regs2[2])\n ) {\n $prefix = $regs2[1];\n foreach (explode(';', $regs2[2]) as $prop) {\n $prefix .= ';' . (strpos($prop, '=') ? $prop : 'TYPE='.$prop);\n }\n }\n\n if (preg_match_all('/([^\\\\;]+);?/', $prefix, $regs2)) {\n $entry = array();\n $field = strtoupper($regs2[1][0]);\n $enc = null;\n\n foreach($regs2[1] as $attrid => $attr) {\n $attr = preg_replace('/[\\s\\t\\n\\r\\0\\x0B]/', '', $attr);\n if ((list($key, $value) = explode('=', $attr)) && $value) {\n if ($key == 'ENCODING') {\n $value = strtoupper($value);\n // add next line(s) to value string if QP line end detected\n if ($value == 'QUOTED-PRINTABLE') {\n while (preg_match('/=$/', $lines[$i])) {\n $data .= \"\\n\" . $lines[++$i];\n }\n }\n $enc = $value == 'BASE64' ? 'B' : $value;\n }\n else {\n $lc_key = strtolower($key);\n $entry[$lc_key] = array_merge((array)$entry[$lc_key], (array)self::vcard_unquote($value, ','));\n }\n }\n else if ($attrid > 0) {\n $entry[strtolower($key)] = true; // true means attr without =value\n }\n }\n\n // decode value\n if ($enc || !empty($entry['base64'])) {\n // save encoding type (#1488432)\n if ($enc == 'B') {\n $entry['encoding'] = 'B';\n // should we use vCard 3.0 instead?\n // $entry['base64'] = true;\n }\n\n $data = self::decode_value($data, $enc ?: 'base64');\n }\n else if ($field == 'PHOTO') {\n // vCard 4.0 data URI, \"PHOTO:data:image/jpeg;base64,...\"\n if (preg_match('/^data:[a-z\\/_-]+;base64,/i', $data, $m)) {\n $entry['encoding'] = $enc = 'B';\n $data = substr($data, strlen($m[0]));\n $data = self::decode_value($data, 'base64');\n }\n }\n\n if ($enc != 'B' && empty($entry['base64'])) {\n $data = self::vcard_unquote($data);\n }\n\n $entry = array_merge($entry, (array) $data);\n $result[$field][] = $entry;\n }\n }\n\n unset($result['VERSION']);\n\n return $result;\n }", "private static function arrayToStr($nvp)\r\n\t {\r\n\t\t $temp_str = '';\r\n\t\t if (!is_array($nvp)) return $nvp;\r\n\t\t foreach ($nvp as $key => $value)\r\n\t\t {\r\n\t\t\t $temp_str .= $key.'='.$value.'&';\r\n\t\t }\r\n\t\t return rtrim($temp_str , '&');\r\n\t }" ]
[ "0.68386084", "0.67593586", "0.6727776", "0.6663099", "0.66561294", "0.66193986", "0.66057616", "0.63000566", "0.6216794", "0.594195", "0.5637514", "0.5609811", "0.5511996", "0.5396022", "0.5272197", "0.5240577", "0.5160063", "0.5151507", "0.5122402", "0.50719434", "0.5056054", "0.49873462", "0.49116912", "0.4868764", "0.48654777", "0.48432067", "0.48376364", "0.48335445", "0.48258057", "0.48205522" ]
0.67708236
1
Get the generated interface name
public function getGeneratedInterface() { return 'I'.ucfirst($this->name).'Adapter'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function name(): string\n {\n return 'interface';\n }", "protected function getInterfaceDefinition($name) {\n return 'Webforge\\Types\\Interfaces\\\\'.$name;\n }", "abstract protected function generateName();", "public function getUniqueName()\n {\n \t// load the identifiers\n $identifier = $this->getIdentifier();\n $aspectClassName = get_class($this->getPointcut()->getAspect());\n $interceptWithMethod = $this->getPointcut()->interceptWithMethod();\n\t\t// return the concatenated unique name\n return \"$identifier::$aspectClassName::$interceptWithMethod\";\n }", "public function GenerateInterface($name = null) {\n\t\t\tif (!$name) $name = $this->getGeneratedInterface(); \n\t\t\t$this->writeLine('interface '.$name.' {'); \n if (isset($this->select_one)) \n foreach($this->select_one as $rq) \n $rq->writeSignature(true); \n if (isset($this->select)) \n foreach($this->select as $rq) \n $rq->writeSignature(true);\n if (isset($this->insert)) \n foreach($this->insert as $rq) \n $rq->writeSignature(true);\n if (isset($this->update)) \n foreach($this->update as $rq) \n $rq->writeSignature(true);\n if (isset($this->delete)) \n foreach($this->delete as $rq) \n $rq->writeSignature(true); \n $this->writeLine('}');\n }", "public function getInterfaceCode();", "public function name()\n {\n return Formatter::format(\n $this->identifierParts,\n $this->getOutputFormat()\n );\n }", "protected function getStub(): string\n {\n $stubPrefix = '';\n\n if (str_contains($this->getNameInput(), config('repository.repository_path', 'Repositories'))) {\n $stubPrefix = 'repository.';\n }\n\n return LarepositoryServiceProvider::$packageLocation\n . DIRECTORY_SEPARATOR\n . 'stubs' . DIRECTORY_SEPARATOR\n . 'Repository' . DIRECTORY_SEPARATOR\n . $stubPrefix . 'interface.stub';\n }", "protected function getStubName()\n {\n $stub = '/observer-plain.stub';\n\n if ($this->option('model')) {\n $stub = '/observer.stub';\n }\n\n return $stub;\n }", "public function getClassName() {\n if (isset($this->generate_as)) {\n return $this->generate_as;\n } else return ucfirst($this->name).'AdapterImpl';\n }", "function name()\n {\n \n return new StringWrapper(get_class($this->object).'#'.$this->id());\n \n }", "public function getComponentInterface()\n {\n return 'Nerrad\\\\WPCLI\\\\EE\\\\interfaces\\\\ComponentHas' . $this->type . 'Interface';\n }", "public function getInternalName();", "public function get_name();", "public function get_name();", "public function get_name();", "public function getName()\n {\n return Language::_('Ispapi.name', true);\n }", "public function getNodename();", "public static function getServiceId(): string\n {\n return RequestInterface::class;\n }", "public function getInterfaceId()\n {\n return $this->interfaceId;\n }", "protected function generateIdByName(): string\n {\n return \"auto_id_\" . $this->name;\n }", "private function auto_name(){\n\n // the name starts from the class name Tbutton1 etc\n // toString inherits method from Tcontrol\n // which inherits from Object\n \n $prefix=toString($this);\n // get current count\n $counter=count($this->names);\n // create name\n $name=$prefix.'_'.$counter;\n \n return $name;\n }", "public function getName() \n { \n return $this->getType().\"_\".substr(md5(implode($this->getParameters())), 0, 20);\n }", "public static function get_name() : string ;", "public static function get_name() : string ;", "public function generate() {\n return 'namespace ' . $this->namespace;\n }", "protected function getControllerStubName()\n {\n $version = '';\n if ($this->option('api-version')) {\n $version = '-version-based';\n }\n\n return parent::getControllerStubName() . $version;\n }", "public function getCommandInterface()\n {\n return 'Nerrad\\\\WPCLI\\\\EE\\\\interfaces\\\\' . $this->type . 'CommandInterface';\n }", "abstract public function get_name();", "abstract public function get_name();" ]
[ "0.7561654", "0.67842674", "0.6774712", "0.6696295", "0.6657731", "0.6585888", "0.6551176", "0.64950436", "0.648664", "0.6471242", "0.6444275", "0.6396577", "0.639656", "0.6378045", "0.6378045", "0.6378045", "0.6369798", "0.6356752", "0.63536525", "0.635339", "0.6336516", "0.6312162", "0.6309241", "0.6278059", "0.6278059", "0.6275324", "0.6267147", "0.62563014", "0.6242477", "0.6242477" ]
0.75436175
1
Generate the adapter code
public function GenerateAdapter() { $this->writeLine( 'class '.$this->getClassName() ); $this->writeLine( 'extends '.$this->getExtends() ); $this->writeLine('implements '); $this->writeLine( implode(', ', $this->getImplements()) ); $this->writeLine('{'); $this->writeLine( 'public static $adapter = \''.$this->name.'\';' ); $this->writeLine('public function __construct() {'); $this->writeLine('parent::__construct(\''.$this->name.'\');'); $this->writeLine('}'); if (isset($this->select_one)) foreach($this->select_one as $rq) $rq->toPhp(true); if (isset($this->select)) foreach($this->select as $rq) $rq->toPhp(true); if (isset($this->insert)) foreach($this->insert as $rq) $rq->toPhp(true); if (isset($this->update)) foreach($this->update as $rq) $rq->toPhp(true); if (isset($this->delete)) foreach($this->delete as $rq) $rq->toPhp(true); $this->writeLine('}'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getGeneratedInterface() {\n\t\t\treturn 'I'.ucfirst($this->name).'Adapter';\t\n\t\t}", "abstract protected function createAdapter();", "abstract protected function getAdapter();", "abstract protected function getAdapter();", "public function generateInitCode();", "public function getAdapter();", "public function getAdapter();", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generateExtensionLoader()\n {\n $this->outFiles['extension_loader_interface'] = [\n 'file' => $this->classes['extension_loader_interface']['file'],\n 'code' => $this->template->getCodeFromTemplate('ddd-cqrs/Model/ExtensionLoaderInterface', [\n 'namespace' => $this->classes['extension_loader_interface']['info']['namespace'],\n 'class' => $this->classes['extension_loader_interface']['info']['class_name'],\n 'data_interface' => $this->classes['data_interface']['class'],\n 'entity_var' => $this->entityVar,\n 'entity_name' => $this->entityName,\n ]),\n ];\n\n $extensionFactory = preg_replace('/Interface$/', 'ExtensionFactory', $this->classes['data_interface']['class']);\n\n $this->outFiles['extension_loader'] = [\n 'file' => $this->classes['extension_loader']['file'],\n 'code' => $this->template->getCodeFromTemplate('ddd-cqrs/Model/ExtensionLoader', [\n 'namespace' => $this->classes['extension_loader']['info']['namespace'],\n 'class' => $this->classes['extension_loader']['info']['class_name'],\n 'data_interface' => $this->classes['data_interface']['class'],\n 'entity_var' => $this->entityVar,\n 'entity_name' => $this->entityName,\n 'extension_factory' => $extensionFactory,\n 'extension_loader_interface' => $this->classes['extension_loader_interface']['class'],\n ]),\n ];\n }", "public function getAdapterMethod();", "public function generate()\n {\n return parent::generate();\n }", "function _generate($instance) {\n $output = $this->CI->ciwy->datasource->_generate($this->CI->ciwy->component_config[$instance]['dataSourceInstance']); // Because datasource code is generated here we need to avoid dual code generation (see below)\n\n $output .= ' var ' . $instance . ' = new YAHOO.widget.AutoComplete(\"' . $this->CI->ciwy->component_config[$instance]['inputAttributes']['name'] . '\", \"';\n $output .= $this->CI->ciwy->component_config[$instance]['containerId'] . '\", ';\n $output .= $this->CI->ciwy->component_config[$instance]['dataSourceInstance'];\n $output .= ');' . $this->new_line;\n if (count($this->CI->ciwy->component_config[$instance]['Config']) > 0) {\n foreach ($this->CI->ciwy->component_config[$instance]['Config'] as $key => $val) {\n $output .= ' ' . $instance . '.' . $key . str_repeat(' ', 24 - strlen($key)) . ' = ' . $this->CI->ciwy->_property_wrapper($val, $this->component_property[$key]) . ';' . $this->new_line;\n }\n }\n unset ($this->CI->ciwy->component_instances[$this->CI->ciwy->component_config[$instance]['dataSourceInstance']]); // Avoid dual code generation for data source\n return $output;\n }", "public static function getCodeGenerator() {\n return new Q\\Codegen\\Generator\\Label(__CLASS__);\n }", "public function createAdapter() : AdapterInterface;", "abstract protected function doGetAdapter();", "public function generate()\n\t{\n\t\treturn parent::generate();\n\t}", "public function generateEntityCode()\n {\n $tables = $this->getTables();\n \n $code = \" require_once 'grandprix.data.php';\";\n foreach ($tables as $table)\n {\n $columns = $this->getColumns($table['tableName']);\n $children = $this->getChildren($table['tableName']);\n \n $code .=\n\"\n /**\n * \" . ucfirst($table['tableName']) . \" Data Entity class.\n * \n * @package Grandprix\n * @subpackage Data\n */\n class \" . ucfirst($table['tableName']) . \" extends DataEntity\n { \n\";\n \n foreach ($columns as $column)\n {\n $code .=\n\"\n /**\n * @var \" . self::getPhpType($column['dataType']) . \"\n */\n public \\$\" . ucfirst($column['columnName']) . \";\n\";\n }\n\n $code .=\n\"\n /**\n * Creates an empty instance of this class.\n * \n * @return \" . ucfirst($table['tableName']) . \"\n */\n public static function createInstance()\n {\n \\$className = __CLASS__; return new \\$className();\n }\n \n /**\n * Creates an instance of this class based on the provided data array.\n *\n * @param array \\$data The keyed array containing the data\n * @return \" . ucfirst($table['tableName']) . \"\n */\n public static function fromData(&\\$data)\n {\n \\$entity = self::createInstance();\n \\$entity->setObjectData(\\$data);\n return \\$entity;\n }\n }\n\";\n \n }\n \n return $code;\n }", "public function generate() \r\n\t{\t\r\n\t\tparent::generate();\r\n\t\r\n\t\t$this->schemaXml = new SimpleXMLElement(file_get_contents( $this->_xmlFile ));\r\n\t\t\r\n\t\t//parse object types\r\n\t\tforeach ($this->schemaXml->children() as $reflectionType) \r\n\t\t{\r\n\t\t\tswitch($reflectionType->getName())\r\n\t\t\t{\r\n\t\t\t\tcase \"enums\":\r\n\t\t\t\t\t//create enum classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $enums_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeEnum($enums_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"classes\":\r\n\t\t\t\t\t//create object classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $classes_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeObjectClass($classes_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"services\":\r\n\t\t\t\t\t//implement services (api actions)\r\n\t\t\t\t\tforeach($reflectionType->children() as $services_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeService($services_node);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//write main class (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t\t\t\t$this->writeMainClass($reflectionType->children());\r\n\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->addFile('KalturaTypes.js', $this->enumTypes);\r\n\t\t$this->addFile('KalturaVO.js', $this->voClasses);\r\n\t\t$this->addFile('KalturaServices.js', $this->serviceClasses);\r\n\t\t$this->addFile('KalturaClient.js', $this->mainClass);\r\n\t\t//write project file (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t$this->writeProjectFile();\r\n\t}", "public function generateSampleCode() {\n\t\t$sampleCode = new SampleCode();\n\t\treturn array($sampleCode);\n\t}", "abstract public function generate();", "public function GenerateInterface($name = null) {\n\t\t\tif (!$name) $name = $this->getGeneratedInterface(); \n\t\t\t$this->writeLine('interface '.$name.' {'); \n if (isset($this->select_one)) \n foreach($this->select_one as $rq) \n $rq->writeSignature(true); \n if (isset($this->select)) \n foreach($this->select as $rq) \n $rq->writeSignature(true);\n if (isset($this->insert)) \n foreach($this->insert as $rq) \n $rq->writeSignature(true);\n if (isset($this->update)) \n foreach($this->update as $rq) \n $rq->writeSignature(true);\n if (isset($this->delete)) \n foreach($this->delete as $rq) \n $rq->writeSignature(true); \n $this->writeLine('}');\n }", "public function generate()\n\t{\n\t\t$entityName = mb_strtolower($this->getEntityName());\n\n\t\t$entityDir = Yii::getAlias(self::PATH_TO_MODULE . '/' . $entityName);\n\n\t\tif (!is_dir($entityDir) && !mkdir($entityDir) && !is_dir($entityDir)) {\n\t\t\tthrow new InternalException(InternalException::ERROR_DENIED, \"Не удалось создать папку: {$entityDir}\");\n\t\t}\n\n\t\t$entityTableFilePath = \"{$entityDir}/{$entityName}.php\";\n\n\t\t$files = [\n\t\t\tnew CodeFile($entityTableFilePath, $this->render('table.php')),\n\t\t];\n\n\t\t$helpersDir = __DIR__ . '/default/admininterface';\n\n\t\tif (!is_dir($helpersDir) && !mkdir($helpersDir) && !is_dir($helpersDir)) {\n\t\t\tthrow new InternalException(InternalException::ERROR_DENIED, \"Не удалось создать папку: {$helpersDir}\");\n\t\t}\n\n\t\tforeach ($dirs = scandir($helpersDir, null) as $file) {\n\t\t\tif ($file === '.' || $file === '..') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$templateFilePath = $helpersDir . '/' . $file;\n\t\t\t$codeFilePath = $entityDir . '/admininterface/' . $entityName . $file;\n\t\t\tif (is_file($templateFilePath) && pathinfo($templateFilePath, PATHINFO_EXTENSION) === 'php') {\n\t\t\t\t$files[] = new CodeFile($codeFilePath, $this->render(\"admininterface/$file\"));\n\t\t\t}\n\t\t}\n\n\t\treturn $files;\n\t}", "public function generate()\n {\n $interfacesData = json_decode($this->json, true);\n foreach ($interfacesData as $interface) {\n $filename = $interface['name'] . '.java';\n $interfaceObject = new JAVAInterfaceObject();\n $interfaceObject->setName($interface['name']);\n foreach ($interface['methods'] as $method) {\n $methodObject = new JAVAMethod();\n $methodObject->setName($method['name']);\n $methodObject->setReturnValue($method['returnType']);\n $methodObject->setScope($method['scope']);\n $methodObject->setComment($method['comment']);\n foreach ($method['parameters'] as $parameter) {\n $parameterObject = new Parameter();\n $parameterObject->setName($parameter['name']);\n $parameterObject->setType($parameter['type']);\n $methodObject->addParameter($parameterObject);\n }\n foreach ($method['annotations'] as $annotation) {\n $annotationObject = new Annotation();\n $annotationObject->setName($annotation['name']);\n $annotationObject->setValue($annotation['value']);\n $annotationObject->setInterpreter('@');\n $methodObject->addAnnotation($annotationObject);\n }\n $interfaceObject->addMethod($methodObject);\n \n }\n file_put_contents($this->folder . DIRECTORY_SEPARATOR . $filename, $interfaceObject->toString());\n }\n }", "public function generate()\n{\n$user_code=\"{% extends 'resource.twig.c' %}\\n\".$this->user_code;\n\n$buf=$this->gen->renderer->render_string($this->filename,$user_code\n\t,array('resource' =>$this, 'global' => $this->gen));\n$this->gen->file_write($this->dest_filename,$buf);\n}" ]
[ "0.662946", "0.6511017", "0.60634387", "0.60634387", "0.6019794", "0.58341897", "0.58341897", "0.58334684", "0.58334684", "0.583344", "0.583344", "0.583344", "0.583344", "0.583344", "0.58287543", "0.580936", "0.5801711", "0.57794714", "0.5778451", "0.5763455", "0.5762898", "0.5743411", "0.57207924", "0.5717369", "0.5692571", "0.5686366", "0.5673723", "0.5663429", "0.5631773", "0.56172377" ]
0.820904
0
Generate the entity code
public function GenerateEntity() { return $this->entity->Generate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generateEntityCode()\n {\n $tables = $this->getTables();\n \n $code = \" require_once 'grandprix.data.php';\";\n foreach ($tables as $table)\n {\n $columns = $this->getColumns($table['tableName']);\n $children = $this->getChildren($table['tableName']);\n \n $code .=\n\"\n /**\n * \" . ucfirst($table['tableName']) . \" Data Entity class.\n * \n * @package Grandprix\n * @subpackage Data\n */\n class \" . ucfirst($table['tableName']) . \" extends DataEntity\n { \n\";\n \n foreach ($columns as $column)\n {\n $code .=\n\"\n /**\n * @var \" . self::getPhpType($column['dataType']) . \"\n */\n public \\$\" . ucfirst($column['columnName']) . \";\n\";\n }\n\n $code .=\n\"\n /**\n * Creates an empty instance of this class.\n * \n * @return \" . ucfirst($table['tableName']) . \"\n */\n public static function createInstance()\n {\n \\$className = __CLASS__; return new \\$className();\n }\n \n /**\n * Creates an instance of this class based on the provided data array.\n *\n * @param array \\$data The keyed array containing the data\n * @return \" . ucfirst($table['tableName']) . \"\n */\n public static function fromData(&\\$data)\n {\n \\$entity = self::createInstance();\n \\$entity->setObjectData(\\$data);\n return \\$entity;\n }\n }\n\";\n \n }\n \n return $code;\n }", "public function generate()\n\t{\n\t\t$entityName = mb_strtolower($this->getEntityName());\n\n\t\t$entityDir = Yii::getAlias(self::PATH_TO_MODULE . '/' . $entityName);\n\n\t\tif (!is_dir($entityDir) && !mkdir($entityDir) && !is_dir($entityDir)) {\n\t\t\tthrow new InternalException(InternalException::ERROR_DENIED, \"Не удалось создать папку: {$entityDir}\");\n\t\t}\n\n\t\t$entityTableFilePath = \"{$entityDir}/{$entityName}.php\";\n\n\t\t$files = [\n\t\t\tnew CodeFile($entityTableFilePath, $this->render('table.php')),\n\t\t];\n\n\t\t$helpersDir = __DIR__ . '/default/admininterface';\n\n\t\tif (!is_dir($helpersDir) && !mkdir($helpersDir) && !is_dir($helpersDir)) {\n\t\t\tthrow new InternalException(InternalException::ERROR_DENIED, \"Не удалось создать папку: {$helpersDir}\");\n\t\t}\n\n\t\tforeach ($dirs = scandir($helpersDir, null) as $file) {\n\t\t\tif ($file === '.' || $file === '..') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$templateFilePath = $helpersDir . '/' . $file;\n\t\t\t$codeFilePath = $entityDir . '/admininterface/' . $entityName . $file;\n\t\t\tif (is_file($templateFilePath) && pathinfo($templateFilePath, PATHINFO_EXTENSION) === 'php') {\n\t\t\t\t$files[] = new CodeFile($codeFilePath, $this->render(\"admininterface/$file\"));\n\t\t\t}\n\t\t}\n\n\t\treturn $files;\n\t}", "public function getGeneratedCode()\n {\n $adminClass = $this->getAdminClassName();\n if (class_exists($adminClass)) {\n throw new \\Exception('Impossible to generate. Class ' . $adminClass . ' already exists.');\n }\n $namespaceParts = explode('\\\\', $adminClass);\n if (isset($namespaceParts[0]) && $namespaceParts[0] == '') {\n array_shift($namespaceParts);\n }\n\n return $this->getTemplating()->render('MaxmodeGeneratorBundle:Sonata:Admin/class.php.twig', array(\n 'className' => array_pop($namespaceParts),\n 'namespace' => implode('\\\\', $namespaceParts),\n 'entityClass' => $this->getEntityItem()->getItemClassName(),\n 'editFields' => $this->prepareFieldList($this->_editFields),\n 'listFields' => $this->prepareFieldList($this->_listFields),\n 'maxLineLength' => self::MAX_LINE_LENGTH,\n ));\n }", "public function generate()\n {\n AnnotationRegistry::registerFile(\n __DIR__ . '/../vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'\n );\n\n $driver = new AnnotationDriver(\n new CachedReader(new AnnotationReader(), new ArrayCache()),\n array(\n __DIR__ . '/../library/Xi/Filelib/Backend/Adapter/DoctrineOrm/Entity',\n )\n );\n\n $config = new Configuration();\n $config->setMetadataDriverImpl($driver);\n $config->setProxyDir(ROOT_TESTS . '/data/temp');\n $config->setProxyNamespace('Proxies');\n\n $em = EntityManager::create($this->connectionOptions, $config);\n\n $st = new SchemaTool($em);\n $metadata = $st->getCreateSchemaSql($em->getMetadataFactory()->getAllMetadata());\n\n return join(\";\\n\", $metadata) . \";\\n\";\n }", "public function entityFor(): string;", "public function GenerateStructure() {\n // WRITE CONSTRUCTOR\n $this->writeLine(\n sprintf(\n '$return = new pdoMap_Dao_Metadata_Table(\n \\'%1$s\\',\\'%2$s\\',\\'%3$s\\',\n \\'%4$s\\',\\'%5$s\\',\\'%6$s\\');',\n $this->name, // adapter name\n $this->getTableName(), // table name\n $this->entity->getClassName(), // entity class name\n $this->getInterface(), // interface service name\n $this->getAdapterClassName(), // adapter class name (if set)\n $this->getUse() // database connection\n )\n );\n // WRITE PROPERTIES\n $this->entity->GenerateProperties(); \n $this->writeLine('return $return;');\n }", "function fromexp(){return \"`{$this->entity->name}`\"; }", "public function generate(ContentEntityInterface $entity);", "private function _model_generation()\n\t{\n\t\t$prefix = ($this->bundle == DEFAULT_BUNDLE) ? '' : Str::classify($this->bundle).'_';\n\n\t\t// set up the markers for replacement within source\n\t\t$markers = array(\n\t\t\t'#CLASS#'\t\t=> $prefix.$this->class_prefix.$this->class,\n\t\t\t'#LOWER#'\t\t=> $this->lower,\n\t\t\t'#TIMESTAMPS#'\t=> $this->_timestamps\n\t\t);\n\n\t\t// loud our model template\n\t\t$template = Utils::load_template('model/model.tpl');\n\n\t\t// holder for relationships source\n\t\t$relationships_source = '';\n\n\t\t// loop through our relationships\n\t\tforeach ($this->arguments as $relation)\n\t\t{\t\n\n\t\t\t// if we have a valid relation\n\t\t\tif(strstr($relation, ':')) :\n\n\t\t\t\t// split\n\t\t\t\t$relation_parts = explode(':', Str::lower($relation));\n\n\t\t\t\t// we need two parts\n\t\t\t\tif(! count($relation_parts) == 2) continue;\n\n\t\t\t\t$method = $this->method($relation_parts[1]);\n\n\t\t\t\t// markers for relationships\n\t\t\t\t$rel_markers = array(\n\t\t\t\t\t'#CLASS#'\t\t\t=> $prefix.$this->class_prefix.$this->class,\n\t\t\t\t\t'#SINGULAR#'\t\t=> Str::lower(Str::singular($relation_parts[1])),\n\t\t\t\t\t'#PLURAL#'\t\t\t=> Str::lower(Str::plural($relation_parts[1])),\n\t\t\t\t\t'#METHOD#'\t\t\t=> $method,\n\t\t\t\t\t'#WORD#'\t\t\t=> Str::classify(Str::singular($relation_parts[1])),\n\t\t\t\t\t'#WORDS#'\t\t\t=> Str::classify(Str::plural($relation_parts[1]))\n\t\t\t\t);\n\n\t\t\t\t// start with blank\n\t\t\t\t$relationship_template = '';\n\n\t\t\t\t// use switch to decide which template\n\t\t\t\tswitch ($relation_parts[0])\n\t\t\t\t{\n\t\t\t\t\tcase \"has_many\":\n\t\t\t\t\tcase \"hm\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/has_many.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"belongs_to\":\n\t\t\t\t\tcase \"bt\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/belongs_to.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"has_one\":\n\t\t\t\t\tcase \"ho\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/has_one.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"has_many_and_belongs_to\":\n\t\t\t\t\tcase \"hbm\":\n\t\t\t\t\t\t$relationship_template = Utils::load_template('model/has_many_and_belongs_to.tpl');\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\telse:\n\n\t\t\t\t$method = $this->method($relation);\n\n\t\t\t\t// markers for relationships\n\t\t\t\t$rel_markers = array(\n\t\t\t\t\t'#METHOD#'\t\t=> $method,\n\t\t\t\t);\n\n\t\t\t\t$relationship_template = Utils::load_template('model/method.tpl');\n\n\t\t\tendif;\t\n\n\t\t\t// add it to the source\n\t\t\t$relationships_source .= Utils::replace_markers($rel_markers, $relationship_template);\n\t\t}\n\n\t\t// add a marker to replace the relationships stub\n\t\t// in the model template\n\t\t$markers['#RELATIONS#'] = $relationships_source;\n\n\t\t// add the generated model to the writer\n\t\t$this->writer->create_file(\n\t\t\t'Model',\n\t\t\t$prefix.$this->class_prefix.$this->class,\n\t\t\t$this->bundle_path.'models/'.$this->class_path.$this->lower.EXT,\n\t\t\tUtils::replace_markers($markers, $template)\n\t\t);\n\t}", "public function generate()\n {\n $this->createUsersEntity();\n }", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function getCode()\n {\n return OrderModel::ENTITY;\n }", "function genClass()\r\n {\r\n $this->_file->file_name = GEN_DIR.\"/\".$this->db_name.\"/\".$this->table_name.\"/\".$this->table_name.\".php\";\r\n $this->_file->open(\"w\");\r\n\r\n $string = $this->_genClassHead();\r\n $string .= $this->_genConstructor();\r\n $string .= $this->_genInsert();\r\n $string .= $this->_genUpdate(); \r\n $string .= $this->_genDelete();\r\n $string .= $this->_genSelect();\r\n $string .= $this->_genSelectAll();\r\n $string .= $this->_genClassFoot();\r\n $this->_file->write($string);\r\n }", "abstract public function getEntityTypeCode();", "public function generate()\n{\n$user_code=\"{% extends 'resource.twig.c' %}\\n\".$this->user_code;\n\n$buf=$this->gen->renderer->render_string($this->filename,$user_code\n\t,array('resource' =>$this, 'global' => $this->gen));\n$this->gen->file_write($this->dest_filename,$buf);\n}", "abstract public function generate();", "abstract protected function createEntities();", "public function run()\n {\n EntityType::create([\n 'en' => ['name' => 'offers'],\n 'ar' => ['name' => 'العروض'],\n ]);\n }", "public function generateCode() {\n $content = \"\";\n foreach ($this->arrTemplates as $template) {\n if (!file_exists($template)) {\n //Template not found\n continue;\n }\n $content .= file_get_contents($template);\n }\n \n foreach ($this->attributes as $key => $val) {\n $content = str_replace($this->placeHolderStart.$key.$this->placeHolderEnd, $val, $content);\n }\n return $content;\n }", "protected function body(Entity $entity, $prefix){\n $this->string .= \"EntitySql::getInstanceFromString('{$entity->getName()}', '{$prefix}')->_fields() . ',\n' . \";\n\n }", "public function generate()\n\t{\n\t\treturn parent::generate();\n\t}", "public function generate();", "public function generate();", "public function generate();" ]
[ "0.85135317", "0.6651294", "0.6615616", "0.6508623", "0.63875175", "0.6356612", "0.6240284", "0.6197398", "0.6104176", "0.61031663", "0.60996467", "0.60996467", "0.6099628", "0.6099628", "0.6099628", "0.6099628", "0.6099628", "0.6053485", "0.60358304", "0.6029271", "0.59321535", "0.593065", "0.5907243", "0.586685", "0.5858167", "0.58272517", "0.5801855", "0.57975435", "0.57975435", "0.57975435" ]
0.7133943
1
Generates an anchor name based on a given heading.
public function generateAnchorName($heading) { // Remove HTML tags $heading = preg_replace('/<(.*?)>/', '', $heading); // Remove parentheses $heading = preg_replace('/\(.*?\)/', '', $heading); // Remove inner-word punctuation $heading = preg_replace('/[\'"‘’“”]/', '', $heading); // Get the "words". This will search for any unicode "letters" or "numbers" preg_match_all('/[\p{L}\p{N}]+/u', $heading, $words); $words = ArrayHelper::filterEmptyStringsFromArray($words[0]); // Turn them into camelCase foreach ($words as $i => $word) { // Special case if the whole word is capitalized if (strtoupper($word) == $word) { $words[$i] = strtolower($word); } else { $words[$i] = lcfirst($word); } } // Put them together as the anchor name return implode('-', $words); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function heading_anchors() {\r\n\t\t// headings to have an anchor, so we can take the option that the structure() function now offers us for achieving the same end.\r\n\t\t$count = 0;\r\n\t\t$arrayRxp = array(\r\n\t\t//'(<h1>)(<em>)*([0-9]{1,2})' => '$1$2<a name=\"$3\"></a>$3',\r\n\t\t//'(<h2>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5\"></a>$3$4$5',\r\n\t\t//'(<h3>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7\"></a>$3$4$5$6$7',\r\n\t\t//'(<h4>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7_$9\"></a>$3$4$5$6$7$8$9',\r\n\t\t//'(<h2>)(<em>)*([0-9]{1,2})' => '$1$2<a name=\"$3\"></a>$3',\r\n\t\t//'(<h3>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5\"></a>$3$4$5',\r\n\t\t//'(<h4>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7\"></a>$3$4$5$6$7',\r\n\t\t//'(<h5>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7_$9\"></a>$3$4$5$6$7$8$9',\r\n\t\t//'(<h3>)(<em>)*([0-9]{1,2})' => '$1$2<a name=\"$3\"></a>$3',\r\n\t\t//'(<h4>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5\"></a>$3$4$5',\r\n\t\t//'(<h5>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7\"></a>$3$4$5$6$7',\r\n\t\t//'(<h6>)(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1$2<a name=\"$3_$5_$7_$9\"></a>$3$4$5$6$7$8$9',\r\n\t\t// (2011-06-27) the name attribute is deprecated\r\n\t\t// hmm, this is further complicated by the fact that preexistent id attributes on headings can act as anchors...\r\n\t\t'(<h1)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})' => '$1 id=\"$5\"$2>$4$5',\r\n\t\t'(<h2)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7\"$2>$4$5$6$7',\r\n\t\t'(<h3)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9\"$2>$4$5$6$7$8$9',\r\n\t\t'(<h4)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9_$11\"$2>$4$5$6$7$8$9$10$11',\r\n\t\t'(<h2)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})' => '$1 id=\"$5\"$2>$4$5',\r\n\t\t'(<h3)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7\"$2>$4$5$6$7',\r\n\t\t'(<h4)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9\"$2>$4$5$6$7$8$9',\r\n\t\t'(<h5)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9_$11\"$2>$4$5$6$7$8$9$10$11',\r\n\t\t'(<h3)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})' => '$1 id=\"$5\"$2>$4$5',\r\n\t\t'(<h4)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7\"$2>$4$5$6$7',\r\n\t\t'(<h5)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9\"$2>$4$5$6$7$8$9',\r\n\t\t'(<h6)( ([^i]|i[^d])[^=]*=\"[^\"]*?\")*>(<em>)*([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})(\\.)([0-9]{1,2})' => '$1 id=\"$5_$7_$9_$11\"$2>$4$5$6$7$8$9$10$11',\r\n\t\t);\r\n\t\tforeach($arrayRxp as $search => $replace) {\r\n\t\t\t$this->code = preg_replace('/' . $search . '/is', $replace, $this->code, -1, $ct);\r\n\t\t\t$count += $ct;\r\n\t\t}\r\n\t\t$this->logMsgIf('heading_anchors', $count);\r\n\t}", "function anchor_content_headings($content) {\n // now run the pattern and callback function on content\n // and process it through a function that replaces the title with an id \n $content = preg_replace_callback(\"/\\<h([1|2|3|4])\\>(.*?)\\<\\/h([1|2|3|4])\\>/\", function ($matches) {\n $hTag = $matches[1];\n $title = $matches[2];\n $slug = str_replace(\" \", \"-\", strtolower($title));\n return '<a href=\"#'. $slug .'\"><h'. $hTag .' id=\"' . $slug . '\">' . $title . '</h'. $hTag .'></a>';\n }, $content);\n return $content;\n }", "function anchor($title, $link, $tabs = 0, $nl = true)\n{\n start_anchor($link, $tabs, false) ;\n echo $title ;\n close_anchor($tabs = 0, $nl) ;\n}", "protected function getHeadingHtml() {\n\t\t$heading = '';\n\t\tif ( $this->isUserPage ) {\n\t\t\t// The heading is just the username without namespace\n\t\t\t$heading = $this->pageUser->getName();\n\t\t} else {\n\t\t\t$pageTitle = $this->getOutput()->getPageTitle();\n\t\t\tif ( $pageTitle ) {\n\t\t\t\t$heading = $pageTitle;\n\t\t\t}\n\t\t}\n\t\treturn Html::rawElement( 'h1', [ 'id' => 'section_0' ], $heading );\n\t}", "public function get_name()\n {\n return 'section-heading';\n }", "function emc_fmc_section_title() {\r\n\r\n\t$url = get_post_type_archive_link( 'emc_content_focus' );\r\n\t$html = sprintf( '<h2 class=\"emc-section-heading\">%1$s <a class=\"emc-what-is-this\" href=\"%2$s\">%3$s</a></h2>',\r\n\t\tesc_html__( 'Foundational Math Concepts', 'emc' ),\r\n\t\tesc_url( $url ),\r\n\t\tesc_html__( 'What is this?', 'emc' )\r\n\t);\r\n\r\n\techo $html;\r\n\r\n}", "private function _addAnchorToTagMatch($match)\n\t{\n\t\t$anchorName = $this->generateAnchorName($match[3]);\n\n\t\treturn '<'.$match[1].$match[2].' id='.$anchorName.'>' .\n\t\t\t$match[3] .\n\t\t\t' <a class=\"anchor\" href=\"#'.$anchorName.'\" title=\"'.Craft::t('Direct link to {heading}', array('heading' => $match[3])).'\">#</a>' .\n\t\t\t'</'.$match[1].'>';\n\t}", "function addHeading(& $heading, & $parentElement) {\n\t\t$headingElement =& $this->_document->createElement('heading');\n\t\t$parentElement->appendChild($headingElement);\n\t\t\n\t\t$this->addCommonProporties($heading, $headingElement);\n\t\t\n\t\tif ($heading->getField('location') == 'right')\n\t\t\t$headingElement->setAttribute('location', 'right');\n\t\telse\n\t\t\t$headingElement->setAttribute('location', 'left');\n\t}", "function make_heading(& $str, $strip = TRUE)\n{\n\tglobal $NotePattern;\n\n\t// Cut fixed-heading anchors\n\t$id = '';\n\t$matches = array();\n\tif (preg_match('/^(\\*{0,3})(.*?)\\[#([A-Za-z][\\w-]+)\\](.*?)$/m', $str, $matches)) {\n\t\t$str = $matches[2] . $matches[4];\n\t\t$id = $matches[3];\n\t} else {\n\t\t$str = preg_replace('/^\\*{0,3}/', '', $str);\n\t}\n\n\t// Cut footnotes and tags\n//\tif ($strip === TRUE) $str = strip_htmltag(make_link(preg_replace($NotePattern, '', $str)));\n\tif ($strip === TRUE) $str = strip_htmltag(make_link(preg_replace_callback($NotePattern, create_function('$matches','return;'), $str)));\t\t// PHP5.5用修正\n\t\n\treturn $id;\n}", "function new_heading()\n {\n }", "private function generateTitle()\n {\n $label = $this->pre_link_text.' ';\n if($this->terms_page) {\n // if a page has been given, create the anchor\n $label.= '<a href=\"'.$this->terms_page.'\"';\n if($this->open_new_window) {\n // if were to open the link in a new window, add target=\"_blank\"\n $label.= ' target=\"_blank\"';\n }\n $label.= '>'.$this->link_text;\n $label.= '</a>';\n } else {\n // else just show the link text as plain text\n $label.= $this->link_text;\n }\n if(!is_null($this->post_link_text)) {\n // if the post link text is not blank, add it our string\n $label.= ' '.$this->post_link_text;\n }\n $label.= '.';\n // set the field title (label). We use DBField here to stop SS escaping it.\n $this->title = DBField::create_field('HTMLFragment', $label);\n return $this;\n }", "function _headerToLink($title, $create = false) {\n if($create) {\n return sectionID($title, $this->headers);\n } else {\n $check = false;\n return sectionID($title, $check);\n }\n }", "private function generateHeading()\n {\n //get current dimensions\n\t\t$highestRow = $this->objWorksheet->getHighestRow(); // e.g. 10\n\t\t$highestColumn = $this->objWorksheet->getHighestColumn(); // e.g 'F'\n\n\t\t$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn);\n\n\t\t//insert row on top\n\t\t$this->objWorksheet->insertNewRowBefore(1,2);\n\n\t\t//merge cells\n\t\t$this->objWorksheet->mergeCells(\"A1:\".$highestColumn.\"1\");\n\n\t\t//set the text for header\n\t\t$this->objWorksheet->setCellValue(\"A1\", $this->_headingText);\n\t\t$this->objWorksheet->getStyle('A1')->getAlignment()->setWrapText(true);\n\t\t$this->objWorksheet->getRowDimension('1')->setRowHeight(48);\n\n //Apply style\n\t\t$this->objWorksheet->getStyle(\"A1\")->applyFromArray($this->_headingStyleArray);\n }", "function heading( $data = '', $h = '1', $attributes = '' )\n\t{\n\t\treturn '<h' . $h . _stringify_attributes( $attributes ) . '>' . $data . '</h' . $h . '>';\n\t}", "protected function callback_heading_as_html ($matches) {\n\t\t$heading = preg_replace(\"|%%(\\d+)%%|\", '', $matches[2]);\n\n $result = str_repeat ('+', (strlen($matches[1]) - 1)).' '.$heading.\"\\n\";\n\n return $result;\n }", "private function url_anchor_target($title) {\n $return = FALSE;\n\n if ($title) {\n $return = trim(strip_tags($title));\n\n // convert accented characters to ASCII\n $return = StringUtils::spanish_stemmer($return);\n\n // replace newlines with spaces (eg when headings are split over multiple lines)\n $return = str_replace(array(\"\\r\", \"\\n\", \"\\n\\r\", \"\\r\\n\"), ' ', $return);\n\n // remove &amp;\n $return = str_replace('&amp;', '', $return);\n\n // remove non alphanumeric chars\n $return = preg_replace('/[^a-zA-Z0-9 \\-_]*/', '', $return);\n\n // convert spaces to _\n $return = str_replace(\n array(' ', ' '),\n '_',\n $return\n );\n\n // remove trailing - and _\n $return = rtrim($return, '-_');\n\n // lowercase everything?\n $return = strtolower($return);\n\n // hyphenate?\n $return = str_replace('_', '-', $return);\n $return = str_replace('--', '-', $return);\n }\n\n if (array_key_exists($return, $this->collision_collector)) {\n $this->collision_collector[$return]++;\n $return .= '-' . $this->collision_collector[$return];\n }\n else {\n $this->collision_collector[$return] = 1;\n }\n\n return $return;\n }", "function MyApp_Interface_HEAD_Title()\n {\n $comps=preg_split('/::/',parent::MyApp_Interface_HEAD_Title());\n $keys=array(\"Initials\",\"Name\",\"Title\");\n \n $unit=$this->Unit();\n foreach ($keys as $key)\n {\n $name=$this->GetRealNameKey($unit,$key);\n \n if (!empty($name))\n {\n array_push($comps,$name);\n break;\n }\n }\n \n $event=$this->Event();\n foreach ($keys as $key)\n {\n $name=$this->GetRealNameKey($event,$key);\n \n if (!empty($name))\n {\n array_push($comps,$name);\n break;\n }\n }\n\n return join(\"::\",array_reverse($comps)); \n }", "public function getHeadingText(string $markdown, string $heading = '#') : string\n {\n // Try to find a heading 1 and if so use that text for the title tag of the generated page\n $matches = array();\n $title = '';\n\n try {\n preg_match(\"/\".$heading.\" ?(.*)/\", $markdown, $matches);\n $title = (count($matches) > 0) ? trim($matches[1]) : '';\n\n // Be sure that the heading 1 wasn't type like # MyHeadingOne # i.e. with a final #\n\n $title = ltrim(rtrim($title, $heading), $heading);\n } catch (Exception $e) {\n }\n\n return $title;\n }", "abstract protected function generateName();", "function genesis_seo_site_title_new_link() {\n\t\n\t//* Set what goes inside the wrapping tags\n\t$inside = sprintf( '<a href=\"%s\" title=\"Visit Bruno Group Signature Services\">%s</a>', trailingslashit( '//brunogroup.com/signature-services' ), get_bloginfo( 'name' ) );\n\n\t//* Determine which wrapping tags to use\n\t$wrap = is_home() && 'title' === genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : 'p';\n\n\t//* A little fallback, in case an SEO plugin is active\n\t$wrap = is_home() && ! genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : $wrap;\n\n\t//* And finally, $wrap in h1 if HTML5 & semantic headings enabled\n\t$wrap = genesis_html5() && genesis_get_seo_option( 'semantic_headings' ) ? 'h1' : $wrap;\n\n\t//* Build the title\n\t$title = genesis_html5() ? sprintf( \"<{$wrap} %s>\", genesis_attr( 'site-title' ) ) : sprintf( '<%s id=\"title\">%s</%s>', $wrap, $inside, $wrap );\n\t$title .= genesis_html5() ? \"{$inside}</{$wrap}>\" : '';\n\n\t//* Echo (filtered)\n\techo apply_filters( 'genesis_seo_title', $title, $inside, $wrap );\n\n}", "function tep_create_sort_heading($sortby, $colnum, $heading) {\n global $PHP_SELF;\n\n $sort_prefix = '';\n $sort_suffix = '';\n\n if ($sortby) {\n $sort_prefix = '<a href=\"' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('page', 'info', 'sort')) . 'page=1&sort=' . $colnum . ($sortby == $colnum . 'a' ? 'd' : 'a')) . '\" title=\"' . tep_output_string(TEXT_SORT_PRODUCTS . ($sortby == $colnum . 'd' || substr($sortby, 0, 1) != $colnum ? TEXT_ASCENDINGLY : TEXT_DESCENDINGLY) . TEXT_BY . $heading) . '\" class=\"productListing-heading\">' ;\n $sort_suffix = (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? '+' : '-') : '') . '</a>';\n }\n\n return $sort_prefix . $heading . $sort_suffix;\n }", "function qa_anchor($basetype, $postid)\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\treturn strtolower($basetype) . $postid; // used to be $postid only but this violated HTML spec\n}", "function makeLink($text, $link, $section = '', $title = '', $target = '')\n{\n\t// if there's nothing to link, don't link anything\n\tif(!$text)\n\t\treturn '';\n\n\t$ret = '<a href=\"';\n\n\tif($section != 'EXTERIOR')\n\t{\n\t\tif($section == '/')\n\t\t\t$ret .= ARC_WWW_PATH;\n\t\telse if($section)\n\t\t\t$ret .= ARC_WWW_PATH . $section . '/';\n\n\t\t$ret .= '?';\n\t}\n\n\tif($section != 'EXTERIOR' && isset($_GET['sqlprofile']) || isset($_POST['sqlprofile']))\n\t\t$link .= '&sqlprofile';\n\n\t$ret .= str_replace('&', '&amp;', $link) . '\"';\n\n\tif($title)\n\t\t$ret .= ' title=\"' . $title . '\"';\n\n\tif($target)\n\t\t$ret .= ' target=\"' . $target . '\"';\n\n\t$ret .= '>' . $text . '</a>';\n\n\treturn $ret;\n}", "public static function makeTitle($name);", "function generateHeading()\n{\n\t$heading = \"\";\n\t \n $randomNum = rand(1, 100);\n\t \n\tif (($randomNum >= 1) && ($randomNum <= 26))\n\t{\n\t\t$heading = getMealTypeHeading();\n\t}\n\n\tif (($randomNum >= 27) && ($randomNum <= 30))\n\t{\n\t $heading = \"Under the Clock\";\n\t}\n\n\tif (($randomNum >= 31) && ($randomNum <= 32))\n\t{\n\t\t$heading = \"Newest\";\n\t}\n\t\n\tif (($randomNum >= 33) && ($randomNum <= 40))\n\t{\n\t\t$heading = \"Top Hits\";\n\t}\n\t\n\tif (($randomNum >= 41) && ($randomNum <= 42))\n\t{\n\t\t$heading = \"Chef Favourites\";\n\t}\n\t\n\tif (($randomNum >= 43) && ($randomNum <= 50))\n\t{\n\t\t$heading = \"Trending Now\";\n\t}\n\t\n\tif (($randomNum >= 51) && ($randomNum <= 52))\n\t{\n\t\t$heading = \"Spotlight\";\n\t}\n\t\n\tif (($randomNum >= 53) && ($randomNum <= 57))\n\t{\n\t\t$heading = getNextHolidayHeading();\n\t\t\n\t\tif (strcmp($heading, \"None\") == 0)\n\t\t{\n\t\t\tgenerateHeading();\n\t\t}\n\t}\n\t\n\tif (($randomNum >= 58) && ($randomNum <= 62))\n\t{\n\t\t$heading = \"New\";\n\t}\n\t\n\tif (($randomNum >= 63) && ($randomNum <= 77))\n\t{\n\t\t$heading = getPopularIngredientHeading();\n\t}\n\t\n\tif (($randomNum >= 78) && ($randomNum <= 90))\n\t{\n\t\t$heading = getOtherFeatureHeading();\n\t}\n\t\n\tif (($randomNum >= 91) && ($randomNum <= 100))\n\t{\n\t\t$heading = getEthnicityHeading();\n\t}\n\n\treturn $heading;\n}", "function get_anchor( $title ) {\n $unwanted_array = array( 'Š'=>'S', 'š'=>'s', 'Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E',\n 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U',\n 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss', 'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c',\n 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o',\n 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y' );\n $title = strtr( $title, $unwanted_array );\n $title = str_replace(\" \", \"-\", $title);\n $title = str_replace(\"'\", \"-\", $title);\n $title = strtolower($title);\n $title = substr($title, 0, 50);\n return $title;\n }", "public function getMainHeading() : string\n {\n return <<< 'MAINHEADING'\nUnique to Oracle\nMAINHEADING;\n }", "function createSimpleLink($idName) {\n echo '<a href=\"index.php\" id=\"' . $idName . '\" class=\"nested\">homepage</a>';\n }", "public function get_name() {\n return 'apr_modern_heading';\n }", "function getPersonLink($lastname,$firstname) {\n return getNormalisedChars($lastname).'_'.getNormalisedChars($firstname);\n}" ]
[ "0.67633224", "0.6057888", "0.60150397", "0.58401763", "0.58030105", "0.5766994", "0.5761064", "0.56733775", "0.5601421", "0.5550285", "0.5527711", "0.55157316", "0.5511428", "0.549522", "0.54193324", "0.54011625", "0.5390055", "0.5373236", "0.5349038", "0.5334081", "0.52985007", "0.5294069", "0.52653766", "0.5248362", "0.5231715", "0.5228947", "0.52286106", "0.5184138", "0.5172474", "0.51680577" ]
0.84614486
0
Private Methods ========================================================================= Adds an anchor link to the given HTML tag match.
private function _addAnchorToTagMatch($match) { $anchorName = $this->generateAnchorName($match[3]); return '<'.$match[1].$match[2].' id='.$anchorName.'>' . $match[3] . ' <a class="anchor" href="#'.$anchorName.'" title="'.Craft::t('Direct link to {heading}', array('heading' => $match[3])).'">#</a>' . '</'.$match[1].'>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function __parseLinksHTML($match)\n\t{\n\t\t$completeUrl = $match[1] ? $match[0] : \"http://{$match[0]}\";\n\n\t\treturn '<a target=\"_blank\" href=\"' . $completeUrl . '\">'\n\t\t . $match[2] . $match[3] . $match[4] . '</a>';\n\t}", "public function renderTagAnchor($result);", "public function appendHyperlink(?string $href = null, mixed $content = null, ?string $target = null): A;", "public static function anchor($url,$text,$attributes = null) {\r\n\t\treturn \"<a href='\".Configuration::getURLPath().\"/\".$url.\"' \".$attributes.\">\".$text.\"</a>\";\r\n\t}", "public function renderTagAnchor($result) {\n\n\t\t$file = $this->file;\n\n\t\treturn sprintf('<a href=\"%s%s\" target=\"%s\">%s</a>',\n\t\t\t$this->getAnchorUri() ? $this->getAnchorUri() : $file->getPublicUrl(TRUE),\n\t\t\t$this->getAppendTimeStamp() ? '?' . $file->getProperty('tstamp') : '',\n\t\t\t$this->getTarget(),\n\t\t\t$result\n\t\t);\n\t}", "public function renderTagAnchor($result) {\n\t\t$uri = $this->thumbnailService->getAnchorUri();\n\t\tif (! $uri) {\n\t\t\t$uri = $this->getUri();\n\t\t}\n\n\t\treturn sprintf('<a href=\"%s\" target=\"_blank\" data-uid=\"%s\">%s</a>',\n\t\t\t$uri,\n\t\t\t$this->getFile()->getUid(),\n\t\t\t$result\n\t\t);\n\t}", "public function makeClickableLinks()\n {\n $this->texte = trim(preg_replace(\n \"#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i\",\n \"$1$3</a>\",\n preg_replace_callback(\n '#([\\s>])((www|ftp)\\.[\\w\\\\x80-\\\\xff\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is',\n function ($matches) {\n return $this->makeClickableUrlCallback($matches, 'http://');\n },\n preg_replace_callback(\n '#([\\s>])([\\w]+?://[\\w\\\\x80-\\\\xff\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is',\n function ($matches) {\n return $this->makeClickableUrlCallback($matches);\n },\n ' '.$this->texte\n )\n )\n ));\n\n return $this;\n }", "function start_anchor($link, $tabs = 0, $nl = false)\n{\n /**\n * Starting Anchor tag.\n *\n * Args:\n * $link (int): the link of the Anchor\n * $tabs (int): number of tabs for indentation, default is 0\n * $nl (bool): print NewLine in the end ? default is 'false'.\n */\n start_tag('a', Tab($tabs), $nl, \"href='\" . $link . \"'\") ;\n}", "function linktag($destination, $content, $class='', $style='', $id='', $extra='', $title_alt='')\n\t{\n\t\t$content = ($this->entitize_content) ? htmlentities('' . $content) : $content;\n\t\t$extra .= ' href=\"' . $destination . '\"';\n\t\t$extra .= ($title_alt == '' ? '' : ' alt=\"' . $title_alt . '\" title=\"' . $title_alt . '\"');\n\t\treturn $this->tag('a', $content, $class, $style, $id, $extra);\n\t}", "static function a($href=false, $content='', $arguments=false) {\n\t\t$arguments = self::arguments($arguments);\n\t\tif (empty($href)) {\n\t\t\t$arguments['class'] = (empty($arguments['class'])) ? 'empty' : $arguments['class'] . ' empty';\n\t\t} else {\n\t\t\t$arguments['href'] = $href;\n\t\t}\n\t\tif ($email = str::starts($href, 'mailto:')) {\n\t\t\t$encoded = str::encode($email);\n\t\t\t$href = 'mailto:' . $encoded;\n\t\t\t$content = str_replace($email, $encoded, $content);\n\t\t}\n\t\treturn self::tag('a', $arguments, $content);\n\t}", "private function rep_links_callback($match) {\t\r\n\t\t\r\n\t\t$query = substr($match[0],2,-2);\r\n\r\n\t\t$db_Article = Article::getArticle()->select($query);\r\n\t\t\r\n\t\tif($db_Article != FALSE) {\r\n\t\t\t$query = ' <a href=\"' . urlencode($query) . '\">' . $query . '</a> ';\r\n\t\t\t$this->links[$this->linkCount] = $db_Article;\r\n\t\t\t$this->linkCount++;\r\n\t\t}\r\n\t\t\r\n\t\treturn $query;\t\t\r\n\t}", "public function addAnchor ($href, $text, $id = NULL, $class = NULL, $attributes = array ())\n\t{\n\t\t$id = (empty($id) ? '' : ' id=\"' . $id . '\"');\n\t\t$class = (empty($class) ? '' : ' class=\"' . $class . '\"');\n\n\t\t$html = \"<a href=\\\"$href\\\"\" . $id . $class . \"\";\n\t\tif ($attributes) {\n\t\t\t$html .= $this -> addAttributes($attributes);\n\t\t}\n\t\t$html .= \">$text</a>\";\n\n\t\treturn $html;\n\t}", "function links_add_target($content, $target = '_blank', $tags = array('a'))\n {\n }", "function alink($title=null,$url=null,$attributes=[], $secure=null,$escape=false) \n\t{\n\t\treturn app('html')->alink($title,$url,$attributes,$secure,$escape);\n\t}", "static function a($link, $text, $id = Null, $class = Null)\n {\n return '<a'.self::_id($id).self::_class($class).' href=\"'. $link.'\" title=\"'.$text.'\" >'.$text.'</a>';\n }", "protected static function doInternalAnchorsCallback($matches)\n {\n $whole_match = $matches[1];\n\n $text = trim($matches[2], '/');\n\n if(count($matches) > 3)\n {\n $url = $matches[3] == '' ? $matches[4] : $matches[3];\n $title =& $matches[7];\n }\n else\n {\n $url = $matches[2];\n $title = '';\n }\n\n $url = self::encodeAttribute($url);\n\n $red =(self::isLink($url)) ? '' : ' redlink';\n\n $attribs = 'class=\"internal'.$red.'\"';\n\n $url = self::encodeAttribute(self::getLink($url));\n\n $redAdvise =($red) ? jgettext('Click to create this page...') : '';\n\n $attribs .=((isset($title) && $title) || $redAdvise)\n ? ' title=\"'.$redAdvise.$title.'\"'\n : '';\n\n return JHtml::link($url, $text, $attribs);\n }", "protected function single_post_tag_link( $match = '' ) {\n\t\treturn $this->get_term_link( $match, 'post_tag' );\n\t}", "public static function linkField($text,$url='#',$option=array()) {\n $option['href']=$url;\n \t\treturn self::htmltag('a',$option,$text);\n\t}", "function tag_href($selector, $text = '', $source = false)\r\n{\r\n $t = tags_href($selector, $text, $source);\r\n if ($t) $r = reset($t);\r\n else $r='';\r\n\r\n if (DEV)\r\n xlogc('tag_href', $r, $selector, $text, $source);\r\n\r\n return $r;\r\n}", "function url_to_link_callback($matches)\n{\n return '<a href=\"' . htmlspecialchars($matches[1]) . '\">' . $matches[1] . '</a>';\n}", "function link($text,$url = '#',$attribute = array()){ \r\n\t\t$attribute = $this->convertStringAtt($attribute);\r\n\t\tif($url){\r\n\t\t\tpreg_match(\"/([^\\?]+)?(\\?)?(.+)?/\", $url, $reg);\r\n\t\t\tif(isset($reg[3])){\r\n\t\t\t\tpreg_match_all(\"/&(amp;)?([^&]+)/\",\"&\".$reg[3], $exp);\r\n\t\r\n\t\t\t\tfor ($i=0;$i<count($exp[2]);$i++){\r\n\t\t\t\t\t$var = explode(\"=\",$exp[2][$i]);\r\n\t\t\t\t\t$exp[2][$i] = $var[0].\"=\".urlencode(isset($var[1]) ? $var[1] : '');\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\t$reg[3] = implode(\"&\",$exp[2]);\r\n\t\t\t}else{\r\n\t\t\t\t$reg[3] = '';\r\n\t\t\t}\r\n\t\t\t$stat = '';\r\n\t\t\tif(isset($attribute['state'])){\r\n\t\t\t\tif($attribute['state'] == \"*\"){\r\n\t\t\t\t\t$ex = array();\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$ex = explode(\",\",$attribute['state']);\r\n\t\t\t\t}\r\n\t\t\t\t$stat = $GLOBALS['BASIC_URL']->serialize($ex);\r\n\t\t\t\tunset($attribute['state']);\r\n\t\t\t}\r\n\t\t\t$tmp = $stat.$reg[3];\r\n\t\t\t$attribute['href'] = $reg[1].($tmp ? '?' : '').$tmp;\r\n\t\t\tif(isset($attribute['path'])){\r\n\t\t\t\t$tmp = $GLOBALS['BASIC']->pathFile(\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t$GLOBALS['BASIC']->ini_get('root_virtual'),\r\n\t\t\t\t\t\t$attribute['href']\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\r\n\t\t\t\t$attribute['href'] = $tmp[0].$tmp[1];\r\n\t\t\t\tunset($attribute['path']);\r\n\t\t\t}\r\n\t\t\t$attribute['href'] = $GLOBALS['BASIC_URL']->link($attribute['href']);\r\n\t\t}else{\r\n\t\t\t$attribute['href'] = '#';\r\n\t\t}\r\n\t\treturn $this->createTag('a',$attribute,$text);\r\n\t}", "public function toHyperlink(?string $linkText = null): A;", "public function asLink()\n {\n $label = $this->title ?: $this->value;\n return '<a href=\"' . $this->href .'\" title=\"' . $label . '\">' . $label . '</a>';\n }", "function tags_href($selector, $text = '', $source = false)\r\n{\r\n $r = urls(tags_attr($selector, 'href', $text, $source));\r\n if (DEV)\r\n xlogc('tags_href', $r, $selector, $text, $source);\r\n\r\n return $r;\r\n}", "static public function a($href = '', $title = '', $target = \"_self\", $misc = '', $newline = true)\n {\n global $config;\n if(empty($title)) $title = $href;\n $newline = $newline ? \"\\n\" : '';\n /* if page has onlybody param then add this param in all link. the param hide header and footer. */\n if(strpos($href, 'onlybody=yes') === false and isset($_GET['onlybody']) and $_GET['onlybody'] == 'yes')\n {\n $onlybody = $config->requestType == 'PATH_INFO' ? \"?onlybody=yes\" : \"&onlybody=yes\";\n $href .= $onlybody;\n }\n if($target == '_self') return \"<a href='$href' $misc>$title</a>$newline\";\n return \"<a href='$href' target='$target' $misc>$title</a>$newline\";\n }", "public function add_link($url, $title, $sort_order=NULL, $attributes=array()) {\n $args = func_get_args();\n \t$filter_pass = DynamicMenu_Filter::apply_filters('add_link', $args);\n if (!$filter_pass) {\n return $this;\n }\n $attributes = array_merge($this->attributes, $attributes);\n $anchor = Html::anchor($url, $title, $attributes);\n $key = self::slugify($title);\n $this->links[$key] = array(\n 'html' => $anchor,\n 'title' => $title,\n 'sort_order' => (int) $sort_order,\n );\n return $this;\n }", "public static function panchor($protocol, $uri, $title = FALSE, $attributes = FALSE)\n\t{\n\t\treturn html::anchor($uri, $title, $attributes, $protocol);\n\t}", "function anchor($title, $link, $tabs = 0, $nl = true)\n{\n start_anchor($link, $tabs, false) ;\n echo $title ;\n close_anchor($tabs = 0, $nl) ;\n}", "protected function addLinks()\n {\n }", "private function make_clickable($text) {\r\n return preg_replace_callback(\r\n '#\\b(?<![href|src]=[\\'\"])https?://[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^[:punct:]\\s]|/))#', create_function(\r\n '$matches', 'return \"<a href=\\'{$matches[0]}\\'>{$matches[0]}</a>\";'\r\n ), $text\r\n );\r\n }" ]
[ "0.7048786", "0.6548224", "0.6483145", "0.6248656", "0.62374574", "0.61355644", "0.6080457", "0.60681975", "0.5975719", "0.58886385", "0.5886247", "0.5843463", "0.5804454", "0.5783415", "0.5773873", "0.57414365", "0.57133985", "0.5709507", "0.5705729", "0.5649693", "0.5619515", "0.5615243", "0.5613189", "0.5565561", "0.55654323", "0.55205333", "0.55088556", "0.55074364", "0.55019", "0.5501403" ]
0.77676207
0
Returns an Identity object based on session_id() getIdentity() returns a base Scenario_Identity object with the identity string provided by session_id(). If the session is not yet started, it will throw an error, as when to start the session should be up to the developer.
public function getIdentity(array $params) { $id = session_id(); if ($id == "") { /** * @see Scenario_Exception */ require_once 'Scenario/Exception.php'; throw new Scenario_Exception('Unable to use session_id() as an identity string, are you missing a session_start()?'); } /** * @see Scenario_Identity */ require_once 'Scenario/Identity.php'; return new Scenario_Identity(session_id()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function GetSessionIdentity ();", "public function getSessionID();", "public static function getSessionid();", "public function get_session_id()\n {\n }", "protected function _getId ()\n {\n return session_id();\n }", "protected function getSessionId()\n {\n return \\Session::getId();\n }", "public function getSessionid()\n {\n return $this->sessionid;\n }", "public static function getId(){\n\t\treturn session_id();\n\t}", "public function getSessionID()\n {\n return $this->_session;\n }", "abstract function getSessionById($id);", "public function getSessionID(){\r\n\t\treturn $this->sessionID;\r\n\t}", "public function getIdentity ()\n\t{\n\t\treturn $this->session->get('user');\n\t}", "public function getSessionID()\n {\n return $this->sessionID;\n }", "public abstract function getIdentity();", "public function get($id = '') {\n\t\tif($id == '') {\n\t\t\t$id = $this->id;\n\t\t}\n\t\t$sess = ORM::for_table($this->session_type)->find_one($id);\n\t\treturn $sess;\n\t}", "public function startSession($id){\n\n }", "public function getId(): string\n {\n return session_id();\n }", "public function getSessionId();", "public function getSessionId();", "public function getId() {\n\t\treturn session_id();\n\t}", "public function getSessionID() {\n return $this->sessionID;\n }", "public function getIdentity()\n {\n return $this->session->get('auth-identity');\n }", "final function getSession_id() {\n\t\treturn $this->getSessionId();\n\t}", "function get_id () {\n\t\treturn $this->session_id ?: false;\n\t}", "public function getId()\n {\n return $this->getValue('session_id');\n }", "public function getIdentity();", "public function getSessionId() {}", "public function getId()\n {\n $this->checkIfStarted();\n\n return $this->sessionId;\n }", "public function getId()\n {\n $this->checkIfStarted();\n\n return session_id();\n }", "public function startSession()\r\n {\r\n if (session_id() === '') {\r\n // Attempt to start a session\r\n session_start();\r\n\r\n $this->session_id = session_id() ?: false;\r\n }\r\n\r\n return $this->session_id;\r\n }" ]
[ "0.729675", "0.6675893", "0.65923226", "0.6418689", "0.63862914", "0.6324631", "0.63078356", "0.62673134", "0.62353605", "0.62349796", "0.6232178", "0.62279487", "0.62115616", "0.6198297", "0.61880475", "0.6180125", "0.6169896", "0.6162204", "0.6162204", "0.615711", "0.61369383", "0.6131677", "0.60899824", "0.6077583", "0.60692894", "0.60370135", "0.6031871", "0.5998894", "0.5991374", "0.5985018" ]
0.7623249
0
Load all items from the cart
private function loadItems() { if ($this->items === null) { $this->items = $this->storage->load(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function load() {\n if(isset($_SESSION['cart'])) {\n $this->items = $_SESSION['cart'];\n } \n }", "public function loadPreviousItems()\n {\n //first get it out of db.\n if ($orderId = $this->_order->check_cart($this->_auth->id)) {\n $order = $this->_order->get_order($orderId);\n $this->_items = unserialize($order['items']); \n $this->_shipping = array();\n $this->_shippingCost = array();\n $this->_salesTax = array();\n $this->_total = 0;\n $this->persist();\n }\n }", "public function getCartItems($cart_id);", "public function getSessionItems() { global $smarty; \n if(isset($_SESSION['checkout']['items'])) { \n $smarty->assign(\"cart\", $_SESSION['checkout']['items']);\n }\n }", "public function loadData(Cart $cart)\n\t{\n\t\tif (!Validate::isLoadedObject($cart) || ($products = $cart->getProducts()) === array())\n\t\t\treturn;\n\n\t\t$currency = new Currency($cart->id_currency);\n\t\tif (!Validate::isLoadedObject($currency))\n\t\t\treturn;\n\n\t\t// Cart rules are available from prestashop 1.5 onwards.\n\t\tif (_PS_VERSION_ >= '1.5')\n\t\t{\n\t\t\t$cart_rules = (array)$cart->getCartRules(CartRule::FILTER_ACTION_GIFT);\n\n\t\t\t$gift_products = array();\n\t\t\tforeach ($cart_rules as $cart_rule)\n\t\t\t\tif ((int)$cart_rule['gift_product'])\n\t\t\t\t{\n\t\t\t\t\tforeach ($products as $key => &$product)\n\t\t\t\t\t\tif (empty($product['gift'])\n\t\t\t\t\t\t\t&& (int)$product['id_product'] === (int)$cart_rule['gift_product']\n\t\t\t\t\t\t\t&& (int)$product['id_product_attribute'] === (int)$cart_rule['gift_product_attribute'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$product['cart_quantity'] = (int)$product['cart_quantity'];\n\t\t\t\t\t\t\t$product['cart_quantity']--;\n\n\t\t\t\t\t\t\tif (!($product['cart_quantity'] > 0))\n\t\t\t\t\t\t\t\tunset($products[$key]);\n\n\t\t\t\t\t\t\t$gift_product = $product;\n\t\t\t\t\t\t\t$gift_product['cart_quantity'] = 1;\n\t\t\t\t\t\t\t$gift_product['price_wt'] = 0;\n\t\t\t\t\t\t\t$gift_product['gift'] = true;\n\n\t\t\t\t\t\t\t$gift_products[] = $gift_product;\n\n\t\t\t\t\t\t\tbreak; // One gift product per cart rule\n\t\t\t\t\t\t}\n\t\t\t\t\tunset($product);\n\t\t\t\t}\n\n\t\t\t$items = array_merge($products, $gift_products);\n\t\t}\n\t\telse\n\t\t\t$items = $products;\n\n\t\tforeach ($items as $item)\n\t\t{\n\t\t\t$name = $item['name'];\n\t\t\tif (isset($item['attributes_small']))\n\t\t\t\t$name .= ' ('.$item['attributes_small'].')';\n\n\t\t\t$this->line_items[] = array(\n\t\t\t\t'product_id' => (int)$item['id_product'],\n\t\t\t\t'quantity' => (int)$item['cart_quantity'],\n\t\t\t\t'name' => (string)$name,\n\t\t\t\t'unit_price' => Tiresias::helper('price')->format($item['price_wt']),\n\t\t\t\t'price_currency_code' => (string)$currency->iso_code,\n\t\t\t);\n\t\t}\n\t}", "private function loadAll() {\n\n return $this->search->getProducts();\n\n }", "public function cartItems()\n {\n if(Auth::check()) //if user is logged in\n {\n $userCartExistence = Cart::hasCart(Auth::id()); //check if logged in user has any cart\n if($userCartExistence) //if athenticated user has any cart then retrieve items from cart\n {\n $cartItems = Cart::CartItems(Auth::id());\n }\n else\n {\n $cartItems = null;\n }\n }\n else //if user is not logged in\n {\n $Cart = Session::has('cart') ? Session::get('cart') : null; //check if there is any cart in the session\n if($Cart)\n {\n $cartItems = $Cart->items; //if there is cart then retrieve items from cart\n }\n else\n {\n $cartItems = null;\n }\n }\n\n return $cartItems;\n // return response()->json(['cartItems' => $cartItems]);\n }", "public function allcartAction()\n {\n if ($this->_isCheckFormKey && !$this->_validateFormKey()) {\n $this->_forward('noRoute');\n return;\n }\n\n $wishlist = $this->_getWishlist();\n if (!$wishlist) {\n $this->_forward('noRoute');\n return;\n }\n $isOwner = $wishlist->isOwner(Mage::getSingleton('customer/session')->getCustomerId());\n\n $messages = array();\n $addedItems = array();\n $notSalable = array();\n $hasOptions = array();\n\n $cart = Mage::getSingleton('checkout/cart');\n $collection = $wishlist->getItemCollection()\n ->setVisibilityFilter();\n\n $qtysString = $this->getRequest()->getParam('qty');\n if (isset($qtysString)) {\n $qtys = array_filter(json_decode($qtysString), 'strlen');\n }\n\n foreach ($collection as $item) {\n /** @var Mage_Wishlist_Model_Item */\n try {\n \n $disableAddToCart = $item->getProduct()->getDisableAddToCart();\n $item->unsProduct(); \n \n // Start: Get childProduct and overwrite stored product with loaded simple configurable because it holds stock info\n $itemBuyRequest = $item->getBuyRequest();\n $childProduct = null; \n if($itemBuyRequest['super_attribute']) {\n \n $childProduct = $item->getProduct()->getTypeInstance(true)->getProductByAttributes($itemBuyRequest['super_attribute'], $item->getProduct());\n $childProduct = Mage::getModel('catalog/product')->load($childProduct->getId());\n\n if($childProduct) {\n //$buyRequest->setData('product', $childProduct->getId()); \n $item->setProduct($childProduct); \n $itemBuyRequest->setData('product', $childProduct->getId()); \n $item->mergeBuyRequest($itemBuyRequest); \n } \n } \n // End\n \n // Set qty\n if (isset($qtys[$item->getId()])) {\n $qty = $this->_processLocalizedQty($qtys[$item->getId()]);\n if ($qty) {\n $item->setQty($qty);\n }\n }\n $item->getProduct()->setDisableAddToCart($disableAddToCart);\n // Add to cart\n if ($item->addToCart($cart, $isOwner)) {\n $addedItems[] = $item->getProduct();\n }\n\n } catch (Mage_Core_Exception $e) {\n if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_NOT_SALABLE) {\n $notSalable[] = $item;\n } else if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS) {\n $hasOptions[] = $item;\n } else {\n $messages[] = $this->__('%s for \"%s\".', trim($e->getMessage(), '.'), $item->getProduct()->getName());\n }\n\n $cartItem = $cart->getQuote()->getItemByProduct($item->getProduct());\n if ($cartItem) {\n $cart->getQuote()->deleteItem($cartItem);\n }\n } catch (Exception $e) {\n Mage::logException($e);\n $messages[] = Mage::helper('wishlist')->__('Cannot add the item to shopping cart.');\n }\n }\n\n if ($isOwner) {\n $indexUrl = Mage::helper('wishlist')->getListUrl($wishlist->getId());\n } else {\n $indexUrl = Mage::getUrl('wishlist/shared', array('code' => $wishlist->getSharingCode()));\n }\n if (Mage::helper('checkout/cart')->getShouldRedirectToCart()) {\n $redirectUrl = Mage::helper('checkout/cart')->getCartUrl();\n } else if ($this->_getRefererUrl()) {\n $redirectUrl = $this->_getRefererUrl();\n } else {\n $redirectUrl = $indexUrl;\n }\n\n if ($notSalable) {\n $products = array();\n foreach ($notSalable as $item) {\n $products[] = '\"' . $item->getProduct()->getName() . '\"';\n }\n $messages[] = Mage::helper('wishlist')->__('Unable to add the following product(s) to shopping cart: %s.', join(', ', $products));\n }\n\n if ($hasOptions) {\n $products = array();\n foreach ($hasOptions as $item) {\n $products[] = '\"' . $item->getProduct()->getName() . '\"';\n }\n $messages[] = Mage::helper('wishlist')->__('Product(s) %s have required options. Each of them can be added to cart separately only.', join(', ', $products));\n }\n\n if ($messages) {\n $isMessageSole = (count($messages) == 1);\n if ($isMessageSole && count($hasOptions) == 1) {\n $item = $hasOptions[0];\n if ($isOwner) {\n $item->delete();\n }\n $redirectUrl = $item->getProductUrl();\n } else {\n $wishlistSession = Mage::getSingleton('wishlist/session');\n foreach ($messages as $message) {\n $wishlistSession->addError($message);\n }\n $redirectUrl = $indexUrl;\n }\n }\n\n if ($addedItems) {\n // save wishlist model for setting date of last update\n try {\n $wishlist->save();\n }\n catch (Exception $e) {\n Mage::getSingleton('wishlist/session')->addError($this->__('Cannot update wishlist'));\n $redirectUrl = $indexUrl;\n }\n\n $products = array();\n foreach ($addedItems as $product) {\n $products[] = '\"' . $product->getName() . '\"';\n }\n\n Mage::getSingleton('checkout/session')->addSuccess(\n Mage::helper('wishlist')->__('%d product(s) have been added to shopping cart: %s.', count($addedItems), join(', ', $products))\n );\n\n // save cart and collect totals\n $cart->save()->getQuote()->collectTotals();\n }\n\n Mage::helper('wishlist')->calculate();\n\n $this->_redirectUrl($redirectUrl);\n }", "private function load() {\n\n $db = Database::getInstance(); \n\t $con = $db->getConnection();\n \n $query = \"SELECT * FROM Products ORDER by ID DESC\";\n \n if ($result = $con->query($query)) {\n \t/* fetch object array */\n \t while ($prod = $result->fetch_object(\"Product\")) {\n\t\t\t \tarray_push($this->products, $prod);\n \t}\n \t/* free result set */\n \t$result->close();\n }\n\t}", "public function get_cart_items()\n\t{\n\t\t$this->initiate_cart();\n\t\treturn $this->ci->session->cart_items;\n\t}", "public function fetchAll()\r\n {\r\n \t// get from mem if available\r\n \t$memcache = new \\Memcached();\r\n \t$memcache->addServer('localhost', 11211);\r\n \t$key = md5(catalogProductList::MEMCACHED_FETCH_ALL);\r\n \t$cache_data = $memcache->get($key);\r\n \tif ($cache_data) {\r\n \t\t$this->log->addInfo('cache hit', array(\"key\" => $key));\r\n \t\t$this->data = $cache_data;\r\n \t} else {\r\n\t\t\t$this->data = $this->client->catalogProductList($this->sessionid);\r\n\t\t\t$memcache->set($key, $this->data, 60*1);\r\n \t}\r\n }", "public function _getItems(Cart $cart)\n {\n $items = $cart->getQuote()->getAllVisibleItems();\n try {\n $data = [];\n $configurableSkus = [];\n foreach ($items as $item) {\n $product = $item->getProduct();\n $_item = [];\n $_item['vars'] = [];\n if ($item->getProduct()->getTypeId() == 'configurable') {\n $_item['isConfiguration'] = 1;\n $parentIds[] = $item->getParentItemId();\n $options = $this->cpModel->getOrderOptions($product);\n $_item['id'] = $options['simple_sku'];\n $_item['title'] = $options['simple_name'];\n $_item['vars'] = $this->_getVars($options);\n $configurableSkus[] = $options['simple_sku'];\n } elseif (!in_array($item->getSku(), $configurableSkus) && $item->getProductType() != 'bundle') {\n $_item['id'] = $item->getSku();\n $_item['title'] = $item->getName();\n } else {\n $_item['id'] = null;\n }\n if ($_item['id']) {\n $_item['qty'] = (int)$item->getQty();\n $_item['url'] = $item->getProduct()->getProductUrl();\n $_item['image'] = $this->productHelper->getSmallImageUrl($product);\n $current_price = null;\n $reg_price = $product->getPrice();\n $special_price = $product->getSpecialPrice();\n $special_from = $product->getSpecialFromDate();\n $special_to = $product->getSpecialToDate();\n if ($special_price &&\n ($special_from === null || (strtotime($special_from) < strtotime('Today'))) &&\n ($special_to === null || (strtotime($special_to) > strtotime('Today')))) {\n $current_price = $special_price;\n } else {\n $current_price = $reg_price;\n }\n $_item['price'] = $current_price * 100;\n if ($tags = $this->_getTags($product)) {\n $_item['tags'] = $tags;\n }\n $data[] = $_item;\n }\n }\n\n return $data;\n } catch (\\Exception $e) {\n $this->clientManager->getClient()->logger($e);\n\n return false;\n }\n }", "public function initShoppingCarts()\n\t{\n\t\t$this->collShoppingCarts = array();\n\t}", "public function retrieveItems() {\n $this->all = array();\n $this->_backlog = array();\n $this->_progress = array();\n $this->_done = array();\n $table_name = \"items\";\n $connection = db_connect();\n if ($connection->connect_error) {\n die(\"Connection failed: \" . $connection->connect_error);\n }\n $sql = \"SELECT * FROM $table_name ORDER BY id\";\n $result = @mysqli_query($connection, $sql) or die(mysqli_error($connection));\n while ($row = mysqli_fetch_array($result)) {\n $id = $row['id'];\n $category = $row['category'];\n $text = $row['text'];\n $item = new Item($id, $category, $text);\n array_push($this->all, $item);\n if ($category == 1) {\n array_push($this->_backlog, $item);\n } else if ($category == 2) {\n array_push($this->_progress, $item);\n } else if ($category == 3) {\n array_push($this->_done, $item);\n }\n }\n }", "function getCart(){\n \treturn $this->myCart->getList();\n }", "public function resetItems()\n {\n Yii::$app->session->set('cart', []);\n }", "private function loadAllItems(): array\n {\n /** @var array<WC_Order_Item_Fee|WC_Order_Item_Product|WC_Order_Item_Shipping> $items */\n $items = array_merge(\n $this->object->get_items(),\n $this->object->get_items(\"shipping\"),\n $this->object->get_items(\"fee\")\n );\n\n return $this->items = $items;\n }", "protected function get_items_from_cart() {\n\t\t$this->items = array();\n\n\t\tforeach ( $this->cart->get_cart() as $cart_item_key => $cart_item ) {\n\t\t\t$item = $this->get_default_item_props();\n\t\t\t$item->key = $cart_item_key;\n\t\t\t$item->object = $cart_item;\n\t\t\t$item->tax_class = $cart_item['data']->get_tax_class();\n\t\t\t$item->taxable = 'taxable' === $cart_item['data']->get_tax_status();\n\t\t\t$item->price_includes_tax = wc_prices_include_tax();\n\t\t\t$item->quantity = $cart_item['quantity'];\n\t\t\t$item->price = wc_add_number_precision_deep( $cart_item['data']->get_price() * $cart_item['quantity'] );\n\t\t\t$item->product = $cart_item['data'];\n\t\t\t$item->tax_rates = $this->get_item_tax_rates( $item );\n\t\t\t$this->items[ $cart_item_key ] = $item;\n\t\t}\n\t}", "private static function loadItems()\n\t{\n\t\tself::$_items=array();\t\t\t\t\t\t//FIXME Сделать критерию с селект где не будет лишних полей\n\t\t$models=self::model()->findAll();\n\t\tforeach($models as $model)\n\t\t\tself::$_items[$model->code]=$model->value;\n\t}", "public function reloadItems();", "function carts()\n\t\t{\n\t\t\tif ( ! $this->data['user'])\n\t\t\t{\n\t\t\t\t$this->flexi_cart->set_error_message('You must login to view saved carts.', 'public', TRUE);\n\t\t\t\tredirect('login');\n\t\t\t}\n\n\t\t\t// The load/save/delete cart data functions require the flexi cart ADMIN library.\n\t\t\t$this->load->library('flexi_cart_admin');\n\n\t\t\t// Create an SQL WHERE clause to list all previously saved cart data for a specific user.\n\t\t\t// This examples also prevents cart session data from confirmed orders being loaded, by checking the readonly status is set at '0'.\n\t\t\t$sql_where = array(\n\t\t\t\t$this->flexi_cart->db_column('db_cart_data', 'user') => $this->data['user']->id,\n\t\t\t\t$this->flexi_cart->db_column('db_cart_data', 'readonly_status') => 0\n\t\t\t);\n\t\t\t// Get a list of all saved carts that match the SQL WHERE statement.\n\t\t\t$this->data['saved_cart_data'] = $this->flexi_cart_admin->get_db_cart_data_query(FALSE, $sql_where)->result_array();\n\n\t\t\t// Get any status message that may have been set.\n\t\t\t$this->data['message'] = $this->session->flashdata('message');\n\n\t\t\t$this->load->view('public/dashboard/carts_view', $this->data);\n\t\t}", "public function load_cart($table){\n\t\t\t$this ->empty_cart();\n\t\t\t//Recupera numero de mesa\n\t\t\t$mesa = \"table\".$table;\n\t\t\t//Asigna lo guardado en esa mesa al carro actual\n\t\t\t$_SESSION['cart'] = $_SESSION[$mesa];\n\n\t\t\t//Actualiza la informacion de que el carrito actual pertenece a esa mesa\n\t\t\t$_SESSION['current'] = $mesa;\n\n\t\t\t//Actualiza el carro para mostrar cambios\n \t\t$this->update_cart();\n\n\t\t}", "public function cart(): void\n {\n $userData = $this->getSession()->getCurrentUserData();\n\n if ($userData->getCart() && $userData->getCart()->hasProducts())\n {\n echo $this->render('cart/shoppingCart', $userData->getRenderCartParams());\n }\n }", "public function get_items(){\n\t \t//Si no esta vacio empieza a imprimirlos\n\t \tif(!empty($this->cart)){\n\t \t\t\n\t\t \tforeach ($this->cart as $linea) {\n\t\t \t\t\n\t\t \t\t?>\n\t\t\t <tr class=\"filaTicket\">\n\t\t\t\t <td height=\"20\"><?=$linea['code']?></td>\n\t\t\t\t <td><?=$linea['product']?></td>\n\t\t\t\t <td align=\"right\"><?php echo number_format($linea['price'], 2, ',','.')?></td>\n\t\t\t\t <td align=\"right\"><?=$linea['iva']?></td>\n\t\t\t\t <td align=\"right\"><?= $linea['amount']?></td>\n\t\t\t\t <td align=\"right\"><?php echo number_format($linea['subtotal'], 2, ',','.') ?></td>\n\n\t\t\t\t \n\t\t\t\t <td>\n\t\t\t\t <button onClick=\"borrarProducto(<?=$linea['code']?>);\">Borrar</button>\n\n\t\t\t\t </td>\n\n\t\t\t </tr>\n\t\t \t\t\t<?php\n\n\t \t}\n\n\t \t}\n\t \t\n\t }", "function _loadItems()\n\t{\n\t\tjimport('joomla.filesystem.folder');\n\n\t\t/* Get a database connector */\n\t\t$db =& JFactory::getDBO();\n\n\t\t$query = 'SELECT *' .\n\t\t\t\t' FROM #__extensions' .\n\t\t\t\t' WHERE state = -1' .\n\t\t\t\t' ORDER BY type, client_id, folder, name';\n\t\t$db->setQuery($query);\n\t\t$rows = $db->loadObjectList();\n\n\t\t$apps =& JApplicationHelper::getClientInfo();\n\n\t\t$numRows = count($rows);\n\t\tfor($i=0;$i < $numRows; $i++)\n\t\t{\n\t\t\t$row =& $rows[$i];\n\t\t\tif (strlen($row->manifest_cache)) {\n\t\t\t\t$data = unserialize($row->manifest_cache);\n\t\t\t\tif ($data) {\n\t\t\t\t\tforeach($data as $key => $value) {\n\t\t\t\t\t\t$row->$key = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$row->jname = JString::strtolower(str_replace(\" \", \"_\", $row->name));\n\t\t\tif (isset($apps[$row->client_id])) {\n\t\t\t\t$row->client = ucfirst($apps[$row->client_id]->name);\n\t\t\t} else {\n\t\t\t\t$row->client = $row->client_id;\n\t\t\t}\n\t\t}\n\t\t$this->setState('pagination.total', $numRows);\n\t\tif ($this->_state->get('pagination.limit') > 0) {\n\t\t\t$this->_items = array_slice($rows, $this->_state->get('pagination.offset'), $this->_state->get('pagination.limit'));\n\t\t} else {\n\t\t\t$this->_items = $rows;\n\t\t}\n\t}", "public function getItems(): array\n {\n return $_SESSION['cart'] ?? [];\n }", "function load() {\n $statement = $this->db->prepare('SELECT * FROM favs WHERE id = :id');\n $statement->execute(array(':id' => $this->get('id')));\n $data = $statement->fetch(PDO::FETCH_ASSOC);\n $this->setMultiple($data);\n }", "public function getItems()\n {\n $cartItems = [];\n\n foreach ($_SESSION['cart'] as $id => $data) {\n $cartItem = $this->productList->getProduct($id);\n $cartItem->count = $data['count'];\n\n $cartItems[$id] = $cartItem;\n }\n\n return $cartItems;\n }", "public function addToCart() {\n\t\t$baseQuantity = 1;\n\t\t$result = $this->db->select();\n\t\twhile(($row = mysql_fetch_assoc($result)) != FALSE){\n\t\t\t$_SESSION['cart'][] = array($row['id'], $row['name'], $row['description'], $row['cost'], $baseQuantity);\n\t\t}\n\t}", "public function getCart();" ]
[ "0.7864368", "0.70897734", "0.675945", "0.67422634", "0.65406716", "0.6492334", "0.64723665", "0.6472274", "0.6456924", "0.63853735", "0.63778657", "0.63772964", "0.63579094", "0.6341696", "0.63258237", "0.62854457", "0.6269724", "0.61998665", "0.61774546", "0.6154933", "0.6131463", "0.61149144", "0.6112809", "0.6112274", "0.6065976", "0.6057056", "0.6053385", "0.6051609", "0.6051427", "0.6048313" ]
0.7335535
1
Creates a new Permission model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { $model = new Permission(); if ($model->load(Yii::$app->request->post())) { $this->_saveRecord($model, 'permission_id'); } return $this->render(ACTION_CREATE, [MODEL => $model, 'titleView' => 'Create']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n $model = new PermissionForm();\n $post = Yii::$app->request->post();\n unset($this -> menuList[0]);\n if ($model->load($post) && $model->save()) {\n $model->menu_id = $post['PermissionForm']['menu_id'];\n $model->save();\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'menuList' => $this -> menuList,\n ]);\n }\n }", "public function create()\n {\n \n \n return view('permissions.create');\n }", "public function create()\n {\n return view('permissions.create_permission');\n }", "public function create()\n {\n $this->authorize('create', Permission::class);\n\n return view('laralum_permissions::create');\n }", "public function create()\n {\n return view('back_end.createPermission');\n }", "public function create()\n {\n abort_if(Gate::denies('permission_create'), Response::HTTP_FORBIDDEN, 'Forbidden');\n\n return view('admin.permissions.create');\n }", "public function create()\n {\n $title = 'Add Permission';\n return view('admin.permission.create', compact('title') );\n }", "public function create()\n {\n return view(\"role_permission.permission\");\n }", "public function create()\n {\n // \n return view('admin.permission.createP');\n }", "public function create()\n {\n return view('permission.create');\n }", "public function create()\n {\n return view('permissions.create');\n }", "public function create()\n {\n return view('admin.permissions.create');\n }", "public function create()\n {\n return view('admin.permissions.create');\n }", "public function create()\n {\n return view('backend.permission.create');\n }", "public function create()\n {\n return view('backend.permission.create');\n }", "public function create()\n {\n return view('UserCenter.Permissions.create');\n }", "public function create()\n {\n// -----------------------------\n $pageTitle = $this->getPageTitle() . \" - ایجاد\";\n// -----------------------------\n return view('Dashboard.Permission.create', compact('pageTitle'));\n }", "public function create()\n {\n if (Auth::user()->ability('superadministrator', 'create-permissions')){\n return view('permission.create',[\n 'pageheader'=>'权限',\n 'pagedescription'=>'添加',\n ]);\n }\n return abort(403,config('yyxt.permission_deny'));\n }", "public function create()\n {\n return view('permission.permissionadd');\n }", "public function create()\n {\n // if (! Gate::allows('users_manage')) {\n // return abort(401);\n // }\n return view('admin.permissions.create');\n }", "public function create(): View\n {\n return view('permissions.create');\n }", "public function create() {\n\t\tif(!(Entrust::hasRole(['support', 'admin']) || Entrust::can('permission.create'))) return redirect()->route('home');\n Log::debug('create');\n\n\t\treturn view('pages.permission.create');\n\t}", "public function create()\n {\n return view('admin.permission.add');\n }", "public function create()\n {\n\n return view('layouts.dashboard.admin.crud.permissions.create');\n\n }", "public function create()\n {\n $user = UserDetail::findOrFail(Session::get('id'));\n return view('admin.permissions.create', compact('user'));\n }", "public function create()\n {\n abort_unless(Gate::allows('permission-create'), 403);\n\n return view('admin.permission.create');\n }", "public function create()\n {\n abort_unless(Gate::allows('permission-create'), 403);\n\n return view('admin.permission.create');\n }", "public function create()\n {\n if (! Gate::allows('users_manage')) {\n return abort(401);\n }\n return view('admin.permissions.create');\n }", "public function create() {\r\n $this->db->insert(\"assets_permissions\", array());\r\n\r\n $this->model->setId($this->db->lastInsertId());\r\n\r\n return $this->save();\r\n }", "public function create()\n {\n //\n return view('admin.permissions.create', [\n 'title' => 'Создание разрешения',\n 'page_title' => 'Создание нового разрешения',\n ]);\n }" ]
[ "0.80862355", "0.74901825", "0.74845266", "0.74669313", "0.74579203", "0.74530274", "0.7448191", "0.7389891", "0.7350964", "0.734821", "0.7344983", "0.730681", "0.730681", "0.7271402", "0.7271402", "0.7264901", "0.7261882", "0.72546726", "0.7240605", "0.71993816", "0.71978396", "0.71722066", "0.7151991", "0.7112827", "0.70957816", "0.7081241", "0.7081241", "0.70481986", "0.70305973", "0.69792855" ]
0.84697866
0
Finds the Permission model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($permissionId) { $permissionId = self::stringDecode($permissionId); if (($model = Permission::findOne($permissionId)) !== null) { return $model; } $event = Yii::t( 'app', 'The requested page does not exist {id}', [ 'id' => $permissionId ] ); $bitacora = new Bitacora(); $bitacora->register($event, '', MSG_ERROR); throw new NotFoundHttpException( Yii::t( 'app', 'The requested page does not exist.' ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find(int $id): Permission\n {\n return Permission::find($id);\n }", "public function findPermissionById($permissionId);", "protected function _getPermissionModel()\n\t{\n\t\treturn $this->getModelFromCache('XenForo_Model_Permission');\n\t}", "protected function findModel($id)\n {\n if (($model = PermissionForm::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public abstract function find($primary_key, $model);", "protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }", "public function findPermission($permissionName);", "protected function findModel($id)\n {\n $auth = Configs::authManager();\n $item = $this->type === Item::TYPE_ROLE ? $auth->getRole($id) : $auth->getPermission($id);\n if ($item) {\n return new AuthItem($item);\n } else {\n $this->send($this->fail('数据不存在'));\n }\n }", "public function find($id)\n {\n return response(Permission::findById($id),HTTP_OK);\n }", "public function find($id)\n {\n $query=\"SELECT permissionId,\".\n \"permissionName \". \t\t \n\t \"FROM permission \".\n\t \"WHERE permissionId=\".$id;\n\n return($this->selectDB($query, \"Permission\"));\n }", "public function findByName(string $name)\n {\n return Permission::whereName($name)->first();\n }", "public function permission($permission)\n {\n if (is_numeric($permission)) {\n return $this->permissionModel->find((int) $permission);\n }\n\n return $this->permissionModel->like('name', $permission, 'none', null, true)->first();\n }", "protected function findModel($id)\n {\n if (($model = UserRoles::find()->where(['id' => $id, 'company_id' => Yii::$app->company->getCompanyID()])->joinWith('permissions')->one()) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "private function findModel($key)\n {\n if (null === $key) {\n throw new BadRequestHttpException('Key parameter is not defined in findModel method.');\n }\n\n $modelObject = $this->getNewModel();\n\n if (!method_exists($modelObject, 'findOne')) {\n $class = (new\\ReflectionClass($modelObject));\n throw new UnknownMethodException('Method findOne does not exists in ' . $class->getNamespaceName() . '\\\\' .\n $class->getShortName().' class.');\n }\n\n $result = call_user_func([\n $modelObject,\n 'findOne',\n ], $key);\n\n if ($result !== null) {\n return $result;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findPkSimple($key, ConnectionInterface $con)\n {\n $sql = 'SELECT id, permission, role_id, can FROM candle_role_permission WHERE id = :p0';\n try {\n $stmt = $con->prepare($sql);\n $stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(\\PDO::FETCH_NUM)) {\n /** @var ChildCandleRolePermission $obj */\n $obj = new ChildCandleRolePermission();\n $obj->hydrate($row);\n CandleRolePermissionTableMap::addInstanceToPool($obj, null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key);\n }\n $stmt->closeCursor();\n\n return $obj;\n }", "public function getById($id = null) {\r\n if ($id) {\r\n $this->model->setId($id);\r\n }\r\n\r\n $data = $this->db->fetchRow(\"SELECT * FROM assets_permissions WHERE id = ?\", $this->model->getId());\r\n $this->assignVariablesToModel($data);\r\n }", "protected function findModel($id)\n {\n if (($model = SecurityEntities::findOne($id)) !== null) \n {\n return $model;\n } else \n {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel()\n\t{\n\t\tif( $this->_model===null )\n\t\t{\n\t\t\t$itemName = $this->getItemName();\n\t\t\t\n\t\t\tif( $itemName!==null )\n\t\t\t{\n\t\t\t\t$this->_model = $this->_authorizer->authManager->getAuthItem($itemName);\n\t\t\t\t$this->_model = $this->_authorizer->attachAuthItemBehavior($this->_model);\n\t\t\t}\n\n\t\t\tif( $this->_model===null )\n\t\t\t\tthrow new CHttpException(404, Rights::t('core', 'The requested page does not exist.'));\n\t\t}\n\n\t\treturn $this->_model;\n\t}", "protected function findModel($id)\n\t{\n if (($model = UserLevel::findOne($id)) !== null) {\n return $model;\n }\n\n\t\tthrow new \\yii\\web\\NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\t}", "public static function findByName($name) {\n $permission = static::where('name', $name)->first();\n\n if (!$permission) {\n throw new PermissionDoesNotExist();\n }\n\n return $permission;\n }", "public function permission()\n {\n return $this->hasOne('App\\Models\\Permission', 'id', 'permission_fk');\n }", "public static function getPermissionModel()\n {\n return static::getModel('Permissions');\n }", "function model()\n {\n return Permission::class;\n }", "protected function findModel($id)\n {\n if (($model = denied::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = AcRole::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }\n }", "public function findOrFail($id)\n {\n $permission = $this->model->find($id);\n\n if (! $permission) {\n throw ValidationException::withMessages(['message' => trans('permission.could_not_find')]);\n }\n\n return $permission;\n }", "protected function findModel($id, $accessCheck = true)\n {\n if (($model = Category::findOne($id)) !== null) {\n \n if ($accessCheck && ! ($model->isAllowed()))\n throw new HttpException(403, Yii::t('app', 'You are not allowed to access this page.'));\n \n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function getPermission($id) {\n \t$user_auth = Auth::user();\n if (!$user_auth) \n {\n return response()->json(['error'=>'Unauthorised'], 401);\n } \n\t\t if (tbl_permission::where('user_id', $id)->exists()) \n\t\t {\n\t\t \t $tbl_permission = tbl_permission::where('user_id', $id)->get()->first(); \n return response()->json(['success' => $tbl_permission], $this-> successStatus); \n\t\t \n\t\t } \n\t\t else \n\t\t {\n\t\t return response()->json([\"message\" => \"Menu not found\"], 404);\n\t\t \n\t\t }\n\t\t \t\n }", "public function getById(int $id)\n {\n if (!$found = cache($id . '_userPermissionById')) {\n $found = $this->objectManager->where(['id' => $id])->load()->getRow();\n cache()->save($id . '_userPermissionById', $found, 3600);\n }\n\n return $found;\n }", "protected function findModel($id) {\n\t\tif (($model = Menu::findOne ( $id )) !== null) {\n\t\t\treturn $model;\n\t\t}\n\t\t\n\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\n\t}" ]
[ "0.6860788", "0.67522484", "0.6621091", "0.6521287", "0.6306831", "0.6301965", "0.6232957", "0.6203481", "0.6186248", "0.6177765", "0.60999924", "0.6051429", "0.6030567", "0.60105306", "0.6010337", "0.60079485", "0.5969247", "0.59671825", "0.5952619", "0.5928692", "0.59280086", "0.5909901", "0.5898157", "0.5837155", "0.5789591", "0.5783395", "0.5775167", "0.5767735", "0.5762642", "0.57475835" ]
0.67843777
1
Verifies the nextMap can properly be retrieved.
public function test_next_map() { $this->assertSame('Driel Single 01', $this->postScriptumServer->nextMap()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function valid()\n {\n if ($this->key() < count($this->map)) {\n return true;\n }\n return false;\n }", "protected function hasMappingErrorOccurred() {}", "public function test_next_map()\n {\n $this->assertSame('Belaya AAS v1', $this->btwServer->nextMap());\n }", "public function hasLastrealmapid(){\n return $this->_has(33);\n }", "public function test_next_map()\n {\n $this->assertSame('Al Basrah Insurgency v1', $this->btwServer->nextMap());\n }", "public function hasLastmapid(){\n return $this->_has(28);\n }", "public function hasMaps(){\n return $this->_has(15);\n }", "public function testIfMapsContainProperData()\n {\n $factory = new FileSystemMapFactory();\n $maps = $factory->create($this->data);\n $count = 0;\n\n foreach ($this->data as $name => $mapData) {\n /** @var FileSystemMap $map */\n $map = $maps[$count];\n\n $this->assertEquals($this->data[$name]['src'], $map->getSource());\n $this->assertEquals($this->data[$name]['dst'], $map->getDestination());\n\n if (isset($this->data['client'])) {\n $this->assertEquals($this->data['client'], $map->getClient());\n }\n\n $this->assertEquals($name, $map->getName());\n\n $count++;\n }\n }", "public function next()\n {\n $this->valid = (next($this->keys) !== false);\n }", "#[\\ReturnTypeWillChange]\n public function next()\n {\n $this->valid = (next($this->keys) !== false);\n }", "public function valid()\n {\n $map = $this->__getSerialisablePropertyMap();\n $mapKeys = array_keys($map);\n return isset($mapKeys[$this->iteratorPosition]);\n }", "public function valid() {\n return isset($this->iteratorKeys[$this->iteratorPosition]);\n }", "public function valid ()\n {\n return isset($this->offset) && isset($this->cache[ $this->offset ]);\n }", "public function hasMapid(){\n return $this->_has(4);\n }", "public function testIfMapBagContainsMaps()\n {\n $factory = new FileSystemMapFactory();\n $result = $factory->create($this->data);\n\n $this->assertContainsOnlyInstancesOf('\\SyncFS\\Map\\FileSystemMap', $result);\n }", "public function valid()\n {\n return isset($this->keys[$this->pointer]);\n }", "public function test_admin_set_next_map()\n {\n $this->assertTrue($this->postScriptumServer->adminSetNextMap('Heelsum Single 01'));\n }", "public function valid()\n {\n return array_key_exists($this->key(), $this->iterator_data);\n }", "public function valid() { \n\t\t$page = &$this->touchPage();\n\t\treturn (key($page) !== null);\n\t}", "public function valid() { return isset($this->keys[$this->pos]);\n }", "public function valid()\n {\n return $this->_key + 1 <= $this->_limit;\n }", "public function test_admin_set_next_map()\n {\n $this->assertTrue($this->btwServer->adminSetNextMap('Al Basrah Insurgency v1'));\n }", "public function test_admin_set_next_map()\n {\n $this->assertTrue($this->btwServer->adminSetNextMap('Al Basrah AAS v1'));\n }", "public function test_current_map()\n {\n $this->assertSame('Heelsum Single 01', $this->postScriptumServer->currentMap());\n }", "function next(){ \r\n\t $this->valid = (FALSE !== next($this->array)); \r\n\t }", "public function testNext()\n {\n $this->collection->next();\n $this->assertEquals(1, $this->collection->key());\n $this->assertEquals(2, $this->collection->current());\n\n $this->collection->last();\n $this->collection->next();\n $this->assertNull($this->collection->key());\n $this->assertFalse($this->collection->current());\n }", "public function valid() : bool\n {\n return !($this->key() >= count($this->currentRecordSet) && count($this->currentRecordSet) != $this->pageSize);\n }", "public function hasMapping();", "public function valid()\n {\n return $this->offsetExists($this->key());\n }", "protected function checkOffset($key){\r\n if(isset($this->_registry[$key]))\r\n return true;\r\n\r\n return false;\r\n }" ]
[ "0.6516455", "0.6312409", "0.6198853", "0.608791", "0.608383", "0.6065419", "0.6012295", "0.5837406", "0.5720046", "0.57073665", "0.56728506", "0.55918354", "0.54946816", "0.54834014", "0.5476507", "0.5465668", "0.54432833", "0.54375935", "0.5434883", "0.54344213", "0.5410341", "0.5386359", "0.5360473", "0.53355646", "0.5254661", "0.5248001", "0.5246299", "0.5182116", "0.5167841", "0.5162859" ]
0.63179684
1
Verifies the disconnected player list can properly be retrieved.
public function test_list_disconnected_players() { $playerList = $this->postScriptumServer->listDisconnectedPlayers(); $this->assertCount(3, $playerList); foreach ($playerList as $player) { if ($player->getId() === 88) { $this->assertSame(195, $player->getDisconnectedSince()); } else if ($player->getId() === 84) { $this->assertSame(108, $player->getDisconnectedSince()); } else if ($player->getId() === 42) { $this->assertSame(3, $player->getDisconnectedSince()); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_list_disconnected_players()\n {\n $playerList = $this->btwServer->listDisconnectedPlayers();\n\n $this->assertCount(0, $playerList);\n }", "public function test_list_disconnected_players()\n {\n $playerList = $this->btwServer->listDisconnectedPlayers();\n\n $this->assertCount(3, $playerList);\n\n foreach ($playerList as $player) {\n if ($player->getId() === 88) {\n $this->assertSame(195, $player->getDisconnectedSince());\n } else if ($player->getId() === 84) {\n $this->assertSame(108, $player->getDisconnectedSince());\n } else if ($player->getId() === 42) {\n $this->assertSame(3, $player->getDisconnectedSince());\n }\n }\n }", "public function test_list_players()\n {\n $players = $this->btwServer->listPlayers();\n\n $this->assertCount(0, $players);\n }", "private function checkOnlineList()\n {\n $this->online->checkOnlineList($this->loginTime);\n }", "private function check_players(){\n\t\tforeach($this->clients as $cli){\n\t\t\tif(null!==$cli){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function test_list_players()\n {\n $players = $this->postScriptumServer->listPlayers();\n\n $this->assertCount(77, $players);\n }", "public function test_list_players()\n {\n $players = $this->btwServer->listPlayers();\n\n $this->assertCount(77, $players);\n }", "public function ListValidatePlayer()\n {\n $users = User::where([\n ['isEnabled', 0],\n ['isDelete', 0]\n ])\n ->get();\n\n if ($users <> \"[]\") {\n return response()->json(\n\n $users\n ,\n 200\n );\n }\n }", "public function testConnection()\n {\n $lists = $this->_getLists();\n if ($lists === false) {\n return $this->_error;\n }\n\n return true;\n }", "public function playersThatArePlayingLogins() {\n\t\t$spectators = $this->maniaControl->getPlayerManager()->getSpectators();\n\t\t$specLogins = array();\n\t\tforeach ($spectators as $spec) {\n\t\t\t$specLogins[] = trim($spec->login);\n\t\t}\n\n\t\t$allPlayers = $this->maniaControl->getPlayerManager()->getPlayers();\n\t\t$allPlayersLogins = array();\n\t\tforeach ($allPlayers as $pl) {\n\t\t\t$allPlayersLogins[] = trim($pl->login);\n\t\t}\n\n\t\treturn array_diff($allPlayersLogins, $specLogins);\n\t}", "public function test_connection() {\n\t\treturn is_array( $this->_get_lists() );\n\t}", "public function test_connection() {\n\t\t/**\n\t\t * just try getting a list as a connection test\n\t\t */\n\n\t\ttry {\n\t\t\t/** @var Thrive_Dash_Api_Mailchimp $mc */\n\t\t\t$mc = $this->get_api();\n\n\t\t\t$mc->request( 'lists' );\n\t\t} catch ( Thrive_Dash_Api_Mailchimp_Exception $e ) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\n\t\treturn true;\n\t}", "public function listDisconnectedPlayers() : string\n {\n return $this->sourceQuery->Rcon('AdminListDisconnectedPlayers');\n }", "function get_playlists_no_more_cb26()\r\n\t{\r\n\t\tglobal $db;\r\n\t\t$result = $db->select(tbl($this->playlist_tbl),\"*\",\" playlist_type='\".$this->type.\"' AND userid='\".userid().\"'\");\r\n\t\t\r\n\t\tif(count($result)>0)\r\n\t\t\treturn $result;\r\n\t\treturn false;\r\n\t}", "public function invalidPlayersProvider()\n {\n return [\n [[]], // no players\n [['Alice']], // too few players\n [['Alice', 'Bob', 'Carol', 'Eve', 'One too many']] // too many players\n ];\n }", "public function valid()\n {\n return isset($this->channels[$this->key()]);\n }", "public static function prune_playlists() { \n\n\t\t/* Just delete if no matching session row */\n\t\t$sql = \"DELETE FROM `tmp_playlist` USING `tmp_playlist` \" . \n\t\t\t\"LEFT JOIN session ON session.id=tmp_playlist.session \" . \n\t\t\t\"WHERE session.id IS NULL AND tmp_playlist.type != 'vote'\";\n\t\t$db_results = Dba::query($sql);\n\n\t\treturn true;\n\n\t}", "function ticketbud_server_connectivity_ok() {\n\t// skip the check on WPMU because the status page is hidden\n\tglobal $ticketbud_unused_api_key;\n\tif ( $ticketbud_unused_api_key )\n\t\treturn true;\n\t$servers = ticketbud_get_server_connectivity();\n\treturn !( empty($servers) || !count($servers) || count( array_filter($servers) ) < count($servers) );\n}", "public function checkOutsideConnection()\n {\n // Require only on this function to not overload memory with not needed classes\n require_once _PS_MODULE_DIR_ . 'doofinder/lib/EasyREST.php';\n $client = new EasyREST(true, 3);\n $result = $client->get(sprintf('%s/auth/login', self::DOOMANAGER_URL));\n\n return $result && $result->originalResponse && isset($result->headers['code'])\n && (strpos($result->originalResponse, 'HTTP/2 200') || $result->headers['code'] == 200);\n }", "public function checkIsModelListCorrupted()\n {\n try {\n $this->helperService->getAllModels();\n }\n catch(Exception $e) {\n return true;\n }\n return false;\n }", "public function checkConnection(){\r\n\t\treturn false;\r\n\t}", "public function test_showAddToWishList_AddToWishListIsNotAvailable_returnTrue()\r\n\t{\r\n\t\t$this->prepareisAddToWishListAvailable(false);\r\n\t\t$actual = $this->service->showAddToWishList();\r\n\t\t$this->assertFalse($actual);\r\n\t}", "public function testConnection() {\n\t\t/** @var Thrive_Dash_Api_WebinarJamStudio $api */\n\t\t$api = $this->getApi();\n\t\t/**\n\t\t * just try getting the list of the webinars as a connection test\n\t\t */\n\t\ttry {\n\t\t\t$api->getUpcomingWebinars(); // this will throw the exception if there is a connection problem\n\t\t} catch ( Thrive_Dash_Api_WebinarJamStudio_Exception $e ) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\n\t\treturn true;\n\t}", "private function _checkExist()\n {\n $ret = ['valid' => true, 'message' => []];\n\n if (!($validation = IO::required($this->data, ['videoLink']))['valid']) {\n throw new InvalidParameterException($validation['message']);\n }\n\n $eitherOptions = ['username', 'email'];\n\n $choseOptions = array_intersect($eitherOptions, array_keys($this->data));\n\n foreach ($choseOptions as $option) {\n if ($option == 'username') {\n $sql = \"SELECT COUNT(*) FROM `user` WHERE `username` = :username\";\n } elseif ($option == 'email') {\n $sql = \"SELECT COUNT(*) FROM `user` WHERE `email` = :email\";\n }\n\n $stmt = $this->pdo->prepare($sql);\n\n $stmt->execute([$option => $this->data[$option]]);\n\n if ($stmt->fetchColumn() != 0) {\n $ret['valid'] = false;\n $ret['message'][] = $option . '{' . $this->data[$option] . '} has been occupied, please try again.';\n }\n }\n\n\n return $ret;\n }", "protected function disconnectIfConnected() {}", "public function checkChanges()\n {\n //loop through all connected sockets\n foreach ($this->changed as $changed_socket) {\n //check for any incomming data\n while (socket_recv($changed_socket, $buf, 1024, 0) >= 1) {\n $received_text = $this->unmask($buf); //unmask data\n $this->processCommunication($changed_socket, $received_text);\n break 2; //exits this loop\n }\n\n $buf = @socket_read($changed_socket, 1024, PHP_NORMAL_READ);\n if ($buf === false) { // check disconnected client\n foreach ($this->clients as $clientId => $sockets) {\n if (!in_array($changed_socket, $sockets)) {\n continue;\n }\n\n foreach ($sockets as $key => $socket) {\n if ($socket == $changed_socket) {\n // remove client for $clients array\n socket_getpeername($changed_socket, $ip);\n unset($this->clients[$clientId][$key]);\n break 2;\n }\n }\n }\n }\n }\n }", "public function inListForItemNotContainedReturnsFalseDataProvider() {}", "public function hasDlcsList()\n {\n return $this->dlcs !== null;\n }", "public function removeSpectatorsAndNotConnectedPlayers() {\n\t\t$spectators = $this->maniaControl->getPlayerManager()->getSpectators();\n\t\t$playersThatArePlaying = $this->playersThatArePlayingLogins();\n\n\t\t/*\n\t\t * Setting every player to spectator and then just iterating over\n\t\t * players that are currently playing and setting correct flag!\n\t\t * */\n\t\tforeach ($this->matchScore->blueTeamPlayers as $player) {\n\t\t\t$player->isSpectator = true;\n\t\t}\n\t\tforeach ($this->matchScore->redTeamPlayers as $player) {\n\t\t\t$player->isSpectator = true;\n\t\t}\n\n\t\tforeach ($playersThatArePlaying as $player) {\n\t\t\tif (array_key_exists($player, $this->matchScore->blueTeamPlayers)) {\n\t\t\t\t$this->matchScore->blueTeamPlayers[$player]->isSpectator = false;\n\t\t\t}\n\t\t\tif (array_key_exists($player, $this->matchScore->redTeamPlayers)) {\n\t\t\t\t$this->matchScore->redTeamPlayers[$player]->isSpectator = false;\n\t\t\t}\n\t\t}\n\n\t\tforeach ($spectators as $spectator) {\n\t\t\t$login = trim($spectator->login);\n\n\t\t\tif (array_key_exists($login, $this->matchScore->blueTeamPlayers)) {\n\t\t\t\t$this->matchScore->blueTeamPlayers[$login]->isSpectator = true;\n\t\t\t}\n\t\t\tif (array_key_exists($login, $this->matchScore->redTeamPlayers)) {\n\t\t\t\t$this->matchScore->redTeamPlayers[$login]->isSpectator = true;\n\t\t\t}\n\t\t}\n\t}", "public function disconnect() : bool\n {\n return false;\n }" ]
[ "0.77570873", "0.76441556", "0.61054873", "0.6088999", "0.60659385", "0.60154957", "0.601074", "0.58628076", "0.58405006", "0.57007873", "0.5678933", "0.56211114", "0.54537207", "0.52979136", "0.52176505", "0.5153377", "0.5098705", "0.50837123", "0.5053778", "0.49932352", "0.49922234", "0.49891528", "0.49830925", "0.4975611", "0.49646503", "0.4963765", "0.49479437", "0.4933382", "0.49278748", "0.48859105" ]
0.7647972
1
Verifies the broadcast command does work properly
public function test_admin_Broadcast() { $this->assertTrue($this->postScriptumServer->adminBroadcast('Hello World!')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isBroadcasted();", "public function test_admin_Broadcast()\n {\n $this->assertTrue($this->btwServer->adminBroadcast('Hello World!'));\n }", "public function test_admin_Broadcast()\n {\n $this->assertTrue($this->btwServer->adminBroadcast('Hello World!'));\n }", "public function broadcastOn();", "public function broadcastOn();", "public function testPendingValidationNoMapping()\n {\n $this->executeCommand();\n $this->assertCount(0, $this->validateReceiver->getSent());\n $this->assertCount(0, $this->captureReceiver->getSent());\n $this->assertCount(0, $this->cancelReceiver->getSent());\n }", "public static function shouldReceive()\n {\n }", "public static function shouldReceive()\n {\n }", "public static function shouldReceive()\n {\n }", "public static function shouldReceive()\n {\n }", "public function testIsValid()\n {\n $running = new RunningBroadcast(null, null, null);\n self::assertEquals($running->isValid(), false);\n\n $running = new RunningBroadcast(1, null, null);\n self::assertEquals($running->isValid(), false);\n\n $running = new RunningBroadcast(null, 2, null);\n self::assertEquals($running->isValid(), false);\n\n $running = new RunningBroadcast(null, 2, 3);\n self::assertEquals($running->isValid(), false);\n\n $running = new RunningBroadcast(1, 2, null);\n self::assertEquals($running->isValid(), false);\n\n $running = new RunningBroadcast(1, 2, 3);\n self::assertEquals($running->isValid(), true);\n }", "function broadcast(){\n return (long2ip(ip2long($this->network())\n | (~(ip2long($this->netmask())))));\n }", "public function broadcastWhen() {\n $return = false;\n $ids_to_broadcast = [$this->message->userId, $this->message->receiverUserId];\n if (in_array($this->message->userId, $ids_to_broadcast) || in_array($this->message->receiverUserId, $ids_to_broadcast)) $return = true;\n return $return;\n }", "public function hasServerTvBroadcastTime()\n {\n return $this->server_tv_broadcast_time !== null;\n }", "public function adminBroadcast(string $msg) : bool\n {\n return $this->_consoleCommand('AdminBroadcast', $msg, 'Message broadcasted');\n }", "function works() {\n\t$data = createMessagePayload('Flarum is able to contact this Telegram room. Great!');\n\n\ttry {\n\t\t$result = Request::sendMessage($data);\n\n\t\treturn $result->isOk();\n\t} catch (TelegramException $e) {\n\t\treturn false;\n\t}\n}", "public function broadcastOn()\n {\n return ['scammer'];\n }", "public function testRunsOk()\n {\n $application = new Application();\n $application->add($this->command);\n\n $command = $application->find('dequeue');\n $command_tester = new CommandTester($command);\n\n $this->assertEquals(0, $this->dispatcher->getQueue()->count());\n $this->dispatcher->dispatch(\n new Inc(['number' => 12,\n ]));\n $this->assertEquals(1, $this->dispatcher->getQueue()->count());\n\n $command_tester->execute([\n 'command' => $command->getName(),\n 'type' => Inc::class,\n ]);\n $this->assertEquals(0, $command_tester->getStatusCode());\n $this->assertEquals(0, $this->dispatcher->getQueue()->count());\n }", "public function broadcastMessage($message)\n {\n $response = $this->sendCommand(static::RCMD_BROADCAST_MSG, $message);\n return $response->getData() === 'Broadcast Sent!';\n }", "public function testShouldAllowToSendSms()\n\t {\n\t\tdefine(\"GNOKII_COMMAND\", \"sh \" . __DIR__ . \"/mock/mock.sh\");\n\t\tdefine(\"SMSC_NUMBER\", \"+79043490000\");\n\n\t\t$sender = new PhpGnokii();\n\t\t$this->assertTrue($sender->send(\"+79526191914\", \"test\"));\n\t }", "public function can_perform_loopback()\n {\n }", "protected function onReceive(string $payload) {\n\n\t\t\t$sp = explode(':', $payload, 3);\n\n\t\t\t// extract handler\n\t\t\t$message = $sp[0];\n\t\t\t$handler = $this->handlers[$message] ?? null;\n\t\t\tif (!$handler)\n\t\t\t\tthrow new SystemBroadcastUnhandledException(\"No handler for system broadcast message \\\"$message\\\" registered\");\n\n\t\t\t// extract data\n\t\t\t$dataEncoded = $sp[2] ?? '';\n\t\t\t$data = null;\n\t\t\tif ($dataEncoded != '') {\n\t\t\t\t$data = @json_decode($dataEncoded, true);\n\t\t\t\tif (json_last_error())\n\t\t\t\t\tthrow new RuntimeException('JSON decode failed: ' . json_last_error_msg());\n\t\t\t}\n\n\t\t\t// check signature\n\t\t\t$signatureData = $sp[1] ?? null;\n\t\t\tif ($signatureData) {\n\t\t\t\t$spSig = explode('|', $signatureData, 4);\n\n\t\t\t\t// check algorithm\n\t\t\t\t$algorithm = $spSig[0] ?? null;\n\t\t\t\tif (!in_array($algorithm, $this->verificationAlgorithms()))\n\t\t\t\t\tthrow new SystemBroadcastUnhandledException(\"Refused handling system broadcast message \\\"$message\\\" with invalid signature algorithm \\\"$algorithm\\\"\");\n\n\t\t\t\t// get secret\n\t\t\t\t$keyName = $spSig[1] ?? null;\n\t\t\t\tif (!in_array($algorithm, $this->verificationAlgorithms()))\n\t\t\t\t\tthrow new SystemBroadcastUnhandledException(\"Refused handling system broadcast message \\\"$message\\\" without signature key name\");\n\t\t\t\t$secret = $this->verificationKeys()[$keyName] ?? null;\n\t\t\t\tif (!$secret)\n\t\t\t\t\tthrow new SystemBroadcastUnhandledException(\"Refused handling system broadcast message \\\"$message\\\" with unknown signature key \\\"$keyName\\\"\");\n\n\t\t\t\t// get timestamp\n\t\t\t\t$timestamp = $spSig[2] ?? 0;\n\t\t\t\tif (!$timestamp || !is_numeric($timestamp))\n\t\t\t\t\tthrow new SystemBroadcastUnhandledException(\"Refused handling system broadcast message \\\"$message\\\" with invalid timestamp \\\"$timestamp\\\"\");\n\t\t\t\t$now = time();\n\t\t\t\t$timeDiff = abs($now - $timestamp);\n\t\t\t\tif ($timeDiff > $this->timeTolerance)\n\t\t\t\t\tthrow new SystemBroadcastUnhandledException(\"Refused handling system broadcast message \\\"$message\\\" with timestamp \\\"$timestamp\\\" exceeding the maximum tolerance of \\\"{$this->timeTolerance}\\\". Current system time is $now.\");\n\n\n\t\t\t\t// verify signature\n\t\t\t\t$signature = $spSig[3];\n\t\t\t\tif (!$signature)\n\t\t\t\t\tthrow new SystemBroadcastUnhandledException(\"Refused handling system broadcast message \\\"$message\\\" with missing signature\");\n\t\t\t\t$expectedSign = hash_hmac($algorithm, $this->stringToSign($message, $dataEncoded, $timestamp), $secret);\n\t\t\t\tif (!hash_equals($expectedSign, $signature))\n\t\t\t\t\tthrow new SystemBroadcastUnhandledException(\"Refused handling system broadcast message \\\"$message\\\" with invalid signature \\\"$signature\\\". Valid signature would be \\\"$expectedSign\\\"\");\n\n\t\t\t}\n\t\t\telse if ($this->usesSignatures()) {\n\t\t\t\tthrow new SystemBroadcastUnhandledException(\"Refused handling unauthenticated system broadcast message \\\"$message\\\"\");\n\t\t\t}\n\n\n\t\t\tcall_user_func($handler, $data, $this, $message);\n\t\t}", "public function test_dotorg_communication()\n {\n }", "public function notify() : bool{}", "public function isSent() {}", "public function deviceConditionDoesNotMatchRobot() {}", "public function deviceConditionDoesNotMatchRobot() {}", "public function broadcastEvent(\\Montage\\Event\\Event $event);", "private function test_availability() {\r\n\r\n $this->add_log('test_availability: Testing ws availability...', 'DEBUG');\r\n\r\n $params = new stdClass();\r\n $params->from = @new SoapVar($this->sender, XSD_STRING, \"string\", \"http://www.w3.org/2001/XMLSchema\");\r\n $this->call_function('disponibilitat', $params);\r\n $this->add_log('test_availability: Server avalaible', 'DEBUG');\r\n }", "public function broadcastAs()\n {\n return 'game.won_by_robot';\n }" ]
[ "0.69082236", "0.66991156", "0.66991156", "0.6169791", "0.6169791", "0.57542425", "0.5725016", "0.5725016", "0.5725016", "0.5725016", "0.5693092", "0.56548315", "0.5500017", "0.5326541", "0.53026444", "0.5294171", "0.5219728", "0.51821285", "0.51215005", "0.5089883", "0.5080837", "0.50801367", "0.5064733", "0.5039059", "0.50306994", "0.50211996", "0.5019893", "0.49898195", "0.4989729", "0.4988971" ]
0.67587143
1
Verifies the set next map command does work properly
public function test_admin_set_next_map() { $this->assertTrue($this->postScriptumServer->adminSetNextMap('Heelsum Single 01')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_next_map()\n {\n $this->assertSame('Driel Single 01', $this->postScriptumServer->nextMap());\n }", "public function test_admin_set_next_map()\n {\n $this->assertTrue($this->btwServer->adminSetNextMap('Al Basrah AAS v1'));\n }", "public function test_admin_set_next_map()\n {\n $this->assertTrue($this->btwServer->adminSetNextMap('Al Basrah Insurgency v1'));\n }", "public function test_next_map()\n {\n $this->assertSame('Belaya AAS v1', $this->btwServer->nextMap());\n }", "public function test_next_map()\n {\n $this->assertSame('Al Basrah Insurgency v1', $this->btwServer->nextMap());\n }", "public function adminSetNextMap(string $map) : bool\n {\n return $this->_consoleCommand('AdminSetNextMap', $map, 'Set next map to');\n }", "public function test_current_map()\n {\n $this->assertSame('Heelsum Single 01', $this->postScriptumServer->currentMap());\n }", "protected function hasMappingErrorOccurred() {}", "public function hasLastrealmapid(){\n return $this->_has(33);\n }", "public function hasLastmapid(){\n return $this->_has(28);\n }", "public function test_current_map()\n {\n $this->assertSame('Al Basrah AAS v1', $this->btwServer->currentMap());\n }", "public function test_current_map()\n {\n $this->assertSame('Al Basrah AAS v1', $this->btwServer->currentMap());\n }", "public function test_admin_change_map()\n {\n $this->assertTrue($this->postScriptumServer->adminChangeMap('Heelsum Single 01'));\n }", "public function valid()\n {\n if ($this->key() < count($this->map)) {\n return true;\n }\n return false;\n }", "private function check_jumps()\n {\n static $seen_loop_info = false;\n \n assert(is_array($this->gotos));\n \n foreach ($this->gotos as $lid => $gotos) { \n foreach ($gotos as $goto) {\n if ($goto->resolved === true)\n continue;\n \n if (!isset ($this->labels[$lid]))\n Logger::error_at($goto->loc, 'goto to undefined label `%s`', $goto->id);\n else {\n Logger::error_at($goto->loc, 'goto to unreachable label `%s`', $goto->id);\n Logger::info_at($this->labels[$lid]->loc, 'label was defined here');\n \n if (!$seen_loop_info) {\n $seen_loop_info = true;\n Logger::info_at($goto->loc, 'it is not possible to jump into a loop or switch statement');\n }\n }\n }\n }\n }", "public function test_admin_change_map()\n {\n $this->assertTrue($this->btwServer->adminChangeMap('Al Basrah AAS v1'));\n }", "public function test_admin_change_map()\n {\n $this->assertTrue($this->btwServer->adminChangeMap('Al Basrah AAS v1'));\n }", "public function process_cmdmap() {}", "public function testIfMapsContainProperData()\n {\n $factory = new FileSystemMapFactory();\n $maps = $factory->create($this->data);\n $count = 0;\n\n foreach ($this->data as $name => $mapData) {\n /** @var FileSystemMap $map */\n $map = $maps[$count];\n\n $this->assertEquals($this->data[$name]['src'], $map->getSource());\n $this->assertEquals($this->data[$name]['dst'], $map->getDestination());\n\n if (isset($this->data['client'])) {\n $this->assertEquals($this->data['client'], $map->getClient());\n }\n\n $this->assertEquals($name, $map->getName());\n\n $count++;\n }\n }", "public function next()\n {\n $this->valid = (next($this->keys) !== false);\n }", "public function testGetOffset(): void\n {\n $model = ProcessMemoryMap::load([\n \"offset\" => 46290,\n ], $this->container);\n\n $this->assertSame(46290, $model->getOffset());\n }", "function next(){ \r\n\t $this->valid = (FALSE !== next($this->array)); \r\n\t }", "public function needsIncrementOffset();", "function geoCodeXSet($modmap){\n // Cas ou l'on passe directement un oid\n if(!is_array($modmap)) $modmap=$this->xset->rdisplay($modmap);\n $nq = 0; $nqn = 0;\n $fname = $modmap['ofname']->raw;\n $ftable = $modmap['oftable']->raw;\n XLogs::notice(get_class($this),get_class($this).\"::geoCodeAutoXSet start\");\n $xset = XDataSource::objectFactoryHelper8('BCLASS=XDSTable&SPECS='.$ftable);\n $rs = selectQuery($xset->select_query(array()));\n $tests = 0;\n $delay = 0;\n while($rs && ($ors = $rs->fetch())){\n \n $pending = true;\n \n while($pending){\n\t$foo = array();\n\t$ofc = $xset->getField($fname);\n\t$fv = $ofc->edit($ors[$fname], $foo);\n\tif($fv->type == 'A' && ($fv->accuracy == '' || $fv->accuracy == 'N/A' || empty($fv->upd) || $ors['UPD'] > $fv->upd || \n\t\t\t\t$modmap['oUPD']->raw > $fv->upd)){\n\t $gar = array();\n\t $addressfields = explode(' ', $modmap['ofgcaddr']->raw);\n\t foreach($addressfields as $foo=>$afn){\n\t $afv = trim($ors[$afn]);\n\t if (!empty($afv))\n\t $gar['address'][] = array('value'=>$afv, 'retry'=>true, 'default'=>NULL);\n\t }\n\t $gar['city'] = array('value'=>$ors[$modmap['ofgctown']->raw], 'retry'=>true, 'default'=>NULL);\n\t $gar['zipcode'] = array('value'=>$ors[$modmap['ofgczipc']->raw], 'retry'=>false, 'default'=>NULL);\n\t $gar['country'] = array('value'=>$ors[$modmap['ofgccntr']->raw], 'retry'=>false, 'default'=>NULL);\n\t $nq += 1;\n\t $rg = $this->googleGeoCode($gar, 0, $ors['KOID']);\n\t list ($ok, $mess, $accuracy, $coords, $maddress, $retry, $query) = $rg;\n\t XLogs::notice(get_class($this).get_class($this).\"::googleGeoCode $ok $mess $retry $query\");\n\t $tests += 1;\n\t if ($ok){\n\t $pending = false;\n\t $fres = array('latlng'=>$coords[1].';'.$coords[0],\n\t\t\t 'autogc'=>1,\n\t\t\t 'accuracy'=>$accuracy);\n\t $xset->procEdit(array('_options'=>array('local'=>true),\n\t\t\t\t 'tplentry'=>TZR_RETURN_DATA,\n\t\t\t\t $fname=>$fres,\n\t\t\t\t 'oid'=>$ors['KOID']));\n\t } else if ($mess == 'too many query'){\n\t $delay += 100000; // pending reste a true\n\t XLogs::notice(get_class($this),get_class($this).\"::geoCodeAutoXSet delaying $delay $nq\");\n\t XLogs::update('geocoding', NULL, \"incr delaying $delay $nq\");\n\t }else{\n\t $pending =false;\n\t $fres = array('latlng'=>'',\n\t\t\t 'autogc'=>1,\n\t\t\t 'accuracy'=>0);\n\t $xset->procEdit(array('_options'=>array('local'=>true),\n\t\t\t\t 'tplentry'=>TZR_RETURN_DATA,\n\t\t\t\t $fname=>$fres,\n\t\t\t\t 'oid'=>$ors['KOID']));\n\t \n\t }\n\t} else { \n\t XLogs::notice(get_class($this),get_class($this).\"::geCodeXSet up to date \".$ors['KOID']);\n\t $nqn += 1;\n\t $pending = false;\n\t $delay = 0;\n\t}\n\tusleep($delay);\n\tXLogs::notice('XModMap', \"geoCodeXSet query $nq ommitted $nqn of {$rs->rowCount()}\");\n }\n }\n XLogs::notice(get_class($this),get_class($this).\"::geoCodeAutoXSet end\");\n return array('nq'=>$nq, 'nqn'=>$nqn, 'nt'=>$rs->rowCount());\n }", "function runningPlay() {\n\t\t// request information about the new map\n\t\t// ... and callback to function newMap()\n\t}", "public function hasMaps(){\n return $this->_has(15);\n }", "public function valid() { return isset($this->keys[$this->pos]);\n }", "public function tellInvalidPin()\n {\n }", "private function setUserMapPlace() {\n\t\t$this->mapPlaceManager->unsetMapPlace($this->user->id);\n\n\t\t$count = $this->mapPlaceManager->getFreeMapPlaceCount();\n\t\tif($count < 10 || GlobalConfig::ALWAYS_EXTEND_MAP ) {\n\t\t\t$mapManager = new MapManager($this->db);\n\t\t\t$mapManager->extendMap();\n\t\t}\n\t\t\t\n\t\t$mapPlace = $this->mapPlaceManager->getRandomFreeMapPlace();\n\t\t$mapPlace->userid = $this->user->id;\n\t\tif(!$mapPlace) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\t$this->mapPlaceManager->updateMapPlace($mapPlace);\n\t\t\treturn true;\n\t\t}\n\t}", "#[\\ReturnTypeWillChange]\n public function next()\n {\n $this->valid = (next($this->keys) !== false);\n }" ]
[ "0.7176545", "0.70906556", "0.7056645", "0.6848051", "0.6822363", "0.66957504", "0.6047744", "0.59268945", "0.58230567", "0.5736064", "0.5708287", "0.5708287", "0.56693184", "0.55760986", "0.55047345", "0.5459054", "0.5459054", "0.54217076", "0.53869563", "0.5307856", "0.52699584", "0.5197039", "0.5160301", "0.50935733", "0.5080907", "0.50629574", "0.50462955", "0.5032553", "0.5014325", "0.500521" ]
0.72295284
0
Verifies the restart match command does work properly
public function test_admin_restart_match() { $this->assertTrue($this->postScriptumServer->adminRestartMatch()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_admin_restart_match()\n {\n $this->assertTrue($this->btwServer->adminRestartMatch());\n }", "public function adminRestartMatch() : bool\n {\n return $this->_consoleCommand('AdminRestartMatch', '', 'Game restarted');\n }", "public function test_admin_restart_match()\n {\n $this->assertTrue($this->btwServer->adminRestartMatch());\n\n sleep(30);\n }", "function restart()\n {\n $this->destroy();\n if( $this->_state !== 'destroyed' ) {\n // @TODO :: generated error here\n return false;\n }\n\n $this->_state = 'restart';\n\t\t$this->_start();\n\t\t$this->_state\t=\t'active';\n\n\t\t$this->_setCounter();\n\n return true;\n }", "abstract protected function _restart();", "public static function isRestart () {\n\t\tif (self::$restart == true) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function restart() {\n $cmd = sprintf(\"./control.sh restart %s -game %s -ip %s -port %d -maxplayers %d -map %s -rcon %s\", $this->sid, $this->gameId, $this->ip, $this->port, $this->maxplayers, $this->map, $this->rcon);\n ssh($cmd, $this->host);\n log_action('RESTART');\n }", "protected function restart(): void\n {\n // TODO\n }", "public function restart() {\n\t\t$this->invoke(\"restart\");\n\t}", "public function adminEndMatch() : bool\n {\n return $this->_consoleCommand('AdminEndMatch', '', 'Match ended');\n }", "public function check()\n {\n if ($this->needsRestart()) {\n $this->prepareRestart($command) && $this->restart($command);\n return;\n }\n\n $originalIniScanDir = getenv(self::ENV_INI_SCAN_DIR_OLD);\n\n if ($originalIniScanDir) {\n putenv(self::ENV_INI_SCAN_DIR_OLD);\n putenv(self::ENV_INI_SCAN_DIR . '=' . $originalIniScanDir);\n } else {\n putenv(self::ENV_INI_SCAN_DIR);\n }\n }", "public function runMatch()\n {\n }", "public function assertPsKillVersion($match)\n {\n $this->assertNotEmpty($match);\n }", "public function simulateEnabledMatchSpecificConditionsSucceeds() {}", "public function simulateEnabledMatchSpecificConditionsSucceeds() {}", "public function match() {\r\n\t\treturn false;\r\n\t}", "public function test_admin_end_match()\n {\n $this->assertTrue($this->btwServer->adminEndMatch());\n\n sleep(30);\n }", "public function testMatch()\n {\n $password = 'pass';\n $matches = LeetMatch::match($password);\n $this->assertEmpty($matches);\n\n $password = 'p4ss';\n $matches = LeetMatch::match($password);\n $this->assertCount(5, $matches);\n\n $password = 'p4ssw0rd';\n $matches = LeetMatch::match($password);\n $this->assertCount(11, $matches);\n\n // Test translated characters that are not a dictionary word.\n $password = '76+(';\n $matches = LeetMatch::match($password);\n $this->assertEmpty($matches);\n }", "private function prepareRestart(&$command)\n {\n $iniFiles = array();\n if ($loadedIni = php_ini_loaded_file()) {\n $iniFiles[] = $loadedIni;\n }\n\n $additional = $this->getAdditionalInis($iniFiles, $replace);\n if ($this->writeTmpIni($iniFiles, $replace)) {\n $command = $this->getCommand($additional);\n }\n\n return !empty($command) && putenv(self::ENV_ALLOW.'=1');\n }", "public function testVerifyToNotWin()\n {\n\n $match = $this->createMatch();\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n $winner = new Winner();\n $winner->verify($match, 0, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(0, $matchFound->winner);\n\n }", "public function tryresetAction() {\n return true;\n }", "private function needsRestart()\n {\n if (PHP_SAPI !== 'cli' || !defined('PHP_BINARY')) {\n return false;\n }\n\n return !getenv(self::ENV_ALLOW) && $this->loaded;\n }", "protected function isMatch()\n {\n if($this->scope!=''){\n if($this->argv[1] != $this->scope){\n return false;\n }\n }\n\n if($this->argv[2] == $this->trigger || ($this->scope=='' && $this->argv[1] == $this->trigger)) {\n $this->match = true;\n }\n\n }", "public function restart() {\n\t\t$this->resetTriggerTime();\n\t\t$this->timer->restartEvent( $this );\n\t}", "public function test_admin_end_match()\n {\n $this->assertTrue($this->btwServer->adminEndMatch());\n }", "public function prepareForRestart() {\n\t\tparent::prepareForRestart();\n\t}", "function testIfmatchWithModifiers(){\n\t\t#mdx:ifmatch2\n\t\tParam::get('phone')\n\t\t\t->filters()\n\t\t\t->ifmatch('/[a-z]/i', 'Phone cannot contain letters');\n\n\t\t$error = Param::get('phone')->process(['phone'=>'9829574K'])->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Phone cannot contain letters\", $error);\n\n\t}", "public function reInit(): bool {}", "protected function restart()\n {\n $this->stop();\n $this->start();\n }", "public function restartWith(Command $command);" ]
[ "0.73609245", "0.7221903", "0.7208859", "0.6367601", "0.6331943", "0.6096358", "0.5967439", "0.5864611", "0.5577808", "0.55695707", "0.5523084", "0.5491819", "0.54550093", "0.5379564", "0.53795165", "0.5377231", "0.53632176", "0.53461796", "0.52655584", "0.5247932", "0.52356416", "0.52259165", "0.5214308", "0.5205883", "0.5202957", "0.5194102", "0.5178206", "0.51615804", "0.51572865", "0.5142869" ]
0.7437495
0
Verifies the end match command does work properly
public function test_admin_end_match() { $this->assertTrue($this->postScriptumServer->adminEndMatch()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function adminEndMatch() : bool\n {\n return $this->_consoleCommand('AdminEndMatch', '', 'Match ended');\n }", "public function test_admin_end_match()\n {\n $this->assertTrue($this->btwServer->adminEndMatch());\n }", "public function test_admin_end_match()\n {\n $this->assertTrue($this->btwServer->adminEndMatch());\n\n sleep(30);\n }", "public function match() {\r\n\t\treturn false;\r\n\t}", "protected function ends()\n {\n static $re_all = '/^[\\h\\v]*$/';\n static $re_nnl = '/^[\\h]*$/';\n \n if ($this->data === null)\n return true;\n \n // if $tnl (track new lines) is true: use \\h, else: use \\h\\v\n return preg_match($this->tnl ? $re_nnl : $re_all, $this->data);\n }", "public function endsWithReturnsTrueForMatchingLastPartDataProvider() {}", "public function endsWithReturnsFalseForNotMatchingLastPartDataProvider() {}", "public final function __end() : bool {\n\t\t\treturn false;\n\t\t}", "public function testExactMatchWithExpectationAfterOutput() {\n\t\techo 'foobar';\n\t\t$this->expectOutputContains( 'foobar' );\n\t}", "abstract protected function isEndToken(string $token) : bool;", "protected function _detectCompletionAndEnd()\n {\n// detect if the output has completed, and if it does\n// delete the output file and stop the loop.\n if($this->_detectCompletionBoundaryInOutput() === true)\n {\n $this->deleteOutputFile();\n $this->stop();\n }\n else if($this->_detectFailureBoundaryInOutput() === true)\n {\n $this->_error_code = $this->_getErrorCodeInOutput();\n }\n }", "public function runMatch()\n {\n }", "abstract protected function doEnd();", "public function testSendingOutputWithMismatchedLineEndingAmount() {\n\t\t$test = new IncorrectOutputMismatchedLineEndingAmountTestCase( 'test' );\n\t\t$result = $test->run();\n\n\t\t$this->assertSame( 1, $result->failureCount() );\n\t\t$this->assertSame( 1, \\count( $result ) );\n\n\t\t$failures = $result->failures();\n\t\t$this->assertMatchesRegularExpression(\n\t\t\t\"`^Failed asserting that '[^']+' matches PCRE pattern \\\"#`\",\n\t\t\t$failures[0]->exceptionMessage()\n\t\t);\n\t}", "public function hasEnd(){\n return $this->_has(3);\n }", "public function hasEnd(){\n return $this->_has(3);\n }", "public function testSendingOutputWithMismatchedLineEndings() {\n\t\t$test = new IncorrectOutputMismatchedLineEndingsTestCase( 'test' );\n\t\t$result = $test->run();\n\n\t\t$this->assertSame( 1, $result->failureCount() );\n\t\t$this->assertSame( 1, \\count( $result ) );\n\n\t\t$failures = $result->failures();\n\t\t$this->assertMatchesRegularExpression(\n\t\t\t\"`^Failed asserting that '[^']+' matches PCRE pattern \\\"#`\",\n\t\t\t$failures[0]->exceptionMessage()\n\t\t);\n\t}", "public function ends()\n {\n return $this->endRepeat !== \"never\";\n }", "protected function eof() { \n\t\treturn !isset($this->lines[$this->cursor]); \n\t}", "protected function isMatch()\n {\n if($this->scope!=''){\n if($this->argv[1] != $this->scope){\n return false;\n }\n }\n\n if($this->argv[2] == $this->trigger || ($this->scope=='' && $this->argv[1] == $this->trigger)) {\n $this->match = true;\n }\n\n }", "private function searchMustEnd(): bool\n {\n return in_array($this->search->fresh()->status, [\n Search::STATUS_FINISHED,\n Search::STATUS_FAILED,\n Search::STATUS_PAUSED\n ]);\n }", "function endCase() {\n\t}", "public function end() {}", "public function end() {}", "public function end() {}", "public function test_validation_missingClosingCommand() : void\n {\n $subject = <<<'EOT'\n{code: \"ApacheVelocity\"}\nSome content here.\n{end}\nEOT;\n\n $parser = $this->preParseString($subject);\n\n $this->assertFalse($parser->isValid());\n $this->assertCollectionHasErrorCode(\n Mailcode_Commands_CommonConstants::VALIDATION_MISSING_CONTENT_CLOSING_TAG,\n $parser->getCollection()\n );\n }", "public function message()\n {\n return 'This match has ended.';\n }", "public function end($end);", "public function end();", "public function end();" ]
[ "0.74820113", "0.6888107", "0.63732845", "0.6371162", "0.62928724", "0.61902434", "0.60692745", "0.59760344", "0.5940732", "0.5898977", "0.58609116", "0.5847114", "0.58043635", "0.5791831", "0.57390827", "0.57390827", "0.57345915", "0.5734372", "0.5659402", "0.5623187", "0.56207675", "0.56113243", "0.5605275", "0.5605275", "0.5605275", "0.55550283", "0.54876643", "0.54857874", "0.5485079", "0.5485079" ]
0.69672436
1
Verifies the admin set max num players command does work properly
public function test_admin_set_max_num_players() { $this->assertTrue($this->postScriptumServer->adminSetMaxNumPlayers(78)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_admin_set_max_num_players()\n {\n $this->assertTrue($this->btwServer->adminSetMaxNumPlayers(78));\n }", "public function test_admin_set_max_num_players()\n {\n $this->assertTrue($this->btwServer->adminSetMaxNumPlayers(78));\n }", "public function adminSetMaxNumPlayers(int $slots) : bool\n {\n return $this->_consoleCommand('AdminSetMaxNumPlayers', $slots, 'Set MaxNumPlayers to ' . $slots);\n }", "public function getMaxPlayers(): int;", "function check_max_number_of_members($value)\n{\n\t$max_member_no_limit = $value['max_member_no_limit'];\n\tif ($max_member_no_limit == MEMBER_PER_GROUP_NO_LIMIT)\n\t{\n\t\treturn true;\n\t}\n\t$max_member = $value['max_member'];\n\treturn is_numeric($max_member);\n}", "public function getMaxPlayers() : int {\r\n\r\n return (int) $this->getMain()->getDatabase()->get(\"max_players\", [\"table\" => \"Games\", \"name\" => $this->getName()])->fetchArray()[0];\r\n\r\n }", "private function setNumOfPlayers(int $num) : int\n {\n\t\t$minUserNum = 2;\n\t\t$maxUserNum = count($this->availablePlayerNames);\n\n if ($num <= $minUserNum) {\n $num = $minUserNum;\n\t\t}\n\n\t\tif ($num > $maxUserNum) {\n\t\t\t$num = $maxUserNum;\n\t\t}\n\n\t\t$this->numOfPlayers = $num;\n\t\t\n\t\treturn $this->numOfPlayers;\n }", "public function setMaxPlayers(int $int) {\r\n\r\n return $this->getMain()->getDatabase()->set(\"max_players\", $int, [\"table\" => \"Games\", \"name\" => $this->getName()]);\r\n\r\n }", "function zg_ai_have_num_players($num_players) {\n\n // Goal: $num players across the game.\n $sql = 'select count(id) as count from users\n where meta like \"ai_%\";';\n $result = db_query($sql);\n $item = db_fetch_object($result);\n firep($item, 'ai item');\n $count = (int) $item->count;\n\n zg_ai_out(\"want $num_players players, have $count\");\n\n if ($count >= $num_players) {\n // zg_ai_out('woohoo! we have enough players! returning TRUE');.\n return TRUE;\n }\n\n zg_ai_do('create new player');\n zg_ai_do('create new player');\n zg_ai_do('create new player');\n return FALSE;\n}", "function _checkMaxLimt()\r\n {\r\n if ($this->data[$this->name]['max_limit'] >= $this->data[$this->name]['min_limit']) {\r\n return true;\r\n }\r\n return false;\r\n }", "function _checkMaxQuantityLimt()\r\n {\r\n if ($this->data[$this->name]['buy_max_quantity_per_user'] >= $this->data[$this->name]['buy_min_quantity_per_user']) {\r\n return true;\r\n }\r\n return false;\r\n }", "public function hasMaxTeam(){\n return $this->_has(7);\n }", "public function test_list_players()\n {\n $players = $this->postScriptumServer->listPlayers();\n\n $this->assertCount(77, $players);\n }", "public function hasMaxTeams(){\n return $this->_has(11);\n }", "function validate_players ($gender)\n{\n // Build the indicies into the $_POST array appropriate for the specified\n // gender\n\n $min = 'MinPlayers' . $gender;\n $pref = 'PrefPlayers' . $gender;\n $max = 'MaxPlayers' . $gender;\n\n // Validate the individual numbers\n\n if (! (validate_int ($min, 0, 100, \"Min $gender Players\") &&\n\t validate_int ($max, 0, 100, \"Max $gender Players\") &&\n\t validate_int ($pref, 0, 100, \"Preferred $gender Players\")))\n return false;\n\n // If the user didn't fill in the preferred number, default it to the\n // maximum\n\n if (0 == $_POST[$pref])\n $_POST[$pref] = $_POST[$max];\n\n if ((int)$_POST[$min] > (int)$_POST[$pref])\n return display_error (\"Min $gender Players must be less than or equal to Preferred $gender Players\");\n\n if ((int)$_POST[$pref] > (int)$_POST[$max])\n return display_error (\"Preferred $gender Players must be less than or equal to Max $gender Players\");\n\n return true;\n}", "public function test_list_players()\n {\n $players = $this->btwServer->listPlayers();\n\n $this->assertCount(77, $players);\n }", "public function hasMaxMp(){\r\n return $this->_has(4);\r\n }", "public function hasMpMax(){\r\n return $this->_has(4);\r\n }", "public function setPasswordLenghtMax($num) {\n if((is_numeric($num)) && (($this->password_lenghtMin==null) || ($this->password_lenghtMin<$num))) {\n $this->password_lenghtMax = $num;\n return $this->password_lenghtMax;\n }\n return false;\n }", "public function update_variables(){\n\n // Calculate this battle's count variables\n $perside_max = 0;\n if (!empty($this->values['players'])){\n foreach ($this->values['players'] AS $id => $player){\n $max = $player['counters']['robots_total'];\n if ($max > $perside_max){ $perside_max = $max; }\n }\n }\n $this->counters['robots_perside_max'] = $perside_max;\n\n // Define whether we're allowed to use experience or not\n $this->flags['allow_experience_points'] = true;\n if (!empty($this->flags['player_battle'])\n || !empty($this->flags['challenge_battle'])){\n $this->flags['allow_experience_points'] = false;\n }\n\n // Return true on success\n return true;\n\n }", "public function maxTries();", "public function testHasLimit() {\n $this->assertEquals(1, $this->users->limit());\n }", "public function test_get_max_version()\n {\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n\n $this->clear_dummy_data();\n $this->assertEquals(null, $migrator_util->get_max_version());\n\n $this->insert_dummy_version_data(array(3));\n $this->assertEquals(\"3\", $migrator_util->get_max_version());\n $this->clear_dummy_data();\n }", "function testMaxval(){\n\t\t#mdx:maxval\n\t\tParam::get('age')->filters()->maxval(150, \"Age cannot be more than %d!\");\n\t\t$error = Param::get('age')->process(['age'=>200])->error;\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertContains(\"more than 150\", $error);\n\t}", "public function hasMaxVigor(){\r\n return $this->_has(25);\r\n }", "public function testUpdateInvalidMaxOptions(): void\n {\n $menu = factory(Menu::class)->create();\n\n $request = [\n 'name' => 'test',\n 'max_depth' => 'five',\n 'max_children' => [5]\n ];\n\n $response = $this->json('PUT', '/api/menus/' . $menu->id, $request);\n\n $response->assertStatus(400);\n }", "private function verifyAttempts(){\n //if($sql->rowCount > 5){\n //echo 'Limite de tentativas de login excedido!';\n //exit;\n }", "function testMaxlen(){\n\t\t#mdx:maxlen\t\t\n\t\tParam::get('description')->filters()->maxlen(30, \"Description must be less than %d characters long!\");\n\t\t$error = Param::get('description')\n\t\t\t->process(['description'=>str_repeat('lorem ipsum', 10)])\n\t\t\t->error;\n\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertContains(\"less than 30\", $error);\n\t}", "private static function VerifyWidthMinAndMax()\n {\n global $wgEmbedVideoMinWidth, $wgEmbedVideoMaxWidth;\n if (!is_numeric($wgEmbedVideoMinWidth) || $wgEmbedVideoMinWidth < 100)\n $wgEmbedVideoMinWidth = 100;\n if (!is_numeric($wgEmbedVideoMaxWidth) || $wgEmbedVideoMaxWidth > 1024)\n $wgEmbedVideoMaxWidth = 1024;\n }", "public function getMaxAttemptTimes(): int\n {\n return 3;\n }" ]
[ "0.8642783", "0.8642783", "0.70288604", "0.6582735", "0.6343313", "0.6321232", "0.62790173", "0.6207885", "0.6161848", "0.6079425", "0.5897885", "0.5821605", "0.5804494", "0.57887733", "0.5751407", "0.57191855", "0.5702126", "0.56975454", "0.5673302", "0.5585022", "0.5541913", "0.55350626", "0.55321085", "0.5515474", "0.5467339", "0.5467021", "0.54641145", "0.5462319", "0.5461365", "0.54451483" ]
0.8645664
0
Verifies the kick command does work properly
public function test_admin_kick() { $this->assertTrue($this->postScriptumServer->adminKick('Marcel', 'Test')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_admin_kick()\n {\n $this->assertTrue($this->btwServer->adminKick('Marcel', 'Test'));\n }", "public function test_admin_kick_by_id()\n {\n $this->assertTrue($this->postScriptumServer->adminKickById(1, 'Test'));\n }", "public function test_admin_kick_by_id()\n {\n $this->assertTrue($this->btwServer->adminKickById(1, 'Test'));\n }", "public function adminKickById(int $id, string $reason = '') : bool\n {\n return $this->_consoleCommand('AdminKickById', $id . ' ' . $reason, 'Kicked player ');\n }", "public function adminKick(string $nameOrSteamId, string $reason = '') : bool\n {\n return $this->_consoleCommand('AdminKick', $nameOrSteamId . ' ' . $reason, 'Kicked player ');\n }", "public function testChannelsKick()\n {\n }", "function ts3client_requestClientKickFromServer($serverConnectionHandlerID, $clientID, $kickReason) {}", "public function event_kick($who, $message, $victim)\r\n\t{\r\n\t\r\n\t}", "public function checkCLIuser() {}", "public function kick_user($params) {\n return array('status' => false, 'message' => 'KICK_USER_FAIL');\n }", "public function should_run()\n\t{\n\t\treturn $this->config['delete_pms_last_gc'] < time() - $this->config['delete_pms_gc'];\n\t}", "function ts3client_requestClientKickFromChannel($serverConnectionHandlerID, $clientID, $kickReason) {}", "public function kick_user($nick, $message)\r\n\t{\r\n\t\t$this->server->send_line(\"KICK {$this->channel} {$nick} :{$message}\");\r\n\t}", "public function event_kicked($who, $why)\r\n\t{\r\n\r\n\t}", "public function doKick($nick, $channel, $reason = null)\n {\n $args = array($nick, $channel);\n\n if (!empty($reason)) {\n $args[] = $reason;\n }\n\n $this->send('KICK', $args);\n }", "public static function guest ()\n {\n return !self::check();\n }", "function kickGuests($admin = false) {\n\tglobal $_user, $_vars;\n\t\n\tif ($admin && !$_vars['admin']) {\n\t\tredirectTo(\"/\");\n\t}\n\t\n\tif (!$_user->data['is_registered']) {\n\t\tredirectTo(\"/login\");\n\t}\n}", "private function _joke()\n {\n $question = str_replace(array(\"!joke \", \"!joke\"), \"\", $this->_data->message);\n $question = escapeshellcmd($question);\n \n if ($question == \"\") {\n $value = `ruby jokes.rb`;\n }\n else {\n $value = `ruby jokes.rb $question`; \n }\n \n if ($value) {\n $this->_message($this->_data->nick.': '. $value); \n }\n else {\n $this->_message($this->_data->nick.': No jokes about '. $question .'');\n \n }\n \n }", "public function test_admin_ban()\n {\n $this->assertTrue($this->btwServer->adminBan('Marcel', '1h', 'Test'));\n }", "public function test_admin_ban()\n {\n $this->assertTrue($this->postScriptumServer->adminBan('Marcel', '1h', 'Test'));\n }", "public function guest(): bool\n {\n return ! $this->check();\n }", "public function authenticateBack( $wantedNickName ){\n $MyNick = $this->waitForCommand('MyNick');\n if(!$MyNick){\n $this->lasterror = \"not awaited mynick\";\n return false;\n }\n if($MyNick->params[0] != $wantedNickName){\n $this->lasterror = $MyNick->params[0].\" instead of $wantedNickName\";\n return false;\n }\n\n if( !$this->sendCommand('MyNick '.$this->nickname) ) {\n $this->lasterror = \"not sended mynick\";\n return false;\n }\n\n if( !$this->sendCommand('Lock '.self::generateLock().\n ' Pk='.self::generatePk()) ) {\n $this->lasterror = \"not sended lock\";\n return false;\n }\n\n $Lock = $this->waitForCommand('Lock');\n if(!$Lock){\n $this->lasterror = \"not awaited lock\";\n return false;\n }\n if( !$this->sendCommand('Key '.self::lock2key($Lock->params[0])) ) {\n $this->lasterror = \"not sended key\";\n return false;\n }\n \n $Direction = $this->waitForCommand('Direction');\n if(!$Direction){\n $this->lasterror = \"not awaited direction\";\n return false;\n }\n\n $myrand = mt_rand(0, 0x7FFF);\n if( !$this->sendCommand(\"Direction Download $myrand\") ) {\n $this->lasterror = \"not sended direction\";\n return false;\n }\n\n $Key = $this->waitForCommand('Key');\n if(!$Key){\n $this->lasterror = \"not awaited key\";\n return false;\n }\n\n if($Direction->params[0]!='Upload' && $Direction->params[1] > $myrand){\n $this->needToSendFirst = true;\n }\n return true;\n }", "function Check() {\n\t\t// Check if the token has been sent.\n\t\tif(isset($_REQUEST['spack_token'])) {\n\t\t\t// Check if the token exists\n\t\t\tif(isset($_SESSION[\"spackt_\".$_REQUEST['spack_token']])) {\n\t\t\t\t// Check if the token isn't empty\n\t\t\t\tif(isset($_SESSION[\"spackt_\".$_REQUEST['spack_token']])) {\n\t\t\t\t\t$age = time()-$_SESSION[\"spackt_\".$_REQUEST['spack_token']];\n\t\t\t\t\t// Check if the token did not timeout\n\t\t\t\t\tif($age > $this->timeout*60) $this->error = 4;\n\t\t\t\t}\n\t\t\t\telse $this->error = 3;\n\t\t\t}\n\t\t\telse $this->error = 2;\n\t\t}\n\t\telse $this->error = 1;\n\t\t// Anyway, destroys the old token.\n\t\t$this->tokenDelAll();\n\t\tif($this->error==0) return true;\n\t\telse return false;\n\t}", "public function getKick()\n {\n return $this->get(self::_KICK);\n }", "public function readable_check_again() {\n\n\t\t/* Nonce check */\n\t\tcheck_ajax_referer( 'wpcd-admin', 'nonce' );\n\n\t\t/* Permision check - unsure that this is needed since the action is not destructive and might cause issues if the user sees the message and can't dismiss it because they're not an admin. */\n\t\tif ( ! wpcd_is_admin() ) {\n\t\t\twp_send_json_error( array( 'msg' => __( 'You are not authorized to perform this action - do readable check again.', 'wpcd' ) ) );\n\t\t}\n\n\t\t$this->wpapp_admin_init();\n\n\t\tif ( get_transient( 'wpcd_readable_check' ) ) {\n\t\t\t$return = array(\n\t\t\t\t'message' => __( 'Readable check successful!', 'wpcd' ),\n\t\t\t);\n\t\t\twp_send_json_success( $return );\n\t\t} else {\n\t\t\t$return = array(\n\t\t\t\t'message' => __( 'Readable check failed!', 'wpcd' ),\n\t\t\t);\n\t\t\twp_send_json_error( $return );\n\t\t}\n\n\t\twp_die();\n\t}", "public function testQuarantineCheckIfProfileIsQuarantined()\n {\n\n }", "function processCheater($login, $checkpoints, $chkpt, $finish) {\n\n\t\t// collect checkpoints\n\t\t$cps = '';\n\t\tforeach ($checkpoints as $cp)\n\t\t\t$cps .= formatTime($cp) . '/';\n\t\t$cps = substr($cps, 0, strlen($cps)-1); // strip trailing '/'\n\n\t\t// report cheat\n\t\tif ($finish == -1)\n\t\t\ttrigger_error('Cheat by \\'' . $login . '\\' detected! CPs: ' . $cps . ' Last: ' . formatTime($chkpt[2]) . ' index: ' . $chkpt[4], E_USER_WARNING);\n\t\telse\n\t\t\ttrigger_error('Cheat by \\'' . $login . '\\' detected! CPs: ' . $cps . ' Finish: ' . formatTime($finish), E_USER_WARNING);\n\n\t\t// check for valid player\n\t\tif (!$player = $this->server->players->getPlayer($login)) {\n\t\t\ttrigger_error('Player object for \\'' . $login . '\\' not found!', E_USER_WARNING);\n\t\t\treturn;\n\t\t}\n\n\t\tswitch ($this->settings['cheater_action']) {\n\n\t\tcase 1: // set to spec\n\t\t\t$rtn = $this->client->query('ForceSpectator', $login, 1);\n\t\t\tif (!$rtn) {\n\t\t\t\ttrigger_error('[' . $this->client->getErrorCode() . '] ForceSpectator - ' . $this->client->getErrorMessage(), E_USER_WARNING);\n\t\t\t} else {\n\t\t\t\t// allow spectator to switch back to player\n\t\t\t\t$rtn = $this->client->query('ForceSpectator', $login, 0);\n\t\t\t}\n\t\t\t// force free camera mode on spectator\n\t\t\t$this->client->addCall('ForceSpectatorTarget', array($login, '', 2));\n\t\t\t// free up player slot\n\t\t\t$this->client->addCall('SpectatorReleasePlayerSlot', array($login));\n\n\t\t\t// log console message\n\t\t\t$this->console('Cheater [{1} : {2}] forced into free spectator!', $login, stripColors($player->nickname, false));\n\n\t\t\t// show chat message\n\t\t\t$message = formatText('{#server}>> {#admin}Cheater {#highlite}{1}$z$s{#admin} forced into spectator!',\n\t\t\t str_ireplace('$w', '', $player->nickname));\n\t\t\t$this->client->query('ChatSendServerMessage', $this->formatColors($message));\n\t\t\tbreak;\n\n\t\tcase 2: // kick\n\t\t\t// log console message\n\t\t\t$this->console('Cheater [{1} : {2}] kicked!', $login, stripColors($player->nickname, false));\n\n\t\t\t// show chat message\n\t\t\t$message = formatText('{#server}>> {#admin}Cheater {#highlite}{1}$z$s{#admin} kicked!',\n\t\t\t str_ireplace('$w', '', $player->nickname));\n\t\t\t$this->client->query('ChatSendServerMessage', $this->formatColors($message));\n\n\t\t\t// kick the cheater\n\t\t\t$this->client->query('Kick', $login);\n\t\t\tbreak;\n\n\t\tcase 3: // ban (& kick)\n\t\t\t// log console message\n\t\t\t$this->console('Cheater [{1} : {2}] banned!', $login, stripColors($player->nickname, false));\n\n\t\t\t// show chat message\n\t\t\t$message = formatText('{#server}>> {#admin}Cheater {#highlite}{1}$z$s{#admin} banned!',\n\t\t\t str_ireplace('$w', '', $player->nickname));\n\t\t\t$this->client->query('ChatSendServerMessage', $this->formatColors($message));\n\n\t\t\t// update banned IPs file\n\t\t\t$this->bannedips[] = $player->ip;\n\t\t\t$this->writeIPs();\n\n\t\t\t// ban the cheater and also kick him\n\t\t\t$this->client->query('Ban', $player->login);\n\t\t\tbreak;\n\n\t\tcase 4: // blacklist & kick\n\t\t\t// log console message\n\t\t\t$this->console('Cheater [{1} : {2}] blacklisted!', $login, stripColors($player->nickname, false));\n\n\t\t\t// show chat message\n\t\t\t$message = formatText('{#server}>> {#admin}Cheater {#highlite}{1}$z$s{#admin} blacklisted!',\n\t\t\t str_ireplace('$w', '', $player->nickname));\n\t\t\t$this->client->query('ChatSendServerMessage', $this->formatColors($message));\n\n\t\t\t// blacklist the cheater and then kick him\n\t\t\t$this->client->query('BlackList', $player->login);\n\t\t\t$this->client->query('Kick', $player->login);\n\n\t\t\t// update blacklist file\n\t\t\t$filename = $this->settings['blacklist_file'];\n\t\t\t$rtn = $this->client->query('SaveBlackList', $filename);\n\t\t\tif (!$rtn) {\n\t\t\t\ttrigger_error('[' . $this->client->getErrorCode() . '] SaveBlackList (kick) - ' . $this->client->getErrorMessage(), E_USER_WARNING);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 5: // blacklist & ban\n\t\t\t// log console message\n\t\t\t$this->console('Cheater [{1} : {2}] blacklisted & banned!', $login, stripColors($player->nickname, false));\n\n\t\t\t// show chat message\n\t\t\t$message = formatText('{#server}>> {#admin}Cheater {#highlite}{1}$z$s{#admin} blacklisted & banned!',\n\t\t\t str_ireplace('$w', '', $player->nickname));\n\t\t\t$this->client->query('ChatSendServerMessage', $this->formatColors($message));\n\n\t\t\t// update banned IPs file\n\t\t\t$this->bannedips[] = $player->ip;\n\t\t\t$this->writeIPs();\n\n\t\t\t// blacklist & ban the cheater\n\t\t\t$this->client->query('BlackList', $player->login);\n\t\t\t$this->client->query('Ban', $player->login);\n\n\t\t\t// update blacklist file\n\t\t\t$filename = $this->settings['blacklist_file'];\n\t\t\t$rtn = $this->client->query('SaveBlackList', $filename);\n\t\t\tif (!$rtn) {\n\t\t\t\ttrigger_error('[' . $this->client->getErrorCode() . '] SaveBlackList (ban) - ' . $this->client->getErrorMessage(), E_USER_WARNING);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tdefault: // ignore\n\t\t}\n\t}", "private function check_players(){\n\t\tforeach($this->clients as $cli){\n\t\t\tif(null!==$cli){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function _check_command($return = false)\n\t{\n\t\t$response = '';\n\n\t\tdo\n\t\t{\n\t\t\t$result = @fgets($this->connection, 512);\n\t\t\t$response .= $result;\n\t\t}\n\t\twhile (substr($result, 3, 1) !== ' ');\n\n\t\tif (!preg_match('#^[123]#', $response))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn ($return) ? $response : true;\n\t}", "public function test_character_can_don_one_shield()\n {\n // If he could hold 2 shields, his AC would change after picking up the 2nd one.\n $this->character->use(new Shield());\n $first_shield_ac = $this->character->getAc();\n $this->character->use(new Shield());\n $this->assertEquals($first_shield_ac, $this->character->getAc());\n }" ]
[ "0.6991278", "0.62694955", "0.6166438", "0.569332", "0.5669721", "0.56419355", "0.55808455", "0.55148077", "0.5514137", "0.5499427", "0.54472655", "0.5446986", "0.54001576", "0.5393819", "0.5324072", "0.525964", "0.52108175", "0.520291", "0.51139", "0.5081888", "0.5005252", "0.4988035", "0.49875012", "0.49837396", "0.49745712", "0.49674755", "0.49605682", "0.495146", "0.4949321", "0.49355102" ]
0.70317525
0
Verifies the kick by id command does work properly
public function test_admin_kick_by_id() { $this->assertTrue($this->postScriptumServer->adminKickById(1, 'Test')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_admin_kick_by_id()\n {\n $this->assertTrue($this->btwServer->adminKickById(1, 'Test'));\n }", "public function adminKickById(int $id, string $reason = '') : bool\n {\n return $this->_consoleCommand('AdminKickById', $id . ' ' . $reason, 'Kicked player ');\n }", "public function test_admin_ban_by_id()\n {\n $this->assertTrue($this->postScriptumServer->adminBanById(1, '1h', 'Test'));\n }", "public function test_admin_kick()\n {\n $this->assertTrue($this->postScriptumServer->adminKick('Marcel', 'Test'));\n }", "public function test_admin_kick()\n {\n $this->assertTrue($this->btwServer->adminKick('Marcel', 'Test'));\n }", "public function test_admin_ban_by_id()\n {\n $this->assertTrue($this->btwServer->adminBanById(1, '1h', 'Test'));\n }", "public function test_squad_server_admin_warn_by_id()\n {\n $this->assertTrue($this->postScriptumServer->adminWarnById(0, 'Hello World!'));\n }", "public function test_squad_server_admin_warn_by_id()\n {\n $this->assertTrue($this->btwServer->adminWarnById(0, 'Hello World!'));\n }", "public function check($id);", "public function adminKick(string $nameOrSteamId, string $reason = '') : bool\n {\n return $this->_consoleCommand('AdminKick', $nameOrSteamId . ' ' . $reason, 'Kicked player ');\n }", "function checkAction($id)\n\t{\n\t\t$check = $this->DB->database_select('users', 'uid', array('username' => session_get('username'), 'uid' => $id), 1);\n\t\treturn ($check != 0);\n\t}", "function chk_teach_id(){\n\n\t\t$Q = $this->teach_lgn->chk_teach_id();\n\n\t\tif ($Q) {\n\t\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t\telse{\n\n\t\t\treturn TRUE;\n\t\t}\n\n\t}", "function ts3client_requestClientKickFromServer($serverConnectionHandlerID, $clientID, $kickReason) {}", "function ts3client_requestClientKickFromChannel($serverConnectionHandlerID, $clientID, $kickReason) {}", "private function checkID($id)\n {\n if ($id == 0) {\n $response = array(\"status\" => false, \"message\" => 'Invalid ID');\n $this->send(400, $response);\n }\n }", "public function testQuarantineExistsHeadQuarantinesid()\n {\n\n }", "public function testQuarantineExistsGetQuarantinesidExists()\n {\n\n }", "public function testActivateBySuperAdminWithWrongId(): void\n {\n // Login via tenant-admin\n $token = $this->loginByEmail(self::SUPER_ADMIN[0], self::SUPER_ADMIN[1]);\n\n // Request\n $response = $this->put('api/v1/outroCards/activate/1111111?token=' . $token);\n\n // Check response status\n $response->assertStatus(460);\n\n $responseJSON = json_decode($response->getContent(), true);\n $success = $responseJSON['success']; // array\n $code = $responseJSON['code']; // array\n $message = $responseJSON['message']; // array\n\n $this->assertEquals(false, $success);\n $this->assertEquals(460, $code);\n $this->assertEquals('Wrong ID.', $message);\n }", "private function __validate_id() {\n if (isset($this->initial_data[\"id\"])) {\n # Check the Unbound ACLs array for ID\n if (array_key_exists($this->initial_data[\"id\"], $this->config[\"unbound\"][\"acls\"])) {\n $this->id = $this->initial_data[\"id\"];\n } else {\n $this->errors[] = APIResponse\\get(2074);\n }\n } else {\n $this->errors[] = APIResponse\\get(2072);\n }\n }", "public function canSetId();", "function Del_Mess_One($name, $command)\n{\n \n global $cbox_url, $Bot_Name, $Bot_Key;\n \n //Find ID and Del\n $a = file_get_contents($cbox_url . '&sec=main');\n $matches = explode('<tr id=', $a);\n for ($i = 0; $i < count($matches); $i++) {\n $mess = $matches[$i];\n //Get User Name\n preg_match('%<b class=\"(.*)\">(.*)</b>%U', $mess, $user);\n $nick = $user[2];\n \n //Neu name chinh la name can del == > del\n if ($name == $nick) {\n \n if (count(explode($command, $mess)) > 1) {\n //Get ID User\n preg_match('%\"(.*)\">%U', $mess, $id);\n $id_user = $id[1];\n \n $dj = \"DJ Myno\";\n $passdj = \"ken-123\";\n $keydj = Get_Key($cbox_url, $dj, $passdj);\n //Del\n $cbox_url . '&sec=delban&n=' . $dj . '&k=' . $keydj . '&del=' . $id_user . '<br>';\n _Get($cbox_url . '&sec=delban&n=' . $dj . '&k=' . $keydj . '&del=' . $id_user);\n }\n }\n }\n}", "function check_ownership($id){\n\n $id = (int)$id;\n\n $sql = \"SELECT * FROM recipes WHERE id = '$id'\";\n\n $recipe = $this->select($sql)[0];\n\n if ( $recipe['user_id'] == $_SESSION['user_logged_in'] ) {\n return true;\n }else {\n header(\"Location: /\");\n exit();\n }\n\n }", "public function checkAlternativeIdMethods() {}", "public function isChecking($id) {\n return ($id==11201);\n }", "function screamUno($userId) {\n\tif (count(getDeck($userId)) == 1) {\n\t\tSQLUpdate(\"update users set uno = 1 where id = $userId\");\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "private function check_ID($id){\r\n\r\n $query = \"SELECT FROM users WHERE oauth_uid = ?\";\r\n $data = $this->_db->get_Row($query, $id);\r\n\r\n return ($this->_db->count_Rows($data) > 0) ? true : false;\r\n }", "public function checkFakes($id)\n {\n $this->db->query('SELECT * FROM fakes where userid = :userid');\n $this->db->bind(':userid', $id);\n $row = $this->db->singleResult();\n\n // Check if anything is returned\n if ($this->db->rowCount() == 0) {\n return true;\n }\n }", "public function kick_user($params) {\n return array('status' => false, 'message' => 'KICK_USER_FAIL');\n }", "public function testFailureWrongIDSCondition()\n {\n $user = User::find(1);\n $this->actingAs($user);\n\n $response = $this->postJson('/v1/collection/book/remove', [\n 'collection_id' => 'collection_5fac21047eb21',\n 'book_id' => 'wrong_id',\n ]);\n\n $response->assertSessionMissing('success');\n }", "public function actionCheckId() {\n $id = $_POST['id'];\n $row = 0;\n $object = Yii::app()->db->createCommand(\"select * from hobby_new where id=\" . $id)->queryRow();\n if (!empty($object['id'])) {\n $row = 1;\n }\n echo $row;\n }" ]
[ "0.7142423", "0.6444565", "0.59535444", "0.59183806", "0.5911984", "0.59015626", "0.5898159", "0.58456606", "0.56715405", "0.56634456", "0.5462734", "0.5407593", "0.5350294", "0.527448", "0.52650887", "0.5239024", "0.5181409", "0.51670814", "0.5155887", "0.5153842", "0.510887", "0.50683", "0.5064635", "0.50553435", "0.502908", "0.5002825", "0.49869674", "0.497524", "0.49663913", "0.49648756" ]
0.71932113
0
Verifies the ban by id command does work properly
public function test_admin_ban_by_id() { $this->assertTrue($this->postScriptumServer->adminBanById(1, '1h', 'Test')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_admin_ban_by_id()\n {\n $this->assertTrue($this->btwServer->adminBanById(1, '1h', 'Test'));\n }", "public function banORunBan($id)\n {\n try {\n $instance = $this->find($id);\n if ($instance->banned === 0) {\n \\Toastr::warning(trans('bans.' . strtolower($this->getModelName())), $title = $instance->title, $options = []);\n $instance->banned = true;\n } else {\n \\Toastr::info(trans('unbans.' . strtolower($this->getModelName())), $title = $instance->title, $options = []);\n $instance->banned = false;\n }\n $instance->update();\n } catch (\\Exception $e) {\n return response(\"Error appeared. Maybe model doesn't have banned field\" . $e->getMessage(), $e->getCode());\n }\n }", "public function ban();", "function banId($db, $id, $r=null){\n if (isset($r) && !empty($r)){\n $db->exec(\"UPDATE d_membre SET is_ban = 1, r_ban = \\\"$r\\\" WHERE id = \\\"$id\\\"\"); \n }else {\n $db->exec(\"UPDATE d_membre SET is_ban = 1 WHERE id = \\\"$id\\\"\"); \n }\n return true;\n}", "function validateBlacklistId( $id ) {\n $rowcount = $this->SHARED_DB->get_var($this->SHARED_DB->prepare(\n \"SELECT COUNT(1)\n FROM hbo_blacklist\n WHERE id = %d\", $id));\n\n if($this->SHARED_DB->last_error) {\n throw new DatabaseException($this->SHARED_DB->last_error);\n }\n\n if ($rowcount == 0) {\n throw new DatabaseException( \"Unable to find blacklist id $id\" );\n }\n }", "public function test_admin_ban()\n {\n $this->assertTrue($this->btwServer->adminBan('Marcel', '1h', 'Test'));\n }", "public function test_admin_ban()\n {\n $this->assertTrue($this->postScriptumServer->adminBan('Marcel', '1h', 'Test'));\n }", "public function banUser(){\n if($this->adminVerify()){\n\n }else{\n echo \"Vous devez avoir les droits administrateur pour accéder à cette page\";\n }\n }", "public function ban($id=null){\n if($this->request->is('get')){\n throw new MethodNotAllowedException();\n }\n\n $this->request->data['User']['id']=$id;\n $this->request->data['User']['banned']=1;\n if($this->User->save($this->request->data)) {\n $this->Session->setFlash(__('User have been banned'));\n $this->redirect(array('controller'=>'users','action'=>'index'));\n }\n }", "public function ban(Request $request, $id)\n {\n //\n \n $data = customer::where('Customer_ID', $id)->get();\n $data2 = staff::all();\n $reason = $request->Ban_Reason;\n $validatedPass = $request->Staff_Password;\n foreach($data2 as $data1){\n $data3 = $data1->Staff_Password;\n }\n $verify = password_verify($validatedPass,$data3);\n if ( $verify) {\n //if($validatedPass == $data1){\n \n \n DB::select(\"UPDATE customers set Ban_Reason = '$reason' , Customer_Status = 'BANNED' where Customer_ID = ?\",[$id]);\n $data = customer::where('Customer_ID', $id)->get();\n $message = \"User is banned.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.CustomerInformationInterface', compact(\"data\"));\n } \n else {\n $data = customer::where('Customer_ID', $id)->get();\n $message = \"Password incorrect please try again.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.BanInformationInterface', compact(\"data\"));\n }\n }", "public function update($id)\n {\n if(!Entrust::can('issuetban') && !Entrust::can('issuepban'))\n {\n return Redirect::action('ADKGamers\\\\Webadmin\\\\Controllers\\\\Admin\\\\AdKats\\\\BanController@index', [])->withErrors(['You do not have permission to issue bans']);\n }\n\n $ban = Ban::find($id);\n\n if(!$ban)\n {\n return View::make('error.generror')->with('code', 404)->with('errmsg', 'PAGE NOT FOUND')\n ->with('errdescription', 'No ban exists with ID ' . $id)\n ->with('title', 'Page Not Found');\n }\n\n $record = Record::find($ban->latest_record_id);\n\n $preferences = Auth::user()->preferences;\n\n $tz = $preferences->timezone;\n\n switch(Input::get('_gameName'))\n {\n case \"BF3\":\n if(is_null($preferences->bf3_playerid))\n {\n $source_player_name = Auth::user()->username;\n $source_player_id = NULL;\n }\n else\n {\n $sourcePlayerQuery = Player::where('GameID', Input::get('_gameID'))->where('PlayerID', $preferences->bf3_playerid)->first();\n $source_player_name = $sourcePlayerQuery->SoldierName;\n $source_player_id = $sourcePlayerQuery->PlayerID;\n }\n break;\n\n case \"BF4\":\n if(is_null($preferences->bf4_playerid))\n {\n $source_player_name = Auth::user()->username;\n $source_player_id = NULL;\n }\n else\n {\n $sourcePlayerQuery = Player::where('GameID', Input::get('_gameID'))->where('PlayerID', $preferences->bf4_playerid)->first();\n $source_player_name = $sourcePlayerQuery->SoldierName;\n $source_player_id = $sourcePlayerQuery->PlayerID;\n }\n break;\n\n default:\n $source_player_name = Auth::user()->username;\n $source_player_id = NULL;\n break;\n }\n\n $ban_reason = trim(Input::get('ban_reason'));\n $ban_notes = trim(Input::get('ban_notes'));\n $ban_server = Input::get('ban_server');\n $ban_status = Input::get('ban_status');\n $ban_type = Input::get('ban_type');\n $ban_start_date = trim(Input::get('ban_start_date'));\n $ban_end_date = trim(Input::get('ban_end_date'));\n $ban_start_time = trim(Input::get('ban_start_time'));\n $ban_end_time = trim(Input::get('ban_end_time'));\n\n $ban_start_date_time = Carbon::createFromFormat('m/d/Y g:i A', sprintf(\"%s %s\", $ban_start_date, $ban_start_time), $tz)->toDateTimeString();\n $ban_end_date_time = Carbon::createFromFormat('m/d/Y g:i A', sprintf(\"%s %s\", $ban_end_date, $ban_end_time), $tz)->toDateTimeString();\n\n if($ban_type == 8)\n {\n $ban_start_convert = Carbon::now();\n $ban_end_convert = Carbon::now()->addYears(20);\n }\n else\n {\n $ban_start_convert = Helper::LocalToUTC($ban_start_date_time);\n $ban_end_convert = Helper::LocalToUTC($ban_end_date_time);\n }\n\n if($ban_end_convert->lte($ban_start_convert))\n return Redirect::action('ADKGamers\\\\Webadmin\\\\Controllers\\\\Admin\\\\AdKats\\\\BanController@edit', [$id])->withErrors(['Ban end date/time can\\'t be before the start date/time.']);\n\n if($ban_type == 7 && !Entrust::can('issuetban'))\n {\n return Redirect::action('ADKGamers\\\\Webadmin\\\\Controllers\\\\Admin\\\\AdKats\\\\BanController@edit', [$id])->withErrors(['You do not have permission to temp ban the player'])->withInput();\n }\n\n if($ban_type == 8 && !Entrust::can('issuepban'))\n {\n return Redirect::action('ADKGamers\\\\Webadmin\\\\Controllers\\\\Admin\\\\AdKats\\\\BanController@edit', [$id])->withErrors(['You do not have permission to perma ban the player'])->withInput();\n }\n\n if($source_player_name != $record->source_name || $ban_reason != $record->record_message || $ban_type != $record->command_action)\n {\n $newRecord = new Record;\n $newRecord->server_id = $ban_server;\n $newRecord->command_type = $ban_type;\n $newRecord->command_action = $ban_type;\n $newRecord->command_numeric = $ban_start_convert->diffInMinutes($ban_end_convert);\n $newRecord->target_name = $record->target_name;\n $newRecord->target_id = $record->target_id;\n $newRecord->source_name = $source_player_name;\n $newRecord->source_id = $source_player_id;\n $newRecord->record_message = $ban_reason;\n $newRecord->record_time = ($ban_start_convert->toDateTimeString() == $record->record_time ? $ban_start_convert->addSecond()->toDateTimeString() : $ban_start_convert->toDateTimeString());\n $newRecord->adkats_read = 'Y';\n $newRecord->adkats_web = TRUE;\n $newRecord->save();\n\n $record->command_action = ($record->command_action == 8 ? 73 : 72);\n $record->save();\n\n $ban->latest_record_id = $newRecord->record_id;\n $ban->ban_notes = $ban_notes;\n $ban->ban_status = $ban_status;\n $ban->ban_startTime = ($ban_start_convert->toDateTimeString() == $record->record_time ? $ban_start_convert->addSecond()->toDateTimeString() : $ban_start_convert->toDateTimeString());\n $ban->ban_endTime = $ban_end_convert->toDateTimeString();\n $ban->ban_enforceName = Input::get('ban_enforceName');\n $ban->ban_enforceGUID = Input::get('ban_enforceGUID');\n $ban->ban_enforceIP = Input::get('ban_enforceIP');\n $ban->save();\n }\n else\n {\n if($ban_notes != $ban->ban_notes)\n {\n $ban->ban_notes = $ban_notes;\n }\n\n if($ban_status != $ban->ban_status)\n {\n $ban->ban_status = $ban_status;\n }\n\n if(Input::get('ban_enforceName') != $ban->ban_enforceName)\n {\n $ban->ban_enforceName = Input::get('ban_enforceName');\n }\n\n if(Input::get('ban_enforceGUID') != $ban->ban_enforceGUID)\n {\n $ban->ban_enforceGUID = Input::get('ban_enforceGUID');\n }\n\n if(Input::get('ban_enforceIP') != $ban->ban_enforceIP)\n {\n $ban->ban_enforceIP = Input::get('ban_enforceIP');\n }\n\n if($ban_type != 8)\n {\n $ban->ban_startTime = ($ban_start_convert->toDateTimeString() == $record->record_time ? $ban_start_convert->addSecond()->toDateTimeString() : $ban_start_convert->toDateTimeString());\n $ban->ban_endTime = $ban_end_convert->toDateTimeString();\n }\n\n $ban->save();\n }\n\n return Redirect::action('ADKGamers\\\\Webadmin\\\\Controllers\\\\Admin\\\\AdKats\\\\BanController@edit', [$id])->with('message', sprintf(\"Ban #%u has been updated.\", $id));\n }", "function checkBan(){\r\n\r\n\t#obtain codeigniter object.\r\n\t$ci =& get_instance();\r\n\r\n\t#see if user is suspended.\r\n\tif($ci->suspend_length > 0){\r\n\t\t#see if user is still suspended.\r\n\t\t$math = 3600 * $ci->suspend_length;\r\n\t\t$suspend_date = $ci->suspend_time + $math;\r\n\t\t$today = time() - $math;\r\n\r\n\t\tif($suspend_date > $today){\r\n\t\t\texit(show_error($ci->lang->line('suspended')));\r\n\t\t}\r\n\t}\r\n\t#see if the IP of the user is banned.\r\n\t$uip = detectProxy();\r\n\r\n\t$ci->db->distinct('ban_item')->from('ebb_banlist')->where('ban_type', 'IP')->like('ban_item', $uip)->limit(1);\r\n\t$banChk = $ci->db->count_all_results();\r\n\r\n\t#output an error msg.\r\n\tif($banChk == 1){\r\n\t\texit(show_error($ci->lang->line('banned')));\r\n\t}\r\n}", "public function edit($id)\n {\n if(!Entrust::can('issuetban') && !Entrust::can('issuepban'))\n {\n return Redirect::action('ADKGamers\\\\Webadmin\\\\Controllers\\\\Admin\\\\AdKats\\\\BanController@index', [])->withErrors(['You do not have permission to issue bans']);\n }\n\n $ban = Ban::join('adkats_records_main', 'adkats_bans.latest_record_id', '=', 'adkats_records_main.record_id')\n ->join('tbl_server', 'adkats_records_main.server_id', '=', 'tbl_server.ServerID')\n ->join('tbl_games', 'tbl_server.GameID', '=', 'tbl_games.GameID')\n ->where('ban_id', $id)->first();\n\n if(!$ban)\n {\n return View::make('error.generror')->with('code', 404)->with('errmsg', 'PAGE NOT FOUND')\n ->with('errdescription', 'No ban exists with ID ' . $id)\n ->with('title', 'Page Not Found');\n }\n\n if($ban->Name == 'BF3')\n {\n foreach(Server::bf3()->get() as $server)\n {\n $_servers[$server->ServerID] = $server->ServerName;\n }\n }\n elseif($ban->Name == 'BF4')\n {\n foreach(Server::bf4()->get() as $server)\n {\n $_servers[$server->ServerID] = $server->ServerName;\n }\n }\n\n $title = sprintf(\"Editing Ban #%u\", $ban->ban_id);\n\n View::share('title', $title);\n\n $this->layout->content = View::make('admin.adkats.bans.edit')->with('ban', $ban)->with('_servers', $_servers);\n }", "public function banR(Request $request, $id)\n {\n //\n $data = rider::where('Rider_ID', $id)->get();\n $data2 = staff::all();\n $reason = $request->Reason;\n $validatedPass = $request->Staff_Password;\n foreach($data2 as $data1){\n $data3 = $data1->Staff_Password;\n }\n $verify = password_verify($validatedPass,$data3);\n if ( $verify) {\n DB::select(\"UPDATE riders set Reason = '$reason' , Rider_Status = 'BANNED' where Rider_ID = ?\",[$id]);\n $data = rider::where('Rider_ID', $id)->get();\n $message = \"User is banned.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.RiderInformationInterface', compact(\"data\"));\n } \n else {\n $data = rider::where('Rider_ID', $id)->get();\n $message = \"Password incorrect please try again.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.BanInformationRInterface', compact(\"data\"));\n }\n }", "function ban($db, $pseudo, $r=null){\n if (isset($r) && !empty($r)){\n $db->exec(\"UPDATE d_membre SET is_ban = 1, r_ban = \\\"$r\\\" WHERE pseudo = \\\"$pseudo\\\"\"); \n }else {\n $db->exec(\"UPDATE d_membre SET is_ban = 1 WHERE pseudo = \\\"$pseudo\\\"\"); \n }\n return true;\n}", "public function adminBanById(int $id, string $duration = '1d', string $reason = '') : bool\n {\n return $this->_consoleCommand('AdminBanById', $id . ' ' . $duration . ' ' . $reason, 'Banned player ');\n }", "public function test_squad_server_admin_warn_by_id()\n {\n $this->assertTrue($this->btwServer->adminWarnById(0, 'Hello World!'));\n }", "function ban_user($id_auteur)\n{\n\t$user_ip = (isset($HTTP_SERVER_VARS['REMOTE_ADDR'])) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR');\n\n\tif (empty($id_auteur)) return;\n\n\t// On le recherche\n\t$is_spammer = sql_fetsel('id_auteur', 'spip_auteurs_spipbb', \"id_auteur=$id_auteur\");\n\t$infos = sql_fetsel('login, email', 'spip_auteurs', \"id_auteur=$id_auteur\");\n\n\tif (is_array($is_spammer) and !empty($is_spammer['id_auteur']) and $is_spammer['user_spam_warnings'] > $GLOBALS['spipbb']['sw_nb_spam_ban'] ) // parametrage\n\t{\n\t\t@sql_updateq('spip_auteurs_spipbb', array(\n\t\t\t\t\t'ip_auteur' => $user_ip,\n\t\t\t\t\t'ban' => 'oui'\n\t\t\t\t\t\t\t),\n\t\t\t\t\"id_auteur=$id_auteur\");\n\t\t$login = $infos['login'];\n\t\t$email = $infos['email'];\n\t\t@sql_insertq('spip_ban_liste', array(\n\t\t\t\t\t'ban_ip' => $user_ip,\n\t\t\t\t\t'ban_login' => $login,\n\t\t\t\t\t'ban_email' => $email,\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t}\n}", "public function ban($expression) {\n $this->execute('ban ' . $expression);\n }", "public function test_squad_server_admin_warn_by_id()\n {\n $this->assertTrue($this->postScriptumServer->adminWarnById(0, 'Hello World!'));\n }", "function query_if_banned($pdo, $user_id, $ip)\n{\n if (!function_exists('ban_select')) {\n require_once QUERIES_DIR . '/bans.php';\n }\n $ban = isset($user_id) && $user_id != 0 ? ban_select_active_by_user_id($pdo, $user_id) : false; // user_id\n $ban = !$ban && isset($ip) ? ban_select_active_by_ip($pdo, $ip) : $ban; // ip if user_id isn't found\n return $ban;\n}", "function ban_user($reason, $duration, $user_id) {\n\tif(!set_user_role(ROLE_BANNED, $user_id)) {\n\t\treturn false;\n\t}\n\tadd_ban_details($reason, $duration, $user_id);\n\n\treturn true;\n}", "function is_baned($ip)\r\n{\r\n\tglobal $db_url;\r\n\t$all_baned_ips=array();\r\n\t$db=YDB::factory($db_url);\r\n\t$result=$db->queryAll(sprintf(parse_tbprefix(\"SELECT * FROM <badip> WHERE ip='%s'\"),$db->escape_string($ip)));\r\n\tif($result)\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function check_ban ($database, $mpre, $spre, $email, $ip, $type)\n{\n\t// Expire old bans fist\n\t$time = time();\n\t$qry = \"SELECT id FROM {$spre}banlist WHERE expire<'$time' AND expire!='0' AND active='1'\";\n $result = $database->openConnectionWithReturn($qry);\n while (list($bid) = mysql_fetch_array($result))\n {\n \t$qry2 = \"UPDATE {$spre}banlist SET active='0' WHERE id='$bid' OR alias='$bid'\";\n \t$database->openConnectionNoReturn($qry2);\n\t}\n\n\t$qry = \"SELECT date, auth, reason, alias, level\n \t\tFROM {$spre}banlist\n WHERE ( (email='$email' AND email!='') OR (ip='$ip' AND ip!='') )\n \tAND active='1'\";\n $result = $database->openConnectionWithReturn($qry);\n\n if (!mysql_num_rows($result))\n {\n\t // Check wildcard IPs\n\t $qry2 = \"SELECT ip FROM {$spre}banlist WHERE ip LIKE '%*%' AND active='1'\";\n\t $result2 = $database->openConnectionWithReturn($qry2);\n\t list($banip) = mysql_fetch_array($result2);\n while ($banip && !$wildcard)\n\t {\n\t $wildcard = check_wild_IP($ip, $banip);\n\t if ($wildcard)\n {\n\t $qry = \"SELECT date, auth, reason, alias, level\n\t FROM {$spre}banlist WHERE ip='$banip'\";\n\t $result = $database->openConnectionWithReturn($qry);\n }\n list($banip) = mysql_fetch_array($result2);\n\t }\n }\n\n // If a result was returned, then this person's banned!\n if (mysql_num_rows($result))\n {\n \tlist ($date, $auth, $reason, $alias, $level) = mysql_fetch_array($result);\n\n // {$alias != \"0\"} indicates that the matched ban actually\n // links to a different ban (ie, multiple email/IPs)\n if ($alias != \"0\")\n {\n $qry = \"SELECT date, auth, reason FROM {$spre}banlist WHERE id='$alias'\";\n $result = $database->openConnectionWithReturn($qry);\n list ($date, $auth, $reason) = mysql_fetch_array($result);\n }\n\n\t\t// If it's a command ban, then we need to make sure it's a command app\n if ( ($level == \"command\" && ($type == \"ship\" || $type == \"command\")) ||\n\t\t\t $level != \"command\")\n {\n \t $reason = date(\"F j, Y\", $date) . \"<br /><br />\" . $reason . \"\\n\";\n\t\t\t$reason = \"Authorized by: \" . $auth . \"<br /><br />\" . $reason . \"\\n\";\n\t return $reason;\t\t\t// Returns positive\n }\n }\n // No results - person's not banned\n return;\n}", "public function banUser($id)\n {\n //\n $data = customer::where('Customer_ID', $id)->get();\n return view('ManageAccount.BanInformationInterface', compact(\"data\"));\n }", "function ban_loginOk($args) {\n $ip = $_SERVER['REMOTE_ADDR']; \n $this->load_ipban();\n \n unset($this->data_ban['FAILURES'][$ip]); \n unset($this->data_ban['BANS'][$ip]);\n \n $this->write_ipban();\n if ($this->rc->config->get('bruteforcebreaker_keep_trace', true)) \n rcube::write_log('bruteforcebreaker', sprintf(\"Login ok for %s.\\n\", $ip));\n return $args;\n }", "public function banUserR($id)\n {\n //\n $data = rider::where('Rider_ID', $id)->get();\n return view('ManageAccount.BanInformationRInterface', compact(\"data\"));\n }", "public function unban($id=null){\n if($this->request->is('get')){\n throw new MethodNotAllowedException();\n }\n\n $this->request->data['User']['id']=$id;\n $this->request->data['User']['banned']=0;\n if($this->User->save($this->request->data)) {\n $this->Session->setFlash(__('User have been un banned'));\n $this->redirect(array('controller'=>'users','action'=>'index'));\n }\n }", "function query_if_banned($pdo, $user_id, $ip)\n{\n if (!function_exists('ban_select')) {\n require_once QUERIES_DIR . '/bans.php';\n }\n $bans = !empty($user_id) && !empty($ip) ? bans_select_active($pdo, $user_id, $ip) : false; // both\n $bans = !$bans && !empty($user_id) ? bans_select_active_by_user_id($pdo, $user_id) : $bans; // user_id\n $bans = !$bans && !empty($ip) ? bans_select_active_by_ip($pdo, $ip) : $bans; // ip if user_id isn't found\n return $bans;\n}", "public function baned()\n {\n\t\t$source = $this->render('baned.html', array());\n\t\t$this->_view($source);\n\t}" ]
[ "0.7984984", "0.70188737", "0.6972131", "0.68740016", "0.65127015", "0.6477991", "0.6394135", "0.6374035", "0.63722444", "0.6286647", "0.6277863", "0.62589586", "0.624427", "0.6225984", "0.6191506", "0.608635", "0.59782594", "0.59320784", "0.58829206", "0.5880357", "0.5861235", "0.5853971", "0.5853548", "0.58488685", "0.5807275", "0.5805413", "0.57502973", "0.57044655", "0.56826866", "0.56781214" ]
0.79278874
1
Replaces spaces with full text search wildcards
protected function fullTextWildcards($term) { return str_replace(' ', '*', $term) . '*'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function fullTextWildcards($term)\n {\n // removing symbols used by MySQL\n $reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];\n $term = str_replace($reservedSymbols, ' ', $term);\n\n $words = explode(' ', $term);\n\n foreach($words as $key => $word){\n /*\n * applying + operator (required word) only big words\n * because smaller ones are not indexed by mysql\n */\n if(strlen($word) >= 3) {\n $words[$key] = '+' . $word . '*';\n }\n }\n\n $searchTerm = implode( ' ', $words);\n\n return $searchTerm;\n }", "protected function fullTextWildcards($term)\n {\n // removing symbols used by MySQL\n $reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];\n $term = str_replace($reservedSymbols, '', $term);\n\n $words = explode(' ', $term);\n\n foreach ($words as $key => $word) {\n /*\n * applying + operator (required word) only big words\n * because smaller ones are not indexed by mysql\n */\n if (strlen($word) >= 1) {\n $words[$key] = '+' . $word . '*';\n }\n }\n\n $searchTerm = implode(' ', $words);\n\n return $searchTerm;\n }", "public static function escapeMatchPattern($text){\r\n\t\t$text = str_replace('*', '', trim($text));\r\n\t\tif(mb_strlen($text)>=3){\r\n\t\t\tif(!strstr($text,'\"')){\r\n\t\t\t\tif(!strstr($text,\"'\")){\r\n\t\t\t\t\t//not exact phrase\r\n\t\t\t\t\tif(!strstr($text,' ')){\r\n\t\t\t\t\t\t//one word\r\n\t\t\t\t\t\t$text.='*';//truncation\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn self::escape($text);\r\n\t}", "function str_replace_whole_word($search, $replace, $subject) {\r\n\t\t//$test_string = preg_replace('/\\bSUMMARY\\b/s', 'Summary', $test_string);\r\n\t\t//var_dump($test_string);exit(0);\r\n\t\t$count = 1;\r\n\t\twhile($count > 0) {\r\n\t\t\t//$subject = preg_replace('/([^a-zœàáâãäåæçèéêëìíîïðñòóôõöøùúûüý]|&oelig;|&agrave;|&aacute;|&acirc;|&atilde;|&auml;|&aring;|&aelig;|&ccedil;|&egrave;|&eacute;|&ecirc;|&euml;|&igrave;|&iacute;|&icirc;|&iuml;|&eth;|&ntilde;|&ograve;|&oacute;|&ocirc;|&otilde;|&ouml;|&divide;|&oslash;|&ugrave;|&uacute;|&ucirc;|&uuml;|&yacute;)' . $search . '([^a-zœàáâãäåæçèéêëìíîïðñòóôõöøùúûüý]|&oelig;|&agrave;|&aacute;|&acirc;|&atilde;|&auml;|&aring;|&aelig;|&ccedil;|&egrave;|&eacute;|&ecirc;|&euml;|&igrave;|&iacute;|&icirc;|&iuml;|&eth;|&ntilde;|&ograve;|&oacute;|&ocirc;|&otilde;|&ouml;|&divide;|&oslash;|&ugrave;|&uacute;|&ucirc;|&uuml;|&yacute;)/s', '$1' . $replace . '$2', $subject, -1, $count);\r\n\t\t\t$subject = preg_replace('/([^a-zA-ZœàáâãäåæçèéêëìíîïðñòóôõöøùúûüýŒÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ])' . $search . '([^a-zA-ZœàáâãäåæçèéêëìíîïðñòóôõöøùúûüýŒÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ])/s', '$1' . $replace . '$2', $subject, -1, $count);\r\n\t\t}\r\n\t\treturn $subject;\r\n\t}", "protected function toLikeSearchString($text)\n {\n $str = preg_replace('#[\\s%]+#', '%', $text);\n\n // Remove all wildcard character at the head and tail\n $str = preg_replace('#^%+#', '', $str);\n $str = preg_replace('#%+$#', '', $str);\n \n return $str;\n }", "function censor_words($output)\n {\n foreach ($_SESSION['pgo_word_censor'] as $find => $replace)\n {\n $output = preg_replace(\"/\\b$find\\b/i\", $replace, $output);\n }\n return $output;\n }", "function wp_spaces_regexp()\n {\n }", "function bad_words($text)\n\t\t\t{\n\t\t\t\t$swearWords = array('motherfucking', 'motherfucker', 'fucker', 'fuck', 'bitch', 'shit', 'pussy', 'nigger', 'slut', 'cunt');\n\n\t\t\t\t$replaceWith = array('m****rf*****g', 'm****rf***r', 'f****r', 'f**k', 'b***h', 's**t', 'p***y', 'n****r', 's**t', 'c**t');\n\n\t\t\t\t$text = str_ireplace($swearWords, $replaceWith, $text);\n\n\t\t\t\treturn $text;\n\t\t\t}", "public function wordFilter($text = '', $exact = TRUE) {\n\t\tif (!isset($this->bad_words)) {\n\t\t\t$this->fetchBadWords();\n\t\t} // end if\n\n\t\tif ($exact === TRUE) {\n\t\t\treturn strtr($text, $this->bad_words);\n\t\t} // end if\n\n reset($this->bad_words);\n while(list($word, $replace) = each($this->bad_words)) {\n $text = mb_ereg_replace('/(^|\\b)' . $word . '(\\b|!|\\?|\\.|,|$)/i', $replace, $text);\n } // end while\n\t\treturn $text;\n\t}", "function _culturefeed_search_ui_sanitize_query_term($term) {\n // Replace special characters with normal ones.\n $term = culturefeed_search_transliterate($term);\n\n // Replace AND to a space.\n $term = str_replace(' AND ', ' ', $term);\n\n $query_parts = explode(' OR ', $term);\n array_walk($query_parts, function(&$search_string) {\n\n // Strip of words between quotes. The spaces don't need to be replaced to AND for them.\n preg_match_all('/\".*?\"/', $search_string, $matches);\n foreach ($matches[0] as $match) {\n $search_string = str_replace($match, '', $search_string);\n }\n\n $search_string = str_replace(' ', ' ', $search_string);\n\n // Put words with a special character between quotes.\n $words = explode(' ', trim($search_string));\n $parts = array();\n $special_characters = '-!?&/';\n foreach ($words as $word) {\n if (strpbrk($word, $special_characters)) {\n $word = '\"' . $word . '\"';\n }\n $parts[] = $word;\n }\n\n // Replace spaces between multiple search words by 'AND'.\n $search_string = implode(' AND ', $parts);\n\n // Add back the words between quotes.\n if (!empty($matches[0])) {\n if (empty($search_string)) {\n $search_string .= implode(' AND ', $matches[0]);\n }\n else {\n $search_string .= ' AND ' . implode(' AND ', $matches[0]);\n }\n }\n\n });\n\n return implode(' OR ', $query_parts);\n}", "function qoute_replacment($phrase){\r\n\t$find = array(\"\\’\", \"’\", \"\\‘\", \"‘\", \"\\'\", \"'\", \"—\", '\\”', '”', '\\“', '“', '\\\"', '\"',\"\\n\",\"\\r\",\"…\");\r\n\t//defince what to replace the find array with\r\n\t$replace = array(\"&apos;\", \"&apos;\", \"&apos;\", \"&apos;\", \"&apos;\", \"&apos;\", \"-\", \"&quot;\", \"&quot;\", \"&quot;\", \"&quot;\", \"&quot;\", \"&quot;\",\"&nbsp;\",\"&nbsp;\",\"...\");\r\n\t//html entities code incase you want that\r\n\t#$replace = array(\"&#39\", \"&#39\", \"&#39\", \"&#39\", \"&#39\", \"&#39\",\"—\", \"&#34\", \"&#34\", \"&#34\", \"&#34\", \"&#34\", \"&#34\");\r\n\t//do the replacing\r\n\t$newphrase = str_replace($find, $replace, $phrase);\r\n \t//return the replacing for output\r\n\treturn $newphrase;\r\n}", "function acf_str_replace($string = '', $search_replace = array())\n{\n}", "function cleanSearchTerms($arg) {\r\n return explode(\" \", preg_replace(\"/[^a-zA-Z0-9]+/\", \" \", strtolower(trim($arg))));\r\n}", "function doclean($samy)\n\t {\n\n\t $samyb = trim($samy);\n\t $samyb = @ereg_replace(\"%([A-Za-z]+)%\",\"\",$samyb);\n\t $samyb = str_replace(\"=\",\"\",$samyb);\n\t $samyb = str_replace(\"--\",\"\",$samyb);\n\t $samyb = str_replace(\";\",\"\",$samyb);\n\t $samyb = str_replace(\"..\",\"\",$samyb);\n\t $samyb = str_replace(\"?\",\"\",$samyb);\n\t $samyb = str_replace(\" OR \",\"\",$samyb);\n\t $samyb = str_replace(\" LIKE \",\"\",$samyb);\n\n\t return $samyb;\n\n\t }", "function find_replace($request) {\r\n\r\n $content = $request['content'];\r\n $keywords = $request['keywords'];\r\n\r\n foreach ($keywords as $keyword) {\r\n $content = str_replace($keyword['find'], $keyword['replace'], $content);\r\n }\r\n\r\n return $content;\r\n}", "function swap_bad_words($string)\n{\n global $gbBadWords;\n\n foreach ($gbBadWords as $bad_word)\n {\n $pattern = '/(\\W|^)(' . $bad_word . ')(\\W|$)/iu';\n\n //just get the first letter of bad_word into good_word\n $good_word = substr($bad_word, 0, 1);\n\n //fill out good_word with *s\n for ($i = 1; $i < strlen($bad_word); $i++)\n {\n $good_word .= '*';\n }\n //we replace the bad_word with good word including anything immediately adjacent\n //such as a comma, space, period or start/end of string.\n $replacement = '$1' . $good_word . '$3';\n $string = preg_replace($pattern, $replacement, $string);\n }\n\n //convert back to UTF-8\n return $string;\n\n}", "public function getUnicodeReplaceGreedy();", "function search_excerpt_highlight() {\n $excerpt = get_the_excerpt();\n $keys = implode('|', explode(' ', get_search_query()));\n $excerpt = preg_replace('/(' . $keys . ')/iu', '<strong class=\"search-highlight\">\\0</strong>', $excerpt);\n\n echo '<p>' . $excerpt . '</p>';\n}", "function replaceWordInText($strText, $mixWord, $strReplaceContent)\n{\n global $boolDebug;\n if(!is_array($mixWord))\n $mixWord = array($mixWord);\n\n foreach ($mixWord as $strWord)\n $strText = preg_replace(\"/(?<![ÄäÜüÖößA-Za-z0-9\\-])(\".regex_real_string($strWord).\")(?![ÄäÜüÖößA-Za-z0-9\\-\\>]|\\!\\?\\.[ÄäÜüÖößA-Za-z0-9])/ui\", $strReplaceContent, $strText);\n\n return $strText;\n}", "function highlight_this($text, $words)\n\t{\n\t\t$words = trim($words);\n\t\t$the_count = 0;\n\t\t$wordsArray = explode(' ', $words);\n\t\t\tforeach($wordsArray as $word) {\n\t\t\t if(strlen(trim($word)) != 0)\n\t\t\t\n\t\t\t //exclude these words from being replaced\n\t\t\t $exclude_list = array(\"word1\", \"word2\", \"word3\");\n\t\t\t// Check if it's excluded\n\t\t\tif($word!=\"\")\n\t\t\t{\n\t\t\tif ( in_array( strtolower($word), $exclude_list ) ) {\n\t \n\t\t\t} else {\n\t\t\t\t//$text = str_replace($word, \"<span class=\\\"highlight\\\">\".$word.\"</span>\", $text, $count);\n\t\t//\t\t$text = str_replace($word, \"<span class=\\\"highlight\\\">\".$word.\"</span>\", $text);\n\t\t\t\t$text = preg_replace ( \"/\".$word.\"/i\", \"<span class=\\\"highlight\\\">\".$word.\"</span>\", $text );\n\t\t\t\t//$the_count = $count + $the_count;\n\t\t\t\t}\n\t\t\t}\n\t\t\t \n\t\t}\n\t\t//added to show how many keywords were found\n\t\t//echo \"<br><div class=\\\"emphasis\\\">A search for <strong>\" . $words. \"</strong> found <strong>\" . $the_count . \"</strong> matches within the \" . $the_place. \".</div><br>\";\n\t \n\t\treturn $text;\n\t}", "public function StringSearchForAllWords()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_search_string_all_words;\n }", "function cf_search_where( $where ) {\n global $pagenow, $wpdb;\n if ( is_search() ) {\n $where = preg_replace(\n \"/\\(\\s*\".$wpdb->posts.\".post_title\\s+LIKE\\s*(\\'[^\\']+\\')\\s*\\)/\",\n \"(\".$wpdb->posts.\".post_title LIKE $1) OR (\".$wpdb->postmeta.\".meta_value LIKE $1)\", $where );\n }\n return $where;\n}", "private function sanitizeSearchQuery($query)\n {\n return $query;\n //return preg_replace('/[^[:alnum:] ]/', '', trim(preg_replace('/[[:space:]]+/', ' ', $query)));\n }", "function ssSearchRegexFilter( $where ) {\n if( !empty( $this->ss_input_post_title ) ) {\n $where .= \" AND wp_posts.post_title != '\" . $this->ss_input_post_title_origin . \"' AND wp_posts.post_title REGEXP '.[[:<:]]\" . implode( '[[:>:]]|.[[:<:]]', $this->ss_input_post_title ) . \"[[:>:]]' \"; \n }\n\n return $where;\n }", "public function highlightMatches(string $query, string $text): string\n\t{\n\t\t$queryWords = str_word_count($query, 1, implode('', $this->specialChars));\n\t\t$snippetWords = str_word_count(str_replace('-', ' ', $text), 1, implode('', $this->specialChars));\n\t\t$replaces = [];\n\t\tforeach ($queryWords as $word) {\n\t\t\tforeach ($snippetWords as $snippetWord) {\n\t\t\t\t// case-insensitive matching. accent-insensitive matching\n\t\t\t\tif (strtolower(str_replace($this->specialChars, $this->specialReplaces, $word)) ===\n\t\t\t\t\tstrtolower(str_replace($this->specialChars, $this->specialReplaces, $snippetWord))) {\n\t\t\t\t\t$replaces['/\\b' . preg_quote($snippetWord, '/') . '\\b/'] = str_replace('%word%', $snippetWord, $this->highlightTemplate);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn preg_replace(array_keys($replaces), array_values($replaces), $text);\n\t}", "function refine_title($string) {\n\n\t\t// replace underscores with spaces\n\t\t$string = preg_replace(\"(_)\", \" \", $string);\n\n\t\t// replace '%20' with space\n\t\t$string = preg_replace(\"(%20)\", \" \", $string);\n\n\t\t// replace multiple spaces with single space\n\t\t$string = preg_replace(\"([ ]{2,})\", \" \", $string);\n\n\t\treturn trim(ucwords(strtolower($string)));\n\t}", "function BadWordFunc ($RemoveBadWordText) {\n\t$RemoveBadWordText = eregi_replace(\"fuc?k|[kc]unt|asshole|shit|fag|wank|dick|pu[zs]?[zs][yi]|bastard|s[kc]rew|mole[zs]ter|mole[sz]t|coc?k\", \"****\", $RemoveBadWordText);\n \treturn $RemoveBadWordText;\n}", "function tagspaces($t)\r\n{\r\n $tolkiens = array(' ', '(', ')', '-', '+');\r\n $result = str_replace($tolkiens, '%', $t);\r\n return $result;\r\n}", "function get_sanitized_search_query($search_query)\n\t{\n\t\t$lowercase_search_query = strtolower(substr($search_query,0,20000));\t\n\t\t$trimed_search_query = trim($lowercase_search_query);\t\n\t\t$santizied_search_query = preg_replace('/[^[:alnum:]\\- ]/i', '', $trimed_search_query);\n\t\t\n\t\treturn $santizied_search_query;\n\t}", "function cf_search_where( $where ) {\n global $pagenow, $wpdb;\n\n if ( is_search() ) {\n $where = preg_replace(\n \"/\\(\\s*\".$wpdb->posts.\".post_title\\s+LIKE\\s*(\\'[^\\']+\\')\\s*\\)/\",\n \"(\".$wpdb->posts.\".post_title LIKE $1) OR (\".$wpdb->postmeta.\".meta_value LIKE $1)\", $where );\n }\n\n return $where;\n}" ]
[ "0.6662183", "0.64149714", "0.61172026", "0.60683316", "0.59295064", "0.589712", "0.5817518", "0.578583", "0.5681057", "0.5548434", "0.5538875", "0.55084175", "0.55063283", "0.5474026", "0.54662937", "0.5466179", "0.5456904", "0.5448339", "0.5430218", "0.5429804", "0.5419971", "0.5382253", "0.5367437", "0.5361595", "0.533556", "0.5314338", "0.5311424", "0.52936196", "0.52779454", "0.52720076" ]
0.6870011
0
Scope a query that matches a full text search of a term.
public function scopeSearch($query, $term) { $columns = implode(',',$this->searchable); $query->whereRaw("MATCH ({$columns}) AGAINST (? IN BOOLEAN MODE)" , $this->fullTextWildcards($term)); return $query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function scopeSearch($query, $term);", "public function scopeMatchingTerm($query, $term)\n {\n if ($term == '')\n return $query;\n else\n return $query->where('name', 'like', '%' . $term . '%')\n ->orWhere('description', 'like', '%' . $term . '%');\n }", "public function scopeSearch($query, $term): mixed\n {\n if (!is_null($term)) {\n return $query->where('name', 'ILIKE', \"%$term%\")\n ->orWhere('description', 'ILIKE', \"%$term%\");\n }\n\n return $query;\n }", "public function scopeSearch($query, $term)\n {\n if($term)\n {\n $query->where(function ($q) use ($term){\n $q->where('title', 'LIKE', \"%{$term}%\");\n\n $q->orwhereHas('author', function ($qr) use ($term){\n $qr->where('name', 'LIKE', \"%{$term}%\");\n });\n });\n }\n }", "public function scopeTerm($query, $term)\n {\n $query->where('term', $term);\n }", "public function scopeSearch($query, $term, $callback = null)\n {\n if(isset($this->searchable) && is_array($this->searchable) && count($this->searchable) > 0){\n\n $columns = implode(',',$this->searchable);\n\n $filters = [];\n $term = $this->extractFilterFromTerm($term, $filters);\n\n if(strlen($term) > 0)\n $query->whereRaw(\"MATCH ({$columns}) AGAINST (? IN BOOLEAN MODE)\", $this->fullTextWildcards($term));\n\n if(count($filters) > 0 && is_callable($callback))\n call_user_func_array($callback, [ $filters ]);\n\n return $query;\n\n }\n }", "public function scopeSearch($query, $terms)\n {\n foreach (Str::of($terms)->explode(' ') as $term) {\n $query->orWhere('title', 'LIKE', $term)\n ->orWhere('content', 'LIKE', $term);\n }\n\n return $query;\n }", "public function scopeFilter($query, $term)\n {\n return $query\n ->where('name', 'like', '%' . $term . '%')\n ->orWhere('email', 'like', '%' . $term . '%');\n }", "protected function fullTextWildcards($term)\n {\n // removing symbols used by MySQL\n $reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];\n $term = str_replace($reservedSymbols, ' ', $term);\n\n $words = explode(' ', $term);\n\n foreach($words as $key => $word){\n /*\n * applying + operator (required word) only big words\n * because smaller ones are not indexed by mysql\n */\n if(strlen($word) >= 3) {\n $words[$key] = '+' . $word . '*';\n }\n }\n\n $searchTerm = implode( ' ', $words);\n\n return $searchTerm;\n }", "public function scopeSearch($query)\n {\n $keyword = request('q');\n if ($keyword) {\n $model = $query->getModel();\n $searchable = $model->searchable;\n\n $local = Arr::where($searchable, function ($value, $key) {\n return is_numeric($key);\n });\n\n foreach ($local ?? [] as $key => $field) {\n $where = $key == 0 ? 'where' : 'orWHere';\n $query = $query->{$where}($field, 'like', \"%$keyword%\");\n }\n\n $relations = Arr::where($searchable, function ($value, $key) {\n return is_string($key);\n });\n\n foreach ($relations ?? [] as $key => $field) {\n $fields = Arr::wrap($field);\n $whereHas = empty($local) && $key == 0 ? 'whereHas' : 'orWhereHas';\n $query = $query->{$whereHas}($key, function ($query) use ($fields, $keyword) {\n foreach ($fields as $key => $field) {\n $where = $key == 0 ? 'where' : 'orWHere';\n $query->{$where}($field, 'like', \"%$keyword%\");\n }\n });\n }\n\n return $query;\n }\n }", "public function search($term = null);", "public function findBySearchTerm($query, $term = '', $facetConfiguration = [], $searchConfiguration = []);", "protected function fullTextWildcards($term)\n {\n // removing symbols used by MySQL\n $reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];\n $term = str_replace($reservedSymbols, '', $term);\n\n $words = explode(' ', $term);\n\n foreach ($words as $key => $word) {\n /*\n * applying + operator (required word) only big words\n * because smaller ones are not indexed by mysql\n */\n if (strlen($word) >= 1) {\n $words[$key] = '+' . $word . '*';\n }\n }\n\n $searchTerm = implode(' ', $words);\n\n return $searchTerm;\n }", "public function scopeFilter($query, $term)\n {\n $term = '%' . $term . '%';\n\n return $query->where('first_name', 'LIKE', $term)\n ->orWhere('last_name', 'LIKE', $term)\n ->orWhere('email', 'LIKE', $term);\n }", "public function scopeWithKeyword($query, $keyword)\n {\n return $query->where('name', 'like', '%'.$keyword.'%');\n }", "public function scopeSearchFilter($query, $q)\n {\n if(!empty($q)){\n return $query->where(DB::raw('LOWER(text)'), 'LIKE', '%' . strtolower($q) . '%');\n }\n }", "public function scopeSearched($query) // this is convention method\n {\n\n $search = request()->query('search');\n\n if (!$search) {\n\n return $query->published();\n\n }\n\n return $query->published()->where('title', 'LIKE', \"%{$search}%\");\n\n }", "public function scopeFilterBySearchWord( $query )\n {\n $word = request() -> get( 'search' );\n $word = strtolower($word);\n\n if( $word )\n {\n $query \n -> where( 'id', 'like', '%'. $word .'%' )\n -> orWhereHas( 'charger_connector_type.charger', function( $q ) use( $word ) {\n $q \n -> where( 'code', 'like', '%'. $word .'%')\n -> orWhereRaw(\"lower(location->>'$.ka') like '%{$word}%'\")\n -> orWhereRaw(\"lower(location->>'$.en') like '%{$word}%'\")\n -> orWhereRaw(\"lower(location->>'$.ru') like '%{$word}%'\");\n })\n -> orWhereHas( 'user', function( $q ) use( $word ) {\n $q \n -> whereRaw(\"lower(first_name) like '%{$word}%'\")\n -> orWhereRaw(\"lower(first_name) like '%{$word}%'\")\n -> orWhereRaw(\"lower(first_name) like '%{$word}%'\");\n });\n\n }\n }", "public function set_query($term = '') {\n if (!empty($term)) {\n $this->term = $term;\n }\n\n if (empty($this->term)) {\n $this->validquery = false;\n } else {\n $this->validquery = true;\n }\n\n if ($this->validquery and $this->validindex) {\n $this->results = $this->get_results();\n } else {\n $this->results = array();\n }\n }", "public function scopeSearch($query,$search){\n if($search){\n return $query->where ('title','LIKE',\"%$search%\")\n ->orWhere('description','LIKE',\"%$search%\");\n }\n }", "public function scopeOfSearch($query, $keyword)\n {\n return $query->where('name','like','%'.$keyword.'%');\n }", "private function filterTerm()\n {\n if(empty($this->term)) {\n return;\n }\n\n $this->query->andWhere(\n ['or',\n ['LIKE', 'message', $this->term],\n ['LIKE', 'category', $this->term],\n ]\n );\n }", "protected function fullTextWildcards($term)\n {\n return str_replace(' ', '*', $term) . '*';\n \n }", "public function scopeSearch($query, $keyword)\n {\n return $query->shortCode($keyword)->orWhere(function (Builder $query) use ($keyword) {\n $query->contactName($keyword);\n })->orWhere(function (Builder $query) use ($keyword) {\n $query->contactNumber($keyword);\n })->orWhere(function (Builder $query) use ($keyword) {\n $query->contactEmail($keyword);\n })->orWhere(function (Builder $query) use ($keyword) {\n $query->product($keyword);\n })->orWhere(function (Builder $query) use ($keyword) {\n $query->services($keyword);\n });\n }", "public function scopeSearch($query){\n if (request()->has('search_query') && !empty(request()->search_query) && request()->has('search_columns') && !empty(request()->search_columns) ) {\n \t$query = $this->getQuery($query , request()->search_columns , request()->search_query );\n }else{\n \tif (request()->has('search_query') && !empty(request()->search_query)) {\n \t\t$query = $this->getQuery($query , $this->fillable , request()->search_query );\n \t}\n }\n\n \n \n \n \n \n return $query;\n }", "public function modifyQuery($query, SearchTerm $search);", "public function searchByKeyword($query);", "public function scopeSearch($query, $search) {\n $searchAlt = str_replace(' ', '_', $search);\n\n if(empty($search)) {\n return $query;\n } else {\n return $query\n ->where('filename', 'like', '%' . $search . '%')\n ->Orwhere('filename', 'like', '%' . $searchAlt . '%')\n ->Orwhere('name', 'like', '%' . $searchAlt . '%')\n ->Orwhere('name', 'like', '%' . $search . '%');\n }\n }", "public function scopeSearch($query, string $q): Builder\n {\n return $query\n ->where('title', 'LIKE', \"%{$q}%\")\n ->orWhere('desc', 'LIKE', \"%{$q}%\");\n }", "public function scopeSearch($query, $search)\n\t{\n\t\treturn $query->where('address', 'like', '%' . $search . '%')\n\t\t\t->orWhere('city', 'like', '%' . $search . '%')\n\t\t\t->orWhere('zip', 'like', '%' . $search . '%')\n\t\t\t->orWhere('title', 'like', '%' . $search . '%')\n\t\t\t->orWhere('description', 'like', '%' . $search . '%')\n\t\t\t->get();\n\t}" ]
[ "0.808432", "0.7413824", "0.7222598", "0.72054404", "0.7191608", "0.71395236", "0.64251107", "0.6399057", "0.6366055", "0.63552713", "0.62934667", "0.6277461", "0.62724614", "0.62619597", "0.6256577", "0.624123", "0.6213066", "0.62068313", "0.62060946", "0.61942387", "0.6185627", "0.610771", "0.60064983", "0.59896696", "0.5921099", "0.5902511", "0.5878781", "0.5803862", "0.57343656", "0.56947875" ]
0.7715841
1
Get the user model by principal URI
private function _getUser($principalUri) { $username = basename($principalUri); return \GO\Base\Model\User::model()->findSingleByAttribute('username', $username); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getUserModel()\n {\n $config = $this->app->make('config');\n\n if (is_null($guard = $config->get('auth.defaults.guard'))) {\n return null;\n }\n\n if (is_null($provider = $config->get(\"auth.guards.{$guard}.provider\"))) {\n return null;\n }\n\n $model = $config->get(\"auth.providers.{$provider}.model\");\n\n // The standard auth config that ships with Laravel references the\n // Eloquent User model in the above config path. However, users\n // are free to reference anything there - so we check first.\n if (is_subclass_of($model, EloquentModel::class)) {\n return $model;\n }\n }", "public function getUserModel()\n {\n return $this->getController()->getServiceLocator()->get('User\\Model\\User');\n }", "function userModel() { \n $model = config('auth.model');\n return new $model;\n }", "public function user()\n {\n if (!is_null($this->user)) {\n return $this->user;\n }\n $user = null;\n try {\n $resourceId = Authorizer::getResourceOwnerId();\n $resourceType = Authorizer::getResourceOwnerType();\n } catch (\\Exception $e) {\n $resourceId = null;\n $resourceType = null;\n // throw $e;\n }\n if ($resourceType !== $this->id) {\n return null;\n }\n if (!empty($resourceId)) {\n $user = $this->getProvider()->retrieveById($resourceId);\n }\n return $this->user = $user;\n\n }", "private function _getUser($args)\n {\n try\n {\n $componentLoader = new MIDAS_ComponentLoader();\n $authComponent = $componentLoader->loadComponent('Authentication', 'api');\n }\n catch (Zend_Exception $e)\n {\n $authComponent = MidasLoader::loadComponent('Authentication');\n }\n return $authComponent->getUser($args, null);\n }", "public function loadUser()\n {\n if ($this->_model === null) {\n if (Yii::app()->user->id)\n $this->_model = Yii::app()->controller->module->user();\n if ($this->_model === null)\n $this->redirect(Yii::app()->controller->module->loginUrl);\n }\n return $this->_model;\n }", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser()\n\t{\n\t\tif ($this->_user === false) {\n\t\t\t$model = User::findIdentityByEmail($this->email);\n\n\t\t\tif ($model and ($model->role == User::ROLE_USER or $model->role == User::ROLE_ADMINISTRATOR)) {\n\t\t\t\t$this->_user = $model;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_user;\n\t}", "public function userProviderModel()\n {\n $config = $this->laravel['config'];\n\n $provider = $config->get('auth.guards.'.$config->get('auth.defaults.guard').'.provider');\n\n return $config->get(\"auth.providers.{$provider}.model\");\n }", "public function getUserModel() {\n\t\treturn ($this->isAdmin()) ? Mage::getSingleton('admin/user') : Mage::getSingleton('customer/customer');\n\t}", "public function user() : Authenticatable|null\n {\n // All routes that need to be authenticated should use AttachBroker middleware\n // Otherwise need a workaround with exception on pages, that not uses this middleware\n //\n if(is_null($this->user) && !$this->broker->isAttached()) {\n return null;\n }\n\n if (! is_null($this->user)) {\n return $this->user;\n }\n\n if ($payload = $this->broker->profile($this->request)) {\n $this->user = $this->loginFromPayload($payload);\n }\n\n return $this->user;\n }", "public function resolveUser() {\n $user = User::model()->findByAttributes(array('emailAddress' => $this->email));\n if(!($user instanceof User)){\n $profile = Profile::model()->findByAttributes(array('emailAddress' => $this->email));\n if($profile instanceof Profile) {\n $user = $profile->user;\n }\n }\n return $user;\n }", "function getApprover() {\n return user_load($this->approver_uid);\n }", "public function getUser()\n {\n return $this->getAuth()->getIdentity();\n }", "function getUserFromToken() {\n\t\treturn $this->_storage->loadUserFromToken();\n\t}", "public function getUserFromAuth() {\n\n $auth = Zend_Auth::getInstance();\n $identity = $auth->getIdentity();\n\n return $identity;\n }", "public function user()\n {\n return $this->belongsTo(Config::get('odotmedia.advertisements.user.model'));\n }", "public function loadUser()\r\n\t{\r\n\t\tif($this->_model===null)\r\n\t\t{\r\n\t\t\tif(Yii::app()->user->id)\r\n\t\t\t\t$this->_model=Yii::app()->controller->module->user();\r\n\t\t\tif($this->_model===null)\r\n\t\t\t\t$this->redirect(Yii::app()->controller->module->loginUrl);\r\n\t\t}\r\n\t\treturn $this->_model;\r\n\t}", "private function getUser() {\n\t\t$account = $this->authenticationManager->getSecurityContext()->getAccount();\n\t\t$user = $account->getParty();\n\t\treturn $user;\n\t}", "protected function getUserModel()\n\t{\n\t\t$userModel = Config::get('maclof/revisionable::user_model', 'User');\n\n\t\tif(!class_exists($userModel))\n\t\t{\n\t\t\tthrow new ModelNotFoundException('The model ' . $userModel . ' was not found.');\n\t\t}\n\n\t\treturn new $userModel;\n\t}", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }" ]
[ "0.6329774", "0.6171094", "0.6139268", "0.6118511", "0.60709256", "0.60309404", "0.60117435", "0.60117435", "0.60117435", "0.60117435", "0.60117435", "0.60117435", "0.60117435", "0.5990263", "0.59812427", "0.59791493", "0.59632057", "0.595907", "0.5937105", "0.59332234", "0.59317803", "0.5920369", "0.5919846", "0.5916029", "0.5885953", "0.5871604", "0.5867854", "0.5867854", "0.5867854", "0.5867854" ]
0.7263936
0
Returns a list of calendars for a principal
public function getCalendarsForUser($principalUri) { \GO::debug("c:getCalendarsForUser($principalUri)"); if(!isset($this->_cachedCalendars[$principalUri])){ $user = $this->_getUser($principalUri); $findParams = \GO\Base\Db\FindParams::newInstance()->ignoreAcl() ->joinModel(array( 'model' => 'GO\Sync\Model\UserCalendar', 'localTableAlias' => 't', //defaults to "t" 'localField' => 'id', //defaults to "id" 'foreignField' => 'calendar_id', //defaults to primary key of the remote model 'tableAlias' => 'l', //Optional table alias )) ->criteria(\GO\Base\Db\FindCriteria::newInstance()->addCondition('user_id', $user->id, '=', 'l')); $stmt = \GO\Calendar\Model\Calendar::model()->find($findParams); if(!$stmt->rowCount()){ //If the sync settings dialog for this user is never opened no default settings are created \GO\Sync\Model\Settings::model()->findForUser($user); //create default settings $stmt = \GO\Calendar\Model\Calendar::model()->find($findParams); } $this->_cachedCalendars[$principalUri] = array(); while ($calendar = $stmt->fetch()) { $this->_cachedCalendars[$principalUri][] = $this->_modelToDAVCalendar($calendar, $principalUri); } } \GO::debug($this->_cachedCalendars[$principalUri]); return $this->_cachedCalendars[$principalUri]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fetchAllForCalendarHome(string $principalUri): array;", "public function listCalendars()\n {\n Kronolith::initialize();\n $all_external_calendars = $GLOBALS['calendar_manager']->get(Kronolith::ALL_EXTERNAL_CALENDARS);\n $result = new stdClass;\n $auth_name = $GLOBALS['registry']->getAuth();\n\n // Calendars. Do some twisting to sort own calendar before shared\n // calendars.\n foreach (array(true, false) as $my) {\n foreach ($GLOBALS['calendar_manager']->get(Kronolith::ALL_CALENDARS) as $id => $calendar) {\n $owner = ($auth_name && ($calendar->owner() == $auth_name));\n if (($my && $owner) || (!$my && !$owner)) {\n $result->calendars['internal'][$id] = $calendar->toHash();\n }\n }\n\n // Tasklists\n if (Kronolith::hasApiPermission('tasks')) {\n foreach ($GLOBALS['registry']->tasks->listTasklists($my, Horde_Perms::SHOW, false) as $id => $tasklist) {\n if (isset($all_external_calendars['tasks/' . $id])) {\n $owner = ($auth_name &&\n ($tasklist->get('owner') == $auth_name));\n if (($my && $owner) || (!$my && !$owner)) {\n $result->calendars['tasklists']['tasks/' . $id] =\n $all_external_calendars['tasks/' . $id]->toHash();\n }\n }\n }\n }\n }\n\n // Resources\n if (!empty($GLOBALS['conf']['resource']['driver'])) {\n foreach (Kronolith::getDriver('Resource')->listResources() as $resource) {\n if ($resource->get('type') != Kronolith_Resource::TYPE_GROUP) {\n $rcal = new Kronolith_Calendar_Resource(array(\n 'resource' => $resource\n ));\n $result->calendars['resource'][$resource->get('calendar')] = $rcal->toHash();\n } else {\n $rcal = new Kronolith_Calendar_ResourceGroup(array(\n 'resource' => $resource\n ));\n $result->calendars['resourcegroup'][$resource->getId()] = $rcal->toHash();\n }\n }\n }\n\n // Timeobjects\n foreach ($all_external_calendars as $id => $calendar) {\n if ($calendar->api() != 'tasks' && $calendar->display()) {\n $result->calendars['external'][$id] = $calendar->toHash();\n }\n }\n\n // Remote calendars\n foreach ($GLOBALS['calendar_manager']->get(Kronolith::ALL_REMOTE_CALENDARS) as $url => $calendar) {\n $result->calendars['remote'][$url] = $calendar->toHash();\n }\n\n // Holidays\n foreach ($GLOBALS['calendar_manager']->get(Kronolith::ALL_HOLIDAYS) as $id => $calendar) {\n $result->calendars['holiday'][$id] = $calendar->toHash();\n }\n\n return $result;\n }", "protected function getSortedCalendars(string $principalUri): array {\n\t\t$calendars = $this->backend->getCalendarsForUser($principalUri);\n\t\t$calendarsById = [];\n\t\tforeach ($calendars as $calendar) {\n\t\t\t$calendarsById[(int) $calendar['id']] = $calendar;\n\t\t}\n\n\t\treturn $calendarsById;\n\t}", "public function get_calendar_list() {\n $calendars = array();\n $uri = 'https://www.googleapis.com/calendar/v3/users/me/calendarList';\n $params = array(\n 'sslverify' => false,\n 'timeout' => 60,\n 'headers' => array(\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->get_access_token(),\n ),\n );\n\n $response = wp_remote_get( $uri, $params );\n\n if ( !is_wp_error( $response ) && 200 == $response[ 'response' ][ 'code' ] && 'OK' == $response[ 'response' ][ 'message' ] ) {\n $body = json_decode( $response[ 'body' ] );\n $calendars = $body->items;\n\n $this->debug( 'Calendar List retrieved successfully', $body );\n } else {\n $this->error( 'Error while retrieving Calendar List: ', $response );\n }\n\n return $calendars;\n }", "public function getCalendars(User $user = null);", "function get_calendars() {\n\n\t\t// Get the attached calendars\n\t\t$calendars = wp_get_post_terms( $this->post_id , 'calendar' );\n\t\t$this->calendars = $calendars;\n\t\t\n\t\t// Loop through calendars, checking permissions\n\t\tforeach ( $calendars as $calendar ) {\n\t\t\t\n\t\t\t// Is it a group calendar?\n\t\t\tif ( is_group_calendar( $calendar->term_id ) ) :\n\t\t\t\t$group_id\t= groups_get_id( $calendar->slug );\n\t\t\t\t$can_view \t= groups_is_user_member( get_current_user_id() , $group_id ) ? true : false;\n\t\t\telse :\n\t\t\t\t$can_view = true;\n\t\t\tendif;\n\t\t\t\n\t\t\t// If we find a calendar for which the user is authorized, go ahead and display it\n\t\t\tif( $can_view ) :\n\t\t\t\t$this->calendar = $calendar;\n\t\t\t\t$this->can_view = true;\n\t\t\t\tbreak;\n\t\t\tendif;\n\t\t}\n\n\t\t// If the user is not allowed to view any calendar, redirect them to the group\n\t\tif ( !$can_view ) {\n\t\t\t$redirect = SITEURL . '/groups/' . $this->calendar->slug;\n\t\t\tbp_core_add_message( 'You cannot access events on this calendar.' , 'error' );\n\t\t\tbp_core_redirect( $redirect );\n\t\t}\n\t}", "public function calendars()\n {\n return $this->hasMany('App\\Models\\Calendar');\n }", "public function getCalendars($where = null)\n {\n $result = [];\n $byParent = [];\n $values = [];\n $cond = $where ? ' where ' . self::buildWhere($where, $values) : '';\n $stmt = $this->db->prepare('select * from calendars ' . $cond);\n\n if (!$stmt->execute($values)) {\n throw new Exception($this->getPDOError('Cannot get calendars list.'), E_APP_GET_CALENDARS);\n }\n\n while ($e = $stmt->fetch(PDO::FETCH_ASSOC)) {\n\n $e['intervals'] = $this->getCalendarIntervals(['calendar' => @$e['id']]);\n $e['daysPerMonth'] = intval($e['daysPerMonth']);\n $e['daysPerWeek'] = intval($e['daysPerWeek']);\n $e['hoursPerDay'] = intval($e['hoursPerDay']);\n\n if (!$where) {\n $parentId = $e['parentId'] ? $e['parentId'] : '';\n\n if (!isset($byParent[$parentId])) {\n $byParent[$parentId] = [];\n }\n\n $byParent[$parentId][] = $e;\n } else {\n $result[] = $e;\n }\n }\n\n return $where ? $result : self::buildTree($byParent, '');\n }", "public static function getSharedCalendarsForUser($a_usr_id = 0)\r\n\t{\r\n\t\tglobal $ilDB,$ilUser,$rbacreview;\r\n\t\t\r\n\t\tif(!$a_usr_id)\r\n\t\t{\r\n\t\t\t$a_usr_id = $ilUser->getId();\r\n\t\t}\r\n\r\n\t\t$query = \"SELECT * FROM cal_shared \".\r\n\t\t\t\"WHERE obj_type = \".$ilDB->quote(self::TYPE_USR ,'integer').\" \".\r\n\t\t\t\"AND obj_id = \".$ilDB->quote($a_usr_id ,'integer').\" \".\r\n\t\t\t\"ORDER BY create_date\";\r\n\t\t$res = $ilDB->query($query);\r\n\t\t$calendars = array();\r\n\t\twhile($row = $res->fetchRow(DB_FETCHMODE_OBJECT))\r\n\t\t{\r\n\t\t\t$calendars[] = $row->cal_id; \r\n\t\t\t\r\n\t\t\t$shared[$row->cal_id]['cal_id'] = $row->cal_id;\r\n\t\t\t$shared[$row->cal_id]['create_date'] = $row->create_date;\r\n\t\t\t$shared[$row->cal_id]['obj_type'] = $row->obj_type;\r\n\t\t}\r\n\t\t\r\n\t\t$assigned_roles = $rbacreview->assignedRoles($ilUser->getId());\r\n\t\t\r\n\t\t$query = \"SELECT * FROM cal_shared \".\r\n\t\t\t\"WHERE obj_type = \".$ilDB->quote(self::TYPE_ROLE ,'integer').\" \".\r\n\t\t\t\"AND \".$ilDB->in('obj_id',$assigned_roles,false ,'integer');\r\n\r\n\t\t$res = $ilDB->query($query);\r\n\t\twhile($row = $res->fetchRow(DB_FETCHMODE_OBJECT))\r\n\t\t{\r\n\t\t\tif(in_array($row->cal_id,$calendars))\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif(ilCalendarCategories::_isOwner($ilUser->getId(),$row->cal_id))\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$shared[$row->cal_id]['cal_id'] = $row->cal_id;\r\n\t\t\t$shared[$row->cal_id]['create_date'] = $row->create_date;\r\n\t\t\t$shared[$row->cal_id]['obj_type'] = $row->obj_type;\r\n\t\t}\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\treturn $shared ? $shared : array();\r\n\t\t// TODO: return also role calendars\r\n\t\t\r\n\t}", "function loadPublicCalendars() {\n $sql = \"\n SELECT c.calendar_id, c.title, c.color\n FROM %s AS c\n WHERE c.surfer_id IS NULL\n ORDER BY c.title\n \";\n $result = $this->databaseQueryFmt($sql, $this->tableCalendars);\n if (!$result || $result->count() == 0) {\n // database error or no public calendars defined\n return FALSE;\n }\n\n $calendars = array();\n while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) {\n $calendars[] = $row;\n }\n\n return $calendars;\n }", "public function getCalendar()\n {\n $result = new stdClass;\n $all_calendars = $GLOBALS['calendar_manager']->get(Kronolith::ALL_CALENDARS);\n if (!isset($all_calendars[$this->vars->cal]) && !$GLOBALS['conf']['share']['hidden']) {\n $GLOBALS['notification']->push(_(\"You are not allowed to view this calendar.\"), 'horde.error');\n return $result;\n } elseif (!isset($all_calendars[$this->vars->cal])) {\n // Subscribing to a \"hidden\" share, check perms.\n $kronolith_shares = $GLOBALS['injector']->getInstance('Kronolith_Shares');\n $share = $kronolith_shares->getShare($this->vars->cal);\n if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {\n $GLOBALS['notification']->push(_(\"You are not allowed to view this calendar.\"), 'horde.error');\n return $result;\n }\n $calendar = new Kronolith_Calendar_Internal(array('share' => $share));\n } else {\n $calendar = $all_calendars[$this->vars->cal];\n }\n\n $result->calendar = $calendar->toHash();\n return $result;\n }", "public function calendars()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'category',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'site_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'not' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'not' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'status',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => 'open'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t)\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Convert calendar_name to calendar_id\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('calendar_id') == '' AND\n\t\t\t$this->P->value('calendar_name') != '')\n\t\t{\n\t\t\t$ids = $this->data->get_calendar_id_from_name(\n\t\t\t\t$this->P->value('calendar_name'),\n\t\t\t\tNULL,\n\t\t\t\t$this->P->params['calendar_name']['details']['not']\n\t\t\t);\n\n\t\t\tif ( empty( $ids ) )\n\t\t\t{\n\t\t\t\t//ee()->TMPL->log_item('Calendar: No results for\n\t\t\t\t//calendar name provided, bailing');\n\t\t\t\treturn $this->no_results();\n\t\t\t}\n\n\t\t\t$this->P->set('calendar_id', implode('|', $ids));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Determine which calendars this user has permission to view\n\t\t// and modify the parameters accordingly.\n\t\t// -------------------------------------\n\n\t\t// TODO\n\n\t\t// -------------------------------------\n\t\t// Fetch the basics\n\t\t// -------------------------------------\n\n\t\t$data = $this->data->fetch_calendars_basics(\n\t\t\t$this->P->value('site_id'),\n\t\t\t$this->P->value('calendar_id'),\n\t\t\t$this->P->params['calendar_id']['details']['not']\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// If no data, then give 'em no_results\n\t\t// -------------------------------------\n\n\t\tif (($total_results = count($data)) == 0)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: No results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Ensure date_range_start <= date_range_end\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('date_range_start') !== FALSE AND\n\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\tif ($this->P->value('date_range_start', 'ymd') > $this->P->value('date_range_end', 'ymd'))\n\t\t\t{\n\t\t\t\t$temp = $this->P->params['date_range_start']['value'];\n\t\t\t\t$this->P->set('date_range_start', $this->P->params['date_range_end']['value']);\n\t\t\t\t$this->P->set('date_range_end', $temp);\n\t\t\t\tunset($temp);\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// This will come in handy later\n\t\t// -------------------------------------\n\n\t\t$calendar_array = array();\n\t\tforeach ($data as $k => $arr)\n\t\t{\n\t\t\t$calendar_array[] = $arr['calendar_id'];\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Date range params? Then we need to do a lot more work.\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('date_range_start') !== FALSE OR\n\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: Calculating date ranges');\n\t\t\t$min = ($this->P->value('date_range_start') !== FALSE) ?\n\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') :\n\t\t\t\t\t\t0;\n\n\t\t\t$max = ($this->P->value('date_range_end') !== FALSE) ?\n\t\t\t\t$this->P->value('date_range_end', 'ymd') :\n\t\t\t\t0;\n\n\t\t\t$calendar_array = $this->data->fetch_calendars_with_events_in_date_range(\n\t\t\t\t$min,\n\t\t\t\t$max,\n\t\t\t\t$calendar_array,\n\t\t\t\t$this->P->value('status')\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// No calendars? No results.\n\t\t// -------------------------------------\n\n\t\tif (empty($calendar_array))\n\t\t{\n//ee()->TMPL->log_item('Calendar: No calendars, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tInvoke Channel class\n\t\t//\t----------------------------------------\n\n\t\tif ( ! class_exists('Channel') )\n\t\t{\n\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t}\n\n\t\t$channel = new Channel();\n\n\t\t//need to remove limit here so huge amounts of events work\n\t\t$channel->limit = 1000000;\n\n\t\t// --------------------------------------------\n\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t// --------------------------------------------\n\n\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t// -------------------------------------\n\t\t// Prepare parameters\n\t\t// -------------------------------------\n\n\t\tee()->TMPL->tagparams['entry_id'] = implode('|', $calendar_array);\n\t\tee()->TMPL->tagparams['channel'] = CALENDAR_CALENDARS_CHANNEL_NAME;\n\n\t\t// -------------------------------------\n\t\t// Pre-process related data\n\t\t// -------------------------------------\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\n\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t\tee()->TMPL->var_single = array_merge(\n\t\t\t\tee()->TMPL->var_single,\n\t\t\t\tee()->TMPL->related_markers\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Execute needed methods\n\t\t// -------------------------------------\n\n\t\t$channel->fetch_custom_channel_fields();\n\n\t\t$channel->fetch_custom_member_fields();\n\n\t\t// --------------------------------------------\n\t\t// Pagination Tags Parsed Out\n\t\t// --------------------------------------------\n\n\t\t$this->fetch_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Querification\n\t\t// -------------------------------------\n\n\t\t$channel->build_sql_query();\n\n\t\tif ($channel->sql == '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\tif ($channel->query->num_rows() == 0)\n\t\t{\n//ee()->TMPL->log_item('Calendar: Channel module says no results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t// -------------------------------------------\n\t\t// 'calendar_calendars_channel_query' hook.\n\t\t// - Do something with the channel query\n\n\t\tif (ee()->extensions->active_hook('calendar_calendars_channel_query') === TRUE)\n\t\t{\n\t\t\t$channel->query = ee()->extensions->call('calendar_calendars_channel_query', $channel->query, $calendar_array);\n\t\t\tif (ee()->extensions->end_script === TRUE) return;\n\t\t}\n\t\t//\n\t\t// -------------------------------------------\n\n\t\t// -------------------------------------\n\t\t// Inject Calendar-specific variables\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Adding Calendar variables');\n\n\t\t$aliases = array(\n\t\t\t'title'\t\t\t=> 'calendar_title',\n\t\t\t'url_title'\t\t=> 'calendar_url_title',\n\t\t\t'entry_id'\t\t=> 'calendar_id',\n\t\t\t'author_id'\t\t=> 'calendar_author_id',\n\t\t\t'author'\t\t=> 'calendar_author',\n\t\t\t'status'\t\t=> 'calendar_status'\n\t\t);\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$aliases['url_title'] = 'calendar_borked_title';\n\n\t\t\tee()->TMPL->var_single['calendar_borked_title'] = 'calendar_borked_title';\n\n\t\t\tunset(ee()->TMPL->var_single['calendar_url_title']);\n\n\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_url_title' . RD,\n\t\t\t\t\t'\"calendar_url_title\"',\n\t\t\t\t\t\"'calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_borked_title' . RD,\n\t\t\t\t\t'\"calendar_borked_title\"',\n\t\t\t\t\t\"'calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t}\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ?\n\t\t\t\t\t\t\t\t\t\t$row['screen_name'] : $row['username'];\n\n\t\t\tforeach ($aliases as $old => $new)\n\t\t\t{\n\t\t\t\t$channel->query->result[$k][$new] = $channel->query->result[$k][$old];\n\t\t\t}\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tRedeclare\n\t\t//\t----------------------------------------\n\t\t//\tWe will reassign the $channel->query->result with our\n\t\t//\treordered array of values.\n\t\t//\t----------------------------------------\n\n\t\t$channel->query->result_array = $channel->query->result;\n\n\t\t// --------------------------------------------\n\t\t// Typography\n\t\t// --------------------------------------------\n\n\t\tee()->load->library('typography');\n\t\tee()->typography->initialize();\n\t\tee()->typography->convert_curly = FALSE;\n\n\t\t$channel->fetch_categories();\n\n\t\t// -------------------------------------\n\t\t// Parse\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing, via channel module');\n\n\n\n\t\t$channel->parse_channel_entries();\n\n\t\t// -------------------------------------\n\t\t// Paginate\n\t\t// -------------------------------------\n\n\t\t$channel = $this->add_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Related entries\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries, via Weblog module');\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_related_entries();\n\t\t\t}\n\n\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\t$tagdata = $channel->return_data;\n\n\t\t//ee()->TMPL->log_item('Calendar: Done!');\n\n\t\t//on the off chance someone just wrote the word\n\t\t//'calendar_url_title', we should fix that before\n\t\t//output. (See above calendar_url_title fix)\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_borked_title' . RD,\n\t\t\t\t\t'\"calendar_borked_title\"',\n\t\t\t\t\t\"'calendar_borked_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_url_title' . RD,\n\t\t\t\t\t'\"calendar_url_title\"',\n\t\t\t\t\t\"'calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\treturn $tagdata;\n\n\t}", "function getCalendarsForAdmin() {\n //\n // http://dev4.krubner.com/admin.php?page=admin_calendar\n //\n // this brings back 2 months worth of days to show in a calendar\n\n global $controller; \n\n $today = new DateTime(date('Y-m-d'));\n\n //Get Calendar for this week\n if(!isset($_GET['ym'])){\n $top_month = date('Y-m');\n } else {\n $top_month = $_GET['ym'];\n }\n\n $firstDayOfMonthDateTime = new DateTime($top_month.\"-01\");\n $lastDayOfMonthDateTime = clone $firstDayOfMonthDateTime;\n $lastDayOfMonthDateTime->modify(\"+1 month\");\n $lastDayOfMonthDateTime->modify(\"-1 day\");\n\n $arrayOfDaysForThisMonth = array();\n $arrayOfDaysForThisMonth = $controller->command(\"loadAllNights\", $firstDayOfMonthDateTime, $lastDayOfMonthDateTime); \n\n $calendars = array();\n $calendars[$top_month] = $arrayOfDaysForThisMonth;\n\n $firstDayOfMonthDateTime2 = clone $firstDayOfMonthDateTime;\n $firstDayOfMonthDateTime2->modify(\"+1 month\");\n $lastDayOfMonthDateTime2 = clone $firstDayOfMonthDateTime2;\n $lastDayOfMonthDateTime2->modify(\"+1 month\");\n $lastDayOfMonthDateTime2->modify(\"-1 day\");\n\n $arrayOfDaysForThisMonth = array();\n $arrayOfDaysForThisMonth = $controller->command(\"loadAllNights\", $firstDayOfMonthDateTime2, $lastDayOfMonthDateTime2); \n\n $calendars[$lastDayOfMonthDateTime2->format('Y-m')] = $arrayOfDaysForThisMonth;\n\n return $calendars; \n}", "public function getCalendarFor($name);", "public function getCalendarInfo()\n\t{\n\t\t\n\t\t//get URL to calendar page\n\t\t$url = $this->calendarLink;\n\t\t//Get the sourcecode\t\t\t\n\t\t$data = $this->curl->curlGetReq($url);\n\t\t//find all links to each person\n\t\t$query = \"//a\";\n\t\t$aTagNodes = $this->curl-> getDOMData($data,$query);\n\t\t\n\t\t$calendarDates = new CalendarDateRepository();\n\t\t//loop through each link, representing a person\n\t\tforeach ($aTagNodes as $at)\n\t\t{\n\t\t\t//get the href to that persons calendar\n\t\t\t$calURL =$at->getAttribute(\"href\");\n\t\t\t//get the sourcecode of that page\n\t\t\t$data = $this->curl->curlGetReq($url.$calURL);\n\t\t\t//get the table header containing name of the days\n\t\t\t$query = \"//th\";\n\t\t\t$days = $this->curl->getDOMData($data,$query);\n\t\t\t//get the table data containing availability\n\t\t\t$query = \"//td\";\n\t\t\t$availibility = $this->curl->getDOMData($data,$query);\t\t\t\n\n\t\t\t$dates = array();\n\t\t\t/*\n\t\t\t* loop table data, if the availability of that day is ok\n\t\t\t* save that data.\n\t\t\t*/\n\t\t\tfor ($i=0; $i < $days->length ; $i++)\n\t\t\t{ \n\t\t\t\t$availibilityStr =$availibility[$i]->nodeValue;\n\t\n\t\t\t\tif(strtolower($availibilityStr) === \"ok\")\n\t\t\t\t{\t\n\t\t\t\t\t//$calendarDates->add($days[$i]->nodeValue);\n\t\t\t\t\t$dates[] = new Day($days[$i]->nodeValue);\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t$calendarDates->add($dates);\n\t\t\t\n\t\t }\n\t\t\n\t\treturn $calendarDates; \n\t}", "public function test_getAllCalendars() {\n// \t\t$user = TestingUtil::getTestAdminUser();\n// \t\t$userApp = new UserApp();\n// \t\t$userApp->initializeForAppID($user, 5);\n// \t\t$outlookClient = new OutlookClient($user, $userApp);\n// \t\t$outlookCalendar = new OutlookCalendar($outlookClient);\n// \t\t$calendars = $outlookCalendar->getAllCalendars();\n// \t\t$this->assertCount(3, $calendars);\n\t\t$this->assertEquals(1,1);\n\t}", "public function index()\n {\n $principal = Principal::all();\n return $principal;\n }", "public function getCalendarInCalendarHome(string $principalUri, string $calendarUri): ?ExternalCalendar;", "public function index()\n {\n return Calendar::all();\n }", "public function actionCalendar()\n {\n // Get current ID of logined user\n $userId = Yii::$app->user->getId() ?: '1000';\n $profile = (new UsersProfile())->getProfile();\n\n // Fill array keyes with [1, .., date(\"t\")].\n // date(\"t\") - count of days in current month\n $calendar = array_fill_keys(range(1, date(\"t\")), []);\n $model = new TaskQuery(Task::class);\n\n foreach ($model->getByCurrentMonth($userId)->all() as $task) {\n // Get current $task->date and create new DateTime object\n // $date->format(\"j\") -- Day of the month: 1, 2, .., 31\n // Fill array $calender with $task objects\n $date = \\DateTime::createFromFormat(\"Y-m-d H:i:s\", $task->deadline);\n $calendar[$date->format(\"j\")][] = $task;\n }\n\n return $this->render('calendar', \\compact('calendar', 'profile'));\n }", "public function findCalendarsByUser(UserInterface $user)\r\n {\r\n $qb = $this->repository->createQueryBuilder('c');\r\n $qb->where('c.createdBy = :user');\r\n $qb->setParameter('user', $user);\r\n\r\n return $qb->getQuery()->execute();\r\n }", "public function getUserCalendar(User $user): array\n {\n $calendarsURL = $user->getCalendars();\n\n $calendars = [];\n foreach ($calendarsURL as $calendar) {\n array_push($calendars, $this->fetchEvents($calendar->getURL()));\n }\n return $calendars;\n }", "public static function ObtenerCalendario()\n {\n // Consulta de la meta\n $consulta = \"SELECT * FROM calendario\";\n\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n // Capturar primera fila del resultado\n //$row = $comando->fetch(PDO::FETCH_ASSOC);\n //return $row;\n\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n // Aquí puedes clasificar el error dependiendo de la excepción\n // para presentarlo en la respuesta Json\n return -1;\n }\n }", "function createCalendar($principalUri, $calendarUri, array $properties) {\n\n return null;\n }", "public function calendar_get_list($ews,$startdate, $enddate){\n\t\t// Set init class\n\t\t$request = new EWSType_FindItemType();\n\t\t// Use this to search only the items in the parent directory in question or use ::SOFT_DELETED\n\t\t// to identify \"soft deleted\" items, i.e. not visible and not in the trash can.\n\t\t$request->Traversal = EWSType_ItemQueryTraversalType::SHALLOW;\n\t\t// This identifies the set of properties to return in an item or folder response\n\t\t$request->ItemShape = new EWSType_ItemResponseShapeType();\n\t\t$request->ItemShape->BaseShape = EWSType_DefaultShapeNamesType::DEFAULT_PROPERTIES;//Returns ID_ONLY - DEFAULT_PROPERTIES - ALL_PROPERTIES\n\t\t\n\t\t// Define the timeframe to load calendar items\n\t\t$request->CalendarView = new EWSType_CalendarViewType();\n\t\t$request->CalendarView->StartDate = $startdate; // an ISO8601 date e.g. 2012-06-12T15:18:34+03:00\n\t\t$request->CalendarView->EndDate = $enddate; // an ISO8601 date later than the above\n\t\t\n\t\t// Only look in the \"calendars folder\"\n\t\t$request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();\n\t\t$request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType();\n\t\t$request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR;\n\t\t\n\t\t// Send request\n\t\t$response = $ews->FindItem($request);\n\t\t\n\t\t// Add events to array if event(s) were found in the timeframe specified\n\t\tif ($response->ResponseMessages->FindItemResponseMessage->RootFolder->TotalItemsInView > 0){\n\t\t $events = $response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem;\t\n\t\t}\n\t\telse{\n\t\t\tif(empty($events)){\n\t\t\t\t$events = \"No Events Found\"; \t\n\t\t\t}\n\t\t}\n\t\t \n\t\treturn $events; //remember to use the php function urlencode on the id and changekey else it will not work when sent to other EWS functions\n\t }", "public function createCalendar($principalUri, $calendarUri, array $properties) {}", "public function getCalendar() {\n return $this->calendar;\n }", "protected function get_calendar()\n\t{\n\t\treturn $this->calendars['gregorian'];\n\t}", "public function getCalendarPage();", "public function calendarPayroll($data)\n\t{\n\t\t// Formato fecha y-m-d\n\t\t$start = $data['start'];\n\t\t$end = $data['end'];\n\t\t\t\n\t\t// Formato a fecha d-m-y\n\t\t$startDate = date(\"d-m-Y\",strtotime($start));\n\t\t$endDate = date(\"d-m-Y\",strtotime($end));\n\t\t\t\n\t\t// Convertir a arreglo fechas\n\t\t$sDate = explode('-', $startDate);\n\t\t$eDate = explode('-', $endDate);\n\t\t$years = \"\";\n\t\t\t\n\t\t// Validar Fecha\n\t\tif ($sDate[1] == \"12\") {\n\t\t\tif ($sDate[0] == \"1\") {\n\t\t\t\t$years = $sDate[2];\n\t\t\t} else {\n\t\t\t\t$years = $eDate[2];\n\t\t\t}\n\t\t} else {\n\t\t\t$years = $sDate[2];\n\t\t}\n\t\t\t\n\t\t$users = $this->getUserService()->getUsersAndDetails();\n\t\t$semana = 0; $quincena = 0; $mes = 0;\n\t\t\t\n\t\tforeach ($users as $user){\n\t\t\tif ($user['period'] == 1){ $semana++; }\n\t\t\tif ($user['period'] == 2){ $quincena++; }\n\t\t\tif ($user['period'] == 3){ $mes++; }\n\t\t}\n\t\t\t\n\t\t$week = array(); $fortnight = array(); $month = array(); $arr = array();\n\t\t\t\n\t\tif ($semana > 0) {\n\t\t\t$week = $this->pagoSemana($years);\n\t\t} if ($quincena > 0) {\n\t\t\t$fortnight = $this->pagoQuincena($years);\n\t\t} if ($mes > 0){\n\t\t\t$month = $this->pagoMensual($years);\n\t\t}\n\t\t\t\n\t\t$calendar = array();\n\t\t\t\n\t\tforeach ($week as $w){\n\t\t\t$calendar[] = $w;\n\t\t}\n\t\tforeach ($fortnight as $f){\n\t\t\t$calendar[] = $f;\n\t\t}\n\t\tforeach ($month as $m){\n\t\t\t$calendar[] = $m;\n\t\t}\n\t\t\n\t\treturn $calendar;\n\t}" ]
[ "0.70131445", "0.6858883", "0.67017037", "0.66978055", "0.65352964", "0.6442766", "0.6253367", "0.61964846", "0.61364025", "0.6092897", "0.599893", "0.5983254", "0.586558", "0.58069414", "0.5733568", "0.5713105", "0.56808126", "0.56793064", "0.5621551", "0.56128055", "0.558512", "0.5569151", "0.55656576", "0.5533713", "0.5521904", "0.54982734", "0.54908824", "0.5475038", "0.54589635", "0.5458256" ]
0.7077838
0
Get the event by DAV client URI
private function getEventByUri($uri, $calendarId){ $joinCriteria = FindCriteria::newInstance() ->addRawCondition('t.id', 'd.id'); $whereCriteria = FindCriteria::newInstance() ->addModel(DavEvent::model(),'d') ->addCondition('calendar_id', $calendarId) ->addCondition('uri', $uri,'=','d'); $findParams = FindParams::newInstance() ->single() ->join(DavEvent::model()->tableName(),$joinCriteria, 'd') ->criteria($whereCriteria); return \GO\Calendar\Model\Event::model()->find($findParams); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GetEventByURI($uri_path = '') \n {\n if ( ! $uri_path) {\n return false;\n }\n $data = $this->db\n ->join('status', 'status.id_status = event.id_status', 'left')\n ->join('event_detail', 'event_detail.id_event = event.id_event', 'left')\n ->join('localization', 'localization.id_localization = event_detail.id_localization', 'left')\n ->where('is_delete', 0)\n ->where('publish_date <=', $this->date_now)\n ->where(\"(expire_date >= '{$this->date_now}' OR expire_date IS NULL || expire_date = '0000-00-00')\")\n ->where(\"LCASE({$this->db->dbprefix('event')}.uri_path)\", strtolower($uri_path))\n ->where(\"LCASE({$this->db->dbprefix('status')}.status_text)\", \"publish\")\n ->where(\"LCASE({$this->db->dbprefix('localization')}.iso_1)\", $this->lang->get_active_uri_lang())\n ->order_by('event.id_event', 'desc')\n ->limit(1)\n ->get('event')\n ->row_array();\n\n return $data;\n }", "public function find_client($event_id, $client_id);", "public function getEvent();", "public function getEvent()\n {\n // get event\n $this\n ->get('/event')\n ->assertStatus(200);\n }", "public function calendar_get_item($ews,$event_id){\n\t\t// Form the GetItem request\n\t\t$request = new EWSType_GetItemType();\n\t\t\n\t\t// Define which item properties are returned in the response\n\t\t$itemProperties = new EWSType_ItemResponseShapeType();\n\t\t$itemProperties->BaseShape = EWSType_DefaultShapeNamesType::ALL_PROPERTIES;\n\t\t\n\t\t// Add properties shape to request\n\t\t$request->ItemShape = $itemProperties;\n\t\t\n\t\t// Set the itemID of the desired item to retrieve\n\t\t$id = new EWSType_ItemIdType();\n\t\t$id->Id = $event_id;\n\t\t\n\t\t$request->ItemIds->ItemId = $id;\n\t\t\n\t\t// Send the listing (find) request and get the response\n\t\t$response = $ews->GetItem($request);\n\t\t//create an array to hold response data\n\t\t$event_data = array();\n\t\tarray_push($event_data,$response->ResponseMessages->GetItemResponseMessage->Items->CalendarItem);\n\t\treturn $event_data;\n\t }", "public static function event() {\n return self::service()->get('events');\n }", "public function getEvent($eventUrl)\n\t{\n\t\t// The given $eventUrl could, in legacy code, actually be a token instead\n\t\tif (!$this->connector->isEventUrl($eventUrl))\n\t\t{\n\t\t\t// This is an old-style token. Properly path it.\n\t\t\t$eventUrl = 'events/'. $eventUrl;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// The Event is using the new distributed API, and we're given an EventUrl\n\t\t\t$eventUrl = urldecode($eventUrl);\n\n\t\t\t// Verify the OAuth signature of the call\n\t\t\t//\n\t\t\t// Todo: This can be deferred to get the wrapper functional, but MUST be done!\n\t\t\t// Maybe see: OAuthSignatureMethod_HMAC_SHA1::check_signature()?\n\t\t\t// Should be a library call, not a local method implementation\n\t\t\tif (false)\n\t\t\t{\n\t\t\t\t$error = array('error' => 'The request did not validate using AppDirect OAuth signatures');\n\t\t\t\tthrow new AppDirectValidationException('401', $error);\n\t\t\t}\n\t\t}\n\n\t\t// GET the event from the provided $eventUrl using a OAuth-signed request\n\t\treturn new AppDirectEvent($this->connector->get($eventUrl));\n\t}", "public static function get(Client $client, $id) {\n $req = $client->newRequest(\"GET\", \"/{accountname}/events/{id}\");\n $req->addParameter(\"id\", $id);\n\n\n $result = $req->run(\"json\");\n return Event::fromJson($result);\n }", "public function getEvent()\n {\n // Check for a new event on the current connection\n $buffer = '';\n do {\n $buffer .= fgets($this->socket, 512);\n } while (!empty($buffer) && !preg_match('/\\v+$/', $buffer));\n $buffer = trim($buffer);\n\n // If no new event was found, return NULL\n if (empty($buffer)) {\n return null;\n }\n\n // If the event has a prefix, extract it\n $prefix = '';\n if (substr($buffer, 0, 1) == ':') {\n $parts = explode(' ', $buffer, 3);\n $prefix = substr(array_shift($parts), 1);\n $buffer = implode(' ', $parts);\n }\n\n // Parse the command and arguments\n list($cmd, $args) = array_pad(explode(' ', $buffer, 2), 2, null);\n\n // Parse the server name or hostmask\n if (strpos($prefix, '@') === false) {\n $hostmask = new Phergie_Hostmask(\n null, null, $prefix\n );\n } else {\n $hostmask = Phergie_Hostmask::fromString($prefix);\n }\n\n // Parse the event arguments depending on the event type\n $cmd = strtolower($cmd);\n switch ($cmd) {\n case 'names':\n case 'nick':\n case 'quit':\n case 'ping':\n case 'pong':\n case 'error':\n case 'part':\n $args = array_filter(array(ltrim($args, ':')));\n break;\n\n case 'privmsg':\n case 'notice':\n $args = $this->parseArguments($args, 2);\n list($source, $ctcp) = $args;\n if (substr($ctcp, 0, 1) === \"\\001\" && substr($ctcp, -1) === \"\\001\") {\n $ctcp = substr($ctcp, 1, -1);\n $reply = ($cmd == 'notice');\n list($cmd, $args) = array_pad(explode(' ', $ctcp, 2), 2, array());\n $cmd = strtolower($cmd);\n switch ($cmd) {\n case 'version':\n case 'time':\n case 'finger':\n case 'ping':\n if ($reply) {\n $args = array($args);\n }\n break;\n case 'action':\n $args = array($source, $args);\n break;\n }\n }\n // This fixes the issue that seems to occur, but why does it?\n if (!is_array($args)) {\n $args = array($args);\n }\n break;\n\n case 'topic':\n case 'invite':\n case 'join':\n $args = $this->parseArguments($args, 2);\n break;\n\n case 'kick':\n case 'mode':\n $args = $this->parseArguments($args, 3);\n break;\n\n // Remove target and colon preceding description from responses\n default:\n $args = substr($args, strpos($args, ' ') + 2);\n break;\n }\n\n // Create, populate, and return an event object\n if (ctype_digit($cmd)) {\n $event = new Phergie_Event_Response;\n $event\n ->setCode($cmd)\n ->setDescription($args);\n } else {\n $event = new Phergie_Event_Request;\n $event\n ->setType($cmd)\n ->setArguments($args);\n $event->setHostmask($hostmask);\n }\n $event->setRawData($buffer);\n return $event;\n }", "public function getEvent()\n {\n $headers = $this->getHeaders();\n return isset($headers['X-NE-Event']) ? $headers['X-NE-Event'] : null;\n }", "private function loadEvent()\n {\n $api_event = $this->product->getWebUrlApi() . \"segments?_sort=id&_order=desc&_start=0&_end=26&is_displayed=1\";\n $api_event = $this->httpClient->get($api_event);\n $api_event = json_decode($api_event->getRawBody(), true);\n return $api_event;\n }", "function url_ical(string $pkey, string $eventid): string\n{\n return $GLOBALS['icaldownload']->url_ical($pkey, $eventid);\n}", "public function getEvent()\n {\n return $this->getProperty(\"Event\",\n new Event($this->getContext(), new ResourcePath(\"Event\", $this->getResourcePath())));\n }", "public function getEvent(): EventInterface;", "public function getEvent()\n {\n $event = array(\n \"eid\" => $this->eid,\n \"name\" => $this->name,\n \"venue\" => $this->venue,\n \"date\" => $this->date,\n \"time\" => $this->time,\n \"type\" => $this->type,\n \"status\" => $this->status\n );\n return $event;\n }", "public function getCalendarObject($calendarId, $objectUri) {\n\n\t\t\\GO::debug(\"c:getCalendarObject($calendarId,$objectUri)\");\n\n\t\t/*\n\t\t * When a client adds or updates an event, the server must return the\n\t\t * data identical to what the client sent. That's why we store the\n\t\t * client data in a separate table and if the mtime's match we use that.\n\t\t */\n\n\t\t//select on calendar id is necessary because somehow thunderbird tries\n\t\t//to get an event that's an invitation. It must not return the organizers event.\n\t\t\n\t\t$whereCriteria = FindCriteria::newInstance()\n\t\t\t->addModel(\\GO\\Calendar\\Model\\Event::model())\n\t\t\t->addModel(DavEvent::model(),'d')\n\t\t\t->addCondition('calendar_id', $calendarId)\n\t\t\t->addCondition('uri', $objectUri,'=','d');\n\t\t\n\t\t$joinCriteria = FindCriteria::newInstance()\n\t\t\t->addRawCondition('t.id', 'd.id');\n\t\t\n\t\t$findParams = FindParams::newInstance()\n\t\t\t//->single()\n\t\t\t->limit(1)\n\t\t\t->ignoreAcl()\n\t\t\t->select(\"t.*, d.uri, d.mtime AS client_mtime, d.data\")\n\t\t\t->criteria($whereCriteria)\n\t\t\t->join(DavEvent::model()->tableName(), $joinCriteria,'d', 'LEFT');\n\n//\t\t$sql = \"SELECT d.uri,e.*, d.mtime AS client_mtime, d.data FROM cal_events e INNER JOIN dav_events d ON d.id=e.id WHERE d.uri=? AND e.calendar_id=?\";\n//\t\t$this->cal->query($sql, 'si', array($objectUri,$calendarId));\n//\t\t$event = $this->cal->next_record();\n\n\t\t//\\GO::debug($event);\n\t\t\n\t\t$event = \\GO\\Calendar\\Model\\Event::model()->find($findParams)->fetch();\n\t\t\n\t\tif ($event) {\n\n\t\t\t\\GO::debug('Found event');\n\t\t\t\n\t\t\t$data = ($event->mtime==$event->client_mtime && !empty($event->data)) ? $event->data : $this->exportCalendarEvent($event);\n\t\t\t\\GO::debug($event->mtime==$event->client_mtime ? \"Returning client data (mtime)\" : \"Returning server data (mtime)\");\n\t\t\t\n\t\t\t\n//\t\t\t$data = $this->exportCalendarEvent($event);\n\t\t\t\n\t\t\t\\GO::debug($data);\n\n\t\t\t$object = array(\n\t\t\t\t'id' => $event->id,\n\t\t\t\t'uri' => $event->uri,\n\t\t\t\t'calendardata' => $data,\n\t\t\t\t'calendarid' => $calendarId,\n\t\t\t\t'lastmodified' => $event->mtime,\n\t\t\t\t'etag'=>'\"' . date('Ymd H:i:s', $event->mtime). '-'.$event->id.'\"'\n\t\t\t);\n\t\t\t//\\GO::debug($object);\n\t\t\treturn $object;\n\t\t} \n\t\telse {\n\n\t\t\t//$calendar = $this->cal->get_calendar($calendarId);\n\n//\t\t\t$sql = \"SELECT e.*, d.uri, d.mtime AS client_mtime, d.data FROM ta_tasks e INNER JOIN dav_tasks d ON d.id=e.id WHERE d.uri=?\";// AND e.tasklist_id=?\";\n//\t\t\t$this->tasks->query($sql, 's', array($objectUri));\n//\t\t\t$task = $this->tasks->next_record();\n\t\t\t\n\t\t\t$whereCriteria = FindCriteria::newInstance()\n\t\t\t\t->addModel(\\GO\\Tasks\\Model\\Task::model())\n\t\t\t\t->addModel(DavTask::model(),'d')\n\t\t\t\t//->addCondition('tasklist_id', $calendarId) //Not necessary with the inner join on dav_tasks\n\t\t\t\t->addCondition('uri', $objectUri,'=','d');\n\t\t\n\t\t\t$joinCriteria = FindCriteria::newInstance()\n\t\t\t\t->addRawCondition('t.id', 'd.id');\n\n\t\t\t$findParams = FindParams::newInstance()\n\t\t\t\t->single()\n\t\t\t\t->select(\"t.*, d.uri, d.mtime AS client_mtime, d.data\")\n\t\t\t\t->criteria($whereCriteria)\n\t\t\t\t->join(DavTask::model()->tableName(), $joinCriteria,'d', 'LEFT');\n\t\t\t\n\t\t\t\n\t\t\t$task = \\GO\\Tasks\\Model\\Task::model()->find($findParams);\n\n\t\t\tif ($task) {\n\n\t\t\t\t\\GO::debug('Found task');\n\n\t\t\t\t$data = ($task->mtime==$task->client_mtime && !empty($task->data)) ? $task->data : $task->toICS();\n\n\t\t\t\t\\GO::debug($data);\n\n\t\t\t\t$object = array(\n\t\t\t\t\t'id' => $task->id,\n\t\t\t\t\t'uri' => $task->uri,\n\t\t\t\t\t'calendardata' => $data,\n\t\t\t\t\t'calendarid' => $calendarId,\n\t\t\t\t\t'lastmodified' => $task->mtime,\n\t\t\t\t\t'etag'=>'\"' .date('Ymd H:i:s', $task->mtime). '-'.$task->id.'\"'\n\t\t\t\t);\n\n\n\t\t\t\treturn $object;\n\t\t\t}\n\t\t}\n\t\tthrow new Sabre\\DAV\\Exception\\NotFound('File not found');\n\t}", "public function index($appId)\n {\n return $this->try(function() use ($appId)\n {\n return $this->client->get('v1/apps/'.$appId.'/events');\n });\n }", "public function getEvent() {\n return $this->event;\n }", "public function getEvent()\n {\n return $this->event;\n }", "public function getEvent()\n {\n return $this->event;\n }", "public function getEvent()\n {\n return $this->event;\n }", "protected function getEvent(string $event) {\n return $this\n ->mailjet_webhook_events()\n ->where('event', $event)\n ->orderBy('created_at', 'desc')\n ->first();\n }", "public function event( $id ) {\n\t\treturn $this->client->getEvent( [ 'id' => $id ] );\n\t}", "public function getEvent()\n {\n return $this->getData('event');\n }", "public function getEvent($event_uri, $verbose = true)\n {\n $params = [];\n if ($verbose) {\n $params['verbose'] = 'yes';\n }\n\n $event_list = (array)json_decode($this->apiGet($event_uri, $params));\n if (isset($event_list['events']) && isset($event_list['events'][0])) {\n $event = new EventEntity($event_list['events'][0]);\n $this->eventDb->save($event);\n\n foreach ($event->getHosts() as $hostsInfo) {\n if (isset($hostsInfo->host_uri)) {\n $hostsInfo->username = $this->userApi->getUsername($hostsInfo->host_uri);\n $hostsInfo->entity = $this->userApi->getUser($hostsInfo->host_uri);\n }\n }\n return $event;\n }\n\n return false;\n }", "public function getEvent($eventId)\n {\n $url = '/events/' . $eventId;\n\n $response = $this->request($url);\n\n $dataWrapper = $this->contentHandler->getEventDataWrapper($response);\n\n return $dataWrapper->getData()->get(0);\n }", "public function getEventDispatch();", "public function getEventObject(){\n $eventTimeID = $this->getID();\n\n $prepared = self::adhocQuery(function( \\PDO $connection ) use ($eventTimeID){\n $statement = $connection->prepare(\"\n SELECT sev.id FROM SchedulizerEvent sev\n JOIN SchedulizerEventTime sevTime ON sevTime.eventID = sev.id\n WHERE sevTime.id = :eventTimeID\n \");\n $statement->bindValue(\":eventTimeID\", $eventTimeID);\n return $statement;\n });\n\n return Event::getByID($prepared->fetch(\\PDO::FETCH_COLUMN));\n }", "public function getEvent() {\n\t}", "public function getEvent() {\n $request = $this->getRequest();\n\n if (request('type') == 'event_callback') {\n $event = $request['event'];\n } else {\n $event = $request;\n }\n\n return $event;\n }" ]
[ "0.6026523", "0.56476104", "0.55299765", "0.5339097", "0.53301615", "0.52014196", "0.5114776", "0.51048684", "0.50857025", "0.5063577", "0.50404483", "0.50049466", "0.5003664", "0.49884564", "0.49456805", "0.49206483", "0.48921737", "0.48792472", "0.48657516", "0.48657516", "0.48657516", "0.4861933", "0.4857695", "0.48545665", "0.48389447", "0.48195016", "0.48177952", "0.480489", "0.4790509", "0.47746757" ]
0.5938819
1
Returns all calendar objects within a calendar object. Will create the DavEvent record when they do not exist and update them when the mtime differs
public function getCalendarObjects($calendarId) { \GO::debug("c:getCalendarObjects($calendarId)"); //weird bug? if(!\GO::user()) { throw new Sabre\DAV\Exception\NotAuthenticated(); } //Get the calendar object and check if the user has delete permission. $calendar = \GO\Calendar\Model\Calendar::model()->findByPk($calendarId, false, true); // if(!$calendar->checkPermissionLevel(\GO\Base\Model\Acl::DELETE_PERMISSION)) // throw new Sabre\DAV\Exception\Forbidden(); \GO::config()->caldav_max_months_old=isset(\GO::config()->caldav_max_months_old) ? \GO::config()->caldav_max_months_old : 6; \GO::config()->caldav_max_months_old=\GO::config()->caldav_max_months_old*-1; $objects = array(); $whereCriteria = FindCriteria::newInstance() ->addModel(\GO\Calendar\Model\Event::model()) ->addCondition('exception_for_event_id', 0) ->addCondition('calendar_id', $calendarId); $findParams = FindParams::newInstance() ->ignoreAcl() ->criteria($whereCriteria); $stmt = \GO\Calendar\Model\Event::model()->findForPeriod( $findParams, \GO\Base\Util\Date::date_add(time(), 0, GO::config()->caldav_max_months_old), \GO\Base\Util\Date::date_add(time(),0,0,3) ); //Outlook crashes on dates far in the future. \GO::debug("Found ".$stmt->rowCount()." events"); while ($event = $stmt->fetch()) { // Check if all occurences of this rrule are removed with an exception. // If so, then continue to the next event. (Sabredav cannot handle rrules where all possible dates are removed by exceptions) if(!empty($event->rrule)) { try{ $vobject = $event->toVObject(); $it = new \Sabre\VObject\Recur\EventIterator($vobject); }catch(\Exception $e) { \GO::debug("Invalid rrule event ID: ".$event->id.' : '.$event->rrule.' '.$e->getMessage()); \GO::debug("All possible RRULE dates are removed by an RRULE Exception event so there is no event to display"); continue; } } $calendar_user_id = $event->calendar->user_id; $user_id = \GO::user()->id; if(!$event->private || $calendar_user_id == $user_id){ $davEvent = DavEvent::model()->findByPk($event->id); if(!$davEvent || $davEvent->mtime != $event->mtime){ $davEvent = CaldavModule::saveEvent($event, $davEvent); } $objects[] = array( 'id' => $event->id, 'uri' => $davEvent->uri, 'calendardata' => $davEvent->data, 'calendarid' => 'c:'.$calendarId, 'lastmodified' => $event->mtime, 'etag'=>'"' . date('Ymd H:i:s', $event->mtime). '-'.$event->id.'"' ); } } if($calendar->tasklist_id>0) { $tasklist = \GO\Tasks\Model\Tasklist::model()->findByPk($calendar->tasklist_id, false, true); if($tasklist && $tasklist->getPermissionLevel() > 0) { $whereCriteria = FindCriteria::newInstance() ->addModel(\GO\Tasks\Model\Task::model()) ->addCondition('tasklist_id', $calendar->tasklist_id) ->mergeWith(FindCriteria::newInstance() ->addModel(\GO\Tasks\Model\Task::model()) ->addCondition('completion_time', 0) ->addCondition('due_time', \GO\Base\Util\Date::date_add(time(), 0, \GO::config()->caldav_max_months_old),'>','t',false)); $findParams = \GO\Base\Db\FindParams::newInstance() ->select('t.*') ->ignoreAcl() ->criteria($whereCriteria); $stmt = \GO\Tasks\Model\Task::model()->find($findParams); \GO::debug("Found ".$stmt->rowCount()." tasks"); // $sql = "SELECT * FROM ta_tasks WHERE tasklist_id=? AND (completion_time=0 OR due_time>?)"; // $count = $this->tasks->query($sql, 'ii', array($calendar['tasklist_id'], Date::date_add(time(),0,\GO::config()->caldav_max_months_old))); while ($task = $stmt->fetch()) { $davTask = DavTask::model()->findByPk($task->id); if(!$davTask || $davTask->mtime != $task->mtime){ $davTask = CaldavModule::saveTask($task, $davTask); } $objects[] = array( 'id' => $task->id, 'uri' => $davTask->uri, 'calendardata' => $davTask->data, 'calendarid' => 'c:'.$calendarId, 'lastmodified' => $task->mtime, 'etag'=>'"' . date('Ymd H:i:s', $task->mtime). '-'.$task->id.'"' ); } } } //\GO::debug($objects); return $objects; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCalendarObjects($calendarId) {\n \n $this->mylog(' getCalendarObjects');\n\n $evts = $this->base->events_event_liste ($this->auth->token, $calendarId, NULL, NULL, NULL, NULL, NULL, NULL);\n\n $results = [];\n\n if (count($evts)) {\n\tforeach ($evts as $evt) {\n\t \n\t $calendardata = $this->getCalendarData($evt);\n\t $results[] = [\n\t\t\t'id' => $evt['eve_id'],\n\t\t\t'uri' => $evt['eve_id'].'.ics',\n\t\t\t'lastmodified' => $evt['eve_date_modification'], \n\t\t\t'etag' => '\"' . md5($calendardata) . '\"',\n\t\t\t'calendarid' => $calendarId,\n\t\t\t'calendardata' => $calendardata,\n\t\t\t'size' => (int)strlen($calendardata),\n\t\t\t'component' => 'vevent',\n\t\t\t];\n\t //\t $this->mylog(' == '.$evt['eve_date_modification'].' '.$evt['eve_id']);\n\t}\n }\n \n return $results;\n }", "public function getCalendarObjects($calendarId)\n {\n $params[\"calendar_id\"] = $calendarId;\n\n list($type, $user) = explode(\"_\", $calendarId);\n\n $events = MyScEvents::getMyScEvents($params);\n\n// Info: Array scheme\n// $events[] = array(\n// \"allDay\"=> false,\n// \"description\" => $description,\n// \"end\" => $end->format(\"Y-m-d H:i:s\"),\n// \"id\" => $id,\n// \"start\" => $start->format(\"Y-m-d H:i:s\"),\n// \"title\" => $title,\n// \"summary\" => \"Test2\",\n// \"calendardata\" => \"BEGIN:VCALENDAR\\nVERSION:2.0\\n\"\n// . \"PRODID:mySchoolCalendar\"\n// . \\OCP\\App::getAppVersion('mySchoolCalendar') . \"\\n\"\n// . $vevent->serialize() . \"END:VCALENDAR\"\n// );\n\n $objects = array();\n\n foreach ($events as $event) {\n $object = array(\n \"id\" => $event[\"id\"],\n \"uri\" => $type . \"_event_\" . $event[\"id\"],\n \"lastmodified\" => time(),\n \"calendarid\" => $calendarId,\n \"calendardata\" => $event[\"calendardata\"]\n );\n\n $objects[] = $object;\n }\n\n return $objects;\n }", "function getCalendarObjects($calendarId)\n\t{\n\t\t$objs = q(\"SELECT * FROM %s%scalendarobjects WHERE `calendar_id` = %d\", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, IntVal($calendarId));\n\t\t$ret = array();\n\t\tforeach ($objs as $obj) {\n\t\t\t$ret[] = array(\n\t\t\t\t\"id\" => IntVal($obj[\"id\"]),\n\t\t\t\t\"calendardata\" => $obj[\"calendardata\"],\n\t\t\t\t\"uri\" => $obj[\"uri\"],\n\t\t\t\t\"lastmodified\" => $obj[\"lastmodified\"],\n\t\t\t\t\"calendarid\" => $calendarId,\n\t\t\t\t\"etag\" => $obj[\"etag\"],\n\t\t\t\t\"size\" => IntVal($obj[\"size\"]),\n\t\t\t);\n\t\t}\n\t\treturn $ret;\n\t}", "public function listCalendars()\n {\n Kronolith::initialize();\n $all_external_calendars = $GLOBALS['calendar_manager']->get(Kronolith::ALL_EXTERNAL_CALENDARS);\n $result = new stdClass;\n $auth_name = $GLOBALS['registry']->getAuth();\n\n // Calendars. Do some twisting to sort own calendar before shared\n // calendars.\n foreach (array(true, false) as $my) {\n foreach ($GLOBALS['calendar_manager']->get(Kronolith::ALL_CALENDARS) as $id => $calendar) {\n $owner = ($auth_name && ($calendar->owner() == $auth_name));\n if (($my && $owner) || (!$my && !$owner)) {\n $result->calendars['internal'][$id] = $calendar->toHash();\n }\n }\n\n // Tasklists\n if (Kronolith::hasApiPermission('tasks')) {\n foreach ($GLOBALS['registry']->tasks->listTasklists($my, Horde_Perms::SHOW, false) as $id => $tasklist) {\n if (isset($all_external_calendars['tasks/' . $id])) {\n $owner = ($auth_name &&\n ($tasklist->get('owner') == $auth_name));\n if (($my && $owner) || (!$my && !$owner)) {\n $result->calendars['tasklists']['tasks/' . $id] =\n $all_external_calendars['tasks/' . $id]->toHash();\n }\n }\n }\n }\n }\n\n // Resources\n if (!empty($GLOBALS['conf']['resource']['driver'])) {\n foreach (Kronolith::getDriver('Resource')->listResources() as $resource) {\n if ($resource->get('type') != Kronolith_Resource::TYPE_GROUP) {\n $rcal = new Kronolith_Calendar_Resource(array(\n 'resource' => $resource\n ));\n $result->calendars['resource'][$resource->get('calendar')] = $rcal->toHash();\n } else {\n $rcal = new Kronolith_Calendar_ResourceGroup(array(\n 'resource' => $resource\n ));\n $result->calendars['resourcegroup'][$resource->getId()] = $rcal->toHash();\n }\n }\n }\n\n // Timeobjects\n foreach ($all_external_calendars as $id => $calendar) {\n if ($calendar->api() != 'tasks' && $calendar->display()) {\n $result->calendars['external'][$id] = $calendar->toHash();\n }\n }\n\n // Remote calendars\n foreach ($GLOBALS['calendar_manager']->get(Kronolith::ALL_REMOTE_CALENDARS) as $url => $calendar) {\n $result->calendars['remote'][$url] = $calendar->toHash();\n }\n\n // Holidays\n foreach ($GLOBALS['calendar_manager']->get(Kronolith::ALL_HOLIDAYS) as $id => $calendar) {\n $result->calendars['holiday'][$id] = $calendar->toHash();\n }\n\n return $result;\n }", "function getCalendarObjects($path, $node, $jsonData = null) {\n $start = null;\n $end = null;\n\n $filters = [\n 'name' => 'VCALENDAR',\n 'comp-filters' => [\n [\n 'name' => 'VEVENT',\n 'comp-filters' => [],\n 'prop-filters' => [],\n 'is-not-defined' => false,\n 'time-range' => [\n 'start' => $start,\n 'end' => $end,\n ],\n ],\n ],\n 'prop-filters' => [],\n 'is-not-defined' => false,\n 'time-range' => null,\n ];\n\n return [200, $this->getMultipleDAVItems($path, $node, $node->calendarQuery($filters), $start, $end)];\n }", "public function getCalendarObject($calendarId, $objectUri) {\n\n\t\t\\GO::debug(\"c:getCalendarObject($calendarId,$objectUri)\");\n\n\t\t/*\n\t\t * When a client adds or updates an event, the server must return the\n\t\t * data identical to what the client sent. That's why we store the\n\t\t * client data in a separate table and if the mtime's match we use that.\n\t\t */\n\n\t\t//select on calendar id is necessary because somehow thunderbird tries\n\t\t//to get an event that's an invitation. It must not return the organizers event.\n\t\t\n\t\t$whereCriteria = FindCriteria::newInstance()\n\t\t\t->addModel(\\GO\\Calendar\\Model\\Event::model())\n\t\t\t->addModel(DavEvent::model(),'d')\n\t\t\t->addCondition('calendar_id', $calendarId)\n\t\t\t->addCondition('uri', $objectUri,'=','d');\n\t\t\n\t\t$joinCriteria = FindCriteria::newInstance()\n\t\t\t->addRawCondition('t.id', 'd.id');\n\t\t\n\t\t$findParams = FindParams::newInstance()\n\t\t\t//->single()\n\t\t\t->limit(1)\n\t\t\t->ignoreAcl()\n\t\t\t->select(\"t.*, d.uri, d.mtime AS client_mtime, d.data\")\n\t\t\t->criteria($whereCriteria)\n\t\t\t->join(DavEvent::model()->tableName(), $joinCriteria,'d', 'LEFT');\n\n//\t\t$sql = \"SELECT d.uri,e.*, d.mtime AS client_mtime, d.data FROM cal_events e INNER JOIN dav_events d ON d.id=e.id WHERE d.uri=? AND e.calendar_id=?\";\n//\t\t$this->cal->query($sql, 'si', array($objectUri,$calendarId));\n//\t\t$event = $this->cal->next_record();\n\n\t\t//\\GO::debug($event);\n\t\t\n\t\t$event = \\GO\\Calendar\\Model\\Event::model()->find($findParams)->fetch();\n\t\t\n\t\tif ($event) {\n\n\t\t\t\\GO::debug('Found event');\n\t\t\t\n\t\t\t$data = ($event->mtime==$event->client_mtime && !empty($event->data)) ? $event->data : $this->exportCalendarEvent($event);\n\t\t\t\\GO::debug($event->mtime==$event->client_mtime ? \"Returning client data (mtime)\" : \"Returning server data (mtime)\");\n\t\t\t\n\t\t\t\n//\t\t\t$data = $this->exportCalendarEvent($event);\n\t\t\t\n\t\t\t\\GO::debug($data);\n\n\t\t\t$object = array(\n\t\t\t\t'id' => $event->id,\n\t\t\t\t'uri' => $event->uri,\n\t\t\t\t'calendardata' => $data,\n\t\t\t\t'calendarid' => $calendarId,\n\t\t\t\t'lastmodified' => $event->mtime,\n\t\t\t\t'etag'=>'\"' . date('Ymd H:i:s', $event->mtime). '-'.$event->id.'\"'\n\t\t\t);\n\t\t\t//\\GO::debug($object);\n\t\t\treturn $object;\n\t\t} \n\t\telse {\n\n\t\t\t//$calendar = $this->cal->get_calendar($calendarId);\n\n//\t\t\t$sql = \"SELECT e.*, d.uri, d.mtime AS client_mtime, d.data FROM ta_tasks e INNER JOIN dav_tasks d ON d.id=e.id WHERE d.uri=?\";// AND e.tasklist_id=?\";\n//\t\t\t$this->tasks->query($sql, 's', array($objectUri));\n//\t\t\t$task = $this->tasks->next_record();\n\t\t\t\n\t\t\t$whereCriteria = FindCriteria::newInstance()\n\t\t\t\t->addModel(\\GO\\Tasks\\Model\\Task::model())\n\t\t\t\t->addModel(DavTask::model(),'d')\n\t\t\t\t//->addCondition('tasklist_id', $calendarId) //Not necessary with the inner join on dav_tasks\n\t\t\t\t->addCondition('uri', $objectUri,'=','d');\n\t\t\n\t\t\t$joinCriteria = FindCriteria::newInstance()\n\t\t\t\t->addRawCondition('t.id', 'd.id');\n\n\t\t\t$findParams = FindParams::newInstance()\n\t\t\t\t->single()\n\t\t\t\t->select(\"t.*, d.uri, d.mtime AS client_mtime, d.data\")\n\t\t\t\t->criteria($whereCriteria)\n\t\t\t\t->join(DavTask::model()->tableName(), $joinCriteria,'d', 'LEFT');\n\t\t\t\n\t\t\t\n\t\t\t$task = \\GO\\Tasks\\Model\\Task::model()->find($findParams);\n\n\t\t\tif ($task) {\n\n\t\t\t\t\\GO::debug('Found task');\n\n\t\t\t\t$data = ($task->mtime==$task->client_mtime && !empty($task->data)) ? $task->data : $task->toICS();\n\n\t\t\t\t\\GO::debug($data);\n\n\t\t\t\t$object = array(\n\t\t\t\t\t'id' => $task->id,\n\t\t\t\t\t'uri' => $task->uri,\n\t\t\t\t\t'calendardata' => $data,\n\t\t\t\t\t'calendarid' => $calendarId,\n\t\t\t\t\t'lastmodified' => $task->mtime,\n\t\t\t\t\t'etag'=>'\"' .date('Ymd H:i:s', $task->mtime). '-'.$task->id.'\"'\n\t\t\t\t);\n\n\n\t\t\t\treturn $object;\n\t\t\t}\n\t\t}\n\t\tthrow new Sabre\\DAV\\Exception\\NotFound('File not found');\n\t}", "public function getCalendars($where = null)\n {\n $result = [];\n $byParent = [];\n $values = [];\n $cond = $where ? ' where ' . self::buildWhere($where, $values) : '';\n $stmt = $this->db->prepare('select * from calendars ' . $cond);\n\n if (!$stmt->execute($values)) {\n throw new Exception($this->getPDOError('Cannot get calendars list.'), E_APP_GET_CALENDARS);\n }\n\n while ($e = $stmt->fetch(PDO::FETCH_ASSOC)) {\n\n $e['intervals'] = $this->getCalendarIntervals(['calendar' => @$e['id']]);\n $e['daysPerMonth'] = intval($e['daysPerMonth']);\n $e['daysPerWeek'] = intval($e['daysPerWeek']);\n $e['hoursPerDay'] = intval($e['hoursPerDay']);\n\n if (!$where) {\n $parentId = $e['parentId'] ? $e['parentId'] : '';\n\n if (!isset($byParent[$parentId])) {\n $byParent[$parentId] = [];\n }\n\n $byParent[$parentId][] = $e;\n } else {\n $result[] = $e;\n }\n }\n\n return $where ? $result : self::buildTree($byParent, '');\n }", "public function calendars()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'category',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'site_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'not' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'not' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'status',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => 'open'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t)\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Convert calendar_name to calendar_id\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('calendar_id') == '' AND\n\t\t\t$this->P->value('calendar_name') != '')\n\t\t{\n\t\t\t$ids = $this->data->get_calendar_id_from_name(\n\t\t\t\t$this->P->value('calendar_name'),\n\t\t\t\tNULL,\n\t\t\t\t$this->P->params['calendar_name']['details']['not']\n\t\t\t);\n\n\t\t\tif ( empty( $ids ) )\n\t\t\t{\n\t\t\t\t//ee()->TMPL->log_item('Calendar: No results for\n\t\t\t\t//calendar name provided, bailing');\n\t\t\t\treturn $this->no_results();\n\t\t\t}\n\n\t\t\t$this->P->set('calendar_id', implode('|', $ids));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Determine which calendars this user has permission to view\n\t\t// and modify the parameters accordingly.\n\t\t// -------------------------------------\n\n\t\t// TODO\n\n\t\t// -------------------------------------\n\t\t// Fetch the basics\n\t\t// -------------------------------------\n\n\t\t$data = $this->data->fetch_calendars_basics(\n\t\t\t$this->P->value('site_id'),\n\t\t\t$this->P->value('calendar_id'),\n\t\t\t$this->P->params['calendar_id']['details']['not']\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// If no data, then give 'em no_results\n\t\t// -------------------------------------\n\n\t\tif (($total_results = count($data)) == 0)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: No results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Ensure date_range_start <= date_range_end\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('date_range_start') !== FALSE AND\n\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\tif ($this->P->value('date_range_start', 'ymd') > $this->P->value('date_range_end', 'ymd'))\n\t\t\t{\n\t\t\t\t$temp = $this->P->params['date_range_start']['value'];\n\t\t\t\t$this->P->set('date_range_start', $this->P->params['date_range_end']['value']);\n\t\t\t\t$this->P->set('date_range_end', $temp);\n\t\t\t\tunset($temp);\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// This will come in handy later\n\t\t// -------------------------------------\n\n\t\t$calendar_array = array();\n\t\tforeach ($data as $k => $arr)\n\t\t{\n\t\t\t$calendar_array[] = $arr['calendar_id'];\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Date range params? Then we need to do a lot more work.\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('date_range_start') !== FALSE OR\n\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: Calculating date ranges');\n\t\t\t$min = ($this->P->value('date_range_start') !== FALSE) ?\n\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') :\n\t\t\t\t\t\t0;\n\n\t\t\t$max = ($this->P->value('date_range_end') !== FALSE) ?\n\t\t\t\t$this->P->value('date_range_end', 'ymd') :\n\t\t\t\t0;\n\n\t\t\t$calendar_array = $this->data->fetch_calendars_with_events_in_date_range(\n\t\t\t\t$min,\n\t\t\t\t$max,\n\t\t\t\t$calendar_array,\n\t\t\t\t$this->P->value('status')\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// No calendars? No results.\n\t\t// -------------------------------------\n\n\t\tif (empty($calendar_array))\n\t\t{\n//ee()->TMPL->log_item('Calendar: No calendars, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tInvoke Channel class\n\t\t//\t----------------------------------------\n\n\t\tif ( ! class_exists('Channel') )\n\t\t{\n\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t}\n\n\t\t$channel = new Channel();\n\n\t\t//need to remove limit here so huge amounts of events work\n\t\t$channel->limit = 1000000;\n\n\t\t// --------------------------------------------\n\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t// --------------------------------------------\n\n\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t// -------------------------------------\n\t\t// Prepare parameters\n\t\t// -------------------------------------\n\n\t\tee()->TMPL->tagparams['entry_id'] = implode('|', $calendar_array);\n\t\tee()->TMPL->tagparams['channel'] = CALENDAR_CALENDARS_CHANNEL_NAME;\n\n\t\t// -------------------------------------\n\t\t// Pre-process related data\n\t\t// -------------------------------------\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\n\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t\tee()->TMPL->var_single = array_merge(\n\t\t\t\tee()->TMPL->var_single,\n\t\t\t\tee()->TMPL->related_markers\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Execute needed methods\n\t\t// -------------------------------------\n\n\t\t$channel->fetch_custom_channel_fields();\n\n\t\t$channel->fetch_custom_member_fields();\n\n\t\t// --------------------------------------------\n\t\t// Pagination Tags Parsed Out\n\t\t// --------------------------------------------\n\n\t\t$this->fetch_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Querification\n\t\t// -------------------------------------\n\n\t\t$channel->build_sql_query();\n\n\t\tif ($channel->sql == '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\tif ($channel->query->num_rows() == 0)\n\t\t{\n//ee()->TMPL->log_item('Calendar: Channel module says no results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t// -------------------------------------------\n\t\t// 'calendar_calendars_channel_query' hook.\n\t\t// - Do something with the channel query\n\n\t\tif (ee()->extensions->active_hook('calendar_calendars_channel_query') === TRUE)\n\t\t{\n\t\t\t$channel->query = ee()->extensions->call('calendar_calendars_channel_query', $channel->query, $calendar_array);\n\t\t\tif (ee()->extensions->end_script === TRUE) return;\n\t\t}\n\t\t//\n\t\t// -------------------------------------------\n\n\t\t// -------------------------------------\n\t\t// Inject Calendar-specific variables\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Adding Calendar variables');\n\n\t\t$aliases = array(\n\t\t\t'title'\t\t\t=> 'calendar_title',\n\t\t\t'url_title'\t\t=> 'calendar_url_title',\n\t\t\t'entry_id'\t\t=> 'calendar_id',\n\t\t\t'author_id'\t\t=> 'calendar_author_id',\n\t\t\t'author'\t\t=> 'calendar_author',\n\t\t\t'status'\t\t=> 'calendar_status'\n\t\t);\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$aliases['url_title'] = 'calendar_borked_title';\n\n\t\t\tee()->TMPL->var_single['calendar_borked_title'] = 'calendar_borked_title';\n\n\t\t\tunset(ee()->TMPL->var_single['calendar_url_title']);\n\n\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_url_title' . RD,\n\t\t\t\t\t'\"calendar_url_title\"',\n\t\t\t\t\t\"'calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_borked_title' . RD,\n\t\t\t\t\t'\"calendar_borked_title\"',\n\t\t\t\t\t\"'calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t}\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ?\n\t\t\t\t\t\t\t\t\t\t$row['screen_name'] : $row['username'];\n\n\t\t\tforeach ($aliases as $old => $new)\n\t\t\t{\n\t\t\t\t$channel->query->result[$k][$new] = $channel->query->result[$k][$old];\n\t\t\t}\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tRedeclare\n\t\t//\t----------------------------------------\n\t\t//\tWe will reassign the $channel->query->result with our\n\t\t//\treordered array of values.\n\t\t//\t----------------------------------------\n\n\t\t$channel->query->result_array = $channel->query->result;\n\n\t\t// --------------------------------------------\n\t\t// Typography\n\t\t// --------------------------------------------\n\n\t\tee()->load->library('typography');\n\t\tee()->typography->initialize();\n\t\tee()->typography->convert_curly = FALSE;\n\n\t\t$channel->fetch_categories();\n\n\t\t// -------------------------------------\n\t\t// Parse\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing, via channel module');\n\n\n\n\t\t$channel->parse_channel_entries();\n\n\t\t// -------------------------------------\n\t\t// Paginate\n\t\t// -------------------------------------\n\n\t\t$channel = $this->add_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Related entries\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries, via Weblog module');\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_related_entries();\n\t\t\t}\n\n\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\t$tagdata = $channel->return_data;\n\n\t\t//ee()->TMPL->log_item('Calendar: Done!');\n\n\t\t//on the off chance someone just wrote the word\n\t\t//'calendar_url_title', we should fix that before\n\t\t//output. (See above calendar_url_title fix)\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_borked_title' . RD,\n\t\t\t\t\t'\"calendar_borked_title\"',\n\t\t\t\t\t\"'calendar_borked_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_url_title' . RD,\n\t\t\t\t\t'\"calendar_url_title\"',\n\t\t\t\t\t\"'calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\treturn $tagdata;\n\n\t}", "function get_calendars() {\n\n\t\t// Get the attached calendars\n\t\t$calendars = wp_get_post_terms( $this->post_id , 'calendar' );\n\t\t$this->calendars = $calendars;\n\t\t\n\t\t// Loop through calendars, checking permissions\n\t\tforeach ( $calendars as $calendar ) {\n\t\t\t\n\t\t\t// Is it a group calendar?\n\t\t\tif ( is_group_calendar( $calendar->term_id ) ) :\n\t\t\t\t$group_id\t= groups_get_id( $calendar->slug );\n\t\t\t\t$can_view \t= groups_is_user_member( get_current_user_id() , $group_id ) ? true : false;\n\t\t\telse :\n\t\t\t\t$can_view = true;\n\t\t\tendif;\n\t\t\t\n\t\t\t// If we find a calendar for which the user is authorized, go ahead and display it\n\t\t\tif( $can_view ) :\n\t\t\t\t$this->calendar = $calendar;\n\t\t\t\t$this->can_view = true;\n\t\t\t\tbreak;\n\t\t\tendif;\n\t\t}\n\n\t\t// If the user is not allowed to view any calendar, redirect them to the group\n\t\tif ( !$can_view ) {\n\t\t\t$redirect = SITEURL . '/groups/' . $this->calendar->slug;\n\t\t\tbp_core_add_message( 'You cannot access events on this calendar.' , 'error' );\n\t\t\tbp_core_redirect( $redirect );\n\t\t}\n\t}", "private function _get_calendar_array()\n\t{\n\t $this->all_events = $this->result->xpath(\".//event\");\n\t \n\t foreach($this->all_events as $an_event):\n\t $start_at = $an_event->xpath(\"./start-at\");\n \t $start_at = $start_at[0];\n \t $end_at = $an_event->xpath(\"./end-at\");\n \t $end_at = $end_at[0];\n \t \n \t $start_at = new DateTime($start_at);\n \t $start_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $start_at->setTime(0, 0, 0);\n \t $end_at = new DateTime($end_at);\n \t $end_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $end_at->setTime(0, 0, 0);\n \t \n \t $start_timestamp = strtotime($start_at->format('Y-m-d'));\n $end_timestamp = strtotime($end_at->format('Y-m-d'));\n \n $start_year = date(\"Y\", $start_timestamp);\n $end_year = date(\"Y\", $end_timestamp);\n $start_month = date(\"m\", $start_timestamp);\n $end_month = date(\"m\", $end_timestamp);\n $start_day = date(\"d\", $start_timestamp);\n $start_day = $start_day + 1;\n $end_day = date(\"d\", $end_timestamp);\n $end_day = $end_day + 1;\n \n if(($start_year == $this->year && $start_month == $this->month) || ($end_year == $this->year && $end_month == $this->month)):\n if($start_year == $end_year):\n if($start_month == $end_month):\n $this->_calendar_array_one($start_day, $end_day);\n else:\n if($end_month != $this->month):\n $this->_calendar_array_two($start_day);\n else:\n $this->_calendar_array_three($end_day);\n endif;\n endif;\n endif;\n endif;\n endforeach;\n \n\t foreach($this->callinks as $callinks):\n\t foreach($callinks as $key => $value):\n\t $this->combined_callinks[\"$key\"] = $value;\n\t endforeach;\n\t endforeach;\n\t}", "private function getEvents () \n\n\t\t{\n\t\t\t $dbs = new DB ( $this->config['database'] );\n $c = $dbs->query (\"SELECT * FROM tbl_events_record WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t if ( count ( $c ) ) {\n\t\t\t\t$this->result['data']['id'] = trim ( $this->c );\n\t\t\t\t$this->result['data']['events'] = $c[0]['events'];\n\t\t\t\t$this->result['data']['date'] = $c[0]['date_rec'];\n\t\t\t } else \n\t\t\t\t$this->result['data']['result'] = \"Not found [error code:100:101]\";\n\n\t\t\t $dbs->CloseConnection ();\n\t\t\t\n\t\t \treturn;\n\t\t}", "public function get_calendar_list() {\n $calendars = array();\n $uri = 'https://www.googleapis.com/calendar/v3/users/me/calendarList';\n $params = array(\n 'sslverify' => false,\n 'timeout' => 60,\n 'headers' => array(\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->get_access_token(),\n ),\n );\n\n $response = wp_remote_get( $uri, $params );\n\n if ( !is_wp_error( $response ) && 200 == $response[ 'response' ][ 'code' ] && 'OK' == $response[ 'response' ][ 'message' ] ) {\n $body = json_decode( $response[ 'body' ] );\n $calendars = $body->items;\n\n $this->debug( 'Calendar List retrieved successfully', $body );\n } else {\n $this->error( 'Error while retrieving Calendar List: ', $response );\n }\n\n return $calendars;\n }", "function loadPublicCalendars() {\n $sql = \"\n SELECT c.calendar_id, c.title, c.color\n FROM %s AS c\n WHERE c.surfer_id IS NULL\n ORDER BY c.title\n \";\n $result = $this->databaseQueryFmt($sql, $this->tableCalendars);\n if (!$result || $result->count() == 0) {\n // database error or no public calendars defined\n return FALSE;\n }\n\n $calendars = array();\n while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) {\n $calendars[] = $row;\n }\n\n return $calendars;\n }", "public function events()\n {\n return $this->hasMany(CalendarEvent::class);\n }", "function loadEventsByCalendar($calendarId) {\n\n if (!is_int($calendarId)) {\n return FALSE;\n }\n\n $filter = $this->databaseGetSQLCondition('calendar_id', $calendarId);\n $sql = \"\n SELECT c.title, c.event_id\n FROM %s AS c\n WHERE $filter\n ORDER BY c.start_stamp\n \";\n\n $result = $this->databaseQueryFmt($sql, $this->tableEvents);\n if (!$result) {\n return FALSE;\n }\n\n $events = array();\n while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) {\n $events[] = $row;\n }\n\n return $events;\n }", "public function calendar_get_list($ews,$startdate, $enddate){\n\t\t// Set init class\n\t\t$request = new EWSType_FindItemType();\n\t\t// Use this to search only the items in the parent directory in question or use ::SOFT_DELETED\n\t\t// to identify \"soft deleted\" items, i.e. not visible and not in the trash can.\n\t\t$request->Traversal = EWSType_ItemQueryTraversalType::SHALLOW;\n\t\t// This identifies the set of properties to return in an item or folder response\n\t\t$request->ItemShape = new EWSType_ItemResponseShapeType();\n\t\t$request->ItemShape->BaseShape = EWSType_DefaultShapeNamesType::DEFAULT_PROPERTIES;//Returns ID_ONLY - DEFAULT_PROPERTIES - ALL_PROPERTIES\n\t\t\n\t\t// Define the timeframe to load calendar items\n\t\t$request->CalendarView = new EWSType_CalendarViewType();\n\t\t$request->CalendarView->StartDate = $startdate; // an ISO8601 date e.g. 2012-06-12T15:18:34+03:00\n\t\t$request->CalendarView->EndDate = $enddate; // an ISO8601 date later than the above\n\t\t\n\t\t// Only look in the \"calendars folder\"\n\t\t$request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();\n\t\t$request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType();\n\t\t$request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR;\n\t\t\n\t\t// Send request\n\t\t$response = $ews->FindItem($request);\n\t\t\n\t\t// Add events to array if event(s) were found in the timeframe specified\n\t\tif ($response->ResponseMessages->FindItemResponseMessage->RootFolder->TotalItemsInView > 0){\n\t\t $events = $response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem;\t\n\t\t}\n\t\telse{\n\t\t\tif(empty($events)){\n\t\t\t\t$events = \"No Events Found\"; \t\n\t\t\t}\n\t\t}\n\t\t \n\t\treturn $events; //remember to use the php function urlencode on the id and changekey else it will not work when sent to other EWS functions\n\t }", "public function getEventsCreatedHere()\n {\n $options = array(\n 'calendar' => $this->shortname,\n 'created_only' => true\n );\n\n # create new events class. On constructor it will get the stuff\n $events = new Events($options);\n return $events;\n }", "private function getCalendar($calendar_obj_list, $cal_id){\n\t\t$main_cal_obj = false;\n\t\tforeach($calendar_obj_list as $cal){\n\t\t\tif($cal->getId() == $cal_id){\n\t\t\t\t$main_cal_obj = $cal;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(!is_object($main_cal_obj) && is_object($calendar_obj_list[0])){\n\t\t\t// they specified an incorrect calendar id\n\t\t\t// just use the first calendar\n\t\t\t$main_cal_obj = $calendar_obj_list[0];\n\t\t}\n\t\treturn $main_cal_obj;\n\t}", "public function calendars()\n {\n return $this->hasMany('App\\Models\\Calendar');\n }", "function findEventsByCalendar($events=array(),$calendar) {\n\t\t$output = array();\n\t\tif (!$events) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\t$x = 0;\n\t\t\tforeach ($events as $event) {\n\t\t\t\t$calendar_found = false;\n\t\t\t\tforeach ($event['Tag'] as $tag) {\n\t\t\t\t\tfor ($i=0; $i<count($tag['Calendar']); $i++) {\n\t\t\t\t\t\tif ($tag['Calendar'][$i]['shortname'] == $calendar) {\n\t\t\t\t\t\t\t$output[$x] = $event;\n\t\t\t\t\t\t\t$calendar_found = true;\n\t\t\t\t\t\t\t$x++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ($calendar_found == true) {\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\treturn $output;\n\t\t}\n\t}", "public function getCalendar()\n {\n $result = new stdClass;\n $all_calendars = $GLOBALS['calendar_manager']->get(Kronolith::ALL_CALENDARS);\n if (!isset($all_calendars[$this->vars->cal]) && !$GLOBALS['conf']['share']['hidden']) {\n $GLOBALS['notification']->push(_(\"You are not allowed to view this calendar.\"), 'horde.error');\n return $result;\n } elseif (!isset($all_calendars[$this->vars->cal])) {\n // Subscribing to a \"hidden\" share, check perms.\n $kronolith_shares = $GLOBALS['injector']->getInstance('Kronolith_Shares');\n $share = $kronolith_shares->getShare($this->vars->cal);\n if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {\n $GLOBALS['notification']->push(_(\"You are not allowed to view this calendar.\"), 'horde.error');\n return $result;\n }\n $calendar = new Kronolith_Calendar_Internal(array('share' => $share));\n } else {\n $calendar = $all_calendars[$this->vars->cal];\n }\n\n $result->calendar = $calendar->toHash();\n return $result;\n }", "public static function get_all_course_events($cid = NULL) {\r\n global $uid, $course_id;\r\n if (is_null($cid)) {\r\n $cid = $course_id;\r\n }\r\n return Database::get()->queryArray(\"SELECT id, title, content FROM personal_calendar WHERE user_id = ? AND reference_obj_course = ? \", $uid, $cid);\r\n }", "public function getCalendarInfo()\n\t{\n\t\t\n\t\t//get URL to calendar page\n\t\t$url = $this->calendarLink;\n\t\t//Get the sourcecode\t\t\t\n\t\t$data = $this->curl->curlGetReq($url);\n\t\t//find all links to each person\n\t\t$query = \"//a\";\n\t\t$aTagNodes = $this->curl-> getDOMData($data,$query);\n\t\t\n\t\t$calendarDates = new CalendarDateRepository();\n\t\t//loop through each link, representing a person\n\t\tforeach ($aTagNodes as $at)\n\t\t{\n\t\t\t//get the href to that persons calendar\n\t\t\t$calURL =$at->getAttribute(\"href\");\n\t\t\t//get the sourcecode of that page\n\t\t\t$data = $this->curl->curlGetReq($url.$calURL);\n\t\t\t//get the table header containing name of the days\n\t\t\t$query = \"//th\";\n\t\t\t$days = $this->curl->getDOMData($data,$query);\n\t\t\t//get the table data containing availability\n\t\t\t$query = \"//td\";\n\t\t\t$availibility = $this->curl->getDOMData($data,$query);\t\t\t\n\n\t\t\t$dates = array();\n\t\t\t/*\n\t\t\t* loop table data, if the availability of that day is ok\n\t\t\t* save that data.\n\t\t\t*/\n\t\t\tfor ($i=0; $i < $days->length ; $i++)\n\t\t\t{ \n\t\t\t\t$availibilityStr =$availibility[$i]->nodeValue;\n\t\n\t\t\t\tif(strtolower($availibilityStr) === \"ok\")\n\t\t\t\t{\t\n\t\t\t\t\t//$calendarDates->add($days[$i]->nodeValue);\n\t\t\t\t\t$dates[] = new Day($days[$i]->nodeValue);\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t$calendarDates->add($dates);\n\t\t\t\n\t\t }\n\t\t\n\t\treturn $calendarDates; \n\t}", "function build_feed(array $calendars, $start = \"today\", $end = \"tomorrow\") {\n $feed = array();\n foreach( $calendars as $name => $id ) {\n try { $raw_feed = fetch_feed($id, strtotime($start), strtotime($end)); }\n catch( Exception $e ) {\n $feed[$name] = array();\n continue;\n }\n\n $clean_feed = array();\n\n foreach( $raw_feed['items'] as $item ) {\n array_push($clean_feed, calendar_scrub($item));\n }\n\n usort($clean_feed, function($a, $b) {\n return strtotime($a['dateTime']['start']) - strtotime($b['dateTime']['start']);\n });\n\n $feed[$name] = $clean_feed;\n }\n\n return json_encode($feed);\n}", "public function fetchExternalEvents()\n {\n $db = \\JFactory::getDbo();\n $config = $GLOBALS['com_pbbooking_data']['config'];\n\n foreach ($GLOBALS['com_pbbooking_data']['calendars'] as $cal)\n {\n if ( isset($cal->enable_google_cal) && $cal->enable_google_cal == 1 )\n {\n // This has a google cal and should get external events.\n $service = new \\Google_Service_Calendar($this->googleClient);\n\n // Get the date range\n $dtfrom = date_create(\"now\", new \\DateTimeZone(PBBOOKING_TIMEZONE));\n $dtto = date_create(\"now\", new \\DateTimeZone(PBBOOKING_TIMEZONE))->modify('+ ' . $config->sync_future_events . 'months');\n\n $params = array(\n 'timeMin' => $dtfrom->format(DATE_ATOM),\n 'timeMax' => $dtto->format(DATE_ATOM),\n 'maxResults' => $config->google_max_results\n );\n\n $googleEvents = $service->events->listEvents(trim($cal->gcal_id),$params);\n\n // Now loop through the events\n\n //let's first of all the gcalids of the external events then I can unset the element to be left with an array\n //of events that USED to be in the goolge cal but aren't any more. Then I can just deleted.\n $cur_externals = $db->setQuery('select gcal_id from #__pbbooking_events where cal_id = ' . (int)$cal->id.' and externalevent = 1')->loadColumn();\n $real_externals = array();\n\n foreach ($googleEvents as $gEvent)\n {\n\n //first check to see if the event with that gcal_id exists\n $db_event = $db->setQuery('select * from #__pbbooking_events where gcal_id = \"'.$db->escape($gEvent->getId()).'\"')->loadObject();\n //if it exists check to see if it is \"owned\" by externalevent\n if ($db_event && isset($db_event->externalevent) && $db_event->externalevent == 1)\n {\n //if it is owned by externalevent then update in the database\n $db_event->summary = $gEvent->getSummary();\n $db_event->dtend = date_create($gEvent->getEnd()->getDateTime(),new \\DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM);\n $db_event->dtstart = date_create($gEvent->getStart()->getDateTime(),new \\DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM);\n $db->updateObject('#__pbbooking_events',$db_event,'id');\n\n $real_externals[] = $gEvent->getId();\n\n echo '<br/>External event updated succesfully';\n } \n\n //if it's not ownedby externalevent then we don't need to do anything as it's owned by pbbooking\n \n \n if (!$db_event)\n {\n //else it doesn't exist in the database so we need to create \n $new_event = array(\n 'cal_id' => $cal->id,\n 'summary' => $gEvent->getSummary(),\n 'dtend' => date_create($gEvent->getEnd()->getDateTime(),new \\DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM),\n 'dtstart' => date_create($gEvent->getStart()->getDateTime(),new \\DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM),\n 'verified' => 1,\n 'externalevent' => 1,\n 'gcal_id' => $gEvent->getId()\n );\n $db->insertObject('#__pbbooking_events',new \\JObject($new_event),'id');\n\n echo '<br/>External event created succesfully';\n }\n }\n\n $stale_externals = array_diff($cur_externals,$real_externals);\n //delete stale gcal events\n foreach ($stale_externals as $rmevent) {\n $db->setQuery('delete from #__pbbooking_events where gcal_id = \"'.$db->escape($rmevent).'\"')->execute();\n echo '<br/>External event deleted succesfully';\n }\n\n }\n }\n \n }", "public function test_getAllCalendars() {\n// \t\t$user = TestingUtil::getTestAdminUser();\n// \t\t$userApp = new UserApp();\n// \t\t$userApp->initializeForAppID($user, 5);\n// \t\t$outlookClient = new OutlookClient($user, $userApp);\n// \t\t$outlookCalendar = new OutlookCalendar($outlookClient);\n// \t\t$calendars = $outlookCalendar->getAllCalendars();\n// \t\t$this->assertCount(3, $calendars);\n\t\t$this->assertEquals(1,1);\n\t}", "public static function getEvents($calendars, $companyId, $employeeId, $start, $end) {\n\n $sql = \" SELECT event.id, event.name,event.start_datetime,event.end_datetime,event.color,is_all_day \"\n . \" FROM event \"\n . \" INNER JOIN calendar\t\"\n . \" ON event.calendar_id= calendar.id \"\n . \" AND calendar.company_id={$companyId} \"\n . \" AND calendar.disabled=\" . self::STATUS_ENABLE\n . \" WHERE ( \"\n . \" event.is_public=1 \"\n . \" OR event.created_employee_id={$employeeId}\t \"\n . \" OR (EXISTS( \"\n . \" SELECT * \"\n . \" FROM invitation \"\n . \" WHERE invitation.event_id= event.id \"\n . \" AND invitation.owner_id={$employeeId} \"\n . \" AND invitation.owner_table='employee' \"\n . \" AND invitation.company_id={$companyId} \"\n . \" AND invitation.disabled=\" . self::STATUS_ENABLE\n . \" ) \"\n . \" ) \"\n . \" OR(EXISTS( \"\n . \" SELECT * \"\n . \" FROM invitation \"\n . \" INNER JOIN department \"\n . \" ON invitation.owner_id=department.id \"\n . \" AND invitation.owner_table='department' \"\n . \" AND department.company_id={$companyId} \"\n . \" AND department.disabled=\" . self::STATUS_ENABLE\n . \" INNER JOIN employee \"\n . \" ON department.id=employee.department_id \"\n . \" AND employee.company_id={$companyId} \"\n . \" AND employee.id={$employeeId} \"\n . \" AND employee.disabled=\" . self::STATUS_ENABLE\n . \" WHERE invitation.event_id=event.id \"\n . \" AND invitation.company_id={$companyId} \"\n . \" AND invitation.disabled=\" . self::STATUS_ENABLE\n . \" ) \"\n . \" ) \"\n . \" ) \"\n . \" AND event.end_datetime <= \" . strtotime($end . \" 23:59:59\")\n . \" AND event.start_datetime >= \" . strtotime($start . \" 00:00:00\")\n . \" AND event.company_id={$companyId} \"\n . \" AND event.disabled=\" . self::STATUS_ENABLE;\n\n if (!empty($calendars)) {\n $sql .= \" AND event.calendar_id IN (\" . implode(',', $calendars) . \") \";\n $command = \\Yii::$app->getDb()->createCommand($sql);\n return $command->queryAll();\n }\n \n return [];\n }", "function getCalendarObject($calendarId, $objectUri) {\n\n $this->mylog(' getCalendarObject '.$calendarId, $objectUri);\n\n $this->base->set_timestamp_return_format('U');\n $evt = $this->base->events_event_get($this->auth->token, $objectUri);\n $calendardata = $this->getCalendarData($evt);\n $ret = [\n\t 'id' => $evt['eve_id'],\n\t 'uri' => $evt['eve_id'].'.ics',\n\t 'lastmodified' => $evt['eve_date_modification'],\n\t 'etag' => '\"' . md5($calendardata) . '\"',\n\t 'calendarid' => $calendarId,\n\t 'size' => (int)strlen($calendardata),\n\t 'calendardata' => $calendardata,\n\t 'component' => 'vevent'\n\t ];\n // $this->mylog(print_r($ret, true));\n // file_put_contents('/tmp/calendarobject-'.$evt['eve_id'].'.txt', $ret);\n return $ret;\n }", "function get_event_xml(){\n// $xml = simplexml_load_file($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/calendar-categories.xml\");\n $xml = autoCache(\"simplexml_load_file\", array($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/calendar-categories.xml\"));\n $categories = array();\n $xml = $xml->{'system-page'};\n foreach ($xml->children() as $child) {\n if($child->getName() == \"dynamic-metadata\"){\n foreach($child->children() as $metadata){\n if($metadata->getName() == \"value\"){\n array_push($categories, (string)$metadata);\n }\n }\n }\n }\n// $xml = simplexml_load_file($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/events.xml\");\n $xml = autoCache(\"simplexml_load_file\", array($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/events.xml\"));\n $event_pages = $xml->xpath(\"//system-page[system-data-structure[@definition-path='Event']]\");\n $dates = array();\n $datePaths = array();\n foreach($event_pages as $child ){\n $page_data = inspect_page($child, $categories);\n if (!$page_data[\"hide-from-calendar\"]){\n $dates = add_event_to_array($dates, $page_data, $datePaths);\n }\n }\n return $dates;\n}", "Public function getEvents()\n\t{\n\t\t$result=$this->M_calendar->getEvents();\n\t\techo json_encode($result);\n\t}" ]
[ "0.6850148", "0.66243887", "0.6605277", "0.60973716", "0.599606", "0.5961908", "0.5959493", "0.5886915", "0.58813703", "0.58649564", "0.5777857", "0.5770414", "0.56889725", "0.5660429", "0.5658748", "0.56363565", "0.56211215", "0.55728775", "0.55705047", "0.5560506", "0.55298173", "0.5526086", "0.5508226", "0.5494993", "0.5451027", "0.54429996", "0.54381835", "0.540996", "0.5402905", "0.53980696" ]
0.70425195
0
The getChanges method returns all the changes that have happened, since the specified syncToken in the specified calendar. This function should return an array, such as the following: [ 'syncToken' => 'The current synctoken', 'added' => [ 'new.txt', ], 'modified' => [ 'modified.txt', ], 'deleted' => [ 'foo.php.bak', 'old.txt' ] ];
public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null) { \GO::debug("getChangesForCalendar($calendarId,$syncToken)"); // Current synctoken $calendar = GO\Calendar\Model\Calendar::model()->findByPk($calendarId); $currentToken = $calendar->version; if($calendar->tasklist_id) { $tasklist = \GO\Tasks\Model\Tasklist::model()->findByPk($calendar->tasklist_id); if($tasklist) { $currentToken += $tasklist->version; } } if (is_null($currentToken)) return null; $result = [ 'syncToken' => $currentToken, 'added' => [], 'modified' => [], 'deleted' => [], ]; if ($syncToken) { $findParams = FindParams::newInstance() ->select('uri, operation') ->criteria(FindCriteria::newInstance() ->addCondition('synctoken', $syncToken, '>=') ->addCondition('synctoken', $currentToken, '<') ->addCondition('calendarid', $calendarId, '>=') ) ->order('synctoken'); if ($limit > 0) { $findParams->limit((int) $limit); } $stmt = CalendarChange::model()->find($findParams); $changes = []; // This loop ensures that any duplicates are overwritten, only the // last change on a node is relevant. while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { $changes[$row['uri']] = $row['operation']; } foreach ($changes as $uri => $operation) { switch ($operation) { case 1 : $result['added'][] = $uri; break; case 2 : $result['modified'][] = $uri; break; case 3 : $result['deleted'][] = $uri; break; } } } else { // No synctoken supplied, this is the initial sync. $joinCriteria = FindCriteria::newInstance() ->addRawCondition('t.id', 'e.id'); $findParams = FindParams::newInstance() ->select('uri') ->join(GO\Calendar\Model\Event::model()->tableName(), $joinCriteria, 'e') ->criteria( FindCriteria::newInstance()->addCondition('calendar_id', $calendarId, '=', 'e') ); $stmt = DavEvent::model()->find($findParams); $result['added'] = $stmt->fetchAll(\PDO::FETCH_COLUMN); if($calendar->tasklist_id>0) { $joinCriteria = FindCriteria::newInstance() ->addRawCondition('t.id', 'e.id'); $findParams = FindParams::newInstance() ->select('uri') ->join(GO\Tasks\Model\Task::model()->tableName(), $joinCriteria, 'e') ->criteria( FindCriteria::newInstance()->addCondition('tasklist_id', $calendar->tasklist_id, '=', 'e') ); $stmt = DavTask::model()->find($findParams); $result['added'] = array_merge($result['added'], $stmt->fetchAll(\PDO::FETCH_COLUMN)); } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getChanges();", "public function getChanges();", "public function getChangedEntries();", "public function getChanges()\n {\n $this->conn->initialize();\n $response = $this->conn->getClient()->request(\"/{$this->name}/_changes\");\n\n if (false === $response->isSuccessful()) {\n throw new \\RuntimeException('Request wasn\\'t successfull');\n }\n\n return JSONEncoder::decode($response->getContent());\n }", "public function getChanges($getValues = false) {\n\t\tif($getValues === 2) {\n\t\t\t$changes = array();\n\t\t\tforeach($this->changes as $name => $value) {\n\t\t\t\tif($value) {} // value ignored\n\t\t\t\t$changes[$name] = $name;\n\t\t\t}\n\t\t\treturn $changes;\n\t\t} else if($getValues) {\n\t\t\treturn $this->changes;\n\t\t} else {\n\t\t\treturn array_keys($this->changes);\n\t\t}\n\t}", "public function getChanges($localPath = '', $synced = '', $localDir = '', &$localRenames, $connections)\n\t{\n\t\t//Stub for compatibility\n\t\treturn array();\n\t}", "protected function getOrderChanges()\n {\n $changes = array();\n\n foreach (static::$changes as $key => $data) {\n $names = explode(':', $key, 2);\n\n $name = static::getFieldHumanReadableName($names[0]);\n $subname = isset($names[1]) ? $names[1] : null;\n\n if ($subname) {\n $subname = static::getFieldHumanReadableName($subname);\n $changes[$name][$subname] = $data;\n\n } else {\n $changes[$name] = $data;\n }\n }\n\n return $changes;\n }", "public function getChanges(): ?array {\n $val = $this->getBackingStore()->get('changes');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, WorkbookDocumentTaskChange::class);\n /** @var array<WorkbookDocumentTaskChange>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'changes'\");\n }", "public function getDataChangesList() {\n return DataChangeRecord::get()->filter([\n 'ChangeRecordID' => $this->owner->ID,\n 'ChangeRecordClass' => $this->owner->ClassName\n ]);\n }", "public function getChanges(array $options = array())\n {\n if (!empty($this->_collection['id'])) {\n // How far back to sync for those collections that use this.\n $cutoffdate = self::_getCutOffDate(!empty($this->_collection['filtertype'])\n ? $this->_collection['filtertype']\n : 0);\n\n $this->_logger->meta(sprintf(\n 'STATE: Initializing message diff engine for %s (%s)',\n $this->_collection['id'],\n $this->_folder->serverid())\n );\n\n // Check for previously found changes first.\n if (!empty($this->_changes)) {\n $this->_logger->meta('STATE: Returning previously found changes.');\n return $this->_changes;\n }\n\n // Get the current syncStamp from the backend.\n $this->_thisSyncStamp = $this->_backend->getSyncStamp(\n $this->_folder->serverid(),\n $this->_lastSyncStamp\n );\n\n if ($this->_thisSyncStamp === false) {\n throw new Horde_ActiveSync_Exception_StaleState(\n 'Detecting a change in timestamp or modification sequence. Reseting state.'\n );\n }\n\n $this->_logger->meta(sprintf(\n 'STATE: Using SYNCSTAMP %s for %s.',\n $this->_thisSyncStamp,\n $this->_collection['id'])\n );\n\n // No existing changes, poll the backend\n $changes = $this->_backend->getServerChanges(\n $this->_folder,\n (int)$this->_lastSyncStamp,\n (int)$this->_thisSyncStamp,\n $cutoffdate,\n !empty($options['ping']),\n $this->_folder->haveInitialSync,\n !empty($options['maxitems']) ? $options['maxitems'] : 100,\n !empty($this->_collection['forcerefresh'])\n );\n\n // Only update the folderstate if we are not PINGing.\n if (empty($options['ping'])) {\n $this->_folder->updateState();\n }\n\n $this->_logger->meta(sprintf(\n 'STATE: Found %d message changes in %s.',\n count($changes),\n $this->_collection['id'])\n );\n\n // Check for mirrored client changes.\n $this->_changes = array();\n if (count($changes) && $this->_havePIMChanges()) {\n $this->_logger->meta('STATE: Checking for client initiated changes.');\n switch ($this->_collection['class']) {\n case Horde_ActiveSync::CLASS_EMAIL:\n // @todo Fix me with a changes object that transparently\n // deals with different data structure for initial sync.\n if (!empty($changes) && !is_array($changes[0])) {\n $this->_changes = $changes;\n break;\n }\n\n // Map of client-sourced changes\n $mailmap = $this->_getMailMapChanges($changes);\n\n // Map constants to more human readable/loggable text.\n $flag_map = array(\n Horde_ActiveSync::CHANGE_TYPE_FLAGS => 'flag change',\n Horde_ActiveSync::CHANGE_TYPE_DELETE => 'deletion',\n Horde_ActiveSync::CHANGE_TYPE_CHANGE => 'move',\n Horde_ActiveSync::CHANGE_TYPE_DRAFT => 'draft'\n );\n\n $cnt = count($changes);\n for ($i = 0; $i < $cnt; $i++) {\n if (empty($mailmap[$changes[$i]['id']][$changes[$i]['type']])) {\n $this->_changes[] = $changes[$i];\n continue;\n }\n // @todo For 3.0, create a Changes and\n // ChangeFilter classes to abstract out a bunch of\n // this stuff. (Needs BC breaking changes in\n // storage/state classes).\n\n // OL2013 is broken and duplicates the destination\n // email during MOVEITEMS requests (instead it\n // reassigns the existing email the new UID). Don't\n // send the ADD command for these changes.\n if ($changes[$i]['type'] == Horde_ActiveSync::CHANGE_TYPE_CHANGE &&\n $changes[$i]['flags'] == Horde_ActiveSync::FLAG_NEWMESSAGE &&\n $this->_deviceInfo->deviceType != 'WindowsOutlook15') {\n $this->_changes[] = $changes[$i];\n continue;\n }\n $changes[$i]['ignore'] = true;\n $this->_changes[] = $changes[$i];\n $this->_logger->meta(sprintf(\n 'STATE: Ignoring client initiated %s for %s',\n $flag_map[$changes[$i]['type']],\n $changes[$i]['id'])\n );\n }\n break;\n\n default:\n $client_timestamps = $this->_getPIMChangeTS($changes);\n $cnt = count($changes);\n for ($i = 0; $i < $cnt; $i++) {\n if (empty($client_timestamps[$changes[$i]['id']])) {\n $this->_changes[] = $changes[$i];\n continue;\n }\n if ($changes[$i]['type'] == Horde_ActiveSync::CHANGE_TYPE_DELETE) {\n // If we have a delete, don't bother stating the message,\n // the entry should already be deleted on the client.\n $stat['mod'] = 0;\n } else {\n // stat only returns MODIFY times, not deletion times,\n // so will return (int)0 for ADD or DELETE.\n $stat = $this->_backend->statMessage($this->_folder->serverid(), $changes[$i]['id']);\n }\n if ($client_timestamps[$changes[$i]['id']] >= $stat['mod']) {\n $this->_logger->meta(sprintf(\n 'STATE: Ignoring client initiated change for %s (client TS: %s Stat TS: %s)',\n $changes[$i]['id'], $client_timestamps[$changes[$i]['id']], $stat['mod'])\n );\n } else {\n $this->_changes[] = $changes[$i];\n }\n }\n }\n } elseif (count($changes)) {\n $this->_logger->meta('STATE: No client changes, returning all messages.');\n $this->_changes = $changes;\n }\n } else {\n // FOLDERSYNC changes.\n $this->_getFolderChanges();\n }\n\n return $this->_changes;\n }", "public function get_cozlesson_changes(Request $request) {\n if ($request->has('lesson_ids'))\n $data = $this->cozLessonChanges_model->get_cozlesson_changes($request, $request->input('lesson_ids'));\n\n return $data;\n }", "public function getCalendarSync()\n {\n return $this->calendarSync;\n }", "public static function getSyncList()\n {\n $fileList = array();\n $project = EcrProjectHelper::getProject();\n $syncList = self::readSyncList();\n\n if(false === $syncList)\n throw new Exception(jgettext('No synchronization list found - Please synchronize with your remote'));\n\n $allCopies = array();\n\n foreach($project->copies as $copy)\n {\n $files = JFolder::files($copy, '.', true, true);\n\n $allCopies = array_merge($files, $allCopies);\n\n foreach($files as $file)\n {\n $fShort = str_replace(JPATH_ROOT.'/', '', $file);\n\n //-- File does not exist\n if( ! array_key_exists($fShort, $syncList))\n {\n $f = new stdClass;\n $f->path = $fShort;\n $f->status = 'new';\n\n $fileList[$fShort] = $f;\n }\n else\n {\n $f = $syncList[$fShort];\n\n //-- File size is different\n if($f->size != filesize($file))\n {\n $f->status = 'changed';\n\n $fileList[$fShort] = $f;\n }\n }\n }\n }\n\n foreach($syncList as $item)\n {\n if( ! in_array(JPATH_ROOT.'/'.$item->path, $allCopies))\n {\n $f = new stdClass;\n $f->path = $item->path;\n $f->status = 'deleted';\n\n $fileList[$item->path] = $f;\n }\n }\n\n ksort($fileList);\n\n return $fileList;\n }", "public function getAllByTask($task_id){\n $changes = $this->find('all', array(\n 'conditions'=>array(\n 'Change.task_id'=>$task_id),\n 'order'=>array(\n 'Change.created DESC')));\n return $changes; \n }", "public function changes()\r\n\t{\r\n\t\t$Change = App::make('Change');\r\n\r\n\t\treturn $Change::where('fmodel', 'GalleryItem')\r\n\t\t\t\t \t ->where('fid', $this->id)\r\n\t\t\t\t \t ->with('user')\r\n\t\t\t\t \t ->orderBy('created_at', 'DESC')\r\n\t\t\t\t \t ->get();\r\n\t}", "public function getChangeset(): array\n\t{\n\t\t$changes = [];\n\n\t\tforeach ($this->getNonMetadataFields() as $key => $value) {\n\t\t\tif (! isset($this->initialFieldValues[$key]) || $value !== $this->initialFieldValues[$key]) {\n\t\t\t\t$changes[$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $changes;\n\t}", "function get_changes($path, $to, $from = null) {\n $changes = [];\n $currentPath = getcwd();\n chdir($path);\n\n if ($from == null) {\n $shellOutput = shell_exec('git log --pretty=oneline ' . $to);\n } else {\n $shellOutput = shell_exec('git log --pretty=oneline ' . $from . '...' . $to);\n }\n\n $lines = preg_split('/\\R/', trim($shellOutput));\n foreach ($lines as $line) {\n if (null != $line) {\n $changes[substr($line, 0, 40)] = trim(substr($line, 40, strlen($line)));\n } else {\n echo 'Could not get changes of repository ' . $path . PHP_EOL;\n }\n }\n\n chdir($currentPath);\n\n return $changes;\n}", "public function detectChanges()\n {\n return [];\n }", "public function ChangesSink($timeout = 30) {\n $notifications = array();\n $stopat = time() + $timeout - 1;\n\n //We can get here and the ChangesSink not be initialized yet\n if (!$this->changessinkinit) {\n ZLog::Write(LOGLEVEL_DEBUG, sprintf(\"BackendCalDAV->ChangesSink - Not initialized ChangesSink, sleep and exit\"));\n // We sleep and do nothing else\n sleep($timeout);\n return $notifications;\n }\n\n // only check once to reduce pressure in the DAV server\n foreach ($this->sinkdata as $k => $v) {\n $changed = false;\n\n $url = $this->_caldav_path . substr($k, 1) . \"/\";\n $response = $this->_caldav->GetSync($url, false, CALDAV_SUPPORTS_SYNC);\n\n if (CALDAV_SUPPORTS_SYNC) {\n if (count($response) > 0) {\n $changed = true;\n ZLog::Write(LOGLEVEL_DEBUG, sprintf(\"BackendCalDAV->ChangesSink - Changes detected\"));\n }\n }\n else {\n // If the numbers of events are different, we know for sure, there are changes\n if (count($response) != count($v)) {\n $changed = true;\n ZLog::Write(LOGLEVEL_DEBUG, sprintf(\"BackendCalDAV->ChangesSink - Changes detected\"));\n }\n else {\n // If the numbers of events are equals, we compare the biggest date\n // FIXME: we are comparing strings no dates\n if (!isset($this->sinkmax[$k])) {\n $this->sinkmax[$k] = '';\n for ($i = 0; $i < count($v); $i++) {\n if ($v[$i]['getlastmodified'] > $this->sinkmax[$k]) {\n $this->sinkmax[$k] = $v[$i]['getlastmodified'];\n }\n }\n }\n\n for ($i = 0; $i < count($response); $i++) {\n if ($response[$i]['getlastmodified'] > $this->sinkmax[$k]) {\n $changed = true;\n }\n }\n\n if ($changed) {\n ZLog::Write(LOGLEVEL_DEBUG, sprintf(\"BackendCalDAV->ChangesSink - Changes detected\"));\n }\n }\n }\n\n if ($changed) {\n $notifications[] = $k;\n }\n }\n\n // Wait to timeout\n if (empty($notifications)) {\n while ($stopat > time()) {\n sleep(1);\n }\n }\n\n return $notifications;\n }", "public function getControlListchanges($risk_id) \n\t{\n\t\t$sql = \"select a.*\n\t\t\t\tfrom t_risk_control_change a\n\t\t\t\twhere a.risk_id = ? and switch_flag='P' \";\n\t\t$par = array('uid' => $risk_id);\n\t\t\n\t\t$query = $this->db->query($sql, $par);\n\t\t$res = array();\n\t\tforeach($query->result_array() as $row) {\n\t\t\t$res[] = $row;\n\t\t}\n\t\t\n\t\treturn $res;\n\t}", "public function calculateChangeSet()\n {\n $set = [];\n foreach ($this->current as $key => $current) {\n $original = isset($this->original[$key]) ? $this->original[$key] : null;\n $set[$key]['old'] = $original;\n $set[$key]['new'] = $current;\n }\n foreach ($this->remove as $key) {\n $set[$key]['old'] = $this->original[$key];\n $set[$key]['new'] = null;\n }\n ksort($set);\n return $set;\n }", "public function getRevisions(): array;", "private function getChangeArr(\\SimpleXMLElement $xml) {\n\t\t\t$files\t\t = array(\n\t\t\t\t'deleted'\t=> array(),\n\t\t\t\t'changed'\t=> array(),\n\t\t\t\t'other'\t\t=> array()\n\t\t\t);\n\n\t\t\tforeach($xml->paths->path as $file) {\n\t\t\t\t// extract file path\n\t\t\t\t$svnPath\t= $file->__toString();\n\t\t\t\t$path\t\t= $this->getPathWithoutSVNUrl($svnPath);\n\t\t\t\t$tempPath\t= $this->getTempPathForFile($path);\n\n\t\t\t\t// get the current type\n\t\t\t\t$type = (string) $file['item'];\n\n\t\t\t\t// if path is in ignore list, or the repository itself ignore them\n\t\t\t\tif($this->isInIgnoreList($path)\n\t\t\t\t\t|| $file == rtrim($this->getRepositoryUrl(), DS)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// file info to reduce replaces in other classe\n\t\t\t\t$fileInfo = array(\n\t\t\t\t\t'tempPath'\t=> $tempPath,\n\t\t\t\t\t'path'\t\t=> $path,\n\t\t\t\t\t'svnPath'\t=> $svnPath\n\t\t\t\t);\n\n\t\t\t\tswitch($type) {\n\t\t\t\t\tcase 'modified':\n\t\t\t\t\tcase 'added':\t\t// file to upload\n\t\t\t\t\t\t// set array key to have every file only once\n\t\t\t\t\t\t$files['changed'][$path] = $fileInfo;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'deleted':\t\t// file to delete\n\t\t\t\t\t\t// set array key to have every file only once\n\t\t\t\t\t\t$files['deleted'][$path] = $fileInfo;\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\t\t\t// files where the svn properties changed\n\t\t\t\t\t\t$files['other'][$path] = $fileInfo;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $files;\n\t\t}", "public function getDocumentChangeSet($document)\n {\n $oid = spl_object_hash($document);\n if (isset($this->documentChangeSets[$oid])) {\n return $this->documentChangeSets[$oid];\n }\n return array();\n }", "public function getChanges(array $context, $new)\n {\n $output = array();\n\n foreach ($this->_fields as $key => $field) {\n if ($field instanceof FieldInterface) {\n $changes = $field->getDataModelDependyChanges($context, $new);\n\n if ($changes) {\n $output[$field->getFieldKey()] = $changes;\n }\n }\n }\n\n return $output;\n }", "public function getChangedFiles( $baseDir, $from, $to )\r\n {\r\n $patchFile = 'patch-' . str_random( 8 ) . '.tmp';\r\n\r\n if ( file_exists( $patchFile ) )\r\n {\r\n unlink( $patchFile );\r\n }\r\n\r\n $baseDir = str_replace( '/', DIRECTORY_SEPARATOR, trim( $baseDir ) );\r\n\r\n if ( DIRECTORY_SEPARATOR !== $baseDir[ strlen( $baseDir ) - 1 ] )\r\n {\r\n $baseDir .= DIRECTORY_SEPARATOR;\r\n }\r\n\r\n try\r\n {\r\n $result = [ 'added' => [ ], 'modified' => [ ], 'deleted' => [ ] ];\r\n\r\n $cmd = 'git diff --name-status --patch';\r\n\r\n $cmd = $cmd . \" $from $to\";\r\n $cmd = $cmd . ' > ' . $patchFile;\r\n $out = [ ];\r\n $ret = NULL;\r\n\r\n exec( $cmd, $out, $ret );\r\n\r\n $output = file_get_contents( $patchFile );\r\n\r\n $files = explode( \"\\n\", $output );\r\n\r\n foreach ( $files as $file )\r\n {\r\n if ( 0 === strlen( trim( $file ) ) )\r\n {\r\n continue;\r\n }\r\n\r\n list( $type, $path ) = explode( \"\\t\", $file );\r\n\r\n switch ( trim( $type ) )\r\n {\r\n case 'A':\r\n $result[ 'added' ][] = str_replace( '/', DIRECTORY_SEPARATOR, $baseDir . $path );\r\n break;\r\n case 'M':\r\n $result[ 'modified' ][] = str_replace( '/', DIRECTORY_SEPARATOR, $baseDir . $path );\r\n break;\r\n case 'D':\r\n $result[ 'deleted' ][] = str_replace( '/', DIRECTORY_SEPARATOR, $baseDir . $path );\r\n break;\r\n case 'C':\r\n case 'R':\r\n list( $from, $to ) = explode( \"\\t\", $path );\r\n $result[ 'deleted' ][] = str_replace( '/', DIRECTORY_SEPARATOR, $baseDir . $from );\r\n $result[ 'added' ][] = str_replace( '/', DIRECTORY_SEPARATOR, $baseDir . $to );\r\n break;\r\n default:\r\n syslog( LOG_ALERT, 'Unknown Value - Type: ' . $type . ' - Path: ' . $path );\r\n break;\r\n }\r\n }\r\n\r\n if ( file_exists( $patchFile ) )\r\n {\r\n unlink( $patchFile );\r\n }\r\n\r\n return $result;\r\n }\r\n catch ( Exception $e )\r\n {\r\n echo $e->getMessage() . PHP_EOL;\r\n\r\n if ( file_exists( $patchFile ) )\r\n {\r\n unlink( $patchFile );\r\n }\r\n }\r\n\r\n return NULL;\r\n }", "public function getChanges(): array\n {\n $changes = [];\n\n foreach ($this->changedAttributesName() as $key) {\n $changes[$key] = $this->originals[$key];\n }\n\n return $changes;\n }", "public function getChangedFields()\n {\n\n $fields = [];\n\n if ($this->synchronized || !static::$track) {\n return $fields;\n }\n\n foreach ($this->savedData as $key => $value) {\n\n if ($value != $this->data[$key]) {\n $fields[] = $key;\n }\n }\n\n return $fields;\n\n }", "private static function getChanges(CronJob $job)\n {\n $changes = $job->getDirty();\n $oldNew = [];\n\n foreach ($changes as $attr => $change) {\n $oldNew[$attr] = [\n 'old' => $job->getOriginal($attr),\n 'new' => self::formatAttribute($job, $attr),\n ];\n }\n\n return $oldNew;\n }", "protected function getChangedRemoteObjects()\n {\n $query = $this->getRemoteObjectsQuery();\n $table = $this->getRemoteBaseTable();\n $query->addWhere(\"\\\"{$table}\\\".\\\"_ImportedID\\\" > 0\");\n $query->addWhereAny(array(\n \"\\\"{$table}\\\".\\\"_ImportedDate\\\" IS NULL\",\n \"\\\"{$table}\\\".\\\"_ImportedDate\\\" < \\\"{$table}\\\".\\\"LastEdited\\\"\"\n ));\n $items = iterator_to_array($this->task->query($query));\n return new ArrayList($items);\n }" ]
[ "0.66692466", "0.66692466", "0.6117554", "0.59589154", "0.5900768", "0.5793931", "0.55515593", "0.5520223", "0.5491338", "0.5489072", "0.54851055", "0.543287", "0.5409003", "0.5372565", "0.5359157", "0.5355645", "0.5341408", "0.5274084", "0.5220829", "0.5167407", "0.51571125", "0.5148636", "0.5142191", "0.51343805", "0.5129027", "0.5097991", "0.5097729", "0.5096755", "0.5090134", "0.5066681" ]
0.76397246
0
Validate the form for copying/moving a tree entry
function mm_ui_content_copymove_validate($form, &$form_state, $restore = FALSE) { _mm_ui_content_copymove_get_values($form_state['values'], $src_mmtid, $modes, $src_parent_mmtid, $dest_mmtid); $nodes_only = $modes['move_nodes'] || $modes['copy_nodes'] && !$modes['copy_page']; if ($modes['copy_page'] || $modes['move_page']) { mm_ui_validate_fake_required($form['name_alias']['name'], trim($form_state['values']['name'])); mm_ui_validate_fake_required($form['name_alias']['alias'], trim($form_state['values']['alias'])); } if (!$src_mmtid || !is_numeric($src_mmtid)) { form_set_error('', t('Missing one or more required fields')); return; } $x = mm_ui_strings(mm_content_is_group($src_mmtid)); if ($modes['move_page'] && !mm_content_user_can($src_mmtid, 'w')) $message = t('You do not have permission to modify this @thing.', $x); if ($modes['move_page'] && !$restore && !mm_content_user_can($src_parent_mmtid, 'a')) $message = t('You do not have permission to modify the source @thingpos parent.', $x); if (!is_numeric($dest_mmtid) || !mm_content_user_can($dest_mmtid, $nodes_only ? 'u' : 'a')) $message = t('You do not have permission to modify the destination @thing.', $x); if (mm_content_is_normal($src_mmtid) != mm_content_is_normal($dest_mmtid) || mm_content_is_group($src_mmtid) != mm_content_is_group($dest_mmtid)) $message = t('Source and destination are not of the same type.'); if (mm_content_user_can($dest_mmtid, 'IS_RECYCLED')) if ($modes['copy_nodes'] || $modes['copy_page']) { $message = 'You cannot copy to a recycle bin.'; } else { $message = 'You cannot move to a recycle bin using this option. Please use the Delete option, instead.'; } if ($message) { watchdog('mm', $message, array(), WATCHDOG_WARNING, "source: $src_mmtid, dest: $dest_mmtid"); form_set_error('', t($message)); return; } if (mm_content_is_vgroup($src_mmtid) != mm_content_is_vgroup($dest_mmtid)) { form_set_error('dest', mm_content_is_vgroup($src_mmtid) ? t('Pre-defined groups can only be moved to create sub-groups of other pre-defined groups.') : t('You cannot copy/move a regular group inside the pre-defined groups list.')); } if (!$nodes_only && !_mm_ui_validate_entry($src_mmtid, $dest_mmtid, $form_state['values'], TRUE, TRUE)) { return; } if ($dest_mmtid == $src_parent_mmtid && $modes['move_page']) { form_set_error('', t('Instead of moving a @thing within the same parent @thing, rename it using Settings-&gt;Edit.', $x)); } else if ($dest_mmtid == $src_mmtid && $nodes_only && $modes['move_nodes']) { form_set_error('', t('Moving just a @thingpos contents to itself results in no change.', $x)); } else if ($dest_mmtid == $src_mmtid && !$modes['move_nodes'] && ($modes['move_page'] || $modes['copy_recur'])) { form_set_error('', t('You cannot copy or move a @thing within itself.', $x)); } else if (mm_content_is_child($dest_mmtid, $src_mmtid)) { if ($modes['move_page']) { form_set_error('dest', t('You cannot move a @thing into a @subthing of itself. Please choose another destination.', $x)); } else if ($modes['copy_recur']) { form_set_error('dest', t('You cannot copy a @thing and any @subthings into a child of itself. Please choose another destination.', $x)); } } else if ($modes['move_nodes'] && mm_content_is_archive($dest_mmtid)) { form_set_error('dest', t('You cannot move content into an archive. Move the content into the main @thing, instead, and the archive will be updated automatically.', $x)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validator()\n {\n if (!$this->getElement(self::PARENT_ID_KEY)->getValue() && !$this->skinsetModel->getTemplateConfigByKey($this->getRecord()->template)->getAllowedOnRoot()) {\n $this->getElement(self::PARENT_ID_KEY)->addError('form.categoryMove.parentId.error');\n return false;\n }\n return true;\n }", "function validate() {\n\t\timport('lib.pkp.classes.navigationMenu.NavigationMenuItem');\n\t\tif ($this->getData('menuItemType') && $this->getData('menuItemType') != \"\") {\n\t\t\tif ($this->getData('menuItemType') == NMI_TYPE_CUSTOM) {\n\t\t\t\tif (!preg_match('/^[a-zA-Z0-9\\/._-]+$/', $this->getData('path'))) {\n\t\t\t\t\t$this->addError('path', __('manager.navigationMenus.form.pathRegEx'));\n\t\t\t\t}\n\n\t\t\t\t$navigationMenuItemDao = DAORegistry::getDAO('NavigationMenuItemDAO');\n\n\t\t\t\t$navigationMenuItem = $navigationMenuItemDao->getByPath($this->_contextId, $this->getData('path'));\n\t\t\t\tif (isset($navigationMenuItem) && $navigationMenuItem->getId() != $this->navigationMenuItemId) {\n\t\t\t\t\t$this->addError('path', __('manager.navigationMenus.form.duplicatePath'));\n\t\t\t\t}\n\t\t\t} elseif ($this->getData('menuItemType') == NMI_TYPE_REMOTE_URL) {\n\t\t\t\tif(!filter_var($this->getData('url'), FILTER_VALIDATE_URL)) {\n\t\t\t\t\t$this->addError('url', __('manager.navigationMenus.form.customUrlError'));\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$this->addError('path', __('manager.navigationMenus.form.typeMissing'));\n\t\t}\n\n\t\treturn parent::validate();\n\t}", "function path_admin_form_validate($form, &$form_state) {\n $src = $form_state['values']['src'];\n $dst = $form_state['values']['dst'];\n $pid = isset($form_state['values']['pid']) ? $form_state['values']['pid'] : 0;\n // Language is only set if locale module is enabled, otherwise save for all languages.\n $language = isset($form_state['values']['language']) ? $form_state['values']['language'] : '';\n\n if (db_result(db_query(\"SELECT COUNT(dst) FROM {url_alias} WHERE pid != %d AND dst = '%s' AND language = '%s'\", $pid, $dst, $language))) {\n form_set_error('dst', t('The alias %alias is already in use in this language.', array('%alias' => $dst)));\n }\n $item = menu_get_item($src);\n if (!$item || !$item['access']) {\n form_set_error('src', t(\"The path '@link_path' is either invalid or you do not have access to it.\", array('@link_path' => $src)));\n }\n}", "public function validate()\n {\n $this->validateNode($this->tree);\n }", "function mm_ui_content_copymove_submit($form, &$form_state, $restore = FALSE) {\n global $user;\n\n _mm_ui_content_copymove_get_values($form_state['values'], $src_mmtid, $modes, $src_parent_mmtid, $dest_mmtid);\n\n $name = trim($form_state['values']['name']);\n $alias = trim($form_state['values']['alias']);\n $x = mm_ui_strings(mm_content_is_group($src_mmtid));\n\n if ($modes['copy_page'] || $modes['copy_nodes']) {\n if ($modes['copy_page'] && $modes['copy_nodes']) {\n $msg = $modes['copy_recur'] ?\n t('The @thing, any @subthings, and their contents were successfully copied.', $x) :\n t('The @thing and its contents were successfully copied.', $x);\n }\n else if ($modes['copy_nodes']) {\n $msg = t('The @thingpos contents were successfully copied.', $x);\n }\n else {\n $msg = $modes['copy_recur'] ?\n t('The @thing and any @subthings were successfully copied.', $x) :\n t('The @thing was successfully copied.', $x);\n }\n\n $copy_params = array(\n MM_COPY_ALIAS => $alias,\n MM_COPY_CONTENTS => $modes['copy_nodes'],\n MM_COPY_NAME => $name,\n MM_COPY_OWNER => $user->uid,\n MM_COPY_READABLE => TRUE,\n MM_COPY_RECUR => $modes['copy_recur'],\n MM_COPY_TREE => $modes['copy_page'],\n );\n $new_mmtid = mm_content_copy($src_mmtid, $dest_mmtid, $copy_params);\n\n if (is_numeric($new_mmtid)) {\n if ($new_mmtid != $src_mmtid) $msg .= ' ' . t('You are now viewing the destination.');\n drupal_set_message($msg);\n $form_state['redirect'] = mm_content_get_mmtid_url($new_mmtid);\n }\n else {\n form_set_error('', $new_mmtid);\n }\n }\n else if ($modes['move_page']) {\n $old_tree = mm_content_get($src_mmtid);\n $error = mm_content_move($src_mmtid, $dest_mmtid, $restore ? 'restore' : '');\n\n if (!$error) {\n if ($name != $old_tree->name || $alias != $old_tree->alias) {\n mm_content_update_quick(array('name' => $name, 'alias' => $alias), array('mmtid' => $src_mmtid), $dest_mmtid);\n }\n drupal_set_message($restore ?\n t('The @thing has been restored.', $x) :\n t('The @thing was successfully moved.', $x));\n $form_state['redirect'] = mm_content_get_mmtid_url($src_mmtid);\n }\n else {\n form_set_error('', $error);\n }\n }\n else if ($modes['move_nodes']) {\n $ok = $total = 0;\n foreach (mm_content_get_nids_by_mmtid($src_mmtid) as $nid) {\n $total++;\n $uid = db_result(db_query('SELECT uid FROM {node} WHERE nid = %d', $nid));\n if (!empty($uid) || $uid === 0) {\n $node = (object)array('nid' => $nid, 'uid' => $uid);\n if (mm_content_node_access('update', $node)) {\n db_query('UPDATE {mm_node2tree} SET mmtid = %d WHERE mmtid = %d AND nid = %d',\n $dest_mmtid, $src_mmtid, $nid);\n db_query('DELETE FROM {mm_node_reorder} WHERE nid = %d AND mmtid = %d',\n $nid, $dest_mmtid);\n $ok++;\n }\n }\n }\n\n $failed = $total - $ok;\n $x += array('@total' => $total, '@ok' => $ok, '@failed' => $failed);\n if ($failed) {\n if ($failed == $total) {\n drupal_set_message(t('You do not have permission to move any of the @total piece(s) of content on the @thing.', $x));\n $form_state['redirect'] = mm_content_get_mmtid_url($src_mmtid);\n }\n else {\n drupal_set_message(t('Only @ok of the @total piece(s) of content on the @thing could be moved, due to lack of permission.', $x));\n $form_state['redirect'] = mm_content_get_mmtid_url($dest_mmtid);\n }\n }\n else if (!$total) {\n drupal_set_message(t('There are no contents on this @thing to move.', $x));\n $form_state['redirect'] = mm_content_get_mmtid_url($src_mmtid);\n }\n else {\n drupal_set_message(t('@total piece(s) of content were successfully moved.', $x));\n $form_state['redirect'] = mm_content_get_mmtid_url($dest_mmtid);\n }\n }\n}", "function ValidateEdit()\n\t{\n\t}", "function mm_ui_content_copymove(&$form_state, $item) {\n $x = mm_ui_strings($is_group = $item->is_group);\n\n if ($item->parent > 0) {\n $pitem = mm_content_get_tree($item->parent, array(\n MM_GET_TREE_DEPTH => 0,\n MM_GET_TREE_RETURN_PERMS => TRUE,\n )\n );\n }\n\n $form['#attributes'] = array('class' => 'mm-ui-copymove');\n $form['mmtid'] = array(\n '#type' => 'value',\n '#value' => $item->mmtid\n );\n\n $form['mode'] = array(\n '#type' => 'fieldset',\n '#title' => t('Mode'),\n '#collapsible' => FALSE);\n $form['mode']['mode'] = array(\n '#type' => 'radios',\n '#default_value' => 'copy',\n '#options' => array('copy' => t('Copy'), 'move' => t('Move')));\n if ($item->perms['IS_RECYCLED']) {\n unset($form['mode']['mode']['#options']['move']);\n $form['mode']['mode']['#description'] = t('This @thing is in the recycle bin. You can copy it, but it cannot be moved.', $x);\n }\n\n $form['copy'] = array(\n '#type' => 'fieldset',\n '#attributes' => array('id' => 'copydiv'),\n '#title' => t('What to copy'),\n '#collapsible' => FALSE);\n $mustcheck = $is_group ? '' : \"alert('\" . t('You must choose \"This @thing\", \"Contents\", or both.', $x) . \"');\";\n $form['copy']['copy_page'] = array(\n '#type' => 'checkbox',\n '#default_value' => TRUE,\n '#title' => t('This @thing', $x));\n $form['copy']['copy_subpage'] = array(\n '#type' => 'checkbox',\n '#default_value' => FALSE,\n '#attributes' => array('style' => 'margin-left: 20px'),\n '#title' => t('and any @subthings', $x));\n if (!$is_group) {\n $form['copy']['copy_nodes'] = array(\n '#type' => 'checkbox',\n '#default_value' => FALSE,\n '#title' => t('Contents'));\n $form['copy']['desc'] = array(\n '#type' => 'item',\n '#description' => t('When contents are copied without their current @thing, the new copies take on the permissions of the destination @thing.', $x));\n }\n\n $form['move'] = array(\n '#type' => 'fieldset',\n '#attributes' => array('id' => 'movediv'),\n '#title' => t('What to move'),\n '#collapsible' => FALSE);\n $form['move']['move_mode'] = array(\n '#type' => 'radios',\n '#default_value' => 'page',\n '#description' => $is_group ? NULL : t('Moved contents keep their original permissions.'),\n '#options' => array(\n 'page' => t($is_group ? 'This @thing and any @subthings' : 'This @thing, any @subthings, and all their contents', $x),\n 'nodes' => t('Just the contents appearing on this @thing', $x)));\n\n $limit_move = isset($item->flags['limit_move']) && !user_access('administer all menus');\n if ($is_group) {\n unset($form['move']['move_mode']['#options']['nodes']);\n if ($limit_move) {\n unset($form['mode']['mode']['#options']['move']);\n $form['mode']['mode']['#description'] = t('You are not allowed to move this group.') . ' ' . $form['mode']['mode']['#description'];\n }\n else if (mm_content_is_vgroup($item->mmtid)) {\n $form['mode']['mode']['#default_value'] = 'move';\n unset($form['mode']['mode']['#options']['copy']);\n }\n }\n else if ($limit_move) {\n $form['move']['move_mode']['#default_value'] = 'nodes';\n unset($form['move']['move_mode']['#options']['page']);\n $form['move']['move_mode']['#description'] = t('You are not allowed to move this page, only its contents.') . ' ' . $form['move']['move_mode']['#description'];\n }\n\n $form['dest'] = array(\n '#type' => 'fieldset',\n '#title' => t('Destination'),\n '#collapsible' => FALSE);\n\n $parents = mm_content_get_parents($item->mmtid);\n if (!user_access('administer all menus')) array_shift($parents); // skip root\n $pop_start = implode('/', $parents) . \"/$item->mmtid\";\n\n $form['dest']['dest'] = array(\n '#title' => t('Destination'),\n '#type' => $is_group ? 'mm_grouplist' : 'mm_catlist',\n '#required' => $item->parent <= 0,\n '#default_value' => $pitem ?\n array($pitem[0]->mmtid => mm_content_expand_name($pitem[0]->name)) :\n array('' => t('(choose the destination)')),\n '#mm_list_popup_start' => $pop_start,\n '#mm_list_min' => 1,\n '#mm_list_max' => 1,\n '#mm_list_selectable' => 'au',\n '#description' => t('Choose where to copy/move the @thing. The default value is the @thingpos current parent.',\n $x)\n );\n\n $form['name_alias'] = array(\n '#type' => 'fieldset',\n '#attributes' => array('id' => 'namediv'),\n '#title' => $is_group ? t('Name') : t('Name and URL name'),\n '#collapsible' => FALSE);\n $form['name_alias']['name'] = array(\n '#type' => 'mm_fake_required',\n '#mm_orig_type' => 'textfield',\n '#title' => t('New @thing name', $x),\n '#default_value' => $item->name,\n '#size' => 40, '#maxlength' => 128,\n '#description' => t('If you do not change the Destination above, you must modify the name here.')\n );\n\n if (!$is_group) {\n $form['name_alias']['alias'] = array(\n '#type' => $item->is_user_home || user_access('administer all menus') ? 'textfield' : 'mm_fake_required',\n '#mm_orig_type' => 'textfield',\n '#title' => t('New URL name'),\n '#default_value' => $item->alias,\n '#size' => 20, '#maxlength' => 128,\n '#description' => t('A name that will be used in URLs. '.\n 'Try to limit this to something short, using only the lowercase characters '.\n '<code>a-z</code>, <code>0-9</code>, dot, dash, and underscore.')\n );\n }\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Go!'),\n );\n mm_static('copymove', TRUE, $mustcheck);\n\n return $form;\n}", "protected function _processValidForm()\n {\n $table = $this->_getTable();\n\n $formValues = $this->_getForm()->getValues();\n\n if (!empty($formValues[$this->_getPrimaryIdKey()])) {\n $row = $this->_getRow($this->_getPrimaryId());\n } else {\n $row = $table->createRow();\n }\n\n foreach ($formValues as $key => $value) {\n if (isset($row->$key) && !$table->isIdentity($key)) {\n $row->$key = $value;\n }\n }\n\n $row->save();\n\n $this->_goto($this->_getBrowseAction());\n }", "function cps_changeset_edit_form_validate($form, &$form_state) {\n}", "function validate()\n {\n if (!$this->ParentId && !$this->Content)\n throw Exception(\"ParentId and Content cannot both be NULL\");\n }", "public function canCopy()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn ( !$this->parent() and static::canAddRoot() ) or ( $this->parent() and $this->parent()->canAdd() );\n\t}", "protected function _validate() {\n\t}", "function validate($monographId) {\n\t\tparent::validate();\n\n\t\t$copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO');\n\t\t$press =& Request::getPress();\n\t\t$user =& Request::getUser();\n\n\t\t$isValid = true;\n\n\t\t$copyeditorSubmission =& $copyeditorSubmissionDao->getCopyeditorSubmission($monographId, $user->getId());\n\n\t\tif ($copyeditorSubmission == null) {\n\t\t\t$isValid = false;\n\t\t} else if ($copyeditorSubmission->getPressId() != $press->getId()) {\n\t\t\t$isValid = false;\n\t\t} else {\n\t\t\tif ($copyeditorSubmission->getUserIdBySignoffType('SIGNOFF_COPYEDITING_INITIAL') != $user->getId()) {\n\t\t\t\t$isValid = false;\n\t\t\t}\n\t\t}\n\n\t\tif (!$isValid) {\n\t\t\tRequest::redirect(null, Request::getRequestedPage());\n\t\t}\n\n\t\t$this->submission =& $copyeditorSubmission;\n\t\treturn true;\n\t}", "function thumbwhere_contentcollection_edit_form_validate(&$form, &$form_state) {\n \n //if (twCanDebug()) debug($form); \n //if (twCanDebug()) debug($form_state);\n\n\n // No validation for pk\n\n\n // Convert fk autocomplete for fk_actor\n $value = $form['fk_actor']['#value'];\n // If we have something, escape the auto-completion encoding.\n if (!empty($value)) { \n $value = entity_autocomplete_get_id($value);\n form_set_value($form['fk_actor'], $value,$form_state);\n }\n //if (twCanDebug()) debug($form['fk_actor']);\n if (twCanDebug()) debug('fk_actor = ' . $value);\n // Validate fk fk_actor\n if (empty($value)) {\n form_set_error('fk_actor', t('Validation error, \\'fk_actor\\' is mandatory1.'));\n // throw new Exception('Field \\'fk_actor\\' in is mandatory');\n }\n\n // Validate normaltitle\n $value = $form['title']['#value'];\n // If we have no default value then we don't care much for checking for emptyness.\n\n\n \n\n //form_set_value( array('#parents' => array('array_key_parent', 'array_key_to_replace')) , $value, $form_state);\n\n \n \n $thumbwhere_contentcollection = $form_state['thumbwhere_contentcollection'];\n\n // Notify field widgets to validate their data.\n field_attach_form_validate('thumbwhere_contentcollection', $thumbwhere_contentcollection, $form, $form_state);\n \n \n \n}", "function inscription_jesa_manage_validate($form, &$form_state) {\n \n}", "private function _postValidation()\r\n\t{\r\n // Used $_POST here to allow us to modify them directly - naughty I know :)\r\n\r\n\t\tif (empty($_POST['description']) OR strlen($_POST['description']) > 10000)\r\n\t\t\t$this->_mod_errors[] = $this->l('Description is invalid');\r\n\t\t// could check that this is a valid path, but the next test will\r\n\t\t// do that for us anyway\r\n\t\t// But first we need to get rid of the escape characters\r\n\t\t$_POST['filepath'] = $this->winFixFilename($_POST['filepath']);\r\n\t\tif (empty($_POST['filepath']) OR (strlen($_POST['filepath']) > 255))\r\n\t\t\t$this->_mod_errors[] = $this->l('The target location is invalid');\r\n\r\n\t\tif (file_exists($_POST['filepath']) && !is_writable($_POST['filepath']))\r\n\t\t\t$this->_mod_errors[] = $this->l('File error.<br />Cannot write to').' '.$_POST['filepath'];\r\n\t}", "function oa_export_blueprint_export_form_validate($form, &$form_state) {\n if (empty($form_state['values']['blueprint']) || empty($form_state['values']['space'])) {\n drupal_set_message(t(\"We can't seem to find the Blueprint or Space for your export.\"), 'error');\n form_set_error('', NULL);\n }\n}", "function mongo_node_form_validate(&$form, &$form_state) {\n $entity_type = $form_state['entity_type'];\n $entity = $form_state[$entity_type];\n field_attach_form_validate($entity_type, $entity, $form, $form_state);\n}", "function _or_chart_admin_url_form_validate($form, &$form_state) { \n $nodes = array_filter($form_state['values']['nodes']);\n if (count($nodes) == 0) {\n form_set_error('', t('No items selected.'));\n }\n}", "function pdfbulletin_settings_form_validate(&$form, &$form_state) {\n // @todo SERIOUSLY\n}", "private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}", "private function validate() {\n\t\tif (!$this->user->hasPermission('modify', 'module/bottomlistcategory')) {\n\t\t\t$this->error['warning'] = $this->language->get('error_permission');\n\t\t}\n\t\t\n\t\tif (!$this->error) {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\t\n\t}", "function proceedDragDrop()\n\t{\n\t\tglobal $ilCtrl;\n\n//echo \"-\".$_POST[\"il_hform_source_id\"].\"-\".$_POST[\"il_hform_target_id\"].\"-\".$_POST[\"il_hform_fc\"].\"-\";\n\t\t$this->content_object->executeDragDrop($_POST[\"il_hform_source_id\"], $_POST[\"il_hform_target_id\"],\n\t\t\t$_POST[\"il_hform_fc\"], $_POST[\"il_hform_as_subitem\"]);\n\t\t$ilCtrl->redirect($this, \"showHierarchy\");\n\t}", "public function validateTree()\n {\n if (!$this->showTree) {\n return;\n }\n\n $this->showSorting = $this->showPagination = false;\n\n if (!$this->model->methodExists('getChildren')) {\n throw new ApplicationException(\n 'To display list as a tree, the specified model must have a method \"getChildren\"'\n );\n }\n\n if (!$this->model->methodExists('getChildCount')) {\n throw new ApplicationException(\n 'To display list as a tree, the specified model must have a method \"getChildCount\"'\n );\n }\n }", "abstract protected function fieldValidation($submittedData);", "function thumbwhere_contentcollectionitem_edit_form_validate(&$form, &$form_state) {\n \n //if (twCanDebug()) debug($form); \n //if (twCanDebug()) debug($form_state);\n\n\n // No validation for pk\n\n\n // Convert fk autocomplete for fk_contentcollection\n $value = $form['fk_contentcollection']['#value'];\n // If we have something, escape the auto-completion encoding.\n if (!empty($value)) { \n $value = entity_autocomplete_get_id($value);\n form_set_value($form['fk_contentcollection'], $value,$form_state);\n }\n //if (twCanDebug()) debug($form['fk_contentcollection']);\n if (twCanDebug()) debug('fk_contentcollection = ' . $value);\n // Validate fk fk_contentcollection\n if (empty($value)) {\n form_set_error('fk_contentcollection', t('Validation error, \\'fk_contentcollection\\' is mandatory1.'));\n // throw new Exception('Field \\'fk_contentcollection\\' in is mandatory');\n }\n\n // Convert fk autocomplete for fk_content\n $value = $form['fk_content']['#value'];\n // If we have something, escape the auto-completion encoding.\n if (!empty($value)) { \n $value = entity_autocomplete_get_id($value);\n form_set_value($form['fk_content'], $value,$form_state);\n }\n //if (twCanDebug()) debug($form['fk_content']);\n if (twCanDebug()) debug('fk_content = ' . $value);\n // Validate fk fk_content\n if (empty($value)) {\n form_set_error('fk_content', t('Validation error, \\'fk_content\\' is mandatory1.'));\n // throw new Exception('Field \\'fk_content\\' in is mandatory');\n }\n\n // Validate normalweight\n $value = $form['weight']['#value'];\n // If we have no default value then we don't care much for checking for emptyness.\n\n\n \n\n //form_set_value( array('#parents' => array('array_key_parent', 'array_key_to_replace')) , $value, $form_state);\n\n \n \n $thumbwhere_contentcollectionitem = $form_state['thumbwhere_contentcollectionitem'];\n\n // Notify field widgets to validate their data.\n field_attach_form_validate('thumbwhere_contentcollectionitem', $thumbwhere_contentcollectionitem, $form, $form_state);\n \n \n \n}", "abstract public function validate();", "abstract public function validate();", "function culturefeed_entry_ui_edit_collaboration_data_form_validate(array $form, array &$form_state) {\n\n if (isset($form_state['values']['collaboration'])) {\n\n $collaboration = $form_state['values']['collaboration'];\n foreach ($collaboration as $tag => $info) {\n\n $field = \"collaboration][\" . $tag . \"][image][\";\n if (!empty($info['image']['upload']) && $info['image']['copyright'] != 1) {\n form_set_error($field . \"copyright\", t('Please agree to the general conditions of UiTdatabank and declare that you have the necessary rights or permissions to distribute the image through UiTdatabank.'));\n }\n if (!empty($info['image']['upload']) && empty($info['image']['copyright_text'])) {\n form_set_error($field . \"copyright_text\", t('Copyright field is required.'));\n }\n\n }\n\n }\n\n}", "abstract public function valid();" ]
[ "0.62335956", "0.6147149", "0.6125741", "0.60412186", "0.57650757", "0.57623434", "0.5760975", "0.57478315", "0.5743867", "0.5673393", "0.559553", "0.5561291", "0.5510506", "0.54944503", "0.54328454", "0.5405858", "0.5385325", "0.53776807", "0.53178436", "0.5314212", "0.5292809", "0.52830213", "0.527647", "0.5269608", "0.5268417", "0.5266699", "0.52664626", "0.52664626", "0.5266313", "0.5263084" ]
0.6981728
0
Process the form for copying/moving a tree entry
function mm_ui_content_copymove_submit($form, &$form_state, $restore = FALSE) { global $user; _mm_ui_content_copymove_get_values($form_state['values'], $src_mmtid, $modes, $src_parent_mmtid, $dest_mmtid); $name = trim($form_state['values']['name']); $alias = trim($form_state['values']['alias']); $x = mm_ui_strings(mm_content_is_group($src_mmtid)); if ($modes['copy_page'] || $modes['copy_nodes']) { if ($modes['copy_page'] && $modes['copy_nodes']) { $msg = $modes['copy_recur'] ? t('The @thing, any @subthings, and their contents were successfully copied.', $x) : t('The @thing and its contents were successfully copied.', $x); } else if ($modes['copy_nodes']) { $msg = t('The @thingpos contents were successfully copied.', $x); } else { $msg = $modes['copy_recur'] ? t('The @thing and any @subthings were successfully copied.', $x) : t('The @thing was successfully copied.', $x); } $copy_params = array( MM_COPY_ALIAS => $alias, MM_COPY_CONTENTS => $modes['copy_nodes'], MM_COPY_NAME => $name, MM_COPY_OWNER => $user->uid, MM_COPY_READABLE => TRUE, MM_COPY_RECUR => $modes['copy_recur'], MM_COPY_TREE => $modes['copy_page'], ); $new_mmtid = mm_content_copy($src_mmtid, $dest_mmtid, $copy_params); if (is_numeric($new_mmtid)) { if ($new_mmtid != $src_mmtid) $msg .= ' ' . t('You are now viewing the destination.'); drupal_set_message($msg); $form_state['redirect'] = mm_content_get_mmtid_url($new_mmtid); } else { form_set_error('', $new_mmtid); } } else if ($modes['move_page']) { $old_tree = mm_content_get($src_mmtid); $error = mm_content_move($src_mmtid, $dest_mmtid, $restore ? 'restore' : ''); if (!$error) { if ($name != $old_tree->name || $alias != $old_tree->alias) { mm_content_update_quick(array('name' => $name, 'alias' => $alias), array('mmtid' => $src_mmtid), $dest_mmtid); } drupal_set_message($restore ? t('The @thing has been restored.', $x) : t('The @thing was successfully moved.', $x)); $form_state['redirect'] = mm_content_get_mmtid_url($src_mmtid); } else { form_set_error('', $error); } } else if ($modes['move_nodes']) { $ok = $total = 0; foreach (mm_content_get_nids_by_mmtid($src_mmtid) as $nid) { $total++; $uid = db_result(db_query('SELECT uid FROM {node} WHERE nid = %d', $nid)); if (!empty($uid) || $uid === 0) { $node = (object)array('nid' => $nid, 'uid' => $uid); if (mm_content_node_access('update', $node)) { db_query('UPDATE {mm_node2tree} SET mmtid = %d WHERE mmtid = %d AND nid = %d', $dest_mmtid, $src_mmtid, $nid); db_query('DELETE FROM {mm_node_reorder} WHERE nid = %d AND mmtid = %d', $nid, $dest_mmtid); $ok++; } } } $failed = $total - $ok; $x += array('@total' => $total, '@ok' => $ok, '@failed' => $failed); if ($failed) { if ($failed == $total) { drupal_set_message(t('You do not have permission to move any of the @total piece(s) of content on the @thing.', $x)); $form_state['redirect'] = mm_content_get_mmtid_url($src_mmtid); } else { drupal_set_message(t('Only @ok of the @total piece(s) of content on the @thing could be moved, due to lack of permission.', $x)); $form_state['redirect'] = mm_content_get_mmtid_url($dest_mmtid); } } else if (!$total) { drupal_set_message(t('There are no contents on this @thing to move.', $x)); $form_state['redirect'] = mm_content_get_mmtid_url($src_mmtid); } else { drupal_set_message(t('@total piece(s) of content were successfully moved.', $x)); $form_state['redirect'] = mm_content_get_mmtid_url($dest_mmtid); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mm_ui_content_copymove(&$form_state, $item) {\n $x = mm_ui_strings($is_group = $item->is_group);\n\n if ($item->parent > 0) {\n $pitem = mm_content_get_tree($item->parent, array(\n MM_GET_TREE_DEPTH => 0,\n MM_GET_TREE_RETURN_PERMS => TRUE,\n )\n );\n }\n\n $form['#attributes'] = array('class' => 'mm-ui-copymove');\n $form['mmtid'] = array(\n '#type' => 'value',\n '#value' => $item->mmtid\n );\n\n $form['mode'] = array(\n '#type' => 'fieldset',\n '#title' => t('Mode'),\n '#collapsible' => FALSE);\n $form['mode']['mode'] = array(\n '#type' => 'radios',\n '#default_value' => 'copy',\n '#options' => array('copy' => t('Copy'), 'move' => t('Move')));\n if ($item->perms['IS_RECYCLED']) {\n unset($form['mode']['mode']['#options']['move']);\n $form['mode']['mode']['#description'] = t('This @thing is in the recycle bin. You can copy it, but it cannot be moved.', $x);\n }\n\n $form['copy'] = array(\n '#type' => 'fieldset',\n '#attributes' => array('id' => 'copydiv'),\n '#title' => t('What to copy'),\n '#collapsible' => FALSE);\n $mustcheck = $is_group ? '' : \"alert('\" . t('You must choose \"This @thing\", \"Contents\", or both.', $x) . \"');\";\n $form['copy']['copy_page'] = array(\n '#type' => 'checkbox',\n '#default_value' => TRUE,\n '#title' => t('This @thing', $x));\n $form['copy']['copy_subpage'] = array(\n '#type' => 'checkbox',\n '#default_value' => FALSE,\n '#attributes' => array('style' => 'margin-left: 20px'),\n '#title' => t('and any @subthings', $x));\n if (!$is_group) {\n $form['copy']['copy_nodes'] = array(\n '#type' => 'checkbox',\n '#default_value' => FALSE,\n '#title' => t('Contents'));\n $form['copy']['desc'] = array(\n '#type' => 'item',\n '#description' => t('When contents are copied without their current @thing, the new copies take on the permissions of the destination @thing.', $x));\n }\n\n $form['move'] = array(\n '#type' => 'fieldset',\n '#attributes' => array('id' => 'movediv'),\n '#title' => t('What to move'),\n '#collapsible' => FALSE);\n $form['move']['move_mode'] = array(\n '#type' => 'radios',\n '#default_value' => 'page',\n '#description' => $is_group ? NULL : t('Moved contents keep their original permissions.'),\n '#options' => array(\n 'page' => t($is_group ? 'This @thing and any @subthings' : 'This @thing, any @subthings, and all their contents', $x),\n 'nodes' => t('Just the contents appearing on this @thing', $x)));\n\n $limit_move = isset($item->flags['limit_move']) && !user_access('administer all menus');\n if ($is_group) {\n unset($form['move']['move_mode']['#options']['nodes']);\n if ($limit_move) {\n unset($form['mode']['mode']['#options']['move']);\n $form['mode']['mode']['#description'] = t('You are not allowed to move this group.') . ' ' . $form['mode']['mode']['#description'];\n }\n else if (mm_content_is_vgroup($item->mmtid)) {\n $form['mode']['mode']['#default_value'] = 'move';\n unset($form['mode']['mode']['#options']['copy']);\n }\n }\n else if ($limit_move) {\n $form['move']['move_mode']['#default_value'] = 'nodes';\n unset($form['move']['move_mode']['#options']['page']);\n $form['move']['move_mode']['#description'] = t('You are not allowed to move this page, only its contents.') . ' ' . $form['move']['move_mode']['#description'];\n }\n\n $form['dest'] = array(\n '#type' => 'fieldset',\n '#title' => t('Destination'),\n '#collapsible' => FALSE);\n\n $parents = mm_content_get_parents($item->mmtid);\n if (!user_access('administer all menus')) array_shift($parents); // skip root\n $pop_start = implode('/', $parents) . \"/$item->mmtid\";\n\n $form['dest']['dest'] = array(\n '#title' => t('Destination'),\n '#type' => $is_group ? 'mm_grouplist' : 'mm_catlist',\n '#required' => $item->parent <= 0,\n '#default_value' => $pitem ?\n array($pitem[0]->mmtid => mm_content_expand_name($pitem[0]->name)) :\n array('' => t('(choose the destination)')),\n '#mm_list_popup_start' => $pop_start,\n '#mm_list_min' => 1,\n '#mm_list_max' => 1,\n '#mm_list_selectable' => 'au',\n '#description' => t('Choose where to copy/move the @thing. The default value is the @thingpos current parent.',\n $x)\n );\n\n $form['name_alias'] = array(\n '#type' => 'fieldset',\n '#attributes' => array('id' => 'namediv'),\n '#title' => $is_group ? t('Name') : t('Name and URL name'),\n '#collapsible' => FALSE);\n $form['name_alias']['name'] = array(\n '#type' => 'mm_fake_required',\n '#mm_orig_type' => 'textfield',\n '#title' => t('New @thing name', $x),\n '#default_value' => $item->name,\n '#size' => 40, '#maxlength' => 128,\n '#description' => t('If you do not change the Destination above, you must modify the name here.')\n );\n\n if (!$is_group) {\n $form['name_alias']['alias'] = array(\n '#type' => $item->is_user_home || user_access('administer all menus') ? 'textfield' : 'mm_fake_required',\n '#mm_orig_type' => 'textfield',\n '#title' => t('New URL name'),\n '#default_value' => $item->alias,\n '#size' => 20, '#maxlength' => 128,\n '#description' => t('A name that will be used in URLs. '.\n 'Try to limit this to something short, using only the lowercase characters '.\n '<code>a-z</code>, <code>0-9</code>, dot, dash, and underscore.')\n );\n }\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Go!'),\n );\n mm_static('copymove', TRUE, $mustcheck);\n\n return $form;\n}", "function proceedDragDrop()\n\t{\n\t\tglobal $ilCtrl;\n\n//echo \"-\".$_POST[\"il_hform_source_id\"].\"-\".$_POST[\"il_hform_target_id\"].\"-\".$_POST[\"il_hform_fc\"].\"-\";\n\t\t$this->content_object->executeDragDrop($_POST[\"il_hform_source_id\"], $_POST[\"il_hform_target_id\"],\n\t\t\t$_POST[\"il_hform_fc\"], $_POST[\"il_hform_as_subitem\"]);\n\t\t$ilCtrl->redirect($this, \"showHierarchy\");\n\t}", "function mm_ui_content_copymove_validate($form, &$form_state, $restore = FALSE) {\n _mm_ui_content_copymove_get_values($form_state['values'], $src_mmtid, $modes, $src_parent_mmtid, $dest_mmtid);\n $nodes_only = $modes['move_nodes'] || $modes['copy_nodes'] && !$modes['copy_page'];\n\n if ($modes['copy_page'] || $modes['move_page']) {\n mm_ui_validate_fake_required($form['name_alias']['name'], trim($form_state['values']['name']));\n mm_ui_validate_fake_required($form['name_alias']['alias'], trim($form_state['values']['alias']));\n }\n\n if (!$src_mmtid || !is_numeric($src_mmtid)) {\n form_set_error('', t('Missing one or more required fields'));\n return;\n }\n\n $x = mm_ui_strings(mm_content_is_group($src_mmtid));\n\n if ($modes['move_page'] && !mm_content_user_can($src_mmtid, 'w'))\n $message = t('You do not have permission to modify this @thing.', $x);\n\n if ($modes['move_page'] && !$restore && !mm_content_user_can($src_parent_mmtid, 'a'))\n $message = t('You do not have permission to modify the source @thingpos parent.', $x);\n\n if (!is_numeric($dest_mmtid) || !mm_content_user_can($dest_mmtid, $nodes_only ? 'u' : 'a'))\n $message = t('You do not have permission to modify the destination @thing.', $x);\n\n if (mm_content_is_normal($src_mmtid) != mm_content_is_normal($dest_mmtid) || mm_content_is_group($src_mmtid) != mm_content_is_group($dest_mmtid))\n $message = t('Source and destination are not of the same type.');\n\n if (mm_content_user_can($dest_mmtid, 'IS_RECYCLED'))\n if ($modes['copy_nodes'] || $modes['copy_page']) {\n $message = 'You cannot copy to a recycle bin.';\n }\n else {\n $message = 'You cannot move to a recycle bin using this option. Please use the Delete option, instead.';\n }\n\n if ($message) {\n watchdog('mm', $message, array(), WATCHDOG_WARNING, \"source: $src_mmtid, dest: $dest_mmtid\");\n form_set_error('', t($message));\n return;\n }\n\n if (mm_content_is_vgroup($src_mmtid) != mm_content_is_vgroup($dest_mmtid)) {\n form_set_error('dest', mm_content_is_vgroup($src_mmtid) ? t('Pre-defined groups can only be moved to create sub-groups of other pre-defined groups.') : t('You cannot copy/move a regular group inside the pre-defined groups list.'));\n }\n\n if (!$nodes_only && !_mm_ui_validate_entry($src_mmtid, $dest_mmtid, $form_state['values'], TRUE, TRUE)) {\n return;\n }\n\n if ($dest_mmtid == $src_parent_mmtid && $modes['move_page']) {\n form_set_error('', t('Instead of moving a @thing within the same parent @thing, rename it using Settings-&gt;Edit.', $x));\n }\n else if ($dest_mmtid == $src_mmtid && $nodes_only && $modes['move_nodes']) {\n form_set_error('', t('Moving just a @thingpos contents to itself results in no change.', $x));\n }\n else if ($dest_mmtid == $src_mmtid && !$modes['move_nodes'] && ($modes['move_page'] || $modes['copy_recur'])) {\n form_set_error('', t('You cannot copy or move a @thing within itself.', $x));\n }\n else if (mm_content_is_child($dest_mmtid, $src_mmtid)) {\n if ($modes['move_page']) {\n form_set_error('dest', t('You cannot move a @thing into a @subthing of itself. Please choose another destination.', $x));\n }\n else if ($modes['copy_recur']) {\n form_set_error('dest', t('You cannot copy a @thing and any @subthings into a child of itself. Please choose another destination.', $x));\n }\n }\n else if ($modes['move_nodes'] && mm_content_is_archive($dest_mmtid)) {\n form_set_error('dest', t('You cannot move content into an archive. Move the content into the main @thing, instead, and the archive will be updated automatically.', $x));\n }\n}", "function doEdit()\n {\n $dt = new lmbDate();\n $this->dt_up = $dt->getStamp();\n\n $node_id = $this->request->getInteger('id');\n $node['node_id'] = $node_id;\n $node['title'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_TITLE);\n $node['description'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_DESCR);\n $node['identifier'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_URI);\n $node['price'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_PRICE);\n\n $this->dt_cr = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_CREATE_DATE);\n $node['date_create'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_CREATE_DATE);\n $node['date_update'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_UPDATE_DATE);\n $node['is_branch'] = TreeItem::getIsBranchByNodeId($node_id);\n\n $this->setFormDatasource($node, 'object_form');\n\n $criteria = new lmbSQLFieldCriteria('is_branch', 1);\n $criteria->addAnd('attr_id = '. TreeItem::ID_TITLE );\n $this->items = lmbActiveRecord :: find('TreeItem', $criteria);\n\n\n if($this->request->hasPost())\n {\n $this->_validateAndSave(false);\n //$this->_onAfterSave();\n }\n }", "function doEdit()\n {\n $dt = new lmbDate();\n $this->dt_up = $dt->getStamp();\n\n $node_id = $this->request->getInteger('id');\n $this->node = $node_id;\n $category['node_id'] = $node_id;\n $category['title'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_TITLE);\n $category['description'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_DESCR);\n $category['identifier'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_URI);\n\n $this->dt_cr = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_CREATE_DATE);\n $category['date_create'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_CREATE_DATE);\n $category['date_update'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_UPDATE_DATE);\n $category['is_branch'] = TreeItem::getIsBranchByNodeId($node_id);\n\n $this->setFormDatasource($category, 'object_form');\n\n if($this->request->hasPost())\n {\n $this->_validateAndSave(false);\n //$this->_onAfterSave();\n }\n }", "public function save_trash_delete_form() {\n\t\t// Handled in the process_bulk_actions() function in includes/class-forms-list.php\n\t}", "function cps_changeset_edit_form_submit($form, &$form_state) {\n $entity = $form_state['entity'];\n $entity->name = $form_state['values']['name'];\n $entity->description = $form_state['values']['description'];\n $entity->lock_in_select = $form_state['values']['lock_in_select'];\n\n if (!empty($entity->is_new)) {\n // Automatically move us to the new changeset context.\n cps_set_current_changeset($entity->changeset_id);\n\n // If there is a destination, we have to remove the changeset ID from it.\n if (!empty($_GET['destination'])) {\n // We used drupal_get_destination() before because it may not have been\n // calculated; to directly modify it we will then need to get the\n // (now cached) static.\n $_GET['destination'] = preg_replace(\"/changeset_id=[^&]+/\", 'changeset_id=' . $entity->changeset_id, $_GET['destination']);\n }\n }\n}", "protected function _prepare_entry ($entry)\n {\n parent::_prepare_entry ($entry);\n\n $db = $this->db;\n $entry->kind = $db->f ('entry_kind');\n\n switch ($entry->type)\n {\n case 'change':\n $entry->number = $db->f ('chng_number');\n $entry->job_id = $db->f ('chng_job_id');\n break;\n case 'job':\n $entry->time_created->set_from_iso ($db->f ('job_time_created'));\n $branch_info = $entry->main_branch_info ();\n $branch_info->status = $db->f ('job_status');\n $branch_info->priority = $db->f ('job_priority');\n $branch_info->time_closed->set_from_iso ($db->f ('job_time_closed'));\n $branch_info->closer_id = $db->f ('job_closer_id');\n break;\n }\n }", "public function cloneWizardPageObject()\n\t{\n\t\tglobal $ilObjDataCache;\n\t\t\n\t \tif (!$_POST['clone_source'])\n\t \t{\n\t\t\tilUtil::sendInfo($this->lng->txt('select_one'));\n\t\t\tif (isset($_SESSION['wizard_search_title']))\n\t\t\t{\n\t\t\t\t$this->searchCloneSourceObject();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->createObject();\n\t\t\t}\n\t\t\treturn false;\n\t \t}\n\t\t$source_id = $_POST['clone_source'];\n\t\t$this->lng->loadLanguageModule('frm');\n\n\t \t$new_type = $_REQUEST['new_type'];\n\t \t$this->ctrl->setParameter($this, 'clone_source', (int) $_POST['clone_source']);\n\t \t$this->ctrl->setParameter($this, 'new_type', $new_type);\n\t \t\n\t \t$this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.frm_wizard_page.html', 'Modules/Forum');\n\t \t$this->tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this));\n\t \t$this->tpl->setVariable('TYPE_IMG', ilUtil::getImagePath('icon_'.$new_type.'.gif'));\n\t \t$this->tpl->setVariable('ALT_IMG', $this->lng->txt('obj_'.$new_type));\n\t \t$this->tpl->setVariable('TXT_DUPLICATE', $this->lng->txt('frm_wizard_page'));\n\t \t$this->tpl->setVariable('INFO_THREADS', $this->lng->txt('fmr_copy_threads_info'));\n\t \t$this->tpl->setVariable('THREADS', $this->lng->txt('forums_threads'));\n\t \t\n\t \t$forum_id = $ilObjDataCache->lookupObjId((int) $_POST['clone_source']);\n\t \tinclude_once('Modules/Forum/classes/class.ilForum.php');\n\t \t$threads = ilForum::_getThreads($forum_id, ilForum::SORT_TITLE);\n\t \tforeach ($threads as $thread_id => $title)\n\t \t{\n\t \t\t$this->tpl->setCurrentBlock('thread_row');\n\t \t\t$this->tpl->setVariable('CHECK_THREAD', ilUtil::formCheckbox(0, 'cp_options['.$source_id.'][threads][]', $thread_id));\n\t \t\t$this->tpl->setVariable('NAME_THREAD', $title);\n\t \t\t$this->tpl->parseCurrentBlock();\n\t \t}\n\t \t$this->tpl->setVariable('SELECT_ALL', $this->lng->txt('select_all'));\n\t \t$this->tpl->setVariable('JS_FIELD', 'cp_options['.$source_id.'][threads]');\n\t \t$this->tpl->setVariable('BTN_COPY', $this->lng->txt('obj_'.$new_type.'_duplicate'));\n\t \tif (isset($_SESSION['wizard_search_title']))\n\t \t{\n\t \t\t$this->tpl->setVariable('BACK_CMD', 'searchCloneSource');\n\t \t}\n\t \telse\n\t \t{\n\t \t\t$this->tpl->setVariable('BACK_CMD', 'create');\n\t \t}\n \t\t$this->tpl->setVariable('BTN_BACK', $this->lng->txt('btn_back'));\n\t}", "abstract function performInsert(Form $arg0);", "protected function _processValidForm()\n {\n $table = $this->_getTable();\n\n $formValues = $this->_getForm()->getValues();\n\n if (!empty($formValues[$this->_getPrimaryIdKey()])) {\n $row = $this->_getRow($this->_getPrimaryId());\n } else {\n $row = $table->createRow();\n }\n\n foreach ($formValues as $key => $value) {\n if (isset($row->$key) && !$table->isIdentity($key)) {\n $row->$key = $value;\n }\n }\n\n $row->save();\n\n $this->_goto($this->_getBrowseAction());\n }", "function proceedDragDrop()\n\t{\n\t\tglobal $ilCtrl;\n\n//\t\t$this->slm_object->executeDragDrop($_POST[\"il_hform_source_id\"], $_POST[\"il_hform_target_id\"],\n//\t\t\t$_POST[\"il_hform_fc\"], $_POST[\"il_hform_as_subitem\"]);\n//\t\t$ilCtrl->redirect($this, \"showOrganization\");\n\t}", "function gform_site_cloner($entry, $form){\n\n $_POST = [\n 'action' => 'process',\n 'clone_mode' => 'core',\n 'source_id' => rgar( $entry, '3' ), //specific to the form entry fields and should resolve to the ID site to copy\n 'target_name' => rgar( $entry, '2' ), //specific to the form entry fields - need to parallel site url restrictions\n 'target_title' => rgar( $entry, '2' ), //specific to the form entry fields\n 'disable_addons' => true,\n 'clone_nonce' => wp_create_nonce('ns_cloner')\n ];\n \n // Setup clone process and run it.\n $ns_site_cloner = new ns_cloner();\n $ns_site_cloner->process();\n\n $site_id = $ns_site_cloner->target_id;\n $site_info = get_blog_details( $site_id );\n if ( $site_info ) {\n // Clone successful!\n }\n}", "function copyCategorySelect( $option, $cid, $SectionList, $items, $sectionOld, $contents, $redirect ) {\r\n\t\t?>\r\n\t\t<form action=\"index2.php\" method=\"post\" name=\"adminForm\">\r\n\t\t<br />\r\n\t\t<table class=\"adminheading\">\r\n\t\t<tr>\r\n\t\t\t<th class=\"categories\">\r\n\t\t\tКопирование подрубрики\r\n\t\t\t</th>\r\n\t\t</tr>\r\n\t\t</table>\r\n\r\n\t\t<br />\r\n\t\t<script language=\"javascript\" type=\"text/javascript\">\r\n\t\tfunction submitbutton(pressbutton) {\r\n\t\t\tvar form = document.adminForm;\r\n\t\t\tif (pressbutton == 'cancel') {\r\n\t\t\t\tsubmitform( pressbutton );\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// do field validation\r\n\t\t\tif (!getSelectedValue( 'adminForm', 'sectionmove' )) {\r\n\t\t\t\talert( \"Пожалуйста, выберите рубрику для копируемой подрубрики\" );\r\n\t\t\t} else {\r\n\t\t\t\tsubmitform( pressbutton );\r\n\t\t\t}\r\n\t\t}\r\n\t\t</script>\r\n\t\t<table class=\"adminform\">\r\n\t\t<tr>\r\n\t\t\t<td width=\"3%\"></td>\r\n\t\t\t<td align=\"left\" valign=\"top\" width=\"30%\">\r\n\t\t\t<strong>Копировать в раздел:</strong>\r\n\t\t\t<br />\r\n\t\t\t<?php echo $SectionList ?>\r\n\t\t\t<br /><br />\r\n\t\t\t</td>\r\n\t\t\t<td align=\"left\" valign=\"top\" width=\"20%\">\r\n\t\t\t<strong>Копируемые подрубрики:</strong>\r\n\t\t\t<br />\r\n\t\t\t<?php\r\n\t\t\techo \"<ol>\";\r\n\t\t\tforeach ( $items as $item ) {\r\n\t\t\t\techo \"<li>\". $item->name .\"</li>\";\r\n\t\t\t}\r\n\t\t\techo \"</ol>\";\r\n\t\t\t?>\r\n\t\t\t</td>\r\n\t\t\t<td valign=\"top\" width=\"20%\">\r\n\t\t\t<strong>Копируемое содержимое подрубрики:</strong>\r\n\t\t\t<br />\r\n\t\t\t<?php\r\n\t\t\techo \"<ol>\";\r\n\t\t\tforeach ( $contents as $content ) {\r\n\t\t\t\techo \"<li>\". $content->title .\"</li>\";\r\n\t\t\t\techo \"\\n <input type=\\\"hidden\\\" name=\\\"item[]\\\" value=\\\"$content->id\\\" />\";\r\n\t\t\t}\r\n\t\t\techo \"</ol>\";\r\n\t\t\t?>\r\n\t\t\t</td>\r\n\t\t\t<td valign=\"top\">\r\n\t\t\tВ выбранный раздел будут скопированы все\r\n\t\t\t<br />\r\n\t\t\tперечисленные подрубрики и всё \r\n\t\t\t<br />\r\n\t\t\tперечисленное содержимое этих подрубрик.\r\n\t\t\t</td>.\r\n\t\t</tr>\r\n\t\t</table>\r\n\t\t<br /><br />\r\n\r\n\t\t<input type=\"hidden\" name=\"ca\" value=\"<?php echo $option;?>\" />\r\n\t\t<input type=\"hidden\" name=\"section\" value=\"<?php echo $sectionOld;?>\" />\r\n\t\t<input type=\"hidden\" name=\"boxchecked\" value=\"1\" />\r\n\t\t<input type=\"hidden\" name=\"redirect\" value=\"<?php echo $redirect; ?>\" />\r\n\t\t<input type=\"hidden\" name=\"task\" value=\"\" />\r\n\t\t<?php\r\n\t\tforeach ( $cid as $id ) {\r\n\t\t\techo \"\\n <input type=\\\"hidden\\\" name=\\\"cid[]\\\" value=\\\"$id\\\" />\";\r\n\t\t}\r\n\t\t?>\r\n\t\t</form>\r\n\t\t<?php\r\n\t}", "function processPost($formvalues) {\n\t\t// check if the parentid is specified\n\t\tif (isArrayKeyAnEmptyString('parentid', $formvalues)) {\n\t\t\t$formvalues['parentid'] = NULL;\n\t\t}\n\t\t// trim spaces from the name field\n\t\tif (!isArrayKeyAnEmptyString('name', $formvalues)) {\n\t\t\t$formvalues['name'] = trim($formvalues['name']);\n\t\t}\n\t\tparent::processPost($formvalues);\n\t}", "function processForm()\r\n\t{\r\n\t\t$originalViewId = $this->viewId;\r\n\t\tparent::processForm();\r\n\t\t\r\n\t\t$this->mc->database->query(\"UPDATE \" . $this->mc->config['database_pref'] . \"views SET view_action = view_name WHERE view_id = ?\", array(array($this->viewId, \"i\")));\r\n\t\t\r\n\t\t//if(isset($_REQUEST['view_videoselection']) && $_REQUEST['view_videoselection'] != -1)\r\n\t\t\t// TODO: currently just statically inserted\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'The Superbowl XLVI 2012.mp4', 'Superbowl XLVI Trailer', '4:16', 'superbowl_logo.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'Ahmad Bradshaw Touchdown.mp4', 'Ahmad Bradshaw Touchdown', '0:24', 'superbowl_shot.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'Jerome Simpson Touchdown Flip.mp4', 'Jerome Simpson Touchdown Flip', '0:26', 'nfl_logo_rasen.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'Tom Brady Final Throw.mp4', 'Tom Brady Final Throw', '1:33', 'nfl_logl_original.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'Best SuperBowl Moments.mp4', 'Best SuperBowl Moments', '3:19', 'superbowl_moments.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\r\n\t\t// update concept type id for this view\r\n\t\t$conceptQuery = $this->mc->database->query(\"SELECT concept_id FROM \" . $this->mc->config['database_pref'] . \"concepts WHERE concept_key = 'mediacenter'\");\r\n\t\t$this->mc->database->query(\"UPDATE \" . $this->mc->config['database_pref'] . \"views SET view_c_type = ? WHERE view_id = ?\", array(array($conceptQuery->rows[0]->concept_id, \"i\"), array($this->viewId, \"i\")));\r\n\t\t\r\n\t\t$this->cleanUpDirectory();\r\n\t\t$this->createXmlFile();\r\n\t\t\r\n\t\t// re-create main xml file and refresh filelist\r\n\t\t$this->mc->filecreator->createGeneralFiles();\r\n\t\t$configSet = true;\r\n\t\tinclude_once('modules/filemanager.module.php');\r\n\t\t$fileManagerObj = new apdModuleFilemanager($this->mc);\r\n\t\t$fileManagerObj->refreshFilelist();\r\n\t\t\r\n\t\theader(\"Location: index.php?m=mediacenter&view_id=\" . $this->viewId);\r\n\t}", "public function process_post() {\n\t\t$name = $this->node->attr('name');\n\n\n\t\tif (!empty($_POST) && $this->get_post_value($name)) {\n//\t\t\t$this->value = $this->get_post_value($name);\n\t\t\t$this->value($this->get_post_value($name));\n\t\t}\n\t}", "function processForm(){\n /*Admin page content goes here */\n if( isset($_POST['rssMultiUpdate']) ){\n require \"classes/RssUpdateSingle.php\";\n \n $RssUpdateSingle = new RssUpdateSingle;\n $RssUpdateSingle->updateBlog();\n }\n }", "public function postProcess()\n {\n $pageId = Tools::getValue('id_page');\n if (Tools::isSubmit('submitEditCustomHTMLPage') || Tools::isSubmit('submitEditCustomHTMLPageAndStay')) {\n if ($pageId == 'new')\n $this->processAdd();\n else\n $this->processUpdate();\n }\n else if (Tools::isSubmit('status'.$this->table)) {\n $this->toggleStatus();\n }\n else if (Tools::isSubmit('delete'.$this->table)) {\n $this->processDelete();\n }\n }", "function dlgModify() {\n global $database;\n\n if ((!$this->sql_getEntry($this->section_id,$this->page_id)) && ($database->is_error())) {\n // SQL Fehler\n $this->print_error(); }\n else {\n // sicherstellen, dass nur bei einem Reload die $_REQUEST Daten verwendet werden\n if ((isset($_REQUEST['action'])) && ($_REQUEST['action'] == 'request')) {\t$this->requestToRecord(); }\n $parser = new templateParser();\n $parser->add('h1',dl_backend_header);\n $parser->add('description',dl_backend_description);\n $parser->add('text_header',dl_backend_text_header);\n $parser->add('value_header',$this->record['header']);\n $parser->add('text_prefix',dl_backend_text_prefix);\n $parser->add('value_prefix',$this->record['prefix']);\n $parser->add('text_select',dl_backend_text_select);\n $parser->add('text_suffix',dl_backend_text_suffix);\n $parser->add('value_suffix',$this->record['suffix']);\n\n $parser->add('form_action', WB_URL.'/modules/dirlist/save.php');\n $parser->add('btn_submit',dl_backend_btn_submit);\n $parser->add('btn_abort',dl_backend_btn_abort);\n $parser->add('abort_location',ADMIN_URL. '/pages/index.php');\n $parser->add('page_id',$this->page_id);\n $parser->add('section_id',$this->section_id);\n\t\t\t// Medienverzeichnis auslesen\n $media_dirs = $this->getMediaDirectories();\n if (!empty($this->record['directory']) && (in_array($this->record['directory'],$media_dirs))) {\n $dummy = ''; }\n else {\n $dummy = ' selected=\"selected\"'; }\n $worker = sprintf('<select name=\"directory\"><option value=\"\"%s>%s</option>',$dummy,dl_backend_select_directory);\n while (list($key,$val) = each($media_dirs)) {\n \t$dummy = $key;\n if (!empty($val)) {\n ($val == $this->record['directory']) ? $dummy = ' selected=\"selected\"' : $dummy = '';\n $worker .= sprintf('<option value=\"%s\"%s>%s</option>',$val,$dummy,$val); }}\n $worker .= '</select>';\n $parser->add('directory',$worker);\n\n // Sortierreihenfolge\n $parser->add('text_sort',dl_backend_text_sort);\n $sortArray[1] \t= dl_backend_sortFilesAscending;\n $sortArray[2] \t= dl_backend_sortFilesDescending;\n $sortArray[4] \t= dl_backend_sortSizeAscending;\n\t $sortArray[8] \t= dl_backend_sortSizeDescending;\n $sortArray[16] \t= dl_backend_sortDateAscending;\n $sortArray[32] \t= dl_backend_sortDateDescending;\n\n $worker = '<select name=\"sort\">';\n for ($i=1; $i < 33; $i = $i*2) {\n \t($i == $this->record['sort']) ? $dummy = ' selected=\"selected\"' : $dummy = '';\n \t$worker .= sprintf('<option value=\"%d\"%s>%s</option>',$i,$dummy,$sortArray[$i]); }\n $worker .= '</select>';\n $parser->add('sort',$worker);\n\n $parser->add('text_preselect',dl_backend_text_preselect);\n if ($this->record['exclude'] == 0) {\n $dummy = ' selected=\"selected\"';\n $dummy2 = ''; }\n else {\n $dummy = '';\n $dummy2 = ' selected=\"selected\"'; }\n $worker = sprintf('<option value=\"0\"%s>%s</option>',$dummy,dl_backend_include);\n $worker .= sprintf('<option value=\"1\"%s>%s</option>',$dummy2,dl_backend_exclude);\n $parser->add('exclude_option',$worker);\n $parser->add('value_extensions',$this->record['extensions']);\n\n ($this->record['blank'] == 1) ? $checked = ' checked=\"checked\"' : $checked = '';\n $parser->add('blank_checked',$checked);\n $parser->add('text_blank', dl_backend_blank);\n\n $parser->add('value_header',$this->record['header']);\n $parser->add('value_prefix',$this->record['prefix']);\n $parser->add('value_suffix',$this->record['suffix']);\n\n $parser->parseTemplateFile(WB_PATH.'/modules/dirlist/htt/backend.htt');\n $parser->echoHTML();\n } // else\n\n }", "function review_handler($entry, $form)\n{\n\t$post_id = $entry['post_id'];\n\tif(get_post_type($post_id) != 'bi_review')\n\t\treturn;\n\tif(! is_user_logged_in())\n\t\treturn;\n\t$post = get_post($post_id);\n\t$post->comment_status = 'open';\n\t$post->post_title = $entry[13];\n\t$post->post_status = 'pending';\n\t$post->post_parent = get_post_meta($post_id, 'post_parent', true);\n //echo \"post->parent = \" . $post->post_parent . \"<br/>\";\n\twp_update_post( get_object_vars($post) );\n}", "function post_handler() {\r\n\r\n if ($this->action == 'new' or $this->action == 'edit') { # handle new-save\r\n # check permission first\r\n if ( ($this->action == 'new' and !$this->allow_new) or ($this->action == 'edit' and !$this->allow_edit) )\r\n die('Permission not given for \"'.$this->action.'\" action.');\r\n\r\n $_REQUEST['num_row'] = intval($_REQUEST['num_row']) > 0? intval($_REQUEST['num_row']): 1; # new row should get the number of row to insert from num_row\r\n # import suggest field into current datasource (param sugg_field[..]). note: suggest field valid for all rows\r\n if ($this->action == 'new')\r\n $this->import_suggest_field_to_ds();\r\n # only do this if post come from edit form. bground: browse mode now can contain <input>, which value got passed to edit/new mode\r\n if ($this->_save == '') { # to accomodate -1 (preview)\r\n\t\t\t\treturn False;\r\n\t\t\t}\r\n\r\n $this->import2ds(); # only do this if post come from edit form. bground: browse mode now can contain <input>, which value got passed to edit/new mode\r\n $this->db_count = $_REQUEST['num_row']; # new row should get the number of row to insert from num_row\r\n # check requirement\r\n\r\n if (!$this->validate_rows()) # don't continue if form does not pass validation\r\n return False;\r\n\r\n if ($this->action == 'new') {\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n if (!$this->check_datatype($i)) { # check duplicate index\r\n return False;\r\n }\r\n\r\n if (!$this->check_duplicate_index($i)) { # check duplicate index\r\n return False;\r\n }\r\n if (!$this->check_insert($i)) { # check insertion\r\n return False;\r\n }\r\n }\r\n\r\n if ($this->preview[$this->action] and $this->_save == -1) { # show preview page instead\r\n $this->_preview = True;\r\n return False;\r\n }\r\n\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n $this->insert($i);\r\n }\r\n\r\n if ($this->_go != '') {\r\n while (@ob_end_clean());\r\n header('Location: '.$this->_go);\r\n exit;\r\n }\r\n }\r\n elseif ($this->action == 'edit') {\r\n $this->populate($this->_rowid, True);\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n #~ if (!$this->check_duplicate_index($i)) { # check duplicate index\r\n #~ return False;\r\n #~ }\r\n if (!$this->check_update($i)) { # check insertion\r\n return False;\r\n }\r\n }\r\n\r\n if ($this->preview[$this->action] and $this->_save == -1) { # show preview page instead\r\n $this->_preview = True;\r\n return False;\r\n }\r\n\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n $this->update($i);\r\n }\r\n\r\n if ($this->_go != '') {\r\n #~ include('footer.inc.php');\r\n header('Location: '.$this->_go);\r\n exit;\r\n }\r\n }\r\n }\r\n elseif ($this->action == 'csv') {\r\n /* generate CSV representation of loaded datasource\r\n http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm\r\n */\r\n if (AADM_ON_BACKEND!=1)\r\n die('Permission not given for \"'.$this->action.'\" action.');\r\n $this->browse_rows = 0; # show all data\r\n $this->populate();\r\n $rows = array();\r\n $fields = array();\r\n foreach ($this->properties as $colvar=>$col) {\r\n $vtemp = $this->ds->{$colvar}[$i];\r\n $vtemp = str_replace('\"','\"\"',$vtemp);\r\n $vtemp = (strpos($vtemp,',') === false and strpos($vtemp,'\"') === false and strpos($vtemp,\"\\n\") === false)? $vtemp: '\"'.$vtemp.'\"';\r\n $fields[] = (strpos($col->label,',') === false)? $col->label: '\"'.$col->label.'\"';\r\n }\r\n $rows[] = join(',',$fields);\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n $fields = array();\r\n foreach ($this->properties as $colvar=>$col) {\r\n $vtemp = $this->ds->{$colvar}[$i];\r\n $vtemp = str_replace('\"','\"\"',$vtemp);\r\n $vtemp = (strpos($vtemp,',') === false and strpos($vtemp,'\"') === false and strpos($vtemp,\"\\n\") === false)? $vtemp: '\"'.$vtemp.'\"';\r\n $fields[] = $vtemp;\r\n }\r\n $rows[] = join(',',$fields);\r\n }\r\n #~ header('Content-type: application/vnd.ms-excel');\r\n header('Content-type: text/comma-separated-values');\r\n header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');\r\n header('Content-Disposition: inline; filename=\"dump.csv\"');\r\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\r\n header('Pragma: public');\r\n header('Expires: 0');\r\n\r\n echo join(\"\\r\\n\",$rows);\r\n exit();\r\n }\r\n else { # no-act handler, call its post function callbacks if available\r\n if (AADM_ON_BACKEND==1) {\r\n $callback = 'act_'.$this->action;\r\n if (method_exists($this, $callback)) {\r\n $this->$callback(True);\r\n }\r\n }\r\n }\r\n }", "function process(&$dom, &$formnode) {\n\t\t$formerrors = $this->readform();\n\t\tif(count($formerrors) > 0) {\n\t\t\tforeach($formerrors as $error) {\n\t\t\t\t$node = $formnode->appendChild($dom->createElement(\"formerror\"));\n\t\t\t\t$node->setAttribute(\"type\", $error);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Attempt MySQL add\n\t\t$result = $this->ftpmirror->addmirror();\n\t\tif(PEAR::isError($result)) {\n\t\t\t$node = $formnode->appendChild($dom->createElement(\"error\"));\n\t\t\t$node->appendChild($dom->createTextNode($result->getMessage()));\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Report success\n\t\tif($result) {\n\t\t\t$node = $formnode->appendChild($dom->createElement(\"added\"));\n\t\t\t$this->ftpmirror->add_to_node($dom, $node);\n\t\t\t$this->ftpmirror = new FTPMirror();\n\t\t}\n\n\t\treturn;\n\t}", "function putInTree()\n\t{\n//echo \"st:putInTree\";\n\t\t// chapters should be behind pages in the tree\n\t\t// so if target is first node, the target is substituted with\n\t\t// the last child of type pg\n\t\tif ($_GET[\"target\"] == IL_FIRST_NODE)\n\t\t{\n\t\t\t$tree = new ilTree($this->content_object->getId());\n\t\t\t$tree->setTableNames('lm_tree','lm_data');\n\t\t\t$tree->setTreeTablePK(\"lm_id\");\n\n\t\t\t// determine parent node id\n\t\t\t$parent_id = (!empty($_GET[\"obj_id\"]))\n\t\t\t\t? $_GET[\"obj_id\"]\n\t\t\t\t: $tree->getRootId();\n\t\t\t// determine last child of type pg\n\t\t\t$childs =& $tree->getChildsByType($parent_id, \"pg\");\n\t\t\tif (count($childs) != 0)\n\t\t\t{\n\t\t\t\t$_GET[\"target\"] = $childs[count($childs) - 1][\"obj_id\"];\n\t\t\t}\n\t\t}\n\t\tif (empty($_GET[\"target\"]))\n\t\t{\n\t\t\t$_GET[\"target\"] = IL_LAST_NODE;\n\t\t}\n\n\t\tparent::putInTree();\n\t}", "function edit_tree()\n\t{\n\n\t\t$tree_id = $this->EE->input->get('tree_id');\n\t\t$this->EE->ttree->check_tree_table_exists($tree_id);\n\t\t\n\t\t$this->EE->cp->add_to_head('<link type=\"text/css\" href=\"'.$this->_theme_base_url.'css/taxonomy.css\" rel=\"stylesheet\" />');\n\n\t\t$new = $this->EE->input->get('new');\n\t\t\n\t\t$vars = array();\n\t\t\n\t\t// fetch the tree\n\t\t$this->EE->db->where_in('id', $tree_id);\n\t\t$vars['tree'] = $this->EE->db->get('taxonomy_trees')->result_array();\n\t\t\n\t\t// make sure if a tree is requested it exists\n\t\t// unless we're adding a new one that is...\n\t\tif( !$vars['tree'] && $new != 1)\n\t\t{\n\t\t\t$this->EE->session->set_flashdata( 'message_failure', lang('invalid_tree') );\n\t\t\t$this->EE->functions->redirect($this->_base_url);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$vars['tree'] = (isset($vars['tree'][0])) ? $vars['tree'][0] : '';\n\t\t$vars['tree']['template_preferences'] = (isset($vars['tree']['template_preferences'])) ? explode('|', $vars['tree']['template_preferences']) : '';\n\t\t$vars['tree']['channel_preferences'] = (isset($vars['tree']['channel_preferences'])) ? explode('|', $vars['tree']['channel_preferences']) : '';\n\t\t$vars['tree']['permissions'] = (isset($vars['tree']['permissions'])) ? explode('|', $vars['tree']['permissions']) : '';\n\t\t\n\t\t$vars['tree']['fields'] = (isset($vars['tree']['fields'])) ? array_sort($this->unserialize($vars['tree']['fields']), 'order', SORT_ASC) : '';\n\t\t$vars['tree']['max_depth'] = (isset($vars['tree']['max_depth'])) ? $vars['tree']['max_depth'] : 0;\n\t\t$vars['member_groups'] = array();\n\n\t\t\n\t\t// -----------\n\t\t// Build templates, channels, and member_group select options\n\t\t// -----------\n\t\t\n\t\t\t// fetch our templates\n\t\t\t$templates = $this->EE->template_model->get_templates($this->site_id)->result_array();\n\t\t\t\n\t\t\t// must have templates!\n\t\t\tif ( !$templates )\n\t\t\t{\n\t\t\t\t$this->EE->session->set_flashdata('message_failure', lang('no_templates_exist'));\n\t\t\t\t$this->EE->functions->redirect($this->_base_url);\n\t\t\t}\n\t\t\t\n\t\t\t// build up our templates array for our multiselect options\n\t\t\tforeach( $templates as $template )\n\t\t\t{\n\t\t\t\t$vars['templates'][$template['template_id']] = '/'.$template['group_name'].'/'.$template['template_name'];\n\t\t\t}\n\n\t\t\t// fetch our channels\n\t\t\t$channels = $this->EE->ttree->get_channels($this->site_id);\n\t\t\t\n\t\t\t// must have channels!\n\t\t\tif (!$channels)\n\t\t\t{\n\t\t\t\t$this->EE->session->set_flashdata('message_failure', $this->EE->lang->line('no_channels_exist'));\n\t\t\t\t$this->EE->functions->redirect($this->_base_url);\n\t\t\t}\n\t\t\t\n\t\t\t// build our channels array for our multiselect options\n\t\t\tforeach( $channels as $channel )\n\t\t\t{\n\t\t\t\t$vars['channels'][$channel['channel_id']] = $channel['channel_title'];\n\t\t\t}\n\n\t\t\t// fetch our member_groups\n\t\t\t$member_groups = $this->EE->member_model->get_member_groups()->result_array();\n\t\t\t\n\t\t\t// build our member_groups array for our multiselect options\n\t\t\tforeach( $member_groups as $member_group )\n\t\t\t{\n\t\t\t\t// only add to the array if the member group can actuall access the taxonomy module \n\t\t\t\tif( $this->EE->ttree->can_access_taxonomy($member_group['group_id']) )\n\t\t\t\t{\n\t\t\t\t\t$vars['member_groups'][$member_group['group_id']] = $member_group['group_title'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\n\t\t// -----------\n\n\t\tif($new)\n\t\t{\n\t\t\t$vars['tree']['id'] = NULL;\n\t\t\t$vars['tree']['label'] = NULL;\n\t\t\treturn $this->content_wrapper('edit_tree', 'add_tree', $vars);\n\t\t}\n\n\t\treturn $this->content_wrapper('edit_tree', 'edit_tree', $vars);\n\t\n\t}", "private function _handleFormPost()\n {\n // see submit.php\n // 'FILE_OBJECTS' => 'handle_file_post',\n // 'BASE64_ENCODED_FILE_OBJECTS' => 'handle_base64_encoded_file_post',\n // 'TRANSFER_IDS' => 'handle_transfer_ids_post'\n }", "function copy()\n\t{\n\t\tJSession::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$cid = JFactory::getApplication()->input->get('cid',array(0),'array');\n\n\t\t$model = $this->getModel('fields');\n\n\t\tif(!$model->copy( $cid )) {\n\t\t\tthrow new Exception(JText::_('COM_FLEXIMPORT_FIELDS_COPY_FAILED'), 400);\n\t\t} else {\n\t\t\t$msg = JText::_('COM_FLEXIMPORT_FIELDS_COPY_SUCCESS');\n\t\t\t$cache = JFactory::getCache('com_fleximport');\n\t\t\t$cache->clean();\n\t\t}\n\t\t$this->setRedirect('index.php?option=com_fleximport&view=fields', $msg );\n\t}", "protected function processEditForm(sfWebRequest $request, sfForm $form) {\n $collectionId = sfToolkit::getArrayValueForPath($form->getName(), 'parent_node_id');\n $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));\n if ($form->isValid()) {\n $asset_group = $form->save();\n $PostParams = $request->getPostParameters();\n\n $AssetInformatoin = Doctrine_Query::Create()\n ->from('AssetGroup a')\n ->select('a.*,ft.*')\n ->leftJoin('a.FormatType ft WITH ft.id=a.format_id')\n ->addWhere(\"ft.id = '\" . $PostParams['asset_group']['format_id'] . \"'\")\n ->fetchArray();\n\n $characteristicsValue = Doctrine_Query::Create()\n ->from('CharacteristicsValues cv')\n ->select('cv.*,cc.*,cf.*')\n ->leftJoin('cv.CharacteristicsConstraints cc')\n ->leftJoin('cv.CharacteristicsFormat cf')\n ->addWhere(\"cv.format_id = '\" . $AssetInformatoin[0]['FormatType']['type'] . \"'\")\n ->fetchArray();\n\n #Move copies to the end to check the total score if score is greater then 90 and less then 12 , copies score wont apply \n $copiesValue = NULL;\n $copieExist = FALSE;\n foreach ($characteristicsValue as $key => $SingleValue) {\n if ($SingleValue['c_name'] == 'copies') {\n $copiesValue = $SingleValue;\n $copieExist = TRUE;\n unset($characteristicsValue[$key]);\n }\n }\n $characteristicsValue[] = $copiesValue;\n\n #Loading Socre Calculater Library \n $ScoreCalculator = new scoreCalculator();\n $score = $ScoreCalculator->callFormatCalculator($AssetInformatoin, $characteristicsValue);\n\n #If Score is Greater Then 90 And Less Then 12 , Deduct Copies Score From Total\n if ($copieExist && isset($score['score']) && ($score['score'] >= 90 || $score['score'] <= 12)) {\n if ($AssetInformatoin[0]['FormatType']['copies'] == 1) {\n $scoreTotal = (float) $score['score'] - (float) $copiesValue['c_score'];\n if ($scoreTotal > 100) {\n $scoreTotal = 100;\n }\n $score['scoreRounded'] = round((float) $scoreTotal / 20, 2);\n $score['score'] = (float) $scoreTotal;\n }\n }\n if ($score != FALSE) {\n $update = Doctrine_Query::create()\n ->update('FormatType ')\n ->set('asset_score', '?', $score['scoreRounded'])\n ->where('id = ?', $AssetInformatoin[0]['FormatType']['id'])\n ->execute();\n echo 'Done';\n } else {\n echo 'calculator not found for this format type';\n }\n\n return true;\n }\n return false;\n }", "function prepare_form() {\n global $wpdb, $userdata;\n\n $post_id = isset( $_GET['pid'] ) ? intval( $_GET['pid'] ) : 0;\n\n //is editing enabled?\n if ( wpuf_get_option( 'enable_post_edit', 'wpuf_others', 'yes' ) != 'yes' ) {\n return __( 'Post Editing is disabled', 'wpuf' );\n }\n\n $curpost = get_post( $post_id );\n\n if ( !$curpost ) {\n return __( 'Invalid post', 'wpuf' );\n }\n\n //has permission?\n if ( !current_user_can( 'delete_others_posts' ) && ( $userdata->ID != $curpost->post_author ) ) {\n return __( 'You are not allowed to edit', 'wpuf' );\n }\n\n //perform delete attachment action\n if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == \"del\" ) {\n check_admin_referer( 'wpuf_attach_del' );\n $attach_id = intval( $_REQUEST['attach_id'] );\n\n if ( $attach_id ) {\n wp_delete_attachment( $attach_id );\n }\n }\n\n //process post\n if ( isset( $_POST['wpuf_edit_post_submit'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'wpuf-edit-post' ) ) {\n $this->submit_post();\n\n $curpost = get_post( $post_id );\n }\n\n //show post form\n $this->edit_form( $curpost );\n }", "function moveCategorySelect( $option, $cid, $SectionList, $items, $sectionOld, $contents, $redirect ) {\r\n\t\t?>\r\n\t\t<form action=\"index2.php\" method=\"post\" name=\"adminForm\">\r\n\t\t<br />\r\n\t\t<table class=\"adminheading\">\r\n\t\t<tr>\r\n\t\t\t<th class=\"categories\">\r\n\t\t\tПеремещение подрубрики\r\n\t\t\t</th>\r\n\t\t</tr>\r\n\t\t</table>\r\n\r\n\t\t<br />\r\n\t\t<script language=\"javascript\" type=\"text/javascript\">\r\n\t\tfunction submitbutton(pressbutton) {\r\n\t\t\tvar form = document.adminForm;\r\n\t\t\tif (pressbutton == 'cancel') {\r\n\t\t\t\tsubmitform( pressbutton );\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// do field validation\r\n\t\t\tif (!getSelectedValue( 'adminForm', 'sectionmove' )) {\r\n\t\t\t\talert( \"Пожалуйста, выберите раздел для перемещаемой подрубрики\" );\r\n\t\t\t} else {\r\n\t\t\t\tsubmitform( pressbutton );\r\n\t\t\t}\r\n\t\t}\r\n\t\t</script>\r\n\t\t<table class=\"adminform\">\r\n\t\t<tr>\r\n\t\t\t<td width=\"3%\"></td>\r\n\t\t\t<td align=\"left\" valign=\"top\" width=\"30%\">\r\n\t\t\t<strong>Переместить в раздел:</strong>\r\n\t\t\t<br />\r\n\t\t\t<?php echo $SectionList ?>\r\n\t\t\t<br /><br />\r\n\t\t\t</td>\r\n\t\t\t<td align=\"left\" valign=\"top\" width=\"20%\">\r\n\t\t\t<strong>Перемещаемые подрубрики:</strong>\r\n\t\t\t<br />\r\n\t\t\t<?php\r\n\t\t\techo \"<ol>\";\r\n\t\t\tforeach ( $items as $item ) {\r\n\t\t\t\techo \"<li>\". $item->name .\"</li>\";\r\n\t\t\t}\r\n\t\t\techo \"</ol>\";\r\n\t\t\t?>\r\n\t\t\t</td>\r\n\t\t\t<td valign=\"top\" width=\"20%\">\r\n\t\t\t<strong>Перемещаемые объекты содержимого:</strong>\r\n\t\t\t<br />\r\n\t\t\t<?php\r\n\t\t\techo \"<ol>\";\r\n\t\t\tforeach ( $contents as $content ) {\r\n\t\t\t\techo \"<li>\". $content->title .\"</li>\";\r\n\t\t\t}\r\n\t\t\techo \"</ol>\";\r\n\t\t\t?>\r\n\t\t\t</td>\r\n\t\t\t<td valign=\"top\">\r\n\t\t\tВ выбранный раздел будут перемещены все\r\n\t\t\t<br />\r\n\t\t\t перечисленные подрубрики и всё \r\n\t\t\t<br />\r\n\t\t\tперечисленное содержимое этих подрубрик.\r\n\t\t\t</td>.\r\n\t\t</tr>\r\n\t\t</table>\r\n\t\t<br /><br />\r\n\r\n\t\t<input type=\"hidden\" name=\"ca\" value=\"<?php echo $option;?>\" />\r\n\t\t<input type=\"hidden\" name=\"section\" value=\"<?php echo $sectionOld;?>\" />\r\n\t\t<input type=\"hidden\" name=\"boxchecked\" value=\"1\" />\r\n\t\t<input type=\"hidden\" name=\"redirect\" value=\"<?php echo $redirect; ?>\" />\r\n\t\t<input type=\"hidden\" name=\"task\" value=\"\" />\r\n\t\t<?php\r\n\t\tforeach ( $cid as $id ) {\r\n\t\t\techo \"\\n <input type=\\\"hidden\\\" name=\\\"cid[]\\\" value=\\\"$id\\\" />\";\r\n\t\t}\r\n\t\t?>\r\n\t\t</form>\r\n\t\t<?php\r\n\t}" ]
[ "0.6721694", "0.59017074", "0.58524543", "0.5625395", "0.5497842", "0.54715306", "0.54038763", "0.53728485", "0.5365987", "0.5348362", "0.5340907", "0.5326535", "0.5318877", "0.52915305", "0.5282227", "0.52479744", "0.5229618", "0.51865274", "0.51462454", "0.51414156", "0.514124", "0.5121855", "0.5099178", "0.509703", "0.50802", "0.50762916", "0.5073812", "0.5063962", "0.5055871", "0.5049069" ]
0.63969
1
Gets word from DB with sentenceId and wordIndex
public function getWord($sentenceId, $wordIndex){ $query = $this->conn->createQueryBuilder(); $query->select('w.*') ->from('word', 'w') ->where('w.sentenceId = '.$sentenceId) ->andWhere('w.wordIndex = '.$wordIndex) ; $w = $query->execute(); return $w->fetch(); // there can be only 1 result here, so do not do "fetchAll" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getWord($id){\n $stmt = $this->con->prepare(\"SELECT name FROM words WHERE id = ?\");\n $stmt->bind_param(\"i\",$id);\n $stmt->execute();\n $word = $stmt->get_result()->fetch_assoc();\n $stmt->close(); \n return $word['name'];\n }", "public function find($id)\r\n {\r\n return $this->word->findOne($id);\r\n }", "private function getWordFromDb($word)\n {\n $retrievedRecord = array();\n\n try {\n //Connect to the database and open connections\n\n $connectionString = 'sqlite:' . __DIR__ . '/../words.sqlite3';\n \n //echo \"CONNECTION: $connectionString\\n\";\n\n $dbHandler = new PDO($connectionString);\n // Set errormode to exceptions\n $dbHandler->setAttribute(\n PDO::ATTR_ERRMODE, \n PDO::ERRMODE_EXCEPTION\n );\n\n // Select all data from memory db messages table \n $statement = $dbHandler->prepare(\n \"SELECT * FROM words WHERE lower(words.asciiword) = ?\"\n );\n\n $wordToCheck = $this->collateWord(mb_strtolower($word, 'UTF-8'));\n if ($statement->execute(array($wordToCheck))) {\n while ($row = $statement->fetch()) {\n //echo \"Id: \" . $row['id'] . \"\\n\";\n //echo \"Word: \" . $row['word'] . \"\\n\";\n //echo \"Flags: \" . $row['flags'] . \"\\n\";\n //echo \"\\n\";\n $retrievedRecord = $row;\n }\n }\n\n //Close db connections\n $dbHandler = null;\n }\n catch(PDOException $e) {\n // Print PDOException message\n echo $e->getMessage() . \"\\n\";\n }\n \n return $retrievedRecord;\n }", "public function findByWord(string $word): WordEnInterface\n {\n return $this->model\n ->select(['id', 'word'])\n ->where('word', $word)\n ->first();\n }", "public function getDefinitionId()\r\n{\r\n $query_string = \"SELECT wordid FROM glossary \";\r\n $query_string .= \"WHERE word = :word\";\r\n\r\n return $query_string;\r\n}", "static public function search($word)\n {\n\t\t$word = Tools::alphanum($word, /* strict = */ true);\n\t\t$record = null;\n\n\t\ttry\n\t\t{\n\t\t\t$record = Definition::select()\n\t\t\t\t->where('deleted_at', null)\n \t\t\t->where('type_flag', DEFTYPE_DICTIONARY)\n\t\t\t\t->where(function ($query) use ($word){$query\n\t\t\t\t\t->where('title', $word)\t\t\t\t\t\t\t\t\t\t\t// exact match of title\n\t\t\t\t\t->orWhere('forms', 'LIKE', '%;' . $word . ';%')\t\t\t\t\t// exact match of \";word;\"\n\t\t\t\t\t->orWhere('conjugations_search', 'LIKE', '%;' . $word . ';%') \t// exact match of \";word;\"\n\t\t\t\t\t;})\n\t\t\t\t->first();\n\n\t\t\tif (!isset($record))\n\t\t\t{\n\t\t\t\t$record = self::searchDeeper($word);\n\t\t\t}\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\t$msg = 'Error getting word: ' . $word;\n\t\t\tEvent::logException(LOG_MODEL, LOG_ACTION_SELECT, $word, null, $msg . ': ' . $e->getMessage());\n\t\t\tTools::flash('danger', $msg);\n\t\t}\n\n\t\t//dd($record);\n\n\t\treturn $record;\n\t}", "public function getWordByLineIndex($line, $index) {\r\n\t\t$lines = $this->readAtLine ( $line );\r\n\t\t$words = explode ( \" \", $lines );\r\n\t\treturn $words [$index];\r\n\t\r\n\t}", "private function lookup($word) {\n\n $query = $this->dm->getRepository('\\FYP\\Database\\Documents\\Lexicon');\n $result = $query->findOneBy(array('phrase' => $word));\n if (empty($result)) {\n $result = $query->findOneBy(array('phrase' => strtolower($word)));\n }\n\n if (empty($result)) {\n return self::DEFAULT_TAG;\n } else {\n return $result->getTags()[0];\n }\n\n }", "public function getItem(int $id): WordViewModel;", "public function getRandomWord() {\n\n $repo = $this->entityManager->getRepository('AppBundle:Word');\n $totalWordsCount = $repo->createQueryBuilder('w')\n ->select('count(w.id)')\n ->getQuery()\n ->getSingleScalarResult();\n \n\n $word = $repo->createQueryBuilder('word')\n ->setFirstResult(rand(0, $totalWordsCount - 1))\n ->setMaxResults(1)\n ->getQuery()\n ->getSingleResult(); \n\n return $word;\n }", "abstract public function lookupWordRandomly();", "abstract public function lookupWord($word);", "public function retrieveDefinitionsFromDB()\r\n{\r\n $query_string = \"SELECT wordid, word FROM glossary\";\r\n\r\n return $query_string;\r\n}", "public function getDefinitionFromDB()\r\n{\r\n $query_string = \"SELECT word, worddefinition FROM glossary \";\r\n $query_string .= \"WHERE wordid = :wordid\";\r\n\r\n return $query_string;\r\n}", "public function queryKeywordsByWord($word) {\n $result = $this->query(\"SELECT page_id FROM Keywords WHERE word='$word'\");\n \n // No pages with the specified id, return null.\n if ($result->num_rows == 0) {\n return null;\n }\n \n return $result->fetch_all();\n }", "public function getOneSyl() {\n $table = \"eng-1-syl\";\n $sql = \"SELECT * FROM `$table`\";\n $stmt = $this->pdo->prepare($sql);\n $stmt->execute();\n $response = $stmt->fetchAll(PDO::FETCH_ASSOC);\n if ($response) {\n $numberRows = count($response);\n $random = $this->random($numberRows);\n $word = $response[$random][\"word\"];\n return $word;\n }\n else {\n echo \"something is broken\";\n }\n\n // select a random number from 0 to the highest numbered row\n // take that word and return it\n }", "public function getRandomWord() {\n return $this->_index[array_rand($this->_index)];\n }", "static public function searchPartial($word)\n {\n\t\t$word = Tools::alpha($word);\n\t\t$records = null;\n\n\t\tif (!isset($word))\n\t\t{\n\t\t\t// show full list\n\t\t\treturn Definition::getIndex();\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$records = Definition::select()\n\t\t\t\t->where('deleted_at', null)\n \t\t\t->where('type_flag', DEFTYPE_DICTIONARY)\n\t\t\t\t->where(function ($query) use ($word){$query\n\t\t\t\t\t->where('title', 'LIKE', $word . '%')\t\t\t\t\t\t\t// exact match of title\n\t\t\t\t\t->orWhere('forms', 'LIKE', '%;' . $word . ';%')\t\t\t\t\t// exact match of \";word;\"\n\t\t\t\t\t->orWhere('conjugations_search', 'LIKE', '%;' . $word . '%;%') \t// exact match of \";word;\"\n\t\t\t\t\t;})\n\t\t\t\t->orderBy('title')\n\t\t\t\t->get();\n\n\t\t\tif (false && !isset($record)) // not yet\n\t\t\t{\n\t\t\t\t$record = self::searchDeeper($word);\n\t\t\t}\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\t$msg = 'Error getting word: ' . $word;\n\t\t\tEvent::logException(LOG_MODEL, LOG_ACTION_SELECT, $word, null, $msg . ': ' . $e->getMessage());\n\t\t\tTools::flash('danger', $msg);\n\t\t}\n\n\t\t//dd($records);\n\n\t\treturn $records;\n\t}", "public function searchByWord($word){\n\n try\n {\n $query = \"SELECT * FROM movies \n WHERE movies.title LIKE '%$word%'\";\n\n\n $this->connection = Connection::getInstance();\n\n $result = $this->connection->execute($query);\n \n if($result){\n \n $mapping = $this->map($result); \n\n return $mapping;\n }\n else{\n return null;\n }\n }\n catch(\\PDOException $ex)\n {\n throw $ex;\n }\n }", "function queryword()\n\t{\n\t\t$sql=\"select id_word, frequency, word from $this->lang_frequency where word >= '$this->word' LIMIT 1\";\n\t\t$fs = mysql_query($sql,$this->db);\n\t\t$rs=mysql_fetch_row($fs);\n\t\t//dumpa ($rs);\n\t\t$err=mysql_error($this->db);\n\t\tif ($err)\n\t\t{\n\t\t\techo \"<br>$sql <br> $err<hr>\";\n\t\t}\n\n\t\t$id=$rs[0];\n\t\t$feq=$rs[1];\n\t\t//echo \"<span>$word con id = $id e freq di $feq<br>$sql<br></span>\";\n\t\tif ($id<=25)\n\t\t{\n\t\t $idn=0;\n\t\t $pos=$id-1;\n\t\t}\n\t\telse\n\t\t{\n\t\t $idn=$id-26;\n\t\t $pos=25;\n\t\t}\n\t\t$this->wordfreq=$feq;\n\t\t$this->id=$id;\n\t\t$this->idn=$idn;\n\t\t$this->pos=$pos;\n\t\t$this->wordfound=$rs[2];\n\t}", "static public function searchGeneral($word)\n {\n\t\t$word = Tools::alpha($word);\n\t\t$records = null;\n\n\t\tif (!isset($word))\n\t\t{\n\t\t\t// show full list\n\t\t\treturn Definition::getIndex();\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$records = Definition::select()\n\t\t\t\t->where('deleted_at', null)\n \t\t\t->where('type_flag', DEFTYPE_DICTIONARY)\n\t\t\t\t->where(function ($query) use ($word){$query\n\t\t\t\t\t->where('title', 'LIKE', $word . '%')\n\t\t\t\t\t->orWhere('forms', 'LIKE', '%' . $word . '%')\n\t\t\t\t\t->orWhere('conjugations_search', 'LIKE', '%' . $word . '%')\n\t\t\t\t\t->orWhere('translation_en', 'LIKE', '%' . $word . '%')\n\t\t\t\t\t;})\n\t\t\t\t->orderBy('title')\n\t\t\t\t->get();\n\n\t\t\tif (false && !isset($record)) // not yet\n\t\t\t{\n\t\t\t\t$record = self::searchDeeper($word);\n\t\t\t}\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\t$msg = 'Error getting word: ' . $word;\n\t\t\tEvent::logException(LOG_MODEL, LOG_ACTION_SELECT, $word, null, $msg . ': ' . $e->getMessage());\n\t\t\tTools::flash('danger', $msg);\n\t\t}\n\n\t\t//dd($records);\n\n\t\treturn $records;\n\t}", "public function getWord()\n {\n return $this->word;\n }", "public function word_to_sentence()\n {\n return $this->hasMany(\n WordToSentence::class,\n 'sentence_id',\n 'id',\n );\n }", "function get_word_flashcard(array $wordsids, int $wordindex, bool $backward = false) {\n global $DB, $USER, $output, $coursemoduleid, $tupf;\n\n $wordid = $wordsids[$wordindex];\n\n $word = $DB->get_record('tupf_words', ['id' => $wordid]);\n\n if (empty($word)) {\n delete_cache_and_back_home();\n return;\n }\n\n return $output->words_review_flashcard($word, $wordindex + 1, count($wordsids), $backward);\n}", "public function getWord() {\n while ( isset( $this->words[$this->wCounter] ) ) {\n $wr = $this->words[$this->wCounter];\n $this->wCounter++;\n return $wr;\n }\n if ( !isset( $this->words[$this->wCounter] ) ) {\n $this->wCounter = 0;\n return END_LINE;\n }\n }", "function findWord($String){\n\t\tforeach($vertexList as $v){\n\t\t\tif($v->word === $String)\n\t\t\t\treturn $v;\n\t\t}\n\t\treturn NULL;\n\t}", "public function wordIdWithOrder()\n {\n return $this->word_to_sentence()->orderBy('order', 'asc')->get('word_id')->toArray();\n }", "public function show($id)\n {\n $word = Word::find($id);\n \n return view('words.show', compact('word'));\n\n }", "protected function manageWord($word, $index) {\n // normalize\n $word = mb_strtolower($word, $this->encoding);\n \n $termObj = new Term($word);\n\n // save the term\n if(!$this->uniqueMatchesStatus[$word]) {\n $termObj->save();\n $this->uniqueMatchesStatus[$word] = TRUE;\n }\n \n // add to term list\n if ($this->termsList->contains($termObj)) {\n // just add new occurrence\n $this->invertedIndex->addOccurrence($this->invertedIndex->getInvertedIndex($termObj, $this), $index);\n } else {\n $this->termsList->push($termObj);\n\n // save term-doc relation (inverted index) and position of occurrance\n $this->invertedIndex->addRelation($termObj, $this, $index);\n }\n }", "private function seek($word)\r\n\t{\r\n\t\t$arrPictureId = array();\r\n\t\t$query =\r\n\t\t\"\r\n\t\t\tSELECT DISTINCT\r\n\t\t\t\tii.picture_id\r\n\t\t\tFROM\r\n\t\t\t\tinverted_index ii\r\n\t\t\tJOIN\r\n\t\t\t\tword w\r\n\t\t\tON\r\n\t\t\t\tw.id = ii.word_id\r\n\t\t\tAND\r\n\t\t\t\tw.deleted_at IS NULL\r\n\t\t\tAND\r\n\t\t\t\tw.word LIKE ?\r\n\t\t\tWHERE\r\n\t\t\t\tii.deleted_at IS NULL\r\n\t\t\tORDER BY\r\n\t\t\t\tii.updated_at DESC\r\n\t\t\";\r\n\t\t$data = DB::select($query, array('%' . $word . '%'));\r\n\t\t$arrPictureId = array();\r\n\t\tforeach ($data as $row)\r\n\t\t{\r\n\t\t\t$arrPictureId[] = $row->picture_id;\r\n\t\t}\r\n\t\treturn $arrPictureId;\r\n\t}" ]
[ "0.6754498", "0.6531486", "0.6379945", "0.6379895", "0.62475497", "0.6008331", "0.57935303", "0.5738375", "0.57151735", "0.5705406", "0.56879294", "0.56734633", "0.56500775", "0.5636636", "0.5630476", "0.5612837", "0.5600672", "0.5571276", "0.5543773", "0.5537048", "0.5535245", "0.55071056", "0.5472239", "0.5467468", "0.54643136", "0.54244936", "0.5391024", "0.5374248", "0.5369144", "0.5353734" ]
0.80146056
0
Saves all words in a sentenceTree to the "word" database table
public function saveWordList($coreNLP){ $corenlp_sentence_id = array(); // get the sentences data $serverData = $coreNLP->serverMemory[0]['sentences']; $sentenceClass = new Sentence($this->conn); // go through all the trees foreach($coreNLP->trees as $treeId => $sentenceTree){ // create a new sentenceId in the DB $sentenceId = $sentenceClass->create(); // this array matches the CoreNLP sentenceId to the Database sentenceId $corenlp_sentence_id[$treeId] = $sentenceId; foreach($sentenceTree as $key => $node){ if(array_key_exists('index', $node)){ // create word entry in DB $this->create($node, $sentenceId); } } } return $corenlp_sentence_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function savePhrase()\n\t{\n\t\tglobal $ilUser;\n\t\tglobal $ilDB;\n\n\t\t$next_id = $ilDB->nextId('svy_phrase');\n\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_phrase (phrase_id, title, defaultvalue, owner_fi, tstamp) VALUES (%s, %s, %s, %s, %s)\",\n\t\t\tarray('integer','text','text','integer','integer'),\n\t\t\tarray($next_id, $this->title, 1, $ilUser->getId(), time())\n\t\t);\n\t\t$phrase_id = $next_id;\n\n\t\t$counter = 1;\n\t\tfor ($i = 0; $i < $this->categories->getCategoryCount(); $i++) \n\t\t{\n\t\t\t$cat = $this->categories->getCategory($i);\n\t\t\t$next_id = $ilDB->nextId('svy_category');\n\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_category (category_id, title, defaultvalue, owner_fi, tstamp, neutral) VALUES (%s, %s, %s, %s, %s, %s)\",\n\t\t\t\tarray('integer','text','text','integer','integer','text'),\n\t\t\t\tarray($next_id, $cat->title, 1, $ilUser->getId(), time(), $cat->neutral)\n\t\t\t);\n\t\t\t$category_id = $next_id;\n\t\t\t$next_id = $ilDB->nextId('svy_phrase_cat');\n\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_phrase_cat (phrase_category_id, phrase_fi, category_fi, sequence) VALUES (%s, %s, %s, %s)\",\n\t\t\t\tarray('integer', 'integer', 'integer','integer'),\n\t\t\t\tarray($next_id, $phrase_id, $category_id, $counter)\n\t\t\t);\n\t\t\t$counter++;\n\t\t}\n\t}", "function bl_InsertWords($page_id,$words)\n {\n\n \tforeach ($words as $word => $infos) \n \t{\n\t\t\t// On test si l'URL existe deja\n\t\t\t$worditem = db_getWordByWord($word);\n\t\t\tif (!$worditem) {\n\t\t\t\t$id = db_addWord($word);\n\t\t\t} else {\n\t\t\t\t// l'URL existe deja\n\t\t\t\t$id = $worditem['word_id'];\n\t\t\t}\n\n\n \t\t//if (!db_isWordedExist($page_id,$id)) {\n \t\t\t//db_createFastWorded($page_id,$id,$infos['total']['avg_weight'],$infos['total']['avg_density']);\n \t\t//}\n \t\t//db_insertWordedData($page_id,$id,$tag,$infos['freq'],$infos['density'],$infos['weight']);\n \t}\n \tdb_createFastWorded($page_id,$words);\n }", "function insert($word){\n\t\tinsert($root,$word);\n\t}", "public function run()\n {\n DB::table('words')->insert([\n 'english'=> 'Cachememory',\n 'estonian'=> 'Vahemälu',\n 'russian'=> 'Кэш-память'\n ]);\n }", "function insert($word) {\n $p = $this->root;\n for ($i=0; $i < strlen($word); $i++) { \n $index = (int)(ord($word[$i]) - ord('a'));\n if ($p->children[$index] == null) {\n $p->children[$index] = new TrieNode();\n }\n $p = $p->children[$index]; // 移动到子节点\n }\n $p->is_word = true; // 当前单词走完一遍,标记is_word为真\n }", "private function create_frequency_table($words)\n {\n foreach($words as $key => $word) \n {\n $this->insert_word($word);\n }\n }", "private function installWords()\n {\n $data = file(__DIR__ . '/../bad_words_pl.txt');\n\n $bom = pack('H*', 'EFBBBF');\n\n $rows = [];\n foreach ($data as $row) {\n $rows[] = [trim(preg_replace(\"/^$bom/\", '', $row))];\n }\n\n Yii::$app\n ->db\n ->createCommand()\n ->batchInsert($this->table, ['word'], $rows)\n ->execute();\n }", "public function train($sentence)\n {\n\n //connectionecting to database\n require 'koneksi.php';\n\n // ekstraksi keyword\n mysqli_query($connection, \"TRUNCATE tbtoken\");\n $keywordsArray = $this->tokenize($sentence);\n // update tabel frekuensi kata\n foreach ($keywordsArray as $word) {\n\n // if this word is already present with given category then update count else insert\n $sql = mysqli_query($connection, \"SELECT count(*) as total FROM tbtoken WHERE term = '$word' \");\n $count = mysqli_fetch_assoc($sql);\n\n //rumus bobot\n\n if ($count['total'] == 0) {\n $sql = mysqli_query($connection, \"INSERT into tbtoken (term,count) values('$word',1)\");\n } else {\n $sql = mysqli_query($connection, \"UPDATE tbtoken set count = count + 1 where term = '$word'\");\n }\n }\n\n //closing connectionection\n $connection->close();\n }", "public function run()\n {\n FileWord::query()->delete();\n\n DB::beginTransaction();\n\n FileWordFactory::new()\n ->count(10)\n ->create()\n ->each(function (FileWord $dokumenWord) {\n $tempDocxFilename = \"temp.docx\";\n $tempHTMLFilename = \"temp.html\";\n $docxObject = $this->getRandomWordDocument();\n\n $docxWriter = IOFactory::createWriter($docxObject, \"Word2007\");\n $docxWriter->save(__DIR__ . DIRECTORY_SEPARATOR . $tempDocxFilename);\n\n $htmlWriter = IOFactory::createWriter($docxObject, \"HTML\");\n $htmlWriter->save(__DIR__ . DIRECTORY_SEPARATOR . $tempHTMLFilename);\n\n $dokumenWord->update([\n \"konten_html\" => $this->extractBodyContent(__DIR__ . DIRECTORY_SEPARATOR . $tempHTMLFilename)\n ]);\n\n $dokumenWord\n ->addMediaFromDisk($tempDocxFilename, \"seeders\")\n ->usingFileName(Str::snake($dokumenWord->nama) . \".docx\")\n ->toMediaCollection(FileWord::COLLECTION_WORD_FILE);\n\n unlink(__DIR__ . DIRECTORY_SEPARATOR . $tempHTMLFilename);\n });\n\n DB::commit();\n }", "public function saveToDb()\n\t{\n\t\t$this->addDocument();\n\t\tparent::saveToDb();\n\t}", "public function save_tree()\n\t{\n\t\tforeach ($this->class_tree as $tree)\n\t\t{\n\t\t\tif (isset($tree['change_flag']))\n\t\t\t{\n\t\t\t\tswitch ($tree['change_flag'])\n\t\t\t\t{\n\t\t\t\t case 'INSERT' :\n\t\t\t\t\t$this->add_new_class($tree);\n\t\t\t\t\tbreak;\n\t\t\t\t case 'UPDATE' :\n\t\t\t\t\t$this->save_edited_class($tree);\n\t\t\t\t\tbreak;\n\t\t\t\t default :\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function insertKeyword($page_id, $word) {\n $page_id = $this->connection->escape_string($page_id);\n $word = $this->connection->escape_string($word);\n \n $this->query(\"INSERT INTO Keywords (page_id, word)\"\n . \" VALUES ('$page_id', '$word')\");\n }", "public function storeLanguagesVarsToDB(): void\n {\n foreach ($this->getDirsWithLanguages() as $lang => $dir) {\n $fs = new Filesystem();\n $files = $fs->files($dir);\n foreach ($files as $fileName) {\n $filePath = $dir . \"/\" . $fileName->getRelativePathname();\n $array = (file_exists($filePath)) ? require($filePath) : [];\n $this->saveLanguageValueToDB(basename($fileName->getRelativePathname(), \".php\"), $lang, [], $array);\n }\n }\n }", "protected function manageWord($word, $index) {\n // normalize\n $word = mb_strtolower($word, $this->encoding);\n \n $termObj = new Term($word);\n\n // save the term\n if(!$this->uniqueMatchesStatus[$word]) {\n $termObj->save();\n $this->uniqueMatchesStatus[$word] = TRUE;\n }\n \n // add to term list\n if ($this->termsList->contains($termObj)) {\n // just add new occurrence\n $this->invertedIndex->addOccurrence($this->invertedIndex->getInvertedIndex($termObj, $this), $index);\n } else {\n $this->termsList->push($termObj);\n\n // save term-doc relation (inverted index) and position of occurrance\n $this->invertedIndex->addRelation($termObj, $this, $index);\n }\n }", "function insert($word)\n {\n $node = $this->root;\n for ($i = 0; $i < strlen($word); $i++) {\n $index = ord($word[$i]) - ord('a');\n if (!isset($node->children[$index])) {\n $node->children[$index] = new TrieNode();\n }\n //每个节点都是必须要有的\n $node = $node->children[$index];\n }\n $node->isEnd = true;\n }", "function insert($word)\n {\n $node = $this;\n for ($i = 0; $i < strlen($word); $i++) {\n $index = ord($word[$i]) - ord('a');\n if (!isset($node->children[$index])) {\n $node->children[$index] = new Trie();\n }\n //每个节点都是必须要有的\n $node = $node->children[$index];\n }\n $node->isEnd = true;\n }", "private function write_data_to_db()\r\n {\r\n $dic_depth = 1;\r\n \r\n for ($dic_depth = 1; $dic_depth < 6; $dic_depth++)\r\n {\r\n foreach ($this->directory_array[$dic_depth] as $id => $dic_node)\r\n {\r\n // create node is not existed, get id when existed\r\n $ret = $this->add_testsuite_node_to_db($dic_depth, $dic_node);\r\n \r\n // create testcase under testsuite\r\n if ($ret)\r\n {\r\n $this->add_testcase_nodes_to_db($dic_depth, $dic_node);\r\n }\r\n }\r\n }\r\n }", "public function store(StoreWord $request)\n {\n $word = new Word;\n $word->user_id = $request->user()->id;\n $word->text = $request->input('text');\n $word->impression = $request->input('impression');\n $word->action = $request->input('action');\n\n $word->save();\n\n \\Session::flash('flash_message', '保存しました');\n return redirect('words/index');\n }", "public function multiInsert($words, $id_order)\n {\n foreach ($words as $word) {\n $this->db->insert(\"{$this->table}_search\", [\n 'word' => $word,\n 'id_order' => $id_order\n ]);\n }\n }", "public function saveAll() {\n\t\t$originalCaret = $this->caret;\n\t\tforeach($this as $key => $row) {\n\t\t\t$this->save();\n\t\t}\n\t\t$this->caret = $originalCaret;\n\t}", "public function run()\n {\n DB::table('vocabularies')->insert([\n [\n 'id' => 1,\n 'word' => 'Accommodate',\n 'pronunciation' => 'əˈkɑːmədeɪt',\n 'meaning'=>'đáp ứng, cung cấp chỗ ở',\n 'image' => 'public/word1.png',\n 'verb_form' => 'verb',\n 'sound' => 'public/sound1.mp3',\n 'topic_id' => 1\n \n ],[\n 'id' => 2,\n 'word' => 'Arrange',\n 'pronunciation' => 'əˈreɪndʒ',\n 'meaning'=>'sắp xếp',\n 'image' => 'public/word2.png',\n 'verb_form' => 'verb',\n 'sound' => 'public/sound2.mp3',\n 'topic_id' => 1\n \n ],[\n 'id' => 3,\n 'word' => 'Associate',\n 'pronunciation' => 'əˈsoʊʃieɪt',\n 'meaning'=>'liên tưởng, liên kết',\n 'image' => 'public/word3.png',\n 'verb_form' => 'verb',\n 'sound' => 'public/sound3.mp3',\n 'topic_id' => 1\n \n ],[\n 'id' => 4,\n 'word' => 'Disk',\n 'pronunciation' => 'disk',\n 'meaning'=>'đĩa, ổ đĩa',\n 'image' => 'public/word11.png',\n 'verb_form' => 'noun',\n 'sound' => 'public/sound11.mp3',\n 'topic_id' => 2\n \n ],[\n 'id' => 5,\n 'word' => 'facilitate',\n 'pronunciation' => 'fəˈsɪlɪteɪt',\n 'meaning'=>'tạo điều kiện thuận lợi\n ',\n 'image' => 'public/word12.png',\n 'verb_form' => 'verb',\n 'sound' => 'public/sound12.mp3',\n 'topic_id' => 2\n \n ],[\n 'id' => 6,\n 'word' => 'Network',\n 'pronunciation' => 'ˈnetwɜːrk',\n 'meaning'=>'kết nối\n ',\n 'image' => 'public/word13.png',\n 'verb_form' => 'verb',\n 'sound' => 'public/sound13.mp3',\n 'topic_id' => 2\n \n ],[\n 'id' => 7,\n 'word' => 'Popularize',\n 'pronunciation' => 'ˈpɑːpjələraɪz',\n 'meaning'=>'làm cho phổ biến',\n 'image' => 'public/word14.png',\n 'verb_form' => 'verb',\n 'sound' => 'public/sound14.mp3',\n 'topic_id' => 2\n \n ]\n ]\n );\n }", "function insert($word) {\n if (strlen($word) == 0) return;\n\n $cur = $this->root;\n for ($i = 0; $i < strlen($word); $i++) {\n $c = substr($word, $i, 1);\n if (!isset($cur->next[$c])) {\n $cur->next[$c] = new TrieNode();\n }\n $cur = $cur->next[$c];\n }\n\n if (!$cur->$isWord) {\n $cur->$isWord = true;\n $this->size++;\n }\n }", "function saveKeyWord($key_word, $account){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('INSERT INTO key_word_list (key_word, accountID) VALUES (:key_word, :account)');\n\t\t$statement->execute(array(':key_word' => $key_word, ':account'=>$account));\n\t}", "public function run()\n {\n for ($courseId = 1; $courseId <= 2; $courseId++) {\n $json = File::get(\"database/seeds/json/courses/\" . $courseId . \".json\");\n $data = json_decode($json, true);\n\n $insert = [];\n\n foreach ($data[\"levels\"] as $_ => $level) {\n foreach ($level['words'] as $word) {\n array_push($insert, [\n 'level_id' => $level['id'],\n 'course_id' => $courseId,\n 'source' => $word['source'],\n 'target' => $word['target'],\n 'data' => json_encode($word['data']),\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now()\n ]);\n }\n }\n\n DB::table('words')->insert($insert);\n }\n }", "public function run()\n {\n $keywords = ['new', 'internal', 'expensive', 'second hand', 'antique', 'electronic', 'furniture'];\n\n foreach ($keywords as $keywordName) {\n $keyword = new Keyword();\n $keyword->name = $keywordName;\n $keyword->save();\n }\n }", "function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }", "function saveQuestionsToDb() \n\t{\n\t\tglobal $ilDB;\n\t\t// save old questions state\n\t\t$old_questions = array();\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_svy_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\tif ($result->numRows())\n\t\t{\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\t$old_questions[$row[\"question_fi\"]] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// delete existing question relations\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_svy_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t// create new question relations\n\t\tforeach ($this->questions as $key => $value) \n\t\t{\n\t\t\t$next_id = $ilDB->nextId('svy_svy_qst');\n\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_svy_qst (survey_question_id, survey_fi, question_fi, heading, sequence, tstamp) VALUES (%s, %s, %s, %s, %s, %s)\",\n\t\t\t\tarray('integer','integer','integer','text','integer','integer'),\n\t\t\t\tarray($next_id, $this->getSurveyId(), $value, (strlen($old_questions[$value][\"heading\"])) ? $old_questions[$value][\"heading\"] : NULL, $key, time())\n\t\t\t);\n\t\t}\n\t}", "public function postWord(){\r\n if(!$this->hasLoginCheck())\r\n return;\r\n $title=$_POST['title'];\r\n $content=$_POST['content'];\r\n //$tag=explode(\",\",$this->_post('tag'));\r\n $tag=$_POST['tag'];\r\n// $tmp2=$tmp->select();\r\n $blogItem = new BlogItemModel();\r\n $blogItem->addWord($title,$content,$tag);\r\n echo json_encode(array('status'=>'true'));\r\n }", "function mx_add_search_words($mode, $post_id, $post_text, $post_title = '', $mx_mode = 'mx')\n\t{\n\t\tglobal $db, $config, $lang;\n\n\t\t// $search_match_table = SEARCH_MATCH_TABLE;\n\t\t// $search_word_table = SEARCH_WORD_TABLE;\n\n\t\tswitch ($mx_mode)\n\t\t{\n\t\t\tcase 'mx':\n\t\t\t\t$search_match_table = MX_MATCH_TABLE;\n\t\t\t\t$search_word_table = MX_WORD_TABLE;\n\t\t\t\t$db_key = 'block_id';\n\t\t\tbreak;\n\t\t\tcase 'kb':\n\t\t\t\t$search_match_table = KB_MATCH_TABLE;\n\t\t\t\t$search_word_table = KB_WORD_TABLE;\n\t\t\t\t$db_key = 'article_id';\n\t\t\tbreak;\n\t\t}\n\n\t\tstopwords_synonyms_init();\n\n\t\t$search_raw_words = array();\n\t\t$search_raw_words['text'] = split_words(clean_words('post', $post_text, $stopwords_array, $synonyms_array));\n\t\t$search_raw_words['title'] = split_words(clean_words('post', $post_title, $stopwords_array, $synonyms_array));\n\n\t\t@set_time_limit(0);\n\n\t\t$word = array();\n\t\t$word_insert_sql = array();\n\t\twhile (list($word_in, $search_matches) = @each($search_raw_words))\n\t\t{\n\t\t\t$word_insert_sql[$word_in] = '';\n\t\t\tif (!empty($search_matches))\n\t\t\t{\n\t\t\t\tfor ($i = 0; $i < sizeof($search_matches); $i++)\n\t\t\t\t{\n\t\t\t\t\t$search_matches[$i] = trim($search_matches[$i]);\n\n\t\t\t\t\tif($search_matches[$i] != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$word[] = $search_matches[$i];\n\t\t\t\t\t\tif (!strstr($word_insert_sql[$word_in], \"'\" . $search_matches[$i] . \"'\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$word_insert_sql[$word_in] .= ($word_insert_sql[$word_in] != \"\") ? \", '\" . $search_matches[$i] . \"'\" : \"'\" . $search_matches[$i] . \"'\";\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\tif (sizeof($word))\n\t\t{\n\t\t\tsort($word);\n\n\t\t\t$prev_word = '';\n\t\t\t$word_text_sql = '';\n\t\t\t$temp_word = array();\n\t\t\tfor($i = 0; $i < sizeof($word); $i++)\n\t\t\t{\n\t\t\t\tif ($word[$i] != $prev_word)\n\t\t\t\t{\n\t\t\t\t\t$temp_word[] = $word[$i];\n\t\t\t\t\t$word_text_sql .= (($word_text_sql != '') ? ', ' : '') . \"'\" . $word[$i] . \"'\";\n\t\t\t\t}\n\t\t\t\t$prev_word = $word[$i];\n\t\t\t}\n\t\t\t$word = $temp_word;\n\n\t\t\t$check_words = array();\n\n\t\t\t$value_sql = '';\n\t\t\t$match_word = array();\n\t\t\tfor ($i = 0; $i < sizeof($word); $i++)\n\t\t\t{\n\t\t\t\t$new_match = true;\n\t\t\t\tif (isset($check_words[$word[$i]]))\n\t\t\t\t{\n\t\t\t\t\t$new_match = false;\n\t\t\t\t}\n\n\t\t\t\tif ($new_match)\n\t\t\t\t{\n\t\t\t\t\t$value_sql .= (($value_sql != '') ? ', ' : '') . '(\\'' . $word[$i] . '\\', 0)';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($value_sql != '')\n\t\t\t{\n\t\t\t\t$sql = \"INSERT IGNORE INTO \" . $search_word_table . \" (word_text, word_common) VALUES $value_sql\";\n\t\t\t\t$db->sql_query($sql);\n\t\t\t}\n\t\t}\n\n\t\twhile(list($word_in, $match_sql) = @each($word_insert_sql))\n\t\t{\n\t\t\t$title_match = ($word_in == 'title') ? 1 : 0;\n\n\t\t\tif ($match_sql != '')\n\t\t\t{\n\t\t\t\t$sql = \"INSERT INTO \" . $search_match_table . \" ($db_key, word_id, title_match)\n\t\t\t\t\tSELECT $post_id, word_id, $title_match\n\t\t\t\t\t\tFROM \" . $search_word_table . \"\n\t\t\t\t\t\tWHERE word_text IN ($match_sql)\";\n\t\t\t\t$db->sql_query($sql);\n\t\t\t}\n\t\t}\n\n\t\tif ($mode == 'single')\n\t\t{\n\t\t\t// remove_common('single', 4/10, $word);\n\t\t}\n\n\t\treturn;\n\t}", "function storeDictionary($conn, $username)\n{\n if(htmlentities(isset($_FILES['textfile'])))\n {\n $user = $username;\n $temp_file = htmlentities($_FILES['textfile']['tmp_name']);\n $content = file_get_contents($temp_file);\n $printed_data = $content;\n\n //split the data and store in an array\n $eachLine = explode(',', $printed_data);\n array_pop($eachLine);\n\n foreach($eachLine as $product)\n {\n $item = explode('=', $product);\n $eng = htmlentities($conn->real_escape_string($item[0]));\n $spa = htmlentities($conn->real_escape_string($item[1]));\n $trim_eng = trim($eng);\n $trim_spa = trim($spa);\n\n //to check duplicates\n $check_if_exists = \"SELECT * FROM dictionary WHERE username='$user' AND english='$trim_eng' AND spanish='$trim_spa'\";\n $check_result = $conn->query($check_if_exists);\n if(!$check_result) die(\"Database access failed:\" . $conn->error);\n $checkrows = $check_result->num_rows;\n\n //if there's duplicate then continue, else insert the word into the db.\n if($checkrows > 0){\n continue;\n $check_result->close();\n $insert_result->close();\n }\n else{\n $insert_dictionary = \"INSERT INTO dictionary (username, english, spanish) VALUES ('$user', '$trim_eng', '$trim_spa')\" ;\n $insert_result = $conn->query($insert_dictionary);\n if(!$insert_result) echo \"INSERT failed: '$query' <br>\" . $conn->error. \"<br><br>\";\n }\n }\n }\n}" ]
[ "0.6201011", "0.61349446", "0.585257", "0.567816", "0.56154186", "0.55890113", "0.5557674", "0.55357987", "0.55022246", "0.5471551", "0.5453876", "0.5388177", "0.5333931", "0.53241104", "0.5317736", "0.5311957", "0.5308728", "0.52937865", "0.5289119", "0.52833104", "0.5266835", "0.5258341", "0.52530295", "0.52468663", "0.5233245", "0.5224449", "0.5219633", "0.51802754", "0.51663953", "0.51518685" ]
0.6540614
0
Matches a search word in the wordlist Creates a list of matches that is used by OpenIE to find relations
public function matchSearchTerm($searchTerm, $wordList){ $matches = array(); foreach($wordList as $type => $nodes){ foreach($nodes as $node){ if($node['value'] == $searchTerm){ $matches[$node['openieId']] = $type; } } } return $matches; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matching_words($query_words_list, $protein_subject_words_list) {\n $index = 0;\n $query_size = count($query_words_list);\n $matching_words_indices = array();\n\n // go through the whole query words list\n while ($index < $query_size) {\n // key — Fetch a key from an array\n $query_word_key = key($query_words_list[$index]);\n $db_index = 0;\n $db_size = count($protein_subject_words_list);\n\n // go through each database word list\n while ($db_index < $db_size) {\n $word_index_match = array();\n $db_word_key = key($protein_subject_words_list[$db_index]);\n // Returns < 0 if str1 is less than str2; > 0 if str1 is greater \n // than str2, and 0 if they are equal.\n $word_match = strcmp($query_word_key, $db_word_key);\n // if query word match with database then push it to array\n if ($word_match == 0) {\n $query_word_index = $query_words_list[$index][$query_word_key];\n $db_word_index = $protein_subject_words_list[$db_index][$db_word_key];\n $word_index_match = array($query_word_index, $db_word_index);\n array_push($matching_words_indices, $word_index_match);\n }\n $db_index++;\n } // end db\n $index++;\n }\n\n return $matching_words_indices;\n}", "public function apply()\r\n\t{\r\n\t\t// --------------------------------------\r\n\t\t// Initiate some variables used later on\r\n\t\t// --------------------------------------\r\n\r\n\t\t$words = $lookup = $found = array();\r\n\r\n\t\t// --------------------------------------\r\n\t\t// Get tagdata to search through\r\n\t\t// --------------------------------------\r\n\r\n\t\t$haystack = $this->EE->TMPL->tagdata;\r\n\r\n\t\t// --------------------------------------\r\n\t\t// Get tag parameters\r\n\t\t// --------------------------------------\r\n\r\n\t\tforeach (array('site', 'channel', 'field', 'tag') AS $attr)\r\n\t\t{\r\n\t\t\t$$attr = $this->EE->TMPL->fetch_param($attr);\r\n\t\t}\r\n\r\n\t\t// --------------------------------------\r\n\t\t// Compose regex used to search haystack\r\n\t\t// --------------------------------------\r\n\r\n\t\t$pattern = '#' .preg_quote(self::LD). '(.*?)' .preg_quote(self::RD). '#';\r\n\r\n\t\t// --------------------------------------\r\n\t\t// Search text\r\n\t\t// --------------------------------------\r\n\r\n\t\tif (preg_match_all($pattern, $haystack, $matches))\r\n\t\t{\r\n\t\t\t// Loop through matches\r\n\t\t\tforeach ($matches[0] AS $i => $match)\r\n\t\t\t{\r\n\t\t\t\t// See if the linked word is different from the search word: [[Search word | linked word]]\r\n\t\t\t\t$word = explode(self::MD, $matches[1][$i], 2);\r\n\t\t\t\t\r\n\t\t\t\t// Set linked word to search word if not explicitly given\r\n\t\t\t\tif (count($word) == 1)\r\n\t\t\t\t{\r\n\t\t\t\t\t$word[1] = $word[0];\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// save to words and lookup array\r\n\t\t\t\t$words[$match] = $word;\r\n\t\t\t\t$lookup[] = $word[0];\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Nothing found, just return without doing anything\r\n\t\t\treturn $haystack;\r\n\t\t}\r\n\r\n\t\t// --------------------------------------\r\n\t\t// Which site?\r\n\t\t// --------------------------------------\r\n\r\n\t\tif ($site)\r\n\t\t{\r\n\t\t\t$query = $this->EE->db->select('site_id')->from('sites')->where('site_name', $site)->get();\r\n\t\t\t$site_id = $query->num_rows() ? $query->row('site_id') : $this->EE->config->item('site_id');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$site_id = $this->EE->config->item('site_id');\r\n\t\t}\r\n\r\n\t\t// --------------------------------------\r\n\t\t// Determine which fields to select from DB\r\n\t\t// --------------------------------------\r\n\r\n\t\t$sql_select = array('t.entry_id', 't.url_title');\r\n\r\n\t\tif (isset($this->EE->session->cache['channel'][$site_id][$field]))\r\n\t\t{\r\n\t\t\t$sql_attr = 'd.field_id_'.$this->EE->session->cache['channel'][$site_id][$field];\r\n\t\t\t$data_join = TRUE;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$sql_attr = 't.title';\r\n\t\t\t$data_join = FALSE;\r\n\t\t}\r\n\r\n\t\t// --------------------------------------\r\n\t\t// Insert generic @monooso mockery here\r\n\t\t// --------------------------------------\r\n\r\n\t\t$sql_select[] = $sql_attr.' AS word';\r\n\r\n\t\t// --------------------------------------\r\n\t\t// Query DB to lookup words\r\n\t\t// --------------------------------------\r\n\t\t\r\n\t\t$this->EE->db->select(implode(',', $sql_select))\r\n\t\t ->from('channel_titles t')\r\n\t\t ->where('t.site_id', $site_id)\r\n\t\t ->where_in($sql_attr, $lookup);\r\n\t\t\r\n\t\t// Filter words by channel\r\n\t\tif ($channel)\r\n\t\t{\r\n\t\t\t$this->EE->db->join('channels c', 'c.channel_id = t.channel_id')\r\n\t\t\t ->where('channel_name', $channel);\r\n\t\t}\r\n\r\n\t\t// Join exp_channel_data if necessary\r\n\t\tif ($data_join)\r\n\t\t{\r\n\t\t\t$this->EE->db->join('channel_data d', 'd.entry_id = t.entry_id');\r\n\t\t}\r\n\t\t\r\n\t\t$query = $this->EE->db->get();\r\n\r\n\t\t// Get results and put them in the Found array for later reference\r\n\t\tforeach ($query->result_array() AS $row)\r\n\t\t{\r\n\t\t\t$found[strtolower($row['word'])] = $row;\r\n\t\t}\r\n\r\n\t\t// --------------------------------------\r\n\t\t// Get tag and tag attrinbutes\r\n\t\t// --------------------------------------\r\n\r\n\t\t// Tag defaults to <a>\r\n\t\t$tag = ($tag) ? $tag : 'a';\r\n\r\n\t\t// Init attributes array\r\n\t\t$tagparams = array();\r\n\r\n\t\t// Look for tag:something parameters\r\n\t\tforeach ($this->EE->TMPL->tagparams AS $key => $val)\r\n\t\t{\r\n\t\t\tif (substr($key, 0, 4) == 'tag:')\r\n\t\t\t{\r\n\t\t\t\t$tagparams[substr($key, 4)] = $val;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// --------------------------------------\r\n\t\t// Loop through words and replace them\r\n\t\t// --------------------------------------\r\n\r\n\t\tforeach ($words AS $marker => $word)\r\n\t\t{\r\n\t\t\t$lower_word = strtolower($word[0]);\r\n\r\n\t\t\tif (array_key_exists($lower_word, $found))\r\n\t\t\t{\r\n\t\t\t\t$attrs = '';\r\n\r\n\t\t\t\tforeach ($tagparams AS $key => $val)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Replace markers in values with current entry_id and url_title\r\n\t\t\t\t\t$val = str_replace(\r\n\t\t\t\t\t\tarray('%%entry_id%%', '%%url_title%%'),\r\n\t\t\t\t\t\tarray($found[$lower_word]['entry_id'], $found[$lower_word]['url_title']),\r\n\t\t\t\t\t\t$val\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\t// create url\r\n\t\t\t\t\tif (in_array($key, array('href', 'src')) && ! (substr($val, 0, 4) == 'http' || substr($val, 0, 1) == '/'))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$val = $this->EE->functions->create_url($val);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$attrs .= ' '.$key.'=\"'.$val.'\"';\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Create replacement tag\r\n\t\t\t\t$replacement = \"<{$tag}{$attrs}>{$word[1]}</{$tag}>\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$replacement = $word[1];\r\n\t\t\t}\r\n\r\n\t\t\t$haystack = str_replace($marker, $replacement, $haystack);\r\n\t\t}\r\n\r\n\t\t// --------------------------------------\r\n\t\t// Parse template vars\r\n\t\t// --------------------------------------\r\n\r\n\t\t$this->return_data = $haystack;\r\n\r\n\t\t// --------------------------------------\r\n\t\t// Like a movie, like a style\r\n\t\t// --------------------------------------\r\n\r\n\t\treturn $this->return_data;\r\n\t}", "protected function searchForWords()\n {\n $result = [];\n foreach ($this->words as $tokenizedWord) {\n $tokenizedWordAsObject = (object)$tokenizedWord;\n $tokenizedWord = $tokenizedWordAsObject->t;\n\n if (array_key_exists($tokenizedWord, $this->index)) {\n foreach ($this->index[$tokenizedWord] as $file) {\n\n $key = strval($file->f);\n if (array_key_exists($key, $result)) {\n $result[$key]['weight'] *= $file->w * $tokenizedWordAsObject->w;\n } else {\n $result[$key] = [\n 'file' => $this->files->{$key},\n 'weight' => $file->w * $tokenizedWordAsObject->w\n ];\n }\n }\n }\n }\n return $result;\n }", "function search($file, $list, $keyword = null) {\n\t\t\t\t$listString = \"\";\n\t\t\t\t$first = true;\n\t\t\t\t//cycle through the list of search criteria to search for from the resume\n\t\t\t\tfor($x = 0; $x < count($list); $x++) {\n\t\t\t\t\t//if abbreviations are applicable to the search criteria, search for both the abbreviations and the full keyword. If abbreviations are not applicable, just search for the full keyword name\n\t\t\t\t\tif (array_key_exists('abbreviations', $list[$x])) {\n\t\t\t\t\t\t$searchWord = $list[$x][\"{$keyword}\"];\n\t\t\t\t\t\t$searchAbbr = $list[$x][\"abbreviations\"];\n\t\t\t\t\t\t$searchWord = str_replace('+', '\\+', $searchWord);\n\t\t\t\t\t\t$cont = FALSE;\n\t\t\t\t\t\tif ((!empty($searchWord)) && (preg_match(\"/\\b$searchWord/i\",$file))) {\n\t\t\t\t\t\t\t$cont = TRUE;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((!empty($searchAbbr)) && (preg_match(\"/\\b$searchAbbr\\b/\",$file))) {\n\t\t\t\t\t\t\t$cont = TRUE;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($cont) {\n\t\t\t\t\t\t\t$add = \"\";\n\t\t\t\t\t\t\tif($first == false) {\n\t\t\t\t\t\t\t\t$listString = $listString.\",\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!empty($list[$x][\"abbreviations\"])) {\n\t\t\t\t\t\t\t\t$add .= $list[$x][\"abbreviations\"].\": \";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$add .= $list[$x][\"{$keyword}\"];\n\t\t\t\t\t\t\t$listString = $listString.\"$add\";\n\t\t\t\t\t\t\t$first = false;\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\tif(stripos($file, $list[$x])) {\n\t\t\t\t\t\t\tif($first == false) {\n\t\t\t\t\t\t\t\t$listString = $listString.\",\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$add = $list[$x];\n\t\t\t\t\t\t\t$listString = $listString.\"$add\";\n\t\t\t\t\t\t\t$first = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $listString;\n\t\t\t}", "private function _getSearchStringQuery()\n {\n $words = [];\n //split string depend on quote\n preg_match_all('/\"(?:\\\\\\\\.|[^\\\\\\\\\"])*\"|\\S+/', Input::get('search.value'), $matches);\n if (!empty($matches[0])) {\n //remove quote in each part\n foreach ($matches[0] as $key => $word) {\n $words[$key] = preg_replace('/\"|\\'/', '', $word);\n if (empty($words[$key])) {\n unset($words[$key]);\n }\n }\n //create query with each search column\n foreach ($this->column_search as $item) {\n // create query with each part of search string\n $this->query->where( function($q) use($item, $words) {\n $q->where($item, 'like', '%'.$words[0].'%');\n $wordNumb = count($words);\n for ($i = 1; $i < $wordNumb; $i++) {\n $q->orWhere($item, 'like', '%'.$words[$i].'%');\n }\n });\n }\n }\n // store to hightligh matching word in title of document\n $this->sSearch = $words;\n }", "function getSimilarWords($content) {\n $words = processContent($content);\n $suggestions = array();\n foreach ($words as $word) {\n $result = sql_query(\"SELECT * FROM `words`\");\n $shortest = -1;\n while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {\n // could use similar_text, but doing so is less efficient\n $lev = levenshtein($word, $row[\"word\"]);\n // check for an exact match\n \n if ($lev == 0) {\n $closest = $word;\n $shortest = 0;\n // break out of the loop; we've found an exact match\n break;\n }\n \n // if this distance is less than the next found shortest\n // distance, OR if a next shortest word has not yet been found\n if ($lev <= $shortest || $shortest < 0) {\n // set the closest match, and shortest distance\n $closest = $row[\"word\"];\n $shortest = $lev;\n }\n }\n if ($closest != $word) {\n $suggestions[$word] = $closest;\n }\n }\n return $suggestions;\n }", "public function searchWordList(string $pattern)\n {\n $results = [];\n $reader = $this->getWordBatch();\n foreach ($reader as $batch) {\n $matchCount = preg_match_all($pattern, $batch, $matches);\n if ($matchCount > 0) {\n foreach ($matches[0] as $match) {\n $results[] = $match;\n }\n }\n }\n return $results;\n }", "protected function matched(): array\n {\n $s = mb_strtolower($this->searchKey);\n $foundRecords = [];\n foreach ($this->source->getRecords() as $index => $word) {\n $found = mb_strpos($s, mb_strtolower($word));\n if (false !== $found) {\n $foundRecords[$index] = intval($found);\n }\n }\n return $foundRecords;\n }", "static public function searchPartial($word)\n {\n\t\t$word = Tools::alpha($word);\n\t\t$records = null;\n\n\t\tif (!isset($word))\n\t\t{\n\t\t\t// show full list\n\t\t\treturn Definition::getIndex();\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$records = Definition::select()\n\t\t\t\t->where('deleted_at', null)\n \t\t\t->where('type_flag', DEFTYPE_DICTIONARY)\n\t\t\t\t->where(function ($query) use ($word){$query\n\t\t\t\t\t->where('title', 'LIKE', $word . '%')\t\t\t\t\t\t\t// exact match of title\n\t\t\t\t\t->orWhere('forms', 'LIKE', '%;' . $word . ';%')\t\t\t\t\t// exact match of \";word;\"\n\t\t\t\t\t->orWhere('conjugations_search', 'LIKE', '%;' . $word . '%;%') \t// exact match of \";word;\"\n\t\t\t\t\t;})\n\t\t\t\t->orderBy('title')\n\t\t\t\t->get();\n\n\t\t\tif (false && !isset($record)) // not yet\n\t\t\t{\n\t\t\t\t$record = self::searchDeeper($word);\n\t\t\t}\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\t$msg = 'Error getting word: ' . $word;\n\t\t\tEvent::logException(LOG_MODEL, LOG_ACTION_SELECT, $word, null, $msg . ': ' . $e->getMessage());\n\t\t\tTools::flash('danger', $msg);\n\t\t}\n\n\t\t//dd($records);\n\n\t\treturn $records;\n\t}", "function mx_add_search_words($mode, $post_id, $post_text, $post_title = '', $mx_mode = 'mx')\n\t{\n\t\tglobal $db, $config, $lang;\n\n\t\t// $search_match_table = SEARCH_MATCH_TABLE;\n\t\t// $search_word_table = SEARCH_WORD_TABLE;\n\n\t\tswitch ($mx_mode)\n\t\t{\n\t\t\tcase 'mx':\n\t\t\t\t$search_match_table = MX_MATCH_TABLE;\n\t\t\t\t$search_word_table = MX_WORD_TABLE;\n\t\t\t\t$db_key = 'block_id';\n\t\t\tbreak;\n\t\t\tcase 'kb':\n\t\t\t\t$search_match_table = KB_MATCH_TABLE;\n\t\t\t\t$search_word_table = KB_WORD_TABLE;\n\t\t\t\t$db_key = 'article_id';\n\t\t\tbreak;\n\t\t}\n\n\t\tstopwords_synonyms_init();\n\n\t\t$search_raw_words = array();\n\t\t$search_raw_words['text'] = split_words(clean_words('post', $post_text, $stopwords_array, $synonyms_array));\n\t\t$search_raw_words['title'] = split_words(clean_words('post', $post_title, $stopwords_array, $synonyms_array));\n\n\t\t@set_time_limit(0);\n\n\t\t$word = array();\n\t\t$word_insert_sql = array();\n\t\twhile (list($word_in, $search_matches) = @each($search_raw_words))\n\t\t{\n\t\t\t$word_insert_sql[$word_in] = '';\n\t\t\tif (!empty($search_matches))\n\t\t\t{\n\t\t\t\tfor ($i = 0; $i < sizeof($search_matches); $i++)\n\t\t\t\t{\n\t\t\t\t\t$search_matches[$i] = trim($search_matches[$i]);\n\n\t\t\t\t\tif($search_matches[$i] != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$word[] = $search_matches[$i];\n\t\t\t\t\t\tif (!strstr($word_insert_sql[$word_in], \"'\" . $search_matches[$i] . \"'\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$word_insert_sql[$word_in] .= ($word_insert_sql[$word_in] != \"\") ? \", '\" . $search_matches[$i] . \"'\" : \"'\" . $search_matches[$i] . \"'\";\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\tif (sizeof($word))\n\t\t{\n\t\t\tsort($word);\n\n\t\t\t$prev_word = '';\n\t\t\t$word_text_sql = '';\n\t\t\t$temp_word = array();\n\t\t\tfor($i = 0; $i < sizeof($word); $i++)\n\t\t\t{\n\t\t\t\tif ($word[$i] != $prev_word)\n\t\t\t\t{\n\t\t\t\t\t$temp_word[] = $word[$i];\n\t\t\t\t\t$word_text_sql .= (($word_text_sql != '') ? ', ' : '') . \"'\" . $word[$i] . \"'\";\n\t\t\t\t}\n\t\t\t\t$prev_word = $word[$i];\n\t\t\t}\n\t\t\t$word = $temp_word;\n\n\t\t\t$check_words = array();\n\n\t\t\t$value_sql = '';\n\t\t\t$match_word = array();\n\t\t\tfor ($i = 0; $i < sizeof($word); $i++)\n\t\t\t{\n\t\t\t\t$new_match = true;\n\t\t\t\tif (isset($check_words[$word[$i]]))\n\t\t\t\t{\n\t\t\t\t\t$new_match = false;\n\t\t\t\t}\n\n\t\t\t\tif ($new_match)\n\t\t\t\t{\n\t\t\t\t\t$value_sql .= (($value_sql != '') ? ', ' : '') . '(\\'' . $word[$i] . '\\', 0)';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($value_sql != '')\n\t\t\t{\n\t\t\t\t$sql = \"INSERT IGNORE INTO \" . $search_word_table . \" (word_text, word_common) VALUES $value_sql\";\n\t\t\t\t$db->sql_query($sql);\n\t\t\t}\n\t\t}\n\n\t\twhile(list($word_in, $match_sql) = @each($word_insert_sql))\n\t\t{\n\t\t\t$title_match = ($word_in == 'title') ? 1 : 0;\n\n\t\t\tif ($match_sql != '')\n\t\t\t{\n\t\t\t\t$sql = \"INSERT INTO \" . $search_match_table . \" ($db_key, word_id, title_match)\n\t\t\t\t\tSELECT $post_id, word_id, $title_match\n\t\t\t\t\t\tFROM \" . $search_word_table . \"\n\t\t\t\t\t\tWHERE word_text IN ($match_sql)\";\n\t\t\t\t$db->sql_query($sql);\n\t\t\t}\n\t\t}\n\n\t\tif ($mode == 'single')\n\t\t{\n\t\t\t// remove_common('single', 4/10, $word);\n\t\t}\n\n\t\treturn;\n\t}", "public function searchForPlayList();", "function dbListProductsSearch( $iStatus, $sWord, $iList ){\n\n $aFile = file( DB_PRODUCTS );\n $iCount = count( $aFile );\n $iFindPage = 0;\n $iFindAll = 0;\n $aCategories = dbThrowProductCategories( );\n $sWord = preg_quote( $sWord );\n\n for( $i = 1; $i < $iCount; $i++ ){\n $aExp = explode( '$', $aFile[$i] );\n if( isset( $aCategories[$aExp[0]] ) && $aExp[4] >= $iStatus && eregi( $sWord, $aFile[$i] ) ){\n $iFindPage++;\n $iFindAll++;\n \n if( $iFindPage == 1 )\n $aPageStart[] = $i;\n\n if( isset( $aPageStart[$GLOBALS['iPage'] - 1] ) && !isset( $aPageEnd[$GLOBALS['iPage'] - 1] ) ){\n $aData[] = $aExp;\n }\n\n if( $iFindPage == $iList ){\n $aPageEnd[] = $i;\n $iFindPage = 0;\n }\n }\n } // end for\n\n if( isset( $aData ) ){\n $aData[0]['iFindAll'] = $iFindAll;\n return $aData;\n }\n else\n return null;\n }", "private function _highlightMatchingWord($datas)\n {\n $numResult = count($datas);\n for ($i = 0; $i < $numResult; $i++) {\n //store how much word matching\n $match = 0;\n //searching each word in title\n foreach ($this->sSearch as $word) {\n $pos = mb_stripos($datas[$i]->title, $word);\n if (is_numeric($pos) && (strlen($word) > 1)) {\n $word = mb_strtolower($word);\n $datas[$i]->title = mb_strtolower($datas[$i]->title);\n $datas[$i]->title = str_ireplace(\n $word,\n \"<b style='background-color:#ffc107;'>$word</b>\",\n $datas[$i]->title\n );\n $match++;\n }\n }\n //push to each array depend on how much word matching\n if ($match) {\n $part[$match][] = $datas[$i];\n }\n }\n //merge all document ordered by matching number form hight to low\n $wordNumb = count($this->sSearch);\n $partTmp = [];\n for ($j = $wordNumb; $j > 0; $j--) {\n if (isset($part[$j])) {\n foreach ($part[$j] as $value) {\n $partTmp[] = $value;\n }\n }\n }\n // store total of matching title\n $this->count_filtered = count($partTmp);\n // paging by cutting array\n $end = Input::get('start') + Input::get('length');\n $tmp = [];\n for ($i = Input::get('start'); $i < $end; $i++) {\n if (isset($partTmp[$i])) {\n $tmp[] = $partTmp[$i];\n }\n }\n return $tmp;\n }", "function obtain_word_list(&$orig_word, &$replacement_word)\n{\n\tglobal $db;\n\n\t//\n\t// Define censored word matches\n\t//\n\t$sql = \"SELECT word, replacement\n\t\tFROM \" . WORDS_TABLE;\n\tif( !($result = $db->sql_query($sql)) )\n\t{\n\t\tmessage_die(GENERAL_ERROR, 'Could not get censored words from database', '', __LINE__, __FILE__, $sql);\n\t}\n\n\tif ( $row = $db->sql_fetchrow($result) )\n\t{\n\t\tdo \n\t\t{\n\t\t\t$orig_word[] = '#\\b(' . str_replace('\\*', '\\w*?', preg_quote($row['word'], '#')) . ')\\b#i';\n\t\t\t$replacement_word[] = $row['replacement'];\n\t\t}\n\t\twhile ( $row = $db->sql_fetchrow($result) );\n\t}\n\n\treturn true;\n}", "function search() {}", "public function search();", "public function search();", "public function searchWordToConditions($search_word = null)\n {\n //全角スペースは半角スペースに変換しておく\n $search_word = str_replace(' ', ' ', $search_word);\n \n //and検索\n $array_word = explode(' ', $search_word);\n \n $search_conditions = [];\n foreach ($array_word as $val) {\n $search_conditions[] = array(\n 'or' => array(\n 'Event.title LIKE' => '%' . $val . '%',\n 'EventsDetail.title LIKE' => '%' . $val . '%'\n )\n );\n }\n \n return $search_conditions;\n }", "public function StringSearchForAllWords()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_search_string_all_words;\n }", "public function findWords(array $data)\r\n {\r\n return $this->word->findWords($data);\r\n }", "static public function searchGeneral($word)\n {\n\t\t$word = Tools::alpha($word);\n\t\t$records = null;\n\n\t\tif (!isset($word))\n\t\t{\n\t\t\t// show full list\n\t\t\treturn Definition::getIndex();\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$records = Definition::select()\n\t\t\t\t->where('deleted_at', null)\n \t\t\t->where('type_flag', DEFTYPE_DICTIONARY)\n\t\t\t\t->where(function ($query) use ($word){$query\n\t\t\t\t\t->where('title', 'LIKE', $word . '%')\n\t\t\t\t\t->orWhere('forms', 'LIKE', '%' . $word . '%')\n\t\t\t\t\t->orWhere('conjugations_search', 'LIKE', '%' . $word . '%')\n\t\t\t\t\t->orWhere('translation_en', 'LIKE', '%' . $word . '%')\n\t\t\t\t\t;})\n\t\t\t\t->orderBy('title')\n\t\t\t\t->get();\n\n\t\t\tif (false && !isset($record)) // not yet\n\t\t\t{\n\t\t\t\t$record = self::searchDeeper($word);\n\t\t\t}\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\t$msg = 'Error getting word: ' . $word;\n\t\t\tEvent::logException(LOG_MODEL, LOG_ACTION_SELECT, $word, null, $msg . ': ' . $e->getMessage());\n\t\t\tTools::flash('danger', $msg);\n\t\t}\n\n\t\t//dd($records);\n\n\t\treturn $records;\n\t}", "public function matchedDocs()\n {\n return $this->_resVector;\n }", "public function searchWord($dataset = array(), $datalatih = array()){\n\n\t$data = array();\n\t$term = array_unique($datalatih);// menghilangkan array yg duplikat\n\n\tfor($i=0; $i<count($dataset); $i++){\n\t\t$key[$i] = 0;\n\t\tforeach($dataset[$i]['stopword'] AS $keys => $value){\n\t\t\t$data[$i][$key[$i]] = array($key[$i] => $value);\n\t\t\t$key[$i] ++;\n\t\t}\n\t}\n\n\tforeach ($term as $keys => $val) {\n\t\tfor($x = 0; $x < count($data); $x++) {\n\t\t\t$sum[$x] = 0;\n\t\t\tfor($y = 0; $y < count($data[$x]); $y++) {\n\t\t\t\tforeach ($data[$x][$y] as $key => $value) {\n\t\t\t\t\tif($val == $value) {\n\t\t\t\t\t\t$nilai = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t \t$nilai = 0; \n\t\t\t\t\t}\n\t\t\t\t\t$sum[$x] += $nilai;\n\t\t\t\t} \n\t\t\t}\n\n\t\t\t$params[$x] = array($val, $sum[$x]);\n\t\t}\n\n\t\t$df[$keys] = $params;\n\n\t}\n\n\treturn $df;\n\n}", "function listAllWithSearch($term) \r\n {\r\n\r\n $newTerm = \"%\".$term.\"%\";\r\n\r\n //new PDOAgent\r\n $p = new PDOAgent(\"mysql\", DB_USER, DB_PASS, DB_HOST, DB_NAME);\r\n\r\n //Connect to the Database\r\n $p->connect();\r\n\r\n //Setup the Bind Parameters\r\n $bindParams = [\"term\"=>$newTerm];\r\n \r\n //Get the results of the insert query (rows inserted)\r\n $results = $p->query(\"SELECT * FROM Coaches WHERE coachFName LIKE :term OR\r\n coachLName LIKE :term OR salary LIKE :term OR teamName LIKE :term \r\n OR dateStarted LIKE :term OR endOfContract LIKE :term;\", $bindParams);\r\n \r\n //Disconnect from the database\r\n $p->disconnect();\r\n \r\n //Return the objects\r\n return $results;\r\n }", "public function indexedWordQuery($words, $search_data)\n\t{\n\t\tglobal $settings;\n\n\t\t$query_select = array(\n\t\t\t'id_msg' => 'm.id_msg',\n\t\t);\n\t\t$query_inner_join = array();\n\t\t$query_left_join = array();\n\t\t$query_where = array();\n\t\t$query_params = $search_data['params'];\n\n\t\tif ($query_params['id_search'])\n\t\t\t$query_select['id_search'] = '{int:id_search}';\n\n\t\t$count = 0;\n\t\tforeach ($words['words'] as $regularWord)\n\t\t{\n\t\t\t$query_where[] = 'm.body' . (in_array($regularWord, $query_params['excluded_words']) ? ' NOT' : '') . (empty($settings['search_match_words']) || $search_data['no_regexp'] ? ' LIKE ' : ' RLIKE ') . '{string:complex_body_' . $count . '}';\n\t\t\t$query_params['complex_body_' . $count++] = empty($settings['search_match_words']) || $search_data['no_regexp'] ? '%' . strtr($regularWord, array('_' => '\\\\_', '%' => '\\\\%')) . '%' : '[[:<:]]' . addcslashes(preg_replace(array('/([\\[\\]$.+*?|{}()])/'), array('[$1]'), $regularWord), '\\\\\\'') . '[[:>:]]';\n\t\t}\n\n\t\tif ($query_params['user_query'])\n\t\t\t$query_where[] = '{raw:user_query}';\n\t\tif ($query_params['board_query'])\n\t\t\t$query_where[] = 'm.id_board {raw:board_query}';\n\n\t\tif ($query_params['topic'])\n\t\t\t$query_where[] = 'm.id_topic = {int:topic}';\n\t\tif ($query_params['min_msg_id'])\n\t\t\t$query_where[] = 'm.id_msg >= {int:min_msg_id}';\n\t\tif ($query_params['max_msg_id'])\n\t\t\t$query_where[] = 'm.id_msg <= {int:max_msg_id}';\n\n\t\t$count = 0;\n\t\tif (!empty($query_params['excluded_phrases']) && empty($settings['search_force_index']))\n\t\t\tforeach ($query_params['excluded_phrases'] as $phrase)\n\t\t\t{\n\t\t\t\t$query_where[] = 'subject NOT ' . (empty($settings['search_match_words']) || $search_data['no_regexp'] ? ' LIKE ' : ' RLIKE ') . '{string:exclude_subject_phrase_' . $count . '}';\n\t\t\t\t$query_params['exclude_subject_phrase_' . $count++] = empty($settings['search_match_words']) || $search_data['no_regexp'] ? '%' . strtr($phrase, array('_' => '\\\\_', '%' => '\\\\%')) . '%' : '[[:<:]]' . addcslashes(preg_replace(array('/([\\[\\]$.+*?|{}()])/'), array('[$1]'), $phrase), '\\\\\\'') . '[[:>:]]';\n\t\t\t}\n\t\t$count = 0;\n\t\tif (!empty($query_params['excluded_subject_words']) && empty($settings['search_force_index']))\n\t\t\tforeach ($query_params['excluded_subject_words'] as $excludedWord)\n\t\t\t{\n\t\t\t\t$query_where[] = 'subject NOT ' . (empty($settings['search_match_words']) || $search_data['no_regexp'] ? ' LIKE ' : ' RLIKE ') . '{string:exclude_subject_words_' . $count . '}';\n\t\t\t\t$query_params['exclude_subject_words_' . $count++] = empty($settings['search_match_words']) || $search_data['no_regexp'] ? '%' . strtr($excludedWord, array('_' => '\\\\_', '%' => '\\\\%')) . '%' : '[[:<:]]' . addcslashes(preg_replace(array('/([\\[\\]$.+*?|{}()])/'), array('[$1]'), $excludedWord), '\\\\\\'') . '[[:>:]]';\n\t\t\t}\n\n\t\t$numTables = 0;\n\t\t$prev_join = 0;\n\t\tforeach ($words['indexed_words'] as $indexedWord)\n\t\t{\n\t\t\t$numTables++;\n\t\t\tif (in_array($indexedWord, $query_params['excluded_index_words']))\n\t\t\t{\n\t\t\t\t$query_left_join[] = '{db_prefix}log_search_words AS lsw' . $numTables . ' ON (lsw' . $numTables . '.id_word = ' . $indexedWord . ' AND lsw' . $numTables . '.id_msg = m.id_msg)';\n\t\t\t\t$query_where[] = '(lsw' . $numTables . '.id_word IS NULL)';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$query_inner_join[] = '{db_prefix}log_search_words AS lsw' . $numTables . ' ON (lsw' . $numTables . '.id_msg = ' . ($prev_join === 0 ? 'm' : 'lsw' . $prev_join) . '.id_msg)';\n\t\t\t\t$query_where[] = 'lsw' . $numTables . '.id_word = ' . $indexedWord;\n\t\t\t\t$prev_join = $numTables;\n\t\t\t}\n\t\t}\n\n\t\t$ignoreRequest = wesql::query('\n\t\t\tINSERT IGNORE INTO {db_prefix}' . $search_data['insert_into'] . '\n\t\t\t\t(' . implode(', ', array_keys($query_select)) . ')\n\t\t\tSELECT ' . implode(', ', $query_select) . '\n\t\t\tFROM {db_prefix}messages AS m' . (empty($query_inner_join) ? '' : '\n\t\t\t\tINNER JOIN ' . implode('\n\t\t\t\tINNER JOIN ', $query_inner_join)) . (empty($query_left_join) ? '' : '\n\t\t\t\tLEFT JOIN ' . implode('\n\t\t\t\tLEFT JOIN ', $query_left_join)) . '\n\t\t\tWHERE ' . implode('\n\t\t\t\tAND ', $query_where) . (empty($search_data['max_results']) ? '' : '\n\t\t\tLIMIT ' . ($search_data['max_results'] - $search_data['indexed_results'])),\n\t\t\t$query_params\n\t\t);\n\n\t\treturn $ignoreRequest;\n\t}", "function getWords($words){\n $wordArray = str_word_count($words,1);\n global $flag_q; //flag for quotes\n\n //to add to the query string synonyms\n $synonyms = get_synonyms($words);\n\n foreach($synonyms as $synonym){\n $wordArray[] = $synonym;\n }\n\n if(!$flag_q) {\n //to handle expression with operator and stop word\n $wordArray = array_diff($wordArray, array('and', 'or', 'not', 'And', 'Or', 'Not', 'OR', 'AND', 'NOT'));\n }\n\n $wordsToSend = \"\";\n //aggregate all of the word searched for the query string to bold later\n foreach($wordArray as $word){\n $wordsToSend .= \"words[]=\" . $word . \"&\";\n }\n\n $wordsToSend = substr($wordsToSend, 0, -1);\n return $wordsToSend;\n}", "static public function search($word)\n {\n\t\t$word = Tools::alphanum($word, /* strict = */ true);\n\t\t$record = null;\n\n\t\ttry\n\t\t{\n\t\t\t$record = Definition::select()\n\t\t\t\t->where('deleted_at', null)\n \t\t\t->where('type_flag', DEFTYPE_DICTIONARY)\n\t\t\t\t->where(function ($query) use ($word){$query\n\t\t\t\t\t->where('title', $word)\t\t\t\t\t\t\t\t\t\t\t// exact match of title\n\t\t\t\t\t->orWhere('forms', 'LIKE', '%;' . $word . ';%')\t\t\t\t\t// exact match of \";word;\"\n\t\t\t\t\t->orWhere('conjugations_search', 'LIKE', '%;' . $word . ';%') \t// exact match of \";word;\"\n\t\t\t\t\t;})\n\t\t\t\t->first();\n\n\t\t\tif (!isset($record))\n\t\t\t{\n\t\t\t\t$record = self::searchDeeper($word);\n\t\t\t}\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\t$msg = 'Error getting word: ' . $word;\n\t\t\tEvent::logException(LOG_MODEL, LOG_ACTION_SELECT, $word, null, $msg . ': ' . $e->getMessage());\n\t\t\tTools::flash('danger', $msg);\n\t\t}\n\n\t\t//dd($record);\n\n\t\treturn $record;\n\t}", "function find_similar_words($word, $threshold)\n {\n $similar = array();\n $tbl = 'babl_words_' . $this->lan;\n $word = addslashes( ( trim( $word ) ) );\n $sndx = substr($word, 0, 2);\n $query = \"select `word` AS word from `$tbl` where `di`=?\";\n @$result = $this->mDb->query($query, array($sndx));\n while ($res = $result->fetchRow() )\n {\n $tword = $res[\"word\"];\n $lev = levenshtein($tword, $word);\n if (count($similar) < $threshold)\n {\n $similar[$tword] = $lev;\n asort ($similar);\n }\n else\n {\n // If the array is full then if the lev is better than the worst lev\n // then update $keys = array_keys($similar);\n $last_key = $keys[count($keys) - 1];\n if ($lev < $similar[$last_key])\n {\n unset ($similar[$last_key]);\n $similar[$tword] = $lev;\n asort ($similar);\n }\n }\n }\n return $similar;\n }", "function message_search( &$data )\n {\n // Clear/init array\n // Load bad word (stopwords) list\n $this->get_bad_words();\n // put words to search in an array\n $_words = $this->_split_words( stripslashes($data['search']) );\n \n // Default boolean is 'OR';\n if(empty($data['bool']))\n {\n $data['bool'] = 'OR';\n }\n\n $comma = '';\n $_fields = '';\n foreach ($data['fields'] as $f)\n {\n $_fields .= $comma.'m.'.$f;\n $comma = ',';\n }\n \n if(!empty($data['order']))\n {\n $order = ' ORDER BY m.'.ltrim($data['order']).' ';\n }\n else\n {\n $order = \" ORDER BY m.mdate DESC \";\n }\n\n if(empty($data['limit']))\n {\n $data['limit'] = 200;\n }\n \n // Build searching sql string if boolean between words = OR\n //\n if((strtolower($data['bool']) == 'or'))\n {\n $_bool = \"OR\";\n\n // Init var\n $_or = \"\"; \n $text_sql = '(';\n // Build sql search \n foreach($_words as $str)\n {\n $text_sql .= $_or.' w.word='.crc32($str).' ';\n $_or = $_bool;\n }\n $text_sql .= ')';\n \n if($GLOBALS['B']->auth->is_user)\n {\n $w_status = 'l.status>1';\n }\n else\n {\n $w_status = 'l.status=2';\n }\n \n // The entire sql string to get documents \n $sql = \"\n SELECT DISTINCT \n {$_fields}\n FROM\n {$GLOBALS['B']->sys['db']['table_prefix']}earchive_messages AS m,\n {$GLOBALS['B']->sys['db']['table_prefix']}earchive_lists AS l,\n {$GLOBALS['B']->sys['db']['table_prefix']}earchive_words_crc32 AS w\n WHERE\n m.mid=w.mid \n AND\n m.lid=l.lid\n AND\n {$w_status}\n AND \n {$text_sql}{$order} \n LIMIT {$data['limit']}\"; \n }\n // Build searching sql string if boolean between words = AND\n //\n elseif((strtolower($data['bool']) == 'and'))\n {\n $_compare = array();\n $x = 0;\n \n foreach($_words as $_w)\n {\n $word_sql = ' word='.crc32($_w).' ';\n // Get the result for this word\n $_compare[$x] = $this->_get_result( $word_sql );\n \n if($x > 0)\n {\n // Get words which occure in both tables (AND simulation)\n $_compare[$x] = array_intersect($_compare[$x-1], $_compare[$x]);\n // Stop if the AND word relation has no results\n // $result['num'] contains the numbers of results \n // needed for the pagination class\n //\n if(count($_compare[$x]) == 0)\n {\n return FALSE;\n }\n }\n $x++;\n }\n\n // check if there are results\n if(!empty($_compare[$x-1]))\n {\n $this->_create_tmp_table();\n $this->_insert_msg_ids( $_compare[$x-1] );\n }\n else\n return FALSE;\n \n // The entire sql string to get documents \n $sql = \"\n SELECT DISTINCT \n {$_fields}\n FROM\n {$GLOBALS['B']->sys['db']['table_prefix']}earchive_messages AS m,\n {$this->tmp_search_table} AS tmp\n WHERE\n m.mid=tmp.mid {$order} \n LIMIT {$data['limit']}\";\n }\n \n $result = $GLOBALS['B']->db->query($sql);\n\n if (DB::isError($result)) \n {\n trigger_error($result->getMessage().\"\\n\\nINFO: \".$result->userinfo.\"\\n\\nFILE: \".__FILE__.\"\\nLINE: \".__LINE__, E_USER_ERROR);\n }\n\n // get var name to store the result\n $GLOBALS['B']->$data['var'] = array();\n $_result = & $GLOBALS['B']->$data['var'];\n\n if(is_object($result))\n {\n while($row = &$result->FetchRow( DB_FETCHMODE_ASSOC ))\n {\n $tmp = array();\n foreach($data['fields'] as $f)\n {\n $tmp[$f] = stripslashes($row[$f]);\n }\n $_result[] = $tmp;\n }\n } \n }", "public function get_search_strings()\n\t{\n\t\treturn $this->search_strings;\n\t}" ]
[ "0.6542435", "0.6202444", "0.61278224", "0.60425925", "0.6024874", "0.6019819", "0.60154897", "0.6004835", "0.59040576", "0.58794105", "0.587241", "0.5844331", "0.58227473", "0.5818288", "0.5773552", "0.57596505", "0.57596505", "0.57431686", "0.5720849", "0.56956834", "0.5660707", "0.5548175", "0.55346245", "0.5522148", "0.551951", "0.5519388", "0.5508587", "0.54976934", "0.54905224", "0.5490349" ]
0.7194467
0
Generate many users automatically
function generateUsers() { global $connect; for($i=0;$i<25;$i++){ $sql = 'INSERT INTO USER(ID,FIRSTNAME,LASTNAME,CITY,ADDRESS,POSTALCODE,COUNTRY,EMAIL,PASSWORD,BIRTH) VALUES(NULL,:firstname,:lastname,:city,:address,:postalcode,:country,:email,:password,:birth)'; $req = $connect->prepare($sql); $req->execute(array(':firstname' => "firstname_".$i,':lastname' => "lastname_".$i ,':city' => "ville_".$i,':address' => "address_".$i,':postalcode' => $i.$i.$i.$i.$i,':country' => "country_".$i,':email' => "email_".$i."@test.fr",':password' => md5("test"),':birth' => $i.$i.$i.$i."/01/".$i.$i)) or die(print_r($connect->erroInfo())); } header('Location: adminShowUser.php'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generate()\n {\n $this->createUsersEntity();\n }", "public function run()\n {\n for ($i = 0; $i < 100; $i++) {\n \\App\\Users::create(\n [\n 'user_login' => 'randuser' . $i,\n ]\n );\n }\n }", "protected function createRandomUsers() {\n\n $faker = Faker\\Factory::create();\n\n $Equipos = Equipos::all(); \n\n for($i=0; $i < 4; $i++) {\n User::create([\n 'name' => $faker->firstName,\n 'puntaje' => rand(1,30),\n 'lastname' => $faker->lastName,\n 'nacimiento' => Carbon::now(),\n 'fecha_visita'=> Carbon::now(),\n 'email' => $faker->email,\n 'equipo_id' => $Equipos->random(1)->id,\n 'password' => Hash::make('12345678'), //Vital guardar la contraseña encriptada o no nos vamos a poder autenticar!\n ]); \n }\n }", "public function run()\n {\n factory(App\\User::class, 10)->create()->each(function ($user) {\n $len = rand(1,10);\n\n for ($i=0; $i < $len; $i++) {\n $skill_ids[] = rand(1,12);\n $technology_ids[] = rand(1,22);\n }\n\n $user->skills()->attach($skill_ids);\n $user->technologies()->attach($technology_ids);\n });\n }", "public function run()\n {\n foreach (Partner::inRandomOrder()->get() as $partner) {\n for ($i = 0; $i < 10; $i++) {\n try {\n PartnerUser::create(['user_id' => md5(rand(0, 999999)), 'active' => rand(0, 1), 'partner_id' => $partner->id]);\n } catch (\\Exception $e) {\n // перехват Duplicate entry partner_users_user_id_unique\n }\n }\n }\n }", "public function run()\n {\n $numUsers = 50;\n $faker = Faker::create();\n for($i = 0; $i < $numUsers;$i++){\n $request = new Request([\n 'name' => $faker->name,\n 'email' => $faker->unique()->safeEmail,\n 'birthYear' => date('Y'),\n 'gender' => $faker->randomElement($array = array('male','famale')),\n 'avatarURL' => 'https://www.pcgamesn.com/wp-content/uploads/2019/04/Astroneer-My-base-900x506.jpg',\n 'password' => 'password', // password\n 'remember_token' => Str::random(10),\n ]);\n\n UserService::create_with_request($request);\n }\n }", "public function run()\n {\n $numOfUsers = 10;\n for ($i = 1; $i <= $numOfUsers; $i++){\n User::query()->create([\n 'name' => \"User $i \" . str_random(10),\n 'balance' => rand(0,10000)\n ]);\n }\n }", "public function run()\n {\n User::factory()->count(100)->create()->each(function ($user) {\n $team = Team::find(21);\n $user->teams()->attach($team);\n $user->attachRole('publisher', $team);\n \n Helper::addDefaultAvailability($user, true);\n\n });\n }", "public function run()\n {\n DB::table('user')->delete();\n\n $roles = Rol::all();\n $representantes = Representante::all();\n\n foreach(range(1, 8) as $index) {\n factory(User::class)->create([\n 'rol_id' => $roles->random()->id,\n 'representante_cedula' => $representantes->pop()->cedula\n ]);\n }\n }", "public function run()\n {\n factory(User::class, 100)->create()\n ->each(function (User $user) {\n $followees = User::query()\n ->whereNotIn('id', [$user->id])\n ->inRandomOrder()\n ->take(random_int(0, 10))\n ->get();\n $user->followees()->sync($followees->pluck('id'));\n\n $block_user = User::query()\n ->whereNotIn('id', [$user->id])\n ->inRandomOrder()\n ->firstOr();\n $user->blocking()->attach($block_user->id);\n\n $mute_user = User::query()\n ->whereNotIn('id', [$user->id])\n ->inRandomOrder()\n ->firstOr();\n $user->muting()->attach($mute_user->id);\n\n $user->tweets()->saveMany(\n factory(App\\Tweet::class, random_int(0, 1000))->make()\n );\n });\n }", "public function run()\n {\n $faker = Faker::create(\"pt_BR\");\n\n foreach( range(1, 10) as $i){\n \tUser::create([\n \t\t'nome' => $faker->name,\n \t\t'email' => $faker->freeEmail,\n \t\t'senha' => $faker->password\n \t]);\n }\n }", "public function run()\n\t{\n\t\tfor ($i = 1; $i < 6; $i++) {\n\t\t\tUser::create\n\t\t\t(\n\t\t\t\t[\n\t\t\t\t\t'name' => \"User $i\",\n\t\t\t\t\t'uid' => \"u012345$i\",\n\t\t\t\t\t'email' => \"[email protected]\",\n\t\t\t\t\t'password' => bcrypt('pass'),\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\t}", "public function run()\n {\n\n $faker=Faker::create();\n for($i = 0;$i<20;$i++){\n $user = new User;\n $user->name = $faker->name;\n $user->email = $faker->unique()->email;\n $user->password = Hash::make(\"memopays\"); \n $user->save(); \n } \n \n\n\n\n \n }", "public function run()\n {\n factory(User::class, 10)->create()->each(function ($user) {\n $user->emails()->saveMany(factory(Email::class, 2)->make());\n $user->phones()->saveMany(factory(Phone::class, 2)->make());\n });\n }", "public function run()\n {\n $faker = Faker::create();\n\n for ($i=1; $i <= 10; $i++) {\n $user = new User([\n 'username' => $faker->userName,\n 'email' => $faker->unique()->safeEmail,\n 'password' => bcrypt('secret'),\n 'student_id' => $i\n ]);\n $user->save();\n\n $user->attachRole($faker->numberBetween(1, 2));\n }\n }", "public function run()\n {\n \\App\\Models\\User::factory(5)->create()->each(function($user){\n $user->questions()->saveMany(\n \\App\\Models\\Question::factory(rand(1, 5))->create()->make()\n )->each(function($q){\n $q->answers()->saveMany(factory(App\\Models\\Answer::class, rand(1, 5))->make());\n });\n });\n }", "public function run()\n {\n foreach (range(1, 200) as $value) {\n Users::create(['user_nickname' => strlen(10), 'user_telephone' => '1828019' . rand(1000, 9999), 'user_time' => $_SERVER['REQUEST_TIME'], 'user_password' => encrypt('admin')]);\n }\n }", "public function run()\n {\n $users=App\\User::all();\n factory(App\\Profile::class,10)->create()->each(function ($profile) use ($users){\n $profile->user()->associate($users->random());\n $proflie->save();\n });\n }", "public function run()\n {\n $faker = Faker::create();\n\n foreach(range(1, 10) as $index)\n {\n User::create([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'username' => $faker->userName,\n 'password' => $faker->password,\n 'location' => $faker->text,\n 'profile_picture' => $faker->imageUrl($width = 550, $height = 550)\n ]);\n }\n }", "public function run()\n {\n factory(App\\Models\\User::class,2)->create()->each(function($user){\n $user->articles()->saveMany(factory(App\\Models\\Article::class,5)->create()->each(function($article){\n $article->categories()->saveMany(factory(App\\Models\\Category::class,rand(1,3))->make());\n }))->make();\n });\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n\n for ($i=0; $i < 10; $i++) {\n User::create([\n 'name' => $faker->userName,\n 'email' => \"[email protected]\",\n 'password' => Hash::make('password'),\n 'active' => false\n ]);\n }\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n\n $limit = 20;\n\n for ($i = 0; $i < $limit; $i++) {\n UserInGroups::create([\n 'userID'=>random_int(0, 20),\n 'groupID'=> random_int(0, 4),\n ]);\n }\n }", "public function run()\n {\n $users = factory(User::class)->times(1)->create();\n\n foreach ($users as $user) {\n echo 'User generated. Email: ' . $user->email . PHP_EOL;\n }\n }", "public function run()\n {\n\n $labels = [\n Label::factory()->count(1)->create(),\n Label::factory()->count(3)->create(),\n Label::factory()->count(5)->create()\n ]; \n\n foreach ($this->users as $user) {\n User::factory()\n ->has( Article::factory()->hasAttached($labels[mt_rand(0,2)])->count(3) )->create([\n 'name' => $user,\n 'email' => $user . '@mail.hu'\n ]);\n }\n\n /*User::factory()\n ->count(10)\n ->create();\n\n User::factory()\n ->count(5)\n ->unverified()\n ->create();*/\n }", "public function run()\n {\n $users = factory(App\\User::class, 10)\n ->create()\n ->each(function($u) {\n $u->itemsTaken()->save(factory(App\\Item::class)->make());\n $u->itemsGiven()->save(factory(App\\Item::class)->make());\n });\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n\t\t$collection = [];\n\t\tfor ($x = 0; $x < 20; $x++) {\n\t\t\t$id = $x + 1;\n \t\t$data = [\n \n\t 'username' => $faker->userName,\n\t 'email' => $faker->email,\n\t 'password' => \\Hash::make('qawsedrf'.$id),\n\t 'created_at' => date('Y-m-d H:i:s'),\n\t 'updated_at' => date('Y-m-d H:i:s'),\n\t ];\n\t array_push($collection, $data);\n\t\t}\n \n User::insert($collection);\n }", "public function run()\n {\n User::factory()\n ->count(25)\n ->hasArticles(1)\n ->create(['user_type' => User::AUTHOR]);\n }", "public function run()\n {\n $faker = Factory::create('id_ID');\n\n for ($c = 0; $c < 2; $c++){\n $user = user::create([\n 'username' => $faker->userName,\n //'email' => $faker->unique()->safeEmail,\n 'password' => bcrypt('secret'),\n 'type' => $faker->sentence('1', 'true'),\n 'created_by' => '',\n 'updated_by' => '',\n 'remember_token' => str_random(10),\n ]);\n }\n\n User::find(1)->update([\n 'username' => 'admin',\n 'type' => 'admin',\n ]);\n\n User::find(2)->update([\n 'username' => 'pegawai',\n 'type' => 'pegawai',\n ]);\n }", "public function run()\n {\n for($i=1; $i<=18; $i++)\n {\n User::create(\n [\n 'email' => 'nightmarket'.$i.'@atmtllc.com',\n 'password' => bcrypt('password'),\n 'subscribed' => '1',\n 'name' => 'Night Market Account #'.$i,\n 'username' => 'nm'.$i,\n ]);\n echo \"Created account number \" . $i .\"!\\r\\n\";\n }\n }", "public function run()\n {\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) {\n $user = User::create([\n 'name' => $faker->firstname,\n 'email' => $faker->email,\n 'password' => Hash::make('123'),\n 'url' => $faker->domainName,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }\n\n }" ]
[ "0.7765107", "0.73565406", "0.73421544", "0.7247794", "0.72263837", "0.7126828", "0.7126134", "0.71033555", "0.7051161", "0.70499974", "0.7024163", "0.7023744", "0.70157665", "0.70096755", "0.6997771", "0.6948282", "0.6946799", "0.6940183", "0.6940076", "0.6939349", "0.69316345", "0.69301677", "0.69281983", "0.6913696", "0.6907268", "0.68961334", "0.68819356", "0.6881214", "0.6879344", "0.687844" ]
0.74618286
1
Retrieve the server service (get or objects) for url construction.
public function getService() { if (preg_match('/^2\./', $this->getVersion())) { $service = 'get'; } else { $service = 'objects'; } return $service; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rest_get_server()\n {\n }", "private function get_server()\n {\n }", "public function getServiceEndpoint()\r\n {\r\n // return static::SERVICE_TESTING_URL;\r\n return static::SERVICE_PRODUCTION_URL;\r\n }", "public function getService()\n {\n return $this->send('POST', 'getService');\n }", "abstract protected function getService();", "public function get(string $service = '');", "private static function getService()\n {\n return self::$app->get(static::SERVICE_NAME);\n }", "public function getServiceType() {\n return parse_url($this->repositoryUrl, PHP_URL_HOST);\n }", "private static function getServiceInstance()\n {\n $s = self::getServiceType();\n switch ($s) {\n case 0:\n http_response_code(404);\n exit();\n case 1:\n return new RCFaxClient();\n break;\n case 2:\n return new TwilioFaxClient();\n }\n }", "private function get_server()\n\t{\n\t\treturn $this->m_server;\n\t}", "public function GetServer()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_my_server;\n }", "public static function get()\n {\n $load = [];\n foreach (self::$endpoints as $label => $uri) {\n $load[$label] = self::getServer($uri);\n }\n\n return $load;\n }", "private function Get_Server() {\n\t\treturn $this->task->getServer();\n\t\t//return $GLOBALS['server'];\n\t}", "protected function getWebServer() {}", "public static function getServiceRoot() {\n if (strtolower($_SERVER['SERVER_NAME'])=='www.palmettonewmedia.com') {\n return Config::getHTTPS() . '://www.palmettonewmedia.com/foodfinder/service';\n }\n else {\n return Config::getHTTPS() .'://' . $_SERVER['SERVER_NAME'] . '/service';\n }\n }", "abstract protected function getElisServiceUrl();", "public function getEndpoint();", "public function getEndpoint();", "public function getEndpoint();", "public function service()\r\n {\r\n return $this->service;\r\n }", "protected function getServer() {\n if (!$this->server) {\n $this->server = DrupalResourceServer::configure();\n }\n\n return $this->server;\n }", "public function getServer();", "public function getServer();", "public function service()\n {\n return $this->service;\n }", "public function getApplicationServer(): ApplicationServerInterface;", "public function getServit()\n {\n return $this->servit;\n }", "public function getServer(): ServerBag { return $this->server; }", "public function setService(){\n if($this->getRecord()->getRecordType() === \"yt\"){\n $this->service = new YoutubeService();\n }\n if($this->getRecord()->getRecordType() === \"gm\"){\n $this->service = new GoogleMapService();\n }\n }", "public function getService() // TODO: add function return type\r\n {\r\n $connection_properties = $this->get();\r\n\r\n // load the services from the services store; for connections,\r\n // make sure the service also has the connection interface\r\n $connection_type = $connection_properties['connection_type'];\r\n $connection_info = $connection_properties['connection_info'];\r\n $service = \\Flexio\\Services\\Factory::create($connection_type, $connection_info);\r\n if (!($service instanceof \\Flexio\\IFace\\IConnection))\r\n throw new \\Flexio\\Base\\Exception(\\Flexio\\Base\\Error::NO_SERVICE);\r\n\r\n // for oauth services, the access token may have been refreshed via\r\n // a refresh token, so these should be saved so that the access token\r\n // isn't refreshed in every subsequent call\r\n if ($service instanceof \\Flexio\\IFace\\IOAuthConnection)\r\n {\r\n $tokens = $service->getTokens();\r\n $connection_info = $connection_properties['connection_info'];\r\n\r\n $info_changed = false;\r\n if (!isset($connection_info))\r\n {\r\n $info_changed = true;\r\n }\r\n else\r\n {\r\n if (($connection_info['access_token'] ?? false) !== $tokens['access_token'])\r\n $info_changed = true;\r\n if (($connection_info['refresh_token'] ?? false) !== $tokens['refresh_token'])\r\n $info_changed = true;\r\n if (($connection_info['expires'] ?? false) !== $tokens['expires'])\r\n $info_changed = true;\r\n }\r\n\r\n if ($info_changed === true)\r\n $this->set([ 'connection_info' => $tokens]);\r\n }\r\n\r\n return $service;\r\n }", "public function service() {\n return $this->service;\n }" ]
[ "0.68682915", "0.6420574", "0.6300071", "0.616733", "0.6151938", "0.61112416", "0.6095185", "0.60941267", "0.60908246", "0.60751694", "0.6032252", "0.60245275", "0.60078967", "0.59445685", "0.59391165", "0.5906276", "0.5885482", "0.5885482", "0.5885482", "0.5874363", "0.58705914", "0.585853", "0.585853", "0.5831772", "0.58288", "0.5820829", "0.5790235", "0.57886285", "0.57829183", "0.5780082" ]
0.65340155
1
Retrieve the mimeType for a given pid and dsid.
public function getMimeType($pid, $dsid) { // Query for mime type. $stream = Zend_Registry::get('gateway')->query( "{$this->url}/objects/$pid/datastreams?format=xml", "//*[local-name() = 'datastream'][@dsid='" . $dsid . "']" ); return $stream->item(0)->getAttribute('mimeType'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMimetypeById($id) {\n\t\tif (!$this->mimetypes) {\n\t\t\t$this->loadMimetypes();\n\t\t}\n\t\tif (isset($this->mimetypes[$id])) {\n\t\t\treturn $this->mimetypes[$id];\n\t\t}\n\t\treturn null;\n\t}", "public static function fetchMime($id)\n {\n $file = static::data($id);\n $fileObj = new File(Configure::read('FileApi.basePath') . $file->category . DS . $file->tag . DS . $file->filename);\n\n return $fileObj->mime();\n }", "public static function mimeType($_path)\r\n {\r\n return finfo_file(finfo_open(FILEINFO_MIME_TYPE), $_path);\r\n }", "public function getMimeType($path){\n return $this->disk->mimeType($path);\n //mimeType() will only search the path under root directory\n }", "public static function mimeType($path)\n\t{\n\t\treturn finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path);\n\t}", "function mimeType($path) {\n\t\tif ($file = $this->file($path)) {\n\t\t\treturn Mime_Type::guessType($file);\n\t\t}\n\t}", "abstract public function getMimeType();", "function getMimeType() ;", "public function mimeType(): string\n {\n return $this->mimeType ??= FileSystem::mimeType($this->path);\n }", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "protected function readMimeType()\n {\n $ext = pathinfo($this->filename, PATHINFO_EXTENSION);\n $this->mimeType = PMF_Attachment_MimeType::guessByExt($ext);\n\n return $this->mimeType;\n }", "public function getMimeType() {}", "public function getMimeType() {}", "public function getMimeType() {}", "public function getMimeType() {}", "function getMimeType($filename)\n{\n\t$mimeType = '';\n\n\t// Check only existing readable files\n\tif (!file_exists($filename) || !is_readable($filename))\n\t{\n\t\treturn '';\n\t}\n\n\t// Try finfo, this is the preferred way\n\tif (function_exists('finfo_open'))\n\t{\n\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t$mimeType = finfo_file($finfo, $filename);\n\t\tfinfo_close($finfo);\n\t}\n\t// No finfo? What? lets try the old mime_content_type\n\telseif (function_exists('mime_content_type'))\n\t{\n\t\t$mimeType = mime_content_type($filename);\n\t}\n\t// Try using an exec call\n\telseif (function_exists('exec'))\n\t{\n\t\t$mimeType = @exec(\"/usr/bin/file -i -b $filename\");\n\t}\n\n\t// Still nothing? We should at least be able to get images correct\n\tif (empty($mimeType))\n\t{\n\t\t$imageData = elk_getimagesize($filename, 'none');\n\t\tif (!empty($imageData['mime']))\n\t\t{\n\t\t\t$mimeType = $imageData['mime'];\n\t\t}\n\t}\n\n\t// Account for long responses like text/plain; charset=us-ascii\n\tif (!empty($mimeType) && strpos($mimeType, ';'))\n\t{\n\t\tlist($mimeType,) = explode(';', $mimeType);\n\t}\n\n\treturn $mimeType;\n}", "public function getMimeType(): string\n {\n return $this->mimeType;\n }", "public function getMimeType(): string\n {\n return $this->mimeType;\n }", "function getMimeType ()\n\t{\n\t\treturn $this->mainType.'/'.$this->subType;\n\t}", "public function getMimeType(): string\n {\n return (string) $this->mimeType;\n }", "public function getMimeType()\n {\n return $this->mimeType;\n }", "public function getMimeType() : string\n {\n return $this->mimeType;\n }", "public function getMediaType($fileMimeType);", "function getMimeType() {\n\t\treturn $this->getParam(self::PARAM_DISTRIBUTOR_MIMETYPE);\n\t}", "public function mime(string $path)\n {\n return $this->adapter->mimeType($path);\n }", "function dt_get_short_post_myme_type( $post_id = '' ) {\n\t$mime_type = get_post_mime_type( $post_id );\n\tif ( $mime_type ) {\n\t\t$mime_type = current(explode('/', $mime_type));\n\t}\n\treturn $mime_type;\n}" ]
[ "0.6449824", "0.6321696", "0.6191946", "0.6171012", "0.6101198", "0.6045775", "0.6017324", "0.5928317", "0.5853361", "0.5836331", "0.5836331", "0.5836331", "0.5836331", "0.5836331", "0.5816346", "0.57314503", "0.57314503", "0.57314503", "0.57314503", "0.5700815", "0.5695331", "0.5695331", "0.5681928", "0.5674568", "0.5673187", "0.56689143", "0.5667195", "0.565283", "0.5630982", "0.56209403" ]
0.83234537
0
Find Area By name
public function find_by_name($name) { $this->db->where('area_name',$name); $q=$this->db->get($this->table_name); //$q=$this->db->query("SELECT GetAreaIdByName('{$name}') as id LIMIT 1"); return $q->row(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getAreaByName($name) {\n\t\t$db = Flight::db(false);\n\t\t$response = new stdClass();\n\t\t$req = $db->query(\"select MAX(idArea) as idArea from area where nameArea like '$name'\");\n\t\tif ($result = $req->fetchAll(PDO::FETCH_OBJ)) {\n\t\t\t$response->count = 1;\n\t\t\t$response->result = $result;\n\t\t} else {\n\t\t\t$response->count = 0;\n\t\t\t$response->result = \"error\";\n\t\t}\n\t\treturn Flight::json($response);\n\t}", "function __determineArea() {\n\t\t$url = $this->Area->Url->findByUrl(Router::url('/', true));\n\t\t$area = $this->Area->findById($url['Url']['area_id']);\n\t\tif (!$area) {\n\t\t\t$this->cakeError('error404');\n\t\t}\n\t\treturn $area['Area'];\n\t}", "function mapit_get_voting_area_by_name($name, $type = null) {\n global $mapit_client;\n $params = func_get_args();\n $result = $mapit_client->call('MaPit.get_voting_area_by_name', $params);\n return $result;\n}", "public function hasArea(string $name): bool {\n $area = $this->areas()->firstWhere('area_define_name', $name);\n\n return \\is_object($area);\n }", "function getArea(){}", "public function getAreaName()\n {\n return $this->area_name;\n }", "public function getCurrentArea(): AreaContract;", "abstract protected function getArea();", "function particulararea($id)\n\t{\n\t\t$getarea=\"SELECT * from area where id = $id\";\n\t\t$ggetareadata = $this->get_results( $getarea );\n\t\treturn $ggetareadata;\n\t}", "public function getArea($area_id) {\n $query = $this->db->query(\"SELECT a.area_id,a.code,a.status,a.name,c.city_id,z.zone_id,coun.country_id FROM \" . DB_PREFIX . \"area a LEFT JOIN \" . DB_PREFIX . \"city c on (c.city_id=a.city_id) LEFT JOIN \" . DB_PREFIX . \"zone z on (z.zone_id=c.zone_id) LEFT JOIN \" . DB_PREFIX . \"country coun on (coun.country_id=z.country_id) WHERE area_id = '\" . (int) $area_id . \"'\");\n\n return $query->row;\n }", "public function getAreaId()\n {\n return $this->area;\n }", "function getArea($area)\n {\n $areas = array();\n if(isset($this->areas[$area])){\n ksort($this->areas[$area]);\n $areas = $this->areas[$area];\n }\n return $areas;\n }", "public function getByIdOrDefault(string $id): AreaContract;", "public function getArea($areaId = -1) {\r\r\n //check $areaId is numeric\r\n if (!is_numeric($areaId) || ($areaId == -1) ){\r\n\t\t\t\techo 'Only numeric parameters.';\r\n\t\t\t\texit;\r\r\n }\r\r\n\r\n $select = $this->select()->where(\"area_code = ?\",$areaId);\r\t\t\r\n $result = $this->_db->fetchRow($select);\t\r\n return ($result == false) ? false : $result = $result;\t\r\r\n }", "public function testCreateArea()\n {\n $name = 'area-46';\n $this->browse(function (Browser $browser)use($name){\n\n \n $browser->visit('/admin/dashboard')\n ->type( 'name',$name)\n ->press('Add');\n \n });\n $this->assertDatabaseHas('areas',['name'=>$name]);\n \n \n\n }", "function addArea($area,$boxName,$position = 0) {\n if($this->boxRender->hasBox($boxName)){\n \n if(!isset($this->areas[$area])){\n $this->areas[$area] = array();\n }\n// if(!isset($this->areas[$area][$position])){\n// $this->areas[$area][$position] = array();\n// }\n if(!array_search($boxName, $this->areas[$area])){\n if(empty($this->areas[$area][$position])){\n $this->areas[$area][$position] = $boxName;\n }else{\n $this->areas[$area][] = $boxName;\n }\n }\n }\n return $this;\n }", "public function compare($name){\n\n $sql = \"SELECT a.nombre FROM area a WHERE a.nombre='$name' AND a.status=1\";\n \n return DB::singleRecord($sql);\n }", "public static function area($area)\n\t{\n\t //return the first to the last item :)\n\t\t$clean = explode('/',$area);\n\t\tarray_pop($clean);\n $area = array_pop($clean);\n\t\treturn $area;\n\t\t\n\t}", "public function areaName()\n {\n return $this->name[array_rand($this->name)];\n }", "function get_duo_areas() {\n \t\n }", "public function getArea($areaId) {\n $methods = array(\"areas\", $areaId);\n return $this->get($methods);\n }", "public function getAreaID() {\n return $this->get(self::AREAID);\n }", "public function getTagName ()\n\t{\n\t\treturn 'area';\n\t}", "public function getAreaId()\n {\n return $this->areaId;\n }", "public function getArea()\n {\n return $this->area;\n }", "public function getArea()\n {\n return $this->area;\n }", "public function getArea()\n {\n return $this->area;\n }", "function findByName($name) {\n \t$str_len = strlen($name);\n \ttrim($name);\n \t$name = str_replace('category', '', strtolower($name));\n \t\n\t\t$conn = Doctrine_Manager::connection();\n\t\t// query for check if location exists\n\t\t$unique_query = \"SELECT id FROM commoditycategory WHERE LOWER(name) LIKE LOWER('%\".$name.\"%') OR LOWER(name) LIKE LOWER('%\".$name.\"%') OR LOWER(name) LIKE LOWER('%\".$name.\"%') \";\n\t\t$result = $conn->fetchOne($unique_query);\n\t\t// debugMessage($unique_query);\n\t\t// debugMessage($result);\n\t\treturn $result; \n\t}", "protected function _getAreaByFile($file)\n {\n $area = 'default';\n if (preg_match('/\\/(?<area>adminhtml|frontend)\\//', $file, $matches)) {\n $area = $matches['area'];\n }\n return $area;\n }", "public function show(Area $area)\n {\n //\n }" ]
[ "0.7308833", "0.65800565", "0.6567851", "0.64259386", "0.6338269", "0.62128526", "0.6041777", "0.5957886", "0.5822349", "0.5751498", "0.5748758", "0.57384574", "0.56934506", "0.5675208", "0.5668515", "0.56389594", "0.5618905", "0.55988896", "0.55467045", "0.55121773", "0.54936576", "0.54656696", "0.544517", "0.53984845", "0.5374443", "0.5374443", "0.5374443", "0.53607184", "0.533429", "0.5329823" ]
0.72456974
1
Check if an Authentication Type exists
final public function isAuthType($type) { return in_array($type, $this->authTypes); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasLoginType()\n {\n return $this->get(self::LOGIN_TYPE) !== null;\n }", "protected function needsAuthentication()\n {\n return !empty($this->authType);\n }", "public function isAuth() {}", "public function isAuth();", "function checkAuth($type, $username, $password)\n {\n if (!$_MIDCOM->authentication->is_user())\n {\n if (!$_MIDCOM->authentication->login($username, $password))\n {\n return false;\n }\n }\n return true;\n }", "public function getAuthType()\n {\n return $this->auth_type;\n }", "public function is_auth()\r\n\t{\r\n\t\tstatic $authorized = null;\r\n\r\n\t\tif(isset($authorized))\r\n\t\t\treturn $authorized;\r\n\r\n\t\t$authorized = false;\r\n\t\t$token = Options::get('picasa_token_' . User::identify()->id);\r\n\r\n\t\tif($token != null)\r\n\t\t\t$authorized = true;\r\n\r\n\t\treturn $authorized;\r\n\t}", "public function check($type)\n {\n switch ($type)\n {\n case Signature::TYPE_SUBSCRIBO_BASIC:\n if (empty($this->basicToken)) {\n return false;\n }\n return true;\n case Signature::TYPE_SUBSCRIBO_DIGEST:\n if (empty($this->digestToken)) {\n return false;\n }\n if (empty($this->digestSecret)) {\n return false;\n }\n return true;\n default:\n return false;\n }\n }", "public function getAuthType()\n {\n return isset($this->authType) ? $this->authType : null;\n }", "public static function isValidType(String $type){\n return array_key_exists(strtoupper($type), self::userTypes());\n }", "public function getAuthenticationType() {\n\t\treturn $this->_mAuthenticationType;\n\t}", "public function checkAuthentication() {}", "public function isAuth(){\n\t\t$sess = Core::getSingleton(\"system/session\");\n\t\tif( $sess->has(\"account\") ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function typedSessionExists($type)\n {\n return $this->has($type);\n }", "function authUsers($userType, Request $request, Response $response) {\n $authHeader = $request->getHeader('Authorization');\n list($jwt) = sscanf($authHeader[0], 'Bearer %s');\n if ($jwt) {\n try {\n $data = getTokenData($request);\n if (in_array($data[Constants::USERS_FLD_USER_TYPE], $userType)) {\n return true;\n } else {\n return false;\n }\n } catch (Exception $e) {\n return false;\n }\n } else {\n return false;\n }\n return false;\n}", "public function authorize()\n {\n return Auth::user()->type == 1;\n }", "abstract protected function isSocialUser($type);", "public function hasProvider($type);", "public function getAuthenticationAvailable();", "private function assertValidAuthType()\n {\n if (\n !array_key_exists($this->authType, $this->authenticators)\n || !class_exists($this->authenticators[$this->authType])\n || !is_subclass_of($this->authenticators[$this->authType], AbstractAuthenticator::class)\n ) {\n throw new UnregisteredAuthenticatorException(\n $this->authType . ' is not a registered authentication type'\n );\n }\n }", "public function hasAuthorization(): bool;", "protected function isAuthenticate() {\n $em = $this->getEm();\n $repository = $em->getRepository('Ephp\\Bundle\\WsInvokerBundle\\Entity\\Log\\LogAuthentication');\n /* @var $repository \\Ephp\\Bundle\\WsInvokerBundle\\Entity\\Log\\LogAuthenticationRepository */\n return $repository->checkOrCreateToken($this->getUtente(), $this->persist);\n }", "public static function check()\n {\n return (new Authenticator(request()))->isAuthenticated();\n }", "public function isAuthenticate()\n {\n return !empty($this->access_token);\n }", "public static function Exists( $type )\n {\n switch ( strtolower( trim ( $type ) ) )\n {\n case \"post\":\n return ( !empty( $_POST ) ) ? true : false;\n \n break;\n \n case \"get\":\n return ( !empty( $_GET ) ) ? true : false;\n \n break;\n \n default:\n return false;\n \n break;\n }\n }", "public function isLogin()\n\t{\n\t\t$type = Bn::getValue('user_type');\n\t\treturn (!empty($type));\n\t}", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();" ]
[ "0.67034703", "0.6668424", "0.638007", "0.63571733", "0.6292423", "0.612688", "0.6111449", "0.6102453", "0.60576504", "0.6057591", "0.6044635", "0.6033264", "0.6001203", "0.59904635", "0.59458435", "0.59232587", "0.5891418", "0.5888499", "0.5851927", "0.5842377", "0.5829877", "0.5827907", "0.58131677", "0.5796743", "0.57918733", "0.5782136", "0.5776968", "0.5768389", "0.5768389", "0.5768389" ]
0.6812893
0
Set a value. If the value is such that it cannot be stored directly in the database for example an object, then it is stored in $this>metaCache. Only when the object is saved, then $this>row is updated. This function expects objects, unix timestamps and scalars as values.
public function set($name, $value) { $spec = SERIA_Meta::_getSpec($this); if(!isset($spec['fields'][$name])) throw new SERIA_Exception('No such field '.$name); if(is_object($value)) { $this->metaCache[$name] = $value; } else { if(isset($spec['fields'][$name]['type'])) { $tokens = SERIA_DB::sqlTokenize($spec['fields'][$name]['type']); switch(strtolower($tokens[0])) { /* case 'year' : if(strlen($value)==4) // assume year $this->row[$name] = $value; else // assume timestamp $this->row[$name] = date('Y', $value); case 'date' : case 'datetime' : if(trim($value, "0123456789")=="") // assume timestamp $this->row[$name] = date('Y-m-d H:i:s', $value); else // assume database format $this->row[$name] = $value; break; */ default : $this->row[$name] = $value; break; } } $this->metaCache[$name] = $value; } $this->changedRow[$name] = true; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final public function set(object $value): CacheItemInterface\n\t{\n\t\tif ($stm = $this->_prepare('INSERT INTO `Cache` (\n\t\t\t\t`key`,\n\t\t\t\t`value`,\n\t\t\t\t`expires`\n\t\t\t) VALUES (:key, :value, :expires)\n\t\t\tON DUPLIATE KEY UPDATE\n\t\t\t\t`value` = :value,\n\t\t\t\t`expires`= COALESCE(:expires, NULL);')) {\n\t\t\t$stm->bindValue(':key', $this->getKey());\n\t\t\t$stm->bindValue(':value', serialize($value));\n\n\t\t\tif (isset($this->_expires)) {\n\t\t\t\t$stm->bindValue(':expires', $this->_expires->format(DateTimeInterface::W3C));\n\t\t\t}\n\n\t\t\t$stm->execute();\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "abstract public function setValue($value);", "public function __set($attr, $value) {\n if ($this->isMeta($attr)) {\n if ($value === null || $value === '') {\n // UNSET VALUE\n if (isset($this->meta()->$attr)) {\n if (isset($this->_metaModified[$attr]) && $this->_metaModified[$attr] == self::META_ADDED) {\n // unset what's to be added - not to add it at all\n unset($this->_metaModified[$attr]);\n } else {\n // unset what was modified or initially existed\n $this->_metaModified[$attr] = self::META_UNSET;\n }\n unset($this->meta()->$attr);\n }\n } else {\n // SET VALUE\n if (isset($this->meta()->$attr)) {\n // field exists\n if (isset($this->_metaModified[$attr]) && ($this->_metaModified[$attr] == self::META_ADDED)) {\n // updating previously added field; do nothing - stay in add mode\n } else {\n // updating field that was deleted, modified before or initially loaded\n $this->_metaModified[$attr] = self::META_MODIFIED;\n }\n } else {\n // non-existing field\n if (isset($this->_metaModified[$attr]) && ($this->_metaModified[$attr] == self::META_UNSET)) {\n // field initially existed, but to be deleted. Modify instead\n $this->_metaModified[$attr] = self::META_MODIFIED;\n } else {\n // first access of non-existed field\n $this->_metaModified[$attr] = self::META_ADDED;\n }\n }\n $this->meta()->$attr = $value;\n }\n } else {\n parent::__set($attr, $value);\n }\n }", "public function setValue($value)\n {\n $value = arr::get($value, 'value', NULL);\n\n if ($value !== NULL)\n {\n //pokud prisla prazdna hodnota, tak do modelu ukladam NULL\n if (empty($value))\n {\n $value = NULL;\n }\n\n parent::setValue($value);\n }\n }", "public function setValue($value) {\n $this->value = $value->value;\n }", "protected function doSet($value)\n {\n }", "public function setValue($value)\n {\n $this->_value = new Zend_Memory_Value($value, $this);\n }" ]
[ "0.6863212", "0.6810166", "0.6810166", "0.6810166", "0.6810166", "0.6810166", "0.6810166", "0.6810166", "0.6810166", "0.6810166", "0.6810166", "0.6770276", "0.6770276", "0.6770223", "0.6770223", "0.6770223", "0.6770223", "0.6770223", "0.6770223", "0.6770223", "0.6770223", "0.6770223", "0.6770223", "0.6770223", "0.6728812", "0.66376823", "0.6636111", "0.66111773", "0.6483338", "0.64403826" ]
0.7231991
0
Return raw response from the search Takes a URL and array of headers
function get_response($url, $headers) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function search()\n {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $this->getUrl());\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);\n ob_start();\n curl_exec($ch);\n $response = ob_get_contents();\n ob_end_clean();\n\n curl_close($ch);\n\n return $response;\n }", "private function _search(){\n\t\tif($this->curluse){\n\t\t\ttry{\n\t\t\t\t$ch = curl_init();\n\t\t\t\tcurl_setopt($ch, CURLOPT_URL, $this->searchURL);\n\t\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\t\t\t\tcurl_setopt($ch, CURLOPT_HEADER, false);\n\t\t\t\tif(isset($this->proxy_url) && isset($this->proxy_port)){\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_PROXYPORT, $this->proxy_port);\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_PROXY, $this->proxy_url);\n\t\t\t\t}\n\t\t\t\t$output = curl_exec($ch);\n\t\t\t\tif(curl_errno($ch))\n\t\t\t\t{\n\t\t\t\t\tthrow new \\Exception(curl_error($ch));\n\t\t\t\t}\n\t\t\t\tcurl_close($ch);\n\t\t\t\treturn $output;\n\t\t\t} catch(Exception $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif ($stream = fopen($this->searchURL, 'r')) {\n\t\t\t\treturn stream_get_contents($stream);\n\t\t\t\tfclose($stream);\n\t\t\t}\n\t\t}\n\t}", "public function get($url, $query = array(), $headers = array());", "private function query($url,$timeout=60){\r\n $options = array( 'http' => array(\r\n 'user_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8',\r\n 'max_redirects' => 10,\r\n 'timeout' => $timeout,\r\n 'header' => array(\r\n 'Accept-Language: en',\r\n ),\r\n ));\r\n $page = @file_get_contents($url,false,stream_context_create($options));\r\n //print('<pre>');print_r($http_response_header);print(htmlspecialchars($page));die('</pre>');/*DEBUG*/\r\n return array('content'=>$page,'header'=>implode(\"\\n\",$http_response_header));\r\n }", "function urlResponse($url) {\n $headers = get_headers($url);\n return substr($headers[0],9, 3);\n }", "public function head($url, $query = array(), $headers = array());", "public function get(string $url, array $input = [], $headers = null);", "function getResponseHeaders();", "function http_get($url) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n //curl_setopt($ch,CURLOPT_HEADER, false); \n $output = curl_exec($ch);\n curl_close($ch);\n return $output;\n}", "function geturl($url){\n if($url==\"\"){\n $url = \"http://www.36kr.com/\";\n }\n \n $ch = curl_init();\n\n // set the url to fetch \n curl_setopt($ch, CURLOPT_URL, $url);\n\n //return the transfer (the result of curl_exec()) as a string instead of outputing directly\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n //return the HTTP Response header using the callback function readHeader\n //curl_setopt($ch, CURLOPT_HEADERFUNCTION, 'readHeader');\n\n // execute the curl session\n $output = curl_exec($ch);\n\n // close curl resource to free up system resources \n curl_close($ch);\n\n //the callback function used to retreive the header info\n function readHeader($ch, $string) {\n $length = strlen($string);\n //only display the headers with content\n if (trim($string) != '')\n echo \"<center>Header: $string</center><br />\\n\";\n return $length;\n }\n\n //echo \"<br /><center><b><u>BELOW this line is the content fetched from www.example.com:</u></b></center><br />\";\n return $output;\n}", "function customGet($url, $refer, $header_array)\n {\n $USER_AGENT=\"Mozilla/5.0 (Windows NT 6.3; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0\";\n\n if (!isset($CONNECT_TIMEOUT) || !filter_var($CONNECT_TIMEOUT, FILTER_VALIDATE_INT)) {$CONNECT_TIMEOUT=10;} //use 10 seconds by default when no timeout is set\n if (!isset($refer) || !filter_var($refer, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED)) {$refer=$url;} //use original url as refer when no valid URL provided\n\n $ch=curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_USERAGENT, $USER_AGENT);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $CONNECT_TIMEOUT);\n curl_setopt($ch, CURLOPT_TIMEOUT, $CONNECT_TIMEOUT);\n curl_setopt($ch, CURLOPT_REFERER, $refer);\n if (is_array($header_array)) //add custom header\n {\n curl_setopt($ch, CURLOPT_HTTPHEADER, $header_array);\n }\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_MAXREDIRS, 10);\n $result=curl_exec($ch);\n curl_close($ch);\n\n return $result;\n }", "public function get($url) {\n $request = $this->getRequest($url, HttpRequest::METH_GET);\n try {\n // this could be parametrized using optional options interface\n $options = array(\n 'useragent' => \"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1; MS-RTC LM 8)\",\n 'connecttimeout' => 120, // timeout in seconds on connect \n 'timeout' => 120, // timeout in seconds on response \n 'redirect' => 5, // stop after 5 redirects\n 'compress' => true, // allow compression or not\n 'referer' => \"https://www.google.com/#output=search&sclient=psy-ab&q=jachty&fp=1\",\n );\n $request->setOptions($options);\n $request->send();\n } catch (Exception $e) {\n throw new Exception('Loading failed with exception', $request->getResponseCode(), $e);\n }\n $code = $request->getResponseCode();\n $body = $request->getResponseBody();\n\n // make sure we did not fail\n if ($code >= 500) {\n throw new Exception('Error response code recieved: ' . $body, $code);\n } elseif ($code >= 400) {\n throw new Exception('Permanent failure' . $body, $code);\n } elseif (trim($body) == '') {\n throw new Exception('Empty response', $code);\n }\n\n return $body;\n }", "function doAPISearch($params) {\n global $searchUrl;\n\n $ch = curl_init(); // initialize curl handle\n curl_setopt($ch, CURLOPT_URL,$searchUrl . $params);\n curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable\n curl_setopt($ch, CURLOPT_TIMEOUT, 8); // times out after 4s\n curl_setopt($ch, CURLOPT_POST, 0); // set GET method\n // curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n // Retrieve result\n $result = curl_exec($ch);\n // TODO return error if error\n // $cerror = curl_error($ch);\n\n return $result;\n}", "function get_remote_html($url) {\r\n\r\n\t$ch = curl_init($url);\r\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\r\n\tcurl_setopt($ch, CURLOPT_VERBOSE, true); \r\n\tcurl_setopt($ch, CURLOPT_HEADER, true);\r\n\r\n\t$response = curl_exec($ch);\r\n\r\n\tlist($header, $body) = explode(\"\\r\\n\\r\\n\", $response, 2);\r\n\r\n\treturn array( 'header' => $header, 'body' => $body );\r\n\r\n}", "function CurlGetHeaders(& $rsUrl) \n{ \n\t$stCurlHandle = @curl_init(); \n\n\tcurl_setopt($stCurlHandle, CURLOPT_URL, $rsUrl); \n\tcurl_setopt($stCurlHandle, CURLOPT_HEADER, true); \n\tcurl_setopt($stCurlHandle, CURLOPT_NOBODY, true); \n\tcurl_setopt($stCurlHandle, CURLOPT_RETURNTRANSFER, true); \n\tcurl_setopt($stCurlHandle, CURLOPT_TIMEOUT, 5); \n\n\t$sCurlExecResult = '';\n\t$sCurlExecResult = curl_exec($stCurlHandle); \n\t$sCurlExecResult = explode(\"\\n\", $sCurlExecResult); \n\treturn $sCurlExecResult; \n}", "function BingWebSearch ($url, $key, $query,$count,$offset) {\n // Prepare HTTP request\n // NOTE: Use the key 'http' even if you are making an HTTPS request. See:\n // http://php.net/manual/en/function.stream-context-create.php\n $headers = \"Ocp-Apim-Subscription-Key: $key\\r\\n\";\n $options = array ('http' => array (\n 'header' => $headers,\n 'method' => 'GET'));\n\n // Perform the Web request and get the JSON response\n $context = stream_context_create($options);\n\n\n $result = file_get_contents($url . \"?q=\" . urlencode($query).\"&count=\".$count.\"&offset=\".$offset, false, $context);\n\n // Extract Bing HTTP headers\n $headers = array();\n foreach ($http_response_header as $k => $v) {\n $h = explode(\":\", $v, 2);\n if (isset($h[1]))\n if (preg_match(\"/^BingAPIs-/\", $h[0]) || preg_match(\"/^X-MSEdge-/\", $h[0]))\n $headers[trim($h[0])] = trim($h[1]);\n }\n\n return array($headers, $result);\n }", "public function getResponseHeaders();", "public static function urlGet($url,$headers=null) {\n\n $c = curl_init();\n curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($c, CURLOPT_URL, $url);\n if ($headers != null && is_array($headers)){\n\n curl_setopt($c, CURLOPT_HTTPHEADER, $headers);\n\n }\n\n if($headers != null && in_array('Custom-SSL-Verification:false',$headers)){\n curl_setopt($c, CURLOPT_SSL_VERIFYHOST, false); \n curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);\n }\n\n $contents = curl_exec($c);\n\n if($errno = curl_errno($c)) {\n $error_message = curl_strerror($errno);\n //echo \"cURL error ({$errno}):\\n {$error_message}\";\n $contents = \"cURL error ({$errno}):\\n {$error_message}\";\n }\n curl_close($c);\n return utf8_encode($contents);\n }", "public function get ($url, $headers = null, $options = null);", "function get_with_header($url, $refer = null)\n {\n curl_setopt_array($this->curl, array(\n CURLOPT_URL => $url,\n CURLOPT_REFERER => $refer,\n CURLOPT_HEADER => true,\n ));\n $response = curl_exec($this->curl);\n curl_setopt($this->curl, CURLOPT_HEADER, false);\n $header_size = curl_getinfo($this->curl, CURLINFO_HEADER_SIZE);\n return array(\n substr($response, 0, $header_size),\n new Page(substr($response, $header_size), $url, $this),\n );\n }", "public function getHeaderValue();", "function curl_index($vs = null, $ev = null, $search = null)\n\t{\n\t\t\n\t\t$url \t = 'http://webbond.seminolesheriff.org/Search.aspx';\n\t\t$headers = array('GET /public/ArRptQuery.aspx HTTP/1.1',\n\t\t\t\t\t'Host: www.sheriffseminole.org',\n\t\t\t\t\t'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1',\n\t\t\t\t\t'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',\n\t\t\t\t\t'Accept-Language: en-us,en;q=0.5',\n\t\t\t\t\t'Accept-Encoding: gzip, deflate',\n\t\t\t\t\t'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7',\n\t\t\t\t\t'Keep-Alive: 115',\n\t\t\t\t\t'Connection: keep-alive',\n\t\t\t\t\t'Cookie: ASP.NET_SessionId=hhwz3u45zmuiddbhqwy2y1rw',\n\t\t\t\t\t'Cache-Control: max-age=0');\n\t\t$ch = curl_init(); \n \tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_COOKIEFILE, $this->cookies);\n\t\tcurl_setopt($ch, CURLOPT_COOKIEJAR, $this->cookies);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tif ($ev && $vs && $search)\n\t\t{\n\t\t\t$fields = '__EVENTTARGET=&__EVENTARGUMENT=&__LASTFOCUS=&__VIEWSTATE='.urlencode($vs).'&__EVENTVALIDATION='.urlencode($ev).'&ctl00%24ContentPlaceHolder1%24ddllist=Last+Name&ctl00%24ContentPlaceHolder1%24txtTST='.urlencode($search).'&ctl00%24ContentPlaceHolder1%24Button1=Search';\n\t\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $fields);\n\t\t}\n\t\t//curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n $index = curl_exec($ch);\n curl_close($ch);\n\t\treturn $index;\n\t}", "public function search()\n {\n return $this->call('GET', $this->endpoint);\n }", "public function content() {\n $config = \\Drupal::config('webspark_isearch.settings');\n $solr = $config->get('solr');\n $client = \\Drupal::httpClient();\n $query= \\Drupal::request()->getQueryString();\n\n $url = $solr . '?' . urldecode($query);\n\n $request = $client->get($url);\n $status = $request->getStatusCode();\n $content = $request->getBody()->getContents();\n $file_contents = json_decode($content);\n\n return new JsonResponse($file_contents);\n }", "function http_response($url, $opts = array()) {\n $url = preg_replace('/ /', '%20', $url);\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_HEADER, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_USERAGENT, \"uw_transparancy, toolserver.org wikiproject parser\");\n $output = curl_exec($ch);\n // Check for errors\n if (curl_errno($ch)) {\n wpLog(\"Curl error: \" . curl_error($ch));\n return http_response($url);\n }\n\n curl_close($ch);\n\n return $output;\n}", "function httpGET($url = '/', $headers = '') {\n $this->ensureOpened(__FUNCTION__);\n ($headers = trim($headers)) === '' or $headers .= \"\\r\\n\";\n\n // Note: in HTTP/1.1 Connection defaults to Keep Alive which will keep\n // the connection hanging unless you send 'Connection: close'. Its output\n // also changes due to chunked transfer encoding.\n $headers = \"GET $url HTTP/1.0\\r\\n\".\n $headers.\"\\r\\n\";\n\n $this->write($headers);\n return $this->readAll();\n }", "function https_get_header_json($token_url) {\n $timeout = 30;\n $ch = curl_init(); \n // set URL and other appropriate options\n curl_setopt($ch, CURLOPT_URL, $token_url);\n //curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n //curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n $file_contents = curl_exec($ch);\n curl_close($ch);\n\n return $file_contents;\n}", "public function get($uri, array $headers = []): ResponseInterface;", "function curl_function($url){\n\t$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, $url);\ncurl_setopt($ch, CURLOPT_HEADER, 0);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_TIMEOUT, 100);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n$output = curl_exec($ch);\necho curl_error($ch);\ncurl_close($ch);\n \n//$searchResponse = json_decode($output,true);\n return $output;\n\t\n\t}", "function curl_get_result($url) {\n\t@set_time_limit(0);\n\t\n\t// Headers\n\t $header[0] = \"Accept: text/xml,application/xml,application/xhtml+xml,\";\n\t $header[0] .= \"text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\";\n\t $header[] = \"Cache-Control: max-age=0\";\n\t $header[] = \"Connection: keep-alive\";\n\t $header[] = \"Keep-Alive: 300\";\n\t $header[] = \"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\";\n\t $header[] = \"Accept-Language: en-us,en;q=0.5\";\n\t $header[] = \"Pragma: \"; // browsers keep this blank. \n\t\n\t$ch = curl_init();\n\t$timeout = 5;\n\tcurl_setopt($ch,CURLOPT_URL,$url);\n\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\n\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\n\tcurl_setopt($ch, CURLOPT_USERAGENT, 'Googlebot/2.1 (+http://www.google.com/bot.html)'); \n\tcurl_setopt($ch,CURLOPT_HTTPHEADER,$header);\n\tif(!$data = curl_exec($ch)){\n\t\treturn false;\n\t}else{\n\t\tcurl_close($ch);\n\t\treturn $data;\n\t}\n}" ]
[ "0.7029437", "0.65809524", "0.6147937", "0.60302055", "0.60089767", "0.58185035", "0.5794863", "0.5763208", "0.5758542", "0.5746395", "0.57430786", "0.57390195", "0.57303506", "0.57302076", "0.57097936", "0.5698481", "0.56357324", "0.56136584", "0.5604945", "0.55746007", "0.5561544", "0.55084807", "0.54873616", "0.54808754", "0.54782194", "0.54481244", "0.5440898", "0.544023", "0.5411383", "0.54077005" ]
0.6855138
1
Build subtext for results Takes array of strings
function build_subtext($subtext_values) { $subtext_pieces = array(); foreach ($subtext_values as $value) { if (!empty($value)) { $subtext_pieces[] = $value; } } return implode('; ', $subtext_pieces); $subtext_pieces = array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function buildByText($text);", "public function textForRenderDataProvider()\n {\n return [\n 'searchwordExistMultipleTimesInText' => [\n 'butt',\n 30,\n 'Minions ipsum butt po kass gelatooo la belloo! Butt aaaaaah chasy bee do bee do bee do aaaaaah bananaaaa chasy baboiii la . Belloo! bee do bee do bee do para tú chasy tank yuuu! Potatoooo ti aamoo! Po kass butt wiiiii potatoooo poulet tikka masala para tú tatata bala tu hana dul sae. Baboiii la bee do bee do bee do tank yuuu! Aaaaaah jiji hahaha. Tank yuuu! bananaaaa aaaaaah po kass bappleees tulaliloo me want bananaaa! Tatata bala tu belloo! Me want bananaaa! bappleees daa uuuhhh belloo! Poopayee gelatooo chasy bananaaaa. Daa hana dul sae po kass butt jiji jeje uuuhhh.',\n 'Minions ipsum <span class=\"faq-search-highlight\">butt</span> po kass gelatoo...',\n ],\n 'searchwordAtTextStart' => [\n 'Flensburg bodaaa',\n 16,\n 'bodaaa Minions ipsum butt po kass gelatooo la belloo! Butt aaaaaah chasy bee do bee do bee do aaaaaah bananaaaa chasy baboiii la . Belloo! bee do bee do bee do para tú chasy tank yuuu! Potatoooo ti aamoo! Po kass butt wiiiii potatoooo poulet tikka masala para tú tatata bala tu hana dul sae. Baboiii la bee do bee do bee do tank yuuu! Aaaaaah jiji hahaha. Tank yuuu! bananaaaa aaaaaah po kass bappleees tulaliloo me want bananaaa! Tatata bala tu belloo! Me want bananaaa! bappleees daa uuuhhh belloo! Poopayee gelatooo chasy bananaaaa. Daa hana dul sae po kass butt jiji jeje uuuhhh.',\n '<span class=\"faq-search-highlight\">bodaaa</span> Minions ipsum b...',\n ],\n 'searchwordAtTextEnd' => [\n 'bodaaa',\n 16,\n 'Minions ipsum butt po kass gelatooo la belloo! Butt aaaaaah chasy bee do bee do bee do aaaaaah bananaaaa chasy baboiii la. Belloo! bee do bee do bee do para tú chasy tank yuuu! Potatoooo ti aamoo! Po kass butt wiiiii potatoooo poulet tikka masala para tú tatata bala tu hana dul sae. Baboiii la bee do bee do bee do tank yuuu! Aaaaaah jiji hahaha. Tank yuuu! bananaaaa aaaaaah po kass bappleees tulaliloo me want bananaaa! Tatata bala tu belloo! Me want bananaaa! bappleees daa uuuhhh belloo! Poopayee gelatooo chasy bananaaaa. Daa hana dul sae po kass butt jiji jeje uuuhhh bodaaa',\n '...iji jeje uuuhhh <span class=\"faq-search-highlight\">bodaaa</span>',\n ],\n 'searchwordWithinTrimAtStartOfText' => [\n 'bodaaa',\n 16,\n 'Minions bodaaa ipsum butt po kass gelatooo la belloo! Butt aaaaaah chasy bee do bee do bee do aaaaaah bananaaaa chasy baboiii la . Belloo! bee do bee do bee do para tú chasy tank yuuu! Potatoooo ti aamoo! Po kass butt wiiiii potatoooo poulet tikka masala para tú tatata bala tu hana dul sae. Baboiii la bee do bee do bee do tank yuuu! Aaaaaah jiji hahaha. Tank yuuu! bananaaaa aaaaaah po kass bappleees tulaliloo me want bananaaa! Tatata bala tu belloo! Me want bananaaa! bappleees daa uuuhhh belloo! Poopayee gelatooo chasy bananaaaa. Daa hana dul sae po kass butt jiji jeje uuuhhh.',\n 'Minions <span class=\"faq-search-highlight\">bodaaa</span> ipsum b...',\n ],\n 'searchwordWithinTrimAtStartOfTextSecond' => [\n 'bodaaa',\n 16,\n 'Minions ipsum bodaaa butt po kass gelatooo la belloo! Butt aaaaaah chasy bee do bee do bee do aaaaaah bananaaaa chasy baboiii la . Belloo! bee do bee do bee do para tú chasy tank yuuu! Potatoooo ti aamoo! Po kass butt wiiiii potatoooo poulet tikka masala para tú tatata bala tu hana dul sae. Baboiii la bee do bee do bee do tank yuuu! Aaaaaah jiji hahaha. Tank yuuu! bananaaaa aaaaaah po kass bappleees tulaliloo me want bananaaa! Tatata bala tu belloo! Me want bananaaa! bappleees daa uuuhhh belloo! Poopayee gelatooo chasy bananaaaa. Daa hana dul sae po kass butt jiji jeje uuuhhh.',\n 'Minions ipsum <span class=\"faq-search-highlight\">bodaaa</span> b...',\n ],\n 'searchwordMiddleOfText' => [\n 'bodaaa',\n 16,\n 'Minions ipsum butt po kass gelatooo la belloo! Butt aaaaaah chasy bee do bee do bee do aaaaaah bananaaaa chasy baboiii la. Belloo! bee do bee do bee do para tú chasy tank yuuu! Potatoooo ti aamoo! Po kass butt wiiiii potatoooo poulet tikka masala para tú tatata bala tu hana dul sae. Baboiii la bodaaa bee do bee do bee do tank yuuu! Aaaaaah jiji hahaha. Tank yuuu! bananaaaa aaaaaah po kass bappleees tulaliloo me want bananaaa! Tatata bala tu belloo! Me want bananaaa! bappleees daa uuuhhh belloo! Poopayee gelatooo chasy bananaaaa. Daa hana dul sae po kass butt jiji jeje uuuhhh.',\n '...oiii la <span class=\"faq-search-highlight\">bodaaa</span> bee do ...',\n ],\n 'searchwordNotFound' => [\n 'Flensburg',\n 16,\n 'Minions ipsum butt po kass gelatooo la belloo! Butt aaaaaah chasy bee do bee do bee do aaaaaah bananaaaa chasy baboiii la. Belloo! bee do bee do bee do para tú chasy tank yuuu! Potatoooo ti aamoo! Po kass butt wiiiii potatoooo poulet tikka masala para tú tatata bala tu hana dul sae. Baboiii la bodaaa bee do bee do bee do tank yuuu! Aaaaaah jiji hahaha. Tank yuuu! bananaaaa aaaaaah po kass bappleees tulaliloo me want bananaaa! Tatata bala tu belloo! Me want bananaaa! bappleees daa uuuhhh belloo! Poopayee gelatooo chasy bananaaaa. Daa hana dul sae po kass butt jiji jeje uuuhhh.',\n 'Minions ipsum bu...',\n ],\n 'trimLongerThanContentSearchWordNotFound' => [\n 'Flensburg',\n 30,\n 'Minions ipsum butt po kass ge',\n 'Minions ipsum butt po kass ge',\n ],\n 'trimLongerThanContentStart' => [\n 'Minions',\n 30,\n 'Minions ipsum butt po kass',\n '<span class=\"faq-search-highlight\">Minions</span> ipsum butt po kass',\n ],\n 'trimLongerThanContentMiddle' => [\n 'ipsum',\n 30,\n 'Minions ipsum butt po kass',\n 'Minions <span class=\"faq-search-highlight\">ipsum</span> butt po kass',\n ],\n 'trimLongerThanContentEnd' => [\n 'kass',\n 30,\n 'Minions ipsum butt po kass',\n 'Minions ipsum butt po <span class=\"faq-search-highlight\">kass</span>',\n ],\n 'cropCharIsDecimal' => [\n 'bodaaa',\n 16.4,\n 'Minions ipsum butt po kass gelatooo la belloo! Butt aaaaaah chasy bee do bee do bee do aaaaaah bananaaaa chasy baboiii la. Belloo! bee do bee do bee do para tú chasy tank yuuu! Potatoooo ti aamoo! Po kass butt wiiiii potatoooo poulet tikka masala para tú tatata bala tu hana dul sae. Baboiii la bodaaa bee do bee do bee do tank yuuu! Aaaaaah jiji hahaha. Tank yuuu! bananaaaa aaaaaah po kass bappleees tulaliloo me want bananaaa! Tatata bala tu belloo! Me want bananaaa! bappleees daa uuuhhh belloo! Poopayee gelatooo chasy bananaaaa. Daa hana dul sae po kass butt jiji jeje uuuhhh.',\n '...oiii la <span class=\"faq-search-highlight\">bodaaa</span> bee do ...',\n ],\n ];\n }", "public function as_text ()\n {\n $opts = $this->context->text_options;\n \n if ($this->subject)\n {\n $pieces [] = $opts->convert_to_html_entities ($this->subject);\n }\n \n if (!empty($this->_objects))\n {\n $objs = array_reverse($this->_objects);\n $titles = null;\n \n foreach ($objs as $obj)\n {\n if (empty($titles))\n {\n // Do not truncate the first, most important title in the list\n \n $formatter = $obj->title_formatter ();\n $formatter->max_visible_output_chars = 0;\n $title = $opts->convert_to_html_entities ($obj->title_as_plain_text ($formatter));\n }\n else \n {\n $title = $opts->convert_to_html_entities ($obj->title_as_plain_text ());\n }\n \n $titles [] = $title; \n }\n \n $text = join ($this->separator, $titles);\n \n if (! empty($text))\n {\n $pieces [] = $text;\n }\n }\n\n if ($this->group)\n {\n $pieces [] = $opts->convert_to_html_entities ($this->group);\n }\n \n if (isset ($pieces))\n {\n $Result = $this->prefix . join ($this->separator, $pieces) . $this->suffix;\n }\n else\n {\n $Result = $this->prefix . $this->suffix;\n }\n \n return $Result; \n }", "public function getTexts() {\r\n // get locations from getLocations() function\r\n // only getTexts() function is called from outside\r\n // getLocations() has been left as a public function\r\n // in case something goes awry during development\r\n $loc = $this->getLocations();\r\n // 9 texts, three for each phase\r\n $text = array(9);\r\n\r\n for($i = 0; $i < 9; $i++) {\r\n // SQL query for getting all messages from a generated location\r\n $sql = 'SELECT content FROM writing WHERE locx = ' . $loc[$i][0] . ' AND locy = ' . $loc[$i][1];\r\n $result = $this->conn->prepare($sql);\r\n $result->execute();\r\n\r\n // choose randomly a text from the MySQL query\r\n $texttochoose = rand(0, $result->rowCount() - 1);\r\n // for finding the random text from the query\r\n $textcurrent = 0;\r\n while($row = $result->fetch(PDO::FETCH_ASSOC)) {\r\n if($textcurrent == $texttochoose) {\r\n // echo '$i: ' . $i . ', $row[\"content\"]: ' . $row['content'] . '<br/>';\r\n $text[$i] = $row['content'];\r\n break;\r\n }\r\n $textcurrent++;\r\n }\r\n }\r\n \r\n // array to put both location and text in\r\n // the array's key consists of phase, locx and locy\r\n // i.e. 001 = phase 1, locx 0, locy 1\r\n // i.e. 222 = phase 3, locx 2, locy 2\r\n $texts = array();\r\n \r\n // the array's key consists of phase, locx and locy\r\n // i.e. 001 = phase 1, locx 0, locy 1\r\n // i.e. 222 = phase 3, locx 2, locy 2\r\n for($i = 0; $i < 9; $i++) {\r\n if($i < 3) {\r\n $texts['0' . (string)$loc[$i][0] . (string)$loc[$i][1]] = $text[$i];\r\n } else if($i < 6) {\r\n $texts['1' . (string)$loc[$i][0] . (string)$loc[$i][1]] = $text[$i];\r\n } else {\r\n $texts['2' . (string)$loc[$i][0] . (string)$loc[$i][1]] = $text[$i];\r\n }\r\n }\r\n\r\n return $texts;\r\n }", "function createSubject($line_as_arr, $session_id)\n{\n //example from CRC database - column headings below\n\n //0 1 2 3 4 5 6 7 8 9 10 11\n //id term\tisland\tcity territory\tcounty\tstate country continent\tpart_order\talt_form alt_form_lang\n\n //12 13 14 15 16 17 18 19 20 21 22 23\n //use_for locator source other\text_id\tnotes created_for created_by created_on\tlast_edited\tlast_edited_by\tsuppress\n\n //if [1] is not empty then spilt on brackets and commas, add last entry first as a term?\n $terms = array();\n $data = new Data();\n\n echo($line_as_arr);\n //do this for all items 1 to 8, reverse order so country comes first\n for ($x=8; $x>=1; $x--)\n {\n $entry = $line_as_arr[$x];\n if (!empty($entry))\n {\n if (!strpbrk($entry, \",(\"))\n {\n\n $term = new Term();\n $term->term = trim($entry);\n $term->term_type = \"geographic\";\n $term->vocabulary = \"/vocabularies/1\";\n $terms[] = $term;\n }\n else{\n $places = preg_split(\"/[(,]+/\", $entry, -1, PREG_SPLIT_NO_EMPTY);\n //echo $places;\n //loop through places, flipped order so country comes first\n foreach (array_reverse($places) as $place)\n {\n echo \"place \" . $place . \"\\n\";\n //ToDo strip ) and , from strings\n $term = new Term();\n $term->term = trim($place, \") \");\n $term->term_type = \"geographic\";\n $term->vocabulary = \"/vocabularies/1\";\n $terms[] = $term;\n }\n }\n }\n }\n\n //add notes\n $notes = \"\";\n\n if (!empty($line_as_arr[10])){\n $notes = $notes . \"Alt form = \" . $line_as_arr[10] . \",\";\n }\n if (!empty($line_as_arr[11])) {\n $notes = $notes . \"Alt form lang = \" . $line_as_arr[11]. \",\";\n }\n if (!empty($line_as_arr[12])) {\n $notes = $notes . \"Use For = \" . $line_as_arr[12]. \",\";\n }\n if (!empty($line_as_arr[13])){\n $notes = $notes . \"Locator = \" . $line_as_arr[13]. \",\";\n }\n if (!empty($line_as_arr[15])) {\n $notes = $notes . \"Other = \" . $line_as_arr[15]. \",\";\n }\n if (!empty($line_as_arr[17])) {\n $notes = $notes . \"Notes = \" . $line_as_arr[17]. \",\";\n }\n if (!empty($line_as_arr[16])){\n $notes = $notes . \"External Id = \" . $line_as_arr[16] . \",\";\n }\n if (!empty($line_as_arr[18])) {\n $notes = $notes . \"Created For = \" . $line_as_arr[18]. \",\";\n }\n\n if (strlen($notes) > 0){\n $data->scope_note = trim($notes, \",\");\n }\n\n //$data->title = $line_as_arr[1];\n $data->vocabulary = \"/vocabularies/1\";\n $data->external_ids =array();\n $data->source = $line_as_arr[14];\n $data->authority_id = \"geo_\".$line_as_arr[0];\n\n //Change to an array of terms\n $data->terms = $terms;\n\n echo json_encode($data). \"\\n\";\n\n $headers = array(\n 'Accept: application/json',\n 'Content-Type: application/json',\n 'X-ArchivesSpace-Session: '.$session_id\n );\n\n $service_url = 'http://localhost:8089/subjects';\n $curl = curl_init($service_url);\n\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_VERBOSE, 1);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));\n curl_setopt($curl, CURLOPT_URL, $service_url);\n\n $curl_response = curl_exec($curl);\n if ($curl_response === false) {\n $info = curl_getinfo($curl);\n curl_close($curl);\n die('error occurred during curl exec. Additional info: ' . var_export($info));\n }\n curl_close($curl);\n $decoded = json_decode($curl_response);\n if (isset($decoded->response->status) && $decoded->response->status == 'ERROR') {\n die('error occurred: ' . $decoded->response->errormessage);\n }\n echo 'response ok!';\n echo print_r($curl_response);\n //echo '====================';\n //echo print_r($decoded);\n\n}", "function echoResultsQREE ($rows) \r{\r \techo \"<table cellpadding=7>\\n\";\r \tforeach ($rows as $row) {\r\t\techo \"\\n\\n\\n<tr>\\n<td valign=top>\\n\";\r\t\techoDocumentLink($row);\r\t\techo \"<td><font color=blue>\".$row[0].\"</font><br>\";\r\t\techoTwoSentences($row[3],$row[4],$row[5],$row[6],$row[7],false);\r \t}\r \techo \"</table>\\n\";\r}", "function searchesHelp($text){\n array_push($text, array('key' => 'PARENT_SEARCHES_HELP',\n 'parent' => '',\n 'text' => 'Search - Help'));\n \n array_push($text, array('key' => 'SEARCHES_HELP',\n 'parent' => 'PARENT_SEARCHES_HELP',\n 'text' => 'Click on a search item to open the editing area.'));\n array_push($text, array('key' => 'SEARCHES_ADD_SEARCH_HELP',\n 'parent' => 'PARENT_SEARCHES_HELP',\n 'text' => 'Click on the \"plus\" icon to add a search.'));\n \n array_push($text, array('key' => 'SEARCHES_EDIT_SEARCH_HELP',\n 'parent' => 'PARENT_SEARCHES_HELP',\n 'text' => 'Click on the \"search\" icon to edit search details.'));\n array_push($text, array('key' => 'SEARCHES_EDIT_SEARCH_SETTINGS_HELP',\n 'parent' => 'PARENT_SEARCHES_HELP',\n 'text' => 'Click on the \"gear\" icon to edit search settings.'));\n array_push($text, array('key' => 'SEARCHES_EDIT_SEARCH_DELETE_HELP',\n 'parent' => 'PARENT_SEARCHES_HELP',\n 'text' => 'Click the \"trash\" icon to delete the search.'));\n array_push($text, array('key' => 'SEARCHES_EDIT_SEARCH_EXCLUDED_CALENDARS_HELP',\n 'parent' => 'PARENT_SEARCHES_HELP',\n 'text' => 'If hours filters are enabled only calendars that have availability set for hours are included in search, else only calendar that have availability set for days are included.'));\n \n array_push($text, array('key' => 'SEARCHES_SEARCH_NAME_HELP',\n 'parent' => 'PARENT_SEARCHES_HELP',\n 'text' => 'Change search name.'));\n \n return $text;\n }", "function buildQuery( )\n {\n $field = \"KeyWords\";\n\n $QueryText = $this->QueryText;\n \n $QueryText = trim( $QueryText );\n// $QueryText = ereg_replace( \"[ ]+\", \" \", $QueryText );\n// $queryArray = explode( \" \", $QueryText );\n $QueryText = ereg_replace( '\\\\\\\\\"', '\"', $QueryText );\n preg_match_all( \"/((\\\"[^\\\"]+\\\")|([^ ]+))/\", $QueryText, $m );\n $queryArray = array();\n foreach( $m[0] as $match )\n {\n $queryArray[] = $match;\n }\n if ( count( $queryArray ) == 0 )\n $queryArray[] = \"\";\n\n $normalArray = array();\n $addArray = array();\n $subArray = array();\n\n foreach( $queryArray as $queryItem )\n {\n switch ( $queryItem[0] )\n {\n case '-':\n {\n $subArray[] = substr( $queryItem, 1 );\n break;\n }\n case '+':\n {\n $addArray[] = substr( $queryItem, 1 );\n break;\n }\n default:\n {\n $normalArray[] = $queryItem;\n }\n }\n }\n\n $arrs = array( array( \"array\" => \"normalArray\", \"item_delim\" => \"OR\", \"delim\" => \"OR\", \"compare\" => \"LIKE\" ),\n array( \"array\" => \"addArray\", \"item_delim\" => \"OR\", \"delim\" => \"AND\", \"compare\" => \"LIKE\" ),\n array( \"array\" => \"subArray\", \"item_delim\" => \"AND\", \"delim\" => \"AND\", \"compare\" => \"NOT LIKE\" ) );\n\n $total_query = \"\";\n foreach( $arrs as $arr )\n {\n $queryArray = ${$arr[\"array\"]};\n $item_delim = $arr[\"item_delim\"];\n $delim = $arr[\"delim\"];\n $compare = $arr[\"compare\"];\n $query = \"\";\n for ( $i=0; $i<count($queryArray); $i++ )\n {\n $queryVal = $queryArray[$i];\n if ( strlen( $queryVal ) > 1 and $queryVal[0] == '\"' and $queryVal[strlen($queryVal)-1] == '\"' )\n {\n $queryVal = substr( $queryVal, 1, strlen( $queryVal ) - 2 );\n }\n\n $subquery = \"\";\n for ( $j=0; $j<count($this->Fields); $j++ )\n {\n $queryItem = $queryVal;\n\n $queryItem = $this->Fields[$j] .\" $compare '%\" . $queryItem . \"%' \";\n\n if ( $j > 0 )\n $queryItem = $item_delim . \" \" . $queryItem . \" \";\n\n $subquery .= $queryItem;\n }\n $query .= \"( $subquery )\";\n\n if ( count( $queryArray) != ($i+1) )\n $query .= \" $delim \";\n }\n if ( count( $queryArray ) )\n {\n if ( !empty( $total_query ) )\n {\n $total_query = \"$total_query $delim ( $query )\";\n }\n else\n {\n $total_query = \"( $query )\";\n }\n }\n }\n return $total_query;\n }", "function searchesFrontEnd($text){\n array_push($text, array('key' => 'PARENT_SEARCH_FRONT_END',\n 'parent' => '',\n 'text' => 'Search - Front end'));\n \n array_push($text, array('key' => 'SEARCH_FRONT_END_TITLE',\n 'parent' => 'PARENT_SEARCH_FRONT_END',\n 'text' => 'Search',\n 'location' => 'all'));\n \n array_push($text, array('key' => 'SEARCH_FRONT_END_CHECK_IN',\n 'parent' => 'PARENT_SEARCH_FRONT_END',\n 'text' => 'Check in',\n 'de' => 'Anreise',\n 'nl' => 'Check in',\n 'fr' => 'Arrivée',\n 'pl' => 'Przyjazd',\n 'location' => 'all'));\n array_push($text, array('key' => 'SEARCH_FRONT_END_CHECK_OUT',\n 'parent' => 'PARENT_SEARCH_FRONT_END',\n 'text' => 'Check out',\n 'de' => 'Abreise',\n 'nl' => 'Check uit',\n 'fr' => 'Départ',\n 'pl' => 'Wyjazd',\n 'location' => 'all'));\n array_push($text, array('key' => 'SEARCH_FRONT_END_START_HOUR',\n 'parent' => 'PARENT_SEARCH_FRONT_END',\n 'text' => 'Start at',\n 'de' => 'Start um',\n 'nl' => 'Start op',\n 'fr' => 'Arrivée à',\n 'pl' => 'Rozpoczęcie',\n 'location' => 'all')); \n array_push($text, array('key' => 'SEARCH_FRONT_END_END_HOUR',\n 'parent' => 'PARENT_SEARCH_FRONT_END',\n 'text' => 'Finish at',\n 'de' => 'Ende um',\n 'nl' => 'Eindigd op',\n 'fr' => 'Départ à',\n 'pl' => 'Zakończenie',\n 'location' => 'all'));\n array_push($text, array('key' => 'SEARCH_FRONT_END_NO_ITEMS',\n 'parent' => 'PARENT_SEARCH_FRONT_END',\n 'text' => 'No book items',\n 'de' => 'No book items',\n 'nl' => '# Accomodaties',\n 'fr' => 'Aucun élément de réservation',\n 'pl' => 'Brak rezerwacji',\n 'location' => 'all'));\n /*\n * No data.\n */\n array_push($text, array('key' => 'SEARCH_FRONT_END_NO_AVAILABILITY',\n 'parent' => 'PARENT_SEARCH_FRONT_END',\n 'text' => 'Nothing available.',\n 'location' => 'all'));\n array_push($text, array('key' => 'SEARCH_FRONT_END_NO_SERVICES_AVAILABLE',\n 'parent' => 'PARENT_SEARCH_FRONT_END',\n 'text' => 'There are no services available for the period you selected.',\n 'de' => 'There are no services available for the period you selected.',\n 'nl' => 'Er zijn geen er zijn geen diensten beschikbaar voor de periode die u hebt geselecteerd.',\n 'fr' => 'Il n<<single-quote>>y a pas de services disponibles pour la période que vous avez sélectionné.',\n 'pl' => 'W wybranych terminie nie posiadamy wolnych miejsc.',\n 'location' => 'all'));\n array_push($text, array('key' => 'SEARCH_FRONT_END_NO_SERVICES_AVAILABLE_SPLIT_GROUP',\n 'parent' => 'PARENT_SEARCH_FRONT_END',\n 'text' => 'You cannot add divided groups to a reservation.',\n 'location' => 'all'));\n /*\n * Sort\n */\n array_push($text, array('key' => 'SEARCH_FRONT_END_SORT_TITLE',\n 'parent' => 'PARENT_SEARCH_FRONT_END',\n 'text' => 'Sort by',\n 'location' => 'all'));\n array_push($text, array('key' => 'SEARCH_FRONT_END_SORT_NAME',\n 'parent' => 'PARENT_SEARCH_FRONT_END',\n 'text' => 'Name',\n 'location' => 'all'));\n array_push($text, array('key' => 'SEARCH_FRONT_END_SORT_PRICE',\n 'parent' => 'PARENT_SEARCH_FRONT_END',\n 'text' => 'Price',\n 'location' => 'all'));\n array_push($text, array('key' => 'SEARCH_FRONT_END_SORT_ASC',\n 'parent' => 'PARENT_SEARCH_FRONT_END',\n 'text' => 'Ascending',\n 'location' => 'all'));\n array_push($text, array('key' => 'SEARCH_FRONT_END_SORT_DESC',\n 'parent' => 'PARENT_SEARCH_FRONT_END',\n 'text' => 'Descending',\n 'location' => 'all'));\n /*\n * View\n */\n array_push($text, array('key' => 'SEARCH_FRONT_END_VIEW_GRID',\n 'parent' => 'PARENT_SEARCH_FRONT_END',\n 'text' => 'Grid view',\n 'location' => 'all'));\n array_push($text, array('key' => 'SEARCH_FRONT_END_VIEW_LIST',\n 'parent' => 'PARENT_SEARCH_FRONT_END',\n 'text' => 'List view',\n 'location' => 'all'));\n array_push($text, array('key' => 'SEARCH_FRONT_END_VIEW_MAP',\n 'parent' => 'PARENT_SEARCH_FRONT_END',\n 'text' => 'Map view',\n 'location' => 'all'));\n /*\n * Results\n */\n array_push($text, array('key' => 'SEARCH_FRONT_END_RESULTS_PRICE',\n 'parent' => 'PARENT_SEARCH_FRONT_END',\n 'text' => 'Start at %s',\n 'location' => 'all'));\n array_push($text, array('key' => 'SEARCH_FRONT_END_RESULTS_VIEW',\n 'parent' => 'PARENT_SEARCH_FRONT_END',\n 'text' => 'View',\n 'location' => 'all'));\n \n return $text;\n }", "private function _getTextContent($arguments) {\n $result = '';\n foreach ($arguments as $value) {\n if (is_array($value)) {\n $result .= $this->_getTextContent_recursive($value);\n } else {\n $result .= $value;\n }\n }\n\n return $result;\n }", "private function _getTextContent_recursive($arguments) {\n $result = '';\n foreach ($arguments as $key=>$value) {\n if (!is_numeric($key)) {\n $result .= $key;\n }\n\n if (is_array($value)) {\n $result .= $this->_getTextContent_recursive($value);\n } else {\n $result .= $value;\n }\n }\n return $result;\n }", "private function joinForDocFetcher($customersArray)\n {\n $stringresponse = '';\n $i = 1;\n $totalitems = count($customersArray);\n foreach ($customersArray as $item) {\n if ($i == 1 && $totalitems == 1) {\n return $stringresponse .= \"*\" . $item . \"*\";\n } elseif ($i == 1) {\n $stringresponse .= \"*\" . $item . \"*\";\n } elseif ($i == $totalitems) {\n $stringresponse .= \" OR *\" . $item . \"*\";\n } else {\n $stringresponse .= \" OR *\" . $item . \"*\";\n }\n $i++;\n }\n return $stringresponse;\n\n }", "function task1($strings, $glue = false)\n{\n $row = [];\n if (!empty($strings)) {\n foreach ($strings as $string) {\n if ($glue) {\n $row[] = $string;\n } else {\n $row[] = '<p>' . $string . '</p>';\n }\n }\n }\n return implode(' ', $row);\n}", "function get_test_solution($testtype, $wo_record, $nosent, $wo_text)\n{\n if ($testtype == 1) {\n $trans = repl_tab_nl($wo_record['WoTranslation']) . \n getWordTagList($wo_record['WoID'], ' ', 1, 0);\n return $nosent ? $trans : \"[$trans]\";\n }\n return $wo_text;\n}", "function subraya($text){\r\n return \"<u>$text</u>\";\r\n }", "function pre_content($string){\n\n $t = explode(\" \",$string);\n for($j = 0;$j<35;$j++){\n $arr[$j] = $t[$j];\n }\n $text = implode(\" \", $arr);\n return $text;\n //unset($arr);\n}", "public function getParagraph($index)\r\n {\r\n $examples = array(\r\n 'Vivamus eros mi, consequat nec mollis sit amet, venenatis vitae lorem. Ut sem dui, egestas eget turpis id, cursus iaculis odio. Proin efficitur risus sit amet ornare accumsan. Quisque volutpat pellentesque libero ut vulputate. Nunc ac arcu at leo elementum ultrices. Pellentesque sit amet molestie libero. Praesent a condimentum lectus.',\r\n 'Donec malesuada ligula augue, ut pulvinar lacus vulputate id. Nunc ornare ante turpis, eget dignissim odio ornare at. Fusce tellus urna, cursus vel ex in, ullamcorper auctor dolor. Nunc posuere dapibus dictum. Suspendisse placerat, odio non dignissim lobortis, felis felis rhoncus massa, et auctor dolor odio eget nulla. Nullam vestibulum.',\r\n 'Duis felis libero, consectetur in accumsan ac, pharetra vel tortor. Curabitur placerat nunc elit, lobortis bibendum arcu condimentum vel. Nullam neque diam, dignissim at urna sed, tristique elementum libero. Curabitur at ante nulla. Ut semper hendrerit tempus. Vivamus ullamcorper non erat vel convallis. In hac habitasse platea dictumst. Proin interdum.',\r\n 'Aliquam sit amet dolor quis augue pellentesque rutrum in ut risus. Vestibulum felis metus, ullamcorper vel magna id, pellentesque gravida orci. Morbi sit amet faucibus orci. Class aptent taciti sociosqu.',\r\n 'Fusce facilisis ipsum eget est ullamcorper, nec placerat elit porta. Fusce mattis tellus quis congue molestie. Duis gravida eros sit amet nulla tincidunt, imperdiet eleifend nibh maximus. Vivamus nulla sem.',\r\n 'Vestibulum viverra libero risus, in suscipit urna luctus eu. Cras vel diam pretium, rhoncus sem.',\r\n 'Vestibulum et nibh id nulla mollis posuere. Sed ultricies sem id massa finibus tincidunt. In bibendum ante ante, vitae pulvinar purus mattis non. Curabitur vitae tristique urna, nec elementum nulla. Aenean eget sapien consequat, tristique mi laoreet, porta ante. Cras urna massa, hendrerit at maximus id, tincidunt iaculis orci. Quisque vel arcu efficitur, blandit lectus id, ultrices libero. Aenean sit amet gravida nisi, nec elementum arcu. Nullam eu ornare dui.',\r\n 'Maecenas non ante ex. Suspendisse mollis ornare augue, quis dapibus tellus vestibulum vitae. Pellentesque vel turpis consectetur, rhoncus nunc sit amet, venenatis sapien. Nulla consectetur leo risus, vel accumsan ipsum scelerisque ac. Morbi quis dui ut nisi tristique pretium. Aliquam ultrices velit rutrum, bibendum velit ac, tincidunt dui. Nulla convallis lacinia enim id sodales. Phasellus efficitur ultrices facilisis. Duis sagittis orci purus, sit amet tincidunt urna commodo a. Nullam ornare.',\r\n 'In lobortis, dolor a cursus tempor, augue leo congue massa, ac vehicula orci lacus vel mauris. Maecenas pellentesque arcu in.',\r\n 'Duis magna lorem, consectetur sed diam in, cursus vulputate turpis. Curabitur sodales auctor facilisis. Integer vel tempor nisl, eget imperdiet.',\r\n 'Aenean lacinia dignissim ante, at vehicula velit vehicula et. Duis dignissim orci in commodo convallis. Sed semper tortor gravida tristique.',\r\n 'Maecenas et dignissim odio, quis elementum urna. Integer lorem dolor, laoreet non ullamcorper eget, blandit eu enim. Donec molestie a eros a interdum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras a posuere nunc. Donec vitae lorem in orci varius lobortis. Aenean mattis lectus urna. Sed ultrices vulputate neque, vitae finibus dolor tincidunt a. Donec ac velit nec purus ultrices fermentum.\r\n <br>Morbi sollicitudin laoreet nulla, quis blandit risus ultricies nec. Aliquam eget felis arcu. Donec volutpat, est vitae varius pellentesque, lectus lorem tempus tortor, ut ornare ipsum nisi sed dolor. Nam vel mauris maximus.',\r\n 'Integer ut purus sed nibh ultricies laoreet. Duis et porttitor risus. Quisque pretium quam facilisis lectus condimentum mattis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis.',\r\n 'Phasellus elit est, commodo vitae rhoncus id, ultrices ut velit. In ut sagittis ligula. Duis tristique lectus nisi. Cras egestas eleifend rhoncus. Donec eu aliquet quam. Pellentesque vel elementum tellus.',\r\n 'Suspendisse potenti. In risus mauris, fermentum sed lorem id, fringilla feugiat risus. Integer pharetra vestibulum elit eu pulvinar. Mauris quam urna, tristique eget felis in, efficitur auctor nulla. Sed sed cursus sem. Donec porta, mi non dapibus euismod, ipsum orci semper ante, at vestibulum purus elit et lacus. Donec gravida congue neque, nec dignissim lacus dapibus eu. Vestibulum eu nibh ultricies, cursus arcu vitae, convallis risus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In vulputate id enim sed pharetra. Sed consequat ultricies elit, in semper ex dictum non. Integer elementum ante quam, sed fermentum metus dictum nec. Cras dui odio, fringilla et ultricies sed, tincidunt nec elit. Nulla ultrices, mi in pulvinar scelerisque, elit diam molestie urna, id semper elit est vitae neque.\r\n <br>Etiam massa enim, hendrerit at felis eget, dictum consectetur erat. Fusce sed tellus ut purus accumsan hendrerit. Morbi vestibulum leo non nisl sagittis tempor. Sed blandit dictum cursus. Fusce accumsan turpis eget tellus sollicitudin, et scelerisque mi varius. Donec eget leo tincidunt diam pulvinar placerat. Curabitur bibendum ante ac dapibus aliquam. Nulla varius, tellus eget bibendum mattis, augue purus tincidunt ex, in placerat diam justo vitae velit. Nulla vel enim et erat ultricies efficitur ut nec felis. Nullam nisi purus, finibus non arcu ac, venenatis convallis est. Praesent ante turpis, tempor vitae velit ut, scelerisque tristique enim. Nam consequat nibh in lectus scelerisque, eget gravida eros rutrum. Nullam quis commodo lectus, ac posuere erat. Cras et rhoncus neque. Sed auctor quam eget ipsum feugiat, a eleifend mi vestibulum.\r\n <br>Suspendisse vulputate velit ac tempus semper. Pellentesque at facilisis massa, sit amet volutpat turpis. Aliquam dictum quam sit amet lectus fermentum, a accumsan metus dignissim. Etiam luctus at ante id eleifend. Sed non leo lectus. Aenean molestie placerat mollis. Suspendisse urna odio, rhoncus id lorem eu, mollis efficitur est. Ut viverra, erat id molestie malesuada, lorem tellus commodo mi, auctor laoreet augue risus sed mauris. Nullam commodo in purus vitae viverra. Integer eget auctor metus. Nam euismod tempus mollis.',\r\n );\r\n \r\n $key = $index % (count($examples ) - 1);\r\n return $examples[$key];\r\n }", "function searchesSearch($text){\n array_push($text, array('key' => 'PARENT_SEARCHES_SEARCH',\n 'parent' => '',\n 'text' => 'Search'));\n \n array_push($text, array('key' => 'SEARCHES_SEARCH_NAME',\n 'parent' => 'PARENT_SEARCHES_SEARCH',\n 'text' => 'Name'));\n \n array_push($text, array('key' => 'SEARCHES_SEARCH_LOADED',\n 'parent' => 'PARENT_SEARCHES_SEARCH',\n 'text' => 'Search loaded.'));\n \n return $text;\n }", "private static function createGenreListForResult($result, $individualGenreResults) {\n\t\t$matchCount = 0;\n\t\t$str = \"\";\n\t\tforeach ($individualGenreResults as $genre => $results) {\n\t\t\tif(in_array($result, $results)) {\n\t\t\t\tif($str===\"\") $str = $genre;\n\t\t\t\telse $str .= \", \" . $genre;\n\t\t\t\t$matchCount++;\n\t\t\t}\n\t\t}\n\t\tif($matchCount > 4) {\n\t\t\treturn \"multiple\";\n\t\t}\n\t\tif($matchCount == 0) {\n\t\t\treturn \"\";\n\t\t}\n\t\treturn $str;\n\t}", "function generate($array) {\n $result = \"\";\n ob_start();\n if(sizeof($array)) {\n $i = 0;\n foreach($array as $string) {\n $i++;\n echo \"<span style='background-color: \".$this->colors[\"seq\"].\"; border-right: 1px solid #949494;'>\".$i.\".&nbsp;</span>&nbsp;\";\n echo $string.\"<br/>\\r\\n\";\n }\n }\n $result = ob_get_contents();\n ob_end_clean();\n return $result;\n }", "function content_array_to_string($array){\n $joined_string=\"\";\n for($count=0;$count<count($array);$count++){\n \n if($count!=count($array)-1){\n $joined_string.= $array[$count].'/';\n }\n else{\n $joined_string.=$array[$count];\n }\n }\n return $joined_string;\n }", "function exec_output_to_tmpl_loop($exec_output, $trim)\n {\n $output_loop = array();\n for ($i=0; $i<count($exec_output); $i++)\n {\n if (($i <= 20) || ($i > count($exec_output) - 20) || ( ! $trim))\n {\n $output_loop[] = array('text' => $exec_output[$i]);\n\n if (($i == 20) && ($trim))\n {\n $output_loop[] = array('text' => '');\n $output_loop[] = array('text' => '[...]');\n $output_loop[] = array('text' => '');\n }\n }\n }\n\n return $output_loop;\n }", "function buildKeywords($array): string {\n\n $keywords = null;\n\n foreach ( $array as $key => $value ) {\n\n foreach ( $value as $key_2 => $value_2 ) {\n \n if ( next($value) ) {\n $keywords = $keywords . \"(\" . $value_2 . \") OR \";\n } else {\n $keywords = $keywords . \"(\" . $value_2 . \")\";\n }\n \n }\n }\n\n return $keywords;\n}", "public function provideInlineConversionTests() {\n $result = [\n [[\n 'descr' => \"[i] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [i]emergency broadcasting system[/i].\",\n 'html' => \"This is a test of the <i>emergency broadcasting system</i>.\",\n ]],\n [[\n 'descr' => \"[b] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [b]emergency broadcasting system[/b].\",\n 'html' => \"This is a test of the <b>emergency broadcasting system</b>.\",\n ]],\n [[\n 'descr' => \"[u] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [u]emergency broadcasting system[/u].\",\n 'html' => \"This is a test of the <u>emergency broadcasting system</u>.\",\n ]],\n [[\n 'descr' => \"[s] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [s]emergency broadcasting system[/s].\",\n 'html' => \"This is a test of the <strike>emergency broadcasting system</strike>.\",\n ]],\n [[\n 'descr' => \"[sup] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [sup]emergency broadcasting system[/sup].\",\n 'html' => \"This is a test of the <sup>emergency broadcasting system</sup>.\",\n ]],\n [[\n 'descr' => \"[sub] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [sub]emergency broadcasting system[/sub].\",\n 'html' => \"This is a test of the <sub>emergency broadcasting system</sub>.\",\n ]],\n [[\n 'descr' => \"[font=Arial] gets correctly converted (simple font name).\",\n 'bbcode' => \"This is a test of the [font=Arial]emergency broadcasting system[/font].\",\n 'html' => \"This is a test of the <span style=\\\"font-family:'Arial'\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[font=Times New Roman] gets correctly converted (unquoted default value).\",\n 'bbcode' => \"This is a test of the [font=Times New Roman]emergency broadcasting system[/font].\",\n 'html' => \"This is a test of the <span style=\\\"font-family:'Times New Roman'\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[font=Times New Roman size=1] gets converted (trailing parameter identified).\",\n 'bbcode' => \"This is a test of the [font=Times New Roman size=1]emergency broadcasting system[/font].\",\n 'html' => \"This is a test of the <span style=\\\"font-family:'Times New Roman'\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[font=\\\"Courier New\\\"] gets correctly converted (quoted default value).\",\n 'bbcode' => \"This is a test of the [font=\\\"Courier New\\\"]emergency broadcasting system[/font].\",\n 'html' => \"This is a test of the <span style=\\\"font-family:'Courier New'\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[font=\\\"Courier New\\\" blarg size=1] gets converted (floating parameter ignored).\",\n 'bbcode' => \"This is a test of the [font=\\\"Courier New\\\" blarg size=1]emergency broadcasting system[/font].\",\n 'html' => \"This is a test of the <span style=\\\"font-family:'Courier New'\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[size=6] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [size=6]emergency broadcasting system[/size].\",\n 'html' => \"This is a test of the <span style=\\\"font-size:2.0em\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[size=10] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [size=10]emergency broadcasting system[/size].\",\n 'html' => \"This is a test of the <span style=\\\"font-size:1.0em\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[size=blah] gets ignored.\",\n 'bbcode' => \"This is a test of the [size=blah]emergency broadcasting system[/size].\",\n 'html' => \"This is a test of the [size=blah]emergency broadcasting system[/size].\",\n ]],\n [[\n 'descr' => \"[color=red] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [color=red]emergency broadcasting system[/color].\",\n 'html' => \"This is a test of the <span style=\\\"color:red\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[color=gronk] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [color=gronk]emergency broadcasting system[/color].\",\n 'html' => \"This is a test of the <span style=\\\"color:gronk\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[color=#FFF] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [color=#FFF]emergency broadcasting system[/color].\",\n 'html' => \"This is a test of the <span style=\\\"color:#FFF\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[color=*#\\$] is prohibited.\",\n 'bbcode' => \"This is a test of the [color=*#\\$]emergency broadcasting system[/color].\",\n 'html' => \"This is a test of the [color=*#\\$]emergency broadcasting system[/color].\",\n ]],\n [[\n 'descr' => \"[spoiler] gets converted.\",\n 'bbcode' => \"Ssh, don't tell, but [spoiler]Darth is Luke's father[/spoiler]!\",\n 'html' => \"Ssh, don't tell, but <span class=\\\"bbcode_spoiler\\\">Darth is Luke's father</span>!\",\n ]],\n [[\n 'descr' => \"[acronym] gets converted.\",\n 'bbcode' => \"The [acronym=\\\"British Broadcasting Company\\\"]BBC[/acronym] airs [i]Doctor Who[/i] on Saturdays.\",\n 'html' => \"The <span class=\\\"bbcode_acronym\\\" title=\\\"British Broadcasting Company\\\">BBC</span> airs <i>Doctor Who</i> on Saturdays.\",\n ]],\n [[\n 'descr' => \"[acronym] safely encodes its content.\",\n 'bbcode' => \"The [acronym=_\\\"><script>alert(/XSS/.source)</script><x]Foo[/acronym] is safe.\",\n 'html' => \"The <span class=\\\"bbcode_acronym\\\" title=\\\"_&quot;&gt;&lt;script&gt;alert(/XSS/.source)&lt;/script&gt;&lt;x\\\">Foo</span> is safe.\",\n ]],\n ];\n return $result;\n }", "private function formatResultsAsHtml($search_string,$results,$highlighting=True){\r\n\t\t\tglobal $web_app_page_post_back_name;\r\n\t\t\tglobal $url_rest_node_param;\r\n\t\t\tglobal $search_index_structure_combined_attributes;\r\n\t\t\tglobal $search_index_structure_perspective;\r\n\t\t\t\r\n\t\t\t$html = \"<div class=\\\"search_result_heading\\\">\\n\";\r\n\t\t\t$html = $html . \"Search results for: <font class=\\\"search_phrase\\\">\" . htmlspecialchars($search_string) . \"</font><br />\\n\";\r\n\t\t\t$html = $html . \"</div><br />\\n\";\r\n\t\t\t\r\n\t\t\tif(count($results) > 0){\r\n\t\t\t\tforeach($results as $key => $value){\r\n\t\t\t\t\t$html = $html . \"<table class=\\\"search_result_item\\\">\\n\";\r\n\t\t\t\t\t$html = $html . \"<tr><td class=\\\"search_result_item\\\">\\n\";\r\n\t\t\t\t\t$html = $html . \"<a href=\\\"$web_app_page_post_back_name?$url_rest_node_param=\". urlencode($key) . \"\\\">\\n\";\r\n\t\t\t\t\t//$html = $html . $results[$key][\"name\"];\r\n\t\t\t\t\t//$display_name = preg_replace('/\\//',' ',$key);\r\n\t\t\t\t\t//$html = $html . $display_name;\r\n\t\t\t\t\t//$html = $html . $key;\r\n\t\t\t\t\tif(isset($value[$search_index_structure_perspective])){\r\n\t\t\t\t\t\t$html = $html . strtoupper($value[$search_index_structure_perspective]) . \" - \" . $key;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$html = $html . $key;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$html = $html . \"</a></td></tr>\\n\";\r\n\t\t\t\t\t$html = $html . \"<tr><td class=\\\"search_result_content\\\">\";\r\n\t\t\t\t\t//$html = $html . $results[$key][\"matched\"];\r\n\t\t\t\t\t//$highlight = $this->highlightHtml($search_string,$value);\r\n\t\t\t\t\t$highlight = $this->highlightHtml($search_string,htmlspecialchars($value[$search_index_structure_combined_attributes]));\r\n\t\t\t\t\t//$broken_apart = $this->trimHighlightedHtml($highlight);\r\n\t\t\t\t\t//$html = $html . \"$value\";\r\n\t\t\t\t\t$html = $html . \"$highlight\";\r\n\t\t\t\t\t$html = $html . \"</td></tr>\\n\";\r\n\t\t\t\t\t$html = $html . \"</table>\\n<br />\";\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\r\n\t\t\t\t$html = $html . \"<table class=\\\"search_result_item\\\">\\n\";\r\n\t\t\t\t$html = $html . \"<tr><td class=\\\"search_result_item\\\">Nothing found</td></tr>\\n\";\r\n\t\t\t\t$html = $html . \"</table>\\n<br />\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\treturn $html;\r\n\t\t}", "function longExplanation($text) {\n $students = \"Information for students and parents that are currently a part of the team or are interested in joining.\";\n if ($text == \"STUDENTS\") {\n return $students;\n }\n}", "function searchResults($results, $titlesOnly) {\r\n$IPBHTML = \"\";\r\n//--starthtml--//\r\n$IPBHTML .= <<<EOF\r\n{parse striping=\"searchStripe\" classes=\"row1,row2\"}\n<div id='search_results'>\n\t<ol>\n\t\t<if test=\"hasResults:|:is_array($results) && count($results)\">\n\t\t\t<foreach loop=\"results:$results as $result\">\n\t\t\t\t<if test=\"subResult:|:$result['sub']\">\n\t\t\t\t\t<li class='{parse striping=\"searchStripe\"} sub clearfix clear'>\n\t\t\t\t\t\t{$result['html']}\n\t\t\t\t\t</li>\n\t\t\t\t<else />\n\t\t\t\t\t<li class='{parse striping=\"searchStripe\"} clearfix clear'>\n\t\t\t\t\t\t{$result['html']}\n\t\t\t\t\t</li>\n\t\t\t\t</if>\n\t\t\t</foreach>\n\t\t</if>\n\t</ol>\n</div>\r\nEOF;\r\n//--endhtml--//\r\nreturn $IPBHTML;\r\n}", "public function providerToPlainText() {\n $tests = [];\n $tests[] = ['some text', 'some text'];\n $tests[] = ['some &amp; text', 'some & text'];\n $tests[] = ['<b>some text</b>', 'some text'];\n $tests[] = ['<script>alert(\\'message\\');</script><b>some text</b>', 'alert(\\'message\\');some text'];\n return $tests;\n }", "function getAllResearchFieldsText(){\r\n\t\t$authorDao =& DAORegistry::getDAO('AuthorDAO');\r\n\t\t$proposalDetailsDao =& DAORegistry::getDAO('ProposalDetailsDAO');\r\n \r\n // get all the authors with the same email\r\n $authors = $authorDao->getAuthorsByEmail($this->getEmail());\r\n\r\n $researchFields = array();\r\n \r\n // Get all the research fields of every submissions by the author\r\n foreach ($authors as $author) {\r\n $proposalDetails = $proposalDetailsDao->getProposalDetailsByArticleId($author->getSubmissionId());\r\n $rFields = $proposalDetails->getResearchFields(); \r\n $researchFieldCodeArray = explode(\"+\", $rFields);\r\n foreach ($researchFieldCodeArray as $rField) {\r\n $researchFields[] = $rField;\r\n }\r\n }\r\n\r\n // clean the arry of duplicates\r\n $researchFieldsCleaned = array_unique($researchFields);\r\n \r\n $researchFieldTextArray = array();\r\n $extraFieldDao =& DAORegistry::getDAO('ExtraFieldDAO');\r\n foreach($researchFieldsCleaned as $rFieldCode) {\r\n $extraField =& $extraFieldDao->getExtraField($rFieldCode);\r\n $fieldText = (isset($extraField) ? $extraField->getLocalizedExtraFieldName() : '');\r\n array_push($researchFieldTextArray, $fieldText);\r\n unset($extraField);\r\n }\r\n \r\n $researchFieldText = \"\";\r\n foreach($researchFieldTextArray as $i => $rfText) {\r\n $researchFieldText = $researchFieldText . $rfText;\r\n if($i < count($researchFieldTextArray)-1) $researchFieldText = $researchFieldText . \", \";\r\n }\r\n\r\n return $researchFieldText;\r\n }", "function macro_grep($args) {\n $regexp = getattr($args, 'regexp');\n $substr = getattr($args, 'substr');\n $page = getattr($args, 'page');\n\n if (!$substr && !$regexp) {\n return macro_error('Expecting parameter `substr` or `regexp`');\n }\n if ($substr && $regexp) {\n return macro_error(\"Parameters `substr` and `regexp` can't be used together\");\n }\n if (!$page) {\n return macro_error('Expecting parameter `page`');\n }\n\n if (!identity_can('macro-grep', $args)) {\n return macro_permission_error();\n }\n\n if ($substr) {\n $textblocks = textblock_grep($substr, $page, false);\n } else {\n $textblocks = textblock_grep($regexp, $page, true);\n }\n $textblocks_good = array();\n foreach ($textblocks as $textblock) {\n if (identity_can(\"textblock-view\", $textblock)) {\n $textblocks_good[] = $textblock;\n }\n }\n\n ob_start();\n?>\n<div class=\"macroToc\">\n<p><strong><?= count($textblocks_good) ?></strong> rezultate.</p>\n<ul>\n<?php foreach ($textblocks_good as $textblock) { ?>\n <li><?= format_link(url_textblock($textblock['name']), $textblock['title']) ?></li>\n<?php } ?>\n</ul>\n</div>\n<?php\n $buffer = ob_get_clean();\n\n return $buffer;\n}" ]
[ "0.5645378", "0.55541784", "0.5486493", "0.54757285", "0.5426167", "0.5367588", "0.5312508", "0.5311192", "0.52687865", "0.52354336", "0.5231502", "0.5210922", "0.51805687", "0.5176376", "0.5146155", "0.5099463", "0.5093051", "0.50730574", "0.50646913", "0.50477", "0.5037037", "0.5032388", "0.4989034", "0.49826416", "0.49746516", "0.4973031", "0.4949891", "0.49377036", "0.4910973", "0.49034175" ]
0.6438608
0
Build link to alternative resource
function build_alternative($name, $url, $image, $color, $proxy_required) { $link = '<a class="button ' . $color . '" href="'; if ($proxy_required) { $link .= PROXY_PREFIX; } $link .= $url . '" target="_blank"><span class="icon"><img src="' . LIBRARY_SEARCH_URL . '/images/' . $image . '" alt="' . $name . ' Logo" /></span><span class="text">Search ' . $name . ' for <em>' . urldecode($this->query) . '</em> &raquo;</span></a>'; return $link; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function attachUrl(ResourceEntry $resource);", "public function link()\r\n\t{\r\n\t\t$language_segment = (Config::get('core::languages')) ? $this->language->uri . '/' : '';\r\n\r\n\t\treturn url($language_segment . 'galleries/' . $this->gallery->slug . '/' . $this->id);\r\n\t}", "function generate_external_link($id, $ext)\n {\n global $data_sub;\n $data_sub1 = \"\";\n if($data_sub !== \"\")\n $data_sub1 = \"${data_sub}.\";\n \n $append_ext = \"\";\n if($ext == \"gif\" || $ext == \"webm\")\n $append_ext = \".$ext\";\n\n global $server_name;\n return format_public_uri($data_sub1.$server_name, true).\"/\".$id.$append_ext;\n }", "public function makelink()\n {\n /*\n * If link set directly that forces using it rather than build\n */\n if ($this->link) {\n return $this->link;\n }\n\n $pageid = static::makeParameterId($this->for);\n $parameters = $this->app['request']->query->all();\n if (array_key_exists($pageid, $parameters)) {\n unset($parameters[$pageid]);\n } else {\n unset($parameters['page']);\n }\n\n $parameters[$pageid] = '';\n $link = '?' . http_build_query($parameters);\n\n return $link;\n }", "function vcex_build_link( $link, $fallback = '' ) {\n\tif ( empty( $link ) ) {\n\t\treturn $fallback;\n\t}\n\n\t// Return if there isn't any link.\n\tif ( '||' == $link || '|||' == $link || '||||' == $link ) {\n\t\treturn;\n\t}\n\n\t// Return simple link escaped (fallback for old textfield input).\n\tif ( false === strpos( $link, 'url:' ) ) {\n\t\treturn esc_url( $link );\n\t}\n\n\t// Build link.\n\t// Needs to use total function to fix issue with fallbacks.\n\t$link = vcex_parse_multi_attribute( $link, array( 'url' => '', 'title' => '', 'target' => '', 'rel' => '' ) );\n\n\t// Sanitize.\n\t$link = is_array( $link ) ? array_map( 'trim', $link ) : '';\n\n\treturn $link;\n}", "function href() {\n\t\t$usemodrewrite = polarbear_setting('usemodrewrite');\n\t\tif ($usemodrewrite) {\n\t\t\treturn $this->fullpath();\n\t\t} else {\n\t\t\treturn $this->templateToUse() . '?polarbear-page=' . $this->getId();\n\t\t}\n\t}", "function get_generic_link() {\n\t\treturn $this->url;\n\t}", "function alt_from_resource($source,$target,$name='',$delete=false){\n\t// alt is the source resource, $ref is the target resource that will get the new alternate\n\tglobal $view_title_field;\n\t$srcdata=get_resource_data($source);\n\t$srcext = $srcdata['file_extension'];\n\t$srcpath = get_resource_path($source,true,\"\",false,$srcext);\n\tif ($name == ''){\n\t\t$name = sql_value(\"select value from resource_data where resource_type_field = '$view_title_field' and resource = '$source'\",'Untitled');\n\t}\n\n\t$description = '';\n\tif (!file_exists($srcpath)){\n\t\techo \"ERROR: File not found.\";\n\t\treturn false;\n\t} else {\n\n\t\t$file_size = filesize_unlimited($srcpath);\n\t\t$altid = add_alternative_file($target,$name,$description=\"\",$file_name=\"\",$file_extension=\"\",$file_size,$alt_type='');\n\t\t$newpath = get_resource_path($target,true,\"\",true,$srcext,-1,1,false,'',$altid);\n\t\tcopy($srcpath,$newpath);\n\t\t# Preview creation for alternative files (enabled via config)\n global $alternative_file_previews;\n if ($alternative_file_previews){\n\t\t\tcreate_previews($target,false,$srcext,false,false,$altid);\n \t}\n\t\tif ($delete){\n\t\t\t// we are supposed to delete the original resource when we're done\n\t\t\t# Not allowed to edit this resource? They shouldn't have been able to get here.\n\t\t\tif ((!get_edit_access($source,$srcdata[\"archive\"],false,$srcdata))||checkperm('D')) {\n\t\t\t\texit (\"Permission denied.\");\n\t\t\t} else {\n\t\t\t\tdelete_resource($source);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\n\t}\n}", "function alternateAbsoluteLink($action=null) {\n\t\t$segment = ($action) ? \"/\".$action : '';\n\t\treturn TranslatableDomains::convertLocaleToTLD($withEndSlash=false).Director::baseURL().$this->owner->URLSegment.'/'.$segment;\n\t}", "public function buildFrontendUri() {}", "public function getOfficialLink();", "function offer_link($resource)\n{\n return Button::success()->withIcon(Icon::check())->withAttributes(['title' => 'ofertar', 'data-toggle' => 'tooltip'])\n ->asLinkTo(route('bids.offer.create', ['bid' => $resource]));\n}", "public function getPrepareLink()\n {\n $baseUrl = Mage::app()->getStore($this->getStoreId())->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);\n \n return $baseUrl . $this->getData('path') . $this->getFilename();\n }", "function getLink(): string;", "protected function getMoreLinkURL()\n {\n return $this->buildURL(self::WIDGET_TARGET_NEW_ARRIVALS);\n }", "function helpLink() {\n\t\t// By default it's an (external) URL, hence not a valid Title.\n\t\t// But because MediaWiki is by nature very customizable, someone\n\t\t// might've changed it to point to a local page. Tricky!\n\t\t// @see https://phabricator.wikimedia.org/T155319\n\t\t$helpPage = $this->msg( 'helppage' )->inContentLanguage()->plain();\n\t\tif ( preg_match( '/^(?:' . wfUrlProtocols() . ')/', $helpPage ) ) {\n\t\t\t$helpLink = Linker::makeExternalLink(\n\t\t\t\t$helpPage,\n\t\t\t\t$this->msg( 'help' )->plain()\n\t\t\t);\n\t\t} else {\n\t\t\t$helpLink = MediaWikiServices::getInstance()->getLinkRenderer()->makeKnownLink(\n\t\t\t\tTitle::newFromText( $helpPage ),\n\t\t\t\t$this->msg( 'help' )->text()\n\t\t\t);\n\t\t}\n\t\treturn $helpLink;\n\t\t// This doesn't work with the default value of 'helppage' which points to an external URL\n\t\t// return $this->footerLink( 'help', 'helppage' );\n\t}", "public function getLink()\n {\n return $this->getMonstring()->getLink()\n . 'program/?hendelse='\n . $this->getId();\n }", "public function buildUrl($resource)\n {\n return $this->baseUrl.$resource.'/'.$this->method;\n }", "public function asLink()\n {\n $label = $this->title ?: $this->value;\n return '<a href=\"' . $this->href .'\" title=\"' . $label . '\">' . $label . '</a>';\n }", "public function link() { return site_url().'/'.$this->post->post_name; }", "public function link() {\n $num_args = func_num_args();\n $optional = $this->simple_expression->getOptionalPlaceholderCount();\n $max_args = $this->simple_expression->getPlaceholderCount();\n // correct number of arguments given?\n if($num_args <= $max_args && $num_args >= $max_args - $optional) {\n\n $args = func_get_args();\n\n // add some empty entries in where for the not given optional arguments\n $optional > 0 && $args = array_values(array_merge($args, array_fill(0, $optional, null)));\n\n foreach($args as $key => $arg) {\n if(is_array($arg)) {\n $args[$key] = array_map('urlencode', $arg);\n } else {\n $args[$key] = urlencode($arg);\n }\n }\n $args = array_map('urlencode', $args);\n\n $link = $this->simple_expression->replace($args, false);\n } else {\n throw new BadMethodCallException(\"Invalid number of arguments when linking to '{$this->url}'\");\n }\n\n return $link;\n }", "function rsd_link()\n {\n }", "public function makeLinkButton() {}", "function render_external_link($text, $link, $params = array(), $no_banner = true,\n $alt_src = null) {\n if (is_mobile() || $no_banner) {\n $params = array_merge($params, array('target' => '_blank'));\n } else {\n $link = BASE_URL.'ex/?s='.urlencode($link);\n if ($alt_src) {\n $link .= '&a='.urldecode($alt_src);\n }\n }\n return render_link_helper($text, $link, false, $params);\n}", "function buildRESTAPIUrl($SiteURL, $APILink, $ObjectType, $ObjectIdentifier){\n\t\t//TODO: add ability to remove double slashes\n\t\t$url = $SiteURL . $APILink . \"/\" . $ObjectIdentifier . $ObjectType;\n\t\treturn $url;\n\t}", "function href($link = false, $name = false) {\n $return = config('host') . $link;\n\n if ($name) {\n $return = '<a href=\"' . $return . '\">' . $name . '</a>';\n }\n\n return $return;\n}", "public function link($type='')\n\t{\n\t\t$link = $this->_base;\n\n\t\t// If it doesn't exist or isn't published\n\t\tswitch (strtolower($type))\n\t\t{\n\t\t\tcase 'edit':\n\t\t\t\t$link .= '&task=edit&id=' . $this->get('id');\n\t\t\tbreak;\n\n\t\t\tcase 'delete':\n\t\t\t\t$link .= '&task=delete&id=' . $this->get('id');\n\t\t\tbreak;\n\n\t\t\tcase 'answer':\n\t\t\t\t$link .= '&task=answer&id=' . $this->get('id') . '#comments';\n\t\t\tbreak;\n\n\t\t\tcase 'comments':\n\t\t\t\t$link .= '&task=question&id=' . $this->get('id') . '#comments';\n\t\t\tbreak;\n\n\t\t\tcase 'math':\n\t\t\t\t$link .= '&task=question&id=' . $this->get('id') . '#math';\n\t\t\tbreak;\n\n\t\t\tcase 'report':\n\t\t\t\t$link = 'index.php?option=com_support&task=reportabuse&category=question&id=' . $this->get('id');\n\t\t\tbreak;\n\n\t\t\tcase 'permalink':\n\t\t\tdefault:\n\t\t\t\t$link .= '&task=question&id=' . $this->get('id');\n\t\t\tbreak;\n\t\t}\n\n\t\treturn $link;\n\t}", "function _makeInternalLink($href)\n\t{\n\t\t$id = path_to_id_ct($href, FILE_TABLE, $ct);\n\t\tif (substr($ct, 0, 5) == \"text/\") {\n\t\t\t$href = \"document:$id\";\n\t\t} else \n\t\t\tif ($ct == \"image/*\") {\n\t\t\t\tif (strpos($href, \"?\") === false) {\n\t\t\t\t\t$href .= \"?id=$id\";\n\t\t\t\t}\n\t\t\t}\n\t\treturn $href;\n\t}", "public function getLink();", "public function getLink();" ]
[ "0.6242454", "0.62380683", "0.6227382", "0.6225177", "0.62251323", "0.6209397", "0.61803246", "0.61436737", "0.6141826", "0.6128158", "0.6112433", "0.6107837", "0.60501593", "0.6050087", "0.6040822", "0.6014566", "0.5989861", "0.59869367", "0.59579", "0.59534013", "0.5947313", "0.5946482", "0.59438837", "0.5931797", "0.5930021", "0.59158003", "0.59058625", "0.59043294", "0.58882576", "0.58882576" ]
0.6806993
0
Print total count of results
function print_count() { $span = '<span class="count">' . number_format($this->result_count) . '</span> result'; if ($this->result_count > 1) { $span .= 's'; } return $span; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTotalNumberOfResults();", "public function totalCount();", "public function totalCount();", "public function getTotalResults();", "public function getTotalCount();", "public function getTotalCount();", "public function getTotalCount();", "function print_results() {\r\n if ($list = $this->print_list()) {\r\n echo '<p>' . $this->print_count() . '</p>';\r\n echo $list;\r\n echo '<p class=\"more\">' . $this->print_more() . '</p>';\r\n }\r\n else {\r\n echo $this->zero_results;\r\n }\r\n }", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();" ]
[ "0.76372206", "0.75731957", "0.75731957", "0.7538539", "0.7512835", "0.7512835", "0.7512835", "0.71726066", "0.7101554", "0.7101554", "0.7101554", "0.7101554", "0.7101554", "0.7101554", "0.7101554", "0.7101554", "0.7101554", "0.7101554", "0.7101554", "0.7101554", "0.7101554", "0.7101554", "0.7101554", "0.7101554", "0.7101554", "0.7101554", "0.7101554", "0.7101554", "0.7101554", "0.7101554" ]
0.76789707
0
Comprehensive print results function
function print_results() { if ($list = $this->print_list()) { echo '<p>' . $this->print_count() . '</p>'; echo $list; echo '<p class="more">' . $this->print_more() . '</p>'; } else { echo $this->zero_results; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function printOutput()", "public function printResults() {\n $assertions = $this->getAssertions();\n $failures = $this->getFailures();\n $errors = $this->getErrors();\n return \"Assertions: \" . $assertions . \", Failures: \" . $failures . \" and \" . $errors . \" errors.\";\n }", "public function printResult() {\n $result = array($this->callerFunctionName => array());\n foreach ($this->stacks as $caller_name => $stack_info) {\n $result[$this->callerFunctionName][] = array(\n $caller_name => $stack_info['count'],\n );\n }\n if (is_callable($this->resultPrintFunction)) {\n $this->resultPrintFunction($result);\n }\n }", "public function print();", "public function printResult ($term = NULL) {\n print $this->saveResult($term);\n\n }", "function printResults(array $results, bool $includeDescription = false)\n{\n $width = [\n 'name' => 0,\n 'price' => 0,\n 'link' => 0,\n 'eshop' => 0,\n 'description' => 0,\n ];\n\n foreach ($results as $result) {\n foreach ($result as $key => $value) {\n $width[$key] = max(mb_strlen($value), $width[$key]);\n }\n }\n\n echo '+'.str_repeat('-', 2 + $width['name']);\n echo '+'.str_repeat('-', 2 + $width['price']);\n echo '+'.str_repeat('-', 2 + $width['link']);\n echo '+'.str_repeat('-', 2 + $width['eshop']).\"+\\n\";\n\n\n foreach ($results as $result) {\n\n echo '| '.$result['name'].str_repeat(' ', $width['name'] - mb_strlen($result['name'])).' ';\n echo '| '.$result['price'].str_repeat(' ', $width['price'] - mb_strlen($result['price'])).' ';\n echo '| '.$result['link'].str_repeat(' ', $width['link'] - mb_strlen($result['link'])).' ';\n echo '| '.$result['eshop'].str_repeat(' ', $width['eshop'] - mb_strlen($result['eshop'])).' ';\n echo \"|\\n\";\n echo '+'.str_repeat('-', 2 + $width['name']);\n echo '+'.str_repeat('-', 2 + $width['price']);\n echo '+'.str_repeat('-', 2 + $width['link']);\n echo '+'.str_repeat('-', 2 + $width['eshop']).\"+\\n\";\n if ($includeDescription) {\n echo '| '.$result['description'].str_repeat(' ',\n max(0, 7 + $width['name'] + $width['price'] + $width['link'] - mb_strlen($result['description'])));\n echo \"|\\n\";\n echo str_repeat('-', 10 + $width['name'] + $width['price'] + $width['link']).\"\\n\";\n }\n }\n}", "public function print_result(){\n $parsed_result = (array) $this->get_result()->parse_result();\n foreach($parsed_result['items'] as $repository_detail){\n $out .= $repository_detail->full_name.': '.$repository_detail->description.'<br />';\n }\n echo $out;\n }", "function echoResultsQREE ($rows) \r{\r \techo \"<table cellpadding=7>\\n\";\r \tforeach ($rows as $row) {\r\t\techo \"\\n\\n\\n<tr>\\n<td valign=top>\\n\";\r\t\techoDocumentLink($row);\r\t\techo \"<td><font color=blue>\".$row[0].\"</font><br>\";\r\t\techoTwoSentences($row[3],$row[4],$row[5],$row[6],$row[7],false);\r \t}\r \techo \"</table>\\n\";\r}", "function prof_print()\r\n{\r\n global $prof_timing, $prof_names, $profiling;\r\n $size = count($prof_timing);\r\n for($i=0;$i<$size - 1; $i++)\r\n {\r\n \tif($profiling)\r\n \t{\r\n \techo \"{$prof_names[$i]}\\n\";\r\n \techo sprintf(\" %f\\n\", $prof_timing[$i+1]-$prof_timing[$i]);\r\n \t}\r\n }\r\n if($profiling)\r\n {\r\n \techo \"{$prof_names[$size-1]}\\n\";\r\n\t}\r\n}", "function printResult($result) {\n\t\t\t\techo \"<div class='Pokeguide'>\n\t\t\t\techo \"<table>\";\n\n\t\t\t\twhile ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n\t\t\t\t\tfor ($i = 0; $i < 15; $i++){\n\t\t\t\t\t\techo \"<tr><td>\" . $row[$i] . \"</td></tr>\"; //or just use \"echo $row[0]\" \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\techo \"</table>\";\n\t\t\t\techo \"</div>\";\n\t\t\t}", "private static function pretty_print($result, $n) {\n\t\tfor ($i = 0; $i < $n; $i++) {\n\t\t\t$m = $result[$i]->Count();\n\t\t\t$crawl = $result[$i]->Tail();\n\t\t\tfor ($j = 0; $j < $m; $j++) {\n\t\t\t\techo \"Line : \" . $i;\n\t\t\t\techo \"\\t\\t Value : \" . $crawl->Value();\n\t\t\t\techo \"\\t\\t Column: \" . $crawl->Column();\n\t\t\t\t$crawl = $crawl->Next();\n\t\t\t\techo \"\\n\";\n\t\t\t}\n\t\t}\n\t}", "public function print_out()\n {\n echo \"id: \" . $this->id . \"<br/>\";\n echo $this->rewrite;\n echo $this->extension;\n echo $this->stranglerPattern;\n echo $this->continuousEvolution;\n echo $this->split;\n echo $this->processStrategyOthers;\n echo $this->ddd;\n echo $this->functionalDecomposition;\n echo $this->existingStructure;\n echo $this->decompositionStrategyOthers;\n echo $this->SCA;\n echo $this->MDA;\n echo $this->WDA;\n echo $this->DMC;\n echo $this->techniqueOthers;\n echo $this->GR;\n echo $this->MO;\n echo $this->sourceCode;\n echo $this->useCase;\n echo $this->systemSpecification;\n echo $this->API;\n echo $this->inputOthers;\n echo $this->list;\n echo $this->archi;\n echo $this->outputOthers;\n echo $this->experiment;\n echo $this->example;\n echo $this->caseStudy;\n echo $this->noValidation;\n echo $this->maintainability;\n echo $this->performance;\n echo $this->reliability;\n echo $this->scalability;\n echo $this->security;\n echo $this->qualityOthers;\n echo $this->score;\n echo $this->matchScore;\n echo $this->misMatch . \"<br/>\";\n }", "function pr($data) {\n echo \"<pre>\" . print_r($data, true) . \"</pre>\";\n}", "public function printResult() {\n $this->result->path = $this->getType() . 's/' . $this->getName() . '#tmp';\n\n // text/plain is used to support IE\n header('Cache-Control: no-cache');\n header('Content-Type: text/plain; charset=utf-8');\n\n print $this->getResult();\n }", "function echoResult($myarray){\n\t\t\t$ctr = 1;\n\t\t\tforeach($myarray as $entry){\n\t\t\t\techo \"<p>$ctr : $entry</p>\";\n\t\t\t\t$ctr += 1;\n\t\t\t}\n\t\t}", "public static function doPrint($ast)\n {\n }", "function printResults(&$results) {\n // the profile name and total sessions.\n if (count($results->getRows()) > 0) {\n\n // Get the profile name.\n $profileName = $results->getProfileInfo()->getProfileName();\n\n // Get the entry for the first entry in the first row.\n $rows = $results->getRows();\n $sessions = $rows[0][0];\n\n // Print the results.\n print \"First view (profile) found: $profileName\\n\";\n print \"Total sessions: $sessions\\n\";\n } else {\n print \"No results found.\\n\";\n }\n}", "function printResultForAggregation($result) {\n while (($row = oci_fetch_array($result)) != false) {\n echo \"<p class=\\\"wrapper\\\">\";\n echo $row[1];\n echo \": \";\n echo $row[0];\n echo \"</p>\";\n }\n }", "function printResults($reports) {\n for ( $reportIndex = 0; $reportIndex < count( $reports ); $reportIndex++ ) {\n $report = $reports[ $reportIndex ];\n $header = $report->getColumnHeader();\n $dimensionHeaders = $header->getDimensions();\n $metricHeaders = $header->getMetricHeader()->getMetricHeaderEntries();\n $rows = $report->getData()->getRows();\n\n for ( $rowIndex = 0; $rowIndex < count($rows); $rowIndex++) {\n $row = $rows[ $rowIndex ];\n $dimensions = $row->getDimensions();\n $metrics = $row->getMetrics();\n for ($i = 0; $i < count($dimensionHeaders) && $i < count($dimensions); $i++) {\n print($dimensionHeaders[$i] . \": \" . $dimensions[$i] . \"\\n\");\n }\n\n for ($j = 0; $j < count($metrics); $j++) {\n $values = $metrics[$j]->getValues();\n for ($k = 0; $k < count($values); $k++) {\n $entry = $metricHeaders[$k];\n print($entry->getName() . \": \" . $values[$k] . \"\\n\");\n }\n }\n }\n }\n}", "function prof_print()\n{\n global $prof_timing, $prof_names;\n $size = count($prof_timing);\n for ($i = 0; $i < $size - 1; $i++) {\n echo \"<b>{$prof_names[$i]}</b><br>\";\n echo sprintf(\"&nbsp;&nbsp;&nbsp;%f<br>\", $prof_timing[$i + 1] - $prof_timing[$i]);\n }\n echo \"<b>{$prof_names[$size - 1]}</b><br>\";\n}", "function printResults(&$results) {\n\t // the profile name and total sessions.\n\t if (count($results->getRows()) > 0) {\n\n\t // Get the profile name.\n\t $profileName = $results->getProfileInfo()->getProfileName();\n\n\t // Get the entry for the first entry in the first row.\n\t $rows = $results->getRows();\n\t $sessions = $rows[0][0];\n\n\t // Print the results.\n\t print \"First view (profile) found: $profileName\\n\";\n\t print \"Total sessions: $sessions\\n\";\n\t } else {\n\t print \"No results found.\\n\";\n\t }\n\t}", "function tf_print($value, $die = false) {\r\n static $first_time = true;\r\n\r\n if ($first_time) {\r\n ob_start();\r\n ?><style type=\"text/css\">\r\n div.tf_print_r {\r\n max-height: 500px;\r\n overflow-y: scroll;\r\n background: #111;\r\n margin: 10px 30px;\r\n padding: 0;\r\n border: 1px solid #F5F5F5;\r\n position: relative;\r\n z-index: 10;\r\n }\r\n\r\n div.tf_print_r pre {\r\n color: #47EE47;\r\n text-shadow: 1px 1px 0 #000;\r\n font-family: Consolas, monospace;\r\n font-size: 12px;\r\n margin: 0;\r\n padding: 5px;\r\n display: block;\r\n line-height: 16px;\r\n text-align: left;\r\n }\r\n </style><?php\r\n echo str_replace(array(' ', \"\\n\"), '', ob_get_clean());\r\n }\r\n\r\n ?><div class=\"tf_print_r\"><pre><?php print htmlspecialchars(tf_print_r($value, true), null, 'UTF-8'); ?></pre></div><?php\r\n\r\n $first_time = false;\r\n\r\n if ($die) die();\r\n }", "public function outputResults()\r\n {\r\n // loop all products and display results per product\r\n foreach ($this->Products->getAllProducts() as $productId => $productName) {\r\n echo \"Product ID: \" . $productId . \"\\n\";\r\n echo \"Product Name: \" . $productName . \"\\n\";\r\n echo \"Total Units Sold: \" . $this->ProductsSold->getSoldTotal($productId) . \"\\n\";\r\n echo \"Total Units Purchased and Pending: \" . $this->ProductsPurchased->getPurchasedPendingTotal($productId) . \"\\n\";\r\n echo \"Total Units Purchased and Received: \" . $this->ProductsPurchased->getPurchasedReceivedTotal($productId) . \"\\n\";\r\n echo \"Current Stock Level: \" . $this->Inventory->getStockLevel($productId) . \"\\n\\n\";\r\n }\r\n }", "public function showTestResults() {\n echo \"Tests: {$this->tests}\\n\";\n echo \"Pass: {$this->pass}\\n\";\n echo \"Fail: {$this->fail}\\n\";\n }", "function printResult($result) {\n\techo \"result from SQL:\";\n echo \"<table>\";\n\twhile ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr>\\n\";\n foreach ($row as $item) {\n echo \" <td>\" . ($item !== null ? htmlentities($item, ENT_QUOTES) : \"&nbsp;\") . \"</td>\\n\";\n }\n echo \"</tr>\\n\";\n }\n echo \"</table>\\n\";\n}", "function printResults($reports) {\n\n\n for ( $reportIndex = 0; $reportIndex < count( $reports ); $reportIndex++ ) {\n $report = $reports[ $reportIndex ];\n $header = $report->getColumnHeader();\n $dimensionHeaders = $header->getDimensions();\n $metricHeaders = $header->getMetricHeader()->getMetricHeaderEntries();\n $rows = $report->getData()->getRows();\n for ( $rowIndex = 0; $rowIndex < count($rows); $rowIndex++) {\n $row = $rows[ $rowIndex ];\n $dimensions = $row->getDimensions();\n $metrics = $row->getMetrics();\n for ($i = 0; $i < count($dimensionHeaders) && $i < count($dimensions); $i++) {\n print($dimensionHeaders[$i] . \": \" . $dimensions[$i] . \"\\n\");\n }\n \n for ($j = 0; $j < count($metrics); $j++) {\n $values = $metrics[$j]->getValues();\n for ($k = 0; $k < count($values); $k++) {\n $entry = $metricHeaders[$k];\n print($entry->getName() . \": \" . $values[$k] . \"\\n\");\n }\n }\n }\n }\n }", "function printResults () {\n\n if (! $this->isActive()) { return; }\n\n $unstoppedTasks = array_keys($this->startTime);\n if (count($unstoppedTasks)) {\n Tht::error('Unstopped Perf task: `' . $unstoppedTasks[0] . '`');\n }\n\n $results = $this->results();\n\n // Have to do this outside of results() or the audit calls will show up in the perf tasks.\n // $results['imageAudit'] = Tht::module('Image')->auditImages(Tht::path('public'));\n\n $thtDocLink = Tht::getThtSiteUrl('/reference/perf-panel');\n $compileMessage = Compiler::getDidCompile() ? '<div class=\"bench-compiled\">Files were updated. Refresh to see compiled results.</div>' : '';\n\n $table = OTypeString::getUntyped(\n Tht::module('Web')->u_table(OList::create($results['single']),\n OList::create([ 'task', 'durationMs', 'memoryMb', 'value' ]),\n OList::create([ 'Task', 'Duration (ms)', 'Peak Memory (MB)', 'Detail' ]),\n OMap::create(['class' => 'bench-result'])\n ), 'html');\n\n $tableGroup = OTypeString::getUntyped(\n Tht::module('Web')->u_table(OList::create($results['group']),\n OList::create([ 'task', 'durationMs', 'memoryMb', 'numCalls' ]),\n OList::create([ 'Task', 'Duration (ms)', 'Memory (MB)', 'Calls' ]),\n OMap::create(['class' => 'bench-result'])\n ), 'html');\n\n\n $opCache = '';\n if (Tht::isOpcodeCacheEnabled()) {\n $opCache = '<span style=\"color: #393\">ON</span>';\n }\n else {\n $opCache = '<span style=\"color: #c33\">OFF</span>';\n }\n\n $appCache = Tht::module('Cache')->u_get_driver();\n if ($appCache == 'file') {\n $appCache = '<span style=\"color: #c33\">' . $appCache . '</span>';\n }\n else {\n $appCache = '<span style=\"color: #393\">' . $appCache . '</span>';\n }\n\n\n\n $phpVersion = phpVersion();\n\n\n echo $this->perfPanelCss();\n echo $this->perfPanelJs($results['scriptTime']);\n\n ?>\n <div id=\"perf-score-container\">\n\n <div class=\"perfSection\">\n <div class='perfHeader'>Perf Score: <span id='perfScoreTotalLabel'></span><span id='perfScoreTotal'></span></div>\n\n <div class=\"perfHelp\"><a href=\"<?= $thtDocLink ?>\" style=\"font-weight:bold\">About This Score</a></div>\n </div>\n\n <?= $compileMessage ?>\n\n <div class=\"perfSection\">\n <div class=\"perfTotals\">\n <div>Server - Page Execution: <span id=\"perfScoreServer\"><?= $results['scriptTime'] ?> ms</span></div>\n <div>Network - Transfer: <span id='perfScoreNetwork'></span></div>\n <div>Browser - window.onload: <span id='perfScoreClient'></span></div>\n </div>\n </div>\n\n <div class=\"perfSection\">\n <div class=\"perfTotals\">\n <div>Server - Peak Memory: <span><?= $results['peakMemory'] ?> MB</span></div>\n </div>\n </div>\n\n <div class=\"perfSection tasksGrouped\">\n <div class=\"perfSubHeader\">Top Tasks (Grouped)</div>\n <?= $tableGroup ?>\n </div>\n\n <div class=\"perfSection\">\n <div class=\"perfSubHeader\">Top Tasks (Individual)</div>\n <?= $table ?>\n <div style='text-align:center; margin-top:48px;'>\n <p style=\"font-size: 80%\"> Sub-task time is not included in parent tasks.</p>\n </div>\n </div>\n\n\n\n <div class=\"perfSection\">\n <div class=\"perfHeader\">PHP Info</div>\n\n <div style=\"text-align: left; width: 300px; display: inline-block; margin-top: 32px\">\n <li>PHP Version: <b><?= $phpVersion ?></b></li>\n <li>Opcode Cache: <b><?= $opCache ?></b></li>\n <li>App Cache Driver: <b><?= $appCache ?></b></li>\n </div>\n </div>\n\n <div class=\"perfSection\">\n Perf Panel only visible to localhost or <code>devIp</code> in <code>config/app.jcon</code>\n </div>\n\n </div>\n <?php\n\n }", "public function ViewResults() {\n echo \"<pre>\" . print_r($this->rs, TRUE) . \"</pre>\";\n }", "function print_results() {\n global $dbh;\n print \"results:\\n\";\n $res = $dbh->query(\"SELECT * FROM phptest WHERE a = 72 ORDER BY b\");\n $i = 0;\n while ($row = $res->fetchRow(DB_FETCHMODE_ORDERED)) {\n print '|' . implode(\" - \", $row) . \"|\\n\";\n $i++;\n }\n if (!$i) {\n print \"The records were not found. Did they get inserted?\\n\";\n }\n}", "function printResult($result) {\n while (($row = oci_fetch_array($result)) != false) {\n echo \"<p class=\\\"wrapper\\\">\";\n echo $row[0];\n echo \"</p>\";\n }\n }" ]
[ "0.7163035", "0.7059165", "0.7037608", "0.6904549", "0.66769814", "0.6626774", "0.6606997", "0.65196073", "0.63979745", "0.6351496", "0.6339251", "0.6281294", "0.626759", "0.6262241", "0.6228144", "0.62189484", "0.6192051", "0.6173858", "0.61628175", "0.61130387", "0.61126894", "0.6109416", "0.60936475", "0.60901135", "0.6080795", "0.6071193", "0.6061544", "0.6061391", "0.6040147", "0.6038143" ]
0.7460847
0
Resolves the criteria passed by request into aggregation of logical operations of criteria objects. This aggregation will be a specification.
public function resolveCriteria(array $criteria): SpecificationInterface { // If we detect the name of the field that manages a Leaf criterion... if (\array_key_exists('operator', $criteria)) { return $this->buildLeafFromCriterion(new Criterion($criteria)); } // If we detect the name of any logical operator that make us build a branch... if (!empty(\array_intersect_key($this->logicalOperatorRegistry->getOperators(), $criteria))) { return $this->buildBranchFromCriteria($criteria); } // Throw exception if we did not found what was expected. throw CriteriaException::invalidCriteriaFormat(\key($criteria)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function findOperationBy(array $criteria);", "private function resolver($criteria, $request)\n {\n if (Resolver::isRegexPattern($criteria))\n {\n $template = Resolver::checkTemplate($criteria);\n return Resolver::regexTest($template, $request);\n }\n else\n {\n return Resolver::testCondition($criteria, $request);\n }\n }", "public function aggregate()\n {\n return new ParameterBag(\n $this->query->all() + $this->request->all() + $this->cookies->all() + $this->content->all()\n );\n }", "private function &normalizeCriteria($criteria) {\n\n $result = array();\n $lastFieldName = null;\n\n foreach($criteria as $key => $value) {\n\n if (is_numeric($key)) {\n\n // $value is either a field name, value, conjunction, literal sql, or another array of criteria\n\n if ($lastFieldName !== null) {\n $result[] = new Octopus_Model_Restriction_Field($this->getModelInstance(), $lastFieldName, $value);\n $lastFieldName = null;\n } else if (is_array($value)) {\n $result[] = $this->normalizeCriteria($value);\n $lastFieldName = null;\n } else if ($value instanceof Octopus_Model_Restriction) {\n $result[] = $value;\n } else {\n\n $uvalue = strtoupper($value);\n\n if ($uvalue === 'OR' || $uvalue === 'AND') {\n if (count($result)) {\n $result[] = $uvalue;\n }\n $lastFieldName = null;\n } else if ($lastFieldName === null) {\n\n if (Octopus_Model_Restriction_Field::looksLikeFieldExpression($value)) {\n $lastFieldName = $value;\n } else {\n // Probably literal SQL\n $result[] = new Octopus_Model_Restriction_Sql($value);\n }\n\n }\n }\n\n continue;\n }\n\n // $key is either a field name or a conjunction or NOT\n $ukey = strtoupper($key);\n\n if ($ukey === 'NOT') {\n $result[] = array('NOT' => $this->normalizeCriteria($value));\n } else if ($ukey === 'AND' || $ukey === 'OR') {\n $result[] = $ukey;\n $result[] = $this->normalizeCriteria($value);\n } else {\n // Two scenarios:\n // 1. $key is a field name and $value is a corresponding filter value\n // 2. $key is literal SQL and $value is an array of parameters to go with it\n if (Octopus_Model_Restriction_Field::looksLikeFieldExpression($key)) {\n $result[] = new Octopus_Model_Restriction_Field($this->getModelInstance(), $key, $value);\n } else {\n $result[] = new Octopus_Model_Restriction_Sql($key, $value);\n }\n }\n }\n\n return $result;\n }", "public function criteria( $criteria)\n {\n $this->request->setParam('criteria', $criteria);\n\n return $this;\n }", "public function getCriteriaCollection(): CriteriaCollection;", "public function processOrCombination($collection, $conditions)\n {\n $fieldsConditions = [];\n $multiFieldsConditions = [];\n foreach ($conditions as $condition) {\n $attribute = $condition['attribute'];\n $cond = $condition['conditions'];\n $value = $condition['cvalue'];\n\n //ignore condition if value is null or empty\n if ($value == '' || $value == null) {\n continue;\n }\n\n if ($this->ruleType == self::REVIEW && isset($this->attributeMapForQuote[$attribute])) {\n $attribute = $this->attributeMapForOrder[$attribute];\n } elseif ($this->ruleType == self::ABANDONED && isset($this->attributeMapForOrder[$attribute])) {\n $attribute = $this->attributeMapForQuote[$attribute];\n } else {\n $this->productAttribute[] = $condition;\n continue;\n }\n\n if ($cond == 'null') {\n if ($value == '1') {\n if (isset($fieldsConditions[$attribute])) {\n $multiFieldsConditions[$attribute][]\n = ['notnull' => true];\n continue;\n }\n $fieldsConditions[$attribute] = ['notnull' => true];\n } elseif ($value == '0') {\n if (isset($fieldsConditions[$attribute])) {\n $multiFieldsConditions[$attribute][]\n = [$cond => true];\n continue;\n }\n $fieldsConditions[$attribute] = [$cond => true];\n }\n } else {\n if ($cond == 'like' || $cond == 'nlike') {\n $value = '%' . $value . '%';\n }\n if (isset($fieldsConditions[$attribute])) {\n $multiFieldsConditions[$attribute][]\n = [$this->conditionMap[$cond] => $value];\n continue;\n }\n $fieldsConditions[$attribute]\n = [$this->conditionMap[$cond] => $value];\n }\n }\n /**\n * All rule conditions are combined into an array to yield an OR when passed\n * to `addFieldToFilter`. The exception is any 'like' or 'nlike' conditions,\n * which must be added as separate filters in order to have the AND logic.\n */\n if (!empty($fieldsConditions)) {\n $column = $cond = [];\n foreach ($fieldsConditions as $key => $fieldsCondition) {\n $type = key($fieldsCondition);\n if ($type == 'like' || $type == 'nlike') {\n $collection->addFieldToFilter(\n (string) $key,\n $fieldsCondition\n );\n } else {\n $column[] = (string) $key;\n $cond[] = $fieldsCondition;\n }\n if (!empty($multiFieldsConditions[$key])) {\n foreach ($multiFieldsConditions[$key] as $multiFieldsCondition) {\n $type = key($multiFieldsCondition);\n if ($type == 'like' || $type == 'nlike') {\n $collection->addFieldToFilter(\n (string) $key,\n $multiFieldsCondition\n );\n } else {\n $column[] = (string) $key;\n $cond[] = $multiFieldsCondition;\n }\n }\n }\n }\n if (!empty($column) && !empty($cond)) {\n $collection->addFieldToFilter(\n $column,\n $cond\n );\n }\n }\n return $this->processProductAttributes($collection);\n }", "public abstract function listOperationBy(array $criteria);", "public function getCriteria();", "public function buildCriteria()\n\t{\n\t\t$criteria = new Criteria(VpoRequestPeer::DATABASE_NAME);\n\n\t\tif ($this->isColumnModified(VpoRequestPeer::ID)) $criteria->add(VpoRequestPeer::ID, $this->id);\n\t\tif ($this->isColumnModified(VpoRequestPeer::HAZARDOUS_CARGO_FLAG)) $criteria->add(VpoRequestPeer::HAZARDOUS_CARGO_FLAG, $this->hazardous_cargo_flag);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQUEST_DATE)) $criteria->add(VpoRequestPeer::REQUEST_DATE, $this->request_date);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQUEST_REASON_DESC)) $criteria->add(VpoRequestPeer::REQUEST_REASON_DESC, $this->request_reason_desc);\n\t\tif ($this->isColumnModified(VpoRequestPeer::AGENCY_NAME)) $criteria->add(VpoRequestPeer::AGENCY_NAME, $this->agency_name);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_FIRST_NAME)) $criteria->add(VpoRequestPeer::REQ_FIRST_NAME, $this->req_first_name);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_LAST_NAME)) $criteria->add(VpoRequestPeer::REQ_LAST_NAME, $this->req_last_name);\n\t\tif ($this->isColumnModified(VpoRequestPeer::AGENCY_DIVISION)) $criteria->add(VpoRequestPeer::AGENCY_DIVISION, $this->agency_division);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_ADDRESS1)) $criteria->add(VpoRequestPeer::REQ_ADDRESS1, $this->req_address1);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_ADDRESS2)) $criteria->add(VpoRequestPeer::REQ_ADDRESS2, $this->req_address2);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_CITY)) $criteria->add(VpoRequestPeer::REQ_CITY, $this->req_city);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_STATE)) $criteria->add(VpoRequestPeer::REQ_STATE, $this->req_state);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_COUNTRY)) $criteria->add(VpoRequestPeer::REQ_COUNTRY, $this->req_country);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_ZIPCODE)) $criteria->add(VpoRequestPeer::REQ_ZIPCODE, $this->req_zipcode);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_OFFICE_PHONE)) $criteria->add(VpoRequestPeer::REQ_OFFICE_PHONE, $this->req_office_phone);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_OFFICE_COMMENT)) $criteria->add(VpoRequestPeer::REQ_OFFICE_COMMENT, $this->req_office_comment);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_MOBILE_PHONE)) $criteria->add(VpoRequestPeer::REQ_MOBILE_PHONE, $this->req_mobile_phone);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_MOBILE_COMMENT)) $criteria->add(VpoRequestPeer::REQ_MOBILE_COMMENT, $this->req_mobile_comment);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_FAX_PHONE)) $criteria->add(VpoRequestPeer::REQ_FAX_PHONE, $this->req_fax_phone);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_FAX_COMMENT)) $criteria->add(VpoRequestPeer::REQ_FAX_COMMENT, $this->req_fax_comment);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_PAGER_PHONE)) $criteria->add(VpoRequestPeer::REQ_PAGER_PHONE, $this->req_pager_phone);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_PAGER_COMMENT)) $criteria->add(VpoRequestPeer::REQ_PAGER_COMMENT, $this->req_pager_comment);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_OTHER_PHONE1)) $criteria->add(VpoRequestPeer::REQ_OTHER_PHONE1, $this->req_other_phone1);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_OTHER_COMMENT1)) $criteria->add(VpoRequestPeer::REQ_OTHER_COMMENT1, $this->req_other_comment1);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_OTHER_PHONE2)) $criteria->add(VpoRequestPeer::REQ_OTHER_PHONE2, $this->req_other_phone2);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_OTHER_COMMENT2)) $criteria->add(VpoRequestPeer::REQ_OTHER_COMMENT2, $this->req_other_comment2);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_OTHER_PHONE3)) $criteria->add(VpoRequestPeer::REQ_OTHER_PHONE3, $this->req_other_phone3);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_OTHER_COMMENT3)) $criteria->add(VpoRequestPeer::REQ_OTHER_COMMENT3, $this->req_other_comment3);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_EMAIL)) $criteria->add(VpoRequestPeer::REQ_EMAIL, $this->req_email);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQ_ALT_EMAIL)) $criteria->add(VpoRequestPeer::REQ_ALT_EMAIL, $this->req_alt_email);\n\t\tif ($this->isColumnModified(VpoRequestPeer::CONTACT_NOTES)) $criteria->add(VpoRequestPeer::CONTACT_NOTES, $this->contact_notes);\n\t\tif ($this->isColumnModified(VpoRequestPeer::ORIGIN_CITY)) $criteria->add(VpoRequestPeer::ORIGIN_CITY, $this->origin_city);\n\t\tif ($this->isColumnModified(VpoRequestPeer::ORIGIN_STATE)) $criteria->add(VpoRequestPeer::ORIGIN_STATE, $this->origin_state);\n\t\tif ($this->isColumnModified(VpoRequestPeer::DEST_CITY)) $criteria->add(VpoRequestPeer::DEST_CITY, $this->dest_city);\n\t\tif ($this->isColumnModified(VpoRequestPeer::DEST_STATE)) $criteria->add(VpoRequestPeer::DEST_STATE, $this->dest_state);\n\t\tif ($this->isColumnModified(VpoRequestPeer::PREFERRED_DATE)) $criteria->add(VpoRequestPeer::PREFERRED_DATE, $this->preferred_date);\n\t\tif ($this->isColumnModified(VpoRequestPeer::ALTERNATIVE_DATE)) $criteria->add(VpoRequestPeer::ALTERNATIVE_DATE, $this->alternative_date);\n\t\tif ($this->isColumnModified(VpoRequestPeer::TRANSPORT_TYPE)) $criteria->add(VpoRequestPeer::TRANSPORT_TYPE, $this->transport_type);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQUEST_POSTED_DATE)) $criteria->add(VpoRequestPeer::REQUEST_POSTED_DATE, $this->request_posted_date);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQUEST_POSTED_TO_AFA_ORG_ID)) $criteria->add(VpoRequestPeer::REQUEST_POSTED_TO_AFA_ORG_ID, $this->request_posted_to_afa_org_id);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQUES_PROCESSED_DATE)) $criteria->add(VpoRequestPeer::REQUES_PROCESSED_DATE, $this->reques_processed_date);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQUEST_DISPOSITION)) $criteria->add(VpoRequestPeer::REQUEST_DISPOSITION, $this->request_disposition);\n\t\tif ($this->isColumnModified(VpoRequestPeer::CALLER_NAME)) $criteria->add(VpoRequestPeer::CALLER_NAME, $this->caller_name);\n\t\tif ($this->isColumnModified(VpoRequestPeer::CALLER_PHONE)) $criteria->add(VpoRequestPeer::CALLER_PHONE, $this->caller_phone);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQUEST_POST_RESULTS)) $criteria->add(VpoRequestPeer::REQUEST_POST_RESULTS, $this->request_post_results);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQUESTER_VPO_USER_ID)) $criteria->add(VpoRequestPeer::REQUESTER_VPO_USER_ID, $this->requester_vpo_user_id);\n\t\tif ($this->isColumnModified(VpoRequestPeer::SOURCE)) $criteria->add(VpoRequestPeer::SOURCE, $this->source);\n\t\tif ($this->isColumnModified(VpoRequestPeer::SOAP_POST_FROM_AFA_ORG_ID)) $criteria->add(VpoRequestPeer::SOAP_POST_FROM_AFA_ORG_ID, $this->soap_post_from_afa_org_id);\n\t\tif ($this->isColumnModified(VpoRequestPeer::SOAP_POST_REQUEST_ID)) $criteria->add(VpoRequestPeer::SOAP_POST_REQUEST_ID, $this->soap_post_request_id);\n\t\tif ($this->isColumnModified(VpoRequestPeer::REQUEST_PROCESSED_BY)) $criteria->add(VpoRequestPeer::REQUEST_PROCESSED_BY, $this->request_processed_by);\n\n\t\treturn $criteria;\n\t}", "public function getCriteria()\n {\n $criterias = array();\n foreach ($this->validators as $validator) {\n $criterias = array_merge($criterias, $validator->getCriteria());\n }\n \n return $criterias;\n }", "public function testDataProvider()\n {\n $out = [];\n\n // Case #0, without any request parameters.\n $out[] = [\n 'request' => new Request(),\n 'expectedChoices' => [\n 'Color' => [\n 'Green' => 2,\n 'Red' => 2,\n 'Black' => 1,\n ],\n 'Made in' => [\n 'USA' => 3,\n 'China' => 4,\n 'Germany' => 3,\n 'Lithuania' => 1,\n ],\n 'Designed in' => [\n 'USA' => 3,\n 'Germany' => 2,\n ],\n 'Condition' => [\n 'Excelent' => 2,\n 'Fair' => 2,\n 'Good' => 2,\n ],\n 'Group' => [\n 'Accessories' => 3,\n 'Utilities' => 2,\n 'Maintenance' => 1,\n ],\n ],\n 'filter' => 'dynamic_aggregate_filter'\n ];\n\n // Case #1, with color red\n $out[] = [\n 'request' => new Request(['dynamic_aggregate' => ['Color' => 'Red']]),\n 'expectedChoices' => [\n 'Color' => [\n 'Green' => 2,\n 'Red' => 2,\n 'Black' => 1,\n ],\n 'Made in' => [\n 'USA' => 1,\n 'China' => 1,\n ],\n 'Condition' => [\n 'Fair' => 1,\n ],\n 'Designed in' => [\n 'Germany' => 2,\n ]\n ],\n 'filter' => 'dynamic_aggregate_filter'\n ];\n\n // Case #2, with color red, with zero choices\n $out[] = [\n 'request' => new Request(['zero_aggregate' => ['Color' => 'Red']]),\n 'expectedChoices' => [\n 'Color' => [\n 'Green' => 2,\n 'Red' => 2,\n 'Black' => 1,\n ],\n 'Made in' => [\n 'USA' => 1,\n 'China' => 1,\n 'Lithuania' => 0,\n 'Germany' => 0,\n ],\n 'Designed in' => [\n 'USA' => 0,\n 'Germany' => 2,\n ],\n 'Condition' => [\n 'Fair' => 1,\n 'Good' => 0,\n 'Excelent' => 0,\n ],\n 'Group' => [\n 'Accessories' => 0,\n 'Utilities' => 0,\n 'Maintenance' => 0,\n ],\n ],\n 'filter' => 'dynamic_aggregate_with_zero_choice_filter'\n ];\n\n return $out;\n }", "protected function applyCriteria(){\n\n if( $this->skipCriteria === true )\n return $this;\n\n $criteria = $this->getCriteria();\n\n foreach($criteria as $c){\n if( $c instanceof Criteria ){\n $this->query = $c->apply($this->query, $this);\n }\n }\n\n return $this;\n }", "public abstract function getCriteriaFrom($criteria);", "public function pushCriteria(CriteriaContract $criteria);", "abstract public function query($collection, array $criteria = null);", "public function rules($request=NULL)\n {\n $rules = [];\n switch ($this->event_type) {\n case AutoEvent::TYPE_SPECIFIC_DATETIME:\n $rules = [\n 'specific_day' => 'required',\n 'specific_time' => 'required',\n ];\n break;\n case AutoEvent::TYPE_WEEKLY_RECURRING:\n $rules = [\n 'weekly_recurring_weekdays' => 'required',\n 'weekly_recurring_weeks' => 'required',\n 'weekly_recurring_months' => 'required',\n 'weekly_recurring_time' => 'required',\n ];\n break;\n case AutoEvent::TYPE_MONTHLY_RECURRING:\n $rules = [\n 'monthly_recurring_days' => 'required',\n 'monthly_recurring_months' => 'required',\n 'monthly_recurring_time' => 'required',\n ];\n break;\n case AutoEvent::TYPE_SUBSCRIBER_EVENT:\n $rules = [\n 'subscriber_event' => 'required',\n 'delay_type' => 'required',\n 'delay_value' => 'required',\n 'delay_unit' => 'required',\n ];\n break;\n case AutoEvent::TYPE_CUSTOM_CRITERIA:\n if (isset($request->custom_criteria)) {\n foreach ($request->custom_criteria as $key => $param) {\n $rules['custom_criteria.'.$key.'.field_uid'] = 'required';\n $rules['custom_criteria.'.$key.'.operator'] = 'required';\n if(!in_array($param['operator'], [AutoEvent::OPERATOR_BLANK, AutoEvent::OPERATOR_NOT_BLANK])) {\n $rules['custom_criteria.'.$key.'.value'] = 'required';\n }\n }\n } else {\n $rules['custom_criteria_empty'] = 'required';\n }\n break;\n }\n\n return $rules;\n }", "public function resolve(Request $request)\n\t{\n\t\t$request->databaseQueries = array_merge($request->databaseQueries, $this->queries);\n\n\t\t$request->databaseQueriesCount += $this->count['total'];\n\t\t$request->databaseSlowQueries += $this->count['slow'];\n\t\t$request->databaseSelects += $this->count['select'];\n\t\t$request->databaseInserts += $this->count['insert'];\n\t\t$request->databaseUpdates += $this->count['update'];\n\t\t$request->databaseDeletes += $this->count['delete'];\n\t\t$request->databaseOthers += $this->count['other'];\n\n\t\t$request->modelsActions = array_merge($request->modelsActions, $this->modelsActions);\n\n\t\t$request->modelsRetrieved = $this->modelsCount['retrieved'];\n\t\t$request->modelsCreated = $this->modelsCount['created'];\n\t\t$request->modelsUpdated = $this->modelsCount['updated'];\n\t\t$request->modelsDeleted = $this->modelsCount['deleted'];\n\n\t\t$this->appendDuplicateQueriesWarnings($request);\n\n\t\treturn $request;\n\t}", "public static function query(\\Phalcon\\Di\\DiInterface $container = null): CriteriaInterface;", "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "function prepareCriteria ($criteria = []) {\n $defaultCriteria = config('main.criteria');\n\n if (!empty($criteria)) {\n switch (gettype($criteria)) {\n case 'array':\n $criteria = array_merge($defaultCriteria, (array) $criteria);\n\n if (!empty($criteria['fs'])){\n $criteria['fs'] = array_filter($criteria['fs']);\n }\n\n if (!empty($criteria['disp'])){\n $criteria['disp'] = array_filter($criteria['disp']);\n }\n\n if (empty($criteria['r']) || (int) $criteria['r'] <= 0){\n $criteria['r'] = config('main.criteria.r');\n } else {\n $criteria['r'] = (int) $criteria['r'];\n }\n\n if (empty($criteria['o'])){\n $criteria['o'] = config('main.criteria.o');\n }\n\n if (isset($criteria['d']) && ((int) $criteria['d'] !== 1 && (int) $criteria['d'] !== 0)){\n $criteria['d'] = config('main.criteria.d');\n }\n\n break;\n case 'string':\n $criteria = json_decode($criteria, true);\n\n if (empty($criteria['o'])){\n $criteria['o'] = config('main.criteria.o');\n }\n\n if (empty($criteria['r']) || (int) $criteria['r'] <= 0){\n $criteria['r'] = config('main.criteria.r');\n } else {\n $criteria['r'] = (int) $criteria['r'];\n }\n\n if (isset($criteria['d']) && ((int) $criteria['d'] !== 1 && (int) $criteria['d'] !== 0)){\n $criteria['d'] = config('main.criteria.d');\n }\n\n if (!empty($criteria['fs'])) {\n $criteria['fs'] = array_filter($criteria['fs']);\n } else {\n $criteria['fs'] = config('main.criteria.fs');\n }\n\n if (!empty($criteria['disp'])) {\n $criteria['disp'] = array_filter($criteria['disp']);\n } else {\n $criteria['disp'] = config('main.criteria.disp');\n }\n\n break;\n default:\n $criteria = $defaultCriteria;\n break;\n }\n } else {\n $criteria = $defaultCriteria;\n }\n\n // url-Decoding values of 'fs' key in Criteria recursively\n if (isset($criteria['fs']) && !empty($criteria['fs'])) {\n foreach ($criteria['fs'] as $key => $fs) {\n if (is_array($fs)) {\n foreach ($fs as $i => $f) {\n $criteria['fs'][$key][$i] = rawurldecode($f);\n }\n } else {\n $criteria['fs'][$key] = rawurldecode($fs);\n }\n }\n }\n\n return json_decode(json_encode($criteria));\n }", "public function get_completed_criteria_sql() {\n $join = '';\n $where = '';\n $params = array();\n\n if ($this->method == BADGE_CRITERIA_AGGREGATION_ANY) {\n // User has received ANY of the required badges.\n $join = \" LEFT JOIN {badge_issued} bi2 ON bi2.userid = u.id\";\n $i = 0;\n foreach ($this->params as $param) {\n if ($i == 0) {\n $where .= ' bi2.badgeid = :badgeid'.$i;\n } else {\n $where .= ' OR bi2.badgeid = :badgeid'.$i;\n }\n $params['badgeid'.$i] = $param['badge'];\n $i++;\n }\n // MDL-66032 Do not create expression if there are no badges in criteria.\n if (!empty($where)) {\n $where = ' AND (' . $where . ') ';\n }\n return array($join, $where, $params);\n } else {\n // User has received ALL of the required badges.\n $join = \" LEFT JOIN {badge_issued} bi2 ON bi2.userid = u.id\";\n $i = 0;\n foreach ($this->params as $param) {\n $i++;\n $where = ' AND bi2.badgeid = :badgeid'.$i;\n $params['badgeid'.$i] = $param['badge'];\n }\n return array($join, $where, $params);\n }\n }", "public function get_criteria() { return $this->criteria_list; }", "public function addCriteria( CriteriaInterface $criteria );", "private function expandCriteriaParameters(Criteria $criteria)\n {\n $expression = $criteria->getWhereExpression();\n\n if ($expression === null) {\n return [];\n }\n\n $valueVisitor = new SqlValueVisitor();\n\n $valueVisitor->dispatch($expression);\n\n [, $types] = $valueVisitor->getParamsAndTypes();\n\n return $types;\n }", "protected function _filters_to_conditions($request_data = null){\n \n $conditions = array();\n //user has to have an active account\n $conditions['User.active'] = 1;\n \n if(empty($request_data)){\n return $conditions;\n }\n \n if(!empty($request_data['motive_id'])){\n $conditions['Experience.motive_id'] = $request_data['motive_id'];\n }\n if(!empty($request_data['department_id'])){\n $conditions['User.department_id'] = $request_data['department_id'];\n }\n if(!empty($request_data['school_id'])){\n $conditions['User.school_id'] = $request_data['school_id'];\n }\n if(!empty($request_data['key_word'])){\n $conditions['Experience.description LIKE'] = '%'.$request_data['key_word'].'%';\n }\n //now\n if(!empty($request_data['date_min']) && !empty($request_data['date_max']) && ($request_data['date_min'] === $request_data['date_max'])){\n $conditions['AND'] = array('Experience.dateEnd >=' => $request_data['date_min'],\n 'Experience.dateStart <=' => $request_data['date_max']);\n }\n else{\n //futur\n if(!empty($request_data['date_min'])){\n $conditions['Experience.dateStart >='] = $request_data['date_min'];\n }\n //past\n if(!empty($request_data['date_max'])){\n $conditions['Experience.dateStart <='] = $request_data['date_max'];\n }\n }\n if(!empty($request_data['city_id'])){\n $conditions['Experience.city_id'] = $request_data['city_id'];\n }\n if(!empty($request_data['city_name'])){\n $conditions['City.name'] = $request_data['city_name'];\n }\n if(!empty($request_data['country_id'])){\n $conditions['City.country_id'] = $request_data['country_id'];\n }\n if(!empty($request_data['user_name'])){\n //extracts first and last names\n $names = explode(' ',$request_data['user_name']);\n if(count($names) > 1){\n $conditions['AND']['User.firstname LIKE'] = '%'.$names[0].'%';\n $conditions['AND']['User.lastname LIKE'] = '%'.$names[1].'%';\n }\n //if only last or first name was entered\n else{\n $conditions['OR'] = array('User.firstname LIKE' => '%'.$request_data['user_name'].'%',\n 'User.lastname LIKE' => '%'.$request_data['user_name'].'%');\n }\n }\n return $conditions;\n }", "public function addCriteria(array $criteria);", "private function applyCriteria()\n {\n foreach( $this->criteria as $criterion )\n {\n $this->query = $criterion->apply( $this->query, $this );\n }\n\n return $this;\n }", "public function build(SearchCriteria $criteria)\n {\n $this->where = array();\n $this->sort = array();\n\n $this->where[] = $this->whereEquals('project', $this->metadata->getId());\n\n $this->handleStatuses($criteria);\n $this->handleTypes($criteria);\n $this->handleAssignees($criteria);\n $this->handleKeywords($criteria);\n $this->handleSorting($criteria);\n $this->handleIds($criteria);\n\n return $this->generateJql($this->where, $this->sort);\n }", "public function testConvertToEloquentWithAggregates()\n {\n $queryString = 'sum=amount';\n list($eloquentConditions, $aggregates) = $this->parser->parse($queryString)->convertToEloquent();\n $expected = [\n 'function' => 'sum',\n 'field' => 'amount'\n ];\n $this->assertEquals($expected, $aggregates);\n }" ]
[ "0.5427638", "0.5171537", "0.4975322", "0.49265787", "0.4901586", "0.48859018", "0.4885137", "0.4871752", "0.48394307", "0.48294684", "0.47633922", "0.4674159", "0.46320555", "0.46204072", "0.4601009", "0.45778453", "0.45228314", "0.44841573", "0.44818723", "0.44696996", "0.44626087", "0.4454537", "0.44168895", "0.44086117", "0.44054383", "0.43999982", "0.4391888", "0.4386937", "0.43818268", "0.4370686" ]
0.52253634
1
function to set shipping price
public function setShippingPrice() { if ($this->price > 200) { $this->shippingPrice = 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setShipping($ship_key)\n {\n return 4.50;\n }", "function setPrice( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Price = $value;\n setType( $this->Price, \"double\" );\n }", "function setItem_price($price){\n $this->item_price = $price;\n }", "function setPrice($new_price)\n {\n $this->price = $new_price;\n }", "public function getShippingPrice() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->shippingPrice;\r\n\t}", "public function setShippingAmount($amount);", "public function setShippingCost($shippingCost);", "function getShippingPrice(){\n\t\t$data = $this->_collectShippingInfo();\n\t\tif(Mage::getModel(\"tax/config\")->displayCartShippingExclTax()) return $data->getShippingExclTax();\n\t\telse return $data->getShippingInclTax();\n\t}", "public function setPrice()\n {\n $price = $this->price;\n $outFix = $this->outFix;\n $outPer = $this->outPer;\n $inPer = $this->inPer;\n $inFix = $this->inFix;\n $flag = $this->flagInOut;\n if ($price < 1) {\n $sumIn = $outFix > 0 ? 1 + $outFix : 1; //outFix\n $sumIn = $outPer > 0 ? $sumIn + ($sumIn * $outPer / 100) : $sumIn; //outPer\n $sumIn = $sumIn / $price; // price\n $sumIn = $inFix > 0 ? $sumIn + $inFix : $sumIn;// inFix\n $ss = $sumIn * $inPer / 100;\n $sumIn = $inPer > 0 ? $sumIn + $ss : $sumIn;\n $this->in = $this->format_amount($sumIn);\n $this->out = $flag ? 1 : 0;\n } else {\n $val = $inFix > 0 ? 1 - $inFix : 1;\n $val = $inPer > 0 ? $val - $val * ($inPer / 100) : $val;\n $sumOut = $price * $val;\n $sumOut = $outFix > 0 ? $sumOut - $outFix : $sumOut;\n $sumOut = $outPer > 0 ? $sumOut - $outPer / 100 * $sumOut : $sumOut;\n $this->out = $this->format_amount($sumOut);\n $this->in = $flag ? 1 : 0;\n }\n $this->price = (float)$price;\n }", "function setPrice($price)\n {\n $this->price = $price;\n }", "public function deliveryPriceDhaka()\n {\n }", "public function setPrice($value)\n {\n $this->price = $value;\n $this->recalculate();\n }", "public function setShipping($shipping);", "function change_total_price_cdek()\n{\n $price = $_POST['price'];\n $name = $_POST['name'];\n $shipping_cost = $price;\n setcookie('shipping_city_cost', $shipping_cost, time() + (86400 * 30), '/');\n setcookie('shipping_name', $name, time() + (86400 * 30), '/');\n echo 'Shipping cost updated : ' . $shipping_cost;\n wp_die();\n}", "public function calculate_shipping($package){\n \n $calc = $this->distance * $this->priceperkm;\n $cost = round( $calc, 2 );\n \n if($cost < $this->minimumprice) {\n $cost = $this->minimumprice;\n }\n \n// Calculating the % of the unloading variable\n global $woocommerce;\n $cartsubtotal = $woocommerce->cart->cart_contents_total;\n $unloadingtotal = ( $this->unloadingprice / 100 ) * $cartsubtotal;\n \n $cost2 = $cost + $unloadingtotal;\n \n \n \n// Sending the final rate to the user \n $this->add_rate( \n array(\n 'id' => $this->id,\n 'label' => $this->title,\n 'cost' => $cost\n )\n );\n \n $this->add_rate(\n array(\n 'id' => $this->id2,\n 'label' => $this->title2,\n 'cost' => $cost2\n ) \n );\n }", "function setPrice($price, $taxPercentage = 25)\n {\n $this->taxPercentage = $taxPercentage;\n $this->taxA = $price / 100 * 100;\n $this->price = $price;\n }", "public function setProductPrice($product_price){\n $this->product_price = $product_price;\n }", "public function setPrice($price)\n {\n $this->price = (double)$price;\n $this->recalculatePriceTotal();\n }", "private function setShippingOptions() {\n // Reset the settings if this is a recrawl\n if ($this->getSaverData()->isRecrawl()) {\n // Set dimensions and weight\n $this->product->set_weight('');\n $this->product->set_length('');\n $this->product->set_width('');\n $this->product->set_height('');\n\n // Set shipping class\n $this->product->set_shipping_class_id(0);\n }\n\n // No shipping for virtual products.\n if ($this->wcData->isVirtual()) {\n $this->product->set_virtual(true);\n return;\n }\n\n // Not a virtual product.\n $this->product->set_virtual(false);\n\n // Set dimensions and weight\n $this->product->set_weight($this->wcData->getWeight());\n $this->product->set_length($this->wcData->getLength());\n $this->product->set_width($this->wcData->getWidth());\n $this->product->set_height($this->wcData->getHeight());\n\n // Set shipping class\n $this->product->set_shipping_class_id($this->wcData->getShippingClassId());\n }", "public function setPrice(float $price):void\n {\n $this->price = $price;\n }", "public function setShippingValues(Order $order): void;", "public function getShippingRate();", "public function getShippingAmount();", "public function getShippingCost();", "public function actionUkrainepostShipping()\n {\n echo 20.14;\n }", "public function setSalePriceAttribute($value)\n {\n $this->attributes['sale_price'] = Utils::numbersOnly($value);\n }", "public function setPrice(float $price) : void\n {\n $this->set('price', $price, 'products');\n }", "public function setPrice ($price){\n\t\tif(!is_numeric($price)){\n\t\t\treturn;\n\t\t}\n\t\t$this->Item['price'] = $price;\n\t}", "public function actionNovaPostaShipping()\n {\n echo 35.46;\n }", "public function setPriceAttribute($value) {\n\t\t$this->attributes['price'] = round(floatval($value), 2);\n\t}" ]
[ "0.7553018", "0.6926533", "0.6923322", "0.69061244", "0.67753637", "0.67646515", "0.6737925", "0.6727052", "0.67060894", "0.66223216", "0.6603935", "0.6503078", "0.6448832", "0.6445785", "0.6429301", "0.64170676", "0.6411084", "0.6392101", "0.6335815", "0.63263655", "0.6302353", "0.630102", "0.6293642", "0.6291789", "0.62787825", "0.6268595", "0.62598276", "0.6256583", "0.6250405", "0.6224093" ]
0.78764826
0
Allows setting any param value
public function __set($param, $value);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set($params) {}", "public function setParam($name, $value);", "public function setParam($param, $value);", "abstract protected function setParameter($key, $value);", "public function setParam($key, $value);", "public function setParameter($name, $value);", "abstract public function setValue($value);", "public abstract function setParameter($parameter);", "public function setParams($params);", "public function setParams($params);", "public function setDefaultParam($name, $value);", "public function set_param($key, $value)\n {\n }", "protected function setParam($name, $value) {\n if (!array_key_exists($name, $this->params)) {\n throw new \\Exception(E()->Utils->translate('ERR_DEV_NO_PARAM').': '.$name.' @'.$this->getName() , SystemException::ERR_DEVELOPER);\n }\n if ($name == 'active') {\n $value = (bool)$value;\n }\n if (is_scalar($value)) {\n $value = explode('|', $value);\n $this->params[$name] =\n (sizeof($value) == 1) ? current($value) : $value;\n } elseif (is_array($value)) {\n $this->params[$name] = $value;\n } else {\n $this->params[$name] = $value;\n }\n }", "public function set($parameter, $value);", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "protected final function setParams ($params)\n\t{\n\t\t/// This method is restricted (cannot be used by descendants).\n\t}", "public function __set($param, $value)\r\n {\r\n $this->params_named->set($param, $value);\r\n }", "public function setParameter(string $paramName, $paramValue = NULL);" ]
[ "0.7533565", "0.7122675", "0.7120944", "0.7078099", "0.70670426", "0.69775724", "0.6975281", "0.6967299", "0.69639844", "0.69639844", "0.6930339", "0.6846463", "0.68289834", "0.68227017", "0.6789295", "0.6789295", "0.6789295", "0.6789295", "0.6789295", "0.6789295", "0.6789295", "0.6789295", "0.6789295", "0.6789295", "0.6789295", "0.6788375", "0.6788375", "0.6749015", "0.6722144", "0.6677293" ]
0.713207
1
Returns the name of schema.
public function getSchemaName() { return $this->schemaName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSchemaName()\n {\n return $this->schemaName;\n }", "public function getSchemaName(): string;", "public function getSchemaName()\n {\n return $this->getTable()->getSchema()->getName();\n }", "function getSchemaDisplayName() {\n\t\treturn __('plugins.schemas.dc.schemaName');\n\t}", "public function schema()\r\n {\r\n return $this->getKey('schema', true);\r\n }", "public function guessSchemaName()\n {\n return $this->schema ?: $this->database->getSchema();\n }", "public function getSchemaPath() : string\n {\n return $this->schema;\n }", "public function getSchema()\n {\n if (empty($this->schema)) {\n return 'public';\n } else {\n return $this->schema;\n }\n }", "public function getSchemaType(): string\n {\n /** @var CubridSchema|MssqlSchema|MysqlSchema|OciSchema|PgsqlSchema|SqliteSchema $schema */\n $schema = $this->db->getSchema();\n return Schema::identifySchema($schema);\n }", "public function get_schema() {\n\t\treturn $this->schema;\n\t}", "public function getSchemaID(): string;", "public function schema()\n\t{\n\t\treturn $this->schema;\n\t}", "public function getSchema() {\n return Cool::getInstance()->getSchema($this->databaseName);\n }", "public function getSchema(): string;", "public function getSchema(): string;", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function GetDefaultSchema() {\n if ($cache = fastcache::cache_get('default_schema', 'schema')) {\n $this->defaultSchema = $cache->data;\n return $this->defaultSchema;\n }\n $result = $this->connection->query_direct(\"SELECT SCHEMA_NAME()\")\n ->fetchField();\n fastcache::cache_set('default_schema', $result, 'schema');\n $this->defaultSchema = $result;\n return $this->defaultSchema;\n }", "public function getSchema()\n {\n return $this->get(self::SCHEMA);\n }", "public function getSchema()\n {\n if ($this->schema === null) {\n $this->getSchemaTables();\n }\n\n return $this->schema;\n }", "public function getSchemaType()\n {\n return $this->schemaType;\n }", "public function get_schema()\r\n\t{\r\n\t\t return $this->sql_select_exe('SELECT * FROM sys.Tables', NULL);\r\n\t}", "public function getSchemaName($resourceName)\n {\n return $this->deploymentConfig->get(\n ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTIONS .\n '/' .\n $resourceName .\n '/dbname'\n );\n }", "public static function get_schema()\n {\n }", "public function get_schema()\n {\n }", "public function getReferencedSchema(): string;" ]
[ "0.88741386", "0.87666196", "0.85139966", "0.8023488", "0.7965228", "0.78538316", "0.75079054", "0.7373762", "0.7346069", "0.7297001", "0.72883636", "0.7172693", "0.7170861", "0.71295214", "0.71295214", "0.70897084", "0.70897084", "0.70897084", "0.70897084", "0.70897084", "0.70897084", "0.698586", "0.69678956", "0.6965172", "0.6960718", "0.69430363", "0.6877443", "0.6818684", "0.6808831", "0.669791" ]
0.8812968
1
Normalize a callable into 2tuple form.
public function normalize($callable) { if ($callable instanceof Closure) { $class = null; $func = $callable; } elseif (is_object($callable)) { $class = get_class($callable); $func = '__invoke'; } elseif (is_array($callable)) { list($class, $func) = $callable; if (is_object($class)) { $class = get_class($class); } } elseif (strpos($callable, '::') !== false) { list($class, $func) = explode('::', $callable, 2); } else { $class = null; $func = $callable; } return array($class, $func); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function parse($callable)\n {\n list($callable, $args) = $this->parseArgs($callable);\n\n if ($this->isClassMethod($callable)) {\n $callable = $this->parseClassMethod($callable);\n } elseif ($this->isMutatorMethod($callable)) {\n $callable = [$this, $callable];\n } elseif (!function_exists($callable)) {\n throw new InvalidCallableException(\"Function [{$callable}] not found.\");\n }\n\n return [$callable, $args];\n }", "public function toTuple();", "protected function parseArgs($callable)\n {\n $args = [];\n\n if (strpos($callable, ':') !== false) {\n list($callable, $argsString) = explode(':', $callable);\n\n $args = explode(',', $argsString);\n }\n\n return [$callable, $args];\n }", "public function convert(callable $function);", "public function unpack(callable $func = null);", "protected function parseCallArguments(array $args, $callable) {\n if((is_array($callable) && \n array_key_exists(1,$callable) &&\n array_key_exists($name = $callable[1], $this->arguments)) ||\n (is_scalar($callable) &&\n array_key_exists($name = $callable, $this->arguments))) {\n $args = array_merge($args, $this->arguments[$name]);\n }\n \n return $args;\n }", "protected function prepareRule($callable, $attribute)\n {\n if (is_string($callable) || static::isFormattableOrClosure($callable)) {\n return $callable;\n }\n\n return parent::prepareRule($callable);\n }", "protected function prepare_callable_reference( $callable_reference ) {\n\n\t\t// Determine whether the callable reference might require additional preparation.\n\t\tif ( is_string( $callable_reference ) ) {\n\n\t\t\t// Check what type of additional preparation is required.\n\t\t\tif ( strpos( $callable_reference, '@' ) ) { // Method reference.\n\t\t\t\t$callable_reference = explode( '@', $callable_reference );\n\t\t\t} elseif ( strpos( $callable_reference, '::' ) ) { // Static method reference.\n\t\t\t\t$callable_reference = explode( '::', $callable_reference );\n\t\t\t}\n\t\t}\n\t\treturn $callable_reference;\n\t}", "protected function _call($callable, $args = array()) {\n\t\treturn call_user_func_array($callable, $args);\n\t}", "public function __invoke(): callable\n {\n /**\n * Trim and remove doubled-up whitespace.\n *\n * @param string $string The string to process.\n * @param string $chars The characters to process/trim.\n * @param string $replacement The string to replace instances with.\n * @return string\n */\n return function (string $string, string $chars = '', string $replacement = ''): string {\n return call_user_func_array([StringHelpers::class, 'unspace'], func_get_args());\n };\n }", "public static function parse($callables)\n {\n if (static::isFormattableOrClosure($callables)) {\n return [$callables, []];\n }\n\n return parent::parse($callables);\n }", "function call($callable, $args = null)\n {\n $args = (func_num_args() > 2) ? array_slice(func_get_args(), 1) : (array) $args;\n return call_user_func_array($callable, $args);\n }", "private function fn(): callable {\n\t\treturn function (mixed $expression): string { return $expression; };\n\t}", "public function callCallable(callable $callable)\n {\n try {\n $rf = new ReflectionFunction(Closure::fromCallable($callable));\n } catch (ReflectionException $e) {\n throw new LogicException('Failed reflecting callable', 0, $e);\n }\n return $callable(...$this->expandParameters($rf->getParameters()));\n }", "protected function parseCallable($callableName) {\n if(!is_string($callableName) || is_callable($callableName)) {\n return $callableName;\n }\n \n $argStart = strpos($callableName,'(');\n if($argStart !== false) {\n $argEnd = strpos($callableName,')');\n $argumentSignature = substr($callableName,$argStart+1,$argEnd-$argStart-1);\n $callableName = substr($callableName,0, $argStart);\n $this->arguments[$callableName] = explode(',', $argumentSignature);\n }\n \n return trim($callableName);\n }", "public static function fix(callable $f)\n {\n return call_user_func(\n function (callable $x) use ($f) {\n return $f(\n function () use ($f, $x) {\n return call_user_func_array($x($x), func_get_args());\n }\n );\n },\n function (callable $x) use ($f) {\n return $f(\n function () use ($f, $x) {\n return call_user_func_array($x($x), func_get_args());\n }\n );\n }\n );\n }", "private static function reflectCallableParameters($callable)\n {\n /*\n loosely after https://github.com/technically-php/callable-reflection/blob/main/src/CallableReflection.php#L72-L86.\n Licence is compatible, both project use MIT\n */\n if ($callable instanceof Closure) {\n $reflection = new ReflectionFunction($callable);\n } elseif (is_string($callable) && function_exists($callable)) {\n $reflection = new ReflectionFunction($callable);\n } elseif (is_string($callable) && str_contains($callable, '::')) {\n $reflection = new ReflectionMethod($callable);\n } elseif (is_object($callable) && method_exists($callable, '__invoke')) {\n $reflection = new ReflectionMethod($callable, '__invoke');\n } else {\n throw new \\InvalidArgumentException('argument is not callable or the code is wrong');\n }\n\n return $reflection->getParameters();\n }", "function cdr(callable $pair)\n{\n $res = function ($x, $y) {\n return $y;\n };\n return $pair($res);\n // END\n}", "public static function getAsCallable($callable)\n {\n if (!is_callable($callable)) {\n if ($callable instanceof static) {\n $callable = $callable->getClosure();\n\n } else {\n throw new \\InvalidArgumentException('$callable arguments is not callable');\n }\n }\n\n return $callable;\n }", "function resolveCallableWithArgs(/*callable*/$callable, $parameters)\n {\n if ($parameters instanceof \\Traversable)\n $parameters = \\Poirot\\Std\\cast($parameters)->toArray();\n \n \n $reflection = reflectCallable($callable);\n $matchedArguments = resolveArgsForReflection($reflection, $parameters);\n \n $callbackResolved = function() use ($callable, $matchedArguments) {\n return call_user_func_array($callable, $matchedArguments);\n };\n \n return $callbackResolved;\n }", "function tuple()\n{\n $arguments = func_get_args();\n if (is_array($arguments[0])) {\n $generators = $arguments[0];\n } else {\n $generators = $arguments;\n }\n return new TupleGenerator($generators);\n}", "function car(callable $pair)\n{\n $res = function ($x, $y) {\n return $x;\n };\n return $pair($res);\n // END\n}", "private function normalizeFunctions(array $args): array\n\t{\n\t\tif (isset($args[0])) {\n\t\t\treturn $args;\n\t\t}\n\n\t\t$processedArgs = [];\n\t\tforeach ($args as $argName => $argValue) {\n\t\t\t[$argName, $operator] = ConditionParserHelper::parsePropertyOperator($argName);\n\t\t\t$processedArgs[] = [CompareFunction::class, $argName, $operator, $argValue];\n\t\t}\n\t\treturn $processedArgs;\n\t}", "function convertArg($a)\n{\n if(is_callable($a))\n {\n // PHP Can't serialize closures\n $r = new ReflectionFunction($a);\n $a = array($r->getName() => array(\n \"parameters\" => array_map('convertParam', $r->getParameters())\n ));\n }\n if(is_array($a))\n {\n // Recursively convert arrays\n $a = convertArray($a);\n }\n if(is_object($a))\n {\n $r = new ReflectionClass($a);\n $a = array($r->getName() => array(\n \"properties\" => convertArray(get_object_vars($a)),\n \"methods\" => $r->getMethods()));\n }\n return $a;\n}", "public function transform(Closure $func): static;", "function extractParameters($callableOrClassname) : array {\n\tswitch (true) {\n\t\t// Handle closure\n\t\tcase $callableOrClassname instanceof Closure:\n\t\t\t$parameters = (new ReflectionFunction($callableOrClassname))->getParameters();\n\t\t\tbreak;\n\t\t\n\t\t// Handle clasname-object-method-array\n\t\tcase is_array($callableOrClassname) && is_callable($callableOrClassname):\n\t\t\t$class = is_string($callableOrClassname[0]) ? $callableOrClassname[0] : get_class($callableOrClassname[0]);\n\t\t\t$parameters = (new ReflectionMethod($class . '::' . $callableOrClassname[1]))->getParameters();\n\t\t\tbreak;\n\n\t\t// Handle callable-string classname::method or function name\n\t\tcase is_string($callableOrClassname) && is_callable($callableOrClassname):\n\t\t\t$parameters = strpos($callableOrClassname, '::') ?\n\t\t\t\t\t\t\t\t(new ReflectionMethod($callableOrClassname))->getParameters() :\n\t\t\t\t\t\t\t\t(new ReflectionFunction($callableOrClassname))->getParameters();\n\t\t\tbreak;\n\t\t\n\t\t// Handle class name\n\t\tcase is_string($callableOrClassname) && class_exists($callableOrClassname):\n\t\t\t$parameters = (new ReflectionMethod($callableOrClassname . '::__construct'))->getParameters();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tthrow new InvalidArgumentException(sprintf(\n\t\t\t\t'Cant extract parameters from given argument with type \\'%s\\'.', \n\t\t\t\tis_object($callableOrClassname) ? get_class($callableOrClassname) : gettype($callableOrClassname)\n\t\t\t));\n\t}\n\n\treturn array_map(function(ReflectionParameter $parameter){\n\t\treturn $parameter->name;\n\t}, $parameters);\n}", "public static function parseCallback($callback)\n {\n if (is_string($callback)) {\n $callbackParts = explode('@', $callback);\n $class = self::$namespace . '\\\\' . $callbackParts[0];\n $method = $callbackParts[1];\n $callback = [$class, $method];\n }\n\n return $callback;\n }", "public function pipeAndReturnCallbackResult(callable $callback);", "protected function getBindingCallable($binder, $value)\n {\n // If $binder is a callable then use it, otherwise resolve the callable :\n if (is_callable($binder)) {\n return $binder;\n\n // If $binder is string (class name or Class@method)\n } elseif (is_string($binder)) {\n // Check if binder is CLass@method callable style\n if (strpos($binder, '@') === false) {\n $class = $binder;\n $method = null;\n } else {\n list($class, $method) = explode('@', $binder);\n }\n\n if (!class_exists($class)) {\n throw new Exception(\"Route-Model-Binding : Class not found : [$class]\");\n }\n\n $instance = $this->resolveClass($class);\n\n // If a custom method defined, use it, Otherwise, use the default binding callable\n if ($method) {\n return [$instance, $method];\n } else {\n return $this->getDefaultBindingResolver($instance, $value);\n }\n }\n\n throw new InvalidArgumentException('Route-Model-Binding : Invalid binder value, Expected callable or string');\n }", "public function to_fn() {\n $self = $this;\n return static function ($values) use ($self) {\n return $self->apply($values);\n };\n }" ]
[ "0.574029", "0.5605994", "0.55629414", "0.556134", "0.5397531", "0.5327673", "0.500636", "0.49669617", "0.4955853", "0.49198663", "0.4821207", "0.47891495", "0.47592136", "0.47322276", "0.47072294", "0.46931612", "0.46281737", "0.45879304", "0.45803133", "0.4576079", "0.45749453", "0.4570304", "0.45603183", "0.4514647", "0.4494459", "0.44911546", "0.44735405", "0.43914038", "0.43897614", "0.43795928" ]
0.6501608
0
Indicates whether a pdf document should be generated from the response for the specified request. The request must be for the 'pdf' format and the response format must be html.
public function isConvertable(Request $request, Response $response) { // Request must be for the 'pdf' format if ($request->getRequestFormat() !== $this->getFormat()) return false; // Current response must be html if (!$this->isHtmlResponse($response)) return false; // All checks ok return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function pdf($request, $response)\n {\n $id = $request->getAttribute('id');\n if (!ModelsRequests::generatePdfForId($id)) {\n return $response->withStatus(404)->withText(\"Il congedo non è stato trovato!\");\n }\n }", "public function generte_pdf(Request $request){\n }", "public function executeArticlePDF(sfWebRequest $request) {\n \t$this->setLayout(false);\n \t$filename = $request->getParameter('title_slug');\n \t$pdf_path = $this->_pdf_directory . $filename . '.pdf';\n \t$this->forward404Unless($this->isValidPDF($filename) && file_exists($pdf_path));\n \t$response = $this->getResponse();\n \t$response->clearHttpHeaders();\n \t$response->setContentType('application/pdf');\n \t$response->sendHttpHeaders();\n \t$response->setContent(readfile($pdf_path));\n \t$response->sendContent();\n\t\treturn sfView::HEADER_ONLY;\n }", "public function has_pdfs() {\n\t\treturn sizeof( $this->get_pdfs() ) ? true : false;\n\t}", "protected function formatPdf($response)\n\t{\n\n\t\t// #TODO: Implement BeforeRender Functionality\n\n\t\t$tmpfile_name = uniqid();\n\t\tif($this->build_path == \"\"){\n\t\t\t$this->build_path = getcwd().\"/\";\n\t\t}\n\n\t\t$tmpfile_path = $this->build_path.$tmpfile_name;\n\t\t$logfile_path = $this->build_path.$tmpfile_name.\".log\";\n\t\t$auxfile_path = $this->build_path.$tmpfile_name.\".aux\";\n\t\t$pdffile_path = $this->build_path.$tmpfile_name.\".pdf\";\n\n\t\t// Write temp file\n\t\t$fp = fopen($tmpfile_path, 'w+');\n\t\tfwrite($fp, $response->data);\n\t\tfclose($fp);\n\n\t\t// Start Process\n\t\t$process = new Process(\n\t\t\t[\n\t\t\t\t$this->latexbin,\n\t\t\t\t'-interaction=nonstopmode',\n\t\t\t\t$tmpfile_path,\n\t\t\t\t'-output-directory=$build_path'\n\t\t\t]\n\t\t);\n\n\t\t$process->setTimeout($this->timeout);\n\t\t$process->setIdleTimeout($this->idletimeout);\n\t\t$process->run();\n\n\t\tif (!$process->isSuccessful()) {\n\t\t\tunlink($logfile_path);\n\t\t\tunlink($auxfile_path);\n\t\t\tunlink($tmpfile_path);\n \tthrow new ProcessFailedException($process);\n\t\t}else{\n\t\t\tunlink($logfile_path);\n\t\t\tunlink($auxfile_path);\n\t\t\tunlink($tmpfile_path);\n\t\t\tif(file_exists($pdffile_path)){\n\t\t\t\t$pdf = file_get_contents($pdffile_path);\n\t\t\t\tunlink($pdffile_path);\n\t\t\t\treturn $pdf;\n\t\t\t}\n\t\t}\n\t}", "function convert_to_pdf($document_content, $file_name = false, $test = false) {\n\t$response = @file_get_contents('https://docraptor.com/docs?user_credentials=95gWBkqAtpdvRLTmfOU', false, stream_context_create(array(\n\t\t'http' => array (\n\t\t\t'method' => 'POST',\n\t\t\t'header' => 'Content-type: application/x-www-form-urlencoded' . \"\\r\\n\",\n\t\t\t'content' => http_build_query(array(\n\t\t\t\t'doc[document_content]' => $document_content, \n\t 'doc[document_type]' => 'pdf',\n\t 'doc[name]' => 'voucher.pdf',\n\t 'doc[test]' => ($test ? 'true' : false)\n\t\t\t))\n\t\t)\n\t)));\n\tif ($response && $file_name) {\n\t\t$path = '/tmp/'.$file_name;\n\t\t$file = fopen ($path, 'w'); \n\t\tfwrite($file, $response); \n\t\tfclose ($file);\n\t\treturn $path;\n\t} else if ($response) {\n\t\treturn $response;\n\t} else {\n\t\treturn false;\n\t}\n}", "function convert_to_pdf($document_content, $file_name = false, $test = false) {\n\t$response = @file_get_contents('https://docraptor.com/docs?user_credentials=95gWBkqAtpdvRLTmfOU', false, stream_context_create(array(\n\t\t'http' => array (\n\t\t\t'method' => 'POST',\n\t\t\t'header' => 'Content-type: application/x-www-form-urlencoded' . \"\\r\\n\",\n\t\t\t'content' => http_build_query(array(\n\t\t\t\t'doc[document_content]' => $document_content, \n\t 'doc[document_type]' => 'pdf',\n\t 'doc[name]' => 'voucher.pdf',\n\t 'doc[test]' => ($test ? 'true' : false)\n\t\t\t))\n\t\t)\n\t)));\n\tif ($response && $file_name) {\n\t\t$path = '/tmp/'.$file_name;\n\t\t$file = fopen ($path, 'w'); \n\t\tfwrite($file, $response); \n\t\tfclose ($file);\n\t\treturn $path;\n\t} else if ($response) {\n\t\treturn $response;\n\t} else {\n\t\treturn false;\n\t}\n}", "protected function ConvertToPdfRequest(Requests\\ConvertToPdfRequest $request)\n {\n\n $resourcePath = '/conversion/pdf';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = \"\";\n $multipart = false;\n \n\n // query params\n if ($request->outPath !== null) {\n $localName = lcfirst('OutPath');\n $localValue = is_bool($request->outPath) ? ($request->outPath ? 'true' : 'false') : $request->outPath;\n if (strpos($resourcePath, '{' . $localName . '}') !== false) {\n $resourcePath = str_replace('{' . $localName . '}', ObjectSerializer::toPathValue($localValue), $resourcePath);\n } else {\n $queryParams[$localName] = ObjectSerializer::toQueryValue($localValue);\n }\n }\n \n \n $resourcePath = $this->_parseURL($resourcePath, $queryParams);\n\n // body params\n $_tempBody = null;\n if (isset($request->settings)) {\n if (is_string($request->settings)) {\n $_tempBody = \"\\\"\" . $request->settings . \"\\\"\"; \n } else {\n $_tempBody = $request->settings;\n }\n }\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/json', 'application/xml']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 = $formParams[\"data\"];\n }\n }\n \n $this->_requestToken();\n\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['x-groupdocs-client'] = $this->config->getUserAgent();\n }\n \n $defaultHeaders['x-groupdocs-client-version'] = $this->config->getClientVersion();\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n \n $req = new Request(\n 'POST',\n $this->config->getHost() . $resourcePath,\n $headers,\n $httpBody\n );\n if ($this->config->getDebug()) {\n $this->_writeRequestLog('POST', $this->config->getHost() . $resourcePath, $headers, $httpBody);\n }\n \n return $req;\n }", "public function convert(Request $request, Response $response)\n {\n $generator = $this->getGenerator();\n $options = $request->attributes->get(\"{$this->getFormat()}_options\", []);\n $headers = array_merge($request->headers->all(), [\n 'Content-Type' => 'application/pdf',\n ]);\n\n return new StreamedResponse(function () use ($response, $generator, $options) {\n\n // Buffer the original response\n ob_start();\n $response->sendContent();\n $html = ob_get_contents();\n ob_end_clean();\n\n // Output converted response\n echo $generator->getOutputFromHtml($html, $options);\n\n }, $response->getStatusCode(), $headers);\n }", "protected function formatPdf($response)\n {\n $mpdf = new \\mPDF();\n if ($this->rotated) {\n $mpdf->AddPage('L');\n }\n $mpdf->WriteHTML($response->data);\n return $mpdf->Output('', 'S');\n }", "public function pdf(Request $request)\n {\n /**\n * toma en cuenta que para ver los mismos\n * datos debemos hacer la misma consulta\n **/\n\n $id=$request->input('codigoOt');\n\n $ordenDeTrabajoAsignada = ot_orden_trabajo::where('OT_ID','1');\n\n $pdf = PDF::loadView('pdfs.pdfOT', compact('ordenDeTrabajoAsignada'));\n\n return $pdf->download('ot.pdf');\n }", "private function shouldDepict(Request $request): bool\n {\n return app()->environment(config('depictr.environments', []))\n && $this->comesFromCrawler($request)\n && $request->isMethod('GET')\n && ! $request->header('X-Inertia')\n && ! $this->urlIsExcluded($request);\n }", "public function format($response)\n\t{\n\t\t$response->getHeaders()->set('Content-Type', 'application/pdf');\n\t\t$response->content = $this->formatPdf($response);\n\t}", "public function generarPDF(Request $request){\n\n\t\t$mes = $request->mes;\n\t\t$annio = $request->annio;\n\t\t$concepto = $request->concepto;\n\t\t$mayor_obrero = 0;\n\t\t$mayor_empleado = 0;\n\n\t\tif($concepto == 20100){\n\t\t\t$nominas_obrero = DB::table('nomina')\n\t\t\t\t\t\t\t\t\t->where('fecha_inicio', 'like', '%/'.$mes.'/'.$annio.'%')\n\t\t\t\t\t\t\t\t\t->where('tipo', 'obrero')\n\t\t\t\t\t\t\t\t\t->get();\n\n\t\t\t$nominas_empleado = DB::table('nomina')\n\t\t\t\t\t\t\t\t\t->where('fecha_inicio', 'like', '%/'.$mes.'/'.$annio.'%')\n\t\t\t\t\t\t\t\t\t->where('tipo', 'empleado')\n\t\t\t\t\t\t\t\t\t->get();\n\n\t\t\tforeach ($nominas_obrero as $obrero) {\n\t\t\t\tif($obrero->id > $mayor_obrero){\n\t\t\t\t\t$mayor_obrero = $obrero->id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ($nominas_empleado as $empleado) {\n\t\t\t\tif($empleado->id > $mayor_empleado){\n\t\t\t\t\t$mayor_empleado = $empleado->id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\t$html = view('pdf.retenciones.retenciones_fideicomiso')->with('mayor_obrero', $mayor_obrero)->with('mayor_empleado', $mayor_empleado)->with('mes', $mes)->with('annio', $annio)->render();\n \t\treturn PDF::load($html)->show();\n \t\n\t\t}\n\n\t\telse if($concepto == 20222){\n\t\t\t$nominas_obrero = DB::table('nomina')\n\t\t\t\t\t\t\t\t\t->where('fecha_inicio', 'like', '%/'.$mes.'/'.$annio.'%')\n\t\t\t\t\t\t\t\t\t->where('tipo', 'obrero')\n\t\t\t\t\t\t\t\t\t->get();\n\n\t\t\t$nominas_empleado = DB::table('nomina')\n\t\t\t\t\t\t\t\t\t->where('fecha_inicio', 'like', '%/'.$mes.'/'.$annio.'%')\n\t\t\t\t\t\t\t\t\t->where('tipo', 'empleado')\n\t\t\t\t\t\t\t\t\t->get();\n\n\t\t\tforeach ($nominas_obrero as $obrero) {\n\t\t\t\tif($obrero->id > $mayor_obrero){\n\t\t\t\t\t$mayor_obrero = $obrero->id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ($nominas_empleado as $empleado) {\n\t\t\t\tif($empleado->id > $mayor_empleado){\n\t\t\t\t\t$mayor_empleado = $empleado->id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$html = view('pdf.retenciones.retenciones_tesoreria_seguridad')->with('mayor_obrero', $mayor_obrero)->with('mayor_empleado', $mayor_empleado)->with('mes', $mes)->with('annio', $annio)->render();\n \t\treturn PDF::load($html)->show();\n \t\n\t\t}\n\n\t\telse if($concepto == 20134){\n\n\t\t\t\t$html = view('pdf.retenciones.retenciones_caja_ahorro')->with('annio', $annio)->with('mes', $mes)->render();\n \t\treturn PDF::load($html)->show();\n\t\t}\n\n\t\telse if($concepto == 30121){\n\n\t\t\t$nominas_obrero = DB::table('nomina')\n\t\t\t\t\t\t\t\t\t->where('fecha_inicio', 'like', '%/'.$mes.'/'.$annio.'%')\n\t\t\t\t\t\t\t\t\t->where('tipo', 'obrero')\n\t\t\t\t\t\t\t\t\t->get();\n\n\t\t\t$nominas_empleado = DB::table('nomina')\n\t\t\t\t\t\t\t\t\t->where('fecha_inicio', 'like', '%/'.$mes.'/'.$annio.'%')\n\t\t\t\t\t\t\t\t\t->where('tipo', 'empleado')\n\t\t\t\t\t\t\t\t\t->get();\n\t\t\tforeach ($nominas_obrero as $obrero) {\n\t\t\t\tif($obrero->id > $mayor_obrero){\n\t\t\t\t\t$mayor_obrero = $obrero->id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ($nominas_empleado as $empleado) {\n\t\t\t\tif($empleado->id > $mayor_empleado){\n\t\t\t\t\t$mayor_empleado = $empleado->id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($nominas_obrero != null && $nominas_empleado != null){\n\t\t\t\t$html = view('pdf.retenciones.retenciones_faov')->with('mayor_empleado', $mayor_empleado)->with('mayor_obrero', $mayor_obrero)->with('mes', $mes)->with('annio', $annio)->render();\n \t\treturn PDF::load($html)->show();\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn redirect()->back()->with('alert', 'No existen retenciones para esta fecha');\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function format($response)\n {\n $response->getHeaders()->set('Content-Type', 'application/pdf');\n $response->content = $this->formatPdf($response);\n }", "public function pdfAction(Request $request, $id)\n {\n $donation=new donation();\n $facture = new facture();\n $em=$this->getDoctrine()->getManager();\n $facture= $em->getRepository(\"DonationBundle:facture\")->find($id);\n $donation = $em->getRepository(\"DonationBundle:donation\")->find($facture->getDonationid());\n\n $snappy = $this->get('knp_snappy.pdf');\n $snappy->setOption('no-outline', true);\n $snappy->setOption('page-size','LETTER');\n $snappy->setOption('encoding', 'UTF-8');\n\n $html = $this->renderView('facture/pdf.html.twig', array(\n 'donation'=>$donation,\n 'facture' => $facture,\n ));\n\n $filename = 'myFirstSnappyPDF';\n\n return new Response(\n $snappy->getOutputFromHtml($html),\n 200,\n array(\n 'Content-Type' => 'application/pdf',\n 'Content-Disposition' => 'inline; filename=\"'.$filename.'.pdf\"'\n )\n );\n }", "public function attachment_is_pdf( $id ) {\n\t\treturn wp_attachment_is( 'pdf', $id );\t\t\n\t}", "protected function checkPDF(): void\n {\n if ('application/pdf' === $this->mimeType ||\n 'pdf' === $this->fileExtension\n ) {\n $this->iconClass = self::ICON_PDF;\n }\n }", "public function validateDoc($document)\n\t\t{\n\t\t\tif ($document == 'terms_and_conditions' ||\n\t\t\t\t$document == 'privacy_policy') {\n\t\t\t\t\n\t\t\t\t$render = $document;\n\n\t\t\t}else{\n\n\t\t\t\t$render = \"no_document\";\n\n\t\t\t}\n\n\t\t\treturn $render;\n\t\t}", "function _wp_kses_allow_pdf_objects($url)\n {\n }", "public function getPdfUrl() {\n $ch = curl_init();\n $timeout = 10;\n curl_setopt($ch, CURLOPT_URL, $this->url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n $response = curl_exec($ch);\n curl_close($ch);\n\n // If you accidentally look at this, I suggest pretending you haven't seen it.\n $matches = array();\n preg_match(\"/\\<span class=\\\"application-pdf\\\"\\>.*\\<\\/span\\>/\", $response, $matches);\n \n // If no PDF URL that means there is no bill to download yet (boo)\n if (!isset($matches[0]))\n return false;\n \n $pdfUrl = $matches[0];\n $pdfUrl = str_replace('<span class=\"application-pdf\"><a href=\"', '', $pdfUrl);\n $pdfUrl = preg_replace(\"/\\\"\\>PDF version,(.*)\\<\\/a\\>\\<\\/span\\>/\", '', $pdfUrl);\n // Forcably fix some incorrectly parsed URLs\n $pdfUrl = preg_replace(\"/^.*http\\:/\", 'http:', $pdfUrl);\n $pdfUrl = preg_replace(\"/\\.pdf.*$/\", '.pdf', $pdfUrl);\n \n return $pdfUrl;\n }", "function _testXpdf() {\r\n \tglobal $output, $status;\r\n @exec('pdftotext', $output, $status);\r\n if (!empty($output[0])) {\r\n if (preg_match(\"/pdftotext/i\",$output[0], $matches)) {\r\n return \"pdftotext\";\r\n }\r\n }\r\n unset($output, $status);\r\n }", "public static function pdf_mime_header() {\n\t//--\n\treturn (string) 'application/pdf';\n\t//--\n}", "function pdf() {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canView($this->logged_user)) {\n InvoicePDFGenerator::download($this->active_invoice, Invoices::getInvoicePdfName($this->active_invoice));\n \tdie();\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n }", "public function shouldRender()\n {\n if ($this->totalPages > 1) {\n \n return true;\n }\n \n return false;\n }", "public function handleRequest($request)\r\n { \r\n $logClass= new LogClass('jobtracker', 'GeneratePDFChain');\r\n $sharedClass = new SharedClass();\r\n \r\n \t\r\n //2 - initialize instances\r\n $pdf = new JobPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);\r\n \r\n //3 - get the parts connected\r\n $pdfParams = $request['pdfParams'];\r\n \r\n $jobData = $request['jobData'];\r\n $documentData = $request['documentData'];\r\n $documentData = $documentData['data'];\r\n $imagesData = $request['imagesData'];\r\n $notesData = $request['notesData'];\r\n $notesData = $notesData['data'];\r\n $userData = $request['userData'];\r\n $printOptions = explode(\",\", $pdfParams['print_options']);\r\n \r\n //contact rules\r\n $ContactRules = $sharedClass->getCustomerRules($userData['customerid'], $userData['role']);\r\n \r\n if (count($jobData)==0) {\r\n return false;\r\n }\r\n \r\n $headerImage = array('image'=> K_PATH_IMAGES.'banner.jpg','imagetype'=>'jpg');\r\n $footerImage = array('image'=> K_PATH_IMAGES.'banner.jpg','imagetype'=>'jpg');\r\n $logoImage = array('image'=>K_PATH_IMAGES.'logo.png', 'imagetype'=>'PNG');\r\n \r\n \r\n $brandingImage = $sharedClass->getBrandingImage('H', 'R');\r\n if (count($brandingImage)>0) {\r\n $dirpath = $this->config->item('branding_dir').$brandingImage['documentid'].'.'.$brandingImage['docformat'];\r\n \r\n if (file_exists($dirpath)) {\r\n $headerImage = array('image'=> $this->config->item('branding_dir').$brandingImage['documentid'].'.'.$brandingImage['docformat'],'imagetype'=> $brandingImage['docformat']);\r\n }\r\n }\r\n \r\n $brandingImage = $sharedClass->getBrandingImage('F', 'R');\r\n if (count($brandingImage)>0) {\r\n $dirpath = $this->config->item('branding_dir').$brandingImage['documentid'].'.'.$brandingImage['docformat'];\r\n \r\n if (file_exists($dirpath)) {\r\n $footerImage = array('image'=> $this->config->item('branding_dir').$brandingImage['documentid'].'.'.$brandingImage['docformat'],'imagetype'=> $brandingImage['docformat']);\r\n }\r\n }\r\n \r\n //set document information\r\n $pdf->SetCreator(PDF_CREATOR);\r\n $pdf->SetAuthor(PDF_AUTHOR);\r\n $pdf->SetTitle('JOB - ' .$jobData[\"jobid\"]);\r\n $pdf->SetSubject('JOB');\r\n \r\n // set header and footer fonts\r\n $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));\r\n $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));\r\n\r\n // set default monospaced font\r\n $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);\r\n\r\n // set margins\r\n $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP+25, PDF_MARGIN_RIGHT,PDF_MARGIN_BOTTOM+20);\r\n $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);\r\n $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);\r\n\r\n // set auto page breaks\r\n $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);\r\n\r\n // set image scale factor\r\n $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);\r\n\r\n // set some language-dependent strings (optional)\r\n if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {\r\n require_once(dirname(__FILE__) . '/lang/eng.php');\r\n $pdf->setLanguageArray($l);\r\n }\r\n \r\n\r\n\r\n // ---------------------------------------------------------\r\n // set font\r\n $pdf->SetFont('helvetica', '', 8);\r\n \r\n $pdf->SetTextColor(0, 0, 0);\r\n $pdf->SetFont('helvetica', '', 8);\r\n $border = array('LTRB' => array('width' => 0.3, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));\r\n \r\n //Company Info \r\n $address = nl2br($sharedClass->getSysValue(\"dochead\"));\r\n $owner= nl2br($sharedClass->getSysValue(\"tradingname\"));\r\n $abn= nl2br($sharedClass->getSysValue(\"abn\"));\r\n\r\n $CompanyDetail = '<table>\r\n <tr><td style =\"width:5px;height:3px;font-size:3px;\">&nbsp;</td><td style =\"height:3px;font-size:3px;width:250px;\"></td></tr>\r\n <tr><td style =\"width:5px;\">&nbsp;</td><td ><b>'. $owner.'</b>';\r\n $CompanyDetail .='<br>ABN : '.$abn;\r\n $CompanyDetail .='<br>'.$address;\r\n \r\n $CompanyDetail .='</td></tr>\r\n </table>';\r\n \r\n $pdf->setHeaderImage($headerImage);\r\n $pdf->setfooterImage($footerImage);\r\n $pdf->setLogoImage($logoImage);\r\n $pdf->setjobTitle('JOB - ' .$jobData[\"jobid\"]);\r\n $pdf->setjobid($jobData[\"jobid\"]);\r\n $pdf->setCompanyDetail($CompanyDetail);\r\n \r\n // add a page\r\n $pdf->AddPage();\r\n \r\n //Job Detail Section\r\n if(is_array($printOptions) && (array_search('jl', $printOptions) > -1)) {\r\n $pdf->Ln(4);\r\n $pdf->SetFont('helvetica', 'B', 10);\r\n $pdf->SetFillColor(31,73,125); // Grey\r\n $pdf->SetTextColor(255, 255, 255);\r\n $pdf->Cell(0, 7, 'Job Detail', 0, false, 'L', true, '', 0, false, 'M', 'M');\r\n\r\n $pdf->SetFont('helvetica', '', 9);\r\n $pdf->SetFillColor(255, 255, 255);\r\n $pdf->SetTextColor(0, 0, 0);\r\n\r\n $pdf->Ln(3.8);\r\n\r\n $border = array('LTRB' => array('width' => 0.3, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));\r\n\r\n //Job Data formating for display\r\n $jobData['sitecontact'] = '';\r\n if($jobData['sitecontact'] != '') {\r\n $jobData['sitecontact'] = $jobData['sitecontact'];\r\n if($jobData['sitephone'] != '') {\r\n $jobData['sitecontact'] = $jobData['sitecontact'].' - ('.$jobData['sitephone'].')';\r\n }\r\n }\r\n\r\n $jobData['notexceed'] = format_amount($jobData['notexceed']);\r\n $jobData['pdate'] = format_datetime($jobData['pdate'], RAPTOR_DISPLAY_DATEFORMAT, RAPTOR_DISPLAY_TIMEFORMAT);\r\n $jobData['duedate'] = format_date($jobData['duedate'], RAPTOR_DISPLAY_DATEFORMAT);\r\n $jobData['duetime'] = format_time($jobData['duetime'], RAPTOR_DISPLAY_TIMEFORMAT);\r\n $jobData['jcompletedate'] = format_datetime($jobData['jcompletedate'], RAPTOR_DISPLAY_DATEFORMAT, RAPTOR_DISPLAY_TIMEFORMAT);\r\n\r\n $jobData['custordref1_label'] = isset($ContactRules[\"custordref1_label\"]) ? $ContactRules[\"custordref1_label\"] : 'Order Ref 1';\r\n $jobData['custordref2_label'] = isset($ContactRules[\"custordref2_label\"]) ? $ContactRules[\"custordref2_label\"] : 'Order Ref 2';\r\n $jobData['custordref3_label'] = isset($ContactRules[\"custordref3_label\"]) ? $ContactRules[\"custordref3_label\"] : 'Order Ref 3';\r\n\r\n $jobData['custordref3_access'] = isset($ContactRules[\"hide_custordref3_in_client_portal\"]) ? $ContactRules[\"hide_custordref3_in_client_portal\"] : 0;\r\n\r\n //Job Data\r\n $jobDetail = '<table cellpadding=\"2\" style=\"border:solid 1px black;\">';\r\n $jobDetail .= '<tr><td style =\"width:10px;\">&nbsp;</td><td style =\"width:150px;height:3px;font-size:3px;\">&nbsp;</td><td style =\"height:3px;font-size:3px;width:476px;\"></td></tr>';\r\n $jobDetail .= '<tr><td style =\"width:10px;\">&nbsp;</td><td style =\"width:150px;\">Job Id</td><td>'. $jobData['jobid'].'</td></tr>';\r\n $jobDetail .= '<tr><td style =\"width:10px;\">&nbsp;</td><td style =\"width:150px;\">Job Status</td><td>'. $jobData['portaldesc'].'</td></tr>';\r\n $jobDetail .= '<tr><td style =\"width:10px;\">&nbsp;</td><td style =\"width:150px;\">Site</td><td>'. $jobData['siteline1'].'</td></tr>';\r\n $jobDetail .= '<tr><td style =\"width:10px;\">&nbsp;</td><td style =\"width:150px;\">Site Address</td><td>'. $jobData['site'].'</td></tr>';\r\n $jobDetail .= '<tr><td style =\"width:10px;\">&nbsp;</td><td style =\"width:150px;\">Territory</td><td>'. $jobData['territory'].'</td></tr>';\r\n $jobDetail .= '<tr><td style =\"width:10px;\">&nbsp;</td><td style =\"width:150px;\">'.$jobData['custordref1_label'].'</td><td>'. $jobData['custordref'].'</td></tr>';\r\n $jobDetail .= '<tr><td style =\"width:10px;\">&nbsp;</td><td style =\"width:150px;\">'.$jobData['custordref2_label'].'</td><td>'. $jobData['custordref2'].'</td></tr>';\r\n $jobDetail .= '<tr><td style =\"width:10px;\">&nbsp;</td><td style =\"width:150px;\">'.$jobData['custordref3_label'].'</td><td>'. $jobData['custordref3'].'</td></tr>';\r\n $jobDetail .= '<tr><td style =\"width:10px;\">&nbsp;</td><td style =\"width:150px;\">Priority</td><td>'. $jobData['priority'].'</td></tr>';\r\n $jobDetail .= '<tr><td style =\"width:10px;\">&nbsp;</td><td style =\"width:150px;\">$ Limit</td><td>'. $jobData['notexceed'].'</td></tr>';\r\n $jobDetail .= '<tr><td style =\"width:10px;\">&nbsp;</td><td style =\"width:150px;\">Quoted Required?</td><td>'. $jobData['quoted'].'</td></tr>';\r\n $jobDetail .= '<tr><td style =\"width:10px;\">&nbsp;</td><td style =\"width:150px;\">Entry Date</td><td>'. $jobData['pdate'].'</td></tr>';\r\n $jobDetail .= '<tr><td style =\"width:10px;\">&nbsp;</td><td style =\"width:150px;\">Due Date</td><td>'. $jobData['duedate'].'</td></tr>';\r\n $jobDetail .= '<tr><td style =\"width:10px;\">&nbsp;</td><td style =\"width:150px;\">Completion Date</td><td>'. $jobData['jcompletedate'].'</td></tr>';\r\n $jobDetail .= '<tr><td style =\"width:10px;\">&nbsp;</td><td style =\"width:150px;\">Site FM</td><td>'. $jobData['sitefm'].'</td></tr>';\r\n $jobDetail .= '<tr><td style =\"width:10px;\">&nbsp;</td><td style =\"width:150px;\">Site Contact</td><td>'. $jobData['sitecontact'].'</td></tr>';\r\n $jobDetail .= '<tr><td style =\"width:10px;\">&nbsp;</td><td style =\"width:150px;\">Job Description</td><td>'. $jobData['jobdescription'].'</td></tr>';\r\n $jobDetail .= '<tr><td style =\"width:10px;\">&nbsp;</td><td style =\"width:150px;height:3px;font-size:3px;\">&nbsp;</td><td style =\"height:3px;font-size:3px;width:476px;\"></td></tr>';\r\n\r\n $jobDetail .='</table>';\r\n\r\n // output the HTML content\r\n\r\n $pdf->writeHTML($jobDetail, true, false, true, false, '');\r\n }\r\n \r\n \r\n //Job Note Section\r\n if(is_array($printOptions) && (array_search('jn', $printOptions) > -1)) {\r\n $pdf->Ln(7);\r\n $pdf->SetFont('helvetica', 'B', 10);\r\n $pdf->SetFillColor(31,73,125); // Grey\r\n $pdf->SetTextColor(255, 255, 255);\r\n $pdf->Cell(0, 7, 'Job Notes', 0, false, 'L', true, '', 0, false, 'M', 'M');\r\n\r\n $pdf->SetFont('helvetica', '', 9);\r\n $pdf->SetFillColor(255, 255, 255);\r\n $pdf->SetTextColor(0, 0, 0);\r\n\r\n $pdf->Ln(3.8);\r\n $color1 = \"#FFFFFF\";\r\n $color2 = \"#F4F9FF\";\r\n $html = '<table style =\"border:1px solid black;\" cellspacing=\"0\" cellpadding=\"4\">\r\n <thead>\r\n <tr nobr=\"true\">\r\n <th style =\"border:1px solid black;font-weight:bold;width:100px;background-color:#CCCCCC;\">Job Note Id</th>\r\n\r\n <th style =\"border:1px solid black;font-weight:bold;width:356px;background-color:#CCCCCC;\">Notes</th>\r\n <th style =\"border:1px solid black;font-weight:bold;width:100px;background-color:#CCCCCC;\">Note Type</th>\r\n <th style =\"border:1px solid black;font-weight:bold;width:80px;background-color:#CCCCCC;\">Date</th>\r\n </tr></thead><tbody>';\r\n\r\n $count = 0;\r\n foreach ($notesData as $row) {\r\n $count = $count+1;\r\n $row_color = ($count % 2) ? $color1 : $color2;\r\n $html .= '<tr nobr=\"true\" bgcolor=\"'. $row_color.'\">\r\n <td style =\"border:1px solid black;width:100px;\">'.$row['jobnoteid'].'</td>\r\n <td style =\"border:1px solid black;width:356px;\">' . $row['notes'] . '</td>\r\n <td style =\"border:1px solid black;width:100px;\">' . $row['notetype'] . '</td>\r\n <td style =\"border:1px solid black;width:80px;\">' . format_date($row['date'], RAPTOR_DISPLAY_DATEFORMAT) . '</td>\r\n </tr>';\r\n }\r\n\r\n /*for ($i= $count;$i<=4;$i++) {\r\n $row_color = ($i % 2) ? $color2:$color1;\r\n $html .= '<tr bgcolor=\"'. $row_color.'\">\r\n <td style =\"border:1px solid black;width:100px;\">&nbsp;</td>\r\n <td style =\"border:1px solid black;width:356px;\">&nbsp;</td>\r\n <td style =\"border:1px solid black;width:100px;\">&nbsp;</td>\r\n <td style =\"border:1px solid black;width:80px;\">&nbsp;</td>\r\n </tr>';\r\n\r\n }*/\r\n $html .= '</tbody></table>';\r\n\r\n // output the HTML content\r\n $pdf->writeHTML($html, true, false, true, false, '');\r\n }\r\n \r\n \r\n \r\n //job documents\r\n if(is_array($printOptions) && (array_search('jd', $printOptions) > -1)) {\r\n $pdf->Ln(7);\r\n $pdf->SetFont('helvetica', 'B', 10);\r\n $pdf->SetFillColor(31,73,125); // Grey\r\n $pdf->SetTextColor(255, 255, 255);\r\n $pdf->Cell(0, 7, 'Job Docs', 0, false, 'L', true, '', 0, false, 'M', 'M');\r\n\r\n $pdf->SetFont('helvetica', '', 9);\r\n $pdf->SetFillColor(255, 255, 255);\r\n $pdf->SetTextColor(0, 0, 0);\r\n\r\n $pdf->Ln(3.8);\r\n $color1 = \"#FFFFFF\";\r\n $color2 = \"#F4F9FF\";\r\n $html = '<table style =\"border:1px solid black;\" cellspacing=\"0\" cellpadding=\"4\">\r\n <thead>\r\n <tr nobr=\"true\">\r\n <th style =\"border:1px solid black;font-weight:bold;width:338px;background-color:#CCCCCC;\">Document Name</th>\r\n\r\n <th style =\"border:1px solid black;font-weight:bold;width:218px;background-color:#CCCCCC;\">Docfolder</th>\r\n <th style =\"border:1px solid black;font-weight:bold;width:80px;background-color:#CCCCCC;\">Date Added</th>\r\n </tr></thead><tbody>';\r\n\r\n $count = 0;\r\n foreach ($documentData as $row) {\r\n $count = $count+1;\r\n $row_color = ($count % 2) ? $color1 : $color2;\r\n $html .= '<tr nobr=\"true\" bgcolor=\"'. $row_color.'\">\r\n <td style =\"border:1px solid black;width:338px;\">'.$row['docname'].'</td>\r\n <td style =\"border:1px solid black;width:218px;\">' . $row['docfolder'] . '</td>\r\n <td style =\"border:1px solid black;width:80px;\">' . format_date($row['dateadded'], RAPTOR_DISPLAY_DATEFORMAT) . '</td>\r\n </tr>';\r\n }\r\n\r\n /*for ($i= $count;$i<=4;$i++) {\r\n $row_color = ($i % 2) ? $color2:$color1;\r\n $html .= '<tr bgcolor=\"'. $row_color.'\">\r\n <td style =\"border:1px solid black;width:338px;\">&nbsp;</td>\r\n <td style =\"border:1px solid black;width:218px;\">&nbsp;</td>\r\n <td style =\"border:1px solid black;width:80px;\">&nbsp;</td>\r\n </tr>';\r\n\r\n }*/\r\n $html .= '</tbody></table>';\r\n\r\n // output the HTML content\r\n $pdf->writeHTML($html, true, false, true, false, '');\r\n }\r\n \r\n //images\r\n if(is_array($printOptions) && (array_search('im', $printOptions) > -1)) {\r\n $pdf->Ln(7);\r\n $pdf->SetFont('helvetica', 'B', 10);\r\n $pdf->SetFillColor(31,73,125); // Grey\r\n $pdf->SetTextColor(255, 255, 255);\r\n $pdf->Cell(0, 7, 'Images', 0, false, 'L', true, '', 0, false, 'M', 'M');\r\n\r\n $pdf->SetFont('helvetica', '', 9);\r\n $pdf->SetFillColor(255, 255, 255);\r\n $pdf->SetTextColor(0, 0, 0);\r\n\r\n $pdf->Ln(3.8);\r\n\r\n $html = '<table cellspacing=\"0\" cellpadding=\"10\">';\r\n foreach ($imagesData as $k => $value) {\r\n $imagepath = $this->config->item('document_path').$value['documentid'].'_thumb.'.$value['docformat'];\r\n $dirpath = $this->config->item('document_dir').$value['documentid'].'_thumb.'.$value['docformat'];\r\n if (file_exists($dirpath)) {\r\n $html .= '<tr nobr=\"true\"><td style =\"border-bottom:1px solid gray;width:150px;\"><img src=\"'.$imagepath.'\" /></td>'\r\n . '<td style =\"border-bottom:1px solid gray;width:486px;vertical-align:middle;\" valign=\"middle\">Id: '.$value['documentid'].' '.format_date($value['dateadded'], RAPTOR_DISPLAY_DATEFORMAT).'<br />'.$value['docname'].'<br />'.$value['documentdesc'].'</td></tr>';\r\n }\r\n } \r\n\r\n $html .= '</table>';\r\n\r\n $pdf->writeHTML($html, true, false, true, false, '');\r\n }\r\n \r\n //echo $html;\r\n //exit;\r\n \r\n $filelocation = $this->config->item('document_dir');\r\n if(!$filelocation){\r\n $filelocation = $_SERVER['DOCUMENT_ROOT'].'/infomaniacDocs/jobdocs';\r\n \r\n }\r\n $open = false;\r\n if(isset($pdfParams['open'])){\r\n $open = (bool)$pdfParams['open'];\r\n }\r\n \r\n //5 - get inserted id values\r\n $file_name = 'job_' . $jobData[\"jobid\"] . '.pdf';\r\n \r\n $fileNL = $filelocation . \"/\" . $file_name; //Linux\r\n \r\n if (!is_dir($filelocation)) {\r\n mkdir($filelocation, 0755, true);\r\n }\r\n \r\n //6 - return the result object\r\n //Close and output PDF document\r\n $pdf->Output($fileNL, 'F');\r\n \r\n if ($open) {\r\n ob_end_clean();\r\n $pdf->Output($file_name, 'I');\r\n }\r\n \r\n \r\n $logClass->log('Create Job PDF');\r\n \r\n if ($this->successor != NULL)\r\n {\r\n $this->successor->handleRequest ($request);\r\n }\r\n //it should be at the last part of chain\r\n $this -> returnValue = $request;\r\n \r\n\r\n }", "public function authorize() {\n\t\treturn $this->user()->can('create', Pdf::class);\n\t}", "public static function isRequest() {\n\t return http_response_code()!==FALSE;\n\t}", "public function pdf($no, $download = false)\n {\n $handle = $this->getHandle($no);\n $pdf = $this->client\n ->Quotation_GetPdf([\n 'quotationHandle' => $handle,\n ])\n ->Quotation_GetPdfResult;\n\n if (!$download) {\n return $pdf;\n }\n\n header('Content-type: application/pdf');\n header('Content-Disposition: attachment; filename=\"' . $no . '.pdf\"');\n echo $pdf;\n\n return true;\n }", "public function testSupportedMIMETypes()\n {\n $this->assertContains('application/x-pdf', self::$client->getSupportedMIMETypes());\n }" ]
[ "0.6752349", "0.59716284", "0.5959558", "0.59247404", "0.5795268", "0.5757904", "0.5757904", "0.57113576", "0.5634374", "0.5624991", "0.56138057", "0.5599685", "0.5538908", "0.54689413", "0.54665947", "0.5413307", "0.5399296", "0.5374836", "0.5370826", "0.53654677", "0.5355895", "0.5354883", "0.5354804", "0.5344209", "0.53128785", "0.5257816", "0.52429956", "0.5236997", "0.522802", "0.52261114" ]
0.7042534
0
/ Plugin Name: Carousel MobileOneContainers Description: Display a carousel list of containers product Author: Edwin Marte | Ntono Digital Author URI: Version: 1.0 / Adding new metabox Image to post type Meta Boxes
function listing_image_add_metabox () { add_meta_box( 'listingimagediv', __( 'Image Containers Loop', 'text-domain' ), 'listing_image_metabox', 'product', 'side', 'low'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function thmplt_carousel_slide_meta(){\r\n\tadd_meta_box(\"thmplt_carousel_meta_box1\", \"Slide Settings\", \"thmplt_carousel_slide_settings_html\", \"thmplt_carousel\", \"normal\", \"high\");\r\n\tadd_meta_box(\"thmplt_carousel_meta_box2\", \"Slide Images\", \"thmplt_carousel_slide_settings_html2\", \"thmplt_carousel\", \"normal\", \"high\");\r\n}", "function pz_add_custom_meta_box()\n{\n add_meta_box(\n 'custom_meta_box',\n 'Custom Image Metabox',\n 'pz_custom_meta_box_callbacks',\n 'page', // page, post etc.\n 'normal',\n 'high');\n}", "function wr_add_image_portfolio_metaboxes() {\n\tadd_meta_box(\n\t\t'image2',\n\t\t'Image Slide 2',\n\t\t'wr_image2_portfolio',\n\t\t'portfolio',\n\t\t'side',\n\t\t'default'\n\t);\n\tadd_meta_box(\n\t\t'image3',\n\t\t'Image Slide 3',\n\t\t'wr_image3_portfolio',\n\t\t'portfolio',\n\t\t'side',\n\t\t'default'\n\t);\n}", "function sb_slideshow_meta_box_callback() {\n\tglobal $wpdb, $sb_slideshow_interface, $sb_slideshow_slides;\n\n\tsb_slideshow_slides( $sb_slideshow_interface['mysql_select'] ); // push slides\n\n\t// Add custom meta boxes to custom post type\n\tadd_meta_box( 'sb_slides', __( 'Slides', 'startbox' ), 'sb_slideshow_slides_meta', 'slideshow', 'normal', 'low' );\n\tadd_meta_box( 'sb_library', __( 'Media Library', 'startbox' ), 'sb_slideshow_library_meta', 'slideshow', 'normal', 'low' );\n\tadd_meta_box( 'sb_shortcode', __( 'Shortcode', 'startbox' ), 'sb_slideshow_shortcode_meta', 'slideshow', 'side', 'low' );\n\tadd_meta_box( 'sb_slide_options', __( 'Options', 'startbox' ), 'sb_slideshow_options_meta', 'slideshow', 'side', 'low' );\n}", "public function add_meta_boxes(){\r\n \r\n add_meta_box(\r\n 'cyclone-slides-metabox',\r\n __('Slides', 'cyclone-slider-2'),\r\n array( $this, 'render_slides_meta_box' ),\r\n 'cycloneslider' ,\r\n 'normal',\r\n 'high'\r\n );\r\n \r\n add_meta_box(\r\n 'cyclone-slider-preview-metabox',\r\n __('Slider Preview', 'cyclone-slider-2'),\r\n array( $this, 'render_slider_preview_meta_box' ),\r\n 'cycloneslider' ,\r\n 'side',\r\n 'high'\r\n );\r\n \r\n add_meta_box(\r\n 'cyclone-slider-codes',\r\n __('Get Slider Codes', 'cyclone-slider-2'),\r\n array( $this, 'render_slider_codes' ),\r\n 'cycloneslider' ,\r\n 'side',\r\n 'low'\r\n );\r\n \r\n add_meta_box(\r\n 'cyclone-slider-properties-metabox',\r\n __('Basic Settings', 'cyclone-slider-2'),\r\n array( $this, 'render_slider_properties_meta_box' ),\r\n 'cycloneslider' ,\r\n 'side',\r\n 'low'\r\n );\r\n \r\n add_meta_box(\r\n 'cyclone-slider-advanced-settings-metabox',\r\n __('Advanced Settings', 'cyclone-slider-2'),\r\n array( $this, 'render_slider_advanced_settings_meta_box' ),\r\n 'cycloneslider' ,\r\n 'side',\r\n 'low'\r\n );\r\n \r\n add_meta_box(\r\n 'cyclone-slider-templates-metabox',\r\n __('Templates', 'cyclone-slider-2'),\r\n array( $this, 'render_slider_templates_meta_box' ),\r\n 'cycloneslider' ,\r\n 'normal',\r\n 'low'\r\n );\r\n \r\n add_meta_box(\r\n 'cyclone-slider-id',\r\n __('Slideshow ID', 'cyclone-slider-2'),\r\n array( $this, 'render_slider_id' ),\r\n 'cycloneslider' ,\r\n 'normal',\r\n 'low'\r\n );\r\n }", "function add_shortcode_metabox() {\n add_meta_box('acf_slideshow_shortcode', 'Shortcode', 'acfcallback', 'acf_slideshow', 'side', 'default');\n}", "function scalia_slides_register_meta_box($post) {\r\r\n\tremove_meta_box('postimagediv', 'scalia_slide', 'side');\r\r\n\tadd_meta_box('postimagediv', __('Slide Image', 'scalia'), 'post_thumbnail_meta_box', 'scalia_slide', 'normal', 'high');\r\r\n\tadd_meta_box('scalia_slide_settings', __('Slide Settings', 'scalia'), 'scalia_slide_settings_box', 'scalia_slide', 'normal', 'high');\r\r\n}", "function slider_metabox() {\n add_meta_box('slider_detail_metabox', __('Slider Details', 'calibrefx'), 'slider_detail_metabox', 'slider', 'normal', 'high');\n}", "function wpb_carousel_widget() {\n\t register_widget( 'wpb_widget' );\n\t}", "function triumph_hero(){\n global $homepage_metabox;\n $id = 'homepage';\n print '<div id=\"hp-top\">';\n print '<div class=\"hp-top-background-block\"></div>';\n $i = 0;\n while($homepage_metabox->have_fields('sliders')):\n $active = $i==0?' active':'';\n $indicators .= '<li data-target=\"#myCarousel_'.$id.'\" data-slide-to=\"'.$i.'\" class=\"'.$active.'\"></li>';\n $items .= '\n <div class=\"item'.$active.'\">\n <div class=\"image_block_wrapper\">\n <div class=\"image_block\" style=\"background: url('.$homepage_metabox->get_the_value('image').') center top no-repeat #000000;background-size: cover;\">\n <div class=\"quote_block\">\n <div class=\"wrap\">\n <div class=\"quote\">'.apply_filters('the_content',$homepage_metabox->get_the_value('quote')).'</div>\n <div class=\"attribution\">'.$homepage_metabox->get_the_value('attribution').'</div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"wrap\">\n <div class=\"content-sidebar-wrap row\">\n <main itemprop=\"mainContentOfPage\" role=\"main\" class=\"content col-md-8 col-sm-12\">\n <article itemtype=\"http://schema.org/CreativeWork\" itemscope=\"itemscope\" class=\"page entry\">\n <header class=\"entry-header\">\n <h1 itemprop=\"headline\" class=\"entry-title\">'.$homepage_metabox->get_the_value('title').'</h1> \n </header>\n <div itemprop=\"text\" class=\"entry-content\">\n '.apply_filters('the_content',$homepage_metabox->get_the_value('content')).'\n </div>\n </article>\n </main>\n <aside itemtype=\"http://schema.org/WPSideBar\" itemscope=\"itemscope\" role=\"complementary\" class=\"sidebar sidebar-primary widget-area col-md-4 hidden-sm hidden-xs\">\n '.apply_filters('the_content',$homepage_metabox->get_the_value('sidebar')).'\n </aside>\n </div>\n </div>\n </div>';\n $i++;\n endwhile;\n print msd_carousel_wrapper($items,array('id' => $id,'indicators' => $indicators));\n print '</div>';\n}", "function oxy_move_slideshow_meta_box()\n{\n remove_meta_box('postimagediv', 'oxy_slideshow_image', 'side');\n add_meta_box('postimagediv', __('Slideshow Image', 'lambda-admin-td'), 'post_thumbnail_meta_box', 'oxy_slideshow_image', 'advanced', 'low');\n}", "public function htheme_imgcarousel_element(){\r\n\r\n\t\t//SETUP VC MAP\r\n\t\tvc_map(\r\n\t\t\tarray(\r\n\t\t\t\t\"name\" => esc_html__( \"Basic Image Carousel\", \"js_composer\" ),\r\n\t\t\t\t\"base\" => \"htheme_imgcarousel_slug\",\r\n\t\t\t\t\"class\" => \"\",\r\n\t\t\t\t'icon' => 'htheme_imgcarousel_icon',\r\n\t\t\t\t\"category\" => esc_html__( \"WooCommerce\", \"js_composer\"),\r\n\t\t\t\t'description' => esc_html__( \"Add an image carousel to your site.\", \"js_composer\" ),\r\n\t\t\t\t\"params\" => array(\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\"type\" => \"attach_images\",\r\n\t\t\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\t\t\"class\" => \"htheme_element_class\",\r\n\t\t\t\t\t\t\"heading\" => esc_html__( \"Images\", \"js_composer\" ),\r\n\t\t\t\t\t\t\"param_name\" => \"htheme_imgcarousel_images\",\r\n\t\t\t\t\t\t\"value\" => __( \"\", \"js_composer\" ),\r\n\t\t\t\t\t\t\"description\" => esc_html__( \"Add multiple images for you image carousel.\", \"js_composer\" )\r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\"type\" => \"dropdown\",\r\n\t\t\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\t\t\"class\" => \"htheme_element_class\",\r\n\t\t\t\t\t\t\"heading\" => esc_html__( \"Image sizing\", \"js_composer\" ),\r\n\t\t\t\t\t\t\"param_name\" => \"htheme_image_carousel_size\",\r\n\t\t\t\t\t\t\"value\" => array(\r\n\t\t\t\t\t\t\t'Contain' => 'contain',\r\n\t\t\t\t\t\t\t'Cover' => 'cover',\r\n\t\t\t\t\t\t\t'Auto' => 'auto'\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'std' => '',\r\n\t\t\t\t\t\t\"description\" => esc_html__( \"Choose the image sizing.\", \"js_composer\" ),\r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\"type\" => \"dropdown\",\r\n\t\t\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\t\t\"class\" => \"htheme_element_class\",\r\n\t\t\t\t\t\t\"heading\" => esc_html__( \"Layout\", \"js_composer\" ),\r\n\t\t\t\t\t\t\"param_name\" => \"htheme_image_carousel_layout\",\r\n\t\t\t\t\t\t\"value\" => array(\r\n\t\t\t\t\t\t\t'Full row carousel' => 'full_row',\r\n\t\t\t\t\t\t\t'Contained carousel' => 'contained_row'\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'std' => '',\r\n\t\t\t\t\t\t\"description\" => esc_html__( \"Choose the layout for your image carousel.\", \"js_composer\" ),\r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\"type\" => \"dropdown\",\r\n\t\t\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\t\t\"class\" => \"htheme_element_class\",\r\n\t\t\t\t\t\t\"heading\" => esc_html__( \"Carousel height\", \"js_composer\" ),\r\n\t\t\t\t\t\t\"param_name\" => \"htheme_image_carousel_height\",\r\n\t\t\t\t\t\t\"value\" => array(\r\n\t\t\t\t\t\t\t'100px' => 100,\r\n\t\t\t\t\t\t\t'200px' => 200,\r\n\t\t\t\t\t\t\t'300px' => 300,\r\n\t\t\t\t\t\t\t'400px' => 400,\r\n\t\t\t\t\t\t\t'500px' => 500,\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'std' => '',\r\n\t\t\t\t\t\t\"description\" => esc_html__( \"Set the height for your image carousel.\", \"js_composer\" ),\r\n\t\t\t\t\t),\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t}", "public function register_carousel_three_options ( $wp_customize ){\n\t $wp_customize->add_section( 'mytheme_options_three',\n\t \tarray(\n\t\t\t'title'=> __('Carousel Three Options', 'Claremont Theme'),\n\t\t\t'priority'=> 37, //Determines what order this appears in\n\t\t\t'capability'=> 'edit_theme_options', //Capability needed to tweak\n\t\t\t'description'=> __('Allows you to customize some example setting for Claremont Theme', 'Claremont Theme'),\n\t\t)\n\t );\n\n\t \t\t \n // =============================\n // = Image =\n // =============================\n\n\t \n\t $wp_customize->add_setting('mytheme_options_three[carousel_image_three]',\n\t\tarray(\n\t\t\t'default'=> get_template_directory_uri() . '/images/header/IMG_0932.JPG',\n\t\t\t'type' => 'option',\n\t\t\t'capability'=> 'edit_theme_options',\n\t\t)\n\t );\n\t \n\t $wp_customize->add_control ( new WP_Customize_Image_Control( $wp_customize,\n\t \t'mytheme_carousel_control_three',//Set a unique ID for the control\n\t\tarray(\n\t\t \n\t\t\t'label'=> __('Carousel image', 'Claremont Theme'),\n\t\t\t'section'=> 'mytheme_options_three',//ID of the section this control renders\n\t\t\t'settings'=>'mytheme_options_three[carousel_image_three]',//ID of the setting\n\t\t\t)\t\t\t\t\t \n\t ));\n \n // =============================\n // = Title =\n // =============================\n\t $wp_customize->add_setting('mytheme_options_three[carousel_title_three]',\n\t\tarray(\n\t\t\t'default'=> 'Default Title',\n\t\t\t'type' => 'option',\n\t\t\t'capability'=> 'edit_theme_options',\n\t\t)\n\t );\n\t\t\t \n\t $wp_customize->add_control ( new WP_Customize_Control( $wp_customize,\n\t \t'mytheme_carousel_title_three',//Set a unique ID for the control\n\t\tarray(\n\t\t \n\t\t\t'label'=> __('Carousel title', 'Claremont Theme'),\n\t\t\t'type'=>'text',\n\t\t\t'section'=> 'mytheme_options_three',//ID of the section this control renders\n\t\t\t'settings'=>'mytheme_options_three[carousel_title_three]',//ID of the setting\n\t\t\t)\t\t\t\t\t \n\t ));\n \n // =============================\n // = TextArea =\n // =============================\n\t $wp_customize->add_setting('mytheme_options_three[carousel_textarea_three]',\n\t\tarray(\n\t\t\t'default'=> 'Place text here.',\n\t\t\t'type' => 'option',\n\t\t\t'capability'=> 'edit_theme_options',\n\t\t)\n\t );\n\t \n\t $wp_customize->add_control ( new Example_Customize_Textarea_Control( $wp_customize,\n\t \t'mytheme_carousel_textarea_three',//Set a unique ID for the control\n\t\tarray(\n\t\t \n\t\t\t'label'=> __('Carousel textarea', 'Claremont Theme'),\n\t\t\t'section'=>'mytheme_options_three',//ID of the section this control renders\n\t\t\t'settings'=>'mytheme_options_three[carousel_textarea_three]',//ID of the setting\n\t\t\t)\t\t\t\t\t \n\t ));\n\t \n\t \n // =============================\n // = Page Dropdown =\n // ============================\n\t $wp_customize->add_setting('mytheme_options_three[carousel_pagelink_three]',\n\t \tarray(\n\t\t\t'capability'=>'edit_theme_options',\n \t\t'type'=>'option',\n\t\t));\n\n\t $wp_customize->add_control('mytheme_carousel_pagelink_three', array(\n \t'label'=> __('Carousel page link', 'Claremont Theme'),\n \t'section'=> 'mytheme_options_three',\n \t'type' => 'dropdown-pages',\n \t'settings' => 'mytheme_options_three[carousel_pagelink_three]',\n\t\t));\n\n\n // =============================\n // = Pagelink Title =\n // =============================\n\t $wp_customize->add_setting('mytheme_options_three[carousel_pagelink_title_three]',\n\t\tarray(\n\t\t\t'default'=> 'Button Three Title',\n\t\t\t'type' => 'option',\n\t\t\t'capability'=> 'edit_theme_options',\n\t\t)\n\t );\n\n\t $wp_customize->add_control ( new WP_Customize_Control( $wp_customize,\n\t \t'mytheme_carousel_pagelinktitle_three',//Set a unique ID for the control\n\t\tarray(\n\t\t \n\t\t\t'label'=> __('Carousel page link title', 'Claremont Theme'),\n\t\t\t'type'=>'text',\n\t\t\t'section'=> 'mytheme_options_three',//ID of the section this control renders \n\t\t\t'settings'=>'mytheme_options_three[carousel_pagelink_title_three]',//ID of the setting\n\t\t\t)\t\t\t\t\t \n\t ));\n }", "function _portfolio_carousel( $options )\n\t{\n\t\n\t\t\n\t\t$element_size = zn_get_size( $options['_sizer'] );\n\t\n\t\twp_reset_query();\n\t\tglobal $post;\n\n\t\t\n\t\t$posts_per_page = isset($options['ports_per_page']) ? $options['ports_per_page'] : '4'; // how many posts\n\n\t\t$query = array(\n\t\t\t'post_type' => 'portfolio',\n\t\t\t'paged' => (get_query_var('paged')) ? get_query_var('paged') : 1,\n\t\t\t'posts_per_page' => $posts_per_page,\n\t\t\t'tax_query' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'taxonomy' => 'project_category',\n\t\t\t\t\t'field' => 'id',\n\t\t\t\t\t'terms' => $options['portfolio_categories']\n\t\t\t\t)\n\t\t\t),\n\t\t\t'showposts' => $options['ports_per_page_visible']\n\t\t);\n\n\n\n\n\t\t// Start the query\n\t\tquery_posts( $query );\n\t\t$i = 1;\n\n\t\t?>\n\t\t\t\t\t\t<div class=\"span12\">\n\t\t\t\t\t\t\t<div class=\"row hg-portfolio-carousel\">\n\n\t\t\t\t\t\t\t<?php if ( have_posts() ): while ( have_posts() ): the_post(); \n\t\t\t\t\t\t\t\t// Get post meta information\n\t\t\t\t\t\t\t\t$post_meta_fields = get_post_meta($post->ID, 'zn_meta_elements', true);\n\t\t\t\t\t\t\t\t$post_meta_fields = maybe_unserialize( $post_meta_fields );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<div class=\"span6\">\n\t\t\t\t\t\t\t\t\t<div class=\"ptcontent\">\n\t\t\t\t\t\t\t\t\t\t<h3 class=\"title\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"<?php the_permalink(); ?>\"><span class=\"name\"><?php the_title(); ?></span></a>\n\t\t\t\t\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t\t\t\t\t<div class=\"pt-cat-desc\">\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\tif ( preg_match('/<!--more(.*?)?-->/', $post->post_content) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tthe_content('');\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tthe_excerpt();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t</div><!-- end item desc -->\n\t\t\t\t\t\t\t\t\t\t<div class=\"itemLinks\">\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\tif ( !empty ( $post_meta_fields['sp_link']['url'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '<span><a href=\"'.$post_meta_fields['sp_link']['url'].'\" target=\"'.$post_meta_fields['sp_link']['target'].'\" >'.__(\"Live Preview: \",THEMENAME).'<strong>'.$post_meta_fields['sp_link']['url'].'</strong></a></span>';\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"seemore\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"<?php the_permalink(); ?>\" ><?php _e('See more &rarr;',THEMENAME);?></a>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</div><!-- end item links -->\n\t\t\t\t\t\t\t\t\t</div><!-- end item content -->\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"span6\">\n\t\t\t\t\t\t\t\t\t<div class=\"ptcarousel\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"controls\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"#\" class=\"prev\"><span class=\"icon-chevron-left icon-white\"></span></a>\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"#\" class=\"next\"><span class=\"icon-chevron-right icon-white\"></span></a>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<ul class=\"ptcarousel1\">\n\t\t\t\t\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\t\t\t\t\t\tif ( !empty ( $post_meta_fields['port_media'] ) && is_array( $post_meta_fields['port_media'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $post_meta_fields['port_media'] as $media ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// COMBINED\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !empty ( $media['port_media_image_comb'] ) && !empty ( $media['port_media_video_comb'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<li>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"'.$media['port_media_video_comb'].'\" rel=\"prettyPhoto\" data-type=\"image\">';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$size = zn_get_size( 'eight');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$image = vt_resize( '', $media['port_media_image_comb'] , $size['width'],$size['height'] , true );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<img src=\"'.$image['url'].'\" width=\"'.$image['width'].'\" height=\"'.$image['height'].'\" alt=\"'.get_the_title().'\" />';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '</a>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '</li>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// IMAGE\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telseif ( !empty ( $media['port_media_image_comb'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<li>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"'.$media['port_media_image_comb'].'\" data-type=\"image\" rel=\"prettyPhoto\">';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$size = zn_get_size( 'eight' );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$image = vt_resize( '', $media['port_media_image_comb'] , $size['width'],$size['height'] , true );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<img src=\"'.$image['url'].'\" width=\"'.$image['width'].'\" height=\"'.$image['height'].'\" alt=\"'.get_the_title().'\" />';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '</a>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '</li>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// VIDEO\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telseif ( !empty ( $media['port_media_video_comb'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<li>';\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$size = zn_get_size( 'eight' );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo get_video_from_link( $media['port_media_video_comb'] , '' , $size['width'] , $size['height'] );\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '</li>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t</div><!-- end ptcarousel -->\n\t\t\t\t\t\t\t\t</div>\n\n\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ( $i % $options['ports_per_page_visible'] != 0 ) {\n\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"span12\"><hr class=\"bs-docs-separator\"></div>';\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t?>\n\n\n\t\t\t\t\t\t\t<?php endwhile; ?>\n\t\t\t\t\t\t\t<?php endif; ?>\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</div><!-- end portfolio layout -->\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\techo '<div class=\"clear\"></div>';\n\t\t\t\t\t\t\t\techo '<div class=\"span12\" >';\n\t\t\t\t\t\t\t\t\tzn_pagination(); \n\t\t\t\t\t\t\t\t\twp_reset_query();\n\t\t\t\t\t\t\t\techo '</div>';\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</div>\n\t\t<?php\n\n\t}", "public function add_meta_boxes() {\n add_meta_box( 'wc-product-label-gallery', __( 'Label gallery', 'wc-label-gallery' ), array( $this, 'gallery_output' ), 'product', 'side', 'low' );\n }", "function mobile_kiosk_add_post_meta_boxes() {\n\t\n\t// Gallery Options\n\tadd_meta_box(\n\t\t'gallery-options',\n\t\tesc_html__( 'Gallery Options', 'gallery-options' ),\n\t\t'mobile_kiosk_gallery_options_meta_box', \n\t\t'kioskgallery', \n\t\t'normal', \n\t\t'high' \n\t);\n\t\n\t// Gallery Slides\n\tadd_meta_box(\n\t\t'gallery-slides',\n\t\tesc_html__( 'Gallery Slides', 'gallery-slides' ),\n\t\t'mobile_kiosk_gallery_slides_meta_box', \n\t\t'kioskgallery', \n\t\t'normal', \n\t\t'low' \n\t);\n\t\n}", "public function create_meta_box() {\n\t\tadd_meta_box( 'slider_meta', 'Example metabox', array( $this, 'slider_meta_fields_callback' ), [ 'Page', 'post' ] );\n\n\t}", "function portfolioism_add_custom_metabox() {\n add_meta_box(\n 'portfolioism_meta',\n 'Artwork',\n 'portfolioism_meta_callback',\n 'artwork'\n );\n }", "function _sp_custom_box_carousel_shortcode( $post ) {\n\n\t$output = '';\n\n\t$output .= '<div class=\"settings-container\">' . PHP_EOL;\t\n\t$output .= sp_get_slider_shortcode( $post->ID ) . PHP_EOL;\n\t$output .= '<p class=\"howto\">' . __( 'Paste this shortcode on the page you want this carousel slider to show.', 'sp-theme' ) . '</p>' . PHP_EOL;\t\n\t$output .= '</div>' . PHP_EOL;\n\n\techo $output;\n}", "function igv_cmb_metaboxes() {\n\t$prefix = '_igv_';\n\n\t/**\n\t * Metaboxes declarations here\n * Reference: https://github.com/WebDevStudios/CMB2/blob/master/example-functions.php\n\t */\n\n\n\n $show_meta = new_cmb2_box( array(\n 'id' => $prefix . 'show_meta',\n 'title' => esc_html__( 'Show Metadata', 'cmb2' ),\n 'object_types' => array( 'show', ), // Post type\n // 'show_on_cb' => 'yourprefix_show_if_front_page', // function should return a bool value\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 // 'classes' => 'extra-class', // Extra cmb2-wrap classes\n // 'classes_cb' => 'yourprefix_add_some_classes', // Add classes through a callback.\n ) );\n\n $show_meta->add_field( array(\n 'name' => 'Cover photo',\n 'desc' => 'Upload an image or enter an URL.',\n 'id' => $prefix . 'cover_photo',\n 'type' => 'file',\n // Optional:\n 'options' => array(\n 'url' => false, // Hide the text input for the url\n ),\n 'text' => array(\n 'add_upload_file_text' => 'Add Cover Photo' // Change upload button text. Default: \"Add or Upload File\"\n ),\n ) );\n\n $show_meta->add_field( array(\n 'name' => __( 'Youtube playlist ID', 'cmb2' ),\n 'id' => $prefix . 'playlist_id',\n 'type' => 'text',\n ));\n\n $show_meta->add_field( array(\n 'name' => __( 'Youtube playlist link', 'cmb2' ),\n 'id' => $prefix . 'playlist_link',\n 'type' => 'text',\n ));\n\n $show_meta->add_field( array(\n 'name' => __( 'Tracklist', 'cmb2' ),\n 'id' => $prefix . 'tracklist',\n 'type' => 'wysiwyg',\n ));\n\n $show_meta->add_field( array(\n 'name' => __( 'Episode #', 'cmb2' ),\n 'id' => $prefix . 'episode_number',\n 'type' => 'text',\n 'attributes' => array(\n 'pattern' => '\\d*',\n ),\n ));\n\n}", "function add_images_meta_box($post) {\n $images = get_post_meta($post->ID, 'imagegallery_images', true);\n\t$count = 1;\n\tif (!empty($images) ) {\n\t\tforeach($images as $image) {\n\t\t\toutput_image_add_box($count++, $image);\n\t\t}\n\t}\n\techo '<div id=\"admin-list-end-marker\" style=\"clear: both;\"></div><a rel=\"image\" href=\"#\" id=\"add-admin-list\" name=\"add-admin-list\">Add Images</a>';\n}", "function _carousel_shortcode_info(&$shortcodes) {\n\t$shortcodes['carousel'] = array(\n\t\t'title' => t('Carousel'),\n\t\t'description' => t('Create a Carousel of items with captions'),\n\t\t'process callback' => 'art_shortcode_carousel',\n\t\t'tips callback' => 'art_shortcode_carousel_tip',\n\t);\n\t\n\t$shortcodes['carousel_item'] = array(\n\t\t'title' => t('Carousel Item'),\n\t\t'description' => t('Create a carousel item to go inside a carousel'),\n\t\t'process callback' => 'art_shortcode_carousel_item',\n\t\t'tips callback' => 'art_shortcode_carousel_item_tip',\n\t);\n\t\n\t\n\treturn $shortcodes;\n}", "function coolRahulSoni_meta_box_add()\n{\n add_meta_box( 'my-meta-box-id', 'My First Meta Box', 'cd_meta_box_cb', 'post', 'normal', 'high' );\n}", "function bnk_create_slide_metabox() {\r\n\tglobal $slide_meta;\r\n \r\n\tadd_meta_box($slide_meta['id'], $slide_meta['title'], 'bnk_build_slide_metabox', $slide_meta['page'], $slide_meta['context'], $slide_meta['priority']);\r\n}", "function pg_add_custom_box() {\r\n\tif( function_exists( 'add_meta_box' )) {\r\n\t\tadd_meta_box( 'pg_custom_box_1', __( 'Edit Photocrati Galleries / Albums', 'photocrati' ), 'pg_inner_custom_box_1', 'page', 'normal', 'high' );\r\n\t\tadd_meta_box( 'pg_custom_box_2', __( 'Edit Photocrati Galleries / Albums', 'photocrati' ), 'pg_inner_custom_box_1', 'post', 'normal', 'high' );\r\n\t}\r\n}", "function my_meta_init()\n{\n // http://codex.wordpress.org/Function_Reference/wp_enqueue_script\n // http://codex.wordpress.org/Function_Reference/wp_enqueue_style\n \n //wp_enqueue_script('my_meta_js', MY_THEME_PATH . '/custom/meta.js', array('jquery'));\n wp_enqueue_style('my_meta_css', MY_THEME_PATH . '/custom/shop-meta.css');\n \n // review the function reference for parameter details\n // http://codex.wordpress.org/Function_Reference/add_meta_box\n \n // add a meta box for each of the wordpress page types: posts and pages\n foreach (array('product') as $type) \n {\n add_meta_box('my_all_meta', 'Prezzo e Descrizione Prodotto', 'my_meta_setup', $type, 'normal', 'high');\n }\n \n // add a callback function to save any data a user enters in\n add_action('save_post','my_meta_save');\n}", "function add_meta_box_horse_gallery() {\n\tglobal $meta_box_portfolio_images;\n\tadd_meta_box($meta_box_portfolio_images['id'], $meta_box_portfolio_images['title'], 'meta_box_horse_gallery', $meta_box_portfolio_images['page'], $meta_box_portfolio_images['context'], $meta_box_portfolio_images['priority']);\n}", "function civ_meta_box() {\n\n\tadd_meta_box( 'my box', 'Civ Slider','show_my_meta_box', 'post' );\n\n\tfunction show_my_meta_box( $post ) {\n\t\t//\tThis will count the amount of slides total to insert for the slide order .\n\t\t\n\t\tglobal $wpdb;\n\t\t$table_name = $wpdb->prefix . 'civ_slider';\n\t\t$row_count = $wpdb->get_var( 'select count(*) from $table_name' );\n\t\t$slide_count = $row_count + 1;\n\t\t$post_id_check = $post->ID;\n\n\t\t$box_check = $wpdb->get_row($wpdb->prepare(\"select * from $table_name where post_id=%d\", $post_id_check));\n?>\n\t<form method=\"post\" >\n\t\t<label>Check here to add post to homepage slider: </label>\n\t\t<input type=\"checkbox\" name=\"chkd\" <?php if($box_check != null ){echo \"checked\";} ?> />\n\t\t<input type=\"hidden\" value=\"<?php echo $post->ID; ?>\" name=\"post_id\" />\n\t\t<input type=\"hidden\" value=\"<?php echo $slide_count; ?>\" name=\"slide_order\" />\n\t</form>\n\t\t<?php\n\t}\n}", "function tg_add_product_gallery_metabox() { \n\t// More info about arguments in the WP Codex\n\tadd_meta_box(\n\t\t'product_gallery', // Name of the box\n\t\t'Gallery', // Title of the box\n\t\t'tg_product_gallery_metabox', // The metabox html function \n\t\t'post', // SET TO THE POST TYPE WHERE THE METABOX IS SHOWN\n\t\t'normal', // Specifies where the box is shown\n\t\t'high' // Specifies where the box is shown\n\t); \n}", "function tg_product_gallery_metabox() {\n\tglobal $post;\n\t// Here we get the current images ids of the gallery\n\t$values = get_post_custom($post->ID);\n\tif(isset($values['product_gallery'])) {\n\t\t// The json decode return an array of image ids\n\t\t$ids = json_decode($values['product_gallery'][0]);\n\t}else {\n\t\t$ids = array();\n\t}\n\t//wp_nonce_field('my_meta_box_nonce', 'post_gallery_meta_box_nonce'); // Security\n\techo '<input type=\"hidden\" name=\"post_gallery_meta_box_nonce\" value=\"', wp_create_nonce(basename(__FILE__)), '\" />';\n\t// Implode the array to a comma separated list\n\t$cs_ids = implode(\",\", $ids); \n\t// We display the gallery\n\t$html = do_shortcode('[gallery ids=\"'.$cs_ids.'\"]');\n\t// Here we store the image ids which are used when saving the product\n\t$html .= '<input id=\"product_gallery_ids\" type=\"hidden\" name=\"product_gallery_ids\" value=\"'.$cs_ids. '\" />';\n\t// A button which we will bind to later on in JavaScript\n\t$html .= '<div class=\"clear_div\">';\n\t$html .= '<input id=\"manage_gallery\" title=\"Manage gallery\" type=\"button\" value=\"Manage gallery\" class=\"button-primary button-large\" />';\n\tif(!empty($cs_ids))\t{\n\t\t$html .= '&nbsp;&nbsp;<input id=\"remove_gallery\" title=\"Remove gallery\" type=\"button\" value=\"Remove gallery\" class=\"remove_gallery\" />';\n\t\t$html .= '</div>';\n\t}else{\n\t\t$html .= '&nbsp;&nbsp;<input id=\"remove_gallery\" title=\"Remove gallery\" type=\"button\" value=\"Remove gallery\" \n\t\tclass=\"remove_gallery\" style=\"display:none;\" />';\n\t\t$html .= '</div>';\t\t\n\t}\t\n\techo $html;\n}" ]
[ "0.7375599", "0.68776506", "0.6871126", "0.6775046", "0.6683653", "0.66329354", "0.65745693", "0.6563255", "0.6533238", "0.6505103", "0.6492187", "0.6485759", "0.6443125", "0.64393926", "0.64239436", "0.64022046", "0.64015126", "0.64001495", "0.63472784", "0.633952", "0.63312805", "0.6329049", "0.6320016", "0.6308016", "0.6306805", "0.6268367", "0.6258679", "0.6256021", "0.6246652", "0.6217439" ]
0.7247765
1
Tries to determine ID of the current user's language by using cookies or browser language
public static function run() { // We are looking for language in the user's cookie if (isset($_COOKIE['x-language-id'])) { $isset = LangHelper::getLanguageByParam('id', $_COOKIE['x-language-id']); if ($isset !== null) { return $isset['id']; } } // Let's look at the language of the browser if (getenv('HTTP_ACCEPT_LANGUAGE')) { $arr = explode(';', getenv('HTTP_ACCEPT_LANGUAGE')); foreach ($arr as $val) { $val = preg_replace("/^q=[\d\.]+,?/", '', $val); $isset = LangHelper::getLanguageByParam('locale', substr($val, 0, 2)); if ($isset !== null) { return $isset['id']; } } } // Default language $lang_id = LangHelper::getLanguage('id'); if ($lang_id !== null) { return $lang_id; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getLanguageId()\n {\n $languageId = \"\";\n if (isset($_SESSION['Shopware'][\"Auth\"]->localeID) && $_SESSION['Shopware'][\"Auth\"]->localeID != \"\") {\n $languageId = $_SESSION['Shopware'][\"Auth\"]->localeID;\n }\n return $languageId;\n }", "function common_current_language(){\r\n\tif($_SESSION['lang'] == 'id'){\r\n\t\treturn 'Bahasa Indonesia';\r\n\t}\r\n\telse if($_SESSION['lang'] == 'en'){\r\n\t\treturn 'English';\r\n\t}\r\n}", "private static function getLanguage()\n {\n if (isset($_COOKIE[\"language\"]))\n {\n return $_COOKIE[\"language\"];\n }\n else\n {\n // Default is Czech\n return \"cs\";\n }\n }", "protected function getLanguage()\n {\n $lang = 1;\n try {\n $lang = Registry::get('lang');\n } catch (\\Exception $e) {\n if (!empty($_SESSION['lang'])) {\n $lang = $_SESSION['lang'];\n }\n\n if (!empty($this->user->languageId)) {\n $lang = $this->user->languageId;\n }\n\n $this->setLanguage($lang);\n }\n\n return $lang;\n }", "private function get_language ()\n {\n $lang = filter_input ( INPUT_COOKIE, 'lang', FILTER_CALLBACK, [ 'options' => [ $this, 'filter_lang' ] ] );\n\t$new_lang = filter_input ( INPUT_GET, 'lang', FILTER_CALLBACK, [ 'options' => [ $this, 'filter_lang' ] ] );\n\tif ( $new_lang ) {\n\t\t$lang = $new_lang;\n\t\tsetcookie( \"lang\", substr ( $lang, 0, 2 ), time() + 3600 * 24 * 365, '/' );\n\t}\n\t\n\treturn $lang ?? 'uk';\n }", "function getSessionLanguage()\n {\n\n // define all the global variables\n global $user;\n\n // check if its a user or guest session\n if ($this->logged_in()) { // user session\n\n // grab the users preferred language\n $language = $user->getPreferredLanguage();\n\n } else { // guest session\n\n // check if any cookies were to be found for a custom language\n if (isset($_COOKIE['language'])) {\n $language = $_COOKIE['language'];\n } else {\n $language = \"\";\n }\n }\n\n // check if $language has been initialized or not\n if (is_string($language) && $language != \"\") {\n return $language; // if no errors then return the language string\n } else {\n return false; // if no language, then just return false\n }\n }", "function getLang() {\n\tif (request()->cookie(config('translate.su_cookie_name'))) {\n\t\t$cookie = request()->cookie(config('translate.su_cookie_name'));\n\t} else {\n\t\tif (request()->cookie(config('translate.cookie_name'))) {\n\t\t\t$cookie = request()->cookie(config('translate.cookie_name'));\n\t\t} else {\n\t\t\tif (substr(request()->server('HTTP_ACCEPT_LANGUAGE'), 0, 2)) {\n\t\t\t\t$cookie = substr(request()->server('HTTP_ACCEPT_LANGUAGE'), 0, 2);\n\t\t\t} else {\n\t\t\t\t$cookie = config('translate.default_locale');\n\t\t\t}\n\t\t}\n\t}\n\treturn $cookie;\n}", "public function getLanguageIdentifier();", "public function get_language()\n\t{\n\t\tif ($this->userdata['language'] != '')\n\t\t{\n\t\t\treturn $this->userdata['language'];\n\t\t}\n\t\tif (ee()->input->cookie('language'))\n\t\t{\n\t\t\treturn ee()->input->cookie('language');\n\t\t}\n\t\telse if (ee()->config->item('deft_lang') != '')\n\t\t{\n\t\t\treturn ee()->config->item('deft_lang');\n\t\t}\n\n\t\treturn 'english';\n\t}", "public function getCookieLanguage()\n {\n return isset($_COOKIE['lang']) ? $_COOKIE['lang'] : null;\n }", "protected function _extractLanguage() {\n // Default lanuage is always Lao\n $lang = 'lo';\n\n // Set the cookie name\n //$this->Cookie->name = '_osm_la';\n //echo $this->response->cookie(\"_osm_la\");\n \n // First check if the language parameter is set in the URL. The URL\n // parameter has first priority.\n $paramLang = $this->request->query(\"lang\");\n if (isset($paramLang)) {\n // Check if the URL parameter is a valid language identifier\n if (array_key_exists($paramLang, $this->_languages)) {\n // Set the language to the URL parameter\n $lang = $paramLang;\n }\n } else if ($this->Cookie->read($this->_languageCookie) != null) {\n // Check if a cookie is set and set its value as language. A Cookie\n // has second priority\n $cookieValue = $this->Cookie->read($this->_languageCookie);\n // Check if the URL parameter is a valid language identifier\n if (array_key_exists($cookieValue, $this->_languages)) {\n // Set the language to the Cookie value\n $lang = $cookieValue;\n }\n }\n\n // If neither the lang parameter nor a cookie is set, set and return\n // Lao as language.\n //$this->log(var_dump($this));\n //$this->response->cookie($this->_languageCookie => $lang ]);\n return $lang;\n }", "public function get_current_lang() {\n return \\Drupal::languageManager()->getCurrentLanguage()->getId();\n }", "function pnUserGetLang()\r\n{\r\n $lang = pnSessionGetVar('lang');\r\n if (!empty($lang)) {\r\n return $lang;\r\n } else {\r\n return pnConfigGetVar('language');\r\n }\r\n}", "function get_current_language() {\n $ci = & get_instance();\n if ($ci->session->userdata('lang')) {\n return $ci->session->userdata('lang');\n } else {\n return DEF_LANGUAGE;\n }\n}", "function findLanguage() {\n\t\tif ((LANGUAGE == 'NULL') || (LANGUAGE === NULL)) {\n\t\t\treturn null;\n\t\t}\n\t\t/*\n\t\t\t\tif (isset ($this->Session)) {\n\t\t\t\t\t$code= $this->Session->read('Lang.Code');\n\t\t\t\t\tif (isset ($code) && !empty ($code)) {\n\t\t\t\t\t\treturn $code;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t*/\n\t\tif (LANGUAGE == 'VHOST') {\n\t\t\t$l= $this->getVhostLang();\n\t\t\tif (empty ($l)) {\n\t\t\t\t$l= $this->getBrowserLang();\n\t\t\t}\n\t\t\treturn $l;\n\t\t}\n\t\tif (LANGUAGE == 'BROWSER') {\n\t\t\treturn $this->getBrowserLang();\n\t\t}\n\t\treturn LANGUAGE;\n\t}", "public static function getLanguage()\r\n {\r\n return session()->get(self::$sessLanguageKey);\r\n }", "function get_lang ()\r\n {\r\n return $_SESSION[\"lang\"];\r\n }", "public static function getLang(){\n\t\tif(!isset(self::$_config['lang'])) return null;\n\t\telse return $_COOKIE['lang'];\n\t}", "function getCurrentLanguage() {\n if(strtolower($_SERVER['HTTP_HOST'][0].$_SERVER['HTTP_HOST'][1]) == \"en\") {\n return \"en\";\n }\n return \"cs\";\n}", "public static function getUserLocale()\n {\n $lang_id = Auth::user()->lang_id;\n $locale = ($lang_id == 1) ? 'en' : 'ar';\n Session::put('locale', $locale);\n return $locale;\n }", "private function _makeSureThereIsALanguageID()\n {\n if (empty(Session::get('languageID'))) {\n if (strstr(URL::getDomainExtension(), 'localhost')\n || strstr(URL::getDomainExtension(), 'nl')\n ) {\n Session::save('languageID', 1);\n } elseif (strstr(URL::getDomainExtension(), 'com')) {\n Session::save('languageID', 2);\n }\n }\n }", "public function getLanguageId()\n {\n return $this->language_id;\n }", "public function getLangId()\n {\n return $this->lang_id;\n }", "private function _getUserLanguage(): string\n {\n /** @var WebApplication|ConsoleApplication $this */\n // If the user is logged in *and* has a primary language set, use that\n if ($this instanceof WebApplication) {\n // Don't actually try to fetch the user, as plugins haven't been loaded yet.\n $session = $this->getSession();\n $id = $session->getHasSessionId() || $session->getIsActive() ? $session->get($this->getUser()->idParam) : null;\n if ($id && ($language = $this->getUsers()->getUserPreference($id, 'language')) !== null) {\n return $language;\n }\n }\n\n // Fall back on the default CP language, if there is one, otherwise the browser language\n return Craft::$app->getConfig()->getGeneral()->defaultCpLanguage ?? $this->_getFallbackLanguage();\n }", "public function getCurrentLanguage() {\n return $this->ci->session->userdata(\"language\");\n }", "public static function getLanguage() {\n\t\tglobal $current_user, $default_language;\n\t\tif (!empty($current_user) && !empty($current_user->column_fields['language'])) {\n\t\t\treturn $current_user->column_fields['language'];\n\t\t}\n\t\t// Fallback : Read the Accept-Language header of the request (really useful for login screen)\n\t\tif (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n\t\t\t//Getting all languages in an array\n\t\t\t$languages = Vtiger_LanguageExport::getAll();\n\t\t\t//Extracting locales strings from header\n\t\t\tpreg_match_all(\"/([a-z-]+)[,;]/i\", $_SERVER['HTTP_ACCEPT_LANGUAGE'], $locales);\n\t\t\t//Looping in found locales and test match against languages\n\t\t\tforeach ($locales[1] as $locale) {\n\t\t\t\tforeach ($languages as $code => $lang) {\n\t\t\t\t\t//First case insensitive comparison\n\t\t\t\t\tif (strcasecmp($code, $locale) === 0) {\n\t\t\t\t\t\treturn $code;\n\t\t\t\t\t}\n\t\t\t\t\t//Second case with replacing '-' by '_'\n\t\t\t\t\tif (strcasecmp($code, str_replace('-', '_', $locale)) === 0) {\n\t\t\t\t\t\treturn $code;\n\t\t\t\t\t}\n\t\t\t\t\t//Finally, try with short 2 letters country code\n\t\t\t\t\tif (strcasecmp(substr($code, 0, 2), $locale) === 0) {\n\t\t\t\t\t\treturn $code;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Last fallback : global configuration\n\t\treturn $default_language;\n\t}", "public function getLanguageId()\n\t{\n\t\tif( isset( $this->values[$this->prefix . 'languageid'] ) ) {\n\t\t\treturn (string) $this->values[$this->prefix . 'languageid'];\n\t\t}\n\n\t\treturn null;\n\t}", "public function getLanguageID()\n {\n return $this->languageID;\n }", "public function getLanguageID()\n {\n return $this->languageID;\n }", "public function getLanguageId()\n {\n return $this->getValue('nb_language_id');\n }" ]
[ "0.8108536", "0.7595774", "0.7449701", "0.7379859", "0.73620707", "0.7302966", "0.72833157", "0.7271093", "0.7148458", "0.70471257", "0.70351607", "0.70329005", "0.70298284", "0.7029382", "0.6996994", "0.69765896", "0.6961427", "0.69582677", "0.69292504", "0.6906385", "0.68760127", "0.6860402", "0.68175673", "0.68118143", "0.6786108", "0.6764345", "0.67444533", "0.6729629", "0.6729629", "0.6718495" ]
0.7636853
1
Specify data which should be serialized to JSON. Includes all public properties by default plus data from properties array.
public function jsonSerialize() { $publicProperties = get_object_vars($this); unset($publicProperties['properties']); return array_merge($publicProperties, $this->getPropertiesField()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function jsonSerialize()\n {\n $json = array();\n $json['persons'] = $this->persons;\n $json['companies'] = $this->companies;\n\n return array_merge($json, $this->additionalProperties);\n }", "public function jsonSerialize()\n {\n $json = array();\n $json['Name'] = $this->name;\n $json['MvaNumber'] = $this->mvaNumber;\n $json['CompanyPhone'] = $this->companyPhone;\n $json['CompanyEmail'] = $this->companyEmail;\n $json['Id'] = $this->id;\n $json['CustomerNumber'] = $this->customerNumber;\n $json['Resources'] = $this->resources;\n $json['CompanyUrl'] = $this->companyUrl;\n $json['Contact'] = $this->contact;\n $json['Address'] = $this->address;\n $json['Dealer'] = $this->dealer;\n $json['Settings'] = $this->settings;\n $json['Country'] = $this->country;\n\n return array_merge($json, $this->additionalProperties);\n }", "public function jsonSerialize()\n {\n $json = array();\n $json['beslutningField'] = $this->beslutningField;\n $json['arsaksDataField'] = $this->arsaksDataField;\n $json['scoreField'] = $this->scoreField;\n $json['grenseAvslagField'] = $this->grenseAvslagField;\n $json['grenseGodkjentField'] = $this->grenseGodkjentField;\n\n return array_merge($json, $this->additionalProperties);\n }", "public function jsonSerialize()\n {\n $json = array();\n $json['totalRecords'] = $this->totalRecords;\n $json['totalPages'] = $this->totalPages;\n $json['pageNumber'] = $this->pageNumber;\n $json['numberOfRecordsPerPage'] = $this->numberOfRecordsPerPage;\n $json['applications'] = $this->applications;\n\n return array_merge($json, $this->additionalProperties);\n }", "public function jsonSerialize()\n {\n $json = array();\n $json['MvaNumber'] = $this->mvaNumber;\n $json['Prokura'] = $this->prokura;\n $json['Signature'] = $this->signature;\n $json['Report'] = $this->report;\n\n return array_merge($json, $this->additionalProperties);\n }", "public function jsonSerialize()\n {\n $json = array();\n $json['id'] = $this->id;\n $json['amount'] = $this->amount;\n $json['postedDate'] = $this->postedDate;\n $json['description'] = $this->description;\n $json['memo'] = $this->memo;\n $json['normalizedPayee'] = $this->normalizedPayee;\n $json['institutionTransactionId'] = $this->institutionTransactionId;\n $json['category'] = $this->category;\n $json['type'] = $this->type;\n\n return array_merge($json, $this->additionalProperties);\n }", "public function jsonSerialize() {\r\n\t\treturn $this->props;\r\n\t}", "public function serialize(PropertyHolder $data);", "public function jsonSerialize()\n {\n $json = array();\n $json['dialogs'] = $this->dialogs;\n $json['language'] = $this->language;\n $json['styling'] = $this->styling;\n\n return array_merge($json, $this->additionalProperties);\n }", "function jsonSerialize()\n {\n $data = $this->data;\n foreach ($this->config as $name => $c) {\n if (is_callable($c['serializer'])) {\n $data[$name] = call_user_func($c['serializer'], $data['name']);\n }\n }\n return $data;\n }", "public function jsonSerialize()\n {\n $json = array();\n $json['id'] = $this->id;\n $json['number'] = $this->number;\n $json['name'] = $this->name;\n $json['balance'] = $this->balance;\n $json['type'] = $this->type;\n $json['aggregationStatusCode'] = $this->aggregationStatusCode;\n $json['status'] = $this->status;\n $json['customerId'] = $this->customerId;\n $json['institutionId'] = $this->institutionId;\n $json['balanceDate'] = $this->balanceDate;\n $json['aggregationSuccessDate'] = $this->aggregationSuccessDate;\n $json['aggregationAttemptDate'] = $this->aggregationAttemptDate;\n $json['createdDate'] = $this->createdDate;\n $json['currency'] = $this->currency;\n $json['lastTransactionDate'] = $this->lastTransactionDate;\n $json['institutionLoginId'] = $this->institutionLoginId;\n $json['displayPosition'] = $this->displayPosition;\n\n return array_merge($json, $this->additionalProperties);\n }", "public function serializar() {\n\t return json_encode(get_object_vars($this), JSON_FORCE_OBJECT);\n\t\t}", "public function serializar() {\n\t return json_encode(get_object_vars($this), JSON_FORCE_OBJECT);\n\t\t}", "public function jsonSerialize(){\n if( ! $this->isPersisted() ){\n $properties = (object) get_object_vars($this);\n unset($properties->id);\n return $properties;\n }\n $properties = (object) get_object_vars($this);\n $properties->startUTC = $properties->startUTC->format('c');\n $properties->endUTC = $properties->endUTC->format('c');\n $properties->repeatEndUTC = !is_null($properties->repeatEndUTC) ? $properties->repeatEndUTC->format('c') : null;\n $properties->weeklyDays = is_null($properties->weeklyDays) ? array() :\n // All this does is cast the exploded values from strings to integers\n array_map(function($day){ return (int)$day; }, explode(',',$properties->weeklyDays));\n return $properties;\n }", "public function jsonSerialize()\n {\n return array_merge([\n 'settings' => $this->settings(),\n 'actions' => $this->actions(),\n 'columns' => $this->columns(),\n 'filters' => $this->filters(),\n 'cacheKey' => $this->generateCacheKey()\n ], parent::jsonSerialize());\n }", "public function jsonSerialize()\n {\n $json = array();\n $json['id'] = $this->id;\n $json['name'] = $this->name;\n $json['voa'] = $this->voa;\n $json['voi'] = $this->voi;\n $json['stateAgg'] = $this->stateAgg;\n $json['ach'] = $this->ach;\n $json['transAgg'] = $this->transAgg;\n $json['aha'] = $this->aha;\n $json['accountTypeDescription'] = $this->accountTypeDescription;\n $json['phone'] = $this->phone;\n $json['urlHomeApp'] = $this->urlHomeApp;\n $json['urlLogonApp'] = $this->urlLogonApp;\n $json['oauthEnabled'] = $this->oauth_Enabled;\n $json['urlForgotPassword'] = $this->urlForgotPassword;\n $json['urlOnlineRegistration'] = $this->urlOnlineRegistration;\n $json['class'] = $this->mclass;\n $json['specialText'] = $this->specialText;\n $json['specialInstructions'] = $this->specialInstructions;\n $json['address'] = $this->address;\n $json['currency'] = $this->currency;\n $json['email'] = $this->email;\n $json['status'] = $this->status;\n $json['newInstitutionId'] = $this->newInstitutionId;\n $json['branding'] = $this->branding;\n $json['oauthInstitutionId'] = $this->oauth_InstitutionId;\n\n return array_merge($json, $this->additionalProperties);\n }", "function jsonSerialize()\n\t{\n\t\treturn [\n\t\t\t'id' => $this->getId(),\n\t\t\t'metadata' => $this->getMetadata()\n\t\t];\n\t}", "public function jsonSerialize()\n {\n $json = array();\n $json['payFrequency'] = $this->payFrequency;\n\n return array_merge($json, $this->additionalProperties);\n }", "function jsonSerialize()\n {\n return Helper::serialize(get_object_vars($this));\n }", "public function toJSON() {\n return json_encode($this->data);\n }", "function jsonSerialize() {\n $data = array();\n if ($this->getStreet()) {\n $data[self::FIELDNAME_STREET] = $this->getStreet();\n }\n if ($this->getZip()) {\n $data[self::FIELDNAME_ZIP] = $this->getZip();\n }\n if ($this->getCity()) {\n $data[self::FIELDNAME_CITY] = $this->getCity();\n }\n if ($this->getCountry()) {\n $data[self::FIELDNAME_COUNTRY] = $this->getCountry();\n }\n if ($this->getCoordinate()) {\n $data[self::FIELDNAME_COORDINATE] = $this->getCoordinate();\n }\n return $data;\n }", "public function jsonSerialize() {\n\n return ['id' => $this->id,\n 'name' => $this->name,\n 'author' => $this->author,\n 'description' => $this->description];\n \n \n }", "public function jsonSerialize()\n {\n $json = array();\n $json['type'] = $this->type;\n $json['currentBalance'] = $this->currentBalance;\n $json['twoMonthAverage'] = $this->twoMonthAverage;\n $json['sixMonthAverage'] = $this->sixMonthAverage;\n $json['beginningBalance'] = $this->beginningBalance;\n\n return array_merge($json, $this->additionalProperties);\n }", "public function jsonSerialize()\n {\n }", "public function jsonSerialize()\n {\n }", "public function serialize()\n\t{\n\t\treturn json_encode(array(\n\t\t\t'data' => $this->data,\n\t\t\t'this' => $this->getArrayCopy(),\n\t\t\t'name' => $this->name,\n\t\t\t'merged' => $this->merged,\n\t\t));\n\t}", "public function jsonSerialize()\n {\n $json = array();\n $json['id'] = $this->id;\n $json['consumerId'] = $this->consumerId;\n $json['consumerSsn'] = $this->consumerSsn;\n $json['requesterName'] = $this->requesterName;\n $json['requestId'] = $this->requestId;\n $json['constraints'] = $this->constraints;\n $json['type'] = $this->type;\n $json['status'] = $this->status;\n $json['createdDate'] = $this->createdDate;\n\n return array_merge($json, $this->additionalProperties);\n }", "public function jsonSerialize()\n {\n $this->present();\n\n return $this->data;\n }", "public function jsonSerialize()\n {\n $json = array();\n $json['id'] = $this->id;\n $json['abbrvName'] = $this->abbrvName;\n $json['logoUrl'] = $this->logoUrl;\n $json['decryptionKeyActivated'] = $this->decryptionKeyActivated;\n $json['createdDate'] = $this->createdDate;\n $json['lastModifiedDate'] = $this->lastModifiedDate;\n $json['status'] = $this->status;\n\n return array_merge($json, $this->additionalProperties);\n }", "public function jsonSerialize()\n {\n return [\n 'emp_no' => $this->emp_no,\n 'birth_date' => $this->getCustomData('birth_date'),\n 'first_name' => $this->first_name,\n 'last_name' => $this->last_name,\n 'complet_name' => $this->first_name . ' ' . $this->last_name,\n 'gender' => $this->getGender(),\n 'hire_date' => $this->getCustomData('hire_date'),\n 'salary' => ($this->salary->salary) ?? 0,\n 'titles' => ($this->title->title) ?? '',\n 'departments' => (new DepartmentRepo())->getNames($this->departments)\n ];\n }" ]
[ "0.6588477", "0.64389616", "0.6410529", "0.63292783", "0.6321633", "0.6286873", "0.6277906", "0.626355", "0.62138224", "0.61932653", "0.61905366", "0.61827403", "0.61827403", "0.61605805", "0.60855246", "0.6085367", "0.60842156", "0.60544693", "0.60479873", "0.60398364", "0.6024478", "0.60204744", "0.60130405", "0.60079026", "0.60079026", "0.5981825", "0.5981599", "0.59763086", "0.5958026", "0.5956134" ]
0.66726726
0
Registers the required js files and script to initialize echarts plugin.
protected function registerClientScript() { $id = $this->options['id']; $view = $this->getView(); $option = !empty($this->pluginOptions['option']) ? Json::encode($this->pluginOptions['option']) : '{}'; if ($this->theme) { $js = "var {$this->clientId} = echarts.init(document.getElementById('{$id}'), " . $this->quote($this->theme) . ");"; } else { $js = "var {$this->clientId} = echarts.init(document.getElementById('{$id}'));"; } $js .= "{$this->clientId}.setOption({$option});"; if (isset($this->pluginOptions['group'])) { $js .= "{$this->clientId}.group = " . $this->quote($this->pluginOptions['group']) . ";"; } if ($this->responsive) { $js .= "$(window).resize(function () {{$this->clientId}.resize()});"; } foreach ($this->pluginEvents as $name => $handlers) { $handlers = (array) $handlers; foreach ($handlers as $handler) { $js .= "{$this->clientId}.on(" . $this->quote($name) . ", $handler);"; } } EChartsAsset::register($view); $view->registerJs($js); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register_plugin_script() {\n\t\twp_enqueue_script ( 'tr-execute', plugin_dir_url ( __FILE__ ) . '../js/execute.js', array (\n\t\t\t\t'jquery' \n\t\t) );\n\t\twp_enqueue_script ( 'tr-jquery-custom', plugin_dir_url ( __FILE__ ) . '../js/jquery-ui.min.js', array (\n\t\t\t\t'jquery' \n\t\t) );\n\t\t// wp_enqueue_script ( 'tr-jquery-charts', plugin_dir_url ( __FILE__ ) . '../js/charts.js', array (\n\t\t// 'jquery'\n\t\t// ) );\n\t\t// include the new datachart file.\n\t\t// wp_enqueue_script ( 'tr-jquery-charts', plugin_dir_url ( __FILE__ ) . '../js/define_chart_code.js', array (\n\t\t// 'jquery'\n\t\t// ) );\n\t\t// enque the google jsapi from url\n\t\t// wp_enqueue_script ( 'kek-chart', 'https://www.google.com/jsapi');\n\t\t// wp_enqueue_script ( 'kek-chart2', 'https://www.gstatic.com/charts/loader.js');\n\t}", "public static function em_enqueue_scripts(){\n\t\twp_enqueue_script('events-manager-pro', plugins_url('includes/js/events-manager-pro.js',__FILE__), array('jquery'), EMP_VERSION); //jQuery will load as dependency\n\t}", "protected function initJS()\n\t{\n\t\tglobal $tpl;\n\t\t\n\t\tinclude_once \"Services/jQuery/classes/class.iljQueryUtil.php\";\n\t\tiljQueryUtil::initjQuery();\n\t\t\n\t\t$tpl->addJavascript(\"Services/Chart/js/flot/excanvas.min.js\");\n\t\t$tpl->addJavascript(\"Services/Chart/js/flot/jquery.flot.min.js\");\n\t\t\n\t\tif((bool)$this->auto_resize)\n\t\t{\n\t\t\t// #13108\n\t\t\t$tpl->addJavascript(\"Services/Chart/js/flot/jquery.flot.resize.min.js\");\n\t\t}\n\t\t\n\t\t$this->addCustomJS();\n\t}", "protected function registerClientScript()\n {\n $id = $this->options['id'];\n $view = $this->getView();\n ChartJsAsset::register($view);\n\n $config = Json::encode(\n [\n 'type' => $this->type,\n 'data' => $this->data ?: new JsExpression('{}'),\n 'options' => $this->clientOptions ?: new JsExpression('{}'),\n 'plugins' => $this->plugins\n ]\n );\n\n $js = \";var chartJS_{$id} = new Chart($('#{$id}'),{$config});\";\n $view->registerJs($js);\n }", "protected function registerScript()\n\t{\n\t $baseUrl = Yii::app()->getHomeUrl();\n\t $js_arr = array('triggmine-scripts.js');\n\t foreach($js_arr as $filename)\n\t {\n\t Yii::app()->getClientScript()->registerScriptFile('/js/vendor/'.$filename, CClientScript::POS_END);\n\t }\n\t}", "public function enqueue_scripts()\n\t{\n\t\twp_enqueue_script( 'orghub-upload-extended-data', ORGANIZATION_HUB_PLUGIN_URL.'/admin-pages/scripts/upload-extended-data.js' );\t\t\n\t}", "protected function loadJavaScripts()\n {\n $this->pageRenderer->loadJquery();\n $this->pageRenderer->loadRequireJsModule('bootstrap');\n $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/ContextHelp');\n $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/DocumentHeader');\n $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/SplitButtons');\n }", "public function register_scripts()\n {\n }", "private function registerClientScripts()\n {\n $view = $this->getView();\n\n DatepickerAsset::$language = $this->_language;\n DatepickerAsset::$juiNoConflict = $this->juiNoConflict;\n DatepickerAsset::register($view);\n\n $clientOptions = array_replace([\n 'format' => 'yyyy-mm-dd',\n ], $this->clientOptions);\n $options = Json::htmlEncode($clientOptions);\n\n $view->registerJs(\"jQuery('#{$this->options['id']}').datepicker(jQuery.extend({autoclose: true, zIndexOffset: 100}, $options));\");\n }", "public function registerScripts() {\n $this->scripts['bootstrap.min'] = 'assets/js/bootstrap.min.js';\n $this->scripts['jquery.nouislider.min'] = 'assets/js/mkdf-ui/jquery.nouislider.min.js';\n $this->scripts['mkdf-ui-admin'] = 'assets/js/mkdf-ui/mkdf-ui.js';\n $this->scripts['mkdf-bootstrap-select'] = 'assets/js/mkdf-ui/mkdf-bootstrap-select.min.js';\n\n foreach ($this->scripts as $scriptHandle => $scriptPath) {\n sienna_mikado_register_skin_script($scriptHandle, $scriptPath);\n }\n }", "public function registerClientScript() {\n\n// $_cssFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'jquery.innerfade/css/jq_fade.css';\n// $cssFile = Yii::app()->getAssetManager()->publish($_cssFile);\n// Yii::app()->getClientScript()->registerCssFile($cssFile);\n\n $_jsFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'jquery.innerfade/js/jquery.innerfade.js';\n $jsFile = Yii::app()->getAssetManager()->publish($_jsFile);\n\n Yii::app()->getClientScript()->registerScriptFile($jsFile);\n }", "public function DefineJsResources()\n {\n $this->carabiner->js('https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js');\n $this->carabiner->js('https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js');\n $this->carabiner->js('https://cdn.jsdelivr.net/npm/[email protected]/dist/Chart.min.js');\n // an array of arrays\n $this->carabiner->js(array(\n array('assets/js/Chart.min.js'),\n array('assets/js/Chart.bundle.min.js'),\n array('assets/js/jquery.js')\n ));\n }", "function addJSFiles()\n\t{\n\t\t\t\t$this->getContainer()->AddJSFile(\"include/zoombox/zoombox.js\");\n\t\t$this->getJSControl();\t\n\t}", "protected function registerAssets()\n {\n // register the necessary script files\n $bundle = TradingViewAsset::register($this->view)->withScripts($this->scripts);\n \n $this->options['library_path'] = $bundle->baseUrl . '/charting_library/';\n\n // prepare and register JavaScript code block\n $jsOptions = Json::encode($this->options);\n $js = \"var widget = window.tvWidget = new TradingView.widget($jsOptions);\";\n $key = __CLASS__ . '#' . $this->id;\n \n $this->view->registerJs($js, View::POS_READY, $key);\n }", "public function registerAssets()\n {\n DateRangePickerAsset::register($this->view);\n\n $key = __CLASS__ . '#' . $this->id;\n $this->options['success'] = new JsExpression($this->options['success']);\n\n $jsOptions = Json::encode($this->options);\n $javascript = \"var dateRange = new pickerDateRange('\".$this->id.\"', \".$jsOptions.\");\";\n $this->view->registerJs($javascript, View::POS_READY, $key);\n }", "public function widget_scripts() {\n\t\twp_register_script( 'elementor-hello-world', plugins_url( '/assets/js/hello-world.js', __FILE__ ), [ 'jquery' ], false, true );\n\t}", "public function loadScripts() {\n $graphcss = $this->getProperty('graphcss');\n $customcss = $this->getProperty('customcss');\n $loadjquery = $this->getProperty('loadjquery');\n\n $cssUrl = $this->sekug->config['cssUrl'].'web/';\n $jsUrl = $this->sekug->config['jsUrl'].'web/';\n\n if($loadjquery == 1){\n $this->modx->regClientStartupScript($jsUrl.'libs/'.$this->sekug->config['jqueryFile']);\n }\n if($customcss>''){\n $this->modx->regClientCSS($this->modx->getOption('assets_url').$customcss);\n } else {\n $this->modx->regClientCSS($cssUrl.'gallery.structure.css');\n }\n if($graphcss>''){\n $this->modx->regClientCSS($this->modx->getOption('assets_url').$graphcss);\n } else {\n $this->modx->regClientCSS($cssUrl.'directory.graph.css');\n }\n }", "public function register_scripts()\r\n\t{\r\n\t\twp_register_style('poll', plugins_url('assets/poll.css', __DIR__));\r\n\t\twp_register_script('vue', 'https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js', array('jquery'), null, true);\r\n\t\twp_register_script('poll', plugins_url('assets/poll.js', __DIR__), array('vue'), null, true);\r\n\t}", "public function registerScripts() {\r\n\t\t$baseUrl = Yii::app()->assetManager->publish(dirname(__FILE__).\"/assets/\".__CLASS__);\r\n\t\tYii::app()->clientScript->registerScriptFile($baseUrl.\"/AFileBrowser.js\");\r\n\t\t\r\n\t}", "private function registerPlugins()\n\t{\n\t\t$assetDir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR;\n\t\t$assetUrl = Yii::app()->assetManager->publish($assetDir);\n\n\n\t\t$cs = Yii::app()->getClientScript();\n\n\t\tforeach ($this->plugins as $p)\n\t\t{\n\n\t\t\tif ($p['flag'])\n\t\t\t{\n\t\t\t\tforeach ($p['js'] as $js)\n\t\t\t\t\t$cs->registerScriptFile($assetUrl . \"/\" . $js, CClientScript::POS_END);\n\t\t\t}\n\t\t}\n\t}", "function jigoshop_admin_coupons_scripts () {\n\twp_register_script('jigoshop-date', jigoshop::plugin_url() . '/assets/js/date.js');\n\twp_register_script('jigoshop-datepicker', jigoshop::plugin_url() . '/assets/js/datepicker.js', array('jquery', 'jigoshop-date'));\n\twp_enqueue_script('jigoshop-datepicker');\n}", "public static function add() {\n\t\t\\Layout::addJs('/composer/nnnick/chartjs/dist/Chart.min.js', 10000);\n\t\t\\Layout::addCss('/composer/nnnick/chartjs/dist/Chart.min.css', 10000);\n\t}", "public function registerScripts()\n {\n // font awesome. choose css fonts instead of svg, see more at https://fontawesome.com/how-to-use/on-the-web/other-topics/performance\n // to name font awesome handle as `plugin-name-prefix-font-awesome5` is to prevent conflict with other plugins that maybe use older version but same handle that cause some newer icons in this plugin disappears.\n wp_enqueue_style('rundizable-wp-features-font-awesome5', plugin_dir_url(RUNDIZABLEWPFEATURES_FILE).'assets/fontawesome/css/all.min.css', [], '5.5.0');\n wp_enqueue_style('rundizable-wp-features-rd-settings-tabs-css', plugin_dir_url(RUNDIZABLEWPFEATURES_FILE).'assets/css/rd-settings-tabs.css', [], RUNDIZABLEWPFEATURES_VERSION);\n wp_enqueue_script('rundizable-wp-features-rd-settings-tabs-js', plugin_dir_url(RUNDIZABLEWPFEATURES_FILE).'assets/js/rd-settings-tabs.js', ['jquery'], RUNDIZABLEWPFEATURES_VERSION, true);\n }", "public function register_scripts() {\r\n\r\n\t\t$this->nyp_style();\r\n\r\n\t\twp_register_script( 'accounting', WC_Name_Your_Price()->plugin_url() . '/assets/js/accounting.js', array( 'jquery' ), '0.4.2', true );\r\n\r\n\t\t$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';\r\n\t\twp_register_script( 'woocommerce-nyp', WC_Name_Your_Price()->plugin_url() . '/assets/js/name-your-price' . $suffix . '.js', array( 'jquery', 'accounting' ), WC_Name_Your_Price()->version, true );\r\n\t}", "private function __register_scripts() {\n\t\t// Load all the registered scripts\n\t\t$assets_loader = new SwpmvcAssetsLoader();\n\t\t$assets = $assets_loader->fn_load_scripts();\n\n\t\t//Extract CSS Assets and put them into Registered CSS Container\n\t\t$this->registered_css = $assets[ 'css' ];\n\n\t\t//Extract JS Assets and put them into Registered JS Container\n\t\t$this->registered_js = $assets[ 'js' ];\n\n\t\t//Some cleanup\n\t\tunset($assets_loader);\n\t\tunset($assets);\n\n\t\t//Load all the common CSS and JS which will be required for all the pages.\n\t\t$this->fn_load_scripts();\n\t}", "public function register_assets() {\n\n $scripts = $this->get_scripts();\n $styles = $this->get_styles();\n\n foreach ( $scripts as $handle => $script ) {\n $deps = isset( $script['deps'] ) ? $script['deps'] : false;\n\n wp_register_script( $handle, $script['src'], $deps, $script['version'], true );\n }\n\n foreach ( $styles as $handle => $style ) {\n $deps = isset( $style['deps'] ) ? $style['deps'] : false;\n\n wp_register_style( $handle, $style['src'], $deps, $style['version'] );\n }\n\n wp_localize_script( 'cbxcf-scripts', 'cbxcfObj', [\n 'ajaxurl' => admin_url( 'admin-ajax.php' ),\n 'error' => __( 'Something went wrong', 'cbxcustomform' ),\n ] );\n\n }", "private function registerClientScript()\n {\n ArrayInputAsset::register($this->view);\n }", "private function initializePlugins() {\r\n if (isset($this->settings[\"loadJsPlugins\"])) {\r\n if (count($this->settings[\"loadJsPlugins\"])) {\r\n foreach ($this->settings[\"loadJsPlugins\"] as $pluginName) {\r\n $this->addPlugin($pluginName);\r\n }\r\n }\r\n }\r\n unset($this->settings[\"loadJsPlugins\"]);\r\n }", "public function add_scripts() {\n\n\t\t\t\tFusion_Dynamic_JS::enqueue_script( 'fusion-video' );\n\t\t\t}", "public function addAssets()\n {\n $this->addJs('../../graphreport/assets/d3.js');\n $this->addJs('../../graphreport/assets/c3.js');\n $this->addCss('../../graphreport/assets/c3.css'); \n }" ]
[ "0.6930164", "0.6642013", "0.66358787", "0.659453", "0.65577745", "0.64857", "0.64182717", "0.6393153", "0.63474125", "0.63356113", "0.6265968", "0.62512493", "0.6246191", "0.62407136", "0.6223083", "0.62043434", "0.62031066", "0.61829865", "0.6176997", "0.6174723", "0.6174443", "0.61739224", "0.6161694", "0.61521095", "0.61516875", "0.6149621", "0.6130863", "0.61296993", "0.6116489", "0.61078537" ]
0.70504874
0
Returns the client ID of the echarts.
public function getClientId() { $id = $this->options['id']; if ($this->_clientId === null) { $this->_clientId = "echarts_{$id}"; } return $this->_clientId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClientId()\n {\n return $this->client_id;\n }", "public function getClientId()\n {\n return $this->client_id;\n }", "public function getClientId()\n {\n return $this->client_id;\n }", "public function getClientId()\n {\n return $this->client_id;\n }", "public function getClientId()\n {\n return $this->client_id;\n }", "public function getClientID()\n {\n return $this->ClientID;\n }", "public function getClientId()\n\t\t\t{\n\t\t\t\treturn $this->clientId;\n\t\t\t}", "public function getClientId()\n\t{\n\t\treturn $this->_clientId;\n\t}", "public function getClientId() {\n return $this->clientId;\n }", "public function getClientId()\n {\n return $this->clientId;\n }", "public function getClientId()\n {\n return $this->clientId;\n }", "public function getClientId()\n {\n return $this->clientId;\n }", "public function getClientId()\n {\n return $this->clientId;\n }", "public function getClientId()\n {\n return $this->clientId;\n }", "public function getClientId()\n {\n return $this->clientId;\n }", "public function getIdClient()\n {\n return $this->idClient;\n }", "public function getIdClient()\n {\n return $this->idClient;\n }", "public function getClientId(): string\n {\n return $this->configuration[ConfigurationInterface::CLIENT_ID];\n }", "public function getClientId() : string\n {\n return $this->clientId;\n }", "public function getClientId() : string\n {\n return $this->clientId;\n }", "public function get_client_id() {\n return $this->get_option( 'client-id', '' );\n }", "public function getClientId() : int\n {\n return $this->clientId;\n }", "public function getClientId(): string\n {\n return (string) data_get($this->args, 'credentials.id');\n }", "public function getClientId()\n {\n return $this->getParameter('clientId');\n }", "public function get_clientid() {\n return $this->clientid;\n }", "public function getClientes_idclient(){\n return $this->clientes_idclient;\n }", "public function getClientId();", "public function getClientId();", "public function getClientId();", "public function getClientId();" ]
[ "0.7346107", "0.7346107", "0.7346107", "0.7346107", "0.7346107", "0.73284566", "0.73151404", "0.73117363", "0.7284441", "0.72842646", "0.72842646", "0.72842646", "0.72842646", "0.72842646", "0.72842646", "0.7238168", "0.7238168", "0.7189344", "0.7155751", "0.7155751", "0.70847577", "0.7077766", "0.6952469", "0.68494266", "0.6761313", "0.6724893", "0.6666512", "0.6666512", "0.6666512", "0.6666512" ]
0.8740448
0
Registers the JS files of the given themes.
public static function registerTheme($theme) { $themes = (array) $theme; array_walk($themes, function (&$name) { $name .= '.js'; }); static::$_themeJsFiles = array_unique(array_merge(static::$_themeJsFiles, $themes)); if (static::$_themeJsFiles) { ThemeAsset::register(Yii::$app->getView())->js = static::$_themeJsFiles; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function register_theme_styles_and_scripts(){\n // Register style\n wp_enqueue_style( 'theme-icons', get_template_directory_uri(). '/css/icons.css', array(), '1.0.0', 'all' ); // Register font icons\n wp_enqueue_style( 'google_fonts', sunset_google_fonts_url(), array(), '1.0.0'); // Register Google fonts\n wp_enqueue_style( 'slick-style', get_template_directory_uri(). '/css/slick.css', array(), '1.9.0', 'all' ); // Register theme main style\n wp_enqueue_style( 'theme-main-style', get_template_directory_uri(). '/css/main.css', array(), '1.0.0', 'all' ); // Register theme main style\n\n // Register scripts\n wp_enqueue_script( 'jquery');\n wp_enqueue_script( 'slick-scripts', get_template_directory_uri(). '/js/slick.js', array('jquery'), '1.9.0', true );\n wp_enqueue_script( 'main-scripts', get_template_directory_uri(). '/js/main.js', array('jquery'), '1.0.0', true );\n }", "function theme_files() {\n \n wp_register_style('style', get_template_directory_uri() . '/dist/app.css', [], 1, 'all');\n wp_enqueue_style('style');\n\n wp_enqueue_script('jquery');\n\n wp_register_script('app', get_template_directory_uri() . '/dist/app.js', ['jquery'], 1, true);\n wp_enqueue_script('app');\n}", "function startertheme_enqueue_files() {\n wp_enqueue_script('startertheme_scripts', get_theme_file_uri('/assets/dist/js/frontend/app.js'), NULL, '1.0', true);\n wp_enqueue_style('startertheme_style', get_theme_file_uri('/assets/dist/css/style.css'), NULL, '1.0');\n}", "public function register_assets() {\n $js_folder = SD_PLUGIN_PATH . '/src/assets/js/';\n $css_folder = SD_PLUGIN_PATH . '/src/assets/css/';\n $scripts = scandir($js_folder);\n //var_dump($scripts);\n $styles = scandir($css_folder);\n foreach ($styles as $style) {\n if( !is_dir($style) ) {\n wp_enqueue_style( URL_SCOPE . mt_rand(0, 9000), '/wp-content/plugins/'.sanitize_key(PLUGIN_NAME).'/src/assets/css/' . $style);\n }\n }\n foreach ($scripts as $script) {\n if( !is_dir($script) ) {\n wp_enqueue_script( URL_SCOPE . mt_rand(0, 9000), '/wp-content/plugins/'.sanitize_key(PLUGIN_NAME).'/src/assets/js/' . $script);\n }\n }\n }", "function register_theme_js_styles(){\n wp_register_script('global', get_template_directory_uri() . '/js/global.js', array('jquery'), false, true);\n\n wp_register_style('theme-styles', get_template_directory_uri() . '/style.css');\n wp_enqueue_style('theme-styles');\n\n wp_register_style('blocks', get_template_directory_uri() . '/blocks.css');\n wp_enqueue_style('blocks');\n\n wp_enqueue_script('jquery');\n wp_enqueue_script('global');\n //enqueue_slick();\n enqueue_lightbox();\n}", "function wp_prepare_themes_for_js($themes = \\null)\n {\n }", "function addThemeScripts() \n {\n wp_enqueue_script('constructor-theme', CONSTRUCTOR_DIRECTORY_URI.'/js/ready.js', array('jquery'));\n }", "public function register_assets() {\n\n\t\tforeach ( $this->assets as $asset ) {\n\t\t\t$js_path = $this->plugin->dir() . '/js/dist/' . $asset . '.asset.php';\n\t\t\t$css_path = $this->plugin->dir() . '/css/' . $asset . '.css';\n\t\t\tif ( file_exists( $js_path ) ) {\n\t\t\t\t$assets_dep = require_once $js_path;\n\t\t\t\twp_register_script(\n\t\t\t\t\t'formation-' . $asset . '-js',\n\t\t\t\t\t$this->plugin->asset_url( 'js/dist/' . $asset . '.js' ),\n\t\t\t\t\t$assets_dep['dependencies'],\n\t\t\t\t\t$assets_dep['version'],\n\t\t\t\t\ttrue\n\t\t\t\t);\n\n\t\t\t\tif ( file_exists( $css_path ) ) {\n\t\t\t\t\twp_register_style(\n\t\t\t\t\t\t'formation-' . $asset . '-css',\n\t\t\t\t\t\t$this->plugin->asset_url( 'css/' . $asset . '.css' ),\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t$assets_dep['version']\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function theme_js(){\n\n\t\twp_register_script('custom-script1', get_template_directory_uri() . '/js/menu.js', array('jquery'),'', true);\n\t\twp_register_script('custom-script2', get_template_directory_uri() . '/js/main.js', array('jquery'),'', true);\n\t\twp_register_script('custom-script3', get_template_directory_uri() . '/js/css3-mediaqueries.js', array('jquery'),'', true);\n\t\n\t\twp_enqueue_script('custom-script1', get_template_directory_uri() . '/js/theme.js', array('jquery'),'', true );\n\t\twp_enqueue_script('custom-script2');\n\t\twp_enqueue_script('custom-script3');\n}", "function add_js_theme( $js_files, $is_i18n = FALSE )\n {\n if ( $is_i18n )\n return $this->add_jsi18n_theme( $js_files );\n\n // make sure that $this->includes has array value\n if ( ! is_array( $this->includes ) )\n $this->includes = array();\n\n // if $css_files is string, then convert into array\n $js_files = is_array( $js_files ) ? $js_files : explode( \",\", $js_files );\n\n foreach( $js_files as $js )\n {\n // remove white space if any\n $js = trim( $js );\n\n // go to next when passing empty space\n if ( empty( $js ) ) continue;\n\n // using sha1( $js ) as a key to prevent duplicate js to be included\n $this->includes[ 'js_files' ][ sha1( $js ) ] = base_url( \"/themes/{$this->settings->theme}/js\" ) . \"/{$js}\";\n }\n\n return $this;\n }", "function theme_assets() {\n\t// load css\n\twp_enqueue_style( 'font-awesome-css', get_template_directory_uri() . '/css/fontawesome.css' );\n\twp_enqueue_style( 'bootstrap-css', get_template_directory_uri() . '/css/bootstrap.css' );\n\twp_enqueue_style( 'style-css', get_template_directory_uri() . '/style.css', false, time() );\n\n\t// load javascript\n\twp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '', true );\n wp_enqueue_script( 'waterfall-js', get_template_directory_uri() . '/js/waterfall.js', array(), '', true );\n\twp_enqueue_script( 'main', get_template_directory_uri() . '/js/main.js', array(), '', true);\n}", "public function register_assets() {\n\n $scripts = $this->get_scripts();\n $styles = $this->get_styles();\n\n foreach ( $scripts as $handle => $script ) {\n $deps = isset( $script['deps'] ) ? $script['deps'] : false;\n\n wp_register_script( $handle, $script['src'], $deps, $script['version'], true );\n }\n\n foreach ( $styles as $handle => $style ) {\n $deps = isset( $style['deps'] ) ? $style['deps'] : false;\n\n wp_register_style( $handle, $style['src'], $deps, $style['version'] );\n }\n\n wp_localize_script( 'cbxcf-scripts', 'cbxcfObj', [\n 'ajaxurl' => admin_url( 'admin-ajax.php' ),\n 'error' => __( 'Something went wrong', 'cbxcustomform' ),\n ] );\n\n }", "function theme_scripts() {\n // Registrace scriptu (bundle.js z webpacku)\n wp_register_script(\n // Název\n 'bundle',\n // Cesta\n get_template_directory_uri() . '/dist/bundle.js',\n // Závislosti (žádné)\n '',\n // Verze (žádná)\n false,\n // Umístit do patičky\n true\n );\n\n // Zařazení stylu do fronty\n wp_enqueue_script('bundle');\n}", "public function theme_scripts() {\n\t\t$suffix = !TALEMY_DEV_MODE ? '.min' : '';\n\n\t\t// stylesheets\n\t\twp_register_style(\n\t\t\t'font-awesome-5-all',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/font-awesome/css/all.min.css',\n\t\t\tfalse,\n\t\t\t'5.10.1'\n\t\t);\n\n\t\twp_register_style(\n\t\t\t'font-awesome-5-shim',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/font-awesome/css/v4-shims.min.css',\n\t\t\tfalse,\n\t\t\t'5.10.1'\n\t\t);\n\t\t\n\t\twp_register_style(\n\t\t\t'fancybox',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/css/fancybox.min.css'\n\t\t);\n\n\t\twp_register_style(\n\t\t\t'talemy',\n\t\t\tTALEMY_THEME_URI . 'assets/css/style'. $suffix . '.css',\n\t\t\tfalse,\n\t\t\tTALEMY_THEME_VERSION\n\t\t);\n\n\t\twp_enqueue_style( 'font-awesome-5-all' );\n\t\twp_enqueue_style( 'font-awesome-5-shim' );\n\t\twp_enqueue_style( 'talemy' );\n\t\twp_style_add_data( 'talemy', 'rtl', 'replace' );\n\n\t\t// scripts\n\n \twp_register_script(\n \t\t'fancybox',\n \t\tTALEMY_THEME_URI . 'assets/lib/js/jquery.fancybox.min.js',\n \t\tarray( 'jquery' ),\n \t\tTALEMY_THEME_VERSION,\n \t\ttrue\n \t);\n\n\t\twp_register_script(\n\t\t\t'jquery-fitvids',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/jquery.fitvids.min.js',\n\t\t\tarray( 'jquery' ),\n\t\t\t'1.1',\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'jquery-matchheight',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/jquery.matchHeight.min.js',\n\t\t\tarray( 'jquery' ),\n\t\t\t'0.7.0',\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'jquery-placeholder',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/jquery.placeholder.min.js',\n\t\t\tarray( 'jquery' ),\n\t\t\t'2.3.1',\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'jquery-requestanimationframe',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/jquery.requestanimationframe.min.js',\n\t\t\tarray( 'jquery' ),\n\t\t\t'0.2.3',\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'jquery-selectric',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/jquery.selectric.min.js',\n\t\t\tarray( 'jquery' ),\n\t\t\t'1.13.0',\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'jquery-superfish',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/jquery.superfish.min.js',\n\t\t\tarray( 'jquery' ),\n\t\t\t'1.7.10',\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'jquery-throttle-debounce',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/jquery.throttle-debounce.min.js',\n\t\t\tarray( 'jquery' ),\n\t\t\t'1.1',\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'resize-sensor',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/ResizeSensor.min.js',\n\t\t\tarray(),\n\t\t\tnull,\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'theia-sticky-sidebar',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/theia-sticky-sidebar.min.js',\n\t\t\tarray( 'jquery', 'resize-sensor' ),\n\t\t\t'1.7.0',\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'talemy-modernizr',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/modernizr.js',\n\t\t\tarray(),\n\t\t\t'3.6.0',\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'talemy-block',\n\t\t\tTALEMY_THEME_URI . 'assets/js/talemy-block.min.js',\n\t\t\tarray( 'jquery', 'imagesloaded', 'jquery-matchheight' ),\n\t\t\tTALEMY_THEME_VERSION,\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'talemy',\n\t\t\tTALEMY_THEME_URI . 'assets/js/talemy' . $suffix . '.js',\n\t\t\tarray(\n\t\t\t\t'jquery',\n\t\t\t\t'imagesloaded',\n\t\t\t\t'jquery-fitvids',\n\t\t\t\t'jquery-superfish',\n\t\t\t\t'jquery-selectric',\n\t\t\t\t'jquery-throttle-debounce',\n\t\t\t\t'jquery-requestanimationframe',\n\t\t\t\t'jquery-matchheight',\n\t\t\t\t'jquery-placeholder',\n\t\t\t\t'theia-sticky-sidebar',\n\t\t\t\t'talemy-modernizr'\n\t\t\t),\n\t\t\tTALEMY_THEME_VERSION,\n\t\t\ttrue\n\t\t);\n\n\t\twp_enqueue_script( 'jquery-fitvids' );\n\t\twp_enqueue_script( 'jquery-superfish' );\n\t\twp_enqueue_script( 'jquery-selectric' );\n\t\twp_enqueue_script( 'jquery-throttle-debounce' );\n\t\twp_enqueue_script( 'jquery-requestanimationframe' );\n\t\twp_enqueue_script( 'jquery-matchheight' );\n\t\twp_enqueue_script( 'jquery-placeholder' );\n\t\twp_enqueue_script( 'theia-sticky-sidebar' );\n\t\twp_enqueue_script( 'talemy-modernizr' );\n\t\twp_enqueue_script( 'talemy' );\n\t\twp_localize_script( 'talemy', 'talemy_js_data', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );\n\n\t\tif ( is_single() ) {\n\t\t\tif ( talemy_get_option( 'post_comments' ) && comments_open() && get_option( 'thread_comments' ) ) {\n\t\t\t\twp_enqueue_script( 'comment-reply' );\n\t\t\t}\n\t\t\tif ( is_singular( 'sfwd-courses' ) ) {\n\t\t\t\twp_enqueue_style( 'fancybox' );\n\t\t\t\twp_enqueue_script( 'fancybox' );\n\t\t\t} else {\n\t\t\t\t$in_focus_mode = false;\n\t\t\t\tif ( class_exists( 'LearnDash_Settings_Section' ) ) {\n\t\t\t\t\t$in_focus_mode = LearnDash_Settings_Section::get_section_setting( 'LearnDash_Settings_Theme_LD30', 'focus_mode_enabled' );\n\t\t\t\t}\n\t\t\t\tif ( !$in_focus_mode && in_array( get_post_type(), array( 'sfwd-lessons', 'sfwd-topic' ) ) ) {\n\t\t\t\t\twp_enqueue_style( 'fancybox' );\n\t\t\t\t\twp_enqueue_script( 'fancybox' );\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( is_page() && !is_front_page() ) {\n\t\t\tif ( talemy_get_option( 'page_comments' ) && comments_open() && get_option( 'thread_comments' ) ) {\n\t\t\t\twp_enqueue_script( 'comment-reply' );\n\t\t\t}\n\t\t}\n\t}", "public function theme_assets_handler() {\n\t\t\n\t\t$version = wp_get_theme()->get('Version');\n\n\t\t//Enqueue stylesheets\n\t\tforeach ($this->styles as $style) {\n\t\t\twp_register_style($this->prefix . $style['slug'], get_template_directory_uri() . $style['path'], $style['deps'], $version);\n\t\t\twp_enqueue_style($this->prefix . $style['slug']);\n\n\n\n\t\t}\n\t\t\n\t\t//Enqueue Scripts\n\t\tforeach ($this->scripts as $script) {\n\t\t\twp_register_script($this->prefix . $script['slug'], get_template_directory_uri() . $script['path'], $script['deps'], $version);\n\t\t\twp_enqueue_script($this->prefix . $script['slug']);\n\t\t}\n\t\t\n\t\t//Enqueue WP Scripts\n\t\tif(is_array($this->wp_scripts)){\n\t\t\t\n\t\t\tforeach ($this->wp_scripts as $script) {\n\t\t\t\twp_enqueue_script($script);\n\t\t\t}\n\t\t}\n\t}", "public function registerScripts() {\n $this->scripts['bootstrap.min'] = 'assets/js/bootstrap.min.js';\n $this->scripts['jquery.nouislider.min'] = 'assets/js/mkdf-ui/jquery.nouislider.min.js';\n $this->scripts['mkdf-ui-admin'] = 'assets/js/mkdf-ui/mkdf-ui.js';\n $this->scripts['mkdf-bootstrap-select'] = 'assets/js/mkdf-ui/mkdf-bootstrap-select.min.js';\n\n foreach ($this->scripts as $scriptHandle => $scriptPath) {\n sienna_mikado_register_skin_script($scriptHandle, $scriptPath);\n }\n }", "function add_theme_scripts_styles_func() {\n//\tscripts\n\twp_register_script('modernizr', get_template_directory_uri() . '/assets/js/vendor/modernizr-3.5.0.min.js', array(), false, true);\n\twp_enqueue_script('modernizr');\n\twp_register_script('jquery-theme', get_template_directory_uri() . '/assets/js/vendor/jquery-1.12.4.min.js', array(), false, true);\n\twp_enqueue_script('jquery-theme');\n\twp_register_script('popper', get_template_directory_uri() . '/assets/js/popper.min.js', array('jquery-theme'), false, true);\n\twp_enqueue_script('popper');\n\twp_register_script('bootstrap', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array('jquery-theme'), false, true);\n\twp_enqueue_script('bootstrap');\n\twp_register_script('jquery-slicknav', get_template_directory_uri() . '/assets/js/jquery.slicknav.min.js', array('jquery-theme'), false, true);\n\twp_enqueue_script('jquery-slicknav');\n\twp_register_script('owl-carousel', get_template_directory_uri() . '/assets/js/owl.carousel.min.js', array('jquery-theme'), false, true);\n\twp_enqueue_script('owl-carousel');\n\twp_register_script('slick', get_template_directory_uri() . '/assets/js/slick.min.js', array('jquery-theme'), false, true);\n\twp_enqueue_script('slick');\n\twp_register_script('wow', get_template_directory_uri() . '/assets/js/wow.min.js', array('jquery-theme'), false, true);\n\twp_enqueue_script('wow');\n\twp_register_script('animated', get_template_directory_uri() . '/assets/js/animated.headline.js', array('jquery-theme'), false, true);\n\twp_enqueue_script('animated');\n\twp_register_script('magnific-popup', get_template_directory_uri() . '/assets/js/jquery.magnific-popup.js', array('jquery-theme'), false, true);\n\twp_enqueue_script('magnific-popup');\n\twp_register_script('scrollUp', get_template_directory_uri() . '/assets/js/jquery.scrollUp.min.js', array('jquery-theme'), false, true);\n\twp_enqueue_script('scrollUp');\n\twp_register_script('nice-select', get_template_directory_uri() . '/assets/js/jquery.nice-select.min.js', array('jquery-theme'), false, true);\n\twp_enqueue_script('nice-select');\n\twp_register_script('sticky', get_template_directory_uri() . '/assets/js/jquery.sticky.js', array('jquery-theme'), false, true);\n\twp_enqueue_script('sticky');\n\twp_register_script('contact', get_template_directory_uri() . '/assets/js/contact.js', array('jquery-theme'), false, true);\n\twp_enqueue_script('contact');\n\twp_register_script('mailsend', get_template_directory_uri() . '/assets/js/mailsend.js', array('jquery-theme'), false, true);\n\twp_enqueue_script('mailsend');\n\twp_localize_script( 'mailsend', 'data',\n\t\tarray(\n\t\t\t'url' => admin_url('admin-ajax.php')\n\t\t)\n\t);\n\twp_register_script('form', get_template_directory_uri() . '/assets/js/jquery.form.js', array('jquery-theme'), false, true);\n\twp_enqueue_script('form');\n\twp_register_script('validate', get_template_directory_uri() . '/assets/js/jquery.validate.min.js', array('jquery-theme'), false, true);\n\twp_enqueue_script('validate');\n\twp_register_script('mail-script', get_template_directory_uri() . '/assets/js/mail-script.js', array('jquery-theme'), false, true);\n\twp_enqueue_script('mail-script');\n\twp_register_script('ajaxchimp', get_template_directory_uri() . '/assets/js/jquery.ajaxchimp.min.js', array('jquery-theme'), false, true);\n\twp_enqueue_script('ajaxchimp');\n\twp_register_script('plugins', get_template_directory_uri() . '/assets/js/plugins.js', array('jquery-theme'), false, true);\n\twp_enqueue_script('plugins');\n\twp_register_script('main', get_template_directory_uri() . '/assets/js/main.js', array('jquery-theme'), false, true);\n\twp_enqueue_script('main');\n//\tstyles\n\twp_register_style('bootstrap-style', get_template_directory_uri() . '/assets/css/bootstrap.min.css');\n\twp_enqueue_style('bootstrap-style');\n\twp_register_style('owl-carousel', get_template_directory_uri() . '/assets/css/owl.carousel.min.css');\n\twp_enqueue_style('owl-carousel');\n\twp_register_style('flaticon', get_template_directory_uri() . '/assets/css/flaticon.css');\n\twp_enqueue_style('flaticon');\n\twp_register_style('slicknav', get_template_directory_uri() . '/assets/css/slicknav.css');\n\twp_enqueue_style('slicknav');\n\twp_register_style('animate', get_template_directory_uri() . '/assets/css/animate.min.css');\n\twp_enqueue_style('animate');\n\twp_register_style('magnific-popup', get_template_directory_uri() . '/assets/css/magnific-popup.css');\n\twp_enqueue_style('magnific-popup');\n\twp_register_style('fontawesome-all', get_template_directory_uri() . '/assets/css/fontawesome-all.min.css');\n\twp_enqueue_style('fontawesome-all');\n\twp_register_style('themify-icons', get_template_directory_uri() . '/assets/css/themify-icons.css');\n\twp_enqueue_style('themify-icons');\n\twp_register_style('slick', get_template_directory_uri() . '/assets/css/slick.css');\n\twp_enqueue_style('slick');\n\twp_register_style('nice-select', get_template_directory_uri() . '/assets/css/nice-select.css');\n\twp_enqueue_style('nice-select');\n\twp_register_style('style', get_template_directory_uri() . '/assets/css/style.css');\n\twp_enqueue_style('style');\n}", "function example-theme_load_theme_assets() {\n\n\t$assetpath_css = getenv( 'WP_ENV' ) === 'production' ? '/assets/rev/' . asset_path( 'css/main.css' ) : '/assets/build/css/main.css';\n\t$assetpath_js = getenv( 'WP_ENV' ) === 'production' ? '/assets/rev/' . asset_path( 'js/app.js' ) : '/assets/build/js/app.js';\n\n\tif ( ! is_admin() ) {\n\t\twp_enqueue_style( 'example-theme-css-main', get_template_directory_uri() . $assetpath_css );\n\t}\n\n\twp_register_script( 'example-theme-script-main', get_template_directory_uri() . $assetpath_js, array(), '1.0', true );\n\twp_enqueue_script( 'example-theme-script-main' );\n\n}", "function include_config_files($themes){\n\n foreach($themes as $theme => $path){\n\n $config_path = $path->to('config') .DIRECTORY_SEPARATOR;\n \n //allow developer to replace config paths, \n //if false is returned, don't include it\n \n $scripts = $config_path .WXP::DS(\"config\\scripts.php\");\n $this->include_path($scripts, \"WXP.{$theme}.include_scripts\", function() use ($scripts){\n add_action(\"wp_enqueue_scripts\", function() use ($scripts){\n require $scripts;\n });\n });\n \n //load init file if exist\n \n $hooks = $config_path .WXP::DS(\"config/init.php\");\n $this->include_path($hooks, \"WXP.{$theme}.include_init\"); \n\n //load hooks file if exist\n \n $hooks = $config_path .WXP::DS(\"config/hooks.php\");\n $this->include_path($hooks, \"WXP.{$theme}.include_hooks\"); \n \n //load dom routes if exist\n \n $domRoutes = $config_path .WXP::DS(\"config/dom-routes.php\");\n $this->include_path($domRoutes, \"WXP.{$theme}.include_dom_routes\");\n \n //load options file if exists\n \n $theme_options = $config_path .WXP::DS(\"config/options.php\");\n $this->include_path($theme_options, \"WXP.{$theme}.include_theme_options\");\n \n //load meta boxes file if exists\n \n $meta_boxes = $config_path .WXP::DS(\"config/meta-boxes.php\");\n $this->include_path($meta_boxes, \"WXP.{$theme}.include_meta_boxes\");\n \n \n //load paths if set\n \n $t_paths = $config_path .WXP::DS(\"config/paths.php\");\n $this->include_path($t_paths, \"WXP.{$theme}.include_template_paths\");\n \n }\n }", "private function register_scripts_and_styles()\n\t\t\t{\n\n\t\t\t\tif( is_admin() )\n\t\t\t\t{\n\n\t\t \t\t//$this->load_file('friendly_widgets_admin_js', '/themes/'.THEMENAME.'/admin/js/widgets.js', true);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ \n\n\t\t \t\t//$this->load_file('friendly_widgets', '/themes/'.THEMENAME.'/theme_assets/js/widgets.js', true);\n\n\t\t\t\t}\n\n\t\t\t}", "private function register_scripts_and_styles()\n\t\t\t{\n\n\t\t\t\tif( is_admin() )\n\t\t\t\t{\n\n\t\t \t\t//$this->load_file('friendly_widgets_admin_js', '/themes/'.THEMENAME.'/admin/js/widgets.js', true);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ \n\n\t\t \t\t//$this->load_file('friendly_widgets', '/themes/'.THEMENAME.'/theme_assets/js/widgets.js', true);\n\n\t\t\t\t}\n\n\t\t\t}", "function kesha_theme_scripts() {\n\n // Register Custom CSS\n wp_register_style( 'theme', get_template_directory_uri() . '/dist/css/built.min.css', array(), rand(111,9999), 'all' );\n\n // Enqueue Styles\n wp_enqueue_style( 'theme' );\n\n // Register JS.\n wp_register_script( 'scripts', get_template_directory_uri() . '/dist/js/built.min.js', array( 'jquery' ), rand(111,9999), TRUE );\n\n // Enqueue JS\n wp_enqueue_script( 'scripts' );\n}", "public function registerScripts()\n {\n // font awesome. choose css fonts instead of svg, see more at https://fontawesome.com/how-to-use/on-the-web/other-topics/performance\n // to name font awesome handle as `plugin-name-prefix-font-awesome5` is to prevent conflict with other plugins that maybe use older version but same handle that cause some newer icons in this plugin disappears.\n wp_enqueue_style('rundizable-wp-features-font-awesome5', plugin_dir_url(RUNDIZABLEWPFEATURES_FILE).'assets/fontawesome/css/all.min.css', [], '5.5.0');\n wp_enqueue_style('rundizable-wp-features-rd-settings-tabs-css', plugin_dir_url(RUNDIZABLEWPFEATURES_FILE).'assets/css/rd-settings-tabs.css', [], RUNDIZABLEWPFEATURES_VERSION);\n wp_enqueue_script('rundizable-wp-features-rd-settings-tabs-js', plugin_dir_url(RUNDIZABLEWPFEATURES_FILE).'assets/js/rd-settings-tabs.js', ['jquery'], RUNDIZABLEWPFEATURES_VERSION, true);\n }", "public function registerScripts()\r\n\t{\r\n\t\twp_register_style('social-shares', plugins_url('assets/social-shares.css', __FILE__));\r\n\t\twp_register_script('social-shares', plugins_url('assets/social-shares.js', __FILE__), array('jquery'), false, true);\r\n\t}", "public static function loadThemes()\n {\n $themesFolder = new Folder(ROOT . DS . 'themes');\n $themes = $themesFolder->read()[0];\n $loader = require ROOT . DS . 'vendor' . DS . 'autoload.php';\n foreach ($themes as $theme) {\n $loader->addPsr4('WasabiTheme\\\\' . $theme . '\\\\', [$themesFolder->path . DS . $theme . DS . 'src']);\n Plugin::load('WasabiTheme/' . $theme, [\n 'path' => $themesFolder->path . DS . $theme . DS,\n 'bootstrap' => true,\n 'routes' => false\n ]);\n }\n }", "function _appthemes_register_theme_scripts() {\n\n\t// Minimize prod or show expanded in dev.\n\t$min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';\n\n\trequire_once APP_THEME_FRAMEWORK_DIR . '/js/localization.php';\n\n\twp_register_script( 'colorbox', APP_THEME_FRAMEWORK_URI . \"/js/colorbox/jquery.colorbox{$min}.js\", array( 'jquery' ), '1.6.1' );\n\twp_register_style( 'colorbox', APP_THEME_FRAMEWORK_URI . \"/js/colorbox/colorbox{$min}.css\", false, '1.6.1' );\n\twp_register_style( 'font-awesome', APP_THEME_FRAMEWORK_URI . \"/lib/font-awesome/css/font-awesome{$min}.css\", false, '4.7.0' );\n\n\twp_register_script( 'footable', APP_THEME_FRAMEWORK_URI . \"/js/footable/jquery.footable{$min}.js\", array( 'jquery' ), '2.0.3' );\n\twp_register_script( 'footable-grid', APP_THEME_FRAMEWORK_URI . \"/js/footable/jquery.footable.grid{$min}.js\", array( 'footable' ), '2.0.3' );\n\twp_register_script( 'footable-sort', APP_THEME_FRAMEWORK_URI . \"/js/footable/jquery.footable.sort{$min}.js\", array( 'footable' ), '2.0.3' );\n\twp_register_script( 'footable-filter', APP_THEME_FRAMEWORK_URI . \"/js/footable/jquery.footable.filter{$min}.js\", array( 'footable' ), '2.0.3' );\n\twp_register_script( 'footable-striping', APP_THEME_FRAMEWORK_URI . \"/js/footable/jquery.footable.striping{$min}.js\", array( 'footable' ), '2.0.3' );\n\twp_register_script( 'footable-paginate', APP_THEME_FRAMEWORK_URI . \"/js/footable/jquery.footable.paginate{$min}.js\", array( 'footable' ), '2.0.3' );\n\twp_register_script( 'footable-bookmarkable', APP_THEME_FRAMEWORK_URI . \"/js/footable/jquery.footable.bookmarkable{$min}.js\", array( 'footable' ), '2.0.3' );\n\n\t_appthemes_localize_theme_scripts();\n}", "function enqueue_scripts() {\n\n\t\t//$the_theme = wp_get_theme();\n\t\t// Get the custom theme data.\n\t\twp_enqueue_style( 'styles', get_stylesheet_directory_uri() . '/css/screen.css', array(), '2.2.2' );\n\t\twp_enqueue_style( 'webfonts' , 'https://fonts.googleapis.com/css2?family=Open+Sans+Condensed:ital,wght@0,300;0,700;1,300&family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400;1,600;1,700;1,800&display=swap', array(), false);\n\n\t\t//wp_enqueue_script( 'jquery-last', get_template_directory_uri() . '/vendor/js/jquery-3.2.1.min.js', array(), '', true);\n\t\twp_enqueue_script( 'jquery-fancybox', get_template_directory_uri() . '/vendor/js/jquery.fancybox.min.js', array(), '', true);\n\t\twp_enqueue_script( 'swiper', get_template_directory_uri() . '/vendor/js/swiper.min.js', array(), '', true);\n\n\t\twp_enqueue_script( 'theme-scripts', get_template_directory_uri() . '/js/app.min.js', array('jquery', 'jquery-fancybox', 'swiper'), '2.0.1', true );\n\n\t\twp_localize_script( 'theme-scripts', 'config', array(\n\t\t\t'ajax_url'\t=>\tadmin_url('admin-ajax.php'),\n\t\t\t'site_url'\t=>\tget_bloginfo( 'url' ),\n\t\t\t'theme_url'\t=>\tget_bloginfo( 'template_url' ),\n\t\t));\n\n\t}", "public static function loadScriptsAndStyles($theme=null)\n {\n if ($theme === null && atkTheme::getInstance()->getAttribute('dialog_theme_load', true))\n {\n $theme = atkTheme::getInstance()->getAttribute('dialog_theme_name', 'alphacube');\n }\n \n atkimport('atk.ui.atkpage');\n\n $page = &atkPage::getInstance();\n $page->register_script(atkconfig('atkroot').'atk/javascript/prototype-ui/window/window.packed.js');\n $page->register_script(atkconfig('atkroot').'atk/javascript/prototype-ui-ext.js'); \n $page->register_script(atkconfig('atkroot').'atk/javascript/class.atkdialog.js');\n $page->register_style(atkconfig('atkroot').'atk/javascript/prototype-ui/window/themes/window/window.css');\n $page->register_style(atkconfig('atkroot').'atk/javascript/prototype-ui/window/themes/shadow/mac_shadow.css'); \n \n if ($theme)\n {\n $page->register_style(atkconfig('atkroot').'atk/javascript/prototype-ui/window/themes/window/'.$theme.'.css');\n } \n }", "function theme_scripts()\r\n{\r\n // Load Bootstrap\r\n\twp_enqueue_style( 'theme-bootstrap', get_theme_file_uri( '/assets/vendor/bootstrap/css/bootstrap.min.css' ));\r\n\t// Load Font-Awesome\r\n\twp_enqueue_style( 'theme-fontawesome', get_theme_file_uri( '/assets/vendor/font-awesome/css/all.min.css' ));\r\n // Theme stylesheet.\r\n\twp_enqueue_style( 'theme-style', get_stylesheet_uri() );\r\n}", "function add_theme_scripts() {\n wp_enqueue_style( 'materialize', get_template_directory_uri() . '/materialize/materialize.css', array(), '1.1', 'all' );\n wp_enqueue_style( 'materialize', get_template_directory_uri() . '/materialize/materialize.min.css', array(), '1.1', 'all' );\n wp_enqueue_style( 'style', get_stylesheet_uri() );\n\n wp_enqueue_script( 'script', get_template_directory_uri() . '/js/jquery-3.2.1.js', array ( 'jquery' ), 1.1, true);\n wp_enqueue_script( 'materialize-js', get_template_directory_uri() . '/js/materialize.js', array( 'jquery' ), 1.1, true );\n wp_enqueue_script( 'materialize-js', get_template_directory_uri() . '/js/materialize.min.js', array( 'jquery' ), 1.1, true );\n wp_enqueue_script( 'mainjs', get_template_directory_uri() . '/js/init.js', array(), 1.1, true );\n\n}" ]
[ "0.7101266", "0.705379", "0.69827694", "0.6899698", "0.6832402", "0.68117875", "0.6733613", "0.67205095", "0.6696908", "0.6695708", "0.66952455", "0.666374", "0.6651311", "0.66508657", "0.6647404", "0.6642767", "0.662506", "0.66236204", "0.66072047", "0.6562304", "0.6562304", "0.654224", "0.6531109", "0.65172255", "0.6498875", "0.6493901", "0.64916646", "0.6488588", "0.64620745", "0.64318305" ]
0.734126
0
Registers the JS files of the given maps.
public static function registerMap($map) { $maps = (array) $map; array_walk($maps, function (&$name) { $name = 'js/' . $name . '.js'; }); static::$_mapJsFiles = array_unique(array_merge(static::$_mapJsFiles, $maps)); if (static::$_mapJsFiles) { MapAsset::register(Yii::$app->getView())->js = static::$_mapJsFiles; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addJavascriptFiles($js /* array */);", "protected function registerScripts() {\n\t\tforeach (static::$scripts as $handle => $scriptPath) {\n\t\t\tstatic::registerScript($handle, $scriptPath);\n\t\t}\n\t}", "public function register_assets() {\n\n $scripts = $this->get_scripts();\n $styles = $this->get_styles();\n\n foreach ( $scripts as $handle => $script ) {\n $deps = isset( $script['deps'] ) ? $script['deps'] : false;\n\n wp_register_script( $handle, $script['src'], $deps, $script['version'], true );\n }\n\n foreach ( $styles as $handle => $style ) {\n $deps = isset( $style['deps'] ) ? $style['deps'] : false;\n\n wp_register_style( $handle, $style['src'], $deps, $style['version'] );\n }\n\n wp_localize_script( 'cbxcf-scripts', 'cbxcfObj', [\n 'ajaxurl' => admin_url( 'admin-ajax.php' ),\n 'error' => __( 'Something went wrong', 'cbxcustomform' ),\n ] );\n\n }", "private function getRequireJsMap(array $map)\n {\n $jsonMap = [];\n foreach ($map as $fileId => $fileInfo) {\n if (!in_array(pathinfo($fileId, PATHINFO_EXTENSION), ['js', 'html'])) {\n continue;\n }\n\n $fileId = '/' . $fileId; // add leading slash to match exclude patterns\n $filePath = $this->minification->addMinifiedSign(str_replace(Repository::FILE_ID_SEPARATOR, '/', $fileId));\n $filePath = substr($filePath, 1); // and remove\n $jsonMap[$filePath] = '../../../../'\n . $fileInfo['area'] . '/' . $fileInfo['theme'] . '/' . $fileInfo['locale'] . '/';\n }\n $jsonMap = json_encode($jsonMap);\n return \"require.config({\\\"config\\\": {\\\"baseUrlInterceptor\\\":{$jsonMap}}});\";\n }", "public function registerScripts() {\n $this->scripts['bootstrap.min'] = 'assets/js/bootstrap.min.js';\n $this->scripts['jquery.nouislider.min'] = 'assets/js/mkdf-ui/jquery.nouislider.min.js';\n $this->scripts['mkdf-ui-admin'] = 'assets/js/mkdf-ui/mkdf-ui.js';\n $this->scripts['mkdf-bootstrap-select'] = 'assets/js/mkdf-ui/mkdf-bootstrap-select.min.js';\n\n foreach ($this->scripts as $scriptHandle => $scriptPath) {\n sienna_mikado_register_skin_script($scriptHandle, $scriptPath);\n }\n }", "static function register_footer_scripts( $scripts ) {\n\n\t\tif ( ! empty ($scripts['google-maps-api']) ) {\n\n\t\t\t$google_maps_key = pixelgrade_option( 'google_maps_api_key' );\n\n\t\t\tif ( ! empty( $google_maps_key ) ) {\n\t\t\t\t$scripts['google-maps-api']['path'] .= '&key=' . $google_maps_key;\n\t\t\t}\n\t\t}\n\n\t\tself::register_scripts( $scripts, true );\n\t}", "public function includeGMapsJS() {\n\t\tif(self::$jsIncluded) return;\n // Google map JS\n\t\t\n\t\t//adding in a callback for jochen:\n //$this->content .= '<script src=\"http://maps.google.com/maps?hl='. $this->lang.'&file=api&amp;v=2&amp;key='.$this->googleMapKey.'\" type=\"text/javascript\">';\n\t\t$this->content .= '<script src=\"http://maps.google.com/maps?hl='. $this->lang.'&file=api&amp;v=2&amp;callback=load&amp;key='.$this->googleMapKey.'\" type=\"text/javascript\">';\n $this->content .= '</script>'.\"\\n\";\n \n // Clusterer JS\n if ($this->useClusterer==true) {\n\t\t\t// Source: http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/src/\n\t\t\t$this->content .= '<script src=\"'.$this->clustererLibraryPath.'\" type=\"text/javascript\"></script>'.\"\\n\";\n }\n \n self::$jsIncluded = true;\n\t\n\t}", "public function register_assets() {\n\n\t\tforeach ( $this->assets as $asset ) {\n\t\t\t$js_path = $this->plugin->dir() . '/js/dist/' . $asset . '.asset.php';\n\t\t\t$css_path = $this->plugin->dir() . '/css/' . $asset . '.css';\n\t\t\tif ( file_exists( $js_path ) ) {\n\t\t\t\t$assets_dep = require_once $js_path;\n\t\t\t\twp_register_script(\n\t\t\t\t\t'formation-' . $asset . '-js',\n\t\t\t\t\t$this->plugin->asset_url( 'js/dist/' . $asset . '.js' ),\n\t\t\t\t\t$assets_dep['dependencies'],\n\t\t\t\t\t$assets_dep['version'],\n\t\t\t\t\ttrue\n\t\t\t\t);\n\n\t\t\t\tif ( file_exists( $css_path ) ) {\n\t\t\t\t\twp_register_style(\n\t\t\t\t\t\t'formation-' . $asset . '-css',\n\t\t\t\t\t\t$this->plugin->asset_url( 'css/' . $asset . '.css' ),\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t$assets_dep['version']\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function addJSFiles()\n\t{\n\t\t\t\t$this->getContainer()->AddJSFile(\"include/zoombox/zoombox.js\");\n\t\t$this->getJSControl();\t\n\t}", "protected function injectFromAssetManager() {\n $asset = dirname(__FILE__) .'/js/';\n $passet = Yii::app()->assetManager->publish($asset);\n $cs = Yii::app()->clientScript;\n foreach ($this->jsFiles as $jf) {\n $cs->registerScriptFile($passet . '/' . $jf, CClientScript::POS_HEAD);\n }\n }", "public function register_assets() {\n $js_folder = SD_PLUGIN_PATH . '/src/assets/js/';\n $css_folder = SD_PLUGIN_PATH . '/src/assets/css/';\n $scripts = scandir($js_folder);\n //var_dump($scripts);\n $styles = scandir($css_folder);\n foreach ($styles as $style) {\n if( !is_dir($style) ) {\n wp_enqueue_style( URL_SCOPE . mt_rand(0, 9000), '/wp-content/plugins/'.sanitize_key(PLUGIN_NAME).'/src/assets/css/' . $style);\n }\n }\n foreach ($scripts as $script) {\n if( !is_dir($script) ) {\n wp_enqueue_script( URL_SCOPE . mt_rand(0, 9000), '/wp-content/plugins/'.sanitize_key(PLUGIN_NAME).'/src/assets/js/' . $script);\n }\n }\n }", "protected function loadJavaScripts() {}", "private function __register_scripts() {\n\t\t// Load all the registered scripts\n\t\t$assets_loader = new SwpmvcAssetsLoader();\n\t\t$assets = $assets_loader->fn_load_scripts();\n\n\t\t//Extract CSS Assets and put them into Registered CSS Container\n\t\t$this->registered_css = $assets[ 'css' ];\n\n\t\t//Extract JS Assets and put them into Registered JS Container\n\t\t$this->registered_js = $assets[ 'js' ];\n\n\t\t//Some cleanup\n\t\tunset($assets_loader);\n\t\tunset($assets);\n\n\t\t//Load all the common CSS and JS which will be required for all the pages.\n\t\t$this->fn_load_scripts();\n\t}", "public function registerAssets()\n {\n $jsTimeVal = Date('l d/m/Y H:i', $this->timestamp);\n $view = $this->getView();\n WeatherBundleAsset::register($view);\n $uuid = uniqid();\n $js = <<<JS\n var wb = new WeatherBundle({$this->lat}, {$this->lon}, '{$this->weatherUrl}', 'metric', {$this->droneModels}, '{$jsTimeVal}');\n wb.getWeather(\"{$this->imageDir}\", \"{$this->timeVal}\", {$this->callback});\n JS;\n $view->registerJs($js,View::POS_READY);\n }", "protected function addJS() {\n foreach ($this->js_files as $js_file) {\n $this->header.=\"<script type='text/javascript' src='\" . __ASSETS_PATH . \"/\" . $js_file . \"'></script> \\n\";\n }\n }", "private function registerPlugins()\n\t{\n\t\t$assetDir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR;\n\t\t$assetUrl = Yii::app()->assetManager->publish($assetDir);\n\n\n\t\t$cs = Yii::app()->getClientScript();\n\n\t\tforeach ($this->plugins as $p)\n\t\t{\n\n\t\t\tif ($p['flag'])\n\t\t\t{\n\t\t\t\tforeach ($p['js'] as $js)\n\t\t\t\t\t$cs->registerScriptFile($assetUrl . \"/\" . $js, CClientScript::POS_END);\n\t\t\t}\n\t\t}\n\t}", "public function registerScripts() {\r\n\t\t$baseUrl = Yii::app()->assetManager->publish(dirname(__FILE__).\"/assets/\".__CLASS__);\r\n\t\tYii::app()->clientScript->registerScriptFile($baseUrl.\"/AFileBrowser.js\");\r\n\t\t\r\n\t}", "public function addJSInclude($jsfiles)\n\t{\n\t\tif(!is_array($jsfiles))\n\t\t\t$jsfiles = array($jsfiles);\n\n\t\tforeach($jsfiles as $file)\n\t\t{\n\t\t\tif(!in_array($file, $this->jsIncludes))\n\t\t\t\tarray_unshift($this->jsIncludes, '<script type=\"text/javascript\" src=\"' . $file . '\"></script>');\n \t\t}\n\t}", "public function registerScripts($form)\n\t{\n\t\t\n\t}", "private function addAssets($config)\n {\n if ($config->get('built_in_css', false)) {\n $this->addAssetData('plugin://googlemaps/assets/css/googlemaps.css', 'css', null, null);\n }\n\n // need Google's library from the following URL\n $googleMapLibUri = 'https://maps.googleapis.com/maps/api/js?v=3';\n $language = $this->grav['language']->getActive();\n if ($language) {\n $googleMapLibUri .= '&language=' . $language;\n }\n $apiKey = $config->get('apiKey', false);\n if (!is_bool($apiKey)) {\n $googleMapLibUri .= '&key=' . $apiKey; // appends a Google's provided key if any\n }\n $this->addAssetData($googleMapLibUri, 'js', 3, 'bottom');\n // Use normal or minified glue depending on debugging being active\n $googleMapGlueUri = ($this->config->get('system.debugger.enabled', false))\n ? 'plugin://googlemaps/assets/js/googlemaps.js'\n : $googleMapGlueUri = 'plugin://googlemaps/assets/js/googlemaps.min.js';\n $this->addAssetData($googleMapGlueUri, 'js', 2, 'bottom');\n }", "public function add_js($js) {\n $current = $this->dwoo_data->js_files;\n $current[] = $js;\n $this->dwoo_data->js_files = $current;\n }", "private function _insertJSlibcode($usedLibs) {\n\t\tforeach ($usedLibs as $libKey=>$libValue) {\n\t\t\t$GLOBALS['TSFE']->additionalHeaderData[$this->extKey.$libKey] = '<script type=\"text/javascript\">google.load(\"'.$libKey.'\", \"'.$libValue.'\");</script>';\n\t\t}\n\t}", "function ale_map_load_scripts() {\n wp_register_script( 'google-maps-api', 'http://maps.google.com/maps/api/js?sensor=false' );\n }", "protected function injectFromGoogleApi() {\n $cs = Yii::app()->clientScript;\n foreach ($this->jsFiles as $jf) {\n $cs->registerScriptFile($this->googleApiUrl . $jf, CClientScript::POS_HEAD);\n }\n }", "public function enqueueScripts(){}", "public function register_assets() {\n\t\t\twp_enqueue_script(\n\t\t\t\t'wp_searchermain',\n\t\t\t\tget_stylesheet_directory_uri() . '/resources/scripts/denuncias/SearcherMain.js',\n\t\t\t\tarray(),\n\t\t\t\t'1.0.0',\n\t\t\t\ttrue\n\t\t\t);\n\t\t\twp_localize_script(\n\t\t\t\t'wp_searchermain',\n\t\t\t\t'wp_searchermain',\n\t\t\t\tarray(\n\t\t\t\t\t'ajax' => admin_url( 'admin-ajax.php' ),\n\t\t\t\t\t'nonce' => wp_create_nonce( 'auth_nonce' )\n\t\t\t\t)\n\t\t\t);\n }", "public function register_scripts()\n {\n }", "public function registerScripts() {\n $this->registerScriptsCommon();\n \n if(is_admin()) {\n $this->registerScriptsAdmin();\n } else {\n $this->registerScriptsFrontend();\n }\n }", "public function register_assets() {\n\t}", "function aitAdminEnqueueScriptsAndStyles()\n{\n\t$mapLanguage = get_locale();\n\taitAddScripts(array(\n\t\t'ait-googlemaps-api' => array(\n\t\t\t\t\t\t\t\t\t //'file' => 'https://maps.google.com/maps/api/js?key=AIzaSyC62AaIu5cD1nwSCmyO4-33o3DjkFCH4KE&sensor=false&amp;language='.$mapLanguage,\n\t\t\t\t\t\t\t\t\t 'file' => 'https://maps.google.com/maps/api/js?key=AIzaSyBL0QWiORKMYd585E4qvcsHcAR1R7wmdiY&sensor=false&amp;language='.$mapLanguage,\n\t\t\t\t\t\t\t\t\t 'deps' => array('jquery')\n\t\t\t\t\t\t\t\t\t ),\n\t\t'ait-jquery-gmap3' => array('file' => THEME_JS_URL . '/libs/gmap3.min.js', 'deps' => array('jquery', 'ait-googlemaps-api')),\n\t));\n}" ]
[ "0.67518306", "0.6558918", "0.6276848", "0.6230812", "0.6142105", "0.60572845", "0.60283715", "0.5963894", "0.59283364", "0.5891478", "0.58643115", "0.58173853", "0.5811111", "0.5769973", "0.57162094", "0.5711398", "0.57052994", "0.57046634", "0.568333", "0.56821173", "0.5674974", "0.5635878", "0.56203973", "0.56117034", "0.5604749", "0.55943", "0.5584938", "0.5579401", "0.5562713", "0.5551397" ]
0.7561279
0
Ensure that changes to records flush overwritten files, and update the visibility of other assets.
public function onBeforeWrite() { if (!$this->hasAssets()) { return; } // Prepare blank manipulation $manipulations = new AssetManipulationList(); // Mark overwritten object as deleted if ($this->owner->isInDB()) { $priorRecord = DataObject::get(get_class($this->owner))->byID($this->owner->ID); if ($priorRecord) { $this->addAssetsFromRecord($manipulations, $priorRecord, AssetManipulationList::STATE_DELETED); } } // Add assets from new record with the correct visibility rules $state = $this->getRecordState($this->owner); $this->addAssetsFromRecord($manipulations, $this->owner, $state); // Whitelist assets that exist in other stages $this->addAssetsFromOtherStages($manipulations); // Apply visibility rules based on the final manipulation $this->processManipulation($manipulations); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function flushAssets()\n\t{\n\t\t(new Version)->refreshMediaVersion();\n\t}", "public function flush() {\n if ($this->c_owner) {\n if ($this->update('owner', $this->owner, Project::$tableName)) {\n $this->c_owner = false;\n }\n }\n if ($this->c_name) {\n if ($this->update('name', $this->name, Project::$tableName)) {\n $this->c_name = false;\n }\n }\n if ($this->c_description) {\n if ($this->update('description', $this->description, Project::$tableName)) {\n $this->c_description = false;\n }\n }\n \n if ($this->c_deadline) {\n if ($this->update('deadline', $this->deadline, Project::$tableName)) {\n $this->c_deadline = false;\n }\n }\n if ($this->c_time) {\n if ($this->update('time', $this->time, Project::$tableName)) {\n $this->c_time = false;\n }\n }\n }", "private function checkFileUpdates() {\n\n if ($this->request->params['controller'] != 'acos' || ($this->request->params['action'] != 'admin_synchronize' && $this->request->params['action'] != 'admin_prune_acos' && $this->request->params['action'] != 'admin_build_acl')) {\n if ($this->AclManager->isControllerHashFileOutOfSync()) {\n $missingAcoNodes = $this->AclManager->getMissingAcos();\n $nodesToPrune = $this->AclManager->getAcosToPrune();\n\n $hasUpdates = false;\n\n if (count($missingAcoNodes) > 0) {\n $hasUpdates = true;\n }\n\n if (count($nodesToPrune) > 0) {\n $hasUpdates = true;\n }\n\n $this->set('nodesToPrune', $nodesToPrune);\n $this->set('missingAcoNodes', $missingAcoNodes);\n\n if ($hasUpdates) {\n $this->render('Acl.Acos/admin_has_updates');\n $this->response->send();\n $this->AclManager->updateControllerHashFile();\n exit();\n } else {\n $this->AclManager->updateControllerHashFile();\n }\n \t\t\n \t\t$this->AclManager->update_controllers_hash_file();\n }\n }\n }", "protected function processChangedAndNewFiles() {}", "public function onAfterSkippedWrite()\n {\n $this->updateChildFilesystem();\n }", "public function onAfterDelete()\n {\n if (!$this->hasAssets()) {\n return;\n }\n\n // Prepare blank manipulation\n $manipulations = new AssetManipulationList();\n\n // Add all assets for deletion\n $this->addAssetsFromRecord($manipulations, $this->owner, AssetManipulationList::STATE_DELETED);\n\n // Whitelist assets that exist in other stages\n $this->addAssetsFromOtherStages($manipulations);\n\n // Apply visibility rules based on the final manipulation\n $this->processManipulation($manipulations);\n }", "protected function afterUpdating()\n {\n }", "public function updateChildFilesystem()\n {\n // Don't synchronise on live (rely on publishing instead)\n if (class_exists(Versioned::class) && $this->hasExtension(Versioned::class) && Versioned::get_stage() === Versioned::LIVE) {\n return;\n }\n\n $this->flushCache();\n // Writing this record should trigger a write (and potential updateFilesystem) on each child\n foreach ($this->AllChildren() as $child) {\n $child->write();\n }\n }", "private function flushFileCachedValues() {\n\n foreach ( $this->getSheetNames( true ) as $sheet ) {\n\n $this->setActiveSheet( $sheet, 'name' );\n $this->activeSheet->updateCalculations();\n $this->saveActiveSheetChanges();\n }\n\n }", "function damopen_assets_library_post_update_change_public_files_to_private() {\n $connection = Database::getConnection();\n // Select the uri from the database.\n $query = $connection\n ->select('file_managed', 'fm')\n ->fields('fm', ['fid', 'uri']);\n $result = $query->execute();\n\n $fileStorage = Drupal::entityTypeManager()->getStorage('file');\n $fileSystem = Drupal::service('file_system');\n $priv_path = $fileSystem->realpath('private://');\n\n foreach ($result as $row) {\n $uri = str_replace('public://', '', $row->uri);\n $file_name = substr(strrchr($uri, '/'), 1);\n $folder = str_replace($file_name, '', $uri);\n // Check if the directory already exists.\n // Directory does not exist, so lets create it.\n if (\n !is_dir($priv_path . '/' . $folder)\n && !mkdir($concurrentDirectory = $priv_path . '/' . $folder, 0775, TRUE)\n && !is_dir($concurrentDirectory)\n ) {\n throw new RuntimeException(sprintf('Directory \"%s\" was not created', $concurrentDirectory));\n }\n\n // Move the file to the private folder.\n $new_uri = $fileSystem->move('public://' . $uri, 'private://' . $uri, FileSystemInterface::EXISTS_REPLACE);\n\n if ($new_uri !== NULL) {\n // Replace the uri with the new private schema's uri.\n /** @var \\Drupal\\file\\FileInterface $file */\n $file = $fileStorage->load($row->fid);\n $file->setFileUri($new_uri);\n $file->save();\n }\n }\n}", "public function afterSave()\n {\n if (!$this->files) {\n return;\n } else if ($this->contentAttribute) {\n $this->owner->updateAttributes([$this->contentAttribute => $this->processContentFiles(true)['content']]);\n } else {\n /** @var UploadedFile $file */\n foreach ($this->files as $key => $file) {\n $this->files[$key] = $this->saveFile($file->tempName, $file->name);\n }\n }\n $this->setAttributeValue(\\array_map(function($v){ return basename($v); }, array_filter($this->files)));\n }", "public function beforeSave()\n {\n /** @var BaseActiveRecord $model */\n $model = $this->owner;\n foreach ($this->attributes as $attribute => $attributeConfig) {\n if ($this->hasScenario($attributeConfig)) {\n if (isset($this->files[$attribute]) && $this->validateFile($this->files[$attribute])) {\n if (!$model->getIsNewRecord() && $model->isAttributeChanged($attribute)) {\n if ($this->getAttributeConfig($attributeConfig, 'unlinkOnSave') === true) {\n $this->deleteFileName[$attribute] = $this->resolveFileName($attribute, true);\n }\n }\n } else {\n // Protect attribute\n $model->$attribute = $model->getOldAttribute($attribute);\n }\n } else {\n if (!$model->getIsNewRecord() && $model->isAttributeChanged($attribute)) {\n if ($this->getAttributeConfig($attributeConfig, 'unlinkOnSave')) {\n $this->deleteFileName[$attribute] = $this->resolveFileName($attribute, true);\n }\n }\n }\n }\n $this->fileSave();\n }", "protected function processUpdates()\n {\n $this->importStaticData();\n }", "public function update(){\n parent::update();\n $this->collection = null;\n $this->files = null;\n $this->dublinCore = null;\n }", "private function postUpdate() {\n\t\t$this->info('Import finished, cleaning up.');\n\t\t$this->reCache();\n\t}", "public function flushFile()\n {\n $this->em->flush();\n }", "protected function removeSysFileReferenceRecordsFromImportDataWithRelationToMissingFile() {}", "protected function fixFiles()\n {\n\n \tforeach (glob(base_path($this->passport_path) . '*.php') as $filename)\n \t{\n \t $file = file_get_contents($filename);\n \t file_put_contents($filename, str_replace($this->laravel_model, $this->mongo_model, $file));\n \t //$this->info($filename . \" has been Checked/Modified\");\n \t}\n\n }", "function onAfterWrite(){\r\n\t\tparent::onAfterWrite();\r\n\t\t$this->cleaningUpVariationData();\r\n\t}", "protected function after_execute() {\n $this->add_related_files('block_file', 'intro', null);\n $this->add_related_files('block_file', 'file', null);\n }", "public function onBeforeWrite()\n {\n $this->getTextCache()->invalidate($this->owner);\n }", "protected function updateVisibility()\n {\n if($this->visibility === null) {\n return;\n }\n\n if ($this->instance->content->visibility != $this->visibility) {\n $this->instance->content->visibility = $this->visibility;\n\n $contentIds = [];\n foreach($this->instance->mediaList as $media) {\n $contentIds[] = $media->content->id;\n }\n\n Content::updateAll(['visibility' => $this->visibility], ['in', 'id', $contentIds]);\n }\n }", "protected function afterSave(){\n\t\tparent::afterSave();\n\t\t\n\t\tYii::app()->cache->delete('sponsorsAdDisplayPercent');\n\t}", "function checkSavedFiles(){\n\t\t \n\t\t $tableFiles = new TabOut_TableFiles;\n\t\t $baseFileName = $this->tableID;\n\t\t $tableFiles->getAllFileSizes($baseFileName);\n\t\t $this->files = $tableFiles->savedFileSizes;\n\t\t $metadata = $this->metadata;\n\t\t $tableFields = $metadata[\"tableFields\"];\n\t\t unset($metadata[\"tableFields\"]);\n\t\t $metadata[\"files\"] = $this->files;\n\t\t $metadata[\"tableFields\"] = $tableFields; //just for sake of order! :)\n\t\t $this->metadata = $metadata;\n\t\t \n\t }", "public function ApplyChanges()\n {\n parent::ApplyChanges();\n\n }", "public function reAnimate()\n {\n $this->addOrRemovePublishedAtTimeToFrontmatter();\n\n // get last modified unixtime from file\n $lastModified = filemtime($this->index_path);\n\n // check if file has been modified since last save\n if ($this->post->last_modified != $lastModified) {\n $data = $this->prepareContentData();\n $this->post = $this->content->update($this->post, $data);\n $this->addSlugToFrontmatter();\n $this->regenerateStatic($this->post->id, $this->path.'/index.md', $this->frontmatter, $this->discharger->getMarkdown());\n clearstatcache();\n $data['last_modified'] = filemtime($this->path.'/index.md');\n $this->post = $this->content->update($this->post, $data);\n }\n }", "public function flush()\n {\n if (file_exists($this->CacheFolder . \"/\" . $this->CacheIndex)) {\n unlink($this->CacheFolder . \"/\" . $this->CacheIndex);\n touch($this->CacheFolder . \"/\" . $this->CacheIndex);\n }\n if (file_exists($this->CacheFolder . \"/\" . $this->CacheDB)) {\n unlink($this->CacheFolder . \"/\" . $this->CacheDB);\n touch($this->CacheFolder . \"/\" . $this->CacheDB);\n }\n }", "public function updateSource() {\n if (!empty($this->imported)) {\n $data = $this->source->data;\n if (empty($data)) {\n $data = array();\n }\n foreach ($this->imported as $key) {\n $data[] = $key;\n }\n $this->source->data = $data;\n $this->source->last_updated = date('Y-m-d H:i:s', strtotime('now'));\n $this->source->save();\n $this->imported = array();\n }\n }", "protected function beforeUpdating()\n {\n }", "function commitChanges() {\r\n\t\tglobal $file;\r\n\t\tglobal $expenses;\r\n\r\n\t\tsortExpensesDate();\r\n\t\trenumber(&$expenses);\r\n\r\n\t\t$xmlString = toXML();\r\n\r\n\t\t$fp = fopen($file.\".bak\", \"w\");\r\n\t\tflock($fp, LOCK_EX);\r\n\t\tfputs($fp, $xmlString);\r\n\t\tflock($fp, LOCK_UN);\r\n\t\tfclose($fp);\r\n\r\n\t\tswapFiles();\r\n\t}" ]
[ "0.66175604", "0.59279233", "0.58682835", "0.5860525", "0.5831702", "0.578855", "0.578303", "0.56967306", "0.5691274", "0.5666461", "0.56320786", "0.5621597", "0.562093", "0.5562484", "0.5547433", "0.5499615", "0.5479114", "0.5458401", "0.5456594", "0.5452077", "0.54365784", "0.5433267", "0.5399764", "0.5397148", "0.53889525", "0.53678733", "0.5346857", "0.53425133", "0.53422016", "0.53386986" ]
0.68842894
0
Given a set of asset manipulations, trigger any necessary publish, protect, or delete actions on each asset.
protected function processManipulation(AssetManipulationList $manipulations) { // When deleting from stage then check if we should archive assets $archive = $this->owner->config()->get('keep_archived_assets'); // Check deletion policy $deletedAssets = $manipulations->getDeletedAssets(); if ($archive && $this->isVersioned()) { // Publish assets $this->swapAll($manipulations->getPublicAssets()); // Archived assets are kept protected $this->protectAll($deletedAssets); } else { // Remove old version $this->deleteAll($deletedAssets); // Publish assets $this->publishAll($manipulations->getPublicAssets()); } // Protect assets $this->protectAll($manipulations->getProtectedAssets()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actions(){\n $params = func_get_args();\n\n //This should be our trade object\n $tradeObject = $params[0];\n\n $this->orders = $tradeObject->getOrders();\n\n\n foreach($this->collection as $order){\n // if we cant find our order in open orders then trigger an action\n if(!$this->orderIsOpen($order->getCurrentOrderID()))\n call_user_func_array(array($order, \"action\"), $params);\n }\n\n // Merge completed orders into one order\n // there is no good reason for this other than \n // the fact that I felt like doing it. :D\n $this->mergeCompleted();\n\n\n }", "public function perform()\n {\n foreach ($this->actions as $action) {\n $action->perform();\n }\n }", "public function OnAllAction() {\n\n // get current action\n $HookName= current_filter();\n $HookNameParts= explode(' (', $HookName);\n $SearchName= isset($HookNameParts[1]) ? $HookNameParts[0] : $HookName;\n\n // find profiles containing that action and execute invalidation\n foreach($this->Profiles as $Name => $Profile) {\n if (in_array($SearchName, $Profile['InvalidatingActions'])) {\n $this->GetDealer($Name)->Invalidate($HookName);\n }\n }\n\n // search in group actions and trigger custom action if found\n foreach($this->GroupActions as $Name => $List) {\n if (in_array($HookName, $List)) {\n //$this->Log(\"[GroupAction: {$Name}] triggered by action: {$HookName}\");\n do_action(\"$Name ($HookName)\");\n }\n }\n }", "private function setup_actions() {\n\n\t\tadd_action( 'load-post.php', array( self::$instance, 'action_load_customizations' ) );\n\t\tadd_action( 'load-post-new.php', array( self::$instance, 'action_load_customizations' ) );\n\t\tadd_action( 'added_post_meta', array( self::$instance, 'update_schedule' ), 10, 4 );\n\t\tadd_action( 'updated_post_meta', array( self::$instance, 'update_schedule' ), 10, 4 );\n\t\tadd_action( 'deleted_post_meta', array( self::$instance, 'remove_schedule' ), 10, 3 );\n\t\tadd_action( 'trashed_post', array( self::$instance, 'unschedule_unpublish' ) );\n\t\tadd_action( 'untrashed_post', array( self::$instance, 'reschedule_unpublish' ) );\n\t\tadd_action( self::$cron_key, array( self::$instance, 'unpublish_post' ) );\n\t\tadd_filter( 'is_protected_meta', array( self::$instance, 'protect_meta_key' ), 10, 3 );\n\n\t\tif ( wp_next_scheduled( self::$deprecated_cron_key ) ) {\n\t\t\tadd_action( self::$deprecated_cron_key, array( self::$instance, 'unpublish_content' ) );\n\t\t}\n\t}", "public function onBeforeWrite()\n {\n if (!$this->hasAssets()) {\n return;\n }\n\n // Prepare blank manipulation\n $manipulations = new AssetManipulationList();\n\n // Mark overwritten object as deleted\n if ($this->owner->isInDB()) {\n $priorRecord = DataObject::get(get_class($this->owner))->byID($this->owner->ID);\n if ($priorRecord) {\n $this->addAssetsFromRecord($manipulations, $priorRecord, AssetManipulationList::STATE_DELETED);\n }\n }\n\n // Add assets from new record with the correct visibility rules\n $state = $this->getRecordState($this->owner);\n $this->addAssetsFromRecord($manipulations, $this->owner, $state);\n\n // Whitelist assets that exist in other stages\n $this->addAssetsFromOtherStages($manipulations);\n\n // Apply visibility rules based on the final manipulation\n $this->processManipulation($manipulations);\n }", "public function implement_all_effects()\n\t{\n\t\tforeach ($this->collection as $image)\n\t\t{\n\t\t\t$image->implement_effects();\n\t\t}\n\t}", "function process_bulk_action() {\n global $wbdb;\n \n //Detect when a bulk action is being triggered...\n if( 'delete'===$this->current_action() ) {\n #wp_die('Items deleted (or they would be if we had items to delete)!');\n #$wpdb->query(\"DELETE FROM {$wpdb->prefix}amazon_listings WHERE id = ''\",)\n }\n\n if( 'verify'===$this->current_action() ) {\n\t\t\t#echo \"<br>verify handler<br>\";\t\t\t\n }\n \n }", "public function actions() {\n\t\tadd_action( 'wp_loaded', array( $this, 'generate_data' ) );\n\t\tadd_action( 'wp_loaded', array( $this, 'update_storage_site' ) );\n\t\tadd_action( 'wp_loaded', array( $this, 'update_storage_network' ) );\n\t}", "private function actions()\n {\n }", "public function run()\n {\n\t\t$policies = Policy::get(); \n\t\t$resources = Resource::get(); \n\n\t\tforeach($policies as $policy) {\n\t\t\tforeach($resources as $resource) {\n\t\t\t\t$policy->resources()->attach($resource); \n\t\t\t}\n\t\t}\n }", "private function iterate_actions( $when ) {\n\t\t// general\n\t\tdo_action( \"astoundify_import_content_{$when}_{$this->get_action()}_item\", $this );\n\n\t\t// type\n\t\tdo_action( \"astoundify_import_content_{$when}_{$this->get_action()}_item_type_{$this->get_type()}\", $this );\n\n\t\t// object type\n\t\tif ( isset( $this->item['data']['post_type'] ) ) {\n\t\t\t$object_type = $this->item['data']['post_type'];\n\n\t\t\tdo_action( \"astoundify_import_content_{$when}_{$this->get_action()}_item_type_{$object_type}\", $this );\n\t\t}\n\n\t\t// item\n\t\tdo_action( \"astoundify_import_content_{$when}_{$this->get_action()}_item_{$this->get_id()}\", $this );\n\t}", "public function\n\t\tdo_actions()\n\t{\n\t}", "public static function setup_actions() {\n\t\tadd_action(\n\t\t\t'astoundify_import_content_after_import_item_type_object',\n\t\t\tarray( __CLASS__, 'set_products' )\n\t\t);\n\t}", "public function bulk_action_scripts() {\n\t\t \tglobal $post_type;\n\t\t\tif( $post_type == 'shop_order' ) {\n\t\t\t\twp_register_script(\n\t\t\t\t\t'dropbox-export',\n\t\t\t\t\tplugins_url( 'js/dropbox-export.js' , dirname(__FILE__) ),\n\t\t\t\t\tarray( 'jquery', 'thickbox' )\n\t\t\t\t);\n\t\t\t\twp_enqueue_script( 'dropbox-export' );\n\t\t\t\twp_enqueue_style( 'thickbox' );\n\t\t\t}\n\n\t\t}", "public function admin_table_bulk_actions($actions)\n {\n }", "public function distribution() {\n if (isset($_POST[\"filter\"])) {\n $this->admin_filter();\n }\n if (isset($_POST[\"add\"])) {\n $this->add_media();\n }\n if (isset($_POST[\"delete\"])) {\n $this->delete_media();\n }\n if (isset($_POST[\"modify\"])) {\n $this->modify_media();\n }\n }", "protected function publishApprovalsFiles(): void\n {\n $this->call('vendor:publish', [\n '--tag' => 'migrations',\n '--provider' => \"Nesiasoft\\Core\\Approvals\\ApprovalsServiceProvider\",\n ]);\n\n $this->call('vendor:publish', [\n '--tag' => 'config',\n '--provider' => \"Nesiasoft\\Core\\Approvals\\ApprovalsServiceProvider\",\n ]);\n }", "public function run()\n {\n $policies = config('policies.policies');\n\n foreach ($policies as $roleName => $permissions) {\n $role = Role::where('name', $roleName)->first();\n\n foreach ($permissions as $permissionName) {\n $permission = Permission::where('name', $permissionName)->first();\n\n $role->givePermissionTo($permission);\n }\n }\n }", "public function action()\n {\n foreach ($this->actions as $action) {\n $action->run();\n }\n }", "protected function checkAllScheduledByAction(array $objects, string $action): void\n {\n foreach ($objects as $object) {\n $this->postResetPermissions[] = $object;\n\n if ('delete' !== $action) {\n $this->getObjectFilter()->restore($object);\n }\n }\n }", "public function process_bulk_action() \n\t{\n\t\t$action = $this->current_action();\n\t\t\n\t\tif ( $action and array_key_exists( $action, $this->bulkActions ) )\n\t\t{\n\t\t\t$class = $this->activeRecordClass;\n\t\t\tforeach( $_POST[ 'item' ] as $item_id )\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$item = $class::load( $item_id );\n\t\t\t\t\tif ( is_callable( array( $item, $action ) ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tcall_user_func( array( $item, $action ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch( \\Exception $e ) { }\n\t\t\t}\n\t\t}\n\t}", "public function bulkAction()\r\n {\r\n $this->checkIfDemo();\r\n $this->AdminJobModel->bulkAction();\r\n }", "private function processAssets()\n {\n $js = $this->assetmanager->getAssetHandler('js');\n\n $afh = new \\Core\\Asset\\AssetFileHandler();\n $afh->setFilename($this->config->get('Core', 'dir.cache') . '/script.js');\n $afh->setTTL($this->config->get('Core', 'cache.ttl.js'));\n\n $js->setFileHandler($afh);\n\n $css = $this->assetmanager->getAssetHandler('css');\n\n $theme = $this->config->get('Core', 'style.theme.name');\n\n $css->addProcessor(new \\Core\\Asset\\Processor\\ReplaceProcessor('../fonts/', '../Themes/' . $theme . '/fonts/'));\n $css->addProcessor(new \\Core\\Asset\\Processor\\ReplaceProcessor('../img/', '../Themes/' . $theme . '/img/'));\n\n $afh = new \\Core\\Asset\\AssetFileHandler();\n $afh->setFilename($this->config->get('Core', 'dir.cache') . '/style.css');\n $afh->setTTL($this->config->get('Core', 'cache.ttl.css'));\n\n $css->setFileHandler($afh);\n\n foreach ($this->apps as $app) {\n foreach ($app->javascript as $aio) {\n $js->addObject($aio);\n }\n\n foreach ($app->css as $aio) {\n $css->addObject($aio);\n }\n }\n\n // Process assets\n $this->assetmanager->process();\n }", "private function hooks() {\n // stripe non3ds refund\n add_action( 'dokan_refund_request_created', [ $this, 'process_refund' ] );\n add_filter( 'dokan_refund_approve_vendor_refund_amount', [ $this, 'vendor_refund_amount_non_3ds' ], 10, 3 );\n add_action( 'dokan_refund_approve_before_insert', [ $this, 'add_vendor_withdraw_entry_non_3ds' ], 10, 3 );\n\n // process 3ds refund\n add_action( 'dokan_refund_request_created', [ $this, 'process_3ds_refund' ] );\n add_filter( 'dokan_refund_approve_vendor_refund_amount', [ $this, 'vendor_refund_amount_3ds' ], 10, 3 );\n add_action( 'dokan_refund_approve_before_insert', [ $this, 'add_vendor_withdraw_entry_3ds' ], 10, 3 );\n }", "protected function protectAll($assets)\n {\n if (empty($assets)) {\n return;\n }\n $store = $this->getAssetStore();\n foreach ($assets as $asset) {\n $store->protect($asset['Filename'], $asset['Hash']);\n }\n }", "function process_bulk_action() {\n\t\t\n\t\t//Detect when a bulk action is being triggered...\n\t\tif( 'delete'=== $this->current_action() ) {\n\t\t\twp_die( 'Items deleted (or they would be if we had items to delete)!' );\n\t\t}\n\t\t\n\t}", "public function run()\n {\n $permissions = [\n 'product_create',\n 'product_show',\n 'product_edit',\n 'product_delete'\n ];\n\n $user = Role::findByName('admin');\n\n foreach ($permissions as $permission) {\n $user->givePermissionTo($permission);\n }\n }", "public function performMultipleAction(){\r\n\t\tif(Request::ajax()){\r\n\t\t\t$actionType = ((Input::get('type'))) ? Input::get('type') : '';\r\n\t\t\tif(!empty($actionType) && !empty(Input::get('ids'))){\r\n\t\t\t\tif($actionType\t==\t'active'){\r\n\t\t\t\t\tBlog::whereIn('id', Input::get('ids'))->update(array('status' => ACTIVE));\r\n\t\t\t\t}\r\n\t\t\t\telseif($actionType\t==\t'inactive'){\r\n\t\t\t\t\tBlog::whereIn('id', Input::get('ids'))->update(array('status' => 0));\r\n\t\t\t\t}\r\n\t\t\t\telseif($actionType\t==\t'delete'){\r\n\t\t\t\t\tBlog::whereIn('id', Input::get('ids'))->delete();\r\n\t\t\t\t}\r\n\t\t\t\tSession::flash('success', trans(\"messages.global.action_performed_message\")); \r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function performActions()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$this->performActionList();\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$this->errorsNonFatal[htmlspecialcharsEx($e->getCode())] = htmlspecialcharsEx($e->getMessage());\n\t\t}\n\t}", "public function onAfterDelete()\n {\n if (!$this->hasAssets()) {\n return;\n }\n\n // Prepare blank manipulation\n $manipulations = new AssetManipulationList();\n\n // Add all assets for deletion\n $this->addAssetsFromRecord($manipulations, $this->owner, AssetManipulationList::STATE_DELETED);\n\n // Whitelist assets that exist in other stages\n $this->addAssetsFromOtherStages($manipulations);\n\n // Apply visibility rules based on the final manipulation\n $this->processManipulation($manipulations);\n }" ]
[ "0.60173655", "0.58534074", "0.57009554", "0.55504906", "0.5447694", "0.5443552", "0.542013", "0.53905857", "0.53546125", "0.5334522", "0.5262782", "0.5244542", "0.5243241", "0.5241503", "0.52274954", "0.52269995", "0.52255386", "0.52150524", "0.51883805", "0.5181081", "0.51739943", "0.5172638", "0.5157503", "0.51556325", "0.50914806", "0.50861377", "0.50785714", "0.5046849", "0.50350857", "0.50271285" ]
0.6238898
0
Given a record, add all assets it contains to the given manipulation. State can be declared for this record, otherwise the underlying DataObject will be queried for canView() to see if those assets are public
protected function addAssetsFromRecord(AssetManipulationList $manipulation, DataObject $record, $state) { // Find all assets attached to this record $assets = $this->findAssets($record); if (empty($assets)) { return; } // Add all assets to this stage foreach ($assets as $asset) { $manipulation->addAsset($asset, $state); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function onBeforeWrite()\n {\n if (!$this->hasAssets()) {\n return;\n }\n\n // Prepare blank manipulation\n $manipulations = new AssetManipulationList();\n\n // Mark overwritten object as deleted\n if ($this->owner->isInDB()) {\n $priorRecord = DataObject::get(get_class($this->owner))->byID($this->owner->ID);\n if ($priorRecord) {\n $this->addAssetsFromRecord($manipulations, $priorRecord, AssetManipulationList::STATE_DELETED);\n }\n }\n\n // Add assets from new record with the correct visibility rules\n $state = $this->getRecordState($this->owner);\n $this->addAssetsFromRecord($manipulations, $this->owner, $state);\n\n // Whitelist assets that exist in other stages\n $this->addAssetsFromOtherStages($manipulations);\n\n // Apply visibility rules based on the final manipulation\n $this->processManipulation($manipulations);\n }", "protected function addAssetsFromOtherStages(AssetManipulationList $manipulation)\n {\n // Skip unversioned or unsaved assets\n if (!$this->isVersioned() || !$this->owner->isInDB()) {\n return;\n }\n\n // Unauthenticated member to use for checking visibility\n $baseClass = $this->owner->baseClass();\n $baseTable = $this->owner->baseTable();\n $filter = [\n Convert::symbol2sql(\"{$baseTable}.ID\") => $this->owner->ID,\n ];\n $stages = $this->owner->getVersionedStages(); // {@see Versioned::getVersionedStages}\n foreach ($stages as $stage) {\n // Skip current stage; These should be handled explicitly\n if ($stage === Versioned::get_stage()) {\n continue;\n }\n\n // Check if record exists in this stage\n $record = Versioned::get_one_by_stage($baseClass, $stage, $filter);\n if (!$record) {\n continue;\n }\n\n // Check visibility of this record, and record all attached assets\n $state = $this->getRecordState($record);\n $this->addAssetsFromRecord($manipulation, $record, $state);\n }\n }", "public function addAssets() {}", "public function addAssets() {}", "public function onAfterDelete()\n {\n if (!$this->hasAssets()) {\n return;\n }\n\n // Prepare blank manipulation\n $manipulations = new AssetManipulationList();\n\n // Add all assets for deletion\n $this->addAssetsFromRecord($manipulations, $this->owner, AssetManipulationList::STATE_DELETED);\n\n // Whitelist assets that exist in other stages\n $this->addAssetsFromOtherStages($manipulations);\n\n // Apply visibility rules based on the final manipulation\n $this->processManipulation($manipulations);\n }", "private function setAssetsFromData()\n {\n if (is_array($this->assetData)) {\n $assets = $this->grav['assets'];\n foreach ($this->assetData as $item) {\n $assetType = $item['type'];\n if ($assetType == 'css') {\n $assets->addCss($item['data']);\n } elseif ($assetType == 'js') {\n $assets->addJs($item['data'], $item['prio'], true, null, $item['where']);\n } elseif ($assetType == 'inlinejs') {\n $assets->addInlineJs($item['data'], $item['prio'], $item['where']);\n }\n }\n }\n }", "public function addAdminAssets() {}", "public function loadAssetFromRecord($record=null, $noHydrate = false) {\n\t\tif(!$record && !$this->assetObject) {\n\t\t\treturn;\n\t\t}\n\n\t\tif($record) {\n\t\t\t$this->assetObject = $record;\t\n\t\t}\n\n\n\t\t$this->templateId = $record->getTemplateId();\n\t\t$this->setGlobalValue(\"readyForDisplay\", $record->getReadyForDisplay());\n\t\t$this->setGlobalValue(\"templateId\", $record->getTemplateId());\n\t\t$this->setGlobalValue(\"collectionId\", $record->getCollectionId());\n\t\t$this->setGlobalValue(\"availableAfter\", $record->getAvailableAfter());\n\t\t$this->setGlobalValue(\"modified\", $record->getModifiedAt());\n\t\t$this->setGlobalValue(\"modifiedBy\", $record->getModifiedBy());\n\t\t$this->setGlobalValue(\"deletedBy\", $record->getDeletedBy());\n\t\t$this->setGlobalValue(\"deleted\", $record->getDeleted());\n\t\t$this->setGlobalValue(\"deletedAt\", $record->getDeletedAt());\n\t\t$this->setGlobalValue(\"csvBatch\", $record->getCSVImport()?$record->getCSVImport()->getId():null);\n\n\t\tif($noHydrate) {\n\t\t\treturn;\n\t\t}\n\n\t\tif($this->loadWidgetsFromArray($record->getWidgets())) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "protected function findAssets(DataObject $record)\n {\n // Search for dbfile instances\n $files = [];\n $fields = DataObject::getSchema()->fieldSpecs($record);\n foreach ($fields as $field => $db) {\n $fieldObj = $record->$field;\n if (!($fieldObj instanceof DBFile)) {\n continue;\n }\n\n // Omit variant and merge with set\n $next = $record->dbObject($field)->getValue();\n unset($next['Variant']);\n if ($next) {\n $files[] = $next;\n }\n }\n\n // De-dupe\n return array_map(\"unserialize\", array_unique(array_map(\"serialize\", $files ?? [])));\n }", "public function addAsset() {\n try {\n if (!($this->asset instanceof Base_Model_ObtorLib_App_Core_Asset_Entity_Asset)) {\n throw new Base_Model_ObtorLib_App_Core_Asset_Exception(\" Asset Asset Entity not initialized\");\n } else {\n $objAsset = new Base_Model_ObtorLib_App_Core_Asset_Dao_Asset();\n $objAsset->asset = $this->asset;\n return $objAsset->addAsset();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Asset_Exception($ex);\n }\n }", "protected function processManipulation(AssetManipulationList $manipulations)\n {\n // When deleting from stage then check if we should archive assets\n $archive = $this->owner->config()->get('keep_archived_assets');\n\n // Check deletion policy\n $deletedAssets = $manipulations->getDeletedAssets();\n if ($archive && $this->isVersioned()) {\n // Publish assets\n $this->swapAll($manipulations->getPublicAssets());\n // Archived assets are kept protected\n $this->protectAll($deletedAssets);\n } else {\n // Remove old version\n $this->deleteAll($deletedAssets);\n // Publish assets\n $this->publishAll($manipulations->getPublicAssets());\n }\n\n // Protect assets\n $this->protectAll($manipulations->getProtectedAssets());\n }", "function slidedeck_lens_manage_entry_actions( $lens, $is_writable ) {\n $namespace = $this->slidedeck_namespace;\n\n include( SLIDEDECK2_DEVELOPER_DIRNAME . '/views/_lens-manage-entry-actions.php' );\n }", "function add($record)\n {\n $data = get_object_vars($record);\n $this->rest->initialize(array('server' => REST_SERVER));\n $this->rest->option(CURLOPT_PORT, REST_PORT);\n $retrieved = $this->rest->post('recipe/maintenance/item/id/' . $record->menu_id.'-'.$record->inventory_id, $data);\n }", "public function loadAssets()\n {\n add_action('admin_enqueue_scripts', [$this, 'enqueueAdminAssets']);\n add_filter('script_loader_tag', [$this, 'addAssetAttribute'], 10, 3);\n }", "public function add(Record $record)\n {\n $this->list[] = $record;\n }", "private function addAssets()\n {\n foreach (config('asgard.media.assets.media-partial-assets', []) as $assetName => $path) {\n $path = $this->assetFactory->make($path)->url();\n $this->assetManager->addAsset($assetName, $path);\n }\n }", "public static function addCraft()\n\t\t{\n\t\t\t$stageDBO = DatabaseObjectFactory::build('material');\n\t\t\t$arr = ['material_id','unit_price','name'];\n\t\t\t$stageDBO->SetJoin(['[><]item' => 'item_id']);\n\t\t\t$materials = $stageDBO->getRecords($arr);\n\t\t\tinclude('views/pages/addCraft.php');\n\t\t}", "public function load(ORM $record)\n\t{\n\t\t$restocks = [];\n\t\t$records = $record->restocks->find_all();\n\t\tforeach($records as $r)\n\t\t{\n\t\t\t$restocks[] = array_merge($r->as_array(), ['item_name' => $r->item->name]);\n\t\t}\n\t\treturn array('restocks' => $restocks);\n\t}", "protected function createAudit($record, $mutation = 'delete')\n {\n $needle = get_class($this->owner);\n $hayStack = self::config()->get('audit_exclusions');\n // Early exit on exclusions\n if (in_array($needle, $hayStack)) {\n return;\n }\n\n $auditId = Audit::create()->update([\n Audit::DB_MODEL_NAME => $this->owner->getField('ClassName'),\n Audit::DB_MODEL_ID => $this->owner->getField('ID'),\n Audit::DB_MUTATION_PEFORMED => $mutation\n ])->write();\n\n foreach ($record as $key => $value) {\n AuditValue::create()\n ->setField(AuditValue::DB_FIELD, $key)\n ->setField(AuditValue::DB_PREVIOUS_VALUE, $value)\n ->setField(AuditValue::HAS_ONE_AUDIT_ID, $auditId)\n ->write();\n }\n }", "public function assets()\n {\n return $this->morphMany(Asset::class, 'assetable');\n }", "public function assets()\n {\n return $this->morphToMany('HugoKalidas\\LaravelFlexCms\\Assets\\Assets' , 'assetable');\n }", "public function addChild(Doctrine_Record $record);", "public function store($updateNulls = false)\n\t{\t\t\n\t\t// always an insert\t\t\n\t\t$stored = $this->_db->insertObject($this->_tbl, $this, $this->_tbl_key);\n\n\t\t// If the store failed return false.\n\t\tif (!$stored)\n\t\t{\n\t\t\t$e = new JException(JText::sprintf('JLIB_DATABASE_ERROR_STORE_FAILED', get_class($this), $this->_db->getErrorMsg()));\n\t\t\t$this->setError($e);\n\t\t\treturn false;\n\t\t}\n\n\t\t// If the table is not set to track assets return true.\n\t\tif (!$this->_trackAssets) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ($this->_locked) {\n\t\t\t$this->_unlock();\n\t\t}\n\n\t\t//\n\t\t// Asset Tracking\n\t\t//\n\n\t\t$parentId\t= $this->_getAssetParentId();\n\t\t$name\t\t= $this->_getAssetName();\n\t\t$title\t\t= $this->_getAssetTitle();\n\n\t\t$asset\t= JTable::getInstance('Asset');\n\t\t$asset->loadByName($name);\n\n\t\t// Check for an error.\n\t\tif ($error = $asset->getError())\n\t\t{\n\t\t\t$this->setError($error);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Specify how a new or moved node asset is inserted into the tree.\n\t\tif (empty($this->asset_id) || $asset->parent_id != $parentId) {\n\t\t\t$asset->setLocation($parentId, 'last-child');\n\t\t}\n\n\t\t// Prepare the asset to be stored.\n\t\t$asset->parent_id\t= $parentId;\n\t\t$asset->name\t\t= $name;\n\t\t$asset->title\t\t= $title;\n\t\tif ($this->_rules instanceof JRules) {\n\t\t\t$asset->rules = (string) $this->_rules;\n\t\t}\n\n\t\tif (!$asset->check() || !$asset->store($updateNulls))\n\t\t{\n\t\t\t$this->setError($asset->getError());\n\t\t\treturn false;\n\t\t}\n\n\t\tif (empty($this->asset_id))\n\t\t{\n\t\t\t// Update the asset_id field in this table.\n\t\t\t$this->asset_id = (int) $asset->id;\n\n\t\t\t$query = $this->_db->getQuery(true);\n\t\t\t$query->update($this->_db->quoteName($this->_tbl));\n\t\t\t$query->set('asset_id = '.(int) $this->asset_id);\n\t\t\t$query->where($this->_db->quoteName($k).' = '.(int) $this->$k);\n\t\t\t$this->_db->setQuery($query);\n\n\t\t\tif (!$this->_db->query())\n\t\t\t{\n\t\t\t\t$e = new JException(JText::sprintf('JLIB_DATABASE_ERROR_STORE_FAILED_UPDATE_ASSET_ID', $this->_db->getErrorMsg()));\n\t\t\t\t$this->setError($e);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function addAssets()\n {\n $this->addJs('../../graphreport/assets/d3.js');\n $this->addJs('../../graphreport/assets/c3.js');\n $this->addCss('../../graphreport/assets/c3.css'); \n }", "private function _addTags()\n {\n $metadata = $this->getRecordMetadata();\n $this->_record->addTags($metadata[self::TAGS]);\n }", "public function addAudit(Audit $audit);", "public function isAssetAclEnabled()\n {\n $assetFieldAlias = $this->getFieldAlias('asset_id');\n\n if ( $this->hasField($assetFieldAlias) && $this->isAssetsTracked() )\n {\n return true;\n }\n\n return false;\n }", "private function add_record_or_update_record() {\n\t\t\t$this->before_custom_save();\n\t\t\t$this->before_save();\n\t\t\tif($this->new_record) {\n\t\t\t\t$this->before_create();\n\t\t\t\t$result = $this->add_record();\n\t\t\t\t$this->after_create();\n\t\t\t} else {\n\t\t\t\t$this->before_update();\n\t\t\t\t$result = $this->update_record();\n\t\t\t\t$this->after_update();\n\t\t\t}\n\t\t\t$this->after_save();\n\n\t\t\t// init user custom cache\n\t\t\tif (is_array($this->cache)) {\n\t\t\t\t$this->rebuild_cache();\n\t\t\t}\n\n\t\t\tif($this->blob_fields) {\n\t\t\t\t$this->update_blob_fields();\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "public static function prepare($record) {\n $fieldRepo = Field::getRepository();\n /**\n * @var FieldEntity[] $fields\n */\n $fields = $fieldRepo->findBy(['is_hidden' => false, 'organisation' => Apollo::getInstance()->getUser()->getOrganisationId()]);\n /**\n * @var FieldEntity $field\n */\n foreach($fields as $field) {\n $record->findOrCreateData($field->getId());\n }\n }", "public function loadAssets()\r\n {\r\n $this->app->document->addStylesheet('elements:imagebox/assets/css/edit.css');\r\n return parent::loadAssets();\r\n }" ]
[ "0.5983292", "0.59673995", "0.5171399", "0.5171399", "0.48691416", "0.48545712", "0.4832955", "0.48314267", "0.47808412", "0.4565236", "0.45315292", "0.44944543", "0.44396025", "0.41933188", "0.418899", "0.41816735", "0.4172173", "0.41716185", "0.4140145", "0.41389728", "0.41211343", "0.41071048", "0.40909785", "0.40863654", "0.4053476", "0.40429926", "0.40125144", "0.40119672", "0.40007004", "0.40002528" ]
0.77252924
0
Constructor method for FindMeetingTimeCandidatesResponseMessageType
public function __construct(\ArrayType\EwsArrayOfMeetingTimeCandidate $meetingTimeCandidates) { $this ->setMeetingTimeCandidates($meetingTimeCandidates); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function setMeetingReminders($meeting_id,$chosen_time=false) {\n $mtg = Meeting::findOne($meeting_id);\n if ($chosen_time ===false) {\n $chosen_time = Meeting::getChosenTime($meeting_id);\n }\n // create attendees list for organizer and participants\n $attendees = array();\n $attendees[0]=$mtg->owner_id;\n $cnt =1;\n foreach ($mtg->participants as $p) {\n if ($p->status ==Participant::STATUS_DEFAULT) {\n $attendees[$cnt]=$p->participant_id;\n $cnt+=1;\n }\n }\n // for each attendee\n foreach ($attendees as $a) {\n // for their reminders\n $rems = Reminder::find()->where(['user_id'=>$a])->all();\n foreach ($rems as $rem) {\n // create a meeting reminder for that reminder at that time\n MeetingReminder::create($meeting_id,$a,$rem->id,$rem->duration);\n }\n }\n }", "public function __construct($_tzFrom = null, $_tzTo = null){\n $this->_resultFormatNames = array_keys(self::$_resultFormats);\n $this->setInstanceTimezones($_tzFrom, $_tzTo);\n }", "public function __construct(\n $in_results_per_page = 0, ///< An integer that defines how many results per page you want to see. 0 (default) is all in one page.\n c_comdef_meeting_search_manager &$in_parent = null, ///< A reference to an existing c_comdef_meeting_search_manager object.\n c_comdef_meetings &$in_search_results = null, ///< A reference to some pre-parsed search results.\n $in_pageno = 0 ///< An integer. The page of the main search this is from.\n ) {\n // If this is a page of results, we set up the object to reference the root.\n if ($in_parent instanceof c_comdef_meeting_search_manager) {\n $this->_my_root = $in_parent;\n // These all reference the root object's values.\n $this->_formats = $in_parent->_formats;\n $this->_formats_comparison_operator = $in_parent->_formats_comparison_operator;\n $this->_service_bodies = $in_parent->_service_bodies;\n $this->_languages = $in_parent->_languages;\n $this->_weekdays = $in_parent->_weekdays;\n $this->_venue_types = $in_parent->_venue_types;\n $this->_start_after = $in_parent->_start_after;\n $this->_start_before = $in_parent->_start_before;\n $this->_end_before = $in_parent->_end_before;\n $this->_min_duration = $in_parent->_min_duration;\n $this->_max_duration = $in_parent->_max_duration;\n $this->_search_radius = $in_parent->_search_radius;\n $this->_search_center_long = $in_parent->_search_center_long;\n $this->_search_center_lat = $in_parent->_search_center_lat;\n $this->_search_string = $in_parent->_search_string;\n $this->_meeting_id_array = $in_parent->_meeting_id_array;\n $this->_published_search = $in_parent->_published_search;\n \n $this->_my_server = $in_parent->_my_server;\n \n // These may get changed by this instance.\n $this->sort_array = $in_parent->sort_array;\n $this->sort_desc = $in_parent->sort_desc;\n \n // These are passed in and set at construction\n $this->_pageno = $in_pageno;\n $this->_search_results = $in_search_results;\n } else // If we are the root object, we start clean.\n {\n // See if the caller has requested a number of results per page.\n if ($in_results_per_page) {\n $this->_results_per_page = $in_results_per_page;\n }\n \n $this->_my_server = c_comdef_server::MakeServer(); // We initialize the server.\n \n $this->SetUpFormats(); // We set the formats array.\n $this->SetUpServiceBodies(); // We set the Service Bodies array.\n $this->SetUpLanguages(); // We set the Languages array.\n \n // Set up the weekday array (1 = Sunday, 7 = Saturday ).\n $this->_weekdays = null;\n for ($wd = 1; $wd < 8; $wd++) {\n $this->_weekdays[$wd] = 0;\n }\n\n $this->_venue_types = null;\n $this->_venue_types[VenueType::IN_PERSON] = 0;\n $this->_venue_types[VenueType::VIRTUAL] = 0;\n $this->_venue_types[VenueType::HYBRID] = 0;\n\n // This is the default sort.\n $this->sort_array = array ( \"lang_enum\", \"weekday_tinyint\", \"start_time\", \"id_bigint\" );\n \n // We have no search parameters or results at this point.\n }\n }", "public function __construct($type, $message, $user_id = null, $datetime = null, $remote_ip = null) {\t\t\n\t\t$this->eventType = $type;\n\t\t$this->message = $message;\n\t\t$this->user_id = $user_id;\n\t\t$this->datetime = $datetime;\n\t\t$this->remote_ip = $remote_ip;\n\t}", "public function __construct($column)\n {\n $this -> hourMeeting = $column;\n }", "public function __construct() {\n parent::__construct();\n\t\t$this->defineName(\"candidates\");\n }", "public function __construct($timeslots)\n {\n $this->timeslots = $timeslots;\n }", "public function createRoom(Request $request)\n {\n $user = Auth::user();\n $user_type = 0;\n $invited_user = 0;\n $user_id = 0;\n $topic_id = $request->topic_id;\n if (empty($topic_id)) {\n $topic_id = 0;\n }\n $client_time_zone = UserHelper::getTimeZone($user->id);\n $current_time = Carbon::now($client_time_zone);\n $get_partner_info = UserHelper::getPartnerInfo($request->partner_id);\n if ($get_partner_info[0] == 1) {\n return response()->json([\n 'success' => false,\n 'message' => __('messages.provider_in_call_message')\n ]);\n }\n if ($get_partner_info[1] == 1) {\n $client_id = UserHelper::getClientId($user->id);\n if (UserHelper::userMoney($user->id) != 1) {\n return response()->json([\n 'success' => false,\n 'message' => __('messages.user_have_money_message')\n ]);\n }\n $carbon_after = new Carbon($current_time);\n $after_time = $carbon_after->addMinutes(15);\n $carbon_befor = new Carbon($current_time);\n $befor_time = $carbon_befor->subMinutes(15);\n\n //check if the service provider has another booking in same time\n $provider_Appointments = Appointment::where('service_provider_id', $request->partner_id)\n ->where('start_time', '=', $current_time)\n ->where('client_id', '!=', $client_id)\n ->first();\n\n //check if ther is an appointment at this time\n $provider_Appointments_after_time = Appointment::where('service_provider_id', $request->partner_id)\n ->where('start_time', '<=', $after_time)\n ->where('start_time', '>=', $befor_time)\n ->where('client_id', '!=', $client_id)\n ->first();\n $provider_Appointments_befor_time = Appointment::where('service_provider_id', $request->partner_id)\n ->where('end_time', '<=', $after_time)\n ->where('end_time', '>=', $befor_time)\n ->where('client_id', '!=', $client_id)\n ->first();\n // check if the appointment is reserved\n if (!empty($provider_Appointments) ||\n (!empty($provider_Appointments_befor_time)) ||\n (!empty($provider_Appointments_after_time))) {\n\n // return false response\n return response()->json([\n 'success' => false,\n 'message' => __('messages.provider_in_call_message')\n ]);\n }\n\n $invited_user = ServiceProvider::findOrFail($request->partner_id);\n $user_id = $invited_user->user_id;\n if (empty($request->room_name)) {\n $room_name = str_random(6);\n } else {\n $room_name = $request->room_name;\n }\n Cache::put($user_id, $room_name, 10);\n Cache::put(\n $room_name,\n [$client_id,\n $request->partner_id,\n $request->call_type,\n $topic_id\n ],\n 20\n );\n $client = new Client($this->sid, $this->token);\n \n $exists = $client->video->rooms->read([\n 'uniqueName' => $room_name\n ]);\n\n if (empty($exists)) {\n $client->video->rooms->create([\n 'uniqueName' => $room_name,\n 'type' => 'group',\n 'recordParticipantsOnConnect' => false,\n ]);\n }\n $this->sendPushNotification(\n $user_id,\n $room_name,\n $request->call_type,\n $user->id//caller id\n );\n\n return response()->json([\n 'room_name' => $room_name\n ]);\n } else {\n $appointment = Appointment::where('start_time', '<=', $current_time)\n ->where('end_time', '>=', $current_time)\n ->where('call_type', '=', $request->call_type)\n ->where('status', '=', Appointment::APPOINTMENT_APPROVED)\n ->get();\n\n if ($user->user_type == 1) {\n $client_id = UserHelper::getClientId($user->id);\n $appointment = $appointment->where('client_id', '=', $client_id)\n ->where('service_provider_id', '=', $request->partner_id)\n ->first();\n // check if the appointment is empty\n if (empty($appointment)) {\n return response()->json([\n 'success' => false,\n 'message' => __('messages.no_appotment_message')\n ]);\n }\n if (UserHelper::userMoney($user->id) != 1) {\n return response()->json([\n 'success' => false,\n 'message' => __('messages.user_have_money_message')\n ]);\n }\n $invited_user = ServiceProvider::findOrFail($appointment->service_provider_id);\n $user_id = $invited_user->user_id;\n } elseif ($user->user_type == 2) {\n $service_provider_id = UserHelper::getServiceProviderId($user->id);\n $appointment = $appointment\n ->where('service_provider_id', '=', $service_provider_id)\n ->where('client_id', '=', $request->partner_id)\n ->first();\n // check if the appointment is empty\n if (empty($appointment)) {\n return response()->json([\n 'success' => false,\n 'message' => __('messages.no_appotment_message')\n ]);\n }\n $user_type = 2;\n $invited_user = UserHelper::getClientInfo($appointment->client_id);\n $user_id = $invited_user->user_id;\n\n if (UserHelper::userMoney($user_id) != 1) {\n return response()->json([\n 'success' => false,\n 'message' => __('messages.user_have_money_message')\n ]);\n }\n }\n\n \n if (!empty($appointment)) {\n if (empty($request->room_name)) {\n $room_name = \"Room no \".$appointment->id;\n } else {\n $room_name = $request->room_name;\n }\n Cache::put($user_id, $room_name, 10);\n Cache::put(\n $room_name,\n [$appointment->client_id,\n $appointment->service_provider_id,\n $appointment->call_type,\n $topic_id\n ],\n 20\n );\n $client = new Client($this->sid, $this->token);\n \n $exists = $client->video->rooms->read([\n 'uniqueName' => $room_name\n ]);\n \n if (empty($exists)) {\n $client->video->rooms->create([\n 'uniqueName' => $room_name,\n 'type' => 'group',\n 'recordParticipantsOnConnect' => false,\n ]);\n }\n $this->sendPushNotification(\n $user_id,\n $room_name,\n $appointment->call_type,\n $user->id//caller id\n );\n\n return response()->json([\n 'room_name' => $room_name\n ]);\n } else {\n return response()->json([\n 'success' => false,\n 'message' => __('messages.no_appotment_message')\n ]);\n }\n }\n }", "public function __construct()\n {\n $this->inbox_arr = array();\t\t\t# Initialize array\n $this->outbox_arr = array();\t\t\t# Initialize array\n $this->visible_box = SHOPTALK_INBOX;\t# Inbox displayed by default\n $this->time_zone = 0;\t\t\t\t\t# Default to Greenwich Mean Time\n }", "public function __construct($timetable)\n {\n $this->timetable = $timetable;\n }", "public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.offerShiftRequest');\n }", "public function __construct($type = 0, $time = null) {\n \n $this->setType($type);\n $this->startedAt = false;\n $this->stoppedAt = false;\n \n parent::__construct($time);\n }", "public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.trainingReminderNotification');\n }", "public function __construct(?\\StructType\\EwsFindMessageTrackingSearchResultType $messageTrackingSearchResult = null)\n {\n $this\n ->setMessageTrackingSearchResult($messageTrackingSearchResult);\n }", "public function __construct(ConferenceToAffiliateMeeting $conferenceToAffiliateMeeting)\n {\n $this->conferenceToAffiliateMeeting = $conferenceToAffiliateMeeting;\n }", "public function __construct(\n public string $dateTime ,\n public string $timezone ,\n )\n {\n }", "public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.callStartedEventMessageDetail');\n }", "public function __construct($time, $date, $numberOfParticipants, $sessionName){\n $this->groupsArray = array(new Group());\n $this->setSessionName($sessionName);\n $this->setSessionTime($time);\n $this->setSessionDate($date);\n $this->setNumberOfParticipants($numberOfParticipants);\n \n }", "public function __construct(array $attendeeAvailability = array())\n {\n $this\n ->setAttendeeAvailability($attendeeAvailability);\n }", "public function __construct(\\Fincallorca\\HitchHikerApi\\Wsdl\\v3_1_388_1\\StructType\\AllotmentResponse $allotment = null, $arrival = null, $arrivalDateTime = null, $bookingClass = null, $cabinClass = null, $cabinClassName = null, $carrierCode = null, $codeShare = null, \\Fincallorca\\HitchHikerApi\\Wsdl\\v3_1_388_1\\ArrayType\\ArrayOfFareResponseDatePair $datePairs = null, $departure = null, $departureDateTime = null, $equipmentCode = null, $equipmentName = null, $fareBase = null, $flightNumber = null, $freeBaggageAllowance = null, $freeSeats = null, $mealCode = null, $numberOfStops = null, $segmentID = null, $segmentMileage = null, \\Fincallorca\\HitchHikerApi\\Wsdl\\v3_1_388_1\\StructType\\SharedPrice $surcharge = null, $travelTime = null)\n {\n $this\n ->setAllotment($allotment)\n ->setArrival($arrival)\n ->setArrivalDateTime($arrivalDateTime)\n ->setBookingClass($bookingClass)\n ->setCabinClass($cabinClass)\n ->setCabinClassName($cabinClassName)\n ->setCarrierCode($carrierCode)\n ->setCodeShare($codeShare)\n ->setDatePairs($datePairs)\n ->setDeparture($departure)\n ->setDepartureDateTime($departureDateTime)\n ->setEquipmentCode($equipmentCode)\n ->setEquipmentName($equipmentName)\n ->setFareBase($fareBase)\n ->setFlightNumber($flightNumber)\n ->setFreeBaggageAllowance($freeBaggageAllowance)\n ->setFreeSeats($freeSeats)\n ->setMealCode($mealCode)\n ->setNumberOfStops($numberOfStops)\n ->setSegmentID($segmentID)\n ->setSegmentMileage($segmentMileage)\n ->setSurcharge($surcharge)\n ->setTravelTime($travelTime);\n }", "public function auEssShiftMatchingClockOffRosterShiftRequest($local_time, $employee_id, string $contentType = self::contentTypes['auEssShiftMatchingClockOffRosterShift'][0])\n {\n\n // verify the required parameter 'local_time' is set\n if ($local_time === null || (is_array($local_time) && count($local_time) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $local_time when calling auEssShiftMatchingClockOffRosterShift'\n );\n }\n\n // verify the required parameter 'employee_id' is set\n if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $employee_id when calling auEssShiftMatchingClockOffRosterShift'\n );\n }\n\n\n $resourcePath = '/api/v2/ess/{employeeId}/shift/matchingclockoff';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $local_time,\n 'localTime', // param base name\n 'string', // openApiType\n '', // style\n false, // explode\n true // required\n ) ?? []);\n\n\n // path params\n if ($employee_id !== null) {\n $resourcePath = str_replace(\n '{' . 'employeeId' . '}',\n ObjectSerializer::toPathValue($employee_id),\n $resourcePath\n );\n }\n\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml', ],\n $contentType,\n $multipart\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 (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('apiKey');\n if ($apiKey !== null) {\n $headers['apiKey'] = $apiKey;\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 $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function __construct(\\Ews\\ArrayType\\EwsArrayOfFreeBusyResponse $freeBusyResponseArray = null, \\Ews\\StructType\\EwsSuggestionsResponseType $suggestionsResponse = null)\n {\n $this\n ->setFreeBusyResponseArray($freeBusyResponseArray)\n ->setSuggestionsResponse($suggestionsResponse);\n }", "public function getMeetings(): CacheableJsonResponse {\n\n // Initialize the response.\n $response = [];\n\n // Wrap Query in render context.\n $context = new RenderContext();\n $meeting_nids = \\Drupal::service('renderer')->executeInRenderContext($context, function () {\n $meeting_query = \\Drupal::entityQuery('node')\n ->condition('type', 'cfo_meeting')\n ->condition('status', 1)\n ->sort('created');\n return $meeting_query->execute();\n });\n\n if (!empty($meeting_nids)) {\n\n // Loop through all meetings.\n foreach ($meeting_nids as $meeting_nid) {\n\n // Load the meeting node.\n if ($meeting_node = $this->nodeStorage->load($meeting_nid)) {\n\n // Prepare the meeting date for the url \"slug\".\n $meeting_date = $meeting_node->get('field_meeting_date')->getValue()[0]['value'];\n $meeting_slug = date('F-j-Y', strtotime($meeting_date));\n\n // Contents of this meeting.\n $meeting = [\n 'meeting_nid' => $meeting_nid,\n 'meeting_title' => $meeting_node->label(),\n 'meeting_updated' => $meeting_node->changed->value,\n 'meeting_slug' => $meeting_slug,\n ];\n\n // Add this meeting into the response.\n $response[] = $meeting;\n\n }\n\n }\n\n }\n\n // Set up the Cache Meta.\n $cacheMeta = (new CacheableMetadata())\n ->setCacheTags(['node_list:cfo_meeting'])\n ->setCacheMaxAge(Cache::PERMANENT);\n\n // Set the JSON response to the response of meetings.\n $json_response = new CacheableJsonResponse($response);\n\n // Add in the cache dependencies.\n $json_response->addCacheableDependency($cacheMeta);\n\n // Handle any bubbled cacheability metadata.\n if (!$context->isEmpty()) {\n $bubbleable_metadata = $context->pop();\n BubbleableMetadata::createFromObject($meeting_nids)\n ->merge($bubbleable_metadata);\n }\n\n // Return JSON Response.\n return $json_response;\n\n }", "function __construct($result)\n {\n $this->_from = isset($result['from']) ? trim($result['from']) : null;\n $this->_to = isset($result['to']) ? trim($result['to']) : null;\n }", "public function testConstructor()\n {\n // no params\n $result = new ExperimentRecruitingTokenResponse();\n $this->assertEquals('Sizzle\\Bacon\\Database\\ExperimentRecruitingTokenResponse', get_class($result));\n }", "protected function init( $data )\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t/** @var Sequence */\r\n\t\t\t$this->_tlv = ( new \\lyquidity\\Asn1\\Der\\Decoder() )->decodeElement( $data );\r\n\r\n\t\t\t$tbsResponseData = $this->_tlv->first()->asSequence();\r\n\t\t\t$dateTime = \\lyquidity\\Asn1\\asGeneralizedTime( $tbsResponseData->getFirstChildOfType( UniversalTagID::GENERALIZEDTIME ) );\r\n\t\t\t// $this->producedAt = $this->DateTimefromString( $dateTime );\r\n\t\t\t$this->producedAt = $dateTime->getValue();\r\n\r\n\t\t\t$this->responses = asSequence( $tbsResponseData->getFirstChildOfType( UniversalTagID::SEQUENCE ) );\r\n\r\n\t\t\t/* We care only about the first SingleResponse */\r\n\t\t\t$this->singleResponse = new SingleResponse( $this->responses->first() );\r\n\t\t}\r\n\t\tcatch (\\lyquidity\\Asn1\\Exception\\Asn1DecodingException $e) \r\n\t\t{\r\n\t\t\tthrow new ResponseException (\"Malformed request\", \\lyquidity\\OCSP\\Ocsp::ERR_MALFORMED_ASN1);\r\n\t\t} \r\n\t\tcatch (\\lyquidity\\Asn1\\Exception\\InvalidAsn1Value $e)\r\n\t\t{\r\n\t\t\tthrow new ResponseException (\"Malformed request\", \\lyquidity\\OCSP\\Ocsp::ERR_MALFORMED_ASN1);\r\n\t\t}\r\n\t}", "public function userMeetings()\n\t{\n\t\t//get user session\n\t\t$currenttime = time();\n\t\t$extra_time = Configure::read('extra_meetingtime'); //done in bootstrap\n\t\t$user = $this->Session->read('UserData.userName');\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t\n\t\t//get allsection setting sections for same course\n\t\t$sections_list = $this->__allSections();\n\t\t$options['conditions'][] = array(\n\t\t\t\t'MeetingInfo.chat_from_course'=>$course_name,\n\t\t\t\t'MeetingInfo.chat_from_section'=>$sections_list,\n\t\t\t\t'OR'=>array('MeetingInfo.is_active' => '1', 'MeetingInfo.chat_meeting_startdate >='=> $currenttime-$extra_time)\n\t\t);\t\t\n\t\t$options['joins'][] = array(\n\t\t\t\t'table' => 'chat_meeting_users',\n\t\t\t\t'alias' => 'Meetingusers',\n\t\t\t\t'type' => 'INNER',\n\t\t\t\t'conditions'=> array('Meetingusers.chat_meeting_name = MeetingInfo.chat_meeting_name',\n\t\t\t\t\t\t'Meetingusers.to_user' => $user,\n\t\t\t\t\t\t'Meetingusers.is_accept !=' => 2)\n\t\t);\n\t\t$options['fields'] = array( 'MeetingInfo.*', 'Meetingusers.id', 'Meetingusers.is_accept' );\n\t\t$options['order'] = array('MeetingInfo.chat_meeting_startdate ASC');\n\t\t$meeting_list = $this->MeetingInfo->find('all', $options);\n\t\t$join_group_img= $this->webroot.\"img/join.png\";\n\t\t$accept_imgsrc= $this->webroot.\"img/accept.png\";\n\t\t$reject_imgsrc= $this->webroot.\"img/reject.png\";\n\t\t$detail_imgsrc= $this->webroot.\"img/meeting_detail.png\";\n\t\t$msgstr = '';\n\t\tif (count($meeting_list))\n\t\t foreach ($meeting_list as $mettings) {\n\t\t \t$meetinguser_id = $mettings['Meetingusers']['id'];\n\t\t \t$meeting_tilte = $mettings['MeetingInfo']['chat_meeting_title'];\n\t\t \t$meeting_name = $mettings['MeetingInfo']['chat_meeting_name'];\n\t\t \t$meeting_date = $mettings['MeetingInfo']['chat_meeting_startdate'];\n\t\t \t$meeting_active = $mettings['MeetingInfo']['is_active'];\n\t\t \t$is_accept = \t$mettings['Meetingusers']['is_accept'];\n\t\t \t@$meetingDetails = $this->__mettingDetail($meeting_name);\n\t\t \t$meetingUserNames = implode(', ', $meetingDetails['users']);\n\t\t\t $msgstr .= \"<li id='meeting_\".$meetinguser_id.\"'><span class='meeting_title'>\".ucfirst($meeting_tilte).\"</span>\";\n\t\t\t //if meeting is not accepted or/denied then showing the buttons for action.\n// \t\t\t if(!$is_accept)\n// \t\t\t \t$msgstr .= \"<span class='prq_icon_meeting' id='meetingaction_\".$meetinguser_id.\"'><input type='image' src='\".$accept_imgsrc.\"' title='accept invitation' onClick=acceptMeetingInvitaion('$meetinguser_id','$meeting_name') />\n// \t\t\t \t&nbsp;&nbsp;&nbsp;<input type='image' src='\".$reject_imgsrc.\"' title='reject invitation' onClick=rejectMeetingInvitaion('$meetinguser_id') /></span>\n// \t\t\t \t\";\n\t\t\t //showing the join meeting from the start date time of the meeting date till 30 minuteslater.\n\t\t\t if (($meeting_date <= $currenttime || $meeting_active) && $is_accept == 1) {\n\t\t\t \t$msgstr .= \"<span class='meeting-detail' id='meeting_detail_\".$meetinguser_id.\"'>\n\t\t\t \t <span class='meeting-date' style='display:none;'> Meeting @ \".date('m/d/Y h:i A', $meetingDetails['date'][0]).\"</span>\n\t\t\t\t <input type='image' class='detail-image' id='detail_meeting_\".$meetinguser_id.\"' onclick=detailMeeting('\".$meetinguser_id.\"') src='\".$detail_imgsrc.\"' title='meeting detail' alt='Detail'/></span>\n\t\t\t \t<span class='join_meeting_area'><input type='image' title='start meeting' id='joinmetting_\".$meeting_name.\"' onclick=joinmeeting('\".$meetinguser_id.\"','\".$meeting_name.\"') src='\".$join_group_img.\"' /></span>\";\n\t\t\t \tif(!$is_accept)\n\t\t\t \t\t$msgstr .= \"<span class='prq_icon_meeting' id='meetingaction_\".$meetinguser_id.\"'><input type='image' src='\".$accept_imgsrc.\"' title='accept invitation' onClick=acceptMeetingInvitaion('$meetinguser_id','$meeting_name') />\n\t\t\t \t\t&nbsp;&nbsp;&nbsp;<input type='image' src='\".$reject_imgsrc.\"' title='reject invitation' onClick=rejectMeetingInvitaion('$meetinguser_id') /></span>\n\t\t\t \t\t\";\n\t\t\t\t$msgstr .= \"<div class='meeting-detail-area' id='below_meeting_detail_\".$meetinguser_id.\"'>\n\t\t\t\t <span class='meeting-users'><b>Participants:</b> $meetingUserNames</span>\n\t\t\t \t</div>\n\t\t\t \t</li>\";\n\t\t\t } else {\n\t\t\t \t$msgstr .= \" <span class='meeting-detail' id='meeting_detail_\".$meetinguser_id.\"'>\n\t\t\t \t<span class='meeting-date'> Meeting @ \".date('m/d/Y h:i A', $meetingDetails['date'][0]).\"</span>\n\t\t\t \t<input type='image' class='detail-image' id='detail_meeting_\".$meetinguser_id.\"' onclick=detailMeeting('\".$meetinguser_id.\"') src='\".$detail_imgsrc.\"' title='meeting detail' alt='Detail'/></span>\";\n\t\t\t \tif(!$is_accept)\n\t\t\t \t\t$msgstr .= \"<span class='prq_icon_meeting' id='meetingaction_\".$meetinguser_id.\"'><input type='image' src='\".$accept_imgsrc.\"' title='accept invitation' onClick=acceptMeetingInvitaion('$meetinguser_id','$meeting_name') />\n\t\t\t \t\t&nbsp;&nbsp;&nbsp;<input type='image' src='\".$reject_imgsrc.\"' title='reject invitation' onClick=rejectMeetingInvitaion('$meetinguser_id') /></span>\n\t\t\t \t\t\";\n\t\t\t \t$msgstr .= \"<div class='meeting-detail-area' id='below_meeting_detail_\".$meetinguser_id.\"'>\n\t\t\t \t<span class='meeting-users'>Participants: $meetingUserNames</span>\n\t\t\t \t</div>\n\t\t\t \t</li>\";\n\t\t\t }\n\t\t }\n\t\t \n\t\t //get current login user\n\t\t //updating the mark read for meeting users as read \n\t\t $user = $this->Session->read('UserData.userName');\n\t\t $this->MeetingUser->updateAll(\n\t\t \t\tarray('MeetingUser.is_read' => 1),\n\t\t \t\tarray('MeetingUser.to_user' => $user)\n\t\t );\n\t\t \n\t\t if ($msgstr == \"\") {\n\t\t \techo \"<span class='noresultfound'>No result found</span>\";\n\t\t \texit;\n\t\t }\n\t\t echo $msgstr;\n\t\t exit;\n\t}", "public function __construct() {\n $this->startup= new Date('2018-06-02 14:12:11+0200');\n $this->responsible= new Person(1549, 'Timm');\n }", "public function __construct() { $this->_competitions = [new Competition(0, 'unknow', 0)]; }", "public function __construct($surveyID = null, $startTime = null, $taskID = null, $status = null, $responseRateValue = null, $calcMethod = null, $mailToInstructor = null, $mailToDean = null)\n {\n $this\n ->setSurveyID($surveyID)\n ->setStartTime($startTime)\n ->setTaskID($taskID)\n ->setStatus($status)\n ->setResponseRateValue($responseRateValue)\n ->setCalcMethod($calcMethod)\n ->setMailToInstructor($mailToInstructor)\n ->setMailToDean($mailToDean);\n }" ]
[ "0.48409176", "0.46415326", "0.46238506", "0.46189728", "0.459876", "0.45932695", "0.44249666", "0.44214097", "0.44142398", "0.4409216", "0.43712234", "0.4356641", "0.43558082", "0.43494785", "0.4341607", "0.43356425", "0.4291168", "0.42818493", "0.4280207", "0.42656127", "0.4258343", "0.42493552", "0.42476523", "0.4241894", "0.42280406", "0.4227108", "0.42266765", "0.42201313", "0.42198262", "0.41887197" ]
0.6646118
0
/ RELOAD FORM Gets all POST elements and then puts them into the row array. This row array is then used in all forms to load in the default value of the fields
function reload_form() { global $ROW, $ERROR_MESSAGE; // Only reload if it hasn't been reloaded already if ( $ERROR_MESSAGE && ( !isset($ROW[0]['STATUS']) || $ROW[0]['STATUS'] != 'RELOAD') ) { $ROW[0]=$_POST; $ROW[0]['STATUS']='RELOAD'; LOG_MSG('INFO',"reload_form(): ROW=[".print_r($ROW,true)."]"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RestoreCurrentRowFormValues($idx) {\r\n\t\tglobal $objForm, $rekeningju;\r\n\r\n\t\t// Get row based on current index\r\n\t\t$objForm->Index = $idx;\r\n\t\t$this->LoadFormValues(); // Load form values\r\n\t}", "public function loadForm() {\n foreach ($this->Fields as $key => $item) {\n if($item['function'] && $this->FormMode == \"add\") {\n $fn = str_replace('$1', $_POST[$key], $item['function']);\n $this->$key = eval($fn);\n } else\n if($_POST[$key] !== null) {\n $this->$key = $_POST[$key];\n }\n }\n }", "public function populateForm() {}", "abstract function repopulate(Form $arg0);", "public function GetFormPostedValues() {\n\t\t$req_fields=array(\"description\",\"date_open\",\"date_closed\");\n\n\t\tfor ($i=0;$i<count($req_fields);$i++) {\n\n\t\t\t//echo $_POST['application_id'];\n\t\t\tif (ISSET($_POST[$req_fields[$i]]) && !EMPTY($_POST[$req_fields[$i]])) {\n\t\t\t\t$this->SetVariable($req_fields[$i],EscapeData($_POST[$req_fields[$i]]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//echo \"<br>\".$this->req_fields[$i].\"<br>\";\n\t\t\t\t$this->$req_fields[$i]=\"\";\n\t\t\t}\n\t\t}\n\t}", "private function mod_prep($row){\n $meta = new dbMeta(); \n $cols = $meta->get_tabel_columns(); // array w/ all metadata \n $form_array_mod = $meta->buildFormArray($cols); // make to nice form ready\n // insert the values to the form array for mod form\n foreach($row as $k => $v) {\n $form_array_mod[$k]['VALUE'] = $v;\n } \n \n update_form($form_array_mod); // returns array ready to be processed \n }", "function _onGetFormFieldsArray() {\n\t\t\n\t\t/* Are we resuming a paused submission ??? */\n\t\t$form_id = ( int ) bfRequest::getVar ( 'form_id' );\n\t\t$submission_id = ( int ) bfRequest::getVar ( 'submission_id' );\n\t\t$user = bfUser::getInstance ();\n\t\tif ($form_id && $submission_id && $user->get ( 'id' ) > 0) {\n\t\t\t\n\t\t\t/* get submission */\n\t\t\t$path = _BF_JPATH_BASE . DS . 'components' . DS . 'com_form' . DS . 'model' . DS . 'submission.php';\n\t\t\trequire_once ($path);\n\t\t\t$submission = new Submission ( );\n\t\t\t$submission->setTableName ( $form_id );\n\t\t\t$submission->get ( $submission_id );\n\t\t\t\n\t\t\t/* check its mine and paused */\n\t\t\tif ($submission->bf_status != 'Paused' || $submission->bf_user_id != $user->get ( 'id' )) {\n\t\t\t\tunset ( $submission );\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t$rows = array ();\n\t\t\n\t\tif (count ( $this->_FIELDS_CONFIG )) {\n\t\t\tforeach ( $this->_FIELDS_CONFIG as $field ) {\n\t\t\t\t$fieldname = 'FIELD_' . $field->id;\n\t\t\t\t\n\t\t\t\t$vars = array ();\n\t\t\t\tforeach ( $field as $k => $v ) {\n\t\t\t\t\t$vars [$k] = $v;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* if unpausing a submission then */\n\t\t\t\tif (isset ( $submission ) && @$submission->$fieldname != '') {\n\t\t\t\t\t\n\t\t\t\t\tswitch ($field->type) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"checkbox\" :\n\t\t\t\t\t\tcase \"radio\" :\n\t\t\t\t\t\t\t$field->multiple = $submission->$fieldname;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Tested and Works for: \n\t\t\t\t\t\t * textbox \n\t\t\t\t\t\t * textarea\n\t\t\t\t\t\t * select\n\t\t\t\t\t\t * password\n\t\t\t\t\t\t */\n\t\t\t\t\t\tdefault :\n\t\t\t\t\t\t\t$field->value = $submission->$fieldname;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/* Done unpausing */\n\t\t\t\t\n\t\t\t\tPlugins_Fields::loadPlugin ( $field->plugin );\n\t\t\t\t\n\t\t\t\tswitch ($field->plugin) {\n\t\t\t\t\tcase \"text\" :\n\t\t\t\t\t\t$field->plugin = 'textbox';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase \"file\" :\n\t\t\t\t\t\t$field->plugin = 'fileupload';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase \"UNKNOWN\" :\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$plugin = 'plugins_fields_' . $field->plugin;\n\t\t\t\t$fieldObj = new $plugin ( );\n\t\t\t\t$fieldObj->setConfig ( $field );\n\t\t\t\t\n\t\t\t\t$vars ['element'] = $fieldObj->toString ();\n\t\t\t\t$vars ['label'] = '';\n\t\t\t\t\n\t\t\t\t$rows [] = $vars;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $rows;\n\t\n\t}", "public function valuesFromPost()\n {\n return $this->setDefaultValues($_POST);\n }", "protected function _readFormFields() {}", "function getMainForm()\r\n\t{\r\n\t\t// mendapatkan form-form nya row per row.\r\n\t\t// dan kemudian memasukkan value dari query database kedalam input form masing2 yang sesuai\r\n\t\t$i = 0;\r\n\t\t$arrData = array();\r\n\t\t$out = '<tbody>';\r\n\t\t$this->arrInput = get_object_vars($this->input);\r\n\t\twhile ($arrResult = $this->nav->fetch())\r\n\t\t{\r\n\t\t\t$this->arrResult = $arrResult;\r\n\t\t\t$tableId = $this->arrResult[$this->tableId];\r\n\t\t\t$out .= '<tr data-id=\"'.$tableId.'\">';\r\n\t\t\tforeach($this->arrInput AS $input)\r\n\t\t\t{\r\n\t\t\t\tif (!$input->isInsideMultiInput && !$input->isHeader)\r\n\t\t\t\t{\r\n\t\t\t\t\t// digunakan pada sqllinks\r\n\t\t\t\t\tif (preg_match ('~ as ~is',$this->tableId))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (preg_match('~(.*) (as) (.*)~is', $this->tableId, $match))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->tableId=$match[3];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($this->isMultiLanguage && !isset($this->load_lang[$i]) && !empty($this->strField2Lang))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$q = \"SELECT `lang_id`, `\".implode('`, `', $this->strField2Lang).\"` FROM `$this->LanguageTable` WHERE `$this->LanguageTableId`={$tableId}\".$this->LanguageTableWhere;\r\n\t\t\t\t\t\t$this->load_lang[$i] = 1;\r\n\t\t\t\t\t\t$r = $this->db->getAll($q);\r\n\t\t\t\t\t\tforeach($r AS $d)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tforeach($this->strField2Lang AS $f)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$arrResult[$f][$d['lang_id']] = $d[$f];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$arrResult[$input->objectName] = $this->getDefaultValue($input, $arrResult, $i);\r\n\t\t\t\t\t// dapatkan array data report\r\n\t\t\t\t\tif ($this->isReportOn && $input->isIncludedInReport)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$irow = $input->getReportOutput($arrResult[$input->objectName]);\r\n\t\t\t\t\t\tif ($input->reportFunction && is_callable($input->displayFunction))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$irow = call_user_func_array($input->displayFunction, array($irow));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (is_callable($input->exportFunction))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$irow = call_user_func_array($input->exportFunction, array($irow));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$arrData[$i][]\t= $irow;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ($input->isInsideRow)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$out\t.= '<td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$str_value = in_array($input->objectName, ['system_delete_tool']) ? $arrResult[$this->tableId] : $arrResult[$input->objectName];\r\n\t\t\t\t\t$tmp = $input->getOutput($str_value, $input->name.'['.$i.']', $this->setDefaultExtra($input));\r\n\t\t\t\t\tif (!empty($this->disableInput[$input->objectName]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$is_disable = false;\r\n\t\t\t\t\t\tforeach ((array)$this->disableInput[$input->objectName] as $exec)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$comparator = is_array($arrResult[$exec[2]]) ? current($arrResult[$exec[2]]) : $arrResult[$exec[2]];\r\n\t\t\t\t\t\t\teval('if($exec[1] '.$exec[0].' $comparator){$is_disable=true;}');\r\n\t\t\t\t\t\t\tif ($is_disable)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ($is_disable)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$tmp = preg_replace(array('~(<input\\s?)~is', '~(<select\\s?)~is', '~(<textarea\\s?)~is'), '$1 disabled ', $tmp);\r\n\t\t\t\t\t\t\tif ($input->objectName != 'system_delete_tool')\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$tmp.= $this->setDisableInputRecovery($arrResult[$input->objectName], $input->name.'['.$i.']', $tmp);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($input->isInsideRow)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$out\t.= $tmp.'</td>';\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif (!empty($tmp) && preg_match('~hidden~is', $tmp))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$out .= $tmp;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$out .= '<div class=\"hidden\">'.$tmp.'</div>';\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} // end foreach\r\n\t\t\t$out .= '</tr>';\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\t$out .= '</tbody>';\r\n\t\tif ($this->isReportOn)\r\n\t\t{\r\n\t\t\t$this->reportData['data'] = $arrData;\r\n\t\t}\r\n\t\treturn $out;\r\n\t}", "public function get_submitted_edit_form_data()\n\t{\n\t\t$this->credits = $_POST['credits'];\n\t\t$this->levelID = $_POST['level'];\t\n\t}", "public function prepareForm()\n {\n // Searching for the data to populate the Form\n\n // Adding default value to the list\n\n // Setting the lists in $data array\n $data = [\n ];\n\n //dd($data);\n\n return $data;\n }", "public function repopulate() {\n\t\t$fields = $this->field ( null, true );\n\t\tforeach ( $fields as $f ) {\n\t\t\t// Don't repopulate the CSRF field\n\t\t\tif ($f->name === \\Config::get ( 'security.csrf_token_key', 'fuel_csrf_token' )) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif (($value = $f->input ()) !== null) {\n\t\t\t\t$f->set_value ( $value, true );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "function resetPostData() {\n\t\t$this->postData = Array ();\n\t}", "public function updateFromPOST() {\n if ($this->isSubmit()) {\n foreach (Tools::getValue($this->namebase(), array()) as $name => $value) {\n $key = $this->nameify($name);\n $this->input_values[$key] = $value;\n }\n Configuration::updateValue($this->key(), json_encode($this->input_values));\n }\n }", "function readForm() {\n\t\t$this->FiscaalGroepID = $this->formHelper(\"FiscaalGroepID\", 0);\n\t\t$this->FiscaalGroupType = $this->formHelper(\"FiscaalGroupType\", 0);\n\t\t$this->GewijzigdDoor = $this->formHelper(\"GewijzigdDoor\", 0);\n\t\t$this->GewijzigdOp = $this->formHelper(\"GewijzigdOp\", \"\");\n\t}", "public function PrePopulateFormValues($id, $field='')\n {\n if (empty($field)) {\n $field = $this->Index_Name;\n }\n $this->LoadData();\n $row = $this->GetRow($field, $id);\n if ($row) {\n Form_PostArray($row);\n return true;\n }\n return false;\n }", "public function reset() {\n\t\tif ($this->Common->isPosted()) {\n\t\t\t$selection = (array)$this->request->getData('Form.sel');\n\t\t\tforeach ($selection as $sel) {\n\t\t\t\tif (!empty($sel)) {\n\t\t\t\t\tswitch ($sel) {\n\t\t\t\t\t\tcase 'terms':\n\t\t\t\t\t\t\t$this->TranslateDomains->TranslateStrings->TranslateTerms->truncate();\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'strings':\n\t\t\t\t\t\t\t$this->TranslateDomains->TranslateStrings->truncate();\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'groups':\n\t\t\t\t\t\t\t$this->TranslateDomains->truncate();\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'languages':\n\t\t\t\t\t\t\t$this->TranslateDomains->TranslateStrings->TranslateTerms->TranslateLanguages->truncate();\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t$this->Flash->success('Done');\n\n\t\t\treturn $this->redirect(['action' => 'index']);\n\t\t}\n\n\t\t//FIXME\n\t\t//$this->request->data['Form']['sel'][] = 'terms';\n\t\t//$this->request->data['Form']['sel'][] = 'strings';\n\n\t\t//$this->request->data['Form']['sel']['languages'] = 0;\n\t\t//$this->request->data['Form']['sel']['groups'] = 0;\n\t}", "protected function loadFormData() {\r\n\t\t// Check the session for previously entered form data.\r\n\t\t$data = JFactory::getApplication()->getUserState('com_flexicontent.edit.'.$this->getName().'.data', array());\r\n\r\n\t\tif (empty($data)) {\r\n\t\t\t$data = $this->getItem();\r\n\t\t}\r\n\r\n\t\treturn $data;\r\n\t}", "protected function loadFormData(){\n\t\t\n\t\t// Check the session for previously entered form data.\n\t\t$data = JFactory::getApplication()->getUserState('com_egoi.edit.egoi.data', array());\n\t\tif (empty($data)) {\n\t\t\t$data = $this->getItem();\n\t\t}\n\n\t\treturn $data;\n\t}", "private function resetInputFields(){\n $this->title = '';\n $this->body = '';\n $this->page_id = '';\n }", "protected function loadFormData()\n\t\t{\n\t\t\t\t// Check the session for previously entered form data.\n\t\t\t\t$data = JFactory::getApplication()->getUserState('com_helloworld.edit.' . $this->context . '.data', array());\n\t\t\t\tif (empty($data))\n\t\t\t\t{\n\t\t\t\t\t\t$data = $this->getItem();\n\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t}", "protected function loadFormData() \r\n\t{\r\n\t\t// Check the session for previously entered form data.\r\n\t\t$data = JFactory::getApplication()->getUserState('com_ktbtracker.edit.' . $this->getName() . '.data', array());\r\n\t\t\r\n\t\t// Attempt to get the record from the database\r\n\t\tif (empty($data)) {\r\n\t\t\t$data = $this->getItem();\r\n\t\t}\r\n\t\t\r\n\t\treturn $data;\r\n\t}", "function populate() {\n // @todo We inject client input directly into the form. What about\n // security issues?\n if (isset($this->form->request['raw_input'][$this->attributes['name']])) {\n // Disabled input elements do not accept new input.\n if (!$this->disabled) {\n $this->value = $this->form->request['raw_input'][$this->attributes['name']];\n }\n }\n }", "public function reloadSubmissionTable(){\r\n\t\t\t$this->load->model('gs_admission/ajax_base_model', 'AB');\r\n\t\t\t$data[\"formlist\"] = $this->AB->list_of_admission_form2();\r\n\t\t\t$this->load->view('gs_admission/submission/right_side_table',$data);\r\n\t\t}", "protected function loadFormData()\r\n {\r\n // Check the session for previously entered form data.\r\n $app = JFactory::getApplication();\r\n $data = $app->getUserState('com_data.edit.email.data', array());\r\n\r\n if (empty($data))\r\n {\r\n $data = $this->getItem();\r\n\r\n // Pre-select some filters (Status, Category, Language, Access) in edit form if those have been selected in Article Manager: Articles\r\n if ($this->getState('email.id') == 0)\r\n {\r\n $filters = (array) $app->getUserState('com_data.emails.filter');\r\n $data->set(\r\n 'state',\r\n $app->input->getInt(\r\n 'state',\r\n ((isset($filters['published']) && $filters['published'] !== '') ? $filters['published'] : null)\r\n )\r\n );\r\n\r\n $data->set('language', $app->input->getString('language', (!empty($filters['language']) ? $filters['language'] : null)));\r\n $data->set('access',\r\n $app->input->getInt('access', (!empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access')))\r\n );\r\n }\r\n }\r\n\r\n // If there are params fieldsets in the form it will fail with a registry object\r\n if (isset($data->params) && $data->params instanceof Registry)\r\n {\r\n $data->params = $data->params->toArray();\r\n }\r\n\r\n $this->preprocessData('com_data.email', $data);\r\n\r\n return $data;\r\n }", "public function resetPost()\n {\n $_POST = array();\n return $this;\n }", "public function reloadTableData(){\r\n\t\t$this->load->model('gs_admission/ajax_base_model', 'AB');\r\n\t \t$data[\"formlist\"] = $this->AB->list_of_admission_form();\r\n\t\t$user_id = $this->session->userdata(\"user_id\");\r\n\t\t$data[\"myttl\"] = $this->AB->getUserUploadedForm($user_id);\r\n\t\t$data[\"ttl\"] = $this->AB->getUserUploadedForm($user_id=NULL);\r\n\t\t$this->load->view('gs_admission/issuance/form_list',$data);\r\n\t\t}", "private function resetFormData()\r\n {\r\n $_charset = $this->config->getModuleVar('common', 'charset');\r\n\r\n $this->viewVar['cauthor'] = htmlentities($this->strip($this->cauthor), ENT_COMPAT, $_charset);\r\n $this->viewVar['cemail'] = htmlentities($this->strip($this->cemail), ENT_COMPAT, $_charset);\r\n $this->viewVar['cbody'] = htmlentities($this->strip($this->cbody), ENT_COMPAT, $_charset);\r\n }", "private function resetInputFields(){\n $this->nom = '';\n $this->departements_id = '';\n $this->arrondissement_id = '';\n }" ]
[ "0.6497502", "0.6440311", "0.6321709", "0.6300444", "0.62147075", "0.6155644", "0.6027975", "0.6012674", "0.59913504", "0.59858227", "0.587104", "0.5856399", "0.58458173", "0.5830539", "0.58298635", "0.58265984", "0.58258337", "0.5788129", "0.5763833", "0.5757229", "0.57442576", "0.57300997", "0.57293385", "0.5708271", "0.5638041", "0.5626269", "0.55811495", "0.5576577", "0.5573849", "0.5567571" ]
0.7440448
0
/ Generate random password Mask Rules digit C Caps Character (AZ) c Small Character (az) X Mixed Case Character (azAZ) ! Custom Extended Characters
function gen_pass($mask) { $extended_chars = "!@#$%^&*()"; $length = strlen($mask); $pwd = ''; for ($c=0;$c<$length;$c++) { $ch = $mask[$c]; switch ($ch) { case '#': $p_char = rand(0,9); break; case 'C': $p_char = chr(rand(65,90)); break; case 'c': $p_char = chr(rand(97,122)); break; case 'X': do { $p_char = rand(65,122); } while ($p_char > 90 && $p_char < 97); $p_char = chr($p_char); break; case '!': $p_char = $extended_chars[rand(0,strlen($extended_chars)-1)]; break; } $pwd .= $p_char; } return $pwd; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generatePassword() {\n // 57 prefixes\n $aPrefix = array('aero', 'anti', 'ante', 'ande', 'auto', \n 'ba', 'be', 'bi', 'bio', 'bo', 'bu', 'by', \n 'ca', 'ce', 'ci', 'cou', 'co', 'cu', 'cy', \n 'da', 'de', 'di', 'duo', 'dy', \n 'eco', 'ergo', 'exa', \n 'geo', 'gyno', \n 'he', 'hy', 'ki',\n 'intra', \n 'ma', 'mi', 'me', 'mo', 'my', \n 'na', 'ni', 'ne', 'no', 'ny', \n 'omni', \n 'pre', 'pro', 'per', \n 'sa', 'se', 'si', 'su', 'so', 'sy', \n 'ta', 'te', 'tri',\n 'uni');\n\n // 30 suffices\n $aSuffix = array('acy', 'al', 'ance', 'ate', 'able', 'an', \n 'dom', \n 'ence', 'er', 'en',\n 'fy', 'ful', \n 'ment', 'ness',\n 'ist', 'ity', 'ify', 'ize', 'ise', 'ible', 'ic', 'ical', 'ous', 'ish', 'ive', \n 'less', \n 'sion',\n 'tion', 'ty', \n 'or');\n\n // 8 vowel sounds \n $aVowels = array('a', 'o', 'e', 'i', 'y', 'u', 'ou', 'oo'); \n\n // 20 random consonants \n $aConsonants = array('w', 'r', 't', 'p', 's', 'd', 'f', 'g', 'h', 'j', \n 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm', 'qu');\n\n // Some consonants can be doubled\n $aDoubles = array('n', 'm', 't', 's');\n\n // \"Salt\"\n $aSalt = array('!', '#', '%', '?');\n\n $pwd = $aPrefix[array_rand($aPrefix)];\n\n // add random consonant(s)\n $c = $aConsonants[array_rand($aConsonants)];\n if ( in_array( $c, $aDoubles ) ) {\n // 33% chance of doubling it\n if (rand(0, 2) == 1) { \n $c .= $c;\n }\n }\n $pwd .= $c;\n\n // add random vowel\n $pwd .= $aVowels[array_rand($aVowels)];\n\n $pwdSuffix = $aSuffix[array_rand($aSuffix)];\n // If the suffix begins with a vovel, add one or more consonants\n if ( in_array( $pwdSuffix[0], $aVowels ) ) {\n $pwd .= $aConsonants[array_rand($aConsonants)];\n }\n $pwd .= $pwdSuffix;\n\n $pwd .= rand(2, 999);\n # $pwd .= $aSalt[array_rand($aSalt)];\n\n // 50% chance of capitalizing the first letter\n if (rand(0, 1) == 1) {\n $pwd = ucfirst($pwd);\n }\n return $pwd;\n }", "function createPwd($characters) {\n $possible = '23456789bcdfghjkmnpqrstvwxyz';\n $code = '';\n $i = 0;\n while ($i < $characters) {\n $code .= substr($possible, mt_rand(0, strlen($possible)-1), 1);\n $i++;\n }\n return $code;\n}", "public static function generatePassword() {\n\t\t$consonants = array (\n\t\t\t\t\"b\",\n\t\t\t\t\"c\",\n\t\t\t\t\"d\",\n\t\t\t\t\"f\",\n\t\t\t\t\"g\",\n\t\t\t\t\"h\",\n\t\t\t\t\"j\",\n\t\t\t\t\"k\",\n\t\t\t\t\"l\",\n\t\t\t\t\"m\",\n\t\t\t\t\"n\",\n\t\t\t\t\"p\",\n\t\t\t\t\"r\",\n\t\t\t\t\"s\",\n\t\t\t\t\"t\",\n\t\t\t\t\"v\",\n\t\t\t\t\"w\",\n\t\t\t\t\"x\",\n\t\t\t\t\"y\",\n\t\t\t\t\"z\" \n\t\t);\n\t\t$vocals = array (\n\t\t\t\t\"a\",\n\t\t\t\t\"e\",\n\t\t\t\t\"i\",\n\t\t\t\t\"o\",\n\t\t\t\t\"u\" \n\t\t);\n\t\t\n\t\t$password = '';\n\t\t\n\t\tsrand ( ( double ) microtime () * 1000000 );\n\t\tfor($i = 1; $i <= 4; $i ++) {\n\t\t\t$password .= $consonants [rand ( 0, 19 )];\n\t\t\t$password .= $vocals [rand ( 0, 4 )];\n\t\t}\n\t\t$password .= rand ( 0, 9 );\n\t\t\n\t\treturn $password;\n\t}", "public function genaratepassword() {\r\r\n $length = 10;\r\r\n $alphabets = range('A', 'Z');\r\r\n $numbers = range('0', '9');\r\r\n $additional_characters = array('1', '3');\r\r\n $final_array = array_merge($alphabets, $numbers, $additional_characters);\r\r\n $password = '';\r\r\n while ($length--) {\r\r\n $key = array_rand($final_array);\r\r\n $password .= $final_array[$key];\r\r\n }\r\r\n return $password;\r\r\n }", "function generarPassword() {\n\t\t$str = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\";\n\t\t$cad = \"\";\n\t\tfor ($i = 0; $i < 8; $i++) {\n\t\t\t$cad .= substr($str, rand(0, 62), 1);\n\t\t}\n\t\treturn $cad;\n\t}", "public static function generatePassword()\n\t{\n\t\t$consonants = array(\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\");\n\t\t$vocals = array(\"a\", \"e\", \"i\", \"o\", \"u\");\n\n\t\t$password = '';\n\n\t\tsrand((double)microtime() * 1000000);\n\t\tfor ($i = 1; $i <= 4; $i++) {\n\t\t\t$password .= $consonants[rand(0, 19)];\n\t\t\t$password .= $vocals[rand(0, 4)];\n\t\t}\n\t\t$password .= rand(0, 9);\n\n\t\treturn $password;\n\t}", "function generatePassword() {\n\t//* (c) Hitech Scripts 2003\n\t//* For more information, visit http://www.hitech-scripts.com\n\t//* modified for phpgiftreg by Chris Clonch\n\tmt_srand((double) microtime() * 1000000);\n\t$newstring = \"\";\n\tif ($GLOBALS[\"OPT\"][\"password_length\"] > 0) {\n\t\twhile(strlen($newstring) < $GLOBALS[\"OPT\"][\"password_length\"]) {\n\t\t\tswitch (mt_rand(1,3)) {\n\t\t\t\tcase 1: $newstring .= chr(mt_rand(48,57)); break; // 0-9\n\t\t\t\tcase 2: $newstring .= chr(mt_rand(65,90)); break; // A-Z\n\t\t\t\tcase 3: $newstring .= chr(mt_rand(97,122)); break; // a-z\n\t\t\t}\n\t\t}\n\t}\n\treturn $newstring;\n}", "public function createRandomPassword() {\n\t\t$chars = \"abcdefghijkmnopqrstuvwxyz023456789\";\n\t\t\n\t\tsrand((double)microtime()*1000000);\n\t\t\n\t\t$i = 0;\n\t\t\n\t\t$pass = '' ;\n\t\t\n\t\twhile ($i <= 7) {\n\t\t\n\t\t\t$num = rand() % 33;\n\t\t\n\t\t\t$tmp = substr($chars, $num, 1);\n\t\t\n\t\t\t$pass = $pass . $tmp;\n\t\t\n\t\t\t$i++;\n\t\t\n\t\t}\n\t\treturn $pass;\n\t}", "function createRandomPassword() {\r\n $chars = \"abcdefghijkmnopqrstuvwxyz023456789\";\r\n srand((double) microtime() * 1000000);\r\n $i = 0;\r\n $pass = '';\r\n\r\n while ($i <= 7) {\r\n $num = rand() % 33;\r\n $tmp = substr($chars, $num, 1);\r\n $pass = $pass . $tmp;\r\n $i++;\r\n }\r\n\r\n return $pass;\r\n }", "function createRandomPassword() { \n $chars \t= \"abcdefghijkmnopqrstuvwxyz023456789\"; \n srand((double)microtime()*1000000); \n $i \t\t= 0; \n $pass \t= '' ; \n\n while ($i <= 4) { \n $num \t= rand() % 33; \n $tmp \t= substr($chars, $num, 1); \n $pass \t= $pass . $tmp; \n $i++; \n } \n\n return $pass; \n }", "public static function generatePassword() {\r\n return StringGenerator::generateRandomAlphaAndNumbersAndSpecial(12);\r\n }", "public function randomString(){\n $alpha = \"abcdefghijklmnopqrstuvwxyz\";\n $alpha_upper = strtoupper($alpha);\n $numeric = \"0123456789\";\n $special = \".-+=_,!@$#*%<>[]{}\";\n $chars = $alpha . $alpha_upper . $numeric; \n $pw = ''; \n $chars = str_shuffle($chars);\n $pw = substr($chars, 8,8);\n return $pw;\n }", "function gen_pwd($chars) \n\t{\n\t\t$data = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcefghijklmnopqrstuvwxyz';\n\t\treturn substr(str_shuffle($data), 0, $chars);\n\t}", "private function generarPassword() {\r\n $minusculas = \"abcdefghijklmnopqrstuvwxyz\";\r\n $mayusculas = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\r\n $numeros = \"1234567890\";\r\n $may = \"\";\r\n $min = \"\";\r\n $num = \"\";\r\n for ($i = 0; $i < 11; $i++) {\r\n $min .= substr($minusculas, rand(0, 26), 1);\r\n $may .= substr($mayusculas, rand(0, 26), 1);\r\n $num .= substr($numeros, rand(0, 10), 1);\r\n }\r\n $password = substr($may, 0, 2) . substr($min, 0, 5) . '-' . substr($num, 0, 3);\r\n return $password;\r\n }", "function makePassword() {\n $alphaNum = array(2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, g, h, i, j, k, m, n, p, q, r, s, t, u, v, w, x, y, z);\n srand ((double) microtime() * 1000000);\n $pwLength = \"7\"; // this sets the limit on how long the password is.\n for($i = 1; $i <=$pwLength; $i++) {\n $newPass .= $alphaNum[(rand(0,31))];\n }\n return ($newPass);\n}", "public static function makePassword()\n {\n $pass = \"\";\n $chars = array(\n \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"0\",\n \"a\", \"A\", \"b\", \"B\", \"c\", \"C\", \"d\", \"D\", \"e\", \"E\", \"f\", \"F\", \"g\", \"G\", \"h\", \"H\", \"i\", \"I\", \"j\", \"J\",\n \"k\", \"K\", \"l\", \"L\", \"m\", \"M\", \"n\", \"N\", \"o\", \"O\", \"p\", \"P\", \"q\", \"Q\", \"r\", \"R\", \"s\", \"S\", \"t\", \"T\",\n \"u\", \"U\", \"v\", \"V\", \"w\", \"W\", \"x\", \"X\", \"y\", \"Y\", \"z\", \"Z\");\n\n $count = count($chars) - 1;\n\n srand((double) microtime() * 1000000);\n\n for ($i = 0; $i < 8; $i++) {\n $pass .= $chars[rand(0, $count)];\n }\n\n return ($pass);\n }", "function randomPassword()\r\n\t{\r\n\t\t$longitud = 8;\r\n\t\t$carac = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r\n\t\t$pwd = '';\r\n\t\tfor ($i=0; $i<$longitud; ++$i){ \r\n\t\t\t $pwd .= substr($carac, (mt_rand() % strlen($carac)), 1);\r\n\t\t}\t \r\n\t return trim($pwd);\r\n\t}", "function createRandomPassword() {\r\n $chars = \"abcdefghijkmnopqrstuvwxyz023456789\";\r\n srand((double)microtime()*1000000);\r\n $i = 0;\r\n $pass = '' ;\r\n\r\n while ($i <= 7) {\r\n $num = rand() % 33;\r\n $tmp = substr($chars, $num, 1);\r\n $pass = $pass . $tmp;\r\n $i++;\r\n }\r\n\r\n return $pass;\r\n}", "function get_random_password($chars_min=6, $chars_max=8, $use_upper_case=false, $include_numbers=false, $include_special_chars=false)\n {\n $length = rand($chars_min, $chars_max);\n $selection = 'aeuoyibcdfghjklmnpqrstvwxz';\n if($include_numbers) {\n $selection .= \"1234567890\";\n }\n if($include_special_chars) {\n $selection .= \"!@04f7c318ad0360bd7b04c980f950833f11c0b1d1quot;#$%&[]{}?|\";\n }\n \n $password = \"\";\n for($i=0; $i<$length; $i++) {\n $current_letter = $use_upper_case ? (rand(0,1) ? strtoupper($selection[(rand() % strlen($selection))]) : $selection[(rand() % strlen($selection))]) : $selection[(rand() % strlen($selection))]; \n $password .= $current_letter;\n } \n \n return $password;\n }", "function genera_password($num=8,$randnum=0){ // By Kernellover \n $voc = 'aeiou'; \n $con = 'bcdfgjklmnpqrstwxyz';\n\t$nvoc = strlen($voc)-1;\n\t$ncon = strlen($con)-1;\n\t$psw =mt_rand(0,1)?$con[mt_rand(0,$ncon)]:''; // defineix si comença per vocal o consonant\n\n\t\n for ($n=0; $n<=ceil($num/2); $n++){ \n $psw .= $voc[mt_rand(0,$nvoc)]; \n $psw .= $con[mt_rand(0,$ncon)]; \n }\n\n\t$cua=$randnum?mt_rand(1,$randnum):'';\n\t$psw = str_replace (array('q','quu','yi','iy'),array('qu','que','ya','ya'),$psw);\n $psw = substr($psw,0,$num-strlen($cua)).$cua; \n\n\n return $psw; \n}", "function randomPassword()\n{\n\n$digit = 6;\n$karakter = \"ABCDEFGHJKLMNPQRSTUVWXYZ23456789\";\n\nsrand((double)microtime()*1000000);\n$i = 0;\n$pass = \"\";\nwhile ($i <= $digit-1)\n{\n$num = rand() % 32;\n$tmp = substr($karakter,$num,1);\n$pass = $pass.$tmp;\n$i++;\n}\nreturn $pass;\n}", "function generatePassword() {\n //Initialize the random password\n $password = '';\n\n //Initialize a random desired length\n $desired_length = rand(8, 12);\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n for ($length = 0; $length < $desired_length; $length++) {\n //Append a random ASCII character (including symbols)\n $password .= $characters[mt_rand(0, strlen($characters) - 1)];\n }\n\n return $password;\n }", "private function generateRandomPassword() {\n $alphabet = \"23456789bcdefghijklmnopqrstuwxyzBCDEFGHIJKLMNOPQRSTUWXYZ\";\n $pass = array();\n $alphaLength = strlen($alphabet) - 1;\n for ($i = 0; $i < 8; $i ++) {\n $n = rand(0, $alphaLength);\n $pass [] = $alphabet [$n];\n }\n return implode($pass);\n }", "function randomPassword() {\n $alphabet = \"abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789\";\n\t$max = 15;\n\t$temp = \"\";\n\t\n for ($i = 0; $i < $max; $i++) {\n $random_int = mt_rand();\n $temp .= $alphabet[$random_int % strlen($alphabet)];\n }\n return $temp;\n}", "function randomPassword()\r\n{\r\n\r\n$digit = 6;\r\n$karakter = \"ABCDEFGHJKLMNPQRSTUVWXYZ23456789\";\r\n\r\nsrand((double)microtime()*1000000);\r\n$i = 0;\r\n$pass = \"\";\r\nwhile ($i <= $digit-1)\r\n{\r\n$num = rand() % 32;\r\n$tmp = substr($karakter,$num,1);\r\n$pass = $pass.$tmp;\r\n$i++;\r\n}\r\nreturn $pass;\r\n}", "function Genera_Password($cadena){\r\n $cadena_1 = \"1234567890\";\r\n\t$cadena_2 = \"&%$/.@*_-#\";\r\n //Obtenemos la longitud de la cadena de caracteres\r\n $longitudCadena_1=strlen($cadena_1);\r\n\t$longitudCadena_2=strlen($cadena_2);\r\n\r\n //Se define la variable que va a contener la contrase�a\r\n $pass = \"\";\r\n //Se define la longitud de la contrase�a, en mi caso 10, pero puedes poner la longitud que quieras\r\n $longitudPass=4;\r\n\r\n\t$pass = $cadena.substr($cadena_1,rand(0,$longitudCadena_1-1),1).substr($cadena_1,rand(0,$longitudCadena_1-1),1).substr($cadena_2,rand(0,$longitudCadena_2-1),1).substr($cadena_2,rand(0,$longitudCadena_2-1),1);\r\n\r\n return $pass;\r\n}", "function makeRandomPassword() { \n\t $scheme = \"abchefghjkmnpqrstuvwxyz0123456789\"; \n\t srand((double)microtime()*1000000); \n\t\t $i = 0; \n\t\t while ($i <= 7) { \n\t\t\t\t$num = rand() % 33; \n\t\t\t\t$tmp = substr($scheme, $num, 1); \n\t\t\t\t$pass = $pass . $tmp; \n\t\t\t\t$i++; \n\t\t } \n\t\t return $pass; \n\t}", "protected function random_password() \n {\n $length = 8;\n // 0 and O, l and 1 are all removed to prevent silly people who can't read to make mistakes.\n $characters = '23456789abcdefghijkmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ';\n $string = ''; \n for ($p = 0; $p < $length; $p++) {\n $string .= $characters[mt_rand(0, strlen($characters))];\n }\n return $string;\n }", "private function randomPassword() {\n\t\t$alphabet = \"abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789\";\n\t\t$pass = array(); //remember to declare $pass as an array\n\t\t$alphaLength = strlen($alphabet) - 1; //put the length -1 in cache\n\t\tfor ($i = 0; $i < 8; $i++) {\n\t\t\t$n = rand(0, $alphaLength);\n\t\t\t$pass[] = $alphabet[$n];\n\t\t}\n\t\treturn implode($pass); //turn the array into a string\n\t}", "function ae_gen_password($syllables = 3, $use_prefix = false)\n{\n if (!function_exists('ae_arr')) {\n\n // This function returns random array element\n function ae_arr(&$arr)\n {\n return $arr[rand(0, sizeof($arr) - 1)];\n }\n\n }\n\n // 20 prefixes\n $prefix = array('aero', 'anti', 'auto', 'bi', 'bio',\n 'cine', 'deca', 'demo', 'dyna', 'eco',\n 'ergo', 'geo', 'gyno', 'hypo', 'kilo',\n 'mega', 'tera', 'mini', 'nano', 'duo');\n\n // 10 random suffixes\n $suffix = array('dom', 'ity', 'ment', 'sion', 'ness',\n 'ence', 'er', 'ist', 'tion', 'or');\n\n // 8 vowel sounds\n $vowels = array('a', 'o', 'e', 'i', 'y', 'u', 'ou', 'oo');\n\n // 20 random consonants\n $consonants = array('w', 'r', 't', 'p', 's', 'd', 'f', 'g', 'h', 'j',\n 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm', 'qu');\n\n $password = $use_prefix ? ae_arr($prefix) : '';\n $password_suffix = ae_arr($suffix);\n\n for ($i = 0; $i < $syllables; $i++) {\n // selecting random consonant\n $doubles = array('n', 'm', 't', 's');\n $c = ae_arr($consonants);\n if (in_array($c, $doubles) && ($i != 0)) {\n // maybe double it\n if (rand(0, 2) == 1) // 33% probability\n {\n $c .= $c;\n }\n\n }\n $password .= $c;\n //\n // selecting random vowel\n $password .= ae_arr($vowels);\n\n if ($i == $syllables - 1) // if suffix begin with vovel\n {\n if (in_array($password_suffix[0], $vowels)) // add one more consonant\n {\n $password .= ae_arr($consonants);\n }\n }\n\n }\n\n // selecting random suffix\n $password .= $password_suffix;\n\n return $password;\n}" ]
[ "0.78568953", "0.77681845", "0.7706031", "0.76584184", "0.7646685", "0.7636406", "0.75718534", "0.75585645", "0.7510951", "0.7465982", "0.74510753", "0.7431074", "0.73992944", "0.7389806", "0.7380706", "0.7361732", "0.73534524", "0.7347448", "0.7344949", "0.734382", "0.73406845", "0.73366475", "0.7319797", "0.73191255", "0.7316249", "0.7308375", "0.7308195", "0.7280444", "0.72666556", "0.7258954" ]
0.8026063
0
/ Function: get_page_params($count) / generates the different page params
function get_page_params($count) { global $ROWS_PER_PAGE; if ($ROWS_PER_PAGE == '') $ROWS_PER_PAGE=10; $page_arr=array(); $firstpage = 1; $lastpage = intval($count / $ROWS_PER_PAGE); $page=(int)get_arg($_GET,"page"); if ( $page == "" || $page < $firstpage ) { $page = 1; } // no page no if ( $page > $lastpage ) {$page = $lastpage+1;} // page greater than last page //echo "<pre>first=$firstpage last=$lastpage current=$page</pre>"; if ($count % $ROWS_PER_PAGE != 0) { $pagecount = intval($count / $ROWS_PER_PAGE) + 1; } else { $pagecount = intval($count / $ROWS_PER_PAGE); } $startrec = $ROWS_PER_PAGE * ($page - 1); $reccount = min($ROWS_PER_PAGE * $page, $count); $currpage = ($startrec/$ROWS_PER_PAGE) + 1; if($lastpage==0) { $lastpage=null; } else { $lastpage=$lastpage+1; } if($startrec == 0) { $prevpage=null; $firstpage=null; if($count == 0) {$startrec=0;} } else { $prevpage=$currpage-1; } if($reccount < $count) { $nextpage=$currpage+1; } else { $nextpage=null; $lastpage=null; } $appstr="&page="; // Link to PREVIOUS page (and FIRST) if($prevpage == null) { $prev_href="#"; $first_href="#"; $prev_disabled="disabled"; } else { $prev_disabled=""; $prev_href=$appstr.$prevpage; $first_href=$appstr.$firstpage; } // Link to NEXT page if($nextpage == null) { $next_href = "#"; $last_href = "#"; $next_disabled="disabled"; } else { $next_disabled=""; $next_href=$appstr.$nextpage; $last_href=$appstr.$lastpage; } if ( $lastpage == null ) $lastpage=$currpage; $page_arr['page_start_row']=$startrec; $page_arr['page_row_count']=$reccount; $page_arr['page']=$page; $page_arr['no_of_pages']=$pagecount; $page_arr['curr_page']=$currpage; $page_arr['last_page']=$lastpage; $page_arr['prev_disabled']=$prev_disabled; $page_arr['next_disabled']=$next_disabled; $page_arr['first_href']=$first_href; $page_arr['prev_href']=$prev_href; $page_arr['next_href']=$next_href; $page_arr['last_href']=$last_href; //LOG_MSG('INFO',"Page Array=".print_r($page_arr,true)); return $page_arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function populateParams() {\r\n $this->pageNum = isset($_GET['p']) ? (int)$_GET['p'] : 0;\r\n $catId = isset($_GET['c']) ? (int)$_GET['c'] : 0;\r\n \r\n if ($this->pageNum < 1) {\r\n $this->pageNum = 1;\r\n }\r\n }", "function pageInfo($caps_count, $limit = 10)\n{\n // if $_GET['page'] is not set or invalid then set page as default 1\n if(!$page = filter_input(INPUT_GET, 'page', FILTER_SANITIZE_NUMBER_INT)){\n $page = 1;\n }\n\n // calculate the amount of pages based on the limit per page\n $count = $caps_count <= $limit ? 1 : ceil($caps_count / $limit);\n\n // if set page doesnt exist then return\n if($page < 1 || $page > $count) return;\n\n // set offset for current page\n $offset = ($page * $limit) - $limit;\n\n return [\n 'nr' => $page,\n 'count' => $count,\n 'limit' => $limit,\n 'offset' => $offset\n ];\n}", "protected function populateParams() {\r\n $this->pageNum = isset($_GET['p']) ? (int)$_GET['p'] : 0;\r\n $this->status = isset($_GET['status']) ? (int)$_GET['status'] : 0;\r\n if ($this->pageNum < 1) {\r\n $this->pageNum = 1;\r\n }\r\n }", "private function build_params() {\n\n\t\t\t$this->per_page = $this->request->get_param( 'per_page' ) ? $this->request->get_param( 'per_page' ) : (int) get_option( 'posts_per_page' );\n\t\t\t$this->page = $this->request->get_param( 'page' ) ? $this->request->get_param( 'page' ) : 1;\n\t\t}", "function getPagingParameters()\n {\n }", "function paginator($params, $count) {\n $limit = $params->getLimit();\n if ($count > $limit && $count!=0){\n $page = $params->getPage(); \n $controllerName = strtolower(Zend_Controller_Front::getInstance()->getRequest()->getControllerName()); \n $pagination = ($page != 1)?'<span><a href=\"\"onclick=\"Grid.page('.($page-1).'); return false\"><<</a></span>':''; \n if ($page > 10){ \n $pagination .= '<a href=\"\" onclick=\"Grid.page(1); return false;\">1</a>';\n $pagination .= '<span>...</span>';\n }\n $pageSpliter = ($page - 5 >= 1 ? $page - 4 : 1);\n for ($i = $pageSpliter; ($count + $limit) / ($i*$limit) > 1 && $i < $pageSpliter + 10; $i++) {\n $pagination .= '<a href=\"\" onclick=\"Grid.page('.$i.'); return false;\" class=\"'. ($page == $i ? \"active\":\"\") .'\">'.$i.'</a>';\n } \n $lastPage = floor(($count + $limit -1) / $limit);\n if ($page < $lastPage - 10){\n $pagination .= '<span>...</span>'; \n $pagination .= '<a href=\"\" onclick=\"Grid.page('. $lastPage .'); return false;\">'.$lastPage .'</a>';\n }\n $pagination .= ($page < ($count/$limit))?'<span><a href=\"\"onclick=\"Grid.page('.($page+1).'); return false\">>></a></span>':''; \n echo '<div class=\"pagination\">'; \n echo $pagination; \n echo '</div>';\n } \n }", "function getEventsPagination($count, $args) {\n\t \t$wp_args = array();\n\n\t \t$wp_args['base'] = preg_replace( '/(\\?.*)?$/', '', $_SERVER[\"REQUEST_URI\"] ).'%_%';\n\t \t$wp_args['format'] = '?wpcal-page=%#%';\n\n\t \t// Preserver other GET values\n\t \tforeach($_GET as $k => $v) {\n\t \t\tif (strtolower($k) != 'wpcal-page') {\n\t \t\t\tif (isset($wp_args['add_args']))\n\t \t\t\t$wp_args['add_args'] = array();\n\t \t\t\t$wp_args['add_args'][$k] = $v;\n\t \t\t}\n\t \t}\n\n\t \t$epp = 0;\n\t \tif (isset($args['number'])) {\n\t \t\t$epp = intval($args['number']);\n\t \t}\n\t \tif (empty($epp)) {\n\t \t\t$epp = intval(get_option('fse_number'));\n\t \t}\n\n\t \tif (isset($args['pagination_prev_text'])) {\n\t \t\t$wp_args['prev_text'] = $args['pagination_prev_text'];\n\t \t} else {\n\t \t\t$wp_args['prev_text'] = get_option('fse_pagination_prev_text');\n\t \t}\n\n\t \tif (isset($args['pagination_next_text'])) {\n\t \t\t$wp_args['next_text'] = $args['pagination_next_text'];\n\t \t} else {\n\t \t\t$wp_args['next_text'] = get_option('fse_pagination_next_text');\n\t \t}\n\n\t \tif (isset($args['pagination_end_size'])) {\n\t \t\t$wp_args['end_size'] = $args['pagination_end_size'];\n\t \t} else {\n\t \t\t$wp_args['end_size'] = get_option('fse_pagination_end_size');\n\t \t}\n\n\t \tif (isset($args['pagination_mid_size'])) {\n\t \t\t$wp_args['mid_size'] = $args['pagination_mid_size'];\n\t \t} else {\n\t \t\t$wp_args['mid_size'] = get_option('fse_pagination_mid_size');\n\t \t}\n\n\t \tif (isset($args['pagination_use_dots'])) {\n\t \t\t$wp_args['show_all'] = ($args['pagination_use_dots'] == true ? false : true);\n\t \t} else {\n\t \t\t$wp_args['show_all'] = get_option('fse_pagination_usedots') == true ? false : true;\n\t \t}\n\n\t \t$wp_args['prev_next'] = (!empty($wp_args['prev_text']) || !empty($wp_args['next_text']));\n\n\t \t// Calculate number of pages\n\t \t$wp_args['total'] = ceil($count / $epp);\n\n\t \tif ($args['page'] < 1)\n\t \t$wp_args['current'] = 1;\n\t \telseif ($args['page'] > $wp_args['total'])\n\t \t$wp_args['current'] = $wp_args['total'];\n\t \telse\n\t \t$wp_args['current'] = $args['page'];\n\n\t \treturn paginate_links($wp_args);\n\t }", "function getlist($pagecount,$page)\n{\n\t$echo = \"<select size=1 class='page_select' name=page onchange=javascript:location.href='\".getparam(\"page\",\"\").\"'+this.options[this.selectedIndex].value>\";\n\tfor($i=1;$i<=$pagecount;$i++)\n\t{\n\t\t$result = $pagecount/15;\n\t\tif($i>=$page-20 && $i<=$page+15){// ||\n\t\t\t$echo .= \"<option value=$i\".($page==$i ? ' selected' : '').\">\".$i.\"</option>\";\n\t\t}elseif($i%$result ==0 || $i==1 || $i==$pagecount){\n\t\t\t$echo .= \"<option value=$i>\".$i.\"</option>\";\n\t\t}\n\t}\n\t$echo.= \"</select>\";\n\treturn $echo;\n}", "abstract protected function createPages($count = 10): array;", "function pagination($title, $start, $start_name, $max, $max_name, $max_rows, $keep_post = false, $max_page_links = 5, $_selectors = null, $hash = '')\n{\n inform_non_canonical_parameter($max_name);\n inform_non_canonical_parameter($start_name);\n\n if (get_page_name() == 'members') {\n // Don't allow guest bots to probe too deep into the forum index, it gets very slow; the XML Sitemap is for guiding to topics like this\n if (($start > $max * 5) && (is_guest()) && (!is_null(get_bot_type()))) {\n access_denied('NOT_AS_GUEST');\n }\n }\n\n $post_array = array();\n if ($keep_post) {\n foreach ($_POST as $key => $val) {\n if (is_array($val)) {\n continue;\n }\n if (get_magic_quotes_gpc()) {\n $val = stripslashes($val);\n }\n $post_array[$key] = $val;\n }\n }\n\n $get_url = get_self_url(true);\n\n // How many to show per page\n if (is_null($_selectors)) {\n $_selectors = array(10, 25, 50, 80);\n }\n if (has_privilege(get_member(), 'remove_page_split')) {\n if (get_param_integer('keep_avoid_memory_limit', 0) == 1) {\n $_selectors[] = $max_rows;\n }\n }\n $_selectors[] = $max;\n sort($_selectors);\n $_selectors = array_unique($_selectors);\n $selectors = new Tempcode();\n foreach ($_selectors as $selector_value) {\n if ($selector_value > $max_rows) {\n $selector_value = $max_rows;\n }\n $selected = ($max == $selector_value);\n $selectors->attach(do_template('PAGINATION_PER_PAGE_OPTION', array('_GUID' => '1a0583bab42257c60289459ce1ac1e05', 'SELECTED' => $selected, 'VALUE' => strval($selector_value), 'NAME' => integer_format($selector_value))));\n\n if ($selector_value == $max_rows) {\n break;\n }\n }\n $hidden = build_keep_form_fields('_SELF', true, array($max_name, $start_name));\n $per_page = do_template('PAGINATION_PER_PAGE', array('_GUID' => '1993243727e58347d1544279c5eba496', 'HASH' => ($hash == '') ? null : $hash, 'HIDDEN' => $hidden, 'URL' => $get_url, 'MAX_NAME' => $max_name, 'SELECTORS' => $selectors));\n $GLOBALS['INCREMENTAL_ID_GENERATOR']++;\n\n if ($max < $max_rows) { // If they don't all fit on one page\n $parts = new Tempcode();\n $num_pages = ($max == 0) ? 1 : intval(ceil(floatval($max_rows) / floatval($max)));\n\n // Link to first\n if ($start > 0) {\n $url_array = array('page' => '_SELF', $start_name => running_script('index') ? null : 0);\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n $first = do_template('PAGINATION_CONTINUE_FIRST', array('_GUID' => 'f5e510da318af9b37c3a4b23face5ae3', 'TITLE' => $title, 'P' => strval(1), 'FIRST_URL' => $cat_url));\n } else {\n $first = new Tempcode();\n }\n\n // Link to previous\n if ($start > 0) {\n $url_array = array('page' => '_SELF', $start_name => strval(max($start - $max, 0)));\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n $previous = do_template('PAGINATION_PREVIOUS_LINK', array('_GUID' => 'ec4d4da9677b5b9c8cea08676337c6eb', 'TITLE' => $title, 'P' => integer_format(intval($start / $max)), 'URL' => $cat_url));\n } else {\n $previous = do_template('PAGINATION_PREVIOUS');\n }\n\n // CALCULATIONS FOR CROPPING OF SEQUENCE\n // $from is the index number (one less than written page number) we start showing page-links from\n // $to is the index number (one less than written page number) we stop showing page-links from\n if ($max != 0) {\n $max_dispersal = $max_page_links / 2;\n $from = max(0, intval(floatval($start) / floatval($max) - $max_dispersal));\n $to = intval(ceil(min(floatval($max_rows) / floatval($max), floatval($start) / floatval($max) + $max_dispersal)));\n $dif = (floatval($start) / floatval($max) - $max_dispersal);\n if ($dif < 0.0) { // We have more forward range than max dispersal as we're near the start\n $to = intval(ceil(min(floatval($max_rows) / floatval($max), floatval($start) / floatval($max) + $max_dispersal - $dif)));\n }\n } else {\n $from = 0;\n $to = 0;\n }\n\n // Indicate that the sequence is incomplete with an ellipsis\n if ($from > 0) {\n $continues_left = do_template('PAGINATION_CONTINUE');\n } else {\n $continues_left = new Tempcode();\n }\n\n $bot = (is_guest()) && (!is_null(get_bot_type()));\n\n // Show the page number jump links\n for ($x = $from; $x < $to; $x++) {\n $url_array = array('page' => '_SELF', $start_name => ($x == 0) ? null : strval($x * $max));\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n if ($x * $max == $start) {\n $parts->attach(do_template('PAGINATION_PAGE_NUMBER', array('_GUID' => '13cdaf548d5486fb8d8ae0d23b6a08ec', 'P' => strval($x + 1))));\n } else {\n $rel = null;\n if ($x == 0) {\n $rel = 'first';\n }\n $parts->attach(do_template('PAGINATION_PAGE_NUMBER_LINK', array('_GUID' => 'a6d1a0ba93e3b7deb6fe6f8f1c117c0f', 'NOFOLLOW' => ($x * $max > $max * 5) && ($bot), 'REL' => $rel, 'TITLE' => $title, 'URL' => $cat_url, 'P' => strval($x + 1))));\n }\n }\n\n // Indicate that the sequence is incomplete with an ellipsis\n if ($to < $num_pages) {\n $continues_right = do_template('PAGINATION_CONTINUE');\n } else {\n $continues_right = new Tempcode();\n }\n\n // Link to next\n if (($start + $max) < $max_rows) {\n $url_array = array('page' => '_SELF', $start_name => strval($start + $max));\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n $p = ($max == 0) ? 1.0 : ($start / $max + 2);\n $rel = null;\n if (($start + $max * 2) > $max_rows) {\n $rel = 'last';\n }\n $next = do_template('PAGINATION_NEXT_LINK', array('_GUID' => '6da9b396bdd46b7ee18c05b5a7eb4d10', 'NOFOLLOW' => ($start + $max > $max * 5) && ($bot), 'REL' => $rel, 'TITLE' => $title, 'NUM_PAGES' => integer_format($num_pages), 'P' => integer_format(intval($p)), 'URL' => $cat_url));\n } else {\n $next = do_template('PAGINATION_NEXT');\n }\n\n // Link to last\n if ($start + $max < $max_rows) {\n $url_array = array('page' => '_SELF', ($num_pages - 1 == 0) ? null : $start_name => strval(($num_pages - 1) * $max));\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n $last = do_template('PAGINATION_CONTINUE_LAST', array('_GUID' => '2934936df4ba90989e949a8ebe905522', 'TITLE' => $title, 'P' => strval($num_pages), 'LAST_URL' => $cat_url));\n } else {\n $last = new Tempcode();\n }\n\n // Page jump dropdown, if we had to crop\n if ($num_pages > $max_page_links) {\n $list = new Tempcode();\n $pg_start = 0;\n $pg_to = $num_pages;\n $pg_at = intval(floatval($start) / floatval($max));\n if ($pg_to > 100) {\n $pg_start = max($pg_at - 50, 0);\n $pg_to = $pg_start + 100;\n }\n if ($pg_start != 0) {\n $list->attach(form_input_list_entry('', false, '...', false, true));\n }\n for ($i = $pg_start; $i < $pg_to; $i++) {\n $list->attach(form_input_list_entry(strval($i * $max), ($i * $max == $start), strval($i + 1)));\n }\n if ($pg_to != $num_pages) {\n $list->attach(form_input_list_entry('', false, '...', false, true));\n }\n $dont_auto_keep = array();\n $hidden = build_keep_form_fields('_SELF', true, $dont_auto_keep);\n $pages_list = do_template('PAGINATION_LIST_PAGES', array('_GUID' => '9e1b394763619433f23b8ed95f5ac134', 'URL' => $get_url, 'HIDDEN' => $hidden, 'START_NAME' => $start_name, 'LIST' => $list));\n } else {\n $pages_list = new Tempcode();\n }\n\n // Put it all together\n return do_template('PAGINATION_WRAP', array(\n '_GUID' => '2c3fc957d4d8ab9103ef26458e18aed1',\n 'TEXT_ID' => $title,\n 'PER_PAGE' => $per_page,\n 'FIRST' => $first,\n 'PREVIOUS' => $previous,\n 'CONTINUES_LEFT' => $continues_left,\n 'PARTS' => $parts,\n 'CONTINUES_RIGHT' => $continues_right,\n 'NEXT' => $next,\n 'LAST' => $last,\n 'PAGES_LIST' => $pages_list,\n\n 'START' => strval($start),\n 'MAX' => strval($max),\n 'MAX_ROWS' => strval($max_rows),\n 'NUM_PAGES' => strval($num_pages),\n ));\n }\n\n if (get_value('pagination_when_not_needed') === '1') {\n return do_template('PAGINATION_WRAP', array('_GUID' => '451167645e67c7beabcafe11c78680db', 'TEXT_ID' => $title,\n 'PER_PAGE' => $per_page,\n 'FIRST' => '',\n 'PREVIOUS' => '',\n 'CONTINUES_LEFT' => '',\n 'PARTS' => '',\n 'CONTINUES_RIGHT' => '',\n 'NEXT' => '',\n 'LAST' => '',\n 'PAGES_LIST' => '',\n\n 'START' => strval($start),\n 'MAX' => strval($max),\n 'MAX_ROWS' => strval($max_rows),\n 'NUM_PAGES' => strval(1),\n ));\n }\n\n return new Tempcode();\n}", "protected function buildPagination() {}", "protected function buildPagination() {}", "private function getParamsFromRequest() {\n if (isset($_GET['page'])) {\n $this->currentpage = $_GET['page'];\n } else {\n //else set default page to render\n $this->currentpage = 1;\n }\n //If limit is defined in URL\n if (isset($_GET['limit'])) {\n $this->limit = $_GET['limit'];\n } else { //else set default limit to 20\n $this->limit = 10;\n }\n //If currentpage is set to null or is set to 0 or less\n //set it to default (1)\n if (($this->currentpage == null) || ($this->currentpage < 1)) {\n $this->currentpage = 1;\n }\n //if limit is set to null set it to default (10)\n if (($this->limit == null)) {\n $this->limit = 10;\n //if limit is any number less than 1 then set it to 0 for displaying\n //items without limit\n } else if ($this->limit < 1) {\n $this->limit = 0;\n }\n }", "public function page($pagination_link, $values,$other_url){\n $total_values = count($values);\n $pageno = (int)(isset($_GET[$pagination_link])) ? $_GET[$pagination_link] : $pageno = 1;\n $counts = ceil($total_values/$this->limit);\n $param1 = ($pageno - 1) * $this->limit;\n $this->data = array_slice($values, $param1,$this->limit); \n \n \n if ($pageno > $this->total_pages) {\n $pageno = $this->total_pages;\n } elseif ($pageno < 1) {\n $pageno = 1;\n }\n if ($pageno > 1) {\n $prevpage = $pageno -1;\n $this->firstBack = array($this->functions->base_url_without_other_route().\"/$other_url/1\", \n $this->functions->base_url_without_other_route().\"/$other_url/$prevpage\");\n // $this->functions->base_url_without_other_route()./1\n // $this->firstBack = \"<div class='first-back'><a href='blog/\".basename($_SERVER['PHP_SELF'], '.php').\"/1'>\n // <i class='fa fa-arrow-circle-o-left' aria-hidden='true'></i>&nbsp;First\n // </a> \n // <a href='blog/\".basename($_SERVER['PHP_SELF'], '.php').\"/$prevpage'>\n // <i class='fa fa-arrow-circle-o-left' aria-hidden='true'></i>&nbsp;\n // prev\n // </a></div>\";\n }\n\n // $this->where = \"<div class='page-count'>(Page $pageno of $this->total_pages)</div>\";\n $this->where = \"page $pageno of $this->total_pages\";\n if ($pageno < $this->total_pages) {\n $nextpage = $pageno + 1;\n $this->nextLast = array($this->functions->base_url_without_other_route().\"/$other_url/$nextpage\",\n $this->functions->base_url_without_other_route().\"/$other_url/$this->total_pages\");\n // $this->nextLast = \"blog/\".basename($_SERVER['PHP_SELF'], '.php').\"/$nextpage'>Next&nbsp;\n // <i class='fa fa-arrow-circle-o-right' aria-hidden='true'></i></a> \n // <a href='blog/\".basename($_SERVER['PHP_SELF'], '.php').\"/$this->total_pages'>Last&nbsp;\n // <i class='fa fa-arrow-circle-o-right' aria-hidden='true'></i>\n // </a></div>\";\n }\n\n return $pageno;\n }", "function paginationNames($page = 1, $page_count)\n{\n if($page < 3){\n return [\n 'first' => 1,\n 'second' => 2,\n 'third' => 3\n ];\n }elseif($page == $page_count){\n return [\n 'first' => ($page_count - 2),\n 'second' => ($page_count - 1),\n 'third' => $page_count\n ];\n }else{\n return [\n 'first' => ($page - 1),\n 'second' => $page,\n 'third' => ($page + 1)\n ];\n }\n}", "abstract public function preparePagination();", "function paginationLinks($page = 1, $page_count, $query = \"\")\n{\n // base page url\n $url = \"collection\";\n\n // first page link, which doesn't have a page data in url (no page=1)\n $first_page = $url . $query;\n\n // checking if other variables exist in query and adding needed characters\n $query .= (strpos($query, \"=\") !== FALSE) ? \"&\" : \"?\";\n $query .= \"page=\";\n\n // last page is always a max = page_count\n $last_page = $url . $query . $page_count;\n\n // pages before and after current page\n $previous = $url . $query . ($page-1);\n $next = $url . $query . ($page+1);\n\n // setting the three buttons values, middle one is current\n $first = $previous;\n $second = $url . $query . $page;\n $third = $next;\n\n // changing page links in special circumstances\n if($page == 1){\n $first = $first_page;\n $second = $next;\n $third = $url . $query . ($page+2);\n }elseif($page == 2){\n $first = $first_page;\n $previous = $first_page;\n }elseif($page == $page_count){\n $first = $url . $query . ($page_count-2);\n $second = $url . $query . ($page_count-1);\n $third = $last_page;\n }\n\n return [\n 'first_page' => $first_page,\n 'last_page' => $last_page,\n 'previous' => $previous,\n 'next' => $next, \n 'first' => $first,\n 'second' => $second,\n 'third' => $third\n ];\n}", "function GetPagination($page, $perpage, $count) {\n $result = [];\n $result['page'] = $page > 0 ? $page - 1 : 0;\n $result['total'] = $count > $perpage ? $perpage : $count;\n $result['start'] = $result['page'] * $perpage;\n $last = $result['total'] + $result['start'];\n $result['last'] = $last > $count ? $count : $last;\n return $result;\n}", "function getPaging($refUrl, $aryOpts, $pgCnt, $curPg) {\n $return = '';\n $return.='<div class=\"box-bottom\"><div class=\"paginate\">';\n if ($curPg > 1) {\n $aryOpts['pg'] = 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">First</a>';\n\n $aryOpts['pg'] = $curPg - 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Prev</a>';\n }\n for ($i = 1; $i <= $pgCnt; $i++) {\n $aryOpts['pg'] = $i;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"';\n if ($curPg == $i)\n $return.='active';\n $return.='\" >' . $i . '</a>';\n }\n if ($curPg < $pgCnt) {\n $aryOpts['pg'] = $curPg + 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Next</a>';\n $aryOpts['pg'] = $pgCnt;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Last</a>';\n }\n $return.='<div class=\"clearfix\"></div></div></div>';\n return $return;\n}", "function paging($condtion='1')\r\n {\r\n /*\r\n $url = '';\r\n \t if(isset($_GET[\"brand\"])){\r\n \t \t$value = trim($_GET['brand']);\r\n \t \tif($value != \"\"){\r\n\t \t \t$condtion = sprintf(\"brand='%s'\",$value);\r\n\t \t \t$url = '&brand='.$value;\r\n \t \t}\r\n \t }\r\n \t \r\n \t if(isset($_GET[\"module\"])){\r\n \t \t$value = trim($_GET['module']);\r\n \t \tif($value != \"\"){\r\n\t \t \t$module = sprintf(\"series='%s'\",$value);\r\n\t \t \t$condtion = $condtion.' and '.$module;\r\n\t \t \t$url = $url.'&module='.$value;\r\n \t \t}\r\n \t }\r\n \t \r\n \t if(isset($_GET[\"part\"])){\r\n \t \t$value = trim($_GET['part']);\r\n \t \tif($value != \"\"){ \t \t\r\n\t \t \t$part = sprintf(\"module='%s'\",$value);\r\n\t \t \t$condtion = $condtion.' and '.$part;\r\n\t \t \t$url = $url.'&part='.$value;\r\n \t \t}\r\n \t }\r\n \t \r\n \t if(isset($_GET[\"key\"])){\r\n \t \t$value = trim($_GET[\"key\"]);\r\n \t \tif($value != \"\"){\r\n\t \t \t$condtion = $this->key_query($value,$url);\r\n\t \t \techo \"++++++++++\".$condtion;\r\n\t \t \t//$url = $url.'&part='.$value; \t \t\r\n \t \t}\r\n \t }\r\n \t */\r\n // get current page index\r\n $page = 1;\r\n \t if(isset($_GET[\"page\"])){\r\n \t \t$page = $_GET['page'];\r\n \t }\r\n \t \r\n \t // set paging parameters\r\n $number = 6; \r\n $total = $this->total;\r\n $url = $this->pget;\r\n $condtion = $this->cond;\r\n //$total = $this->getTotal($condtion);\r\n \r\n $url = '?page={page}'.$url; \r\n $pager = new Paging($total,$number,$page,$url);\r\n \t \r\n \t // get publish records\r\n\t $db = GLOBALDB();\r\n $sql = \"SELECT * FROM publish WHERE \".$condtion.\" order by id desc LIMIT \".$pager->limit.\",\".$pager->size;\r\n $result = $db->query($sql); \r\n $this->display($result);\r\n \r\n // show paging bar\r\n //echo $sql;\r\n\t $pager->show();\r\n }", "function getPage($params) {\r\n if (isset($params['named']['page'])) {\r\n return is_array($params['named']['page']) ? $params['named']['page'][0] : $params['named']['page']; //Ensure we only send one result\r\n }\r\n return 1;\r\n }", "function HTMLPage ($params) {\n if (!isset($params['total-count'])) {\n return '';\n }\n\n //REQUEST_URIを解析\n $uris = @explode(\"?\", $_SERVER['REQUEST_URI']);\n $base_url = $uris[0];\n $query_params = array();\n if (count($uris)>1) {\n $querys = @explode(\"&\", $uris[1]);\n $query_params = array();\n foreach ($querys as $query) {\n $tmp_params = @explode(\"=\", $query);\n $query_params[$tmp_params[0]] = $tmp_params[1];\n }\n }\n $now_page = 1;\n if (isset($query_params['pager_id'])) {\n $now_page = $query_params['pager_id'];\n }\n unset($query_params['pager_id']);\n\n //POSTデータから条件を設定する「s_」を対象とする仕様。\n foreach ($_POST as $key=>$val) {\n if (substr($key, 0 ,2)=='s_') {\n if (is_array($val)) {\n $i=0;\n foreach ($val as $k=>$v) {\n if (is_null($k)) {\n $k = $i++;\n }\n $str = $key.\"[\".$k.\"]\";\n $query_params[$str] = htmlentities($v);\n }\n }\n else {\n $query_params[$key] = htmlentities($val);\n }\n }\n }\n\n //再構成\n $base_url = site_url($base_url);\n if (count($query_params)>0) {\n $querys = array();\n foreach ($query_params as $key=>$val) {\n $querys[] = $key . '=' . $val;\n }\n $base_url = $base_url . \"?\" . @implode('&', $querys);\n }\n\n //全ページ数を算出\n $total_page = ceil($params['total-count'] / SC_PAGE_COUNT);\n $total_pages = array();\n for ($i=1; $i<=$total_page; $i++) {\n $total_pages[$i] = $i;\n }\n //現在ページから最大5つページ番号を表示するための制御\n $page_data = array();\n for ($i=($now_page-5); $i<=($now_page+5); $i++) {\n if (isset($total_pages[$i])) {\n $page_data[$i] = $base_url . '?pager_id=' . $i;\n if (count($query_params)>0) {\n $page_data[$i] = $base_url . '&pager_id=' . $i;\n }\n }\n }\n\n //固定部生成\n $next_page = $now_page + 1;\n if ($next_page > $total_page) {\n $next_page = $total_page;\n }\n $prev_page = $now_page - 1;\n if ($prev_page < 1) {\n $prev_page = 1;\n }\n $link1 = $base_url . '?pager_id=1';\n if (count($query_params)>0) {\n $link1 = $base_url . '&pager_id=1';\n }\n $link2 = $base_url . '?pager_id=' . $prev_page;\n if (count($query_params)>0) {\n $link2 = $base_url . '&pager_id=' . $prev_page;\n }\n $link3 = $base_url . '?pager_id=' . $next_page;\n if (count($query_params)>0) {\n $link3 = $base_url . '&pager_id=' . $next_page;\n }\n $link4 = $base_url . '?pager_id=' . $total_page;\n if (count($query_params)>0) {\n $link4 = $base_url . '&pager_id=' . $total_page;\n }\n\n $page_html = array();\n if ($total_page > 0) {\n $page_html[] = SimpleCartFunctions::HTMLLink(array('href'=>$link1, 'value'=>__(SCLNG_PAGER_FIRST, SC_DOMAIN)));\n $page_html[] = SimpleCartFunctions::HTMLLink(array('href'=>$link2, 'value'=>__(SCLNG_PAGER_PREV, SC_DOMAIN)));\n foreach ($page_data as $key=>$data) {\n if ($key == $now_page) {\n $page_html[] = $key;\n }\n else {\n $page_html[] = SimpleCartFunctions::HTMLLink(array('href'=>$data, 'value'=>$key));\n }\n }\n $page_html[] = SimpleCartFunctions::HTMLLink(array('href'=>$link3, 'value'=>__(SCLNG_PAGER_NEXT, SC_DOMAIN)));\n $page_html[] = SimpleCartFunctions::HTMLLink(array('href'=>$link4, 'value'=>__(SCLNG_PAGER_LAST, SC_DOMAIN)));\n }\n $page_html[] = __(SCLNG_PAGER_TOTAL, SC_DOMAIN);\n $page_html[] = \":\";\n $page_html[] = $params['total-count'];\n return @implode(' ', $page_html);\n }", "function getPagingSup($refUrl, $aryOpts, $pgCnt, $curPg) {\n if (in_array('[__atuvc]', $aryOpts)) {\n unset($aryOpts[array_search('[__atuvc]')]);\n array_values($aryOpts);\n }\n $return = '';\n if ($curPg > 1) {\n $aryOpts['pg'] = 1;\n //$return.='<li class=\"pre\"><a href=\"'.$refUrl.getQueryString($aryOpts).'\">First</a></li>';\n\n $aryOpts['pg'] = $curPg - 1;\n $return.='<li ><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"pre\">Previous</a></li>';\n }\n for ($i = 1; $i <= $pgCnt; $i++) {\n $aryOpts['pg'] = $i;\n if ($pgCnt == $i && $curPg >= $pgCnt)\n $class.=' bordernone';\n $return.='<li class=\"' . $class . '\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"';\n if ($curPg == $i)\n $return.=' active';\n $return.='\" >' . $i . '</a></li>';\n }\n if ($curPg < $pgCnt) {\n $aryOpts['pg'] = $curPg + 1;\n $return.='<li class=\"last\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"nextal\">Next</a></li>';\n $aryOpts['pg'] = $pgCnt;\n //$return.='<li class=\"last\"><a href=\"'.$refUrl.getQueryString($aryOpts).'\" class=\"nextal\">Last</a></li>';\n }\n return $return;\n}", "function Pagination() \n { \n $this->current_page = 1; \n $this->mid_range = 7; \n $this->items_per_page = (!empty($_GET['ipp'])) ? $_GET['ipp']:$this->default_ipp; \n }", "function get_params_array()\n {\n $values = array(\n 'paged' => (isset($_GET['paged'])?$_GET['paged']:(isset($_POST['paged'])?$_POST['paged']:1)),\n 'l' => (isset($_GET['l'])?$_GET['l']:(isset($_POST['l'])?$_POST['l']:'all')),\n 'group' => (isset($_GET['group'])?$_GET['group']:(isset($_POST['group'])?$_POST['group']:'')),\n 'ip' => (isset($_GET['ip'])?$_GET['ip']:(isset($_POST['ip'])?$_POST['ip']:'')),\n 'vuid' => (isset($_GET['vuid'])?$_GET['vuid']:(isset($_POST['vuid'])?$_POST['vuid']:'')),\n 'sdate' => (isset($_GET['sdate'])?$_GET['sdate']:(isset($_POST['sdate'])?$_POST['sdate']:'')),\n 'edate' => (isset($_GET['edate'])?$_GET['edate']:(isset($_POST['edate'])?$_POST['edate']:'')),\n 'type' => (isset($_GET['type'])?$_GET['type']:(isset($_POST['type'])?$_POST['type']:'all')),\n 'search' => (isset($_GET['search'])?$_GET['search']:(isset($_POST['search'])?$_POST['search']:'')),\n 'sort' => (isset($_GET['sort'])?$_GET['sort']:(isset($_POST['sort'])?$_POST['sort']:'')),\n 'sdir' => (isset($_GET['sdir'])?$_GET['sdir']:(isset($_POST['sdir'])?$_POST['sdir']:''))\n );\n\n return $values;\n }", "function findPages($count, $limit) // count diisi 50 dan limit diisi 10\n { \n $pages = (($count % $limit) == 0) ? $count / $limit : floor($count / $limit) + 1; // maka $pages= 5\n\n return $pages; \n }", "function buildNavigation($pageNum_Recordset1,$totalPages_Recordset1,$prev_Recordset1,$next_Recordset1,$separator=\" | \",$max_links=10, $show_page=true)\n{\n GLOBAL $maxRows_rs_forn,$totalRows_rs_forn;\n\t$pagesArray = \"\"; $firstArray = \"\"; $lastArray = \"\";\n\tif($max_links<2)$max_links=2;\n\tif($pageNum_Recordset1<=$totalPages_Recordset1 && $pageNum_Recordset1>=0)\n\t{\n\t\tif ($pageNum_Recordset1 > ceil($max_links/2))\n\t\t{\n\t\t\t$fgp = $pageNum_Recordset1 - ceil($max_links/2) > 0 ? $pageNum_Recordset1 - ceil($max_links/2) : 1;\n\t\t\t$egp = $pageNum_Recordset1 + ceil($max_links/2);\n\t\t\tif ($egp >= $totalPages_Recordset1)\n\t\t\t{\n\t\t\t\t$egp = $totalPages_Recordset1+1;\n\t\t\t\t$fgp = $totalPages_Recordset1 - ($max_links-1) > 0 ? $totalPages_Recordset1 - ($max_links-1) : 1;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$fgp = 0;\n\t\t\t$egp = $totalPages_Recordset1 >= $max_links ? $max_links : $totalPages_Recordset1+1;\n\t\t}\n\t\tif($totalPages_Recordset1 >= 1) {\n\t\t\t#\t------------------------\n\t\t\t#\tSearching for $_GET vars\n\t\t\t#\t------------------------\n\t\t\t$_get_vars = '';\t\t\t\n\t\t\tif(!empty($_GET) || !empty($HTTP_GET_VARS)){\n\t\t\t\t$_GET = empty($_GET) ? $HTTP_GET_VARS : $_GET;\n\t\t\t\tforeach ($_GET as $_get_name => $_get_value) {\n\t\t\t\t\tif ($_get_name != \"pageNum_rs_forn\") {\n\t\t\t\t\t\t$_get_vars .= \"&$_get_name=$_get_value\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$successivo = $pageNum_Recordset1+1;\n\t\t\t$precedente = $pageNum_Recordset1-1;\n\t\t\t$firstArray = ($pageNum_Recordset1 > 0) ? \"<a href=\\\"$_SERVER[PHP_SELF]?pageNum_rs_forn=$precedente$_get_vars\\\">$prev_Recordset1</a>\" : \"$prev_Recordset1\";\n\t\t\t# ----------------------\n\t\t\t# page numbers\n\t\t\t# ----------------------\n\t\t\tfor($a = $fgp+1; $a <= $egp; $a++){\n\t\t\t\t$theNext = $a-1;\n\t\t\t\tif($show_page)\n\t\t\t\t{\n\t\t\t\t\t$textLink = $a;\n\t\t\t\t} else {\n\t\t\t\t\t$min_l = (($a-1)*$maxRows_rs_forn) + 1;\n\t\t\t\t\t$max_l = ($a*$maxRows_rs_forn >= $totalRows_rs_forn) ? $totalRows_rs_forn : ($a*$maxRows_rs_forn);\n\t\t\t\t\t$textLink = \"$min_l - $max_l\";\n\t\t\t\t}\n\t\t\t\t$_ss_k = floor($theNext/26);\n\t\t\t\tif ($theNext != $pageNum_Recordset1)\n\t\t\t\t{\n\t\t\t\t\t$pagesArray .= \"<a href=\\\"$_SERVER[PHP_SELF]?pageNum_rs_forn=$theNext$_get_vars\\\">\";\n\t\t\t\t\t$pagesArray .= \"$textLink</a>\" . ($theNext < $egp-1 ? $separator : \"\");\n\t\t\t\t} else {\n\t\t\t\t\t$pagesArray .= \"$textLink\" . ($theNext < $egp-1 ? $separator : \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t$theNext = $pageNum_Recordset1+1;\n\t\t\t$offset_end = $totalPages_Recordset1;\n\t\t\t$lastArray = ($pageNum_Recordset1 < $totalPages_Recordset1) ? \"<a href=\\\"$_SERVER[PHP_SELF]?pageNum_rs_forn=$successivo$_get_vars\\\">$next_Recordset1</a>\" : \"$next_Recordset1\";\n\t\t}\n\t}\n\treturn array($firstArray,$pagesArray,$lastArray);\n}", "public function get_pages($total,$current,$nb_per_page,$rub,$array_submitted=array())\n {\n $str_return = '';\n $arr_return = '';\n \n $get = '';\n \n foreach($array_submitted as $keysubmitted => $valuesubmitted)\n {\n if(!empty($valuesubmitted))\n {\n $get .= strtolower('&'.$keysubmitted.'='.$valuesubmitted);\n }\n }\n \n if($total>$nb_per_page)\n {\n $nbpage = ceil($total/$nb_per_page);\n\n if($current>1)\n {\n $prec = $current-1;\n $href = \"index.php?rub=\".$rub.\"&p=\".$prec.$get;\n\n $arr_return[] = array('link' => $href, 'number' => 'fa fa-arrow-left', 'active' => 0, 'bnumber' => 0);\n }\n\n if($nbpage <10)\n {\n $linkstart = 1;\n $linkstop = $nbpage;\n }\n else if($current<=5)\n { \n $linkstart = 1;\n $linkstop = 10;\n }\n else if( $current>5 && $current<($nbpage-5) )\n { \n $linkstart = $current-4;\n $linkstop = $current+5;\n }\n else if( $current>=($nbpage-5) )\n { \n $linkstart = $nbpage-9;\n $linkstop = $nbpage;\n }\n \n\n for($ipage=$linkstart;$ipage<=$linkstop;$ipage++)\n {\n $href = \"index.php?rub=\".$rub.\"&p=\".$ipage.$get; \n if($current==$ipage)\n {\n $arr_return[] = array('link' => '#', 'number' => $ipage, 'active' => 1, 'bnumber' => 1);\n }\n else\n {\n $arr_return[] = array('link' => $href, 'number' => $ipage, 'active' => 0, 'bnumber' => 1);\n }\n }\n\n if($current<$nbpage)\n {\n $suiv = $current+1;\n $href = \"index.php?rub=\".$rub.\"&p=\".$suiv.$get;\n\n $arr_return[] = array('link' => $href, 'number' => 'fa fa-arrow-right', 'active' => 0, 'bnumber' => 0);\n }\n \n \n } \n return $arr_return;\n }", "public function Pages($params = array()) {\n\t\t//设置默认参数\n\t\t$_defaults_params = array(\n\t\t\t'allow_cache' => true,\n\t\t\t'page' => isset($_GET['page']) ? intval($_GET['page']) : 1,\n\t\t\t'pagesize' => 10,\n\t\t);\n\t\t$params = array_merge($_defaults_params, $params);\n\t\t\n\t\t//有开启缓存功能,则从缓存中取数据, 如果有数据,则直接返回结果\n\t\tif($params['allow_cache'] && isset($this->cache)) {\n\t\t\t$cacheKey = md5('collect.fields.pages.' . serialize($params));\n\t\t\t$ret = $this->cache->get($cacheKey);\n\t\t\t\n\t\t\tif($ret && is_array($ret)) {\n\t\t\t\treturn $ret;\n\t\t\t}\n\t\t}\n \n\t\t//添加条件\n\t\t$builds = array(\n 'select' => 'COUNT(`mf`.`collect_fields_id`) AS `COUNT`',\n 'from' => array('{{collect_model_fields}}', 'mf')\n );\n\t\tif(isset($params['collect_fields_status']) && !empty($params['collect_fields_status'])) {\n\t\t\t$builds['where'] = array('AND', '`mf`.`collect_fields_status`=:collect_fields_status');\n\t\t\t$sql_params[':collect_fields_status'] = $params['collect_fields_status'];\n\t\t} else {\n\t\t\t$builds['where'] = array('AND', '`mf`.`collect_fields_status`>:collect_fields_status');\n\t\t\t$sql_params[':collect_fields_status'] = 0;\n\t\t}\n\t\t\n\t\t//\n\t\tif(isset($params['collect_model_id']) && !empty($params['collect_model_id'])) {\n\t\t\t$builds['where'][] = array('AND', '`mf`.`collect_model_id`=:collect_model_id');\n\t\t\t$sql_params[':collect_model_id'] = $params['collect_model_id'];\n\t\t}\n\t\t\n\t\tif(isset($params['collect_fields_id']) && !empty($params['collect_fields_id'])) {\n\t\t\t$builds['where'][] = array('AND', '`mf`.`collect_fields_id`=:collect_fields_id');\n\t\t\t$sql_params[':collect_fields_id'] = $params['collect_fields_id'];\n\t\t}\n\t\t\n\t\tif(isset($params['collect_fields_name']) && !empty($params['collect_fields_name'])) {\n\t\t\t$builds['where'][] = array(\n 'LIKE',\n '`mf`.`collect_fields_name`',\n ':collect_fields_name'\n );\n\t\t\t$sql_params[':collect_fields_name'] = \"{$params['collect_fields_name']}\";\n\t\t}\n\t\t\n\t\tif(isset($params['searchKey']) && !empty($params['searchKey'])) {\n\t\t\t$builds['where'][] = array(\n 'LIKE',\n '`mf`.`collect_fields_name`',\n ':searchKey'\n );\n\t\t\t$sql_params[':searchKey'] = \"%{$params['searchKey']}%\";\n\t\t}\n $sql = $this->buildQuery($builds);\n\t\t\n\t\t//统计数量\n $count = $this->db->queryScalar($sql, $sql_params);\n\t\t\n\t\t//分页处理\n\t\t$pages = new CPagination($count);\n\t\t\n\t\t//设置分页大小\n\t\t$pages->pageSize = $params['pagesize'];\n\t\t\n\t\tif(isset($params['orderby']) && $params['orderby']) {\n\t\t\t$builds['order'] = $params['orderby'];\n\t\t} else {\n $builds['order'] = array(\n\t\t\t\t\t'`mf`.`collect_fields_rank` ASC',\n\t\t\t\t\t'`mf`.`collect_fields_id` DESC',\n\t\t\t\t);\n\t\t}\n\t\t\n $builds['select'] = '`mf`.`collect_fields_id`, `mf`.`collect_fields_name`,`mf`.`collect_fields_system`, `mf`.`collect_fields_belong`, `mf`.`collect_fields_identify`, `mf`.`collect_fields_rank`, `mf`.`collect_fields_lasttime`, `mf`.`collect_fields_type`, `cf`.`content_model_field_name`';\n $builds['leftJoin'] = array(\n '{{content_model_fields}}', 'cf', '`cf`.`content_model_field_id`=`mf`.`content_model_field_id`',\n );\n $pages->applyLimit($builds);\n $sql = $this->buildQuery($builds);\n\t\t$ret['pages'] = $pages;\n\t\t$ret['rows'] = $this->db->queryAll($sql, $sql_params);\n\t\t\n\t\tforeach($ret[\"rows\"] as $_k=>$_v){\n\t\t\t$ret[\"rows\"][$_k]['collect_fields_type'] = self::getFieldTypes($_v['collect_fields_type']);\n\t\t}\n\t\t\n\t\t//有开启缓存,则把结果添加到缓存中\n\t\tif($params['allow_cache'] && isset($this->cache)) {\n\t\t\t$cacheTime = Setting::inst()->getSettingValue('COLLECT_MODEL_PAGES_CACHE_TIME');\n\t\t\t$this->cache->set($cacheKey, json_encode($ret), $cacheTime);\n\t\t\tunset($cacheTime, $cacheKey);\n\t\t}\n\t\treturn $ret;\n\t}", "public function buildPagination($count,$limit,$start,$url) {\n\t\t$pageCount = $count / $limit;\n\t\t$curPage = $start / $limit;\n\t\t$pages = '';\n\t\tfor ($i=0;$i<$pageCount;$i++) {\n\t\t\t$newStart = $i*$limit;\n\t\t\t$u = $url.'&start='.$newStart.'&limit='.$limit;\n\t\t\tif ($i != $curPage) {\n\t\t\t\t$pages .= '<li class=\"page-number\"><a href=\"'.$u.'\">'.($i+1).'</a></li>';\n\t\t\t} else {\n\t\t\t\t$pages .= '<li class=\"page-number pgCurrent\">'.($i+1).'</li>';\n\t\t\t}\n\t\t}\n\t\treturn $this->getChunk('xflickrPagination',array(\n 'xflickr.pages' => $pages,\n\t\t));\n\t}" ]
[ "0.7132374", "0.69605124", "0.68827975", "0.6872568", "0.68438023", "0.6697009", "0.66113085", "0.66006196", "0.6557842", "0.6519253", "0.6505394", "0.6505394", "0.6479073", "0.6448573", "0.64049846", "0.6393", "0.6361017", "0.63430536", "0.6303619", "0.6195957", "0.61955255", "0.60972565", "0.6078348", "0.60780454", "0.6064771", "0.6049592", "0.6030343", "0.6022667", "0.6013821", "0.6012202" ]
0.8312243
0
recursively copy a directory
function recurse_copy_dir($src,$dst) { $dir = opendir($src); $resp=mkdir($dst); LOG_MSG("INFO","creating directory $resp -> [$dst] "); while($dir && false !== ( $file = readdir($dir)) ) { if (( $file != '.' ) && ( $file != '..' )) { if ( is_dir($src . '/' . $file) ) { recurse_copy_dir($src . '/' . $file,$dst . '/' . $file); } else { copy($src . '/' . $file,$dst . '/' . $file); } } } closedir($dir); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function recurse_copy($src,$dst) { \n $dir = opendir($src);\n @mkdir($dst); \n while(false !== ( $file = readdir($dir)) ) {\n if (( $file != '.' ) && ( $file != '..') && !strstr($file,'.DS_Store')) {\n if ( is_dir($src . '/' . $file) ) { \n recurse_copy($src . '/' . $file,$dst . '/' . $file); \n } \n else { \n if(!copy($src . '/' . $file,$dst . '/' . $file)) {\n echo (\"Failed to copy\");\n } \n } \n } \n } \n closedir($dir); \n }", "function copydir($src, $dst) {\n // open the source directory\n $dir = opendir($src);\n // Make the destination directory if not exist\n @mkdir($dst);\n // Loop through the files in source directory\n foreach (scandir($src) as $file) {\n if (( $file != '.' ) && ( $file != '..' )) {\n if ( is_dir($src . '/' . $file) )\n {\n // Recursively calling custom copy function\n // for sub directory\n copydir($src . '/' . $file, $dst . '/' . $file);\n }\n else {\n copy($src . '/' . $file, $dst . '/' . $file);\n }\n }\n }\n closedir($dir);\n}", "function copy_directory( $src, $dst ) {\r\n $dir = opendir( $src );\r\n @mkdir( $dst );\r\n while ( false !== ( $file = readdir( $dir )) ) {\r\n if ( ( $file != '.' ) && ( $file != '..' ) ) {\r\n if ( is_dir( $src . '/' . $file ) ) {\r\n recurse_copy( $src . '/' . $file, $dst . '/' . $file );\r\n } else {\r\n copy( $src . '/' . $file, $dst . '/' . $file );\r\n }\r\n }\r\n }\r\n closedir( $dir );\r\n }", "public function recurseCopy($src,$dst) { \n $dir = opendir($src); \n @mkdir($dst); \n while(false !== ( $file = readdir($dir)) ) { \n if (( $file != '.' ) && ( $file != '..' )) { \n if ( is_dir($src . '/' . $file) ) { \n recurseCopy($src . '/' . $file,$dst . '/' . $file); \n } \n else { \n copy($src . '/' . $file,$dst . '/' . $file); \n } \n } \n } \n closedir($dir); \n }", "function recursive_copy($src,$dst) { \r\n\t $dir = opendir($src); \r\n\t @mkdir($dst); \r\n\t while(false !== ( $file = readdir($dir)) ) { \r\n\t if (( $file != '.' ) && ( $file != '..' )) { \r\n\t if ( is_dir($src . '/' . $file) ) { \r\n\t recursive_copy($src . '/' . $file,$dst . '/' . $file); \r\n\t } \r\n\t else { \r\n\t copy($src . '/' . $file,$dst . '/' . $file); \r\n\t } \r\n\t } \r\n\t } \r\n\t closedir($dir); \r\n\t}", "public static function recurse_copy($src,$dst)\n {\n $dir = opendir($src);\n @mkdir($dst);\n while(false !== ( $file = readdir($dir)) ) {\n if (( $file != '.' ) && ( $file != '..' )) {\n if ( is_dir($src . '/' . $file) ) {\n self::recurse_copy($src . '/' . $file,$dst . '/' . $file);\n }\n else {\n copy($src . '/' . $file,$dst . '/' . $file);\n }\n }\n }\n closedir($dir);\n }", "function recurse_copy(string $src, string $dst) : void {\n\t$dir = opendir($src);\n\t@mkdir($dst);\n\twhile(false !== ( $file = readdir($dir)) ) {\n\t\tif (( $file != '.' ) && ( $file != '..' )) {\n\t\t\tif ( is_dir($src . '/' . $file) ) {\n\t\t\t\trecurse_copy($src . '/' . $file,$dst . '/' . $file);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcopy($src . '/' . $file,$dst . '/' . $file);\n\t\t\t}\n\t\t}\n\t}\n\tclosedir($dir);\n}", "function recursive_copy($src, $dst): void\n{\n $dir = opendir($src);\n if (!@mkdir($dst) && !is_dir($dst)) {\n throw new RuntimeException(sprintf('Directory \"%s\" was not created', $dst));\n }\n while (($file = readdir($dir))) {\n if (($file !== '.') && ($file !== '..')) {\n if (is_dir($src . '/' . $file)) {\n recursive_copy($src . '/' . $file, $dst . '/' . $file);\n } else {\n copy($src . '/' . $file, $dst . '/' . $file);\n }\n }\n }\n closedir($dir);\n}", "function recurse_copy($src,$dst) {\n\t\t$dir = opendir($src);\n\t\t@mkdir($dst);\n\t\twhile(false !== ( $file = readdir($dir)) ) {\n\t\t\tif (( $file != '.' ) && ( $file != '..' )) {\n\t\t\t\tif ( is_dir($src . '/' . $file) ) {\n\t\t\t\t\t$this->recurse_copy($src . '/' . $file,$dst . '/' . $file);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcopy($src . '/' . $file,$dst . '/' . $file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($dir);\n\t}", "function copy_directory($source, $destination) {\n if ($source == '.' || $source == '..') {\n return;\n }\n if (is_dir($source)) {\n @mkdir($destination);\n $directory = dir($source);\n while (false !== ($read_directory = $directory->read())) {\n if ($read_directory == '.' || $read_directory == '..') {\n continue;\n }\n $path_dir = $source . '/' . $read_directory;\n if (is_dir($path_dir)) {\n copy_directory($path_dir, $destination . '/' . $read_directory);\n continue;\n }\n copy($path_dir, $destination . '/' . $read_directory);\n }\n \n $directory->close();\n } else {\n copy($source, $destination);\n }\n}", "function copy_dir_with_files($src, $dst)\n{\n $dir = opendir($src);\n\n // Make the destination directory if not exist\n @mkdir($dst);\n\n // Loop through the files in source directory\n while ($file = readdir($dir)) {\n\n if (($file != '.') && ($file != '..')) {\n if (is_dir($src . '/' . $file)) {\n\n // Recursively calling custom copy function\n // for sub directory\n custom_copy($src . '/' . $file, $dst . '/' . $file);\n\n } else {\n copy($src . '/' . $file, $dst . '/' . $file);\n }\n }\n }\n\n closedir($dir);\n}", "function copy_directory($source, $destination)\n{\n\tmkdir($destination);\n\t$directory = dir($source);\n\twhile ( FALSE !== ( $readdirectory = $directory->read() ) )\n\t{\n\t\tif ( $readdirectory == '.' || $readdirectory == '..' )\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\t$pathDir = $source . '/' . $readdirectory; \n\t\tif (is_dir($pathDir)) // recursively copies subdirectories\n\t\t{\n\t\t\tcopy_directory($pathDir, $destination . '/' . $readdirectory );\n\t\t\tcontinue;\n\t\t}\n\t\tif (copy( $pathDir, $destination . '/' . $readdirectory ))\n\t\t{\n\t\t\techo \"Successfully copied $pathDir.\\n\";\n\t\t}\n\t}\n\t$directory->close();\n}", "private static function recursiveCopy($path, $destination) {\n\t\tif (is_dir($path)) {\n\t\t\tif (!file_exists($destination)) {\n\t\t\t\tmkdir($destination);\n\t\t\t}\n\n\t\t\t$handle = opendir($path);\n\t\t\twhile (false !== ($file = readdir($handle))) {\n\t\t\t\tif ($file != '..' && $file[0] != '.') {\n\t\t\t\t\tself::recursiveCopy($path.'/'.$file, $destination.'/'.$file);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tclosedir($handle);\n\t\t} else {\n\t\t\tcopy($path, $destination);\n\t\t}\n\t}", "function custom_copy($src, $dst) {\n $dir = opendir($src); \n \n // Make the destination directory if not exist \n @mkdir($dst); \n \n // Loop through the files in source directory \n while( $file = readdir($dir) ) { \n \n if (( $file != '.' ) && ( $file != '..' )) { \n if ( is_dir($src . '/' . $file) ) \n { \n \n // Recursively calling custom copy function \n // for sub directory \n custom_copy($src . '/' . $file, $dst . '/' . $file); \n \n } \n else { \n copy($src . '/' . $file, $dst . '/' . $file); \n } \n } \n } \n \n closedir($dir); \n }", "function copyDirectory($src, $dest){\n if(!is_dir($src)) return false;\n\n // If the destination directory does not exist create it\n if(!is_dir($dest)) {\n if(!mkdir($dest)) {\n // If the destination directory could not be created stop processing\n return false;\n }\n }\n\n // Open the source directory to read in files\n $i = new DirectoryIterator($src);\n foreach($i as $f) {\n if($f->isFile()) {\n copy($f->getRealPath(), \"$dest/\" . $f->getFilename());\n } else if(!$f->isDot() && $f->isDir()) {\n copyDirectory($f->getRealPath(), \"$dest/$f\");\n }\n }\n\n}", "private function copyFolderRecursively($from, $to) { \n\t\t\t$dir = opendir($from); \n\t\t\t@mkdir($to);\n\t\t \n\t\t while (false !== ($item = readdir($dir))) { \n\t\t if (($item == '.') or ($item == '..')) continue;\n\t\t \n\t\t $source = $from.DIRECTORY_SEPARATOR.$item;\n\t\t $target = $to.DIRECTORY_SEPARATOR.$item;\n\t\t \n\t\t\t\tif (is_dir($source))\n\t\t\t\t\t$this->copyFolderRecursively($source, $target);\n\t\t\t\telse\n\t\t\t\t\tcopy($source, $target);\n\t\t } \n\t\t closedir($dir);\n\t\t return TRUE; \n\t\t}", "function folder_recurse($src,$dst, $action = 'copy') {\n $dir = opendir($src);\n @mkdir($dst);\n while(false !== ( $file = readdir($dir)) ) {\n if (( $file != '.' ) && ( $file != '..' )) {\n if ( is_dir($src . '/' . $file) ) {\n folder_recurse($src . '/' . $file,$dst . '/' . $file, $action);\n }\n else {\n\n $action($src . '/' . $file,$dst . '/' . $file);\n }\n }\n }\n closedir($dir);\n }", "function copyDirectory($srcDir, $dstDir)\n{\n $dir = opendir($srcDir);\n if (!$dir)\n return false;\n\n while (($entry = readdir($dir)) !== false) {\n if (strcmp($entry, \".\") == 0 || strcmp($entry, \"..\") == 0) {\n continue;\n }\n $src = joinPathComponents($srcDir, $entry);\n $dst = joinPathComponents($dstDir, $entry);\n\n if (is_dir($src)) {\n if (!file_exists($dst))\n mkdir($dst);\n if (!copyDirectory($src, $dst))\n return false;\n } else {\n if (!is_file($dst)) {\n if (!copy($src, $dst))\n return false;\n }\n }\n }\n return true;\n}", "public static function deepCopy($source, $destination)\n\t{\n\t\t$dir = opendir($source);\n\t\t@mkdir($destination);\n\n\t\twhile (false !== ($file = readdir($dir))) {\n\t\t\tif (($file != '.') && ($file != '..')) {\n\t\t\t\tif (is_dir(\"$source/$file\")) {\n\t\t\t\t\tstatic::deepCopy(\"$source/$file\", \"$destination/$file\");\n\t\t\t\t} else {\n\t\t\t\t\tstatic::copyFile(\"$source/$file\", \"$destination/$file\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tclosedir($dir);\n\t}", "function copiar ($desde, $hasta){ \n mkdir($hasta, 0777); \n $this_path = getcwd(); \n if(is_dir($desde)) { \n chdir($desde); \n $handle=opendir('.'); \n while(($file = readdir($handle))!==false){ \n if(($file != \".\") && ($file != \"..\")){ \n if(is_dir($file)){ \n copiar($desde.$file.\"/\", $hasta.$file.\"/\"); \n chdir($desde); \n } \n if(is_file($file)){ \n copy($desde.$file, $hasta.$file); \n } \n } \n } \n closedir($handle); \n } \n}", "public static function rcopy($src,$dst) { //dd($src);\n $dir = opendir($src); \n @mkdir($dst); \n while(false !== ( $file = readdir($dir)) ) { \n if (( $file != '.' ) && ( $file != '..' )) { \n if ( is_dir($src . '/' . $file) ) { \n self::rcopy($src . '/' . $file,$dst . '/' . $file); \n } \n else { \n copy($src . '/' . $file,$dst . '/' . $file); \n } \n } \n } \n closedir($dir); \n }", "function publisher_copyr($source, $dest)\r\n{\r\n // Simple copy for a file\r\n if (is_file($source)) {\r\n return copy($source, $dest);\r\n }\r\n\r\n // Make destination directory\r\n if (!is_dir($dest)) {\r\n mkdir($dest);\r\n }\r\n\r\n // Loop through the folder\r\n $dir = dir($source);\r\n while (false !== $entry = $dir->read()) {\r\n // Skip pointers\r\n if ($entry == '.' || $entry == '..') {\r\n continue;\r\n }\r\n\r\n // Deep copy directories\r\n if (is_dir(\"$source/$entry\") && ($dest !== \"$source/$entry\")) {\r\n copyr(\"$source/$entry\", \"$dest/$entry\");\r\n } else {\r\n copy(\"$source/$entry\", \"$dest/$entry\");\r\n }\r\n }\r\n\r\n // Clean up\r\n $dir->close();\r\n return true;\r\n}", "abstract public function copyLocalDir($from, $to);", "function copyDirRecursive($source, $dest, $dirname='', $privileges=0777)\n {\n static $orgdest = null;\n\n if (is_null($orgdest))\n $orgdest = $dest;\n\n atkdebug(\"Checking write permission for \".$orgdest);\n\n if (!atkFileUtils::is_writable($orgdest))\n {\n atkdebug(\"Error no write permission!\");\n return false;\n }\n\n atkdebug(\"Permission granted to write.\");\n\n if ($dest == $orgdest && $dirname != '')\n {\n mkdir($orgdest . \"/\" . $dirname,$privileges);\n return atkFileUtils::copyDirRecursive($source,$orgdest.\"/\".$dirname,'',$privileges);\n }\n\n // Simple copy for a file\n if (is_file($source))\n {\n $c = copy($source, $dest);\n\n chmod($dest, $privileges);\n\n return $c;\n }\n\n // Make destination directory\n if (!is_dir($dest))\n {\n if ($dest != $orgdest && !is_dir($orgdest.'/'.$dirname) && $dirname != '')\n $dest = $orgdest.'/'.$dirname;\n\n $oldumask = umask(0);\n\n mkdir($dest, $privileges);\n\n umask($oldumask);\n }\n\n // Loop through the folder\n $dir = dir($source);\n\n while (false !== $entry = $dir->read())\n {\n // Skip pointers\n if ($entry == '.' || $entry == '..')\n continue;\n\n // Deep copy directories\n if ($dest !== \"$source/$entry\")\n atkFileUtils::copyDirRecursive(\"$source/$entry\", \"$dest/$entry\", $dirname, $privileges);\n }\n\n // Clean up\n $dir->close();\n\n return true;\n }", "function copy_recursively($src, $dest) {\n global $exc;\n\n $trace = '';\n $trace .= \"Copy Recursive: $src $dest<br/>\";\n\n $excludeDirsNames = isset($exc[\"folders\"]) ? $exc[\"folders\"] : array();\n $excludeFileNames =isset($exc[\"files\"]) ? $exc[\"files\"] : array();\n\n if (is_dir(''.$src)){\n @mkdir($dest);\n $files = scandir($src);\n\n foreach ($files as $file){\n if (!in_array(getRootName($dest), $excludeDirsNames)){\n if ($file != \".\" && $file != \"..\"){\n $trace.= copy_recursively(\"$src/$file\", \"$dest/$file\");\n } \n }\n }\n }\n else if (file_exists($src)){\n $filename = pathinfo($src, PATHINFO_FILENAME);\n //$filename = $filename[count( $filename)-2];\n if (!in_array( $filename, $excludeFileNames)){\n copy($src, $dest);\n }\n }\n\n return $trace;\n}", "public static function copyFolder($from, $to)\n\t{\n\t\t$dir = opendir($from);\n\t\t\n\t\tself::mkdir($to);\n\t\t\n\t\twhile (false !== ($file = readdir($dir))) {\n\t\t\tif ($file != '.' && $file != '..') {\n\t\t\t\tif (is_dir($from.'/'.$file)) {\n\t\t\t\t\tself::copyFolder($from.'/'.$file, $to.'/'.$file);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!copy($from.'/'.$file, $to.'/'.$file)) {\n\t\t\t\t\t\tthrow new Exception('Error recur. copying file to: ' . $to . '/' . $file);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tclosedir($dir);\n\t}", "public static function copyDirectory($src,$dst,$options=array())\n\t{\n\t\t$fileTypes=array();\n\t\t$exclude=array();\n\t\t$level=-1;\n\t\textract($options);\n\t\tif(!is_dir($dst))\n\t\t\tself::createDirectory($dst,isset($options['newDirMode'])?$options['newDirMode']:null,true);\n\n\t\tself::copyDirectoryRecursive($src,$dst,'',$fileTypes,$exclude,$level,$options);\n\t}", "function copyr($source, $dest, $overwrite = false)\n{\n // Simple copy for a file\n if (is_file($source)) {\n return copy($source, $dest);\n }\n\n // Make destination directory\n if (!is_dir($dest)) {\n mkdir($dest);\n }\n\n // If the source is a symlink\n if (is_link($source)) {\n $link_dest = readlink($source);\n return symlink($link_dest, $dest);\n }\n\n // Loop through the folder\n $dir = dir($source);\n while (false !== $entry = $dir->read()) {\n // Skip pointers\n if ($entry == '.' || $entry == '..') {\n continue;\n }\n\n // Deep copy directories\n if ($dest !== \"$source/$entry\") {\n if ($overwrite || !is_file(\"$dest/$entry\")) {\n copyr(\"$source/$entry\", \"$dest/$entry\");\n } else {\n return false;\n }\n }\n }\n\n // Clean up\n $dir->close();\n return true;\n}", "function recursive_copy($source,$destination) {\n\t $counter = 0;\n\t if (substr($source,strlen($source),1)!=\"/\") $source .= \"/\";\n\t if (substr($destination,strlen($destination),1)!=\"/\") $destination .= \"/\";\n\t if (!is_dir($destination)) makeDirs($destination);\n\t $itens = listFiles($source);\n\t foreach($itens as $id => $name) {\n\t if ($name[0] == \"/\") $name = substr($name,1);\n\t if (is_file($source.$name)) { // file\n\t \tif ($name != \"Thumbs.db\") {\n\t\t $counter ++;\n\t\t if (!copy ($source.$name,$destination.$name))\n\t\t echo \"Error: \".$source.$name.\" -> \".$destination.$name.\"<br/>\";\n\t\t else\n\t\t safe_chmod($destination.$name,0775);\n\t \t} else\n\t \t\t@unlink($source.$name);\n\t } else if(is_dir($source.$name)) { // dir\n\t if (!is_dir($destination.$name))\n\t safe_mkdir($destination.$name);\n\t $counter += recursive_copy($source.$name,$destination.$name);\n\t }\n\t }\n\t return $counter;\n\t}", "function copyr($source, $dest) {\n\t// Check for symlinks\n\tif (is_link($source)) {\n\t\treturn symlink(readlink($source), $dest);\n\t}\n\t\n\t// Simple copy for a file\n\tif (is_file($source)) {\n\t\treturn copy($source, $dest);\n\t}\n\n\t// Make destination directory\n\tif (!is_dir($dest)) {\n\t\tmkdir($dest);\n\t}\n\n\t// Loop through the folder\n\t$dir = dir($source);\n\twhile (false !== $entry = $dir->read()) {\n\t\t// Skip pointers\n\t\tif ($entry == '.' || $entry == '..') {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Deep copy directories\n\t\tcopyr(\"$source/$entry\", \"$dest/$entry\");\n\t}\n\n\t// Clean up\n\t$dir->close();\n\treturn true;\n}" ]
[ "0.78571546", "0.783516", "0.78284305", "0.7750978", "0.77106035", "0.76332414", "0.7616711", "0.7587495", "0.75813925", "0.7562438", "0.75414324", "0.7479173", "0.73825717", "0.7334196", "0.713173", "0.70902556", "0.7071556", "0.69858694", "0.6929019", "0.6924671", "0.6900947", "0.6888207", "0.6873404", "0.683042", "0.6819625", "0.6762057", "0.6701651", "0.6700362", "0.6700126", "0.6673383" ]
0.7900599
0
recursively remove a directory
function recurse_remove_dir($dir) { foreach(glob($dir . '/*') as $file) { if(is_dir($file)) recurse_remove_dir($file); else unlink($file); } rmdir($dir); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rm_recursive($dir) {\n\t$dir = rtrim($dir, '\\\\/');\n\tif (is_dir($dir)) { \n\t\t$objects = scandir($dir); \n\t\tforeach ($objects as $object) { \n\t\t\tif ($object != \".\" && $object != \"..\") { \n\t\t\t\tif (filetype($dir.\"/\".$object) == \"dir\") rm_recursive($dir.\"/\".$object); else unlink($dir.\"/\".$object); \n\t\t\t} \n\t\t} \n\t\treset($objects); \n\t\trmdir($dir); \n\t} \t\n}", "function remove_dir($dir = null) {\n if (is_dir($dir)) {\n $objects = scandir($dir);\n foreach ($objects as $object) {\n if ($object != \".\" && $object != \"..\") {\n if (filetype($dir.\"/\".$object) == \"dir\") remove_dir($dir.\"/\".$object);\n else unlink($dir.\"/\".$object);\n }\n }\n reset($objects);\n rmdir($dir);\n }\n}", "function removeRecursive($dir)\n{\n $files = array_diff(scandir($dir), array('.','..'));\n\n // Delete all files one by one\n foreach ($files as $file) {\n // If current file is directory then recurse it\n (is_dir(\"$dir/$file\")) ? $this->removeRecursive(\"$dir/$file\") : unlink(\"$dir/$file\");\n }\n\n // Remove blank directory after deleting all files\n return rmdir($dir);\n}", "function remove_dir_rec($dirtodelete)\n{\n if ( strpos($dirtodelete,\"../\") !== false )\n die(_NONPUOI);\n if ( false !== ($objs = glob($dirtodelete . \"/*\")) )\n {\n foreach ( $objs as $obj )\n {\n is_dir($obj) ? remove_dir_rec($obj) : unlink($obj);\n }\n }\n rmdir($dirtodelete);\n}", "function recursive_rmdir($dir) {\n $handle = opendir($dir);\n while ($file = readdir($handle)) {\n if (is_file(\"$dir/$file\")) {\n unlink(\"$dir/$file\");\n } elseif (is_dir(\"$dir/$file\") && $file != '.' && $file != '..') {\n recursive_rmdir(\"$dir/$file\");\n }\n }\n closedir($handle);\n return rmdir($dir);\n}", "function rm_dir($dir)\n{\n\t$iter = new RecursiveDirectoryIterator($dir);\n\tforeach (new RecursiveIteratorIterator( $iter,\n\t\t\t\t\t\tRecursiveIteratorIterator::CHILD_FIRST) as $f)\n\t{\n\t\t$filename = $f->getFilename();\n\t\tif ($filename === '.' || $filename === '..')\n\t\t\tcontinue;\n\t\tif ($f->isDir())\n\t\t\trmdir($f->getPathname());\n\t\telse\n\t\t\tunlink($f->getPathname());\n\t}\n\trmdir($dir);\n}", "function RemoveDirectory($dir)\n{\n $f = scandir($dir);\n foreach( $f as $file )\n {\n if( is_file(\"$dir/$file\") )\n unlink(\"$dir/$file\");\n elseif( $file != '.' && $file != '..' )\n RemoveDirectory(\"$dir/$file\");\n }\n unset($f);\n \n rmdir($dir);\n}", "function delTree($dir) { \n\t $files = array_diff(scandir($dir), array('.','..')); \n\t foreach ($files as $file) { \n\t (is_dir(\"$dir/$file\")) ? delTree(\"$dir/$file\") : unlink(\"$dir/$file\"); \n\t } \n\t return rmdir($dir); \n\t}", "function removeDirectory($path) {\n $files = glob($path . '/*');\n foreach ($files as $file) {\n is_dir($file) ? removeDirectory($file) : unlink($file);\n }\n rmdir($path);\n return;\n}", "function delTree($dir) \r\n{\r\n $files = glob( $dir . '*', GLOB_MARK );\r\n foreach( $files as $file )\r\n {\r\n if( substr( $file, -1 ) == '/' )\r\n delTree( $file );\r\n else\r\n unlink( $file );\r\n }\r\n \r\n if( is_dir($dir) ) \r\n rmdir( $dir );\r\n \r\n}", "function rmdir_recurse($path) {\n $path = rtrim($path, '/').'/';\n $handle = opendir($path);\n while(false !== ($file = readdir($handle))) {\n if($file != '.' and $file != '..' ) {\n $fullpath = $path.$file;\n if(is_dir($fullpath)) rmdir_recurse($fullpath); else unlink($fullpath);\n }\n }\n closedir($handle);\n rmdir($path);\n}", "function recursive_deletion($baseDir)\n{\n\t$files = scandir($baseDir);\n\tforeach ($files as $file) \n\t{\n\t\tif ( ($file != '.') && ($file != '..') ) \n\t\t{\n\t\t\tif ( is_dir($baseDir . $file) ) recursive_deletion($baseDir.$file.'/');\n\t\t\telse unlink($baseDir . $file);\n\t\t}\n\t}\n\trmdir($baseDir);\n}", "function remove_dir($path) {\n\t\tif (file_exists($path) && is_dir($path))\n\t\t\trmdir($path);\n\t}", "private function remove_directory($path) {\n $files = glob($path . '/*');\n foreach ($files as $file) {\n is_dir($file) ? remove_directory($file) : unlink($file);\n }\n rmdir($path);\n return;\n }", "function rrmdir($dir) {\n if (!file_exists($dir))\n return;\n if (!is_dir($dir)) {\n unlink($dir);\n return;\n }\n $files = array_diff(scandir($dir), array('.','..'));\n foreach ($files as $file) {\n $path = \"$dir/$file\";\n (is_dir($path) && !is_link($path)) ? rrmdir($path) : unlink($path);\n }\n return rmdir($dir);\n}", "function rmdir_recursive($dir) {\n\n\t\t$basicPath = ROOT.DS.\"app\".DS.\"webroot\".DS.\"contents\".DS;\n\t\tif(is_dir($basicPath.$dir)){\n\t\t$files = scandir($basicPath.$dir);\n\t\tarray_shift($files); // remove '.' from array\n\t\tarray_shift($files); // remove '..' from array\n\n\t\tforeach ($files as $file) {\n\t\t$file = $basicPath.$dir .DS. $file;\n\t\tif (is_dir($file)) {\n\t\trmdir_recursive($file);\n\t\trmdir($file);\n\t\t} else {\n\n\t\tunlink($file);\n\t\t }\n\t\t}\n\t\trmdir($basicPath.$dir);\n\t\t}\n\t}", "function remove_directory($src)\n{\n $dir = opendir($src);\n while(false !== ( $file = readdir($dir)) )\n\t{\n if (( $file != '.' ) && ( $file != '..' ))\n\t\t{\n $full = $src . '/' . $file;\n\t\t\t\n if ( is_dir($full) )\n\t\t\t{\n remove_directory($full);\n }\n else\n\t\t\t{\n unlink($full);\n }\n }\n }\n closedir($dir);\n rmdir($src);\n}", "private function deleteFolderRecursively($path) {\n\t\t\t$path = self::folderPath($path);\n\t\t\t$handle = opendir($path);\n\t\t\t\n\t\t\tif (!$handle)\n\t\t\t\tthrow new ServiceException(\"REQUEST_FAILED\", \"Could not open directory for traversal (recurse): \".$path);\n\t\t \n\t\t while (false !== ($item = readdir($handle))) {\n\t\t\t\tif ($item != \".\" and $item != \"..\" ) {\n\t\t\t\t\t$fullpath = $path.$item;\n\t\n\t\t\t\t\tif (is_dir($fullpath)) {\n\t\t\t\t\t\t$this->deleteFolderRecursively($fullpath);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!unlink($fullpath)) {\n\t\t\t\t\t\t\tclosedir($handle);\n\t\t\t\t\t\t\tthrow new ServiceException(\"REQUEST_FAILED\", \"Failed to remove file (recurse): \".$fullpath);\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\tclosedir($handle);\n\t\t\t\n\t\t\tif (!rmdir($path))\n\t\t\t\tthrow new ServiceException(\"REQUEST_FAILED\", \"Failed to remove directory (delete_directory_recurse): \".$path);\n\t\t}", "function rrmdir($dir) {\n if (is_dir($dir)) { \n $objects = scandir($dir); \n foreach ($objects as $object) { \n if ($object != \".\" && $object != \"..\") { \n if (filetype($dir.\"/\".$object) == \"dir\") rmdir($dir.\"/\".$object); else \\\nunlink($dir.\"/\".$object); \n } \n } \n reset($objects); \n rmdir($dir); \n } \n}", "function rrmdir($dir) {\nif (is_dir($dir)) {\n $objects = scandir($dir);\n foreach ($objects as $object) {\n if ($object != \".\" && $object != \"..\") {\n if (filetype($dir.\"/\".$object) == \"dir\") rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object);\n }\n }\n reset($objects);\n rmdir($dir);\n}\n}", "function rmdir_r($dir)\n{\n\tif(is_dir($dir)) {\n\t\t$objs = scandir($dir);\n\t\tforeach($objs as $o) {\n\t\t\tif($o != '.' && $o != '..') {\n\t\t\t\tif(is_dir($dir.'/'.$o)) {\n\t\t\t\t\trmdir_r($dir.'/'.$o);\n\t\t\t\t} else unlink($dir.'/'.$o);\n\t\t\t}\n\t\t}\n\t\treset($objs);\n\t\treturn rmdir($dir);\n\t}\n}", "function gttn_tpps_rmdir($dir) {\n if (is_dir($dir)) {\n $children = scandir($dir);\n foreach ($children as $child) {\n if ($child != '.' and $child != '..') {\n if (is_dir($dir . '/' . $child) and !is_link($dir . '/' . $child)) {\n gttn_tpps_rmdir($dir . '/' . $child);\n }\n else {\n unlink($dir . '/' . $child);\n }\n }\n }\n rmdir($dir);\n }\n}", "function _removeDir($dir) {\r\n\t\tif(file_exists($dir)) {\r\n\t\t\tif($objs = glob($dir.\"/*\"))\r\n\t\t\t\tforeach($objs as $obj) {\r\n\t\t\t\t\tis_dir($obj) ? rmdir($obj) : unlink($obj);\r\n\t\t\t\t}\r\n\t\t\trmdir($dir);\r\n\t\t}\r\n\t}", "function removeDir($directory){\n foreach(glob(\"{$directory}/*\") as $file){\n if(is_dir($file)) { \n removeDir($file);\n } else {\n unlink($file);\n }\n }\n rmdir($directory);\n }", "function delete_dir($path)\n{\n $file_scan = scandir($path);\n foreach ($file_scan as $filecheck)\n {\n $file_extension = pathinfo($filecheck, PATHINFO_EXTENSION);\n if ($filecheck != '.' && $filecheck != '..')\n {\n if ($file_extension == '')\n {\n delete_dir($path . $filecheck . '/');\n }\n else\n {\n unlink($path . $filecheck);\n }\n }\n }\n rmdir($path);\n}", "function remove_dir($dir){\n\tif( !is_dir( $dir ) )\n\t\treturn false;\n\n\t$objects=scandir($dir);\n\tforeach($objects as $object){\n\t\tif($object!='.'&&$object!='..'){\n\t\t\tif(filetype($dir.'/'.$object)=='dir')\n\t\t\t\tremove_dir($dir.'/'.$object);\n\t\t\telse\n\t\t\t\tunlink($dir.'/'.$object);\n\t\t}\n\t}\n\treset($objects);\n\treturn rmdir($dir);\n}", "public static function recursive_unlink($file) {\n if (is_dir($file)) {\n // Remove all files in dir.\n $subfiles = array_diff(scandir($file), array('.','..'));\n foreach ($subfiles as $subfile) {\n self::recursive_unlink($file . '/' . $subfile);\n }\n rmdir($file);\n }\n elseif (file_exists($file)) {\n unlink($file);\n }\n }", "public function remove_dir() {\n\n $path = $this->get_upload_pres_path();\n\n //append_debug_msg($path);\n\n if(!$path || !file_exists($path)){ return; }\n delete_dir($path);\n }", "function delTree($directory)\n{\n\t$files = array_diff(scandir($directory), array('.','..'));\n \tforeach($files as $file)\n\t{\n\t\t//echo(\"$directory/$file<br />\");\n \t\t(is_dir(\"$directory/$file\")) ? delTree(\"$directory/$file\") : unlink(\"$directory/$file\"); \n \t}\n \treturn rmdir($directory);\n}", "function rrmdir($dir) {\n if (is_dir($dir)) { \n $objects = scandir($dir); \n foreach ($objects as $object) { \n if ($object != \".\" && $object != \"..\") { \n if (filetype($dir.\"/\".$object) == \"dir\") rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object); \n } \n } \n reset($objects);\n rmdir($dir); \n } \n }" ]
[ "0.7860229", "0.7705845", "0.76790226", "0.7638309", "0.7600017", "0.7590016", "0.75827116", "0.75450927", "0.75448614", "0.75397563", "0.753273", "0.7474158", "0.74741113", "0.7473814", "0.7467633", "0.7432122", "0.743117", "0.74306524", "0.74216056", "0.7407098", "0.7395388", "0.7386335", "0.73773074", "0.73691934", "0.73629326", "0.73529464", "0.73484737", "0.73339725", "0.73299134", "0.73283494" ]
0.8000187
0
Calculate the percentage of success for a test
public static function percent($suiteResults) { $sum = $suiteResults['pass'] + $suiteResults['fail']; return round($suiteResults['pass'] * 100 / max($sum, 1), 2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSuccessRate(): int\n {\n // Fix for division by zero error\n if ($this->getTestsSum() === 0) {\n return 0;\n }\n\n return (int)round(($this->successful / $this->getTestsSum()) * 100, 0);\n }", "public function getTestedClassesPercent($asString = TRUE)\n {\n return PHP_CodeCoverage_Util::percent(\n $this->getNumTestedClasses(),\n $this->getNumClasses(),\n $asString\n );\n }", "public function percentageParticipation()\n {\n $expectedPartipant = $this->getExpectedParticipants();\n if (count($expectedPartipant) == 0) {\n return 0;\n }\n $actualParticipant = $this->users()\n ->where('users.role_id', Role::findBySlug('PART')->id)\n ->orWhere('users.role_id', Role::findBySlug('GEST')->id)\n ->get()->unique();\n return round((count($actualParticipant) / count($expectedPartipant)) * 100);\n }", "public function getFailRate(): int\n {\n // Fix for division by zero error\n if ($this->getTestsSum() === 0) {\n return 0;\n }\n\n return (int)round(($this->failed / $this->getTestsSum()) * 100, 0);\n }", "public function getTestedMethodsPercent($asString = TRUE)\n {\n return PHP_CodeCoverage_Util::percent(\n $this->getNumTestedMethods(),\n $this->getNumMethods(),\n $asString\n );\n }", "function usp_ews_get_progess_percentage($events, $attempts) {\n $attemptcount = 0;\n\n\t$count_events = count($events);\n foreach($events as $event) {\n if($attempts[$event['type'].$event['id']] == 1) {\n $attemptcount++;\n }\n }\n\t$progressvalue = ($attemptcount==0 || $count_events==0) ? 0 : $attemptcount / $count_events;\n\n return (int)($progressvalue * 100);\n}", "public function getMatchedPercent(){\n return $this->percentage;\n }", "public function getPercentOfCompletedProfile(){\n $pendingCount = $this->getPendingNotificationCount();\n $notificationCount = $this->getNotificationCount();\n $completedCount = $notificationCount - $pendingCount;\n return round(($completedCount * 100.0) / $notificationCount);\n }", "public function calculateTotalPercentage()\n {\n return round((($this->totalcovered + $this->totalmaybe) / $this->totallines) * 100, 2);\n }", "function progress_percentage($events, $attempts) {\n $attemptcount = 0;\n foreach ($events as $event) {\n if(array_key_exists($event['type'].$event['id'], $attempts)) {\n if ($attempts[$event['type'].$event['id']] == 1) {\n $attemptcount++;\n }\n } else {\n }\n }\n $progressvalue = $attemptcount == 0 ? 0 : $attemptcount / count($events);\n return (int)round($progressvalue * 100);\n}", "public function test_it_can_expose_the_percentage_of_time_taken()\n {\n $timelog = factory(TimeLog::class)->create([\n 'number_of_seconds' => 3600,\n 'user_id' => $this->user->id,\n 'project_id' => $this->project->id\n ]);\n // The project should be able to tell us what percentage of the overall time has been taken\n // Work out percentage (Hat tip @ollieread)\n $onePercent = $this->project->getOriginal('total_seconds') / 100;\n $percentage = min(100, ceil($this->project->time_logged_seconds / $onePercent));\n // The percentage should match the project's percentage\n $this->assertSame($this->project->percentage_taken, $percentage);\n }", "public function getTestedClassesAndTraitsPercent($asString = TRUE)\n {\n return PHP_CodeCoverage_Util::percent(\n $this->getNumTestedClassesAndTraits(),\n $this->getNumClassesAndTraits(),\n $asString\n );\n }", "public function positivePercent(){\n\t\treturn round($this->positive*100/($this->positive+$this->negative+$this->indeterminate), 2);\n\t}", "public function testAddPercent()\n {\n $tests = [\n ['expected' => 112, 'fn' => Math::addPercent(100, 12)],\n ['expected' => 112, 'fn' => Math::addPercent(100, '12')],\n ['expected' => 112, 'fn' => Math::addPercent(100, '12%')],\n ['expected' => 112, 'fn' => Math::addPercent(100, '12 %')],\n ['expected' => 112, 'fn' => Math::addPercent('100 ', '12')],\n ['expected' => 112.5, 'fn' => Math::addPercent('100', '12.5')],\n ['expected' => 88, 'fn' => Math::addPercent('100', -12)],\n ['expected' => 88, 'fn' => Math::addPercent('100', '-12')],\n ['expected' => 88, 'fn' => Math::addPercent('100', '-12 %')],\n ['expected' => 88, 'fn' => Math::addPercent('100', '-12%')],\n ];\n\n foreach ($tests as $test) {\n $this->assertEquals($test['expected'], $test['fn']);\n }\n }", "function getGoalPercent(){\n $goal = $GLOBALS['GOAL_STEPS'];\n $cursteps = getCurrentSteps();\n $percent = ( $cursteps[0]['steps'] / $goal ) * 100;\n return round($percent);\n}", "public function getTestsSum(): int\n {\n return count($this->tests);\n }", "public function progress()\n {\n return $this->totalsportevents > 0 ? round(($this->processedsportevents() / $this->totalsportevents) * 100) : 0;\n }", "public function accuracy($test_data,$label='label')\n\t{\n\t\t$first_label = array_keys($test_data)[0];\n\t\t$correct = 0;\n\t\t$total = count($test_data[$first_label]);\n\t\t$current_data_set = [];\n\t\tforeach (range(0, $total-1) as $index => $value) {\n\t\t\tforeach ($test_data as $label => $column) {\n\t\t\t\t$current_data_set[$label][] = $column[$index];\n\t\t\t}\n\t\t\t$accurate = ($this->predict($current_data_set) == $current_data_set[$label][0]);\n\t\t\tif($accurate){\n\t\t\t\t$correct++;\n\t\t\t}\n\t\t\t$current_data_set = [];\n\t\t}\n\n\t\treturn ($correct/$total);\n\t}", "function getTotalFaliures()\n {\n $data = [];\n $output = $this->queryData('//QueryGetTotalFailures','', $data);\n $number = $output[0]['number'];\n return $number;\n }", "public function test_it_can_expose_the_percentage_of_time_remaining()\n {\n $timelog = factory(TimeLog::class)->create([\n 'number_of_seconds' => 3600,\n 'user_id' => $this->user->id,\n 'project_id' => $this->project->id\n ]);\n // The project should be able to tell us what percentage of the overall time is remaining (90%)\n $percentage = (100 - $this->project->percentage_taken);\n $this->assertSame($this->project->percentage_remaining, $percentage);\n }", "function calculate_student_progress($completed_hours, $total_hours, $pace) {\n\n\t// Get the default progress percentage:\n\t$progress = $completed_hours/$total_hours;\n\t// echo number_format($progress, 2);\n\n\tif ($_POST['pace'] == 16) {\n\t\t// Return the formatted progress as a percentage:\n\t\treturn number_format($progress, 2) * 100;\n\t} else {\n\t\t// Get adjusted progress for this pace:\n\t\t$adjusted_progress = $progress / 1.5;\n\n\t\t// Return the formatted progress as a percentage:\n\t\treturn number_format($adjusted_progress, 2) * 100;\n\t\t}\n}", "public function test_percentage_method()\n {\n $expected_value = 60;\n \n $percentage = math::percentage(30, 50);\n \n $this->assertInternalType('array', $percentage);\n $this->assertArrayHasKey('value', $percentage);\n $this->assertArrayHasKey('sign', $percentage);\n \n $this->assertInternalType('int', $percentage['value']);\n $this->assertInternalType('string', $percentage['sign']);\n \n $this->assertEquals($percentage['value'], $expected_value);\n $this->assertEquals($percentage['sign'], $expected_value . '%');\n \n $percentage = math::percentage(NULL, NULL);\n \n $this->assertEquals(NULL, $percentage['value']);\n }", "function evaluaTestFetch()\n\t{\n\t\tif (!$this->session->userdata('user') || $this->session->userdata('user')['scoreTest'] != null) {\n\t\t\tredirect(\"InicioController\");\n\t\t}\n\n\t\t$max_score = $this->input->post('max_score');\n\t\t$res = $this->input->post('respuesta'); //se recupera el input en forma de array\n\t\t$res = json_decode($res);\t//se decodifica el json para ser tratado como object\n\t\t$sum = 0; //inicio de suma\n\t\tforeach ($res as $value) { //se pasa por cada valor de las respuestas\n\t\t\t$sum += $value[0];\n\t\t}\n\n\t\t$resultadoFinal = (int)(($sum / $max_score) * 100); //calculo de resultado en formato de 0 a 100\n\n\t\t//se almacena el resultado en la base de datos\n\t\t$successData = $this->Usuario->updateScoreTest($this->session->userdata('user')['Id_User'], $resultadoFinal);\n\t\tif ($successData) { //si todo se guarda correctamente se procede a actualizar las variables de sesion\n\t\t\t$this->session->unset_userdata('user');\n\t\t\t$this->session->set_userdata('user', $successData);\n\n\t\t\techo json_encode($resultadoFinal);\t//se envia el resultado en formato de 0% a 100%\n\t\t} else {\n\t\t\techo json_encode(\"Error/Error al guardar score de usuario\");\n\t\t}\n\t}", "function getTotalFacultyScore($con, $tcomp, $eatt, $apunct) {\n\t// get the configuration from db; hardcode for now since no table yet\n\t$sql = \"SELECT * FROM users\";\n\t$query = mysqli_query($con, $sql);\n\t//~ $row = mysqli_affected_rows($con);\n\t$tcomp_percent = 0.4;\n\t$eatt_percent = 0.3;\n\t$apunct_percent = 0.3;\n\t\n\treturn ($tcomp *$tcomp_percent) + ($eatt * $eatt_percent) + ($apunct * $apunct_percent);\n}", "public function get_percentage_complete() {\n\t\t$args = $this->get_donation_argument( array( 'number' => - 1, 'output' => '' ) );\n\t\tif ( isset( $args['page'] ) ) {\n\t\t\tunset( $args['page'] );\n\t\t}\n\t\t$query = give_get_payments( $args );\n\t\t$total = count( $query );\n\t\t$percentage = 100;\n\t\tif ( $total > 0 ) {\n\t\t\t$percentage = ( ( 30 * $this->step ) / $total ) * 100;\n\t\t}\n\t\tif ( $percentage > 100 ) {\n\t\t\t$percentage = 100;\n\t\t}\n\n\t\treturn $percentage;\n\t}", "public function test_course_progress_percentage_with_just_activities() {\n global $DB;\n\n // Add a course that supports completion.\n $course = $this->getDataGenerator()->create_course(array('enablecompletion' => 1));\n\n // Enrol a user in the course.\n $user = $this->getDataGenerator()->create_user();\n $studentrole = $DB->get_record('role', array('shortname' => 'student'));\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $studentrole->id);\n\n // Add four activities that use completion.\n $assign = $this->getDataGenerator()->create_module('assign', array('course' => $course->id),\n array('completion' => 1));\n $data = $this->getDataGenerator()->create_module('data', array('course' => $course->id),\n array('completion' => 1));\n $this->getDataGenerator()->create_module('forum', array('course' => $course->id),\n array('completion' => 1));\n $this->getDataGenerator()->create_module('forum', array('course' => $course->id),\n array('completion' => 1));\n\n // Add an activity that does *not* use completion.\n $this->getDataGenerator()->create_module('assign', array('course' => $course->id));\n\n // Mark two of them as completed for a user.\n $cmassign = get_coursemodule_from_id('assign', $assign->cmid);\n $cmdata = get_coursemodule_from_id('data', $data->cmid);\n $completion = new completion_info($course);\n $completion->update_state($cmassign, COMPLETION_COMPLETE, $user->id);\n $completion->update_state($cmdata, COMPLETION_COMPLETE, $user->id);\n\n // Check we have received valid data.\n // Note - only 4 out of the 5 activities support completion, and the user has completed 2 of those.\n $this->assertEquals('50', \\core_completion\\progress::get_course_progress_percentage($course, $user->id));\n }", "public function profileCompleteness() {\n $noFields = 5;\n\n $count = 0;\n\n if($this->fullName() != \"\") {\n $count += 1;\n }\n\n if($this->experience != null) {\n $count += 1;\n }\n\n if($this->currentLocation != \"\") {\n $count += 1;\n }\n\n if($this->preferredLocation != \"\") {\n $count += 1;\n }\n\n if(sizeof($this->skills) > 0) {\n $count += 1;\n }\n\n return (float)$count * 100.0 / (float)$noFields;\n }", "public function getTotalPercentageConversion()\n {\n $percent = 0;\n\n $numberSent = $this->getTotalSumNbReminderSent();\n if ($numberSent > 0) {\n $nbConvertedCarts = $this->getTotalSumNbConvertedCarts();\n $percent = $nbConvertedCarts / $numberSent * 100;\n }\n\n return $percent;\n }", "public static function calculateProjectStatusByPts($projectID) {\n $countPts = ArmyDB::countPointsInProject($projectID);\n\n $units = ArmyDB::retrieveUnitsFromProject($projectID);\n $statusPts = 0;\n\n foreach ($units as $unit) {\n $statusPts += $unit['pts'] * (ArmyDB::convertStatusToDecimal($unit['status']) / 10);\n }\n\n if ($units == 0) {\n return \"0.0%\";\n }\n else {\n return round($statusPts/$countPts * 100,1);\n }\n }", "public function getSuccessCount()\n {\n return $this->success_count;\n }" ]
[ "0.74662346", "0.649993", "0.6478119", "0.6470749", "0.6437501", "0.64136565", "0.6353298", "0.62440366", "0.6235881", "0.6219482", "0.61576104", "0.61561984", "0.6069912", "0.60361207", "0.59833914", "0.5981433", "0.5949986", "0.58984613", "0.58732677", "0.5867769", "0.58490044", "0.5844848", "0.5825265", "0.58246195", "0.5822359", "0.5804957", "0.5785876", "0.57735157", "0.5767884", "0.5752441" ]
0.7263251
1
Redirect to the Spotify authorize URL.
private function redirectToSpotifyAuthorizeUrl() { header("Location: {$this->session->getAuthorizeUrl($this->options)}"); die(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function authorize() {\r\n\t\t$authurl = $this->tmhOAuth->url(\"oauth/authorize\", '') . \"?oauth_token={$_SESSION['oauth']['oauth_token']}\";\r\n\t\theader(\"Location: \".$authurl);\r\n\t\texit;\r\n\r\n\t\t// in case the redirect doesn't fire\r\n\t\t$this->addMsg('<p>To complete the OAuth flow please visit URL: <a href=\"' . $authurl . '\">' . $authurl . '</a></p>');\r\n\t}", "public function redirect()\n {\n $temp = $this->server->getTemporaryCredentials();\n\n // We have a stateless app without sessions, so we use the cache to\n // store the secret for man in the middle attack protection\n $key = 'oauth_temp_'.$temp->getIdentifier();\n $this->cache->put($key, $temp, ProviderContract::CACHE_TTL);\n\n $this->storeReturnUrl($temp);\n\n return new RedirectResponse($this->server->getAuthorizationUrl($temp));\n }", "public function redirectToSpotify()\n {\n //return Socialite::with('spotify')->redirect();\n\n return Socialite::driver('spotify')->redirect();\n }", "public function redirectAction()\n {\n $this->facebookOAuth->authorize();\n }", "private function _authRedirect() {\n $options = array('scope' => $this->settings['permissions']);\n if (!empty($this->settings['appUrl'])) {\n $options['redirect_uri'] = $this->settings['appUrl'];\n }\n $url = $this->facebook->getLoginUrl($options);\n echo \"<script type=\\\"text/javascript\\\">top.location.href = '$url';</script>\";\n exit;\n }", "function auth_redirect() {\n\n\t\tauth_redirect();\n\n\t}", "public function redirect()\n {\n if (!$this->isStateless()) {\n $this->request->getSession()->set(\n 'oauth.temp', $temp = $this->server->getTemporaryCredentials()\n );\n } else {\n $temp = $this->server->getTemporaryCredentials();\n setcookie('oauth_temp', serialize($temp));\n }\n\n return new RedirectResponse($this->server->getAuthorizationUrl($temp));\n }", "public function doRedirect()\n {\n $response = $this->response->asJson()->getResponse();\n $responseToArray = json_decode($response, true);\n\n if ($responseToArray['status']) {\n $url = $responseToArray['data']['authorization_url'];\n\n return redirect()->away($url);\n } else {\n Throw new \\Exception('An error occurred, could not get authorization url. ' . $response);\n }\n\n }", "public function redirectToAuth()\n {\n return Socialite::with('reddit')->scopes(['identity'])->redirect();\n }", "public function redirect()\n {\n $state = null;\n\n if ($this->usesState()) {\n $this->request->session()->put('state', $state = $this->getState());\n }\n\n return new RedirectResponse($this->getAuthUrl($state));\n }", "function auth_redirect()\n {\n }", "public function authorize()\n\t{\n\t\t$state = md5(uniqid(rand(), TRUE));\n\t\t$this->oauth->ci->session->set_userdata('state', $state);\n\t\t\t\n\t\t$params = array(\n\t\t\t'client_id' => $this->_config['client_id'],\n\t\t\t'redirect_uri' => $this->_config['redirect_uri'],\n\t\t\t'state' => $state,\n\t\t\t'scope' => 'email'\n\t\t);\n\t\t\n\t\t$url = $this->_authorize_endpoint.http_build_query($params);\n\t\tredirect($url);\n\t}", "public function openAuthorizationUrl()\n {\n header('Location: ' . $this->getAuthorizationUrl());\n exit(1);\n }", "public function XingAuthorize()\n {\n $redirectResponse = new RedirectResponse(\"https://api.xing.com/v1/authorize?\" . http_build_query(array(\n 'oauth_token' => $this->getConfig()->get('token'))\n ), 302);\n $redirectResponse->send();\n }", "public function oAuthAuthorize($token)\n {\n\theader('Location: ' . self::SECURE_API_URL .\n\t '/oauth/authorize?oauth_token=' . $token);\n }", "private function redirect()\n\t\t{\n\t\t\tif(isUserLoggedIn())\n\t\t\t{\n\t\t\t\theader(\"Location: \" . APPROOT);\n\t\t\t}\n\t\t}", "public function redirectToLogin() {\n\t\t//\tcreate and save the state parameter\n\t\t$openIdStateMap =& storageFindOrCreate( \"openIdStateMap\" );\n\t\t$state = generatePassword(10);\n\t\t$openIdStateMap[ $state ] = $this->code;\n\n\t\t//\tcreate the URL\n\t\t$config = $this->getConfig();\n\t\t$request = new HttpRequest( $config[\"authorization_endpoint\"], \"GET\", array( \n\t\t\t\"response_type\" => \"code\",\n\t\t\t\"scope\" => $this->scope,\n\t\t\t\"client_id\" => $this->clientId,\n\t\t\t\"state\" => $state,\n\t\t\t\"redirect_uri\" => projectURL() . GetTableLink(\"openidcallback\")\n\t\t));\n\n\t\theader( \"Location: \" . $request->getUrl() );\n\t}", "public function redirect();", "public function redirect();", "public function redirect();", "public function redirectToProvider()\n {\n return Socialite::driver('keycloak')->redirect();\n }", "public function redirect()\n {\n $this->request->session()->put('state', $state = $this->getState());\n\n return new RedirectResponse($this->getAuthUrl($state));\n }", "public function redirect() : RedirectResponse\n {\n return new RedirectResponse($this->authUrl);\n }", "public function spotifyAuth($request, $response)\r\n {\r\n $url = \"https://accounts.spotify.com/authorize\";\r\n $client = \"client_id=\" . Application::$app->config['client_id'];\r\n $resp = \"response_type=code\";\r\n $redirect = \"redirect_uri=\" . Application::$app->config['client_redirect'];\r\n $scope = \"scope=user-read-private%20user-read-email%20user-top-read\";\r\n $state = \"state=\" . Application::$app->config['client_redirect'];;\r\n\r\n return $response->redirect(\"$url?$client&$resp&$redirect&$scope&$state\");\r\n }", "public function redirect()\n {\n return Socialite::driver('facebook')->redirect();\n return redirect('/callback');\n }", "public function redirectToProvider()\n {\n \t\\Session::put('domain', 'api');\n\n return Socialite::driver('github')->redirect('/');\n }", "abstract protected function redirect();", "public function redirectToDropbox()\n {\n return Socialite::driver('dropbox')->setScopes(['account_info.read'])->redirect();\n }", "protected function Login()\n {\n $this->redirectParams[\"openid.realm\"] = $this->config[\"realm\"];\n $this->redirectParams[\"openid.return_to\"] = $this->config[\"return_to\"];\n\n $params = http_build_query($this->redirectParams);\n\n $url = $this->urlAuthorize . \"?$params\";\n\n header(\"Location: $url\");\n exit();\n }", "public function callback()\n {\n if (!$this->request->getQuery('code')) {\n $authUrl = $this->GoogleApi->createAuthUrl();\n return $this->redirect(filter_var($authUrl, FILTER_SANITIZE_URL));\n } else {\n $this->GoogleApi->authenticate($this->request->getQuery('code'));\n $this->redirect(\n [\n 'controller' => 'GoogleApis',\n 'action' => 'index'\n ]\n );\n }\n }" ]
[ "0.7309922", "0.72471577", "0.7214553", "0.7021612", "0.69658715", "0.6851996", "0.6820652", "0.6668452", "0.6556567", "0.65399444", "0.65146494", "0.6509719", "0.64666533", "0.6465529", "0.6461036", "0.6440911", "0.6433697", "0.6402669", "0.6402669", "0.6402669", "0.6397886", "0.63738215", "0.63634473", "0.6338307", "0.6313674", "0.62857974", "0.6242223", "0.62362784", "0.62313664", "0.62228143" ]
0.85406005
0
Get or create fMD instance
public static function getInstance() { if ( self::$instance === NULL ) { self::$instance = new fMD(); } return self::$instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getInstance()\n {\n if(is_null(self::$singleton)){\n self::$singleton = new System_MD();\n }\n\n return self::$singleton;\n }", "public static function create() {\n $factory = new static();\n return $factory->createFlo();\n }", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public function create(){\r\n\treturn new $this->class();\r\n }", "public static function factory() {\n\t\tstatic $instance = false;\n\t\tif ( ! $instance ) {\n\t\t\t$instance = new self();\n\t\t\t$instance->setup();\n\t\t}\n\t\treturn $instance;\n\t}", "static public function getInstance() {\n\t\treturn GeneralUtility::makeInstance('Fab\\Media\\ObjectFactory');\n\t}", "public static function getInstance() : Forge\n {\n return static::$instance = static::$instance ?: new static();\n }", "public static function factory() {\n\t\tstatic $instance = false;\n\n\t\tif ( ! $instance ) {\n\t\t\t$instance = new self();\n\t\t\t$instance->setup();\n\t\t}\n\n\t\treturn $instance;\n\t}", "public function getInstance(): object;", "public static function create(){\r\n\t\tif(self::$instance === null){\r\n\t\t\tself::$instance = new self();\r\n\t\t}\r\n\t\treturn self::$instance;\r\n\t}", "public function getInstance(): mixed;", "public function instance();", "public static function getInstance();", "public static function getInstance();", "public static function getInstance();", "public static function getInstance();", "public static function getInstance();", "public static function getInstance();", "public static function getInstance();", "public static function getInstance();", "public static function instance();" ]
[ "0.6461459", "0.6368495", "0.60753214", "0.60753214", "0.60753214", "0.6074871", "0.6074871", "0.6074871", "0.6074474", "0.6074474", "0.6074474", "0.6074474", "0.60210204", "0.60172546", "0.60031986", "0.59960485", "0.5971111", "0.5962281", "0.5928171", "0.5903206", "0.5869276", "0.5864057", "0.5864057", "0.5864057", "0.5864057", "0.5864057", "0.5864057", "0.5864057", "0.5864057", "0.5860332" ]
0.77785313
0
Converts omeka record to appropriate request body in json format.
public function prepareRequestBody($record){ $requestBody = array( 'data' => array( 'name' => $record->id.'.json', 'type' => 'text/plain', 'content' => serialize($record) ) ); return $requestBody; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _recordToJson($_record)\n {\n $converter = Tinebase_Convert_Factory::factory($_record);\n $result = $converter->fromTine20Model($_record);\n\n return $result;\n }", "function record($request) {\n\t\t$type = $request->getVar('type');\n\t\t$value = $request->getVar('value');\n\t\tif ($type && $value) {\n\t\t\t$record = DataObject::get_one($this->dataObject->class, \"\\\"$type\\\" = '$value'\");\n\t\t\theader(\"Content-Type: text/plain\");\n\t\t\techo json_encode(array(\"record\"=>$record->toMap()));\n\t\t}\n\t}", "public function requestBodyConverter($object)\n {\n }", "protected function _toJSON( $controller, $table, $model, $formelements, $recordId=null ){\n //\n\t\t$data['controller'] = $controller;\n\t\t$data['table'] = $table;\n\t\t$data['model'] = $model;\n\t\t\n\t\t// add the backfilled record\n\t\t//\n\t\tif(is_null($recordId) || $recordId==\"\"){\n\t\t $data['recordPkey'] = \"\";\n\t\t $data['record'] = \"\";\n\t\t}\n\t\telse{\n \t\t $this->load->model($model);\n\t\t $object = $this->emExternal->find($model,$recordId);\n\t\t $data['record'] = $object;\n\t\t $field = $object->getIdFieldName();\n\t\t $data['recordPkey'] = $object->$field;\n\t }\n\t\t \n \t $data['form'] = $formelements;\n\n\t\techo json_encode($data);\n\t}", "public function json()\n {\n $data = [\n '$schema' => self::PAYLOAD_SCHEMA,\n 'dt' => $this->dt,\n 'message' => $this->message,\n 'level' => $this->level,\n ];\n\n if (count($this->context)) {\n $data['context'] = $this->context;\n }\n if (count($this->event)) {\n $data['event'] = $this->event;\n }\n\n $options = [\n RequestOptions::JSON => [$data],\n ];\n\n return $this->doRequest(self::METHOD_POST, 'frames', $options);\n }", "public function to_json()\n {\n return json_encode($this->body);\n\t}", "public function getRepresentation(Omeka_Record_AbstractRecord $record)\n {\n $representation = array(\n 'id' => $record->id, \n 'url' => $this->getResourceUrl(\"/geolocations/{$record->id}\"), \n \n \"point_of_interest\" => $record->point_of_interest, \n \"route\" => $record->route,\n \"street_number\" => $record->street_number,\n \"postal_code\" => $record->postal_code,\n \"postal_code_prefix\" => $record->postal_code_prefix,\n \"sublocality\" => $record->sublocality,\n \"locality\" => $record->locality,\n \"natural_feature\" => $record->natural_feature,\n \"establishment\" => $record->establishment,\n \"point_of_interest\" => $record->point_of_interest,\n \"administrative_area_level_3\" => $record->administrative_area_level_3,\n \"administrative_area_level_2\" => $record->administrative_area_level_2,\n \"administrative_area_level_1\" => $record->administrative_area_level_1,\n \"country\" => $record->country,\n \"continent\" => $record->continent,\n \"planetary_body\" => $record->planetary_body,\n \n 'latitude' => $record->latitude, \n 'longitude' => $record->longitude, \n 'zoom_level' => $record->zoom_level, \n 'map_type' => $record->map_type, \n 'address' => $record->address, \n 'item' => array(\n 'id' => $record->item_id, \n 'url' => $this->getResourceUrl(\"/items/{$record->item_id}\"), \n 'resource' => 'items', \n ),\n 'location_type' => $record->location_type\n );\n return $representation;\n }", "protected function json(){\n $this->before(function ($request) {\n if ($request->contentType == \"application/json; charset=utf-8\") {\n $request->data = json_decode($request->data);\n }\n });\n $this->after(function ($response) {\n $response->contentType = \"application/json; charset=utf-8\";\n if (isset($_GET['jsonp'])) {\n $response->body = $_GET['jsonp'].'('.json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).');';\n } else {\n $response->body = json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);\n }\n });\n }", "protected function json(){\n $this->before(function ($request) {\n if ($request->contentType == \"application/json; charset=utf-8\") {\n $request->data = json_decode($request->data);\n }\n });\n $this->after(function ($response) {\n $response->contentType = \"application/json; charset=utf-8\";\n if (isset($_GET['jsonp'])) {\n $response->body = $_GET['jsonp'].'('.json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).');';\n } else {\n $response->body = json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);\n }\n });\n }", "protected function json(){\n $this->before(function ($request) {\n if ($request->contentType == \"application/json; charset=utf-8\") {\n $request->data = json_decode($request->data);\n }\n });\n $this->after(function ($response) {\n $response->contentType = \"application/json; charset=utf-8\";\n if (isset($_GET['jsonp'])) {\n $response->body = $_GET['jsonp'].'('.json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).');';\n } else {\n $response->body = json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);\n }\n });\n }", "public function jsonSerialize()\n {\n $this->serializeWithId($this->resolveFields(\n resolve(Request::class)\n ));\n }", "private function _serializeOrderDetail($record)\n {\n $order_details = new Order_Details();\n $order_details->Discount = $record['Discount'];\n $order_details->OrderID = $record['OrderID'];\n $order_details->ProductID = $record['ProductID'];\n $order_details->Quantity = $record['Quantity'];\n $order_details->UnitPrice = $record['UnitPrice'];\n return $order_details; \n }", "public function formatRecord(Record $record) {\n\t\t$record = $this->normalizeValues($record);\n\n\t\t$output = [];\n\t\t\n\t\t$extra = $this->arr($record->extra);\n\t\tif($extra->keyExists('line') && $extra->keyExists('file')){\n\t\t\t$output['line'] = $extra['line'];\n\t\t\t$output['file'] = $extra['file'];\n\t\t\t$extra->removeKey('line')->removeKey('file');\n\t\t}\n\n\t\tif($extra->keyExists('memory_usage')){\n\t\t\t$output['memory'] = $extra['memory_usage'];\n\t\t\t$extra->removeKey('memory_usage');\n\t\t}\n\n\t\t$record->extra = $extra->val();\n\n\t\t// Handle main record values\n\t\tforeach ($record as $var => $val) {\n\t\t\tif($this->isDateTimeObject($val)) {\n\t\t\t\t$val = $val->format($this->dateFormat);\n\t\t\t}\n\t\t\tif($this->isObject($val)) {\n\t\t\t\t$val = (array)$val;\n\t\t\t} elseif($this->isArray($val)) {\n\t\t\t\t$val = json_encode($val);\n\t\t\t}\n\n\t\t\t$output[$var] = $val;\n\t\t}\n\n\t\treturn $output;\n\t}", "private function body()\n {\n return json_decode($this->request->all()[\"job\"], true);\n }", "public function body()\n {\n $entityBody = file_get_contents('php://input');\n\n foreach ((array)json_decode($entityBody) as $field => $value) {\n $this->requestStack[$field] = $value;\n }\n return json_decode($entityBody);\n }", "public function toJson()\n {\n $array = [];\n if(count($this->_headers))\n {\n $array['Header'] = [\n 'context' => [\n '_jsns' => 'urn:zimbra',\n ],\n ];\n foreach ($this->_headers as $name => $value)\n {\n $array['Header']['context'][$name] = array('_content' => $value);\n }\n }\n if($this->_request instanceof Request)\n {\n $reqArray = $this->_request->toArray();\n $reqName = $this->_request->requestName();\n $array['Body'][$reqName] = $reqArray[$reqName];\n }\n return json_encode((object) $array);\n }", "protected function write(array $record): void\n {\n $this->client->post($this->url, [\n RequestOptions::HEADERS => ['Content-Type' => 'application/json'],\n RequestOptions::BODY => json_encode($this->getMessage($record))\n ]);\n }", "public function toJson();", "public function toJson();", "protected function _createPayload($job)\n {\n return json_encode($job);\n }", "public function buildJson();", "abstract protected function map_object_to_record($object, $record);", "protected function reportCloudRecordingRequest($from, $to)\n {\n // verify the required parameter 'from' is set\n if ($from === null || (is_array($from) && count($from) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $from when calling reportCloudRecording'\n );\n }\n // verify the required parameter 'to' is set\n if ($to === null || (is_array($to) && count($to) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $to when calling reportCloudRecording'\n );\n }\n\n $resourcePath = '/report/cloud_recording';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($from !== null) {\n $queryParams['from'] = ObjectSerializer::toQueryValue($from);\n }\n // query params\n if ($to !== null) {\n $queryParams['to'] = ObjectSerializer::toQueryValue($to);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/json', 'multipart/form-data']\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 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 jsonSerialize()\n {\n return array('headers' => $this->headers, 'body' => $this->body);\n }", "public function jsonSerialize()\n {\n return $this->getBody(true);\n }", "public function toObject(){\r\n return json_decode($this->toJson());\r\n }", "private function _serializeOrder($record)\n {\n $order = new Order();\n $order->OrderID = $record['OrderID'];\n $order->CustomerID = $record['CustomerID'];\n $order->EmployeeID = $record['EmployeeID'];\n $order->OrderDate = !is_null($record['OrderDate']) ? $record['OrderDate']->format('Y-m-d\\TH:i:s'): null;\n $order->RequiredDate = !is_null($record['RequiredDate']) ? $record['RequiredDate']->format('Y-m-d\\TH:i:s'): null;\n $order->ShippedDate = !is_null($record['ShippedDate']) ? $record['ShippedDate']->format('Y-m-d\\TH:i:s'): null;\n $order->ShipVia = $record['ShipVia'];\n $order->Freight = $record['Freight'];\n $order->ShipName = $record['ShipName'];\n $order->ShipAddress = $record['ShipAddress'];\n $order->ShipCity = $record['ShipCity'];\n $order->ShipRegion = $record['ShipRegion'];\n $order->ShipPostalCode = $record['ShipPostalCode'];\n $order->ShipCountry = $record['ShipCountry'];\n return $order;\n }", "private function bodyBuilder(){\n\t\t// create empty structures\n\t\t$body = new stdClass();\n\t\t$input = new stdClass();\n\n\n\t\t// add leads array to input\n\t\t$body->input = $this->leads;\n\n\t\t// if tokens exists, add them to body->input\n\t\tif (isset($this->tokens)) {\n\t\t\t$body->input->tokens = $this->tokens;\n\t\t}\n\n\t\t$json = json_encode($body, JSON_PRETTY_PRINT);\n\n\t\treturn $json;\n\t}", "private function _JsonData() \n {\n $raw = file_get_contents('php://input', true);\n $body = json_decode($raw);\n \n $this->__new((array) $body);\n }", "private function fixObjtoJSON($request)\n {\n // Nest options correctly\n if (isset($request->Options) && count($request->Options->Option)) {\n $i = 0;\n $tempClass = new \\stdClass();\n foreach ($request->Options->Option as $Option) {\n $tempClass->Options[$i] = $Option;\n $i++;\n }\n $request->Options = $tempClass->Options;\n }\n \n // Format and nest LineItems correctly\n if (isset($request->Items) && count($request->Items->LineItem)) {\n $i = 0;\n $tempClass = new \\stdClass();\n foreach ($request->Items->LineItem as $LineItem) {\n // must be strings\n if (isset($LineItem->Quantity)) {\n $LineItem->Quantity = (string)($LineItem->Quantity);\n }\n if (isset($LineItem->UnitCost)) {\n $LineItem->UnitCost = strval($LineItem->UnitCost);\n }\n if (isset($LineItem->Tax)) {\n $LineItem->Tax = strval($LineItem->Tax);\n }\n if (isset($LineItem->Total)) {\n $LineItem->Total = strval($LineItem->Total);\n }\n $tempClass->Items[$i] = $LineItem;\n $i++;\n }\n $request->Items = $tempClass->Items;\n }\n\n // fix blank issue\n if (isset($request->RedirectUrl)) {\n $request->RedirectUrl = str_replace(' ', '%20', $request->RedirectUrl);\n }\n if (isset($request->CancelUrl)) {\n $request->CancelUrl = str_replace(' ', '%20', $request->CancelUrl);\n }\n\n $jsonRequest = json_encode($request);\n\n return $jsonRequest;\n }" ]
[ "0.6134897", "0.55030245", "0.5382027", "0.523877", "0.51920366", "0.5185566", "0.51143456", "0.5040793", "0.5040793", "0.5040793", "0.49755058", "0.4959523", "0.49371713", "0.49339497", "0.49280772", "0.49081087", "0.4906283", "0.48985237", "0.48985237", "0.48630413", "0.4852546", "0.4843197", "0.4830896", "0.48260432", "0.48255017", "0.476117", "0.47603494", "0.47580835", "0.4746021", "0.47364295" ]
0.7372453
0
Specification: Publish price list prices for product abstracts. Uses the given IDs of the `fos_price_product_price_list` table. Merges created or updated prices to the existing ones.
public function publishAbstractPriceProductPriceList(array $priceProductPriceListIds): void;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function publishConcretePriceProductPriceList(array $priceProductPriceListIds): void;", "public function publishAbstractPriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function publishConcretePriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function publishConcretePriceProductByProductIds(array $productIds): void;", "public function updatePrices($contractId, $priceList);", "public function publishAbstractPriceProductByByProductAbstractIds(array $productAbstractIds): void;", "public function updateprices()\n {\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"updateval\");\n if (is_array($aParams)) {\n foreach ($aParams as $soxId => $aStockParams) {\n $this->addprice($soxId, $aStockParams);\n }\n }\n }", "protected function putProductsVariantsPricelistPriceRequest($body, $product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling putProductsVariantsPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\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($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 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 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function patchProductsVariantsPricelistPriceRequest($body, $product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling patchProductsVariantsPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\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($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 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 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function updateAmazonProductsPrices($items)\n{\n\tif (sizeof($items) > 0) {\n\t\t$data['lastmod'] = time();\n\t\t$data['lastmod_user'] = getAmazonSessionUserId();\n\t\t$data['lastpriceupdate'] = time();\n\t\t$data['submitedProduct'] = 0;\n\t\t$data['submitedPrice'] = 0;\n\t\t$data['upload'] = 1;\n\t\t$caseStandardPrice = \"StandardPrice = CASE\";\n\t\tforeach($items as $key => $item)\n\t\t{\n\t\t\t$caseStandardPrice.= \"\\n WHEN id_product = \" . $items[$key]['id_product'] . \" THEN \" . $items[$key]['price'];\n\t\t\t$productsIds[] = $items[$key]['id_product'];\n\t\t}\n\t\t$caseStandardPrice.= \"\n\t\t\tEND\n\t\t\tWHERE id_product IN (\" . implode(\", \", $productsIds) . \")\n\t\t\";\n\t\t$addWhere\t = $caseStandardPrice;\n\t\tSQLUpdate('amazon_products', $data, $addWhere, 'shop', __FILE__, __LINE__);\n\t}\n}", "public function api_update_price(){\n $watchlists = $this->wr->all();\n foreach($watchlists as $watchlist)\n {\n $current_price = $this->get_quotes($watchlist->id);\n\n $this->wr->update([\n 'current_price' => $current_price,\n ],$watchlist->id);\n }\n }", "function editPrices() {\n\t\tglobal $HTML;\n\t\tglobal $page;\n\t\tglobal $id;\n\t\t$HTML->details(1);\n\n\t\t$this->getPrices();\n\n\t\t$price_groups = $this->priceGroupClass->getItems();\n\t\t$countries = $this->countryClass->getItems();\n\n\t\t$_ = '';\n\t\t$_ .= '<div class=\"c init:form form:action:'.$page->url.'\" id=\"container:prices\">';\n\t\t$_ .= '<div class=\"c\">';\n\n\t\t$_ .= $HTML->inputHidden(\"id\", $id);\n\t\t$_ .= $HTML->inputHidden(\"item_id\", $id);\n\n\t\t$_ .= $HTML->head(\"Prices\", \"2\");\n\n\t\tif(Session::getLogin()->validatePage(\"prices_update\")) {\n\t\t\t$_ .= $HTML->inputHidden(\"page_status\", \"prices_update\");\n\t\t}\n\n\t\tif($this->item() && count($this->item[\"id\"]) == 1) {\n\n\t\t\tforeach($countries[\"id\"] as $country_key => $country_id) {\n\n\t\t\t\t$_ .= '<div class=\"ci33\">';\n\n\t\t\t\t\t$_ .= $HTML->head($countries[\"values\"][$country_key], 3);\n\n\t\t\t\t\tforeach($price_groups[\"uid\"] as $index => $price_group_uid) {\n\t\t\t\t\t\t$price = ($this->item[\"price\"][0] && isset($this->item[\"price\"][0][$country_id][$price_group_uid])) ? $this->item[\"price\"][0][$country_id][$price_group_uid] : \"\";\n\t\t\t\t\t\t$_ .= $HTML->input($price_groups[\"values\"][$index], \"prices[$country_id][$price_group_uid]\", $price);\n\t\t\t\t\t}\n\n\t\t\t\t\t$_ .= $HTML->separator();\n\t\t\t\t$_ .= '</div>';\n\n\t\t\t}\n\t\t}\n\n\t\t$_ .= '</div>';\n\n\t\t$_ .= $HTML->smartButton($this->translate(\"Cancel\"), false, \"prices_cancel\", \"fleft key:esc\");\n\t\t$_ .= $HTML->smartButton($this->translate(\"Save\"), false, \"prices_update\", \"fright key:s\");\n\n\t\t$_ .= '</div>';\n\n\t\treturn $_;\n\t}", "public function gETPriceIdPriceListRequest($price_id)\n {\n // verify the required parameter 'price_id' is set\n if ($price_id === null || (is_array($price_id) && count($price_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $price_id when calling gETPriceIdPriceList'\n );\n }\n\n $resourcePath = '/prices/{priceId}/price_list';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($price_id !== null) {\n $resourcePath = str_replace(\n '{' . 'priceId' . '}',\n ObjectSerializer::toPathValue($price_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\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\\build_query($formParams);\n }\n }\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 get_prices($ids)\n\t{\n\t\t$data = '';\n\n\t\t// create comma sepearted lists\n\t\t$items = '';\n\t\tforeach ($ids as $id) {\n\t\t\tif ($items != '') {\n\t\t\t\t$items .= ',';\n\t\t\t}\n\t\t\t$items .= $id;\n\t\t}\n\n\t\t// get multiple product info based on list of ids\n\t\tif($result = $this->Database->query(\"SELECT id, price FROM $this->db_table WHERE id IN ($items) ORDER BY name\" ))\n\t\t{\n\t\t\tif($result->num_rows > 0)\n\t\t\t{\n\t\t\t\twhile($row = $result->fetch_array())\n\t\t\t\t{\n\t\t\t\t\t$data[] = array(\n\t\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t\t'price' => $row['price']\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\n\t}", "protected function getProductsVariantsPricelistPriceRequest($product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 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 run()\n {\n $prices = [\n [\n 'product_id' => 2,\n 'user_id' => 3,\n 'price' => 18,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 3,\n 'user_id' => 3,\n 'price' => 15,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 2,\n 'user_id' => 4,\n 'price' => 18,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 3,\n 'user_id' => 4,\n 'price' => 15,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n ];\n ProductPrice::query()->insert($prices);\n }", "public function test_comicEntityIsCreated_prices_setPrices()\n {\n $sut = $this->getSUT();\n $prices = $sut->getPrices();\n $expected = [\n Price::create(\n 'printPrice',\n 19.99\n ),\n ];\n\n $this->assertEquals($expected, $prices);\n }", "protected function deleteProductsVariantsPricelistPriceRequest($product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 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 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function doActionSetSalePrice()\n {\n $form = new \\XLite\\Module\\CDev\\Sale\\View\\Form\\SaleSelectedDialog();\n $form->getRequestData();\n\n if ($form->getValidationMessage()) {\n \\XLite\\Core\\TopMessage::addError($form->getValidationMessage());\n } elseif (!$this->getSelected() && $ids = $this->getActionProductsIds()) {\n $qb = \\XLite\\Core\\Database::getRepo('XLite\\Model\\Product')->createQueryBuilder();\n $alias = $qb->getMainAlias();\n $qb->update('\\XLite\\Model\\Product', $alias)\n ->andWhere($qb->expr()->in(\"{$alias}.product_id\", $ids));\n\n foreach ($this->getUpdateInfoElement() as $key => $value) {\n $qb->set(\"{$alias}.{$key}\", \":{$key}\")\n ->setParameter($key, $value);\n }\n\n $qb->execute();\n\n \\XLite\\Core\\TopMessage::addInfo('Products information has been successfully updated');\n } else {\n \\XLite\\Core\\Database::getRepo('\\XLite\\Model\\Product')->updateInBatchById($this->getUpdateInfo());\n \\XLite\\Core\\TopMessage::addInfo('Products information has been successfully updated');\n }\n\n $this->setReturnURL($this->buildURL('product_list', '', ['mode' => 'search']));\n }", "public function saved(Price $price)\n {\n PriceItem::where('price_id', $price->id)->delete();\n\n $productId = request()->input('product_id');\n\n foreach (request()->input('prices', []) as $priceInput) {\n $priceCategoryAttributes = [\n 'product_id' => $productId,\n ];\n\n foreach (config('app.locales') as $lang => $locale) {\n $priceCategoryAttributes[\"title_{$lang}\"] = $priceInput['category'][$lang];\n }\n\n $priceCategory = PriceCategory::firstOrCreate($priceCategoryAttributes);\n\n $priceItemAttributes = [\n 'price_id' => $price->id,\n 'price_category_id' => $priceCategory->id,\n ];\n foreach ($priceInput['items'] as $item) {\n $priceItemAttributes['price'] = $item['price'];\n $priceItemAttributes['date_start'] = $item['date_start'];\n $priceItemAttributes['date_end'] = $item['date_end'];\n\n foreach (config('app.locales') as $lang => $locale) {\n $priceItemAttributes[\"title_{$lang}\"] = $item['title'][$lang];\n }\n }\n\n PriceItem::create($priceItemAttributes);\n }\n }", "public function setListPrice(float $listPrice)\n\t{\n\t\t$this->addKeyValue('list_price', $listPrice); \n\n\t}", "public function getOnSaleProducts_List (array $listOptions = array()) {\n // global $app;\n // $options['sort'] = 'shop_products.DateUpdated';\n // $options['order'] = 'DESC';\n // $options['_fshop_products.Status'] = join(',', dbquery::getProductStatusesWhenAvailable()) . ':IN';\n // $options['_fshop_products.Price'] = 'PrevPrice:>';\n // $options['_fshop_products.Status'] = 'DISCOUNT';\n // $config = dbquery::shopGetProductList_NewItems($options);\n // if (empty($config))\n // return null;\n // $self = $this;\n // $callbacks = array(\n // \"parse\" => function ($items) use($self) {\n // $_items = array();\n // foreach ($items as $key => $orderRawItem) {\n // $_items[] = $self->getProductByID($orderRawItem['ID']);\n // }\n // return $_items;\n // }\n // );\n // $dataList = $app->getDB()->getDataList($config, $options, $callbacks);\n // return $dataList;\n\n\n $self = $this;\n $params = array();\n $params['list'] = $listOptions;\n $params['callbacks'] = array(\n 'parse' => function ($dbRawItem) use ($self) {\n return $self->getProductByID($dbRawItem['ID']);\n }\n );\n\n return dbquery::fetchOnSaleProducts_List($params);\n }", "public function prices()\n {\n return $this->morphToMany(Price::class, 'price_able');\n }", "public function calculatePrices(): void\n {\n $orders = ServiceContainer::orders();\n $pizzaPrice = $orders->calculatePizzaPrice($this->items);\n $deliveryPrice = $orders->calculateDeliveryPrice($pizzaPrice, $this->outside, $this->currency);\n $this->delivery_price = $deliveryPrice;\n $this->total_price = $pizzaPrice + $deliveryPrice;\n }", "public function execute($ids = [])\n {\n /**\n * @var $idCollection \\Bazaarvoice\\Connector\\Model\\ResourceModel\\Index\\Collection \n */\n\n if (!$this->canIndex()) {\n return false;\n }\n try {\n $this->logger->debug('Partial Product Feed Index');\n\n if (empty($ids)) {\n $idCollection = $this->bvIndexCollectionFactory->create()->addFieldToFilter('version_id', 0);\n $idCollection->getSelect()->group('product_id');\n $idCollection->addFieldToSelect('product_id');\n $ids = $idCollection->getColumnValues('product_id');\n }\n\n $this->logger->debug('Found '.count($ids).' products to update.');\n\n /**\n * Break ids into pages \n */\n $productIdSets = array_chunk($ids, 50);\n\n /**\n * Time throttling \n */\n $limit = ($this->configProvider->getCronjobDurationLimit() * 60) - 10;\n $stop = time() + $limit;\n $counter = 0;\n do {\n if (time() > $stop) {\n break;\n }\n\n $productIds = array_pop($productIdSets);\n if (!is_array($productIds)\n || count($productIds) == 0\n ) {\n break;\n }\n\n $this->logger->debug('Updating product ids '.implode(',', $productIds));\n\n $this->reindexProducts($productIds);\n $counter += count($productIds);\n } while (1);\n\n if ($counter) {\n if ($counter < count($ids)) {\n $changelogTable = $this->resourceConnection->getTableName('bazaarvoice_product_cl');\n $indexTable = $this->resourceConnection->getTableName('bazaarvoice_index_product');\n $this->resourceConnection->getConnection('core_write')\n ->query(\"INSERT INTO `$changelogTable` (`entity_id`) SELECT `product_id` FROM `$indexTable` WHERE `version_id` = 0;\");\n }\n $this->logStats();\n }\n } catch (Exception $e) {\n $this->logger->crit($e->getMessage().\"\\n\".$e->getTraceAsString());\n }\n\n return true;\n }", "public function syncProductList()\n {\n // Evaluation only needed for custom product list and product tag\n if (!$this->isCustomList() && !$this->model_type !== ProductTag::class) return;\n\n $product_ids = $this->isCustomList() ? $this->product_ids : $this->getProductQuery()->get('id')->pluck('id')->all();\n\n $this->products()->sync($product_ids);\n }", "function _prepareGroupedProductPriceData($entityIds = null) {\n\t\t\t$write = $this->_getWriteAdapter( );\n\t\t\t$table = $this->getIdxTable( );\n\t\t\t$select = $write->select( )->from( array( 'e' => $this->getTable( 'catalog/product' ) ), 'entity_id' )->joinLeft( array( 'l' => $this->getTable( 'catalog/product_link' ) ), 'e.entity_id = l.product_id AND l.link_type_id=' . LINK_TYPE_GROUPED, array( ) )->join( array( 'cg' => $this->getTable( 'customer/customer_group' ) ), '', array( 'customer_group_id' ) );\n\t\t\t$this->_addWebsiteJoinToSelect( $select, true );\n\t\t\t$this->_addProductWebsiteJoinToSelect( $select, 'cw.website_id', 'e.entity_id' );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1600( )) {\n\t\t\t\t$minCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.min_price', 0 );\n\t\t\t\t$maxCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.max_price', 0 );\n\t\t\t\t$taxClassId = $this->_getReadAdapter( )->getCheckSql( 'MIN(i.tax_class_id) IS NULL', '0', 'MIN(i.tax_class_id)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(' . $minCheckSql . ')' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(' . $maxCheckSql . ')' );\n\t\t\t} \nelse {\n\t\t\t\t$taxClassId = new Zend_Db_Expr( 'IFNULL(i.tax_class_id, 0)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(IF(le.required_options = 0, i.min_price, 0))' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(IF(le.required_options = 0, i.max_price, 0))' );\n\t\t\t}\n\n\t\t\t$stockId = 'IF (i.stock_id IS NOT NULL, i.stock_id, 1)';\n\t\t\t$select->columns( 'website_id', 'cw' )->joinLeft( array( 'le' => $this->getTable( 'catalog/product' ) ), 'le.entity_id = l.linked_product_id', array( ) );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1700( )) {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'group_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t} \nelse {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t}\n\n\t\t\t$select->joinLeft( array( 'i' => $table ), '(i.entity_id = l.linked_product_id) AND (i.website_id = cw.website_id) AND ' . '(i.customer_group_id = cg.customer_group_id)', $columns );\n\t\t\t$select->group( array( 'e.entity_id', 'cg.customer_group_id', 'cw.website_id', $stockId, 'i.currency', 'i.store_id' ) )->where( 'e.type_id=?', $this->getTypeId( ) );\n\n\t\t\tif (!is_null( $entityIds )) {\n\t\t\t\t$select->where( 'l.product_id IN(?)', $entityIds );\n\t\t\t}\n\n\t\t\t$eventData = array( 'select' => $select, 'entity_field' => new Zend_Db_Expr( 'e.entity_id' ), 'website_field' => new Zend_Db_Expr( 'cw.website_id' ), 'stock_field' => new Zend_Db_Expr( $stockId ), 'currency_field' => new Zend_Db_Expr( 'i.currency' ), 'store_field' => new Zend_Db_Expr( 'cs.store_id' ) );\n\n\t\t\tif (!$this->getWarehouseHelper( )->getConfig( )->isMultipleMode( )) {\n\t\t\t\t$eventData['stock_field'] = new Zend_Db_Expr( 'i.stock_id' );\n\t\t\t}\n\n\t\t\tMage::dispatchEvent( 'catalog_product_prepare_index_select', $eventData );\n\t\t\t$query = $select->insertFromSelect( $table );\n\t\t\t$write->query( $query );\n\t\t\treturn $this;\n\t\t}", "public function Save($id, $desc, $rating, $genre, $developer, $listPrice, $releaseDate)\n {\t\n\t\ttry\n\t\t{\t\n\t\t\t$response = $this->_obj->Execute(\"Product(\" . $id . \")\" );\n\t\t\t$products = $response->Result;\n\t\t\tforeach ($products as $product) \n\t\t\t{\n\t\t\t\t$product->ProductDescription = $desc;\n\t\t\t\t$product->ListPrice = str_replace('$', '', $listPrice);\n\t\t\t\t$product->ReleaseDate = $releaseDate;\n\t\t\t\t$product->ProductVersion = $product->ProductVersion;\n\t\t\t\t$this->_obj->UpdateObject($product);\n\t\t\t}\n\t\t\t$this->_obj->SaveChanges(); \n\t\t\t$response = $this->_obj->Execute(\"Game?\\$filter=ProductID eq \" . $id );;\n\t\t\t$games = $response->Result;\n\t\t\tforeach ($games as $game) \n\t\t\t{\n\t\t\t\t$game->Rating = str_replace('%20', ' ', $rating);\n\t\t\t\t$game->Genre = str_replace('%20', ' ', $genre);\n\t\t\t\t$game->Developer = $developer;\n\t\t\t\t$game->GameVersion = $game->GameVersion;\n\t\t\t\t$this->_obj->UpdateObject($game);\n\t\t\t}\n\t\t\t$this->_obj->SaveChanges();\n\t\t\t$products[0]->Game = $games;\n\t\t\treturn $products[0];\n }\n catch(ADODotNETDataServicesException $e)\n {\n\t\t\t echo \"Error: \" . $e->getError() . \"<br>\" . \"Detailed Error: \" . $e->getDetailedError();\n }\n }", "public function addprice($sOXID = null, $aUpdateParams = null)\n {\n $myConfig = $this->getConfig();\n\n $this->resetContentCache();\n\n $sOxArtId = $this->getEditObjectId();\n\n\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"editval\");\n\n if (!is_array($aParams)) {\n return;\n }\n\n if (isset($aUpdateParams) && is_array($aUpdateParams)) {\n $aParams = array_merge($aParams, $aUpdateParams);\n }\n\n //replacing commas\n foreach ($aParams as $key => $sParam) {\n $aParams[$key] = str_replace(\",\", \".\", $sParam);\n }\n\n $aParams['oxprice2article__oxshopid'] = $myConfig->getShopID();\n\n if (isset($sOXID)) {\n $aParams['oxprice2article__oxid'] = $sOXID;\n }\n\n $aParams['oxprice2article__oxartid'] = $sOxArtId;\n if (!isset($aParams['oxprice2article__oxamount']) || !$aParams['oxprice2article__oxamount']) {\n $aParams['oxprice2article__oxamount'] = \"1\";\n }\n\n if (!$myConfig->getConfigParam('blAllowUnevenAmounts')) {\n $aParams['oxprice2article__oxamount'] = round(( string ) $aParams['oxprice2article__oxamount']);\n $aParams['oxprice2article__oxamountto'] = round(( string ) $aParams['oxprice2article__oxamountto']);\n }\n\n $dPrice = $aParams['price'];\n $sType = $aParams['pricetype'];\n\n $oArticlePrice = oxNew(\"oxbase\");\n $oArticlePrice->init(\"oxprice2article\");\n $oArticlePrice->assign($aParams);\n\n $oArticlePrice->$sType = new oxField($dPrice);\n\n //validating\n if ($oArticlePrice->$sType->value &&\n $oArticlePrice->oxprice2article__oxamount->value &&\n $oArticlePrice->oxprice2article__oxamountto->value &&\n is_numeric($oArticlePrice->$sType->value) &&\n is_numeric($oArticlePrice->oxprice2article__oxamount->value) &&\n is_numeric($oArticlePrice->oxprice2article__oxamountto->value) &&\n $oArticlePrice->oxprice2article__oxamount->value <= $oArticlePrice->oxprice2article__oxamountto->value\n ) {\n $oArticlePrice->save();\n }\n\n // check if abs price is lower than base price\n $oArticle = oxNew(\"oxArticle\");\n $oArticle->loadInLang($this->_iEditLang, $sOxArtId);\n $sPriceField = 'oxarticles__oxprice';\n if (($aParams['price'] >= $oArticle->$sPriceField->value) &&\n ($aParams['pricetype'] == 'oxprice2article__oxaddabs')) {\n if (is_null($sOXID)) {\n $sOXID = $oArticlePrice->getId();\n }\n $this->_aViewData[\"errorscaleprice\"][] = $sOXID;\n }\n\n }", "protected function saveUpdateProducts()\r\n\t{\r\n\t\tif (count($this->newProducts) > 0) {\r\n\t\t\t// inserir as novas\r\n\t\t\tforeach ($this->newProducts as $product) {\r\n\t\t\t\t$result = $this->client->catalogProductUpdate($this->sessionid, $product->sku, $product);\r\n\t\t\t\t$this->log->addInfo('updated', array(\"sku\" => $product->sku, \"result\" => $result));\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->newProducts = array();\r\n\t}" ]
[ "0.8055158", "0.7791744", "0.75901276", "0.6740554", "0.6615686", "0.65738237", "0.59323585", "0.59132767", "0.5906179", "0.5710619", "0.56863517", "0.56150806", "0.5550583", "0.54916686", "0.5474283", "0.5438785", "0.54045933", "0.5398685", "0.5302523", "0.5298761", "0.5219344", "0.5205988", "0.5204178", "0.5191773", "0.5179187", "0.51746595", "0.5171184", "0.5169964", "0.5135243", "0.511783" ]
0.82506853
0
Specification: Publish price list prices for product abstracts. Uses the given abstract product IDs. Merges created or updated prices to the existing ones.
public function publishAbstractPriceProductByByProductAbstractIds(array $productAbstractIds): void;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function publishAbstractPriceProductPriceList(array $priceProductPriceListIds): void;", "public function publishConcretePriceProductPriceList(array $priceProductPriceListIds): void;", "public function publishAbstractPriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function publishConcretePriceProductByProductIds(array $productIds): void;", "public function publishConcretePriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function updateprices()\n {\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"updateval\");\n if (is_array($aParams)) {\n foreach ($aParams as $soxId => $aStockParams) {\n $this->addprice($soxId, $aStockParams);\n }\n }\n }", "public function updatePrices($contractId, $priceList);", "function updateAmazonProductsPrices($items)\n{\n\tif (sizeof($items) > 0) {\n\t\t$data['lastmod'] = time();\n\t\t$data['lastmod_user'] = getAmazonSessionUserId();\n\t\t$data['lastpriceupdate'] = time();\n\t\t$data['submitedProduct'] = 0;\n\t\t$data['submitedPrice'] = 0;\n\t\t$data['upload'] = 1;\n\t\t$caseStandardPrice = \"StandardPrice = CASE\";\n\t\tforeach($items as $key => $item)\n\t\t{\n\t\t\t$caseStandardPrice.= \"\\n WHEN id_product = \" . $items[$key]['id_product'] . \" THEN \" . $items[$key]['price'];\n\t\t\t$productsIds[] = $items[$key]['id_product'];\n\t\t}\n\t\t$caseStandardPrice.= \"\n\t\t\tEND\n\t\t\tWHERE id_product IN (\" . implode(\", \", $productsIds) . \")\n\t\t\";\n\t\t$addWhere\t = $caseStandardPrice;\n\t\tSQLUpdate('amazon_products', $data, $addWhere, 'shop', __FILE__, __LINE__);\n\t}\n}", "public function calculatePrices(): void\n {\n $orders = ServiceContainer::orders();\n $pizzaPrice = $orders->calculatePizzaPrice($this->items);\n $deliveryPrice = $orders->calculateDeliveryPrice($pizzaPrice, $this->outside, $this->currency);\n $this->delivery_price = $deliveryPrice;\n $this->total_price = $pizzaPrice + $deliveryPrice;\n }", "public function api_update_price(){\n $watchlists = $this->wr->all();\n foreach($watchlists as $watchlist)\n {\n $current_price = $this->get_quotes($watchlist->id);\n\n $this->wr->update([\n 'current_price' => $current_price,\n ],$watchlist->id);\n }\n }", "protected function patchProductsVariantsPricelistPriceRequest($body, $product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling patchProductsVariantsPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\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($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 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 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function putProductsVariantsPricelistPriceRequest($body, $product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling putProductsVariantsPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\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($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 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 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function editPrices() {\n\t\tglobal $HTML;\n\t\tglobal $page;\n\t\tglobal $id;\n\t\t$HTML->details(1);\n\n\t\t$this->getPrices();\n\n\t\t$price_groups = $this->priceGroupClass->getItems();\n\t\t$countries = $this->countryClass->getItems();\n\n\t\t$_ = '';\n\t\t$_ .= '<div class=\"c init:form form:action:'.$page->url.'\" id=\"container:prices\">';\n\t\t$_ .= '<div class=\"c\">';\n\n\t\t$_ .= $HTML->inputHidden(\"id\", $id);\n\t\t$_ .= $HTML->inputHidden(\"item_id\", $id);\n\n\t\t$_ .= $HTML->head(\"Prices\", \"2\");\n\n\t\tif(Session::getLogin()->validatePage(\"prices_update\")) {\n\t\t\t$_ .= $HTML->inputHidden(\"page_status\", \"prices_update\");\n\t\t}\n\n\t\tif($this->item() && count($this->item[\"id\"]) == 1) {\n\n\t\t\tforeach($countries[\"id\"] as $country_key => $country_id) {\n\n\t\t\t\t$_ .= '<div class=\"ci33\">';\n\n\t\t\t\t\t$_ .= $HTML->head($countries[\"values\"][$country_key], 3);\n\n\t\t\t\t\tforeach($price_groups[\"uid\"] as $index => $price_group_uid) {\n\t\t\t\t\t\t$price = ($this->item[\"price\"][0] && isset($this->item[\"price\"][0][$country_id][$price_group_uid])) ? $this->item[\"price\"][0][$country_id][$price_group_uid] : \"\";\n\t\t\t\t\t\t$_ .= $HTML->input($price_groups[\"values\"][$index], \"prices[$country_id][$price_group_uid]\", $price);\n\t\t\t\t\t}\n\n\t\t\t\t\t$_ .= $HTML->separator();\n\t\t\t\t$_ .= '</div>';\n\n\t\t\t}\n\t\t}\n\n\t\t$_ .= '</div>';\n\n\t\t$_ .= $HTML->smartButton($this->translate(\"Cancel\"), false, \"prices_cancel\", \"fleft key:esc\");\n\t\t$_ .= $HTML->smartButton($this->translate(\"Save\"), false, \"prices_update\", \"fright key:s\");\n\n\t\t$_ .= '</div>';\n\n\t\treturn $_;\n\t}", "public function test_comicEntityIsCreated_prices_setPrices()\n {\n $sut = $this->getSUT();\n $prices = $sut->getPrices();\n $expected = [\n Price::create(\n 'printPrice',\n 19.99\n ),\n ];\n\n $this->assertEquals($expected, $prices);\n }", "public function addprice($sOXID = null, $aUpdateParams = null)\n {\n $myConfig = $this->getConfig();\n\n $this->resetContentCache();\n\n $sOxArtId = $this->getEditObjectId();\n\n\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"editval\");\n\n if (!is_array($aParams)) {\n return;\n }\n\n if (isset($aUpdateParams) && is_array($aUpdateParams)) {\n $aParams = array_merge($aParams, $aUpdateParams);\n }\n\n //replacing commas\n foreach ($aParams as $key => $sParam) {\n $aParams[$key] = str_replace(\",\", \".\", $sParam);\n }\n\n $aParams['oxprice2article__oxshopid'] = $myConfig->getShopID();\n\n if (isset($sOXID)) {\n $aParams['oxprice2article__oxid'] = $sOXID;\n }\n\n $aParams['oxprice2article__oxartid'] = $sOxArtId;\n if (!isset($aParams['oxprice2article__oxamount']) || !$aParams['oxprice2article__oxamount']) {\n $aParams['oxprice2article__oxamount'] = \"1\";\n }\n\n if (!$myConfig->getConfigParam('blAllowUnevenAmounts')) {\n $aParams['oxprice2article__oxamount'] = round(( string ) $aParams['oxprice2article__oxamount']);\n $aParams['oxprice2article__oxamountto'] = round(( string ) $aParams['oxprice2article__oxamountto']);\n }\n\n $dPrice = $aParams['price'];\n $sType = $aParams['pricetype'];\n\n $oArticlePrice = oxNew(\"oxbase\");\n $oArticlePrice->init(\"oxprice2article\");\n $oArticlePrice->assign($aParams);\n\n $oArticlePrice->$sType = new oxField($dPrice);\n\n //validating\n if ($oArticlePrice->$sType->value &&\n $oArticlePrice->oxprice2article__oxamount->value &&\n $oArticlePrice->oxprice2article__oxamountto->value &&\n is_numeric($oArticlePrice->$sType->value) &&\n is_numeric($oArticlePrice->oxprice2article__oxamount->value) &&\n is_numeric($oArticlePrice->oxprice2article__oxamountto->value) &&\n $oArticlePrice->oxprice2article__oxamount->value <= $oArticlePrice->oxprice2article__oxamountto->value\n ) {\n $oArticlePrice->save();\n }\n\n // check if abs price is lower than base price\n $oArticle = oxNew(\"oxArticle\");\n $oArticle->loadInLang($this->_iEditLang, $sOxArtId);\n $sPriceField = 'oxarticles__oxprice';\n if (($aParams['price'] >= $oArticle->$sPriceField->value) &&\n ($aParams['pricetype'] == 'oxprice2article__oxaddabs')) {\n if (is_null($sOXID)) {\n $sOXID = $oArticlePrice->getId();\n }\n $this->_aViewData[\"errorscaleprice\"][] = $sOXID;\n }\n\n }", "public function run()\n {\n $prices = [\n [\n 'product_id' => 2,\n 'user_id' => 3,\n 'price' => 18,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 3,\n 'user_id' => 3,\n 'price' => 15,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 2,\n 'user_id' => 4,\n 'price' => 18,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 3,\n 'user_id' => 4,\n 'price' => 15,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n ];\n ProductPrice::query()->insert($prices);\n }", "function _prepareGroupedProductPriceData($entityIds = null) {\n\t\t\t$write = $this->_getWriteAdapter( );\n\t\t\t$table = $this->getIdxTable( );\n\t\t\t$select = $write->select( )->from( array( 'e' => $this->getTable( 'catalog/product' ) ), 'entity_id' )->joinLeft( array( 'l' => $this->getTable( 'catalog/product_link' ) ), 'e.entity_id = l.product_id AND l.link_type_id=' . LINK_TYPE_GROUPED, array( ) )->join( array( 'cg' => $this->getTable( 'customer/customer_group' ) ), '', array( 'customer_group_id' ) );\n\t\t\t$this->_addWebsiteJoinToSelect( $select, true );\n\t\t\t$this->_addProductWebsiteJoinToSelect( $select, 'cw.website_id', 'e.entity_id' );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1600( )) {\n\t\t\t\t$minCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.min_price', 0 );\n\t\t\t\t$maxCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.max_price', 0 );\n\t\t\t\t$taxClassId = $this->_getReadAdapter( )->getCheckSql( 'MIN(i.tax_class_id) IS NULL', '0', 'MIN(i.tax_class_id)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(' . $minCheckSql . ')' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(' . $maxCheckSql . ')' );\n\t\t\t} \nelse {\n\t\t\t\t$taxClassId = new Zend_Db_Expr( 'IFNULL(i.tax_class_id, 0)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(IF(le.required_options = 0, i.min_price, 0))' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(IF(le.required_options = 0, i.max_price, 0))' );\n\t\t\t}\n\n\t\t\t$stockId = 'IF (i.stock_id IS NOT NULL, i.stock_id, 1)';\n\t\t\t$select->columns( 'website_id', 'cw' )->joinLeft( array( 'le' => $this->getTable( 'catalog/product' ) ), 'le.entity_id = l.linked_product_id', array( ) );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1700( )) {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'group_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t} \nelse {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t}\n\n\t\t\t$select->joinLeft( array( 'i' => $table ), '(i.entity_id = l.linked_product_id) AND (i.website_id = cw.website_id) AND ' . '(i.customer_group_id = cg.customer_group_id)', $columns );\n\t\t\t$select->group( array( 'e.entity_id', 'cg.customer_group_id', 'cw.website_id', $stockId, 'i.currency', 'i.store_id' ) )->where( 'e.type_id=?', $this->getTypeId( ) );\n\n\t\t\tif (!is_null( $entityIds )) {\n\t\t\t\t$select->where( 'l.product_id IN(?)', $entityIds );\n\t\t\t}\n\n\t\t\t$eventData = array( 'select' => $select, 'entity_field' => new Zend_Db_Expr( 'e.entity_id' ), 'website_field' => new Zend_Db_Expr( 'cw.website_id' ), 'stock_field' => new Zend_Db_Expr( $stockId ), 'currency_field' => new Zend_Db_Expr( 'i.currency' ), 'store_field' => new Zend_Db_Expr( 'cs.store_id' ) );\n\n\t\t\tif (!$this->getWarehouseHelper( )->getConfig( )->isMultipleMode( )) {\n\t\t\t\t$eventData['stock_field'] = new Zend_Db_Expr( 'i.stock_id' );\n\t\t\t}\n\n\t\t\tMage::dispatchEvent( 'catalog_product_prepare_index_select', $eventData );\n\t\t\t$query = $select->insertFromSelect( $table );\n\t\t\t$write->query( $query );\n\t\t\treturn $this;\n\t\t}", "public function getPriceAll()\n { \n $collection = $this->PostCollectionFactory->create();\n /*$a = $collection->getPrice();*/\n foreach ($collection as $key => $value) {\n $value->getPrice();\n }\n return $value->getPrice();\n }", "public function wc_epo_product_price_rules( $price = array(), $product ) {\n\t\tif ( $this->is_elex_dpd_enabled() ) {\n\t\t\t$check_price = apply_filters( 'wc_epo_discounted_price', NULL, $product, NULL );\n\t\t\tif ( $check_price ) {\n\t\t\t\t$price['product'] = array();\n\t\t\t\tif ( $check_price['is_multiprice'] ) {\n\t\t\t\t\tforeach ( $check_price['rules'] as $variation_id => $variation_rule ) {\n\t\t\t\t\t\tforeach ( $variation_rule as $rulekey => $pricerule ) {\n\t\t\t\t\t\t\t$price['product'][ $variation_id ][] = array(\n\t\t\t\t\t\t\t\t\"min\" => $pricerule[\"min\"],\n\t\t\t\t\t\t\t\t\"max\" => $pricerule[\"max\"],\n\t\t\t\t\t\t\t\t\"value\" => ( $pricerule[\"type\"] != \"percentage\" ) ? apply_filters( 'wc_epo_product_price', $pricerule[\"value\"], \"\", FALSE ) : $pricerule[\"value\"],\n\t\t\t\t\t\t\t\t\"type\" => $pricerule[\"type\"],\n\t\t\t\t\t\t\t\t'conditions' => isset( $pricerule[\"conditions\"] ) ? $pricerule[\"conditions\"] : array(),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tforeach ( $check_price['rules'] as $rulekey => $pricerule ) {\n\t\t\t\t\t\t$price['product'][0][] = array(\n\t\t\t\t\t\t\t\"min\" => $pricerule[\"min\"],\n\t\t\t\t\t\t\t\"max\" => $pricerule[\"max\"],\n\t\t\t\t\t\t\t\"value\" => ( $pricerule[\"type\"] != \"percentage\" ) ? apply_filters( 'wc_epo_product_price', $pricerule[\"value\"], \"\", FALSE ) : $pricerule[\"value\"],\n\t\t\t\t\t\t\t\"type\" => $pricerule[\"type\"],\n\t\t\t\t\t\t\t'conditions' => isset( $pricerule[\"conditions\"] ) ? $pricerule[\"conditions\"] : array(),\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$price['price'] = apply_filters( 'woocommerce_tm_epo_price_compatibility', apply_filters( 'wc_epo_product_price', $product->get_price(), \"\", FALSE ), $product );\n\t\t}\n\n\t\treturn $price;\n\t}", "protected function calculatePrices()\n {\n }", "public function create_individual_product_list ($all_product_ids, $all_qtys) {\n \n foreach(array_combine($all_product_ids, $all_qtys) as $value => $tally){\n \n $key_location = array_search($value, array_column($this->json_source_array['products'], 'id'));\n \n // Add multiple entries when there are multiples of a product\n \n while ($this->qty_counter < $tally) {\n $this->category_price[$this->counter]['category'] = $this->json_source_array['products'][$key_location]['category'];\n $this->category_price[$this->counter]['price'] = $this->json_source_array['products'][$key_location]['price'];\n \n $this->qty_counter += 1;\n $this->counter += 1;\n } \n \n $this->qty_counter = 0;\n }\n\n }", "protected function doActionSetSalePrice()\n {\n $form = new \\XLite\\Module\\CDev\\Sale\\View\\Form\\SaleSelectedDialog();\n $form->getRequestData();\n\n if ($form->getValidationMessage()) {\n \\XLite\\Core\\TopMessage::addError($form->getValidationMessage());\n } elseif (!$this->getSelected() && $ids = $this->getActionProductsIds()) {\n $qb = \\XLite\\Core\\Database::getRepo('XLite\\Model\\Product')->createQueryBuilder();\n $alias = $qb->getMainAlias();\n $qb->update('\\XLite\\Model\\Product', $alias)\n ->andWhere($qb->expr()->in(\"{$alias}.product_id\", $ids));\n\n foreach ($this->getUpdateInfoElement() as $key => $value) {\n $qb->set(\"{$alias}.{$key}\", \":{$key}\")\n ->setParameter($key, $value);\n }\n\n $qb->execute();\n\n \\XLite\\Core\\TopMessage::addInfo('Products information has been successfully updated');\n } else {\n \\XLite\\Core\\Database::getRepo('\\XLite\\Model\\Product')->updateInBatchById($this->getUpdateInfo());\n \\XLite\\Core\\TopMessage::addInfo('Products information has been successfully updated');\n }\n\n $this->setReturnURL($this->buildURL('product_list', '', ['mode' => 'search']));\n }", "public function prices()\n {\n return $this->morphToMany(Price::class, 'price_able');\n }", "public function execute($ids = [])\n {\n /**\n * @var $idCollection \\Bazaarvoice\\Connector\\Model\\ResourceModel\\Index\\Collection \n */\n\n if (!$this->canIndex()) {\n return false;\n }\n try {\n $this->logger->debug('Partial Product Feed Index');\n\n if (empty($ids)) {\n $idCollection = $this->bvIndexCollectionFactory->create()->addFieldToFilter('version_id', 0);\n $idCollection->getSelect()->group('product_id');\n $idCollection->addFieldToSelect('product_id');\n $ids = $idCollection->getColumnValues('product_id');\n }\n\n $this->logger->debug('Found '.count($ids).' products to update.');\n\n /**\n * Break ids into pages \n */\n $productIdSets = array_chunk($ids, 50);\n\n /**\n * Time throttling \n */\n $limit = ($this->configProvider->getCronjobDurationLimit() * 60) - 10;\n $stop = time() + $limit;\n $counter = 0;\n do {\n if (time() > $stop) {\n break;\n }\n\n $productIds = array_pop($productIdSets);\n if (!is_array($productIds)\n || count($productIds) == 0\n ) {\n break;\n }\n\n $this->logger->debug('Updating product ids '.implode(',', $productIds));\n\n $this->reindexProducts($productIds);\n $counter += count($productIds);\n } while (1);\n\n if ($counter) {\n if ($counter < count($ids)) {\n $changelogTable = $this->resourceConnection->getTableName('bazaarvoice_product_cl');\n $indexTable = $this->resourceConnection->getTableName('bazaarvoice_index_product');\n $this->resourceConnection->getConnection('core_write')\n ->query(\"INSERT INTO `$changelogTable` (`entity_id`) SELECT `product_id` FROM `$indexTable` WHERE `version_id` = 0;\");\n }\n $this->logStats();\n }\n } catch (Exception $e) {\n $this->logger->crit($e->getMessage().\"\\n\".$e->getTraceAsString());\n }\n\n return true;\n }", "function getArticlesByPrice($priceMin=0, $priceMax=0, $usePriceGrossInstead=0, $proofUid=1){\n //first get all real articles, then create objects and check prices\n\t //do not get prices directly from DB because we need to take (price) hooks into account\n\t $table = 'tx_commerce_articles';\n\t $where = '1=1';\n\t if($proofUid){\n\t $where.= ' and tx_commerce_articles.uid_product = '.$this->uid;\n\t }\t\n //todo: put correct constant here\n\t $where.= ' and article_type_uid=1';\n\t $where.= $this->cObj->enableFields($table);\n\t $groupBy = '';\n\t $orderBy = 'sorting';\n\t $limit = '';\n\t $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery (\n\t 'uid', $table,\n\t $where, $groupBy,\n\t $orderBy,$limit\n\t );\n\t $rawArticleUidList = array();\n\t while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t $rawArticleUidList[] = $row['uid'];\n\t }\n\t $GLOBALS['TYPO3_DB']->sql_free_result($res);\n\t \n\t //now run the price test\n\t $articleUidList = array();\n\t foreach ($rawArticleUidList as $rawArticleUid) {\n\t\t $tmpArticle = new tx_commerce_article($rawArticleUid,$this->lang_uid);\n\t\t $tmpArticle->load_data();\n\t\t\t $myPrice = $usePriceGrossInstead ? $tmpArticle->get_price_gross() : $tmpArticle->get_price_net();\n\t\t\t if (($priceMin <= $myPrice) && ($myPrice <= $priceMax)) {\n\t\t\t $articleUidList[] = $tmpArticle->get_uid();\n\t\t\t }\n\t\t }\n if(count($articleUidList)>0){\n return $articleUidList;\n }else{\n return false;\n\t }\n\t}", "protected function createProductVariantPricelistPriceRequest($body, $product_id, $variant_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling createProductVariantPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling createProductVariantPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.createProductVariantPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling createProductVariantPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.createProductVariantPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\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($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function get_prices($ids)\n\t{\n\t\t$data = '';\n\n\t\t// create comma sepearted lists\n\t\t$items = '';\n\t\tforeach ($ids as $id) {\n\t\t\tif ($items != '') {\n\t\t\t\t$items .= ',';\n\t\t\t}\n\t\t\t$items .= $id;\n\t\t}\n\n\t\t// get multiple product info based on list of ids\n\t\tif($result = $this->Database->query(\"SELECT id, price FROM $this->db_table WHERE id IN ($items) ORDER BY name\" ))\n\t\t{\n\t\t\tif($result->num_rows > 0)\n\t\t\t{\n\t\t\t\twhile($row = $result->fetch_array())\n\t\t\t\t{\n\t\t\t\t\t$data[] = array(\n\t\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t\t'price' => $row['price']\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\n\t}", "protected function _getCatalogProductPriceData($productIds = null)\n {\n $connection = $this->getConnection();\n $catalogProductIndexPriceSelect = [];\n\n foreach ($this->dimensionCollectionFactory->create() as $dimensions) {\n if (!isset($dimensions[WebsiteDimensionProvider::DIMENSION_NAME]) ||\n $this->websiteId === null ||\n $dimensions[WebsiteDimensionProvider::DIMENSION_NAME]->getValue() === $this->websiteId) {\n $select = $connection->select()->from(\n $this->tableResolver->resolve('catalog_product_index_price', $dimensions),\n ['entity_id', 'customer_group_id', 'website_id', 'min_price']\n );\n if ($productIds) {\n $select->where('entity_id IN (?)', $productIds);\n }\n $catalogProductIndexPriceSelect[] = $select;\n }\n }\n\n $catalogProductIndexPriceUnionSelect = $connection->select()->union($catalogProductIndexPriceSelect);\n\n $result = [];\n foreach ($connection->fetchAll($catalogProductIndexPriceUnionSelect) as $row) {\n $result[$row['website_id']][$row['entity_id']][$row['customer_group_id']] = round($row['min_price'], 2);\n }\n\n return $result;\n }", "public function Save($id, $desc, $rating, $genre, $developer, $listPrice, $releaseDate)\n {\t\n\t\ttry\n\t\t{\t\n\t\t\t$response = $this->_obj->Execute(\"Product(\" . $id . \")\" );\n\t\t\t$products = $response->Result;\n\t\t\tforeach ($products as $product) \n\t\t\t{\n\t\t\t\t$product->ProductDescription = $desc;\n\t\t\t\t$product->ListPrice = str_replace('$', '', $listPrice);\n\t\t\t\t$product->ReleaseDate = $releaseDate;\n\t\t\t\t$product->ProductVersion = $product->ProductVersion;\n\t\t\t\t$this->_obj->UpdateObject($product);\n\t\t\t}\n\t\t\t$this->_obj->SaveChanges(); \n\t\t\t$response = $this->_obj->Execute(\"Game?\\$filter=ProductID eq \" . $id );;\n\t\t\t$games = $response->Result;\n\t\t\tforeach ($games as $game) \n\t\t\t{\n\t\t\t\t$game->Rating = str_replace('%20', ' ', $rating);\n\t\t\t\t$game->Genre = str_replace('%20', ' ', $genre);\n\t\t\t\t$game->Developer = $developer;\n\t\t\t\t$game->GameVersion = $game->GameVersion;\n\t\t\t\t$this->_obj->UpdateObject($game);\n\t\t\t}\n\t\t\t$this->_obj->SaveChanges();\n\t\t\t$products[0]->Game = $games;\n\t\t\treturn $products[0];\n }\n catch(ADODotNETDataServicesException $e)\n {\n\t\t\t echo \"Error: \" . $e->getError() . \"<br>\" . \"Detailed Error: \" . $e->getDetailedError();\n }\n }", "public function prepareData($collection, $productIds)\n {\n foreach ($collection as &$item) {\n if ($item->getSpecialPrice()) {\n $product = $this->productRepository->get($item->getSku());\n $specialFromDate = $product->getSpecialFromDate();\n $specialToDate = $product->getSpecialToDate();\n\n if ($specialFromDate || $specialToDate) {\n $id = $product->getId();\n $this->effectiveDates[$id] = $this->getSpecialEffectiveDate($specialFromDate, $specialToDate);\n }\n }\n }\n }" ]
[ "0.7733322", "0.7470892", "0.6998848", "0.6969628", "0.6792842", "0.5643025", "0.56027704", "0.555223", "0.51989794", "0.5142331", "0.51414996", "0.51377356", "0.5066915", "0.5054238", "0.50529104", "0.5000146", "0.49731126", "0.49621835", "0.49568424", "0.49455938", "0.49293783", "0.4927947", "0.491836", "0.48786607", "0.4864831", "0.48631546", "0.48529536", "0.483512", "0.48220915", "0.48203528" ]
0.78147155
0
Specification: Publish merchant relationship prices for product concretes. Uses the given concrete product IDs. Refreshes the prices data for product concretes for all business units and merchant relationships.
public function publishConcretePriceProductByProductIds(array $productIds): void;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function publishAbstractPriceProductByByProductAbstractIds(array $productAbstractIds): void;", "public function publishConcretePriceProductPriceList(array $priceProductPriceListIds): void;", "public function publishAbstractPriceProductPriceList(array $priceProductPriceListIds): void;", "public function work($product_ids = array()) {\n $this->updateVersionsInOpenCart($product_ids);\n\n // Delete redundant references between category's and Square CATEGORYs. This step is to detect and delete any links to CATEGORYs deleted from the Square dashboard\n $this->deleteCategoryCategory();\n\n // Detect any version differences and prepare upsertion batches\n $this->insertUpdate();\n\n // Delete redundant references between category's and Square CATEGORYs\n $this->deleteCategoryCategory();\n\n // Delete redundant Square CATEGORYs\n $this->deleteCategory();\n }", "protected function _getCatalogProductPriceData($productIds = null)\n {\n $connection = $this->getConnection();\n $catalogProductIndexPriceSelect = [];\n\n foreach ($this->dimensionCollectionFactory->create() as $dimensions) {\n if (!isset($dimensions[WebsiteDimensionProvider::DIMENSION_NAME]) ||\n $this->websiteId === null ||\n $dimensions[WebsiteDimensionProvider::DIMENSION_NAME]->getValue() === $this->websiteId) {\n $select = $connection->select()->from(\n $this->tableResolver->resolve('catalog_product_index_price', $dimensions),\n ['entity_id', 'customer_group_id', 'website_id', 'min_price']\n );\n if ($productIds) {\n $select->where('entity_id IN (?)', $productIds);\n }\n $catalogProductIndexPriceSelect[] = $select;\n }\n }\n\n $catalogProductIndexPriceUnionSelect = $connection->select()->union($catalogProductIndexPriceSelect);\n\n $result = [];\n foreach ($connection->fetchAll($catalogProductIndexPriceUnionSelect) as $row) {\n $result[$row['website_id']][$row['entity_id']][$row['customer_group_id']] = round($row['min_price'], 2);\n }\n\n return $result;\n }", "public function get_prices()\n\t{\n\t\t$product_price_old = 0;\n\t\t$product_price_sale = 0;\n\t\t$price = 0;\n\t\t$eco = 0;\n\t\t$taxes = 0;\n\t\t$dataoc = isset($this->request->post['dataoc']) ? $this->request->post['dataoc'] : '';\n\n\t\tif (!empty($dataoc)) {\n\t\t\t$dataoc = str_replace('&quot;', '\"', $dataoc);\n\t\t\t$json = @json_decode($dataoc, true);\n\t\t\t$product_quantity = isset($json['quantity']) ? $json['quantity'] : 0;\n\t\t\t$product_id_oc = isset($json['product_id_oc']) ? $json['product_id_oc'] : 0;\n\t\t\tif ($product_id_oc == 0) $product_id_oc = isset($json['_product_id_oc']) ? $json['_product_id_oc'] : 0;\n\n\t\t\t// get options\n\t\t\t$options = isset($json['option_oc']) ? $json['option_oc'] : array();\n\t\t\tforeach ($options as $key => $value) {\n\t\t\t\tif ($value == null || empty($value)) unset($options[$key]);\n\t\t\t}\n\n\t\t\t// get all options of product\n\t\t\t$options_temp = $this->get_options_oc($product_id_oc);\n\n\t\t\t// Calc price for ajax\n\t\t\tforeach ($options_temp as $value) {\n\t\t\t\tforeach ($options as $k => $option_val) {\n\t\t\t\t\tif ($k == $value['product_option_id']) {\n\t\t\t\t\t\tif ($value['type'] == 'checkbox' && is_array($option_val) && count($option_val) > 0) {\n\t\t\t\t\t\t\tforeach ($option_val as $val) {\n\t\t\t\t\t\t\t\tforeach ($value['product_option_value'] as $op) {\n\t\t\t\t\t\t\t\t\t// calc price\n\t\t\t\t\t\t\t\t\tif ($val == $op['product_option_value_id']) {\n\t\t\t\t\t\t\t\t\t\tif ($op['price_prefix'] == $this->minus) $price -= isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\t\telse $price += isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif ($value['type'] == 'radio' || $value['type'] == 'select') {\n\t\t\t\t\t\t\tforeach ($value['product_option_value'] as $op) {\n\t\t\t\t\t\t\t\tif ($option_val == $op['product_option_value_id']) {\n\t\t\t\t\t\t\t\t\tif ($op['price_prefix'] == $this->minus) $price -= isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\telse $price += isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// the others have not price, so don't need calc\n\t\t\t\t\t}\n\t\t\t\t\t// if not same -> return.\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$product_prices = $this->get_product_price($product_id_oc, $product_quantity);\n\t\t\t$product_price_old = isset($product_prices['price_old']) ? $product_prices['price_old'] : 0;\n\t\t\t$product_price_sale = isset($product_prices['price_sale']) ? $product_prices['price_sale'] : 0;\n\t\t\t$enable_taxes = $this->config->get('tshirtecommerce_allow_taxes');\n\t\t\tif ($enable_taxes === null || $enable_taxes == 1) {\n\t\t\t\t$taxes = isset($product_prices['taxes']) ? $product_prices['taxes'] : 0;\n\t\t\t\t$eco = isset($product_prices['eco']) ? $product_prices['eco'] : 0;\n\t\t\t} else {\n\t\t\t\t$taxes = 0;\n\t\t\t\t$eco = 0;\n\t\t\t}\n\t\t\t\n\t\t} // do nothing when empty/blank\n\n\t\t// return price for ajax\n\t\techo @json_encode(array(\n\t\t\t'price' => $price, \n\t\t\t'price_old' => $product_price_old, \n\t\t\t'price_sale' => $product_price_sale, \n\t\t\t'taxes' => $taxes,\n\t\t\t'eco' => $eco\n\t\t));\n\t\treturn;\n\t}", "public function scalePrices($product)\n {\n \n // Get the configurable Id\n $configurableId = $this->getConfigurableId($product);\n \n // Check we actually have a configurable product\n if ($configurableId > 0)\n {\n // Get the configurable product and associated base price\n // Please note the price will not be the actual configurable, price but the cheapest price from all the simple products\n $configurableProduct = Mage::getSingleton(\"catalog/Product\")->load($configurableId);\n $configurablePrice = $configurableProduct->getPrice();\n \n // Get current attribute data\n $configurableAttributesData = $configurableProduct->getTypeInstance()->getConfigurableAttributesAsArray();\n $configurableProductsData = array();\n \n // We need to identify the attribute name and Id\n $prodAttrName = $this->getAttributeName($configurableProduct);\n $prodAttrId = $this->getAttributeId($prodAttrName);\n \n // Get associates simple products\n $associatedProducts = $configurableProduct->getTypeInstance()->getUsedProducts();\n foreach ($associatedProducts as $prodList)\n {\n // For each associated simple product gather the data and calculate the extra fixed price\n $prodId = $prodList->getId();\n $prodAttrLabel = $prodList->getAttributeText($prodAttrName);\n $prodAttrValueIndex = $prodList[$prodAttrName];\n $prodScalePrice = $prodList['price'] - $configurablePrice;\n \n $productData = array(\n 'label' => $prodAttrLabel,\n 'attribute_id' => $prodAttrId,\n 'value_index' => $prodAttrValueIndex,\n 'pricing_value' => $prodScalePrice,\n 'is_percent' => '0'\n );\n $configurableProductsData[$prodId] = $productData;\n $configurableAttributesData[0]['values'][] = $productData;\n }\n \n $configurableProduct->setConfigurableProductsData($configurableProductsData);\n $configurableProduct->setConfigurableAttributesData($configurableAttributesData);\n $configurableProduct->setCanSaveConfigurableAttributes(true);\n Mage::log($configurableProductsData, null, 'configurableProductsData.log', true);\n Mage::log($configurableAttributesData, null, 'configurableAttributesData.log', true);\n \n try\n {\n $configurableProduct->save(); \n }\n catch (Exception $e)\n {\n $this->_debug($e->getMessage());\n }\n \n } \n }", "public function updateProduct()\n {\n \t$quote=$this->getQuote();\n \tif($quote)\n \t{\n \t\t$detailproduct=$this->getProduct();\n \t\t$quoteproduct=$quote->getProduct();\n \t\tif(\n\t\t\t\t$quote->getPrice()!=$this->getPrice() or\n\t\t\t\t$quote->getDiscrate()!=$this->getDiscrate() or\n\t\t\t\t$quote->getDiscamt()!=$this->getDiscamt() or\n\t\t\t\t$quote->getProductId()!=$this->getProductId()\n\t\t\t)\n\t\t\t{\n\t\t\t\t$quote->setPrice($this->getPrice());\n\t\t\t\t$quote->setDiscrate($this->getDiscrate());\n\t\t\t\t$quote->setDiscamt($this->getDiscamt());\n\t\t\t\t$quote->setProductId($this->getProductId());\n\t\t\t\t$quote->calc(); //auto save\n\t\t\t\t$detailproduct->calcSalePrices();\n\t\t\t\t\n\t\t\t\t//if product changed, calc old product\n\t\t\t\tif($quoteproduct->getId()!=$detailproduct->getId())\n\t\t\t\t\t$quoteproduct->calcSalePrices();\n\t\t\t}\n \t}\n \telse\n \t{\n\t\t\t//if none, see if product quote by vendor with similar pricing exists. \n\t\t\t$quote=Fetcher::fetchOne(\"Quote\",array('total'=>$this->getUnittotal(),'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),'product_id'=>$this->getProductId()));\n\n\t\t\t//if it doesn't exist, create it, and product->calc()\n\t\t\tif(!$quote)\n\t\t\t{\n\t\t\t\tQuoteTable::createOne(array(\n\t\t\t\t\t'date'=>$this->getInvoice()->getDate(),\n\t\t\t\t\t'price'=>$this->getPrice(),\n\t\t\t\t\t'discrate'=>$this->getDiscrate(),\n\t\t\t\t\t'discamt'=>$this->getDiscamt(),\n\t\t\t\t\t'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),\n\t\t\t\t\t'product_id'=>$this->getProductId(),\n\t\t\t\t\t'ref_class'=>\"Invoicedetail\",\n\t\t\t\t\t'ref_id'=>$this->getId(),\n\t\t\t\t\t'mine'=>1,\n\t\t\t\t\t));\n\t\t\t\t$this->getProduct()->calcSalePrices();\n\t\t\t}\n \t}\n }", "public function processPurchaseOrder($productIds)\r\n {\r\n // process every products for PO creation\r\n foreach ($productIds as $productId) {\r\n // get the additional stock received from PO\r\n $this->Inventory->addStock($productId, 20);\r\n\r\n // update PO data after receiving\r\n $this->ProductsPurchased->updatePurchaseOrderAfterReceiving($productId);\r\n }\r\n }", "public function calculatePrices(): void\n {\n $orders = ServiceContainer::orders();\n $pizzaPrice = $orders->calculatePizzaPrice($this->items);\n $deliveryPrice = $orders->calculateDeliveryPrice($pizzaPrice, $this->outside, $this->currency);\n $this->delivery_price = $deliveryPrice;\n $this->total_price = $pizzaPrice + $deliveryPrice;\n }", "function _prepareGroupedProductPriceData($entityIds = null) {\n\t\t\t$write = $this->_getWriteAdapter( );\n\t\t\t$table = $this->getIdxTable( );\n\t\t\t$select = $write->select( )->from( array( 'e' => $this->getTable( 'catalog/product' ) ), 'entity_id' )->joinLeft( array( 'l' => $this->getTable( 'catalog/product_link' ) ), 'e.entity_id = l.product_id AND l.link_type_id=' . LINK_TYPE_GROUPED, array( ) )->join( array( 'cg' => $this->getTable( 'customer/customer_group' ) ), '', array( 'customer_group_id' ) );\n\t\t\t$this->_addWebsiteJoinToSelect( $select, true );\n\t\t\t$this->_addProductWebsiteJoinToSelect( $select, 'cw.website_id', 'e.entity_id' );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1600( )) {\n\t\t\t\t$minCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.min_price', 0 );\n\t\t\t\t$maxCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.max_price', 0 );\n\t\t\t\t$taxClassId = $this->_getReadAdapter( )->getCheckSql( 'MIN(i.tax_class_id) IS NULL', '0', 'MIN(i.tax_class_id)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(' . $minCheckSql . ')' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(' . $maxCheckSql . ')' );\n\t\t\t} \nelse {\n\t\t\t\t$taxClassId = new Zend_Db_Expr( 'IFNULL(i.tax_class_id, 0)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(IF(le.required_options = 0, i.min_price, 0))' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(IF(le.required_options = 0, i.max_price, 0))' );\n\t\t\t}\n\n\t\t\t$stockId = 'IF (i.stock_id IS NOT NULL, i.stock_id, 1)';\n\t\t\t$select->columns( 'website_id', 'cw' )->joinLeft( array( 'le' => $this->getTable( 'catalog/product' ) ), 'le.entity_id = l.linked_product_id', array( ) );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1700( )) {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'group_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t} \nelse {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t}\n\n\t\t\t$select->joinLeft( array( 'i' => $table ), '(i.entity_id = l.linked_product_id) AND (i.website_id = cw.website_id) AND ' . '(i.customer_group_id = cg.customer_group_id)', $columns );\n\t\t\t$select->group( array( 'e.entity_id', 'cg.customer_group_id', 'cw.website_id', $stockId, 'i.currency', 'i.store_id' ) )->where( 'e.type_id=?', $this->getTypeId( ) );\n\n\t\t\tif (!is_null( $entityIds )) {\n\t\t\t\t$select->where( 'l.product_id IN(?)', $entityIds );\n\t\t\t}\n\n\t\t\t$eventData = array( 'select' => $select, 'entity_field' => new Zend_Db_Expr( 'e.entity_id' ), 'website_field' => new Zend_Db_Expr( 'cw.website_id' ), 'stock_field' => new Zend_Db_Expr( $stockId ), 'currency_field' => new Zend_Db_Expr( 'i.currency' ), 'store_field' => new Zend_Db_Expr( 'cs.store_id' ) );\n\n\t\t\tif (!$this->getWarehouseHelper( )->getConfig( )->isMultipleMode( )) {\n\t\t\t\t$eventData['stock_field'] = new Zend_Db_Expr( 'i.stock_id' );\n\t\t\t}\n\n\t\t\tMage::dispatchEvent( 'catalog_product_prepare_index_select', $eventData );\n\t\t\t$query = $select->insertFromSelect( $table );\n\t\t\t$write->query( $query );\n\t\t\treturn $this;\n\t\t}", "public static function getPrice(&$products_table = NULL, $uid = NULL) {\n Yii::import('application.controllers.ProfileController');\n\n if (!$products_table) { //if it's cart products table\n $table = 'store_cart';\n } else {\n $table = 'temp_order_product_' . (Yii::app()->user->id ? Yii::app()->user->id : 'exchange');\n $query = \"DROP TABLE IF EXISTS {$table};\";\n $query .= \"CREATE TEMPORARY TABLE {$table} (product_id int(11) unsigned, quantity smallint(5) unsigned);\";\n foreach ($products_table as $item) {\n\n if ($item instanceof OrderProduct || $item instanceof stdClass || $item instanceof Cart) {\n $product = Product::model()->findByAttributes(array('id' => (string) $item->product_id));\n } else {\n $product = Product::model()->findByAttributes(array('code' => (string) $item->code));\n }\n\n if ($product) {\n $query .= \"INSERT INTO {$table} VALUES ({$product->id}, {$item->quantity});\";\n } else {\n throw new Exception('Product not found. Product code: ' . $item->code);\n }\n }\n Yii::app()->db->createCommand($query)->execute();\n }\n $query = Yii::app()->db->createCommand()\n ->select('SUM(c.quantity*round(prices.price*(1-greatest(ifnull(disc.percent,0),ifnull(disc1.percent,0),ifnull(disc2.percent,0))/100))) as c_summ, prices.price_id')\n ->from($table . ' c')\n ->join('store_product product', 'c.product_id=product.id')\n ->join('store_product_price prices', 'product.id=prices.product_id')\n ->join('store_price price', 'price.id=prices.price_id')\n ->leftJoin('store_discount disc', \"disc.product_id=0 and disc.actual=1 and (disc.begin_date='0000-00-00' or disc.begin_date<=CURDATE()) and (disc.end_date='0000-00-00' or disc.end_date>=CURDATE())\")\n ->leftJoin('store_product_category cat', 'cat.product_id=product.id')\n ->leftJoin('store_discount_category discat', 'discat.category_id=cat.category_id')\n ->leftJoin('store_discount disc1', \"disc1.product_id=1 and disc1.id=discat.discount_id and disc1.actual=1 and (disc1.begin_date='0000-00-00' or disc1.begin_date<=CURDATE()) and (disc1.end_date='0000-00-00' or disc1.end_date>=CURDATE())\")\n ->leftJoin('store_discount_product dispro', 'dispro.product_id=product.id')\n ->leftJoin('store_discount disc2', \"disc2.product_id=2 and disc2.id=dispro.discount_id and disc2.actual=1 and (disc2.begin_date='0000-00-00' or disc2.begin_date<=CURDATE()) and (disc2.end_date='0000-00-00' or disc2.end_date>=CURDATE())\")\n ->order('price.summ DESC')\n ->group('prices.price_id, price.summ')\n ->having('c_summ>price.summ');\n\n if (!$products_table){\n $sid = ProfileController::getSession();\n $query->where(\"(session_id=:sid AND :sid<>'') OR (user_id=:uid AND :sid<>'')\", array(\n ':sid' => $sid,\n ':uid' => Yii::app()->user->isGuest ? '' : Yii::app()->user->id,\n ));\n }\n\n// $text = $query->getText();\n $row = $query->queryRow();\n if ($row)\n $price = self::model()->findByPk($row['price_id']);\n else\n $price = self::model()->find(array('order' => 'summ'));\n\n if ($products_table)\n Yii::app()->db->createCommand(\"DROP TABLE IF EXISTS {$table};\")->execute();\n\n if ($uid)\n $profile = CustomerProfile::model()->with('price')->findByAttributes(array('user_id' => $uid));\n else\n $profile = ProfileController::getProfile();\n\n if ($profile && $profile->price_id && $profile->price->summ > $price->summ)\n return $profile->price;\n else\n return $price;\n }", "public function calc_price_with_ro($product_price, $ro_combs, $special=0, $stock=false, $ro_price_modificator=0, $quantity=false) {\n \t\t\n\t\t$ro_settings = $this->config->get('related_options');\n\t\t$lp_settings = $this->getLivePriceSettings();\n\t\t\n\t\t$ro_price = $product_price;\n\t\t$ro_discount_addition_total = 0;\n\t\t$ro_special_addition_total = 0;\n\t\t/*\n\t\tif ( !empty($ro_settings['spec_price']) ) {\n\t\t\t$ro_price = $product_price;\n\t\t} else {\n\t\t\t$ro_price = false;\n\t\t}\n\t\t*/\n\t\t$in_stock = null;\n\t\t\n\t\tif ($this->installed()) {\n\t\t\t\n\t\t\tforeach ($ro_combs as $ro_comb) {\n\t\t\t\t\n\t\t\t\tif ( !empty($ro_settings['spec_price']) ) {\n\t\t\t\t\t\n\t\t\t\t\t//if (isset($ro_comb['price']) && $ro_comb['price']!=0) {\n\t\t\t\t\t\t// \"+\" may has effect even without price (by discounts)\n\t\t\t\t\t\tif (isset($ro_settings['spec_price_prefix']) && $ro_settings['spec_price_prefix'] && ($ro_comb['price_prefix'] == '+' || $ro_comb['price_prefix'] == '-') ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$ro_price_addition = $ro_comb['price'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( $ro_comb['price_prefix'] == '-' ) {\n\t\t\t\t\t\t\t\t$ro_price_addition = -$ro_price_addition;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!empty($ro_price_addition)) {\n\t\t\t\t\t\t\t\t//$ro_price+= $ro_price_addition;\n\t\t\t\t\t\t\t\t$ro_price_modificator+= $ro_price_addition;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( !empty($lp_settings['ropro_discounts_addition']) ) {\n\t\t\t\t\t\t\t\tif ( $ro_comb['price_prefix'] == '+' ) {\n\t\t\t\t\t\t\t\t\t$ro_discount_addition_total+= $this->calc_price_with_ro_get_discount($ro_comb, $quantity);\n\t\t\t\t\t\t\t\t} else { // -\n\t\t\t\t\t\t\t\t\t$ro_discount_addition_total-= $this->calc_price_with_ro_get_discount($ro_comb, $quantity);\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\tif ( !empty($lp_settings['ropro_specials_addition']) && $ro_comb['specials'] && $ro_comb['specials'][0] ) {\n\t\t\t\t\t\t\t\t$ro_special_row = $ro_comb['specials'][0];\n\t\t\t\t\t\t\t\tif ( $ro_comb['price_prefix'] == '+' ) {\n\t\t\t\t\t\t\t\t\t$ro_special_addition_total+= $ro_special_row['price'];\n\t\t\t\t\t\t\t\t} else { // -\n\t\t\t\t\t\t\t\t\t$ro_special_addition_total-= $ro_special_row['price'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t} elseif ( !empty($ro_comb['price']) && (float)$ro_comb['price'] ) {\n\t\t\t\t\t\t\t$ro_price = $ro_comb['price'];\n\t\t\t\t\t\t}\n\t\t\t\t\t//}\n\t\t\t\t\t\n\t\t\t\t\tif (isset($ro_comb['current_customer_group_special_price']) && $ro_comb['current_customer_group_special_price']) {\n\t\t\t\t\t\t$special = $ro_comb['current_customer_group_special_price'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( !empty($ro_settings['spec_ofs']) ) {\n\t\t\t\t\t$stock = $ro_comb['stock'];\n\t\t\t\t} elseif ( $this->config->get('config_stock_display') ) {\n\t\t\t\t\t$stock = (int)$ro_comb['quantity'];\n\t\t\t\t} else {\n\t\t\t\t\t$stock = false;\n\t\t\t\t}\n\t\t\t\t$in_stock = $ro_comb['in_stock'];\n\t\t\t}\n\t\t\t$ro_price+= $ro_price_modificator; // apply + and - modifiers at the last step (after = )\n\t\t}\n\t\treturn array('price'=>$ro_price,\n\t\t\t\t\t\t\t\t 'special'=>$special,\n\t\t\t\t\t\t\t\t 'stock'=>$stock,\n\t\t\t\t\t\t\t\t 'in_stock'=>$in_stock,\n\t\t\t\t\t\t\t\t 'price_modificator'=>$ro_price_modificator,\n\t\t\t\t\t\t\t\t 'discount_addition'=>$ro_discount_addition_total,\n\t\t\t\t\t\t\t\t 'special_addition'=>$ro_special_addition_total,\n\t\t\t\t\t\t\t\t );\n\t\t\n\t}", "public function publishConcretePriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function addProductSyncData(&$products)\n {\n $product_ids = [];\n $parent_ids = [];\n $product_stock_ids = []; //modification in config product stock management\n foreach ($products as $product) {\n $product_ids[] = $product['product_id'];\n $product_stock_ids[$product['product_id']] = $product['parent_id'];\n if ((int)$product['parent_id'] !== 0) {\n $product_ids[] = $product['parent_id'];\n $parent_ids[] = $product['parent_id'];\n $product_stock_ids[$product['parent_id']] = $product['parent_id'];\n }\n }\n $product_ids = array_unique($product_ids);\n $parent_ids = array_unique($parent_ids);\n try {\n $store = $this->_storeModelStoreManagerInterface->getStore();\n $website = $store->getWebsite();\n } catch (NoSuchEntityException $exception) {\n $this->_searchHelperData->log(\n LoggerConstants::ZEND_LOG_ERR,\n sprintf('Website Could not be loaded: %s', $exception->getMessage())\n );\n\n return $this;\n }\n\n $this->stockService->clearCache();\n $this->stockService->preloadKlevuStockStatus(array_merge($product_ids, $parent_ids), $website->getId());\n\n $isCollectionMethod = $this->_searchHelperConfig->isCollectionMethodEnabled();\n\n if ($isCollectionMethod) {\n $data = $this->loadProductDataCollection($product_ids);\n }\n\n // Get url product from database\n $url_rewrite_data = $this->getUrlRewriteData($product_ids);\n $attribute_map = $this->getAttributeMap();\n $baseUrl = $this->_productData->getBaseUrl($store);\n $currency = $this->_productData->getCurrency();\n try {\n $store->setCurrentCurrencyCode($currency);\n } catch (LocalizedException $e) {\n $this->_searchHelperData->log(\n LoggerConstants::ZEND_LOG_ERR,\n sprintf('Currency could not be set on store: %s', $e->getMessage())\n );\n\n return $this;\n }\n $rejectedProducts = [];\n $rp = 0;\n\n foreach ($products as $index => &$product) {\n try {\n if ($isCollectionMethod) {\n $item = $data->getItemById($product['product_id']);\n $parent = ((int)$product['parent_id'] !== 0) ? $data->getItemById($product['parent_id']) : null;\n $this->logLoadByMessage($product, true);\n } else {\n $origItem = $this->productRepository->getById(\n $product['product_id'],\n false,\n $store->getId()\n );\n $item = clone $origItem;\n $item->setData('customer_group_id', CustomerGroup::NOT_LOGGED_IN_ID);\n $parent = null;\n if ((int)$product['parent_id'] !== 0) {\n $origParent = $this->productRepository->getById(\n $product['parent_id'],\n false,\n $store->getId()\n );\n $parent = clone $origParent;\n $parent->setData('customer_group_id', CustomerGroup::NOT_LOGGED_IN_ID);\n }\n $this->logLoadByMessage($product);\n }\n\n if (!$item) {\n // Product data query did not return any data for this product\n // Remove it from the list to skip syncing it\n $rejectedProducts[$rp]['product_id'] = $product['product_id'];\n $rejectedProducts[$rp]['parent_id'] = $product['parent_id'];\n $this->_searchHelperData->log(\n LoggerConstants::ZEND_LOG_WARN,\n sprintf(\"Failed to retrieve data for product ID %d\", $product['product_id'])\n );\n unset($products[$index]);\n $rp++;\n continue;\n }\n if ((!isset($parent)) && isset($product['parent_id']) && (int)$product['parent_id'] !== 0) {\n $rejectedProducts[$rp]['product_id'] = $product['product_id'];\n $rejectedProducts[$rp]['parent_id'] = $product['parent_id'];\n $this->_searchHelperData->log(\n LoggerConstants::ZEND_LOG_WARN,\n sprintf(\"Failed to retrieve data for parent ID %d\", $product['parent_id'])\n );\n unset($products[$index]);\n $rp++;\n continue;\n }\n\n $this->processProductBefore($product, $parent, $item);\n // Add data from mapped attributes\n foreach ($attribute_map as $key => $attributes) {\n $product = $this->mapProductAttributes($item, $store, $product, $attributes, $key, $parent);\n }\n\n $product['product_type'] = $this->_productData->getProductType($parent, $item);\n $product['isCustomOptionsAvailable'] = $this->_productData->isCustomOptionsAvailable($parent, $item);\n $product['currency'] = $currency;\n $product['otherPrices'] = $this->_productData->getOtherPrices($item, $currency, $store);\n $product['category'] = $this->_productData->getCategory($parent, $item);\n $product['listCategory'] = $this->_productData->getListCategory($parent, $item);\n $product['categoryIds'] = $this->_productData->getAllCategoryId($parent, $item);\n $product['categoryPaths'] = $this->_productData->getAllCategoryPaths($parent, $item);\n $product['groupPrices'] = $this->_productData->getGroupPricesData($item, $store);\n $product['url'] = $this->_productData->getProductUrlData(\n $parent,\n $item,\n $url_rewrite_data,\n $product,\n $baseUrl\n );\n $product['inStock'] = $this->_stockHelper->getKlevuStockStatus($parent, $item, $website->getId());\n $product['itemGroupId'] = $this->_productData->getItemGroupId($product['parent_id'], $product) ?: '';\n if ((int)$product['itemGroupId'] === 0) {\n $product['itemGroupId'] = ''; // Ref: KS-15006\n }\n $product['id'] = $this->_productData->getId($product['product_id'], $product['parent_id']);\n $this->processProductAfter($product, $parent, $item);\n if ($item) {\n if (!$isCollectionMethod) {\n $item->clearInstance();\n }\n $item = null;\n }\n if ($parent) {\n if (!$isCollectionMethod) {\n $parent->clearInstance();\n }\n $parent = null;\n }\n } catch (\\Exception $e) {\n $this->_searchHelperData->log(\n LoggerConstants::ZEND_LOG_CRIT,\n sprintf(\"Exception thrown in %s::%s - %s\", __CLASS__, __METHOD__, $e->getMessage())\n );\n $markAsSync = [];\n if (!empty($product['parent_id']) && !empty($product['product_id'])) {\n $markAsSync[] = [\n $product['product_id'],\n $product['parent_id'],\n $store->getId(),\n 0,\n $this->_searchHelperCompat->now(),\n \"products\"\n ];\n $write = $this->_frameworkModelResource->getConnection(\"core_write\");\n $query = \"replace into \" . $this->_frameworkModelResource->getTableName('klevu_product_sync')\n . \"(product_id, parent_id, store_id, last_synced_at, type,error_flag) values \"\n . \"(:product_id, :parent_id, :store_id, :last_synced_at, :type,:error_flag)\";\n $binds = [\n 'product_id' => $markAsSync[0][0],\n 'parent_id' => $markAsSync[0][1],\n 'store_id' => $markAsSync[0][2],\n 'last_synced_at' => $markAsSync[0][4],\n 'type' => $markAsSync[0][5],\n 'error_flag' => 1\n ];\n $write->query($query, $binds);\n }\n continue;\n }\n unset($product['product_id'], $product['parent_id']);\n }\n\n if (count($rejectedProducts) > 0) {\n // Can not be injected via construct due to circular dependency\n $magentoProductActions = ObjectManager::getInstance()->get(MagentoProductActionsInterface::class);\n if (!$this->_searchHelperConfig->displayOutofstock()) {\n $rejectedProducts_data = [];\n $r = 0;\n foreach ($rejectedProducts as $rvalue) {\n $idData = $this->checkIdexitsInDb(\n $store->getId(),\n $rvalue[\"product_id\"],\n $rvalue[\"parent_id\"]\n );\n $ids = $idData->getData();\n if (count($ids) > 0) {\n $rejectedProducts_data[$r][\"product_id\"] = $rvalue[\"product_id\"];\n $rejectedProducts_data[$r][\"parent_id\"] = $rvalue[\"parent_id\"];\n $r++;\n }\n }\n $this->_searchHelperData->log(\n LoggerConstants::ZEND_LOG_WARN,\n sprintf(\n \"Because of indexing issue or invalid data we cannot synchronize product IDs %s\",\n implode(\n ',',\n array_map(\n static function ($el) {\n return $el['product_id'];\n },\n $rejectedProducts_data\n )\n )\n )\n );\n $magentoProductActions->deleteProducts($rejectedProducts_data);\n } else {\n $this->_searchHelperData->log(\n LoggerConstants::ZEND_LOG_WARN,\n sprintf(\n \"Because of indexing issue or invalid data we cannot synchronize product IDs %s\",\n implode(\n ',',\n array_map(\n static function ($el) {\n return $el['product_id'];\n },\n $rejectedProducts\n )\n )\n )\n );\n $magentoProductActions->deleteProducts($rejectedProducts);\n }\n }\n\n return $this;\n }", "protected function calculatePrices()\n {\n }", "private function setRecountProduct() {\n\n //$this->model->setDocumentNumber($this->getDocumentNumber);\n $sql = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n INSERT INTO `productrecount` \n (\n `companyId`,\n `warehouseId`,\n `productCode`,\n `productDescription`,\n `productRecountDate`,\n `productRecountSystemQuantity`,\n `productRecountPhysicalQuantity`,\n `isDefault`,\n `isNew`,\n `isDraft`,\n `isUpdate`,\n `isDelete`,\n `isActive`,\n `isApproved`,\n `isReview`,\n `isPost`,\n `executeBy`,\n `executeTime`\n ) VALUES ( \n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n } else {\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n INSERT INTO [productRecount]\n (\n [productRecountId],\n [companyId],\n [warehouseId],\n [productCode],\n [productDescription],\n [productRecountDate],\n [productRecountSystemQuantity],\n [productRecountPhysicalQuantity],\n [isDefault],\n [isNew],\n [isDraft],\n [isUpdate],\n [isDelete],\n [isActive],\n [isApproved],\n [isReview],\n [isPost],\n [executeBy],\n [executeTime]\n) VALUES (\n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n } else {\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n INSERT INTO PRODUCTRECOUNT\n (\n COMPANYID,\n WAREHOUSEID,\n PRODUCTCODE,\n PRODUCTDESCRIPTION,\n PRODUCTRECOUNTDATE,\n PRODUCTRECOUNTSYSTEMQUANTITY,\n PRODUCTRECOUNTPHYSICALQUANTITY,\n ISDEFAULT,\n ISNEW,\n ISDRAFT,\n ISUPDATE,\n ISDELETE,\n ISACTIVE,\n ISAPPROVED,\n ISREVIEW,\n ISPOST,\n EXECUTEBY,\n EXECUTETIME\n ) VALUES (\n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n }\n }\n }\n try {\n $this->q->create($sql);\n } catch (\\Exception $e) {\n $this->q->rollback();\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n }", "public function test_comicEntityIsCreated_prices_setPrices()\n {\n $sut = $this->getSUT();\n $prices = $sut->getPrices();\n $expected = [\n Price::create(\n 'printPrice',\n 19.99\n ),\n ];\n\n $this->assertEquals($expected, $prices);\n }", "public function relatedProductsAction()\n {\n $productId = Mage::app()->getRequest()->getParam('productId');\n $relatedProducts = [];\n\n if ($productId != null) {\n $product = Mage::getModel('catalog/product')->load($productId);\n $relatedProductsId = $product->getRelatedProductIds();\n foreach ($relatedProductsId as $relatedProductId) {\n $relatedProducts[] = Mage::getModel('catalog/product')->load($relatedProductId)->getData();\n }\n }\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($relatedProducts));\n $this->getResponse()->setHeader('Content-type', 'application/json');\n }", "public function loadPriceData($storeId, $productIds)\r\n {\r\n $websiteId = $this->getStore($storeId)->getWebsiteId();\r\n\r\n // check if entities data exist in price index table\r\n $select = $this->getConnection()->select()\r\n ->from(['p' => $this->getTable('catalog_product_index_price')])\r\n ->where('p.customer_group_id = ?', 0) // for all customers\r\n ->where('p.website_id = ?', $websiteId)\r\n ->where('p.entity_id IN (?)', $productIds);\r\n\r\n $result = $this->getConnection()->fetchAll($select);\r\n\t\t\r\n\t\treturn $result;\r\n\r\n if ($this->limiter > 3) {\r\n return $result;\r\n }\r\n\r\n // new added product prices may not be populated into price index table in some reason,\r\n // try to force reindex for unprocessed entities\r\n $processedIds = [];\r\n foreach ($result as $priceData) {\r\n $processedIds[] = $priceData['entity_id'];\r\n }\r\n $diffIds = array_diff($productIds, $processedIds);\r\n if (!empty($diffIds)) {\r\n $this->getPriceIndexer()->executeList($diffIds);\r\n $this->limiter += 1;\r\n $this->loadPriceData($storeId, $productIds);\r\n }\r\n\r\n return $result;\r\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function setProductIds(array $product_ids): self\n {\n $this->product_ids = $product_ids;\n return $this;\n }", "public function testAddRelatedUpSellCrossSellProducts(): void\n {\n $postData = $this->getPostData();\n $this->getRequest()->setMethod(HttpRequest::METHOD_POST);\n $this->getRequest()->setPostValue($postData);\n $this->dispatch('backend/catalog/product/save');\n $this->assertSessionMessages(\n $this->equalTo(['You saved the product.']),\n MessageInterface::TYPE_SUCCESS\n );\n $product = $this->productRepository->get('simple');\n $this->assertEquals(\n $this->getExpectedLinks($postData['links']),\n $this->getActualLinks($product),\n \"Expected linked products do not match actual linked products!\"\n );\n }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "public function saveProductRelations($product)\n {\n parent::saveProductRelations($product);\n\n $data = $product->getCustomOneLinkData();\n if (!is_null($data)) {\n $this->_getResource()->saveProductLinks($product, $data, self::LINK_TYPE_CUSTOMONE);\n }\n\n $data = $product->getCustomTwoLinkData();\n if (!is_null($data)) {\n $this->_getResource()->saveProductLinks($product, $data, self::LINK_TYPE_CUSTOMTWO);\n }\n }", "function _update_product_mrp($prods)\r\n\t{\r\n\t\t$user = $this->erpm->auth();\r\n\t\t$c=0;\r\n\t\tforeach($prods as $i=>$pdet_arr)\r\n\t\t{\r\n\t\t\t\t$pid = $pdet_arr['product_id']; \r\n\t\t\t\t$mrp= $pdet_arr['mrp']; \r\n\t\t\t\tif(empty($mrp))\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t$c++;\r\n\t\t\t\t$pc_prod=$this->db->query(\"select * from m_product_info where product_id=? and mrp!=?\",array($pid,$mrp))->row_array();\r\n\t\t\t\tif(!empty($pc_prod))\r\n\t\t\t\t{\r\n\t\t\t\t\t$inp=array(\"product_id\"=>$pid,\"new_mrp\"=>$mrp,\"old_mrp\"=>$pc_prod['mrp'],\"reference_grn\"=>0,\"created_by\"=>$user['userid'],\"created_on\"=>time());\r\n\t\t\t\t\t$this->db->insert(\"product_price_changelog\",$inp);\r\n\t\t\t\t\t$this->db->query(\"update m_product_info set mrp=? where product_id=? limit 1\",array($mrp,$pid));\r\n\t\t\t\t\tforeach($this->db->query(\"select product_id from products_group_pids where group_id in (select group_id from products_group_pids where product_id=$pid) and product_id!=$pid\")->result_array() as $pg)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$inp=array(\"product_id\"=>$pg['product_id'],\"new_mrp\"=>$mrp,\"old_mrp\"=>$this->db->query(\"select mrp from m_product_info where product_id=?\",$pg['product_id'])->row()->mrp,\"reference_grn\"=>0,\"created_by\"=>$user['userid'],\"created_on\"=>time());\r\n\t\t\t\t\t\t$this->db->insert(\"product_price_changelog\",$inp);\r\n\t\t\t\t\t\t$this->db->query(\"update m_product_info set mrp=? where product_id=? limit 1\",array($mrp,$pg['product_id']));\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$r_itemids=$this->db->query(\"select itemid from m_product_deal_link where product_id=?\",$pid)->result_array();\r\n\t\t\t\t\t$r_itemids2=$this->db->query(\"select l.itemid from products_group_pids p join m_product_group_deal_link l on l.group_id=p.group_id where p.product_id=?\",$pid)->result_array();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$r_itemids_arr = array();\r\n\t\t\t\t\t\tif($r_itemids)\r\n\t\t\t\t\t\t\tforeach($r_itemids as $r_item_det)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(!isset($r_itemids_arr[$r_item_det['itemid']]))\r\n\t\t\t\t\t\t\t\t\t$r_itemids_arr[$r_item_det['itemid']] = array();\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$r_itemids_arr[$r_item_det['itemid']] = $r_item_det; \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif($r_itemids2)\r\n\t\t\t\t\t\t\tforeach($r_itemids2 as $r_item_det)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(!isset($r_itemids_arr[$r_item_det['itemid']]))\r\n\t\t\t\t\t\t\t\t\t$r_itemids_arr[$r_item_det['itemid']] = array();\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$r_itemids_arr[$r_item_det['itemid']] = $r_item_det; \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//$r_itemids=array_unique(array_merge($r_itemids,$r_itemids2));\r\n\t\t\t\t\t\t$r_itemids = array_values($r_itemids_arr);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach($r_itemids as $d)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$itemid=$d['itemid'];\r\n\t\t\t\t\t\t$item=$this->db->query(\"select orgprice,price from king_dealitems where id=?\",$itemid)->row_array();\r\n\t\t\t\t\t\t$o_price=$item['price'];$o_mrp=$item['orgprice'];\r\n\t\t\t\t\t\t$n_mrp=$this->db->query(\"select ifnull(sum(p.mrp*l.qty),0) as mrp from m_product_deal_link l join m_product_info p on p.product_id=l.product_id where l.itemid=?\",$itemid)->row()->mrp+$this->db->query(\"select ifnull(sum((select avg(mrp) from m_product_group_deal_link l join products_group_pids pg on pg.group_id=l.group_id join m_product_info p on p.product_id=pg.product_id where l.itemid=$itemid)*(select qty from m_product_group_deal_link where itemid=$itemid)),0) as mrp\")->row()->mrp;\r\n\t\t\t\t\t\t$n_price=$item['price']/$o_mrp*$n_mrp;\r\n\t\t\t\t\t\t$inp=array(\"itemid\"=>$itemid,\"old_mrp\"=>$o_mrp,\"new_mrp\"=>$n_mrp,\"old_price\"=>$o_price,\"new_price\"=>$n_price,\"created_by\"=>$user['userid'],\"created_on\"=>time(),\"reference_grn\"=>0);\r\n\t\t\t\t\t\t$r=$this->db->insert(\"deal_price_changelog\",$inp);\r\n\t\t\t\t\t\t$this->db->query(\"update king_dealitems set orgprice=?,price=? where id=? limit 1\",array($n_mrp,$n_price,$itemid));\r\n\t\t\t\t\t\tif($this->db->query(\"select is_pnh as b from king_dealitems where id=?\",$itemid)->row()->b)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$o_s_price=$this->db->query(\"select store_price from king_dealitems where id=?\",$itemid)->row()->store_price;\r\n\t\t\t\t\t\t\t$n_s_price=$o_s_price/$o_mrp*$n_mrp;\r\n\t\t\t\t\t\t\t$this->db->query(\"update king_dealitems set store_price=? where id=? limit 1\",array($n_s_price,$itemid));\r\n\t\t\t\t\t\t\t$o_n_price=$this->db->query(\"select nyp_price as p from king_dealitems where id=?\",$itemid)->row()->p;\r\n\t\t\t\t\t\t\t$n_n_price=$o_n_price/$o_mrp*$n_mrp;\r\n\t\t\t\t\t\t\t$this->db->query(\"update king_dealitems set nyp_price=? where id=? limit 1\",array($n_n_price,$itemid));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tforeach($this->db->query(\"select * from partner_deal_prices where itemid=?\",$itemid)->result_array() as $r)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$o_c_price=$r['customer_price'];\r\n\t\t\t\t\t\t\t$n_c_price=$o_c_price/$o_mrp*$n_mrp;\r\n\t\t\t\t\t\t\t$o_p_price=$r['partner_price'];\r\n\t\t\t\t\t\t\t$n_p_price=$o_p_price/$o_mrp*$n_mrp;\r\n\t\t\t\t\t\t\t$this->db->query(\"update partner_deal_prices set customer_price=?,partner_price=? where itemid=? and partner_id=?\",array($n_c_price,$n_p_price,$itemid,$r['partner_id']));\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}\r\n\t\treturn $c;\r\n\t}", "public function publishAbstractPriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function testProductGetPrices()\n {\n $product = $this->find('product', 1);\n $prices = $product->getPrices();\n $price = $prices[0];\n \n $currencies = $this->findAll('currency');\n $dollarCurrency = $currencies[0];\n \n $money = Money::create(10, $dollarCurrency); \n \n $this->assertEquals(\n $money,\n $price\n );\n }", "private function sync_products($erply_category_id, $oc_category_id)\n\t{\n\t\t$this->debug(\"@sync_products creating products for category with id \" . $oc_category_id);\n\n\t\t$offset = 0;\n\t\t$erply_products = array();\n\n\t\t$erply_response = $this->ErplyClient->get_products($offset, 100, 1, 1, null, $erply_category_id);\n\n\t\tif ($erply_response['status']['responseStatus'] == 'error') {\n\t\t\tthrow new Exception(\"Error in Erply response\");\n\t\t}\n\n\t\t$erply_products = $erply_response['records'];\n\n\t\twhile ($offset < $erply_response['status']['recordsTotal']) {\n\t\t\t$offset += 100;\n\t\t\t$erply_response = $this->ErplyClient->get_products($offset, 100, 1, 1, null, $erply_category_id);\n\n\t\t\tif ($erply_response['status']['responseStatus'] == 'error') {\n\t\t\t\tthrow new Exception(\"Error in Erply response\");\n\t\t\t}\n\n\t\t\t$erply_products = array_merge($erply_products, $erply_response['records']);\n\t\t}\n\n\t\tforeach ($erply_products as $erply_product) {\n\t\t\t$this->sync_product($erply_product, $oc_category_id);\n\t\t}\n\n\t\treturn sizeof($erply_products);\n\t}", "public function getRelatedProductsByChart()\r\n {\r\n $chartId = $this->getChart()->getId();\r\n return $this->getChart()->getRelatedProductsByChart($chartId);\r\n }" ]
[ "0.6069264", "0.6034877", "0.57542175", "0.5383104", "0.5334785", "0.5250433", "0.51425743", "0.51398647", "0.51082295", "0.50999063", "0.50550056", "0.5009452", "0.49751654", "0.49522376", "0.4896038", "0.4885717", "0.4868063", "0.48626703", "0.4854262", "0.48180994", "0.48080987", "0.47924674", "0.47697985", "0.47568604", "0.47328085", "0.47281307", "0.47124562", "0.47101015", "0.47080424", "0.47049758" ]
0.69700253
0
Specification: Publish price list prices for products. Uses the given IDs of the `fos_price_product_price_list` table. Merges created or updated prices to the existing ones.
public function publishConcretePriceProductPriceList(array $priceProductPriceListIds): void;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function publishAbstractPriceProductPriceList(array $priceProductPriceListIds): void;", "public function publishAbstractPriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function publishConcretePriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function publishConcretePriceProductByProductIds(array $productIds): void;", "public function updatePrices($contractId, $priceList);", "public function updateprices()\n {\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"updateval\");\n if (is_array($aParams)) {\n foreach ($aParams as $soxId => $aStockParams) {\n $this->addprice($soxId, $aStockParams);\n }\n }\n }", "protected function putProductsVariantsPricelistPriceRequest($body, $product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling putProductsVariantsPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\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($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 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 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function api_update_price(){\n $watchlists = $this->wr->all();\n foreach($watchlists as $watchlist)\n {\n $current_price = $this->get_quotes($watchlist->id);\n\n $this->wr->update([\n 'current_price' => $current_price,\n ],$watchlist->id);\n }\n }", "protected function patchProductsVariantsPricelistPriceRequest($body, $product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling patchProductsVariantsPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\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($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 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 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function updateAmazonProductsPrices($items)\n{\n\tif (sizeof($items) > 0) {\n\t\t$data['lastmod'] = time();\n\t\t$data['lastmod_user'] = getAmazonSessionUserId();\n\t\t$data['lastpriceupdate'] = time();\n\t\t$data['submitedProduct'] = 0;\n\t\t$data['submitedPrice'] = 0;\n\t\t$data['upload'] = 1;\n\t\t$caseStandardPrice = \"StandardPrice = CASE\";\n\t\tforeach($items as $key => $item)\n\t\t{\n\t\t\t$caseStandardPrice.= \"\\n WHEN id_product = \" . $items[$key]['id_product'] . \" THEN \" . $items[$key]['price'];\n\t\t\t$productsIds[] = $items[$key]['id_product'];\n\t\t}\n\t\t$caseStandardPrice.= \"\n\t\t\tEND\n\t\t\tWHERE id_product IN (\" . implode(\", \", $productsIds) . \")\n\t\t\";\n\t\t$addWhere\t = $caseStandardPrice;\n\t\tSQLUpdate('amazon_products', $data, $addWhere, 'shop', __FILE__, __LINE__);\n\t}\n}", "public function syncProductList()\n {\n // Evaluation only needed for custom product list and product tag\n if (!$this->isCustomList() && !$this->model_type !== ProductTag::class) return;\n\n $product_ids = $this->isCustomList() ? $this->product_ids : $this->getProductQuery()->get('id')->pluck('id')->all();\n\n $this->products()->sync($product_ids);\n }", "public function run()\n {\n $prices = [\n [\n 'product_id' => 2,\n 'user_id' => 3,\n 'price' => 18,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 3,\n 'user_id' => 3,\n 'price' => 15,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 2,\n 'user_id' => 4,\n 'price' => 18,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 3,\n 'user_id' => 4,\n 'price' => 15,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n ];\n ProductPrice::query()->insert($prices);\n }", "public function get_prices($ids)\n\t{\n\t\t$data = '';\n\n\t\t// create comma sepearted lists\n\t\t$items = '';\n\t\tforeach ($ids as $id) {\n\t\t\tif ($items != '') {\n\t\t\t\t$items .= ',';\n\t\t\t}\n\t\t\t$items .= $id;\n\t\t}\n\n\t\t// get multiple product info based on list of ids\n\t\tif($result = $this->Database->query(\"SELECT id, price FROM $this->db_table WHERE id IN ($items) ORDER BY name\" ))\n\t\t{\n\t\t\tif($result->num_rows > 0)\n\t\t\t{\n\t\t\t\twhile($row = $result->fetch_array())\n\t\t\t\t{\n\t\t\t\t\t$data[] = array(\n\t\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t\t'price' => $row['price']\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\n\t}", "protected function saveUpdateProducts()\r\n\t{\r\n\t\tif (count($this->newProducts) > 0) {\r\n\t\t\t// inserir as novas\r\n\t\t\tforeach ($this->newProducts as $product) {\r\n\t\t\t\t$result = $this->client->catalogProductUpdate($this->sessionid, $product->sku, $product);\r\n\t\t\t\t$this->log->addInfo('updated', array(\"sku\" => $product->sku, \"result\" => $result));\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->newProducts = array();\r\n\t}", "public function addProductIDs($productIDs)\n {\n $parameters = $this->request->getParameters();\n $parameters->add('id', $productIDs);\n $this->recommendationsUpToDate = false;\n }", "public function execute($ids = [])\n {\n /**\n * @var $idCollection \\Bazaarvoice\\Connector\\Model\\ResourceModel\\Index\\Collection \n */\n\n if (!$this->canIndex()) {\n return false;\n }\n try {\n $this->logger->debug('Partial Product Feed Index');\n\n if (empty($ids)) {\n $idCollection = $this->bvIndexCollectionFactory->create()->addFieldToFilter('version_id', 0);\n $idCollection->getSelect()->group('product_id');\n $idCollection->addFieldToSelect('product_id');\n $ids = $idCollection->getColumnValues('product_id');\n }\n\n $this->logger->debug('Found '.count($ids).' products to update.');\n\n /**\n * Break ids into pages \n */\n $productIdSets = array_chunk($ids, 50);\n\n /**\n * Time throttling \n */\n $limit = ($this->configProvider->getCronjobDurationLimit() * 60) - 10;\n $stop = time() + $limit;\n $counter = 0;\n do {\n if (time() > $stop) {\n break;\n }\n\n $productIds = array_pop($productIdSets);\n if (!is_array($productIds)\n || count($productIds) == 0\n ) {\n break;\n }\n\n $this->logger->debug('Updating product ids '.implode(',', $productIds));\n\n $this->reindexProducts($productIds);\n $counter += count($productIds);\n } while (1);\n\n if ($counter) {\n if ($counter < count($ids)) {\n $changelogTable = $this->resourceConnection->getTableName('bazaarvoice_product_cl');\n $indexTable = $this->resourceConnection->getTableName('bazaarvoice_index_product');\n $this->resourceConnection->getConnection('core_write')\n ->query(\"INSERT INTO `$changelogTable` (`entity_id`) SELECT `product_id` FROM `$indexTable` WHERE `version_id` = 0;\");\n }\n $this->logStats();\n }\n } catch (Exception $e) {\n $this->logger->crit($e->getMessage().\"\\n\".$e->getTraceAsString());\n }\n\n return true;\n }", "public function gETPriceIdPriceListRequest($price_id)\n {\n // verify the required parameter 'price_id' is set\n if ($price_id === null || (is_array($price_id) && count($price_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $price_id when calling gETPriceIdPriceList'\n );\n }\n\n $resourcePath = '/prices/{priceId}/price_list';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($price_id !== null) {\n $resourcePath = str_replace(\n '{' . 'priceId' . '}',\n ObjectSerializer::toPathValue($price_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\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\\build_query($formParams);\n }\n }\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 }", "protected function deleteProductsVariantsPricelistPriceRequest($product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 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 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function updateProductListPivot()\n {\n $model = $this->productListable;\n $products = $model->products()->get('id');\n $this->products()->sync($products->pluck('id'));\n }", "protected function getProductsVariantsPricelistPriceRequest($product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 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 publishAbstractPriceProductByByProductAbstractIds(array $productAbstractIds): void;", "public function execute($ids)\n {\n // TODO: check configurable products\n\n $storeIds = array_keys($this->storeManager->getStores());\n foreach ($storeIds as $storeId) {\n if (!$this->configHelper->isEnabled($storeId)) {\n $this->logger->info('[LOGSHUBSEARCH] Synchronizing disabled for #'.$storeId);\n return;\n }\n if (!$this->configHelper->isReadyToIndex($storeId)) {\n $this->logger->error('[LOGSHUBSEARCH] Unable to update products index. Configuration error #'.$storeId);\n return;\n }\n\n if (!is_array($ids) || empty($ids)) {\n $ids = $this->getAllProductIds();\n $this->logger->info('[LOGSHUBSEARCH] Synchronizing all the '.count($ids).' products, store: #'.$storeId);\n }\n \n $sender = $this->helper->getProductsSender($storeId);\n $pageLength = $this->configHelper->getProductsIndexerPageLength($storeId);\n foreach (array_chunk($ids, $pageLength) as $chunk) {\n $apiProducts = $this->helper->getApiProducts($chunk);\n $sender->synch($apiProducts);\n }\n }\n }", "public function addShippingPrice($productID, $shippingPriceList){\n\n global $db;\n\n if(!is_numeric($productID) || !is_array($shippingPriceList) || count($shippingPriceList) < 1){\n return;\n }\n\n foreach($shippingPriceList as $shippingPrice){\n $param = ['productID' => $productID, 'locationID' => $shippingPrice['locationID'], 'price' => fn_buckys_get_btc_price_formated($shippingPrice['price']),];\n\n $db->insertFromArray(TABLE_SHOP_SHIPPING_PRICE, $param);\n\n }\n\n }", "protected function doActionSetSalePrice()\n {\n $form = new \\XLite\\Module\\CDev\\Sale\\View\\Form\\SaleSelectedDialog();\n $form->getRequestData();\n\n if ($form->getValidationMessage()) {\n \\XLite\\Core\\TopMessage::addError($form->getValidationMessage());\n } elseif (!$this->getSelected() && $ids = $this->getActionProductsIds()) {\n $qb = \\XLite\\Core\\Database::getRepo('XLite\\Model\\Product')->createQueryBuilder();\n $alias = $qb->getMainAlias();\n $qb->update('\\XLite\\Model\\Product', $alias)\n ->andWhere($qb->expr()->in(\"{$alias}.product_id\", $ids));\n\n foreach ($this->getUpdateInfoElement() as $key => $value) {\n $qb->set(\"{$alias}.{$key}\", \":{$key}\")\n ->setParameter($key, $value);\n }\n\n $qb->execute();\n\n \\XLite\\Core\\TopMessage::addInfo('Products information has been successfully updated');\n } else {\n \\XLite\\Core\\Database::getRepo('\\XLite\\Model\\Product')->updateInBatchById($this->getUpdateInfo());\n \\XLite\\Core\\TopMessage::addInfo('Products information has been successfully updated');\n }\n\n $this->setReturnURL($this->buildURL('product_list', '', ['mode' => 'search']));\n }", "function editPrices() {\n\t\tglobal $HTML;\n\t\tglobal $page;\n\t\tglobal $id;\n\t\t$HTML->details(1);\n\n\t\t$this->getPrices();\n\n\t\t$price_groups = $this->priceGroupClass->getItems();\n\t\t$countries = $this->countryClass->getItems();\n\n\t\t$_ = '';\n\t\t$_ .= '<div class=\"c init:form form:action:'.$page->url.'\" id=\"container:prices\">';\n\t\t$_ .= '<div class=\"c\">';\n\n\t\t$_ .= $HTML->inputHidden(\"id\", $id);\n\t\t$_ .= $HTML->inputHidden(\"item_id\", $id);\n\n\t\t$_ .= $HTML->head(\"Prices\", \"2\");\n\n\t\tif(Session::getLogin()->validatePage(\"prices_update\")) {\n\t\t\t$_ .= $HTML->inputHidden(\"page_status\", \"prices_update\");\n\t\t}\n\n\t\tif($this->item() && count($this->item[\"id\"]) == 1) {\n\n\t\t\tforeach($countries[\"id\"] as $country_key => $country_id) {\n\n\t\t\t\t$_ .= '<div class=\"ci33\">';\n\n\t\t\t\t\t$_ .= $HTML->head($countries[\"values\"][$country_key], 3);\n\n\t\t\t\t\tforeach($price_groups[\"uid\"] as $index => $price_group_uid) {\n\t\t\t\t\t\t$price = ($this->item[\"price\"][0] && isset($this->item[\"price\"][0][$country_id][$price_group_uid])) ? $this->item[\"price\"][0][$country_id][$price_group_uid] : \"\";\n\t\t\t\t\t\t$_ .= $HTML->input($price_groups[\"values\"][$index], \"prices[$country_id][$price_group_uid]\", $price);\n\t\t\t\t\t}\n\n\t\t\t\t\t$_ .= $HTML->separator();\n\t\t\t\t$_ .= '</div>';\n\n\t\t\t}\n\t\t}\n\n\t\t$_ .= '</div>';\n\n\t\t$_ .= $HTML->smartButton($this->translate(\"Cancel\"), false, \"prices_cancel\", \"fleft key:esc\");\n\t\t$_ .= $HTML->smartButton($this->translate(\"Save\"), false, \"prices_update\", \"fright key:s\");\n\n\t\t$_ .= '</div>';\n\n\t\treturn $_;\n\t}", "public function getOnSaleProducts_List (array $listOptions = array()) {\n // global $app;\n // $options['sort'] = 'shop_products.DateUpdated';\n // $options['order'] = 'DESC';\n // $options['_fshop_products.Status'] = join(',', dbquery::getProductStatusesWhenAvailable()) . ':IN';\n // $options['_fshop_products.Price'] = 'PrevPrice:>';\n // $options['_fshop_products.Status'] = 'DISCOUNT';\n // $config = dbquery::shopGetProductList_NewItems($options);\n // if (empty($config))\n // return null;\n // $self = $this;\n // $callbacks = array(\n // \"parse\" => function ($items) use($self) {\n // $_items = array();\n // foreach ($items as $key => $orderRawItem) {\n // $_items[] = $self->getProductByID($orderRawItem['ID']);\n // }\n // return $_items;\n // }\n // );\n // $dataList = $app->getDB()->getDataList($config, $options, $callbacks);\n // return $dataList;\n\n\n $self = $this;\n $params = array();\n $params['list'] = $listOptions;\n $params['callbacks'] = array(\n 'parse' => function ($dbRawItem) use ($self) {\n return $self->getProductByID($dbRawItem['ID']);\n }\n );\n\n return dbquery::fetchOnSaleProducts_List($params);\n }", "public function setListPrice(float $listPrice)\n\t{\n\t\t$this->addKeyValue('list_price', $listPrice); \n\n\t}", "public function bulkproducts() {\n\n $this->checkPlugin();\n\n if ( $_SERVER['REQUEST_METHOD'] === 'POST' ){\n //insert products\n $requestjson = file_get_contents('php://input');\n\n $requestjson = json_decode($requestjson, true);\n\n if (!empty($requestjson) && count($requestjson) > 0) {\n\n $this->addProducts($requestjson);\n }else {\n $this->response->setOutput(json_encode(array('success' => false)));\n }\n\n }else if ( $_SERVER['REQUEST_METHOD'] === 'PUT' ){\n //update products\n $requestjson = file_get_contents('php://input');\n $requestjson = json_decode($requestjson, true);\n\n if (!empty($requestjson) && count($requestjson) > 0) {\n $this->updateProducts($requestjson);\n }else {\n $this->response->setOutput(json_encode(array('success' => false)));\n }\n\n }\n }", "public function actionGetProductPrice($id=null)\n {\n $userData = User::find()->andFilterWhere(['u_id' => $id])->andWhere(['IS NOT', 'u_mws_seller_id', null])->all();\n\n foreach ($userData as $user) {\n \\Yii::$app->data->getMwsDetails($user->u_mws_seller_id, $user->u_mws_auth_token);\n $models = FbaAllListingData::find()->andWhere(['created_by' => $user->u_id])->all(); //->andWhere(['status' => 'Active'])\n\n foreach ($models as $model) {\n if ($model->seller_sku) {\n $productDetails = \\Yii::$app->api->getProductCompetitivePrice($model->seller_sku);\n if ($productDetails) {\n $model->buybox_price = $productDetails;\n if ($model->save(false)) {\n echo $model->asin1 . \" is Updated.\";\n }\n }\n }\n sleep(3);\n }\n }\n }", "public function Save($id, $desc, $rating, $genre, $developer, $listPrice, $releaseDate)\n {\t\n\t\ttry\n\t\t{\t\n\t\t\t$response = $this->_obj->Execute(\"Product(\" . $id . \")\" );\n\t\t\t$products = $response->Result;\n\t\t\tforeach ($products as $product) \n\t\t\t{\n\t\t\t\t$product->ProductDescription = $desc;\n\t\t\t\t$product->ListPrice = str_replace('$', '', $listPrice);\n\t\t\t\t$product->ReleaseDate = $releaseDate;\n\t\t\t\t$product->ProductVersion = $product->ProductVersion;\n\t\t\t\t$this->_obj->UpdateObject($product);\n\t\t\t}\n\t\t\t$this->_obj->SaveChanges(); \n\t\t\t$response = $this->_obj->Execute(\"Game?\\$filter=ProductID eq \" . $id );;\n\t\t\t$games = $response->Result;\n\t\t\tforeach ($games as $game) \n\t\t\t{\n\t\t\t\t$game->Rating = str_replace('%20', ' ', $rating);\n\t\t\t\t$game->Genre = str_replace('%20', ' ', $genre);\n\t\t\t\t$game->Developer = $developer;\n\t\t\t\t$game->GameVersion = $game->GameVersion;\n\t\t\t\t$this->_obj->UpdateObject($game);\n\t\t\t}\n\t\t\t$this->_obj->SaveChanges();\n\t\t\t$products[0]->Game = $games;\n\t\t\treturn $products[0];\n }\n catch(ADODotNETDataServicesException $e)\n {\n\t\t\t echo \"Error: \" . $e->getError() . \"<br>\" . \"Detailed Error: \" . $e->getDetailedError();\n }\n }" ]
[ "0.7937263", "0.7360526", "0.7211644", "0.66703296", "0.65506303", "0.5937376", "0.5862801", "0.58348763", "0.5828097", "0.5784281", "0.5727903", "0.5665608", "0.5644147", "0.556371", "0.5546642", "0.55460227", "0.5511881", "0.5511405", "0.5502406", "0.5485018", "0.5443037", "0.53973275", "0.53923357", "0.53751177", "0.53437775", "0.5333481", "0.5301541", "0.52282256", "0.5217819", "0.5215498" ]
0.7818697
1
Add version to $region_default_args properties
public function __construct () { $this->region_default_args['properties'][] = array( 'name' => 'version', 'value' => Upfront_Layout::$version ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function default(&$args) {\n\n\t\t// Check args\n\t\tif (empty($args) || !is_array($args))\n\t\t\t$args = [];\n\n\t\t// Set agency slug\n\t\t$args['agency'] = $this->agency;\n\n\t\t// Check language\n\t\tif (!isset($args['language']) && isset($this->language))\n\t\t\t$args['language'] = $this->language;\n\t}", "public function addDefaultEntriesAndValues() {}", "public function setDefaultArgs($args);", "private function setDefaultArgs()\n {\n $args = [\n 'title' => get_bloginfo('name'),\n 'url' => get_bloginfo('url'),\n 'desc' => get_bloginfo('description'),\n ];\n\n if (is_page() || is_singular()) {\n $args = [\n 'title' => get_the_title(),\n 'url' => get_permalink(),\n 'desc' => $this->getPostExcerpt(),\n ];\n }\n\n $this->setArgs(apply_filters('cgit_socialize_default_args', $args));\n }", "protected function _create_defaults( $args ) {\n\t\t\t$defaults = array(\n\t\t\t\t'help_tabs' => array(),\n\t\t\t\t'help_sidebar' => '',\n\t\t\t);\n\t\t\t$args = wp_parse_args( $args, $defaults );\n\t\t\t$this->args = json_decode( json_encode( $args ) );\n\t\t}", "function caldol_hook_widget_tag_cloud_args($args = array()){\n\n\n$newArgs = array(\n'smallest' => 8,\n'largest' => 15,\n'number' => 20,\n\n);\nreturn array_merge($args, $newArgs);\n}", "function apply_default_args($args) {\r\n\t\t$defaults = array(\r\n\t\t\t'width'=>'',\r\n\t\t\t'height'=>'',\r\n\t\t\t'placeholder'=>'',\r\n\t\t\t'description'=>''\r\n\t\t);\r\n\t\t$args = wp_parse_args( $args, $defaults );\r\n\t\treturn $args;\t\r\n\t}", "public function get_default_args(){ return $this->default_args; }", "public function getDefaultVariantId();", "private function default_args() {\n\t\n\t\t$defaults = array(\n\t\t\t'container' \t=> 'nav',\n\t\t\t'separator' \t=> '&raquo;',\n\t\t\t'before' \t\t=> 'Viewing:',\n\t\t\t'home' \t\t\t=> 'Home',\n\t\t);\n\t\treturn $defaults;\n\t}", "private function setArgs(){\n\t\t$this->args = array(\n\t\t\t'label' => $this->label,\n\t\t\t'labels' => $this->labels,\n\t\t\t'description' => $this->description,\n\t\t\t'public' => $this->public,\n\t\t\t'exclude_from_search' => $this->excludeSearch,\n\t\t\t'publicly_queryable' => $this->publiclyQueryable,\n\t\t\t'show_ui' => $this->show_ui ,\n\t\t\t'show_in_nav_menus' => $this->showInNavMenus,\n\t\t\t'show_in_menu' => $this->showInMenu,\n\t\t\t'show_in_admin_bar' => $this->showInAdminBar,\n\t\t\t'menu_position' => $this->menuPosition,\n\t\t\t'menu_icon' => $this->menuIcon,\n\t\t\t'capability_type' => $this->capabilityType,\n\t\t\t'map_meta_cap' => $this->mapMetaCap,\n\t\t\t'hierarchical' => $this->hierarchical,\n\t\t\t'supports' => $this->supports,\n\t\t\t'register_meta_box_cb' => $this->registerMetaBoxCb,\n\t\t\t'taxonomies' => $this->taxonomies,\n\t\t\t'has_archive' => $this->hasArchive,\n\t\t\t'permalink_epmask' => $this->permalinkEpmask,\n\t\t\t'rewrite' => $this->rewrite,\n\t\t\t'query_var' => $this->queryVar,\n\t\t\t'can_export' => $this->canExport,\n\t\t\t'_builtin' => $this->builtin\n\t\t);\n\t}", "function options($default) {\r\n $default = array_merge(\r\n $default,\r\n array(\r\n \"maximum_result_set\" => \"3\",\r\n \"default_title\" => __(\"Find nearby locations\", 'slp-experience'),\r\n 'radius_label' => __('Within', 'slp-experience'),\r\n \"search_label\" => __(\"Zip Code\", 'slp-experience'),\r\n \"button_label\" => __(\"Go!\", 'slp-experience'),\r\n )\r\n );\r\n\r\n return $default;\r\n }", "function my_wp_default_styles($styles)\n{\n\tglobal $stylesVersion;\n\t//use release date for version\n\t\n\t$styles->default_version = $stylesVersion;\n}", "public function set_defaults($args, $overwrite=false) {\n\t\t\n\t\t$args = (array) $args;\n\t\t$overwrite = (bool) $overwrite;\n\t\t\n\t\tif ($overwrite) {\n foreach ($this->defaults as $k =>$v) {\n if (isset($args[$k])) {\n $this->defaults[$k] = $v;\n }\n else {\n $this->defaults[$k] = null;\n }\n }\n\t\t}\n\t\t// Line item override\n\t\telse {\n\t\t\tforeach ($args as $k => $v) {\n\t\t\t\t$this->defaults[$k] = $v;\n\t\t\t\t$this->$k = $v; // set the args\n\t\t\t}\n\t\t}\t\t\n\t}", "protected function vedConstructArg(array $args = array()) {\n }", "public function singleBundleCreationWithOverrides() {\n $entityTypeInfo = $this->createEntityType();\n\n $title_overrides = [];\n foreach ($this->getConfigurableBaseFields() as $field) {\n $title_overrides[$field] = $this->randomMachineName(16);\n }\n\n $this->createEntityBundle($entityTypeInfo['id'], '', $title_overrides);\n }", "function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )\n {\n if ( $currentVersion != false )\n {\n $dataText = $originalContentObjectAttribute->content();\n $contentObjectAttribute->setContent( $dataText );\n }\n else\n {\n $default = array( 'value' => array() );\n $contentObjectAttribute->setContent( $default );\n }\n }", "public function getDefaultRegion() : ?string;", "public function getDefaultVersionJsn()\n {\n return [\n 'name' => APP_NAME,\n 'tag' => '0.0.0',\n 'desc' => APP_DESC,\n 'codename' => '',\n ];\n }", "public static function getDefaultAgentVersion()\n {\n return 'google.com/gcp-php/' . self::VERSION;\n }", "public function __construct( $name, $version) {\n\n $this->settings_prefix = $name;\n\n\n $version_option = $this->settings_prefix . '_version';\n\n if( get_option($version_option) !== $version) {\n //Version\n $current_version = get_option( $version_option, null );\n $major_version = substr( $version, 0, strrpos( $version, '.' ) );\n\n delete_option( $version_option );\n add_option( $version_option, $version );\n\n do_action( $version_option . '_update', $version, $current_version );\n }\n\n self::$_instance[$name]['version'] = $version;\n }", "private static function add_version_info( $params = array() ) {\n\t\t\t// if any parameter is passed in the pixel, do not overwrite it\n\t\t\treturn array_replace( self::get_version_info(), $params );\n\t\t}", "public function version( $args = array(), $assoc_args = array() ) {\n\t\tself::run( 'core version', $args, $assoc_args );\n\t}", "function initDefaultOptions(){\n\n\t\t\t$defaults = $this->defaultOptions();\n\t\t\treturn update_option( $this->optionsKey, $defaults );\n\t\t}", "private static function get_default_args() {\n $careerjet_api_key = get_option('jobsearch_integration_careerjet_affid');\n \n return array(\n 'affid' => $careerjet_api_key,\n 'keywords' => '',\n 'location' => '',\n 'page' => 1,\n );\n }", "public function singleBundleEditWithOverrides() {\n $entityTypeInfo = $this->createEntityType();\n\n $title_overrides = [];\n foreach ($this->getConfigurableBaseFields() as $field) {\n $title_overrides[$field] = $this->randomMachineName(16);\n }\n\n $bundle_info = $this->createEntityBundle($entityTypeInfo['id'], '', $title_overrides);\n\n $new_title_overrides = [];\n foreach ($this->getConfigurableBaseFields() as $field) {\n $new_title_overrides[$field] = $this->randomMachineName(16);\n }\n\n $this->editEntityBundle($entityTypeInfo['id'], $bundle_info['type'], $this->randomMachineName(16), $new_title_overrides);\n }", "private function getDefaultColumnArgs(){\n\n\t\t$args = array(\n\n\t\t\t\t'hasLightbox'\t=> true,\n\t\t\t\t'buttonText'\t=> __( 'Save Column', 'cuisinesections' )\n\t\t);\n\n\t\t$args = apply_filters( 'chef_sections_default_column_args', $args );\n\n\t\treturn $args;\n\n\t}", "function _wp_register_meta_args_allowed_list($args, $default_args)\n {\n }", "function _wp_register_meta_args_whitelist($args, $default_args)\n {\n }", "function upgradeDefaultOptions_2_2 ()\n\t{\n\t\t// Keep hardcoded name, in case we change the name at a later stage\n\t\t$oldvalues = get_option( 'avhamazon' );\n\t\t$newvalues = array ('general' => array (), 'widget_wishlist' => array () );\n\n\t\tforeach ( $oldvalues as $name => $value ) {\n\t\t\tif ( array_key_exists( $name, $this->default_options['general'] ) ) {\n\t\t\t\t$newvalues['general'][$name] = $value;\n\t\t\t}\n\t\t\tif ( array_key_exists( $name, $this->default_options['widget_wishlist'] ) ) {\n\t\t\t\t$newvalues['widget_wishlist'][$name] = $value;\n\t\t\t}\n\t\t}\n\t\tdelete_option( 'avhamazon' );\n\t\tadd_option( $this->db_options_name_core, $newvalues );\n\t}" ]
[ "0.55579317", "0.5379492", "0.5293333", "0.5138704", "0.51216877", "0.51020133", "0.5101698", "0.50603426", "0.500928", "0.49329698", "0.49038213", "0.48948243", "0.48662868", "0.48136237", "0.4804192", "0.47919914", "0.47913826", "0.47816938", "0.4768469", "0.47440848", "0.4719238", "0.4694356", "0.46793157", "0.46653733", "0.4654762", "0.46529332", "0.46496263", "0.4644118", "0.46254843", "0.46124312" ]
0.71187365
0
Gets a specific, ready made layout for a slug
public function get_theme_layout ($layout_slug='') { if (empty($layout_slug)) return ''; $filenames = array( 'layouts/index-' . $layout_slug . '.php', 'layouts/' . $layout_slug . '.php', ); return function_exists('upfront_locate_template') ? upfront_locate_template($filenames) : locate_template($filenames) ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mai_get_layout( $layout ) {\n\tremove_filter( 'genesis_pre_get_option_site_layout', 'genesiswooc_archive_layout' );\n\n\t// Setup cache.\n\tstatic $layout_cache = '';\n\n\t// If cache is populated, return value.\n\tif ( '' !== $layout_cache ) {\n\t\treturn esc_attr( $layout_cache );\n\t}\n\n\t$site_layout = '';\n\n\tglobal $wp_query;\n\n\t// If home page.\n\tif ( is_home() ) {\n\t\t$site_layout = genesis_get_custom_field( '_genesis_layout', get_option( 'page_for_posts' ) );\n\t\tif ( ! $site_layout ) {\n\t\t\t$site_layout = genesis_get_option( 'layout_archive' );\n\t\t}\n\t}\n\n\t// If viewing a singular page, post, or CPT.\n\telseif ( is_singular() ) {\n\t\t$site_layout = genesis_get_custom_field( '_genesis_layout', get_the_ID() );\n\t\tif ( ! $site_layout ) {\n\t\t\t$site_layout = genesis_get_option( sprintf( 'layout_%s', get_post_type() ) );\n\t\t}\n\t}\n\n\t// If viewing a post taxonomy archive.\n\telseif ( is_category() || is_tag() || is_tax( get_object_taxonomies( 'post', 'names' ) ) ) {\n\t\t$term = $wp_query->get_queried_object();\n\t\t$site_layout = $term ? get_term_meta( $term->term_id, 'layout', true) : '';\n\t\t$site_layout = $site_layout ? $site_layout : genesis_get_option( 'layout_archive' );\n\t}\n\n\t// If viewing a custom taxonomy archive.\n\telseif ( is_tax() ) {\n\t\t$term = $wp_query->get_queried_object();\n\t\t$site_layout = $term ? get_term_meta( $term->term_id, 'layout', true) : '';\n\t\tif ( ! $site_layout ) {\n\t\t\t$tax = get_taxonomy( $wp_query->get_queried_object()->taxonomy );\n\t\t\tif ( $tax ) {\n\t\t\t\t/**\n\t\t\t\t * If we have a tax, get the first one.\n\t\t\t\t * Changed to reset() when hit an error on a term archive that object_type array didn't start with [0]\n\t\t\t\t */\n\t\t\t\t$post_type = reset( $tax->object_type );\n\t\t\t\t// If we have a post type and it supports genesis-cpt-archive-settings\n\t\t\t\tif ( post_type_exists( $post_type ) && genesis_has_post_type_archive_support( $post_type ) ) {\n\t\t\t\t\t// $site_layout = genesis_get_option( sprintf( 'layout_archive_%s', $post_type ) );\n\t\t\t\t\t$site_layout = genesis_get_cpt_option( 'layout', $post_type );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$site_layout = $site_layout ? $site_layout : genesis_get_option( 'layout_archive' );\n\t}\n\n\t// If viewing a supported post type.\n\t// elseif ( is_post_type_archive() && genesis_has_post_type_archive_support() ) {\n\telseif ( is_post_type_archive() ) {\n\t\t// $site_layout = genesis_get_option( sprintf( 'layout_archive_%s', get_post_type() ) );\n\t\t$site_layout = genesis_get_cpt_option( 'layout', get_post_type() );\n\t\t$site_layout = $site_layout ? $site_layout : genesis_get_option( 'layout_archive' );\n\t}\n\n\t// If viewing an author archive.\n\telseif ( is_author() ) {\n\t\t$site_layout = get_the_author_meta( 'layout', (int) get_query_var( 'author' ) );\n\t\t$site_layout = $site_layout ? $site_layout : genesis_get_option( 'layout_archive' );\n\t}\n\n\t// Pull the theme option.\n\tif ( ! $site_layout ) {\n\t\t$site_layout = genesis_get_option( 'site_layout' );\n\t}\n\n\t// Use default layout as a fallback, if necessary.\n\tif ( ! genesis_get_layout( $site_layout ) ) {\n\t\t$site_layout = genesis_get_default_layout();\n\t}\n\t// Push layout into cache.\n\t$layout_cache = $site_layout;\n\n\t// Return site layout.\n\treturn esc_attr( $site_layout );\n\n}", "function layout(string $layout)\n {\n return the_layout($layout);\n }", "function the_layout(string $layout)\n {\n return app('armin.layout')->layout($layout);\n }", "function layout_first()\n { \n foreach (func_get_args() as $name) {\n if(! empty($name) && $layout = the_layout($name)) {\n return $layout;\n }\n } \n\n $error = 'Not Found Layout(s) '. collect(func_get_args())->filter()->implode(', ') . '.';\n\n return abort(500, $error);\n }", "public function get_layout($id)\n\t{\n\t\treturn $this->get_single($id);\n\t}", "function get_where_used( $layout_id, $slug = false, $group = false, $posts_per_page = -1 )\n\t{\n\t\t$layout = $this->get_layout_from_id( $layout_id );\n\n\t\tif( is_object( $layout ) === false && method_exists($layout,'get_post_slug') === false ) return;\n\n\t\t$args = array(\n\t\t\t'posts_per_page' => $posts_per_page,\n\t\t\t'post_type' => 'any',\n\t\t\t'meta_query' => array (\n\t\t\t\tarray (\n\t\t\t\t\t'key' => '_layouts_template',\n\t\t\t\t\t'value' => $slug ? $slug : $layout->get_post_slug(),\n\t\t\t\t\t'compare' => '=',\n\t\t\t\t)\n\t\t\t) );\n\n\t\t$new_query = new WP_Query( $args );\n\n if( $group === true )\n {\n add_filter('posts_orderby', array(&$this, 'order_by_post_type'), 10, 2);\n $new_query->group_posts_by_type = $group;\n }\n\n\t\t$posts = $new_query->get_posts();\n\n\t\treturn $posts;\n\t}", "protected function getLayout() {\n\t\treturn $this->getFrontcontroller()->getResource('layout');\n\t}", "public function getLayout() {\n\n return $this->asset_array['default']['layout']['name'];\n }", "public function getSingle($slug){\n \t// izvuci post iz 'posts' tabele koristeci $slug posta koji je stigao \n $post = Post::where('slug', '=', $slug)->first(); \n // posalji ga u vju single.blade.php iz foldera 'blogg\\resources\\views\\blog' da ga prikaze\n return view('blog.single')->withPost($post); \n }", "protected function getLayout($id='default'){\n\t\tinclude($this->layoutsPath.'/'.$id.'.php');\n\t}", "public function getLayout()\n\t{\n\t\t$input = JFactory::getApplication()->input;\n\t\treturn $input->getCmd('tmpl') ? $input->getCmd('tmpl') : $this->getParam('mainlayout', 'default');\n\t}", "public function getPageBySlug( $slug ) {\n\n\t\tif ( !$page = $this->pageRepo->getBySlug( $slug ) ) {\n\t\t\tabort( 404 );\n\t\t}\n\n\t\t// default view\n\t\t$view = 'pages.inner';\n\n\t\t// default banner - child views can override the default one.\n\t\t$banner = $page->hasBanner() ? $page->bannerImageUrl() : null;\n\t\tif ( $page->isContactUs() ) {\n\t\t\t$view = 'pages.contact-us';\n\t\t}\n\n\t\treturn view( toolbox()->frontend()->view( $view ), compact( 'page', 'banner') );\n\n\t}", "function get_page_layout() {\n\t\tif (is_page() || (is_front_page() && get_option('show_on_front') == 'page')) {\n\t\t\t// WP page,\n\t\t\t// get the page template setting\n\t\t\t$page_id = get_the_ID();\n\t\t\t$page_template = noo_get_post_meta($page_id, '_wp_page_template', 'default');\n\t\t\t\n\t\t\tif (strpos($page_template, 'sidebar') !== false) {\n\t\t\t\tif (strpos($page_template, 'left') !== false) {\n\t\t\t\t\treturn 'left_sidebar';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn 'sidebar';\n\t\t\t}\n\t\t\t\n\t\t\treturn 'fullwidth';\n\t\t}\n\t\t\n\t\t// NOO Resume\n\t\tif( is_post_type_archive( 'noo_resume' ) ) {\n\t\t\treturn noo_get_option('noo_resumes_layout', 'sidebar');\n\t\t}\n\t\tif( is_singular( 'noo_resume' ) ) {\n\t\t\treturn 'fullwidth';\n\t\t}\n\t\t\n\t\t// NOO Company\n\t\tif( is_post_type_archive( 'noo_company' ) ) {\n\t\t\treturn noo_get_option('noo_companies_layout', 'fullwidth');\n\t\t}\n\n\t\tif( is_singular( 'noo_company' ) ) {\n\t\t\tif(noo_get_option('noo_companies_layout', 'fullwidth') == 'fullwidth'){\n\t\t\t\treturn 'sidebar';\n\t\t\t} else{\n\t\t\t\treturn noo_get_option('noo_companies_layout', 'fullwidth');\n\t\t\t}\n\t\t}\n\t\t\n\t\t// NOO Job\n\t\tif( is_post_type_archive( 'noo_job' )\n\t\t\t|| is_tax( 'job_category' )\n\t\t\t|| is_tax( 'job_type' )\n\t\t\t|| is_tax( 'job_tag' ) \n\t\t\t|| is_tax( 'job_location' ) ) {\n\n\t\t\treturn noo_get_option('noo_jobs_layout', 'sidebar');\n\t\t}\n\t\t\n\t\t// Single Job\n\t\tif( is_singular( 'noo_job' ) ) {\n\t\t\treturn noo_get_option('noo_single_jobs_layout', 'right_company');\n\t\t}\n\n\t\t// WooCommerce\n\t\tif( NOO_WOOCOMMERCE_EXIST ) {\n\t\t\tif( is_shop() || is_product_category() || is_product_tag() ){\n\t\t\t\treturn noo_get_option('noo_shop_layout', 'fullwidth');\n\t\t\t}\n\n\t\t\tif( is_product() ) {\n\t\t\t\t$product_layout = noo_get_option('noo_woocommerce_product_layout', 'same_as_shop');\n\t\t\t\tif ($product_layout == 'same_as_shop') {\n\t\t\t\t\t$product_layout = noo_get_option('noo_shop_layout', 'fullwidth');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $product_layout;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Single post page\n\t\tif (is_single()) {\n\n\t\t\t// WP post,\n\t\t\t// check if there's overrode setting in this post.\n\t\t\t$post_id = get_the_ID();\n\t\t\t$override_setting = noo_get_post_meta($post_id, '_noo_wp_post_override_layout', false);\n\t\t\t\n\t\t\tif ( !$override_setting ) {\n\t\t\t\t$post_layout = noo_get_option('noo_blog_post_layout', 'same_as_blog');\n\t\t\t\tif ($post_layout == 'same_as_blog') {\n\t\t\t\t\t$post_layout = noo_get_option('noo_blog_layout', 'sidebar');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $post_layout;\n\t\t\t}\n\n\t\t\t// overrode\n\t\t\treturn noo_get_post_meta($post_id, '_noo_wp_post_layout', 'sidebar-main');\n\t\t}\n\n\t\t// Archive\n\t\tif (is_archive()) {\n\t\t\t$archive_layout = noo_get_option('noo_blog_archive_layout', 'same_as_blog');\n\t\t\tif ($archive_layout == 'same_as_blog') {\n\t\t\t\t$archive_layout = noo_get_option('noo_blog_layout', 'sidebar');\n\t\t\t}\n\t\t\t\n\t\t\treturn $archive_layout;\n\t\t}\n\n\t\t// Index or Home\n\t\tif (is_home() || (is_front_page() && get_option('show_on_front') == 'posts')) {\n\t\t\t\n\t\t\treturn noo_get_option('noo_blog_layout', 'sidebar');\n\t\t}\n\t\t\n\t\treturn '';\n\t}", "function getLayout($id){\r\n \r\n $transform = ucfirst(str_replace('-', \"_\", $id));\r\n $layout_name = \"\\\\LK\\PXEdit\\\\Layouts\\\\\" . $transform;\r\n \r\n // Force an Autoload\r\n \\PXEdit_Autoload($layout_name);\r\n \r\n if(!class_exists($layout_name)){\r\n $this ->sendError('Layout ' . $layout_name . \" is not existing.\");\r\n } \r\n \r\n $layout = new $layout_name();\r\n return $layout;\r\n }", "function get_template_section( $slug, $name = null ) {\n\tdo_action( \"get_template_part_{$slug}\", $slug, $name );\n\n\t$templates = array();\n\tif ( isset($name) )\n\t\t$templates[] = \"template-sections/{$slug}-{$name}.php\";\n\n\t$templates[] = \"template-sections/{$slug}.php\";\n\n\tlocate_template($templates, true, false);\n\t\n}", "public function getLayouts();", "public function getSingle($slug) {\n // $post = Post::where('slug', '=', $slug)->first();\n $this->post = Post::where('slug', '=', $slug)->first();\n\n // return the view and pass in the post object\n // return view('m/blog/blog.single')->withPost($post);\n\n $this->page->title = $this->post->title;\n $this->page->view = 'blog-single';\n return view($this->page->view)\n ->with('page', $this->page)\n ->with('post', $this->post);\n }", "function pi_get_content_layout()\n{\n return piBlogCustomize::pi_refresh_in_customize('pi_options[content][layout]') ? piBlogCustomize::pi_refresh_in_customize('pi_options[content][layout]') : piBlogFramework::$piOptions['content']['layout'];\n}", "function deals_get_template_part( $slug, $name = '' ) {\n\tif ($name == 'deals') :\n\t\tif (!locate_template(array( $slug.'-'.$name.'.php', DEALS_TEMPLATE.$slug.'-'.$name.'.php' ))) :\n\t\t\tload_template( DEALS_TEMPLATE_DIR . $slug.'-'.$name.'.php',false );\n\t\t\treturn;\n\t\tendif;\n endif; \n get_template_part(DEALS_TEMPLATE. $slug, $name );\n}", "protected function getRandomLayout(): string {\n\t\t$key = array_rand($this->layouts);\n\t\t\n\t\treturn $this->layouts[$key];\n\t}", "function cmdeals_get_template_part( $slug, $name = '' ) {\n\tglobal $cmdeals, $post;\n\tif ($name=='store') :\n\t\tif (!locate_template(array( $slug.'-store.php', WPDEALS_TEMPLATE_URL . $slug.'-store.php' ))) :\n\t\t\tload_template( $cmdeals->plugin_path() . '/cmdeals-templates/'.$slug.'-store.php',false );\n\t\t\treturn;\n\t\tendif;\n\tendif;\n\tget_template_part( WPDEALS_TEMPLATE_URL . $slug, $name );\n}", "public function getPage($slug = 'home')\n {\n\n $page = Page::where(['slug' => $slug, 'status' => 'ACTIVE'])->firstOrFail();\n $blocks = $page->blocks()\n ->where('is_hidden', '=', '0')\n ->orderBy('order', 'asc')\n ->get()\n ->map(function ($block) {\n return (object)[\n 'id' => $block->id,\n 'page_id' => $block->page_id,\n 'updated_at' => $block->updated_at,\n 'cache_ttl' => $block->cache_ttl,\n 'template' => $block->template()->template,\n 'data' => $block->cachedData,\n 'path' => $block->path,\n 'type' => $block->type,\n ];\n });\n\n // Override standard body content, with page block content\n $page['body'] = view('voyager-page-blocks::default', [\n 'page' => $page,\n 'blocks' => $this->prepareEachBlock($blocks),\n ]);\n\n // Check that the page Layout and its View exists\n if (empty($page->layout)) {\n $page->layout = 'default';\n }\n if (!View::exists(\"{$this->viewPath}::layouts.{$page->layout}\")) {\n $page->layout = 'default';\n }\n\n // Return the full page\n return view(\"{$this->viewPath}::modules.pages.default\", [\n 'page' => $page,\n 'layout' => $page->layout,\n ]);\n }", "public function getSingle($slug) {\n // get() fetch a collection of object, must be iterated or collection[0]\n // first() get a single object\n $post = Post::where('slug', '=', $slug)->first();\n\n $comments = $post->comments->sortByDesc('id');\n \n // return the view and pass in the post object\n return view('blog.single')->withPost($post)->withComments($comments);\n\n }", "function get_template_part( $slug, $name = null ) {\n\n $templates = array();\n $name = (string) $name;\n if ( '' !== $name )\n $templates[] = \"{$slug}-{$name}.php\";\n\n $templates[] = \"{$slug}.php\";\n\n locate_template($templates, true, false);\n}", "public function getSingle($slug) {\n\n $post = Post::where('slug', '=', $slug)->first();\n\n // return the view and pass in the post object\n\n return view('project.single')->withPost($post);\n\n }", "public static function custom_page_layout()\n {\n\n // get wp post\n global $post;\n // get post name\n $page_slug = $post->post_name;\n // check post name\n if ($page_slug == 'my_events') {\n $page_template = PLUGIN_PATH_INCLUDES_PUBLIC . 'page_template.php';\n }\n return $page_template;\n }", "public function getLayout(): string;", "function publisher_get_header_layout() {\n\n\t\t// Return from cache\n\t\tif ( publisher_get_global( 'header-layout' ) ) {\n\t\t\treturn publisher_get_global( 'header-layout' );\n\t\t}\n\n\t\t$layout = 'default';\n\n\t\tif ( publisher_is_valid_tax() ) {\n\t\t\t$layout = bf_get_term_meta( 'header_layout' );\n\t\t} elseif ( publisher_is_valid_cpt() ) {\n\n\n\t\t\t$layout = bf_get_post_meta( 'header_layout' );\n\t\t\t// default -> Retrieve from parent category\n\t\t\tif ( $layout === 'default' ) {\n\n\t\t\t\t$main_term = publisher_get_post_primary_cat();\n\n\t\t\t\tif ( ! is_wp_error( $main_term ) && is_object( $main_term ) && bf_get_term_meta( 'override_in_posts', $main_term ) ) {\n\t\t\t\t\t$layout = bf_get_term_meta( 'header_layout', $main_term );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( $layout === 'default' ) {\n\t\t\t$layout = publisher_get_option( 'header_layout' );\n\t\t}\n\n\t\t// Cache\n\t\tpublisher_set_global( 'header-layout', $layout );\n\n\t\treturn $layout;\n\n\t}", "function fanwood_plugin_layouts( $layout ) {\n\n\tif ( current_theme_supports( 'theme-layouts' ) ) {\n\t\n\t\t$global_layout = hybrid_get_setting( 'fanwood_global_layout' );\n\t\t$buddypress_layout = hybrid_get_setting( 'fanwood_buddypress_layout' );\n\n\t\tif ( function_exists( 'bp_loaded' ) && !bp_is_blog_page() && $layout == 'layout-default' ) {\n\t\t\n\t\t\tif ( $buddypress_layout !== 'layout_default' ) {\n\t\t\t\n\t\t\t\tif ( $buddypress_layout == 'layout_1c' )\n\t\t\t\t\t$layout = 'layout-1c';\n\t\t\t\telseif ( $buddypress_layout == 'layout_2c_l' )\n\t\t\t\t\t$layout = 'layout-2c-l';\n\t\t\t\telseif ( $buddypress_layout == 'layout_2c_r' )\n\t\t\t\t\t$layout = 'layout-2c-r';\n\t\t\t\telseif ( $buddypress_layout == 'layout_3c_c' )\n\t\t\t\t\t$layout = 'layout-3c-c';\n\t\t\t\telseif ( $buddypress_layout == 'layout_3c_l' )\n\t\t\t\t\t$layout = 'layout-3c-l';\n\t\t\t\telseif ( $buddypress_layout == 'layout_3c_r' )\n\t\t\t\t\t$layout = 'layout-3c-r';\n\t\t\t\telseif ( $buddypress_layout == 'layout_hl_1c' )\n\t\t\t\t\t$layout = 'layout-hl-1c';\n\t\t\t\telseif ( $buddypress_layout == 'layout_hl_2c_l' )\n\t\t\t\t\t$layout = 'layout-hl-2c-l';\n\t\t\t\telseif ( $buddypress_layout == 'layout_hl_2c_r' )\n\t\t\t\t\t$layout = 'layout-hl-2c-r';\n\t\t\t\telseif ( $buddypress_layout == 'layout_hr_1c' )\n\t\t\t\t\t$layout = 'layout-hr-1c';\n\t\t\t\telseif ( $buddypress_layout == 'layout_hr_2c_l' )\n\t\t\t\t\t$layout = 'layout-hr-2c-l';\n\t\t\t\telseif ( $buddypress_layout == 'layout_hr_2c_r' )\n\t\t\t\t\t$layout = 'layout-hr-2c-r';\n\t\t\t\t\n\t\t\t} elseif ( $buddypress_layout == 'layout_default' ) {\n\t\t\t\n\t\t\t\tif ( $global_layout == 'layout_1c' )\n\t\t\t\t\t$layout = 'layout-1c';\n\t\t\t\telseif ( $global_layout == 'layout_2c_l' )\n\t\t\t\t\t$layout = 'layout-2c-l';\n\t\t\t\telseif ( $global_layout == 'layout_2c_r' )\n\t\t\t\t\t$layout = 'layout-2c-r';\n\t\t\t\telseif ( $global_layout == 'layout_3c_c' )\n\t\t\t\t\t$layout = 'layout-3c-c';\n\t\t\t\telseif ( $global_layout == 'layout_3c_l' )\n\t\t\t\t\t$layout = 'layout-3c-l';\n\t\t\t\telseif ( $global_layout == 'layout_3c_r' )\n\t\t\t\t\t$layout = 'layout-3c-r';\n\t\t\t\telseif ( $global_layout == 'layout_hl_1c' )\n\t\t\t\t\t$layout = 'layout-hl-1c';\n\t\t\t\telseif ( $global_layout == 'layout_hl_2c_l' )\n\t\t\t\t\t$layout = 'layout-hl-2c-l';\n\t\t\t\telseif ( $global_layout == 'layout_hl_2c_r' )\n\t\t\t\t\t$layout = 'layout-hl-2c-r';\n\t\t\t\telseif ( $global_layout == 'layout_hr_1c' )\n\t\t\t\t\t$layout = 'layout-hr-1c';\n\t\t\t\telseif ( $global_layout == 'layout_hr_2c_l' )\n\t\t\t\t\t$layout = 'layout-hr-2c-l';\n\t\t\t\telseif ( $global_layout == 'layout_hr_2c_r' )\n\t\t\t\t\t$layout = 'layout-hr-2c-r';\n\t\t\t\n\t\t\t}\n\n\t\t}\n\t\t\n\t}\n\t\n\treturn $layout;\n\n}", "function custom_set_single_posts_layout() {\n if (is_single('post') || is_singular('post')) {\n return 'content-sidebar';\n }\n \n}" ]
[ "0.63985", "0.6339494", "0.6308496", "0.6254587", "0.6122208", "0.6072583", "0.6004632", "0.5933843", "0.5924246", "0.589248", "0.58846366", "0.5828512", "0.5801484", "0.57628727", "0.5731636", "0.5721796", "0.57142305", "0.57123977", "0.5711441", "0.5699014", "0.5693212", "0.56849986", "0.56759065", "0.5670702", "0.5654186", "0.56289256", "0.56255734", "0.56161505", "0.5579828", "0.5565766" ]
0.6854128
0
Checks whether we have a specific, ready made layout for a slug
public function has_theme_layout ($layout_slug='') { $layout = $this->get_theme_layout($layout_slug); return !empty($layout); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasLayout() {}", "protected function isPageTemplate(): bool {\n return (\n $this->layout === 'single' || \n $this->layout === 'archive'\n );\n }", "function hasLayout() ;", "public function layout_exists( $layout ) {\n // If there is a theme, check it exists in there\n if ( !empty( $this->_theme ) AND in_array( $layout, self::get_theme_layouts() ) ) {\n return TRUE;\n }\n\n // Otherwise look in the normal places\n return file_exists( self::_find_view_folder() . 'layouts/' . $layout . self::_ext( $layout ) );\n }", "public function exists()\n {\n return file_exists($this->path('layout.php'));\n }", "function isPage( $slug ) {\n // Get all page summaries (the smallest sets of data about posts)\n $pages = $this->getAll();\n // Return boolean if a page exists with this slug.\n return !empty( $pages[$slug] );\n }", "function voyage_mikado_is_masonry_template() {\n\n $page_id = voyage_mikado_get_page_id();\n $page_template = get_page_template_slug($page_id);\n $page_options_template = voyage_mikado_options()->getOptionValue('blog_list_type');\n\n if(!is_archive()) {\n if($page_template == 'blog-masonry.php' || $page_template == 'blog-masonry-full-width.php') {\n return true;\n }\n } elseif(is_archive() || is_home()) {\n if($page_options_template == 'masonry' || $page_options_template == 'masonry-full-width') {\n return true;\n }\n } else {\n return false;\n }\n }", "function medigroup_mikado_is_masonry_template() {\n\n $page_id = medigroup_mikado_get_page_id();\n $page_template = get_page_template_slug($page_id);\n $page_options_template = medigroup_mikado_options()->getOptionValue('blog_list_type');\n\n if(!is_archive()) {\n if($page_template == 'blog-masonry.php' || $page_template == 'blog-masonry-full-width.php') {\n return true;\n }\n } elseif(is_archive() || is_home()) {\n if($page_options_template == 'masonry' || $page_options_template == 'masonry-full-width') {\n return true;\n }\n } else {\n return false;\n }\n }", "protected function isLayoutExistsByName($name, $layoutType){\n\t\t\n\t\t$isExists = UniteFunctionsWPUC::isPostNameExists($name);\n\t\t\n\t\treturn($isExists);\n\t}", "public function has_reserved_slug() {\n\t\t$reserved_slugs = array(\n\t\t\t// Reserve \"twenty\" names for wordpressdotorg.\n\t\t\t'twentyten', 'twentyeleven', 'twentytwelve','twentythirteen', 'twentyfourteen', 'twentyfifteen',\n\t\t\t'twentysixteen', 'twentyseventeen','twentyeighteen', 'twentynineteen', 'twentytwenty',\n\t\t\t'twentytwentyone', 'twentytwentytwo', 'twentytwentythree', 'twentytwentyfour', 'twentytwentyfive',\n\t\t\t'twentytwentysix', 'twentytwentyseven', 'twentytwentyeight', 'twentytwentynine', 'twentythirty',\n\n\t\t\t// Theme Showcase URL parameters.\n\t\t\t'browse', 'tag', 'search', 'filter', 'upload', 'commercial',\n\t\t\t'featured', 'popular', 'new', 'updated',\n\t\t);\n\n\t\t// If it's not a reserved slug, they can have it.\n\t\tif ( ! in_array( $this->theme_slug, $reserved_slugs, true ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// WordPress.org user is always allowed to upload reserved slugs.\n\t\tif ( 'wordpressdotorg' === $this->author->user_login ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Slug is reserved, user is not authorized.\n\t\treturn true;\n\t}", "public function isLayoutExistsByTitle($title, $layoutType = null){\n\t\t\n\t\t$isExists = UniteFunctionsWPUC::isPostExistsByTitle($title);\n\t\t\n\t\treturn($isExists);\n\t}", "protected function isLayoutExistsByTitle($title, $layoutType){\n\t\t\n\t\t$isExists = UniteFunctionsWPUC::isPostExistsByTitle($title);\n\t\t\n\t\treturn($isExists);\n\t}", "function custom_theme_is_view_with_layout_option()\n{\n // This option is available on all pages. It's also available on archives when there isn't a sidebar.\n return (is_page() || (is_archive() && ! is_active_sidebar('sidebar-1')));\n}", "private function style_matches_slug( $slug ) {\n\t\treturn ( $slug === $this->slplus->SmartOptions->style->value );\n\t}", "function custom_theme_sanitize_page_layout($input)\n{\n $valid = array(\n 'one-column' => __('One Column', 'theme'),\n 'two-column' => __('Two Column', 'theme'),\n );\n\n if (array_key_exists($input, $valid)) {\n return $input;\n }\n\n return '';\n}", "public function is_layout ()\n {\n return is_a( $this, __NAMESPACE__ . '\\\\Layout' );\n }", "function layout_first()\n { \n foreach (func_get_args() as $name) {\n if(! empty($name) && $layout = the_layout($name)) {\n return $layout;\n }\n } \n\n $error = 'Not Found Layout(s) '. collect(func_get_args())->filter()->implode(', ') . '.';\n\n return abort(500, $error);\n }", "private function layoutExists($file) {\n\t\treturn file_exists($this->getLayoutFile($file));\n\t}", "function cinerama_edge_dashboard_page() {\n\t\treturn is_page_template('user-dashboard.php');\n\t}", "public function validSlug($slug){\n $course = Course::where('slug', $slug)->first();\n if($course):\n return false;\n else:\n return true;\n endif; \n }", "public function get_theme_layout ($layout_slug='') {\r\n\t\tif (empty($layout_slug)) return '';\r\n\r\n\t\t$filenames = array(\r\n\t\t\t'layouts/index-' . $layout_slug . '.php',\r\n\t\t\t'layouts/' . $layout_slug . '.php',\r\n\t\t);\r\n\t\treturn function_exists('upfront_locate_template')\r\n\t\t\t? upfront_locate_template($filenames)\r\n\t\t\t: locate_template($filenames)\r\n\t\t;\r\n\t}", "public function checkNewPostLayoutContent(){\n\t\t\n\t\t$this->validateInited();\n\t\t\t\t\n\t\t//check meta data\n\t\tif(!empty($this->metaData))\n\t\t\treturn(false);\n\t\t\n\t\t//get post content\n\t\t$postContent = $this->post->post_content;\n\t\t$postContent = trim($postContent);\n\t\t\n\t\tif(empty($postContent))\n\t\t\treturn(false);\n\t\t\t\n\t\t//generate addon data\n\t\t$arrAddonContent = $this->generateHtmlAddonContentForLayout($postContent);\n\t\tif(empty($arrAddonContent))\n\t\t\treturn(false);\n\t\t\n\t\t//add row to empty layout with the addon data\n\t\t$this->addRowWithHtmlAddon($arrAddonContent);\n\t\t\n\t}", "public function isOnepage()\r\n {\r\n if($this->_params['layout'] != 'onepage'){\r\n return false;\r\n }\r\n return true;\r\n }", "private function slug_exists($slug)\n\t\t{\n\t\t\t$where = '@slug=\"'.utf8_encode($slug).'\"';\n\t\t\t$node = $this->xml->xpath('/post/friendly/url['.$where.']');\n\n\t\t\tif($node==array())\n\t\t\t\treturn false;\n\n\t\t\treturn true;\n\t\t}", "function _layout_builder_bundle_has_no_layouts($entity_type_id, $bundle) {\n $entity_update_manager = \\Drupal::entityDefinitionUpdateManager();\n $entity_type = $entity_update_manager->getEntityType($entity_type_id);\n $bundle_key = $entity_type->getKey('bundle');\n $query = \\Drupal::entityTypeManager()->getStorage($entity_type_id)->getQuery();\n if ($bundle_key) {\n $query->condition($bundle_key, $bundle);\n }\n if ($entity_type->isRevisionable()) {\n $query->allRevisions();\n }\n $query->exists(OverridesSectionStorage::FIELD_NAME)\n ->accessCheck(FALSE)\n ->range(0, 1);\n $results = $query->execute();\n return empty($results);\n}", "public function is_on_dashboard() {\n return ($this->page->pagelayout == 'mydashboard');\n }", "function condition() {\n\t\treturn ! empty( $_GET['page'] ) && $this->args['page_slug'] === $_GET['page']; // Input var okay.\n\t}", "public static function should_enqueue_masonry() {\n\t\tif ( self::is_blog() === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$hestia_alternative_blog_layout = get_theme_mod( 'hestia_alternative_blog_layout', 'blog_normal_layout' );\n\t\tif ( $hestia_alternative_blog_layout !== 'blog_alternative_layout2' ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$hestia_grid_layout = get_theme_mod( 'hestia_grid_layout', 1 );\n\t\tif ( $hestia_grid_layout === 1 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn get_theme_mod( 'hestia_enable_masonry', false );\n\t}", "public function is_on_page_with_description() {\n return ($this->page->pagelayout == 'pagewithdescription');\n }", "public function hasSlug($slug);" ]
[ "0.6541276", "0.65177697", "0.63184744", "0.6231651", "0.6229931", "0.6144456", "0.61089736", "0.60230285", "0.5954641", "0.59452987", "0.59440255", "0.58904546", "0.58605665", "0.5769495", "0.57340306", "0.5714853", "0.5679132", "0.5677173", "0.5646282", "0.5607264", "0.5603999", "0.5583978", "0.5527843", "0.552178", "0.5510028", "0.55059993", "0.5482826", "0.5480829", "0.54595774", "0.5453388" ]
0.6903078
0
Function to get an array with all translations in all entire project
function getAllTranslations() { $translations = []; $modules = $this->getAllModulesOfProject(); sort($modules); foreach ($modules as $module) { $trans = $this->getTranslationsOfModule($module); if ($trans) { foreach ($trans as $value) { foreach ($value as $key => $val) { $langsAvailable = $this->getAvailableLangsOfKey($key); if (!isset($translations[$key])) { $translations[$key] = [ 'key' => $key, 'value' => $val, 'module' => $module->name, 'locale' => implode(', ', $langsAvailable) ]; } else { $isPrivateModulo = $this->modulesRegistry->isPrivateModule($module->name); if ($isPrivateModulo) { $translations[$key] = [ 'key' => $key, 'value' => $val, 'module' => $module->name, 'locale' => implode(', ', $langsAvailable) ]; } } } } } } return $translations; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllTranslationByLanguage();", "protected function translations(): array\n {\n return $this->cache->get('translations', function (): array {\n return array_values(array_map(function (SplFileInfo $file): string {\n return $file->getBasename('.yaml');\n }, iterator_to_array(\n Finder::create()->in($this->config->get('translations_path'))->name('*.yaml')\n )));\n });\n }", "protected abstract function getTranslations();", "public function translations() {\n return $this->client->get(self::$apiName, array());\n }", "public function allTranslations()\n {\n return $this->allLanguages()->mapWithKeys(function ($name, $language) {\n return [$language => $this->allTranslationsFor($language)];\n });\n }", "public function getTranslations()\n {\n }", "public function elfinderLocalizations()\n {\n $i18n = [];\n\n foreach ($this->localizations() as $id => $translations) {\n if ($translations instanceof Translation) {\n foreach ($translations->data() as $language => $message) {\n $i18n[$language][$id] = $message;\n }\n } else {\n $i18n[$language][$id] = $translations;\n }\n }\n\n return $i18n;\n }", "public function getTranslationsByLocale()\n {\n if (!($arColl = $this->getTranslations())) {\n\n return [];\n }\n $out = [];\n foreach ($arColl as $trans) {\n $out[$trans->getLocale()] = $trans;\n }\n\n return $out;\n }", "public function translationsAll()\n {\n return $this->hasMany($this->translatableModel, 'source_id');\n }", "protected function getTranslations() {\n\t\treturn $this->_viewHelper->getTranslations();\n\t}", "function GetLocalizedTexts()\n\t{\n\t\t$result = $this->sendRequest(\"GetLocalizedTexts\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public static function getTranslations() {\n $settings = self::getSettings();\n return json_decode($settings->translations, true);\n }", "public function getTranslations()\n {\n return $this->translations;\n }", "public function getTranslationsArray() {\r\n\t\treturn preg_split('#/#', $this->translation, null, PREG_SPLIT_NO_EMPTY);\r\n\t}", "public function getTranslations()\n {\n return array_map(function ($id) {\n return $id ? new static($id, $this->model) : false;\n }, $this->getTranslationsIDs());\n }", "function &getTranslations(){\n\t\tif ( isset( $this->_cache[__FUNCTION__]) ) return $this->_cache[__FUNCTION__];\n\t\t$tables =& $this->tables();\n\t\t$translations = array();\n\t\tforeach ( array_keys($tables) as $tablename){\n\t\t\t$translations = array_merge($translations, $tables[$tablename]->getTranslations());\n\t\t}\n\t\t$this->_cache[__FUNCTION__] =& $translations;\n\t\treturn $translations;\n\t\t\n\t}", "public function getAll(){\n\t\t$url = WEBSERVICE. \"languages/getAll\";\n\t\t$this->HTTPRequest->setUrl($url);\n\t\t$this->HTTPRequest->setMethod(\"GET\");\n\t\t$arrayResponse = $this->HTTPRequest->sendHTTPRequest();\n\t\treturn $this->arrayToLanguage($arrayResponse, false);\n\t}", "public function translationMessages()\n {\n return [];\n }", "function wp_get_available_translations()\n {\n }", "public function getTranslationsById()\n {\n if (!($arColl = $this->getTranslations())) {\n\n return [];\n }\n $out = [];\n foreach ($arColl as $trans) {\n if (!$trans->getId()) {\n continue;\n }\n $out[$trans->getId()] = $trans;\n }\n\n return$out;\n }", "public function getTranslations( $language )\n\t{\n\t\t$sql = <<<TRANSLATIONS\nSELECT\n\t*\nFROM\n\t`i18n_messages` m\nLEFT JOIN\n\ti18n_translations t ON m.id=t.id_message AND lang =?\nORDER BY\n\tt.translation ASC, m.message ASC\nTRANSLATIONS;\n\n\treturn $this->GetArray( $sql, array( $language, 'tag' => 'Get all translations for current language' ) );\n\t}", "public function translations()\n {\n $locales = config('translatable.locales');\n $fallback_locale = config('translatable.fallback_local');\n unset($locales[$fallback_locale]);\n $translations_count = count($locales);\n if ($translations_count === 1) {\n return $this->hasOne(get_class() . 'Translation');\n } else {\n return $this->hasMany(get_class(), 'Translation');\n }\n }", "public function translations()\n\t{\n\t\treturn $this->hasMany($this->getTranslatorClassName(), 'original_id');\n\t}", "public function getLanguageList();", "public function getTranslationsIDs()\n {\n return [];\n }", "public function getMultilingual();", "public static function getArrayTranslations() {\n return array(\n\n 'mot' => 'mot', 'secondmot' => 'second mot', 'bienvenue' => 'bienvenue'\n\n );\n\n }", "public function getAll(){\n if(!isset($this->array_lang_en)){\n $this->initEn();\n }\n if(!isset($this->array_lang_fr)){\n $this->initEn();\n }\n return [\n 'eng' => $this->array_lang_en,\n 'fr' => $this->array_lang_fr\n ];\n }", "public function getAll()\n {\n return $this->getContainer()->getParameter('locales');\n }", "public function getTranslations()\n {\n return $this->language;\n }" ]
[ "0.7936426", "0.781887", "0.774593", "0.7547088", "0.7544516", "0.731501", "0.7163456", "0.71537936", "0.71046144", "0.71046126", "0.7083187", "0.7042341", "0.6965644", "0.69579184", "0.68774176", "0.6872991", "0.68667144", "0.6848462", "0.68352705", "0.6820744", "0.6805927", "0.67679626", "0.67483646", "0.67449796", "0.6743701", "0.67301494", "0.6711175", "0.6701673", "0.66899693", "0.6688034" ]
0.8123033
0
Method to get all translations of specific module
function getTranslationsOfModule($module) { $translations = []; $resourcesLangPath = $this->getResourcesLangPath($module); $iniFiles = $this->getIniFilesOfModule($module); foreach ($iniFiles as $file => $data) $translations[str_replace('.ini', '', $data)] = parse_ini_file ("$resourcesLangPath/$data"); return $translations; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllTranslations()\n {\n $translations = [];\n $modules = $this->getAllModulesOfProject();\n sort($modules);\n\n foreach ($modules as $module)\n {\n $trans = $this->getTranslationsOfModule($module);\n if ($trans)\n {\n foreach ($trans as $value)\n {\n foreach ($value as $key => $val)\n {\n $langsAvailable = $this->getAvailableLangsOfKey($key);\n\n if (!isset($translations[$key]))\n {\n $translations[$key] = [\n 'key' => $key,\n 'value' => $val,\n 'module' => $module->name,\n 'locale' => implode(', ', $langsAvailable)\n ];\n }\n else\n {\n $isPrivateModulo = $this->modulesRegistry->isPrivateModule($module->name);\n if ($isPrivateModulo)\n {\n $translations[$key] = [\n 'key' => $key,\n 'value' => $val,\n 'module' => $module->name,\n 'locale' => implode(', ', $langsAvailable)\n ];\n }\n }\n }\n }\n }\n }\n return $translations;\n }", "protected abstract function getTranslations();", "public function getAllTranslationByLanguage();", "public function translations() {\n return $this->client->get(self::$apiName, array());\n }", "public function getTranslations()\n {\n }", "protected function getTranslations() {\n\t\treturn $this->_viewHelper->getTranslations();\n\t}", "function GetLocalizedTexts()\n\t{\n\t\t$result = $this->sendRequest(\"GetLocalizedTexts\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "protected function getModules() {\n\t\t$modules = parent::getModules();\n\t\t\n\t\t// Get only modules with translations\n\t\treturn array_filter($modules, function(Module $module) {\n\t\t\t// Automatically skip un-translateable modules\n\t\t\treturn $module->isTranslatable();\n\t\t});\n\t}", "public function getTranslations()\n {\n return $this->language;\n }", "protected function translations(): array\n {\n return $this->cache->get('translations', function (): array {\n return array_values(array_map(function (SplFileInfo $file): string {\n return $file->getBasename('.yaml');\n }, iterator_to_array(\n Finder::create()->in($this->config->get('translations_path'))->name('*.yaml')\n )));\n });\n }", "public function getTranslations()\n {\n return $this->hasMany(NewsItemLang::class, ['news_item_id' => 'id']);\n }", "function getAll()\r\n\t\t{\r\n\t\t\treturn $this->lang;\r\n\t\t}", "public function translationsAll()\n {\n return $this->hasMany($this->translatableModel, 'source_id');\n }", "public static function getTranslations() {\n $settings = self::getSettings();\n return json_decode($settings->translations, true);\n }", "public function getTranslations()\n {\n return $this->translations;\n }", "public function getMultilingual();", "function wp_get_available_translations()\n {\n }", "public function getTranslationsForKey($key);", "public function getAll(){\n\t\t$url = WEBSERVICE. \"languages/getAll\";\n\t\t$this->HTTPRequest->setUrl($url);\n\t\t$this->HTTPRequest->setMethod(\"GET\");\n\t\t$arrayResponse = $this->HTTPRequest->sendHTTPRequest();\n\t\treturn $this->arrayToLanguage($arrayResponse, false);\n\t}", "public function translations()\n\t{\n\t\treturn $this->hasMany($this->getTranslatorClassName(), 'original_id');\n\t}", "public function getStrings ()\n {\n return $this->translate;\n }", "function fetch_languages( $module_id = false )\n\t{\n\t\tif( $module_id ) {\n\t\t\t$this->db->where( 'module_id',$module_id );\n\t\t}\n\t\t$query=$this->db->get( 'languages' );\n\t\t$this->db->flush_cache();\n\t\treturn $query->result_array();\n\t}", "public function getAll()\n {\n return $this->getContainer()->getParameter('locales');\n }", "public function getLanguageList();", "function &getTranslations(){\n\t\tif ( isset( $this->_cache[__FUNCTION__]) ) return $this->_cache[__FUNCTION__];\n\t\t$tables =& $this->tables();\n\t\t$translations = array();\n\t\tforeach ( array_keys($tables) as $tablename){\n\t\t\t$translations = array_merge($translations, $tables[$tablename]->getTranslations());\n\t\t}\n\t\t$this->_cache[__FUNCTION__] =& $translations;\n\t\treturn $translations;\n\t\t\n\t}", "public function getLocalizedStringsList() {\n return $this->_get(1);\n }", "public function allTranslations()\n {\n return $this->allLanguages()->mapWithKeys(function ($name, $language) {\n return [$language => $this->allTranslationsFor($language)];\n });\n }", "public function getTranslationsById()\n {\n if (!($arColl = $this->getTranslations())) {\n\n return [];\n }\n $out = [];\n foreach ($arColl as $trans) {\n if (!$trans->getId()) {\n continue;\n }\n $out[$trans->getId()] = $trans;\n }\n\n return$out;\n }", "private function translations()\n {\n $this['translator'] = $this->share($this->extend('translator', function ($translator) {\n $translator->addLoader('yaml', new TranslationFileLoader());\n\n $translator->addResource('yaml', 'config/locales/pt-br.yml', 'pt-br');\n $translator->addResource('yaml', 'config/locales/en-us.yml', 'en-us');\n $translator->addResource('yaml', 'config/locales/es-es.yml', 'es-es');\n\n return $translator;\n }));\n }", "public function translations()\n {\n $locales = config('translatable.locales');\n $fallback_locale = config('translatable.fallback_local');\n unset($locales[$fallback_locale]);\n $translations_count = count($locales);\n if ($translations_count === 1) {\n return $this->hasOne(get_class() . 'Translation');\n } else {\n return $this->hasMany(get_class(), 'Translation');\n }\n }" ]
[ "0.77585846", "0.7519644", "0.75016063", "0.73077905", "0.7251117", "0.70535856", "0.68925446", "0.68523324", "0.6808986", "0.6746941", "0.6741045", "0.6738055", "0.6695994", "0.6666037", "0.6640058", "0.66320163", "0.6596456", "0.65793896", "0.6564944", "0.65433246", "0.6516435", "0.650354", "0.64208376", "0.64129037", "0.64091176", "0.6394581", "0.6376064", "0.63537717", "0.6335977", "0.6297856" ]
0.7816113
0
Method to get all languages where the indicated key is registered
function getAvailableLangsOfKey($key) { $langs = []; $modules = $this->getAllModulesOfProject(); foreach ($modules as $module) { $translations = $this->getTranslationsOfModule($module); foreach ($translations as $lang => $value) { if (get($value,$key)) $langs[$key][] = strtoupper($this->locale->shortCode ($lang)); } } return $langs ? array_unique($langs[$key]) : []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLanguageList();", "public function getLanguages();", "public function getLanguages() {}", "protected function getLanguages() {}", "public function getTranslationsForKey($key);", "function GetLanguages() // static function\r\n\t{\r\n\t\treturn array_keys ( $this->m_languages );\r\n\t}", "public function getAllTranslationByLanguage();", "public function get_desired_languages();", "public function getLanguageData(string $language_key): array;", "public static function loadLanguages()\n\t{\n\t\tself::$_LANGUAGES = array();\n\t\t$result = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'Language`');\n\t\tforeach ($result AS $row)\n\t\t\tself::$_LANGUAGES[(int)$row['LanguageId']] = $row;\n\t}", "public function getSiteLanguages();", "public function getAvailableLanguages() {}", "public function getSupportedLocalesKeys();", "public static function getAllLanguages()\n {\n\t\tstatic $languages; \n\t\tif($languages == null){\n\t\t\t$db = JFactory::getDbo();\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$default = self::getDefaultLanguage();\n\t\t\t$query->select('lang_id, lang_code, title, `sef`')\n\t\t\t\t->from('#__languages')\n\t\t\t\t->where('published = 1')\n\t\t\t\t->order('ordering');\n\t\t\t$db->setQuery($query);\n\t\t\t$languages = $db->loadObjectList();\n\t\t}\n return $languages;\n }", "function redes_get_languages() {\n $result = [];\n $languages = db_select('languages', 'lan')\n ->fields('lan', ['language', 'name'])\n ->execute()\n ->fetchAll();\n if(isset($languages) && !empty($languages)){\n foreach ($languages as $lang) {\n $result[$lang->language] = $lang->name;\n }\n }//end if\n return $result;\n}", "public function getLanguages($book_id);", "function getAll()\r\n\t\t{\r\n\t\t\treturn $this->lang;\r\n\t\t}", "public function actionLanguages() {\n return Lang::getList();\n }", "public function languages();", "public static function getAllLanguage() {\n $languages = Language::select('name', 'code', 'flag')->get();\n $data = array();\n foreach ($languages as $language) {\n $data[$language->code]['name'] = $language->name;\n $data[$language->code]['flag'] = url(self::LANGUAGE_THUMB_DIR . $language->flag);\n }\n\n return $data;\n }", "public static function GetLanguages() {\n try {\n $vi = 'vi';\n return DB::table('languages')\n ->where('deleted_at', null)\n ->where('language_code', '<>', $vi)\n ->select(\n 'language_code as code',\n 'language_name as name'\n )\n ->get()->toArray();\n } catch (Exception $e) {\n return [];\n }\n }", "public function getMultilingual();", "public function getLanguages()\n {\n $endpoint = $this->endpoints['getLanguages'];\n return $this->sendRequest($endpoint['method'], $endpoint['uri']);\n }", "public function getLanguagesList() {\n return $this->_get(2);\n }", "function signup_get_available_languages()\n {\n }", "public function languages_get() {\n $languages = $this->api_model->languages_get();\n $this->set_response($languages, REST_Controller::HTTP_OK);\n }", "public function getLanguages() {\n\t\t$url = self::API_URL . $this->getMethodName(self::METHOD_GET_LANGUAGES);\n\t\t\n\t\t$response = json_decode($this->doRequest($url, array(\n\t\t\t'key' => $this->apiKey,\n 'ui' => 'en'\n\t\t)));\n\t\t\n\t\t$languages = array();\n\t\tforeach($response->langs as $abbr => $name){\n\t\t\tarray_push($languages, new \\Webcook\\Translator\\Results\\LanguageResult($abbr, $name));\n\t\t}\n\t\t\n\t\treturn $languages;\n\t}", "function getAvailableLanguages($language = \"en\")\n{\n $languages = [];\n $dirs = glob(resource_path(\"lang/*\"));\n foreach ($dirs as $dir)\n {\n $boom = explode(\"/\",$dir);\n if (strlen($boom[count($boom)-1]) === 2)\n {\n $languages[$boom[count($boom)-1]] = trans(\"languages.\" . $boom[count($boom)-1],[],$language);\n }\n }\n return $languages;\n}", "private function getAllLangs()\n\t{\n\t\t$options = array();\n\t\t$sql = \"SELECT * FROM \" . $this->db->prefix . \"site_languages WHERE is_online = 1\";\n\t\t$result = $this->db->query($sql);\n\t\t$available_languages = array();\n\t\twhile($row = $this->db->fetchToRow($result)){\n\t\t\t$available_languages[] = $row[ 'lang' ];\n\t\t\t$options[ $row[ 'lang' ] ][ 'lang' ] = $row[ 'lang' ];\n\t\t\t$options[ $row[ 'lang' ] ][ 'language' ] = ucfirst($row[ 'language' ]);\n\t\t}\n\t\t$this->language_options = $options;\n\n\t\treturn $available_languages;\n\t}", "public function getAll(){\n\t\t$url = WEBSERVICE. \"languages/getAll\";\n\t\t$this->HTTPRequest->setUrl($url);\n\t\t$this->HTTPRequest->setMethod(\"GET\");\n\t\t$arrayResponse = $this->HTTPRequest->sendHTTPRequest();\n\t\treturn $this->arrayToLanguage($arrayResponse, false);\n\t}" ]
[ "0.74686384", "0.7355214", "0.7268893", "0.72001886", "0.7180961", "0.715266", "0.70666873", "0.7051027", "0.6897231", "0.68570435", "0.68503135", "0.68440163", "0.6818944", "0.6803733", "0.6786593", "0.67756516", "0.67755", "0.67456156", "0.67223006", "0.6699972", "0.66971886", "0.66873085", "0.66792244", "0.6652719", "0.6649301", "0.66335535", "0.6616824", "0.66083664", "0.6601858", "0.65917987" ]
0.76414835
0
Private method to get resources languages folder of specific module
function getResourcesLangPath($module) { return "$module->path/{$this->localizationSettings->moduleLangPath}"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getLanguagePath()\n {\n return $this->resourcePath('lang');\n }", "function sti_get_localization_directory()\r\n\t{\r\n\t\treturn \"localization\";\r\n\t}", "function sti_get_localization_directory()\n\t{\n\t\treturn \"localization\";\n\t}", "public static function LanguageFolder()\n {\n return dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR.Configuration::getApplicationFolder().DIRECTORY_SEPARATOR.'Language';\n }", "public static function getLanguageDir() {\n return public_path(self::LANGUAGE_DIR);\n }", "function modules_get_language($script = 'global')\n{\n $currentlang = pnSessionGetVar('lang');\n $language = pnConfigGetVar('language');\n\n\tif (!isset($GLOBALS['ModName'])) {\n\t\t$modname = pnModGetName();\n\t} else {\n\t\t$modname = $GLOBALS['ModName'];\n\t}\n\t$modinfo = pnModGetInfo(pnModGetIDFromName($modname));\n\n \tif (file_exists('modules/'.pnVarPrepForOS($modinfo['directory']).'/lang/'.pnVarPrepForOS($currentlang).\"/$script.php\")) {\n\t\t@include_once 'modules/'.pnVarPrepForOS($modinfo['directory']).'/lang/'.pnVarPrepForOS($currentlang).\"/$script.php\";\n \t} elseif (!empty($language)) {\n\t \tif (file_exists('modules/'.pnVarPrepForOS($modinfo['directory']).'/lang/'.pnVarPrepForOS($language).\"/$script.php\")) {\n\t\t\t@include_once 'modules/'.pnVarPrepForOS($modinfo['directory']).'/lang/'.pnVarPrepForOS($language).\"/$script.php\";\n\t \t}\n \t} else {\n \t// nothing found, use english translation stuff\n\t\tif (file_exists('modules/'.pnVarPrepForOS($modinfo['directory']).\"/lang/eng/$script.php\")) {\n\t\t\t@include_once 'modules/'.pnVarPrepForOS($modinfo['directory']).\"/lang/eng/$script.php\";\n \t}\n \t}\n \treturn;\n}", "private function getLocalesDirectory()\r\n {\r\n // Get path from config\r\n return config('transeditor.language_file_path');\r\n }", "protected function paths()\n {\n return [\n base_path('lit/resources/lang/'),\n ];\n }", "function getAvailableLanguages($language = \"en\")\n{\n $languages = [];\n $dirs = glob(resource_path(\"lang/*\"));\n foreach ($dirs as $dir)\n {\n $boom = explode(\"/\",$dir);\n if (strlen($boom[count($boom)-1]) === 2)\n {\n $languages[$boom[count($boom)-1]] = trans(\"languages.\" . $boom[count($boom)-1],[],$language);\n }\n }\n return $languages;\n}", "public function wp_lang_dir()\n {\n }", "protected function getResourceDir(): string\n {\n $dirParts = [\n AutoloaderInterface::MODULES_PATHNAME,\n $this->getModuleContext(),\n 'res'\n ];\n\n return implode(DIRECTORY_SEPARATOR, $dirParts);\n }", "abstract public function get_app_language();", "function getLanguageFiles() // used in admin_configuration.php\r\n\r\n{\r\n\r\n\t$directory = \"models/languages/\";\r\n\r\n\t$languages = glob($directory . \"*.php\");\r\n\r\n\t//print each file name\r\n\r\n\treturn $languages;\r\n\r\n}", "public static function langPath(){\n return \\Illuminate\\Foundation\\Application::langPath();\n }", "public function getModulesFiles($module = null)\n {\n if ($module !== null) {\n $langs = collect();\n $files = Finder::create()\n ->in($this->laravel->modules->get($this->argument('module'))->getPath().'/Resources/lang')\n ->name('*.json');\n foreach ($files as $lang) {\n $this->addContent($lang);\n }\n $this->line('');\n $this->line(' <comment>Module: </comment><info>'.$module.'</info> added!');\n } else {\n foreach ($this->laravel->modules->all() as $module) {\n if (count($this->files->allFiles($module->getPath().'/Resources/lang')) > 0) {\n $langs = collect();\n $files = Finder::create()\n ->in($module->getPath().'/Resources/lang')\n ->name('*.json');\n $f = collect();\n foreach ($files as $lang) {\n $this->addContent($lang);\n }\n }\n $this->line('');\n $this->line(' <comment>Module: </comment> <info>'.$module.'</info> added!');\n }\n }\n }", "protected function getLocalLangFileName() {}", "public function getThemeLanguageDir()\n {\n return $this->paths->getThemeLanguageDir();\n }", "function includeLocalLang()\t{\n\t\t$llFile = t3lib_extMgm::extPath('f2contentce').'Resources/Private/Language/locallang.xml';\n\t\t$LOCAL_LANG = t3lib_div::readLLXMLfile($llFile, $GLOBALS['LANG']->lang);\n\t\treturn $LOCAL_LANG;\n\t}", "function scf_resources_dir() {\n $res_modules = array('gene', 'antibody', 'modelorganism', 'researchstatement');\n\n $nodes = array();\n $pagers = array();\n\n $elt = 0;\n foreach ($res_modules as $mod) {\n if (module_exists($mod)) {\n list($n, $pager) = module_invoke($mod, 'load_recent_nodes', 5, $elt++);\n $nodes[$mod] = $n;\n $pagers[$mod] = $pager;\n }\n }\n\n return theme('bio_resources', $nodes, $pagers);\n}", "protected function getWordListPath(): string\n {\n return __DIR__ . \"/../data/{$this->locale}.txt\";\n }", "public function getBaseLanguageDir()\n {\n return $this->paths->getBaseLanguageDir();\n }", "function _get_path_to_translation_from_lang_dir($domain)\n {\n }", "public function loadLanguage( $module = null )\r\n\t{\r\n\t\tstatic $included = array();\r\n\t\t\r\n\t\t$dun\t= & get_dunamis( $module );\r\n\t\t$path\t= $dun->getModulePath( $module, 'lang');\r\n\t\t$idiom\t= $this->getIdiom();\r\n\t\t\r\n\t\t$paths\t\t=\tarray( $path . 'English.php', $path . ucfirst( $idiom ) . '.php' );\r\n\t\t\r\n\t\tforeach ( $paths as $path ) {\r\n\t\t\tif (! file_exists( $path ) ) continue;\r\n\t\t\t$s\t=\tbase64_encode( $path );\r\n\t\t\t\r\n\t\t\tif (! isset( $included[$s] ) ) $included[$s] = null;\r\n\t\t\t\r\n\t\t\tif ( empty( $included[$s] ) ) {\r\n\t\t\t\tinclude_once( $path );\r\n\t\t\t\t$included[$s]\t=\t$lang;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$lang = $included[$s];\r\n\t\t\t\r\n\t\t\t$this->appendTranslations( $lang, $module );\r\n\t\t}\r\n\t\t\r\n\t\treturn self :: $instance;\r\n\t}", "function GetLanguageArray()\n{\n global $config, $lang;\n $dh = opendir($config['paths']['root'] . \"language/\");\n unset($lang['languages']);\n $lang['languages'] = array();\n while (false !== ($filename = readdir($dh))) {\n if ($filename != \".\" && $filename != '.svn' && $filename != \"..\" && $filename != \"flags\"\n && is_dir(\n $config['paths']['root'] . \"language/\" . $filename\n )\n ) {\n $lang['languages'][] = $filename;\n }\n }\n}", "function themes_get_language($script = 'global')\n{\n}", "function getTranslationsOfModule($module)\n {\n $translations = [];\n $resourcesLangPath = $this->getResourcesLangPath($module);\n $iniFiles = $this->getIniFilesOfModule($module);\n foreach ($iniFiles as $file => $data)\n $translations[str_replace('.ini', '', $data)] = parse_ini_file (\"$resourcesLangPath/$data\");\n\n return $translations;\n }", "private function pluginDir()\n {\n global $plugins;\n\n if (isset($_GET['pi'])) {\n $pi = preg_replace('/\\W/', '', $_GET['pi']);\n\n if (isset($plugins[$pi]) && is_object($plugins[$pi])) {\n return $plugins[$pi]->coderoot;\n }\n }\n throw new \\Exception('I18N must be created within a plugin');\n }", "function get ($key,$localeName = null)\n {\n $modulesRegistry = $this->modulesRegistry;\n\n if (!$localeName)\n $localeName = $this->locale->locale();\n\n $modules = $this->getAvailableModulesOfKey($key);\n $privateModule = \"\";\n foreach ($modules as $module)\n if ($this->modulesRegistry->isPrivateModule($module))\n $privateModule = $module;\n\n if ($privateModule) $modules = [$privateModule];\n\n if (!$modules)\n return $key;\n\n sort($modules);\n $module = $modulesRegistry->getModule($modules[0]);\n $path = $this->getResourcesLangPath($module).\"/$localeName.ini\";\n\n return $this->translationData->get($key, $path);\n }", "protected function getLanguages() {}", "static function get_available_module_path($nome_categoria,$nome_modulo)\n {\n // framework/core\n\n if ($nome_categoria===ModuleUtils::FRAMEWORK_CATEGORY_NAME && $nome_modulo===ModuleUtils::FRAMEWORK_MODULE_NAME)\n return DS.ModuleUtils::get_framework_core_path();\n\n //moduli primari\n $module_dir = new Dir(DS.ModuleUtils::get_modules_path().$nome_categoria.DS.$nome_modulo.DS);\n //ok aggiunto controllo su definizione del modulo\n $module_def = new File($module_dir->getPath().self::MODULE_DEFINITION_FILE);\n\n if ($module_def->exists())\n return $module_dir->getPath();\n\n //eccezione, modulo non trovato\n throw new Exception(\"Il modulo di categoria $nome_categoria di nome $nome_modulo non esiste!\");\n }" ]
[ "0.74307245", "0.69792694", "0.6939375", "0.6815248", "0.67490596", "0.6584351", "0.65752465", "0.6532462", "0.6508149", "0.6459096", "0.63418084", "0.63270485", "0.6311079", "0.63049555", "0.63046765", "0.6297079", "0.62796825", "0.62702113", "0.62194806", "0.62148356", "0.6188624", "0.61715007", "0.61562186", "0.6142436", "0.6133976", "0.6132172", "0.61197925", "0.6092208", "0.60784155", "0.60773027" ]
0.83719397
0
Private method to get all modules of current project
private function getAllModulesOfProject() { return $this->modulesRegistry->getModules(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModules();", "public function getModules();", "public function getModules() {\n }", "public function all()\n {\n return $this->modules;\n }", "public function getIncludedModules ();", "public function getModulesList();", "public function getModules()\n {\n return array();\n }", "public function getModules(){\n $qb = $this->createQueryBuilder();\n $qb->module('system')->query('modulelist');\n return $this->execute($qb);\n }", "public function getAllModules()\n\t{\n\t\treturn $this->modules;\n\t}", "public function getLoadedModules() {}", "public static function getModules(){ \n $db = new db();\n $db->connect();\n $modules = $db->selectAll('modules');\n return self::getModulesInfo($modules);\n }", "public static function getAllModules()\n\t\t{\n\n\t\t\t$modules = array();\n\n\t\t\treturn apply_filters( 'studiorum_modules', $modules );\n\n\t\t}", "public function getDirectoryModules();", "function get_all_modules() {\n return \\melt\\internal\\get_all_modules();\n}", "function forminator_get_modules() {\n\t$forminator = Forminator_Core::get_instance();\n\n\treturn $forminator->modules;\n}", "public function getModules()\n {\n return $this['module.list'];\n }", "public function getAll()\n {\n $this->_modules['core'][] = array (\n 'module' => 'Magento',\n 'codePool' => 'core',\n 'active' => 'true',\n 'version' => Mage::getVersion()\n );\n\n foreach (Mage::getConfig()->getModuleConfig() as $node) {\n foreach ($node as $module => $data) {\n if (!isset($data->codePool)) {\n continue;\n }\n $codePool = $data->codePool->asArray();\n if (empty($codePool)) {\n continue;\n }\n if (is_array($codePool)) {\n $codePool = implode('.', $codePool);\n }\n\n $this->_modules[$codePool][] = array (\n 'module' => $module,\n 'codePool' => $codePool,\n 'active' => $data->active,\n 'version' => $data->version\n );\n }\n }\n\n return $this->_modules;\n }", "public function getModules() {\n return $this->modules;\n }", "public static function modules() {\n\t\tif (!isset(self::$_modules)) {\n//\t\t\tif(\\GO::user()){\n//\t\t\t\n//\t\t\tCaching caused more problems than benefits\n//\t\t\t\n//\t\t\t\tif(isset(\\GO::session()->values['modulesObject']) && !isset($GLOBALS['GO_CONFIG'])){\n//\t\t\t\t\tself::$_modules=\\GO::session()->values['modulesObject'];\n//\t\t\t\t}else{\n//\t\t\t\t\tself::$_modules=\\GO::session()->values['modulesObject']=new \\GO\\Base\\ModuleCollection();\n//\t\t\t\t}\n//\t\t\t}else\n//\t\t\t{\n//\t\t\t\tself::$_modules=new \\GO\\Base\\ModuleCollection();\n//\t\t\t}\n\t\t\t\n\t\t\tself::$_modules=new \\GO\\Base\\ModuleCollection();\n\t\t}\n\t\treturn self::$_modules;\n\t}", "function qa_list_modules_info()\n{\n\tglobal $qa_modules;\n\treturn $qa_modules;\n}", "public function getModules()\n {\n return $this->modules;\n }", "public function getModules()\n {\n return $this->modules;\n }", "public function getModules()\n {\n return $this->modules;\n }", "function getModules() {\n // transverse component directory\n $files = scandir($this->componentDir, 1);\n $dirs = [];\n\n // find all directories\n foreach ($files as $file) {\n if (($file != \".\") && ($file != \"..\") && is_dir($this->componentDir . DIRECTORY_SEPARATOR . $file)) {\n array_push($dirs, $this->getModule($file));\n }\n }\n\n // remember the structure within the module\n $this->modules = $dirs;\n\n return $dirs;\n }", "public function getModules() {\n if($this->_Modules === NULL) {\n $this->_Modules = array();\n $dir = opendir('modules');\n while ($cnt = readdir($dir)) {\n if ($cnt == '.' || $cnt == '..') {\n continue;\n }\n $configFile = \"modules/$cnt/module.json\";\n if (!is_file($configFile)) {\n continue;\n }\n $json_data = file_get_contents($configFile);\n $config = json_decode($json_data, true);\n $config[\"folder\"] = \"modules/$cnt\";\n $config[\"config\"] = file_exists(\"modules/$cnt/config.php\") === true;\n $this->_Modules[$config['code']] = $config;\n }\n closedir($dir); \n }\n return $this->_Modules;\n }", "public function getExistingModules() {\n if($this->cache->load(\"existingModules\") !== NULL) {\n return $this->cache->load(\"existingModules\");\n }\n else {\n $existingClasses = $this->getClasses();\n $existingModules = array();\n foreach($existingClasses as $fullName => $path)\n {\n $explode = explode(\"\\\\\", $fullName);\n if($explode[0] == \"AdminModule\" && !in_array($explode[1], $existingModules) && preg_match(\"~[a-zA-Z]+Module~\",$explode[1]) !== 0) {\n $path = pathinfo($path, PATHINFO_DIRNAME);\n $path = str_replace(\"/presenters\", \"\", $path);\n $path = str_replace(\"\\presenters\", \"\", $path);\n $existingModules[$path] = $explode[1];\n }\n }\n $this->cache->save(\"existingModules\", $existingModules);\n return $existingModules;\n }\n }", "public function getModuleList(){\n $qb = $this->createQueryBuilder();\n $qb->module('system')->query('modulelistnames');\n return $this->execute($qb);\n }", "public static function availableModules() {\n\t\t$children = array();\n\t\tforeach(get_declared_classes() as $class){\n\t\t if(is_subclass_of((string)$class, 'WorkflowCategory')) {\n\t\t\t\t$children[] = $class;\n\t\t\t}\n\t\t}\n\t\t//This was the old method we shouldn't need this any longer\n\t\t$modules = self::$registeredModules;\n\t\t$children = $modules;\n\t\t//print_r($children);\n\t\treturn $children;\n\t}", "public static function modules()\n {\n return static::$modules ?: static::$modules = new Modules;\n }", "private function listModules() {\n\t\t\n\t\t$tabModules = array ();\n\t\t\n\t\t# search for modules in {appPath}/lib/modules/{module_name}/{module_name}.class.php\n\t\t$res = opendir(LIB_MOD);\n\t\t$i = 0;\n\t\twhile (false !== ($fModule = readdir($res))) {\n\t\t\tif (is_dir(LIB_MOD . $fModule) && $fModule != '.' && $fModule != '..') {\n\t\t\t\tif (is_file(LIB_MOD . $fModule .'/'. $fModule .'.class.php')) {\n\t\t\t\t\t$tabModules[$i]['name'] = $fModule;\n\t\t\t\t\t$tabModules[$i]['link'] = $this->conf['general']['appURL'] .'?action='. $fModule .'.show';\n\t\t\t\t\t++$i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($res);\n\t\t$ret = array (\n\t\t\t'modules'\t=> $tabModules\n\t\t);\n\t\t\n\t\treturn $ret;\n\t}" ]
[ "0.81733066", "0.81733066", "0.8046601", "0.7664847", "0.76621205", "0.7625909", "0.75027376", "0.74667656", "0.7464819", "0.74457943", "0.7423007", "0.73694557", "0.73416436", "0.7336872", "0.73325574", "0.71203834", "0.7119757", "0.70992935", "0.70629334", "0.70449466", "0.7040552", "0.7040552", "0.7040552", "0.7028186", "0.7011229", "0.69741374", "0.6948477", "0.69045854", "0.6887873", "0.68805945" ]
0.8411386
0
Method to get all modules where the indicated key is registered
function getAvailableModulesOfKey($key) { $availableModules = []; $modules = $this->getAllModulesOfProject(); foreach ($modules as $module) { $translations = $this->getTranslationsOfModule($module); foreach ($translations as $lang => $value) { if (get($value,$key) && !in_array($module->name, $availableModules)) $availableModules[] = $module->name; } } return $availableModules; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModules();", "public function getModules();", "function qa_load_all_modules_with($method)\n{\n\t$modules = array();\n\n\t$regmodules = qa_list_modules_info();\n\n\tforeach ($regmodules as $moduletype => $modulesinfo) {\n\t\tforeach ($modulesinfo as $modulename => $moduleinfo) {\n\t\t\t$module = qa_load_module($moduletype, $modulename);\n\n\t\t\tif (method_exists($module, $method))\n\t\t\t\t$modules[$modulename] = $module;\n\t\t}\n\t}\n\n\treturn $modules;\n}", "public function getModules() {\n }", "public function getLoadedModules() {}", "public function getModulesList();", "public static function getModules(){ \n $db = new db();\n $db->connect();\n $modules = $db->selectAll('modules');\n return self::getModulesInfo($modules);\n }", "public function getLoadedModules($loadModules);", "public function getIncludedModules ();", "function forminator_get_modules() {\n\t$forminator = Forminator_Core::get_instance();\n\n\treturn $forminator->modules;\n}", "public function getAvailableModules(string $module): array;", "public static function search()\n {\n return [\n 'module_name' => 'string',\n 'module_key' => 'string',\n ];\n }", "public function getModules()\n {\n return array();\n }", "private static function search()\r\n\t{\r\n\t\t$dir = 'plugins';\r\n\t\t// search for plugin modules in the plugins directory\t\t \r\n\t\t$modules = model_Utils_ModuleHelper::searchDirectoryForModules($dir);\r\n\t\tforeach ($modules as $module)\r\n\t\t{\r\n\t\t\t// save found module paths to the db so we can auto-load them in the future\r\n\t\t\tmodel_Utils_ModuleHelper::saveModule($module);\r\n\t\t\t// add matching paths to Kohana's module paths\t\t\r\n\t\t\tmodel_Utils_ModuleHelper::addModulePath($module);\r\n\t\t}\r\n\t\treturn Model_Admin_EventsAdmin::searchForListeners($dir,'Interface_iPCPPlugin');\t\r\n\t}", "public static function getAllModules()\n\t\t{\n\n\t\t\t$modules = array();\n\n\t\t\treturn apply_filters( 'studiorum_modules', $modules );\n\n\t\t}", "function qa_load_modules_with($type, $method)\n{\n\t$modules = array();\n\n\t$trynames = qa_list_modules($type);\n\n\tforeach ($trynames as $tryname) {\n\t\t$module = qa_load_module($type, $tryname);\n\n\t\tif (method_exists($module, $method))\n\t\t\t$modules[$tryname] = $module;\n\t}\n\n\treturn $modules;\n}", "protected function getAllModules()\n {\n return Hook::getHookModuleExecList('displayHeader');\n }", "public function all()\n {\n return $this->modules;\n }", "public function getModules()\n {\n return $this['module.list'];\n }", "public function getModules(){\n $qb = $this->createQueryBuilder();\n $qb->module('system')->query('modulelist');\n return $this->execute($qb);\n }", "function qa_list_modules($type)\n{\n\t$modules = qa_list_modules_info();\n\treturn is_array(@$modules[$type]) ? array_keys($modules[$type]) : array();\n}", "static function get_all_available_modules()\n {\n $result = array();\n\n $categories = self::get_all_available_categories();\n\n foreach ($categories as $nome_categoria)\n {\n $names = self::get_all_available_by_category($nome_categoria);\n\n if (is_array($names))\n foreach ($names as $nome_modulo)\n {\n $def = self::get_available_module_definition($nome_categoria,$nome_modulo);\n \n $mod = array();\n $mod[\"show\"] = $def->get_show();\n $mod[\"nome_categoria\"] = $nome_categoria;\n $mod[\"nome_modulo\"] = $nome_modulo;\n $version = $def->get_current_version();\n $mod[\"properties\"] = $version;\n $result[] = $mod;\n \n }\n else echo \"Errore per la categoria : \".$nome_categoria;\n\n }\n\n return $result;\n }", "function getModules()\n\t{\n\t\t $this->loadModel('Module'); \n\n\t\t $sections = $this->Module->query(\"SELECT * FROM modules WHERE enable = '1'\");\n\t\t return $sections;\n\t}", "public function loadModules();", "public function getAllModules()\n\t{\n\t\treturn $this->modules;\n\t}", "public function getRequestableModule();", "public function getModuleList(){\n $qb = $this->createQueryBuilder();\n $qb->module('system')->query('modulelistnames');\n return $this->execute($qb);\n }", "private function getModules() {\n // @todo Only do a full rebuild of the module cache every 1 at the most\n $modules = system_rebuild_module_data();\n uasort($modules, 'system_sort_modules_by_info_name');\n\n $result = array();\n $keys_to_send = array('name', 'version', 'package', 'core', 'project');\n foreach ($modules as $module) {\n $info = array();\n $info['status'] = $module->status;\n foreach ($keys_to_send as $key) {\n $info[$key] = isset($module->info[$key]) ? $module->info[$key] : '';\n }\n $info['filename'] = $module->getPathname();\n if (empty($info['project']) && $module->origin == 'core') {\n $info['project'] = 'drupal';\n }\n\n // Determine which files belong to this module and hash them.\n $module_path = explode('/', $info['filename']);\n array_pop($module_path);\n\n // We really only care about this module if it is in 'sites' or in\n // 'modules' folder.\n // Otherwise it is covered by the hash of the distro's modules.\n if ($module_path[0] == 'sites' || $module_path[0] == 'modules') {\n $contrib_path = implode('/', $module_path);\n\n // Get a hash for this module's files. If we nest into another module,\n // we'll return. and that other module will be covered by it's entry in\n // the system table.\n //\n // !! At present we aren't going to do a per module hash, but rather a\n // per-project hash. The reason being that it is too hard to tell an\n // individual module apart from a project.\n list($info['module_data']['hashes'], $info['module_data']['fileinfo']) = self::generateHashesHelper($contrib_path);\n }\n else {\n $info['module_data']['hashes'] = array();\n $info['module_data']['fileinfo'] = array();\n }\n\n $result[] = $info;\n }\n return $result;\n }", "public function getAllModules()\n {\n $modules = array();\n $query = 'SELECT m.id, m.name, t.name AS theme FROM tl_module m LEFT JOIN tl_theme t ON m.pid=t.id';\n\n if (\\Input::get('table') == 'tl_module' && \\Input::get('act') == 'edit') {\n $query .= ' WHERE m.id != ?';\n }\n\n $query .= ' ORDER BY t.name, m.name';\n $result = \\Database::getInstance()\n ->prepare($query)\n ->execute(\\Input::get('id'));\n\n while ($result->next()) {\n $modules[$result->theme][$result->id] = $result->name . ' (ID ' . $result->id . ')';\n }\n\n return $modules;\n }", "function qa_list_modules_info()\n{\n\tglobal $qa_modules;\n\treturn $qa_modules;\n}" ]
[ "0.700129", "0.700129", "0.67833364", "0.6589975", "0.655044", "0.6474812", "0.6364183", "0.61944747", "0.6189151", "0.61363125", "0.6130783", "0.61043257", "0.6074729", "0.60546374", "0.60528034", "0.60104096", "0.5999453", "0.5987314", "0.5967615", "0.59352195", "0.5924302", "0.5921744", "0.59162337", "0.5915759", "0.59088475", "0.59026915", "0.590027", "0.5887185", "0.5883562", "0.5876729" ]
0.71593446
0
Get the intrinsic ratio used to calculate the responsive video size.
public function intrinsic_ratio() { return ($this->slide_video_dimensions['height'] / $this->slide_video_dimensions['width']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function intrinsic_ratio()\n {\n $w = intval($this->r_width);\n $h = intval($this->r_height);\n return $h / $w;\n }", "public function ratio()\r\n {\r\n if (is_null($this->ratio)) {\r\n $this->ratio = $this->width() / 64;\r\n }\r\n\r\n return $this->ratio;\r\n }", "public function aspectRatio()\n {\n if ($this->aspect_ratio) {\n return $this->aspect_ratio;\n }\n\n $exact_ratio = $this->rex_media->getWidth() / $this->rex_media->getHeight();\n $ratio_found = false;\n foreach (self::ASPECT_RATIOS as $ratio) {\n if (naju_float::eq($exact_ratio, $ratio, 0.2)) {\n $this->aspect_ratio = $ratio;\n $ratio_found = true;\n break;\n }\n }\n if (!$ratio_found) {\n $this->aspect_ratio = $exact_ratio;\n }\n\n return $this->aspect_ratio;\n }", "public function getAspectRatio()\n {\n return $this->aspectRatio;\n }", "public function aspectRatio()\n {\n return $this->setRightOperand(PVar::ASPECT_RATIO);\n }", "public function calcRatio()\n {\n // round to 5DP (0.1px for a 10k image)\n $this->ratio = round($this->loaded_width / $this->loaded_height, 5);\n // orientation\n $this->orientation = 'x';\n if ($this->loaded_width < $this->loaded_height) {\n $this->orientation = 'y';\n }\n }", "public function ratio()\n {\n $result = null;\n foreach ($this->data as $value) {\n if (isset($result)) {\n $result = $result / $value;\n\n } else {\n $result = $value;\n }\n }\n\n return $result;\n }", "public function trimmedAspectRatio()\n {\n return $this->setRightOperand(PVar::TRIMMED_ASPECT_RATIO);\n }", "public function initialAspectRatio()\n {\n return $this->setRightOperand(PVar::INITIAL_ASPECT_RATIO);\n }", "function _image_get_preview_ratio($w, $h)\n {\n }", "function _ratio(&$img,$maxwidth,$maxheight=0){\n if(!$maxheight) $maxheight = $maxwidth;\n\n $w = $this->_meta($img,'width');\n $h = $this->_meta($img,'height');\n\n $ratio = 1;\n if($w >= $h){\n if($w >= $maxwidth){\n $ratio = $maxwidth/$w;\n }elseif($h > $maxheight){\n $ratio = $maxheight/$h;\n }\n }else{\n if($h >= $maxheight){\n $ratio = $maxheight/$h;\n }elseif($w > $maxwidth){\n $ratio = $maxwidth/$w;\n }\n }\n return $ratio;\n }", "public function getRatio(): Amount\n {\n return $this->ratio;\n }", "function fa_player_height( $aspect_ratio, $width ){\n\t$width = absint($width);\n\t$height = 0;\n\tswitch( $aspect_ratio ){\n\t\tcase '4x3':\n\t\t\t$height = ($width * 3) / 4;\n\t\tbreak;\n\t\tcase '16x9':\n\t\tdefault:\t\n\t\t\t$height = ($width * 9) / 16;\n\t\tbreak;\t\n\t}\n\treturn $height;\n}", "public static function getAspectRatio($aspect)\n {\n return self::getMetaProperty($aspect, 'ratio');\n }", "public function getRatio() {\r\n if (($this->getRightAnswers() + $this->getWrongAnswers()) > 0) {\r\n $ratio = ( ( $this->getRightAnswers() - $this->getWrongAnswers() ) / ( $this->getRightAnswers() + $this->getWrongAnswers() ) );\r\n return $ratio;\r\n }else{\r\n return 0;\r\n }\r\n }", "function _width($height){\n\t\t\t\treturn intval($this->ratio*intval($height));\n\t\t\t}", "protected function calculateMediaWidthsAndHeights() {}", "public static function getAspectRatio($aspect)\n {\n return self::getMetaProperty($aspect, 'aspectRatio');\n }", "public function getMediaSize()\n {\n return $this->mediaSize;\n }", "function kalium_extract_aspect_ratio( $str = '' ) {\n\t$ratio = [];\n\n\tif ( ! empty( $str ) && preg_match( '/^(?<w>[0-9]+)(:|x)(?<h>[0-9]+)$/', trim( $str ), $matches ) ) {\n\t\t$ratio = [\n\t\t\t'width' => $matches['w'],\n\t\t\t'height' => $matches['h']\n\t\t];\n\t}\n\n\treturn $ratio;\n}", "public function getRatio(): float\n {\n if (0 == $this->total) {\n return 0.0;\n }\n return floatval($this->value / $this->total);\n }", "public function getCalculatedQuality()\n {\n $this->processQualityOptionIfNotAlready();\n return $this->calculatedQuality;\n }", "public function getWidth()\n {\n // Support for 'n%', relative to parent\n return $this->parseGlobalValue_h($this->w);\n }", "public function getResolution()\n {\n return $this->resolution;\n }", "function image_reproportion()\n\t{\n\t\tif ( ! is_numeric($this->dst_width) OR ! is_numeric($this->dst_height) OR $this->dst_width == 0 OR $this->dst_height == 0)\n\t\t\treturn;\n\t\t\n\t\tif ( ! is_numeric($this->src_width) OR ! is_numeric($this->src_height) OR $this->src_width == 0 OR $this->src_height == 0)\n\t\t\treturn;\n\t\n\t\tif (($this->dst_width >= $this->src_width) AND ($this->dst_height >= $this->src_height))\n\t\t{\n\t\t\t$this->dst_width = $this->src_width;\n\t\t\t$this->dst_height = $this->src_height;\n\t\t}\n\t\t\n\t\t$new_width\t= ceil($this->src_width*$this->dst_height/$this->src_height);\t\t\n\t\t$new_height\t= ceil($this->dst_width*$this->src_height/$this->src_width);\n\t\t\n\t\t$ratio = (($this->src_height/$this->src_width) - ($this->dst_height/$this->dst_width));\n\n\t\tif ($this->master_dim != 'width' AND $this->master_dim != 'height')\n\t\t{\n\t\t\t$this->master_dim = ($ratio < 0) ? 'width' : 'height';\n\t\t}\n\t\t\n\t\tif (($this->dst_width != $new_width) AND ($this->dst_height != $new_height))\n\t\t{\n\t\t\tif ($this->master_dim == 'height')\n\t\t\t{\n\t\t\t\t$this->dst_width = $new_width;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->dst_height = $new_height;\n\t\t\t}\n\t\t}\n\t}", "public function dimensions($video) {\n //lets setup our dimensions. Make sure our aspect ratio matches the dimensions to be used, if not lets add black bars.\n $aspect_ratio = _video_aspect_ratio($video->filepath);\n $ratio = $aspect_ratio['ratio'];\n $width = $aspect_ratio ['width'];\n $height = $aspect_ratio['height'];\n\n $wxh = explode('x', $video->dimensions);\n $output_width = $wxh[0];\n $output_height = $wxh[1];\n $output_ratio = number_format($output_width / $output_height, 4);\n\n if ($output_ratio != $ratio && $width && $height) {\n $options = array();\n // Figure out our black bar padding.\n if ($ratio < $output_width / $output_height) {\n $end_width = $output_height * $ratio;\n $end_height = $output_height;\n } else {\n $end_height = $output_width / $ratio;\n $end_width = $output_width;\n }\n\n // We need to get back to an even resolution and maybe compare with our defaults?\n // @TODO Make this more exact on actual video dimensions instead of making sure the wxh are even numbers\n\n if ($end_width == $output_width) {\n // We need to pad the top/bottom of the video\n $padding = round($output_height - $end_height);\n $pad1 = $pad2 = floor($padding / 2);\n if ($pad1 % 2 !== 0) {\n $pad1++;\n $pad2--;\n }\n if (variable_get('video_ffmpeg_pad_method', 0)) {\n $options[] = '-vf \"pad=' . round($output_width) . ':' . round($output_height) . ':0:' . $pad1 . '\"';\n } else {\n $options[] = '-padtop ' . $pad1;\n $options[] = '-padbottom ' . $pad2;\n }\n } else {\n // We are padding the left/right of the video.\n $padding = round($output_width - $end_width);\n $pad1 = $pad2 = floor($padding / 2); //@todo does padding need to be an even number?\n if ($pad1 % 2 !== 0) {\n $pad1++;\n $pad2--;\n }\n if (variable_get('video_ffmpeg_pad_method', 0)) {\n $options[] = '-vf \"pad=' . round($output_width) . ':' . round($output_height) . ':' . $pad1 . ':0\"';\n } else {\n $options[] = '-padleft ' . $pad1;\n $options[] = '-padright ' . $pad2;\n }\n }\n\n $end_width = round($end_width) % 2 !== 0 ? round($end_width) + 1 : round($end_width);\n $end_height = round($end_height) % 2 !== 0 ? round($end_height) + 1 : round($end_height);\n //add our size to the beginning to make sure it hits our -s\n array_unshift($options, $end_width . 'x' . $end_height);\n return implode(' ', $options);\n } else {\n return $video->dimensions;\n }\n }", "public function getWidthProportionMd(): ?string;", "public function getResolution();", "public function getPreviewPixelWidth()\n {\n return isset($this->preview_pixel_width) ? $this->preview_pixel_width : null;\n }", "private static function getAspectRatio(int $width, int $height) : float\n\t{\n\t\treturn floatval($width/$height);\n\t}" ]
[ "0.8139961", "0.75486", "0.72354454", "0.7170941", "0.6863232", "0.6560961", "0.6264969", "0.62637305", "0.6252468", "0.62079614", "0.59535044", "0.5945698", "0.59242505", "0.5867603", "0.5864762", "0.5812672", "0.57373184", "0.5709485", "0.56588614", "0.5621279", "0.5593527", "0.550194", "0.54867357", "0.54749435", "0.54569626", "0.54560363", "0.5435774", "0.5430382", "0.5390487", "0.5373189" ]
0.87134606
0
Gets the application's auth adapter.
public static function getAuthAdapter() { if (null == self::$_authAdapter) { throw new Celsus_Exception("Auth adapter has not been set!"); } return self::$_authAdapter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAuthAdapter()\n {\n if (!$this->_authAdapter) {\n throw new Zend_Controller_Action_Exception(\n \"No auth adapter set\"\n );\n }\n\n return $this->_authAdapter;\n }", "public function getAuthAdapter()\n {\n if (!$this->_authAdapter) {\n throw new Zend_Controller_Action_Exception(\n \"No auth adapter set\"\n );\n }\n\n return $this->_authAdapter;\n }", "public function getAuth()\n {\n return $this->get('core.auth');\n }", "public function getAuthProvider()\n {\n return $this->authProvider;\n }", "public function getAuthProvider() {\n return $this->authProvider;\n }", "public function getAuth()\n {\n if (null === $this->_auth) {\n $this->_auth = Zend_Auth::getInstance();\n }\n return $this->_auth;\n }", "public function getAuthManager();", "public function getAdapter()\n\t{\n\t\treturn $this->req->getAdapter();\n\t}", "public function getPasswordAdapter()\n {\n return $this->adapter;\n }", "protected function getAuthService()\n {\n return $this->services['auth'] = new \\phpbb\\auth\\auth();\n }", "public function getAdapter()\n\t{\n\t\treturn $this->config['adapter'];\n\t}", "public function getAuthenticationProvider() {\n\t\treturn $this->authProvider;\n\t}", "public function getHelper () {\n\t\tif (!$this->initialized)\n\t\t\t$this->init();\n\t\t\n\t\tif (is_null($this->authHelper))\n\t\t\tthrow new Exception(\"No authentication helper is available. Maybe one wasn't configured.\", 450);\n\t\t\n\t\treturn $this->authHelper;\n\t}", "public function getTempAuthAdapter()\n {\n if (!$this->_tempAuthAdapter) {\n throw new Zend_Controller_Action_Exception(\n \"No temp auth adapter set\"\n );\n }\n\n return $this->_tempAuthAdapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAuth() {\n\t\treturn $this->auth;\n\t}", "public static function authManager(){\n return Yii::$app->authManager;\n }", "public function getAdapter()\n\t{\n\t\treturn $this->adapter;\n\t}", "public function getAdapter()\n\t{\n\t\treturn $this->adapter;\n\t}", "public function get_adapter()\n {\n return $this->_adapter;\n }", "public function getAuth()\n {\n $db = new db(self::db_auth);\n return unserialize($db->getAuth());\n\n }", "public function getAuthService()\n {\n if (!$this->authService) {\n $this->authService = $this->serviceManager->get('zfcuser_auth_service');\n }\n\n return $this->authService;\n }", "public static function adapter()\n {\n return self::connectionManager()->getAdapter(static::connectionName());\n }" ]
[ "0.7517111", "0.7517111", "0.70926493", "0.7074507", "0.7058152", "0.69433445", "0.676704", "0.66693985", "0.6613607", "0.6541378", "0.6526375", "0.6520811", "0.6495131", "0.6481802", "0.6472004", "0.6472004", "0.6472004", "0.6472004", "0.6472004", "0.6472004", "0.6472004", "0.6472004", "0.647142", "0.6388418", "0.6372875", "0.6372875", "0.63550496", "0.6249623", "0.6248427", "0.62411827" ]
0.8052087
0
/ checks if YouTube video exists
private function validateYoutubeVideo($id_youtube) { $headers = get_headers('http://gdata.youtube.com/feeds/api/videos/' . $id_youtube); if (!strpos($headers[0], '200')) return false; // video does not exists return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasVideo() {}", "function isYoutube($url)\n {\n\treturn (substr_count(strtolower($url), \"youtube.com\"));\n }", "function landtalk_check_youtube_id_valid( $id ) {\n\tif ( empty( $id ) ) {\n\t\treturn false;\n\t}\n\n\t$url = add_query_arg(\n\t\tarray(\n\t\t\t'part' => 'status',\n\t\t\t'id' => $id,\n\t\t\t'key' => YOUTUBE_API_KEY,\n\t\t),\n\t\t'https://www.googleapis.com/youtube/v3/videos'\n\t);\n\n\t$response = wp_remote_get( $url );\n\t$response_body = wp_remote_retrieve_body( $response );\n\t$parsed_response_body = json_decode( $response_body, true );\n\tif (\n\t\t! empty( $parsed_response_body )\n\t\t&& ! empty( $parsed_response_body['items'] )\n\t\t&& ! empty( $parsed_response_body['items'][0] )\n\t\t&& ! empty( $parsed_response_body['items'][0]['status'] )\n\t\t&& ! empty( $parsed_response_body['items'][0]['status']['embeddable'] )\n\t) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "public function isYoutube($url) \n {\n return $this->isUrlTypeOf(Factory::TYPE_YOUTUBE, $url);\n }", "function videoLink($video)\n{\n\t\t\tif ( substr_count ( $video, 'http://youtu.be/' ) \t\t\t\t> 0 )\n\t\t\t{\n\t\t\t\t$vidIDStart \t= strpos($video, 'http://youtu.be/') + strlen('http://youtu.be');\n\t\t\t\t$vidID\t\t\t= substr($video, $vidIDStart);\n\t\t\t\t$vidURL \t\t= \"https://youtube.com/embed\".$vidID;\n\t\t\t}\n\telse\tif ( substr_count ( $video, 'https://youtu.be/' ) \t\t\t\t> 0 )\n\t\t\t{\n\t\t\t\t$vidIDStart \t= strpos($video, 'https://youtu.be/') + strlen('https://youtu.be');\n\t\t\t\t$vidID\t\t\t= substr($video, $vidIDStart);\n\t\t\t\t$vidURL \t\t= \"https://youtube.com/embed\".$vidID;\n\t\t\t}\n\telse\tif ( substr_count ( $video,\t'https://www.youtube.com/watch?v=') > 0 )\n\t\t\t{\n\t\t\t\t$vidIDStart \t= strpos($video, 'https://www.youtube.com/watch?v=') + strlen('https://www.youtube.com/watch?v=');\n\t\t\t\t$vidID\t\t\t= substr($video, $vidIDStart);\n\t\t\t\t$vidURL \t\t= \"https://youtube.com/embed/\".$vidID;\n\t\t\t}\t\n\telse\tif ( substr_count ( $video,\t'http://www.youtube.com/watch?v=') \t> 0 )\n\t\t\t{\n\t\t\t\t$vidIDStart \t= strpos($video, 'http://www.youtube.com/watch?v=') + strlen('http://www.youtube.com/watch?v=');\n\t\t\t\t$vidID\t\t\t= substr($video, $vidIDStart);\n\t\t\t\t$vidURL \t\t= \"https://youtube.com/embed/\".$vidID;\n\t\t\t}\t\t\t\n\telse\tif ( substr_count ( $video, 'http://vimeo.com/')\t\t\t\t\t\t\t> 0 )\n\t\t\t{\n\t\t\t\t$vidIDStart \t= strpos($video, 'http://vimeo.com/') + strlen('http://vimeo.com/');\n\t\t\t\t$vidID\t\t\t= substr($video, $vidIDStart);\n\t\t\t\t$vidURL \t\t= \"https://player.vimeo.com/video/\".$vidID;\n\t\t\t}\n\telse\tif ( substr_count ( $video, 'https://vimeo.com/')\t\t\t\t\t\t\t> 0 )\n\t\t\t{\t\t\t\n\t\t\t\t$vidIDStart \t= strpos($video, 'https://vimeo.com/') + strlen('https://vimeo.com/');\n\t\t\t\t$vidID\t\t\t= substr($video, $vidIDStart);\n\t\t\t\t$vidURL \t\t= \"https://player.vimeo.com/video/\".$vidID;\n\t\t\t}\n\telse\n\t\t\t{\n\t\t\t\t$video = '';\n\t\t\t\t$vidURL = '';\n\t\t\t}\t\n\t$vid = array($vidURL, $video);\n\treturn $vid;\n}", "function GetYoutubeVideoByURL($youtubeURL) {\r\n\t// Old logic to fetch load URL \r\n\t/*\r\n\t$handler = new YoutubeConverter(); \r\n\t$return = Message::get_info_message(\"Success!\");\r\n\r\n\t// Check whether the url is valid \r\n\tif(!empty($youtubeURL) && !filter_var($youtubeURL, FILTER_VALIDATE_URL) === false)\r\n\t{ \r\n\t\t\r\n\t // Get the downloader object \r\n\t $downloader = $handler->getDownloader($youtubeURL); \r\n\t \r\n\t // Set the url \r\n\t $downloader->setUrl($youtubeURL); \r\n\t \r\n\t // Validate the youtube video url \r\n\t if($downloader->hasVideo())\r\n\t { \r\n\t // Get the video download link info \r\n\t $videoDownloadLink = $downloader->getVideoDownloadLink(); \r\n\t \r\n \tif(isset($videoDownloadLink) && $videoDownloadLink != null)\r\n \t{\r\n\t\t \t$videoTitle = $videoDownloadLink[0]['title']; \r\n\t\t\t\t$videoQuality = $videoDownloadLink[0]['qualityLabel']; \r\n\t\t\t\t$videoFormat = $videoDownloadLink[0]['format']; \r\n\t\t\t\t$videoFileName = strtolower(str_replace(' ', '_', $videoTitle)).'.'.$videoFormat; \r\n\t\t\t\t$downloadURL = $videoDownloadLink[0]['url']; \r\n\t\t\t\t$fileName = preg_replace('/[^A-Za-z0-9.\\_\\-]/', '', basename($videoFileName)); \r\n\r\n\t\t if(!empty($downloadURL))\r\n\t\t \t$return = Message::get_download_message(\"Success\", $downloadURL, $fileName);\r\n\t\t else\r\n\t\t \t\t$return = Message::get_error_message(\"Cannot Get Video Download Url. Please, Try Again.\");\r\n\t \t}\r\n\t \telse\r\n\t \t\t$return = Message::get_error_message(\"Cannot Get Video Donwload URL. Please, Try Again.\");\r\n\t } \r\n\t else\r\n\t \t$return = Message::get_error_message(\"The video is not found, please check YouTube URL.\");\r\n\t} else\r\n \treturn Message::get_error_message(\"Please provide valid YouTube URL.\");\r\n\t*/\r\n\r\n\r\n\tif(!empty($youtubeURL) && !filter_var($youtubeURL, FILTER_VALIDATE_URL) === false)\r\n\t{ \r\n\t\t\r\n \t$dl = new YoutubeDl([\r\n\t\t 'continue' => false, // force resume of partially downloaded files. By default, youtube-dl will resume downloads if possible.\r\n\t\t 'format' => 'bestvideo+bestaudio',\r\n\t\t]);\r\n\t\t// For more options go to https://github.com/rg3/youtube-dl#user-content-options\r\n\r\n\t\t$dl->setDownloadPath('/var/www/html/videos');\r\n\t\t// Enable debugging\r\n\t\t/*$dl->debug(function ($type, $buffer) {\r\n\t\t if (\\Symfony\\Component\\Process\\Process::ERR === $type) {\r\n\t\t echo 'ERR > ' . $buffer;\r\n\t\t } else {\r\n\t\t echo 'OUT > ' . $buffer;\r\n\t\t }\r\n\t\t});*/\r\n\t\ttry {\r\n\t\t $video = $dl->download($youtubeURL);\r\n\t\t //echo $video->getTitle(); // Will return Phonebloks\r\n\t\t //$video->getFile(); // \\SplFileInfo instance of downloaded file\r\n\t\t \r\n\t\t $actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? \"https\" : \"http\") . \"://$_SERVER[HTTP_HOST]\";\r\n\t\t $link = $actual_link . \"/videos/\". $video->getFilename();\r\n\t\t chmod(\"/var/www/html/videos/\".$video->getFilename(), 777);\r\n \t\t\r\n \t\treturn Message::get_download_message(\"Video is downloading. You will be redirected to the download page.\", $link , $video->getFilename());\r\n\t\t} catch (NotFoundException $e) {\r\n\t\t return Message::get_error_message(\"Video not found\");\r\n\t\t} catch (PrivateVideoException $e) {\r\n\t\t return Message::get_error_message(\"Video is private\");\r\n\t\t} catch (CopyrightException $e) {\r\n\t\t return Message::get_error_message(\"The YouTube account associated with this video has been terminated due to multiple third-party notifications of copyright infringement\");\r\n\t\t} catch (Exception $e) {\r\n\t\t return Message::get_error_message(\"Failed to download\");\r\n\t\t}\r\n\r\n \treturn Message::get_error_message(\"Something goes wrong while downloading video. Please, try again.\");\r\n\t} \r\n\telse\r\n \treturn Message::get_error_message(\"Please provide valid YouTube URL.\");\r\n\r\n return $return;\r\n}", "function getRandomVideoURL(){\n\t$response = getHTTPContent(\"http://youtube.com\", true);\n\t\n\tif(preg_match_all('~href=\"/?watch\\?v=(.+?)\"~', $response, $matches)){\n\t\t$matches_array = $matches[1];\n\n\t\tshuffle($matches_array);\n\n\t\treturn \"http://www.youtube.com/watch?v=\".$matches_array[0];\n\t}\n\n\t_log(\"getRandomVideoURL: no videos found\", true);\n\n\treturn false;\n}", "public function isYouTube($url)\n {\n return (strpos($url, 'youtube.com/') !== false || strpos($url, 'youtu.be/') !== false);\n }", "public function has_video() {\r\n\t\treturn strlen( $this->video );\r\n\t}", "public function testGetVideoIdFromInvalidUrl()\n {\n $videoUrl = \"http://this-url-is-crap.com/?a=213213123123\";\n $controller = new YoutubeEmbed();\n \n $this->assertNull($controller->getVideoId($videoUrl));\n }", "public function checkURL($url)\n\t{\n\t\t$ret = false;\n\n\t\t$headers = get_headers(\n\t\t\t'http://gdata.youtube.com/feeds/api/videos/'.\n\t\t\t$this->getVideoId($url)\n\t\t);\n\n\t\tif (strpos($headers[0], '200')) \n\t\t{\n\t\t\t$ret = true;\n\t\t}\n\n\t\treturn $ret;\n\t}", "function parse_yturl($url) \n{\n $pattern = '#^(?:https?://)?(?:www\\.)?(?:youtu\\.be/|youtube\\.com(?:/embed/|/v/|/watch\\?v=|/watch\\?.+&v=))([\\w-]{11})(?:.+)?$#x';\n preg_match($pattern, $url, $matches);\n return (isset($matches[1])) ? $matches[1] : false;\n}", "public function get_youtube_id($url){\r\n if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) {\r\n return false;\r\n }\r\n $parsed_url = parse_url($url);\r\n \r\n if(strpos($parsed_url['host'], 'youtube.com')!==false){\r\n if(strpos($parsed_url['path'], '/watch')!==false){ // Regular url Eg. http://www.youtube.com/watch?v=9bZkp7q19f0\r\n parse_str($parsed_url['query'], $parsed_str);\r\n if(isset($parsed_str['v']) and !empty($parsed_str['v'])){\r\n return $parsed_str['v'];\r\n }\r\n } else if(strpos($parsed_url['path'], '/v/')!==false){ // \"v\" URL http://www.youtube.com/v/9bZkp7q19f0?version=3&autohide=1\r\n $id = str_replace('/v/','',$parsed_url['path']);\r\n if( !empty($id) ){\r\n return $id;\r\n }\r\n } else if(strpos($parsed_url['path'], '/embed/')!==false){ // Embed URL: http://www.youtube.com/embed/9bZkp7q19f0\r\n return str_replace('/embed/','',$parsed_url['path']);\r\n }\r\n } else if(strpos($parsed_url['host'], 'youtu.be')!==false){ // Shortened URL: http://youtu.be/9bZkp7q19f0\r\n return str_replace('/','',$parsed_url['path']);\r\n }\r\n \r\n return false;\r\n }", "function is_video() {\n return is_singular( array( 'video' ) );\n }", "public function checkTitleExists($videoTitle) {\n\t\t$result = mysql_query(\"select id from posts where video_title='$videoTitle'\");\n \tif(mysql_num_rows($result) == 0)\n \t{\n\t\t\treturn false;\n\t \t}else{\n\t \t\treturn true;\n\t\t}\n\t}", "function getYoutubeVideoId($url) {\n\n if (strpos($url, 'http://www.youtube.com/watch?v=') === 0) {\n\n //ini_set(\"allow_url_fopen\", 1); //função habilitada\n //ini_set(\"allow_url_include\", 1); //função habilitada\n\n $urlArray = explode(\"=\", $url);\n $urlArray = explode(\"&\", $urlArray[1]);\n $videoid = trim($urlArray[0]);\n\n //$videourl=\"http://www.youtube.com/api2_rest?method=youtube.videos.get_video_token&video_id=$videoid\";\n //$t = trim(strip_tags(@file_get_contents($videourl)));\n return $videoid;\n } else\n exit(\"Wrong URL / Parameters\");\n\n}", "function checkVideo(string $name): string\n{\n if (!filter_var($_POST[$name], FILTER_VALIDATE_URL)) {\n return check_youtube_url($_POST[$name]);\n }\n}", "function get_youtube_video($video_url) {\n\treturn preg_replace('~(http:\\/\\/www\\.youtube\\.com\\/watch\\?v=)(.*)~', 'http://www.youtube.com/v/$2', $video_url);\n}", "function has_header_video()\n {\n }", "function checkVideo($arrl)\n\t\t{\n\t\t\t//check if the post contain video\n\t\t\tif($arrl['is_video'] == true)\n\t\t\t{\n\t\t\t\treturn $arrl['video_url'];\n\t\t\t}\n\t\t}", "public static function isValidYoutubeURL($url)\n\t{\n\n\t\t$regex_pattern = \"/(youtube.com|youtu.be)\\/(watch)?(\\?v=)?(\\S+)?/\";\n\t\t$match;\n\n\t\tif(preg_match($regex_pattern, $url, $match)){\n\n\t\t\t// Valid url\n\t\t\treturn true;\n\n\t\t}else{\n\n\t\t\t// Not valid url\n\t\t\treturn false;\n\n\t\t}\n\t}", "function bnk_video($postid) {\r\n\r\n\t$video_url = get_post_meta($postid, 'bnk_video_url', true);\r\n\r\n\tif(preg_match('/youtube/', $video_url)) {\r\n\r\n\t\tif(preg_match('/[\\\\?\\\\&]v=([^\\\\?\\\\&]+)/', $video_url, $matches)) {\r\n\t\t\t$output = '<iframe title=\"YouTube video player\" class=\"youtube-player\" type=\"text/html\" width=\"645\" height=\"514\" src=\"http://www.youtube.com/embed/'.$matches[1].'\" frameborder=\"0\" allowFullScreen></iframe>';\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$output = __('Invalid <strong>Youtube</strong> URL.', 'bhinneka');\r\n\t\t}\r\n\r\n\t}\r\n\telseif(preg_match('/vimeo/', $video_url)) {\r\n\r\n\t\tif(preg_match('~^http://(?:www\\.)?vimeo\\.com/(?:clip:)?(\\d+)~', $video_url, $matches))\t{\r\n\t\t\t$output = '<iframe src=\"http://player.vimeo.com/video/'.$matches[1].'\" width=\"645\" height=\"363\" frameborder=\"0\"></iframe>';\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$output = __('Invalid <strong>Vimeo</strong> URL.', 'bhinneka');\r\n\t\t}\r\n\r\n\t}\r\n\telse {\r\n\t\t$output = stripslashes(htmlspecialchars_decode($video_url));\r\n\t}\r\n\techo $output;\r\n}", "function fs_get_youtube_id( $url ){\r\n\tpreg_match( \"#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\\/)[^&\\n]+|(?<=v=)[^&\\n]+|(?<=youtu.be/)[^&\\n]+#\", $url, $matches );\r\n\treturn $matches[0];\r\n}", "function ts_get_embaded_video($url) {\r\n\t\r\n\tif (strstr($url,'vimeo'))\r\n\t{\r\n\t\tif (preg_match('/(\\d+)/', $url, $matches))\r\n\t\t{\r\n\t\t\treturn '<iframe src=\"http://player.vimeo.com/video/'.$matches[0].'?title=0&amp;byline=0&amp;portrait=0&amp;color=ffffff\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';\r\n\t\t}\r\n\t}\r\n\telse if (strstr($url,'youtu'))\r\n\t{\r\n\t\t$pattern = \"#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\\/)[^&\\n]+(?=\\?)|(?<=v=)[^&\\n]+|(?<=youtu.be/)[^&\\n]+#\";\r\n\t\tif (preg_match($pattern, $url, $matches))\r\n\t\t{\r\n\t\t\t\r\n\t\t\treturn '<iframe src=\"http://www.youtube.com/embed/'.$matches[0].'\" frameborder=\"0\" allowfullscreen></iframe>';\r\n\t\t}\r\n\t}\r\n\treturn '';\r\n}", "public static function youtube(string $url, array $options = [], array $attr = []): ?string\n {\n if (preg_match('!youtu!i', $url) !== 1) {\n return null;\n }\n\n $uri = new Uri($url);\n $path = $uri->path();\n $query = $uri->query();\n $first = $path->first();\n $second = $path->nth(1);\n $host = 'https://' . $uri->host() . '/embed';\n $src = null;\n\n $isYoutubeId = function (?string $id = null): bool {\n if (empty($id) === true) {\n return false;\n }\n\n return preg_match('!^[a-zA-Z0-9_-]+$!', $id);\n };\n\n switch ($path->toString()) {\n // playlists\n case 'embed/videoseries':\n case 'playlist':\n if ($isYoutubeId($query->list) === true) {\n $src = $host . '/videoseries';\n }\n\n break;\n\n // regular video URLs\n case 'watch':\n if ($isYoutubeId($query->v) === true) {\n $src = $host . '/' . $query->v;\n\n $query->start = $query->t;\n unset($query->v, $query->t);\n }\n\n break;\n\n default:\n // short URLs\n if (Str::contains($uri->host(), 'youtu.be') === true && $isYoutubeId($first) === true) {\n $src = 'https://www.youtube.com/embed/' . $first;\n\n $query->start = $query->t;\n unset($query->t);\n\n // embedded video URLs\n } elseif ($first === 'embed' && $isYoutubeId($second) === true) {\n $src = $host . '/' . $second;\n }\n }\n\n if (empty($src) === true) {\n return null;\n }\n\n // append all query parameters\n foreach ($options as $key => $value) {\n $query->$key = $value;\n }\n\n // build the full video src URL\n $src = $src . $query->toString(true);\n\n // render the iframe\n return static::iframe($src, static::videoAttr($attr));\n }", "private function hasVideos($id_product)\n\t{\n\t\treturn Db::getInstance()->getValue(\"SELECT COUNT(`id`) FROM `\"._DB_PREFIX_.\"youtube` WHERE `id_product`='$id_product' AND `active`='1'\");\n\t}", "function show_youtube($video_link)\n {\n if (!empty($video_link)) {\n return 'http://www.youtube.com/v/' . _get_youtube_id_from_url($video_link);\n }\n }", "function has_hq($vdetails,$is_file=false)\r\n{\r\n if(!$is_file)\r\n $file = get_hq_video_file($vdetails);\r\n else\r\n $file = $vdetails;\r\n\r\n if(getext($file)=='mp4')\r\n return $file;\r\n else\r\n return false;\r\n}", "public function isVideo()\r\n {\r\n $this->caseClosedOrFail();\r\n\r\n return false;\r\n }", "function get_youtube_video_id($url){\n\treturn preg_replace(\"#http://.*youtube.com/.*v=([aA-zZ0-9]*)?.*#\", \"$1\", $url);\n}" ]
[ "0.7620277", "0.6999222", "0.67780435", "0.6568749", "0.6520824", "0.6519239", "0.6497901", "0.6456665", "0.63994825", "0.63982075", "0.6395107", "0.6388288", "0.6324664", "0.6307082", "0.6300856", "0.62773395", "0.6268459", "0.6256828", "0.62420994", "0.6212979", "0.6209806", "0.61961204", "0.61328745", "0.6129053", "0.60543424", "0.6051694", "0.6050459", "0.6032509", "0.6006297", "0.5987612" ]
0.7399397
1
/ checks if product has any assigned videos
private function hasVideos($id_product) { return Db::getInstance()->getValue("SELECT COUNT(`id`) FROM `"._DB_PREFIX_."youtube` WHERE `id_product`='$id_product' AND `active`='1'"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasVideo() {}", "public function product_videos( $product=null )\n\t{\n\t\t$CI =& get_instance();\n\t\t$this->product = ($product != null) ? $product : $this->product;\n\n\t\t$result = $CI->db->where(\"cv.product_id\",$this->product)->from(\"products_item_video AS cv\")->join(\"media_videos AS mv\",\"mv.id = cv.video_id\",\"left\")->get()->result();\n\t\treturn $result;\n\t}", "function taxonomy_is_video_attribute( $name ) {\n global $masvideos_attributes;\n\n return taxonomy_exists( $name ) && array_key_exists( $name, (array) $masvideos_attributes['video'] );\n }", "function wpc_2018_enable_watch_videos() {\n\tif ( function_exists( 'wpcampus_network_enable' ) ) {\n\t\twpcampus_network_enable( 'videos' );\n\t}\n}", "function wpc_2016_enable_watch_videos() {\n\tif ( function_exists( 'wpcampus_network_enable' ) ) {\n\t\twpcampus_network_enable( 'videos' );\n\t}\n}", "function is_videos() {\n return ( is_post_type_archive( 'video' ) || is_page( masvideos_get_page_id( 'videos' ) ) );\n }", "function is_video() {\n return is_singular( array( 'video' ) );\n }", "public function checkVideos() : boolean {\n\t\t$crl = curl_init();\n\t\tcurl_setopt($crl, CURLOPT_URL, $this->buildPostUrl());\n\t\tcurl_setopt($crl, CURLOPT_CUSTOMREQUEST, \"GET\");\n\t\tcurl_setopt($crl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($crl, CURLOPT_HTTPHEADER, array( \n\t\t\t\t'Authorization: Bearer '.$this->getToken(), \n\t\t\t 'Content-Type: application/json',\n\t\t\t 'Accept: application/vnd.vimeo.*+json;version=3.4'\n\t\t\t) \n\t\t);\n\t\tcurl_setopt($crl, CURLOPT_SSL_VERIFYPEER, true); \n\t\t$result = curl_exec($crl);\n\t\t$fixed = json_decode($result);\n\t\t$videos = $fixed->data;\n\t\techo '<pre>';\n\t\tvar_dump($videos);\n\t\tdie();\n\t\treturn $videos;\n\t}", "protected function _check_videos_transient() {\n\n\t\t$video_urls_transient = get_transient( $this->_ttw_api_url_transient );\n\n\t\tif ( ! $video_urls_transient ) {\n\t\t\t$this->_build_videos_transient();\n\t\t}\n\t}", "private function addVideoIfNeeded($product_images_old, $results) {\n\t\t\n\t\t// let's think that it's always needed\n\t\t$videoNeeded = true;\n\t\t/*\n\t\t$videoNeeded = false;\n\t\tforeach ($product_images_old as $img) {\n\t\t\tif (isset($img['video'])) {\n\t\t\t\t$videoNeeded = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t*/\n\t\tif ($videoNeeded) {\n\t\t\tforeach ($results as &$result) {\n\t\t\t\tif (!isset($result['video'])) {\n\t\t\t\t\t$result['video'] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($result);\n\t\t}\n\t\treturn $results;\n\t}", "public function has_video() {\r\n\t\treturn strlen( $this->video );\r\n\t}", "public function releaseUnusedBookedProducts()\n\t{\n\t\t$piIdArray = array();\n\t\t$now = date('Y-m-d H:i:s');\n\t\t\n\t\t$query = \"select * from product_instance where available = ? and updated < ? and TIMESTAMPDIFF(SECOND, updated, ?) >= ?\";\n\t\t$query = $this->db->query($query, array(PRODUCT_BOOKED, $now, $now, BOOKING_EXPIRY_DURATION_SEC));\n\t\t\n\t\tif($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach($query->result() as $row)\n\t\t\t\t$piIdArray[] = $row->id;\n\t\t}\n\n\t\tif(count($piIdArray) > 0)\n\t\t{\n\t\t\t$this->db->where_in('id', $piIdArray);\n\t\t\t$this->db->update('product_instance', array('available' => PRODUCT_AVAILABLE, 'updated' => $now, 'updated_by_id' => 1));\n\t\t\t\n\t\t}\n\t\t\n\t\techo \"No of product instances released [\".count($piIdArray).\"]\".PHP_EOL;\n\t\treturn true;\t\t\n\t}", "public function getHasVideo()\n {\n return $this->data['fields']['has_video'];\n }", "function video_playable($id)\r\n{\r\n global $cbvideo,$userquery;\r\n\r\n if(isset($_POST['watch_protected_video']))\r\n $video_password = mysql_clean(post('video_password'));\r\n else\r\n $video_password = '';\r\n\r\n if(!is_array($id))\r\n $vdo = $cbvideo->get_video($id);\r\n else\r\n $vdo = $id;\r\n $uid = userid();\r\n if(!$vdo)\r\n {\r\n e(lang(\"class_vdo_del_err\"));\r\n return false;\r\n }elseif($vdo['status']!='Successful')\r\n {\r\n e(lang(\"this_vdo_not_working\"));\r\n if(!has_access('admin_access',TRUE))\r\n return false;\r\n else\r\n return true;\r\n }elseif($vdo['broadcast']=='private'\r\n && !$userquery->is_confirmed_friend($vdo['userid'],userid())\r\n && !is_video_user($vdo)\r\n && !has_access('video_moderation',true)\r\n && $vdo['userid']!=$uid){\r\n e(lang('private_video_error'));\r\n return false;\r\n }elseif($vdo['active'] == 'pen'){\r\n e(lang(\"video_in_pending_list\"));\r\n if(has_access('admin_access',TRUE) || $vdo['userid'] == userid())\r\n return true;\r\n else\r\n return false;\r\n }elseif($vdo['broadcast']=='logged'\r\n && !userid()\r\n && !has_access('video_moderation',true)\r\n && $vdo['userid']!=$uid){\r\n e(lang('not_logged_video_error'));\r\n return false;\r\n }elseif($vdo['active']=='no' )\r\n {\r\n e(lang(\"vdo_iac_msg\"));\r\n if(!has_access('admin_access',TRUE))\r\n return false;\r\n else\r\n return true;\r\n }\r\n //No Checking for video password\r\n elseif($vdo['video_password']\r\n && $vdo['broadcast']=='unlisted'\r\n && $vdo['video_password']!=$video_password\r\n && !has_access('video_moderation',true)\r\n && $vdo['userid']!=$uid)\r\n {\r\n if(!$video_password)\r\n e(lang(\"video_pass_protected\"));\r\n else\r\n e(lang(\"invalid_video_password\"));\r\n template_files(\"blocks/watch_video/video_password.html\",false,false);\r\n }\r\n else\r\n {\r\n $funcs = cb_get_functions('watch_video');\r\n\r\n if($funcs)\r\n foreach($funcs as $func)\r\n {\r\n $data = $func['func']($vdo);\r\n if($data)\r\n return $data;\r\n }\r\n return true;\r\n }\r\n}", "public function generateVideos(int $oid): bool;", "public function exceedsWatchLimit(){\n return $this->getWatchedVideosToday()->count() >= self::MAX_NUMBER_OF_VIDEOS;\n }", "public function ListOfVideosOfAProduct(GetPerPageRequest $request, $id)\n {\n\n $raiseError = new RaiseError;\n $per_page = $request->get('per_page');\n $product = Product::where('is_deleted', false)->with('productDetailVideos.videoSession')->find($id);\n $product_detail_videos = [];\n if ($product != null) {\n $raiseError->ValidationError($product->type != 'video', ['type' => ['You should get a product with type video']]);\n $numArray = [];\n $i = 1;\n for ($indx = 0; $indx < count($product->productDetailVideos); $indx++) {\n $v = $product->productDetailVideos[$indx];\n $numArray[$v->id] = $v != null && $product->productDetailVideos[$indx]->extraordinary ? 0 : $i;\n $i = $numArray[$v->id] ? $i + 1 : $i;\n $product_detail_videos[] = $product->productDetailVideos[$indx];\n }\n $product_detail_video_items = $per_page == \"all\" ? $product_detail_videos : $this->paginate($product_detail_videos, env('PAGE_COUNT'));\n return ((new ProductVideoCollection($product_detail_video_items))->foo($numArray))->additional([\n 'errors' => null,\n ])->response()->setStatusCode(200);\n }\n return (new ProductVideoResource(null))->additional([\n 'errors' => ['product' => ['Product not found!']],\n ])->response()->setStatusCode(404);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "private function _checkExist()\n {\n if (!($validation = IO::required($this->data, ['videoLink']))['valid']) {\n throw new InvalidParameterException($validation['message']);\n }\n\n $resource = new Resource($this->data);\n\n $sql = \"SELECT COUNT(*) FROM `resource` WHERE `video_link` = :video_link\";\n\n $stmt = $this->pdo->prepare($sql);\n\n $stmt->execute(['video_link' => $resource->getVideoLink()]);\n\n return $stmt->fetchColumn() != 0;\n }", "public function listVideos($id){\n\n $seriesvideo = seriesvideo:: where('seriesID', $id)->get();\n $series = series::where('seriesID',$id)->first();\n $uservideos = UserVideo::where('userID',Auth::user()->student_number)->get();\n $i=0;\n\n $userVideo[] = array();\n $serVideo = array();\n\n foreach($seriesvideo as $serVid){\n $serVideo[] = $serVid->videoID;\n $userVideo[$i] = \"confirm\";\n foreach($uservideos as $useVid){\n if($useVid->videoID == $serVid->videoID)\n $userVideo[$i]=\"\";\n }\n $i++;\n }\n $videos = video::whereIn('videoID',$serVideo)->get();\n return view('list_vid',['videos'=>$videos, 'series'=>$series , 'userVideo' =>$userVideo]);\n }", "public function hasProduct()\n {\n return $this->Product !== null;\n }", "public function testRemoveVideoFromPlaylist()\n {\n // Create a playlist\n $this->playlist = new Playlist( $this->user->getId(), \"title\", \"desc\", \"subj\", \"topic\" );\n $this->id = $this->playlist->insertPlaylist();\n\n // Prepare playlist entries\n $dbh = DB::getPDO();\n $stmt = $dbh->prepare(\"INSERT INTO playlistvideos (playlist, video, no) VALUES (?, ?, 0);\");\n $this->assertTrue($stmt->execute([$this->id, $this->video1id]));\n $this->assertTrue($stmt->execute([$this->id, $this->video2id]));\n\n // Remove a video from the playlist\n $playlist = Playlist::getPlaylistById($this->id);\n $playlist->removeVideoFromPlaylist($this->video1id);\n\n // Verify that the video is not present in the playlist anymore\n $videos = Playlist::getVideosByPlaylistId($this->id);\n $this->assertInternalType('array',$videos);\n $this->assertEquals(1, count($videos));\n }", "function get_video_course_ids () {\n\t$ids = array();\n\t$courses = get_user_paid_orders(); // Get paid courses IDs (products)\n\t\n\tif ( !empty($courses) ) { // If user have purchased courses\n\t\tforeach ($courses as $j => $product_id) {\n\t\t\tif (have_rows('lesson', $product_id)) {\n\t\t\t\t$i = 1; // Inner counter from 1 because haven't free lesson\n\t\t\t\twhile (have_rows('lesson', $product_id)) {\n\t\t\t\t\tthe_row();\n\t\t\t\t\t$ids[\"courseVideo_$j\" . \"_$i\"] = get_sub_field('video_id');\n\t\t\t\t\t$i += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $ids;\n}", "private function validateAvailableProduct() {\n\n\t\t$studio_data = &$this->session->data['studio_data'][$this->request->post['price_studio_id']]; //make it short\n\n\t\t//if price_id_product is not empty\n\t\tif (!isset($studio_data['id_product'])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_product');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t///if product exists\n\t\t} elseif (!$this->model_opentshirts_product->getTotalProductsByID($studio_data['id_product'])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_product');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t//if product price is setted up\n\t\t}else if ($this->model_opentshirts_price_product->getMinQuantity($studio_data['id_product'])===false) {\n\t\t\t$this->error['warning'] = $this->language->get('error_not_available');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t}\n\n\t\tif (!$this->error) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function is_publishable($product_id){\n $by = json_decode($this->db->get_where('product',array('product_id'=>$product_id))->row()->added_by,true);\n if($by['type'] == 'admin'){\n return true;\n } else if($by['type'] == 'vendor'){\n $vendor_status = $this->db->get_where('vendor',array('vendor_id'=>$by['id']))->row()->status;\n if ($vendor_status == 'approved') {\n return true;\n } else {\n return false;\n }\n }\n }", "public function hasPlayableResource($mm){\n return $mm->getFilteredTracksWithTags(['display']) || $mm->getProperty('opencast');\n }" ]
[ "0.6772142", "0.65406775", "0.60900927", "0.6057279", "0.60450256", "0.59278154", "0.5810182", "0.58054364", "0.5792452", "0.57916605", "0.5627142", "0.56171227", "0.56118757", "0.56101435", "0.5608703", "0.5590502", "0.55865693", "0.55720097", "0.55720097", "0.55720097", "0.55720097", "0.55720097", "0.5559841", "0.5523328", "0.55229497", "0.5520655", "0.54994524", "0.5494877", "0.54710907", "0.54568654" ]
0.7452454
0
If the enum has overridden the `parseDatabase` method, use it to get the cast value
protected function getCastableValue(mixed $value): mixed { $value = $this->enumClass::parseDatabase($value); if ($value === null) { return null; } // If the value exists in the enum (using strict type checking) return it if ($this->enumClass::hasValue($value)) { return $value; } // Find the value in the enum that the incoming value can be coerced to foreach ($this->enumClass::getValues() as $enumValue) { if ($value == $enumValue) { return $enumValue; } } // Fall back to trying to construct it directly (will result in an error since it doesn't exist) return $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GetEnumValue(){\n\t\treturn db_enum_value($this->tables[0], $this->fields[0]);\n\t}", "function get_enum($db, $table, $column) {\n\t// get ENUM values as string to populate a dropdown select (not the what column has what enum assigned but the possible enums themself)\n\n\t//\t$sql = \"SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS\n\t//WHERE TABLE_SCHEMA = 'maTest' AND TABLE_NAME = 'ma_Posts' AND COLUMN_NAME = 'PostRating'\";\n\t$sql = \"SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS\n\tWHERE TABLE_SCHEMA = '{$db}' AND TABLE_NAME = '{$table}' AND COLUMN_NAME = '{$column}'\";\n\n\t$db = pdo(); # pdo() creates and returns a PDO object\n\t#run the query\n\n\t#$result stores data object in memory\n\ttry {$result = $db->query($sql);} catch(PDOException $ex) {trigger_error($ex->getMessage(), E_USER_ERROR);}\n\n\t#run query\n\t$results = $db->query($sql);\n\n\t#process query\n\t$results = $results->fetchAll(PDO::FETCH_ASSOC);\n\n\t#convert array to string\n\t$results = $results[0]['COLUMN_TYPE'];\n\n\t#prep string data\n\t$results = substr($results, 5, -1);\n\n\t#make $result inot an array of data again\n\t$enum = str_getcsv($results, ',', \"'\");\n\n\treturn $enum;\n}", "function fromDB($value, $type) {\n\t\t//everything is nullable\n\t\tif($value === null) return null;\n\t\t\n\t\tswitch($type) {\n\t\t\tcase 'datetime': // ISO-8601\n\t\t\tcase 'date':\n\t\t\t\treturn new DateTime($value);\n\t\t\tcase 'integer':\n\t\t\t\treturn (int) $value;\n\t\t\tcase 'boolean':\n\t\t\t\treturn (bool) $value;\n\t\t}\n\t\treturn $value;\n\t}", "public function getDatabaseType();", "public function getDatabaseType();", "protected function transformValueFromDatabase($value,$type) {\n\n if($type==SettingInterface::TYPE_STRING) {\n return (string)$value;\n }\n\n if($type==SettingInterface::TYPE_INTEGER) {\n return (integer)$value;\n }\n\n if($type==SettingInterface::TYPE_BOOLEAN) {\n if(in_array($value,[true,1,'y','yes','true'])) {\n return true;\n }\n if(in_array($value,[false,0,'n','no','false'])) {\n return false;\n }\n }\n\n if($type==SettingInterface::TYPE_DATE_TIME) {\n return \\DateTime::createFromFormat('Y-m-d H:i:s',$value);\n }\n\n if($type==SettingInterface::TYPE_ARRAY) {\n return json_decode($value,true);\n }\n\n return $value;\n }", "public function dbTypecast($value)\n {\n // to override this with annotation of explicit PDO type.\n return $this->typecast($value);\n }", "abstract public function cast($value);", "public function _typecastLoadField(Field $f, $value)\n {\n // LOB fields return resource stream\n if (is_resource($value)) {\n $value = stream_get_contents($value);\n }\n\n // work only on copied value not real one !!!\n $v = is_object($value) ? clone $value : $value;\n\n switch ($f->type) {\n case 'string':\n case 'text':\n // do nothing - it's ok as it is\n break;\n case 'integer':\n $v = (int) $v;\n break;\n case 'float':\n $v = (float) $v;\n break;\n case 'money':\n $v = round($v, 4);\n break;\n case 'boolean':\n if (isset($f->enum) && is_array($f->enum)) {\n if (isset($f->enum[0]) && $v == $f->enum[0]) {\n $v = false;\n } elseif (isset($f->enum[1]) && $v == $f->enum[1]) {\n $v = true;\n } else {\n $v = null;\n }\n } elseif ($v === '') {\n $v = null;\n } else {\n $v = (bool) $v;\n }\n break;\n case 'date':\n case 'datetime':\n case 'time':\n $dt_class = isset($f->dateTimeClass) ? $f->dateTimeClass : 'DateTime';\n $tz_class = isset($f->dateTimeZoneClass) ? $f->dateTimeZoneClass : 'DateTimeZone';\n\n if (is_numeric($v)) {\n $v = new $dt_class('@'.$v);\n } elseif (is_string($v)) {\n // ! symbol in date format is essential here to remove time part of DateTime - don't remove, this is not a bug\n $format = ['date' => '+!Y-m-d', 'datetime' => '+!Y-m-d H:i:s', 'time' => '+!H:i:s'];\n $format = $f->persist_format ?: $format[$f->type];\n\n // datetime only - set from persisting timezone\n if ($f->type == 'datetime' && isset($f->persist_timezone)) {\n $v = $dt_class::createFromFormat($format, $v, new $tz_class($f->persist_timezone));\n if ($v === false) {\n throw new Exception(['Incorrectly formatted datetime', 'format' => $format, 'value' => $value, 'field' => $f]);\n }\n $v->setTimeZone(new $tz_class(date_default_timezone_get()));\n } else {\n $v = $dt_class::createFromFormat($format, $v);\n if ($v === false) {\n throw new Exception(['Incorrectly formatted date/time', 'format' => $format, 'value' => $value, 'field' => $f]);\n }\n }\n\n // need to cast here because DateTime::createFromFormat returns DateTime object not $dt_class\n // this is what Carbon::instance(DateTime $dt) method does for example\n if ($dt_class != 'DateTime') {\n $v = new $dt_class($v->format('Y-m-d H:i:s.u'), $v->getTimeZone());\n }\n }\n break;\n case 'array':\n // don't decode if we already use some kind of serialization\n $v = $f->serialize ? $v : $this->jsonDecode($f, $v, true);\n break;\n case 'object':\n // don't decode if we already use some kind of serialization\n $v = $f->serialize ? $v : $this->jsonDecode($f, $v, false);\n break;\n }\n\n return $v;\n }", "public function testCastTypeUnknownWhenReading() {\r\n $uuid = 'abcdefg';\r\n $bool = true;\r\n $int = 1234567;\r\n $string = 'avorium';\r\n // Write data to the database\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$uuid.'\\','.($bool ? 1:0).','.$int.', \\''.$string.'\\')');\r\n // Read data out and cast it to persistent object\r\n $this->setExpectedException('Exception', 'Database column type \\'unknowntype\\' is not known to the persistence adapter.');\r\n $this->getPersistenceAdapter()->get('test_persistence_AbstractPersistenceAdapterTestPersistentObjectUnknownType', $uuid);\r\n }", "function check_enum_value_type($received_value, $table_name, $table_field, \\PDO $db) {\n $options = \\k1lib\\sql\\get_db_table_enum_values($db, $table_name, $table_field);\n $options_fliped = array_flip($options);\n\n if (!isset($options_fliped[$received_value])) {\n $error_type = print_r($options_fliped, TRUE) . \" value: '$received_value'\";\n// d($received_value, TRUE);\n } else {\n $error_type = FALSE;\n }\n return $error_type;\n}", "public static function fromNative()\n {\n $value = func_get_arg(0);\n\n switch (true) {\n case preg_match(self::REGEX_TYPE_VARCHAR, $value, $matchesVarchar):\n $response = Varchar::fromNative($matchesVarchar[1]);\n break;\n\n case preg_match(self::REGEX_TYPE_CHAR, $value, $matchesVarchar):\n $response = Char::fromNative($matchesVarchar[1]);\n break;\n\n case preg_match(self::REGEX_TYPE_TIMESTAMP, $value, $matchesVarchar):\n $response = new Timestamp();\n break;\n\n case preg_match(self::REGEX_TYPE_DATETIME, $value, $matchesVarchar):\n $response = new Datetime();\n break;\n\n case preg_match(self::REGEX_TYPE_DATE, $value, $matchesVarchar):\n $response = new Date();\n break;\n\n case preg_match(self::REGEX_TYPE_TEXT, $value, $matchesVarchar):\n $response = new Text();\n break;\n\n case preg_match(self::REGEX_TYPE_INT_UNSIGNED, $value, $matchesVarchar):\n $response = IntUnsigned::fromNative($matchesVarchar[1]);\n break;\n\n case preg_match(self::REGEX_TYPE_INT_SIGNED, $value, $matchesVarchar):\n $response = IntSigned::fromNative($matchesVarchar[1]);\n break;\n\n case preg_match(self::REGEX_TYPE_DECIMAL, $value, $matchesVarchar):\n $response = Decimal::fromNative((int)$matchesVarchar[1], (int)$matchesVarchar[2]);\n break;\n\n case preg_match(self::REGEX_TYPE_TINYINT_SIGNED, $value, $matchesVarchar):\n $response = TinyIntSigned::fromNative($matchesVarchar[1]);\n break;\n\n case preg_match(self::REGEX_TYPE_ENUM, $value, $matchesVarchar):\n $response = Enum::fromNative($matchesVarchar[1]);\n break;\n\n // @todo Add more cases. http://dev.mysql.com/doc/refman/5.7/en/data-types.html\n\n default:\n $allowedPatterns = array_values(static::getConstants());\n throw new UnexpectedValueException($value, $allowedPatterns);\n break;\n }\n\n return $response;\n }", "public function getDbFieldType()\n {\n }", "public function castDb(mixed $value, string $format = ''): mixed\n {\n if (is_null($value) || ! is_string($value)) {\n return $value;\n }\n\n return $this->encode($value, $this->parseFormat($format));\n }", "public function getCast()\n {\n $result = $this->getType();\n if ($result == \"date\")\n $result = \"string\";\n if ($result == \"datetime\")\n $result = \"string\";\n if ($result == \"enum\")\n $result = \"string\";\n if ($result == \"time\")\n $result = \"string\";\n // BIT, TIMESTAMP, VARBINARY, BLOB\n return \"(\" . $result . \")\";\n }", "protected function extractOraType($dbType){\n\t\tif(strpos($dbType,'FLOAT')!==false) return 'double';\n\n\t\tif (strpos($dbType,'NUMBER')!==false || strpos($dbType,'INTEGER')!==false)\n\t\t{\n\t\t\tif(strpos($dbType,'(') && preg_match('/\\((.*)\\)/',$dbType,$matches))\n\t\t\t{\n\t\t\t\t$values=explode(',',$matches[1]);\n\t\t\t\tif(isset($values[1]) and (((int)$values[1]) > 0))\n\t\t\t\t\treturn 'double';\n\t\t\t\telse\n\t\t\t\t\treturn 'integer';\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn 'double';\n\t\t}\n\t\telse\n\t\t\treturn 'string';\n\t}", "protected function _castValue ( $value ) {\n\t\t\tswitch ( $this->_settingType ) {\n\t\t\t\tcase self::TYPE_BOOLEAN: return $value == \"true\" ? true : false;\n\t\t\t\tcase self::TYPE_SWITCH: return $value ? \"on\" : \"off\";\n\t\t\t\tcase self::TYPE_INTEGER: return intval ( $value );\n\t\t\t\tcase self::TYPE_STRING: return \"$value\";\n\t\t\t\tdefault: return \"\";\n\t\t\t}\n\t\t}", "protected function extractType($dbType)\n\t{\n\t\t$this->type=$this->extractOraType($dbType);\n\t}", "function cast($field, $value) {\n\t\t// if the column doesn't exist, don't cast the value\n\t\tif (!isset($this->columns[$field])) {\n\t\t\treturn $value;\n\t\t}\n\n\t\t// precast arrays\n\t\tif (is_array($value)) {\n\t\t\t$value = $this->columns[$field]->array_to_type(array_values($value));\n\t\t}\n\n\t\t// cast value\n\t\t$value = $this->columns[$field]->type_cast($value);\n\n\t\treturn $value;\n\n\t}", "public function MySQLiFieldType($aFieldname) { \n $retval = '';\n if ($aFieldname=='DeterminationID') { $retval = self::C_DeterminationIDMYSQLI_TYPE; }\n if ($aFieldname=='TimestampCreated') { $retval = self::C_TimestampCreatedMYSQLI_TYPE; }\n if ($aFieldname=='TimestampModified') { $retval = self::C_TimestampModifiedMYSQLI_TYPE; }\n if ($aFieldname=='Version') { $retval = self::C_VersionMYSQLI_TYPE; }\n if ($aFieldname=='CollectionMemberID') { $retval = self::C_CollectionMemberIDMYSQLI_TYPE; }\n if ($aFieldname=='Addendum') { $retval = self::C_AddendumMYSQLI_TYPE; }\n if ($aFieldname=='AlternateName') { $retval = self::C_AlternateNameMYSQLI_TYPE; }\n if ($aFieldname=='Confidence') { $retval = self::C_ConfidenceMYSQLI_TYPE; }\n if ($aFieldname=='DeterminedDate') { $retval = self::C_DeterminedDateMYSQLI_TYPE; }\n if ($aFieldname=='DeterminedDatePrecision') { $retval = self::C_DeterminedDatePrecisionMYSQLI_TYPE; }\n if ($aFieldname=='FeatureOrBasis') { $retval = self::C_FeatureOrBasisMYSQLI_TYPE; }\n if ($aFieldname=='IsCurrent') { $retval = self::C_IsCurrentMYSQLI_TYPE; }\n if ($aFieldname=='Method') { $retval = self::C_MethodMYSQLI_TYPE; }\n if ($aFieldname=='NameUsage') { $retval = self::C_NameUsageMYSQLI_TYPE; }\n if ($aFieldname=='Number1') { $retval = self::C_Number1MYSQLI_TYPE; }\n if ($aFieldname=='Number2') { $retval = self::C_Number2MYSQLI_TYPE; }\n if ($aFieldname=='Qualifier') { $retval = self::C_QualifierMYSQLI_TYPE; }\n if ($aFieldname=='Remarks') { $retval = self::C_RemarksMYSQLI_TYPE; }\n if ($aFieldname=='Text1') { $retval = self::C_Text1MYSQLI_TYPE; }\n if ($aFieldname=='Text2') { $retval = self::C_Text2MYSQLI_TYPE; }\n if ($aFieldname=='TypeStatusName') { $retval = self::C_TypeStatusNameMYSQLI_TYPE; }\n if ($aFieldname=='YesNo1') { $retval = self::C_YesNo1MYSQLI_TYPE; }\n if ($aFieldname=='YesNo2') { $retval = self::C_YesNo2MYSQLI_TYPE; }\n if ($aFieldname=='YesNo3') { $retval = self::C_YesNo3MYSQLI_TYPE; }\n if ($aFieldname=='FragmentID') { $retval = self::C_FragmentIDMYSQLI_TYPE; }\n if ($aFieldname=='TaxonID') { $retval = self::C_TaxonIDMYSQLI_TYPE; }\n if ($aFieldname=='ModifiedByAgentID') { $retval = self::C_ModifiedByAgentIDMYSQLI_TYPE; }\n if ($aFieldname=='PreferredTaxonID') { $retval = self::C_PreferredTaxonIDMYSQLI_TYPE; }\n if ($aFieldname=='DeterminerID') { $retval = self::C_DeterminerIDMYSQLI_TYPE; }\n if ($aFieldname=='CreatedByAgentID') { $retval = self::C_CreatedByAgentIDMYSQLI_TYPE; }\n return $retval;\n }", "public function testEnumDataType()\n {\n $tableName = 'ramp_enumTesting';\n $table = new Application_Model_DbTable_Table($tableName);\n $metaInfo = $table->info(Zend_Db_Table_Abstract::METADATA);\n $whichField = 'gender';\n\n $field = new Application_Model_Field($whichField, array(),\n $metaInfo[$whichField]);\n\n $this->assertTrue($field->isInTable());\n $this->assertTrue($field->isInDB());\n $this->assertTrue($field->isEnum());\n $this->assertSame(\"enum('Unknown','M','F')\", $field->getDataType());\n $this->assertSame(array('Unknown','M','F'),\n array_keys($field->getEnumValues()));\n $this->assertSame('Unknown', $field->getDefault());\n $this->_assertWholelyLocal($field);\n $this->_assertMetaInfoValues($tableName, $whichField, $field);\n }", "abstract public function convertFromRawValue($value);", "public function getDataWithTypeDb() {}", "public function MySQLiFieldType($aFieldname) { \n $retval = '';\n if ($aFieldname=='DNASequencingRunID') { $retval = self::C_DNASequencingRunIDMYSQLI_TYPE; }\n if ($aFieldname=='TimestampCreated') { $retval = self::C_TimestampCreatedMYSQLI_TYPE; }\n if ($aFieldname=='TimestampModified') { $retval = self::C_TimestampModifiedMYSQLI_TYPE; }\n if ($aFieldname=='Version') { $retval = self::C_VersionMYSQLI_TYPE; }\n if ($aFieldname=='CollectionMemberID') { $retval = self::C_CollectionMemberIDMYSQLI_TYPE; }\n if ($aFieldname=='Number1') { $retval = self::C_Number1MYSQLI_TYPE; }\n if ($aFieldname=='Number2') { $retval = self::C_Number2MYSQLI_TYPE; }\n if ($aFieldname=='Number3') { $retval = self::C_Number3MYSQLI_TYPE; }\n if ($aFieldname=='Ordinal') { $retval = self::C_OrdinalMYSQLI_TYPE; }\n if ($aFieldname=='PCRCocktailPrimer') { $retval = self::C_PCRCocktailPrimerMYSQLI_TYPE; }\n if ($aFieldname=='PCRForwardPrimerCode') { $retval = self::C_PCRForwardPrimerCodeMYSQLI_TYPE; }\n if ($aFieldname=='PCRPrimerName') { $retval = self::C_PCRPrimerNameMYSQLI_TYPE; }\n if ($aFieldname=='PCRPrimerSequence5_3') { $retval = self::C_PCRPrimerSequence5_3MYSQLI_TYPE; }\n if ($aFieldname=='PCRReversePrimerCode') { $retval = self::C_PCRReversePrimerCodeMYSQLI_TYPE; }\n if ($aFieldname=='ReadDirection') { $retval = self::C_ReadDirectionMYSQLI_TYPE; }\n if ($aFieldname=='Remarks') { $retval = self::C_RemarksMYSQLI_TYPE; }\n if ($aFieldname=='RunDate') { $retval = self::C_RunDateMYSQLI_TYPE; }\n if ($aFieldname=='ScoreFileName') { $retval = self::C_ScoreFileNameMYSQLI_TYPE; }\n if ($aFieldname=='SequenceCocktailPrimer') { $retval = self::C_SequenceCocktailPrimerMYSQLI_TYPE; }\n if ($aFieldname=='SequencePrimerCode') { $retval = self::C_SequencePrimerCodeMYSQLI_TYPE; }\n if ($aFieldname=='SequencePrimerName') { $retval = self::C_SequencePrimerNameMYSQLI_TYPE; }\n if ($aFieldname=='SequencePrimerSequence5_3') { $retval = self::C_SequencePrimerSequence5_3MYSQLI_TYPE; }\n if ($aFieldname=='Text1') { $retval = self::C_Text1MYSQLI_TYPE; }\n if ($aFieldname=='Text2') { $retval = self::C_Text2MYSQLI_TYPE; }\n if ($aFieldname=='Text3') { $retval = self::C_Text3MYSQLI_TYPE; }\n if ($aFieldname=='TraceFileName') { $retval = self::C_TraceFileNameMYSQLI_TYPE; }\n if ($aFieldname=='YesNo1') { $retval = self::C_YesNo1MYSQLI_TYPE; }\n if ($aFieldname=='YesNo2') { $retval = self::C_YesNo2MYSQLI_TYPE; }\n if ($aFieldname=='YesNo3') { $retval = self::C_YesNo3MYSQLI_TYPE; }\n if ($aFieldname=='ModifiedByAgentID') { $retval = self::C_ModifiedByAgentIDMYSQLI_TYPE; }\n if ($aFieldname=='DNASequenceID') { $retval = self::C_DNASequenceIDMYSQLI_TYPE; }\n if ($aFieldname=='CreatedByAgentID') { $retval = self::C_CreatedByAgentIDMYSQLI_TYPE; }\n return $retval;\n }", "abstract protected function getSupportedEnumType() : string;", "public function _typecastSaveField(Field $f, $value)\n {\n // work only on copied value not real one !!!\n $v = is_object($value) ? clone $value : $value;\n\n switch ($f->type) {\n case 'boolean':\n // if enum is not set, then simply cast value to integer\n if (!isset($f->enum) || !$f->enum) {\n $v = (int) $v;\n break;\n }\n\n // if enum is set, first lets see if it matches one of those precisely\n if ($v === $f->enum[1]) {\n $v = true;\n } elseif ($v === $f->enum[0]) {\n $v = false;\n }\n\n // finally, convert into appropriate value\n $v = $v ? $f->enum[1] : $f->enum[0];\n break;\n case 'date':\n case 'datetime':\n case 'time':\n $dt_class = isset($f->dateTimeClass) ? $f->dateTimeClass : 'DateTime';\n $tz_class = isset($f->dateTimeZoneClass) ? $f->dateTimeZoneClass : 'DateTimeZone';\n\n if ($v instanceof $dt_class) {\n $format = ['date' => 'Y-m-d', 'datetime' => 'Y-m-d H:i:s', 'time' => 'H:i:s'];\n $format = $f->persist_format ?: $format[$f->type];\n\n // datetime only - set to persisting timezone\n if ($f->type == 'datetime' && isset($f->persist_timezone)) {\n $v->setTimezone(new $tz_class($f->persist_timezone));\n }\n $v = $v->format($format);\n }\n break;\n case 'array':\n case 'object':\n // don't encode if we already use some kind of serialization\n $v = $f->serialize ? $v : $this->jsonEncode($f, $v);\n break;\n }\n\n return $v;\n }", "function enum_decode($id) {\r\n /* by default, if available, expects enum_keyval to be filled with array('field1','field2') */\r\n if ($id == '') {\r\n return '';\r\n }\r\n elseif ($this->enum_keyval) {\r\n $row = $this->get_row(array($this->enum_keyval[0]=>$id), $this->enum_keyval[1],'row');\r\n if ($row === False)\r\n return False;\r\n else\r\n return $row[0];\r\n }\r\n }", "public function parseValue($value)\n {\n $loweredValue = trim(strtolower($value));\n\n // Parses NULL values\n if ($this->nullable && in_array($loweredValue, IESDataColumn::$NULL_VALUES))\n return null;\n\n // Parses as a standard data-type\n if ($this->dataType == IESDataColumnType::STRING)\n return $value;\n else if ($this->dataType == IESDataColumnType::BOOLEAN)\n return IESDataColumn::$BOOLEAN_VALUES[$loweredValue] ? \"1\" : \"0\";\n else if ($this->dataType == IESDataColumnType::FLOAT)\n return floatval($loweredValue);\n else if ($this->dataType == IESDataColumnType::INTEGER)\n return intval($value);\n\n throw new \\Exception(\"An unexpected error occured.\");\n }", "function _mysql_enum_values($tableName,$fieldName){\n\n\t\t#$result = @mysql_query(\"DESCRIBE $tableName\");\n\n\t\t foreach($this->fields as $row){\n\n\t\t\tereg('^([^ (]+)(\\((.+)\\))?([ ](.+))?$',$row['Type'],$fieldTypeSplit);\n\n\t\t\t//split type up into array\n\t\t\t$fieldType = $fieldTypeSplit[1];\n\t\t\t$fieldLen = $fieldTypeSplit[3];\n\n\t\t\tif ( ($fieldType=='enum' || $fieldType=='set') && ($row['Field']==$fieldName) ){\n\t\t\t\t$fieldOptions = split(\"','\",substr($fieldLen,1,-1));\n\t\t\t\treturn $fieldOptions;\n\t\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\n\t}", "protected function typecast($value)\n {\n if ($value === ''\n && !in_array(\n $this->type,\n [\n Schema::TYPE_TEXT,\n Schema::TYPE_STRING,\n Schema::TYPE_BINARY,\n Schema::TYPE_CHAR\n ],\n true)\n ) {\n return null;\n }\n\n if ($value === null\n || gettype($value) === $this->phpType\n || $value instanceof ExpressionInterface\n || $value instanceof Query\n ) {\n return $value;\n }\n\n if (is_array($value)\n && count($value) === 2\n && isset($value[1])\n && in_array($value[1], $this->getPdoParamTypes(), true)\n ) {\n return new PdoValue($value[0], $value[1]);\n }\n\n switch ($this->phpType) {\n case 'resource':\n case 'string':\n if (is_resource($value)) {\n return $value;\n }\n if (is_float($value)) {\n // ensure type cast always has . as decimal separator in all locales\n return str_replace(',', '.', (string) $value);\n }\n return (string) $value;\n case 'integer':\n if (is_bool($value)) {\n return ($value) ? 1 : 0;\n }\n return (int) $value;\n case 'boolean':\n return (boolean) $value;\n case 'double':\n return (double) $value;\n }\n\n return $value;\n }" ]
[ "0.61950845", "0.58033305", "0.56334156", "0.5629258", "0.5629258", "0.55831796", "0.5496877", "0.5386859", "0.5340978", "0.5327611", "0.53069067", "0.5304493", "0.5242085", "0.51905245", "0.518612", "0.5144378", "0.5137614", "0.51319605", "0.51291305", "0.51147777", "0.5103843", "0.5070079", "0.50445795", "0.5040838", "0.5026274", "0.50157624", "0.50081867", "0.49897203", "0.49707773", "0.49478394" ]
0.60442966
1
Require Init Functions File
protected function __init_func_loader() { require_once(INIT_FUNC_FILE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadInit() {}", "public function initialize()\n {\n if (file_exists($this->path.'init.php')) {\n require_once($this->path.'init.php');\n }\n }", "public function init() {\n\t\trequire(__DIR__ . '/../setup-scripts/createExplicitUsers.php');\n\t\trequire(__DIR__ . '/../setup-scripts/createExplicitGroups.php');\n\t\trequire(__DIR__ . '/../setup-scripts/createExplicitGroupsDifferentOU.php');\n\t\tparent::init();\n\t}", "private function _require()\n {\n }", "protected function Init() \n {\n // Load the APP config.php and add the defined vars\n $this->load($this->files['app']['file_path'], 'app');\n \n // Load the core.config.php and add the defined vars\n $this->load($this->files['core']['file_path'], 'core', 'config');\n \n // Load the database.config.php and add the defined vars\n $this->load($this->files['db']['file_path'], 'db', 'DB_configs');\n }", "function require_dependencies() {\n global $CFG;\n\n //needed to define CURMAN_DIRLOCATION\n require_once($CFG->dirroot . '/curriculum/config.php');\n\n //needed for constants that define db tables\n require_once($CFG->dirroot.'/curriculum/lib/cmclass.class.php');\n\n //make sure we have access to the context library\n require_once($CFG->dirroot.'/curriculum/lib/contexts.php');\n }", "public function initialize() {\n\t\t//$files = glob( '*.php' );\n\t\t//\n\t\t//if( ! is_array( $files ) ) {\n\t\t//\t// Error when enumerating files, can't do anything about it at this point.\n\t\t//\treturn;\n\t\t//}\n\t\t//\n\t\t//foreach( $files as $file ) {\n\t\t//\trequire_once $file;\n\t\t//}\n\n\t\tif( apply_filters( 'toolset_is_m2m_enabled', false ) ) {\n\t\t\trequire_once TOOLSET_COMMON_PATH . '/inc/public_api/m2m.php';\n\t\t} else {\n\t\t\trequire_once TOOLSET_COMMON_PATH . '/inc/public_api/legacy_relationships.php';\n\t\t}\n\t}", "function module_init () {\n global $core_stylesheets;\n global $core_scripts;\n \n foreach (module_list() as $module) {\n $style_func = $module . '_stylesheets';\n if (function_exists($style_func)) {\n $stylesheets = call_user_func($style_func);\n foreach ($stylesheets as $sheet) {\n $core_stylesheets[] = \"include/$module/$sheet\";\n }\n }\n $style_func = $module . '_scripts';\n if (function_exists($style_func)) {\n $scripts = call_user_func($scripts_func);\n foreach ($scripts as $script) {\n $core_scripts[] = \"include/$module/$script\";\n }\n }\n }\n}", "private function init() {\n\n\t\tif ( ! $this->should_load() ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->setup_admin();\n\t\t$this->setup_api();\n\t}", "function microdata_manager_functions_init() {\n\n\t\trequire_once plugin_dir_path( __FILE__ ) . '/microdata-manager-functions.php';\n}", "public function __construct() {\n\t\tforeach(glob(CORE_BASE . 'helpers/*.php') as $file) {\n\t\t\trequire_once $file;\n\t\t}\n\t}", "public static function init() {\n\t\trequire \"Client/Init.php\";\n\t}", "public function init() {\n\t\t$this->license_helpers();\n\t}", "public function loadRequireJs() {}", "public function __construct()\r\n {\r\n $configDir = ROOT . DS . \"config\" . DS;\r\n \r\n foreach(glob($configDir . \"*.php\") as $file)\r\n {\r\n $pathInfo = pathinfo($file);\r\n $GLOBALS[$pathInfo[\"filename\"]] = require($file);\r\n }\r\n\r\n // Include all PHP files from the config dir\r\n $libsDir = ROOT . DS . \"core\" . DS . \"utilities\" . DS . \"libs\" . DS . \"jwt\" . DS;\r\n \r\n foreach(glob($libsDir . \"*.php\") as $file)\r\n {\r\n ///echo $file.\"<br>\";\r\n $pathInfo = pathinfo($file);\r\n require($file);\r\n }\r\n \r\n spl_autoload_register(array($this, \"load\"));\r\n }", "function bp_ning_import_bp_init() {\n\trequire( dirname( __FILE__ ) . '/bp-functions.php' );\n}", "static function setupInit($path=null,$file=null)\r\n {\r\n Zend_ConfigSettings::setUpConfig();\r\n self::$_general = Zend_Registry::get('general');\r\n self::_setEnv();\t \r\n }", "public function extProc_init() {}", "public function extProc_init() {}", "protected function init()\n {\n $files = $this->fs->findFile('', 'init', 'php', true, true);\n\n if (!$files) {\n return;\n }\n\n $files = array_reverse($files);\n\n $di = $this->getDI();\n\n foreach ($files as $file) {\n include $file;\n }\n\n }", "private static function support()\n {\n require_once static::$root.'Support'.'/'.'FunctionArgs.php';\n }", "public function __construct(){\r\n $this->init_hooks();\r\n $this->includes_and_requires();\r\n }", "protected function RequireLibs()\n {\n\n }", "function do_autoload() {\n\tinit_files();\n}", "function init() {}", "protected function setUp(): void\n {\n require_once('src/functions/common/functions_convert.php');\n require_once('src/functions/common/functions_blocks.php');\n }", "public static function run_init_scripts() {\n foreach (self::$_roots as $module_name => $root_path) {\n if (file_exists($fname =\n ($root_path . self::MODULE_BOOTSTRAP_FILE))) {\n include $fname;\n }\n }\n }", "static function _RequireFile($name) {\n require_once(LIBS_DIR . '/apifunctions/' . $name);\n }", "public function initializeConfiguration(){\n //initial Configured autoload\n if(count($GLOBALS['config']['autoload']))\n self::autoload($GLOBALS['config']['autoload']);\n\n\n }", "public function init()\n {\n require_code('banners');\n require_code('banners2');\n require_lang('banners');\n }" ]
[ "0.73725533", "0.72113645", "0.6878275", "0.68194246", "0.6753673", "0.67479175", "0.6638716", "0.66373515", "0.6627892", "0.6611482", "0.6606788", "0.659789", "0.658719", "0.6570231", "0.65622", "0.65578824", "0.6551566", "0.6536073", "0.6533895", "0.65211284", "0.65189785", "0.65133774", "0.64882845", "0.64795476", "0.64657086", "0.64638054", "0.64529216", "0.64186984", "0.6416442", "0.638554" ]
0.74994653
0
check for for missing Acos or nodes to prune and update the Controller Hash File
private function checkFileUpdates() { if ($this->request->params['controller'] != 'acos' || ($this->request->params['action'] != 'admin_synchronize' && $this->request->params['action'] != 'admin_prune_acos' && $this->request->params['action'] != 'admin_build_acl')) { if ($this->AclManager->isControllerHashFileOutOfSync()) { $missingAcoNodes = $this->AclManager->getMissingAcos(); $nodesToPrune = $this->AclManager->getAcosToPrune(); $hasUpdates = false; if (count($missingAcoNodes) > 0) { $hasUpdates = true; } if (count($nodesToPrune) > 0) { $hasUpdates = true; } $this->set('nodesToPrune', $nodesToPrune); $this->set('missingAcoNodes', $missingAcoNodes); if ($hasUpdates) { $this->render('Acl.Acos/admin_has_updates'); $this->response->send(); $this->AclManager->updateControllerHashFile(); exit(); } else { $this->AclManager->updateControllerHashFile(); } $this->AclManager->update_controllers_hash_file(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pruneMissingDirectories(): void\n {\n try {\n Configuration::prune();\n } catch (\\JsonException $e) {\n warning('Invalid configuration file at '.Configuration::path().'.');\n exit;\n }\n }", "private function cleanHashs() {\n\t\t//$sql = \"DELETE FROM `*PREFIX*ocDashboard_usedHashs` WHERE `timestamp` < '\".(time()-60*60*24).\"'\";\n\t\t$sql = \"DELETE FROM `*PREFIX*ocDashboard_usedHashs` WHERE `timestamp` < ?\";\n\t\t$query = \\OCP\\DB::prepare($sql);\n\t\t$params = Array(time()-60*60*24);\n\t\tif(!$query->execute($params)) {\n\t\t\tOCP\\Util::writeLog('ocDashboard',\"Can't delete usedHashs\", \\OCP\\Util::WARN);\n\t\t}\n\t}", "public function cleanUpOldRunningConfigurations() {}", "function clearchat()\n\t{\n\t\t//validate user\n\t\t$response=$this->validateUserLogin();\n\n\t\t//print_r($_SESSION['jbolo']['nodes']);\n\t\t$input=JFactory::getApplication()->input;\n\t\t$post=$input->post;\n\t\t$nid=$input->post->get('nid','','INT');\n\t\t//validate if nid is not specified\n\t\tif(!$nid){\n\t\t\t$response['validate']->error=1;\n\t\t\t$response['validate']->error_msg=JText::_('COM_JBOLO_INVALID_NODE_ID');\n\t\t\treturn $response;\n\t\t}\n\n\t\t$nodecount=count($_SESSION['jbolo']['nodes']);\n\t\t$flag=0;\n\t\tfor($d=0;$d<$nodecount;$d++)\n\t\t{\n\t\t\tif(!$flag)//loop till required node is found\n\t\t\t{\n\t\t\t\tif(isset($_SESSION['jbolo']['nodes'][$d]))\n\t\t\t\t{\n\t\t\t\t\t//if node found\n\t\t\t\t\tif($_SESSION['jbolo']['nodes'][$d]['nodeinfo']->nid==$nid)\n\t\t\t\t\t{\n\t\t\t\t\t\t//check if messages are present\n\t\t\t\t\t\tif(isset($_SESSION['jbolo']['nodes'][$d]['messages']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//unset messages array from session\n\t\t\t\t\t\t\tunset($_SESSION['jbolo']['nodes'][$d]['messages']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$flag=1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$response['all_clear']=$flag;\n\t\t//print_r($_SESSION['jbolo']['nodes']);\n\t\treturn $response;\n\t}", "function emptyMasterservers() {\n\t\t$this->masterservers = array();\n\t}", "function prune ();", "public function clean() {\n\t\tglobal $warnings;\n\n\t\t// it's not at CBW\n\t\tif ($this->location != 1) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as being at HQ\";\n\t\t\t$this->location = 1;\n\t\t}\n\t\t// it had beer in it\n\t\tif ($this->beer != 0) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as empty\";\n\t\t\t$this->beer = 0;\n\t\t}\n\t\t// it's not dirty\n\t\tif ($this->status != 1) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as dirty\";\n\t\t}\n\n\t\t$this->status = 2;\n\t\t$this->update();\n\t}", "public function pruneCommand() {\n\t\t$count = $this->removeAllImages();\n\t\t$this->outputLine('%d record(s) purged.', [$count]);\n\t}", "public static function cleanupCacheIndicators()\n {\n foreach (static::getCacheStateFiles() as $file) {\n if (\\Includes\\Utils\\FileManager::isFile($file) && !\\Includes\\Utils\\FileManager::deleteFile($file)) {\n \\Includes\\ErrorHandler::fireError(\n 'Unable to delete \"' . $file . '\" file. Please correct the permissions'\n );\n }\n }\n\n // \"Step is running\" indicator\n static::cleanupRebuildIndicator();\n }", "protected static function flushNodeModules()\n {\n tap(new Filesystem, function ($files) {\n $files->deleteDirectory(base_path('node_modules'));\n\n $files->delete(base_path('pnpm-lock.yaml'));\n $files->delete(base_path('yarn.lock'));\n $files->delete(base_path('package-lock.json'));\n });\n }", "public function remove_all_check_points() {\n $path = new tool_mhacker_tc_path($this);\n if (!$path->is_writeable()) {\n return;\n }\n $path->remove_check_points();\n }", "function __reload_ne_adapaters() {\n\t\t$appliance_id = $this->response->html->request()->get('appliance_id');\n\t\t$appliance = new appliance();\n\t\t$appliance->get_instance_by_id($appliance_id);\n\t\t$resource = new resource();\n\t\t$resource->get_instance_by_id($appliance->resources);\n\t\t$command = $this->basedir.\"/plugins/hyperv/bin/htvcenter-hyperv-network post_net_adapters -i \".$resource->ip;\n\t\t$command .= ' --htvcenter-ui-user '.$this->user->name;\n\t\t$command .= ' --htvcenter-cmd-mode fork';\n\t\t$file = $this->rootdir.'/plugins/hyperv/hyperv-stat/'.$resource->ip.'.net_adapters';\n\t\tif(file_exists($file)) {\n\t\t\tunlink($file);\n\t\t}\n\t\t$htvcenter_server = new htvcenter_server();\n\t\t$htvcenter_server->send_command($command, NULL, true);\n\t\twhile (!file_exists($file)) // check if the data file has been modified\n\t\t{\n\t\t usleep(10000); // sleep 10ms to unload the CPU\n\t\t clearstatcache();\n\t\t}\n\t\treturn true;\n\t}", "function deleteUnsaveNode()\n {\n //vymaze az po 2 hodinach ak sa nezmeni stav\n $list = $this->getFluent()->where(\"status = 'not_in_system' AND add_date < ( NOW() - 60*2 )\")->fetchAll();\n\n if (!empty($list)) {\n\n foreach ($list as $l) {\n\n $this->delete($l['id_node']);\n\n $module_name = $this->context->getService('ModuleContainer')->fetch($l['id_type_module'])->service_name;\n\n $this->context->getService($module_name)->delete($l['id_node']);\n }\n }\n }", "public function cleanup()\n {\n // Remove old parts without binaries \n $this->removePartsWithoutBinary();\n \n // Remove parts where the binary is missing\n $this->removePartsWithMissingBinary();\n \n // Remove binaries without parts\n $this->removeBinariesWithoutParts();\n }", "private function _prune()\n {\n if (empty($this->_files) && empty($this->_subdirectories)) {\n $this->_element->delete();\n if ($this->_parent instanceOf Horde_Pear_Package_Xml_Directory) {\n $this->_parent->_deleteSubdirectory($this->_element->getName());\n }\n }\n }", "public function update(Request $request)\n {\n echo \"Recreating VM <br>\";\n ob_flush();\n flush();\n //dd($request->toArray());\n ini_set('max_execution_time', 3600);\n ob_implicit_flush(true);\n set_time_limit(0);\n\n $script_source = public_path();\n $private_key = public_path('include/vdf-key1.pem');\n $vmDetail = VM::find($request->vmid);\n $cookieName = Str::random(16);\n $this->ipa->login($cookieName);\n\n $this->openstack->stopDeleteServer($vmDetail);\n echo \"Deleting VM.....Completed <br>\";\n ob_flush();\n flush();\n $explodeHostname = explode('.',$vmDetail->hostname);\n $policy = $explodeHostname[0].'_'.$vmDetail->username;\n\n \n // $this->ipa->deleteUser($deleteVM->username, $cookieName);\n $this->ipa->deleteHost($vmDetail->hostname, $cookieName);\n $this->ipa->deletePolicy($policy, $cookieName);\n $this->ipa->delDNS($explodeHostname[0], $cookieName);\n $i = 0;\n while(1){\n if($i == 20){\n break;\n }\n sleep(1);\n $i++;\n\n }\n \n echo \"Removing IPA policy.....completed <br>\";\n ob_flush();\n flush();\n\n \n \n $path = storage_path('app/'.$vmDetail->dir);\n \n // $files = array($path.'/terraform.tfstate.backup', $path.'/terraform.tfstate');\n // File::delete($files);\n File::deleteDirectory($path);\n // Storage::delete($path.'/terraform.tfstate');\n $template = $this->openstack->findReTemplate($vmDetail->application_id);\n echo \"Fetched template \". $template.'<br>';\n ob_flush();\n flush();\n File::makeDirectory($path, 0777, true, true);\n File::copy($template, $path.'/main.tf');\n\n \n $app = Application::find($vmDetail->application_id);\n $pluginPath = public_path('plugin');\n $sizeRound = $this->openstack->getSize($vmDetail->project,$app->uid);\n $size = round($sizeRound,0,PHP_ROUND_HALF_ODD);\n \n $command = 'terraform12 apply -auto-approve -lock=false -input=false -var=\"oldvolume='.$vmDetail->vol.'\" -var=\"project='.$vmDetail->project.'\" -var=\"size='.$size.'\" -var=\"nic1='.$vmDetail->nic2.'\" -var=\"nic2='.$vmDetail->nic1.'\" -var=\"netname='.$vmDetail->network.'\" -var=\"vmname='.$vmDetail->name.'\" -var=\"app='.$app->uid.'\" -var=\"flavor='.$request->flavor.'\" -var=\"script_source='.$script_source.'\" -var=\"private_key='.$private_key.'\" -var=\"hostname='.$vmDetail->hostname.'\" -var=\"emailid='.$vmDetail->email.'\" -var=\"jira='.$request->jira.'\" -var=\"user='.Auth::user()->name.'\"';\n \n $init = 'terraform12 init -input=false -plugin-dir='.$pluginPath.'';\n $process = new Process($init);\n $process->setTimeout(3600);\n $process->setWorkingDirectory($path);\n $process->run(function ($type, $buffer) {\n \n if (Process::ERR === $type) {\n\n echo htmlspecialchars_decode($buffer).\"<br>\";\n ob_flush();\n flush();\n \n } else {\n \n echo htmlspecialchars_decode($buffer).\"<br>\";\n ob_flush();\n flush();\n \n }\n \n });\n \n if ($process->isSuccessful()) {\n\n $process->setCommandLine($command);\n $process->run(function ($type, $buffer) {\n \n if (Process::ERR === $type) {\n \n echo $buffer.\"<br>\";\n ob_flush();\n flush();\n \n } else {\n \n echo $buffer.\"<br>\";\n ob_flush();\n flush();\n \n }\n\n });\n \n\n if (!$process->isSuccessful()) {\n \n Log::critical($process->getOutput());\n // throw new ProcessFailedException($process);\n }else{\n\n $vm_uidPath = storage_path('app/'.$vmDetail->dir.'/outputid.json');\n $vm_uid = file_get_contents($vm_uidPath);\n\n // $nicIps = ['routeable'=> $value, 'non_routable' => $new];\n $newRework = New Rework;\n $newRework->application_id = $vmDetail->application_id;\n $newRework->vm_id = $vmDetail->id;\n $newRework->flavor = $request->flavor;\n $newRework->jira = $request->jira;\n \n if($newRework->save()){\n\n $vmDetail->vm_uid = $vm_uid;\n $vmDetail->save();\n //rule = username\n ob_end_flush();\n echo \"</br>\";\n echo \"<b>Your VM is reading but now we are setting hostname and nameserver and installing the IPA client <b><br>\";\n echo \"<b>So it may take upto few min, Go and grab some tea</b><br>\";\n \n if($app->os != 'window'){\n while(1){\n echo \"<b style='color:#FFC20A'>=</b>\";\n $otput = $this->ipa->findHost($vmDetail->hostname, $cookieName);\n $outArray = json_decode($otput, true);\n if($outArray['result']['count'] == 1)\n {\n break;\n }\n sleep(3);\n\n }\n $explodeHostname = explode('.',$vmDetail->hostname);\n $rule = $explodeHostname[0].'_'.$vmDetail->username;\n $this->ipa->addHbacRule($rule, $cookieName);\n $this->ipa->addHbacRuleUser($rule,$vmDetail->username, $cookieName);\n $this->ipa->addHbacRuleHost($rule,$vmDetail->hostname, $cookieName);\n $this->ipa->addHbacRuleService($rule, $cookieName);\n }\n \n\n \n //Mail::to($newvm->email)->send(new VmLaunched($newvm));\n // Mail::to('[email protected]')->cc('[email protected]')->send(new IpUpdateNotification($newvm));\n\n echo \"</br><br>\";\n echo \"<span style='color:#20ff00'>\";\n echo \"======================================================= <br>\";\n echo \"====== \".$vmDetail->name.\"- VM Created Successfully ===== <br>\";\n \n \n echo \"=======================================================<br>\";\n echo \"</span>\";\n }\n }\n }\n }", "public function actionClean() {\n $deletedArr=[];\n $errorArr=[];\n foreach(Finder::find('*')->in(CACHE_DIRECTORY) as $file=>$info){\n try{\n FileSystem::delete($file);\n $deletedArr[]=$file;\n }catch (\\Exception $e){\n $errorArr[]=$file;\n }\n }\n $response=[\n 'state'=>(empty($errorArr)?'OK':'error'),\n 'deleted'=>$deletedArr,\n 'errors'=>$errorArr\n ];\n $this->sendJson($response);\n }", "protected function optimizing()\n {\n if ($this->type !== 'delete') {\n $fields = $this->getMeta()->getFields(AttributeField::class);\n $unorderedNodes = $this->nodes;\n $this->nodes = [];\n\n foreach ($fields as $field) {\n $attname = $field->getAttname();\n\n foreach ($unorderedNodes as $key => $node) {\n if ($node->getAttname() === $attname) {\n $this->nodes[] = $node;\n unset($unorderedNodes[$key]);\n\n break;\n }\n }\n }\n\n $this->nodes = \\array_merge($this->nodes, $unorderedNodes);\n }\n }", "public function clearDiscovery();", "public function ensureConsistency()\n {\n\n if ($this->aFeature !== null && $this->feature_id !== $this->aFeature->getFeatureId()) {\n $this->aFeature = null;\n }\n if ($this->aCvterm !== null && $this->cvterm_id !== $this->aCvterm->getCvtermId()) {\n $this->aCvterm = null;\n }\n if ($this->aPub !== null && $this->pub_id !== $this->aPub->getPubId()) {\n $this->aPub = null;\n }\n }", "public function cleanRepair() {}", "private function nuke()\n {\n \\lib\\Model\\ModelCache::clear($this);\n $this->__new=true;\n $this->__fields=array();\n $this->__isDirty=false;\n $this->__dirtyFields=array();\n }", "public function prune()\n {\n if (!$this->isEmpty()) {\n $this->root->prune();\n $this->root = null;\n }\n }", "protected function removeGenomeUpdates() {\n // Retrieves genome uploads main folder (before users' folders)\n $rootDir = new Folder(WWW_ROOT . DS . 'files' . DS . 'genome_updates', false);\n\n // Checks if folder exists\n if(!$rootDir->Path) {\n $this->error('no-updates-root', 'Updates root folder has not been found');\n }\n\n // Loops users' folders\n foreach($rootDir->find() as $userId) {\n // Instances folder\n $userDir = new Folder($rootDir->pwd() . DS . $userId, false);\n // Checks if folder exists\n if($userDir->path) {\n // Searches user\n $user = $this->findUser($userId);\n // Case folder is not bound to any user\n if(!$user) {\n // Removes folder\n $userDir->remove();\n }\n // Case folder ha an user bound to istelf\n else {\n // Makes a list of files which should be stored into current user's directory\n $updates = array();\n foreach($user['configs'] as $config) {\n $updates = array_merge($updates, $config['updates']);\n }\n\n // Lists files into directory\n $folders = $userDir->find();\n // Loops every folder (should be named as update id)\n foreach($folders as $folder) {\n // Checks if name is present into uploads array\n if (!isset($updates[$folder]) || !$updates[$folder]) {\n $folder = new Folder($userDir->pwd() . DS . $folder, false);\n if($folder->path) {\n $folder->delete();\n }\n }\n }\n }\n }\n }\n }", "public function cleanup() {\n\n\t\t$fs = new \\Symfony\\Component\\Filesystem\\Filesystem();\n\n\t\t$challange_dir = EE_ROOT_DIR . '/services/nginx-proxy/html/.well-known';\n\t\t$challange_rule_file = EE_ROOT_DIR . '/services/nginx-proxy/vhost.d/default';\n\t\tif ( $fs->exists( $challange_rule_file ) ) {\n\t\t\t$fs->remove( $challange_rule_file );\n\t\t}\n\t\tif ( $fs->exists( $challange_dir ) ) {\n\t\t\t$fs->remove( $challange_dir );\n\t\t}\n\t}", "public function ensureConsistency()\n\t{\n\n\t\tif ($this->aPartie !== null && $this->partie_id !== $this->aPartie->getId()) {\n\t\t\t$this->aPartie = null;\n\t\t}\n\t\tif ($this->aPostRelatedByReplicaPostId !== null && $this->replica_post_id !== $this->aPostRelatedByReplicaPostId->getId()) {\n\t\t\t$this->aPostRelatedByReplicaPostId = null;\n\t\t}\n\t}", "public function deleteUnusedFiles(){\n \n }", "function virtual_hosting_db_fixintegrity()\n{\n $PHORUM = $GLOBALS[\"PHORUM\"];\n\n $stale = phorum_db_interact(\n DB_RETURN_ROWS,\n \"SELECT hostname,v.vroot\n FROM {$PHORUM[\"virtual_hosts_table\"]} AS v\n LEFT JOIN {$PHORUM[\"forums_table\"]}\n ON v.vroot = forum_id\n WHERE forum_id IS NULL\"\n );\n\n foreach ($stale as $rec) {\n virtual_hosting_db_unlinkhostname($rec[0], $rec[1]);\n }\n}", "public function cleanUp()\n\t{\n\t\t$this->logger = new ZFObserver_Forensic();\n\t\t$this->logger->attach(new ZFObserver_Observers_Text());\n\t\t$this->logger->setStatus(ZFObserver_ILogeable :: DEBUG);\n\t\tif( !empty($this->seedMirror) )\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tforeach($this->seedMirror as $id=>$seed)\n\t\t\t\t{\n\t\t\t\t\t$this->logger->notify($this, \"System setting {$seed}\");\n\t\t\t\t\t$this->setSeed($seed);\n\t\t\t\t\t$this->getTearDownOperation();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t$this->logger->notify($this, \"Exception caught while going down. \".$e->getMessage());\n\t\t\t}\n\t\t}\n\t}", "private function resetnsAction(){\n\t\t\n\t\t$this -> adminNS -> __unset('bikeAds');\n\t\t$this -> adminNS -> __unset('bikePhoto');\n\t\t$this -> adminNS -> __unset('bikeInsert');\t\t\n\t}" ]
[ "0.57330114", "0.51736265", "0.50988466", "0.5017974", "0.490558", "0.48949087", "0.4881771", "0.48385644", "0.4832635", "0.48161834", "0.47905853", "0.47737452", "0.4743827", "0.47349206", "0.4733623", "0.47286183", "0.4724922", "0.4708866", "0.46837717", "0.468364", "0.46829793", "0.4682777", "0.46792075", "0.46787074", "0.46645546", "0.46636504", "0.46597114", "0.46571586", "0.46217936", "0.46037164" ]
0.6815893
0
Authorize Admins for access to the Admin area.
private function authorizeAdmins() { $authorizedRoleIds = Configure::read('acl.role.access_plugin_role_ids'); $authorizedUserIds = Configure::read('acl.role.access_plugin_user_ids'); $modelRoleFk = $this->_getRoleForeignKeyName(); if (in_array($this->Auth->user($modelRoleFk), $authorizedRoleIds) || in_array( $this->Auth->user($this->getUserPrimaryKeyName()), $authorizedUserIds)) { // Allow all actions. CakePHP 2.0 $this->Auth->allow('*'); // Allow all actions. CakePHP 2.1 $this->Auth->allow(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n return Gate::allows('admin');\n }", "public function authorize()\n {\n return Gate::allows('admin');\n }", "public static function authAdmin() {\n if (Yii::$app->user->can(\"administrator\") || Yii::$app->user->can(\"adminsite\")) {\n return TRUE; //admin ใหญ่\n }\n }", "public function authorize()\n {\n return auth('admin')->check();\n }", "public function authorize()\n {\n $this->id = $this->route('admin');\n return auth('admin')->check();\n }", "public function authorize()\n {\n if(auth('admin')->check()){\n\n return true;\n\n }else{\n\n return false;\n\n }\n }", "public function authorize()\n {\n return true; //admin guard\n }", "public function authorize()\n {\n return Auth::guard('admin')->check();\n }", "public function authorize()\n {\n return auth()->guard('admin')->check();\n }", "public function authorize()\n {\n return isSuperAdmin();\n }", "static function adminGateKeeper() {\n if (!loggedIn() || !adminLoggedIn()) {\n new SystemMessage(translate(\"system_message:not_allowed_to_view\"));\n forward(\"home\");\n }\n }", "function authorizedAdminOnly(){\n global $authenticatedUser;\n if(!$authenticatedUser['admin']){\n header(\"HTTP/1.1 403 Forbidden\");\n header(\"Location: https://eso.vse.cz/~frim00/marvelous-movies/error-403\");\n exit();\n }\n }", "public function authorize()\n {\n if(auth()->guard('admin')->check()){\n return true;\n }\n\n return false;\n }", "public function authorize()\n\t{\n\t\treturn User::isAdmin();\n\t}", "public function requireAdmin(){\n if( ! Authentifiacation::isAdmin()){\n Authentifiacation::rememberRequestedPage();\n Flash::addMessage('You need to have admin status to access this page', Flash::INFO);\n self::redirect('/login/new');\n }\n }", "protected function requiresAdmin() {\n if (!$this->evaluateACLS(self::ACL_ADMIN)) {\n $this->unauthorizedAccess();\n }\n }", "public function authorize()\n {\n return auth()->user()->admin();\n }", "public function authorize()\n {\n return auth()->user()->admin();\n }", "public function authorize()\n {\n return auth()->user()->admin();\n }", "public function authorize()\n {\n return Auth::user()->is_admin;\n }", "public function authorize()\n {\n return Auth()->user()->can('isAdmin');\n }", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "function restrictedToAdmin(\n $redirectPage\n) {\n restrictedToAuthorized($redirectPage);\n $authUser = Authorizer::getAuthorizedUser();\n if ($authUser == null || ! $authUser->isAdmin()) {\n header(\"Location: \" . $redirectPage);\n exit();\n }\n}", "public static function requireAdmin()\n {\n if(!SessionHelper::isAdmin()){\n header('location: ' . (string)getenv('URL') . '/');\n }\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n\t{\n\t\treturn Auth::user()->hasRole('admin');\n\t}", "public function authorize()\n\t{\n\t\treturn Auth::user()->hasRole('admin');\n\t}" ]
[ "0.7631978", "0.7631978", "0.74966955", "0.74205786", "0.740605", "0.73730934", "0.73479766", "0.7312293", "0.7306907", "0.7237257", "0.72363514", "0.72122437", "0.7208024", "0.7203129", "0.7182813", "0.71687454", "0.71657455", "0.71657455", "0.71657455", "0.71304035", "0.7117872", "0.711012", "0.711012", "0.71077615", "0.7103206", "0.70877373", "0.70642", "0.70238096", "0.69996816", "0.69996816" ]
0.79690534
0
Get the Aco passed as an url parameter
protected function getPassedAcoPath() { $acoPath = ''; if (isset($this->params['named']['plugin'])) { $acoPath = $this->params['named']['plugin']; } if (empty($acoPath)) { $acoPath .= $this->params['named']['controller']; } else { $acoPath .= '/' . $this->params['named']['controller']; } $acoPath .= '/' . $this->params['named']['action']; return $acoPath; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getAsso()\r\n {\r\n return $this->get('asso_am.asso_selector')->getAsso();\r\n }", "protected function getAssoId()\r\n {\r\n return $this->get('asso_am.asso_selector')->getAssoId();\r\n }", "public function getAtocom()\n {\n return $this->atocom;\n }", "function wiziapp_cincopaUrl($type = 'xml'){\n switch ($type){\n case'json': return 'http://www.cincopa.com/media-platform/runtime/json.aspx?fid=';\n break;\n case'rss': return 'http://www.cincopa.com/media-platform/runtime/player44/rssjw.aspx?fid=';\n break;\n default:\n return 'http://www.cincopa.com/media-platform/runtime/airtightinteractive/viewer.aspx?fid=';\n break;\n }\n}", "public function getAproposUrl(){\n // return \"chanson.php/\".$id; \n return $this->rootUrl().\"apropos\"; \n }", "public function getAceite();", "function getUrlCauHoi(){\r\n\t\treturn $this->urlCauHoi;\r\n\t}", "public function get( $sURL, $sASIN, $sLanguageCode='', $sCurrency='' ) {\n \n $sQueryKey = $this->oOption->get( 'query', 'cloak' );\n $_aURLParts = parse_url( trim( $sURL ) );\n $_sQuery = $this->getElement( $_aURLParts, array( 'query' ), '' );\n parse_str( $_sQuery, $_aQuery );\n $_aQuery = array(\n $sQueryKey => $sASIN,\n 'locale' => $this->sLocale,\n 'ref' => 'nosim',\n 'tag' => $this->getAssociateID(),\n 'language' => $sLanguageCode,\n 'currency' => $sCurrency,\n ) + $_aQuery;\n if ( ! $this->bRefNosim ) {\n unset( $_aQuery[ 'ref' ] );\n }\n return add_query_arg( \n $_aQuery, \n site_url()\n );\n \n }", "public function getAudienceURLParam(string $url_params): string\n {\n return $this->getFilterURLParam($url_params, \"audience\", $this->audience_filter);\n }", "protected function getUrl() {\n\t\treturn $this->getQueryParam ( self::URL_PARAM );\n\t}", "public function getUrlDetail()\n {\n \treturn \"cob_actadocumentacion/ver/$this->id_actadocumentacion\";\n }", "public function getUrl()\n\t{\n\t\treturn '/akce/' . $this->getActionId();\n\t}", "private function getShopUrl($aShop)\n {\n $shop = $aShop;\n if (!strpos($aShop, \"https://\")) {\n $shop = \"https://\" . $aShop;\n }\n return $shop;\n }", "public function getAn() {\r\n $id = isset($_REQUEST[\"id\"]) ? $_REQUEST[\"id\"] : null;\r\n\r\n if (!isset($id)) {\r\n return null;\r\n }\r\n $anagrafica = AnagraficaFactory::getAnagrafica($id);\r\n if (!isset($anagrafica)) {\r\n echo 'Errore';\r\n exit(\"Errore nella generazione dell'anagrafica\");\r\n }\r\n header('Cache-Control: no-cache, must-revalidate');\r\n header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');\r\n header('Content-type: application/json');\r\n $json = array();\r\n $json[\"id\"] = $id;\r\n $json[\"nome\"] = $anagrafica->getNome();\r\n $json[\"cognome\"] = $anagrafica->getCognome();\r\n $json[\"tipo\"] = $anagrafica->getTipol();\r\n $json[\"contatto\"] = $anagrafica->getContatto();\r\n echo json_encode($json);\r\n }", "public function getAcesso()\n {\n return $this->acesso;\n }", "public function get2($link){\n $url = explode('/', $_GET['url']);\n $this->url_enlace = $url[2];\n }", "public function getAuthority() {}", "public function getAccountId(){\n\t\t$sResult = null;\n\t\tif (!empty($this->aLinks) && isset($this->aLinks[0])){\n\t\t\t/**\n\t\t\t * @var BeezupOMLink\n\t\t\t */\n\t\t\t$oLink = $this->aLinks[0];\n\t\t\t$aAtoms = explode('/', $oLink->getHref());\n\t\t\tif (isset($aAtoms[6]) && $aAtoms[4] == $this->getMarketPlaceTechnicalCode() && $aAtoms[6]== $this->getBeezupOrderUUID() && is_numeric($aAtoms[5])){\n\t\t\t\treturn $aAtoms[5];\n\t\t\t}\n\n\t\t}\n\t\treturn null;\n\t}", "public static function arprocUrl() {\n\t\treturn self::pw('pages')->get('pw_template=arproc')->url;\n\t}", "public function getAuthority()\n {\n }", "public function getAuthority()\n {\n }", "public function get()\n\t\t{\n\t\t\t$aArgument = func_get_args();\n\t\t\t$sURL = array_shift( $aArgument );\n\t\t\t$aData = (bool) count( $aArgument ) ? array_shift( $aArgument ) : Array();\n\t\t\t$mReferer = (bool) count( $aArgument ) ? array_shift( $aArgument ) : false;\n\n\t\t\treturn $this->request( \"get\", $sURL, $aData, $mReferer );\n\t\t}", "public function getCraApiUrl()\n\t{\n\t\treturn $this->config->getApiUrl();\n\t}", "private function _getURL()\n {\n\n $url = $this->_ect . '?';\n foreach ($this as $name => $var) {\n if ($name == 'ect') {\n continue;\n }\n $url .= \"$name=$var&\";\n }\n\n $this->url = $url;\n\n return $this->url;\n }", "public function getEcommUrl()\n {\n $this->db->select(\"hp_parm_desc\");\n $this->db->from(\"ims_hris.hradmin_parms\");\n $this->db->where(\"hp_parm_code = 'ECOMMUNITY_STAFF_URL'\");\n\n $q = $this->db->get();\n return $q->row_case('UPPER');\n }", "protected function getASIN($url)\n {\n $ASIN = str_replace(static::$base_url . \"/dp/\", '', $url);\n $ASIN = substr($ASIN, 0, 10);\n return $ASIN;\n }", "function caJSONLookupServiceUrl($po_request, $ps_table, $pa_attributes=null) {\n\t\t$o_dm = Datamodel::load();\n\t\t\n\t\tif (is_numeric($ps_table)) {\n\t\t\tif (!($t_table = $o_dm->getInstanceByTableNum($ps_table, true))) { return null; }\n\t\t} else {\n\t\t\tif (!($t_table = $o_dm->getInstanceByTableName($ps_table, true))) { return null; }\n\t\t}\n\t\t\n\t\t$vs_pk = $t_table->primaryKey();\n\t\t$vs_module = 'lookup';\n\t\tswitch($ps_table) {\n\t\t\tcase 'ca_objects':\n\t\t\tcase 57:\n\t\t\t\t$vs_controller = 'Object';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_object_lots':\n\t\t\tcase 51:\n\t\t\t\t$vs_controller = 'ObjectLot';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_entities':\n\t\t\tcase 20:\n\t\t\t\t$vs_controller = 'Entity';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_places':\n\t\t\tcase 72:\n\t\t\t\t$vs_controller = 'Place';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_occurrences':\n\t\t\tcase 67:\n\t\t\t\t$vs_controller = 'Occurrence';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_collections':\n\t\t\tcase 13:\n\t\t\t\t$vs_controller = 'Collection';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_storage_locations':\n\t\t\tcase 89:\n\t\t\t\t$vs_controller = 'StorageLocation';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_sets':\n\t\t\tcase 103:\n\t\t\t\t$vs_controller = 'Set';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_set_items':\n\t\t\tcase 105:\n\t\t\t\t$vs_controller = 'SetItem';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_lists':\n\t\t\tcase 36:\n\t\t\t\t$vs_controller = 'List';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_list_items':\n\t\t\tcase 33:\n\t\t\t\t$vs_controller = 'ListItem';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_relationship_types':\n\t\t\tcase 79:\n\t\t\t\t$vs_controller = 'RelationshipType';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_loans':\n\t\t\tcase 133:\n\t\t\t\t$vs_controller = 'Loan';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_movements':\n\t\t\tcase 137:\n\t\t\t\t$vs_controller = 'Movement';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_bundle_displays':\n\t\t\tcase 124:\n\t\t\t\t$vs_controller = 'BundleDisplay';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_metadata_elements':\n\t\t\tcase 42:\n\t\t\t\t$vs_controller = 'MetadataElement';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_search_forms':\n\t\t\tcase 121:\n\t\t\t\t$vs_controller = 'SearchForm';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_tours':\n\t\t\tcase 153:\n\t\t\t\t$vs_controller = 'Tour';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_tour_stops':\n\t\t\tcase 155:\n\t\t\t\t$vs_controller = 'TourStop';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_bundle_mappings':\n\t\t\tcase 128:\n\t\t\t\t$vs_controller = 'BundleMappings';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_bundle_mapping_groups':\n\t\t\tcase 130:\n\t\t\t\t$vs_controller = 'BundleMappingGroups';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_editor_uis':\n\t\t\tcase 101:\n\t\t\t\t$vs_controller = 'EditorUI';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_editor_ui_screens':\n\t\t\tcase 100:\n\t\t\t\t$vs_controller = 'EditorUIScreen';\n\t\t\t\tbreak;\n\t\t\tcase 'ca_object_representations':\n\t\t\tcase 56:\n\t\t\t\t$vs_controller = 'ObjectRepresentation';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn array(\n\t\t\t'ancestorList' => caNavUrl($po_request, $vs_module, $vs_controller, 'GetHierarchyAncestorList', $pa_attributes),\n\t\t\t'levelList' => caNavUrl($po_request, $vs_module, $vs_controller, 'GetHierarchyLevel', $pa_attributes),\n\t\t\t'search' => caNavUrl($po_request, $vs_module, $vs_controller, 'Get', $pa_attributes),\n\t\t\t'idno' => caNavUrl($po_request, $vs_module, $vs_controller, 'IDNo', $pa_attributes),\n\t\t\t'intrinsic' => caNavUrl($po_request, $vs_module, $vs_controller, 'intrinsic', $pa_attributes),\n\t\t\t'attribute' => caNavUrl($po_request, $vs_module, $vs_controller, 'Attribute', $pa_attributes)\n\t\t);\n\t}", "private function _getAqiLink () {\n return sprintf(\n 'https://www.purpleair.com/map?opt=1/mAQI/a10/cC0#8/%.4f/%.4f',\n $this->lat,\n $this->lon\n );\n }", "#[Pure]\n public function getRequestUrl() {}", "public function url()\n {\n return explode('?' ,$this->uri)[0];\n }" ]
[ "0.6314992", "0.5767865", "0.56962717", "0.56341916", "0.54825413", "0.5309926", "0.5264007", "0.5230006", "0.5218084", "0.50830007", "0.501909", "0.49902704", "0.49557215", "0.493336", "0.49329585", "0.49236137", "0.4916106", "0.4915516", "0.4912758", "0.48910385", "0.48910385", "0.48829615", "0.48478752", "0.48363194", "0.48218665", "0.48207977", "0.4820795", "0.4818699", "0.48159266", "0.48059785" ]
0.66496086
0
Set the Aco Variables
protected function setAcoVariables() { $this->set('plugin', isset($this->params['named']['plugin']) ? $this->params['named']['plugin'] : ''); $this->set('controller_name', $this->params['named']['controller']); $this->set('action', $this->params['named']['action']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setVariables()\n \t{\t\n \t\tif (isset($this->params->plugin)) {\n \t\t\t$this->setPlPath(App::pluginPath(Inflector::humanize($this->params->plugin)));\n \t\t}\n \t\t$this->setController($this->params->controller);\n \t\t$this->setAction($this->params->action);\n \t\t$this->setConstant(Configure::read('App'));\n \t\t\n \t}", "public function setVariablesEntrada()\r\n\t{\r\n\t\t$request = $this->requestStack->getCurrentRequest();\r\n\t\t\r\n\t\t$this->tipo = $request->get('tipo');\r\n\t\t$this->apoyoTapas = $request->get('apoyoTapas');\r\n\t\t$this->prof = $request->get('prof');\r\n\t\t$this->anchoPanel = $request->get('ancho');\r\n\t\t$this->pisosManual = $request->get('pisosManual');\r\n\t\t$this->perfilIntermedio = $request->get('perfilIntermedio');\r\n\t\t$this->pisosManual7 = $request->get('pisosManual7');\t\t\r\n\t\t$this->chapaPisoAdicional = $request->get('chapaPiso');\r\n\t\t$this->cantChapaPisoAdicional = $request->get('cantAdicional');\r\n\t\t$this->maxAlt = $request->get('maxAlt');\r\n\t\t$this->cantPaneles = $request->get('cantPaneles');\r\n\t\t$this->abiertoCerrado = $request->get('aletaTipo');\r\n\t\t$this->aletaVenA = $request->get('aletaVenA');\r\n\t\t$this->aletaFluA = $request->get('aletaFluA');\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "private function setQuantumVars() {\n \n if (!empty($_REQUEST['controller'])) {\n \n $this->controller = $_REQUEST['controller'];\n \n };\n \n if (!empty($_REQUEST['task'])) {\n \n $this->task = $_REQUEST['task'];\n \n }\n \n if (!empty($_REQUEST['object_id'])) {\n \n $this->object_id = $_REQUEST['object_id'];\n \n }\n \n \n }", "protected function initVars() {\n\n\t\t}", "public function set()\n {\n // to reflect the current bar.\n\n // Why?\n\n // Otherwise the bar count gets repeated. And that people notice.\n\n $this->variables->setVariable(\"count\", $this->bar_count);\n $this->variables->setVariable(\"max_bar_count\", $this->max_bar_count);\n\n $this->variables->setVariable(\"refreshed_at\", $this->current_time);\n }", "public function autoSet()\n {\n $this->setInfo();\n $this->setParams();\n $this->extractRoutingInfo();\n }", "public static function setEnvironnement()\n\t{\n\t\tUz_Autoloader::init(array(static::$framework_namespace=>$framework_path, static::$application_namespace=>static::$application_path),static::$framework_namespace,array());\n\t\t//On construit la session\n\t\tUz_Service_HTTP_Session::build();\n\t\t//On recupere la requete dans cet objet\n\t\tUz_Service_HTTP_Request::build();\n\t\tUz_Controller_Dispatcher::init(static::$application_namespace);\n\t\tUz_Mapper_Generic::init(static::configureDb());\n\t\t\n\t}", "protected function variablesAssign()\n {\n $app = $this->app;\n $this->request = $app['request'];\n $this->session = $app['session'];\n $this->template = $app['template'];\n $this->theme = $app['theme'];\n\n // Set Request Format\n switch ($this->request->getRequestFormat()) {\n case 'json':\n $this->format = 'json';\n break;\n\n case 'xml':\n $this->format = 'xml';\n break;\n\n case 'csv':\n $this->format = 'csv';\n break;\n\n case 'html':\n default:\n $this->format = 'html';\n break;\n }\n }", "public function set_attributes()\n {\n $this->id = 0;\n $this->set_process();\n $this->set_decomposition();\n $this->set_technique();\n $this->set_applicability();\n $this->set_input();\n $this->set_output();\n $this->set_validation();\n $this->set_quality();\n $this->score = 0;\n $this->matchScore = 0;\n $this->misMatch = \"\";\n }", "private function setSettings() {\n $this ->setAccessToken( $this ->token );\n $this ->setAccountId( self::ACCOUNT_ID );\n }", "public function set($variables) {\n foreach ($variables as $key => $value) {\n $this->vars[$key] = $value;\n }\n }", "public function setValues(){\n if($this->getType() == \"var\"){\n $this->setValue($this->getArg());\n }else if($this->getType() == \"int\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"bool\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"string\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"nil\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"label\"){\n $this->setValue($this->getArg());\n }else if($this->getType() == \"type\"){\n $this->setValue($this->getArg());\n }else{\n $this->setValue(\"CHYBA\");\n }\n }", "public function getSetVariables() {}", "function setAukstis($x) {\n $this->aukstis = $x; // privaciai reiksmei priskiriam kintamaji, kuris bus kazkuom pakeistas\n }", "public function setAttributes()\n\t{\n\t\t$this->title \t\t= Input::get( 'title' );\n\t\t$this->description \t= Input::get( 'description' );\n\t\t$this->color \t\t= Input::get( 'color' );\n\t\t$this->type \t\t= Input::get( 'type' );\n\t\t$this->canvas_id\t= Input::get( 'canvas_id', Input::get( 'canvasId' ) );\n\t}", "public function setDatas()\n\t{\n\t\t$this->data[\"skeleton\"] = $this->getSkeleton();\n\t\t$this->data[\"css\"] = $this->getCss();\n\t\t$this->data[\"javascript\"] = $this->getJavascript();\n\t\t$this->data[\"module\"] = $this->getModule();\n\t\t$this->data[\"site\"] = $this->getSite();\n\t\t\t\t\t\t\n\t\t$this->_nodeName = $this->getNodeName();\n\t\t$this->_value = $this->getNodeValue();\n\t}", "function setVar() {\n\t\t\n\t\t$_argv = func_get_args();\n\t\t$_argc = func_num_args();\n\t\t\n\t\t// load vars\n\t\t$vars = getVars();\n\t\tif (!$_GET[\"__shared__\"][\"vars\"]) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"] = array();\n\t\t}\n\t\tforeach ($vars as $varNamespace => $varArray) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"][$varNamespace] = $varArray;\n\t\t}\n\t\t\n\t\t// Register namespace if not existing\n\t\tif (!$_GET[\"__shared__\"][\"vars\"][$_argv[0]]) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"][$_argv[0]] = array();\n\t\t}\n\t\tif ($_argc == 2) {\n\t\t\tif (is_array($_argv[1])) {\n\t\t\t\tforeach ($_argv[1] as $var => $val) {\n\t\t\t\t\t$_GET[\"__shared__\"][\"vars\"][$_argv[0]][$var] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ($_argc == 3) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"][$_argv[0]][$_argv[1]] = $_argv[2];\n\t\t}\n\t\t\n\t\t// save vars\n\t\t\n\t\tsaveVars();\n\t}", "protected function init()\n {\n $arVariablesExtend = Event::fire(self::EVENT_EXTEND_VARIABLES, []);\n\n foreach ($arVariablesExtend as $iIndex => $arExtend)\n {\n foreach ($arExtend as $sKey => $arVariable) {\n if (in_array($sKey, $this->arVariables)) {\n continue;\n }\n\n // Add to variables\n $this->arVariables[$sKey] = $arVariable;\n }\n }\n }", "public function setVariables(array $variables);", "private function setOptions()\n {\n $this->clientId = $this->config['stravaSettings']['clientId'];\n $this->clientSecret = $this->config['stravaSettings']['clientSecret'];\n $this->redirectUri = $this->config['stravaSettings']['redirectUri'];\n $this->aprovalPrompt = $this->config['stravaSettings']['approval_prompt'];\n $this->scopes = $this->config['stravaSettings']['scopes'];\n }", "public function setResaca($resaca){\n $this->resaca=$resaca;\n }", "public function finish_setting_parameters()\n {\n $this->set_variable( 'parameters', $this->parameters );\n }", "function SetCustomVars()\r\n\t\t{\r\n\r\n\r\n\r\n\t\t\t$this->_variables['availablecountries'] = array(\"name\" => \"Continentes\",\r\n\t\t\t \"type\" => \"dropdown\",\r\n\t\t\t \"help\" => GetLang('boletoitauContinentes'),\r\n\t\t\t \"default\" => \"all\",\r\n\t\t\t \"required\" => true,\r\n\t\t\t \"options\" => GetCountryListAsNameValuePairs(),\r\n\t\t\t\t\"multiselect\" => true\r\n\t\t\t);\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['desconto'] = array(\"name\" => \"Desconto em %\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => '',\r\n\t\t\t \"default\" => \"0\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\r\n\r\n\t\t\t$this->_variables['boletoitaucedente'] = array(\"name\" => \"Cedente\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauCedente'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\r\n\t\t\t$this->_variables['boletoitauagencia'] = array(\"name\" => \"Agencia\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauAgencia'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => true\r\n\t\t\t\t);\r\n\r\n\t\t\t$this->_variables['boletoitauconta'] = array(\"name\" => \"Conta\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauConta'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\r\n\t\t\t$this->_variables['boletoitaucarteira'] = array(\"name\" => \"Carteira\",\r\n\t\t\t \"type\" => \"dropdown\",\r\n\t\t\t \"help\" => GetLang('boletoitauCarteira'),\r\n\t\t\t \"default\" => \"20\",\r\n\t\t\t \"options\" => array('175' => '175', '109' => '109'),\r\n\t\t\t \"required\" => true,\r\n\t\t\t \"multiselection\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\r\n\r\n\r\n\t//_-----------------------------------------------------------------------------------------demonstrativos\r\n\t\r\n\t\t\t$this->_variables['demoum'] = array(\"name\" => \"Demonstra&ccedil;&atilde;o 1\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDemoU'),\r\n\t\t\t \"default\" => \"REFERENTE A COMPRAS ONLINE\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t$this->_variables['demodois'] = array(\"name\" => \"Demonstra&ccedil;&atilde;o 2\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDemoD'),\r\n\t\t\t \"default\" => \"Duvidas e sugest&otilde;es entre em contato conosco:\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t\t\t$this->_variables['demotres'] = array(\"name\" => \"Demonstra&ccedil;&atilde;o 3\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDemoT'),\r\n\t\t\t \"default\" => \"[email protected] | +55 xx 0000.0000\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t//_------------------------------------------------------------------------------------------fim-demonstrativos\r\n\t\r\n\r\n\r\n\r\n\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauinstrucaoum'] = array(\"name\" => \"Instru&ccedil;&atilde;o 1\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoUm'),\r\n\t\t\t \"default\" => \"Multa de R$ 3,00 por atraso.\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t$this->_variables['boletoitauinstrucaodois'] = array(\"name\" => \"Instru&ccedil;&atilde;o 2\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoDois'),\r\n\t\t\t \"default\" => \"Apos o vencimento, pagavel apenas no Banco Real\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t\t\t$this->_variables['boletoitauinstrucaotres'] = array(\"name\" => \"Instru&ccedil;&atilde;o 3\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoTres'),\r\n\t\t\t \"default\" => \"Fatura sujeita a protesto no SPC/SERASA\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauinstrucaoquatro'] = array(\"name\" => \"Instru&ccedil;&atilde;o 4\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoQuatro'),\r\n\t\t\t \"default\" => \"Juros de mora de 0,1% ao dia.\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauaceite'] = array(\"name\" => \"Aceite\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauAceite'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauespeciedoc'] = array(\"name\" => \"Esp&eacute;cie do documento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauEspecieDoc'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\r\n\t\t\t$this->_variables['boletoitauespecie'] = array(\"name\" => \"Esp&eacute;cie de cobran&ccedil;a\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauEspecie'),\r\n\t\t\t \"default\" => \"R$\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\r\n\t\t\t$this->_variables['boletoitaucpfcnpj'] = array(\"name\" => \"CPF ou CNPJ do Boleto\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauCNPF'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\r\n\t\t$this->_variables['boletoitaudiasparavencimento'] = array(\"name\" => \"Dias para vencimento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauVence'),\r\n\t\t\t \"default\" => \"10\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\r\n\r\n\r\n\t\t$this->_variables['boletoitaudv'] = array(\"name\" => \"D&iacute;gito Verificador\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDV'),\r\n\t\t\t \"default\" => \"0\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\r\n\t\t\t$this->_variables['postagem'] = array(\"name\" => \"LINK de Repagamento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => \"URL para Repagamento\",\r\n\t\t\t \"default\" => \"%%GLOBAL_ShopPath%%/modules/checkout/boletoitau/boleto_itau.php?boleto=\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$this->_variables['imagems'] = array(\"name\" => \"IMAGEM de Repagamento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => \"URL para Repagamento\",\r\n\t\t\t \"default\" => \"%%GLOBAL_ShopPath%%/modules/checkout/boletoitau/images/logo.gif\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t$this->_variables['helptext'] = array(\"name\" => \"Mais configura&ccedil;&otilde;es\",\r\n\t\t\t \"type\" => \"textarea\",\r\n\t\t\t \"help\" => GetLang('boletoitauInst'),\r\n\t\t\t \"default\" => \"Voc&ecirc; escolheu pagar com Boleto Banc&aacute;rio do Banco Ita&uacute;.\\nPara reimprimir seu boleto clique no bot&atilde;o abaixo.<br>\",\r\n\t\t\t \"required\" => true,\r\n\t\t\t \"rows\" => 7\r\n\t\t\t);\r\n\t\t\t\r\n\t\t}", "public function setVars( array $vars ) {\n $this->vars += $vars;\n }", "public function setVariables( $variables ) {\n\t\t$this->variables = $variables;\n\t}", "public function setup()\n {\n \t// rtConfig::set('your-key', $your_value);\n }", "protected function CustomVariables ()\r\n\t{\r\n\t\t// Overwrite variables if you want them custom\r\n\t\t$this->Set ('autoload', true);\r\n\t\t$this->Set ('enable_query_strings', false);\r\n\t\t\r\n\t\t// Add your own variables\r\n\t\t$this->Set ('database_host', 'localhost');\r\n\t\t$this->Set ('database_user', 'database_username');\r\n\t\t$this->Set ('database_pass', 'database_password');\r\n\t\t$this->Set ('database_name', 'database_name');\r\n\t\t$this->Set ('database_prefix', 'database_prefix');\r\n\t}", "public function set_vars($vars)\n\t{\n\t\t$this->vars = array_merge($this->vars, $vars);\n\t}", "public function setGlobalsData()\n\t{\n\t\t$GLOBALS['controller'] = $this->class_Name;\n\t\t$GLOBALS['action'] = $this->action_Name;\n\t}", "private function load_variables() : void {\n\t\t$this->today = new \\DateTime( 'NOW' );\n\t\t$this->start_date = new \\DateTime( FTW_START_DATE );\n\t\t$this->completion_date = new \\DateTime( FTW_COMPLETION_DATE );\n\t}" ]
[ "0.6426496", "0.63845694", "0.6160323", "0.61217064", "0.59801626", "0.5944837", "0.5867351", "0.58112305", "0.57892907", "0.5781792", "0.5739037", "0.5672007", "0.56626254", "0.56445134", "0.5637403", "0.56333673", "0.5633296", "0.5622706", "0.5604848", "0.55785626", "0.5564543", "0.55381536", "0.5535901", "0.54958224", "0.54891014", "0.54782844", "0.5473602", "0.5466939", "0.5466081", "0.5457399" ]
0.8083901
0