query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Construct a review html block. This is for a specific burn id (passed to $_GET on the page) | public function reviewPage($accomplishment_id)
{
$permissions = checkFunctionPermissions($_SESSION['user']['id'], array('admin','admin_final','system_admin'), 'write');
// Get the daily burn.
$accomplishment = $this->get($accomplishment_id);
// Construct the title.
if (isset($accomplishment['burn_project']['project_name']) && isset($accomplishment['burn_project']['project_number'])) {
$title = $accomplishment['burn_project']['project_name']." / ".$accomplishment['burn_project']['project_number']." / <small>".$accomplishment['request_dates']['start_date']." to ". $accomplishment['request_dates']['end_date']."</small>";
} elseif (isset($accomplishment['burn_project']['project_name']) ) {
$title = $accomplishment['burn_project']['project_name']." / <small>".$accomplishment['request_dates']['start_date']." to ". $accomplishment['request_dates']['end_date']."</small>";
} else {
$title = "Accomplishment";
}
if ($accomplishment['status_id'] >= $this->approved_id || $permissions['deny']) {
$upper_toolbar = "<div class=\"btn-group pull-right\">
<btn class=\"btn btn-sm btn-default\" onclick=\"Accomplishment.ownerChangeForm($accomplishment_id)\">Change Owner</btn>
</div>";
$review_toolbar = "<div class=\"btn-group pull-right\">
<btn class=\"btn btn-sm btn-default\" onclick=\"AccomplishmentReview.reviewForm($accomplishment_id)\">Add Review</btn>
</div>";
$conditions_toolbar = "";
} else {
$upper_toolbar = "<div class=\"btn-group pull-right\">
<btn class=\"btn btn-sm btn-default\" onclick=\"Accomplishment.ownerChangeForm($accomplishment_id)\">Change Owner</btn>
<btn class=\"btn btn-sm btn-default\" onclick=\"AccomplishmentReview.approveForm($accomplishment_id)\">Approve</btn>
</div>";
$review_toolbar = "<div class=\"btn-group pull-right\">
<btn class=\"btn btn-sm btn-default\" onclick=\"AccomplishmentReview.reviewForm($accomplishment_id)\">Add Review</btn>
</div>";
$conditions_toolbar = "<div class=\"btn-group pull-right\">
<btn class=\"btn btn-sm btn-default\" onclick=\"AccomplishmentReview.conditionForm($accomplishment_id)\">Add Note</btn>
</div>";
}
$map = $this->getMap($accomplishment);
$title_status = $this->getStatusLabel($accomplishment);
$fuels = $this->tablifyFuels($accomplishment_id);
$contacts = $this->getContacts($accomplishment_id);
$uploads = $this->getUploads($accomplishment_id);
$reviews = $this->getReviews($accomplishment_id);
$return_href = $this->mainUrl();
// Construct the header.
$html = "<div class=\"row\">
<div class=\"col-sm-12\">
<span class=\"pull-right\">
$return_href
$title_status
</span>
<h3>$title</h3>
</div>
</div>
<div class=\"row\">
<div class=\"col-sm-8\">
<h4>Details</h4>
<hr>";
// Construct the map.
$html .= "<div>
$map
</div>";
// Construct the data table.
$html .= "<div style=\"margin-top: 15px; padding-left: 0px\" class=\"col-sm-12\">";
$html .= $this->tablifyFields($accomplishment, 'unit_info');
$html .= "</div>
</div>
<div class=\"col-sm-4\">
<div class=\"form-block\"></div>
$upper_toolbar
$contacts
$review_toolbar
$reviews
$uploads
</div>
</div>
<div class=\"row\">
<div class=\"col-sm-12\">
{$fuels['html']}
</div>
</div>";
return $html;
} | [
"protected function getReviews($burn_id)\n {\n\n $permissions = checkFunctionPermissionsAll($_SESSION['user']['id'], array('user','user_district','user_agency','admin','admin_final','system'));\n\n if ($full = true) {\n $com_cond = \"r.comment, '</a>'\";\n } else {\n $com_cond = \"LEFT(r.comment, 47), '...</a>'\";\n }\n\n $html = \"<div class=\\\"\\\" style=\\\"margin: 15px 0px;\\\">\n <h4>Reviews</h4>\n <hr>\";\n\n if ($permissions['write']['admin']) {\n $pre_sql = \"r.burn_review_id, \";\n }\n\n $sql = \"SELECT $pre_sql COALESCE(CONCAT(u.full_name, '<br><small><span class=\\\"label label-default\\\">Edited By</span></small>'), a.full_name) as \\\"Reviewer\\\", CONCAT('<a style=\\\"cursor: pointer\\\" onclick=\\\"BurnProject.reviewDetail(', r.burn_review_id ,')\\\">', $com_cond) as \\\"Excerpt\\\", CONCAT('<small>', COALESCE(r.updated_on, r.added_on), '</small>') as \\\"Edited\\\"\n FROM burn_reviews r\n JOIN users a ON (r.added_by = a.user_id)\n LEFT JOIN users u ON (r.updated_by = u.user_id)\n WHERE burn_id = $burn_id\";\n\n if ($permissions['write']['admin']) {\n $table = show(array('sql'=>$sql,'no_results_message'=>'There are currently no reviews associated with this Burn Request.',\n 'no_results_class'=>'info','pkey'=>'burn_review_id','table'=>'burn_reviews','include_edit'=>true,'include_delete'=>false,\n 'edit_function'=>'BurnReview.editReviewForm'));\n } else {\n $table = show(array('sql'=>$sql,'no_results_message'=>'There are currently no reviews associated with this Burn Request.',\n 'no_results_class'=>'info'));\n }\n\n //$table = show(array('sql'=>$sql,'no_results_message'=>'There are currently no reviews associated with this Burn request.',\n // 'no_results_class'=>'info'));\n\n $html .= $table['html'];\n\n $html .= \"</div>\";\n\n return $html;\n }",
"public function reviewPage($burn_project_id)\n {\n\n $burn_project = $this->get($burn_project_id);\n\n $boundary_html = $this->getMap($burn_project, true, \"Return to burn\");\n\n // Construct the map.\n $html = \"<div>\n $boundary_html\n </div>\";\n\n // Construct the data table.\n $html .= \"<div style=\\\"margin-top: 15px; padding-left: 0px\\\" class=\\\"col-sm-12\\\">\";\n \n $html .= $this->tablifyFields($burn_project, 'project_info');\n $html .= $this->tablifyFields($burn_project, 'detail_info');\n\n $html .= \"\n </div>\";\n\n return $html;\n }",
"function buildReviewDisplay($invId){\r\n $sessionFirstname = $_SESSION['clientData']['clientFirstname'];\r\n $sessionLastname = $_SESSION['clientData']['clientLastname'];\r\n $sessionClientId = $_SESSION['clientData']['clientId'];\r\n $screenName = substr($sessionFirstname,0,1).$sessionLastname;\r\n\r\n $display = \"<h3>Write a review:</h3>\";\r\n $display .= \"<form method='post' action='/phpmotors/reviews/index.php'>\";\r\n $display .= \"<label for='screenName'>Screen Name:<input type='text' name='screenName' id='screenName' value='$screenName' readonly></label>\";\r\n $display .= \"<label for='reviewText'>Review:<textarea id='reviewText' name='reviewText' rows='3' cols='40' required></textarea></label>\";\r\n $display .= \"<input type='submit' value='Submit' id='revSubmit' class='submitBtn' name='submit'>\";\r\n $display .= \"<input type='hidden' name='invId' id='invId' value='$invId'>\";\r\n $display .= \"<input type='hidden' name='clientId' id='clientId' value='$sessionClientId'>\";\r\n $display .= \"<input type='hidden' name='action' value='add'></form>\";\r\n\r\n return $display;\r\n\r\n}",
"function genPastReviewsArea($allReviews)\n{\n\n foreach ($allReviews as $row) {\n echo \"<div class='review' itemprop='review' itemscope itemtype='http://schema.org/Review'>\n <div class='stars' itemprop='reviewRating' itemscope itemtype='http://schema.org/Rating'>\n <meta itemprop='worstRating' content = '1'/>\n <meta itemprop='ratingValue' content='{$row['rating']}'/>\n <meta itemprop='bestRating' content='5'/>\n <div class='star-rating__wrap' title='{$row['rating']}' ' out of 5 stars'>\";\n\n // generate html of stars\n genFixedStars($row['rating']);\n\n echo \"</div>\n </div>\n\n <div class='comment'>\n <p itemprop='description' >{$row['commentText']}\n <sub><em itemprop='author' >{$row['username']}</em><span itemprop='datePublished' content='{$row['datePosted']}'></span> added on {$row['datePosted']}</sub>\n </p>\n </div>\n </div>\";\n }\n}",
"function view_house_review($houseID)\n{\n\t\n}",
"public function review_box() {\n\t\treturn $this->get_break_out_content() . '<section class=\"row\">' . do_shortcode( post_meta( 'review-box' ) ) . '</section>' . $this->get_content_restart();\n\t}",
"protected function _getReviewHtml()\n {\n $layout = $this->getLayout();\n $update = $layout->getUpdate();\n $update->load('checkout_onepage_review');\n $layout->generateXml();\n $layout->generateBlocks();\n $output = $layout->getOutput();\n return $output;\n }",
"function b_myReviews_top_show($options) {\r\n\tglobal $xoopsDB;\r\n\t$block = array();\r\n\t$myts =& MyTextSanitizer::getInstance();\r\n\t//$order = date for most recent reviews\r\n\t//$order = hits for most popular reviews\r\n //$order = votes for most voted reviews\r\n //$order = rating for best ranked reviews\r\n\t$result = $xoopsDB->query(\"SELECT lid, cid, title, date, hits, votes, rating, logourl FROM \".$xoopsDB->prefix(\"myReviews_downloads\").\" WHERE status>0 ORDER BY \".$options[0].\" DESC\",$options[1],0);\r\n\t$block['content'] = \"<ul>\";\r\n\twhile($myrow=$xoopsDB->fetchArray($result)){\r\n\t\t$result2 = $xoopsDB->query(\"SELECT title, cid FROM \".$xoopsDB->prefix(\"myReviews_cat\").\" WHERE cid=\".$myrow['cid'].\"\");\r\n\t\t$myrow2 = $xoopsDB->fetchArray($result2);\r\n\t\t$title = $myts->makeTboxData4Show($myrow[\"title\"]);\r\n\t\t$title2 = $myts->makeTboxData4Show($myrow2[\"title\"]);\r\n\t\tif ( !XOOPS_USE_MULTIBYTES ) {\r\n\t\t\tif (strlen($title) >= 33) {\r\n\t\t\t\t$title = substr($title,0,32).\"...\";\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ( !XOOPS_USE_MULTIBYTES ){\r\n if (strlen($title2) >= 33) {\r\n $title2 = substr($title2,0,32).\"...\";\r\n }\r\n }\r\n if ($options[2]==1)\r\n {\r\n if ($myrow['logourl'])\r\n {\r\n if (file_exists(XOOPS_ROOT_PATH.\"/modules/myReviews/images/shots/thumbs/\".$myrow['logourl']))\r\n {\r\n $block['content'] .= \"<center><a href='\".XOOPS_URL.\"/modules/myReviews/images/shots/\".$myrow['logourl'].\"' target='_blank'><img src='\".XOOPS_URL.\"/modules/myReviews/images/shots/thumbs/\".$myrow['logourl'].\"' width='100' border='0' align='center'></a></center>\";\r\n }//End if\r\n }//End If\r\n }//End if\r\n\r\n\t\tif($options[0] == \"date\"){\r\n\t\t\t$block['content'] .= \"<li><b>\".$title2.\":</b> </strong> <a href='\".XOOPS_URL.\"/modules/myReviews/detailfile.php?lid=\".$myrow['lid'].\"'>\".$title.\" </a> (\".formatTimestamp($myrow['date'],\"s\").\")</li>\";\r\n\t\t\t$block['title'] = _MB_myReviews_TITLE1;\r\n\t\t}elseif($options[0] == \"hits\"){\r\n\t\t\t$block['content'] .= \"<li><b>\".$title2.\":</b> </strong> <a href='\".XOOPS_URL.\"/modules/myReviews/detailfile.php?lid=\".$myrow['lid'].\"'>\".$title.\" </a> (\".$myrow['hits'].\")</li>\";\r\n\t\t\t$block['title'] = _MB_myReviews_TITLE2;\r\n }elseif($options[0] == \"votes\"){\r\n $block['content'] .= \"<li><b>\".$title2.\":</b> </strong> <a href='\".XOOPS_URL.\"/modules/myReviews/detailfile.php?lid=\".$myrow['lid'].\"'>\".$title.\" </a> (\".$myrow['votes'].\")</li>\";\r\n $block['title'] = _MB_myReviews_TITLE3;\r\n }elseif($options[0] == \"rating\"){\r\n $block['content'] .= \"<li><b>\".$title2.\":</b> </strong> <a href='\".XOOPS_URL.\"/modules/myReviews/detailfile.php?lid=\".$myrow['lid'].\"'>\".$title.\" </a> (\".round($myrow['rating'],1).\")</li>\";\r\n $block['title'] = _MB_myReviews_TITLE4;\r\n }\r\n\t}\r\n \t$block['content'] .= \"</ul>\";\r\n\treturn $block;\r\n}",
"public function show_review() {\n $id = $_POST['r_id'];\n $review = $this->model->get_review_by_id($id);\n\n echo $review['text'];\n }",
"public function usersReviewByCompanyID($data, $cmpid, $limit){\n $bind = new pafap_bind();\n $index = 0;\n foreach ($data as $row){\n $uid = $row['ruid'];\n $user = $row['fname'];\n $time = $row['date_created'];\n $desc = $row['rnotes'];\n $header = $row['header'];\n $star = $row['stars'];\n $time = strtotime($time);\n $index +=1;\n if($index <= $limit){\n echo \"<div class='container'><div class='row'>\n <div itemprop='review' itemscope='' itemtype='http://schema.org/Review' class='review pageable-item-js item clearfix' data-reviewmid='md5($uid)'>\n <meta itemprop='itemreviewed' content='$header'>\n <div itemprop='author' itemscope='' itemtype='http://schema.org/Person' class='user-info clearfix'>\n <div class='user-review-name clearfix'>\n <a class='user-review-name-link' itemprop='url' rel='nofollow' title='go to $user profile' href='/users/index.php?uid={$bind->sd($uid)}'>\n <span itemprop='name'>$user</span>\n </a>\n </div>\n <div class='clearfix'>\n 1 Review for $header company\n </div>\n </div>\n <div class='review-info clearfix'>\n Published {$bind->humanTiming($time)} ago\n <meta itemprop='dateCreated' content='{$time}'>\n <h3 itemprop='headline' class='review-title en h4'>\n <a class='review-title-link' rel='nofollow' href='#'>{$this->printStars($star)} Review</a>\n </h3>\n <div itemprop='reviewBody'>\n $desc\n </div>\n </div>\n </div>\n </div></div>\";\n }\n }\n }",
"function show_bookreview_view($attr)\n{\n\t/**\n\t * get the view page\n\t *\n\t */\n\t$view_page = $attr['view_page'];\n\t$bookreview_post;\n\n\tif($view_page == 'HOME')\n\t{\n\t\t//create link\n\t\t$link = get_bloginfo('url') . '/book-reviews/';\n\t\techo '<div id=\"reviews-box\" class=\"reviews-box-class\">\n\t\t<h3 class=\"widget-title\"><a title=\"View all Book Reviews\" href=\"'. $link .'\">Book Reviews</a></h3>\n\t\t<ul class=\"clearfix\">';\n\t\t//get recent 3 bookreview post\n\t\t$bookreview_post = new WP_Query('post_type=bookreview&posts_per_page=3');\n\t}\n\telseif($view_page == 'BOOK_REVIEWS')\n\t{\n\t\t//create link\n\t\t$link = get_bloginfo('url') . '/add-review';\n\t\techo '<a title=\"Add Book Review\" href=\"'. $link .'\" class=\"button add-review-btn\">Add Book Review</a>';\n\t\techo '<div id=\"reviews-box\" class=\"reviews-box-class\">\n\t\t<ul class=\"clearfix\">';\n\t\t//get all book review posts\n\n\t\t$bookreview_post = new WP_Query(array('post_type' => 'bookreview','posts_per_page' => 6,'paged' => get_query_var('paged')));\n\t}\n\telseif($view_page == 'MY_REVIEWS')\n\t{\n\t\t//create link\n\t\tglobal $user_ID;\n\t\t$link = get_bloginfo('url') . '/add-review';\n\t\tif(bp_displayed_user_id()== $user_ID)\n\t\t{\n\t\t\techo '<a title=\"Add Book Review\" href=\"'. $link .'\" class=\"button \" style=\"color:#fff\">Add Book Review</a>';\n\t\t}\n\t\techo '<div id=\"reviews-box\" class=\"reviews-box-class\">\n\t\t<ul class=\"clearfix\">';\n\t\t//get all reviews by author\n\t\t$bookreview_post = new WP_Query('post_type=bookreview&author='. bp_displayed_user_id() . '&posts_per_page=-1');\n\t}\n\n\t//var_dump($bookreview_post);\n\n\tif($bookreview_post->have_posts())\n\t{\n\t\twhile($bookreview_post->have_posts()):\n\t\t\t\n\t\t$bookreview_post->the_post();\n\n\t\t//create proper date format\n\t\t$time = strtotime(get_the_date());\n\t\t$date = date('d M y',$time);\n\n\t\t//strip post content if extra\n\t\t$post_content = (strlen(get_the_content()) > 200) ? substr(get_the_content(),0,197) . '...' : get_the_content();\n\t\t//get_post($post->ID);\n\n\t\t//trim post title\n\t\t$post_title = (strlen(get_the_title()) > 25) ? substr(get_the_title(),0,21) . '»' : get_the_title();\n\n\t\t?>\n<li>\n\t<div class=\"review-thumb\">\n\t\t<?php \n\t\tif(has_post_thumbnail(get_the_ID())):\n\t\techo get_the_post_thumbnail(get_the_ID(),array(193,193));\n\t\telse:\n\t\techo '<img src=\"'. get_template_directory_uri() . '/img/nobookimage.png\" width=\"193\" height=\"193\" alt=\"' . get_the_title() . '\"/>';\n\t\tendif;\n\t\t?>\n\t\t<span class=\"date\"><?php echo $date; ?> </span>\n\t</div>\n\t<h4>\n\t\t<a title=\"<?php echo get_the_title(); ?>\"\n\t\t\thref=\"<?php echo get_permalink( get_the_ID() ); ?>\"> <?php //echo $post_title; ?>\n\t\t\t<?php echo get_the_title(); ?>\n\t\t</a>\n\t</h4>\n\t<div class=\"review-cats\">\n\t\t<?php \n\t\t$categories = get_the_terms(get_the_ID(), 'bookreview_category' );\n\t\tif($categories):\n\t\t?>\n\t\tPosted in\n\t\t<?php foreach($categories as $category ):?>\n\t\t<a\n\t\t\thref=\"<?php echo get_term_link($category, 'bookreview_category' ); ?>\"\n\t\t\tclass=\"box_tag\"><?php echo $category->name; ?> </a> \n\t\t<?php endforeach; endif; ?>\n\t</div>\n\t<div class=\"review-meta\">\n\t\tReviewed by <a\n\t\t\thref=\"<?php echo bp_core_get_user_domain(get_the_author_ID()); ?>\"><?php echo bp_core_get_user_displayname(get_the_author_ID()); ?>\n\t\t</a>\n\t</div>\n\t<div class=\"review-desc\">\n\t\t<?php echo $post_content;?>\n\t\t<a href=\"<?php echo get_permalink( get_the_ID() ); ?>\" class=\"\">Read\n\t\t\tMore</a>\n\t</div>\n\t<div class=\"review-bar clear\">\n\t\t<div class=\"review-actions\">\n\t\t\t<?php if($view_page == 'MY_REVIEWS' && is_user_logged_in() && (get_the_author_ID() == bp_displayed_user_id())): ?>\n\t\t\t<div class=\"edit-options\">\n\t\t\t\t<a\n\t\t\t\t\thref=\"<?php echo get_bloginfo('url') . '/edit-review/?id=' . get_the_ID()?>\"\n\t\t\t\t\tclass=\"edit-classified box_tag button size-mini\">Edit</a> <span\n\t\t\t\t\tclass=\"delete_review box_tag button size-mini\"\n\t\t\t\t\treview_id=\"<?php echo get_the_ID();?>\">Delete</span>\n\t\t\t</div>\n\t\t\t<?php else: endif; ?>\n\t\t</div>\n\t</div>\n</li>\n\n<?php \nendwhile;\n\n//close the div\necho '</ul></div><div class=\"clearfix clear\"></div>';\n\n//handle delete operation\nif($view_page == 'MY_REVIEWS'):\n?>\n<script>\n\t\t\t\tjQuery('.delete_review').click(function(){\n\t\t\t\t\tvar c = confirm(\"Are you sure you want to delete this review?\");\n\t\t\n\t\t\t\t\tif(c == true)\n\t\t\t\t\t{\n\t\t\t\t\t\tjQuery(this).html('Deleting. . .');\n\t\t\t\t\t\tvar _this = this;\t\n\t\t\t\t\t\tvar data = {\n\t\t\t\t\t\t\taction: 'delete_review',\n\t\t\t\t\t\t\treview_id : jQuery(this).attr('review_id') \n\t\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\t\t// since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php\n\t\t\t\t\t\tjQuery.post(ajaxurl, data, function(response) {\n\t\t\t\t\t\t\tif(response == 'DELETED')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tjQuery(_this).parent().parent().fadeOut();\t\n\t\t\t\t\t\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\n\t\t\t\t</script>\n\n<?php \nendif;\n\n//if main reviews page. add pagination\nif($view_page == 'BOOK_REVIEWS'\t) :\n?>\n\n<?php\n$nav_prev = get_previous_posts_link(__('Newer Reviews', 'om_theme'), 20);\n$nav_next = get_next_posts_link(__('Older Reviews', 'om_theme'), 20);\nif( $nav_prev || $nav_next ) {\n\t?>\n<div class=\"navigation-prev-next\">\n\t<?php if($nav_prev){?>\n\t<div class=\"navigation-prev\">\n\t\t<?php echo $nav_prev; ?>\n\t</div>\n\t<?php } ?>\n\t<?php if($nav_next){?>\n\t<div class=\"navigation-next\">\n\t\t<?php echo $nav_next; ?>\n\t</div>\n\t<?php } ?>\n\t<div class=\"clear\"></div>\n</div>\n<?php\n}\n?>\n<?php \nendif;\n\t}\n\telse\n\t{\n\t\tif($view_page == 'HOME')\n\t\t{\n\t\t\techo '</ul></div>';\n\t\t\techo '<div class=\"no-classifieds\"><div class=\"alert alert-info\">No reviews found... you can <a href=\"'. get_bloginfo('url') .'/add-review/\" class=\"button size-mini\">Add a New Book Review</a></div></div>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo '</ul></div><div class=\"clearfix clear\"></div>';\n\t\t\techo '<div class=\"alert alert-info\">No reviews found</div>';\n\t\t}\n\t\t\t\n\t}\n}",
"function printRecipeBlock($recipeCatID, $recipeID) {\n\tglobal $menuvar, $rs_config;\n\t$content = \"\";\n\t$thumbnailHTML = \"\";\n\t\n\t$sql = \"SELECT name, servings, image_full, image_thumb FROM `\" . DBTABLEPREFIX . \"recipes` WHERE id = '\" . $recipeID . \"' LIMIT 1\";\n\t$result = mysql_query($sql);\n\t\t\t\n\tif ($result && mysql_num_rows($result) > 0) {\t\t\t\t\t\t\n\t\twhile ($row = mysql_fetch_array($result)) {\n\t\t\t$thumbnailHTML .= ($row['image_thumb'] != \"\") ? \"<img src=\\\"\" . $row['recipecats_image'] . \"\\\" alt=\\\"\" . $row['name'] . \"\\\" />\" : \"<img src=\\\"themes/\" . $rs_config['ftsrs_theme'] . \"/icons/noImage.png\\\" alt=\\\"\" . $row['name'] . \"\\\" />\";\n\t\t\t\n\t\t\t$content .= \"\n\t\t\t\t\t\t\t<div class=\\\"recipeBlock\\\">\n\t\t\t\t\t\t\t\t<p class=\\\"recipeImage\\\"><a href=\\\"\" . $menuvar['VIEWRECIPE'] . \"&recipeCatID=\" . $recipeCatID . \"&id=\" . $recipeID . \"\\\">\" . $thumbnailHTML . \"</a></p>\n\t\t\t\t\t\t\t\t<p class=\\\"recipeName\\\"><a href=\\\"\" . $menuvar['VIEWRECIPE'] . \"&recipeCatID=\" . $recipeCatID . \"&id=\" . $recipeID . \"\\\">\" . $row['name'] . \"</a></p>\n\t\t\t\t\t\t\t\t<p class=\\\"recipeServings\\\">Servings: \" . $row['servings'] . \"</p>\n\t\t\t\t\t\t\t</div>\";\n\t\t}\n\t\tmysql_free_result($result);\n\t}\n\t\n\treturn $content;\n}",
"function slidedeck_create_custom_slidedeck_block( $html ) {\n ob_start();\n include( SLIDEDECK2_DEVELOPER_DIRNAME . '/views/_create-custom-slidedeck-block.php' );\n $html = ob_get_contents();\n ob_end_clean();\n\n return $html;\n }",
"function fetch_admin_review_lots()\n\t{\n\t\t#print_r($_POST);\n\t\t$urldata = $this->uri->uri_to_assoc(4, array('m', 'i'));\n\t\t$data = assign_to_data($urldata);\n\t\t$data = add_msg_if_any($this, $data);\n\t\t#print_r($_POST);\n\t\t$_POST['lotid'] = mysql_real_escape_string($_POST['lotid']);\n\t\t$data['information'] = $this-> Proc_m -> fetch_admin_review($_POST,$data);\n\t\t#print_r( $data['admin_reviews'] );\n\n\t\t$data['type'] = 'view_review';\n\t\t$data['form_title'] = 'View Best Evaluated Bidder Reviews';\n\n\t\t$this->load->view('bids/add_bebreview', $data);\n\n\t}",
"function displayReview($review,$num){\n\t\t\tglobal $count;\n\t\t\t$num++;\n\t\t\t$review[1] = strtolower($review[1]);\n\t\t\techo \"<p class='review'>\n\t\t\t\t\t\t<img src='{$review[1]}.gif' alt='{$review[1]}' />\n\t\t\t\t\t\t<q>{$review[0]}</q>\n\t\t\t\t </p>\n\t\t\t\t <p class='reviewer'>\n\t\t\t\t \t\t<img src='critic.gif' alt='Critic' />\n\t\t\t\t \t\t{$review[2]}<br />\n\t\t\t\t \t\t{$review[3]}\n\t\t\t\t </p>\";\n\t\t\tif($num == ceil($count/2)){\n\t\t\techo \"</div>\n\t\t\t\t <div class='column'>\";\n\t\t\t}\n\t\t}",
"function makeStyleBlock($affil_id){\n\n\n\n //assign other name to id for cut & pasted code for related tables\n\n $styles_print_block = \"<ul>\";\n\n $affiliates_styles_rel = \"affiliates_styles_rel\";//issues relationship table\n\n $hyp_styles =\"hyp_styles\";//issues descriptions table\n\n\n\n // Lookup related issue numbers array through affil_issue_rel by id#\n\n $styles_id_lookup = \"SELECT list_id FROM $affiliates_styles_rel WHERE affil_id=$affil_id\";\n\n $styles_id_result=mysql_query($styles_id_lookup);// or die(mysql_error())\n\n\n\n //Get certifications id#'s array from array reciept...\n\n while ($row = mysql_fetch_array($styles_id_result)){\n\n $list_id=$row['list_id'];\n\n\n\n // Lookup description for each cert_id#\n\n $desc_lookup=\"SELECT * FROM $hyp_styles WHERE id=$list_id\";\n\n $styles_desc_result=mysql_query($desc_lookup);// or die(mysql_error())\n\n while ($inner_loop = mysql_fetch_array($styles_desc_result)){\n\n $style_desc = $inner_loop['desc'];\n\n $styles_print_block .= \"<li>\".$style_desc.\"</li>\";\n\n\n\n }//end desc - fetching loop\n\n }//end id# - fetching loop\n\n\n\n if ($other_styles !=\"\"){\n\n $styles_print_block .= \"<li>$other_styles</li>\";\n\n }\n\n $styles_print_block .= \"</ul>\";\n\n return $styles_print_block;\n\n\n\n}",
"public function generateCommunitySharedPost($clubid){\n\t\n\t\t\t $this->template->assign(\"clubid\",$clubid);\n\t\t\t return $this->template->fetch($this->theme_dir.'/communities/shared.html');\n\t\n}",
"function review_bar($review_obj) {\n\t\t$details = '<article class=\"review\"><span class=\"review_details\">';\t\t\t\n\n\t\tif ($review_obj['emoji'] != 0) {\n\t\t\t$details .= '<span class=\"emoji_detail\" id=\"' . $review_obj[\"emoji\"] . '\"></span>';\n\t\t}\n\t\tfor ($i = 4; $i >= 0; $i--) {\n\t\t\tif ($i < $review_obj['rating']) {\n\t\t\t\t$details .= '<img src=\"resources/filled_star.png\">';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$details .= '<img src=\"resources/empty_star.png\">';\n\t\t\t}\n\t\t}\n\n\t\t$details .= '<span class=\"category\">' . ucfirst($review_obj['category']) . '</span>';\n\n\t\t//Admin Features\n\t\tif (count($admin = (new GetUser($_SESSION['UID']))->execute()) > 0) {\n \t$admin = $admin[0]['admin'];\n \t}\t\n \tif($admin == 1) {\n \t\t$details .= \"<button id='deleteReview' value='\" . $review_obj['RID'] . \"'>Delete</button>\";\n \t}\n\t\t$details .= '</span>';\n\n\t\t$details .= '\n\t\t\t<p class=\"review_body\">' .\n\t\t\t\t$review_obj['body'] .\n\t\t\t'</p>\n\t\t';\n\n\t\t$details .= '</article>';\n\n\t\techo($details);\n\t}",
"private function createReviews($index, $reviews, $idcontribution){\n $res = \"\";\n ob_start();\n?>\n <tr class=\"contr_row\">\n <td colspan=\"6\" id=\"<?php echo \"th_show_$index\";?>\" class=\"w3-container w3-hide\">\n <div class=\"w3-responsive w3-card-4\">\n <table class=\"w3-table\">\n <tr>\n <td colspan=\"7\">\n<?php\n $res .= ob_get_clean();\n $res .= $this->getAssignDropButton($idcontribution);\n ob_start();\n?>\n </td>\n </tr>\n <tr>\n <th>recenzent</th>\n <th>originalita</th>\n <th>předmět</th>\n <th>gramatika</th>\n <th>korektnost</th>\n <th>komentář</th>\n <th>doporučeno</th>\n </tr>\n<?php\n $res .= ob_get_clean();\n foreach($reviews as $rev){ \n $res .= $this->createReviewRow($rev); \n } \n ob_start();\n?> \n </table>\n </div>\n </td>\n </tr>\n<?php \n $res .= ob_get_clean();\n return $res;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the current requests page set correctly either based on matching user agent strings or dynamically based on the pre_page_set_selection hook. | protected function _setPageSet()
{
$pageSetArray = $this->_selectPageSet();
\RightNow\Libraries\Hooks::callHook('pre_page_set_selection', $pageSetArray);
$selected = $pageSetArray['selected'];
if ($selected !== null)
{
$this->pageSetPath = $pageSetArray[$selected]->getValue();
$this->pageSetID = $pageSetArray[$selected]->getId();
}
else
{
$this->pageSetPath = null;
$this->pageSetID = null;
}
$this->_setPageSetOffset();
$this->_processForShiftJisTranscoding();
} | [
"private function setPageSelect()\n {\n $GLOBALS['TSFE']->sys_page = Tx_Smarty_Service_Compatibility::makeInstance('t3lib_pageSelect');\n $GLOBALS['TSFE']->sys_page->versioningPreview = false;\n $GLOBALS['TSFE']->sys_page->versioningWorkspaceId = false;\n $GLOBALS['TSFE']->where_hid_del = ' AND pages.deleted=0';\n $GLOBALS['TSFE']->sys_page->init(false);\n $GLOBALS['TSFE']->sys_page->where_hid_del .= ' AND pages.doktype<200';\n $GLOBALS['TSFE']->sys_page->where_groupAccess\n = $GLOBALS['TSFE']->sys_page->getMultipleGroupsWhereClause('pages.fe_group', 'pages');\n }",
"protected function initializeCurrentPageFromRequest() {}",
"private function SetCurrentPage() { \n //If current page is set and is above zero, sanitize and accept that value\n if(!empty($_GET['page']) && $_GET['page'] > 0) {\n $this->current_page = (int) $_GET['page'];\n }\n\n //If current page is zero or negative (i.e. invalid value), set current page to 1\n else {\n $this->current_page = 1;\n }\n }",
"function SetSelection($page){}",
"private function _set_agent() {\n\t\tif (!property_exists($this->application,'agent')) {\n\t\t\tif (!$this->application->property_exists('agent')) {\n\t\t\t\tif (isset($_SERVER['HTTP_USER_AGENT'])) {\n\t\t\t\t\t$this->application->agent = $_SERVER['HTTP_USER_AGENT'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->_set_agent_null_check();\n\t\t\t}\n\t\t} else {\n\t\t\t$this->_set_agent_null_check();\n\t\t}\n\t}",
"protected function setPages() {\n // Build array of pages from outline\n $chapters = $this->outline->xpath('chapter');\n $this->pages = $this->xmlObjToArray($chapters, 'pages');\n\n // See if page was requested and set if appropriate\n if(isset($_REQUEST['page'])) {\n // See if all was requested\n if($_REQUEST['page'] == 'all') {\n $this->currentPage = 'all';\n return;\n }\n if(in_array($_REQUEST['page'], $this->pages)) {\n $this->currentPage = $_REQUEST['page'];\n }\n }\n // Otherwise, set default\n if(!isset($this->currentPage)) $this->currentPage = $this->outline->defaultPage;\n\n // Find previus and next pages\n $curKey = null;\n foreach($this->pages as $key => $val) {\n if($val == $this->currentPage) {\n $curKey = $key;\n break;\n }\n }\n // Set values\n if($curKey > 0) $this->previousPage = $this->pages[$curKey - 1];\n if($curKey < (count($this->pages) - 1)) $this->nextPage = $this->pages[$curKey + 1];\n }",
"public function set_user_agent() {\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\t\tvar doc = document.documentElement;\n\t\t\tdoc.setAttribute( 'data-useragent', navigator.userAgent );\n\t\t</script>\n\t\t<?php\n\t}",
"private function _setUserAgentFolder()\n {\n if ($this->getPageSetPath())\n $this->_changeUriForAgent();\n }",
"public function pageProcess() {\n\t\t$debugmode = get_option(UserAgentThemeSwitcherData::DEBUG_KEY);\n\n\t\tif($debugmode == 'true' && $this->userAgent == null && $_SERVER['HTTP_USER_AGENT'] != '') {\n\t\t\t$useragent = $_SERVER['HTTP_USER_AGENT'];\n\t\t\t$this->database->addDebugUserAgent($useragent);\n\t\t}\n\t}",
"protected function setPageInfo() : void {}",
"function ChangeSelection($page){}",
"public function setPagesAccessible()\r\n\t{\r\n\t\t$this->aPagesAccessible = array();\r\n\r\n\t\tif($this->oPrediggoConfig->home_recommendations)\r\n\t\t\t$this->aPagesAccessible[] = 'index';\r\n\t\tif($this->oPrediggoConfig->error_recommendations)\r\n\t\t\t$this->aPagesAccessible[] = '404';\r\n\t\tif($this->oPrediggoConfig->product_recommendations)\r\n\t\t\t$this->aPagesAccessible[] = 'product';\r\n\t\tif($this->oPrediggoConfig->category_recommendations)\r\n\t\t\t$this->aPagesAccessible[] = 'category';\r\n\t\tif($this->oPrediggoConfig->customer_recommendations)\r\n\t\t{\r\n\t\t\t$this->aPagesAccessible[] = 'my-account';\r\n\t\t\t$this->aPagesAccessible[] = 'addresses';\r\n\t\t\t$this->aPagesAccessible[] = 'history';\r\n\t\t\t$this->aPagesAccessible[] = 'order-return';\r\n\t\t}\r\n\t\tif($this->oPrediggoConfig->cart_recommendations)\r\n\t\t{\r\n\t\t\t$this->aPagesAccessible[] = 'order';\r\n\t\t\t$this->aPagesAccessible[] = 'order-opc';\r\n\t\t}\r\n\t\tif($this->oPrediggoConfig->best_sales_recommendations)\r\n\t\t\t$this->aPagesAccessible[] = 'best-sales';\r\n\t\tif($this->oPrediggoConfig->blocklayered_recommendations)\r\n\t\t\t$this->aPagesAccessible[] = 'blocklayered';\r\n\t}",
"public function setPage() {\n }",
"abstract protected function set_external_page();",
"protected function setRequest()\n {\n if (session_status() == PHP_SESSION_NONE) {\n return;\n }\n if (!isset($_SESSION['post_request_vals'])) {\n $_SESSION['post_request_vals'] = array();\n }\n if (!$_SESSION['post_request_vals'] && self::$post) {\n $_SESSION['post_request_vals'] = $_POST;\n }\n }",
"protected function setupPageVars($req) {\n\t\tif ($p = $req->cleanInt('p'))\n\t\t\t$this->tableCurPage = $p;\n\n\t}",
"function setPageRobots($page_robots = null) {\n $this->page_robots = $page_robots;\n }",
"public function Set_Levels()\n\t\t{\n\t\t\t$this->page_array = func_get_args();\n\t\t}",
"function set_current_page() {\n\t\t\n if( isset($_GET[ $this->parameterName ]) ){\n if( $_GET[ $this->parameterName ] > 0 ){\n $this->current_page = $_GET[ $this->parameterName ];\n }else{\n $this->current_page = 1;\n }\n }else{\n $this->current_page = 1;\n }\t\n\t\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get street_type value An additional test has been added (isset) before returning the property value as this property may have been unset before, due to the fact that this property is removable from the request (nillable=true+minOccurs=0) | public function getStreet_type()
{
return isset($this->street_type) ? $this->street_type : null;
} | [
"public function getStreetAddress()\n {\n if (array_key_exists(\"streetAddress\", $this->_propDict)) {\n return $this->_propDict[\"streetAddress\"];\n } else {\n return null;\n }\n }",
"public static function isStreetType( $string = null )\n\t{\n\t\t//reasons to fail\n\t\tif (is_null($string)) return false;\n\t\tif (strlen(trim($string)) < 1) return false;\n\t\t\n\t\t//initializing variables\n\t\t$string = strtoupper(trim($string));\n\t\t$temp = self::clean($string);\n\t\t\n\t\t$_streets = AddressHelper::getArray('_streets');\n\t\t$_streets_reversed = AddressHelper::getReverseArray( '_streets' );\n\t\t\n\t\t//reasons to believe that this is a country\n\t\tif (isset($_streets[$temp])) return $string;\n\t\tif (isset($_streets_reversed[$temp]))return $string;\n\t\t\n\t\treturn false;\n\t}",
"public function getStreet()\n {\n return isset($this->Street) ? $this->Street : null;\n }",
"public function getDefaultStreet() : ?string;",
"public function getAddressType()\n {\n return $this->addressType;\n }",
"public function getAddressType(): AddressType\n {\n return $this->address_type;\n }",
"function getStreetNumber()\n {\n return is_null($this->_sStreetNumber) ? NULL : (string) $this->_sStreetNumber;\n }",
"public function hasAddressType()\n {\n return $this->address_type !== null;\n }",
"public function getTypeAdresse(): ?string {\n return $this->typeAdresse;\n }",
"public function sanitise()\n\t{\n\t\t// Low level sanitation of the properties has already been done, when they were initially set using the __set() method\n\t\t\n\t\t/*\n\t\t * Interesting side note:\n\t\t * \n\t\t * I was thinking about making a method called _mustBeNull($strPropertyName) which would determine whether the individual property should be null, but this \n\t\t * cannot be done, because it would be dependent on the values other fields, so you couldn't just iterate through all the properties and check if each one should\n\t\t * be set to null, and then set it to null\n\t\t */\n\t\t\n\t\tif ($this->landlineServiceAddressTypeId === null)\n\t\t{\n\t\t\t// No address type has been specified\n\t\t\t$this->serviceAddressTypeNumber\t\t= null;\n\t\t\t$this->serviceAddressTypeSuffix\t\t= null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// An address type has been specified\n\t\t\t$objLandlineServiceAddressType\t\t\t\t= $this->getLandlineServiceAddressType();\n\t\t\t$intLandlineServiceAddressTypeCategoryId\t= $objLandlineServiceAddressType->landlineServiceAddressTypeCategoryId;\n\t\t\t\n\t\t\tif ($intLandlineServiceAddressTypeCategoryId == DO_Sales_LandlineServiceAddressTypeCategory::POSTAL)\n\t\t\t{\n\t\t\t\t// ServiceAddressType is a POSTAL address\n\t\t\t\t// Nullify the fields that aren't used for postal addresses\n\t\t\t\t$this->serviceStreetNumberStart\t\t\t\t= null;\n\t\t\t\t$this->serviceStreetNumberEnd\t\t\t\t= null;\n\t\t\t\t$this->serviceStreetNumberSuffix\t\t\t= null;\n\t\t\t\t$this->serviceStreetName\t\t\t\t\t= null;\n\t\t\t\t$this->landlineServiceStreetTypeId\t\t\t= null;\n\t\t\t\t$this->landlineServiceStreetTypeSuffixId\t= null;\n\t\t\t\t$this->servicePropertyName\t\t\t\t\t= null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// ServiceAddressType is not a postal address type, and can therefore have street details\n\t\t\t\tif ($intLandlineServiceAddressTypeCategoryId == DO_Sales_LandlineServiceAddressTypeCategory::ALLOTMENT)\n\t\t\t\t{\n\t\t\t\t\t// ALLOTMENTs do not have Street numbers\n\t\t\t\t\t$this->serviceStreetNumberStart\t\t= null;\n\t\t\t\t\t$this->serviceStreetNumberEnd\t\t= null;\n\t\t\t\t\t$this->serviceStreetNumberSuffix\t= null;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// ServiceAddressType must be a STANDARD address type \n\t\t\t\t\t// (Nothing to do here, exclusive to this category of address type)\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Do other things common to ALLOTMENT & STANDARD address types \n\t\t\t\t// (Nothing to add here, which can't be expressed in simpler rules independent of the category of address type) \n\t\t\t}\t\t\t\n\t\t}\n\n\t\t// Nullify things that are dependent on serviceStreetName being set\n\t\tif ($this->serviceStreetName === null)\n\t\t{\n\t\t\t$this->landlineServiceStreetTypeId\t\t\t= null;\n\t\t\t$this->landlineServiceStreetTypeSuffixId\t= null;\n\t\t}\n\t\t\n\t\t// Nullify things that are dependent on landlineServiceStreetTypeId being set\n\t\tif ($this->landlineServiceStreetTypeId === null)\n\t\t{\n\t\t\t$this->landlineServiceStreetTypeSuffixId = null;\n\t\t}\n\t\t\n\t\tif ($this->serviceStreetName === null && $this->servicePropertyName === null)\n\t\t{\n\t\t\t$this->serviceStreetNumberStart = null;\n\t\t}\n\t\t\n\t\t// Nullify things that are dependent on serviceStreetNumberStart being set\n\t\tif ($this->serviceStreetNumberStart === null)\n\t\t{\n\t\t\t$this->serviceStreetNumberEnd\t\t= null;\n\t\t\t$this->serviceStreetNumberSuffix\t= null;\n\t\t}\n\t\t\n\t\tif ($this->isIndial100 != true)\n\t\t{\n\t\t\t// hasExtensionLevelBilling is only applicable if isIndial100 == true (currently hasExtensionLevelBilling cannot be set to null, although it probably should be able to be)\n\t\t\t$this->hasExtensionLevelBilling = false;\n\t\t}\n\t}",
"public function getStreet() : ?string \n {\n if ( ! $this->hasStreet()) {\n $this->setStreet($this->getDefaultStreet());\n }\n return $this->street;\n }",
"public function getStreet();",
"public function getStreetAndStreetNumber(): ?string\n {\n return isset($this->StreetAndStreetNumber) ? $this->StreetAndStreetNumber : null;\n }",
"public function hasStreet(): bool;",
"public function hasStreet() {\n\t\treturn $this->hasString('street');\n\t}",
"public function getState($type = Contact::POSTALINFO_INT)\n\t{\n\t\treturn $this->_postalInfo[$type]['addr']['sp'];\n\t}",
"public function getAddressType ( ) {\n\n return $this->_addressType;\n }",
"public function getContactType();",
"public function hasStreet()\n {\n return !empty($this->street) ? true : false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
//// Oputputs the sanitized HTML class Return the HTML classes from a string or from an array | function dss_html_class($the_classes = false){
// Get CSS classes
if( is_array($the_classes) ){
$all_classes = array();
foreach ($the_classes as $class) {
//If is not string or is a number skip to the next value
if( is_numeric($class) || ! is_string($class) ) continue;
$all_classes[] = sanitize_html_class($class);
}
$classes = join(' ', $all_classes);
}
elseif( is_string($the_classes) ){
$classes = sanitize_html_class($the_classes);
}
else{
$classes = false;
}
return $classes;
} | [
"function monsterinsights_sanitize_html_class( $class = '' ) {\n\n\tif ( is_string( $class ) ) {\n\t\t$class = sanitize_html_class( $class );\n\t} else if ( is_array( $class ) ) {\n\t\t$class = array_values( array_map( 'sanitize_html_class', $class ) );\n\t\t$class = implode( ' ', array_unique( $class ) );\n\t}\n\n\treturn $class;\n\n}",
"function sanitize_html_class($class, $fallback = '')\n{\n}",
"function mai_sanitize_html_classes( $classes ) {\n\tif ( ! is_array( $classes ) ) {\n\t\t$classes = explode( ' ', $classes );\n\t}\n\treturn implode( ' ', array_unique( array_map( 'sanitize_html_class', array_map( 'trim', $classes ) ) ) );\n}",
"function wp_tsasp_sanitize_html_classes($classes, $sep = \" \") {\n\t$return = \"\";\n\n\tif( $classes && !is_array($classes) ) {\n\t\t$classes = explode($sep, $classes);\n\t}\n\n\tif( !empty($classes) ) {\n\t\tforeach($classes as $class){\n\t\t\t$return .= sanitize_html_class($class) . \" \";\n\t\t}\n\t\t$return = trim( $return );\n\t}\n\n\treturn $return;\n}",
"function sanitize_html_class($classname, $fallback = '')\n {\n }",
"public function sanitize_html_class( $class = '' ) {\r\n\r\n\t\t\tif ( is_string( $class ) ) {\r\n\t\t\t\t$class = sanitize_html_class( $class );\r\n\t\t\t} else if ( is_array( $class ) ) {\r\n\t\t\t\t$class = array_values( array_map( 'sanitize_html_class', $class ) );\r\n\t\t\t\t$class = implode( ' ', array_unique( $class ) );\r\n\t\t\t}\r\n\r\n\t\t\treturn $class;\r\n\r\n\t\t}",
"public function RetrieveClasses(){\n\t\t$this->classes=array();\n\t\t$regex=\"/<[^>]*class=['\\\"]([^'\\\"]+)['\\\"][^>]*>/\";\n\t\tpreg_match_all($regex,$this->html,$matched);\n\t\tif(isset($matched[1])){\n\t\t\tforeach($matched[1] as $class_str){\n\t\t\t\t$classes=preg_split('/[ ]+/',$class_str);\n\t\t\t\tforeach($classes as $class){\n\t\t\t\t\tif(!in_array('.'.$class,$this->classes)){\n\t\t\t\t\t\t$this->classes[]='.'.$class;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->classes;\n\t}",
"function evf_sanitize_classes( $classes, $convert = false ) {\n\t$css = array();\n\t$array = is_array( $classes );\n\n\tif ( ! empty( $classes ) ) {\n\t\tif ( ! $array ) {\n\t\t\t$classes = explode( ' ', trim( $classes ) );\n\t\t}\n\t\tforeach ( $classes as $class ) {\n\t\t\t$css[] = sanitize_html_class( $class );\n\t\t}\n\t}\n\n\tif ( $array ) {\n\t\treturn $convert ? implode( ' ', $css ) : $css;\n\t} else {\n\t\treturn $convert ? $css : implode( ' ', $css );\n\t}\n}",
"function wall_sanitize_wall_item_classes($classes){\n\t$classes = str_replace(\"post\", \" \", $classes);\n\t$classes = str_replace(\"hentry\", \" \", $classes);\n\treturn $classes;\n}",
"public function whitelistClass()\n\t{\n\t\t$casesSpecific = array(\n\t\t\t'Kill script' => array(\n\t\t\t\t'',\n\t\t\t\t'<img src=\"javascript:alert();\" />',\n\t\t\t\t'',\n\t\t\t\t'From specific cases'\n\t\t\t),\n\t\t\t'Nested tags' => array(\n\t\t\t\t'',\n\t\t\t\t'<em><strong>Fred</strong></em>',\n\t\t\t\t'Fred',\n\t\t\t\t'From specific cases'\n\t\t\t),\n\t\t\t'Malformed Nested tags' => array(\n\t\t\t\t'',\n\t\t\t\t'<em><strongFred</strong></em>',\n\t\t\t\t'strongFred',\n\t\t\t\t'From specific cases'\n\t\t\t),\n\t\t\t'Unquoted Attribute Without Space' => array(\n\t\t\t\t'',\n\t\t\t\t'<img height=300>',\n\t\t\t\t'',\n\t\t\t\t'From specific cases'\n\t\t\t),\n\t\t\t'Unquoted Attribute' => array(\n\t\t\t\t'',\n\t\t\t\t'<img height=300 />',\n\t\t\t\t'',\n\t\t\t\t'From specific cases'\n\t\t\t),\n\t\t\t'Single quoted Attribute' => array(\n\t\t\t\t'',\n\t\t\t\t'<img height=\\'300\\' />',\n\t\t\t\t'',\n\t\t\t\t'From specific cases'\n\t\t\t),\n\t\t\t'Attribute is zero' => array(\n\t\t\t\t'',\n\t\t\t\t'<img height=0 />',\n\t\t\t\t'',\n\t\t\t\t'From specific cases'\n\t\t\t),\n\t\t\t'Attribute value missing' => array(\n\t\t\t\t'',\n\t\t\t\t'<img height= />',\n\t\t\t\t'',\n\t\t\t\t'From specific cases'\n\t\t\t),\n\t\t\t'Attribute without =' => array(\n\t\t\t\t'',\n\t\t\t\t'<img height=\"300\" ismap />',\n\t\t\t\t'',\n\t\t\t\t'From specific cases'\n\t\t\t),\n\t\t\t'Bad Attribute Name' => array(\n\t\t\t\t'',\n\t\t\t\t'<br 300 />',\n\t\t\t\t'',\n\t\t\t\t'From specific cases'\n\t\t\t),\n\t\t\t'tracker9725' => array(\n\t\t\t\t// Test for recursion with single tags\n\t\t\t\t'string',\n\t\t\t\t'<img class=\"one two\" />',\n\t\t\t\t'',\n\t\t\t\t'From specific cases'\n\t\t\t)\n\t\t);\n\t\t$tests = array_merge($this->casesGeneric(), $casesSpecific);\n\n\t\treturn $tests;\n\t}",
"function sanitize_html_class($class, $fallback){\n\t//Strip out any % encoded octets\n\t$sanitized = preg_replace('|%[a-fA-F0-9][a-fA-F0-9]|', '', $class);\n\n\t//Limit to A-Z,a-z,0-9,'-'\n\t$sanitized = preg_replace('/[^A-Za-z0-9-]/', '', $sanitized);\n\n\tif ('' == $sanitized)\n\t\t$sanitized = $fallback;\n\n\treturn apply_filters('sanitize_html_class',$sanitized, $class, $fallback);\n}",
"function dynamik_body_classes( $classes )\n{\n\tif( !empty( $_SERVER['HTTP_USER_AGENT'] ) )\n\t{\n\t\t$browser = $_SERVER['HTTP_USER_AGENT'];\n\t\n\t\t// OS specific classes\n\t\tif( preg_match( '/Mac/', $browser ) )\n\t\t\t$classes[] = 'mac';\n\t\telseif( preg_match( '/Windows/', $browser ) )\n\t\t\t$classes[] = 'windows';\n\t\telseif( preg_match( '/Linux/', $browser ) )\n\t\t\t$classes[] = 'linux';\n\t\telse\n\t\t\t$classes[] = 'unknown-os';\n\t\n\t\t// Browser specific classes\n\t\tif( preg_match( '/Chrome/', $browser ) )\n\t\t{\n\t\t\t$classes[] = 'chrome';\n\t\t}\n\t\telseif( preg_match( '/Safari/', $browser ) )\n\t\t{\n\t\t\t$classes[] = 'safari';\n\t\n\t\t\tpreg_match( '/Version\\/(\\d.\\d)/si', $browser, $matches );\n\t\n\t\t\tif( isset( $matches[0] ) && isset( $matches[0][1] ) )\n\t\t\t $sf_version = 'sf' . str_replace( '.', '-', $matches[1] );\n\t\t\telse\n\t\t\t $sf_version = '';\n\t\n\t\t\t$classes[] = $sf_version;\n\t\t}\n\t\telseif( preg_match( '/Opera/', $browser ) )\n\t\t{\n\t\t\t$classes[] = 'opera';\n\t\n\t\t\tpreg_match( '/Opera\\/(\\d.\\d)/si', $browser, $matches );\n\t\t\t$op_version = 'op' . str_replace( '.', '-', $matches[1] );\n\t\t\t$classes[] = $op_version;\n\t\t}\n\t\telseif( preg_match( '/MSIE/', $browser ) )\n\t\t{\n\t\t\t$classes[] = 'msie';\n\t\n\t\t\tif( preg_match( '/MSIE 6.0/', $browser ) )\n\t\t\t\t\t$classes[] = 'ie6';\n\t\t\telseif( preg_match( '/MSIE 7.0/', $browser ) )\n\t\t\t\t\t$classes[] = 'ie7';\n\t\t\telseif( preg_match( '/MSIE 8.0/', $browser ) )\n\t\t\t\t\t$classes[] = 'ie8';\n\t\t\telseif( preg_match( '/MSIE 9.0/', $browser ) )\n\t\t\t\t\t$classes[] = 'ie9';\n\t\t\telseif( preg_match( '/MSIE 10.0/', $browser ) )\n\t\t\t\t\t$classes[] = 'ie10';\n\t\t}\n\t\telseif( '!!navigator.userAgent.match(/Trident.*rv\\:11\\./)' )\n\t\t{\n\t\t\t$classes[] = 'ie11';\n\t\t}\n\t\telseif( preg_match( '/Firefox/', $browser ) && preg_match( '/Gecko/', $browser ) )\n\t\t{\n\t\t\t$classes[] = 'firefox';\n\t\n\t\t\tpreg_match( '/Firefox\\/(\\d)/si', $browser, $matches );\n\t\t\t$ff_version = 'ff' . str_replace( '.', '-', $matches[1] );\n\t\t\t$classes[] = $ff_version;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$classes[] = 'unknown-browser';\n\t\t}\n\t}\n\n\tif( is_front_page() && dynamik_get_design_alt( 'ez_home_slider_display' ) )\n\t{\n\t\t$classes[] = 'ez-home-slider';\n\n\t\tif( dynamik_get_design_alt( 'ez_home_slider_location' ) == 'inside' )\n\t\t{\n\t\t\t$classes[] = 'slider-inside';\n\t\t}\n\t}\n\n\tif( is_front_page() && dynamik_get_design_alt( 'dynamik_homepage_type' ) == 'static_home' &&\n\t\tdynamik_get_design_alt( 'ez_homepage_select' ) )\n\t{\n\t\t$classes[] = 'ez-home';\n\n\t\tif( dynamik_get_design_alt( 'ez_static_home_sb_display' ) )\n\t\t{\n\t\t\t$classes[] = 'ez-home-sidebar';\n\t\t}\n\n\t\tif( dynamik_get_design_alt( 'ez_static_home_sb_location' ) == 'left' )\n\t\t{\n\t\t\t$classes[] = 'home-sidebar-left';\n\t\t}\n\t}\n\n\tif( dynamik_get_design_alt( 'ez_feature_top_position' ) == 'outside_inner' )\n\t\t$classes[] = 'feature-top-outside';\n\n\tif( dynamik_get_design_alt( 'ez_fat_footer_position' ) == 'inside_inner' )\n\t\t$classes[] = 'fat-footer-inside';\n\n\tif( dynamik_get_design_alt( 'wrap_structure' ) == 'fluid' )\n\t\t$classes[] = 'site-fluid';\n\n\tif( is_singular() && dynamik_get_custom_field( '_dyn_labels', false, true ) != '' )\n\t{\n\t\tforeach ( dynamik_get_custom_field( '_dyn_labels', false, true ) as $key => $value )\n\t\t{\n\t\t\t$classes[] = 'label-' . $key;\n\t\t}\n\t}\n\n\tif( defined( 'DYNAMIK_LABEL_WIDTH' ) )\n\t\t$classes[] = DYNAMIK_LABEL_WIDTH;\n\n\t$classes[] = 'override';\n\n\treturn $classes;\n}",
"final public function parseClass() {\n\t\t$content = ' class=\"html-element html-' . $this->getType();\n\t\tif ($this->__isset('class')) {\n\t\t\t$content .= ' ' . $this->__get('class');\n\t\t}\n\t\tif ($this->hasAttribute('class')) {\n\t\t\t$content .= ' ' . $this->_attributes['class'];\n\t\t}\n\t\treturn $content . '\"';\n\t}",
"function sanitize_html_class( $class, $fallback = '' ) {\n\t//Strip out any % encoded octets\n\t$sanitized = preg_replace( '|%[a-fA-F0-9][a-fA-F0-9]|', '', $class );\n\n\t//Limit to A-Z,a-z,0-9,_,-\n\t$sanitized = preg_replace( '/[^A-Za-z0-9_-]/', '', $sanitized );\n\n\tif ( '' == $sanitized && $fallback ) {\n\t\treturn sanitize_html_class( $fallback );\n\t}\n\t/**\n\t * Filters a sanitized HTML class string.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param string $sanitized The sanitized HTML class.\n\t * @param string $class HTML class before sanitization.\n\t * @param string $fallback The fallback string.\n\t */\n\treturn apply_filters( 'sanitize_html_class', $sanitized, $class, $fallback );\n}",
"function twoobl_clean_post_class($classes) {\n foreach ($classes as $k => $class) {\n if( 0 === strpos( $class, 'tag-' )\n || 0 === strpos( $class, 'category-' )\n || 0 === strpos( $class, 'post-' )\n || 0 === strpos( $class, 'type-' )\n || $class == 'status-publish'\n || $class == 'format-standard' )\n unset($classes[$k]);\n }\n return $classes;\n}",
"public static function class_tag($matches) {\n // If class exists, atts is not captured\n $pre_class = $matches[1];\n $quotes = $matches[2];\n $class = $matches[3];\n $post_class = $matches[4];\n $atts = $matches[5];\n $content = $matches[6];\n\n // If we find a crayon=false in the attributes, or a crayon[:_]false in the class, then we should not capture\n $ignore_regex_atts = '#crayon\\s*=\\s*([\"\\'])\\s*(false|no|0)\\s*\\1#msi';\n $ignore_regex_class = '#crayon\\s*[:_]\\s*(false|no|0)#msi';\n if (preg_match($ignore_regex_atts, $atts) !== 0 ||\n preg_match($ignore_regex_class, $class) !== 0\n ) {\n return $matches[0];\n }\n\n if (!empty($class)) {\n if (preg_match('#\\bignore\\s*:\\s*true#', $class)) {\n // Prevent any changes if ignoring the tag.\n return $matches[0];\n }\n // crayon-inline is turned into inline=\"1\"\n $class = preg_replace('#' . self::REGEX_INLINE_CLASS . '#mi', 'inline=\"1\"', $class);\n // \"setting[:_]value\" style settings in the class attribute\n $class = preg_replace('#\\b([A-Za-z-]+)[_:](\\S+)#msi', '$1=' . $quotes . '$2' . $quotes, $class);\n }\n\n // data-url is turned into url=\"\"\n if (!empty($post_class)) {\n $post_class = preg_replace('#\\bdata-url\\s*=#mi', 'url=', $post_class);\n }\n if (!empty($pre_class)) {\n $pre_class = preg_replace('#\\bdata-url\\s*=#mi', 'url=', $pre_class);\n }\n\n if (!empty($class)) {\n return \"[crayon $pre_class $class $post_class]{$content}[/crayon]\";\n } else {\n return \"[crayon $atts]{$content}[/crayon]\";\n }\n }",
"function wd_clean_post_classes( $classes ) {\n\tif( ! is_array( $classes ) )\n\t\treturn $classes;\n\t$allowed_classes = array(\n \t\t'hentry',\n \t\t'type-' . get_post_type(),\n \t);\n\treturn array_intersect( $classes, $allowed_classes );\n}",
"protected function getHtmlClasses()\n\t{\n\t\t$classes = '';\n\n\t\tif( ! empty($this->css_classes) )\n\t\t{\n\t\t\t// open attribute\n\t\t\t$classes.= \" class=\\\"\";\n\t\t\tforeach($this->css_classes as $class)\n\t\t\t{\n\t\t\t\t$classes.=\"{$class} \";\n\t\t\t}\n\t\t\t// close attribute\n\t\t\t$classes.= \"\\\"\";\n\t\t}\n\n\t\treturn $classes;\n\t}",
"function bstart_class_parse_important( $classes, $important_classes) {\n foreach( $classes as $i=>$class ) {\n // if class is imporant\n if ( '!' === $class[0] ) {\n // add to $important_classes array ( after remove ! )\n $important_classes[] = substr( $class, 1 );\n // remove from $classes\n unset( $classes[$i] );\n }\n }\n // $classes = array_values( $classes ); // undecided if this is needed here\n return array(\n $classes,\n $important_classes\n );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the default row for backward compatibility, if the html content is not processed by pagebuilder before | private function getDefaultRow(string $html)
{
return [
[
'data-content-type' => 'row',
'data-element' => 'inner',
'items' => [
[
'data-content-type' => 'html',
"style" => "border-style: none; border-width: 1px; " .
"border-radius: 0px; margin: 0px; padding: 0px;",
'value' => $html,
],
],
],
];
} | [
"private static function getDefaultRow()\n {\n static $row = false;\n if ($row === false) {\n // This row is used in the case where an action is know as an exit_action\n // but this action was not properly recorded when it was hit in the first place\n // so we add this fake row information to make sure there is a nb_hits, etc. column for every action\n $row = new Row(array(\n Row::COLUMNS => array(\n PiwikMetrics::INDEX_NB_VISITS => 1,\n PiwikMetrics::INDEX_NB_UNIQ_VISITORS => 1,\n PiwikMetrics::INDEX_PAGE_NB_HITS => 1,\n )));\n }\n return $row;\n }",
"public function add_blank_row($default_text = null){\r\n\tif($this->properties['in_table']){\r\n\r\n\t\t$this->html .= $this->dom_create('tr', array(), false);\r\n\t\t$this->html .= $this->dom_create('td', array('class' => 'mwms_spanned_row', 'colspan' => '2'), false);\r\n\r\n\t}else{\r\n\r\n\t\t$this->html .= $this->dom_create('div', array('class' => 'mwms_spanned_row'), false);\r\n\t}\r\n\r\n$this->html .= $default_text;\r\n}",
"public function getDefaultRow() : ?int;",
"public function getDefaultRow() : ?int\n {\n return null;\n }",
"private function getRow()\n {\n $module_rows = $this->getRows();\n\n return isset($module_rows[0]) ? $module_rows[0] : null;\n }",
"public function getFirstRow();",
"function getDefaultContent()\n\t{\n\t\treturn $this->defaultContent;\n\t}",
"function getRowHtml()\r\n\t{\r\n\t // Failsafe if i18n is not loaded\r\n\t if(! function_exists('__'))\r\n\t Misc::use_helper('I18N');\r\n\r\n\t if ($this->showGeenResultaten && ($this->rowCount == 0)) {\r\n\t\t $html = \" <td colspan='$this->colCount'>\" . __('Geen resultaten') . \"</td>\\n\";\r\n\t\t}\r\n\t\telse $html = $this->rowDataHtml;\r\n\r\n\t\treturn $html;\r\n\t}",
"protected function _getInnerRow($id=null){\r\n if ($id==null){\r\n $id = $this->id;\r\n }\r\n return $this->_pageModel->find($id)->current();\r\n }",
"public function getRow() : ?int \n {\n if ( ! $this->hasRow()) {\n $this->setRow($this->getDefaultRow());\n }\n return $this->row;\n }",
"function get_list_row() {\n // Return none as this type should not be displayed.\n return array();\n }",
"private function getPart($key) {\n\t\tif (\\array_key_exists($key, $this->content) === false) {\n\t\t\t$this->content[$key]=new HtmlTableContent(\"\", $key);\n\t\t\tif ($key !== \"tbody\") {\n\t\t\t\t$this->content[$key]->setRowCount(1, $this->_colCount);\n\t\t\t}\n\t\t}\n\t\treturn $this->content[$key];\n\t}",
"public function hestia_load_clients_default_content() {\n\t\treturn themeisle_hestia_clients_default_content();\n\t}",
"public function formRow()\n {\n return $this->getHTMLDocument()->getHTMLFactory()->buildHtmlElement('div', '', '', 'form-simple-row');\n }",
"public function getRow(): int|null\n {\n if (!$this->hasRow()) {\n $this->setRow($this->getDefaultRow());\n }\n return $this->row;\n }",
"public function getFirst() {\n \t$this->checkRowCount();\n\n return $this->rows[0];\n }",
"function get_default_page_id()\r\n{\r\n\treturn getField('SELECT defaultpage.id\r\n\t\t\t\tFROM\r\n\t\t\t\t\t((select id from tpl_pages where default_page=1 limit 0,1)\r\n\t\t\t\t\tUNION\r\n\t\t\t\t\t(select id from tpl_pages order by id limit 0,1))\r\n\t\t\t\t\tAS defaultpage\r\n\t\t\t\tLIMIT 0,1');\r\n}",
"public function getWrappedContent() {\n\t\treturn\tarray_key_exists(0, $this->wrapped)\n\t\t\t?\t$this->wrapped[0]\n\t\t\t:\tNULL; \n\t}",
"protected function getPageSummaryRow()\n {\n $columns = array_values($this->columns);\n $cols = count($columns);\n if ($cols === 0) {\n return null;\n }\n $cells = [];\n $skipped = [];\n for ($i = 0; $i < $cols; $i++) {\n /** @var DataColumn $column */\n $column = $columns[$i];\n if (!method_exists($column, 'renderPageSummaryCell')) {\n $cells[] = Html::tag('td');\n continue;\n }\n $cells[] = $column->renderPageSummaryCell();\n if (!empty($column->pageSummaryOptions['colspan'])) {\n $span = (int)$column->pageSummaryOptions['colspan'];\n $dir = ArrayHelper::getValue($column->pageSummaryOptions, 'data-colspan-dir', 'ltr');\n if ($span > 0) {\n $fm = ($dir === 'ltr') ? ($i + 1) : ($i - $span + 1);\n $to = ($dir === 'ltr') ? ($i + $span - 1) : ($i - 1);\n for ($j = $fm; $j <= $to; $j++) {\n $skipped[$j] = true;\n }\n }\n }\n }\n if (!empty($skipped)) {\n for ($i = 0; $i < $cols; $i++) {\n if (isset($skipped[$i])) {\n $cells[$i] = '';\n }\n }\n }\n\n return implode('', $cells);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replace placeholder untuk rule required_with. | protected function replaceRequiredWith($message, $attribute, $rule, array $parameters)
{
return str_replace(':field', $this->attribute($parameters[0]), $message);
} | [
"public function placeholder($placeholder){ $this->attributes['placeholder']=$placeholder; return $this; }",
"public function setPlaceholder($placeholder);",
"function change_placeholder( $args, $key=false, $value=false ) {\n\n if ( $args['required'] != 1 ) {\n $args['placeholder'] = $args['label'] . __( ' (optional)', 'woocommerce' );\n\n } else {\n $args['placeholder'] = $args['label'];\n }\n\n return $args;\n}",
"private function getRequiredParam($required) {\n\t\treturn ($required == true) ? ' required=\"required\" ' : '';\n\t}",
"public function addPlaceholder($placeholder, string $pattern = null);",
"public function setRequired($required) {\n $this->required = !empty($required);\n }",
"private function addRequiredRule()\n {\n $inputs = $this->getDefinedInputs();\n if (!empty($inputs)) {\n foreach ($inputs as $input) {\n if (!$input instanceof Input) {\n continue;\n }\n\n $input->addRule(new ValidatorRule('required'));\n }\n\n $this->setDefinedInputs($inputs);\n }\n }",
"protected function replaceRequiredWith($message, $attribute, $rule, $parameters)\n {\n return str_replace(':values', implode(' / ', $this->getAttributeList($parameters)), $message);\n }",
"function minima_form_required_marker($variables) {\n // This is also used in the installer, pre-database setup.\n $t = get_t();\n $attributes = array(\n 'class' => 'is-required',\n 'title' => $t('This field is required.'),\n );\n return '<span' . drupal_attributes($attributes) . '>*</span>';\n}",
"function theme_form_required_marker($variables) {\n // This is also used in the installer, pre-database setup.\n $t = get_t();\n $attributes = array(\n 'class' => 'form-required',\n 'title' => $t('This field is required.'),\n );\n return '<span' . drupal_attributes($attributes) . '>*</span>';\n}",
"public function jsReplaceRequiredIf($message, $attribute, $rule, $parameters)\n {\n unset($attribute);\n unset($rule);\n\n $data = array();\n $data[$parameters[0]] = $parameters[1];\n\n $parameters[1] = $this->getDisplayableValue($parameters[0], array_get($data, $parameters[0]));\n $parameters[0] = $this->getAttribute($parameters[0]);\n\n return str_replace(array(':other', ':value'), $parameters, $message);\n }",
"protected function replaceRequiredWith($message, $attribute, $rule, $parameters)\n {\n $values = implode(' / ', $this->getAttributeList($parameters));\n\n return str_replace(':values', $values, $message);\n }",
"public function parseRequired(): void\n {\n $this->required = true;\n }",
"public function resolveRequiredIf($field, $pattern)\n\t{\n\t\t//Get the content by the given field\n\t\t$content = $this->get($field);\n\t\t$alerts = $this->rule->getAlertMessages();\n\t\t//Explode pattern by pipe `|` character\n\t\t$patterns = explode(Validation::PIPE, $pattern);\n\n\t\tarray_walk($patterns, function ($pattern) use ($field, $content, $alerts) {\n\t\t\tif (mb_strpos($pattern, 'requiredIf') !== false) {\n\t\t\t\t$pattern = str_replace('requiredIf:', '', $pattern);\n\t\t\t\t$pairs = explode('&', $pattern);\n\t\t\t\t$pairs = explode('=', implode('=', $pairs));\n\n\t\t\t\tif (count($pairs) === 2) {\n\t\t\t\t\t$value = $this->get($pairs[0]);\n\t\t\t\t\t$value = is_bool($value) ? var_export(boolval($value), true) : $value;\n\n\t\t\t\t\tif ($value === $pairs[1]) {\n\t\t\t\t\t\tif ($content === '') {\n\t\t\t\t\t\t\t$this->setValidationAlert($field, $alerts['required']);\n\t\t\t\t\t\t\t$this->setAlertIndicator($field, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (count($pairs) === 4) {\n\t\t\t\t\t$value1 = $this->get($pairs[0]);\n\t\t\t\t\t$value1 = is_bool($value1) ? var_export(boolval($value1), true) : $value1;\n\n\t\t\t\t\t$value2 = $this->get($pairs[0]);\n\t\t\t\t\t$value2 = is_bool($value2) ? var_export(boolval($value2), true) : $value2;\n\n\t\t\t\t\tif ($value1 === $pairs[1] && $value2 === $pairs[3]) {\n\t\t\t\t\t\tif ($content === '') {\n\t\t\t\t\t\t\t$this->setValidationAlert($field, $alerts['required']);\n\t\t\t\t\t\t\t$this->setAlertIndicator($field, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}",
"function mark_required() {\r\n\treturn '<label style=\"color:red\">*</label>';\r\n}",
"function testRequired(){\n\t\t#mdx:required\n\t\tParam::get('name')\n\t\t\t->context(['name'=>''])\n\t\t\t->filters()\n\t\t\t\t->required(\"Cannot be empty\");\n\n\t\t$error = Param::get('name')->process()->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Cannot be empty\", $error);\n\t}",
"function filter_form_field_required($name, $required)\n{\n if (!$required) {\n $minlength = get_field_restrict_property('minlength', $name);\n if ((!empty($minlength)) && (intval($minlength) > 0)) {\n $required = true;\n }\n }\n return $required;\n}",
"function placeholder_comment_form_field($fields) {\n $replace_comment = __('Your Comment', '__x__');\n \n $fields['comment_field'] = '<p class=\"comment-form-comment\"><label for=\"comment\">' . _x( 'Comment', 'noun' ) .\n '</label><textarea id=\"comment\" name=\"comment\" cols=\"45\" rows=\"8\" placeholder=\"'.$replace_comment.'\" aria-required=\"true\"></textarea></p>';\n \n return $fields;\n }",
"function Required($param=false) {\n if (!$param or (isset($_REQUEST[$param]) and $_REQUEST[$param] != '') ) {\n return '';\n } else {\n return '<span class=\"missing\">*</span>';\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of show | public function getShow()
{
return $this->show;
} | [
"public function getDisplayValue();",
"public function getDisplayValue()\n\t{\n\t\treturn $this->displayValue; \n\n\t}",
"public function getIsShow(){\n return $this->is_show;\n }",
"public function display(){\n\t\t\t\t\t\n\t\t\t// returns all values\n\t\t\treturn $this->_params[\"display\"];\n\t\t\t\n\t\t}",
"public function getIsShow()\n {\n return $this->is_show;\n }",
"function cell_get_value_disp()\n {\n return $this->displayedValue;\n }",
"public function display()\n {\n\tif ( is_null($this->value) or !isset($this->choices))\n\t{\n\t return $this->getValue();\n\t}\n\telse\n\t{\n\t return $this->choices[$this->value];\n\t}\n }",
"public function echo_value() {\n\t\techo $this->value;\n\t}",
"public function getShow()\n {\n if (!empty($this->show_id)) {\n return MyRadio_Show::getInstance($this->show_id);\n } else {\n return;\n }\n }",
"function grabShow(){\n\t\t$show = $_GET['viewShowId'];\n\n\t\tif ($show == 0){\n\t\t\t$show = \"all\";\n\t\t}\n\t\treturn $show;\n\t}",
"function getShowTime()\n\t{\n\t\treturn $this->showtime;\n\t}",
"public function getShowTitle()\n {\n return $this->show_title;\n }",
"public function getShowType()\n {\n return $this->show_type;\n }",
"function getDisplay() {\n return $this->display;\n }",
"public function getShowSelf()\n {\n return $this->showSelf;\n }",
"public function getShowName()\n {\n return self::$show_list[$this->show_status];\n }",
"function getShowDate()\n\t{\n\t\treturn $this->showdate;\n\t}",
"public function get_show_max() {\n return $this->show_max;\n }",
"public function getValueDisplayStrategy();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a copy of this datetime after adding the specified number of seconds. The calculation will add a duration equivalent to the number of seconds expressed in microseconds. For example, if a spring daylight savings cutover is from 01:59 to 03:00 then adding one second to 01:59:59 will result in 03:00:00. This is a duration of one second later, even though the hour field value changed from 1 to 3. Returns $this if $seconds is 0. | public function plusSeconds($seconds) {
$value = \Bronto\Util\Preconditions::requireInt($seconds, '$seconds');
return $this->plusMicroseconds($seconds * self::MICROS_PER_SECOND);
} | [
"public function addSeconds($seconds){\n $this->dateTime->add(DateInterval::createFromDateString(\"$seconds Seconds\"));\n return $this;\n }",
"public function addSeconds(int $seconds)\n {\n $time = clone $this;\n\n return $time->add(DateInterval::createFromDateString(\"{$seconds} seconds\"));\n }",
"public function addSeconds(int $seconds) : Date{\n $this->modify($seconds.' second');\n return $this;\n }",
"public function addSecond() {\n\t\treturn $this->add(1, DateTime::SECOND);\n\t}",
"public function setSeconds($var)\n {\n GPBUtil::checkInt64($var);\n $this->seconds = $var;\n\n return $this;\n }",
"public function setDurationSeconds($var)\n {\n GPBUtil::checkFloat($var);\n $this->duration_seconds = $var;\n\n return $this;\n }",
"public function addSecond($second = 1)\n {\n $this->dt->modify(($second > 0 ? '+' : '-') . abs($second) . ' second');\n return $this;\n }",
"public function setElapsedSeconds($seconds)\n {\n $this->elapsed_seconds = $seconds;\n return $this;\n }",
"public function minusSeconds(int $seconds): Duration\n {\n return $this->plusSeconds(-$seconds);\n }",
"public function setSeconds($seconds)\n {\n// convert to totals\n $this->_total_milliseconds = $seconds*1000;\n $this->_total_seconds = $seconds;\n $this->_total_minutes = $seconds/60;\n $this->_total_hours = $this->_total_minutes/60;\n\n $this->_milliseconds =\n $this->_seconds =\n $this->_minutes =\n $this->_hours = 0;\n\n// convert to grouped\n while($seconds > 60)\n {\n $seconds -= 60;\n $this->_minutes += 1;\n if($this->_minutes === 60)\n {\n $this->_hours += 1;\n $this->_minutes = 0;\n }\n }\n $this->_milliseconds = $seconds-floor($seconds);\n $this->_seconds = floor($seconds);\n \n// if the milliseconds are 1, then make a seconds adjust\n if(abs($this->_milliseconds-1) < self::EPSILON)\n {\n $this->_milliseconds = 0;\n $this->_seconds += 1;\n }\n \n// if we have a frame rate then set those values.\n if($this->_frame_rate !== null)\n {\n $this->_frames = round($this->_frame_rate * $this->_milliseconds);\n $this->_total_frames = round($this->_frame_rate * $this->_total_seconds);\n }\n \n return $this;\n }",
"public function shift($seconds)\n {\n $data = $this->getData();\n $newData = [];\n foreach ($data as $measureKey => $measureData) {\n $newMeasureData = [];\n foreach ($measureData[self::KEY_DIMENSION_TIME] as $ts => $subData) {\n $newMeasureData[$ts + $seconds] = $subData;\n }\n $newData[$measureKey] = [self::KEY_DIMENSION_TIME => $newMeasureData];\n }\n\n return new TimeSeries(\n $this->getDimensions(),\n $newData,\n $this->getInterval(),\n $this->getSpan()\n );\n }",
"public function setSeconds($second = 0) {\n\t\tlist($H, $i, $s, $m, $d, $Y) = DateTimeToolkit::breakdown($this->ts);\n\t\t\n\t\treturn new DateTime(mktime($H, $i, $second, $m, $d, $Y));\n\t}",
"public function setTimeSkipped($seconds)\n {\n $this->time_skipped = $seconds;\n return $this;\n }",
"public function addSecond()\n {\n return $this->addSeconds(1);\n }",
"public function setAddSeconds($value)\n {\n return $this->set('AddSeconds', $value);\n }",
"public function addSeconds($value)\n {\n return $this->modify((int) $value.' second');\n }",
"public function withSecond(int $second): DateTime\n {\n return new static(\n $this->date(),\n Time::create($this->hour(), $this->minute(), $second, $this->microsecond()),\n $this->timezone()\n );\n }",
"protected static function addTimestamp(DateTimeImmutable $datetime, $seconds)\n {\n if (0 > $seconds) {\n throw new InvalidArgumentException('The interval can not be negative');\n }\n\n if (false !== ($res = filter_var($seconds, FILTER_VALIDATE_INT))) {\n return $datetime->add(new DateInterval('PT'.$res.'S'));\n }\n\n $timestamp = explode('.', sprintf('%6f', $seconds));\n $seconds = (int) $timestamp[0];\n $micro = $timestamp[1] + $datetime->format('u');\n if ($micro > 1e6) {\n $micro -= 1e6;\n $seconds++;\n }\n\n $dateEnd = $datetime->add(new DateInterval('PT'.$seconds.'S'));\n\n return new DateTimeImmutable(\n $dateEnd->format('Y-m-d H:i:s').\".\".sprintf('%06d', $micro),\n $datetime->getTimeZone()\n );\n }",
"public static function ofSeconds(int $seconds, int $microAdjustment = 0): Duration\n {\n $micros = $microAdjustment % DateTime::MICROS_PER_SECOND;\n $seconds += intdiv($microAdjustment, DateTime::MICROS_PER_SECOND);\n\n if ($micros < 0) {\n $micros += DateTime::MICROS_PER_SECOND;\n $seconds--;\n }\n\n return new Duration($seconds, $micros);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a new element to 'previews' | public function addPreviews(\SteamKit\Base\SteamMsgClientServer2\CMsgClientUCMUpdatePublishedFile\AdditionalPreview $value)
{
if ($this->previews === null) {
$this->previews = new \Protobuf\MessageCollection();
}
$this->previews->add($value);
} | [
"public function display_upcoming_post_previews($optional_arguments = array()){\n\t\t$html = $this->get_upcoming_post_preview($optional_arguments);\n\t\techo $html;\n\t}",
"function createPreviews($res, $type)\n{\n //check if preview is for roads or articles and sets href according to it\n $href = \"?page=\";\n if ($type == 'article') {\n $href .= 'articles-subpage&subpage=';\n } else {\n $href .= 'roads-subpage&subpage=';\n }\n\n //Create HTML string for article\n $previews = \"\";\n $previews .= \"<div class='previews'>\";\n\n foreach ($res as $value) {\n //wrapper around single preview\n $previews .= \"<div class='preview'>\";\n\n //Create varable with the title and add to preview string\n $header = $value[\"title\"] ?? \"\";\n $previews .= \"<h3>$header</h3>\";\n\n //Create varable with data and shorten it down. Add to preview string\n $data = $value[\"preview\"] ?? \"\";\n $data = trim($data);\n $previews .= \"<div class='previewText'>$data</div>\";\n\n //Create variable for subpage.\n $name = $value[\"name\"] ?? \"\";\n $subpage = $href . $name;\n $previews .= \"<a href='$subpage'>Läs mer</a>\";\n\n //end single preview wrapper\n $previews .= \"</div>\";\n\n }\n //end previews\n $previews .= \"</div>\";\n\n return $previews;\n}",
"public function addReviewByInstructure()\n {\n /* code goes here */\n }",
"function addBefore() {\n\n\t}",
"public function actionPreviews()\n {\n $id = Yii::$app->request->post('id');\n $carTransporter = CarTransporter::findOne($id);\n return $this->renderAjax('/car-transporter/previews', compact('carTransporter'));\n }",
"public function addReview($value)\n {\n $this->reviews[] = $value;\n }",
"function addPreview() {\n\t\tif (!$this->id) {\n\t\t\twarn(\"Cant add symlink, provide bin Id plz\");\n\t\t\treturn false;\n\t\t}\n\t\tif (preg_match('/^preview\\//',$this->key)) {\n\t\t\t$fname = $this->getFilename();\n\t\t\t$pre_fname = $this->getFilename(PREVIEW_PATH);\n\t\t\tif ($pre_path = dirname($pre_fname)) {\n\t\t\t\tif (make_path($pre_path)) {\n\t\t\t\t\tsymlink($fname,$pre_fname); // FIXME: Hope it works always // misha@\n\t\t\t\t} else {\n\t\t\t\t\twarn(\"Cant make symlink dir [{$pre_path}]\");\n\t\t\t\t}\n\t\t\t}\n\t\t} // end preview symlinking\n\t}",
"public function testImagesAddPreview()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function woo_vou_add_preview_button() {\r\r\n\t\t\r\r\n\t\tglobal $typenow, $post;\r\r\n\t\t\r\r\n\t\tif ( ! current_user_can( 'manage_options' )\r\r\n\t\t\t|| ! is_object( $post )\r\r\n\t\t\t|| $post->post_type != WOO_VOU_POST_TYPE ) {\r\r\n\t\t\t\treturn;\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\tif ( isset( $_GET['post'] ) ) {\r\r\n\t\t\t\r\r\n\t\t\t$args = array( 'action'\t=>\t'woo_vou_duplicate_vou', 'woo_vou_dupd_vou_id' => absint( $_GET['post'] ) );\r\r\n\t\t\t$dupdurl = add_query_arg( $args, admin_url( 'edit.php' ) );\r\r\n\t\t\t$notifyUrl = wp_nonce_url( $dupdurl, 'duplicate-vou_' . $_GET['post'] );\r\r\n\t\t\t?>\r\r\n\t\t\t<div id=\"duplicate-action\"><a class=\"submitduplicate duplication\" href=\"<?php echo esc_url( $notifyUrl ); ?>\"><?php _e( 'Copy to a new draft', 'woovoucher' ); ?></a></div>\r\r\n\t\t\t<?php\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\t$preview_url = $this->woo_vou_get_preview_link( $post->ID );\r\r\n\t\techo '<a href=\"' . $preview_url . '\" class=\"button button-secondary button-large woo-vou-pdf-preview-button\" >' . __( 'Preview', 'woovoucher' ) . '</a>';\r\r\n\t}",
"function theme_previews_fieldset($node,$thumbs) {\r\n global $user;\r\n //$thumbs = _previews_flattenArray($thumbs);\r\n $thumbs_html = '';\r\n foreach ($thumbs as $fid => $thumbgroup) {\r\n $thumbs_html .= theme('previews_thumbnail_group', $thumbgroup, $fid).'<div class=\"previews_thumb\" style=\"height:60px;background:black;width:3px;\"> </div>';\r\n }\r\n\tif (count($thumbs)) {\r\n\t\t$fieldset = array(\r\n\t\t '#title' => '%title%',\r\n\t\t '#collapsible' => variable_get('previews_collapsed', 0),\r\n\t\t '#collapsed' => variable_get('previews_collapsed', 0),\r\n\t\t '#value' => $thumbs_html,\r\n '#attributes' => array('class'=>'previews_fieldset'),\r\n\t\t );\r\n $out = theme('fieldset', $fieldset);\r\n if ($user->uid != 1) {\r\n cache_set('previews_thumbs_'._previews_dataUriSupport().'_'.$node->nid.'_'.$node->vid, $out,'cache',(time()+60*60*12));\r\n }\r\n }\r\n else {\r\n $out = '';\r\n }\r\n return $out;\r\n}",
"public function pre_view() {}",
"public function addView($episodeid){\n $episodeid = mysql_real_escape_string($episodeid);\n $e = mysql_query(\"UPDATE episodes SET views=views+1 WHERE id='$episodeid'\") or die(mysql_error());\n }",
"function addNewShow()\n {\n\t return view('client.extractor.new');\n }",
"public function addReview(Review $review): void\n {\n array_push($this->reviews, $review);\n }",
"public function preview()\n\t{\n\t\tPhpfox::getBlock('bulletin.preview', array('sText' => $this->get('text')));\n\t}",
"public function createDefaultPreviews()\n {\n $result = true;\n $previews = CArrayHelper::map($this->previews, 'type', 'slug');\n $accessTypes = ProjectPreview::getTypeLabels();\n\n foreach ($accessTypes as $type => $label) {\n if (isset($previews[$type])) {\n continue; // prevent creating duplicating previews\n }\n\n $model = new ProjectPreview;\n $model->generateSlug();\n $model->type = $type;\n $model->projectId = $this->id;\n\n $result = $result && $model->save();\n }\n\n return $result;\n }",
"public function addpreviewAction(){\n Log::infoLog('method='.__FUNCTION__.';user_id='.Auth_Info::getUser()->user_id.';control_number'.';Start action');\n $create_date = \"\";\n if ($this->getRequest()->isGet()){\n $id = $this->_input->id;\n $create_date = MInformations::getInstance()->getEntryById($id)->create_date;\n }\n\n Log::infoLog('method='.__FUNCTION__.';user_id='.Auth_Info::getUser()->user_id.';control_number'.';Start action');\n if ($this->getRequest()->isPost()){\n $array = array('title'=>$this->_input->title, 'detail'=>$this->_input->detail, 'create_date'=>Zynas_Date::dbDatetime());\n $this->getRequest()->setParams($array);\n }\n Log::infoLog('method='.__FUNCTION__.';user_id='.Auth_Info::getUser()->user_id.';control_number'.';End action');\n }",
"public function preview()\n {\n }",
"public function clickPreview()\n {\n $this->_rootElement->find($this->previewButton)->click();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates an h2 random tag with some contents. | public function h2($words = 6) {
return '<h2>' . $this->generator->Text->sentence($words) . '</h2>';
} | [
"function h2 (string $content, array $attributes = []): string {\n\treturn '<h2 '.parseOptions($attributes).'>'.$content.'</h2>';\n}",
"function buildH2($h2) {\n\t\t$this->color('#555');\n\t\t$this->size(14);\n\t\t$this->margin(2, 7);\n\t\t$this->addLine($h2);\n\t}",
"function H2($input){\n $this->add($headline = new HtmlHeadline(2));\n $headline->add($input);\n return $headline;\n }",
"protected function _tag_close_H2($param)\n {\n return $this->_tag_close_H1($param);\n }",
"public function titleH2($titleH2);",
"public function bootstrapHeading2Function(array $args = []): string {\n return $this->bootstrapHeading(2, ArrayHelper::get($args, \"content\"), ArrayHelper::get($args, \"description\"), ArrayHelper::get($args, \"class\"));\n }",
"public function gen() {\n\t\t$len = rand($this->min, $this->max);\n\n\t\t// Image\n\t\tif ($this->pixabayKey !== null && Util::should($this->imageChance)) {\n\t\t\treturn $this->generateImage();\n\t\t}\n\n\t\t// Ordered list\n\t\tif (Util::should($this->olChance)) {\n\t\t\treturn $this->generateList('ol');\n\t\t}\n\n\t\t// Unordered list\n\t\tif (Util::should($this->ulChance)) {\n\t\t\treturn $this->generateList('ul');\n\t\t}\n\n\t\t// Sentences\n\t\t$paragraph = '';\n\t\tfor ($i = 0; $i < $len; $i++) {\n\n\t\t\t// Separate sentences either by space or a new line\n\t\t\t$glue = '';\n\t\t\tif (strlen($paragraph)) {\n\n\t\t\t\t// Optional BR over simple space\n\t\t\t\t$glue = Util::should($this->brChance)\n\t\t\t\t\t? '<br />'\n\t\t\t\t\t: ' ';\n\t\t\t}\n\n\t\t\t$paragraph .= $glue . parent::gen();\n\t\t}\n\n\t\treturn parent::tag('p', $paragraph);\n\t}",
"public function titleH2(string $titleH2): TurboContentHeaderInterface;",
"function alienship_do_site_description() {\n\n\t// Use H2 on home, paragraph elsewhere\n\t$element = is_front_page() || is_home() ? 'h2' : 'p';\n\n\t// Put it all together\n\t$description = '<' . $element . ' id=\"site-description\" class=\"site-description\">' . esc_html( get_bloginfo( 'description' ) ) . '</' . $element . '>';\n\n\t// Echo the description\n\techo apply_filters( 'alienship_site_description_content', $description );\n}",
"public static function page()\n\t{\n\t\treturn \"<div>\\n\".self::paragraphs(rand(2, 5)).\"</div>\\n\";\n\t}",
"function getH2()\n {\n global $html;\n //The following regular expression extracts contents from the $html which is enclosed between the tags <h2 class=\"cd__headline\">..</h2> and copies it to the $matches variable\n preg_match_all('/<h2 class=\"cd__headline\">.*?<\\/h2>/is', $html, $matches);\n for($i=0; $i<count($matches[0]); $i++)\n {\n //The following statements removes h2 tags from the extracted text\n $matches[0][$i]=str_replace('<h2 class=\"cd__headline\">','',$matches[0][$i]);\n $matches[0][$i]=str_replace('</h2>','',$matches[0][$i]);\n }\n //Returns the array of processed h2 tags text\n return $matches[0];\n }",
"protected function _genTalkTitle()\n {\n $data = $this->getData()->getTalkTitleGeneratorData();\n\n $title = \"\";\n $title .= $data->a[array_rand($data->a)] . \" \"; // a-e is because of lack of imagination\n $title .= $data->b[array_rand($data->b)] . \" \";\n $title .= $data->c[array_rand($data->c)] . \" \";\n $title .= $data->d[array_rand($data->d)] . \" \";\n $title .= $data->e[array_rand($data->e)];\n\n return $title;\n }",
"function h1( $vContent = NULL, $aAttrs = array() )\n\t{\n\t\t$bHasEnd = TRUE;\n\t\treturn $this->_create_tag( __FUNCTION__, $aAttrs, $bHasEnd, $vContent );\n\t}",
"public function testAddMultipleH2(): void\n {\n // setup\n $htmlReport = new Html();\n\n // test body\n $htmlReport->body()->h2();\n $htmlReport->body()->h2();\n\n // assertions\n $this->assertEquals('<html><body><h2></h2><h2></h2></body></html>', $htmlReport->compile());\n }",
"public function random_description() {\n\n\t\t$descriptions = array_fill( 0, 15, get_bloginfo( 'description' ) );\n\n\t\t$descriptions []= '01100011 01101111 01100100 01100101';\n\t\t$descriptions []= 'int 0x80';\n\t\t$descriptions []= '#define TRUE 1';\n\t\t$descriptions []= '\\' OR 1=1; --';\n\t\t$descriptions []= '0xfffffff0';\n\n\t\treturn $descriptions[array_rand($descriptions)];\n\t}",
"private function renderSubtitle()\n\t{\n\t\tif ($this->subtitle) {\n\t\t\treturn '<h2 class=\"block-new-subtitle\">' . $this->subtitle . '</h2>';\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"function generate()\n\t{\n\t\tif ( count( $this->_aAttrs ) > 0 )\n\t\t{\n\t\t\t$this->_assemble_attributes();\n\t\t}\n\t\n\t\t$sTag = '<'.$this->_sTagName.$this->_sAttrs;\n\t\t\n\t\tif ( ! $this->_bHasEnd )\n\t\t{\n\t\t\t$sTag .= '/>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sTag .= '>'.$this->_sContent.'</'.$this->_sTagName.'>';\n\t\t}\n\t\n\t\treturn $sTag;\n\t}",
"function add_ids($content) {\n\t//ensure h2's have ids\n\t$content = preg_replace_callback(\n\t\t'/<h2 (?:(?!id=))+([^>]*>)(.*?)<\\/h2>/i', \n\t\tfunction ($perams) {\n\t\t\t$id = strtolower(sanitize_key(strip_tags($perams[2])));\n\t\t\treturn '<h2 id=\"'.$id.'\" '.$perams[1].$perams[2].'</h2>';\n\t\t},\n\t\t$content);\n\t\t\n\treturn $content;\n}",
"public static function _render_below_header_section_2() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore\n\t\t\treturn do_shortcode( astra_get_option( 'below-header-section-2-html' ) );\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prepare email data according to a given channel, scenario, and custom data. | public function prepare($scenarioName, $channelName, array $customData = [], array $attachments = [])
{
$scenarioData = $this->getScenario($scenarioName, $channelName);
$scenarioData = $this->parseRecursiveTranslations($scenarioData);
$defaultFrom = $this->parseRecursiveTranslations($this->defaultFrom());
$defaultTo = $this->parseRecursiveTranslations($this->defaultTo());
$languageData = [
'template_data' => [
'currentLanguage' => $this->translator()->getLocale(),
],
];
if (!isset($customData['template_data'])) {
$customData = [
'template_data' => $customData,
];
}
// Merge emailData and formData, which adds the later to the rendering context.
$renderData = array_merge_recursive($customData, [
'form_data' => $this->formData(),
]);
// Manages renderable data found in the scenario config
array_walk_recursive($scenarioData, function (&$value, $key, $renderData) {
if ($key === 'template_ident') {
return;
}
if (is_string($value)) {
$value = $this->view()->renderTemplate($value, $renderData);
}
}, $renderData);
$emailData = array_merge_recursive(
$defaultFrom,
$defaultTo,
$languageData,
$scenarioData,
$customData
);
if ($this->from() && !is_scalar($this->from())) {
$emailData['from'] = $this->from();
}
if ($this->to() && !is_scalar($this->to())) {
$emailData['to'] = $this->to();
}
if (!empty($attachments)) {
$emailData['attachments'] = $attachments;
}
return $emailData;
} | [
"public function prepare($scenarioName, $channelName, array $customData = []);",
"public function prepareDataforEmail($data = array())\n { \n $params = Factory::getApplication()->getUserState('com_tkdclub.participant.itemparams', '');\n $store_data = $data['store_data'] === 1 ? $store_data = Text::_('JYES') : $store_data = Text::_('JNO');\n $field_text = '';\n\n $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_FIRSTNAME') . ': ' . $data['firstname'] . \"\\r\\n\";\n $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_LASTNAME') . ': ' . $data['lastname'] . \"\\r\\n\";\n $data['email'] ? $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_EMAIL') . ': ' . $data['email'] . \"\\r\\n\" : null;\n $data['clubname'] ? $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_CLUB') . ': ' . $data['clubname'] . \"\\r\\n\" : null;\n $data['grade'] ? $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_GRADE_EMAIL') . ': ' . $data['grade'] . \"\\r\\n\" : null;\n $data['age'] ? $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_AGE') . ': ' . $data['age'] . \"\\r\\n\" : null;\n $data['registered'] ? $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_SUM') . ': ' . $data['registered'] . \"\\r\\n\" : null;\n $data['user1'] ? $field_text .= $params->user1 . ': ' . $data['user1'] . \"\\r\\n\" : null;\n $data['user2'] ? $field_text .= $params->user2 . ': ' . $data['user2'] . \"\\r\\n\" : null;\n $data['user3'] ? $field_text .= $params->user3 . ': ' . $data['user3'] . \"\\r\\n\" : null;\n $data['user4'] ? $field_text .= $params->user4 . ': ' . $data['user4'] . \"\\r\\n\" : null;\n $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_PRIVACY_ACCEPTED_EMAIL') . ': ' . Text::_('JYES') . \"\\r\\n\";\n $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_STOREDATA_ACCEPTED_EMAIL') . ': ' . $store_data . \"\\r\\n\";\n $data['notes'] ? $field_text .= Text::_('COM_TKDCLUB_PARTICIPANT_NOTES') . ': ' . $data['notes'] . \"\\r\\n\" : null;\n $field_text .= \"\\r\\n\";\n\n return $field_text;\n }",
"static function prepare_post_data ($data)\n\t{\n\t\t$settings = get(\"/settings/emails\");\n\t\t\n\t\t// Merge default email settings.\n\t\tif (is_array($params = $settings[$data['type']]))\n\t\t{\n\t\t\t$data = array_merge($params, (array)$data);\n\t\t}\n\t\t\n\t\t// Remember original request params?\n\t\tif (Request::$controller->request)\n\t\t{\n\t\t\t$orig_to = Request::$controller->request->to;\n\t\t\t$orig_cc = Request::$controller->request->cc;\n\t\t\t$orig_bcc = Request::$controller->request->bcc;\n\t\t\t$orig_from = Request::$controller->request->from;\n\t\t\t$orig_subject = Request::$controller->request->subject;\n\t\t}\n\t\t\n\t\t// Render text content.\n\t\tif ($data['text'])\n\t\t{\n\t\t\tob_start();\n\t\t\t$data['view'] = $data['text'];\n\t\t\trender($data);\n\t\t\t$data['text'] = ob_get_clean();\n\t\t}\n\t\telseif ($data['raw_text'])\n\t\t{\n\t\t\t$data['text'] = $data['raw_text'];\n\t\t}\n\t\t\n\t\t// Render html content.\n\t\tif ($data['html'])\n\t\t{\n\t\t\tob_start();\n\t\t\t$data['view'] = $data['html'];\n\t\t\trender($data);\n\t\t\t$data['html'] = ob_get_clean();\n\t\t}\n\t\telseif ($data['raw_html'])\n\t\t{\n\t\t\t$data['html'] = $data['raw_html'];\n\t\t}\n\t\t\n\t\tunset($data['view']);\n\t\tunset($data['raw_text']);\n\t\tunset($data['raw_html']);\n\t\t\n\t\t// Restore request params?\n\t\tif (Request::$controller->request)\n\t\t{\n\t\t\t$data['to'] = $data['to'] ?: Request::$controller->request->to;\n\t\t\t$data['cc'] = $data['cc'] ?: Request::$controller->request->cc;\n\t\t\t$data['bcc'] = $data['bcc'] ?: Request::$controller->request->bcc;\n\t\t\t$data['from'] = $data['from'] ?: Request::$controller->request->from;\n\t\t\t$data['subject'] = $data['subject'] ?: Request::$controller->request->subject;\n\t\t\t\n\t\t\tRequest::$controller->request->to = $orig_to;\n\t\t\tRequest::$controller->request->cc = $orig_cc;\n\t\t\tRequest::$controller->request->bcc = $orig_bcc;\n\t\t\tRequest::$controller->request->from = $orig_from;\n\t\t\tRequest::$controller->request->subject = $orig_subject;\n\t\t}\n\t\t\n\t\t// Filter out model resources.\n\t\tforeach ($data as $key => $val)\n\t\t{\n\t\t\tif ($data[$key] instanceof ModelResource)\n\t\t\t{\n\t\t\t\tunset($data[$key]);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $data;\n\t}",
"public function create($scenarioName, $channelName, array $customData = []);",
"protected function prepare_data() {\n\t\t$url = get_permalink( $this->post->ID );\n\n\t\t/**\n\t\t * Override which image to send.\n\t\t *\n\t\t * @since 0.0.2\n\t\t *\n\t\t * @param int $img The image ID to send\n\t\t * @param int $id The post ID.\n\t\t */\n\t\t$img = apply_filters( 'cwp_tweet_core_tweet_media', false, $this->post->ID );\n\n\t\tif ( ! $img ) {\n\t\t\t$img = get_post_thumbnail_id( $this->post->ID, 'large' );\n\t\t}\n\n\t\tif ( $img ) {\n\t\t\t$data['media'][] = $img;\n\t\t} else {\n\t\t\t$data['media'] = array();\n\t\t}\n\n\t\t$data[ 'message' ] = sprintf( '%1s %2s', substr( $this->message_text, 0, 100 ), $url );\n\n\t\treturn $data;\n\n\t}",
"private static function _prepare_email($template,$details,$customfields)\n\t{\n\t\tPbdebug::log_msg('_prepare_email() using template '.$template,'com_pbbooking');\n\t\tPbdebug::log_msg(json_encode($details),'com_pbbooking');\n\t\tPbdebug::log_msg(json_encode($customfields),'com_pbbooking');\n\n\t\t$db = &JFactory::getDbo();\n\t\t$config = $db->setQuery('select * from #__pbbooking_config')->loadObject();\n\t\t$service = $db->setQuery('select * from #__pbbooking_treatments where id = '.$db->escape($details['service_id']))->loadObject();\n\n\t\tPbdebug::log_msg('_prepare_email() template is '.$config->$template,'com_pbbooking');\n\t\t$body = $config->$template;\n\n\t\t//parse custom fields tags\n\t\tforeach ($customfields as $customfield) {\n\t\t\t$body = preg_replace('/\\|\\*'.$customfield->varname.'\\*\\|/',$customfield->data,$body);\n\t\t}\n\t\t\n\t\t//append service details if required\n\t\t$booking_details = '';\n\t\t$booking_details .= \"<p><table>\";\n\t\t$booking_details .= \"<tr><th>\".JTEXT::_('COM_PBBOOKING_SUCCESS_DATE').\"</th><td>\".JHtml::_('date',date_create($details['dtstart'],new DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM),$config->date_format_message);\n\t\t$booking_details .= \"<tr><th>\".JTEXT::_('COM_PBBOOKING_SUCCESS_TIME').\"</th><td>\".JHtml::_('date',date_create($details['dtstart'],new DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM),JText::_('COM_PBBOOKING_SUCCESS_TIME_FORMAT')).\"</td></tr>\";\n\t\t$booking_details .= \"<tr><th>\".JTEXT::_('COM_PBBOOKING_BOOKINGTYPE').\"</th><td>\".$service->name.\"</td></tr></table></p>\";\n\t\t$body = preg_replace('/\\|\\*booking_details\\*\\|/',$booking_details,$body);\n\n\t\t//append url string if we have it.....\n\t\t$body = preg_replace('/\\|\\*URL\\*\\|/',$details['url'],$body);\n\n\t\tPbdebug::log_msg('_prepare_email() template after all replacements '.$body,'com_pbbooking');\n\n\t\t//return completed string\n\t\treturn $body;\n\t}",
"private function prepareConsignment()\r\n {\r\n $this->extractItemDetailsOfOrder();\r\n $this->setTotals();\r\n $this->setCourier();\r\n }",
"public function create($scenarioName, $channelName, array $customData = [], array $attachments = [])\n {\n $data = $this->prepare($scenarioName, $channelName, $customData, $attachments);\n $email = $this->emailFactory()->create('email')->setData($data);\n\n return $email;\n }",
"protected function prepareAdditionalData() {}",
"function prepare_data_to_mailchimp($order) {\r\n global $MTH;\r\n global $API;\r\n \r\n $mc_array['status'] = 'subscribed';\r\n $mc_array['email_address'] = $order->billing->email;\r\n $mc_array['merge_fields']['NOME'] = $order->billing->first_name;\r\n $mc_array['merge_fields']['SOBRENOME'] = $order->billing->last_name;\r\n $mc_array['merge_fields']['COMPRA'] = $order->date_created;\r\n ($order->date_completed) ? $mc_array['merge_fields']['PAGAMENTO'] = $order->date_completed : false;\r\n $mc_array['merge_fields']['SITUACAO'] = $order->status;\r\n $mc_array['merge_fields']['ENDERECO'] = $order->billing->address_1;\r\n $mc_array['merge_fields']['BAIRRO'] = $order->billing->neighborhood;\r\n $mc_array['merge_fields']['CIDADE'] = $order->billing->city;\r\n $mc_array['merge_fields']['ESTADO'] = $order->billing->state;\r\n $mc_array['merge_fields']['CEP'] = $order->billing->postcode;\r\n $mc_array['merge_fields']['CUPOM'] = (isset($order->coupon_lines[0]->code)) ? $order->coupon_lines[0]->code : '';\r\n $mc_array['merge_fields']['TELEFONE'] = (isset($order->billing->phone)) ? $order->billing->phone : '';\r\n $mc_array['merge_fields']['CELULAR'] = $order->billing->cellphone;\r\n $mc_array['merge_fields']['CPF'] = $order->billing->cpf;\r\n $mc_array['merge_fields']['CNPJ'] = $order->billing->cnpj;\r\n $mc_array['merge_fields']['TIPOCLIENT'] = $order->billing->persontype;\r\n $mc_array['merge_fields']['ORDER_ID'] = $order->id;\r\n // $has_coupon = (isset($order->coupon_lines[0]->code));\r\n \r\n $is_client = $MTH->is_client($order);\r\n $mc_array['merge_fields']['CLIENTE'] = ($is_client) ? 'SIM' : 'NAO';\r\n \r\n $member_tags = [];\r\n foreach ($order->line_items as $item) {\r\n unset($product);\r\n $mc_nome_curso = $item->name;\r\n $mc_sku_curso = $item->sku;\r\n $product = $API->request(\"GET\", \"/wc/v3/products/\" . $item->product_id . \"?\");\r\n \r\n if (!isset($product->id)) {\r\n return $API->return_error('route_woocommerce_webhooks', 'Error retrieving product data: ', $product);\r\n }\r\n \r\n array_push($member_tags, $item->sku);\r\n \r\n foreach ($product->categories as $categories) {\r\n switch ($categories->id) {\r\n case \"196\": // Curso gratis\r\n array_push($member_tags, \"CURSO\");\r\n array_push($member_tags, \"GRATIS\");\r\n break;\r\n case \"43\": // curso de 10h\r\n array_push($member_tags, \"CURSO\");\r\n array_push($member_tags, \"10H\");\r\n break;\r\n case \"193\": // curso de 16h\r\n array_push($member_tags, \"CURSO\");\r\n array_push($member_tags, \"16H\");\r\n break;\r\n case \"74\": // trilha\r\n array_push($member_tags, \"TRILHA\");\r\n array_push($member_tags, \"40H\");\r\n break;\r\n case \"224\": // Plano ensino infantil anos iniciais\r\n array_push($member_tags, \"PLANO_EIAI\");\r\n break;\r\n case \"225\": // Plano anos finais ensino medio\r\n array_push($member_tags, \"PLANO_AFEM\");\r\n break;\r\n case \"223\": // Plano premium\r\n array_push($member_tags, \"PLANO_PREMIUM\");\r\n break;\r\n }\r\n }\r\n }\r\n \r\n $mc_array['merge_fields']['CURSO'] = $mc_nome_curso;\r\n $mc_array['merge_fields']['SKU'] = $mc_sku_curso;\r\n $mc_array['tags'] = $member_tags;\r\n \r\n foreach ($order->meta_data as $item) {\r\n switch ($item->key) {\r\n case \"Tipo de pagamento\": // Curso gratis\r\n $mc_array['merge_fields']['FORMA_PAGM'] = $item->value;\r\n $order_payment_method = $item->value;\r\n break;\r\n }\r\n }\r\n return array($mc_array, $order_payment_method);\r\n }",
"protected function setEmailData($data=NULL)\n\t{\n\t\ttry\n\t\t{\n\t\t\t# Check if there was email data passed to the method.\n\t\t\tif($data!==NULL)\n\t\t\t{\n\t\t\t\t$this->setAttachment($data['Attachment']);\n\t\t\t\t$this->setConfirmationTemplate($data['ConfirmationTemplate']);\n\t\t\t\t$this->setIsHTML($data['IsHTML']);\n\t\t\t\t$this->setMaxFileSize($data['MaxFileSize']);\n\t\t\t\t$this->setMessage($data['Message']);\n\t\t\t\t$this->setRecipients($data['Recipients']);\n\t\t\t\t$this->setSenderEmail($data['SenderEmail']);\n\t\t\t\t$this->setSenderName($data['SenderName']);\n\t\t\t\t$this->setSiteName($data['SiteName']);\n\t\t\t\t$this->setSubject($data['Subject']);\n\t\t\t\t$this->setTemplate($data['Template']);\n\t\t\t}\n\t\t\t# Check if there is session data.\n\t\t\tif(isset($_SESSION['email_subject']))\n\t\t\t{\n\t\t\t\t$this->setAttachment(((isset($_SESSION['email_file'])) ? $_SESSION['email_file'] : NULL));\n\t\t\t\t$this->setIsHTML(((isset($_SESSION['email_html'])) ? $_SESSION['email_html'] : NULL));\n\t\t\t\t$this->setMaxFileSize(((isset($_SESSION['MAX_FILE_SIZE'])) ? $_SESSION['MAX_FILE_SIZE'] : NULL));\n\t\t\t\t$this->setMessage(((isset($_SESSION['email_body'])) ? $_SESSION['email_body'] : NULL));\n\t\t\t\t$this->setSenderEmail(((isset($_SESSION['email'])) ? $_SESSION['email'] : NULL));\n\t\t\t\t$this->setSenderName(((isset($_SESSION['realname'])) ? $_SESSION['realname'] : NULL));\n\t\t\t\t$this->setSiteName(((isset($_SESSION['sitename'])) ? $_SESSION['sitename'] : NULL));\n\t\t\t\t$this->setSubject(((isset($_SESSION['email_subject'])) ? $_SESSION['email_subject'] : NULL));\n\t\t\t\t$this->setRecipients(((isset($_SESSION['email_to'])) ? $_SESSION['email_to'] : NULL));\n\t\t\t}\n\t\t\t# Check if there is POST data.\n\t\t\tif(array_key_exists('_submit_check', $_POST))\n\t\t\t{\n\t\t\t\t$this->setAttachment(((isset($_POST['file'])) ? $_POST['file'] : NULL));\n\t\t\t\t$this->setIsHTML(((isset($_POST['html'])) ? $_POST['html'] : NULL));\n\t\t\t\t$this->setMaxFileSize(((isset($_POST['MAX_FILE_SIZE'])) ? $_POST['MAX_FILE_SIZE'] : NULL));\n\t\t\t\t$this->setMessage(((isset($_POST['message'])) ? $_POST['message'] : NULL));\n\t\t\t\t$this->setSenderEmail(((isset($_POST['email'])) ? $_POST['email'] : NULL));\n\t\t\t\t$this->setSenderName(((isset($_POST['realname'])) ? $_POST['realname'] : NULL));\n\t\t\t\t$this->setSiteName(((isset($_POST['sitename'])) ? $_POST['sitename'] : NULL));\n\t\t\t\t$this->setSubject(((isset($_POST['subject'])) ? $_POST['subject'] : NULL));\n\t\t\t\t$this->setRecipients(((isset($_POST['to'])) ? $_POST['to'] : NULL));\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tthrow $e;\n\t\t}\n\t}",
"function message_prepare($message) {\n // First, decide on queue, log, cron and send options\n parent::message_prepare($message);\n // Build specific mail parameters and store them into the message\n $params = $this->message_params($message);\n $message->params[$this->method] = $this->mail_params($message, $params);\n }",
"private function _process_custom_channel_fields()\n\t{\n\t\t// return;\n\t\t\n\t\t// ---------------------------------------------\n\t\t//\tFetch field groups\n\t\t// ---------------------------------------------\n\n\t\t$this->EE->db->select('field_id, field_name, channels.channel_html_formatting')\n\t\t\t->from('channel_fields channel_fields, channels channels')\n\t\t\t->where_in('channel_id', $this->channel_ids)\n\t\t\t->where('channels.field_group = channel_fields.group_id', NULL, FALSE);\n\t\t\t\n\t\t$channel_fields_info_q = $this->EE->db->get();\n\n\t\t// ---------------------------------------------\n\t\t//\tMake sure there are results before we try to process them...\n\t\t// ---------------------------------------------\n\n\t\tif ($channel_fields_info_q->num_rows() < 1)\n\t\t{\n\t\t\t// No Custom Channel Field results\n\t\t\treturn;\n\t\t}\n\n\t\t// ---------------------------------------------\n\t\t//\tIterate over the category_data_a, processing/replacing custom fields\n\t\t// ---------------------------------------------\n\n\t\tforeach ($channel_fields_info_q->result() as $field)\n\t\t{\n\n\t\t\tforeach($this->entry_data_a as $key => $data_row)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif ( isset($data_row[ 'field_id_'.$field->field_id ]) )\n\t\t\t\t{\n\n\t\t\t\t\t$this->entry_data_a[$key][ $field->field_name ] = array();\n\n\t\t\t\t\t$this->entry_data_a[$key][ $field->field_name ][] = $data_row[ 'field_id_'.$field->field_id ];\n\n\t\t\t\t\t$this->entry_data_a[$key][ $field->field_name ][] = array(\n\t\t\t\t\t\t'text_format' => $data_row['field_ft_'.$field->field_id],\n\t\t\t\t\t\t'html_format' => $field->channel_html_formatting,\n\t\t\t\t\t\t'auto_links' => 'n',\n\t\t\t\t\t\t'allow_img_url' => 'y'\n\t\t\t\t\t);\n\n\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->entry_data_a[$key][ $field->field_name ] = \"\";\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t\t\n\t}",
"protected function prepareData()\n {\n \n foreach ($this->data as $key => $value) {\n switch ($key) {\n case 'urlPath':\n $this->urlPath = $value;\n break;\n case 'paramName':\n $this->paramName = $value;\n break;\n default:\n $this->additionalData[$key] = $value;\n break;\n }\n }\n }",
"public function test_notification_customdata() {\n $this->resetAfterTest(true);\n\n $course = $this->getDataGenerator()->create_course();\n\n $options = array('course' => $course->id, 'forcesubscribe' => FORUM_FORCESUBSCRIBE);\n $forum = $this->getDataGenerator()->create_module('forum', $options);\n\n list($author) = $this->helper_create_users($course, 1);\n list($commenter) = $this->helper_create_users($course, 1);\n\n $strre = get_string('re', 'forum');\n\n // New posts should not have Re: in the subject.\n list($discussion, $post) = $this->helper_post_to_forum($forum, $author);\n $expect = [\n 'author' => (object) [\n 'userid' => $author->id,\n 'messages' => 1,\n ],\n 'commenter' => (object) [\n 'userid' => $commenter->id,\n 'messages' => 1,\n ],\n ];\n $this->queue_tasks_and_assert($expect);\n\n $this->send_notifications_and_assert($author, [$post]);\n $this->send_notifications_and_assert($commenter, [$post]);\n $messages = $this->messagesink->get_messages();\n $customdata = json_decode($messages[0]->customdata);\n $this->assertEquals($forum->id, $customdata->instance);\n $this->assertEquals($forum->cmid, $customdata->cmid);\n $this->assertEquals($post->id, $customdata->postid);\n $this->assertEquals($discussion->id, $customdata->discussionid);\n $this->assertObjectHasAttribute('notificationiconurl', $customdata);\n $this->assertObjectHasAttribute('actionbuttons', $customdata);\n $this->assertCount(1, (array) $customdata->actionbuttons);\n }",
"public function prepareData()\n {\n $order = \\Order::with('client')->find($this->order_id);\n\n if(!$this->computeOverallZScores()){\n return;\n }\n\n $computation = GenerateCAPReportFileTrait::prepareFactorSubfactorDescritors($this->test_scores, $this->test_type_id);\n extract($computation); // extracting index to variable (cap_factors, cap_subfactors, ...)\n\n $f_report_type = $report_type = $file_ext = '';\n switch($this->input['file_type']) {\n case 'gp-pdf-i': // IIR\n $report_type = 'profile';\n $file_ext = 'pdf';\n $f_report_type = 'IIR';\n break;\n }\n\n $this->pdf_data = array_merge($computation, [\n 'test_type_id' => $this->test_type_id,\n 'test_date' => $order->po_date,\n 'client_name' => $order->client ? $order->client->name : '',\n 'order_name' => $order->test_admin_name,\n 'report_type' => $report_type,\n ]);\n\n $test_abbreviation = isset($this->test_scores[0]->test->abbreviation)\n ? $this->test_scores[0]->test->abbreviation : \"\";\n\n // filename: \"{Test Abbrev} {Report Type: IIR,IPR...} {Group Name = Order Name} {PO Date}.{file_ext}\"\n $this->filename = sprintf(\n \"%s %s %s %s.%s\",\n $test_abbreviation,\n $f_report_type,\n $order->test_admin_name,\n $order->po_date,\n $file_ext\n );\n }",
"protected function processDefaultMessageData()\n {\n $this->addMessageData('body', $this->messageModel->getBody());\n $this->addMessageData('createdAt', $this->messageModel->getCreatedAt());\n $this->addMessageData('sender', $this->messageModel->getSender());\n\n $this->addMessageMeta(self::SENDER, 'readStatus', new ReadStatus(MessageMetaInterface::READ_STATUS_READ));\n $this->addMessageMeta(self::RECIPIENTS, 'readStatus', new ReadStatus(MessageMetaInterface::READ_STATUS_NEVER_READ));\n\n $this->addThreadMeta(self::SENDER, 'lastParticipantMessageDate', $this->messageModel->getCreatedAt());\n $this->addThreadMeta(self::RECIPIENTS, 'lastMessageDate', $this->messageModel->getCreatedAt());\n\n $this->processExtra();\n }",
"public function prepareData()\n {\n foreach ($this->data as $key => $value) {\n switch ($key) {\n case 'urlPath':\n $this->urlPath = $value;\n break;\n case 'paramName':\n $this->paramName = $value;\n break;\n default:\n $this->additionalData[$key] = $value;\n break;\n }\n }\n }",
"function email_format_bug_message( array $p_visible_bug_data ) {\n\t$t_normal_date_format = config_get( 'normal_date_format' );\n\t$t_complete_date_format = config_get( 'complete_date_format' );\n\n\t$t_email_separator1 = config_get( 'email_separator1' );\n\t$t_email_separator2 = config_get( 'email_separator2' );\n\t$t_email_padding_length = config_get( 'email_padding_length' );\n\n\t$t_status = $p_visible_bug_data['email_status'];\n\n\t$p_visible_bug_data['email_date_submitted'] = date( $t_complete_date_format, $p_visible_bug_data['email_date_submitted'] );\n\t$p_visible_bug_data['email_last_modified'] = date( $t_complete_date_format, $p_visible_bug_data['email_last_modified'] );\n\n\t$p_visible_bug_data['email_status'] = get_enum_element( 'status', $t_status );\n\t$p_visible_bug_data['email_severity'] = get_enum_element( 'severity', $p_visible_bug_data['email_severity'] );\n\t$p_visible_bug_data['email_priority'] = get_enum_element( 'priority', $p_visible_bug_data['email_priority'] );\n\t$p_visible_bug_data['email_reproducibility'] = get_enum_element( 'reproducibility', $p_visible_bug_data['email_reproducibility'] );\n\n\t$t_message = $t_email_separator1 . \" \\n\";\n\n\tif( isset( $p_visible_bug_data['email_bug_view_url'] ) ) {\n\t\t$t_message .= $p_visible_bug_data['email_bug_view_url'] . \" \\n\";\n\t\t$t_message .= $t_email_separator1 . \" \\n\";\n\t}\n\n\t$t_message .= email_format_attribute( $p_visible_bug_data, 'email_reporter' );\n\t$t_message .= email_format_attribute( $p_visible_bug_data, 'email_handler' );\n\t$t_message .= $t_email_separator1 . \" \\n\";\n\t$t_message .= email_format_attribute( $p_visible_bug_data, 'email_project' );\n\t$t_message .= email_format_attribute( $p_visible_bug_data, 'email_bug' );\n\t$t_message .= email_format_attribute( $p_visible_bug_data, 'email_category' );\n\n\tif( isset( $p_visible_bug_data['email_tag'] ) ) {\n\t\t$t_message .= email_format_attribute( $p_visible_bug_data, 'email_tag' );\n\t}\n\n\t$t_message .= email_format_attribute( $p_visible_bug_data, 'email_reproducibility' );\n\t$t_message .= email_format_attribute( $p_visible_bug_data, 'email_severity' );\n\t$t_message .= email_format_attribute( $p_visible_bug_data, 'email_priority' );\n\t$t_message .= email_format_attribute( $p_visible_bug_data, 'email_status' );\n\t$t_message .= email_format_attribute( $p_visible_bug_data, 'email_target_version' );\n\n\t# custom fields formatting\n\tforeach( $p_visible_bug_data['custom_fields'] as $t_custom_field_name => $t_custom_field_data ) {\n\t\t$t_message .= utf8_str_pad( lang_get_defaulted( $t_custom_field_name, null ) . ': ', $t_email_padding_length, ' ', STR_PAD_RIGHT );\n\t\t$t_message .= string_custom_field_value_for_email( $t_custom_field_data['value'], $t_custom_field_data['type'] );\n\t\t$t_message .= \" \\n\";\n\t}\n\n\t# end foreach custom field\n\n\tif( config_get( 'bug_resolved_status_threshold' ) <= $t_status ) {\n\t\t$p_visible_bug_data['email_resolution'] = get_enum_element( 'resolution', $p_visible_bug_data['email_resolution'] );\n\t\t$t_message .= email_format_attribute( $p_visible_bug_data, 'email_resolution' );\n\t\t$t_message .= email_format_attribute( $p_visible_bug_data, 'email_fixed_in_version' );\n\t}\n\t$t_message .= $t_email_separator1 . \" \\n\";\n\n\t$t_message .= email_format_attribute( $p_visible_bug_data, 'email_date_submitted' );\n\t$t_message .= email_format_attribute( $p_visible_bug_data, 'email_last_modified' );\n\n\tif( isset( $p_visible_bug_data['email_due_date'] ) ) {\n\t\t$t_message .= email_format_attribute( $p_visible_bug_data, 'email_due_date' );\n\t}\n\n\t$t_message .= $t_email_separator1 . \" \\n\";\n\n\t$t_message .= email_format_attribute( $p_visible_bug_data, 'email_summary' );\n\n\t$t_message .= lang_get( 'email_description' ) . \": \\n\" . $p_visible_bug_data['email_description'] . \"\\n\";\n\n\tif( !is_blank( $p_visible_bug_data['email_steps_to_reproduce'] ) ) {\n\t\t$t_message .= \"\\n\" . lang_get( 'email_steps_to_reproduce' ) . \": \\n\" . $p_visible_bug_data['email_steps_to_reproduce'] . \"\\n\";\n\t}\n\n\tif( !is_blank( $p_visible_bug_data['email_additional_information'] ) ) {\n\t\t$t_message .= \"\\n\" . lang_get( 'email_additional_information' ) . \": \\n\" . $p_visible_bug_data['email_additional_information'] . \"\\n\";\n\t}\n\n\tif( isset( $p_visible_bug_data['relations'] ) ) {\n\t\tif( $p_visible_bug_data['relations'] != '' ) {\n\t\t\t$t_message .= $t_email_separator1 . \"\\n\" . utf8_str_pad( lang_get( 'bug_relationships' ), 20 ) . utf8_str_pad( lang_get( 'id' ), 8 ) . lang_get( 'summary' ) . \"\\n\" . $t_email_separator2 . \"\\n\" . $p_visible_bug_data['relations'];\n\t\t}\n\t}\n\n\t# Sponsorship\n\tif( isset( $p_visible_bug_data['sponsorship_total'] ) && ( $p_visible_bug_data['sponsorship_total'] > 0 ) ) {\n\t\t$t_message .= $t_email_separator1 . \" \\n\";\n\t\t$t_message .= sprintf( lang_get( 'total_sponsorship_amount' ), sponsorship_format_amount( $p_visible_bug_data['sponsorship_total'] ) ) . \"\\n\\n\";\n\n\t\tif( isset( $p_visible_bug_data['sponsorships'] ) ) {\n\t\t\tforeach( $p_visible_bug_data['sponsorships'] as $t_sponsorship ) {\n\t\t\t\t$t_date_added = date( config_get( 'normal_date_format' ), $t_sponsorship->date_submitted );\n\n\t\t\t\t$t_message .= $t_date_added . ': ';\n\t\t\t\t$t_message .= user_get_name( $t_sponsorship->user_id );\n\t\t\t\t$t_message .= ' (' . sponsorship_format_amount( $t_sponsorship->amount ) . ')' . \" \\n\";\n\t\t\t}\n\t\t}\n\t}\n\n\t$t_message .= $t_email_separator1 . \" \\n\\n\";\n\n\t# format bugnotes\n\tforeach( $p_visible_bug_data['bugnotes'] as $t_bugnote ) {\n\t\t# Show time tracking is always true, since data has already been filtered out when creating the bug visible data.\n\t\t$t_message .= email_format_bugnote( $t_bugnote, $p_visible_bug_data['email_project_id'],\n\t\t\t\t/* show_time_tracking */ true, $t_email_separator2, $t_normal_date_format ) . \"\\n\";\n\t}\n\n\t# format history\n\tif( array_key_exists( 'history', $p_visible_bug_data ) ) {\n\t\t$t_message .= lang_get( 'bug_history' ) . \" \\n\";\n\t\t$t_message .= utf8_str_pad( lang_get( 'date_modified' ), 17 ) . utf8_str_pad( lang_get( 'username' ), 15 ) . utf8_str_pad( lang_get( 'field' ), 25 ) . utf8_str_pad( lang_get( 'change' ), 20 ) . \" \\n\";\n\n\t\t$t_message .= $t_email_separator1 . \" \\n\";\n\n\t\tforeach( $p_visible_bug_data['history'] as $t_raw_history_item ) {\n\t\t\t$t_localized_item = history_localize_item( $t_raw_history_item['field'], $t_raw_history_item['type'], $t_raw_history_item['old_value'], $t_raw_history_item['new_value'], false );\n\n\t\t\t$t_message .= utf8_str_pad( date( $t_normal_date_format, $t_raw_history_item['date'] ), 17 ) . utf8_str_pad( $t_raw_history_item['username'], 15 ) . utf8_str_pad( $t_localized_item['note'], 25 ) . utf8_str_pad( $t_localized_item['change'], 20 ) . \"\\n\";\n\t\t}\n\t\t$t_message .= $t_email_separator1 . \" \\n\\n\";\n\t}\n\n\treturn $t_message;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets value of 'son_uid' property | public function setSonUid($value) {
return $this->set(self::SON_UID, $value);
} | [
"protected function update_uid()\n {\n // get generated UID\n if (!$this->data['uid']) {\n $this->data['uid'] = kolabformat::getSerializedUID();\n $this->obj->setUid($this->data['uid']);\n }\n }",
"function setUID($uid) {\n\t\t$this->_uid = $uid;\n\t}",
"public function setUid($uid);",
"public function setUid($uid) {\n\t\t$this->uid = $uid;\n\t}",
"public function setUid(int $uid) : void {\n $this->uid = $uid;\n $this->updateLastMetadataModified();\n }",
"private function _setUID()\n {\n $this->uid = uniqid();\n $this->setAttribute('id', $this->uid);\n }",
"public function setUidAttribute($value)\n {\n $this->attributes['uid'] = Str::slug($value);\n }",
"function setUID($uid = 0) {\n\t\tif (strlen(trim($uid)) > 0) {\n $this->uid = (string) $uid;\n } else {\n $rawid = (string) $this->startdate . 'plus' . $this->enddate;\n $this->uid = (string) md5($rawid);\n }\n\t}",
"function setUID($uid = 0) {\n\t\tif (strlen(trim($uid)) > 0) {\n $this->uid = (string) $uid;\n } else {\n $rawid = (string) $this->startdate . 'plus' . $this->enddate;\n $this->uid = (string) md5($rawid);\n }\n\t}",
"public function setExtraUid($uid) {\r\n $this->extra_uid = $uid;\r\n if ($this->extra_attributes) $this->extra_attributes['uid'] = $uid;\r\n }",
"public function set_user_id( $value ) {\n\t\t$this->set_prop( 'user_id', absint( $value ) ) ;\n\t}",
"public function setTasUid ($v)\n {\n // Since the native PHP type for this column is string,\n // we will cast the input to a string (if it is not).\n if ( $v !== null && !is_string ($v) )\n {\n $v = (string) $v;\n }\n if ( $this->tas_uid !== $v )\n {\n $this->tas_uid = $v;\n }\n }",
"public function getSonUid() {\n return $this->get(self::SON_UID);\n }",
"public function setTasUid ($v)\n {\n\n // Since the native PHP type for this column is string,\n // we will cast the input to a string (if it is not).\n if ( $v !== null && !is_string ($v) )\n {\n $v = (string) $v;\n }\n if ( $this->tas_uid !== $v || $v === '' )\n {\n $this->tas_uid = $v;\n }\n }",
"public function setUsrUid ($v)\n {\n // Since the native PHP type for this column is string,\n // we will cast the input to a string (if it is not).\n if ( $v !== null && !is_string ($v) )\n {\n $v = (string) $v;\n }\n if ( $this->usr_uid !== $v || $v === '' )\n {\n $this->usr_uid = $v;\n }\n }",
"public function setUsr_uid ($usr_uid)\n {\n // Since the native PHP type for this column is integer,\n // we will cast the input value to an int (if it is not).\n if ( $usr_uid !== null && !is_int ($usr_uid) && is_numeric ($usr_uid) )\n {\n $usr_uid = (int) $usr_uid;\n }\n if ( $this->usr_uid !== $usr_uid )\n {\n $this->usr_uid = $usr_uid;\n }\n }",
"public function setMsgedUid ($v)\n {\n // Since the native PHP type for this column is string,\n // we will cast the input to a string (if it is not).\n if ( $v !== null && !is_string ($v) )\n {\n $v = (string) $v;\n }\n if ( $this->msged_uid !== $v )\n {\n $this->msged_uid = $v;\n }\n }",
"public function setUsrUid ($v)\n {\n\n // Since the native PHP type for this column is string,\n // we will cast the input to a string (if it is not).\n if ( $v !== null && !is_string ($v) )\n {\n $v = (string) $v;\n }\n\n if ( $this->usr_uid !== $v || $v === '' )\n {\n $this->usr_uid = $v;\n }\n }",
"public function setMsgedUsrUid ($v)\n {\n // Since the native PHP type for this column is string,\n // we will cast the input to a string (if it is not).\n if ( $v !== null && !is_string ($v) )\n {\n $v = (string) $v;\n }\n if ( $this->msged_usr_uid !== $v || $v === '' )\n {\n $this->msged_usr_uid = $v;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Will output an row with options to manage the specified device based on the object data | public function printManageRow() {
echo "<tr>
<td><a href=\"?module=me&action=device&a=view&id=".$this->device_id."\">".$this->name."</a></td>
<td><img src=\"images/platform/".$this->platform.".png\" border=0 width=12 height=12> ".$this->os_version."</td>
<td>".strftime ("%a %b %d, %Y %H:%M", strtotime($this->last_update))."</td>
<td>[<a href=\"?module=me&action=device&a=delete&id=".$this->device_id."\" onclick=\"return rmItem()\">Delete device</a>]</td>
</tr>";
} | [
"private function generateDeviceFilterContentForFilter() \n {\n\n $device = $this->getParam('device', null);\n $deviceName = '';\n\n $exerciseXDeviceDb = new ExerciseXDevice();\n $devicesCollection = $exerciseXDeviceDb->findDevicesWithExercises();\n $exercisesWithoutDevices = $exerciseXDeviceDb->findExercisesWithoutDevices();\n\n $deviceContent = '';\n $optionSelectText = $this->translate('label_device_name');\n\n $this->view->assign('optionValue', 0);\n $this->view->assign('optionText', $this->translate('label_please_select'));\n $deviceContent .= $this->view->render('loops/option.phtml');\n\n foreach ($devicesCollection as $currentDevice) {\n $this->view->assign('optionValue', $currentDevice->offsetGet('device_id'));\n // $this->view->assign('optionText', $currentDevice->offsetGet('device_name') . ' (' .\n // $currentDevice->offsetGet('exerciseCount') . ' ' . (1 < $currentDevice->offsetGet('exerciseCount') ?\n // $this->translate('label_exercises') : $this->translate('label_exercise')) . ') ');\n $this->view->assign('optionText', $currentDevice->offsetGet('device_name'));\n\n if ($device == $currentDevice->offsetGet('device_id')) {\n $deviceName = $currentDevice->offsetGet('device_name');\n }\n\n $deviceContent .= $this->view->render('loops/option.phtml');\n }\n\n if ($exercisesWithoutDevices) {\n $this->view->assign('optionValue', 'WITHOUT');\n $this->view->assign(\n 'optionText', $this->translate('label_exercises_without_device') . ' (' .\n $exercisesWithoutDevices->offsetGet('exerciseCount') . ' ' . (1 < $exercisesWithoutDevices->offsetGet('exerciseCount') ?\n $this->translate('label_exercises') : $this->translate('label_exercise')) . ') '\n );\n\n if ($device == 'WITHOUT') {\n $deviceName = $this->translate('label_exercises_without_exercise_type');\n }\n\n $deviceContent .= $this->view->render('loops/option.phtml');\n }\n\n if ($device) {\n $optionSelectText = $deviceName;\n $this->view->assign('currentValue', $device);\n }\n\n $this->view->assign('selectId', 'device_id');\n $this->view->assign('optionsContent', $deviceContent);\n\n $this->view->assign('optionSelectText', $optionSelectText);\n // $this->view->assign('optionLabelText', $this->translate('label_device_name') . ':');\n $this->view->assign('optionLabelText', '');\n $this->view->assign('optionClassName', ' device-select custom-drop-down col-sm-4 ');\n\n return $this->view->render('globals/select.phtml');\n }",
"function widgetopts_tabcontent_devices( $args ){\n $desktop = '';\n $tablet = '';\n $mobile = '';\n $options_role = '';\n if( isset( $args['params'] ) && isset( $args['params']['devices'] ) ){\n if( isset( $args['params']['devices']['options'] ) ){\n $options_role = $args['params']['devices']['options'];\n }\n if( isset( $args['params']['devices']['desktop'] ) ){\n $desktop = $args['params']['devices']['desktop'];\n }\n if( isset( $args['params']['devices']['tablet'] ) ){\n $tablet = $args['params']['devices']['tablet'];\n }\n if( isset( $args['params']['devices']['mobile'] ) ){\n $mobile = $args['params']['devices']['mobile'];\n }\n }\n ?>\n <div id=\"extended-widget-opts-tab-<?php echo $args['id'];?>-devices\" class=\"extended-widget-opts-tabcontent extended-widget-opts-tabcontent-devices\">\n <p>\n <strong><?php _e( 'Hide/Show', 'widget-options' );?></strong>\n <select class=\"widefat\" name=\"<?php echo $args['namespace'];?>[extended_widget_opts][devices][options]\">\n <option value=\"hide\" <?php if( $options_role == 'hide' ){ echo 'selected=\"selected\"'; }?> ><?php _e( 'Hide on checked devices', 'widget-options' );?></option>\n <option value=\"show\" <?php if( $options_role == 'show' ){ echo 'selected=\"selected\"'; }?>><?php _e( 'Show on checked devices', 'widget-options' );?></option>\n </select>\n </p>\n <table class=\"form-table\">\n <tbody>\n <tr valign=\"top\">\n <td scope=\"row\"><strong><?php _e( 'Devices', 'widget-options' );?></strong></td>\n <td> </td>\n </tr>\n <tr valign=\"top\">\n <td scope=\"row\"><span class=\"dashicons dashicons-desktop\"></span> <label for=\"extended_widget_opts-<?php echo $args['id'];?>-devices-desktop\"><?php _e( 'Desktop', 'widget-options' );?></label></td>\n <td>\n <input type=\"checkbox\" name=\"<?php echo $args['namespace'];?>[extended_widget_opts][devices][desktop]\" value=\"1\" id=\"extended_widget_opts-<?php echo $args['id'];?>-devices-desktop\" <?php if( !empty( $desktop ) ){ echo 'checked=\"checked\"'; }?> />\n </td>\n </tr>\n <tr valign=\"top\">\n <td scope=\"row\"><span class=\"dashicons dashicons-tablet\"></span> <label for=\"extended_widget_opts-<?php echo $args['id'];?>-devices-table\"><?php _e( 'Tablet', 'widget-options' );?></label></td>\n <td>\n <input type=\"checkbox\" name=\"<?php echo $args['namespace'];?>[extended_widget_opts][devices][tablet]\" value=\"1\" id=\"extended_widget_opts-<?php echo $args['id'];?>-devices-table\" <?php if( !empty( $tablet ) ){ echo 'checked=\"checked\"'; }?> />\n </td>\n </tr>\n <tr valign=\"top\">\n <td scope=\"row\"><span class=\"dashicons dashicons-smartphone\"></span> <label for=\"extended_widget_opts-<?php echo $args['id'];?>-devices-mobile\"><?php _e( 'Mobile', 'widget-options' );?></label></td>\n <td>\n <input type=\"checkbox\" name=\"<?php echo $args['namespace'];?>[extended_widget_opts][devices][mobile]\" value=\"1\" id=\"extended_widget_opts-<?php echo $args['id'];?>-devices-mobile\" <?php if( !empty( $mobile ) ){ echo 'checked=\"checked\"'; }?> />\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n<?php\n}",
"protected function displayForCli(array $data)\n {\n $platform = $data['platform'];\n $tables = $data['tables'];\n $views = $data['views'] ?? null;\n\n $this->newLine();\n\n $this->components->twoColumnDetail('<fg=green;options=bold>'.$platform['name'].'</>');\n $this->components->twoColumnDetail('Database', Arr::get($platform['config'], 'database'));\n $this->components->twoColumnDetail('Host', Arr::get($platform['config'], 'host'));\n $this->components->twoColumnDetail('Port', Arr::get($platform['config'], 'port'));\n $this->components->twoColumnDetail('Username', Arr::get($platform['config'], 'username'));\n $this->components->twoColumnDetail('URL', Arr::get($platform['config'], 'url'));\n $this->components->twoColumnDetail('Open Connections', $platform['open_connections']);\n $this->components->twoColumnDetail('Tables', $tables->count());\n\n if ($tableSizeSum = $tables->sum('size')) {\n $this->components->twoColumnDetail('Total Size', number_format($tableSizeSum / 1024 / 1024, 2).'MiB');\n }\n\n $this->newLine();\n\n if ($tables->isNotEmpty()) {\n $this->components->twoColumnDetail('<fg=green;options=bold>Table</>', 'Size (MiB)'.($this->option('counts') ? ' <fg=gray;options=bold>/</> <fg=yellow;options=bold>Rows</>' : ''));\n\n $tables->each(function ($table) {\n if ($tableSize = $table['size']) {\n $tableSize = number_format($tableSize / 1024 / 1024, 2);\n }\n\n $this->components->twoColumnDetail(\n $table['table'].($this->output->isVerbose() ? ' <fg=gray>'.$table['engine'].'</>' : null),\n ($tableSize ? $tableSize : '—').($this->option('counts') ? ' <fg=gray;options=bold>/</> <fg=yellow;options=bold>'.number_format($table['rows']).'</>' : '')\n );\n\n if ($this->output->isVerbose()) {\n if ($table['comment']) {\n $this->components->bulletList([\n $table['comment'],\n ]);\n }\n }\n });\n\n $this->newLine();\n }\n\n if ($views && $views->isNotEmpty()) {\n $this->components->twoColumnDetail('<fg=green;options=bold>View</>', '<fg=green;options=bold>Rows</>');\n\n $views->each(fn ($view) => $this->components->twoColumnDetail($view['view'], number_format($view['rows'])));\n\n $this->newLine();\n }\n }",
"public function printDevices() {\n\t\tif (sizeof($this->devices) == 0) $this->getDevices();\n\t\tprint <<<TABLEHEADER\n \t\t<PRE>\n \t\t<TABLE BORDER=\"1\" CELLPADDING=\"3\">\n \t\t\t<TR>\n \t\t\t\t<TD VALIGN=\"top\"><B>ID</B></TD>\n \t\t\t\t<TD VALIGN=\"top\"><B>name</B></TD>\n \t\t\t\t<TD VALIGN=\"top\"><B>displayName</B></TD>\n \t\t\t\t<TD VALIGN=\"top\"><B>location</B></TD>\n \t\t\t\t<TD VALIGN=\"top\"><B>class</B></TD>\n \t\t\t\t<TD VALIGN=\"top\"><B>model</B></TD>\n \t\t\t\t<TD VALIGN=\"top\"><B>modelDisplayName</B></TD>\n \t\t\t\t<TD VALIGN=\"top\"><B>batteryLevel</B></TD>\n \t\t\t\t<TD VALIGN=\"top\"><B>batteryStatus</B></TD>\n \t\t\t</TR>\nTABLEHEADER;\n\t\tforeach ($this->devices as $device) {\n\t\t\t$location = <<<LOCATION\n\t\t\t<TABLE BORDER=\"1\">\n\t\t\t\t<TR>\n\t\t\t\t\t<TD VALIGN=\"top\">timestamp</TD>\n\t\t\t\t\t<TD VALIGN=\"top\">{$device->location->timestamp}</TD>\n\t\t\t\t</TR>\n\t\t\t\t<TR>\n\t\t\t\t\t<TD VALIGN=\"top\">horizontalAccuracy</TD>\n\t\t\t\t\t<TD VALIGN=\"top\">{$device->location->horizontalAccuracy}</TD>\n\t\t\t\t</TR>\n\t\t\t\t<TR>\n\t\t\t\t\t<TD VALIGN=\"top\">positionType</TD>\n\t\t\t\t\t<TD VALIGN=\"top\">{$device->location->positionType}</TD>\n\t\t\t\t</TR>\n\t\t\t\t<TR>\n\t\t\t\t\t<TD VALIGN=\"top\">longitude</TD>\n\t\t\t\t\t<TD VALIGN=\"top\">{$device->location->longitude}</TD>\n\t\t\t\t</TR>\n\t\t\t\t<TR>\n\t\t\t\t\t<TD VALIGN=\"top\">latitude</TD>\n\t\t\t\t\t<TD VALIGN=\"top\">{$device->location->latitude}</TD>\n\t\t\t\t</TR>\n\t\t\t</TABLE>\nLOCATION;\n\t\t\tprint <<<DEVICE\n\t\t\t\t\t<TR>\n \t\t\t\t<TD VALIGN=\"top\">{$device->ID}</TD>\n \t\t\t\t<TD VALIGN=\"top\">{$device->name}</TD>\n \t\t\t\t<TD VALIGN=\"top\">{$device->displayName}</TD>\n \t\t\t\t<TD VALIGN=\"top\">$location</TD>\n \t\t\t\t<TD VALIGN=\"top\">{$device->class}</TD>\n \t\t\t\t<TD VALIGN=\"top\">{$device->model}</TD>\n \t\t\t\t<TD VALIGN=\"top\">{$device->modelDisplayName}</TD>\n \t\t\t\t<TD VALIGN=\"top\">{$device->batteryLevel}</TD>\n \t\t\t\t<TD VALIGN=\"top\">{$device->batteryStatus}</TD>\n \t\t\t</TR>\nDEVICE;\n\t\t}\n\t\tprint <<<TABLEFOOTER\n \t\t</TABLE>\n \t\t</PRE>\nTABLEFOOTER;\n\t}",
"function filtered_device_list() {\n\t\treturn array(\n\t\t\t'custom-device' => array(\n\t\t\t\t'label' => __( 'Enter custom-device preview mode' ),\n\t\t\t\t'default' => true,\n\t\t\t),\n\t\t);\n\t}",
"function process_devs_disp($host_data)\n{\n global $id;\n\n $i = 0;\n $table = \"\";\n\n $arr = array ('command'=>'devs','parameter'=>'');\n $devs_arr = send_request_to_host($arr, $host_data);\n\n if ($devs_arr != null)\n {\n $id = $host_data['id'];\n while (isset($devs_arr['DEVS'][$i]))\n {\n $table .= process_dev_disp($devs_arr['DEVS'][$i]);\n $i++;\n }\n }\n\n return $table;\n}",
"function hardwareInfoOverlay(&$device, $infoArray) {\n\t\tif (! empty($infoArray['display_x']))\n\t\t\t$device['Device']['hd_specs']['display_x'] = $infoArray['display_x'];\n\t\tif (! empty($infoArray['display_y']))\n\t\t\t$device['Device']['hd_specs']['display_y'] = $infoArray['display_y'];\n\t\tif (! empty($infoArray['display_pixel_ratio']))\n\t\t\t$device['Device']['hd_specs']['display_pixel_ratio'] = $infoArray['display_pixel_ratio'];\n\t}",
"public function editDevice(){\n }",
"private function setDeviceTableHeader(){\n if (isset($this->type)){\n switch ($this->language){\n case \"NL\":\n $this->html .= \"<h3>Gegevens van het terug gebracht matteriaal</h3>\";\n break;\n case \"FR\":\n $this->html .= \"<h3>Info of the returned device</h3>\";\n break;\n case \"EN\":\n $this->html .= \"<h3>Info of the returned device</h3>\";\n break;\n }\n }else{\n switch ($this->language){\n case \"NL\":\n $this->html .= \"<h3>Gegevens van het ontvangen matteriaal</h3>\";\n break;\n case \"FR\":\n $this->html .= \"<h3>Info about the received device</h3>\";\n break;\n case \"EN\":\n $this->html .= \"<h3>Info about the received device</h3>\";\n break;\n }\n }\n $this->html .=\"<table class=\\\"table table-striped table-bordered\\\">\";\n $this->html .= \"<thead>\";\n $this->html .= \"<tr>\";\n $this->html .= \"<th>Category</th>\";\n $this->html .= \"<th>Asset Type</th>\";\n $this->html .= \"<th>AssetTag</th>\";\n $this->html .= \"<th>SerialNumber</th>\";\n $this->html .= \"</tr>\";\n $this->html .= \"</thead>\";\n $this->html .= \"<tbody>\";\n }",
"public function getDeviceOptionEditAction() \n {\n $deviceOptionId = intval($this->getRequest()->getParam('device_option_id', 0));\n $deviceOptionsContent = '';\n\n if (0 < $deviceOptionId) {\n $deviceOptionsDb = new DeviceOptions();\n $deviceOption = $deviceOptionsDb->findOptionById($deviceOptionId);\n\n $this->view->assign('device_option_id', $deviceOption->offsetGet('device_option_id'));\n $this->view->assign('device_option_name', $deviceOption->offsetGet('device_option_name'));\n $this->view->assign('device_option_value', $deviceOption->offsetGet('device_option_default_value'));\n $deviceOptionsContent = $this->view->render('loops/device-option-edit.phtml');\n }\n $this->view->assign('deviceOptionsContent', $deviceOptionsContent);\n }",
"abstract public function setDeviceInfo($data);",
"function get_device_os($device)\n{\n global $config, $table_rows, $cache_os;\n\n // If $recheck sets as TRUE, verified that 'os' corresponds to the old value.\n // recheck only if old device exist in definitions\n $recheck = isset($config['os'][$device['os']]);\n\n $sysDescr = snmp_fix_string(snmp_get($device, 'sysDescr.0', '-Ovq', 'SNMPv2-MIB'));\n $sysDescr_ok = $GLOBALS['snmp_status'] || $GLOBALS['snmp_error_code'] === 1; // Allow empty response for sysDescr (not timeouts)\n $sysObjectID = snmp_get($device, 'sysObjectID.0', '-Ovqn', 'SNMPv2-MIB');\n if (strpos($sysObjectID, 'Wrong Type') !== FALSE)\n {\n // Wrong Type (should be OBJECT IDENTIFIER): \"1.3.6.1.4.1.25651.1.2\"\n list(, $sysObjectID) = explode(':', $sysObjectID);\n $sysObjectID = '.'.trim($sysObjectID, ' .\"');\n }\n\n // Cache discovery os definitions\n cache_discovery_definitions();\n $discovery_os = $GLOBALS['cache']['discovery_os'];\n $cache_os = array();\n\n $table_rows = array();\n $table_opts = array('max-table-width' => TRUE); // Set maximum table width as available columns in terminal\n $table_headers = array('%WOID%n', '');\n $table_rows[] = array('sysDescr', $sysDescr);\n $table_rows[] = array('sysObjectID', $sysObjectID);\n \tprint_cli_table($table_rows, $table_headers, NULL, $table_opts);\n //print_debug(\"Detect OS. sysDescr: '$sysDescr', sysObjectID: '$sysObjectID'\");\n\n $table_rows = array(); // Reinit\n //$table_opts = array('max-table-width' => 200);\n $table_headers = array('%WOID%n', '%WMatched definition%n', '');\n // By first check all sysObjectID\n foreach ($discovery_os['sysObjectID'] as $def => $cos)\n {\n if (match_sysObjectID($sysObjectID, $def))\n {\n // Store matched OS, but by first need check by complex discovery arrays!\n $sysObjectID_def = $def;\n $sysObjectID_os = $cos;\n break;\n }\n }\n\n if ($recheck)\n {\n $table_desc = 'Re-Detect OS matched';\n $old_os = $device['os'];\n\n if (!$sysDescr_ok && !empty($old_os))\n {\n // If sysDescr empty - return old os, because some snmp error\n print_debug(\"ERROR: sysDescr not received, OS re-check stopped.\");\n return $old_os;\n }\n\n // Recheck by complex discovery array\n // Yes, before sysObjectID, because complex more accurate and can intersect with it!\n foreach ($discovery_os['discovery'][$old_os] as $def)\n {\n if (match_discovery_os($sysObjectID, $sysDescr, $def, $device))\n {\n print_cli_table($table_rows, $table_headers, $table_desc . \" ($old_os: \".$config['os'][$old_os]['text'].'):', $table_opts);\n return $old_os;\n }\n }\n foreach ($discovery_os['discovery_network'][$old_os] as $def)\n {\n if (match_discovery_os($sysObjectID, $sysDescr, $def, $device))\n {\n print_cli_table($table_rows, $table_headers, $table_desc . \" ($old_os: \".$config['os'][$old_os]['text'].'):', $table_opts);\n return $old_os;\n }\n }\n\n // Recheck by sysObjectID\n if ($sysObjectID_os)\n {\n // If OS detected by sysObjectID just return it\n $table_rows[] = array('sysObjectID', $sysObjectID_def, $sysObjectID);\n print_cli_table($table_rows, $table_headers, $table_desc . \" ($old_os: \".$config['os'][$old_os]['text'].'):', $table_opts);\n return $sysObjectID_os;\n }\n\n // Recheck by sysDescr from definitions\n foreach ($discovery_os['sysDescr'][$old_os] as $pattern)\n {\n if (preg_match($pattern, $sysDescr))\n {\n $table_rows[] = array('sysDescr', $pattern, $sysDescr);\n print_cli_table($table_rows, $table_headers, $table_desc . \" ($old_os: \".$config['os'][$old_os]['text'].'):', $table_opts);\n return $old_os;\n }\n }\n\n // Recheck by include file (moved to end!)\n\n // Else full recheck 'os'!\n unset($os, $file);\n\n } // End recheck\n\n $table_desc = 'Detect OS matched';\n\n // Check by complex discovery arrays (except networked)\n // Yes, before sysObjectID, because complex more accurate and can intersect with it!\n foreach ($discovery_os['discovery'] as $cos => $defs)\n {\n foreach ($defs as $def)\n {\n if (match_discovery_os($sysObjectID, $sysDescr, $def, $device)) { $os = $cos; break 2; }\n }\n }\n\n // Check by sysObjectID\n if (!$os && $sysObjectID_os)\n {\n // If OS detected by sysObjectID just return it\n $os = $sysObjectID_os;\n $table_rows[] = array('sysObjectID', $sysObjectID_def, $sysObjectID);\n print_cli_table($table_rows, $table_headers, $table_desc . \" ($os: \".$config['os'][$os]['text'].'):', $table_opts);\n return $os;\n }\n\n if (!$os && $sysDescr)\n {\n // Check by sysDescr from definitions\n foreach ($discovery_os['sysDescr'] as $cos => $patterns)\n {\n foreach ($patterns as $pattern)\n {\n if (preg_match($pattern, $sysDescr))\n {\n $table_rows[] = array('sysDescr', $pattern, $sysDescr);\n $os = $cos;\n break 2;\n }\n }\n }\n }\n\n // Check by complex discovery arrays, now networked\n if (!$os)\n {\n foreach ($discovery_os['discovery_network'] as $cos => $defs)\n {\n foreach ($defs as $def)\n {\n if (match_discovery_os($sysObjectID, $sysDescr, $def, $device)) { $os = $cos; break 2; }\n }\n }\n }\n\n if (!$os)\n {\n $path = $config['install_dir'] . '/includes/discovery/os';\n $sysObjectId = $sysObjectID; // old files use wrong variable name\n\n // Recheck first\n $recheck_file = FALSE;\n if ($recheck && $old_os)\n {\n if (is_file($path . \"/$old_os.inc.php\"))\n {\n $recheck_file = $path . \"/$old_os.inc.php\";\n }\n else if (isset($config['os'][$old_os]['discovery_os']) &&\n is_file($path . '/'.$config['os'][$old_os]['discovery_os'] . '.inc.php'))\n {\n $recheck_file = $path . '/'.$config['os'][$old_os]['discovery_os'] . '.inc.php';\n }\n\n if ($recheck_file)\n {\n print_debug(\"Including $recheck_file\");\n\n $sysObjectId = $sysObjectID; // old files use wrong variable name\n include($recheck_file);\n\n if ($os && $os == $old_os)\n {\n $table_rows[] = array('file', $file, '');\n print_cli_table($table_rows, $table_headers, $table_desc . \" ($old_os: \".$config['os'][$old_os]['text'].'):', $table_opts);\n return $old_os;\n }\n }\n }\n\n // Check all other by include file\n $dir_handle = @opendir($path) or die(\"Unable to open $path\");\n while ($file = readdir($dir_handle))\n {\n if (preg_match('/\\.inc\\.php$/', $file) && $file !== $recheck_file)\n {\n print_debug(\"Including $file\");\n\n include($path . '/' . $file);\n\n if ($os)\n {\n $table_rows[] = array('file', $file, '');\n break; // Stop while if os detected\n }\n }\n }\n closedir($dir_handle);\n }\n\n if ($os)\n {\n print_cli_table($table_rows, $table_headers, $table_desc . \" ($os: \".$config['os'][$os]['text'].'):', $table_opts);\n return $os;\n } else {\n return 'generic';\n }\n}",
"function getDeviceDataUsingRoomID($con,$deviceName,$roomID,$userID){\n if(hasOwnerShipUsingRoomID($con,$deviceName,$roomID,$userID)){\n $dv = new Device;\n $sql=\"SELECT * FROM room_device WHERE room_id='$roomID' AND uid='$userID' AND device_name='$deviceName'\";\n $dv->getData($con,$sql);\n return $dv;\n }else{\n $dv=(object) null;\n $dv->error=false;\n $hwSeriesList=getHardwareListUsingRoomID($con,$roomID,$userID);\n for($i=0;$i<count($hwSeriesList);$i++){\n $hwSeries=$hwSeriesList[$i];\n $sql=\"SELECT room_device.id as `dvID`, room_device.device_name as `dvName`, room_device.port as `dvPort`, room_device.device_image as `dvImg`,\n room_device.hid as `homeID`, room_device.room_id as `roomID`, room_device.hw_id as `hwID`, room_device.uid as `userID`, room_device.status as `status`\n FROM room_device\n INNER JOIN hardware ON hardware.id=room_device.hw_id\n INNER JOIN allowed_user ON allowed_user.serial_no=hardware.series\n INNER JOIN product_serial ON product_serial.serial_no=allowed_user.serial_no\n INNER JOIN sold_product ON sold_product.serial_id=product_serial.id\n WHERE allowed_user.member_id='$userID' AND allowed_user.serial_no='$hwSeries' AND room_device.device_name='$deviceName'\";\n $result=mysqli_query($con,$sql);\n if($result){\n $num=mysqli_num_rows($result);\n if($num==1){\n $row=mysqli_fetch_array($result);\n $dv=(object) null;\n $dv->error=false;\n $dv->userID=$row['userID'];\n $dv->homeID=$row['homeID'];\n $dv->roomID=$row['roomID'];\n $dv->hwID=$row['hwID'];\n $dv->dvID=$row['dvID'];\n $dv->dvName=$row['dvName'];\n $dv->dvPort=$row['dvPort'];\n $dv->dvImg=$row['dvImg'];\n $dv->dvStatus=$row['status'];\n $dv->error=false;\n $dv->errorMessage=\"null\";\n return $dv;\n }\n }\n }\n $dv->error=true;\n $dv->errorMessage=\"Device does not exists.\";\n return $dv;\n }\n}",
"public function device(){\n \t\treturn array(\n \t\t 'name' => \"\", // device name\n \t\t 'slug' => \"\", // device slug\n \t\t 'width' => \"\", // device width\n \t\t 'height' => \"\", // device height\n \t\t 'type' => \"\" // mobile or tablet\n \t\t);\n\t\t}",
"public function renderInfoDevice()\n {\n $name = array();\n \n if ($this->device_family)\n {\n if ($this->device_version)\n {\n if ('-' == substr($this->device_version, 0, 1))\n {\n return $this->device_family . $this->device_version;\n }\n \n return $this->device_family . ' ' . $this->device_version;\n }\n \n return $this->device_family;\n }\n \n if ($this->device_version)\n {\n return $this->device_version;\n }\n \n return '';\n }",
"public function render_screen_options()\n {\n }",
"function get_DeviceConfiguration () {\n\t\treturn array (\n\t // -------------------------------------------------------------------------------------------------------\n\t\t\tc_Device_YamahaMain \t=> array(\n\t\t\t\tc_Control_DevicePower \t=> array(\n\t\t\t\t\tc_Property_Name \t\t\t=> 'Power',\n\t\t\t\t\tc_Property_PowerDelay\t\t=> 150,\n\t\t\t\t\tc_Property_CommPower\t\t=> array(c_Comm_Yamaha, 'PWR', '?'),\n\t\t\t\t\tc_Property_CommPowerOff\t\t=> array(c_Comm_Yamaha, 'PWR', 'OFF'),\n\t\t\t\t\tc_Property_CommPowerOn\t\t=> array(c_Comm_Yamaha, 'PWR', 'ON'),\n\t\t\t\t),\n\t\t\t\tc_Control_Volume\t\t=> array(\n\t\t\t\t\tc_Property_Name\t\t\t\t=> 'Volume',\n\t\t\t\t\tc_Property_CommVol\t\t\t=> array(c_Comm_Yamaha, 'VOL', c_Template_Value),\n\t\t\t\t\tc_Property_MinValue\t\t\t=> -60,\n\t\t\t\t\tc_Property_MaxValue\t\t\t=> -15,\n\t\t\t\t),\n\t\t\t\tc_Control_RemoteVolume \t=> array(\n\t\t\t\t\tc_Property_Name \t\t=> 'Volume Control',\n\t\t\t\t\tc_Property_Names \t=> array('src=\"../user/Entertainment/Remote_YamahaVolume.php\" height=38px'),\n\t\t\t\t),\n\t\t\t\tc_Control_RemoteSource\t=> array(\n\t\t\t\t\tc_Property_Name \t\t\t=> 'Source Control',\n\t\t\t\t\tc_Property_Names \t\t=> array('src=\"../user/Entertainment/Remote_YamahaEmpty.php\" height=10px'),\n\t\t\t\t),\n\t\t\t\tc_Control_Muting \t\t\t=> array(\n\t\t\t\t\tc_Property_Name \t\t\t=> 'Mute',\n\t\t\t\t\tc_Property_CommMuteOn \t\t=> array(c_Comm_Yamaha, 'MUTE', 'ON'),\n\t\t\t\t\tc_Property_CommMuteOff \t\t=> array(c_Comm_Yamaha, 'MUTE', 'OFF'),\n\t\t\t\t),\n\t\t\t),\n\t\t\t// -------------------------------------------------------------------------------------------------------\n\t\t\tc_Device_YamahaZone2 \t=> array(\n\t\t\t\tc_Control_DevicePower \t=> array(\n\t\t\t\t\tc_Property_Name \t\t\t=> 'Power',\n\t\t\t\t\tc_Property_PowerDelay\t\t=> 150,\n\t\t\t\t\tc_Property_CommPowerOff\t=> array(c_Comm_Yamaha, 'PWR', 'OFF', 'ZONE2'),\n\t\t\t\t\tc_Property_CommPowerOn\t=> array(c_Comm_Yamaha, 'PWR', 'ON', 'ZONE2'),\n\t\t\t\t),\n\t\t\t\tc_Control_Volume\t\t=> array(\n\t\t\t\t\tc_Property_Name\t\t\t\t=> 'Volume',\n\t\t\t\t\tc_Property_CommVol\t\t\t=> array(c_Comm_Yamaha, 'VOL', c_Template_Value, 'ZONE2'),\n\t\t\t\t\tc_Property_MinValue\t\t\t=> -20,\n\t\t\t\t\tc_Property_MaxValue\t\t\t=> 10,\n\t\t\t\t),\n\t\t\t\tc_Control_Muting \t\t\t=> array(\n\t\t\t\t\tc_Property_Name \t\t\t=> 'Mute',\n\t\t\t\t\tc_Property_CommMuteOn \t\t=> array(c_Comm_Yamaha, 'MUTE', 'ON', 'ZONE2'),\n\t\t\t\t\tc_Property_CommMuteOff \t\t=> array(c_Comm_Yamaha, 'MUTE', 'OFF', 'ZONE2'),\n\t\t\t\t),\n\t\t\t),\n\t // -------------------------------------------------------------------------------------------------------\n\t\t\tc_Device_Yamaha_NetRadio \t=> array(\n\t\t\t\tc_Property_PowerDelay\t=> c_Device_YamahaMain,\n\t\t\t\tc_Control_RemoteSource\t=> array(\n\t\t\t\t\tc_Property_Name \t\t\t=> 'Source Control',\n\t\t\t\t\tc_Property_Names \t\t=> array('src=\"../user/Entertainment/Remote_YamahaNetRadio.php\" height=150px'),\n\t\t\t\t),\n\t\t\t\tc_Control_iRemoteSource \t=> array(\n\t\t\t\t\tc_Property_Name \t\t\t=> 'iPhone Source Control',\n\t\t\t\t\tc_Property_Names \t\t=> array('src=\"../user/Entertainment/iRemote_YamahaNetRadio.php\"'),\n\t\t\t\t),\n\t\t\t\tc_Control_Program \t=> array(\n\t\t\t\t\tc_Property_Name \t\t\t=> 'Program',\n\t\t\t\t\tc_Property_CommPrg\t\t\t=> array(c_Comm_Yamaha, 'CHAN', c_Template_Code),\n\t\t\t\t\tc_Property_CommPrgPrev\t\t=> array(c_Comm_Yamaha, 'CHAN', 'prev'),\n\t\t\t\t\tc_Property_CommPrgNext\t\t=> array(c_Comm_Yamaha, 'CHAN', 'next'),\n\t\t\t\t\tc_Property_Codes\t\t\t=> array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13'),\n\t\t\t\t\tc_Property_Names\t\t\t=> array('NDR2', 'Technobase FM', '104.6 RTL', 'The End 107.9FM', 'NRJ Berlin', 'Fritz','1.fm Top 40','KISS FM 102.7','Ambient Meditation Music','Calm Radio - Sleep','Nirvana Radio Relaxation','Chroma Radio Nature','Healing Music Radio'),\n\t\t\t\t),\n\t\t\t),\n\t\t\t// -------------------------------------------------------------------------------------------------------\n\t\t\tc_Device_SubwooferBack \t=> array(\n\t\t\t\tc_Control_DevicePower \t=> array(\n\t\t\t\t\tc_Property_Name \t\t\t=> 'Power',\n\t\t\t\t\tc_Property_PowerDelay\t\t=> 150,\n\t\t\t\t\tc_Property_CommPowerOff\t\t=> array(c_Comm_HomeMaticSwitch, c_Device_SubwooferBack_ID, 'PWR', 'OFF'),\n\t\t\t\t\tc_Property_CommPowerOn\t\t=> array(c_Comm_HomeMaticSwitch, c_Device_SubwooferBack_ID, 'PWR', 'ON'),\n\t\t\t\t),\n\t\t\t),\n\t\t\t// -------------------------------------------------------------------------------------------------------\n\t\t\tc_Device_SamsungTV \t\t=> array(\n\t\t\t\tc_Control_DevicePower \t=> array(\n\t\t\t\t\tc_Property_Name \t\t\t=> 'Power',\n\t\t\t\t\tc_Property_PowerDelay\t\t=>150,\n\t\t\t\t\tc_Property_CommPowerOn\t\t=> array(c_Comm_NetIO230, c_Device_SamsungTV_ID, 'PWR', 'ON'),\n\t\t\t\t\tc_Property_CommPowerOff\t\t=> array(c_Comm_NetIO230, c_Device_SamsungTV_ID, 'PWR', 'OFF'),\n\t\t\t\t),\n\t\t\t),\n\t // -------------------------------------------------------------------------------------------------------\n\t\t);\n\t}",
"public function printermodelsAction ()\n {\n $manufacturerId = $this->getParam('manufacturerid', false);\n $jsonResponse = new stdClass();\n $jsonResponse->rows = [];\n $master_devicesTable = new MasterDeviceDbTable();\n $result = $master_devicesTable->fetchAll(['manufacturerId = ?' => $manufacturerId], 'modelName');\n\n if (count($result) > 0)\n {\n foreach ($result as $row)\n {\n $jsonResponse->rows[] = ['id' => $row['id'], 'cell' => [\n $row ['id'],\n ucwords(strtolower($row ['modelName']))\n\n ]];\n }\n }\n $this->sendJson($jsonResponse);\n }",
"function add_vendor_specific_info ( $entry, $form, &$data, &$field_type) {\n //cap_set corresponds to binary number with a 1 in each position where a checkbox is checked\n $cap_set = 0;\n for ($cap_num = 1; $cap_num <= 9; $cap_num++) {\n $entry_num = \"10.{$cap_num}\";\n if($entry[$entry_num] != '') {\n $cap_set = $cap_set | (1<<($cap_num-1));\n }\n }\n\n $data = array_merge($data, array('capability_extra' => $entry['11'], 'capability' => $cap_set, 'professional' => $entry['15']));\n $field_type[] = '%d';\n $field_type[] = '%s';\n $field_type[] = '%d';\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the newest modification time of a file in $path, recursively | protected function getNewestModTime($path, $maxDepth = 5) {
static $level = 0;
$level++;
// check if any files in the directory are newer than maxAge
$newest = filemtime($path);
foreach(new \DirectoryIterator($path) as $file) {
if($file->isDot()) continue;
$mtime = $file->getMTime();
if($mtime > $newest) $newest = $mtime;
if($level < $maxDepth && $file->isDir()) {
$mtime = $this->getNewestModTime($file->getPathname(), $maxDepth);
if($mtime > $newest) $newest = $mtime;
}
}
$level--;
return $newest;
} | [
"public function lastModificationTime($path);",
"function get_timestamp($path) {\n\tif( file_exists($path) ) {\n\t\treturn filemtime($path);\n\t}\n}",
"public function getFileModificationTime($filepath);",
"function Java_java_io_WinNTFileSystem_getLastModifiedTime($file) {\n\tif (!file_exists(\"$file\")) {\n\t\treturn filemtime(\".\");\n\t\tvar_dump(\"$file\");\n\t\tvar_dump(\"Java_java_io_WinNTFileSystem_getLastModifiedTime\");\n\t\tvar_dump(\"file does not exist\");\n\t\texit;\n\t}\n\treturn filemtime(\"$file\");\n}",
"function lastModif(){\n \t$mod_time = stat($this->directory);\n \treturn date('Y-m-d',$mod_time['mtime']);\n }",
"public function fileModified($path)\n {\n return Carbon::createFromTimestamp(\n substr($this->disk->lastModified($path), 0, 10)\n )->toDateTimeString();\n }",
"public function getLastModified() \n {\n $obj = Directory::getObject($this->path);\n return strtotime($obj[\"last_modified\"]);\n }",
"function get_filemtime()\n {\n if (file_exists($this->cache_path))\n {\n if ($mtime = @filemtime($this->cache_path))\n {\n\t\t\t\t//return $mtime;\n\n\t\t\t\t$time = gmmktime(\n gmdate(\"H\", $mtime),\n gmdate(\"i\", $mtime),\n gmdate(\"s\", $mtime),\n gmdate(\"m\", $mtime),\n gmdate(\"d\", $mtime),\n gmdate(\"Y\", $mtime)\n );\n return $time;\n\n }\n }\n\n return;\n }",
"public function getLastModified()\n {\n return filemtime($this->path);\n }",
"function jz_filemtime($file) {\n $mdate = filemtime($file);\n if ($mdate > ($curtime = time())) {\n if (@touch($file) === false) {\n $mdate = $curtime - ($mdate - $curtime);\n } else {\n $mdate = filemtime($file);\n }\n }\n return $mdate;\n}",
"public function getLastModificationTime(string $filename);",
"private function addModifiedTimes($path)\n {\n if (is_file($path)) {\n $stat = stat($path);\n $this->modifiedTimes[realpath($path)] = $stat['mtime'];\n\n return;\n }\n\n $directoryIterator = new \\RecursiveDirectoryIterator(realpath($path));\n $files = new \\RecursiveIteratorIterator($directoryIterator);\n\n // Iterate over instances of \\SplFileObject\n foreach ($files as $file) {\n $modifiedTime = $file->getMTime();\n $this->modifiedTimes[$file->getRealPath()] = $modifiedTime;\n }\n }",
"public function getLastModifiedTime() : int\n {\n return filemtime( $this->path );\n }",
"public function getLastModified() {\n\n $obj = Sabre_DAV_DOCMGR_Directory::getObj($this->path);\n\n return strtotime($obj[\"last_modified\"]);\n \n }",
"public function getLastmodified();",
"public function getTimestamp($path){}",
"public function getLastModifiedTime(): int\n {\n return $this->getDirectoryLastModifiedTime($this->path);\n }",
"public function getLastModifiedFile() {\n $loader = new JavaScriptLoader();\n $loader->addNameSpaceFiles();\n $files = $loader->getAllFiles();\n $mod = array();\n foreach($files as $file) {\n $mod[] = filemtime($file);\n }\n asort($mod);\n return end($mod);\n }",
"public static function getCorrectModificationTime($file_path)\n {\n $time = \\filemtime($file_path);\n $isDST = (date('I', $time) == 1);\n $systemDST = (date('I') == 1);\n $adjustment = 0;\n if ($isDST == false && $systemDST == true)\n {\n $adjustment = 3600;\n }\n else if ($isDST == true && $systemDST == false)\n {\n $adjustment = -3600;\n }\n else\n {\n $adjustment = 0;\n }\n\n return ($time + $adjustment);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Searches a button with the specified name on the page. If the button is present, returns true; otherwise false. | public function buttonIsPresent($button)
{
return $this->controlIsPresent('button', $button);
} | [
"protected function findButtonByName( $button ) {\n\t\tif ( ! is_null( $element = $this->find( \"input[type=submit][name='{$button}']\" ) ) ||\n\t\t\t! is_null( $element = $this->find( \"input[type=button][value='{$button}']\" ) ) ||\n\t\t\t! is_null( $element = $this->find( \"button[name='{$button}']\" ) ) ) {\n\t\t\treturn $element;\n\t\t}\n\t}",
"protected function _matchButton($html) {\n return strpos($html, '<button') !== FALSE || strpos($html, 'type=\"submit\"') !== FALSE;\n }",
"public function findButton($name)\n\t{\n\t\tif (array_key_exists($name, $this->buttons))\n\t\t{\n\t\t\treturn $this->buttons[$name];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new \\Exception('Menu item not found', 500);\n\t\t}\n\t}",
"protected function findButtonByText($button)\n {\n foreach ($this->all('button') as $element) {\n if (Str::contains($element->getText(), $button)) {\n return $element;\n }\n }\n }",
"public function buttonExists($buttonName)\n {\n return $this->getChildren()->controlExists($buttonName, 'ButtonModelBase');\n }",
"abstract public function isInButtonScope( $name );",
"function IsButton(){}",
"public function findButton($locator) {\n return $this->getSession()->getPage()->findButton($locator);\n }",
"public function isButton()\n {\n return true;\n }",
"protected function existsPage($page): bool\n {\n return $this->buttons->where('page', $page)->first() !== null;\n }",
"public function isAnyButtonAttached() {\n\t\t$form = $this->control->lookup('Nette\\Forms\\Container');\n\t\t$buttonName = $this->formatButtonName($this->control->getName());\n\t\t$button = $form->getComponent($buttonName, false);\n\t\treturn $button !== null;\n\t}",
"public function getHasButtons()\n\t{\n\t\t$params = $this->getParams();\n\t\tif ($this->canAdd() || $this->getShowFilters() || $this->getAdvancedSearchLink() || $this->canGroupBy() || $this->canCSVExport() || $this->canCSVImport() || $params->get('rss') || $params->get('pdf') || $this->canEmpty()) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getButton(string $name): Button;",
"public function assertButtonExist($button)\n {\n $this->assertSession()->buttonExists($button);\n }",
"function is_button_supported($button){\r\r\n\t \t// return\r\r\n\t \treturn (in_array($button, $this->supported_buttons)) ? true : false;\r\r\n\t }",
"public function testSeeButtons(){\n $this->drupalLogin($this->homeUser);\n $this->drupalGet('connect-four');\n $this->assertSession()->buttonExists('Play');\n\n $this->click('input[type=\"submit\"]:first-child');\n $this->assertSession()->buttonNotExists('Play');\n\n $this->drupalLogin($this->awayUser);\n $this->drupalGet('connect-four');\n $this->assertSession()->buttonExists('Play');\n }",
"public function findButton($locator)\n {\n return parent::findButton($this->parseAlias($locator));\n }",
"public function buttonByUsername($username) {\n $usernames = array(\n 'admin' => true,\n 'default' => true,\n 'default_temp' => true\n );\n return !isset($usernames[$username]);\n }",
"function hasSubmitLabel($label) {\n foreach ($this->_buttons as $button) {\n if ($button->getLabel() == $label) {\n return true;\n }\n }\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get previous login at | public function getPreviousLoginAt()
{
return $this->previousLoginAt;
} | [
"public function previousLoginAt(): ?string\n {\n return optional($this->authentications()->skip(1)->first())->logged_in_at;\n }",
"public function previousLoginAt()\n {\n return optional($this->logins()->skip(1)->first())->created_at;\n }",
"public function getLastLogin()\n {\n }",
"public function getLastLogin()\n {\n return $this->get(self::_LAST_LOGIN);\n }",
"public function getLastLogin() {\n\t\treturn $this->lastLogin;\n\t}",
"public function getLastLogin() \r\n {\r\n return ifset($_SESSION, self::LAST_LOGIN, $this->lastlogin); \r\n }",
"public function getLastLogin()\n {\n return $this->last_login;\n }",
"public function getLastlogin() {\n $lastLogin = parent::getLastlogin();\n\n if (intval($lastLogin) == 0) {\n return $this->getCreated();\n }\n return $lastLogin;\n }",
"function get_user_login_timestamp()\n{\n\tif(is_logged_in())\n\t\treturn \"?\".Yii::app()->session['login_timestamp'];\n\telse\n\t\treturn \"\";\n}",
"public function lastLogin()\n {\n return DB::last('logins','user_id',Auth::id())['created_at'];\n // TODO: Implement lastLogin() method.\n }",
"public static function previousUrl()\n {\n /** @var \\Illuminate\\Session\\Store $instance */\n return $instance->previousUrl();\n }",
"public function get_last_login()\n {\n return $this->last_login;\n }",
"public function get_olduserid()\n {\n return $_SESSION['auth']['olduserid'];\n }",
"public function getLastLogin() {\n return $this->row['lastLogin'];\n }",
"private function popLoginReturnUrl()\n {\n $loginUrl = Yii::$app->session[$this->sessionReturnUrlParam];\n Yii::$app->session->remove($this->sessionReturnUrlParam);\n return $loginUrl;\n }",
"protected function storePreviousUrl()\n {\n if (!Str::contains($url = URL::previous(), ['profile/edit', 'otp-confirm']) & Str::contains($url, url('/'))) {\n session(['previousProfileUrl' => $url]);\n }\n }",
"public function login_form() {\r\n\t\t$template =& Theme_My_Login::get_object()->get_active_instance();\r\n\t\techo wp_original_referer_field( false, $template->get_option( 'instance' ) ? 'current' : 'previous' ) . \"\\n\";\r\n\t}",
"public function get_last_login(){\n\t\tif($this->login_status()){\n\t\t\t\n\t\t\t$params = array($this->account_id);\n\t\t\t$query = $this->db->query(\"SELECT * FROM `account_session_log` WHERE `account_id` = ? ORDER BY `visit_time` DESC LIMIT 1\",$params);\n\t\t\t\n\t\t\tif($query && !$this->db->error()){\n\t\t\t\t$response = $this->db->fetch_array();\n\t\t\t\t$response = $response[0];\n\t\t\t}\n\t\t\t\n\t\t\treturn $response;\n\t\t}else{\n\t\t\tthrow new Exception('User not logged in.');\n\t\t}\n\t}",
"public function getLastLogin(){\n\t\treturn convertTime($this->lastlogindate);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears plaintext version of key from memory. | public function clearMemory()
{
if (extension_loaded('sodium')) {
sodium_memzero($this->plaintextKey);
} else {
// override it with random data first to make sure it's unrecoverable
$this->plaintextKey = random_bytes(20);
$this->plaintextKey = null;
}
} | [
"public function clearKey($key);",
"public function clear($key);",
"function gnupg_cleardecryptkeys($identifier){}",
"public function clearPersistentData($key);",
"public function resetKey()\n {\n $this->key = $this->original;\n }",
"function clear_cache_local_key($clear = false) {\n\t\tswitch (strtolower( $this->local_key_storage )) {\n\t\tcase 'database': {\n\t\t\t\t$this->db_write_local_key( '' );\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tcase 'filesystem': {\n\t\t\t\t$this->write_local_key( '', '' . $this->local_key_path . $this->local_key_name );\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tdefault: {\n\t\t\t\t$this->errors = $this->status_messages['invalid_local_key_storage'];\n\t\t\t}\n\t\t}\n\n\t\treturn ;\n\t}",
"function _clearBuffers()\r\n {\r\n $this->enbuffer = $this->debuffer = array('ciphertext' => '', 'xor' => '', 'pos' => 0, 'enmcrypt_init' => true);\r\n\r\n // mcrypt's handling of invalid's $iv:\r\n // $this->encryptIV = $this->decryptIV = strlen($this->iv) == $this->block_size ? $this->iv : str_repeat(\"\\0\", $this->block_size);\r\n $this->encryptIV = $this->decryptIV = str_pad(substr($this->iv, 0, $this->block_size), $this->block_size, \"\\0\");\r\n\r\n if (!$this->skip_key_adjustment) {\r\n $this->key = str_pad(substr($this->key, 0, $this->key_length), $this->key_length, \"\\0\");\r\n }\r\n }",
"public function erase($key);",
"abstract protected function Clear_Persistent_Data($Key);",
"public function clear()\n {\n unset($this->secretKeys);\n $this->secretKeys = array();\n }",
"public function clearKey($key) {\n $this->_registry->clearKey($key);\n }",
"public function reset()\n {\n unset($_SESSION['aesKey']);\n $this->createSessionKeys(); \n }",
"public function clear_data()\n\t{\n\t\tarray_fill_keys($this->data, '');\n\t\tarray_fill_keys($this->data_original, '');\n\t}",
"public function clear_public_key($key){\n\t\t$params = array($key);\n\t\treturn $this->db->query(\"DELETE FROM `account_public_keys` WHERE `key` = ?\",$params);\n\t}",
"public function unsetData(string $key);",
"public function __destruct()\r\n {\r\n Util::wipe($this->key);\r\n }",
"public function clearIdentity()\n {\n $this->storage[$this->storageKey]=[];\n }",
"function clearFormKey(){\n\t\t // session genereate key\n\t\t$this->formSession['key'] = null;\n\t}",
"public function clear(string $key)\n {\n $this->resetAttempts($key);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the peruser login flood control for a given serialization format. | public function doTestPerUserLoginFloodControl($format): void {
$database = \Drupal::database();
foreach ([TRUE, FALSE] as $uid_only_setting) {
$this->config('user.flood')
// Set a high global limit out so that it is not relevant in the test.
->set('ip_limit', 4000)
->set('user_limit', 3)
->set('uid_only', $uid_only_setting)
->save();
$user1 = $this->drupalCreateUser([]);
$incorrect_user1 = clone $user1;
$incorrect_user1->passRaw .= 'incorrect';
$user2 = $this->drupalCreateUser([]);
// Try 2 failed logins.
for ($i = 0; $i < 2; $i++) {
$response = $this->loginRequest($incorrect_user1->getAccountName(), $incorrect_user1->passRaw, $format);
$this->assertHttpResponseWithMessage($response, 400, 'Sorry, unrecognized username or password.', $format);
}
// A successful login will reset the per-user flood control count.
$response = $this->loginRequest($user1->getAccountName(), $user1->passRaw, $format);
$result_data = $this->serializer->decode($response->getBody(), $format);
$this->logoutRequest($format, $result_data['logout_token']);
// Try 3 failed logins for user 1, they will not trigger flood control.
for ($i = 0; $i < 3; $i++) {
$response = $this->loginRequest($incorrect_user1->getAccountName(), $incorrect_user1->passRaw, $format);
$this->assertHttpResponseWithMessage($response, 400, 'Sorry, unrecognized username or password.', $format);
}
// Try one successful attempt for user 2, it should not trigger any
// flood control.
$this->drupalLogin($user2);
$this->drupalLogout();
// Try one more attempt for user 1, it should be rejected, even if the
// correct password has been used.
$response = $this->loginRequest($user1->getAccountName(), $user1->passRaw, $format);
// Depending on the uid_only setting the error message will be different.
if ($uid_only_setting) {
$expected_message = 'There have been more than 3 failed login attempts for this account. It is temporarily blocked. Try again later or request a new password.';
$expected_log = 'Flood control blocked login attempt for uid %uid';
}
else {
$expected_message = 'Too many failed login attempts from your IP address. This IP address is temporarily blocked.';
$expected_log = 'Flood control blocked login attempt for uid %uid from %ip';
}
$this->assertHttpResponseWithMessage($response, 403, $expected_message, $format);
$last_log = $database->select('watchdog', 'w')
->fields('w', ['message'])
->condition('type', 'user')
->orderBy('wid', 'DESC')
->range(0, 1)
->execute()
->fetchField();
$this->assertEquals($expected_log, $last_log, 'A watchdog message was logged for the login attempt blocked by flood control per user.');
}
} | [
"public function doTestGlobalLoginFloodControl(string $format): void {\n $database = \\Drupal::database();\n $this->config('user.flood')\n ->set('ip_limit', 2)\n // Set a high per-user limit out so that it is not relevant in the test.\n ->set('user_limit', 4000)\n ->save();\n\n $user = $this->drupalCreateUser([]);\n $incorrect_user = clone $user;\n $incorrect_user->passRaw .= 'incorrect';\n\n // Try 2 failed logins.\n for ($i = 0; $i < 2; $i++) {\n $response = $this->loginRequest($incorrect_user->getAccountName(), $incorrect_user->passRaw, $format);\n $this->assertEquals('400', $response->getStatusCode());\n }\n\n // IP limit has reached to its limit. Even valid user credentials will fail.\n $response = $this->loginRequest($user->getAccountName(), $user->passRaw, $format);\n $this->assertHttpResponseWithMessage($response, '403', 'Access is blocked because of IP based flood prevention.', $format);\n $last_log = $database->select('watchdog', 'w')\n ->fields('w', ['message'])\n ->condition('type', 'user')\n ->orderBy('wid', 'DESC')\n ->range(0, 1)\n ->execute()\n ->fetchField();\n $this->assertEquals('Flood control blocked login attempt from %ip', $last_log, 'A watchdog message was logged for the login attempt blocked by flood control per IP.');\n }",
"protected function doTestLogin($format) {\n $client = \\Drupal::httpClient();\n // Create new user for each iteration to reset flood.\n // Grant the user administer users permissions to they can see the\n // 'roles' field.\n $account = $this->drupalCreateUser(['administer users']);\n $name = $account->getAccountName();\n $pass = $account->passRaw;\n\n $login_status_url = $this->getLoginStatusUrlString($format);\n $response = $client->get($login_status_url);\n $this->assertHttpResponse($response, 200, UserAuthenticationController::LOGGED_OUT);\n\n // Flooded.\n $this->config('user.flood')\n ->set('user_limit', 3)\n ->save();\n\n $response = $this->loginRequest($name, 'wrong-pass', $format);\n $this->assertHttpResponseWithMessage($response, 400, 'Sorry, unrecognized username or password.', $format);\n\n $response = $this->loginRequest($name, 'wrong-pass', $format);\n $this->assertHttpResponseWithMessage($response, 400, 'Sorry, unrecognized username or password.', $format);\n\n $response = $this->loginRequest($name, 'wrong-pass', $format);\n $this->assertHttpResponseWithMessage($response, 400, 'Sorry, unrecognized username or password.', $format);\n\n $response = $this->loginRequest($name, 'wrong-pass', $format);\n $this->assertHttpResponseWithMessage($response, 403, 'Too many failed login attempts from your IP address. This IP address is temporarily blocked.', $format);\n\n // After testing the flood control we can increase the limit.\n $this->config('user.flood')\n ->set('user_limit', 100)\n ->save();\n\n $response = $this->loginRequest(NULL, NULL, $format);\n $this->assertHttpResponseWithMessage($response, 400, 'Missing credentials.', $format);\n\n $response = $this->loginRequest(NULL, $pass, $format);\n $this->assertHttpResponseWithMessage($response, 400, 'Missing credentials.name.', $format);\n\n $response = $this->loginRequest($name, NULL, $format);\n $this->assertHttpResponseWithMessage($response, 400, 'Missing credentials.pass.', $format);\n\n // Blocked.\n $account\n ->block()\n ->save();\n\n $response = $this->loginRequest($name, $pass, $format);\n $this->assertHttpResponseWithMessage($response, 400, 'The user has not been activated or is blocked.', $format);\n\n $account\n ->activate()\n ->save();\n\n $response = $this->loginRequest($name, 'garbage', $format);\n $this->assertHttpResponseWithMessage($response, 400, 'Sorry, unrecognized username or password.', $format);\n\n $response = $this->loginRequest('garbage', $pass, $format);\n $this->assertHttpResponseWithMessage($response, 400, 'Sorry, unrecognized username or password.', $format);\n\n $response = $this->loginRequest($name, $pass, $format);\n $this->assertEquals(200, $response->getStatusCode());\n $result_data = $this->serializer->decode($response->getBody(), $format);\n $this->assertEquals($name, $result_data['current_user']['name']);\n $this->assertEquals($account->id(), $result_data['current_user']['uid']);\n $this->assertEquals($account->getRoles(), $result_data['current_user']['roles']);\n $logout_token = $result_data['logout_token'];\n\n // Logging in while already logged in results in a 403 with helpful message.\n $response = $this->loginRequest($name, $pass, $format);\n $this->assertSame(403, $response->getStatusCode());\n $this->assertSame(['message' => 'This route can only be accessed by anonymous users.'], $this->serializer->decode($response->getBody(), $format));\n\n $response = $client->get($login_status_url, ['cookies' => $this->cookies]);\n $this->assertHttpResponse($response, 200, UserAuthenticationController::LOGGED_IN);\n\n $response = $this->logoutRequest($format, $logout_token);\n $this->assertEquals(204, $response->getStatusCode());\n\n $response = $client->get($login_status_url, ['cookies' => $this->cookies]);\n $this->assertHttpResponse($response, 200, UserAuthenticationController::LOGGED_OUT);\n\n $this->resetFlood();\n }",
"function unserialize_safe($serialized) {\r\r\n // as well as if there is any ws between O and :\r\r\n if (is_string($serialized) && strpos($serialized, \"\\0\") === false) {\r\r\n if (strpos($serialized, 'O:') === false) {\r\r\n // the easy case, nothing to worry about\r\r\n // let unserialize do the job\r\r\n return @unserialize($serialized);\r\r\n } else if (!preg_match('/(^|;|{|})O:[0-9]+:\"/', $serialized)) {\r\r\n // in case we did have a string with O: in it,\r\r\n // but it was not a true serialized object\r\r\n return @unserialize($serialized);\r\r\n }\r\r\n }\r\r\n return false;\r\r\n}",
"public function testSerializationCapabilities()\n {\n $shredder = $this->getFileShredderForTesting();\n\n $tmp = serialize($shredder);\n $tmp = unserialize($tmp);\n\n $this->assertEquals($shredder, $tmp);\n $this->assertNotEmpty($shredder->getRandomGenerator());\n\n unset($tmp);\n $this->assertNotNull($shredder);\n }",
"public function testPerUserLoginFloodControl() {\n $this->config('user.flood')\n // Set a high global limit out so that it is not relevant in the test.\n ->set('ip_limit', 4000)\n ->set('user_limit', 2)\n ->save();\n\n $user = $this->drupalCreateUser([]);\n $incorrect_user = clone $user;\n $incorrect_user->pass_raw .= 'incorrect';\n $user2 = $this->drupalCreateUser([]);\n $url = Url::fromRoute('router_test.11');\n\n // Try a failed login.\n $this->basicAuthGet($url, $incorrect_user->getAccountName(), $incorrect_user->pass_raw);\n\n // A successful login will reset the per-user flood control count.\n $this->basicAuthGet($url, $user->getAccountName(), $user->pass_raw);\n $this->assertSession()->statusCodeEquals(200);\n\n // Try 2 failed logins for a user. They will trigger flood control.\n for ($i = 0; $i < 2; $i++) {\n $this->basicAuthGet($url, $incorrect_user->getAccountName(), $incorrect_user->pass_raw);\n }\n\n // Now the user account is blocked.\n $this->basicAuthGet($url, $user->getAccountName(), $user->pass_raw);\n $this->assertSession()->statusCodeEquals(403);\n\n // Try one successful attempt for a different user, it should not trigger\n // any flood control.\n $this->basicAuthGet($url, $user2->getAccountName(), $user2->pass_raw);\n $this->assertSession()->statusCodeEquals(200);\n }",
"protected function _isSerialized($data)\n {\n return preg_match(\"/a:2:\\{i:0;s:\\d+:\\\"/\", $data);\n }",
"abstract public function isSerialized($string);",
"abstract function DeserializeUser();",
"function privCheckFormat($p_level = 0)\n {\n }",
"public function testScrapePrivateProfile(): void\n {\n $porter = FixtureFactory::createPorter();\n $session = FixtureFactory::createCommunitySession($porter);\n\n $this->expectException(ParserException::class);\n $this->expectExceptionCode(ParserException::UNEXPECTED_CONTENT);\n\n $results = $porter->import(new Import(new ScrapeUserGames($session, new \\SteamID('76561197993329385'))));\n }",
"function isSerialized($data){\n\t\tif (trim($data) == \"\")\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (preg_match(\"/^(i|s|a|o|d)(.*);/si\",$data))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"function is_found_users($packet)\n {\n if(!is_array($packet))\n return false;\n if($packet[0] != $this->MRIM_CS_ANKETA_INFO)\n return false;\n list(,$status) = unpack('L1',$packet[1]);\n if($status == $this->MRIM_ANKETA_INFO_STATUS_DBERR)\n return 'database error';\n if($status == $this->MRIM_ANKETA_INFO_STATUS_NOUSER)\n return 'no users';\n if($status == $this->MRIM_ANKETA_INFO_STATUS_RATELIMERR)\n return 'time limit';\n if($status != $this->MRIM_ANKETA_INFO_STATUS_OK)\n return 'error';\n $packet[1] = substr($packet[1],4);\n list(,$fnum) = unpack('L1',$packet[1]);\n $packet[1] = substr($packet[1],4);\n list(,$rows) = unpack('L1',$packet[1]);\n $packet[1] = substr($packet[1],4);\n list(,$timestamp) = unpack('L1',$packet[1]);\n $packet[1] = substr($packet[1],4);\n for($i = 0; $i < $fnum; $i++) {\n list(,$len) = unpack('L1',$packet[1]);\n $packet[1] = substr($packet[1],4);\n $fields[] = substr($packet[1],0,$len);\n $packet[1] = substr($packet[1],$len);\n }\n while(strlen($packet[1]) > 0) {\n for($i = 0; $i < $fnum; $i++) {\n list(,$len) = unpack('L1',$packet[1]);\n $packet[1] = substr($packet[1],4);\n $value = substr($packet[1],0,$len);\n $packet[1] = substr($packet[1],$len);\n $tmp[$fields[$i]] = $value;\n }\n $status = hexdec($tmp['mrim_status']);\n if($status == $this->STATUS_OFFLINE)\n $status = 'offline';\n elseif($status == $this->STATUS_ONLINE)\n $status = 'online';\n elseif($status == $this->STATUS_AWAY)\n $status = 'away';\n elseif($status & $this->STATUS_FLAG_INVISIBLE)\n $status = 'invisible';\n elseif($status == $this->STATUS_OTHER)\n $status = 'other';\n elseif($status == $this->STATUS_UNDETERMINATED)\n $status = 'undeterminated';\n else\n $status = 'unknown';\n $tmp['mrim_status'] = $status;\n $tmp['Nickname'] = iconv('UTF-16LE','UTF-8//IGNORE',$tmp['Nickname']);\n $tmp['FirstName'] = iconv('UTF-16LE','UTF-8//IGNORE',$tmp['FirstName']);\n $tmp['LastName'] = iconv('UTF-16LE','UTF-8//IGNORE',$tmp['LastName']);\n $tmp['Location'] = iconv('UTF-16LE','UTF-8//IGNORE',$tmp['Location']);\n $tmp['status_title'] = iconv('UTF-16LE','UTF-8//IGNORE',$tmp['status_title']);\n $tmp['status_desc'] = iconv('UTF-16LE','UTF-8//IGNORE',$tmp['status_desc']);\n $ret['results'][] = $tmp;\n }\n $ret['fields_count'] = $fnum;\n $ret['max_rows'] = $rows;\n $ret['timestamp'] = $timestamp;\n return $ret;\n }",
"function testparse(){\n //$this->pwd->_users = array();\n $this->pwd->setFile($this->exp_file);\n $r = $this->pwd->load();\n\n $this->assertTrue($r);\n $this->assertEquals($GLOBALS['user'], $this->pwd->_users);\n }",
"public function testFormatPermissions() {\n // Make sure that a regular user only has access to the text formats for\n // which they were granted access.\n $fallback_format = FilterFormat::load(filter_fallback_format());\n $disallowed_format_name = $this->disallowedFormat->getPermissionName();\n $this->assertTrue($this->allowedFormat->access('use', $this->webUser), 'A regular user has access to use a text format they were granted access to.');\n $this->assertEquals(AccessResult::allowed()->addCacheContexts(['user.permissions']), $this->allowedFormat->access('use', $this->webUser, TRUE), 'A regular user has access to use a text format they were granted access to.');\n $this->assertFalse($this->disallowedFormat->access('use', $this->webUser), 'A regular user does not have access to use a text format they were not granted access to.');\n $this->assertEquals(AccessResult::neutral(\"The '$disallowed_format_name' permission is required.\")->cachePerPermissions(), $this->disallowedFormat->access('use', $this->webUser, TRUE), 'A regular user does not have access to use a text format they were not granted access to.');\n $this->assertTrue($fallback_format->access('use', $this->webUser), 'A regular user has access to use the fallback format.');\n $this->assertEquals(AccessResult::allowed(), $fallback_format->access('use', $this->webUser, TRUE), 'A regular user has access to use the fallback format.');\n\n // Perform similar checks as above, but now against the entire list of\n // available formats for this user.\n $this->assertContains($this->allowedFormat->id(), array_keys(filter_formats($this->webUser)), 'The allowed format appears in the list of available formats for a regular user.');\n $this->assertNotContains($this->disallowedFormat->id(), array_keys(filter_formats($this->webUser)), 'The disallowed format does not appear in the list of available formats for a regular user.');\n $this->assertContains(filter_fallback_format(), array_keys(filter_formats($this->webUser)), 'The fallback format appears in the list of available formats for a regular user.');\n\n // Make sure that a regular user only has permission to use the format\n // they were granted access to.\n $this->assertTrue($this->webUser->hasPermission($this->allowedFormat->getPermissionName()), 'A regular user has permission to use the allowed text format.');\n $this->assertFalse($this->webUser->hasPermission($this->disallowedFormat->getPermissionName()), 'A regular user does not have permission to use the disallowed text format.');\n\n // Make sure that the allowed format appears on the node form and that\n // the disallowed format and fallback format do not.\n $this->drupalLogin($this->webUser);\n $this->drupalGet('node/add/page');\n $this->assertSession()->optionExists('body[0][format]', $this->allowedFormat->id());\n $this->assertSession()->optionNotExists('body[0][format]', $this->disallowedFormat->id());\n $this->assertSession()->optionNotExists('body[0][format]', filter_fallback_format());\n\n // Check regular user access to the filter tips pages.\n $this->drupalGet('filter/tips/' . $this->allowedFormat->id());\n $this->assertSession()->statusCodeEquals(200);\n $this->drupalGet('filter/tips/' . $this->disallowedFormat->id());\n $this->assertSession()->statusCodeEquals(403);\n $this->drupalGet('filter/tips/' . filter_fallback_format());\n $this->assertSession()->statusCodeEquals(200);\n $this->drupalGet('filter/tips/invalid-format');\n $this->assertSession()->statusCodeEquals(404);\n\n // Check admin user access to the filter tips pages.\n $this->drupalLogin($this->adminUser);\n $this->drupalGet('filter/tips/' . $this->allowedFormat->id());\n $this->assertSession()->statusCodeEquals(200);\n $this->drupalGet('filter/tips/' . $this->disallowedFormat->id());\n $this->assertSession()->statusCodeEquals(200);\n $this->drupalGet('filter/tips/' . filter_fallback_format());\n $this->assertSession()->statusCodeEquals(200);\n $this->drupalGet('filter/tips/invalid-format');\n $this->assertSession()->statusCodeEquals(404);\n }",
"function is_serialized( $data ) {\n\t// if it isn't a string, it isn't serialized\n\tif ( ! is_string( $data ) )\n\t\treturn false;\n\t$data = trim( $data );\n \tif ( 'N;' == $data )\n\t\treturn true;\n\t$length = strlen( $data );\n\tif ( $length < 4 )\n\t\treturn false;\n\tif ( ':' !== $data[1] )\n\t\treturn false;\n\t$lastc = $data[$length-1];\n\tif ( ';' !== $lastc && '}' !== $lastc )\n\t\treturn false;\n\t$token = $data[0];\n\tswitch ( $token ) {\n\t\tcase 's' :\n\t\t\tif ( '\"' !== $data[$length-2] )\n\t\t\t\treturn false;\n\t\tcase 'a' :\n\t\tcase 'O' :\n\t\t\treturn (bool) preg_match( \"/^{$token}:[0-9]+:/s\", $data );\n\t\tcase 'b' :\n\t\tcase 'i' :\n\t\tcase 'd' :\n\t\t\treturn (bool) preg_match( \"/^{$token}:[0-9.E-]+;\\$/\", $data );\n\t}\n\treturn false;\n}",
"public function testWrongFieldsStudentLogin() {\n try {\n $invalidLoggedStudent = UserManagementController::login(\"wrongUsername\",$this->student->getJnPassword());\n $this->fail(\"The exceptional login scenario failed with wrong fields\");\n } catch (InfinityMetricsException $ime) {\n\n $errorFields = $ime->getErrorList();\n $this->assertNotNull($errorFields);\n $this->assertNotNull($errorFields[\"usernameIncorrect\"]); \n }\n try {\n $invalidLoggedJNUser = UserManagementController::login($this->student->getJnUsername(),\"wrongpassword\");\n $this->fail(\"The exceptional login scenario failed with wrong fields\");\n // $this->assertNull($invalidLoggedJNUser, \"The incorrect javaNetUser's username\\password\");\n } catch (InfinityMetricsException $ime) {\n\n $errorFields = $ime->getErrorList();\n $this->assertNotNull($errorFields);\n $this->assertNotNull($errorFields[\"passwordDoesnMatch\"]);\n }\n }",
"public function testLoadFromSerialUndecodable()\n {\n Partial::verbose();\n $this->setExpectedException('\\\\PHPerian\\\\Exception');\n $object = Partial::loadFromSerial('Undecodable String!');\n }",
"function testparse(){\n $this->pwd->setFile($this->exp_file);\n $r = $this->pwd->load();\n\n $this->assertTrue($r);\n $this->assertEquals($GLOBALS['user'], $this->pwd->_users);\n }",
"private function is_serialized( $data ){\r\n // if it isn't a string, it isn't serialized\r\n if ( !is_string( $data ) )\r\n return false;\r\n $data = trim( $data );\r\n if ( 'N;' == $data )\r\n return true;\r\n if ( !preg_match( '/^([adObis]):/', $data, $badions ) )\r\n return false;\r\n switch ( $badions[1] ) {\r\n case 'a' :\r\n case 'O' :\r\n case 's' :\r\n if ( preg_match( \"/^{$badions[1]}:[0-9]+:.*[;}]\\$/s\", $data ) )\r\n return true;\r\n break;\r\n case 'b' :\r\n case 'i' :\r\n case 'd' :\r\n if ( preg_match( \"/^{$badions[1]}:[0-9.E-]+;\\$/\", $data ) )\r\n return true;\r\n break;\r\n }\r\n return false;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets record with uid = $uid from $table You can set $field to a list of fields (default is '') Additional WHERE clauses can be added by $where (fx. ' AND blabla = 1') Will automatically check if records has been deleted and if so, not return anything. $table must be found in $GLOBALS['TCA'] | static public function getRecord($table, $uid, $fields = '*', $where = '', $useDeleteClause = TRUE) {
if ($table=="tx_templavoila_tmplobj" && self::isFluidTemplateObjectsFeatureEnabled()) {
$toRepo = t3lib_div::makeInstance('tx_templavoila_templateRepository'); /** @var $toRepo tx_templavoila_templateRepository */
$to = $toRepo->getTemplateByUid($uid, TRUE); /** @var $to tx_templavoila_template */
if ($to) {
return $to->getRow();
}
}
return t3lib_BEfunc::getRecord($table, $uid, $fields, $where, $useDeleteClause);
} | [
"public function retrieveRecord($table, $field, $value){\n $sql = \"SELECT * FROM $table WHERE $field = ?\";\n $this->queryDB($sql, [$value], \"SELECT\");\n }",
"function getRecord($table,$chkfield,$id=0,$format=MYSQL_BOTH)\n\t{\n\t\t$ret=0;\n\t\tif($table)\n\t\t{\n\t\t\t$where=$this->WhereClause($chkfield,$id);\n\t\t\tif(strlen($where))\n\t\t\t{\n\t\t\t\t$sql=\"select * from $table where $where\";\n // debug(\"sql\",$sql);\n\t\t\t\t$qt=$this->query($sql);\n\t\t\t\tif($qt)\n\t\t\t\t{\n\t\t\t\t\t$ret=$this->getRow($format);\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}",
"function get_field_where($table, $field, $where){\n\t$result = do_select(\"SELECT $field FROM $table WHERE $where\");\n\tif ($result == 0){ \n\t\treturn false;\n\t}else{\n\t\treturn $result[1][\"$field\"];\n\t}\n}",
"function getSpecificFieldFromAnyTable($table, $field, $id) {\n $getFieldValue = $this->CI->manageCommonTaskModel->getRecord($table, $field, array('id' => $id));\n return $getFieldValue[$field];\n }",
"function returnSingleDetail($dbConnect,$uid, $uidField, $table, $field)\n{\n\t$sql =\"SELECT $field from $table WHERE $uidField = $uid \";\n\t$smt = $dbConnect->prepare($sql);\n\tif ($smt->execute())\n\t{\n while ($rows = $smt->fetch(PDO::FETCH_OBJ))\n {\n\t\t$data= $rows->$field;\n\t\treturn $data;\n }\n\t}\n}",
"public function getRecord($tableName, $uid, $options = [])\n {\n if (!is_array($options)) {\n $options = [];\n }\n $options['where'] = 'uid='.intval($uid);\n if (!is_array($GLOBALS['TCA']) || !array_key_exists($tableName, $GLOBALS['TCA'])) {\n $options['enablefieldsoff'] = 1;\n }\n $result = $this->doSelect('*', $tableName, $options);\n\n return count($result) > 0 ? $result[0] : [];\n }",
"public function getRecordByField($field=null,$value=null)\n {\n\t $status = false;\n\t \n\t if ( (is_null($field)) && (is_null($value)) )\n\t {\n\t\t return $status;\n\t }\n\t \n\t $fields = $this->setFields(false); // Do not get join fields\n\t \n\t if (isset($fields[$field]))\n\t {\n\t\t $table = $this->options['TABLE_NAME'];\t\n\t\t\t$pairs = array( $field => $value );\t\n\t\t\t$data = $this->selectByPairs($pairs,null,false);\n\t\t\t\n\t\t\tif ($data)\n\t\t\t{\n\t\t\t\t$this->addValues_Data($data);\n\t\t\t\t$status = true;\n\t\t\t}\n\t }\n\t\t\n\t\treturn $status;\n }",
"function getFieldsFromAnyTable($table, $fields, $where) {\n $resultArray = $this->CI->manageCommonTaskModel->getRecord($table, $fields, $where);\n return $resultArray;\n }",
"function selectRecord($field, $value, $tableName, $data) {\n\t\t$q = \"SELECT * FROM `\" . $tableName . \"` WHERE `\" . $field . \"` = '\" . $value . \"' \";\n\n\t\tif (isset ( $data ['sort'] )) {\n\t\t\t$q .= \" ORDER BY \" . $data ['sort'] . \" \";\n\t\t}\n\n\t\tif (isset ( $data ['order'] )) {\n\t\t\t$q .= $data ['order'];\n\t\t}\n\t\t// echo $q;\n\t\t$r = $this->db->getSingleRecord ( $q );\n\t\tif ($r != false)\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}",
"function checkField($sField,$sTable,$sWhere=''){\n return $this->db->selectRow(\"SELECT $sField FROM \".$sTable.' '.$sWhere);\n \n }",
"public function getRow($table, $field, $value) {\n $columns = \"\";\n $fields = $this->CI->db->list_fields($table);\n $columns = array_diff($fields, array('is_deleted', 'modified_on', 'password'));\n $fields = \"\";\n $fields = implode(',', $columns);\n\n $this->CI->db->select($fields);\n $this->CI->db->from($table);\n $this->CI->db->where($field, $value);\n $this->CI->db->limit(1);\n $que = $this->CI->db->get();\n return $que->row_array();\n }",
"function DB_read( $field, $table, $condition =\"\") {\r\n global $con;\r\n\r\n if($condition != \"\")\r\n $condition = \"WHERE \".$condition;\r\n $statement = $con->prepare(\"SELECT $field FROM $table $condition\");\r\n $statement->execute();\r\n return $statement->fetchAll();\r\n }",
"private function helperFieldInTable( $table, $field )\n {\n ///////////////////////////////////////////////////////////////////////////////\n //\n // RETURN: table.field is checked before\n\n if( isset( $this->arr_checkedTables[$table][$field] ) )\n {\n return $this->arr_checkedTables[$table][$field];\n }\n // RETURN: table.field is checked before\n\n\n\n ///////////////////////////////////////////////////////////////////////////////\n //\n // Set the global $this->arr_checkedTables[$table][$field]\n\n // Load the TCA for the current table\n $this->pObj->objZz->loadTCA($table);\n // Check, if the field is an element of the current table\n switch( isset($GLOBALS['TCA'][$table]['columns'][$field] ) )\n {\n case( true ):\n // Compare to type of the field in the TypoScript with the type in the TCA\n $str_TsType = $this->arr_fieldType[$field];\n $str_TcaType = $GLOBALS['TCA'][$table]['columns'][$field]['config']['type'];\n // Type isn't the same\n if( $str_TsType != $str_TcaType )\n {\n $this->arr_checkedTables[$table][$field] = false;\n $prompt_01 = 'TCA type of \\'' . $field . '\\' is \\'' . $str_TcaType . '\\' in the TCA, but it is \\'' . $str_TsType . '\\' in the TypoScript.';\n $prompt_02 = 'Please take care of a proper TCA and TypoScript. See flexform.sDEF.statistics.adjustment.fields.' . $field . '.type.';\n if( $this->pObj->b_drs_statistics )\n {\n t3lib_div::devlog('[WARN/STATISTICS] ' . $prompt_01, $this->pObj->extKey, 2);\n t3lib_div::devlog('[HELP/STATISTICS] ' . $prompt_02, $this->pObj->extKey, 1);\n }\n if( $this->debugging )\n {\n $str_prompt = '<p style=\"font-family:monospace;font-size:smaller;padding-top:2em;\">' . $prompt_01 . '</p>';\n $str_prompt .= '<p style=\"font-family:monospace;font-size:smaller;padding-top:2em;\">' . $prompt_02 . '</p>';\n echo $str_prompt;\n }\n // Type isn't the same\n }\n // Type is the same\n if( $str_TsType == $str_TcaType )\n {\n $this->arr_checkedTables[$table][$field] = true;\n }\n // Type is the same\n break;\n default:\n // Hit field isn't any element of the current table\n $this->arr_checkedTables[$table][$field] = false;\n $prompt_01 = $field . ' isn\\'t any field of the table ' . $table . ' in the TCA. Hit can\\'t counted!';\n $prompt_02 = 'Please extend your TCA table ' . $table . ' with the field ' . $field . '.';\n if( $this->pObj->b_drs_statistics )\n {\n t3lib_div::devlog('[WARN/STATISTICS] ' . $prompt_01, $this->pObj->extKey, 2);\n t3lib_div::devlog('[HELP/STATISTICS] ' . $prompt_02, $this->pObj->extKey, 1);\n }\n if( $this->debugging )\n {\n $str_prompt = '<p style=\"font-family:monospace;font-size:smaller;padding-top:2em;\">' . $prompt_01 . '</p>';\n $str_prompt .= '<p style=\"font-family:monospace;font-size:smaller;padding-top:2em;\">' . $prompt_02 . '</p>';\n echo $str_prompt;\n }\n }\n // Check, if the field is an element of the current table\n // Set the global $this->arr_checkedTables[$table][$field]\n\n\n\n ///////////////////////////////////////////////////////////////////////////////\n //\n // RETURN\n\n return $this->arr_checkedTables[$table][$field];\n // RETURN\n }",
"function getField($id, $table, $field){\n\t$q = mysql_query(\"SELECT `$field` FROM `$table` WHERE `id`='$id'\");\n\t$qd = mysql_fetch_assoc($q);\n\treturn f($qd[$field]);\n}",
"public function get_field($table, $field) {\n if ( in_array( $table, $this->get_all_tables() ) ) {\n $table_class = $this->get_struct()[$table];\n return $table_class->get_field($field);\n } else {\n return false;\n }\n }",
"function field_exists($table, $field)\r\n\t{\r\n\t\t$error_state = $this->db->reporterror;\r\n\t\tif ($error_state)\r\n\t\t{\r\n\t\t\t$this->db->hide_errors();\r\n\t\t}\r\n\r\n\t\t$this->db->query_write(\"SELECT $field FROM \" . TABLE_PREFIX . \"$table LIMIT 1\");\r\n\r\n\t\tif ($error_state)\r\n\t\t{\r\n\t\t\t$this->db->show_errors();\r\n\t\t}\r\n\r\n\t\tif ($this->db->errno())\r\n\t\t{\r\n\t\t\t$this->db->errno = 0;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t}",
"abstract public function getFieldsQuery($table);",
"function getDataFromTabel($table, $field='*', $whereField='', $whereValue='', $orderBy='', $order='ASC', $limit=0, $offset=0, $resultInArray=false, $join = '' , $extracondition = ''){\n \n $this->db->select($field);\n $this->db->from($table);\n\n if(is_array($whereField)){\n $this->db->where($whereField);\n }elseif(!empty($whereField) && $whereValue != ''){\n $this->db->where($whereField, $whereValue);\n }\n\n if(!empty($orderBy)){ \n $this->db->order_by($orderBy, $order);\n }\n if($limit > 0){\n $this->db->limit($limit,$offset);\n }\n $query = $this->db->get();\n if($resultInArray){\n $result = $query->result_array();\n }else{\n $result = $query->result();\n }\n\t\tif(!empty($result)){\n return $result;\n }\n else{\n return FALSE;\n }\n\t}",
"function GetSingleField($field, $table, $critfield, $criteria) {\r\r\n # $criteria - useful for avoiding several lines of code just to get\r\r\n # one variable\r\r\n\r\r\n $sql = mysql_query(\"SELECT $field FROM $table WHERE $critfield='$criteria'\");\r\r\n $row = mysql_fetch_array($sql);\r\r\n\r\r\n return $row[$field];\r\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find all demo content collections defined in .tide_demo_content.yml files. | protected function findAllDemoContentCollection() : void {
if (isset($this->collections)) {
return;
}
$this->collections = [];
$discovery = new YamlDiscovery('tide_demo_content', $this->moduleHandler->getModuleDirectories());
$definitions = $discovery->findAll();
foreach ($definitions as $module_name => $collections) {
foreach ($collections as $name => $collection) {
$collection_name = $module_name . ':' . $name;
$collection['module'] = $module_name;
$collection += [
'weight' => 0,
'dependencies' => [
'modules' => [],
'collections' => [],
],
'content' => [],
];
$collection['dependencies']['modules'] = $collection['dependencies']['modules'] ?? [];
$collection['dependencies']['collections'] = $collection['dependencies']['collections'] ?? [];
// Only use items satisfying theirs module dependencies.
if ($this->checkModulesEnabled($collection['dependencies']['modules'])) {
$this->collections[$collection_name] = $collection;
}
else {
$this->messenger->addMessage($this->t('Ignored %name as it does not meet its module dependencies.', ['%name' => $collection_name]));
}
}
}
// Allows other modules to exclude unwanted collections.
$ignored_collections = $this->moduleHandler->invokeAll('tide_demo_content_collection_ignore', [$this->collections]);
if (!empty($ignored_collections)) {
foreach ($ignored_collections as $ignored_collection) {
unset($this->collections[$ignored_collection]);
}
}
// Filter out all items not meeting theirs collection dependencies.
foreach ($this->collections as $collection_name => &$collection) {
$missing_dependencies = $this->checkMissingCollections($collection['dependencies']['collections']);
if (!empty($missing_dependencies)) {
unset($this->collections[$collection_name]);
$this->messenger->addMessage($this->t('Ignored %name as its required collection %collection is missing.', [
'%name' => $collection_name,
'%collection' => reset($missing_dependencies),
]));
}
}
} | [
"private function include_demo_files() {\n\n\t\t// Load Fusion Builder demos.\n\t\tforeach ( self::$demo_files as $demo_file ) {\n\t\t\tinclude $demo_file;\n\t\t}\n\t}",
"public static function getAllGroupsAndDemos()\n {\n $fname = DIR_DATA . '/game_demos.yaml';\n $parsedData = \\yaml_parse_file($fname);\n $entries = array();\n foreach (array_values($parsedData['groups']) as $value) {\n $demos = array();\n foreach ($value['demos'] as $data) {\n $demos[] = new GameDemo($data);\n }\n $entries[] = array(\n 'name' => $value['name'],\n 'href' => $value['href'],\n 'demos' => $demos,\n );\n }\n return $entries;\n }",
"public function get_content_packs() {\n\n\t\t// Registered Demo Content Packs\n\t\treturn array_map( [ Kalium_Demo_Content_Pack::class, 'create_instance' ], [\n\n\t\t\t// Main\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'main',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Main',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-main',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'advanced-custom-fields-pro',\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t\t'portfolio-post-type',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t\t'portfolio' => 'Portfolio',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'front_page' => 'Home',\n\t\t\t\t\t\t\t'posts_page' => 'Blog',\n\t\t\t\t\t\t\t'menus' => [\n\t\t\t\t\t\t\t\t'main-menu' => 'Main Menu',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WooCommerce Products\n\t\t\t\t\t'products' => [\n\t\t\t\t\t\t'name' => 'Products',\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'products.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'woocommerce',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'checked' => false,\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Revolution Slider\n\t\t\t\t\t'revslider' => [\n\t\t\t\t\t\t'type' => 'revolution-slider',\n\t\t\t\t\t\t'src' => [\n\t\t\t\t\t\t\t'revslider-darkslider.zip',\n\t\t\t\t\t\t\t'revslider-homepage.zip',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'requires' => 'revslider',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Widgets\n\t\t\t\t\t'widgets' => [\n\t\t\t\t\t\t'type' => 'wordpress-widgets',\n\t\t\t\t\t\t'src' => 'widgets.wie',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/main/',\n\t\t\t],\n\n\t\t\t// Agency\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'agency',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Agency',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-agency',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'advanced-custom-fields-pro',\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t\t'portfolio-post-type',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t\t'portfolio' => 'Portfolio',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'front_page' => 'Home',\n\t\t\t\t\t\t\t'posts_page' => 'Blog',\n\t\t\t\t\t\t\t'menus' => [\n\t\t\t\t\t\t\t\t'main-menu' => 'Main Menu',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Widgets\n\t\t\t\t\t'widgets' => [\n\t\t\t\t\t\t'type' => 'wordpress-widgets',\n\t\t\t\t\t\t'src' => 'widgets.wie',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/agency/',\n\t\t\t],\n\n\t\t\t// Fashion\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'fashion',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Fashion',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-fashion',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t\t'woocommerce',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t\t'product' => 'Products',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'front_page' => 'Home',\n\t\t\t\t\t\t\t'posts_page' => 'News',\n\t\t\t\t\t\t\t'menus' => [\n\t\t\t\t\t\t\t\t'main-menu' => 'Main Menu',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'woocommerce' => [\n\n\t\t\t\t\t\t\t\t// Pages\n\t\t\t\t\t\t\t\t'pages' => [\n\t\t\t\t\t\t\t\t\t'shop' => 'Shop',\n\t\t\t\t\t\t\t\t\t'cart' => 'Cart',\n\t\t\t\t\t\t\t\t\t'checkout' => 'Checkout',\n\t\t\t\t\t\t\t\t\t'myaccount' => 'Account',\n\t\t\t\t\t\t\t\t],\n\n\t\t\t\t\t\t\t\t// Thumbnails\n\t\t\t\t\t\t\t\t'thumbnails' => [\n\t\t\t\t\t\t\t\t\t'cropping' => 'uncropped',\n\t\t\t\t\t\t\t\t],\n\n\t\t\t\t\t\t\t\t// Other options\n\t\t\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t\t'woocommerce_catalog_columns' => 3,\n\t\t\t\t\t\t\t\t\t'woocommerce_catalog_rows' => 4,\n\t\t\t\t\t\t\t\t],\n\n\t\t\t\t\t\t\t\t// Taxonomy data\n\t\t\t\t\t\t\t\t'taxonomy_data' => '[{\"taxonomy\":\"product_cat\",\"slug\":\"women\",\"name\":\"Women\",\"thumbnail\":\"2016\\/12\\/women.png\"},{\"taxonomy\":\"product_cat\",\"slug\":\"bottoms-women\",\"name\":\"Bottoms\"},{\"taxonomy\":\"product_cat\",\"slug\":\"dresses\",\"name\":\"Dresses\"},{\"taxonomy\":\"product_cat\",\"slug\":\"jackets-women\",\"name\":\"Jackets\"},{\"taxonomy\":\"product_cat\",\"slug\":\"tops\",\"name\":\"Tops\"},{\"taxonomy\":\"product_cat\",\"slug\":\"accessories\",\"name\":\"Accessories\",\"thumbnail\":\"2016\\/12\\/accessories-1.png\"},{\"taxonomy\":\"product_cat\",\"slug\":\"men\",\"name\":\"Men\",\"thumbnail\":\"2016\\/12\\/men-3.png\"},{\"taxonomy\":\"product_cat\",\"slug\":\"jackets\",\"name\":\"Jackets\"},{\"taxonomy\":\"product_cat\",\"slug\":\"sweaters\",\"name\":\"Sweaters\"},{\"taxonomy\":\"product_cat\",\"slug\":\"t-shirts\",\"name\":\"T Shirts\"},{\"taxonomy\":\"product_cat\",\"slug\":\"shoes\",\"name\":\"Shoes\"},{\"taxonomy\":\"product_tag\",\"slug\":\"army\",\"name\":\"army\"},{\"taxonomy\":\"product_tag\",\"slug\":\"backpack\",\"name\":\"backpack\"},{\"taxonomy\":\"product_tag\",\"slug\":\"backpacks\",\"name\":\"backpacks\"},{\"taxonomy\":\"product_tag\",\"slug\":\"bag\",\"name\":\"bag\"},{\"taxonomy\":\"product_tag\",\"slug\":\"bandana\",\"name\":\"bandana\"},{\"taxonomy\":\"product_tag\",\"slug\":\"basic\",\"name\":\"basic\"},{\"taxonomy\":\"product_tag\",\"slug\":\"beige\",\"name\":\"beige\"},{\"taxonomy\":\"product_tag\",\"slug\":\"belt\",\"name\":\"belt\"},{\"taxonomy\":\"product_tag\",\"slug\":\"black\",\"name\":\"black\"},{\"taxonomy\":\"product_tag\",\"slug\":\"blank\",\"name\":\"blank\"},{\"taxonomy\":\"product_tag\",\"slug\":\"blue\",\"name\":\"blue\"},{\"taxonomy\":\"product_tag\",\"slug\":\"bomber\",\"name\":\"bomber\"},{\"taxonomy\":\"product_tag\",\"slug\":\"boys\",\"name\":\"boys\"},{\"taxonomy\":\"product_tag\",\"slug\":\"broken\",\"name\":\"broken\"},{\"taxonomy\":\"product_tag\",\"slug\":\"brown\",\"name\":\"brown\"},{\"taxonomy\":\"product_tag\",\"slug\":\"bw\",\"name\":\"bw\"},{\"taxonomy\":\"product_tag\",\"slug\":\"camouflage\",\"name\":\"camouflage\"},{\"taxonomy\":\"product_tag\",\"slug\":\"casual\",\"name\":\"casual\"},{\"taxonomy\":\"product_tag\",\"slug\":\"classic\",\"name\":\"classic\"},{\"taxonomy\":\"product_tag\",\"slug\":\"classy\",\"name\":\"classy\"},{\"taxonomy\":\"product_tag\",\"slug\":\"cloth\",\"name\":\"cloth\"},{\"taxonomy\":\"product_tag\",\"slug\":\"coat\",\"name\":\"coat\"},{\"taxonomy\":\"product_tag\",\"slug\":\"cream\",\"name\":\"cream\"},{\"taxonomy\":\"product_tag\",\"slug\":\"creme\",\"name\":\"creme\"},{\"taxonomy\":\"product_tag\",\"slug\":\"cropped\",\"name\":\"cropped\"},{\"taxonomy\":\"product_tag\",\"slug\":\"dress\",\"name\":\"dress\"},{\"taxonomy\":\"product_tag\",\"slug\":\"emerald\",\"name\":\"emerald\"},{\"taxonomy\":\"product_tag\",\"slug\":\"fall\",\"name\":\"fall\"},{\"taxonomy\":\"product_tag\",\"slug\":\"frilled\",\"name\":\"frilled\"},{\"taxonomy\":\"product_tag\",\"slug\":\"frills\",\"name\":\"frills\"},{\"taxonomy\":\"product_tag\",\"slug\":\"gentlemen\",\"name\":\"gentlemen\"},{\"taxonomy\":\"product_tag\",\"slug\":\"glasses\",\"name\":\"glasses\"},{\"taxonomy\":\"product_tag\",\"slug\":\"glossy\",\"name\":\"glossy\"},{\"taxonomy\":\"product_tag\",\"slug\":\"gray\",\"name\":\"gray\"},{\"taxonomy\":\"product_tag\",\"slug\":\"green\",\"name\":\"green\"},{\"taxonomy\":\"product_tag\",\"slug\":\"guys\",\"name\":\"guys\"},{\"taxonomy\":\"product_tag\",\"slug\":\"hat\",\"name\":\"hat\"},{\"taxonomy\":\"product_tag\",\"slug\":\"heels\",\"name\":\"heels\"},{\"taxonomy\":\"product_tag\",\"slug\":\"herringbone\",\"name\":\"herringbone\"},{\"taxonomy\":\"product_tag\",\"slug\":\"high\",\"name\":\"high\"},{\"taxonomy\":\"product_tag\",\"slug\":\"jacket\",\"name\":\"jacket\"},{\"taxonomy\":\"product_tag\",\"slug\":\"jeans\",\"name\":\"jeans\"},{\"taxonomy\":\"product_tag\",\"slug\":\"lace\",\"name\":\"lace\"},{\"taxonomy\":\"product_tag\",\"slug\":\"leather\",\"name\":\"leather\"},{\"taxonomy\":\"product_tag\",\"slug\":\"low\",\"name\":\"low\"},{\"taxonomy\":\"product_tag\",\"slug\":\"mini\",\"name\":\"mini\"},{\"taxonomy\":\"product_tag\",\"slug\":\"navy\",\"name\":\"navy\"},{\"taxonomy\":\"product_tag\",\"slug\":\"ombre\",\"name\":\"ombre\"},{\"taxonomy\":\"product_tag\",\"slug\":\"openwork\",\"name\":\"openwork\"},{\"taxonomy\":\"product_tag\",\"slug\":\"oversized\",\"name\":\"Oversized\"},{\"taxonomy\":\"product_tag\",\"slug\":\"pocket\",\"name\":\"pocket\"},{\"taxonomy\":\"product_tag\",\"slug\":\"pompom\",\"name\":\"pompom\"},{\"taxonomy\":\"product_tag\",\"slug\":\"print\",\"name\":\"print\"},{\"taxonomy\":\"product_tag\",\"slug\":\"rain\",\"name\":\"rain\"},{\"taxonomy\":\"product_tag\",\"slug\":\"scarf\",\"name\":\"scarf\"},{\"taxonomy\":\"product_tag\",\"slug\":\"shirt\",\"name\":\"shirt\"},{\"taxonomy\":\"product_tag\",\"slug\":\"shoes\",\"name\":\"shoes\"},{\"taxonomy\":\"product_tag\",\"slug\":\"short\",\"name\":\"short\"},{\"taxonomy\":\"product_tag\",\"slug\":\"silver\",\"name\":\"silver\"},{\"taxonomy\":\"product_tag\",\"slug\":\"skirt\",\"name\":\"skirt\"},{\"taxonomy\":\"product_tag\",\"slug\":\"slippers\",\"name\":\"slippers\"},{\"taxonomy\":\"product_tag\",\"slug\":\"sneakers\",\"name\":\"sneakers\"},{\"taxonomy\":\"product_tag\",\"slug\":\"soft-touch\",\"name\":\"soft touch\"},{\"taxonomy\":\"product_tag\",\"slug\":\"stitch\",\"name\":\"stitch\"},{\"taxonomy\":\"product_tag\",\"slug\":\"striped\",\"name\":\"striped\"},{\"taxonomy\":\"product_tag\",\"slug\":\"studded\",\"name\":\"studded\"},{\"taxonomy\":\"product_tag\",\"slug\":\"studio\",\"name\":\"studio\"},{\"taxonomy\":\"product_tag\",\"slug\":\"sun\",\"name\":\"sun\"},{\"taxonomy\":\"product_tag\",\"slug\":\"sweater\",\"name\":\"sweater\"},{\"taxonomy\":\"product_tag\",\"slug\":\"sweatshirt\",\"name\":\"sweatshirt\"},{\"taxonomy\":\"product_tag\",\"slug\":\"t-shirt\",\"name\":\"t shirt\"},{\"taxonomy\":\"product_tag\",\"slug\":\"trench\",\"name\":\"trench\"},{\"taxonomy\":\"product_tag\",\"slug\":\"tricolor\",\"name\":\"tricolor\"},{\"taxonomy\":\"product_tag\",\"slug\":\"tshirt\",\"name\":\"tshirt\"},{\"taxonomy\":\"product_tag\",\"slug\":\"umbrella\",\"name\":\"umbrella\"},{\"taxonomy\":\"product_tag\",\"slug\":\"urban\",\"name\":\"urban\"},{\"taxonomy\":\"product_tag\",\"slug\":\"white\",\"name\":\"white\"},{\"taxonomy\":\"product_tag\",\"slug\":\"women\",\"name\":\"women\"},{\"taxonomy\":\"product_tag\",\"slug\":\"wraparound\",\"name\":\"wraparound\"},{\"taxonomy\":\"product_tag\",\"slug\":\"yellow\",\"name\":\"yellow\"},{\"taxonomy\":\"product_tag\",\"slug\":\"zara\",\"name\":\"zara\"},{\"taxonomy\":\"pa_colours\",\"slug\":\"brown\",\"name\":\"Brown\"},{\"taxonomy\":\"pa_colours\",\"slug\":\"burgundy\",\"name\":\"Burgundy\"},{\"taxonomy\":\"pa_colours\",\"slug\":\"purple\",\"name\":\"Purple\"},{\"taxonomy\":\"pa_colours\",\"slug\":\"turquoise\",\"name\":\"Turquoise\"},{\"taxonomy\":\"pa_colours\",\"slug\":\"blue\",\"name\":\"Blue\"},{\"taxonomy\":\"pa_colours\",\"slug\":\"white\",\"name\":\"White\"},{\"taxonomy\":\"pa_colours\",\"slug\":\"black\",\"name\":\"Black\"},{\"taxonomy\":\"pa_colours\",\"slug\":\"grey\",\"name\":\"Grey\"},{\"taxonomy\":\"pa_colours\",\"slug\":\"beige\",\"name\":\"Beige\"},{\"taxonomy\":\"pa_colours\",\"slug\":\"navy\",\"name\":\"Navy\"},{\"taxonomy\":\"pa_colours\",\"slug\":\"red\",\"name\":\"Red\"},{\"taxonomy\":\"pa_colours\",\"slug\":\"yellow\",\"name\":\"Yellow\"},{\"taxonomy\":\"pa_material\",\"slug\":\"leather\",\"name\":\"Leather\"},{\"taxonomy\":\"pa_material\",\"slug\":\"cotton\",\"name\":\"Cotton\"},{\"taxonomy\":\"pa_material\",\"slug\":\"wool\",\"name\":\"Wool\"},{\"taxonomy\":\"pa_material\",\"slug\":\"silk\",\"name\":\"Silk\"},{\"taxonomy\":\"pa_size\",\"slug\":\"s\",\"name\":\"S\"},{\"taxonomy\":\"pa_size\",\"slug\":\"m\",\"name\":\"M\"},{\"taxonomy\":\"pa_size\",\"slug\":\"l\",\"name\":\"L\"},{\"taxonomy\":\"pa_size\",\"slug\":\"xl\",\"name\":\"XL\"},{\"taxonomy\":\"pa_size\",\"slug\":\"xxl\",\"name\":\"XXL\"}]',\n\n\t\t\t\t\t\t\t\t// Attribute taxonomies\n\t\t\t\t\t\t\t\t'attribute_taxonomies' => '[{\"attribute_name\":\"colours\",\"attribute_label\":\"Colours\"},{\"attribute_name\":\"material\",\"attribute_label\":\"Material\"},{\"attribute_name\":\"size\",\"attribute_label\":\"Size\"}]',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Revolution Slider\n\t\t\t\t\t'revslider' => [\n\t\t\t\t\t\t'type' => 'revolution-slider',\n\t\t\t\t\t\t'src' => [\n\t\t\t\t\t\t\t'revslider-homepage-full.zip',\n\t\t\t\t\t\t\t'revslider-homepage-slider.zip',\n\t\t\t\t\t\t\t'revslider-parallax-1.zip',\n\t\t\t\t\t\t\t'revslider-parallax-2.zip',\n\t\t\t\t\t\t\t'revslider-parallax-3.zip',\n\t\t\t\t\t\t\t'revslider-shop-accessories.zip',\n\t\t\t\t\t\t\t'revslider-shop-men.zip',\n\t\t\t\t\t\t\t'revslider-shop-shoes.zip',\n\t\t\t\t\t\t\t'revslider-shop-women.zip',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'requires' => 'revslider',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Widgets\n\t\t\t\t\t'widgets' => [\n\t\t\t\t\t\t'type' => 'wordpress-widgets',\n\t\t\t\t\t\t'src' => 'widgets.wie',\n\t\t\t\t\t\t'options' => [\n\n\t\t\t\t\t\t\t// Widgets data\n\t\t\t\t\t\t\t'data' => '{\"widget_nav_menu\":[{\"term_id\":84,\"name\":\"Footer Menu 1\"},{\"term_id\":85,\"name\":\"Footer menu 2\"},{\"term_id\":86,\"name\":\"Footer Menu 3\"}]}',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/fashion/',\n\t\t\t],\n\n\t\t\t// Bookstore\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'bookstore',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Bookstore',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-bookstore',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'advanced-custom-fields-pro',\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t\t'woocommerce',\n\t\t\t\t\t\t\t'mailchimp-for-wp',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t\t'portfolio' => 'Portfolio',\n\t\t\t\t\t\t\t\t'product' => 'Products',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'front_page' => 'Home',\n\t\t\t\t\t\t\t'posts_page' => 'Blog',\n\t\t\t\t\t\t\t'menus' => [\n\t\t\t\t\t\t\t\t'main-menu' => 'Main Menu',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'woocommerce' => [\n\n\t\t\t\t\t\t\t\t// Pages\n\t\t\t\t\t\t\t\t'pages' => [\n\t\t\t\t\t\t\t\t\t'shop' => 'Books',\n\t\t\t\t\t\t\t\t\t'cart' => 'Cart',\n\t\t\t\t\t\t\t\t\t'checkout' => 'Checkout',\n\t\t\t\t\t\t\t\t\t'myaccount' => 'My account',\n\t\t\t\t\t\t\t\t],\n\n\t\t\t\t\t\t\t\t// Thumbnails\n\t\t\t\t\t\t\t\t'thumbnails' => [\n\t\t\t\t\t\t\t\t\t'cropping' => 'custom',\n\t\t\t\t\t\t\t\t\t'cropping_custom_width' => 50,\n\t\t\t\t\t\t\t\t\t'cropping_custom_height' => 76,\n\t\t\t\t\t\t\t\t\t'image_width' => 300,\n\t\t\t\t\t\t\t\t],\n\n\t\t\t\t\t\t\t\t// Other Options\n\t\t\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t\t'woocommerce_shop_page_display' => 'both',\n\t\t\t\t\t\t\t\t\t'woocommerce_category_archive_display' => 'both',\n\t\t\t\t\t\t\t\t\t'woocommerce_catalog_columns' => 3,\n\t\t\t\t\t\t\t\t\t'woocommerce_catalog_rows' => 4,\n\t\t\t\t\t\t\t\t],\n\n\t\t\t\t\t\t\t\t// Taxonomy data\n\t\t\t\t\t\t\t\t'taxonomy_data' => '[{\"taxonomy\":\"product_cat\",\"slug\":\"uncategorized\",\"name\":\"Uncategorized\",\"thumbnail\":\"2019\\/04\\/uncategorized.png\"},{\"taxonomy\":\"product_cat\",\"slug\":\"biography\",\"name\":\"Biography\",\"thumbnail\":\"2019\\/04\\/biography.png\"},{\"taxonomy\":\"product_cat\",\"slug\":\"childrens-books\",\"name\":\"Children\\'s\",\"thumbnail\":\"2019\\/04\\/children.png\"},{\"taxonomy\":\"product_cat\",\"slug\":\"cooking\",\"name\":\"Cooking\",\"thumbnail\":\"2019\\/04\\/cook.png\"},{\"taxonomy\":\"product_cat\",\"slug\":\"drama\",\"name\":\"Drama\",\"thumbnail\":\"2019\\/04\\/drama.png\"},{\"taxonomy\":\"product_cat\",\"slug\":\"lifestyle\",\"name\":\"Family\",\"thumbnail\":\"2019\\/04\\/family.png\"},{\"taxonomy\":\"product_cat\",\"slug\":\"fiction\",\"name\":\"Fiction\",\"thumbnail\":\"2019\\/04\\/fictive.png\"},{\"taxonomy\":\"product_cat\",\"slug\":\"history\",\"name\":\"History\",\"thumbnail\":\"2019\\/04\\/history.png\"},{\"taxonomy\":\"product_cat\",\"slug\":\"crime-thrillers-mystery\",\"name\":\"Mystery\",\"thumbnail\":\"2019\\/04\\/mystery.png\"},{\"taxonomy\":\"product_cat\",\"slug\":\"politics\",\"name\":\"Politics\",\"thumbnail\":\"2019\\/04\\/policitcs.png\"},{\"taxonomy\":\"product_tag\",\"slug\":\"education\",\"name\":\"Education\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"a-j-finn\",\"name\":\"A. J. Finn\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"annelies-marie-frank\",\"name\":\"Anne Frank\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"camille-pagan\",\"name\":\"Camille Pag\\u00e1n\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"daniel-h-pink\",\"name\":\"Daniel H. Pink\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"danielle-steel\",\"name\":\"Danielle Steel\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"david-quammen\",\"name\":\"David Quammen\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"delia-owens\",\"name\":\"Delia Owens\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"dr-seuss\",\"name\":\"Dr. Seuss\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"elliot-ackerman\",\"name\":\"Elliot Ackerman\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"etaf-rum\",\"name\":\"Etaf Rum\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"heather-morris\",\"name\":\"Heather Morris\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"ismail-kadare\",\"name\":\"Ismail Kadare\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"james-holland\",\"name\":\"James Holland\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"joanna-gaines\",\"name\":\"Joanna Gaines\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"jordan-b-peterson\",\"name\":\"Jordan B. Peterson\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"katie-parla\",\"name\":\"Katie Parla\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"kirk-wallace-johnson\",\"name\":\"Kirk Wallace Johnson\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"kristin-fields\",\"name\":\"Kristin Fields\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"lisa-wingate\",\"name\":\"Lisa Wingate\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"mark-hyman-m-d\",\"name\":\"Mark Hyman M.D.\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"mark-manson\",\"name\":\"Mark Manson\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"marlon-james\",\"name\":\"Marlon James\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"maya-angelou\",\"name\":\"Maya Angelou\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"michael-pollan\",\"name\":\"Michael Pollan\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"michael-wolff\",\"name\":\"Michael Wolff\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"michelle-obama\",\"name\":\"Michelle Obama\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"namwali-serpell\",\"name\":\"Namwali Serpell\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"ned-vizzini\",\"name\":\"Ned Vizzini\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"patrick-radden-keefe\",\"name\":\"Patrick Radden Keefe\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"peter-heller\",\"name\":\"Peter Heller\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"r-j-palacio\",\"name\":\"R. J. Palacio\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"rachel-hollis\",\"name\":\"Rachel Hollis\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"ralph-ellison\",\"name\":\"Ralph Ellison\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"sigrid-nunez\",\"name\":\"Sigrid Nunez\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"stephen-hawking\",\"name\":\"Stephen Hawking\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"susan-bernhard\",\"name\":\"Susan Bernhard\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"tara-westover\",\"name\":\"Tara Westover\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"tomi-adeyemi\",\"name\":\"Tomi Adeyemi\"},{\"taxonomy\":\"pa_book-author\",\"slug\":\"trevor-noah\",\"name\":\"Trevor Noah\"},{\"taxonomy\":\"pa_format\",\"slug\":\"audio-cd\",\"name\":\"Audio CD\"},{\"taxonomy\":\"pa_format\",\"slug\":\"audiobook\",\"name\":\"Audiobook\"},{\"taxonomy\":\"pa_format\",\"slug\":\"hardcover\",\"name\":\"Hardcover\"},{\"taxonomy\":\"pa_format\",\"slug\":\"kindle-books\",\"name\":\"Kindle Books\"},{\"taxonomy\":\"pa_format\",\"slug\":\"paperback\",\"name\":\"Paperback\"},{\"taxonomy\":\"pa_language\",\"slug\":\"english\",\"name\":\"English\"},{\"taxonomy\":\"pa_language\",\"slug\":\"french\",\"name\":\"French\"},{\"taxonomy\":\"pa_language\",\"slug\":\"german\",\"name\":\"German\"},{\"taxonomy\":\"pa_language\",\"slug\":\"japanese\",\"name\":\"Japanese\"},{\"taxonomy\":\"pa_language\",\"slug\":\"spanish\",\"name\":\"Spanish\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"192\",\"name\":\"192\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"208\",\"name\":\"208\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"212\",\"name\":\"212\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"251\",\"name\":\"251\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"256\",\"name\":\"256\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"264\",\"name\":\"264\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"270\",\"name\":\"270\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"272\",\"name\":\"272\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"283\",\"name\":\"283\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"288\",\"name\":\"288\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"304\",\"name\":\"304\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"316\",\"name\":\"316\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"321\",\"name\":\"321\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"350\",\"name\":\"350\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"352\",\"name\":\"352\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"400\",\"name\":\"400\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"409\",\"name\":\"409\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"448\",\"name\":\"448\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"464\",\"name\":\"464\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"480\",\"name\":\"480\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"544\",\"name\":\"544\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"576\",\"name\":\"576\"},{\"taxonomy\":\"pa_pages\",\"slug\":\"640\",\"name\":\"640\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"atlantic-monthly-press\",\"name\":\"Atlantic Monthly Press\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"ballantine-books\",\"name\":\"Ballantine Books\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"bantam\",\"name\":\"Bantam\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"clarkson-potter\",\"name\":\"Clarkson Potter\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"disney-hyperion\",\"name\":\"Disney-Hyperion\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"doubleday\",\"name\":\"Doubleday\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"harper\",\"name\":\"Harper\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"harper-paperbacks\",\"name\":\"Harper Paperbacks\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"henry-holt-and-co-2\",\"name\":\"Henry Holt and Co\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"henry-holt-and-co\",\"name\":\"Henry Holt and Co.\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"hogarth\",\"name\":\"Hogarth\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"knopf\",\"name\":\"Knopf\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"lake-union-publishing\",\"name\":\"Lake Union Publishing\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"little-a\",\"name\":\"Little A\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"little-brown-spark\",\"name\":\"Little, Brown Spark\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"modern-library\",\"name\":\"Modern Library\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"penguin-press\",\"name\":\"Penguin Press\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"quercus\",\"name\":\"Quercus\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"random-house\",\"name\":\"Random House\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"riverhead-books\",\"name\":\"Riverhead Books\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"simon-schuster\",\"name\":\"Simon & Schuster\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"spiegel-grau\",\"name\":\"Spiegel & Grau\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"thomas-nelson\",\"name\":\"Thomas Nelson\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"viking\",\"name\":\"Viking\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"william-morrow-cookbooks\",\"name\":\"William Morrow Cookbooks\"},{\"taxonomy\":\"pa_publisher\",\"slug\":\"windmill-books\",\"name\":\"Windmill Books\"},{\"taxonomy\":\"pa_year-published\",\"slug\":\"1993\",\"name\":\"1993\"},{\"taxonomy\":\"pa_year-published\",\"slug\":\"1994\",\"name\":\"1994\"},{\"taxonomy\":\"pa_year-published\",\"slug\":\"1998\",\"name\":\"1998\"},{\"taxonomy\":\"pa_year-published\",\"slug\":\"2007\",\"name\":\"2007\"},{\"taxonomy\":\"pa_year-published\",\"slug\":\"2009\",\"name\":\"2009\"},{\"taxonomy\":\"pa_year-published\",\"slug\":\"2014\",\"name\":\"2014\"},{\"taxonomy\":\"pa_year-published\",\"slug\":\"2016\",\"name\":\"2016\"},{\"taxonomy\":\"pa_year-published\",\"slug\":\"2018\",\"name\":\"2018\"},{\"taxonomy\":\"pa_year-published\",\"slug\":\"2019\",\"name\":\"2019\"}]',\n\n\t\t\t\t\t\t\t\t// Attribute taxonomies\n\t\t\t\t\t\t\t\t'attribute_taxonomies' => '[{\"attribute_name\":\"book-author\",\"attribute_label\":\"Author\"},{\"attribute_name\":\"format\",\"attribute_label\":\"Format\"},{\"attribute_name\":\"language\",\"attribute_label\":\"Language\"},{\"attribute_name\":\"pages\",\"attribute_label\":\"Pages\"},{\"attribute_name\":\"publisher\",\"attribute_label\":\"Publisher\"},{\"attribute_name\":\"year-published\",\"attribute_label\":\"Year Published\"}]',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Revolution Slider\n\t\t\t\t\t'revslider' => [\n\t\t\t\t\t\t'type' => 'revolution-slider',\n\t\t\t\t\t\t'src' => [\n\t\t\t\t\t\t\t'revslider-bookstore.zip',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'requires' => 'revslider',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Widgets\n\t\t\t\t\t'widgets' => [\n\t\t\t\t\t\t'type' => 'wordpress-widgets',\n\t\t\t\t\t\t'src' => 'widgets.wie',\n\t\t\t\t\t\t'options' => [\n\n\t\t\t\t\t\t\t// Widgets data\n\t\t\t\t\t\t\t'data' => '{\"widget_nav_menu\":[{\"term_id\":130,\"name\":\"Footer Menu 1\"},{\"term_id\":131,\"name\":\"Footer Menu 2\"}]}',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/bookstore/',\n\t\t\t],\n\n\t\t\t// Wedding\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'wedding',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Wedding',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-wedding',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'advanced-custom-fields-pro',\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t\t'ninja-forms',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'front_page' => 'Homepage',\n\t\t\t\t\t\t\t'posts_page' => 'Blog',\n\t\t\t\t\t\t\t'menus' => [\n\t\t\t\t\t\t\t\t'main-menu' => 'Main Menu',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Revolution Slider\n\t\t\t\t\t'revslider' => [\n\t\t\t\t\t\t'type' => 'revolution-slider',\n\t\t\t\t\t\t'src' => [\n\t\t\t\t\t\t\t'revslider-intro.zip',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'requires' => 'revslider',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/wedding/',\n\t\t\t],\n\n\t\t\t// Medical\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'medical',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Medical',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-medical',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'advanced-custom-fields-pro',\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t\t'portfolio-post-type',\n\t\t\t\t\t\t\t'ninja-forms',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t\t'portfolio' => 'Portfolio',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'front_page' => 'Home',\n\t\t\t\t\t\t\t'posts_page' => 'News',\n\t\t\t\t\t\t\t'menus' => [\n\t\t\t\t\t\t\t\t'main-menu' => 'Main Menu',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Revolution Slider\n\t\t\t\t\t'revslider' => [\n\t\t\t\t\t\t'type' => 'revolution-slider',\n\t\t\t\t\t\t'src' => [\n\t\t\t\t\t\t\t'revslider-hospital-slider.zip',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'requires' => 'revslider',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Widgets\n\t\t\t\t\t'widgets' => [\n\t\t\t\t\t\t'type' => 'wordpress-widgets',\n\t\t\t\t\t\t'src' => 'widgets.wie',\n\t\t\t\t\t\t'options' => [\n\n\t\t\t\t\t\t\t// Widgets data\n\t\t\t\t\t\t\t'data' => '{\"widget_nav_menu\":[{\"term_id\":2,\"name\":\"Footer Departments 1\"},{\"term_id\":3,\"name\":\"Footer Departments 2\"},{\"term_id\":4,\"name\":\"Footer Links\"},{\"term_id\":37,\"name\":\"Departments Menu\"}]}',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/medical/',\n\t\t\t],\n\n\t\t\t// Automotive\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'automotive',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Automotive',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-automotive',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'advanced-custom-fields-pro',\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t\t'woocommerce',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t\t'product' => 'Products',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'front_page' => 'Home',\n\t\t\t\t\t\t\t'posts_page' => 'News',\n\t\t\t\t\t\t\t'menus' => [\n\t\t\t\t\t\t\t\t'main-menu' => 'Main Menu',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'woocommerce' => [\n\n\t\t\t\t\t\t\t\t// Pages\n\t\t\t\t\t\t\t\t'pages' => [\n\t\t\t\t\t\t\t\t\t'shop' => 'Cars',\n\t\t\t\t\t\t\t\t\t'cart' => 'Cart',\n\t\t\t\t\t\t\t\t\t'checkout' => 'Checkout',\n\t\t\t\t\t\t\t\t\t'myaccount' => 'My account',\n\t\t\t\t\t\t\t\t],\n\n\t\t\t\t\t\t\t\t// Thumbnails\n\t\t\t\t\t\t\t\t'thumbnails' => [\n\t\t\t\t\t\t\t\t\t'cropping' => 'custom',\n\t\t\t\t\t\t\t\t\t'cropping_custom_width' => 5,\n\t\t\t\t\t\t\t\t\t'cropping_custom_height' => 3,\n\t\t\t\t\t\t\t\t\t'image_width' => 600,\n\t\t\t\t\t\t\t\t],\n\n\t\t\t\t\t\t\t\t// Other Options\n\t\t\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t\t'woocommerce_category_archive_display' => 'both',\n\t\t\t\t\t\t\t\t\t'woocommerce_catalog_columns' => 3,\n\t\t\t\t\t\t\t\t\t'woocommerce_catalog_rows' => 8,\n\t\t\t\t\t\t\t\t],\n\n\t\t\t\t\t\t\t\t// Taxonomy data\n\t\t\t\t\t\t\t\t'taxonomy_data' => '[{\"taxonomy\":\"product_cat\",\"slug\":\"hybrid\",\"name\":\"Hybrid-Electric\"},{\"taxonomy\":\"product_cat\",\"slug\":\"sport\",\"name\":\"Sport\"},{\"taxonomy\":\"product_cat\",\"slug\":\"small\",\"name\":\"Small\"},{\"taxonomy\":\"product_cat\",\"slug\":\"truck\",\"name\":\"Truck\"},{\"taxonomy\":\"product_cat\",\"slug\":\"motorcycle\",\"name\":\"Motorcycle\"},{\"taxonomy\":\"product_cat\",\"slug\":\"hatchback\",\"name\":\"Hatchback\"},{\"taxonomy\":\"product_cat\",\"slug\":\"sedan\",\"name\":\"Sedan\"},{\"taxonomy\":\"product_cat\",\"slug\":\"convertible\",\"name\":\"Convertible\"},{\"taxonomy\":\"product_cat\",\"slug\":\"estate\",\"name\":\"Estate\"},{\"taxonomy\":\"product_cat\",\"slug\":\"suv\",\"name\":\"SUV\"},{\"taxonomy\":\"product_cat\",\"slug\":\"van\",\"name\":\"Van\"},{\"taxonomy\":\"product_tag\",\"slug\":\"suv-award\",\"name\":\"SUV Award\"},{\"taxonomy\":\"product_tag\",\"slug\":\"bmw\",\"name\":\"bmw\"},{\"taxonomy\":\"product_tag\",\"slug\":\"4er\",\"name\":\"4er\"},{\"taxonomy\":\"product_tag\",\"slug\":\"convertible\",\"name\":\"convertible\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"alfa-romeo\",\"name\":\"Alfa Romeo\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"audi\",\"name\":\"Audi\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"bmw\",\"name\":\"BMW\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"citroen\",\"name\":\"Citro\\u00ebn\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"fiat\",\"name\":\"Fiat\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"ford\",\"name\":\"Ford\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"honda\",\"name\":\"Honda\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"hyundai\",\"name\":\"Hyundai\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"infiniti\",\"name\":\"Infiniti\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"jaguar\",\"name\":\"Jaguar\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"jeep\",\"name\":\"Jeep\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"land-rover\",\"name\":\"Land Rover\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"mazda\",\"name\":\"Mazda\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"mercedes-benz\",\"name\":\"Mercedes Benz\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"mini\",\"name\":\"Mini\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"mitsubishi\",\"name\":\"Mitsubishi\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"nissan\",\"name\":\"Nissan\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"peugeot\",\"name\":\"Peugeot\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"porsche\",\"name\":\"Porsche\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"renault\",\"name\":\"Renault\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"seat\",\"name\":\"Seat\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"skoda\",\"name\":\"Skoda\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"smart\",\"name\":\"Smart\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"suzuku\",\"name\":\"Suzuku\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"tesla\",\"name\":\"Tesla\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"toyota\",\"name\":\"Toyota\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"vauxhall\",\"name\":\"Vauxhall\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"vespa\",\"name\":\"Vespa\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"volkswagen\",\"name\":\"Volkswagen\"},{\"taxonomy\":\"pa_brand\",\"slug\":\"volvo\",\"name\":\"Volvo\"},{\"taxonomy\":\"pa_color\",\"slug\":\"beige\",\"name\":\"Beige\"},{\"taxonomy\":\"pa_color\",\"slug\":\"black\",\"name\":\"Black\"},{\"taxonomy\":\"pa_color\",\"slug\":\"blue\",\"name\":\"Blue\"},{\"taxonomy\":\"pa_color\",\"slug\":\"brown\",\"name\":\"Brown\"},{\"taxonomy\":\"pa_color\",\"slug\":\"green\",\"name\":\"Green\"},{\"taxonomy\":\"pa_color\",\"slug\":\"metallic\",\"name\":\"Metallic\"},{\"taxonomy\":\"pa_color\",\"slug\":\"orange\",\"name\":\"Orange\"},{\"taxonomy\":\"pa_color\",\"slug\":\"purple\",\"name\":\"Purple\"},{\"taxonomy\":\"pa_color\",\"slug\":\"red\",\"name\":\"Red\"},{\"taxonomy\":\"pa_color\",\"slug\":\"silver\",\"name\":\"Silver\"},{\"taxonomy\":\"pa_color\",\"slug\":\"white\",\"name\":\"White\"},{\"taxonomy\":\"pa_color\",\"slug\":\"yellow\",\"name\":\"Yellow\"},{\"taxonomy\":\"pa_doors\",\"slug\":\"23\",\"name\":\"2\\/3\"},{\"taxonomy\":\"pa_doors\",\"slug\":\"45\",\"name\":\"4\\/5\"},{\"taxonomy\":\"pa_doors\",\"slug\":\"67\",\"name\":\"6\\/7\"},{\"taxonomy\":\"pa_fuel\",\"slug\":\"diesel\",\"name\":\"Diesel\"},{\"taxonomy\":\"pa_fuel\",\"slug\":\"electric\",\"name\":\"Electric\"},{\"taxonomy\":\"pa_fuel\",\"slug\":\"hybrid\",\"name\":\"Hybrid\"},{\"taxonomy\":\"pa_fuel\",\"slug\":\"petrol\",\"name\":\"Petrol\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"101\",\"name\":\"101\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"105\",\"name\":\"105\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"110\",\"name\":\"110\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"120\",\"name\":\"120\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"125\",\"name\":\"125\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"140\",\"name\":\"140\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"150\",\"name\":\"150\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"160\",\"name\":\"160\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"170\",\"name\":\"170\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"172\",\"name\":\"172\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"180\",\"name\":\"180\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"185\",\"name\":\"185\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"190\",\"name\":\"190\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"220\",\"name\":\"220\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"230\",\"name\":\"230\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"235\",\"name\":\"235\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"240\",\"name\":\"240\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"243\",\"name\":\"243\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"255\",\"name\":\"255\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"300\",\"name\":\"300\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"310\",\"name\":\"310\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"350\",\"name\":\"350\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"360\",\"name\":\"360\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"380\",\"name\":\"380\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"385\",\"name\":\"385\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"580\",\"name\":\"580\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"89\",\"name\":\"89\"},{\"taxonomy\":\"pa_horsepower\",\"slug\":\"90\",\"name\":\"90\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"auxiliary-heating\",\"name\":\"Auxiliary heating\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"bluetooth\",\"name\":\"Bluetooth\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"cd-player\",\"name\":\"CD player\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"central-locking\",\"name\":\"Central locking\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"cruise-control\",\"name\":\"Cruise control\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"electric-heated-seats\",\"name\":\"Electric heated seats\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"electric-seat-adjustment\",\"name\":\"Electric seat adjustment\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"electric-side-mirror\",\"name\":\"Electric side mirror\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"electric-windows\",\"name\":\"Electric windows\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"hands-free-kit\",\"name\":\"Hands-free kit\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"head-up-display\",\"name\":\"Head-up display\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"isofix\",\"name\":\"Isofix\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"mp3-interface\",\"name\":\"MP3 interface\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"multifunction-steering-wheel\",\"name\":\"Multifunction steering wheel\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"navigation-system\",\"name\":\"Navigation system\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"on-board-computer\",\"name\":\"On-board computer\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"power-assisted-steering\",\"name\":\"Power Assisted Steering\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"rain-sensor\",\"name\":\"Rain sensor\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"ski-bag\",\"name\":\"Ski bag\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"start-stop-system\",\"name\":\"Start-stop system\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"sunroof\",\"name\":\"Sunroof\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"tunerradio\",\"name\":\"Tuner\\/radio\"},{\"taxonomy\":\"pa_interior-features\",\"slug\":\"ventilated-seats\",\"name\":\"Ventilated Seats\"},{\"taxonomy\":\"pa_kilometers\",\"slug\":\"0\",\"name\":\"0\"},{\"taxonomy\":\"pa_kilometers\",\"slug\":\"10000\",\"name\":\"10000\"},{\"taxonomy\":\"pa_kilometers\",\"slug\":\"1200\",\"name\":\"1200\"},{\"taxonomy\":\"pa_kilometers\",\"slug\":\"12000\",\"name\":\"12000\"},{\"taxonomy\":\"pa_kilometers\",\"slug\":\"20000\",\"name\":\"20000\"},{\"taxonomy\":\"pa_kilometers\",\"slug\":\"25000\",\"name\":\"25000\"},{\"taxonomy\":\"pa_kilometers\",\"slug\":\"5000\",\"name\":\"5000\"},{\"taxonomy\":\"pa_kilometers\",\"slug\":\"50000\",\"name\":\"50000\"},{\"taxonomy\":\"pa_kilometers\",\"slug\":\"7800\",\"name\":\"7800\"},{\"taxonomy\":\"pa_security\",\"slug\":\"abs\",\"name\":\"ABS\"},{\"taxonomy\":\"pa_security\",\"slug\":\"adaptive-cruise-control\",\"name\":\"Adaptive Cruise Control\"},{\"taxonomy\":\"pa_security\",\"slug\":\"adaptive-lighting\",\"name\":\"Adaptive lighting\"},{\"taxonomy\":\"pa_security\",\"slug\":\"blind-spot-monitor\",\"name\":\"Blind Spot Monitor\"},{\"taxonomy\":\"pa_security\",\"slug\":\"collision-avoidance-system\",\"name\":\"Collision Avoidance System\"},{\"taxonomy\":\"pa_security\",\"slug\":\"daytime-running-lights\",\"name\":\"Daytime running lights\"},{\"taxonomy\":\"pa_security\",\"slug\":\"esp\",\"name\":\"ESP\"},{\"taxonomy\":\"pa_security\",\"slug\":\"fog-lamp\",\"name\":\"Fog lamp\"},{\"taxonomy\":\"pa_security\",\"slug\":\"immobilizer\",\"name\":\"Immobilizer\"},{\"taxonomy\":\"pa_security\",\"slug\":\"keyless-entry\",\"name\":\"Keyless Entry\"},{\"taxonomy\":\"pa_security\",\"slug\":\"lane-departure-warning\",\"name\":\"Lane Departure Warning\"},{\"taxonomy\":\"pa_security\",\"slug\":\"led-headlights\",\"name\":\"LED Headlights\"},{\"taxonomy\":\"pa_security\",\"slug\":\"light-sensor\",\"name\":\"Light sensor\"},{\"taxonomy\":\"pa_security\",\"slug\":\"traction-control\",\"name\":\"Traction control\"},{\"taxonomy\":\"pa_security\",\"slug\":\"xenon-headlights\",\"name\":\"Xenon headlights\"},{\"taxonomy\":\"pa_sensors\",\"slug\":\"camera\",\"name\":\"Camera\"},{\"taxonomy\":\"pa_sensors\",\"slug\":\"front-sensors\",\"name\":\"Front sensors\"},{\"taxonomy\":\"pa_sensors\",\"slug\":\"rear-sensors\",\"name\":\"Rear sensors\"},{\"taxonomy\":\"pa_sensors\",\"slug\":\"self-steering-systems\",\"name\":\"Self-steering systems\"},{\"taxonomy\":\"pa_system\",\"slug\":\"awd-all-wheel-drive\",\"name\":\"AWD (All Wheel Drive)\"},{\"taxonomy\":\"pa_system\",\"slug\":\"fwd-fear-wheel-drive\",\"name\":\"FWD (Fear Wheel Drive)\"},{\"taxonomy\":\"pa_system\",\"slug\":\"rwd-rear-wheel-drive\",\"name\":\"RWD (Rear Wheel Drive)\"},{\"taxonomy\":\"pa_transmission\",\"slug\":\"automatic\",\"name\":\"Automatic\"},{\"taxonomy\":\"pa_transmission\",\"slug\":\"manual\",\"name\":\"Manual\"},{\"taxonomy\":\"pa_transmission\",\"slug\":\"semi-automatic\",\"name\":\"Semi-automatic\"}]',\n\n\t\t\t\t\t\t\t\t// Attribute taxonomies\n\t\t\t\t\t\t\t\t'attribute_taxonomies' => '[{\"attribute_name\":\"brand\",\"attribute_label\":\"Brand\"},{\"attribute_name\":\"color\",\"attribute_label\":\"Color\"},{\"attribute_name\":\"doors\",\"attribute_label\":\"Doors\"},{\"attribute_name\":\"fuel\",\"attribute_label\":\"Fuel\"},{\"attribute_name\":\"horsepower\",\"attribute_label\":\"Horsepower\"},{\"attribute_name\":\"interior-features\",\"attribute_label\":\"Interior features\"},{\"attribute_name\":\"kilometers\",\"attribute_label\":\"Kilometers\"},{\"attribute_name\":\"security\",\"attribute_label\":\"Security\"},{\"attribute_name\":\"sensors\",\"attribute_label\":\"Sensors\"},{\"attribute_name\":\"system\",\"attribute_label\":\"Drivetrain\"},{\"attribute_name\":\"transmission\",\"attribute_label\":\"Transmission\"}]',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Product Filter\n\t\t\t\t\t'product-filter' => [\n\t\t\t\t\t\t'type' => 'woocommerce-prdctfltr',\n\t\t\t\t\t\t'src' => 'prdctfltr.json',\n\t\t\t\t\t\t'requires' => 'prdctfltr',\n\t\t\t\t\t\t'options' => [\n\n\t\t\t\t\t\t\t// Product taxonomy attributes\n\t\t\t\t\t\t\t'product_attributes' => '[{\"tax\":\"product_cat\",\"id\":234,\"name\":\"Motorcycle\",\"slug\":\"motorcycle\"},{\"tax\":\"product_cat\",\"id\":143,\"name\":\"Small\",\"slug\":\"small\"},{\"tax\":\"product_cat\",\"id\":16,\"name\":\"Hatchback\",\"slug\":\"hatchback\"},{\"tax\":\"product_cat\",\"id\":131,\"name\":\"Convertible\",\"slug\":\"convertible\"},{\"tax\":\"product_cat\",\"id\":142,\"name\":\"Sport\",\"slug\":\"sport\"},{\"tax\":\"product_cat\",\"id\":17,\"name\":\"Sedan\",\"slug\":\"sedan\"},{\"tax\":\"product_cat\",\"id\":19,\"name\":\"Estate\",\"slug\":\"estate\"},{\"tax\":\"product_cat\",\"id\":18,\"name\":\"SUV\",\"slug\":\"suv\"},{\"tax\":\"product_cat\",\"id\":21,\"name\":\"Van\",\"slug\":\"van\"},{\"tax\":\"product_cat\",\"id\":161,\"name\":\"Truck\",\"slug\":\"truck\"},{\"tax\":\"product_cat\",\"id\":141,\"name\":\"Hybrid-Electric\",\"slug\":\"hybrid\"},{\"tax\":\"product_tag\",\"id\":226,\"name\":\"SUV Award\",\"slug\":\"suv-award\"},{\"tax\":\"product_tag\",\"id\":229,\"name\":\"bmw\",\"slug\":\"bmw\"},{\"tax\":\"product_tag\",\"id\":230,\"name\":\"4er\",\"slug\":\"4er\"},{\"tax\":\"product_tag\",\"id\":232,\"name\":\"convertible\",\"slug\":\"convertible\"},{\"tax\":\"pa_brand\",\"id\":156,\"name\":\"Alfa Romeo\",\"slug\":\"alfa-romeo\"},{\"tax\":\"pa_brand\",\"id\":114,\"name\":\"Audi\",\"slug\":\"audi\"},{\"tax\":\"pa_brand\",\"id\":115,\"name\":\"BMW\",\"slug\":\"bmw\"},{\"tax\":\"pa_brand\",\"id\":128,\"name\":\"Citro\\u00ebn\",\"slug\":\"citroen\"},{\"tax\":\"pa_brand\",\"id\":123,\"name\":\"Fiat\",\"slug\":\"fiat\"},{\"tax\":\"pa_brand\",\"id\":122,\"name\":\"Ford\",\"slug\":\"ford\"},{\"tax\":\"pa_brand\",\"id\":154,\"name\":\"Honda\",\"slug\":\"honda\"},{\"tax\":\"pa_brand\",\"id\":155,\"name\":\"Hyundai\",\"slug\":\"hyundai\"},{\"tax\":\"pa_brand\",\"id\":153,\"name\":\"Infiniti\",\"slug\":\"infiniti\"},{\"tax\":\"pa_brand\",\"id\":119,\"name\":\"Jaguar\",\"slug\":\"jaguar\"},{\"tax\":\"pa_brand\",\"id\":147,\"name\":\"Jeep\",\"slug\":\"jeep\"},{\"tax\":\"pa_brand\",\"id\":118,\"name\":\"Land Rover\",\"slug\":\"land-rover\"},{\"tax\":\"pa_brand\",\"id\":121,\"name\":\"Mazda\",\"slug\":\"mazda\"},{\"tax\":\"pa_brand\",\"id\":116,\"name\":\"Mercedes Benz\",\"slug\":\"mercedes-benz\"},{\"tax\":\"pa_brand\",\"id\":152,\"name\":\"Mini\",\"slug\":\"mini\"},{\"tax\":\"pa_brand\",\"id\":146,\"name\":\"Mitsubishi\",\"slug\":\"mitsubishi\"},{\"tax\":\"pa_brand\",\"id\":124,\"name\":\"Nissan\",\"slug\":\"nissan\"},{\"tax\":\"pa_brand\",\"id\":127,\"name\":\"Peugeot\",\"slug\":\"peugeot\"},{\"tax\":\"pa_brand\",\"id\":148,\"name\":\"Porsche\",\"slug\":\"porsche\"},{\"tax\":\"pa_brand\",\"id\":126,\"name\":\"Renault\",\"slug\":\"renault\"},{\"tax\":\"pa_brand\",\"id\":145,\"name\":\"Seat\",\"slug\":\"seat\"},{\"tax\":\"pa_brand\",\"id\":151,\"name\":\"Skoda\",\"slug\":\"skoda\"},{\"tax\":\"pa_brand\",\"id\":150,\"name\":\"Smart\",\"slug\":\"smart\"},{\"tax\":\"pa_brand\",\"id\":144,\"name\":\"Suzuku\",\"slug\":\"suzuku\"},{\"tax\":\"pa_brand\",\"id\":149,\"name\":\"Tesla\",\"slug\":\"tesla\"},{\"tax\":\"pa_brand\",\"id\":120,\"name\":\"Toyota\",\"slug\":\"toyota\"},{\"tax\":\"pa_brand\",\"id\":125,\"name\":\"Vauxhall\",\"slug\":\"vauxhall\"},{\"tax\":\"pa_brand\",\"id\":235,\"name\":\"Vespa\",\"slug\":\"vespa\"},{\"tax\":\"pa_brand\",\"id\":117,\"name\":\"Volkswagen\",\"slug\":\"volkswagen\"},{\"tax\":\"pa_brand\",\"id\":129,\"name\":\"Volvo\",\"slug\":\"volvo\"},{\"tax\":\"pa_color\",\"id\":34,\"name\":\"Beige\",\"slug\":\"beige\"},{\"tax\":\"pa_color\",\"id\":22,\"name\":\"Black\",\"slug\":\"black\"},{\"tax\":\"pa_color\",\"id\":24,\"name\":\"Blue\",\"slug\":\"blue\"},{\"tax\":\"pa_color\",\"id\":41,\"name\":\"Brown\",\"slug\":\"brown\"},{\"tax\":\"pa_color\",\"id\":37,\"name\":\"Green\",\"slug\":\"green\"},{\"tax\":\"pa_color\",\"id\":25,\"name\":\"Metallic\",\"slug\":\"metallic\"},{\"tax\":\"pa_color\",\"id\":36,\"name\":\"Orange\",\"slug\":\"orange\"},{\"tax\":\"pa_color\",\"id\":38,\"name\":\"Purple\",\"slug\":\"purple\"},{\"tax\":\"pa_color\",\"id\":23,\"name\":\"Red\",\"slug\":\"red\"},{\"tax\":\"pa_color\",\"id\":35,\"name\":\"Silver\",\"slug\":\"silver\"},{\"tax\":\"pa_color\",\"id\":40,\"name\":\"White\",\"slug\":\"white\"},{\"tax\":\"pa_color\",\"id\":39,\"name\":\"Yellow\",\"slug\":\"yellow\"},{\"tax\":\"pa_doors\",\"id\":109,\"name\":\"2\\/3\",\"slug\":\"23\"},{\"tax\":\"pa_doors\",\"id\":110,\"name\":\"4\\/5\",\"slug\":\"45\"},{\"tax\":\"pa_doors\",\"id\":111,\"name\":\"6\\/7\",\"slug\":\"67\"},{\"tax\":\"pa_fuel\",\"id\":27,\"name\":\"Diesel\",\"slug\":\"diesel\"},{\"tax\":\"pa_fuel\",\"id\":30,\"name\":\"Electric\",\"slug\":\"electric\"},{\"tax\":\"pa_fuel\",\"id\":29,\"name\":\"Hybrid\",\"slug\":\"hybrid\"},{\"tax\":\"pa_fuel\",\"id\":28,\"name\":\"Petrol\",\"slug\":\"petrol\"},{\"tax\":\"pa_horsepower\",\"id\":183,\"name\":\"101\",\"slug\":\"101\"},{\"tax\":\"pa_horsepower\",\"id\":178,\"name\":\"105\",\"slug\":\"105\"},{\"tax\":\"pa_horsepower\",\"id\":133,\"name\":\"110\",\"slug\":\"110\"},{\"tax\":\"pa_horsepower\",\"id\":168,\"name\":\"120\",\"slug\":\"120\"},{\"tax\":\"pa_horsepower\",\"id\":187,\"name\":\"125\",\"slug\":\"125\"},{\"tax\":\"pa_horsepower\",\"id\":170,\"name\":\"140\",\"slug\":\"140\"},{\"tax\":\"pa_horsepower\",\"id\":177,\"name\":\"150\",\"slug\":\"150\"},{\"tax\":\"pa_horsepower\",\"id\":167,\"name\":\"160\",\"slug\":\"160\"},{\"tax\":\"pa_horsepower\",\"id\":165,\"name\":\"170\",\"slug\":\"170\"},{\"tax\":\"pa_horsepower\",\"id\":175,\"name\":\"172\",\"slug\":\"172\"},{\"tax\":\"pa_horsepower\",\"id\":164,\"name\":\"180\",\"slug\":\"180\"},{\"tax\":\"pa_horsepower\",\"id\":132,\"name\":\"185\",\"slug\":\"185\"},{\"tax\":\"pa_horsepower\",\"id\":139,\"name\":\"190\",\"slug\":\"190\"},{\"tax\":\"pa_horsepower\",\"id\":112,\"name\":\"220\",\"slug\":\"220\"},{\"tax\":\"pa_horsepower\",\"id\":157,\"name\":\"230\",\"slug\":\"230\"},{\"tax\":\"pa_horsepower\",\"id\":137,\"name\":\"235\",\"slug\":\"235\"},{\"tax\":\"pa_horsepower\",\"id\":182,\"name\":\"240\",\"slug\":\"240\"},{\"tax\":\"pa_horsepower\",\"id\":159,\"name\":\"243\",\"slug\":\"243\"},{\"tax\":\"pa_horsepower\",\"id\":162,\"name\":\"255\",\"slug\":\"255\"},{\"tax\":\"pa_horsepower\",\"id\":172,\"name\":\"300\",\"slug\":\"300\"},{\"tax\":\"pa_horsepower\",\"id\":171,\"name\":\"310\",\"slug\":\"310\"},{\"tax\":\"pa_horsepower\",\"id\":169,\"name\":\"350\",\"slug\":\"350\"},{\"tax\":\"pa_horsepower\",\"id\":176,\"name\":\"360\",\"slug\":\"360\"},{\"tax\":\"pa_horsepower\",\"id\":174,\"name\":\"380\",\"slug\":\"380\"},{\"tax\":\"pa_horsepower\",\"id\":181,\"name\":\"385\",\"slug\":\"385\"},{\"tax\":\"pa_horsepower\",\"id\":160,\"name\":\"580\",\"slug\":\"580\"},{\"tax\":\"pa_horsepower\",\"id\":186,\"name\":\"89\",\"slug\":\"89\"},{\"tax\":\"pa_horsepower\",\"id\":184,\"name\":\"90\",\"slug\":\"90\"},{\"tax\":\"pa_interior-features\",\"id\":65,\"name\":\"Auxiliary heating\",\"slug\":\"auxiliary-heating\"},{\"tax\":\"pa_interior-features\",\"id\":66,\"name\":\"Bluetooth\",\"slug\":\"bluetooth\"},{\"tax\":\"pa_interior-features\",\"id\":64,\"name\":\"CD player\",\"slug\":\"cd-player\"},{\"tax\":\"pa_interior-features\",\"id\":67,\"name\":\"Central locking\",\"slug\":\"central-locking\"},{\"tax\":\"pa_interior-features\",\"id\":68,\"name\":\"Cruise control\",\"slug\":\"cruise-control\"},{\"tax\":\"pa_interior-features\",\"id\":69,\"name\":\"Electric heated seats\",\"slug\":\"electric-heated-seats\"},{\"tax\":\"pa_interior-features\",\"id\":70,\"name\":\"Electric seat adjustment\",\"slug\":\"electric-seat-adjustment\"},{\"tax\":\"pa_interior-features\",\"id\":71,\"name\":\"Electric side mirror\",\"slug\":\"electric-side-mirror\"},{\"tax\":\"pa_interior-features\",\"id\":72,\"name\":\"Electric windows\",\"slug\":\"electric-windows\"},{\"tax\":\"pa_interior-features\",\"id\":73,\"name\":\"Hands-free kit\",\"slug\":\"hands-free-kit\"},{\"tax\":\"pa_interior-features\",\"id\":74,\"name\":\"Head-up display\",\"slug\":\"head-up-display\"},{\"tax\":\"pa_interior-features\",\"id\":75,\"name\":\"Isofix\",\"slug\":\"isofix\"},{\"tax\":\"pa_interior-features\",\"id\":79,\"name\":\"MP3 interface\",\"slug\":\"mp3-interface\"},{\"tax\":\"pa_interior-features\",\"id\":78,\"name\":\"Multifunction steering wheel\",\"slug\":\"multifunction-steering-wheel\"},{\"tax\":\"pa_interior-features\",\"id\":77,\"name\":\"Navigation system\",\"slug\":\"navigation-system\"},{\"tax\":\"pa_interior-features\",\"id\":76,\"name\":\"On-board computer\",\"slug\":\"on-board-computer\"},{\"tax\":\"pa_interior-features\",\"id\":80,\"name\":\"Power Assisted Steering\",\"slug\":\"power-assisted-steering\"},{\"tax\":\"pa_interior-features\",\"id\":81,\"name\":\"Rain sensor\",\"slug\":\"rain-sensor\"},{\"tax\":\"pa_interior-features\",\"id\":82,\"name\":\"Ski bag\",\"slug\":\"ski-bag\"},{\"tax\":\"pa_interior-features\",\"id\":83,\"name\":\"Start-stop system\",\"slug\":\"start-stop-system\"},{\"tax\":\"pa_interior-features\",\"id\":86,\"name\":\"Sunroof\",\"slug\":\"sunroof\"},{\"tax\":\"pa_interior-features\",\"id\":85,\"name\":\"Tuner\\/radio\",\"slug\":\"tunerradio\"},{\"tax\":\"pa_interior-features\",\"id\":84,\"name\":\"Ventilated Seats\",\"slug\":\"ventilated-seats\"},{\"tax\":\"pa_kilometers\",\"id\":140,\"name\":\"0\",\"slug\":\"0\"},{\"tax\":\"pa_kilometers\",\"id\":180,\"name\":\"10000\",\"slug\":\"10000\"},{\"tax\":\"pa_kilometers\",\"id\":185,\"name\":\"1200\",\"slug\":\"1200\"},{\"tax\":\"pa_kilometers\",\"id\":158,\"name\":\"12000\",\"slug\":\"12000\"},{\"tax\":\"pa_kilometers\",\"id\":173,\"name\":\"20000\",\"slug\":\"20000\"},{\"tax\":\"pa_kilometers\",\"id\":166,\"name\":\"25000\",\"slug\":\"25000\"},{\"tax\":\"pa_kilometers\",\"id\":136,\"name\":\"5000\",\"slug\":\"5000\"},{\"tax\":\"pa_kilometers\",\"id\":179,\"name\":\"50000\",\"slug\":\"50000\"},{\"tax\":\"pa_kilometers\",\"id\":163,\"name\":\"7800\",\"slug\":\"7800\"},{\"tax\":\"pa_security\",\"id\":87,\"name\":\"ABS\",\"slug\":\"abs\"},{\"tax\":\"pa_security\",\"id\":88,\"name\":\"Adaptive Cruise Control\",\"slug\":\"adaptive-cruise-control\"},{\"tax\":\"pa_security\",\"id\":89,\"name\":\"Adaptive lighting\",\"slug\":\"adaptive-lighting\"},{\"tax\":\"pa_security\",\"id\":90,\"name\":\"Blind Spot Monitor\",\"slug\":\"blind-spot-monitor\"},{\"tax\":\"pa_security\",\"id\":91,\"name\":\"Collision Avoidance System\",\"slug\":\"collision-avoidance-system\"},{\"tax\":\"pa_security\",\"id\":92,\"name\":\"Daytime running lights\",\"slug\":\"daytime-running-lights\"},{\"tax\":\"pa_security\",\"id\":93,\"name\":\"ESP\",\"slug\":\"esp\"},{\"tax\":\"pa_security\",\"id\":94,\"name\":\"Fog lamp\",\"slug\":\"fog-lamp\"},{\"tax\":\"pa_security\",\"id\":95,\"name\":\"Immobilizer\",\"slug\":\"immobilizer\"},{\"tax\":\"pa_security\",\"id\":96,\"name\":\"Keyless Entry\",\"slug\":\"keyless-entry\"},{\"tax\":\"pa_security\",\"id\":97,\"name\":\"Lane Departure Warning\",\"slug\":\"lane-departure-warning\"},{\"tax\":\"pa_security\",\"id\":98,\"name\":\"LED Headlights\",\"slug\":\"led-headlights\"},{\"tax\":\"pa_security\",\"id\":99,\"name\":\"Light sensor\",\"slug\":\"light-sensor\"},{\"tax\":\"pa_security\",\"id\":100,\"name\":\"Traction control\",\"slug\":\"traction-control\"},{\"tax\":\"pa_security\",\"id\":101,\"name\":\"Xenon headlights\",\"slug\":\"xenon-headlights\"},{\"tax\":\"pa_sensors\",\"id\":104,\"name\":\"Camera\",\"slug\":\"camera\"},{\"tax\":\"pa_sensors\",\"id\":102,\"name\":\"Front sensors\",\"slug\":\"front-sensors\"},{\"tax\":\"pa_sensors\",\"id\":103,\"name\":\"Rear sensors\",\"slug\":\"rear-sensors\"},{\"tax\":\"pa_sensors\",\"id\":105,\"name\":\"Self-steering systems\",\"slug\":\"self-steering-systems\"},{\"tax\":\"pa_system\",\"id\":106,\"name\":\"AWD (All Wheel Drive)\",\"slug\":\"awd-all-wheel-drive\"},{\"tax\":\"pa_system\",\"id\":108,\"name\":\"FWD (Fear Wheel Drive)\",\"slug\":\"fwd-fear-wheel-drive\"},{\"tax\":\"pa_system\",\"id\":107,\"name\":\"RWD (Rear Wheel Drive)\",\"slug\":\"rwd-rear-wheel-drive\"},{\"tax\":\"pa_transmission\",\"id\":32,\"name\":\"Automatic\",\"slug\":\"automatic\"},{\"tax\":\"pa_transmission\",\"id\":31,\"name\":\"Manual\",\"slug\":\"manual\"},{\"tax\":\"pa_transmission\",\"id\":33,\"name\":\"Semi-automatic\",\"slug\":\"semi-automatic\"}]',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// Revolution Slider\n\t\t\t\t\t'revslider' => [\n\t\t\t\t\t\t'type' => 'revolution-slider',\n\t\t\t\t\t\t'src' => [\n\t\t\t\t\t\t\t'revslider-about.zip',\n\t\t\t\t\t\t\t'revslider-homepage-slider.zip',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'requires' => 'revslider',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Widgets\n\t\t\t\t\t'widgets' => [\n\t\t\t\t\t\t'type' => 'wordpress-widgets',\n\t\t\t\t\t\t'src' => 'widgets.wie',\n\t\t\t\t\t\t'options' => [\n\n\t\t\t\t\t\t\t// Widgets data\n\t\t\t\t\t\t\t'data' => '{\"widget_nav_menu\":[{\"term_id\":198,\"name\":\"Useful Info\"},{\"term_id\":195,\"name\":\"Car Links\"},{\"term_id\":194,\"name\":\"Services\"},{\"term_id\":197,\"name\":\"Segments\"}]}',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/automotive/',\n\t\t\t],\n\n\t\t\t// Law\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'law',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Law',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-law',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'advanced-custom-fields-pro',\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'front_page' => 'Home',\n\t\t\t\t\t\t\t'posts_page' => 'News',\n\t\t\t\t\t\t\t'menus' => [\n\t\t\t\t\t\t\t\t'main-menu' => 'Main Menu',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Revolution Slider\n\t\t\t\t\t'revslider' => [\n\t\t\t\t\t\t'type' => 'revolution-slider',\n\t\t\t\t\t\t'src' => [\n\t\t\t\t\t\t\t'revslider-homepage-slider.zip',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'requires' => 'revslider',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Widgets\n\t\t\t\t\t'widgets' => [\n\t\t\t\t\t\t'type' => 'wordpress-widgets',\n\t\t\t\t\t\t'src' => 'widgets.wie',\n\t\t\t\t\t\t'options' => [\n\n\t\t\t\t\t\t\t// Widgets data\n\t\t\t\t\t\t\t'data' => '{\"widget_nav_menu\":[{\"term_id\":10,\"name\":\"Our Services\"},{\"term_id\":12,\"name\":\"Our Services 2\"},{\"term_id\":10,\"name\":\"Our Services\"},{\"term_id\":12,\"name\":\"Our Services 2\"}]}',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/law/',\n\t\t\t],\n\n\t\t\t// Hotel\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'hotel',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Hotel',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-hotel',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'advanced-custom-fields-pro',\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t\t'portfolio-post-type',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t\t'portfolio' => 'Portfolio',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'front_page' => 'Home',\n\t\t\t\t\t\t\t'posts_page' => 'Events',\n\t\t\t\t\t\t\t'menus' => [\n\t\t\t\t\t\t\t\t'main-menu' => 'Main Menu',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Revolution Slider\n\t\t\t\t\t'revslider' => [\n\t\t\t\t\t\t'type' => 'revolution-slider',\n\t\t\t\t\t\t'src' => [\n\t\t\t\t\t\t\t'revslider-hotel-slider.zip',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'requires' => 'revslider',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Widgets\n\t\t\t\t\t'widgets' => [\n\t\t\t\t\t\t'type' => 'wordpress-widgets',\n\t\t\t\t\t\t'src' => 'widgets.wie',\n\t\t\t\t\t\t'options' => [\n\n\t\t\t\t\t\t\t// Widgets data\n\t\t\t\t\t\t\t'data' => '{\"widget_nav_menu\":[{\"term_id\":3,\"name\":\"Hotel\"},{\"term_id\":5,\"name\":\"Other\"},{\"term_id\":4,\"name\":\"Spa & Wellness\"},{\"term_id\":6,\"name\":\"Restaurant\"},{\"term_id\":3,\"name\":\"Hotel\"}]}',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/hotel/',\n\t\t\t],\n\n\t\t\t// Architecture\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'architecture',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Architecture',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-architecture',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'advanced-custom-fields-pro',\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t\t'portfolio-post-type',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t\t'portfolio' => 'Portfolio',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'front_page' => 'Home',\n\t\t\t\t\t\t\t'posts_page' => 'News',\n\t\t\t\t\t\t\t'menus' => [\n\t\t\t\t\t\t\t\t'main-menu' => 'Main Menu',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Revolution Slider\n\t\t\t\t\t'revslider' => [\n\t\t\t\t\t\t'type' => 'revolution-slider',\n\t\t\t\t\t\t'src' => [\n\t\t\t\t\t\t\t'revslider-architecture.zip',\n\t\t\t\t\t\t\t'revslider-home-two.zip',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'requires' => 'revslider',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Widgets\n\t\t\t\t\t'widgets' => [\n\t\t\t\t\t\t'type' => 'wordpress-widgets',\n\t\t\t\t\t\t'src' => 'widgets.wie',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/architecture/',\n\t\t\t],\n\n\t\t\t// Restaurant\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'restaurant',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Restaurant',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-restaurant',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'advanced-custom-fields-pro',\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'front_page' => 'Home',\n\t\t\t\t\t\t\t'posts_page' => 'News',\n\t\t\t\t\t\t\t'menus' => [\n\t\t\t\t\t\t\t\t'main-menu' => 'Main Menu',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Revolution Slider\n\t\t\t\t\t'revslider' => [\n\t\t\t\t\t\t'type' => 'revolution-slider',\n\t\t\t\t\t\t'src' => [\n\t\t\t\t\t\t\t'revslider-homepage.zip',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'requires' => 'revslider',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Widgets\n\t\t\t\t\t'widgets' => [\n\t\t\t\t\t\t'type' => 'wordpress-widgets',\n\t\t\t\t\t\t'src' => 'widgets.wie',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/restaurant/',\n\t\t\t],\n\n\t\t\t// Construction\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'construction',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Construction',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-construction',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'advanced-custom-fields-pro',\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t\t'portfolio-post-type',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t\t'portfolio' => 'Portfolio',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'front_page' => 'Home',\n\t\t\t\t\t\t\t'posts_page' => 'News',\n\t\t\t\t\t\t\t'menus' => [\n\t\t\t\t\t\t\t\t'main-menu' => 'Main Menu',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Revolution Slider\n\t\t\t\t\t'revslider' => [\n\t\t\t\t\t\t'type' => 'revolution-slider',\n\t\t\t\t\t\t'src' => [\n\t\t\t\t\t\t\t'revslider-home.zip',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'requires' => 'revslider',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Widgets\n\t\t\t\t\t'widgets' => [\n\t\t\t\t\t\t'type' => 'wordpress-widgets',\n\t\t\t\t\t\t'src' => 'widgets.wie',\n\t\t\t\t\t\t'options' => [\n\n\t\t\t\t\t\t\t// Widgets data\n\t\t\t\t\t\t\t'data' => '{\"widget_nav_menu\":[{\"term_id\":41,\"name\":\"Services\"},{\"term_id\":42,\"name\":\"Projects\"},{\"term_id\":43,\"name\":\"Company\"}]}',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/construction/',\n\t\t\t],\n\n\t\t\t// Travel\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'travel',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Travel',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-travel',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'advanced-custom-fields-pro',\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t\t'portfolio-post-type',\n\t\t\t\t\t\t\t'ninja-forms',\n\t\t\t\t\t\t\t'bookingcom-official-searchbox',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t\t'portfolio' => 'Portfolio',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'front_page' => 'Home',\n\t\t\t\t\t\t\t'posts_page' => 'News',\n\t\t\t\t\t\t\t'menus' => [\n\t\t\t\t\t\t\t\t'main-menu' => 'Basic',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Revolution Slider\n\t\t\t\t\t'revslider' => [\n\t\t\t\t\t\t'type' => 'revolution-slider',\n\t\t\t\t\t\t'src' => [\n\t\t\t\t\t\t\t'revslider-main-slider.zip',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'requires' => 'revslider',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Widgets\n\t\t\t\t\t'widgets' => [\n\t\t\t\t\t\t'type' => 'wordpress-widgets',\n\t\t\t\t\t\t'src' => 'widgets.wie',\n\t\t\t\t\t\t'options' => [\n\n\t\t\t\t\t\t\t// Widgets data\n\t\t\t\t\t\t\t'data' => '{\"widget_nav_menu\":[{\"term_id\":24,\"name\":\"Basic\"},{\"term_id\":4,\"name\":\"Destinations\"},{\"term_id\":5,\"name\":\"Tickets\"},{\"term_id\":6,\"name\":\"Tourism\"},{\"term_id\":7,\"name\":\"Information\"},{\"term_id\":6,\"name\":\"Tourism\"},{\"term_id\":5,\"name\":\"Tickets\"},{\"term_id\":7,\"name\":\"Information\"},{\"term_id\":4,\"name\":\"Destinations\"},{\"term_id\":24,\"name\":\"Basic\"}]}',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/travel/',\n\t\t\t],\n\n\t\t\t// Photography\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'photography',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Photography',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-photography',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'advanced-custom-fields-pro',\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t\t'portfolio-post-type',\n\t\t\t\t\t\t\t'ninja-forms',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t\t'portfolio' => 'Portfolio',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'front_page' => 'Work',\n\t\t\t\t\t\t\t'posts_page' => 'Blog',\n\t\t\t\t\t\t\t'menus' => [\n\t\t\t\t\t\t\t\t'main-menu' => 'Main Menu',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Widgets\n\t\t\t\t\t'widgets' => [\n\t\t\t\t\t\t'type' => 'wordpress-widgets',\n\t\t\t\t\t\t'src' => 'widgets.wie',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/photography/',\n\t\t\t],\n\n\t\t\t// Landing Page\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'landing',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Landing Page',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-landing',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'advanced-custom-fields-pro',\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'front_page' => 'Homepage',\n\t\t\t\t\t\t\t'posts_page' => 'Blog',\n\t\t\t\t\t\t\t'menus' => [\n\t\t\t\t\t\t\t\t'main-menu' => 'One Page Menu',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Revolution Slider\n\t\t\t\t\t'revslider' => [\n\t\t\t\t\t\t'type' => 'revolution-slider',\n\t\t\t\t\t\t'src' => [\n\t\t\t\t\t\t\t'revslider-landing.zip',\n\t\t\t\t\t\t\t'revslider-apple-watch.zip',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'requires' => 'revslider',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/landing/',\n\t\t\t],\n\n\t\t\t// Shop\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'shop',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Shop',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-shop',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'advanced-custom-fields-pro',\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t\t'woocommerce',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t\t'product' => 'Products',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'front_page' => 'Homepage',\n\t\t\t\t\t\t\t'posts_page' => 'Blog',\n\t\t\t\t\t\t\t'menus' => [\n\t\t\t\t\t\t\t\t'main-menu' => 'Main Menu',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'woocommerce' => [\n\n\t\t\t\t\t\t\t\t// Pages\n\t\t\t\t\t\t\t\t'pages' => [\n\t\t\t\t\t\t\t\t\t'shop' => 'Shop',\n\t\t\t\t\t\t\t\t\t'cart' => 'Cart',\n\t\t\t\t\t\t\t\t\t'checkout' => 'Checkout',\n\t\t\t\t\t\t\t\t\t'myaccount' => 'My Account',\n\t\t\t\t\t\t\t\t],\n\n\t\t\t\t\t\t\t\t// Thumbnails\n\t\t\t\t\t\t\t\t'thumbnails' => [\n\t\t\t\t\t\t\t\t\t'cropping' => 'custom',\n\t\t\t\t\t\t\t\t\t'cropping_custom_width' => 11,\n\t\t\t\t\t\t\t\t\t'cropping_custom_height' => 14,\n\t\t\t\t\t\t\t\t\t'image_width' => 550,\n\t\t\t\t\t\t\t\t],\n\n\t\t\t\t\t\t\t\t// Other Options\n\t\t\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t\t'woocommerce_catalog_columns' => 3,\n\t\t\t\t\t\t\t\t\t'woocommerce_catalog_rows' => 4,\n\t\t\t\t\t\t\t\t],\n\n\t\t\t\t\t\t\t\t// Taxonomy data\n\t\t\t\t\t\t\t\t'taxonomy_data' => '[{\"taxonomy\":\"product_cat\",\"slug\":\"accessories\",\"name\":\"Accessories\",\"thumbnail\":\"2017\\/01\\/landscape1.jpg\"},{\"taxonomy\":\"product_cat\",\"slug\":\"children\",\"name\":\"Children\",\"thumbnail\":\"2017\\/01\\/landscape4.jpg\"},{\"taxonomy\":\"product_cat\",\"slug\":\"home\",\"name\":\"Home\",\"thumbnail\":\"2017\\/01\\/landscape2.jpg\"},{\"taxonomy\":\"product_cat\",\"slug\":\"magazines\",\"name\":\"Magazines\",\"thumbnail\":\"2017\\/01\\/landscape6.jpg\"},{\"taxonomy\":\"product_cat\",\"slug\":\"office\",\"name\":\"Office\",\"thumbnail\":\"2017\\/01\\/landscape3.jpg\"},{\"taxonomy\":\"product_cat\",\"slug\":\"outdoor\",\"name\":\"Outdoor\",\"thumbnail\":\"2017\\/01\\/landscape5.jpg\"},{\"taxonomy\":\"product_tag\",\"slug\":\"backpack\",\"name\":\"backpack\"},{\"taxonomy\":\"product_tag\",\"slug\":\"bag\",\"name\":\"bag\"},{\"taxonomy\":\"product_tag\",\"slug\":\"black\",\"name\":\"black\"},{\"taxonomy\":\"product_tag\",\"slug\":\"wolfiee\",\"name\":\"wolfiee\"},{\"taxonomy\":\"pa_color\",\"slug\":\"black\",\"name\":\"Black\"},{\"taxonomy\":\"pa_color\",\"slug\":\"blue\",\"name\":\"Blue\"},{\"taxonomy\":\"pa_color\",\"slug\":\"green\",\"name\":\"Green\"},{\"taxonomy\":\"pa_color\",\"slug\":\"brown\",\"name\":\"Brown\"},{\"taxonomy\":\"pa_color\",\"slug\":\"red\",\"name\":\"Red\"},{\"taxonomy\":\"pa_color\",\"slug\":\"turquoise\",\"name\":\"Turquoise\"},{\"taxonomy\":\"pa_color\",\"slug\":\"white\",\"name\":\"White\"},{\"taxonomy\":\"pa_color\",\"slug\":\"yellow\",\"name\":\"Yellow\"},{\"taxonomy\":\"pa_dimensions\",\"slug\":\"h1-5-x-w-2-75-x-d-3-0\",\"name\":\"H:1.5\\\" x W: 2.75\\\" x D: 3.0\\\"\"},{\"taxonomy\":\"pa_materials\",\"slug\":\"aluminium\",\"name\":\"Aluminium\"},{\"taxonomy\":\"pa_materials\",\"slug\":\"copper\",\"name\":\"Copper\"},{\"taxonomy\":\"pa_materials\",\"slug\":\"leather\",\"name\":\"Leather\"},{\"taxonomy\":\"pa_materials\",\"slug\":\"nylon\",\"name\":\"Nylon\"},{\"taxonomy\":\"pa_materials\",\"slug\":\"steel\",\"name\":\"Steel\"},{\"taxonomy\":\"pa_materials\",\"slug\":\"wood\",\"name\":\"Wood\"}]',\n\n\t\t\t\t\t\t\t\t// Attribute taxonomies\n\t\t\t\t\t\t\t\t'attribute_taxonomies' => '[{\"attribute_name\":\"color\",\"attribute_label\":\"Color\"},{\"attribute_name\":\"dimensions\",\"attribute_label\":\"Dimensions\"},{\"attribute_name\":\"materials\",\"attribute_label\":\"Materials\"}]',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Revolution Slider\n\t\t\t\t\t'revslider' => [\n\t\t\t\t\t\t'type' => 'revolution-slider',\n\t\t\t\t\t\t'src' => [\n\t\t\t\t\t\t\t'revslider-shop_slider.zip',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'requires' => 'revslider',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Widgets\n\t\t\t\t\t'widgets' => [\n\t\t\t\t\t\t'type' => 'wordpress-widgets',\n\t\t\t\t\t\t'src' => 'widgets.wie',\n\t\t\t\t\t\t'options' => [\n\n\t\t\t\t\t\t\t// Widgets data\n\t\t\t\t\t\t\t'data' => '{\"widget_nav_menu\":[{\"term_id\":38,\"name\":\"Footer - Home\"},{\"term_id\":39,\"name\":\"Footer - Office\"},{\"term_id\":40,\"name\":\"Footer - Magazines\"},{\"term_id\":41,\"name\":\"Footer - Children\"},{\"term_id\":42,\"name\":\"Footer - Outdoor\"},{\"term_id\":43,\"name\":\"Footer - Wall\"}]}'\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/shop/',\n\t\t\t],\n\n\t\t\t// Education\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'education',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Education',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-education',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'advanced-custom-fields-pro',\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t\t'portfolio-post-type',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t\t'portfolio' => 'Portfolio',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'front_page' => 'Homepage',\n\t\t\t\t\t\t\t'posts_page' => 'News',\n\t\t\t\t\t\t\t'menus' => [\n\t\t\t\t\t\t\t\t'main-menu' => 'Main Menu',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Revolution Slider\n\t\t\t\t\t'revslider' => [\n\t\t\t\t\t\t'type' => 'revolution-slider',\n\t\t\t\t\t\t'src' => [\n\t\t\t\t\t\t\t'revslider-contact.zip',\n\t\t\t\t\t\t\t'revslider-blog.zip',\n\t\t\t\t\t\t\t'revslider-homepage-slider.zip',\n\t\t\t\t\t\t\t'revslider-courses.zip',\n\t\t\t\t\t\t\t'revslider-news.zip',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'requires' => 'revslider',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Widgets\n\t\t\t\t\t'widgets' => [\n\t\t\t\t\t\t'type' => 'wordpress-widgets',\n\t\t\t\t\t\t'src' => 'widgets.wie',\n\t\t\t\t\t\t'options' => [\n\n\t\t\t\t\t\t\t// Widgets data\n\t\t\t\t\t\t\t'data' => '{\"widget_nav_menu\":[{\"term_id\":4,\"name\":\"Footer Menu 2\"},{\"term_id\":37,\"name\":\"Footer Menu 3\"},{\"term_id\":3,\"name\":\"Footer Menu 1\"},{\"term_id\":36,\"name\":\"Footer Menu 4\"}]}',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/education/',\n\t\t\t],\n\n\t\t\t// Fitness\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'fitness',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Fitness',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-fitness',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'advanced-custom-fields-pro',\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t\t'woocommerce',\n\t\t\t\t\t\t\t'portfolio-post-type',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t\t'portfolio' => 'Portfolio',\n\t\t\t\t\t\t\t\t'product' => 'Products',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'front_page' => 'Home',\n\t\t\t\t\t\t\t'posts_page' => 'Blog',\n\t\t\t\t\t\t\t'menus' => [ 'main-menu' => 'Main Menu' ],\n\t\t\t\t\t\t\t'woocommerce' => [\n\n\t\t\t\t\t\t\t\t// Pages\n\t\t\t\t\t\t\t\t'pages' => [\n\t\t\t\t\t\t\t\t\t'shop' => 'Shop',\n\t\t\t\t\t\t\t\t\t'cart' => 'Cart',\n\t\t\t\t\t\t\t\t\t'checkout' => 'Checkout',\n\t\t\t\t\t\t\t\t\t'myaccount' => 'My Account',\n\t\t\t\t\t\t\t\t],\n\n\t\t\t\t\t\t\t\t// Thumbnails\n\t\t\t\t\t\t\t\t'thumbnails' => [\n\t\t\t\t\t\t\t\t\t'cropping' => 'custom',\n\t\t\t\t\t\t\t\t\t'cropping_custom_width' => 4,\n\t\t\t\t\t\t\t\t\t'cropping_custom_height' => 5,\n\t\t\t\t\t\t\t\t\t'image_width' => 300,\n\t\t\t\t\t\t\t\t],\n\n\t\t\t\t\t\t\t\t// Other Options\n\t\t\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t\t'woocommerce_catalog_columns' => 3,\n\t\t\t\t\t\t\t\t\t'woocommerce_catalog_rows' => 4,\n\t\t\t\t\t\t\t\t],\n\n\t\t\t\t\t\t\t\t// Taxonomy data\n\t\t\t\t\t\t\t\t'taxonomy_data' => '[{\"taxonomy\":\"product_cat\",\"slug\":\"concentrated-series\",\"name\":\"Concentrated Series\"},{\"taxonomy\":\"product_cat\",\"slug\":\"essential-series\",\"name\":\"Essential Series\"},{\"taxonomy\":\"product_cat\",\"slug\":\"performance-series\",\"name\":\"Performance Series\"},{\"taxonomy\":\"product_cat\",\"slug\":\"premium-series\",\"name\":\"Premium Series\"},{\"taxonomy\":\"product_cat\",\"slug\":\"sx-7-series\",\"name\":\"SX-7 Series\"},{\"taxonomy\":\"product_tag\",\"slug\":\"acid\",\"name\":\"acid\"},{\"taxonomy\":\"product_tag\",\"slug\":\"amino\",\"name\":\"amino\"},{\"taxonomy\":\"product_tag\",\"slug\":\"amplifier\",\"name\":\"amplifier\"},{\"taxonomy\":\"product_tag\",\"slug\":\"anabolic\",\"name\":\"anabolic\"},{\"taxonomy\":\"product_tag\",\"slug\":\"anotest\",\"name\":\"anotest\"},{\"taxonomy\":\"product_tag\",\"slug\":\"bcaa\",\"name\":\"bcaa\"},{\"taxonomy\":\"product_tag\",\"slug\":\"build\",\"name\":\"build\"},{\"taxonomy\":\"product_tag\",\"slug\":\"cell\",\"name\":\"cell\"},{\"taxonomy\":\"product_tag\",\"slug\":\"cell-tech\",\"name\":\"cell tech\"},{\"taxonomy\":\"product_tag\",\"slug\":\"concentrated\",\"name\":\"concentrated\"},{\"taxonomy\":\"product_tag\",\"slug\":\"creacore\",\"name\":\"creacore\"},{\"taxonomy\":\"product_tag\",\"slug\":\"creatine\",\"name\":\"creatine\"},{\"taxonomy\":\"product_tag\",\"slug\":\"double-strenght\",\"name\":\"double strenght\"},{\"taxonomy\":\"product_tag\",\"slug\":\"elite\",\"name\":\"elite\"},{\"taxonomy\":\"product_tag\",\"slug\":\"essential\",\"name\":\"essential\"},{\"taxonomy\":\"product_tag\",\"slug\":\"formula\",\"name\":\"formula\"},{\"taxonomy\":\"product_tag\",\"slug\":\"fruit-punch\",\"name\":\"fruit punch\"},{\"taxonomy\":\"product_tag\",\"slug\":\"halo\",\"name\":\"halo\"},{\"taxonomy\":\"product_tag\",\"slug\":\"hardcore\",\"name\":\"hardcore\"},{\"taxonomy\":\"product_tag\",\"slug\":\"hydroxycut\",\"name\":\"hydroxycut\"},{\"taxonomy\":\"product_tag\",\"slug\":\"iso-zero\",\"name\":\"iso zero\"},{\"taxonomy\":\"product_tag\",\"slug\":\"liquid\",\"name\":\"liquid\"},{\"taxonomy\":\"product_tag\",\"slug\":\"muscle\",\"name\":\"muscle\"},{\"taxonomy\":\"product_tag\",\"slug\":\"nano\",\"name\":\"nano\"},{\"taxonomy\":\"product_tag\",\"slug\":\"performance\",\"name\":\"performance\"},{\"taxonomy\":\"product_tag\",\"slug\":\"pure\",\"name\":\"pure\"},{\"taxonomy\":\"product_tag\",\"slug\":\"push10\",\"name\":\"push10\"},{\"taxonomy\":\"product_tag\",\"slug\":\"shatter\",\"name\":\"shatter\"},{\"taxonomy\":\"product_tag\",\"slug\":\"stim-free\",\"name\":\"stim free\"},{\"taxonomy\":\"product_tag\",\"slug\":\"sx7\",\"name\":\"sx7\"},{\"taxonomy\":\"product_tag\",\"slug\":\"tech\",\"name\":\"tech\"},{\"taxonomy\":\"product_tag\",\"slug\":\"vapor\",\"name\":\"vapor\"},{\"taxonomy\":\"pa_bcaas\",\"slug\":\"12g\",\"name\":\"12g\"},{\"taxonomy\":\"pa_bcaas\",\"slug\":\"15g\",\"name\":\"15g\"},{\"taxonomy\":\"pa_bcaas\",\"slug\":\"21g\",\"name\":\"21g\"},{\"taxonomy\":\"pa_bcaas\",\"slug\":\"2g\",\"name\":\"2g\"},{\"taxonomy\":\"pa_bcaas\",\"slug\":\"4g\",\"name\":\"4g\"},{\"taxonomy\":\"pa_bcaas\",\"slug\":\"5g\",\"name\":\"5g\"},{\"taxonomy\":\"pa_bcaas\",\"slug\":\"7g\",\"name\":\"7g\"},{\"taxonomy\":\"pa_bcaas\",\"slug\":\"8g\",\"name\":\"8g\"},{\"taxonomy\":\"pa_betaine\",\"slug\":\"11g\",\"name\":\"11g\"},{\"taxonomy\":\"pa_betaine\",\"slug\":\"12g\",\"name\":\"12g\"},{\"taxonomy\":\"pa_betaine\",\"slug\":\"1g\",\"name\":\"1g\"},{\"taxonomy\":\"pa_betaine\",\"slug\":\"2g\",\"name\":\"2g\"},{\"taxonomy\":\"pa_betaine\",\"slug\":\"3g\",\"name\":\"3g\"},{\"taxonomy\":\"pa_betaine\",\"slug\":\"4-5g\",\"name\":\"4.5g\"},{\"taxonomy\":\"pa_betaine\",\"slug\":\"7g\",\"name\":\"7g\"},{\"taxonomy\":\"pa_electrolytes\",\"slug\":\"no\",\"name\":\"No\"},{\"taxonomy\":\"pa_electrolytes\",\"slug\":\"yes\",\"name\":\"Yes\"},{\"taxonomy\":\"pa_leucine\",\"slug\":\"10g\",\"name\":\"10g\"},{\"taxonomy\":\"pa_leucine\",\"slug\":\"13g\",\"name\":\"13g\"},{\"taxonomy\":\"pa_leucine\",\"slug\":\"15g\",\"name\":\"15g\"},{\"taxonomy\":\"pa_leucine\",\"slug\":\"1g\",\"name\":\"1g\"},{\"taxonomy\":\"pa_leucine\",\"slug\":\"2-5g\",\"name\":\"2.5g\"},{\"taxonomy\":\"pa_leucine\",\"slug\":\"2g\",\"name\":\"2g\"},{\"taxonomy\":\"pa_leucine\",\"slug\":\"4g\",\"name\":\"4g\"},{\"taxonomy\":\"pa_leucine\",\"slug\":\"5-6g\",\"name\":\"5.6g\"},{\"taxonomy\":\"pa_leucine\",\"slug\":\"5g\",\"name\":\"5g\"},{\"taxonomy\":\"pa_taurine\",\"slug\":\"0-5g\",\"name\":\"0.5g\"},{\"taxonomy\":\"pa_taurine\",\"slug\":\"10g\",\"name\":\"10g\"},{\"taxonomy\":\"pa_taurine\",\"slug\":\"11g\",\"name\":\"11g\"},{\"taxonomy\":\"pa_taurine\",\"slug\":\"12g\",\"name\":\"12g\"},{\"taxonomy\":\"pa_taurine\",\"slug\":\"1g\",\"name\":\"1g\"},{\"taxonomy\":\"pa_taurine\",\"slug\":\"21\",\"name\":\"21\"},{\"taxonomy\":\"pa_taurine\",\"slug\":\"2g\",\"name\":\"2g\"},{\"taxonomy\":\"pa_taurine\",\"slug\":\"3g\",\"name\":\"3g\"},{\"taxonomy\":\"pa_taurine\",\"slug\":\"4g\",\"name\":\"4g\"},{\"taxonomy\":\"pa_taurine\",\"slug\":\"9g\",\"name\":\"9g\"}]',\n\n\t\t\t\t\t\t\t\t// Attribute taxonomies\n\t\t\t\t\t\t\t\t'attribute_taxonomies' => '[{\"attribute_name\":\"bcaas\",\"attribute_label\":\"BCAAs\"},{\"attribute_name\":\"betaine\",\"attribute_label\":\"Betaine\"},{\"attribute_name\":\"electrolytes\",\"attribute_label\":\"Electrolytes\"},{\"attribute_name\":\"leucine\",\"attribute_label\":\"Leucine\"},{\"attribute_name\":\"taurine\",\"attribute_label\":\"Taurine\"}]',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Revolution Slider\n\t\t\t\t\t'revslider' => [\n\t\t\t\t\t\t'type' => 'revolution-slider',\n\t\t\t\t\t\t'src' => [\n\t\t\t\t\t\t\t'revslider-membership.zip',\n\t\t\t\t\t\t\t'revslider-homepage.zip',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'requires' => 'revslider',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Widgets\n\t\t\t\t\t'widgets' => [\n\t\t\t\t\t\t'type' => 'wordpress-widgets',\n\t\t\t\t\t\t'src' => 'widgets.wie',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/fitness/',\n\t\t\t],\n\n\t\t\t// Freelancer\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'freelancer',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Freelancer',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-freelancer',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'advanced-custom-fields-pro',\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t\t'portfolio-post-type',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t\t'portfolio' => 'Portfolio',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'front_page' => 'Portfolio',\n\t\t\t\t\t\t\t'posts_page' => 'Blog',\n\t\t\t\t\t\t\t'menus' => [\n\t\t\t\t\t\t\t\t'main-menu' => 'Main Menu',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Widgets\n\t\t\t\t\t'widgets' => [\n\t\t\t\t\t\t'type' => 'wordpress-widgets',\n\t\t\t\t\t\t'src' => 'widgets.wie',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/freelancer/',\n\t\t\t],\n\n\t\t\t// Blogging\n\t\t\t[\n\t\t\t\t// Content pack ID\n\t\t\t\t'id' => 'blogging',\n\n\t\t\t\t// Name\n\t\t\t\t'name' => 'Blogging',\n\n\t\t\t\t// Import data\n\t\t\t\t'import' => [\n\n\t\t\t\t\t// Child theme\n\t\t\t\t\t'child-theme' => [\n\t\t\t\t\t\t'type' => 'install-child-theme',\n\t\t\t\t\t\t'src' => 'child-theme.zip',\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'name' => 'kalium-child-blogging',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// WordPress Content XML\n\t\t\t\t\t'content' => [\n\t\t\t\t\t\t'type' => 'wordpress-import',\n\t\t\t\t\t\t'src' => 'content.xml',\n\t\t\t\t\t\t'requires' => [\n\t\t\t\t\t\t\t'advanced-custom-fields-pro',\n\t\t\t\t\t\t\t'js_composer',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t'post_types' => [\n\t\t\t\t\t\t\t\t'attachment' => 'Media Files',\n\t\t\t\t\t\t\t\t'post' => 'Posts',\n\t\t\t\t\t\t\t\t'page' => 'Page',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'menus' => [\n\t\t\t\t\t\t\t\t'main-menu' => 'Main Menu',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\n\t\t\t\t\t// Theme Options\n\t\t\t\t\t'theme-options' => [\n\t\t\t\t\t\t'type' => 'theme-options',\n\t\t\t\t\t\t'src' => 'theme-options-base64.txt',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Widgets\n\t\t\t\t\t'widgets' => [\n\t\t\t\t\t\t'type' => 'wordpress-widgets',\n\t\t\t\t\t\t'src' => 'widgets.wie',\n\t\t\t\t\t],\n\n\t\t\t\t\t// Typolab\n\t\t\t\t\t'typolab' => [\n\t\t\t\t\t\t'type' => 'typography-typolab',\n\t\t\t\t\t\t'src' => 'typolab.json',\n\t\t\t\t\t],\n\t\t\t\t],\n\n\t\t\t\t// Preview URL\n\t\t\t\t'url' => 'https://demo.kaliumtheme.com/blogging/',\n\t\t\t],\n\t\t] );\n\t}",
"function razz_demo_content( $demos ) {\n\t$demos_array = array(\n\t\t'blog-demo' => array(\n\t\t\t'title' => esc_html__( 'Main Demo', 'razz' ),\n\t\t\t'screenshot' => 'http://bbioon.com/razz/demos/content/blog.png',\n\t\t\t'preview_link' => 'http://bbioon.com/razz/blog'\n\t\t),\n\t);\n\n\t$download_url = 'http://www.bbioon.com/razz/demos/index.php';\n\n\tforeach ( $demos_array as $id => $data ) {\n\t\t$demo = new FW_Ext_Backups_Demo( $id, 'piecemeal', array(\n\t\t\t'url' => $download_url,\n\t\t\t'file_id' => $id,\n\t\t) );\n\t\t$demo->set_title( $data['title'] );\n\t\t$demo->set_screenshot( $data['screenshot'] );\n\t\t$demo->set_preview_link( $data['preview_link'] );\n\t\t$demos[ $demo->get_id() ] = $demo;\n\t\tunset( $demo );\n\t}\n\n\treturn $demos;\n}",
"private function assetContainers()\n {\n return collect(\n Folder::disk('content')->getFilesByType('assets', 'yaml')\n )->map(function ($path) {\n return [\n 'id' => substr($path, 7, -5),\n 'data' => YAML::parse(Parse::env(File::disk('content')->get($path)))\n ];\n })->pluck('data', 'id');\n }",
"public function getExamples() {\n\t\t$out = [];\n\t\t$finder = new Finder();\n\t\t$finder->files()->in( dirname( __DIR__, 2 ) . '/templates/examples' );\n\t\tforeach ( $finder as $file ) {\n\t\t\t$out[] = [\n\t\t\t\t'generator' => $file->getExtension(),\n\t\t\t\t'name' => $file->getFilename(),\n\t\t\t\t'source' => file_get_contents( $file->getRealPath() ),\n\t\t\t];\n\t\t}\n\t\treturn $out;\n\t}",
"function publisher_demo_raw_content() {\n\n\t$style_id = 'clean-sport';\n\t$prefix = $style_id . '-'; // prevent caching when user installs multiple demos continuously\n\t$demo_path = PUBLISHER_THEME_PATH . 'includes/demos/' . $style_id . '/';\n\t$demo_image_url = publisher_get_demo_images_url( $style_id );\n\n\treturn array(\n\n\t\t//\n\t\t// ->Taxonomies\n\t\t//\n\t\t'taxonomy' => array(\n\t\t\t'multi_steps' => false,\n\t\t\tarray(\n\t\t\t\t//\n\t\t\t\t// Rugby cats\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-rugby',\n\t\t\t\t\t'name' => 'Rugby',\n\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t'term_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'page_listing',\n\t\t\t\t\t\t\t'meta_value' => 'grid-1',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'better_slider_style',\n\t\t\t\t\t\t\t'meta_value' => 'style-1',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'better_slider_gradient',\n\t\t\t\t\t\t\t'meta_value' => 'simple-gr',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'term_color',\n\t\t\t\t\t\t\t'meta_value' => '#bf1a2c',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'term_posts_count',\n\t\t\t\t\t\t\t'meta_value' => 6,\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-rugby-union',\n\t\t\t\t\t'name' => 'Rugby Union',\n\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t'parent' => '%%bs-rugby%%',\n\t\t\t\t\t'term_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'page_listing',\n\t\t\t\t\t\t\t'meta_value' => 'grid-1',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'better_slider_style',\n\t\t\t\t\t\t\t'meta_value' => 'style-1',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'better_slider_gradient',\n\t\t\t\t\t\t\t'meta_value' => 'simple-gr',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'term_color',\n\t\t\t\t\t\t\t'meta_value' => '#bf1a2c',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-rugby-league',\n\t\t\t\t\t'name' => 'Rugby League',\n\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t'parent' => '%%bs-rugby%%',\n\t\t\t\t\t'term_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'page_listing',\n\t\t\t\t\t\t\t'meta_value' => 'grid-1',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'better_slider_style',\n\t\t\t\t\t\t\t'meta_value' => 'style-1',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'better_slider_gradient',\n\t\t\t\t\t\t\t'meta_value' => 'simple-gr',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'term_color',\n\t\t\t\t\t\t\t'meta_value' => '#bf1a2c',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-nfl',\n\t\t\t\t\t'name' => 'NFL',\n\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t'parent' => '%%bs-rugby%%',\n\t\t\t\t\t'term_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'page_listing',\n\t\t\t\t\t\t\t'meta_value' => 'grid-1',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'better_slider_style',\n\t\t\t\t\t\t\t'meta_value' => 'style-1',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'better_slider_gradient',\n\t\t\t\t\t\t\t'meta_value' => 'simple-gr',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'term_color',\n\t\t\t\t\t\t\t'meta_value' => '#bf1a2c',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\n\n\t\t\t\t//\n\t\t\t\t// Soccer cat\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-soccer',\n\t\t\t\t\t'name' => 'Soccer',\n\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t'term_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'page_listing',\n\t\t\t\t\t\t\t'meta_value' => 'classic-1',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'term_posts_count',\n\t\t\t\t\t\t\t'meta_value' => 6,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'better_slider_style',\n\t\t\t\t\t\t\t'meta_value' => 'style-5',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'better_slider_gradient',\n\t\t\t\t\t\t\t'meta_value' => 'simple-gr',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'term_color',\n\t\t\t\t\t\t\t'meta_value' => '#15b842',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\n\t\t\t\t//\n\t\t\t\t// Baseball cat\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-baseball',\n\t\t\t\t\t'name' => 'Baseball',\n\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t'term_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'page_listing',\n\t\t\t\t\t\t\t'meta_value' => 'grid-1',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'term_posts_count',\n\t\t\t\t\t\t\t'meta_value' => 8,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'better_slider_style',\n\t\t\t\t\t\t\t'meta_value' => 'style-3',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'better_slider_gradient',\n\t\t\t\t\t\t\t'meta_value' => 'simple-gr',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'term_color',\n\t\t\t\t\t\t\t'meta_value' => '#8ea907',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\n\t\t\t\t//\n\t\t\t\t// Basketball cat\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-basketball',\n\t\t\t\t\t'name' => 'Basketball',\n\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t'term_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'page_listing',\n\t\t\t\t\t\t\t'meta_value' => 'default',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'term_posts_count',\n\t\t\t\t\t\t\t'meta_value' => 8,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'better_slider_style',\n\t\t\t\t\t\t\t'meta_value' => 'style-3',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'better_slider_gradient',\n\t\t\t\t\t\t\t'meta_value' => 'simple-gr',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'term_color',\n\t\t\t\t\t\t\t'meta_value' => '#dc461c',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\n\t\t\t\t//\n\t\t\t\t// Hockey cat\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-hockey',\n\t\t\t\t\t'name' => 'Hockey',\n\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t'term_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'page_listing',\n\t\t\t\t\t\t\t'meta_value' => 'default',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'term_posts_count',\n\t\t\t\t\t\t\t'meta_value' => 8,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'better_slider_style',\n\t\t\t\t\t\t\t'meta_value' => 'style-3',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'better_slider_gradient',\n\t\t\t\t\t\t\t'meta_value' => 'simple-gr',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'term_color',\n\t\t\t\t\t\t\t'meta_value' => '#30bde8',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\n\n\t\t\t\t//\n\t\t\t\t// Golf cat\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-golf',\n\t\t\t\t\t'name' => 'Golf',\n\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t'term_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'page_listing',\n\t\t\t\t\t\t\t'meta_value' => 'default',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'term_posts_count',\n\t\t\t\t\t\t\t'meta_value' => 8,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'better_slider_style',\n\t\t\t\t\t\t\t'meta_value' => 'style-3',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'better_slider_gradient',\n\t\t\t\t\t\t\t'meta_value' => 'simple-gr',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'term_color',\n\t\t\t\t\t\t\t'meta_value' => '#006c02',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\n\t\t\t)\n\t\t), // taxonomies\n\n\n\t\t//\n\t\t// ->Medias\n\t\t//\n\t\t'media' => array(\n\n\t\t\t'multi_steps' => true,\n\t\t\t'uninstall_multi_steps' => false,\n\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-bg',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'bg.jpg',\n\t\t\t\t'resize' => false,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-logo',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'logo.png',\n\t\t\t\t'resize' => false,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-email',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'email-illustration.png',\n\t\t\t\t'resize' => false,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-ad-940x160',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'ad-940x160.png',\n\t\t\t\t'resize' => false,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-ad-180x480',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'ad-180x480.png',\n\t\t\t\t'resize' => false,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-ad-728x90',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'ad-728x90.png',\n\t\t\t\t'resize' => false,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-ad-300x250',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'ad-300x250.png',\n\t\t\t\t'resize' => false,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-ad-120x240',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'ad-120x240.png',\n\t\t\t\t'resize' => false,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-icon-rugby',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'icon-rugby.png',\n\t\t\t\t'resize' => false,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-icon-soccer',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'icon-soccer.png',\n\t\t\t\t'resize' => false,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-icon-baseball',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'icon-baseball.png',\n\t\t\t\t'resize' => false,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-icon-basketball',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'icon-basketball.png',\n\t\t\t\t'resize' => false,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-icon-hockey',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'icon-hockey.png',\n\t\t\t\t'resize' => false,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-icon-golf',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'icon-golf.png',\n\t\t\t\t'resize' => false,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-icon-more',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'icon-more.png',\n\t\t\t\t'resize' => false,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-1',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-1.jpg',\n\t\t\t\t'resize' => true\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-2',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-2.jpg',\n\t\t\t\t'resize' => true\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-3',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-3.jpg',\n\t\t\t\t'resize' => true\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-4',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-4.jpg',\n\t\t\t\t'resize' => true\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-5',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-5.jpg',\n\t\t\t\t'resize' => true\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-6',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-6.jpg',\n\t\t\t\t'resize' => true\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-7',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-7.jpg',\n\t\t\t\t'resize' => true\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-8',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-8.jpg',\n\t\t\t\t'resize' => true\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-9',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-9.jpg',\n\t\t\t\t'resize' => true\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-10',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-10.jpg',\n\t\t\t\t'resize' => true\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-11',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-11.jpg',\n\t\t\t\t'resize' => true\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-12',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-12.jpg',\n\t\t\t\t'resize' => true\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-13',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-13.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t\t'description' => 'Photo credit: photographed by Pressfoto on Freepik.com',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-14',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-14.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t\t'description' => 'Photo credit: photographed by Pressfoto on Freepik.com',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-15',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-15.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t\t'description' => 'Photo credit: photographed by Pressfoto on Freepik.com',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-16',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-16.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t\t'description' => 'Photo credit: photographed by Pressfoto on Freepik.com',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-17',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-17.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t\t'description' => 'Photo credit: photographed by Pressfoto on Freepik.com',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-18',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-18.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t\t'description' => 'Photo credit: photographed by Pressfoto on Freepik.com',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-19',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-19.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-20',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-20.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-21',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-21.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-22',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-22.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-23',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-23.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-24',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-24.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-25',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-25.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-26',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-26.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-27',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-27.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-28',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-28.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-29',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-29.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-30',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-30.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-31',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-31.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-32',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-32.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-33',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'thumb-33.jpg',\n\t\t\t\t'resize' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'the_id' => 'bs-media-post-content-1',\n\t\t\t\t'file' => $demo_image_url . $prefix . 'post-content-1.jpg',\n\t\t\t\t'resize' => false,\n\t\t\t),\n\n\t\t), // media\n\n\n\t\t//\n\t\t// ->Posts\n\t\t//\n\t\t'posts' => array(\n\t\t\t'multi_steps' => false,\n\t\t\tarray(\n\n\t\t\t\t//\n\t\t\t\t// Homepage\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-front-page',\n\t\t\t\t\t'post_title' => 'Front page',\n\t\t\t\t\t'post_content_file' => $demo_path . 'front-page.txt',\n\t\t\t\t\t'post_type' => 'page',\n\t\t\t\t\t'prepare_vc_css' => true,\n\t\t\t\t\t'post_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'page_layout',\n\t\t\t\t\t\t\t'meta_value' => '1-col',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => '_hide_title',\n\t\t\t\t\t\t\t'meta_value' => 1,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'post_breadcrumb',\n\t\t\t\t\t\t\t'meta_value' => 'hide',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\n\t\t\t\t//\n\t\t\t\t// Posts\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-rugby-1',\n\t\t\t\t\t'post_title' => 'Michigan State Quarterback Connor Cook Carves a Legacy With Pluck',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-1'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-4%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-rugby%%,%%bs-rugby-union%%,%%bs-nfl%%,%%bs-rugby-league%%',\n\t\t\t\t\t),\n\t\t\t\t\t'post_format' => 'video',\n\t\t\t\t\t'post_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => '_featured_embed_code',\n\t\t\t\t\t\t\t'meta_value' => 'https://www.youtube.com/watch?v=edyQGxDYIlI',\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-soccer-1',\n\t\t\t\t\t'post_title' => 'Croatia Beat Spain, 2-1, but the Notable Score Came From the Orchestra',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-8%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-soccer%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-baseball-1',\n\t\t\t\t\t'post_title' => 'I can’t believe all the features mashed into this micro-apartment',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-14%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-baseball%%',\n\t\t\t\t\t),\n\t\t\t\t\t'post_format' => 'video',\n\t\t\t\t\t'post_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => '_featured_embed_code',\n\t\t\t\t\t\t\t'meta_value' => 'https://www.youtube.com/watch?v=ICYwN3cx_28',\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-basketball-1',\n\t\t\t\t\t'post_title' => 'Michael Gbinije, a Piston Recruit, May Play for Nigeria at the Olympics',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-22%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-basketball%%',\n\t\t\t\t\t),\n\t\t\t\t\t'post_format' => 'video',\n\t\t\t\t\t'post_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => '_featured_embed_code',\n\t\t\t\t\t\t\t'meta_value' => 'https://www.youtube.com/watch?v=Yi3CrReo-S0',\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\n\n\t\t\t\t//\n\t\t\t\t// Rugby posts\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-rugby-2',\n\t\t\t\t\t'post_title' => 'Bill Simmons as TV Host: Heavy on Sports and Cursing',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-1%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-rugby%%,%%bs-rugby-league%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-rugby-3',\n\t\t\t\t\t'post_title' => 'N.F.L. Is Teaming With Cirque du Soleil to Draw New Fans',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-5%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-rugby%%,%%bs-nfl%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-rugby-4',\n\t\t\t\t\t'post_title' => 'Curley Johnson, Punter for Super Bowl-Winning Jets, Dies at 80',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-6%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-rugby%%,%%bs-rugby-union%%,%%bs-rugby-league%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-rugby-5',\n\t\t\t\t\t'post_title' => 'For Peyton Manning, the Setting Is Perfect for a Curtain Call',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-3%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-rugby%%,%%bs-nfl%%,%%bs-rugby-league%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-rugby-6',\n\t\t\t\t\t'post_title' => 'Willie Wood Made the Most Memorable Play of Super Bowl I. He Has No Recollection.',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-2%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-rugby%%,%%bs-rugby-league%%,%%bs-rugby-union%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-rugby-7',\n\t\t\t\t\t'post_title' => 'Ken Stabler, a Magnetic N.F.L. Star, Was Sapped of Spirit by C.T.E.',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-1%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-rugby%%,%%bs-rugby-league%%,%%bs-nfl%%',\n\t\t\t\t\t),\n\t\t\t\t\t'post_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'bs_featured_image_credit',\n\t\t\t\t\t\t\t'meta_value' => 'Photo credit: photographed by Pressfoto on Freepik.com',\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-rugby-8',\n\t\t\t\t\t'post_title' => 'The Town of Colma, Where San Francisco’s Dead Live',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-3%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-rugby%%,%%bs-nfl%%,%%bs-rugby-union%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-rugby-9',\n\t\t\t\t\t'post_title' => 'At Blinn College, Cam Newton Plotted a Return to the Big Time',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-4%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-rugby%%,%%bs-rugby-union%%,%%bs-rugby-league%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-rugby-10',\n\t\t\t\t\t'post_title' => 'Sports Business: As the Olympics Near, Brazil and Rio Let the Bad Times Roll',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-5%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-rugby%%,%%bs-rugby-union%%,%%bs-nfl%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\n\n\t\t\t\t//\n\t\t\t\t// Soccer posts\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-soccer-2',\n\t\t\t\t\t'post_title' => 'A Wild Euros Group Stage Whittles the Field Down to 16',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-7%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-soccer%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-soccer-3',\n\t\t\t\t\t'post_title' => 'Copa América: After U.S. Is Thrashed, Coach Asks for More',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-9%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-soccer%%',\n\t\t\t\t\t),\n\t\t\t\t\t'post_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => '_featured_embed_code',\n\t\t\t\t\t\t\t'meta_value' => 'https://soundcloud.com/lifeofdesiigner/desiigner-panda',\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'post_format' => 'audio',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-soccer-4',\n\t\t\t\t\t'post_title' => 'Smaller Copa América So Far Trumps the Bloated Euros',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-10%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-soccer%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-soccer-5',\n\t\t\t\t\t'post_title' => 'Jamie Vardy, Rejecting Arsenal’s Advances, Agrees to Stay at Leicester City',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-11%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-soccer%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-soccer-6',\n\t\t\t\t\t'post_title' => 'Chile Reaches Copa América Final With Shutout of Colombia',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-12%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-soccer%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-soccer-7',\n\t\t\t\t\t'post_title' => 'Chile Soccer Team Strengthened by Forays Away From Home',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-7%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-soccer%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-soccer-8',\n\t\t\t\t\t'post_title' => 'Wales Climbs a Mountain With Bale Leading the Way',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-8%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-soccer%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-soccer-9',\n\t\t\t\t\t'post_title' => 'A Narrow Loss for Northern Ireland, but a Rewarding One',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-9%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-soccer%%',\n\t\t\t\t\t),\n\t\t\t\t\t'post_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'bs_featured_image_credit',\n\t\t\t\t\t\t\t'meta_value' => 'Photo credit: photographed by Pressfoto on Freepik.com',\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-soccer-10',\n\t\t\t\t\t'post_title' => 'Poland Wins but Lewandowski Is Still Without a Goal',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-10%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-soccer%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\n\n\t\t\t\t//\n\t\t\t\t// Baseball posts\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-baseball-2',\n\t\t\t\t\t'post_title' => 'You can squeeze the world’s most compact folding pram into a shoulder bag',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-13%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-baseball%%',\n\t\t\t\t\t),\n\t\t\t\t\t'post_format' => 'video',\n\t\t\t\t\t'post_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => '_featured_embed_code',\n\t\t\t\t\t\t\t'meta_value' => 'https://www.youtube.com/watch?v=708mjaHTwKc',\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-baseball-3',\n\t\t\t\t\t'post_title' => 'What type of camera do I need? A guide to buying your next one',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-15%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-baseball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-baseball-4',\n\t\t\t\t\t'post_title' => 'The FBI paid at least $1 million to get inside the San Bernardino shooter’s iPhone',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-16%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-baseball%%',\n\t\t\t\t\t),\n\t\t\t\t\t'post_format' => 'video',\n\t\t\t\t\t'post_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => '_featured_embed_code',\n\t\t\t\t\t\t\t'meta_value' => 'https://www.youtube.com/watch?v=eIpKzWU5Z2s',\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-baseball-5',\n\t\t\t\t\t'post_title' => 'A lovely ode to the sounds of a mechanical keyboard',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-17%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-baseball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-baseball-6',\n\t\t\t\t\t'post_title' => 'Samsung is trying really hard not to call these phones ‘Rose Gold’',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-18%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-baseball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-baseball-7',\n\t\t\t\t\t'post_title' => 'Apple’s trying to fix two key issues with wired and wireless headphones',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-13%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-baseball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-baseball-8',\n\t\t\t\t\t'post_title' => 'Upgrade to a high-baseball BBQ with these 7 must-have products',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-14%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-baseball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-baseball-9',\n\t\t\t\t\t'post_title' => 'Motorola’s budget Moto G phone: Coming soon in three new flavors',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-15%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-baseball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-baseball-10',\n\t\t\t\t\t'post_title' => 'Xiaomi buys 1,500 Microsoft patents, showing how much it wants the US market',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-16%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-baseball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-baseball-11',\n\t\t\t\t\t'post_title' => 'New York’s antiquated steering wheel law poses roadblock to driverless cars',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-17%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-baseball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-baseball-12',\n\t\t\t\t\t'post_title' => 'This monstrous battery can charge your phone for 40 days after the apocalypse',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-18%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-baseball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\n\n\t\t\t\t//\n\t\t\t\t// Basketball Posts\n\t\t\t\t//\n\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-basketball-2',\n\t\t\t\t\t'post_title' => 'Derrick Rose Expects to Be Appreciated ‘a Little Bit More’ as a Knick',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-21%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-basketball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-basketball-3',\n\t\t\t\t\t'post_title' => 'Nets Acquire Caris LeVert and Send Thaddeus Young to Pacers',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-19%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-basketball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-basketball-4',\n\t\t\t\t\t'post_title' => 'To Escape N.B.A.’s Depths, 76ers Go Down Under and Draft Ben Simmons',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-24%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-basketball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-basketball-5',\n\t\t\t\t\t'post_title' => 'Phil Jackson Outlines the Rewards and the Risks of His Newest Knick',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-23%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-basketball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-basketball-6',\n\t\t\t\t\t'post_title' => 'Ben Simmons Looks to LeBron James as Model as N.B.A. Draft Looms',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-19%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-basketball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-basketball-7',\n\t\t\t\t\t'post_title' => 'Why a Top 3 N.B.A. Draft Pick Is Crucial for Championship Teams',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-21%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-basketball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-basketball-8',\n\t\t\t\t\t'post_title' => 'LeBron James, Citing Need for Rest, Will Skip Rio Olympics',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-22%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-basketball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-basketball-9',\n\t\t\t\t\t'post_title' => 'On Pro Basketball: Twenty Years Apart, Signature Moments for LeBron James and Michael Jordan',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-20%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-basketball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-basketball-10',\n\t\t\t\t\t'post_title' => 'Open Season on Jeremy Lin? In Video, Fan Highlights Hard Fouls',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-23%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-basketball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-basketball-11',\n\t\t\t\t\t'post_title' => 'Sports Business: As the Olympics Near, Brazil and Rio Let the Bad Times Roll',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-24%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-basketball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-basketball-12',\n\t\t\t\t\t'post_title' => 'Sports of The Times: A Comeback for Gabby Douglas at Age 20. That’s Gymnastics',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-21%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-basketball%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\n\n\t\t\t\t//\n\t\t\t\t// Hockey posts\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-hockey-1',\n\t\t\t\t\t'post_title' => 'Youth Hockey’s Growth in U.S. Reaches First Round of the N.H.L. Draft',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-27%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-hockey%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-hockey-2',\n\t\t\t\t\t'post_title' => 'After Draft, Rangers Turn Their Attention to Deals and Free Agency',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-25%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-hockey%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-hockey-3',\n\t\t\t\t\t'post_title' => 'Mike Emrick, a Hockey Wordsmith, Prepares for a Transition to the Diamond',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-29%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-hockey%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-hockey-4',\n\t\t\t\t\t'post_title' => 'In Detroit, Gordie Howe Is Remembered as a Soft-Spoken Star',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-28%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-hockey%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-hockey-5',\n\t\t\t\t\t'post_title' => 'Penguins 3, Sharks 1 | Pittsburgh wins series, 4-2: Penguins Finish Off Sharks to Win Stanley Cup',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-26%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-hockey%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-hockey-6',\n\t\t\t\t\t'post_title' => 'Essay: Recalling a Time When Gordie Howe and His Sons Were the Power',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-27%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-hockey%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-hockey-7',\n\t\t\t\t\t'post_title' => 'Jaromir Jagr vs. Islanders: A Long, Point-Filled History',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-1'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-29%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-hockey%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-hockey-8',\n\t\t\t\t\t'post_title' => 'On Penalty Kill, Islanders Turn a Weakness Into a Weapon',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-28%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-hockey%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-hockey-9',\n\t\t\t\t\t'post_title' => 'Wayne Gretzky Has a Few Points to Make About a Decline in Scoring and Creativity',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-26%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-hockey%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-hockey-10',\n\t\t\t\t\t'post_title' => 'Honing Skills in U.S., a Group of Teenagers Is Fueling China’s Hockey Shift',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-25%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-hockey%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-hockey-11',\n\t\t\t\t\t'post_title' => 'Cleveland Realizes a Championship After All, Thanks to the Monsters',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-1'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-27%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-hockey%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-hockey-12',\n\t\t\t\t\t'post_title' => 'With N.H.L. Expansion, Las Vegas Hits the Jackpot: A Pro Team',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-28%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-hockey%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\n\n\t\t\t\t//\n\t\t\t\t// Golf posts\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-golf-1',\n\t\t\t\t\t'post_title' => 'Rory McIlroy Says He Won’t Attend Olympics Over Zika Concerns',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-32%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-golf%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-golf-2',\n\t\t\t\t\t'post_title' => 'U.S.G.A. Regrets ‘Distraction’ in Ruling Against Dustin Johnson',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-31%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-golf%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-golf-3',\n\t\t\t\t\t'post_title' => 'Unfairly Left in the Dark at the U.S. Open While Officials Consider',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-30%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-golf%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-golf-4',\n\t\t\t\t\t'post_title' => 'Dustin Johnson Wins U.S. Open at Oakmont for First Major Title',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-33%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-golf%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-golf-5',\n\t\t\t\t\t'post_title' => 'A Common Goal at the Top of the Leaderboard: Winning a First Major',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-32%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-golf%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-golf-6',\n\t\t\t\t\t'post_title' => 'On Golf: At U.S. Open, an Upstart-Friendly Course Favors Wisdom, for Now, Over Youth',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-31%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-golf%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-golf-7',\n\t\t\t\t\t'post_title' => 'Rain Stops Play at United States Open, Bringing Some Players Relief',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-30%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-golf%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-golf-8',\n\t\t\t\t\t'post_title' => 'On Golf: Unseen Violation Prompts a Striking Act From Shane Lowry',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-33%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-golf%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-golf-9',\n\t\t\t\t\t'post_title' => 'Englishman Rises in the Late-Afternoon Augusta Sun',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-2'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-32%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-golf%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-golf-10',\n\t\t\t\t\t'post_title' => 'Jordan Spieth Absorbs ‘a Tough One’ With Dignity',\n\t\t\t\t\t'post_excerpt_file' => $demo_path . 'post-excerpt-1.txt',\n\t\t\t\t\t'remote_content' => array(\n\t\t\t\t\t\t'content_id' => 'clean-sport-1'\n\t\t\t\t\t),\n\t\t\t\t\t'thumbnail_id' => '%%bs-media-31%%',\n\t\t\t\t\t'post_terms' => array(\n\t\t\t\t\t\t'category' => '%%bs-golf%%',\n\t\t\t\t\t),\n\t\t\t\t),\n\n\n\t\t\t\t//\n\t\t\t\t// BetterAds posts\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-ad-940x160',\n\t\t\t\t\t'post_title' => '940x180 Banner',\n\t\t\t\t\t'post_type' => 'better-banner',\n\t\t\t\t\t'post_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'type',\n\t\t\t\t\t\t\t'meta_value' => 'image'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'caption',\n\t\t\t\t\t\t\t'meta_value' => '- Advertisement -'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'url',\n\t\t\t\t\t\t\t'meta_value' => 'http://betterstudio.com/'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'img',\n\t\t\t\t\t\t\t'meta_value' => '%%bf_product_demo_media_url:{bs-media-ad-940x180}:\\'full\\'%%'\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-ad-180x480',\n\t\t\t\t\t'post_title' => '180x480 Banner',\n\t\t\t\t\t'post_type' => 'better-banner',\n\t\t\t\t\t'post_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'type',\n\t\t\t\t\t\t\t'meta_value' => 'image'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'caption',\n\t\t\t\t\t\t\t'meta_value' => '- Advertisement -'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'url',\n\t\t\t\t\t\t\t'meta_value' => 'http://betterstudio.com/'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'img',\n\t\t\t\t\t\t\t'meta_value' => '%%bf_product_demo_media_url:{bs-media-ad-180x480}:\\'full\\'%%'\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-ad-728x90',\n\t\t\t\t\t'post_title' => '728x90 Banner',\n\t\t\t\t\t'post_type' => 'better-banner',\n\t\t\t\t\t'post_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'type',\n\t\t\t\t\t\t\t'meta_value' => 'image'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'caption',\n\t\t\t\t\t\t\t'meta_value' => '- Advertisement -'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'url',\n\t\t\t\t\t\t\t'meta_value' => 'http://betterstudio.com/'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'img',\n\t\t\t\t\t\t\t'meta_value' => '%%bf_product_demo_media_url:{bs-media-ad-728x90}:\\'full\\'%%'\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-ad-300x250',\n\t\t\t\t\t'post_title' => '300x250 Banner',\n\t\t\t\t\t'post_type' => 'better-banner',\n\t\t\t\t\t'post_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'type',\n\t\t\t\t\t\t\t'meta_value' => 'image'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'caption',\n\t\t\t\t\t\t\t'meta_value' => '- Advertisement -'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'url',\n\t\t\t\t\t\t\t'meta_value' => 'http://betterstudio.com/'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'img',\n\t\t\t\t\t\t\t'meta_value' => '%%bf_product_demo_media_url:{bs-media-ad-300x250}:\\'full\\'%%'\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-ad-120x240-2',\n\t\t\t\t\t'post_title' => '120x240 Banner - 2',\n\t\t\t\t\t'post_type' => 'better-banner',\n\t\t\t\t\t'post_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'type',\n\t\t\t\t\t\t\t'meta_value' => 'image'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'caption',\n\t\t\t\t\t\t\t'meta_value' => '- Advertisement -'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'url',\n\t\t\t\t\t\t\t'meta_value' => 'http://betterstudio.com/'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'img',\n\t\t\t\t\t\t\t'meta_value' => '%%bf_product_demo_media_url:{bs-media-ad-120x240}:\\'full\\'%%'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'campaign',\n\t\t\t\t\t\t\t'meta_value' => '%%bs-post-ad-campaign-1%%'\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-ad-120x240-1',\n\t\t\t\t\t'post_title' => '120x240 Banner - 1',\n\t\t\t\t\t'post_type' => 'better-banner',\n\t\t\t\t\t'post_meta' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'type',\n\t\t\t\t\t\t\t'meta_value' => 'image'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'caption',\n\t\t\t\t\t\t\t'meta_value' => '- Advertisement -'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'url',\n\t\t\t\t\t\t\t'meta_value' => 'http://betterstudio.com/'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'img',\n\t\t\t\t\t\t\t'meta_value' => '%%bf_product_demo_media_url:{bs-media-ad-120x240}:\\'full\\'%%'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'meta_key' => 'campaign',\n\t\t\t\t\t\t\t'meta_value' => '%%bs-post-ad-campaign-1%%'\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'the_id' => 'bs-post-ad-campaign-1',\n\t\t\t\t\t'post_title' => '120 Banners Campaign',\n\t\t\t\t\t'post_type' => 'better-campaign',\n\t\t\t\t),\n\t\t\t)\n\t\t), // post\n\n\n\t\t//\n\t\t// ->Options\n\t\t//\n\t\t'options' => array(\n\n\t\t\t'multi_steps' => false,\n\n\t\t\t//step one\n\t\t\tarray(\n\t\t\t\t//\n\t\t\t\t// Panel options\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'option',\n\t\t\t\t\t'option_name' => publisher_get_theme_panel_id(),\n\t\t\t\t\t'option_value_file' => $demo_path . 'options.json',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'option',\n\t\t\t\t\t'option_name' => publisher_get_theme_panel_id(),\n\t\t\t\t\t'option_value' => array(\n\t\t\t\t\t\t'logo_text' => 'Publisher',\n\t\t\t\t\t\t'logo_image' => '%%bf_product_demo_media_url:{bs-logo}:\\'full\\'%%',\n\t\t\t\t\t\t'logo_image_retina' => '',\n\t\t\t\t\t),\n\t\t\t\t\t'merge_options' => true,\n\t\t\t\t),\n\n\t\t\t\t// Theme Style\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'option',\n\t\t\t\t\t'option_name' => publisher_get_theme_panel_id() . '_current_style',\n\t\t\t\t\t'option_value' => $style_id,\n\t\t\t\t),\n\n\t\t\t\t// Theme Demo\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'option',\n\t\t\t\t\t'option_name' => publisher_get_theme_panel_id() . '_current_demo',\n\t\t\t\t\t'option_value' => $style_id,\n\t\t\t\t),\n\n\n\t\t\t\t//\n\t\t\t\t// Update front page\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'option',\n\t\t\t\t\t'option_name' => 'page_on_front',\n\t\t\t\t\t'option_value' => '%%bs-front-page%%',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'option',\n\t\t\t\t\t'option_name' => 'show_on_front',\n\t\t\t\t\t'option_value' => 'page',\n\t\t\t\t),\n\n\t\t\t\t//\n\t\t\t\t// Aside Ad\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'option',\n\t\t\t\t\t'merge_options' => true,\n\t\t\t\t\t'option_name' => 'better_ads_manager',\n\t\t\t\t\t'option_value' => array(\n\t\t\t\t\t\t'header_aside_logo_type' => 'banner',\n\t\t\t\t\t\t'header_aside_logo_banner' => '%%bs-post-ad-728x90%%',\n\t\t\t\t\t\t'header_aside_logo_align' => is_rtl() ? 'left' : 'right',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t), // options\n\n\n\t\t//\n\t\t// ->Widgets\n\t\t//\n\t\t'widgets' => array(\n\t\t\t'multi_steps' => false,\n\t\t\tarray(\n\n\t\t\t\t//\n\t\t\t\t// Primary sidebar\n\t\t\t\t//\n\t\t\t\t'primary-sidebar' => array(\n\t\t\t\t\t'remove_all_widgets' => true,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'widget_id' => 'better-social-counter',\n\t\t\t\t\t\t'widget_settings' => array(\n\t\t\t\t\t\t\t'title' => 'Stay With Us',\n\t\t\t\t\t\t\t'order' => 'facebook,twitter,google,youtube,instagram,vimeo,pinterest,envato',\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'widget_id' => 'bs-mix-listing-3-4',\n\t\t\t\t\t\t'widget_settings' => array(\n\t\t\t\t\t\t\t'category' => '%%bs-gameplay%%',\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'widget_id' => 'better-ads',\n\t\t\t\t\t\t'widget_settings' => array(\n\t\t\t\t\t\t\t'title' => '',\n\t\t\t\t\t\t\t'type' => 'banner',\n\t\t\t\t\t\t\t'banner' => '%%bs-post-ad-300x250%%',\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'widget_id' => 'bs-text-listing-1',\n\t\t\t\t\t\t'widget_settings' => array(\n\t\t\t\t\t\t\t'title' => 'Latest News',\n\t\t\t\t\t\t\t'count' => 3,\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'widget_id' => 'bs-newsletter-mailchimp',\n\t\t\t\t\t\t'widget_settings' => array(\n\t\t\t\t\t\t\t'title' => 'Newsletter',\n\t\t\t\t\t\t\t'mailchimp-code' => '<form action=\"//betterstudio.us9.list-manage.com/subscribe/post?u=ed62711f285e19818a5c11811&id=4450ad741b\" method=\"post\"',\n\t\t\t\t\t\t\t'mailchimp-url' => '//betterstudio.us9.list-manage.com/subscribe/post?u=ed62711f285e19818a5c11811&id=4450ad741b',\n\t\t\t\t\t\t\t'msg' => 'Subscribe our newsletter to stay updated.',\n\t\t\t\t\t\t\t'image' => '%%bf_product_demo_media_url:{bs-media-email}:\\'full\\'%%',\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t),\n\n\t\t\t\t//\n\t\t\t\t// Secondary sidebar\n\t\t\t\t//\n\t\t\t\t'secondary-sidebar' => array(\n\t\t\t\t\t'remove_all_widgets' => true,\n\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'widget_id' => 'bs-text-listing-4',\n\t\t\t\t\t\t'widget_settings' => array(\n\t\t\t\t\t\t\t'title' => 'News',\n\t\t\t\t\t\t\t'count' => 8,\n\t\t\t\t\t\t\t'paginate' => 'slider',\n\t\t\t\t\t\t\t'slider-control-dots' => 'style-1',\n\t\t\t\t\t\t\t'slider-control-next-prev' => 'off',\n\t\t\t\t\t\t\t'bf-widget-title-icon' => array(\n\t\t\t\t\t\t\t\t'type' => 'fontawesome',\n\t\t\t\t\t\t\t\t'icon' => 'fa-rss',\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\tarray(\n\t\t\t\t\t\t'widget_id' => 'better-ads',\n\t\t\t\t\t\t'widget_settings' => array(\n\t\t\t\t\t\t\t'title' => '',\n\t\t\t\t\t\t\t'type' => 'banner',\n\t\t\t\t\t\t\t'banner' => '%%bs-post-ad-180x480%%',\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), // widgets\n\n\t\t//\n\t\t// ->Menus\n\t\t//\n\t\t'menus' => array(\n\t\t\t'multi_step' => false,\n\n\t\t\tarray(\n\t\t\t\t//\n\t\t\t\t// Topbar navigation\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'menu-name' => 'Topbar Navigation',\n\t\t\t\t\t'menu-location' => 'top-menu',\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'item_type' => 'term',\n\t\t\t\t\t\t\t'term_id' => '%%bs-baseball%%',\n\t\t\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'the_id' => 'bs-menu-top-soccer',\n\t\t\t\t\t\t\t'item_type' => 'term',\n\t\t\t\t\t\t\t'term_id' => '%%bs-soccer%%',\n\t\t\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\n\t\t\t\t//\n\t\t\t\t// Footer navigation\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'menu-name' => 'Footer Navigation',\n\t\t\t\t\t'menu-location' => 'footer-menu',\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'item_type' => 'page',\n\t\t\t\t\t\t\t'page_id' => '%%bs-front-page%%',\n\t\t\t\t\t\t\t'title' => 'Home',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'the_id' => 'bs-menu-top-soccer',\n\t\t\t\t\t\t\t'item_type' => 'term',\n\t\t\t\t\t\t\t'term_id' => '%%bs-soccer%%',\n\t\t\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'item_type' => 'term',\n\t\t\t\t\t\t\t'term_id' => '%%bs-baseball%%',\n\t\t\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'item_type' => 'term',\n\t\t\t\t\t\t\t'term_id' => '%%bs-rugby%%',\n\t\t\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\n\t\t\t\t//\n\t\t\t\t// Main navigation\n\t\t\t\t//\n\t\t\t\tarray(\n\t\t\t\t\t'menu-name' => 'Main Navigation',\n\t\t\t\t\t'menu-location' => 'main-menu',\n\t\t\t\t\t'recently-edit' => true,\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'the_id' => 'bs-homepages-parent',\n\t\t\t\t\t\t\t'item_type' => 'page',\n\t\t\t\t\t\t\t'title' => 'Home',\n\t\t\t\t\t\t\t'page_id' => '%%bs-front-page%%',\n\t\t\t\t\t\t\t'item_meta' => array(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'meta_key' => 'menu_icon',\n\t\t\t\t\t\t\t\t\t'meta_value' => array(\n\t\t\t\t\t\t\t\t\t\t'icon' => '%%bf_product_demo_media_url:{bs-media-icon-more}:\\'full\\'%%',\n\t\t\t\t\t\t\t\t\t\t'type' => 'custom',\n\t\t\t\t\t\t\t\t\t\t'width' => '',\n\t\t\t\t\t\t\t\t\t\t'height' => '18',\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),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'item_type' => 'term',\n\t\t\t\t\t\t\t'term_id' => '%%bs-rugby%%',\n\t\t\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t\t\t'item_meta' => array(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'meta_key' => 'menu_icon',\n\t\t\t\t\t\t\t\t\t'meta_value' => array(\n\t\t\t\t\t\t\t\t\t\t'icon' => '%%bf_product_demo_media_url:{bs-media-icon-rugby}:\\'full\\'%%',\n\t\t\t\t\t\t\t\t\t\t'type' => 'custom',\n\t\t\t\t\t\t\t\t\t\t'width' => '',\n\t\t\t\t\t\t\t\t\t\t'height' => '18',\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\tarray(\n\t\t\t\t\t\t\t\t\t'meta_key' => 'mega_menu',\n\t\t\t\t\t\t\t\t\t'meta_value' => 'tabbed-grid-posts',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'meta_key' => 'drop_menu_anim',\n\t\t\t\t\t\t\t\t\t'meta_value' => 'slide-bottom-in',\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\tarray(\n\t\t\t\t\t\t\t'item_type' => 'term',\n\t\t\t\t\t\t\t'term_id' => '%%bs-soccer%%',\n\t\t\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t\t\t'item_meta' => array(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'meta_key' => 'menu_icon',\n\t\t\t\t\t\t\t\t\t'meta_value' => array(\n\t\t\t\t\t\t\t\t\t\t'icon' => '%%bf_product_demo_media_url:{bs-media-icon-soccer}:\\'full\\'%%',\n\t\t\t\t\t\t\t\t\t\t'type' => 'custom',\n\t\t\t\t\t\t\t\t\t\t'width' => '',\n\t\t\t\t\t\t\t\t\t\t'height' => '18',\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),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'item_type' => 'term',\n\t\t\t\t\t\t\t'term_id' => '%%bs-baseball%%',\n\t\t\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t\t\t'item_meta' => array(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'meta_key' => 'menu_icon',\n\t\t\t\t\t\t\t\t\t'meta_value' => array(\n\t\t\t\t\t\t\t\t\t\t'icon' => '%%bf_product_demo_media_url:{bs-media-icon-baseball}:\\'full\\'%%',\n\t\t\t\t\t\t\t\t\t\t'type' => 'custom',\n\t\t\t\t\t\t\t\t\t\t'width' => '',\n\t\t\t\t\t\t\t\t\t\t'height' => '18',\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),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'item_type' => 'term',\n\t\t\t\t\t\t\t'term_id' => '%%bs-basketball%%',\n\t\t\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t\t\t'item_meta' => array(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'meta_key' => 'menu_icon',\n\t\t\t\t\t\t\t\t\t'meta_value' => array(\n\t\t\t\t\t\t\t\t\t\t'icon' => '%%bf_product_demo_media_url:{bs-media-icon-basketball}:\\'full\\'%%',\n\t\t\t\t\t\t\t\t\t\t'type' => 'custom',\n\t\t\t\t\t\t\t\t\t\t'width' => '',\n\t\t\t\t\t\t\t\t\t\t'height' => '18',\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\tarray(\n\t\t\t\t\t\t\t\t\t'meta_key' => 'mega_menu',\n\t\t\t\t\t\t\t\t\t'meta_value' => 'grid-posts',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'meta_key' => 'drop_menu_anim',\n\t\t\t\t\t\t\t\t\t'meta_value' => 'slide-fade',\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\tarray(\n\t\t\t\t\t\t\t'item_type' => 'term',\n\t\t\t\t\t\t\t'term_id' => '%%bs-hockey%%',\n\t\t\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t\t\t'item_meta' => array(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'meta_key' => 'menu_icon',\n\t\t\t\t\t\t\t\t\t'meta_value' => array(\n\t\t\t\t\t\t\t\t\t\t'icon' => '%%bf_product_demo_media_url:{bs-media-icon-hockey}:\\'full\\'%%',\n\t\t\t\t\t\t\t\t\t\t'type' => 'custom',\n\t\t\t\t\t\t\t\t\t\t'width' => '',\n\t\t\t\t\t\t\t\t\t\t'height' => '18',\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),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'item_type' => 'term',\n\t\t\t\t\t\t\t'term_id' => '%%bs-golf%%',\n\t\t\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t\t\t'item_meta' => array(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'meta_key' => 'menu_icon',\n\t\t\t\t\t\t\t\t\t'meta_value' => array(\n\t\t\t\t\t\t\t\t\t\t'icon' => '%%bf_product_demo_media_url:{bs-media-icon-golf}:\\'full\\'%%',\n\t\t\t\t\t\t\t\t\t\t'type' => 'custom',\n\t\t\t\t\t\t\t\t\t\t'width' => '',\n\t\t\t\t\t\t\t\t\t\t'height' => '18',\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),\n\t\t\t\t\t)\n\t\t\t\t),\n\n\t\t\t), // step 1\n\n\t\t), // menus\n\n\t);\n}",
"public function retrieveYamlFilesFromExtensionFolders() : array {}",
"private function gatherContentFiles()\n {\n $content = collect(\n Folder::disk('content')->getFilesRecursively('/')\n )->map(function ($path) {\n $disk = 'content';\n $contents = File::disk($disk)->get($path);\n return compact('disk', 'path', 'contents');\n });\n\n $users = collect(\n Folder::disk('users')->getFiles('/')\n )->map(function ($path) {\n $disk = 'users';\n $contents = File::disk($disk)->get($path);\n return compact('disk', 'path', 'contents');\n });\n\n $this->contentFiles = $content->merge($users)\n ->reject(function ($file) {\n return Str::endsWith($file['path'], '.DS_Store'); // yuck\n });\n }",
"public function getPluginCollections();",
"private function include_demo_files() {\r\n\t\t// Load Fusion Builder demos.\r\n\t\tforeach ( $this->demos as $demo ) {\r\n\t\t\t$demo_file = wp_normalize_path( $this->demo_folder_path . $demo . '.php' );\r\n\r\n\t\t\tif ( ! file_exists( $demo_file ) && $this->is_demo_data_zip_downloaded && $this->is_demo_data_zip_extractable ) {\r\n\t\t\t\t$this->is_demo_data_zip_extractable = $this->extract_demo_data_zip();\r\n\t\t\t}\r\n\r\n\t\t\tif ( file_exists( $demo_file ) ) {\r\n\t\t\t\tinclude $demo_file;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}",
"protected function collectTemplateDirs(): \\Illuminate\\Support\\Collection\n {\n return Collection::make(glob(\n get_theme_file_path('/resources/views/blocks') . '/*'\n ));\n }",
"protected function loadFixtures()\n {\n $this->manager = $this->getContainer()->get('sulu_document_manager.document_manager');\n\n $this->hotel1 = $this->createSnippet(\n 'hotel',\n [\n 'en' => [\n 'title' => 'Le grande budapest (en)',\n ],\n 'de' => [\n 'title' => 'Le grande budapest',\n ],\n ]\n );\n\n $this->hotel2 = $this->createSnippet(\n 'hotel',\n [\n 'de' => [\n 'title' => 'L\\'Hôtel New Hampshire',\n ],\n ]\n );\n\n $page = new PageDocument();\n $page->setTitle('Hotels Page');\n $page->setStructureType('hotel_page');\n $page->setResourceSegment('/hotels');\n $page->getStructure()->bind([\n 'hotels' => [\n $this->hotel1->getUuid(),\n $this->hotel2->getUuid(),\n ],\n ]);\n\n $this->manager->persist($page, 'de', [\n 'path' => '/cmf/sulu_io/contents/hotels',\n ]);\n\n $page->setTitle('Hotels');\n $page->setShadowLocaleEnabled(true);\n $page->setShadowLocale('de');\n $page->getStructure()->bind([\n 'hotels' => [],\n ]);\n\n $this->manager->persist($page, 'en', [\n 'path' => '/cmf/sulu_io/contents/hotels',\n ]);\n\n $this->car1 = $this->createSnippet('car', ['de' => ['title' => 'C car']]);\n $this->createSnippet('car', ['de' => ['title' => 'B car']]);\n $this->createSnippet('car', ['de' => ['title' => 'A car']]);\n\n $this->manager->flush();\n }",
"protected function getLocalCatalogs()\n {\n $result = array();\n\n $folders = array(\n $this->srcDir,\n dirname($this->srcDir) . '/app',\n );\n\n foreach($folders as $folder){\n $finder = new Finder();\n $finder->files()->in($folder)->name('/\\w+\\.\\w+\\.yml$/i');\n\n foreach($finder as $file){\n //$yml = $file->getRealpath();\n //$relativePath = $file->getRelativePath();\n $fileName = $file->getRelativePathname();\n\n if(preg_match(\"/translations\\/(\\w+)\\.(\\w+)\\.yml/i\", $fileName, $matches)){\n $catalog = $matches[1];\n $result[$catalog] = null;\n }\n }\n }\n\n return array_keys($result);\n }",
"function x_addons_page_demo_content() {\n\n $data = x_addons_page_demo_content_setup();\n\n extract( $data );\n\n $standard_first = current( $standard_demos );\n $expanded_first = current( $expanded_demos );\n\n ?>\n\n <div class=\"wrap x-addons-demo-content\">\n\n <?php if ( isset( $_GET['clean-cache'] ) ) : ?>\n <div class=\"notice updated\"><p><?php _e( 'Demo content cache has been cleared. All imported content will be considered new.', '__x__' ); ?></p></div>\n <?php endif; ?>\n\n <header class=\"x-addons-header\">\n <h2><?php _e( 'Demo Content', '__x__' ); ?></h2>\n <p><?php _e( 'Quick start the design process with our Standard and Expanded demos. <a href=\"https://community.theme.co/kb/demo-content/\" target=\"_blank\">Learn More</a>.', '__x__' ); ?></p>\n </header>\n\n <div class=\"message\"></div>\n\n <div class=\"x-addons-postboxes\">\n\n <?php if ( isset( $error ) && is_string( $error ) ) : ?>\n\n <div class=\"x-addons-postbox demo-content\">\n <div class=\"error\"><p><?php echo $error ?></p></div>\n </div>\n\n <?php else : ?>\n\n <div class=\"x-addons-postbox demo-content\">\n <div class=\"inside\">\n <form id=\"x-demo-content-form\" method=\"post\">\n\n <input type=\"hidden\" name=\"demo_type\" value=\"standard\" />\n <?php wp_nonce_field( 'x-addons-demo-content' ); ?>\n\n <div class=\"content-container\">\n\n <div class=\"content standard selected\">\n <div class=\"content-inner\">\n <h3><?php _e( 'Standard', '__x__' ); ?></h3>\n <p>Standard demo content will setup the Customizer settings and homepage design with placeholder content for the demo you select. Additionally, you can include optional example posts or portfolio items to see how certain features work.</p>\n <select name=\"standard-demo\" class=\"x-demo-select\">\n <?php foreach ( $standard_demos as $key => $info ) : ?>\n <option data-demo-url=\"<?php echo $info['demo_url']; ?>\" value=\"<?php echo $info['url']; ?>\"><?php echo $info['title']; ?></option>\n <?php endforeach; ?>\n </select>\n <a href=\"<?php echo $standard_first['demo_url']; ?>\" class=\"demo-content-link\" target=\"_blank\"><span>Demo</span></a>\n <fieldset>\n <legend class=\"screen-reader-text\"><span>Import Posts</span></legend>\n <label for=\"standard-demo-posts\">\n <input name=\"standard-demo-posts\" type=\"checkbox\" id=\"standard-demo-posts\" value=\"yes\">\n <span>Import Posts</span>\n </label>\n </fieldset>\n <fieldset>\n <legend class=\"screen-reader-text\"><span>Import Portfolio Items</span></legend>\n <label for=\"standard-demo-portfolio-items\">\n <input name=\"standard-demo-portfolio-items\" type=\"checkbox\" id=\"standard-demo-portfolio-items\" value=\"yes\">\n <span>Import Portfolio Items</span>\n </label>\n </fieldset>\n </div>\n </div>\n\n <div class=\"content expanded\">\n <div class=\"content-inner\">\n <h3><?php _e( 'Expanded', '__x__' ); ?></h3>\n <p>Our Expanded Demos allow you to setup complete sites with the click of a mouse! Everything from the customizer settings, to pages with full graphics are implemented for you, giving you ready-made designs in an instant.</p>\n <select name=\"expanded-demo\" class=\"x-demo-select\">\n <?php foreach ( $expanded_demos as $name => $info ) : ?>\n <option data-demo-url=\"<?php echo $info['demo_url']; ?>\" value=\"<?php echo $name; ?>\"><?php echo $info['title']; ?></option>\n <?php endforeach; ?>\n </select>\n <a href=\"<?php echo $expanded_first['demo_url']; ?>\" class=\"demo-content-link\" target=\"_blank\"><span>Demo</span></a>\n </div>\n </div>\n\n </div>\n\n <p class=\"submit\">\n <input type=\"submit\" name=\"setup\" id=\"x-addons-demo-content-submit\" class=\"button button-primary\" value=\"<?php printf( __( 'Setup Standard Demo: %s', '__x__' ), $standard_first['title'] ); ?>\">\n </p>\n\n </form>\n </div>\n </div>\n\n <?php\n\n $troubleshooting_info = '<p>While our Standard and Expanded demo content can be used any time, it is recommended for use on new installations as a starting point. <a href=\"https://theme.co/go/join-demodashboard.php\" target=\"_blank\">Purchase another license</a>.</p>'\n . '<p>If you feel you have run into a problem, check out our <a href=\"https://community.theme.co/kb/demo-content/#troubleshooting\" target=\"_blank\">troubleshooting tips</a>.</p>';\n\n if ( ! X_REVOLUTION_SLIDER_IS_ACTIVE ) {\n $troubleshooting_info .= '<p><strong>Please note:</strong> Since Revolution Slider is not currently active, any sliders used in our Expanded demos will not be setup. If you wish for these sliders to be setup, please ensure that you have Revolution Slider installed and activated.</p>';\n }\n\n ?>\n\n <div class=\"troubleshooting\"><?php echo $troubleshooting_info; ?></div>\n\n <?php endif; ?>\n\n </div>\n\n </div>\n\n<?php\n\n}",
"public function all(): array {\n\t\t$snippets = [];\n\t\t$views = $this->views->listViews();\n\n\t\t$matches = [];\n\t\tforeach ($views as $view) {\n\t\t\tif (preg_match('/^snippets\\/(.*)\\.twig$/i', $view, $matches)) {\n\t\t\t\t$snippets[$matches[1]] = $view;\n\t\t\t}\n\t\t}\n\n\t\treturn $snippets;\n\t}",
"private function get_collections() {\n\t\tif ( Options::get( 'api-key' ) === '' || ! isset( $_GET['page'] ) || $_GET['page'] !== 'helpscout-docs-api' ) {\n\t\t\treturn [];\n\t\t}\n\t\t$response = HelpScout_Request::get( 'collections' );\n\t\t$response = json_decode( wp_remote_retrieve_body( $response ) );\n\t\t$collections = [];\n\t\tforeach ( $response->collections->items as $collection ) {\n\t\t\t$collections[ $collection->id ] = $collection->name;\n\t\t}\n\n\t\treturn $collections;\n\t}",
"public function discoverAllFiles(): Collection;",
"function __getContentModels() {\n\tglobal $our_content_models;\n\n\tmodule_load_include('inc', 'fedora_repository', 'ContentModel');\n\tmodule_load_include('inc', 'fedora_repository', 'CollectionClass');\n\n\t$options = array();\n\t$collectionHelper = new CollectionClass();\n\n\t//defined in fedora_repository admin config\n\t$default_collection = variable_get('fedora_content_model_collection_pid','islandora:ContentModelCollection');\n\n\t$results = $collectionHelper->getRelatedItems( $default_collection,\tnull, null );\n\n if (empty($results)) {\n return NULL;\n }\n\n\t$items = new SimpleXMLElement( $results );\n\n\tif ( count( $items->results->result ) > 0 ) {\n\t\tforeach ( $items->results->result as $res ) {\n\t\t\t$child_pid = substr( $res->object['uri'], strpos($res->object['uri'],'/')+1 );\n\t\t\tif (in_array($child_pid, $our_content_models)):\n\t\t\t\tif ( ( $cm = ContentModel::loadFromModel( $child_pid ) ) !== false) {\n\t\t\t\t\t$options[$child_pid] = $child_pid;\n\t\t\t\t}\n\t\t\tendif;\n\t\t}\n\t}\n\n\treturn $options;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test that the seed data exists and is reachable | public function testDatabaseSeeds()
{
// Double check that the test data is present and correctly seeded
$this->tester->seeRecord('users', array('email' => 'user@user.com'));
$this->tester->seeRecord('users', array('email' => 'admin@admin.com'));
} | [
"public function testDatabaseSeeds()\n {\n // Check that the test data is present and correctly seeded\n $user = DB::table('users')->where('email', 'user@user.com')->first();\n $this->assertEquals('user@user.com', $user->email);\n }",
"public function testExistsExistingDataFinder()\n {\n $result = Factory::dataFinderExists(\"MyOtherTest\");\n $this->assertTrue($result);\n }",
"protected function shouldSeed()\n {\n return property_exists($this, 'seed') ? $this->seed : false;\n }",
"public function testWalletNewSeed()\n {\n }",
"public function testCreatingVoyagesAndSteps()\n {\n // Run the DatabaseSeeder...\n if (Voyage::all()->count() == 0) {\n $this->seed() ;\n }\n\n $cnt = Voyage::all()->count() ;\n\n $this->assertDatabaseCount('voyages', $cnt);\n }",
"public function testIfYamlSeederWillSeedEntries(){\n\n $result = YamlSeeder::seed();\n\n $entries = \\AMBERSIVE\\YamlSeeder\\Tests\\Examples\\Models\\Migration::get();\n $element = $entries->first();\n\n $this->assertEquals(2, $entries->count());\n $this->assertEquals(99, $element->id);\n\n }",
"public function testAddressSeedCommand()\n {\n $this->assertEquals(0, Address::all()->count());\n $this->artisan('app', [\n '--seed' => true\n ]);\n $this->assertEquals(15, Address::all()->count());\n\n }",
"public function seedingIsAllowed(): bool\n {\n return ($this->hasInitialImports()) || ($this->migrations !== false);\n }",
"public function shouldSeed()\n {\n $relevantRecords = [\n 'root',\n 'content-type',\n 'relation-type',\n 'parent-id',\n ];\n\n return (new $this->model)->whereIn('contents.key', $relevantRecords)->count() === 0;\n }",
"public function getIsHasSeed()\n {\n return $this->isHasSeed;\n }",
"private function runDummySeeders()\n {\n// $this->call('UsersSeeder');\n// $this->call('DistrictsSeeder');\n// $this->call('CitiesMunicipalitiesSeeder');\n// $this->call('BarangaysSeeder');\n// $this->call('ResidentsSeeder');\n// $this->call('LastnamesCounter');\n// $this->call('HouseholdsSeeder');\n// $this->call('AffiliationsSeeder');\n// $this->call('ScholarshipsSeeder');\n// $this->call('AttributionsSeeder');\n// // $this->call('TransactionsSeeder');\n// $this->call('TransactionCategoriesSeeder');\n// $this->call('TransactionCategoryItemsSeeder');\n// $this->call('TransactionsSeeder');\n }",
"public function seedsPending(): bool\n {\n if ($this->settingsSeedsPending()) {\n return true;\n }\n\n if ($this->permissionsSeedsPending()) {\n return true;\n }\n\n return false;\n }",
"public function testPoolExists()\n {\n\n }",
"public function seedingInitial()\n {\n $channel = factory(Channel::class)->create([\n 'id' => 1,\n 'name' => 'general',\n ]);\n $user = factory(User::class)->create([\n 'id' => 1,\n 'name' => 'admin',\n 'email' => 'admin@example.com',\n 'is_verified_with_email' => true,\n 'is_verified_by_admin' => true,\n 'is_admin' => true,\n ]);\n }",
"private function seedBasicData()\n {\n \t$this->info('Adding data to database...');\n \t(new InfernoUserSeeder())->run();\n }",
"public function testResumeDatabaseExist()\n {\n $this->assertTrue(Schema::hasTable('resumes'));\n }",
"protected function recentTestInstanceExists() {}",
"public function testDatabase()\n {\n $this->assertDatabaseHas($this->table, [\n 'title' => 'New Site'\n ]);\n }",
"public function testFixturesSetup() {\n $this->assertCount(3, $this->databaseDumpFiles);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets Pin Required. Indicates whether a mobile staff member needs to enter their PIN to apply the discount to a payment. | public function setPinRequired(?bool $pinRequired): void
{
$this->pinRequired = $pinRequired;
} | [
"public function setPinRequired($val)\n {\n $this->_propDict[\"pinRequired\"] = boolval($val);\n return $this;\n }",
"public function set_pin($pin = 'unused') {\n $this->pin = $pin ? $pin : 'unused';\n }",
"public function set_pin($pin = 'unused') {\n\t\t$this->pin = $pin ? $pin : 'unused';\n\t}",
"public function unsetPinRequired(): void\n {\n $this->pinRequired = [];\n }",
"public function setVoucherPin($value) {\n $this->setPin($value);\n }",
"function set_pin($new_pin) {\n $this->pin = $new_pin;\n \t}",
"public function setPIN($pIN)\n {\n $result = $this->client->SetPIN(\n new \\SoapParam($pIN, 'NewPIN'));\n $this->errorHandling($result, 'Could not set PIN on FRITZ!Box');\n }",
"function setOveridePin($overidePin) {\n $this->overidePin = $overidePin;\n }",
"public function setPasscodeRequired($val)\n {\n $this->_propDict[\"passcodeRequired\"] = boolval($val);\n return $this;\n }",
"public function getPinRequired(): ?bool\n {\n if (count($this->pinRequired) == 0) {\n return null;\n }\n return $this->pinRequired['value'];\n }",
"protected function setCardPin($value) {\n $this->cardPin = $value;\n }",
"public function setRequirePinAfterBiometricChange($val)\n {\n $this->_propDict[\"requirePinAfterBiometricChange\"] = boolval($val);\n return $this;\n }",
"public function setSerialNumberRequired($value) {\r\n $this->_data[\"SerialNumberRequired\"] = filter_var($value, FILTER_VALIDATE_BOOLEAN);\r\n return $this;\r\n }",
"public function setSimplePinBlocked($val)\n {\n $this->_propDict[\"simplePinBlocked\"] = boolval($val);\n return $this;\n }",
"public function markPhoneAsVerified();",
"public function setDisableAppPinIfDevicePinIsSet($val)\n {\n $this->_propDict[\"disableAppPinIfDevicePinIsSet\"] = boolval($val);\n return $this;\n }",
"public function set_phone_verification () {\n\t\t$phoneNumber = $this->get_param('post.phoneNumber');\n\n\t\t\n\t\t$addressData = [\n\t\t\t\t'phone_verified' => 1,\n\t\t];\n\t\t\n\t\t$res = M('user_address')\n\t\t\t->where(\"`user_id` = $this->userID and `phone` = $phoneNumber\")\n\t\t\t->save($addressData);\n\t\t\n\t\tif (!$res) {\n\t\t\t$this->return_error('Can not verify this phone');\n\t\t} else {\n\t\t\t$this->return_data([], 'Phone verified');\n\t\t}\n\t}",
"public function setRequired(bool $required): void\n {\n $this->required = $required;\n }",
"public function setRequired($required) {\n $this->required = !empty($required);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set Check answer attempts \ If instant_feedback is true, this field determines how many times the user can click on the 'Check Answer' button. 0 mea ns unlimited. \ | public function set_feedback_attempts($feedback_attempts)
{
$this->feedback_attempts = $feedback_attempts;
} | [
"public function set_feedback_attempts ($feedback_attempts) {\n $this->feedback_attempts = $feedback_attempts;\n }",
"public function checkAnswers()\n {\n $maxPoints = count($this->questions);\n $points = $maxPoints;\n $rightAnswersCount = 0;\n $wrongAnswersCount = 0;\n\n foreach ($this->questions as $question) {\n if(!$question->isUserAnswerIsCorrect()) {\n $wrongAnswersCount++;\n $points--;\n } else {\n $rightAnswersCount++;\n }\n }\n \n $this->statistics['maxPoints'] = $maxPoints;\n $this->statistics['points'] = $points;\n $this->statistics['rightAnswersCount'] = $rightAnswersCount;\n $this->statistics['wrongAnswersCount'] = $wrongAnswersCount;\n }",
"function new_attempt()\n\t{\n\t\tglobal $db, $user;\n\n\t\t// yah, I would prefer a stronger rand, but this should work\n\t\t$this->question = (int) array_rand($this->question_ids);\n\t\t$this->solved = 0;\n\n\t\t$sql = 'UPDATE ' . $this->table_qa_confirm . '\n\t\t\tSET question_id = ' . (int) $this->question . \",\n\t\t\t\tattempts = attempts + 1\n\t\t\tWHERE confirm_id = '\" . $db->sql_escape($this->confirm_id) . \"'\n\t\t\t\tAND session_id = '\" . $db->sql_escape($user->session_id) . \"'\";\n\t\t$db->sql_query($sql);\n\n\t\t$this->load_answer();\n\t}",
"function scoreAttempt(AttemptQuestionAnswer $attemptQuestionAnswer)\n {\n $attemptQuestionAnswer->setScore(1);\n return 1;\n }",
"public function setAnswerCount($answerCount);",
"public function get_feedback_attempts()\n {\n return $this->feedback_attempts;\n }",
"public function get_feedback_attempts() {\n return $this->feedback_attempts;\n }",
"function get_assessment_question_attempts();",
"protected function increase_attemps()\r\n {\r\n $_SESSION['ATTEMPS'] = (isset($_SESSION['ATTEMPS']) ? $_SESSION['ATTEMPS']++ : 0);\r\n $this->display_login();\r\n }",
"function setPointsManual()\n\t{\n\t\tif (array_key_exists(\"question\", $_POST))\n\t\t{\n\t\t\t$keys = array_keys($_POST[\"question\"]);\n\t\t\t$question_id = $keys[0];\n\t\t\t$points = $_POST[\"question\"][$question_id];\n\t\t\tinclude_once \"./Modules/TestQuestionPool/classes/class.assQuestion.php\";\n\t\t\t$maxpoints = assQuestion::_getMaximumPoints($question_id);\n\t\t\t$result = assQuestion::_setReachedPoints($_GET[\"active_id\"], $question_id, $points, $maxpoints, $_GET[\"pass\"], 1);\n\t\t\t\n\t\t\t// update learning progress\n\t\t\tinclude_once \"./Modules/Test/classes/class.ilObjTestAccess.php\";\n\t\t\tinclude_once(\"./Services/Tracking/classes/class.ilLPStatusWrapper.php\");\n\t\t\tilLPStatusWrapper::_updateStatus($this->object->getId(),\n\t\t\t\tilObjTestAccess::_getParticipantId((int) $_GET[\"active_id\"]));\n\n\t\t\tif ($result) \n\t\t\t{\n\t\t\t\tilUtil::sendSuccess($this->lng->txt(\"tst_change_points_done\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tilUtil::sendFailure($this->lng->txt(\"tst_change_points_not_done\"));\n\t\t\t}\n\t\t}\n\t\t$this->manscoring();\n\t}",
"function correctAnswer() {\n\t}",
"function resetNumberOfTries()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\n\t\tinclude_once(\"./Services/COPage/classes/class.ilPageQuestionProcessor.php\");\n\t\tif (is_array($_POST[\"userquest_id\"]))\n\t\t{\n\t\t\tforeach ($_POST[\"userquest_id\"] as $uqid)\n\t\t\t{\n\t\t\t\t$uqid = explode(\":\", $uqid);\n\t\t\t\tilPageQuestionProcessor::resetTries((int) $uqid[0], (int) $uqid[1]);\n\t\t\t}\n\t\t\tilUtil::sendSuccess($lng->txt(\"msg_obj_modified\"), true);\n\t\t}\n\t\t$ilCtrl->redirect($this, \"listBlockedUsers\");\n\t}",
"function setAsked()\r\n {\r\n /* Note: $Question will return FALSE if the user doesn't have unconditional rights & if the\r\n * question has been asked. That's fine because the question's asked status will still\r\n * be correct.\r\n */\r\n $Question = new Question($this->question_id,TRUE);\r\n $Question->setAsked(TRUE);\r\n $Question->saveAsked(TRUE);\r\n\r\n return TRUE;\r\n }",
"public function answer()\n {\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n if (!isset($_POST['result'])) {\n $question = getQuestions()[$_SESSION['test_question_count']];\n // Get question options from DataBase\n $options = $this->testsModel->getOptions($question->id);\n\n $data = [\n 'question' => $question,\n 'options' => $options,\n 'select_err' => 'Please select one answer',\n 'progress_bar' => ($_SESSION['test_question_count']) / $_SESSION['question_count'] * 100,\n ];\n\n // Save at session which question we are\n $this->view('tests/test', $data);\n\n } else {\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n $option_id = trim($_POST['result']);\n $data = [\n 'user_id' => $_SESSION['user_id'],\n 'test_id' => $_SESSION['test_id'],\n 'question_id' => getQuestions()[$_SESSION['test_question_count']]->id,\n 'option_id' => $option_id,\n 'attemp_count' => 1,\n 'correct' => $this->testsModel->getOptionAnswer($option_id)->answer_bool,\n 'session_id' => $_SESSION['sessionIdForTest'],\n ];\n $this->testsModel->addAnswer($data);\n\n $_SESSION['test_question_count']++;\n\n redirect('tests/test');\n }\n\n }\n\n }",
"function quiz_start_check($quiz) {\n global $user;\n\n $user_is_admin = node_access('update', $quiz);\n\n // Check to see if this user is allowed to take the quiz again:\n if ($quiz->takes > 0) {\n $taken = db_query(\"SELECT COUNT(*) AS takes FROM {quiz_node_results} WHERE uid = :uid AND nid = :nid\", array(':uid' => $user->uid, ':nid' => $quiz->nid))->fetchField();\n $allowed_times = format_plural($quiz->takes, '1 time', '@count times');\n $taken_times = format_plural($taken, '1 time', '@count times');\n\n // The user has already taken this quiz.\n if ($taken) {\n if ($user_is_admin) {\n\n drupal_set_message(t('You have taken this @quiz already. You are marked as an owner or administrator for this quiz, so you can take this quiz as many times as you would like.', array('@quiz' => QUIZ_NAME)), 'status');\n }\n // If the user has already taken this quiz too many times, stop the user.\n elseif ($taken >= $quiz->takes) {\n drupal_set_message(t('You have already taken this @quiz @really. You may not take it again.', array('@quiz' => QUIZ_NAME, '@really' => $taken_times)), 'error');\n return FALSE;\n }\n // If the user has taken the quiz more than once, see if we should report\n // this.\n elseif ($quiz->show_attempt_stats) {\n drupal_set_message(t(\"You can only take this @quiz @allowed. You have taken it @really.\", array('@quiz' => QUIZ_NAME, '@allowed' => $allowed_times, '@really' => $taken_times)), 'status');\n }\n }\n }\n\n // Check to see if the user is registered, and user alredy passed this quiz.\n if ($quiz->show_passed && $user->uid && quiz_is_passed($user->uid, $quiz->nid, $quiz->vid)) {\n drupal_set_message(t('You have already passed this @quiz.', array('@quiz' => QUIZ_NAME)), 'status', FALSE);\n }\n\n return TRUE;\n}",
"public function test_create_attemptfeedback() {\n $dummypage = new moodle_page();\n $target = 'mod_adaptivequiz';\n $renderer = new mod_adaptivequiz_renderer($dummypage, $target);\n\n $output = $renderer->create_attemptfeedback('Test attempt feedback', 99);\n\n // Test form attributes\n $this->assertContains('<form', $output);\n $this->assertContains('/mod/adaptivequiz/view.php', $output);\n $this->assertContains('id=\"attemptfeedback\"', $output);\n\n // Test submit button and class\n $this->assertContains('type=\"submit\"', $output);\n $this->assertContains('class=\"submitbtns adaptivequizfeedback\"', $output);\n\n // Test output contains required elements\n $this->assertContains('name=\"id\"', $output);\n\n $this->assertContains('</form>', $output);\n }",
"protected function resetAttemptCount()\n {\n $this->attempted = 0;\n }",
"public function answerPrompt($answer)\n {\n $this->sessionPost('/alert_text', array('text' => $answer));\n $this->sessionPost('/accept_alert');\n }",
"public function setAnswer($answer) {\n\t\t$this->answer = $answer;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Override of theme_blocks() for content region. Allows content blocks to be split away from page content in page template. See droplitcube_blocks() for how this function is called. | function droplitcube_blocks_content($doit = FALSE) {
static $blocks;
if (!isset($blocks)) {
$blocks = module_exists('context') && function_exists('context_blocks') ? context_blocks('content') : theme_blocks('content');
}
return $doit ? $blocks : '';
} | [
"function droplitcube_blocks($region) {\n // Allow theme functions some additional control over regions.\n $registry = theme_get_registry();\n if (isset($registry['blocks_'. $region])) {\n return theme('blocks_'. $region);\n }\n return module_exists('context') && function_exists('context_blocks') ? context_blocks($region) : theme_blocks($region);\n}",
"function output_flexible_content_blocks($numCols = 1, $pageHasSidebar = false, $alternatingContent = true, $fluidLayout = false) {\n global $post;\n $sidebarContent = \"\";\n $counter = 0;\n $blockCounter = 0;\n\n //For the partners page, we want to use a three column layout.\n if($post->ID == 23):\n $numCols = 3;\n elseif (is_page_template('template-version-landing-page.php') || is_page_template('template-professional-services.php')):\n $numCols = 2;\n endif;\n\n if (get_field('content_blocks')):\n //If we're using a fluid layout, we'll wrap each block in its own container. We will also force the block column size to be the full 12 column grid width.\n if ($fluidLayout) {\n $numCols = 1;\n echo '<div class=\"container-fluid\">';\n }\n\n echo '<div class=\"content-blocks cols'.$numCols.' row\">';\n\n $currentImgHAlign = 'left';\n\n while(the_flexible_field('content_blocks')):\n $counter++;\n\n //Get the image alignment setting for the block. If nothing was set, we'll assume it's a top aligned image.\n $imageAlign = get_sub_field('image_alignment') ? get_sub_field('image_alignment') : 'top'; //Aligned top by default\n\n //We use a standard 12 column Bootstrap Grid for a full width block\n $blockColSize = 12;\n\n //If we're outputting multiple columns, we'll calculate the width for each block.\n if ($numCols > 1 && ($imageAlign == 'top' || $imageAlign == 'bottom' || $imageAlign == 'bottom-center') && get_row_layout() != 'wysiwyg_block'):\n $blockColSize = 12/$numCols;\n endif;\n\n $backgroundImage = get_sub_field('background_image');\n $backgroundColour = get_sub_field('background_colour');\n $blockStyle = '';\n $blockCSSClass = '';\n\n if ($backgroundImage && get_sub_field('image_style') != 'standard'):\n $blockStyle = ' style=\"background: #CCC url('.$backgroundImage.') no-repeat center center; background-size: cover;\" ';\n $blockCSSClass = ' with-background ';\n endif;\n\n\t\t\tif ($backgroundColour):\n\t\t\t\t$blockStyle = ' style=\"background: '.$backgroundColour.';\" ';\n\t\t\t\t$blockCSSClass .= ' with-background ';\n\t\t\tendif;\n\n\t\t\tif (!get_sub_field('thumbnail')):\n\t\t\t\t$blockCSSClass .= ' no-thumb ';\n\t\t\tendif;\n\n if (get_row_layout() != 'featured_webinar' || get_field('feature_latest_webinar_post', 'options')):\n //Start by outputting the column for the block.\n echo '<div class=\"contentBlock col-xs-12 col-sm-'.$blockColSize.' block'.$counter.' '.$imageAlign.' '.get_row_layout().' '.$blockCSSClass.'\" '.$blockStyle.'><div class=\"block-inner\">';\n\n //Reset block info\n $fullSizeImage = '';\n $linkURL = '';\n $linkClass = '';\n $linkTitle = '';\n $linkTag = '';\n\n //Our default block layout consists of an image and a piece of text. In the case of something like the WYSIWYG block, it's just text so we only need to output the post content.\n include(dirname(__FILE__) . '/../templates/content-blocks/'.get_row_layout().'.php');\n\n echo '</div></div>'; //End of the content block wrapper\n endif;\n\n $blockCounter++;\n endwhile;\n\n echo '</div>'; //End of the content-blocks row\n\n //If we're using a fluid layout, we'll wrap each block in its own container.\n if ($fluidLayout) {\n echo '</div>'; //End of the block container\n }\n endif;\n}",
"public function blocks()\n\t{\n\t\tif ($this->session->userdata('user_type') != \"Admin\")\n\t\t{\n\t\t\tshow_404();\n\t\t}\n\n\t\t/** Hook point */\n\t\t$this->hooks->call_hook('builder_elements_blocks_pre');\n\n\t\t$this->data['page'] = \"elements_blocks\";\n\t\t$this->data['title'] = $this->lang->line('builder_elements_blocks_pagetitle');\n\n\t\t$this->data['blocks'] = $this->MBlocks->allBasic();\n\t\t$this->data['blockCategories'] = $this->MBlocks->allBlockCategories();\n\n\t\t$this->data['templates'] = $this->MBlocks->loadTemplateFiles();\n\n\t\t/** Hook point */\n\t\t$this->hooks->call_hook('builder_elements_blocks_post');\n\n\t\t$this->load->view('builder_elements/blocks', $this->data);\n\t}",
"public function blocks_for_region($region) {\n $user_preference = '';\n if(strcmp($region, \"side-pre\") == 0 || \n strcmp($region, \"side-post\") == 0 ){\n\n $user_preference .= \n \"theme_archaius_blocks_region_\" . $region . \n \"_context_\". $this->page->context->id .\n \"_page_type_\" . $this->page->pagetype;\n\n if(! empty($this->page->subpage)){\n $user_preference .= \"_sub_\" . $this->page->subpage; \n }\n }\n //Allow user preference update from javascript\n user_preference_allow_ajax_update($user_preference, PARAM_INT);\n\n $blockcontents = $this->page->blocks->get_content_for_region($region, $this);\n\n $blocks = $this->page->blocks->get_blocks_for_region($region);\n $lastblock = null;\n $zones = array();\n foreach ($blocks as $block) {\n $zones[] = $block->title;\n }\n $output = '';\n\n foreach ($blockcontents as $bc) {\n if ($bc instanceof block_contents) {\n $output .= $this->block($bc, $region);\n $lastblock = $bc->title;\n } else if ($bc instanceof block_move_target) {\n $output .= $this->block_move_target($bc, $zones, $lastblock, $region);\n } else {\n throw new coding_exception('Unexpected type of thing (' . \n get_class($bc) . ') found in list of block contents.');\n }\n }\n return $output;\n }",
"abstract public function getContentBlockDefinitions();",
"function base_page_alter(&$page) {\n // Look in each visible region for blocks.\n foreach (system_region_list($GLOBALS['theme'], REGIONS_VISIBLE) as $region => $name) {\n if (!empty($page[$region])) {\n // Find the last block in the region.\n $blocks = array_reverse(element_children($page[$region]));\n while ($blocks && !isset($page[$region][$blocks[0]]['#block'])) {\n array_shift($blocks);\n }\n if ($blocks) {\n $page[$region][$blocks[0]]['#block']->last_in_region = TRUE;\n }\n }\n }\n}",
"function meilleur_copain_set_blocks_template() {\n if ( ! isset( $_GET['post'] ) ) {\n return;\n }\n\n $bp = buddypress();\n $page = (int) $_GET['post'];\n $bp_pages = array_map( 'intval', wp_list_pluck( (array) $bp->pages, 'id' ) );\n $bp_labels = array_map( 'esc_html', wp_list_pluck( (array) $bp->pages, 'title', 'id' ) );\n\n if ( in_array( $page, $bp_pages, true ) ) {\n $page_object = get_post_type_object( 'page' );\n\n $page_object->template = array(\n array( 'meilleur-copain/placeholder', array(\n 'align' => 'none',\n ) )\n );\n\n $page_object->template_lock = 'all';\n\n // Pass the corresponding object's Buddicon to the Block\n $dashicon_suffix = array_search( $page, $bp_pages );\n if ( ! $dashicon_suffix ) {\n $dashicon_suffix = 'buddypress-logo';\n } elseif ( 'members' === $dashicon_suffix ) {\n $dashicon_suffix = 'community';\n }\n\n // Pass the Label\n $label = __( 'Composant BuddyPress inconnu', 'meilleur-copain' );\n if ( isset( $bp_labels[ $page ] ) ) {\n $label = $bp_labels[ $page ];\n }\n\n wp_localize_script( 'meilleur-copain-placeholder', 'meilleurCopainVars', array(\n 'placeholderIcon' => sprintf( 'buddicons-%s', $dashicon_suffix ),\n 'placeholderLabel' => $label,\n ) );\n }\n}",
"function pluton_single_blocks() {\n\treturn apply_filters( 'pluton_'. get_post_type() .'_single_blocks', array(\n\t\t'media',\n\t\t'title',\n\t\t'meta',\n\t\t'content',\n\t\t'share',\n\t\t'comments',\n\t) );\n}",
"function athen_staff_post_blocks() {\n\n // Defaults\n $defaults = array(\n 'content',\n 'related',\n );\n\n // Get layout blocks\n $blocks = athen_get_mod( 'staff_post_composer' );\n\n // If blocks are 100% empty return defaults\n $blocks = $blocks ? $blocks : $defaults;\n \n // Apply filters to entry layout blocks\n $blocks = apply_filters( 'athen_staff_single_blocks', $blocks );\n\n // Convert blocks to array so we can loop through them\n if ( ! is_array( $blocks ) ) {\n $blocks = explode( ',', $blocks );\n }\n\n // Return blocks\n return $blocks;\n\n}",
"public function register_section_blocks() {\r\n \r\n $labels = array(\r\n\t\t\t'parent_item_colon' => '',\r\n 'name' => _x( 'United Themes - Content Block Management', 'post type general name' , 'ut_shortcodes' ),\r\n\t\t\t'singular_name' => _x( 'Content Block', 'post type singular name' , 'ut_shortcodes' ),\r\n\t\t\t'add_new' => _x( 'Add Content Block', 'ut-content-blocks', 'ut_shortcodes' ),\r\n\t\t\t'add_new_item' => sprintf( esc_html__( 'Add New %s', 'ut_shortcodes' ), __( 'Content Block' , 'ut_shortcodes' ) ),\r\n\t\t\t'edit_item' => sprintf( esc_html__( 'Edit %s', 'ut_shortcodes' ), __( 'Content Block' , 'ut_shortcodes' ) ),\r\n\t\t\t'new_item' => sprintf( esc_html__( 'New %s', 'ut_shortcodes' ), __( 'Content Block' , 'ut_shortcodes' ) ),\r\n\t\t\t'all_items' => sprintf( esc_html__( 'All %s', 'ut_shortcodes' ), __( 'Content Blocks' , 'ut_shortcodes' ) ),\r\n\t\t\t'view_item' => sprintf( esc_html__( 'View %s', 'ut_shortcodes' ), __( 'Content Block' , 'ut_shortcodes' ) ),\r\n\t\t\t'search_items' => sprintf( esc_html__( 'Search %a', 'ut_shortcodes' ), __( 'Content Blocks' , 'ut_shortcodes' ) ),\r\n\t\t\t'not_found' => sprintf( esc_html__( 'No %s Found', 'ut_shortcodes' ), __( 'Content Blocks' , 'ut_shortcodes' ) ),\r\n\t\t\t'not_found_in_trash' => sprintf( esc_html__( 'No %s Found In Trash', 'ut_shortcodes' ), __( 'Content Blocks' , 'ut_shortcodes' ) ),\r\n\t\t\t'menu_name' => esc_html__( 'Content Blocks', 'ut_shortcodes' )\r\n\t\t); \r\n \r\n register_post_type( 'ut-content-block', array(\r\n 'labels' => $labels, \r\n 'supports' => array( 'title', 'editor' ),\r\n 'show_in_menu' => true,\r\n 'show_in_nav_menus' => false,\r\n 'public' => false,\r\n 'show_ui' => true,\r\n 'menu_position' => 5,\r\n ) ); \r\n \r\n }",
"function register_block_core_post_content() {\n\tregister_block_type(\n\t\t'core/post-content',\n\t\tarray(\n\t\t\t'render_callback' => 'render_block_core_post_content',\n\t\t)\n\t);\n}",
"function division_blocks_after() {\n\n\t\t$prefix = 'division_blocks_after_';\n\n\t\t$cmb = new_cmb2_box( array(\n\t\t\t'id' => $prefix . 'metabox',\n\t\t\t'title' => __( 'After Blocks', 'cmb2' ),\n\t\t\t'object_types' => array( 'page' ),\n\t\t\t'show_on' => array(\n\t\t\t\t'key' => 'page-template', 'value' => array(\n\t\t\t\t\t'templates/division-capstone.php',\n\t\t\t\t\t'templates/division-general.php'\n\t\t\t\t)\n\t\t\t),\n\t\t) );\n\n\t\t// $group_field_id is the field id string, so in this case: $prefix . 'demo'\n\t\t$group_field_id = $cmb->add_field( array(\n\t\t\t'id' => $prefix . 'list',\n\t\t\t'type' => 'group',\n\t\t\t'options' => array(\n\t\t\t\t'group_title' => __( 'Section {#}', 'cmb2' ), // {#} gets replaced by row number\n\t\t\t\t'add_button' => __( 'Add Another Section', 'cmb2' ),\n\t\t\t\t'remove_button' => __( 'Remove Section', 'cmb2' ),\n\t\t\t\t'sortable' => true, // beta\n\t\t\t),\n\t\t) );\n\n\t\t$cmb->add_group_field( $group_field_id, array(\n\t\t\t'name' => 'Section Title',\n\t\t\t'id' => $prefix . 'title',\n\t\t\t'type' => 'text_medium'\n\t\t) );\n\n\t\t$cmb->add_group_field( $group_field_id, array(\n\t\t\t'name' => __( 'Attached Blocks', 'cmb2' ),\n\t\t\t'desc' => __( 'Drag blocks from the left column to the right column to attach them to this page.<br />You may rearrange the order of the posts in the right column by dragging and dropping.', 'cmb2' ),\n\t\t\t'id' => 'attached_blocks',\n\t\t\t'type' => 'custom_attached_posts',\n\t\t\t'options' => array(\n\t\t\t\t'show_thumbnails' => true, // Show thumbnails on the left\n\t\t\t\t'filter_boxes' => true, // Show a text box for filtering the results\n\t\t\t\t'query_args' => array( // override the get_posts args\n\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t'post_type' => 'block',\n\t\t\t\t),\n\t\t\t)\n\t\t) );\n\n\t}",
"function gwp_blocks($position)\n{\n $id = get_queried_object_id();\n\n if (is_tax())\n {\n $id = 'term_' . $id;\n }\n\n if (!preg_match('/^common-.*$/', $position))\n { \n $prefix = $id . '_';\n $defaults = gwp_defaults();\n if(!$defaults) {\n $defaults = $prefix;\n }\n }\n else\n {\n $defaults = '';\n $prefix = '';\n }\n\n $output = '';\n \n for ($i = 0;$i < intval(gwp_theme_mod_max($prefix, $defaults, 'blocks_number'));$i++)\n { \n\n if (gwp_theme_mod($prefix, $defaults, 'block_' . $i . '_position') == $position)\n {\n $output .= '<section id=\"' . $prefix . 'block-' . $i . '\" class=\"block';\n if (preg_match('/^.*header$/', $position))\n {\n $output .= ' block-header';\n }\n if (gwp_theme_mod($prefix, $defaults, 'block_' . $i . '_divider') != '0')\n {\n $output .= ' divider';\n if (gwp_theme_mod($prefix, $defaults, 'block_' . $i . '_divider') == 'divider-no-padding')\n {\n $output .= ' bpspace-0';\n }\n }\n if (gwp_theme_mod($prefix, $defaults, 'block_' . $i . '_divider') != '0')\n {\n $output .= ' divider';\n if (gwp_theme_mod($prefix, $defaults, 'block_' . $i . '_divider') == 'divider-no-padding')\n {\n $output .= ' bpspace-0';\n }\n }\n if (gwp_theme_mod($prefix, $defaults, 'block_' . $i . '_bg') != '0')\n {\n $output .= ' bg-' . gwp_theme_mod_value($prefix, $defaults, 'block_' . $i . '_bg', '0');\n }\n if (gwp_theme_mod($prefix, $defaults, 'block_' . $i . '_height') != '0')\n {\n $output .= ' ed-styles';\n }\n $output .= '\"';\n if (gwp_theme_mod($prefix, $defaults, 'block_' . $i . '_height') != '0')\n {\n $output .= ' style=\"height: ' . gwp_theme_mod_value($prefix, $defaults, 'block_' . $i . '_height', '0') . ';\"';\n }\n if (gwp_theme_mod($prefix, $defaults, 'block_' . $i . '_load') != '0')\n {\n $output .= ' data-load=\"' . gwp_theme_mod_value($prefix, $defaults, 'block_' . $i . '_load', '0') . '\"';\n }\n $output .= '>';\n $output .= gwp_include_images($prefix, $defaults, 'block_' . $i);\n\n $output .= '<div class=\"container';\n if (gwp_theme_mod($prefix, $defaults, 'block_' . $i . '_container') == 'fluid')\n {\n $output .= '-fluid';\n }\n $output .= '\">';\n\n if (gwp_theme_mod($prefix, $defaults, 'block_' . $i . '_title') != '')\n {\n $output .= '<div class=\"row';\n if(gwp_theme_mod($prefix, $defaults, 'block_' . $i . '_title_bottom_space') != '0') {\n if(gwp_theme_mod($prefix, $defaults, 'block_' . $i . '_title_bottom_space' == '-')) {\n $output .= ' bspace-0';\n }\n else \n {\n $output .= ' bspace-'.gwp_theme_mod_value($prefix, $defaults, 'block_' . $i . '_title_bottom_space', '0');\n }\n } else {\n $output .= ' bspace-2';\n }\n $output .= '\">\n <div class=\"col-sm-12\">\n <header';\n if (gwp_theme_mod($prefix, $defaults, 'block_' . $i . '_title_position') != '0')\n {\n\n $output .= ' class=\"text-' . gwp_theme_mod_value($prefix, $defaults, 'block_' . $i . '_title_position', '0');\n if (gwp_theme_mod($prefix, $defaults, 'block_' . $i . '_title_position') == 'center')\n {\n $output .= ' col-sm-10 col-sm-push-1';\n }\n $output .= '\"';\n }\n $output .= '><h2>' . gwp_theme_mod_value($prefix, $defaults, 'block_' . $i . '_title', '') . '</h2>';\n $output .= '</header>\n </div>\n </div>';\n }\n $output .= '<div class=\"row';\n\n if (gwp_theme_mod($prefix, $defaults, 'block_' . $i . '_gutters') != '0')\n {\n $output .= ' no-gutters';\n }\n $output .= '\">';\n \n if (gwp_theme_mod($prefix, $defaults, 'block_' . $i . '_type') == 'custom')\n { \n $output .= gwp_include_content($prefix, $defaults, 'block_' . $i);\n }\n elseif (gwp_theme_mod($prefix, $defaults, 'block_' . $i . '_type') == 'blog')\n {\n $output .= gwp_include_blog($prefix, $defaults, 'block_' . $i);\n }\n elseif (gwp_theme_mod($prefix, $defaults, 'block_' . $i . '_type') == 'portfolio')\n {\n $output .= gwp_include_portfolio($prefix, $defaults, 'block_' . $i);\n }\n $output .= '</div>\n </div>\n </section>';\n }\n }\n echo $output;\n}",
"function wp_restore_group_inner_container($block_content, $block)\n {\n }",
"public function register_blocks() {\n // Block script\n wp_register_script(\n 'nh3-mag-blocks',\n plugins_url( 'build/index.js', NH3_BLOCKS_MAIN_FILE ),\n array(\n 'wp-components',\n 'wp-i18n',\n 'wp-blocks',\n 'wp-element',\n 'wp-editor',\n 'wp-data',\n 'wp-compose'\n ),\n filemtime( plugin_dir_path( NH3_BLOCKS_MAIN_FILE ) . 'build/index.js' )\n );\n\n wp_register_script(\n 'nh3-mag-blocks-frontend',\n plugins_url( 'templates/vendors/video.min.js', NH3_BLOCKS_MAIN_FILE ),\n array(),\n filemtime( plugin_dir_path( NH3_BLOCKS_MAIN_FILE ) . 'templates/vendors/video.min.js' ),\n true // Enqueue the script in the footer.\n );\n\n // Block CSS in the editor\n wp_register_style(\n 'nh3-mag-blocks-style-editor',\n plugins_url( 'build/css/editor.css', NH3_BLOCKS_MAIN_FILE ),\n array( 'wp-edit-blocks' ),\n filemtime( plugin_dir_path( NH3_BLOCKS_MAIN_FILE ) . 'build/css/editor.css' )\n );\n\n wp_register_style(\n 'nh3-mag-blocks-style',\n plugins_url( 'build/css/style.css', NH3_BLOCKS_MAIN_FILE ),\n array(),\n filemtime( plugin_dir_path( NH3_BLOCKS_MAIN_FILE ) . 'build/css/style.css' )\n );\n\n wp_register_style(\n 'nh3-mag-blocks-style-editor',\n plugins_url( 'build/css/editor.css', NH3_BLOCKS_MAIN_FILE ),\n array( 'wp-edit-blocks' ),\n filemtime( plugin_dir_path( NH3_BLOCKS_MAIN_FILE ) . 'build/css/editor.css' )\n );\n\n // Register the blocks\n foreach ( self::BLOCKS as $block_name ) {\n register_block_type(\n \"nh3/$block_name\", array(\n 'style' => 'nh3-mag-blocks-style',\n 'script' => 'nh3-mag-blocks-frontend',\n 'editor_script' => 'nh3-mag-blocks',\n 'editor_style' => 'nh3-mag-blocks-style-editor',\n 'render_callback' => $this->generate_template_loader( $block_name ),\n )\n );\n }\n }",
"function render_block_core_post_content($attributes, $content, $block)\n {\n }",
"protected function registerContentBlocks()\n {\n if ($this->app->runningInConsole()) {\n return;\n }\n\n $blocks = Cache::remember('content.blocks', 1440, function ()\n {\n return Block::where('status', 'publish')->get();\n });\n\n $blocks->each(function ($block)\n {\n $name = sprintf('content.block.%s', $block->name);\n\n $position = $block->block_widget_position ?: 'content';\n\n $parameters = array($this->app, $block);\n\n Widget::register(\n 'Modules\\Content\\Widgets\\BlockHandler', $name, $position, $block->menu_order, $parameters\n );\n });\n }",
"function _{PROFILE_CODE}_setup_blocks() {\n $admin_theme = variable_get('admin_theme', 'seven');\n $default_theme = variable_get('theme_default', 'bartik');\n\n $blocks = array(\n array(\n 'module' => 'system',\n 'delta' => 'help',\n 'theme' => $admin_theme,\n 'status' => 1,\n 'weight' => 0,\n 'region' => 'help',\n 'pages' => '',\n 'cache' => DRUPAL_NO_CACHE,\n ),\n array(\n 'module' => 'system',\n 'delta' => 'help',\n 'theme' => $default_theme,\n 'status' => 1,\n 'weight' => 0,\n 'region' => 'preface_first',\n 'pages' => '',\n 'cache' => DRUPAL_NO_CACHE,\n ),\n array(\n 'module' => 'system',\n 'delta' => 'main',\n 'theme' => $default_theme,\n 'status' => 1,\n 'weight' => 0,\n 'region' => 'content',\n 'pages' => '<front>', // Do not show the block on front.\n 'visibility' => 0,\n 'cache' => DRUPAL_NO_CACHE,\n ),\n // Connector.\n array(\n 'module' => 'connector',\n 'delta' => 'one_click_block',\n 'theme' => $default_theme,\n 'status' => 1,\n 'weight' => 1,\n 'region' => 'content',\n 'pages' => \"user\\r\\nuser/login\",\n 'visibility' => BLOCK_VISIBILITY_LISTED,\n 'cache' => DRUPAL_NO_CACHE,\n ),\n // Search sorting.\n array(\n 'module' => 'search_api_sorts',\n 'delta' => 'search-sorts',\n 'theme' => $default_theme,\n 'status' => 1,\n 'weight' => -30,\n 'region' => 'content',\n 'pages' => 'products',\n 'visibility' => BLOCK_VISIBILITY_LISTED,\n 'cache' => DRUPAL_NO_CACHE,\n ),\n );\n\n drupal_static_reset();\n _block_rehash($admin_theme);\n _block_rehash($default_theme);\n foreach ($blocks as $record) {\n $module = array_shift($record);\n $delta = array_shift($record);\n $theme = array_shift($record);\n db_update('block')\n ->fields($record)\n ->condition('module', $module)\n ->condition('delta', $delta)\n ->condition('theme', $theme)\n ->execute();\n }\n}",
"function blocks() {\n\t\n\tglobal $SBLCK;\n\t\n\tif ( ! function_exists( 'register_block_type' ) ) {\n\t\treturn;\n\t}\n\t\n\t// add any configured colors to the background vars colors\n\tif ( ! empty( $SBLCK->get( 'colors' ) ) ) {\n\t\t$SBLCK->set( 'background.colors', $SBLCK->get( 'colors' ) );\n\t}\n\t\n\t$SCR = scripts_array( 'all' );\n\t\n\tregister_scripts( $SCR['scripts'] );\n\tregister_styles( $SCR['styles'] );\n\t\n\tforeach ( $SBLCK->get( 'blocks' ) as $block ) {\n\t\t\n\t\t$register_arguments = [];\n\t\t\n\t\tforeach ( $block['callbacks'] as $call => $cb ) {\n\t\t\t$register_arguments[ $call ] = $cb;\n\t\t}\n\t\t\n\t\tregister_block_type( SECTIONBLOCK_SLUG . '/' . $block['id'], $register_arguments );\n\t}\n\t\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the entity set that contains this entity | public function getEntitySet(): ?EntitySet
{
return $this->entitySet;
} | [
"public function entitySets(): array;",
"public function createEntitySet() : EntitySet\n {\n return clone $this->entitySetPrototype;\n }",
"public function getEntitySetValue(): EntitySet\n {\n return $this->value;\n }",
"public function getEntities() {\n return $this->entities;\n }",
"public function all()\n {\n return $this->set;\n }",
"public function getQuerySet()\n {\n return call_user_func([$this->getModelClass(), 'objects']);\n }",
"final public function getEntities() {\n return (array) $this->entities;\n }",
"protected function getEntities()\n {\n if (!$this->entities) {\n // indirectly initializes the entities property\n $this->initializeChoices();\n }\n\n return $this->entities;\n }",
"public function entitySets(): array\n {\n return array_filter($this->getElements(), function (IEntityContainerElement $item) {\n return $item instanceof IEntitySet;\n });\n }",
"public function getResult()\n {\n $this->_loadSet();\n return $this->_set;\n }",
"protected function getEntities()\n {\n return $this->database->getEntities();\n }",
"public function findEntitySet(string $setName): ?IEntitySet;",
"public function to_set() {\n return $this->copy();\n }",
"private function _getElementSet()\n {\n $elementSetTable = $this->_db->getTable('ElementSet');\n return $elementSetTable->findByName($this->_elementSetMetadata['name']);\n }",
"public function getSet($id) {\n $select = $this->getDatabase()\n ->select()\n ->from($this->getTableName())\n ->where('id = ?', $id);\n\n $data = $select->fetchOne();\n $data['id'] = (int)$data['id'];\n\n $set = new Entity\\Set($data);\n\n return $set;\n }",
"public function getQueriedEntities()\n {\n return isset($this->QueriedEntities) ? $this->QueriedEntities : null;\n }",
"public function getRelatedEntities()\n {\n return $this->relatedEntities;\n }",
"public function getAllEntities()\n {\n return $this->getRepository()->findAll();\n }",
"public static function getQueryableEntity() {\n\t\t // return Site\\Settings::get('morphd_queryable_entities', []);\n\t\t return [];\n\t }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Force initialization of the proxy | public function initializeProxy(): bool; | [
"protected function initializeProxy()\n {\n //Initialize internal vars\n $this->states = new \\ArrayObject();\n $this->activesStates = new \\ArrayObject();\n $this->callerStatedClassesStack = new \\SplStack();\n }",
"public function initializeProxy() : bool;",
"protected function _initProxy() {\n\t\t$options = $this->getOptions();\n\t\t$this->_config->setAutoGenerateProxyClasses(isset($options['proxy']['autoGenerateProxyClasses']) ? $options['proxy']['autoGenerateProxyClasses'] : true);\n\t\t$this->_config->setProxyDir(isset($options['proxy']['directory']) ? $options['proxy']['directory'] : APPLICATION_PATH . '/Model/Proxies');\n\t\t$this->_config->setProxyDir(isset($options['proxy']['directory']) ? $options['proxy']['directory'] : APPLICATION_PATH . '/Model/Proxies');\n\t\t$this->_config->setProxyNamespace(isset($options['proxy']['namespace']) ? $options['proxy']['namespace'] : 'Model\\Proxies');\n\t}",
"public function initProxy()\n {\n $this->proxy = new Proxy(\n $this->getSocketServer(),\n $this->getCachePool(),\n $this->getCacheAdapter()\n );\n $this->\n getProxy()->\n checkExtensionsAvailable()->\n handleTerminationSignals();\n\n return $this;\n }",
"public function initializeLazyGhostObject(): void;",
"public function testForwardStartupProxyNotInitialized()\n {\n try {\n Factory\\StandardStartupFactory::forwardStartup(new Support\\MockProxy(null));\n } catch (Exception\\UnavailableFactory $e) {\n return;\n } catch (\\Exception $e) {\n }\n\n $this->fail('Error, the startup factory must throw an exception when the proxy cannot be initialized');\n }",
"private function applyProxy()\n {\n $proxy = $this->nextProxy();\n if ($proxy !== null ) {\n $this->options['proxy'] = $proxy;\n }\n }",
"public function autoSetProxy() {\n\t\t$proxy = Environment::getEnv('SS_PROXY');\n\n\t\tif ($proxy) {\n\t\t\t$this->setOption('proxy', $proxy);\n\t\t}\n\n\t\tif (Config::inst()->get('Grasenhiller\\WkHtmlToX', 'bypass_proxy_for_own_site')) {\n\t\t\t$this->setOption('bypass-proxy-for', rtrim(str_replace(['http://', 'https://'], ['', ''], Director::absoluteBaseURL()), '/'));\n\t\t}\n\t}",
"protected function ensureProxy() {\n if (!isset($this->proxy)) {\n $class = mica_connector_get_connection_info($this->class);\n if ($class && class_exists($class['class'])) {\n if (empty($this->options)) {\n // We always have to provide the options.\n $this->options = array();\n }\n $this->proxy = new $class['class']($this);\n }\n if (!($this->proxy instanceof MicaDatasetConnectionInterface)) {\n throw new MicaException(t('Dataset connector with id !id specifies illegal service class !class.',\n array('!id' => $this->id, '!class' => $this->class)));\n }\n }\n }",
"public function initGateway() {\n\t}",
"public function setProxyRevalidate(): void\n {\n $this->proxyRevalidate = true;\n }",
"public function _initialize()\n {\n $this->_reconfigure(); // hook for BC only.\n }",
"protected function _init() {}",
"protected function init() {}",
"public function __construct($proxy = null)\n {\n if (!is_null($proxy)) {\n $this->proxy = $proxy;\n }\n }",
"abstract public function reInitialize();",
"protected function lazyLoadHttpClient()\n {\n $this->_client = new Zend_Http_Client();\n }",
"public function initializeEntityProxy(\\Asgard\\Entity\\Entity $entityProxy);",
"protected function init(): void\n {\n $this->map = $this->mapService->getMap();\n $this->shooter = $this->map->getShooter();\n $this->target = $this->map->getTarget();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return stadiums which are free or belongsTo specifyied league | public static function emptyAndWithLeague($league)
{
$stadiums = Stadium::WhereIn('league_id', array_column($league->stadiums->toArray(), 'league_id'))->orWhere('league_id', null)->get();
return $stadiums;
} | [
"public function regularStadium()\n {\n return $this->stadiums()->wherePivot('is_regular_stadium', '1');\n }",
"public function get_leaguedivisions($league_id)\n {\n $sql = \"SELECT x.division_id, x.division_name, x.parent_division_id , x.only_teams\n FROM public.league_division x \n WHERE x.deleted_flag = 'f' \n AND x.league_id = ?\";// AND \".USER_CAN_ACCESS.\" \"; \n return $this->db->query($sql,$league_id)->result_array();\n }",
"function show_only_current_league( $query ) {\r\n if( is_admin() && !empty( $_GET['post_type'] )) {\r\n if ( ($_GET['post_type'] == 'sp_player' && $query->query['post_type'] == 'sp_player' ) ||\r\n ($_GET['post_type'] == 'sp_staff' && $query->query['post_type'] == 'sp_staff' ) ||\r\n ($_GET['post_type'] == 'sp_event' && $query->query['post_type'] == 'sp_event' ) ||\r\n ($_GET['post_type'] == 'sp_list' && $query->query['post_type'] == 'sp_list' )\t) {\r\n $user_groups = wp_get_object_terms(get_current_user_id(), 'squadra');\r\n $user_leagues = array();\r\n foreach ((array)$user_groups as $user_group) {\r\n $user_leagues[] = $user_group->name;\r\n }\r\n if (in_array('Tutto', $user_leagues)) {\r\n return;\r\n }\r\n $query->set('tax_query', array(array(\r\n 'taxonomy' => 'sp_league',\r\n 'field' => 'slug',\r\n 'terms' => $user_leagues,\r\n 'operator' => 'IN'\r\n )));\r\n }\r\n }\r\n }",
"public function league()\n\t{\n\t\treturn $this->belongsTo('Fantasee\\League');\n\t}",
"private function _getLeagueData()\n\t{\n\t // Reference global application object\n $app = JFactory::getApplication();\n // JInput object\n $jinput = $app->input;\n $option = $jinput->getCmd('option');\n $db\t= $this->getDbo();\n $query = $db->getQuery(true);\n \n $query->select('*');\n $query->from('#__sportsmanagement_league');\n $query->where('id = ' . $this->_project[0]['league_id'] );\n \n\t\t//$query = \"SELECT * FROM #__sportsmanagement_league WHERE id=\".$this->_project[0]['league_id'];\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\tif ($db->getNumRows() > 0)\n\t\t{\n\t\t\t$result = $db->loadAssocList();\n\t\t\t$result[0]['object'] = 'League';\n\n\t\t\treturn $result;\n\t\t}\n\t\treturn false;\n\t}",
"public function losingTeam(): BelongsTo\n {\n return $this->top_team_score < $this->bottom_team_score ? $this->topTeam() : $this->bottomTeam();\n }",
"public function findFreeGameSet()\n {\n $criteria = ['owner' => null];\n return $this->findOneBy($criteria);\n }",
"public function standings()\n {\n \treturn $this->hasMany( Standing::class );\n }",
"private function getUnclaimedDistricts() {\r\n return self::getObjectListFromDB(\r\n \"SELECT id, possible_winners FROM districts \r\n WHERE player_color IS NULL\");\r\n }",
"public function availabilities() {\n return $this->belongsToMany(Rehearsal::class, 'availability')\n ->withPivot('start', 'end');\n }",
"function get_teams_by_league_id($id)\n\t{\n $this->db->where('leagues',$id);\n\t\t$query = $this->db->get('teams');\t\t\n\t\treturn $query;\n\t}",
"private function _gather_unassigned_games()\n {\n \t$floating=array();\n \tif(!is_array($this->createdGames)) $this->createdGames=array();//in case of errrs - like if zero teams somethign was skipped\n\t\tforeach($this->createdGames as $i=>$g)\n\t\t{\n\t\t\tif($g['timeslot']==-2)\n\t\t\t{\n\t\t\t\t//$g['g_index']=$i;//self reference GEB\n\t\t\t\t$floating[]=$i;\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn $floating;\n }",
"public function freelance()\n {\n return $this->belongsToMany('Freelance', 'freelances_skills', 'skill_id', 'account_id');\n }",
"public function leagues(){\n return $this->hasMany('App\\League');\n }",
"private function fetchLeagueStandings($division = '')\n\t{\n\t\treturn $this->database->fetchLeagueStandings($division);\n\t}",
"public function getTeams()\n {\n $elements=$this->hasMany(Team::className(), ['id' => 'teamid'])\n ->viaTable('team_user', ['userid' => 'id']);\n $elements->via->where=\"team_user.rights=0\";\n $a = $elements->Where(\"deleted != 1\")->all();\n \n $elements=$this->hasMany(Team::className(), ['id' => 'teamid'])\n ->viaTable('team_user', ['userid' => 'id']);\n $elements->via->where=\"team_user.rights=1\";\n $b = $elements->andWhere(\"deleted != 1\")->all();\n \n $elements=$this->hasMany(Team::className(), ['id' => 'teamid'])\n ->viaTable('team_user', ['userid' => 'id']);\n $elements->via->where=\"team_user.rights=2\";\n $c = $elements->andWhere(\"deleted != 1\")->all();\n \n return array_merge($a,$b,$c);\n }",
"public function standings($groups=null){\n $standings = array();\n if(!$groups){\n $groups = Group::with(['matches','teams'])->get(); \n }\n foreach($groups as $group){\n $standings[$group->id] = array();\n // assign initial values for the teams in the group\n foreach($group->teams as $team){\n $standings[$group->id][$team->id] = array(\n 'team_id'=>$team->id,\n 'team_name'=>$team->name,\n 'team_iso'=>$team->iso,\n 'played' => 0,\n 'wins' => 0,\n 'draws' => 0,\n 'losts'=> 0,\n 'goalsFor' => 0,\n 'goalsAgainst' => 0,\n );\n }\n // parse the pronostics for the group matches \n foreach($group->matches as $match){\n $pronostic = $this->pronostics->where('match_id',$match->id)->first(); // ->first() return an instance of the first found model, or null otherwise.\n if(!$pronostic||is_null($pronostic->score_h) || is_null($pronostic->score_a)) continue;\n $team_h = $match->team_h; // team id\n $team_a = $match->team_a;\n $standings[$group->id][$team_h]['played'] += 1;\n $standings[$group->id][$team_a]['played'] += 1;\n $standings[$group->id][$team_h]['goalsFor'] += $pronostic->score_h;\n $standings[$group->id][$team_h]['goalsAgainst'] += $pronostic->score_a; \n $standings[$group->id][$team_a]['goalsFor'] += $pronostic->score_a;\n $standings[$group->id][$team_a]['goalsAgainst'] += $pronostic->score_h;\n switch ($pronostic->score_h <=> $pronostic->score_a){\n case 0 : $standings[$group->id][$team_h]['draws'] += 1; $standings[$group->id][$team_a]['draws'] += 1; break; // tie\n case 1 : $standings[$group->id][$team_h]['wins'] += 1; $standings[$group->id][$team_a]['losts'] += 1; break; // home team wins\n case -1: $standings[$group->id][$team_h]['losts'] += 1; $standings[$group->id][$team_a]['wins'] += 1; break; // home team loses\n } \n }\n usort($standings[$group->id],array($this, \"cmp_standings\")); \n } \n return $standings;\n }",
"public function approvedTeams()\n {\n return $this->hasMany('App\\Team')->where('status', 'approved');\n }",
"public function standings()\n\t{\n\t\treturn $this->hasMany( Standing::class );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation createAccountOrderRebalanceUsingPostAsync Create account rebalance orders | public function createAccountOrderRebalanceUsingPostAsync($account_id, $req)
{
return $this->createAccountOrderRebalanceUsingPostAsyncWithHttpInfo($account_id, $req)
->then(
function ($response) {
return $response[0];
}
);
} | [
"public function testCreatePortfolioOrderRebalanceUsingPost()\n {\n }",
"public function testCreateAccountOrderReconciliation()\n {\n }",
"function commerce_license_billing_create_recurring_orders_action($order) {\n commerce_license_billing_create_recurring_orders($order);\n}",
"public function testCreateAccountOrderBulkUsingPost()\n {\n }",
"protected function createPortfolioOrderRebalanceUsingPostRequest($portfolio_id, $req)\n {\n // verify the required parameter 'portfolio_id' is set\n if ($portfolio_id === null || (is_array($portfolio_id) && count($portfolio_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $portfolio_id when calling createPortfolioOrderRebalanceUsingPost'\n );\n }\n // verify the required parameter 'req' is set\n if ($req === null || (is_array($req) && count($req) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $req when calling createPortfolioOrderRebalanceUsingPost'\n );\n }\n\n $resourcePath = '/nucleus/v1/portfolio/{portfolio_id}/order_rebalance';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($portfolio_id !== null) {\n $resourcePath = str_replace(\n '{' . 'portfolio_id' . '}',\n ObjectSerializer::toPathValue($portfolio_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($req)) {\n $_tempBody = $req;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\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 \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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createOrder($order);",
"public function create(GuaranteedOrder $postBody, $optParams = [])\n {\n $params = ['postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('create', [$params], GuaranteedOrder::class);\n }",
"public function createOrderToken() {\n\n $this->_constructPayload();\n\n $result = $this->afterpay_create_order->processOrder($this->transaction);\n }",
"public function createTransaction(Customweb_Payment_Authorization_Recurring_ITransactionContext $transactionContext);",
"public function createWallet($account);",
"public function process_rebill( $params ) {\n\t\t\n\t\twc_paysafe_add_debug_log( 'Rebill request: ' . print_r( $params, true ) );\n\t\t\n\t\t// Send request to setup the payment token\n\t\t$rebill = $this->get_client()->hostedPaymentService()->rebillOrder(\n\t\t\tnew \\Paysafe\\HostedPayment\\Order( $params )\n\t\t);\n\t\t\n\t\twc_paysafe_add_debug_log( 'Rebill response: ' . print_r( $rebill, true ) );\n\t\t\n\t\treturn $rebill;\n\t}",
"public function testCreateBankAccountUsingPOST()\n {\n }",
"public function createAccountOrderSellOnlyUsingPost($account_id, $req)\n {\n list($response) = $this->createAccountOrderSellOnlyUsingPostWithHttpInfo($account_id, $req);\n return $response;\n }",
"public function postOrder(array $data=[]){\n $this->type='POST';\n $this->path='/fapi/v1/order';\n $this->data=array_merge($this->data,$data);\n return $this->exec();\n }",
"public function createAccountOrderSellAllUsingPost($account_id, $req)\n {\n list($response) = $this->createAccountOrderSellAllUsingPostWithHttpInfo($account_id, $req);\n return $response;\n }",
"private function createOrders()\n {\n $expectedPlacedOrdersNumber = 3;\n $quote = $this->getQuote('multishipping_quote_id_braintree');\n\n /** @var CheckoutSession $session */\n $session = $this->objectManager->get(CheckoutSession::class);\n $session->replaceQuote($quote);\n\n $this->model->createOrders();\n\n $orderList = $this->getOrderList((int)$quote->getId());\n self::assertCount(\n $expectedPlacedOrdersNumber,\n $orderList,\n 'Total successfully placed orders number mismatch'\n );\n }",
"public function createPaymentTransaction($order, $qliroOrder);",
"function createorder($order_id, $currency, $postArray,$addlink='') {\n\t\t$result = QPConnectorFactory::getConnector()->request($this->mode.$addlink.'?order_id='.$order_id.'¤cy='.$currency, $postArray);\t\n\n\t\treturn json_decode($result, true);\t\t\t\n\t}",
"public function createAccountOrderBuyOnlyUsingPost($account_id, $req)\n {\n list($response) = $this->createAccountOrderBuyOnlyUsingPostWithHttpInfo($account_id, $req);\n return $response;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Appends CSS class(es) to given form view | public static function appendClass(FormView $view, $cssClasses)
{
$vars = $view->vars;
$cssClasses = is_array($cssClasses) ? $cssClasses : [$cssClasses];
$vars['attr'] = isset($vars['attr']) ? $vars['attr'] : [];
$vars['attr']['class'] = isset($vars['attr']['class']) ? $vars['attr']['class'] : '';
$vars['attr']['class'] = trim(implode(' ', array_merge([$vars['attr']['class']], $cssClasses)));
$view->vars = $vars;
} | [
"protected final function AddCssClassField()\n {\n $name = 'CssClass';\n $this->AddField(Input::Text($name, $this->Content()->GetCssClass()), false, Trans(\"Core.ContentForm.$name\"));\n }",
"public function SetViewClass ($viewClass = 'MvcCore\\\\Ext\\\\Forms\\\\View');",
"function hardwood_form_contact_site_form_alter(&$form, &$form_state) {\n $form['cid']['#attributes']['class'][] = 'form-control';\n}",
"function form_classes( $class ) {\r\r\n\t\t\r\r\n\t\t// Get the current CF7 form ID\r\r\n\t\t$cf7 = wpcf7_get_current_contact_form(); // Current contact form 7 object\r\r\n\t\t$form_id = $this->get_form_id( $cf7 );\r\r\n\t\t\r\r\n\t\t// Get current CF7 form template and style from post meta\r\r\n\t\t$template_class = get_post_meta( $form_id, 'cf7s_template', true ) ? ' cf7t-' . get_post_meta( $form_id, 'cf7s_template', true ) : '';\r\r\n\t\t$skin_class = get_post_meta( $form_id, 'cf7s_style', true ) ? ' cf7s-'. get_post_meta( $form_id, 'cf7s_style', true ) : '';\r\r\n\t\t\r\r\n\t\t// CF7 Skins default class\r\r\n\t\t$cf7skins_class = ( $template_class || $skin_class ) ? ' cf7skins' : '';\r\r\n\t\t\r\r\n\t\t// Apply filter to allow other functions to modify the class\r\r\n\t\t$cf7skins_classes = apply_filters( 'cf7skins_form_classes', $cf7skins_class );\r\r\n\t\t\r\r\n\t\t// Return the modified class\r\r\n\t\treturn $class . $cf7skins_classes . $template_class . $skin_class;\r\r\n\t}",
"public function optin_form_css();",
"function sn_gforms_input_class( $classes, $field, $form ){\n\t$input_slug = sanitize_title( $field['label'] );\n\t$classes .= \" gfield-{$input_slug}\";\n\n\treturn $classes;\n}",
"function gf_add_custom_css_classes( $button, $form ) {\n\n\t$dom = new DOMDocument();\n\t$dom->loadHTML( '<?xml encoding=\"utf-8\" ?>' . $button );\n\t$input = $dom->getElementsByTagName( 'input' )->item( 0 );\n\t$classes = $input->getAttribute( 'class' );\n\t$classes .= ' btn btn-secondary';\n\t$input->setAttribute( 'class', $classes );\n\treturn $dom->saveHtml( $input );\n\n}",
"private function renderEditClassForm() {\n\t\t$this->tabs->setTabActive(\"edit_properties\");\n\n\t\t$toolbar = $this->createEditClassFormToolbar();\n\t\t$class_form = $this->createEditClassFormWithPrivilegeCheck();\n\t\t$this->tpl->setContent($toolbar->getHTML() . $class_form->getHTML());\n\t}",
"function bf_vc_edit_form_classes( $classes, $atts, $params ) {\n\n\t\t$added_fields = array();\n\t\t$interactive_added = false;\n\t\tforeach ( $params as $param ) {\n\t\t\tif ( ! empty( $param['show_on'] ) ) {\n\t\t\t\tif ( ! $interactive_added ) {\n\t\t\t\t\tarray_push( $classes, 'bf-interactive-fields', 'bf-has-filters' );\n\t\t\t\t\t$interactive_added = true;\n\t\t\t\t}\n\n\t\t\t\tforeach ( (array) $param['show_on'] as $conditions ) {\n\t\t\t\t\tforeach ( (array) $conditions as $condition ) {\n\t\t\t\t\t\t$field_name = explode( '=', $condition, 2 );\n\t\t\t\t\t\t$field_name = $field_name[0];\n\t\t\t\t\t\tif ( ! in_array( $field_name, $added_fields ) ) {\n\t\t\t\t\t\t\tarray_push( $classes, 'bf-filter-field-' . $field_name );\n\t\t\t\t\t\t\t$added_fields[] = $field_name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn array_unique( $classes );\n\t}",
"public function handler_form_class_attr( $class )\n\t\t{\n\t\t\t$class .= ' avia_ajax_form avia-disable-default-ajax';\n\t\t\treturn $class;\n\t\t}",
"function uw_add_wpcf7_bootstrap_class($class)\n {\n return $class . ' form-horizontal';\n }",
"function add_class_for_form_grid( $class, $id, $args ) {\n\t$class[] = 'give-form-grid-wrap';\n\n\tforeach ( $class as $index => $item ) {\n\t\tif ( false !== strpos( $item, 'give-display-' ) ) {\n\t\t\tunset( $class[ $index ] );\n\t\t}\n\t}\n\n\treturn $class;\n}",
"function finder_form_alter(&$form, &$form_state) {\n $form['finder_form']['submit']['#attributes']['class'] = 'red-grey';\n\t$form['finder_form']['submit']['#attributes']['override'] = true;\n}",
"function wps_add_custom_css_classes( $button, $form ) {\n\n\t\t$dom = new DOMDocument();\n\t\t$dom->loadHTML( '<?xml encoding=\"utf-8\" ?>' . $button );\n\t\t$input = $dom->getElementsByTagName( 'input' )->item( 0 );\n\t\t$classes = $input->getAttribute( 'class' );\n\t\t$classes .= ' btn btn-secondary';\n\t\t$input->setAttribute( 'class', $classes );\n\t\treturn $dom->saveHtml( $input );\n\n\t}",
"function formClass()\n {\n return 'form_settings';\n }",
"public function add_class() {\n\t\t\t\n\t\t$result['class_timeTable'] = $this->Admin_Model->get_timeTable();\n\t\t$result['corp_name']= $this->Admin_Model->getCorporates();\n\t\t$result['class_type'] = $this->Admin_Model->getClass_type();\n\t\t$result['class_recurrence'] = $this->Admin_Model->getClassRecurrence_type();\n\t\t$this->load->view('add_class', $result);\n\n\t}",
"public function add_custom_class( $classes, $field, $form ) {\r\n\t\tif ( $field->type == 'poll' ) {\r\n\t\t\t$classes .= ' gpoll_field';\r\n\t\t}\r\n\r\n\t\treturn $classes;\r\n\t}",
"function add_form_group_class( $classes, $field, $form ){\n\n if ( !is_admin() ) {\n $classes .= \" form-group\";\n $classes = str_replace(\"gfield_error\", \"has-error\", $classes);\n }\n\n return $classes;\n\n}",
"function getFormClasses(){\n return \"\";\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
// setRatePlansForDealer // setRatePlansForDealer() Set which RatePlans a Dealer can sell on behalf of Set which RatePlans a Dealer can sell on behalf of | public static function setRatePlansForDealer($intDealerId, $arrRatePlanIds)
{
// Delete existing records in the Dealer_Rate_Plan table
$qryQuery = new Query();
$intDealerId = intval($intDealerId);
if (!$qryQuery->Execute("DELETE FROM dealer_rate_plan WHERE dealer_id = $intDealerId;"))
{
throw new Exception_Database("Failed to set RatePlans for Dealer: $intDealerId. (Removal of old dealer - RatePlan associations failed) - " . $qryQuery->Error());
}
// Reset the auto incrementing counter for the dealer_rate_plan table
// (This really isn't worth doing, as it is only effective if the dealer is the last one to have records added to the dealer_rate_plan table)
// Insert records into the dealer_rate_plan table
$arrData = array( "dealer_id" => $intDealerId,
"rate_plan_id" => NULL
);
$insDealerRatePlan = new StatementInsert("dealer_rate_plan", $arrData);
foreach ($arrRatePlanIds as $intRatePlanId)
{
$arrData['rate_plan_id'] = $intRatePlanId;
if ($insDealerRatePlan->Execute($arrData) === FALSE)
{
throw new Exception_Database("Failed to set RatePlans for Dealer: $intDealerId. (inserting record into dealer_rate_plan table failed) - ". $insDealerRatePlan->Error());
}
}
} | [
"public function setOfferedPaymentPlans(?array $offeredPaymentPlans): self;",
"public function setRatePlans($arrRatePlanIds)\n\t{\n\t\t// Set the keys to the ratePlanIds as well, if they aren't already\n\t\t$arrRatePlanIds\t\t\t= array_unique($arrRatePlanIds);\n\t\t$this->_arrRatePlanIds\t= (count($arrRatePlanIds) > 0)? array_combine($arrRatePlanIds, $arrRatePlanIds) : Array();\n\t\t$this->_bolSaved\t\t= FALSE;\n\t}",
"public function setComparePlans(array $comparePlans)\n {\n $this->comparePlans = $comparePlans;\n return $this;\n }",
"public function setRatePlanID($ratePlanID)\n {\n $this->ratePlanID = $ratePlanID;\n return $this;\n }",
"public function setRatePlanCandidates(array $ratePlanCandidates)\n {\n $this->ratePlanCandidates = $ratePlanCandidates;\n return $this;\n }",
"public function setRatePlanType($ratePlanType)\n {\n $this->ratePlanType = $ratePlanType;\n return $this;\n }",
"public function setRatePlanCode($ratePlanCode)\n {\n $this->ratePlanCode = $ratePlanCode;\n return $this;\n }",
"public function setDeliveredRates($delivered_rates)\n\t\t{\n\t\t\t$this->delivered_rates = (float)$delivered_rates;\n\n\t\t\treturn $this;\n\t\t}",
"public function setRatePlanCodeType($ratePlanCodeType)\n {\n $this->ratePlanCodeType = $ratePlanCodeType;\n return $this;\n }",
"public function ratePlans()\n {\n return $this->hasMany(RatePlan::class, 'accommodation_object_id', 'id');\n }",
"public function setPlanoDeSaude($planoDeSaude)\n {\n $this->getModel()->setValor(\"planoDeSaude\", $planoDeSaude);\n return $this;\n }",
"public function addToRatePlans(\\Devlabs91\\TravelgateNotify\\Models\\Ota\\InvBlockRoomType\\RatePlansAType\\RatePlanAType $ratePlan)\n {\n $this->ratePlans[] = $ratePlan;\n return $this;\n }",
"public function setRatePlanName($ratePlanName)\n {\n $this->ratePlanName = $ratePlanName;\n return $this;\n }",
"public function updatePlans() {\n // Connecting to stripe, and making query.\n try {\n $braintreePlans = Braintree_Plan::all();\n } catch (Exception $e) {\n // Something went wrong.\n return;\n }\n\n // Getting the plans.\n $plans = [];\n foreach($braintreePlans as $plan) {\n $new_plan = new BraintreePlan(array(\n 'plan_id' => $plan->id,\n 'name' => $plan->name,\n 'billing_frequency' => $plan->billingFrequency,\n 'price' => $plan->price,\n 'currency' => $plan->currencyIsoCode,\n 'billing_day' => $plan->billingDayOfMonth,\n ));\n $new_plan->user()->associate($this->user);\n array_push($plans, $new_plan);\n }\n\n // Delete old, save new.\n foreach (BraintreePlan::where('user_id', $this->user->id)->get() as $stripePlan) {\n BraintreeSubscription::where('plan_id', $stripePlan->id)->delete();\n $stripePlan->delete();\n }\n\n foreach ($plans as $plan) {\n $plan->save();\n }\n\n return $plans;\n }",
"public function setMealPlanCodes($mealPlanCodes)\n {\n $this->mealPlanCodes = $mealPlanCodes;\n }",
"public function ratePlans ()\n {\n return $this->belongsTo('App\\Models\\Components\\RatePlan', 'rrp_rate_plan_id');\n }",
"public function getRatePlanById(string $ratePlanId)\n {\n return $this->get('rate-plan/' . $ratePlanId);\n }",
"public function setBillpayer(Billpayer $billpayer);",
"public function setBlockedMethods(array $payment_methods) {\n $this->setPaymentMethods('blocked', $payment_methods);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get address id by address type | private function getAddressIdByType(OrderInterface $order, string $type): int
{
return $type === AddressType::TYPE_BILLING
? (int)$order->getBillingAddressId()
: (int)$order->getShippingAddressId();
} | [
"public function getAddressId();",
"public function get_address_type($type_id) {\n $address = DB::table('address_type')\n ->select(\n 'address_type.type_id',\n 'address_type.title'\n )\n ->where('address_type.franchise_id', 0)\n ->where('address_type.type_id', $type_id)\n ->first();\n return response()->json($address, 200);\n }",
"public function address_type_type_to_index ($type = \"Used\") {\n\t\t# null of no length\n\t\t$type = strlen($type)==0 || is_null($type) ? \"Used\" : $type;\n\t\t# fetch address states\n\t\t$this->addresses_types_fetch();\n\t\t# reindex\n\t\t$states_assoc = array();\n\t\tforeach($this->address_types as $s) {\n\t\t\t$states_assoc[$s['type']] = $s;\n\t\t}\n\t\t# return\n\t\tif(isset($states_assoc[$type])) {\n\t\t\treturn $states_assoc[$type]['id'];\n\t\t}\n\t\telse {\n\t\t\treturn $type;\n\t\t}\n\t}",
"public function getAddress($type)\n {\n return isset($this->_addresses[$type]) ? $this->_addresses[$type] : null;\n }",
"public function getIdByType(string $type);",
"public function getZohoAddressId();",
"public function getPrimaryAddress($type = null) {\n return $this->addresses->filter(function($address) use ($type) {\n if ($type) {\n if (strtolower($type) != strtolower($address->getType())) {\n return false;\n }\n }\n return $address->getPrimaryAddress();\n })->first();\n }",
"public function addrtype() {\n\t\treturn $this->addrtype;\n\t}",
"public static function getZoneIdByType(Models_Model_Zone $zone, $type = self::ZONE_TYPE_ZIP, $address = null) {\n//\t\t$address = Models_Mapper_ShoppingConfig::getInstance()->getConfigParams();\n\t\t$zoneParts = array();\n\t\tswitch($type) {\n\t\t\tcase self::ZONE_TYPE_ZIP:\n\t\t\t\t$zoneParts = $zone->getZip();\n\t\t\tbreak;\n\t\t\tcase self::ZONE_TYPE_STATE:\n\t\t\t\t$zoneParts = $zone->getStates();\n\t\t\tbreak;\n\t\t\tcase self::ZONE_TYPE_COUNTRY:\n\t\t\t\t$zoneParts = $zone->getCountries(true);\n\t\t\tbreak;\n\t\t}\n\t\tif(is_array($zoneParts) && !empty($zoneParts)) {\n\t\t\tif($type == self::ZONE_TYPE_STATE) {\n\t\t\t\tforeach($zoneParts as $zonePart) {\n\t\t\t\t\tif($zonePart['id'] == $address['state']) {\n\t\t\t\t\t\treturn $zone->getId();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(in_array($address[$type], $zoneParts)) {\n\t\t\t\treturn $zone->getId();\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}",
"public function getCustomerAddressId();",
"protected function _getAddressByType($type)\n {\n foreach ($this->getAddressesCollection() as $address) {\n if ($address->getAddressType() == $type && !$address->isDeleted()) {\n return $address;\n }\n }\n\n $address = Mage::getModel('sales/quote_address')->setAddressType($type);\n $this->addAddress($address);\n return $address;\n }",
"public function getAddress($type = 'billing')\n {\n foreach($this->getAddresses() as $address)\n {\n if($address->getType() === $type)\n {\n return $address;\n }\n }\n return false;\n }",
"public function get_customer_address_id($type, $input) {\n $result = new stdClass();\n $result_arr = array();\n\n if($type==\"autocomplete\") {\n \n $sql1 = \"\n select concat(customer_address_id, ' - ', customer_address_name) as customer_address_id\n from customer_address\n where customer_id like '%\".$input.\"%'\n or customer_address_id like '%\".$input.\"%'\n or customer_address_name like '%\".$input.\"%';\n \";\n\n $q1 = $this->db->query($sql1);\n // var_dump($q1->result_array());exit;\n\n // get item all item rows\n $item_rows_count = count($q1->result());\n $num_rows = count($q1->result());\n }\n // var_dump($query->result_array());exit;\n // var_dump($query->result()[0]->user_login);exit;\n\n for($i=0; $i<count($q1->result()); $i++) {\n $col_arr = array();\n \n foreach($q1->result_array()[$i] as $key => $value) {\n array_push($result_arr, $value);\n }\n }\n $result->suggestions = $result_arr;\n // var_dump($result);exit;\n return $result;\n }",
"public function getAddressType()\n {\n return $this->addressType;\n }",
"public function getAddressId() {\n return is_object($this->address) ? $this->address->getId() : $this->address;\n }",
"protected function getAddressByType($type)\n {\n $address = Doctrine::getTable('rtAddress')->getAddressForObjectAndType($this->getOrder(), $type);\n\n if(!$address && $this->getUser()->isAuthenticated())\n {\n $user = $this->getUser()->getGuardUser();\n $address = Doctrine::getTable('rtAddress')->getAddressForModelAndIdAndType('rtGuardUser', $user->getId(), $type);\n if($address)\n {\n $address = $address->copy(false);\n $address->setFirstName($user->getFirstName());\n $address->setLastName($user->getLastName());\n }\n }\n\n if(!$address)\n {\n $address = new rtAddress;\n }\n\n $address->setModelId($this->getOrder()->getId());\n $address->setType($type);\n $address->setModel('rtShopOrder');\n \n return $address;\n }",
"public function getAddressType(): AddressType\n {\n return $this->address_type;\n }",
"public function getBillingAddressId();",
"public function getQuoteAddressId();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all Faq models. | public function actionIndex() {
$model = new Faq();
$searchModel = new FaqSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
$defaultLanguage = Language::find()->where(['is_default' => 1])->one();
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
'model' => $model,
'defoultId' => $defaultLanguage->id
]);
} | [
"public function actionIndex() {\n $searchModel = new TrFaqSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index() {\n return view('admin.faqs.index')->withFaqs(Faq::orderBy('sort_order')->get());\n }",
"public function getFaqCategories()\n\n {\n $this->checkPermission(4);\n\n // model Data\n $FaqCategories = $this->faqCategories->getAllFaqCategories();\n\n\n $pageTitle = \"All FAQ Categories\";\n\n // view\n\n include (WEBINTY_VIEWS.'/admin/header.html');\n include (WEBINTY_VIEWS.'/admin/menu.html');\n include (WEBINTY_VIEWS.'/admin/nav.html');\n include (WEBINTY_VIEWS.'/admin/faqsCategories.html');\n include (WEBINTY_VIEWS.'/admin/footer.html');\n\n }",
"public function findAll()\n {\n $query=\"SELECT faqId,\".\n \"faqQuestion,\".\n \"faqAnswer,\".\n \"faqOrder,\".\n \"faqCreated,\".\n \"faqModified,\".\n \"faqStatus \". \t\t \n\t \"FROM faq \".\n\t \"WHERE faqStatus='ACTIVE' ORDER by faqOrder\" ;\n\n return($this->selectDB($query, \"Faq\"));\n }",
"public function getHostingFaqs()\n\n {\n $this->checkPermission(4);\n $pageTitle = \"All Hosting FAQS\";\n\n\n // model\n $hostingFaqs = $this->hostingFAQModel->getAllHostingFaqs();\n\n // view\n include (WEBINTY_VIEWS.'/admin/header.html');\n include (WEBINTY_VIEWS.'/admin/menu.html');\n include (WEBINTY_VIEWS.'/admin/nav.html');\n include (WEBINTY_VIEWS.'/admin/hostingFaqs.html');\n }",
"public function getFaqsList()\n {\n $select = $this->_faqResourceModel->getConnection()->select()\n ->from(['faq' => $this->_faqResourceModel->getMainTable()])\n ->joinLeft(\n ['faq_store' => $this->_faqResourceModel->getTable('phpcuong_faq_store')],\n 'faq.faq_id = faq_store.faq_id',\n ['store_id']\n )\n ->where('faq_store.store_id =?', $this->_storeManager->getStore()->getStoreId())\n ->where('faq.is_active = ?', '1');\n\n $textSearch = $this->clearTextSearch();\n $explode = explode(' ', $textSearch);\n\n for ($i=0; $i<count($explode); $i++) {\n if ($i == 0) {\n $select->where('faq.title LIKE ?', \"%{$explode[$i]}%\");\n } else {\n $select->orWhere('faq.title LIKE ?', \"%{$explode[$i]}%\");\n }\n $select->orWhere('faq.content LIKE ?', \"%{$explode[$i]}%\");\n }\n\n $select->group('faq.faq_id');\n $select->order('faq.faq_id DESC');\n\n if ($results = $this->_faqResourceModel->getConnection()->fetchAll($select)) {\n return $results;\n }\n\n return false;\n }",
"public function faq()\n\t{\n\t $faqManager = new FaqManager();\n\t $faqs = $faqManager->findAllFaq();\n\n\t\tView::show(\"faq/faq.php\", \"Frequently asked questions !\", [\"faqs\"=>$faqs]);\n\t}",
"public function faqs()\n {\n return $this->hasMany(Faq::class, 'faq_topic_id');\n }",
"public function getAllFaq()\n\t{\n\t\t$result=$this->db->query(\"SELECT tblmvbfaqmanagement.faq_id_pk,tblmvbfaqmanagement.faq_question,tblmvbfaqmanagement.faq_description,tblmvbfaqmanagement.faq_createdDate,\n\t\t\t\t tblmvbfaqmanagement.faq_modifiedDate,tblmvbfaqmanagement.faq_status,(select tblmvbsysmainusers.sysmu_username from tblmvbsysmainusers \n\t\t\t\t where tblmvbfaqmanagement.faq_createdBy=tblmvbsysmainusers.sysmu_id_pk) as created_by, (select tblmvbsysmainusers.sysmu_username from\n\t\t\t\t tblmvbsysmainusers where tblmvbfaqmanagement.faq_modifiedBy=tblmvbsysmainusers.sysmu_id_pk) as modified_by FROM `tblmvbfaqmanagement` \n\t\t\t\t tblmvbfaqmanagement order by tblmvbfaqmanagement.faq_id_pk DESC\");\n\t\t\n\t\treturn $result->result();\n\t\n\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $faqCategories = $em->getRepository('BrooterAdminBundle:FaqCategory')->findAll();\n\n return $this->render('faqcategory/index.html.twig', array(\n 'faqCategories' => $faqCategories,\n ));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $faqtis = $em->getRepository('AppBundle:faqti')->findAll();\n\n return $this->render('faqti/index.html.twig', array(\n 'faqtis' => $faqtis,\n ));\n }",
"public function getFaq()\n {\n return View::make('policy/faq')\n ->with('title', t('FAQ'));\n }",
"public function listAction ()\n {\n // search options to list questions\n $form = new Admin_Form_QuestionForm();\n $validValues = $form->getValidValues($this->getAllParams());\n $form->populate($validValues);\n $this->view->questions = $this->_questionMapper->getAllQuestions(\n $this->getParam('page'), $validValues);\n $this->view->form = $form;\n }",
"public function deleteAllAction()\n {\n $em = $this->getDoctrine()->getManager();\n $faqRepository = $em->getRepository('AppBundle:Faq');\n\n $faqs = $faqRepository->findAll();\n if (count($faqs) > 0) {\n foreach ($faqs as $faq) {\n $em->remove($faq);\n }\n $em->flush();\n }\n\n return $this->handleView($this->view(null, Codes::HTTP_NO_CONTENT));\n }",
"public function index() {\n $topics = Topic::all();\n return view('faqs.home', ['topics' => $topics]);\n }",
"public function load_all_faq_articles() {\n \n // Load Faq Articles\n (new MidrubBaseAdminCollectionSupportHelpers\\Faq)->load_all_faq_articles();\n \n }",
"public function getFaqContent(){\n $this->sql = \"SELECT fs.name, fi.question, fi.answer FROM `\".$this->table.\"` as fs LEFT JOIN `faq_items` as fi ON fs.id = fi.sid ORDER BY fs.id DESC;\";\n return $this->query();\n }",
"public function index(){\n\t\t// Set the Page Title ('pageName', 'pageSection', 'areaName')\n\t\t$this->_view->pageTitle = array('FaqS');\n\t\t// Set Page Description\n\t\t$this->_view->pageDescription = 'Check Mate FaQs';\n\t\t// Set Page Section\n\t\t$this->_view->pageSection = 'Pages';\n\t\t// Set Page Sub Section\n\t\t$this->_view->pageSubSection = 'Faqs';\n\n $this->_view->data = $this->_model->getAlldata();\n \n\t\t// Render the view ($renderBody, $layout, $area)\n\t\t$this->_view->render('faqs/index', 'layout');\n\t}",
"public function actionIndex()\n {\n $searchModel = new QuizSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove a keyword from the session array (used by AJAX POST call) | public function delKeyword() //BAD BAD FUNCTION
{
/* if (isset($_POST['keyword']) )
{
$arr = Session::get('keywords');
$key = array_search( $_POST['keyword'], $arr);
echo $arr;
//if ( $key !== false )
//{
unset($arr[$key]);
//$arr = array_values($arr);
Session::put('keywords', $arr);
//if (empty($arr))
// Session::forget('keywords');
//}
return "ok";
}
return "not ok";
*/
} | [
"public function removeSessionData(): void;",
"public function removeSessionData(): void\n {\n $this->response->getSession()->remove(config('form.session_key'));\n }",
"public function removeSessionData() {}",
"function remove_movie($movieProductID)\n{\n if(array_search($movieProductID, $_SESSION['movie']) !== false) {\n unset($_SESSION['movie'][array_search($movieProductID, $_SESSION['movie'])]);\n $_SESSION['movie'] = array_values($_SESSION['movie']);\n }\n}",
"function supprimewishlist(){\n unset($_SESSION['wishlist']);\n}",
"function clearSearch(){\n\n\tforeach((array)$_SESSION as $a => $b){\n\t\t\n\t\tif(strpos($a, 'search-keyword') || strpos($a, '-filter-')){\n\t\t\tunset($_SESSION[$a]);\n\t\t}\n\t}\n\t\n\tforeach((array)$_SESSION as $sn => $sv){\n\t\t\n\t\tif(strpos($sn, '-search-') || strpos($sn, '-filter-')){\n\t\t\t$_SESSION[$sn] = '';\n\t\t}\n\t}\n}",
"public function removeProductSession($keycode)\r\n {\r\n // get length of session array\r\n $arrayLength = count($_SESSION['ProductsInClaim']);\r\n \r\n $removedBoolean = false;\r\n \r\n // loop throught products in claim array stored in session variable\r\n for ($i = 0; $i < $arrayLength; $i++)\r\n {\r\n // if keycode in session matchs keycode brought in remove it from the array\r\n if ($_SESSION['ProductsInClaim'][$i]['keycode'] == $keycode)\r\n {\r\n // remove the cost price of the product from claim price - before splicing array\r\n $_SESSION['ClaimAmount'] -= (float)($_SESSION['ProductsInClaim'][$i]['costprice'] *\r\n $_SESSION['ProductsInClaim'][$i]['quantity'] );\r\n \r\n //removes array element and resizes array - 1 is needed to remove one element only\r\n array_splice($_SESSION['ProductsInClaim'],$i,1);\r\n \r\n $array = array(\"response\" => \"product-removed\", \"claim-amount\" => $_SESSION['ClaimAmount']);\r\n echo json_encode($array);\r\n \r\n $removedBoolean = true;\r\n \r\n // stop the loop once found, as the array is resized which can cause index out of\r\n // range error\r\n break;\r\n }\r\n } \r\n if ($removedBoolean == false)\r\n {\r\n $array = array(\"response\" => \"product-not-removed\");\r\n echo json_encode($array);\r\n }\r\n }",
"public static function remove($name){\n \tunset($_SESSION[$name]);\n }",
"function deleteSessionValue($name);",
"function del_ses($name){\n\n\tif (is_array($name)) {\n\t\tforeach ($name as $key => $value) {\n\t\t\t$_SESSION[$value]=null;\n\t\t\tunset($_SESSION[$value]);\n\t\t}\n\t}\n\telse{\n\t\t$_SESSION[$name]=null;\n\t\tunset($_SESSION[$name]);\n\t}\n\t\n}",
"function removeAttribute ( $name ) {\n global $HTTP_SESSION_VARS;\n unset($_SESSION[$name]);\n\t\tunset($HTTP_SESSION_VARS[$name]);\n }",
"function remove_last_from_session(){\n\tif(isset($_SESSION['actions'])){\n\t\tarray_pop($_SESSION['actions']);\n\t}\n}",
"public function flashdataSweep()\n {\n $session = $_SESSION;\n foreach ($session as $key => $value) {\n $value = null;\n if (strpos($key, ':old:')) {\n $this->session->remove($key);\n }\n }\n }",
"public function removeSessionTokenFromRegistry() {}",
"public function deleteSelectionsFromSessionAnyPosition() {\n\n\t\t$sessionData = KSession::$data;\n\t\tforeach ($sessionData as $key=>$value) {\n\t\t\tif (strpos($key, 'selections_') === 0) {\n\t\t\t\tKSession::delete($key);\n\t\t\t}\n\t\t}\n\n\t}",
"public static final function unsetPOST (S $nameOfKey = NULL) {\r\n \tif ($nameOfKey != NULL) {\r\n\t \tif (isset ($_SESSION['POST'][$nameOfKey])) {\r\n\t \t\tunset ($_SESSION['POST'][$nameOfKey]);\r\n\t \t}\r\n \t} else {\r\n \t\t// Unset ALL _SESSION['POST'];\r\n \t\tunset ($_SESSION['POST']);\r\n \t}\r\n }",
"public function unsetSessionValue($key);",
"function removekeyword() {\r\n $keyword_id = $this->uri->segment(3,-1);\r\n\r\n\r\n //load keyword\r\n $keyword = $this->keyword_db->getByID($keyword_id);\r\n if ($keyword == null)\r\n {\r\n appendErrorMessage(__(\"Removing keyword from bookmarklist\").\": \".__(\"non-existing id passed\").\".<br/>\");\r\n redirect('');\r\n }\r\n \r\n $this->bookmarklist_db->removeKeyword($keyword->keyword_id);\r\n redirect('keywords/single/'.$keyword->keyword_id); \r\n }",
"function fnClearSessionForDoclistSearch(){\n $_SESSION['btn_search_doclist'] = \"\";\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
One link has one shortlink, and one shortlink belongs to one link. (onetoone relationship). shortlink() is linked to link() in Shortlink.php. | public function shortlink()
{
return $this->hasOne('App\Models\Shortlink');
} | [
"public function shortlink_meta() {\n\n\t\t// no shortlinks exist on non-singular items, so bail\n\t\tif ( ! is_singular() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// check options to see if it's enabled\n\t\tif ( false === RAFCOCreator_Helper::get_rafco_option( 'sht' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// call the global post object\n\t\tglobal $post;\n\n\t\t// bail without a post object\n\t\tif ( empty( $post ) || ! is_object( $post ) || empty( $post->ID ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// check existing postmeta for RAFCO link\n\t\tif ( false === $link = RAFCOCreator_Helper::get_rafco_meta( $post->ID ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// got a RAFCO? well then add it\n\t\techo '<link href=\"' . esc_url( $link ) . '\" rel=\"shortlink\">' . \"\\n\";\n\t}",
"public function getShortlink()\n {\n return $this->shortlink;\n }",
"public function shortlinks()\n {\n return $this->hasMany(Shortlink::class);\n }",
"public function shortlinks()\n {\n return $this->morphMany(Shortlink::class, 'target');\n }",
"protected function addShortlinkToRepository($shortLink) {\n\n\t\t$selectedDomain = $this->getSelectedDomain();\n\t\t$shortLink->setDomainrecord($selectedDomain);\n\n\t\t// destintation is empty\n\t\tif ($shortLink->getDestination() == '') {\n\t\t\t$this->flashMessageContainer->add(\n\t\t\t\t'The short URL \"' . $shortLink->getFullShortUrl() . '\" was not created, because the destination is not set.',\n\t\t\t\t'Destination empty',\n\t\t\t\t\\TYPO3\\CMS\\Core\\Messaging\\FlashMessage::ERROR\n\t\t\t);\n\n\t\t// short path already exists\n\t\t} elseif ($this->linkRepository->shortPathExistsInDomain($shortLink->getShortpath(), $selectedDomain)) {\n\t\t\t$this->flashMessageContainer->add(\n\t\t\t\t'The short URL \"' . $shortLink->getFullShortUrl() . '\" was not created, because a short URL with the same short path already exists.',\n\t\t\t\t'Short URL already exists',\n\t\t\t\t\\TYPO3\\CMS\\Core\\Messaging\\FlashMessage::ERROR\n\t\t\t);\n\n\t\t} else {\n\t\t\t// set the final properties\n\t\t\t$shortLink->setPid($selectedDomain->getPid());\n\t\t\t$shortLink->setCreatedon(new \\DateTime());\n\n\t\t\t$this->linkRepository->add($shortLink);\n\n\t\t\t// success\n\t\t\t$this->flashMessageContainer->add(\n\t\t\t\t'The short URL \"' . $shortLink->getFullShortUrl() . '\" was added and can be used now.',\n\t\t\t\t'Short URL added',\n\t\t\t\t\\TYPO3\\CMS\\Core\\Messaging\\FlashMessage::OK\n\t\t\t);\n\t\t}\n\t}",
"function nb_cpt_shortlinks( $shortlink, $id, $context, $allow_slugs=true ) {\n\t\t/**\n\t\t * If query is the context, we probably shouldn't do anything\n\t\t */\n\t\tif( 'query' == $context )\n\t\t\treturn $shortlink;\n\n\t\t$post = get_post( $id );\n\t\t$post_id = $post->ID;\n\n\t\t/**\n\t\t * If this is a standard post, return the shortlink that was already built\n\t\t */\n\t\tif( 'post' == $post->post_type )\n\t\t\treturn $shortlink;\n\n\t\t/**\n\t\t * Retrieve the array of publicly_queryable, non-built-in post types\n\t\t */\n\t\t$post_types = get_post_types( array( '_builtin' => false, 'publicly_queryable' => true ) );\n\t\tif( in_array( $post->post_type, $post_types ) || 'page' == $post->post_type )\n\t\t\t$shortlink = home_url('?p=' . $post->ID);\n\n\t\treturn $shortlink;\n\t}",
"function wp_ozh_yourls_wp_get_shortlink( $false, $id, $context = '' ) {\r\n\t\r\n\tglobal $wp_query;\r\n\t$post_id = 0;\r\n\tif ( 'query' == $context && is_single() ) {\r\n\t\t$post_id = $wp_query->get_queried_object_id();\r\n\t} elseif ( 'post' == $context ) {\r\n\t\t$post = get_post($id);\r\n\t\t$post_id = $post->ID;\r\n\t}\r\n\t\r\n\t// No ID and still post? Fail.\r\n\tif( !$post_id && $context == 'post' )\r\n\t\treturn null;\r\n\t\r\n\t// TODO: Generate shortlinks for things other than posts\r\n\tif( !$post_id && $context == 'query' ) \r\n\t\treturn null;\r\n\t\r\n\t// Check if user wants a short link generated for this type of post\r\n\t$type = get_post_type( $post_id );\r\n\tif( !wp_ozh_yourls_generate_on( $type ) )\r\n\t\treturn null;\r\n\t\t\r\n\t// Check if this post is published\r\n\tif( 'publish' != get_post_status( $post_id ) )\r\n\t\treturn null;\r\n\r\n\t// Still here? Must mean we really need a short URL then!\r\n\treturn wp_ozh_yourls_geturl( $post_id );\r\n}",
"function getShortlink( $shortlink, $id, $context, $allow_slugs ) {\n \t// Ref: wp_get_shortlink() : wp-includes/link-template.php\n if ( empty($shortlink) || ($context != 'post' && $context != 'query') )\n return $shortlink;\n \n if ( $context == 'query' && !is_single() )\n return $shortlink;\n \n if ( !empty($id) ) {\n $post = get_post($id);\n }\n else {\n global $wp_query;\n $post = $wp_query->get_queried_object();\n }\n \n if ( !isset($post->post_type) || $post->post_type != 'post' )\n return $shortlink;\n \n $bitly_link = get_post_meta($post->ID, 'bitly_link');\n \n if ( !empty($bitly_link) )\n return $bitly_link[0];\n else\n return $shortlink;\n }",
"public function filter_pre_get_shortlink( $short_link, $id ) {\n\n\t\tif ( false === $this->_check_valid_post( $id ) ) {\n\t\t\treturn $short_link;\n\t\t}\n\n\t\t$current_post = get_post( $id );\n\n\t\t// If we've already created a shortlink return it or just return the default.\n\t\t$link = get_post_meta( $current_post->ID, '_better_yourls_short_link', true );\n\n\t\tif ( '' === $link ) {\n\t\t\treturn $short_link;\n\t\t}\n\n\t\treturn $link;\n\n\t}",
"function my_theme_cpt_shortlinks( $shortlink, $id, $context, $allow_slugs=true ) {\n\t\t/**\n\t\t * If query is the context, we probably shouldn't do anything\n\t\t */\n\t\tif( 'query' == $context )\n\t\t\treturn $shortlink;\n\n\t\t$post = get_post( $id );\n\t\t$post_id = $post->ID;\n\n\t\t/**\n\t\t * If this is a standard post, return the shortlink that was already built\n\t\t */\n\t\tif( 'post' == $post->post_type )\n\t\t\treturn $shortlink;\n\n\t\t/**\n\t\t * Retrieve the array of publicly_queryable, non-built-in post types\n\t\t */\n\t\t$post_types = get_post_types( array( '_builtin' => false, 'publicly_queryable' => true ) );\n\t\tif( in_array( $post->post_type, $post_types ) || 'page' == $post->post_type )\n\t\t\t$shortlink = home_url('?p=' . $post->ID);\n\n\t\treturn $shortlink;\n\t}",
"function GetLink($short_url)\n\t{\n\t\t$id = hexdec($short_url);\n\t\t$this->db->where('id', $id);\n\t\t\n\t\t$query = $this->db->get('links');\n\n\t\tif($query->num_rows > 0)\n\t\t{\n\t\t\treturn $query->row(0);\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"function hum_get_shortlink($link, $id, $context, $allow_slugs) {\n $post_id = 0;\n if ( 'query' == $context ) {\n if ( is_front_page() ) {\n $link = trailingslashit( hum_shortlink_base() );\n } elseif ( is_singular() ) {\n $post_id = get_queried_object_id();\n }\n } elseif ( 'post' == $context ) {\n $post = get_post($id);\n $post_id = $post->ID;\n }\n\n if ( !empty($post_id) ) {\n $type = hum_type_prefix($post_id);\n $sxg_id = num_to_sxg($post_id);\n $link = trailingslashit( hum_shortlink_base() ) . $type . '/' . $sxg_id;\n }\n\n return $link;\n}",
"function wpbitly_get_shortlink( $shortlink, $id, $context )\r\n{\r\n\r\n\t// Look for the post ID passed by wp_get_shortlink() first\r\n\tif ( empty( $id ) )\r\n\t{\r\n\t\tglobal $post;\r\n\t\t$id = ( isset( $post ) ? $post->ID : null );\r\n\t}\r\n\r\n\t// Fall back in case we still don't have a post ID\r\n\tif ( empty( $id ) )\r\n\t{\r\n\t\t// Maybe we got passed a shortlink already? Better to return something than nothing.\r\n\t\t// Some wacky test cases might help us polish this up.\r\n\t\tif ( ! empty( $shortlink ) )\r\n\t\t\treturn $shortlink;\r\n\r\n\t\treturn false;\r\n\r\n\t}\r\n\r\n\t$shortlink = get_post_meta( $id, '_wpbitly', true );\r\n\r\n\tif ( $shortlink == false )\r\n\t{\r\n\t\twpbitly_generate_shortlink( $id );\r\n\t\t$shortlink = get_post_meta( $id, '_wpbitly', true );\r\n\t}\r\n\r\n\treturn $shortlink;\r\n\r\n}",
"protected function set_shorten_links() {\n\n\t\tglobal $socialflow;\n\t\t$shorten_links = absint( $socialflow->options->get( 'shorten_links' ) );\n\t\t$this->set( 'shorten_links', $shorten_links );\n\t}",
"function hybrid_entry_shortlink_shortcode( $attr ) {\n\n\t$attr = shortcode_atts(\n\t\tarray(\n\t\t\t'text' => __( 'Shortlink', 'hybrid-core' ),\n\t\t\t'title' => the_title_attribute( array( 'echo' => false ) ),\n\t\t\t'before' => '',\n\t\t\t'after' => ''\n\t\t),\n\t\t$attr,\n\t\t'entry-shortlink'\n\t);\n\n\t$shortlink = esc_url( wp_get_shortlink( get_the_ID() ) );\n\n\treturn \"{$attr['before']}<a class='shortlink' href='{$shortlink}' title='\" . esc_attr( $attr['title'] ) . \"' rel='shortlink'>{$attr['text']}</a>{$attr['after']}\";\n}",
"function mashsb_get_shorturl_singular( $url ) {\n global $mashsb_options, $post, $mashsb_custom_url;\n \n \n // no shorturl\n if( isset( $mashsb_options['mashsu_methods'] ) && $mashsb_options['mashsu_methods'] === 'disabled' ) {\n return $url;\n }\n \n // Use native WP Shortlinks | only when $mashsb_custom_url is empty. WP Shortlinks are not possible for non wordpress urls like www.google.com\n if( isset( $mashsb_options['mashsu_methods'] ) && $mashsb_options['mashsu_methods'] === 'wpshortlinks' && empty($mashsb_custom_url) ) {\n return wp_get_shortlink();\n }\n\n \n $shorturl = \"\";\n\n // Force cache rebuild\n if( mashsb_force_cache_refresh() ) {\n \n MASHSB()->logger->info( 'mashsb_get_shorturl_singular() -> refresh cache' );\n\n // bitly shortlink\n if( isset( $mashsb_options['mashsu_methods'] ) && $mashsb_options['mashsu_methods'] === 'bitly' ) {\n $shorturl = mashsb_get_bitly_link( $url );\n MASHSB()->logger->info('create shorturl singular: ' . $url . ' ' . $shorturl);\n }\n\n // Google shortlink\n if( isset( $mashsb_options['mashsu_methods'] ) && $mashsb_options['mashsu_methods'] === 'google' ) {\n $shorturl = mashsb_get_google_link( $url );\n }\n update_post_meta( $post->ID, 'mashsb_shorturl', $shorturl );\n } else {\n $shorturl = get_post_meta( $post->ID, 'mashsb_shorturl', true );\n }\n\n if( !empty( $shorturl ) && empty($mashsb_custom_url)) {\n return $shorturl;\n } else {\n return $url;\n }\n}",
"public function get_shortlink()\r\n\t{\r\n\t\t$domain = trailingslashit( $this->_domain );\r\n\t\tglobal $post;\r\n\t\tif ( $post ) {\r\n\t\t\t$domain .= '?p=' . $post->ID;\r\n\t\t}\r\n\t\treturn $domain;\r\n\t}",
"public function userDoesUrlShortening()\n {\n $user = $this->admin();\n $longUrl = 'https://laravel.com';\n\n $this->loginAsAdmin();\n $this->post(route('createshortlink'), ['long_url' => $longUrl]);\n $url = Url::whereLongUrl($longUrl)->first();\n\n $this->assertSame($user->id, $url->user_id);\n }",
"public function test_display_shortlink_if_link_exists()\n {\n $formData = [\n 'link' => 'http://testdomain.com',\n ];\n\n $this->post(route('shortlink.create'), $formData)->assertStatus(200);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for getAchBankLinksForReserveAccountUsingGet Get bank links for a reserve account. | public function testGetAchBankLinksForReserveAccountUsingGet()
{
} | [
"public function getAchBankLinksForReserveAccountUsingGet()\n {\n list($response) = $this->getAchBankLinksForReserveAccountUsingGetWithHttpInfo();\n return $response;\n }",
"public function testGetWireClientBankLinksUsingGet()\n {\n }",
"public function getAchBankLinksForReserveAccountUsingGetAsync()\n {\n return $this->getAchBankLinksForReserveAccountUsingGetAsyncWithHttpInfo()\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getAchBankLinksForReserveAccountUsingGetWithHttpInfo()\n {\n $returnType = '\\com\\hydrogen\\integration\\Model\\AchBankLinkResponseVO[]';\n $request = $this->getAchBankLinksForReserveAccountUsingGetRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\com\\hydrogen\\integration\\Model\\AchBankLinkResponseVO[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function testGetAllBankAccountsUsingGET()\n {\n }",
"public function testAccountListWithBalanceGet()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testGetAccountDirectDebitsUsingGET()\n {\n }",
"public function testGetRTPClientBankLinksUsingGet()\n {\n }",
"public function getAchBankLinksForReserveAccountUsingGetAsyncWithHttpInfo()\n {\n $returnType = '\\com\\hydrogen\\integration\\Model\\AchBankLinkResponseVO[]';\n $request = $this->getAchBankLinksForReserveAccountUsingGetRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function testReturnAvailableAccountBalances(): void\n {\n $this->prepareApi('returnAvailableAccountBalances');\n $this->checkResponse(\n 'returnAvailableAccountBalances',\n $this->tradingApi->returnAvailableAccountBalances(),\n AvailableAccountBalances::class\n );\n }",
"public function testGetBrandsUsingGET()\n {\n }",
"public function testGetWithLinks() {\n $selector = new ServicedAccountSelector();\n $selector->enablePaging = FALSE;\n\n $graph = $this->service->get($selector);\n\n $this->assertGreaterThanOrEqual(1, sizeof($graph->accounts));\n $this->assertGreaterThanOrEqual(1, sizeof($graph->links));\n }",
"public function meGetBankAccounts();",
"public function testAccountTransactionsGet()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testGetAccountScheduledPaymentsUsingGET()\n {\n }",
"public function testGetAggregationAccountBalanceUsingGet()\n {\n }",
"function clickbank_fetch_links($keyword, $camp) {\r\n\t\t\t\techo \"<br>so I should now get some links from clickbank ...\";\r\n\t\t\t\t\r\n\t\t\t\t// ini\r\n\t\t\t\t$camp_opt = unserialize ( $camp->camp_options );\r\n\t\t\t\t$wp_wp_automatic_cbu = get_option('wp_wp_automatic_cbu','');\r\n\t\t\t\t\r\n\t\t\t\t// using clickbank\r\n\t\t\t\t$clickkey = urlencode ( $keyword );\r\n\t\t\t\t\r\n\t\t\t\t// getting start\r\n\t\t\t\t$query = \"select clickbank_start from {$this->wp_prefix}automatic_keywords where keyword_name='$keyword' and keyword_camp='{$camp->camp_id}' \";\r\n\t\t\t\t$ret = $this->db->get_results ( $query );\r\n\t\t\t\t\r\n\t\t\t\t$row = $ret [0];\r\n\t\t\t\t$start = $row->clickbank_start;\r\n\t\t\t\t// check if the start = -1 this means the keyword is exhausted\r\n\t\t\t\tif ($start == '-1') {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//check if it is reactivated or still deactivated\r\n\t\t\t\t\tif($this->is_deactivated($camp->camp_id, $keyword)){\r\n\t\t\t\t\t\t$start =1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t//still deactivated\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\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$sortby = $camp->camp_search_order;\r\n\t\t\t\t$camp_cb_category = $camp->camp_cb_category;\r\n\t\t\t\t$cbname = trim(get_option ( 'wp_wp_automatic_cbu', '' ));\r\n\t\t\t\t$cbpass =trim( urlencode( get_option ( 'wp_wp_automatic_cbp', '' ) ));\r\n\t\t\t\t\r\n\t\t\t\tif (trim ( $cbname ) == '' || trim ( $cbpass ) == '') {\r\n\t\t\t\t\techo '<br>Clickbank username and password required visit settings and add them ';\r\n\t\t\t\t\texit ();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$clickbank = \"https://$cbname.accounts.clickbank.com/account/mkplSearchResult.htm?includeKeywords=$clickkey&resultsPerPage=50&firstResult=$start&sortField=$sortby&$camp_cb_category\";\r\n\t\t\t\techo \"<br>Clickbank Remote Link:$clickbank....\";\r\n\t\t\t\t\r\n\t\t\t\t// login to clickbank\r\n\t\t\t\t$url = \"https://$cbname.accounts.clickbank.com/account/login\";\r\n\t\t\t\t$postst = \"nick=$cbname&pass=$cbpass&login=Log+In&rememberMe=true&j_username=$cbname&j_password=$cbpass\";\r\n\t\t\t\t// Post\r\n\t\t\t\t\r\n\t\t\t\t$x = 'error';\r\n\t\t\t\twhile ( trim ( $x ) != '' ) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tcurl_setopt ( $this->ch, CURLOPT_POST, 1 );\r\n\t\t\t\t\t\r\n\t\t\t\t\t//curl ini\r\n\t\t\t\t\tcurl_setopt($this->ch, CURLOPT_HEADER,1);\r\n\t\t\t\t\t\r\n\t\t\t\t\tcurl_setopt ( $this->ch, CURLOPT_URL, trim ( $url ) );\r\n\t\t\t\t\tcurl_setopt ( $this->ch, CURLOPT_POSTFIELDS, $postst );\r\n\t\t\t\t\t$contexec = curl_exec ( $this->ch );\r\n\t\t\t\t\techo $x = curl_error ( $this->ch );\r\n\t\t\t\t\t\r\n\t\t\t\t\tcurl_setopt($this->ch, CURLOPT_HEADER,0);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\techo $contexec;\r\n\t\t \t\r\n\t\t\t\tif (stristr ( $contexec, 'mainMenu.htm' )) {\r\n\t\t\t\t\techo '<br>Clickbank Login success';\r\n\t\t\t\t} else {\r\n\t\t\t\t\techo '<br>Clickbank Login fail';\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tpreg_match_all('|Set-Cookie: (.*);|Ui', $contexec, $cresults);\r\n\t\t\t\t$cookies = implode(';', $cresults[1]);\r\n\t\t\t\tcurl_setopt($this->ch, CURLOPT_COOKIE, $cookies);\r\n\t\t\t\t\r\n\t\t\t\tcurl_setopt($this->ch,CURLOPT_HTTPHEADER, array(\"Cookie:$cookies\"));\r\n\t\t\t\t \r\n\t\t\t\t//echo '<br>Cookies:'.$cookies;\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t// Get\r\n\t\t\t\t$x = 'error';\r\n\t\t\t\t \r\n\t\t\t\twhile ( trim ( $x ) != '' ) {\r\n\t\t\t\t\t$url = $clickbank;\r\n\t\t\t\t\tcurl_setopt ( $this->ch, CURLOPT_HTTPGET, 1 );\r\n\t\t\t\t\tcurl_setopt ( $this->ch, CURLOPT_URL, trim ( $url ) );\r\n\t\t\t\t\t\r\n\t\t\t\t\t$cont = curl_exec ( $this->ch );\r\n\t\t\t\t\techo $x = curl_error ( $this->ch );\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 \r\n\t\t\t\tpreg_match_all ( '/details\">.*?(http:\\/\\/zzzzz\\..*?net).*?>(.*?)<\\/a>/s', $cont, $matches, PREG_PATTERN_ORDER );\r\n\t\t\t\t\r\n\t\t \t\t$links = $matches [1];\r\n\t\t \t\t$titles = $matches [2];\r\n\t\t\t \r\n\t\t\t\t\r\n\t\t\t\techo '<br>links found:' . count ( $links );\r\n\t\t\t\t\r\n\t\t\t\t// descreptions <div class=\"description\">The #1 Ballet Product. Fundamental Dance Skills. Gaining Popularity Very Quickly. We Cloak Your Affiliate Link. Http://www.ballet-bible.com/affiliates.php</div>\r\n\t\t\t\tpreg_match_all ( '{description\">(.*?)</div>}', $cont, $matches, PREG_PATTERN_ORDER );\r\n\t\t\t\t$descs = $matches [1];\r\n\t\t\t\t\r\n\t\t\t\t \r\n\t\t\t\techo '<ol>';\r\n\t\t\t\tfor($i = 0; $i < count ( $links ); $i ++) {\r\n\t\t\t\t\t$title = addslashes ( $titles [$i] );\r\n\t\t\t\t\t\r\n\t\t\t\t\techo '<li>' . $links [$i] . '<br>' . $titles [$i] . '</li>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t// check if exists\r\n\t\t\t\t \r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$link_url = str_replace('zzzzz', $wp_wp_automatic_cbu,$links[$i]) ;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif( $this->is_execluded($camp->camp_id, $link_url) ){\r\n\t\t\t\t\t\t\t\techo '<-- Execluded';\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ( ! $this->is_duplicate($link_url) ) {\r\n\t\t\t\t\t\t\t\t$desc = addslashes ( $descs [$i] );\r\n\t\t\t\t\t\t\t\t$query = \"INSERT INTO {$this->wp_prefix}automatic_clickbank_links ( link_url , link_title , link_keyword , link_status , link_desc )VALUES ( '$links[$i]', '$title', '$keyword', '0' ,'$desc')\";\r\n\t\t\t\t\t\t\t\t$this->db->query ( $query );\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\techo ' <- duplicated <a href=\"'.get_edit_post_link($this->duplicate_id).'\">#'.$this->duplicate_id.'</a>';\r\n\t\t\t\t\t\t\t}\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}\r\n\t\t\t\techo '</ol>';\r\n\t\t\t\t\r\n\t\t\t\tif (count ( $links ) > 0) {\r\n\t\t\t\t\t// increment the start with 50\r\n\t\t\t\t\t$newstart = $start + 50;\r\n\t\t\t\t\t$query = \"update {$this->wp_prefix}automatic_keywords set clickbank_start = '$newstart' where keyword_name='$keyword'\";\r\n\t\t\t\t\t$this->db->query ( $query );\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// there was no links lets deactivate\r\n\t\t\t\t\t$newstart = '-1';\r\n\t\t\t\t\t$query = \"update {$this->wp_prefix}automatic_keywords set clickbank_start = '$newstart' where keyword_name='$keyword'\";\r\n\t\t\t\t\t$this->db->query ( $query );\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->deactivate_key($camp->camp_id, $keyword);\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}",
"public function testGETOnboardingAccounts()\n {\n }",
"public function testApiV2BalancesGet()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Steve skin (in raw png) | public static function getSteveSkin(); | [
"public function getSkin();",
"public static function compressSpecificSkin()\n {\n return Mage::getStoreConfig('udder_deflate/areas/skin_theme_images');\n }",
"public function getSkin()\n {\n return $this->skin;\n }",
"public function getSkin() : Skin{\r\n\t\treturn $this->skin;\r\n\t}",
"public function get3DRender() {\n global $minX, $maxX, $minY, $maxY;\n\n $this->hd_ratio = imagesx($this->playerSkin) / 64; // Set HD ratio to 2 if the skin is 128x64. Check via width, not height because of new skin type.\n // check if new skin type. If both sides are equaly long: new skin type\n if (imagesx($this->playerSkin) == imagesy($this->playerSkin)) {\n $this->isNewSkinType = true;\n }\n\n $this->playerSkin = Image::convertToTrueColor($this->playerSkin); // Convert the image to true color if not a true color image\n $this->makeBackgroundTransparent(); // make background transparent (fix for weird rendering skins)\n // Quick fix for 1.8:\n // Copy the extra layers ontop of the base layers\n if ($this->layers) {\n $this->fixNewSkinTypeLayers();\n }\n\n $this->calculateAngles();\n $this->facesDetermination();\n $this->generatePolygons();\n $this->memberRotation();\n $this->createProjectionPlan();\n $result = $this->displayImage();\n\n \\ob_start();\n \\imagepng($result);\n $contents = \\ob_get_contents();\n \\ob_end_clean();\n return $contents;\n }",
"public function getSkinUrl() {\n return \"http://skinsystem.ely.by/skins/{$this->getUsername()}.png\";\n }",
"public function getSkin(): \\Yana\\Views\\Skins\\IsSkin;",
"protected function getPathToSkinIMG () {\n // Return\n return new Path (Architecture\n ::pathTo ($this->getPathToSkin (),\n SKIN_IMG_DIR));\n }",
"public static function compressSkin()\n {\n return Mage::getStoreConfigFlag('udder_deflate/areas/skin_images');\n }",
"public function getUserSkin()\n {\n $name = $this->getUserSkinName();\n assert(isset($this->skins[$name]));\n return $this->skins[$name];\n }",
"public function getSkin() {\n\t\tif ( empty( $this->skin ) ) {\n\t\t\t$this->setSkin();\n\t\t}\n\t\t\n\t\treturn $this->skin;\n\t}",
"private function skin() {\n\t\tif ( function_exists( 'wpex_active_skin' ) ) {\n\t\t\treturn wpex_active_skin();\n\t\t}\n\t}",
"function get_skin_thumbnail( $skin ) {\r\r\n\t\t$imgpath = $skin['path'] . $skin['dir'] . '/thumbnail.png';\r\r\n\t\t\r\r\n\t\t// Check if thumbnail.png exists or load default thumbnail\r\r\n\t\tif( file_exists( $imgpath ) ) {\r\r\n\t\t\t$imgurl = $skin['url'] . $skin['dir'] . '/thumbnail.png';\r\r\n\t\t}\r\r\n\t\telse {\r\r\n\t\t\t$imgurl = CF7SKINS_URL . 'images/no-preview.png';\r\r\n\t\t}\r\r\n\t\treturn $imgurl;\r\r\n\t}",
"public function skin($username)\n {\n return $this->get('skin/' . $username);\n }",
"function getskin($idskin){\n $query = $this->db->prepare(\"SELECT * FROM skin WHERE id = ?\");\n $query->execute([$idskin]);\n $skin = $query->fetch(PDO::FETCH_OBJ);\n return $skin;\n }",
"public function getSkinColor()\n {\n return $this->skinColor;\n }",
"public function img()\n\t{\n\t\treturn URL::base() . 'm/pets/'.$this->specie->dir.'/'.$this->color->image;\n\t}",
"public function getImageBluePrimary () {}",
"public function getImageGreenPrimary () {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Link all speakers to the session in the `sessions` API endpoint This allows clients to request a session and get all its speakers embedded in the response, avoiding extra HTTP requests | function link_session_to_speakers( $response, $post ) {
$speaker_ids = get_post_meta( $post->ID, '_wcpt_speaker_id', false );
foreach ( $speaker_ids as $speaker_id ) {
$response->add_link(
'speakers',
get_rest_url( null, "/wp/v2/speakers/$speaker_id" ),
array( 'embeddable' => true )
);
}
return $response;
} | [
"function wcb_get_session_speakers() {\n\t$sessions = wcb_get('sessions');\n\treturn esc_html( $sessions->meta_manager->get( get_the_ID(), 'speakers' ) );\n}",
"public function load_speakers()\n {\n $speakers = Speaker::all();\n\n return response()->json($speakers, 200);\n }",
"public function getAllSessions();",
"public function getSpeakers()\n {\n $json = (new \\Guzzle\\Http\\Client($this->baseUrl))\n ->get('/speakers')\n ->send()\n ->json();\n\n $json = array_map(function($speaker) {\n $speaker['bio'] = Markdown::defaultTransform($speaker['bio']);\n\n return $speaker;\n }, $json);\n\n return $json;\n }",
"function get_speaker_sessions( array $speaker_ids ) {\n\t$sessions_by_speaker = [];\n\n\t$session_args = [\n\t\t'post_type' => 'wcb_session',\n\t\t'post_status' => 'publish',\n\t\t'posts_per_page' => -1,\n\t\t'meta_key' => '_wcpt_session_time',\n\t\t'orderby' => 'meta_value_num',\n\t];\n\n\t$session_posts = get_posts( $session_args );\n\n\tforeach ( $session_posts as $session ) {\n\t\t$session_speaker_ids = get_post_meta( $session->ID, '_wcpt_speaker_id', false );\n\n\t\tforeach ( $session_speaker_ids as $speaker_id ) {\n\t\t\tif ( in_array( $speaker_id, $speaker_ids ) ) {\n\t\t\t\tif ( ! isset( $sessions_by_speaker[ $speaker_id ] ) ) {\n\t\t\t\t\t$sessions_by_speaker[ $speaker_id ] = [];\n\t\t\t\t}\n\n\t\t\t\t$sessions_by_speaker[ $speaker_id ][] = $session;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $sessions_by_speaker;\n}",
"public function sessions()\n {\n return $this->morphedByMany('App\\Session', 'deckable');\n }",
"public function listSpeakers();",
"function getSessions(): array\n {\n return $this->sessions;\n }",
"public function getAll()\n {\n return view('/backoffice/sessions_read')->with(['sessions' => Session::with(['question', 'users', 'answers', 'tag'])->paginate(Config::get('constants.backoffice.NUMBER_OF_DISPLAYED_SESSIONS_PER_PAGE'))]);\n }",
"public function sessions()\n {\n $params = request()->validate([\n 'training_id' => 'required|integer',\n 'year' => 'required|integer',\n ]);\n\n $training = Training::findOrFail($params['training_id']);\n $this->authorize('show', $training);\n\n $sessions = TrainingSession::findAllForTrainingYear($params['training_id'], $params['year']);\n\n\n $info = $sessions->map(\n function ($session) {\n return [\n 'slot' => $session,\n 'trainers' => $session->retrieveTrainers(),\n ];\n }\n );\n\n return response()->json(['sessions' => $info]);\n }",
"public function getRelatedSessions(){\n\n \t$list = new ArrayList();\n \tif($this->RelatedSessions()){\n \t\tforeach($this->RelatedSessions() as $related){\n \t\t\t$list->push($related);\n \t\t}\n \t} \n\n \tif($list->Count() < 3){\n \t\tif($this->Speakers()->Count() > 0){\n \t\t\t$speakers = $this->Speakers();\n \t\t\t$speakerSessions = new ArrayList();\n\t\t\t\tforeach($speakers as $speaker){\n\t\t\t\t\tforeach($speaker->MeetingSessions() as $session){\n\t\t\t\t\t\tif($session->ID != $this->ID){\n\t\t\t\t\t\t\t$speakerSessions->push($session);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tforeach($speakerSessions as $speakerSession){\n\t\t\t\t\tif($speakerSession->TopicID == $this->TopicID){\n\t\t\t\t\t\t$list->push($speakerSession);\n\t\t\t\t\t}\n\t\t\t\t}\n \t\t} \n \t}\n\n \tif($list->Count() < 3){\n \t\tforeach($this->Topic()->MeetingSessions() as $session){\n \t\t\tif($session->ID != $this->ID){\n \t\t\t\t$list->push($session);\n \t\t\t}\n \t\t}\n \t}\n \t\n \t$list->removeDuplicates();\n\n \treturn $list->limit(3);\n }",
"public function getAllSessions() {\n $sql = 'SELECT * FROM Sessions\n INNER JOIN Places ON Places.placeID = Sessions.placeID\n WHERE sectionID = :id';\n $args = array(':id' => $this->id);\n $rows = Database::executeGetAllRows($sql, $args);\n return array_map(function ($row) { return new SectionSession($row); }, $rows);\n }",
"public function relatedSpeakers()\n\t{\n\t\t// Get the talks from this speaker, find the other speakers of these talks\n\t\t$talks = array_pluck($this->talks->all(), 'id');\n\t\t$speakers = DB::table('speaker_talk')->whereIn('talk_id', $talks)->lists('speaker_id');\n\t\t$speakers = array_unique($speakers);\n\n\t\t// Get all the speakers\n\t\tunset($speakers[array_search($this->id, $speakers)]);\n\t\t$speakers = static::whereIn('id', array_unique($speakers))->get();\n\n\t\treturn $speakers;\n\t}",
"public static function showAllSpeakers()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$dao = new DAO('pfe');\n\t\t\t\t$list = array();\n\t\t\t\t$list = $dao->getlist('Speaker');\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\techo 'Message: ' .$e->getMessage();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\t$dao = null;\n\t\t\t\treturn $list;\n\t\t\t}\n\t\t}",
"public function getSessions()\n {\n return $this->sessions;\n }",
"public function getTranscodeSessions()\n {\n return $this->call('/transcode/sessions');\n }",
"public static function all()\n {\n return $_SESSION;\n }",
"private function getAllSpeakers()\n\t{\n\t\t$db = $this->getDbo();\n\t\t$query = $db->getQuery(true);\n\t\t$query->select('*')\n\t\t\t->from('#__conferenceplus_speakers')\n\t\t\t->where($db->qn('enabled') . ' = 1');\n\n\t\t$db->setQuery($query);\n\n\t\t$result = $db->loadAssocList('conferenceplus_speaker_id');\n\n\t\treturn $result;\n\t}",
"public function getSessions()\r\n {\r\n return $this->config->getSessions();\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Accesses the array of site pages through which the user has passed to determine which page was the last unique page visited by the user. Maintains array as a stack, recording the history as expected, with the top of the stack as the page from which the user arrived. Returns NULL if there is no previous unique page in the stack. | protected function get_referer() {
$history = array();
if ($this->Session->check('Auth.Referer.history')) {
$history = unserialize($this->Session->read('Auth.Referer.history'));
}
while (0 != count($history)) {
$pageBack = array_pop($history);
if ($this->name == $pageBack['controller']
&& $this->action == $pageBack['action']
&& $this->passedArgs == $pageBack[0]) {
continue;
} else {
return $pageBack;
}
}
return NULL;
} | [
"function update_history(){\n $last_page = get_session('this_pagewrfi');\n //$last_page_title = get_session('this_page_title');\n global $base_url;\n global $pageTitle;\n $this_page = $base_url;\n $this_page_title = $pageTitle;\n \n $user_went_back = get_post('back');\n $history_stack = get_session('historywrfi');\n //$t= get_session('t');\n //print_message(is_array($t));\n\n if (!$history_stack && $last_page ){\n \n $history_stack = array($last_page);\n //echo(\"last_page\");\n //$t = array($last_page_title);\n //set_session('t', $t);\n set_session('historywrf1', $history_stack);\n //set_session('title_history', $t);\n \n }\n //save last page if diff. from this page and user did not press back\n elseif ($last_page && $last_page != $this_page && !$user_went_back)\n {\n array_push($history_stack, $last_page);\n //echo(\"last_page\");\n //array_push($t, $last_page_title);\n }\n elseif($user_went_back){\n array_pop($history_stack);\n array_pop($t);\n }\n \n set_session('this_pagewrfi', $this_page);\n //set_session('this_page_title', $this_page_title);\n //print_message(get_session('this_page').\"title\");\n //print_message(get_session('this_page_title').\"page\");\n //print_message($this_page.\"title\");\n //print_message($this_page_title.\"page\");\n \n }",
"function GetBackPage() {\n\t\t$session = &GetSession();\n\n\t\t$page = strtolower($_GET['Page']);\n\t\t$base_backpage_link = 'index.php?Page=' . $page . '&';\n\n\t\t$backpage_list = $session->Get('BackPageList');\n\t\t$base_backpage_list = $session->Get('BaseBackPageList');\n\n\t\t// get the last url we remembered.\n\t\t$backpage = array_pop($backpage_list);\n\t\t$base_backpage = array_pop($base_backpage_list);\n\n\t\t// if the last url we remembered isn't the same as the current one..\n\t\t// add the backpage back to the end of the list.\n\t\tif ($base_backpage != $base_backpage_link) {\n\t\t\tarray_push($backpage_list, $backpage);\n\t\t\tarray_push($base_backpage_list, $base_backpage);\n\t\t}\n\n\t\t// if the current url is the same as the one we just fetched, get the next one back (this solves the problem when you go to 'ViewAll', then 'Landing Pages', then back to view all - it will correctly get the first url in the list.\n\t\tif ($base_backpage == $base_backpage_link) {\n\t\t\t$backpage = array_pop($backpage_list);\n\t\t\t$base_backpage = array_pop($base_backpage_list);\n\n\t\t\t// since we took the last url again, we have to put it back on the stack for the next page view (eg changing displaypage etc).\n\t\t\tarray_push($backpage_list, $backpage);\n\t\t\tarray_push($base_backpage_list, $base_backpage);\n\t\t}\n\n\t\t$session->Set('BaseBackPageList', $base_backpage_list);\n\t\t$session->Set('BackPageList', $backpage_list);\n\n\t\treturn $backpage;\n\t}",
"public function updateNavigationStack()\n {\n $referrer = parent::getUrlReferrer();\n $navStack = App()->session['LSNAVSTACK'];\n\n if(!is_array($navStack))\n {\n $navStack = array();\n }\n\n array_unshift($navStack,$referrer);\n\n if(count($navStack)>5)\n {\n array_pop($navStack);\n }\n App()->session['LSNAVSTACK'] = $navStack;\n }",
"function ps_last_page_visited() {\n\tglobal $current_blog, $current_user, $post;\n\tget_currentuserinfo();\n\t\n\tif ( ! is_page_template( 'page-onecolumn.php' ) \n\t && ! is_page_template( 'page-narrowcolumn.php' ) \n\t && ! is_front_page() ) {\t\n\t\t$module_page = get_page_by_title( 'Modules' );\n\t\t$pages = get_pages( array( 'child_of' => $module_page->ID, 'parent' => $module_page->ID, 'hierarchical' => '0' ) );\n\t\t\n\t\tforeach ( $pages as $page ) {\n\t\t\t$mpages = get_pages( array( 'child_of' => $page->ID ) );\n\t\t\tif ( is_page( array( \n\t\t\t\t$page->ID,\n\t\t\t\t$mpages[0]->ID, \n\t\t\t\t$mpages[1]->ID, \n\t\t\t\t$mpages[2]->ID, \n\t\t\t\t$mpages[3]->ID, \n\t\t\t\t$mpages[4]->ID, \n\t\t\t\t$mpages[5]->ID, \n\t\t\t\t$mpages[6]->ID, \n\t\t\t\t$mpages[7]->ID,\n\t\t\t\t$mpages[8]->ID,\n\t\t\t\t$mpages[9]->ID,\n\t\t\t\t$mpages[10]->ID \n\t\t\t) ) ) {\n\t\t\t\t$user_id = get_current_user_id();\n\t\t\t\t$key = $current_blog->blog_id . '_module_url_' . $page->ID;\n\t\t\t\t$value = esc_url( $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] );\n\t\t\t\tupdate_user_meta($user_id, $key, $value);\n\t\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}\n}",
"public function get_history()\n {\n $this->token_checker();\n\n $call = \"history\";\n $key = ($call.$this->_hash);\n $result = $this->_get_cache($key);\n\n if(!$result)\n {\n $this->_api_headers();\n $url = $this->_apiUrl .$call;\n $this->_call_api($url, 'GET');\n $result = $this->result;\n\n $this->_set_cache($key,$result);\n }\n return $result;\n }",
"function get_last_url()\n {\n $last = \"\";\n $history = get_session('historywrf1');\n \n if ($history){ $last = end($history);}\n //print_message(\"Last\".$last.\"\\n\");\n return $last;\n }",
"protected function view_history(){\n $this->console('last page 0 >> '.$this->session->last_page());\n $this->console('last page 1 >> '.$this->session->last_page(1));\n $this->console('last page 2 >> '.$this->session->last_page(2));\n $this->console('last page 3 >> '.$this->session->last_page(3));\n $this->console('referrer page >> '.$this->input->server('HTTP_REFERER', TRUE));\n }",
"function SaveHistory()\n\t{\n\t\t// get last two history from cookie\n\t\t$last1 = $this->m_site->GetValue ( 'last1' );\n\t\t$currURL = \"structure={$this->m_currentStructure}\"; //http_build_query($_GET);\n\t\t\n\n\t\t// get structure from first last\n\t\tif ($last1)\n\t\t{\n\t\t\t$patter = '/structure=([\\w]+)/';\n\t\t\t$matches = array ();\n\t\t\tpreg_match_all ( $patter, $last1, $matches );\n\t\t\t\n\t\t\t$lastStruc = null;\n\t\t\tif (isset ( $matches [1] [0] ))\n\t\t\t{\n\t\t\t\t$lastStruc = $matches [1] [0];\n\t\t\t}\n\t\t\t\n\t\t\tif ($lastStruc != $this->m_currentStructure)\n\t\t\t{\n\t\t\t\t// save last 1 to last 2\n\t\t\t\t$this->m_lastStep = $last1;\n\t\t\t\t$this->m_site->SaveValue ( 'last2', $last1 );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->m_lastStep = $this->m_site->GetValue ( 'last2' );\n\t\t\t}\n\t\t}\n\t\t\n\t\t$fromGet = $_GET;\n\t\t\n\t\t// remove structure is exist\n\t\tif (array_key_exists ( 'structure', $fromGet ))\n\t\t{\n\t\t\tunset ( $fromGet ['structure'] );\n\t\t}\n\t\t\n\t\t$str = http_build_query ( $fromGet );\n\t\tif (strlen ( $str ) > 0)\n\t\t{\n\t\t\t$str = '&' . $str;\n\t\t}\n\t\t$this->m_site->SaveValue ( 'last1', $currURL . $str );\n\t}",
"public function getVisitedPages() {\n\n $aSession = $this->session->get('cms_visitedPages');\n\n if( !is_array($aSession) ) {\n $aSession = [];\n }\n\n return $aSession;\n }",
"private function nextUrl() {\r\n // Pop from the lowest level non-empty url stack\r\n // print_r($this->url_stacks);\r\n for ( $cur = $this->num_levels - 1; $cur >= 0; --$cur ) {\r\n if(sizeof($this->url_stacks[$cur]) > 0) {\r\n\t return array_shift($this->url_stacks[$cur]);\r\n }\r\n }\r\n return NULL;\r\n }",
"public function saveLastVisitedPage()\n\t{\n\t\tif(!$this->isCart() && $this->type == 'html' && empty($this->tmpl))\n\t\t{\n\t\t\t$app = JFactory::getApplication();\n\t\t\t$uri = JFactory::getURI();\n\t\t\t$url = $uri->toString();\n\t\t\t$url = (!JUri::isInternal($url)) ? '' : $url;\n\t\t\t$app->setUserState('proopc.lastvisited.url', $url);\n\t\t}\n\t}",
"public function getHistory () {}",
"function getCallHistory()\n\t{\n\t\treturn $this->call_hist;\n\t}",
"public function popPageFromHistory()\n {\n $history = $this->getPageHistory();\n\n $slug = array_pop($history);\n\n $this->storePageHistory($history);\n\n return $slug;\n }",
"public function getHistory();",
"public function getLatestHistory() {\n $history = $this->getHistory();\n if (count($history) === 0) {\n return null;\n }\n return $history[count($history) - 1];\n }",
"function unkvlp_save_last_post_link(){\r\n $current_user = wp_get_current_user()->ID;\r\n \r\n if(!is_user_logged_in()){\r\n return;\r\n }\r\n \r\n if(is_single() && (get_post_type() == 'post' || get_post_type() == 'client-session' || get_post_type() == 'therapy-demnstr')){\r\n session_start();\r\n \r\n $post_id = get_the_ID();\r\n $history = (array) $_SESSION['history'];\r\n $history_max_url = 5;\r\n array_unshift($history, $post_id);\r\n $history = array_unique($history);\r\n \r\n if(count($history) > $history_max_url){\r\n array_pop($history);\r\n }\r\n \r\n $_SESSION['history']=$history;\r\n \r\n update_user_meta($current_user,'last_visited_post', $history);\r\n }\r\n}",
"static function getLastPage()\r\n {\r\n return $_SESSION[\"last_page\"];\r\n }",
"public function getHistory()\n\t{\n\t\treturn $this->history;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the name of the column test table. | public static function getTestColumnTableName() {
return 'test_column_'.__CLASS__.'_'.getmypid();
} | [
"public static function getTestColumnActiveRecordClassName() {\n\t\treturn self::getTestColumnTableName();\n\t}",
"public static function getTestColumnValueTableName() {\n\t\treturn 'test_variation_'.__CLASS__.'_'.getmypid();\n\t}",
"public function column_name();",
"public static function getTestTableName() {\n\t\treturn 'test_'.__CLASS__.'_'.getmypid();\n\t}",
"public function get_table_name()\n {\n }",
"public function get_foreign_table_column_name();",
"public function getTableName ()\n {\n return $this->getDbTable()->info('name');\n }",
"public function getTablename() : string {}",
"public static function getColumnName()\n {\n return static::getConfig()['column_name'];\n }",
"function get_name_colname(){\n\t\treturn $this->name_colname;\n\t}",
"public function getNameColumn()\n {\n return $this->nameColumn;\n }",
"public function get_target_table_name();",
"public function getName(): string\n {\n return $this->tableName;\n }",
"public static function getTestColumnValueActiveRecordClassName() {\n\t\treturn self::getTestColumnValueTableName();\n\t}",
"protected static function table_name(): mixed\n\t{\n\t\treturn self::$query->table_name;\n\t}",
"private function getColumn(): string\n {\n return $this->getUsernameColumnName();\n }",
"public static function get_table_name() {\n return db_table_name('users');\n }",
"protected function getTableName() {\n return Variable::tableName();\n }",
"public function testGetFieldColumnName($base_field, $columns, $column, $expected) {\n $definitions['test'] = $this->setUpDefinition('test', $columns, $base_field);\n $table_mapping = new TestDefaultTableMapping($this->entityType, $definitions);\n $result = $table_mapping->getFieldColumnName($definitions['test'], $column);\n $this->assertEquals($expected, $result);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests whether the instance is dispatched and content is delivered and cached data is available. | public function staticCacheIsEnabledCachedRepresentationIsAvailable() {
$this->extensionManager->expects ( $this->any () )->method ( 'isDevelopmentContextSet' )->will ( $this->returnValue ( TRUE ) );
$testContent = uniqid ( 'testContent' );
$this->contentProcessorChain->expects ( $this->once () )->method ( 'process' )->with ( $testContent )->will ( $this->returnValue ( $testContent ) );
$this->dispatcher->expects ( $this->once () )->method ( 'isStaticCacheEnabled' )->will ( $this->returnValue ( TRUE ) );
$this->dispatcher->expects ( $this->once () )->method ( 'output' )->with ( $testContent );
$this->dispatcher->expects ( $this->once () )->method ( 'halt' );
$this->dispatcher->expects ( $this->once () )->method ( 'sendStaticCacheHttpHeader' );
$this->dispatcher->expects ( $this->once () )->method ( 'initializeFrontEnd' );
$this->cacheManager->expects ( $this->any () )->method ( 'isRequestProcessible' )->will ( $this->returnValue ( TRUE ) );
$this->cacheManager->expects ( $this->once () )->method ( 'logForeignArguments' );
$this->cacheManager->expects ( $this->once () )->method ( 'loadCachedRepresentation' )->will ( $this->returnValue ( $testContent ) );
$this->cacheManager->expects ( $this->once () )->method ( 'getCachedRepresentationWithoutPageInformation' )->will ( $this->returnValue ( $testContent ) );
$this->extensionManager->expects ( $this->any () )->method ( 'areContentProcessorsEnabled' )->will ( $this->returnValue ( TRUE ) );
$this->dispatcher->dispatch ();
$this->assertEquals ( 4, count ( $this->triggeredEvents ) );
$this->assertInstanceOf ( 'Tx_Extracache_System_Event_Events_EventOnStaticCachePreprocess', $this->triggeredEvents [0] );
$this->assertInstanceOf ( 'Tx_Extracache_System_Event_Events_EventOnStaticCacheContext', $this->triggeredEvents [1] );
$this->assertTrue ( $this->triggeredEvents [1]->getStaticCacheContext () );
$this->assertInstanceOf ( 'Tx_Extracache_System_Event_Events_EventOnStaticCacheResponsePostProcess', $this->triggeredEvents [2] );
} | [
"public function staticCacheIsEnabledCachedRepresentationIsAvailableWithoutContentProzessors() {\r\n\t\t$this->extensionManager->expects ( $this->any () )->method ( 'isDevelopmentContextSet' )->will ( $this->returnValue ( TRUE ) );\r\n\t\t$testContent = uniqid ( 'testContent' );\r\n\t\t$this->contentProcessorChain->expects ( $this->never () )->method ( 'process' );\r\n\t\t$this->dispatcher->expects ( $this->once () )->method ( 'isStaticCacheEnabled' )->will ( $this->returnValue ( TRUE ) );\r\n\t\t$this->dispatcher->expects ( $this->once () )->method ( 'output' )->with ( $testContent );\r\n\t\t$this->dispatcher->expects ( $this->once () )->method ( 'halt' );\r\n\t\t$this->dispatcher->expects ( $this->once () )->method ( 'sendStaticCacheHttpHeader' );\r\n\t\t$this->dispatcher->expects ( $this->once () )->method ( 'initializeFrontEnd' );\r\n\t\t$this->cacheManager->expects ( $this->any () )->method ( 'isRequestProcessible' )->will ( $this->returnValue ( TRUE ) );\r\n\t\t$this->cacheManager->expects ( $this->once () )->method ( 'logForeignArguments' );\r\n\t\t$this->cacheManager->expects ( $this->once () )->method ( 'loadCachedRepresentation' )->will ( $this->returnValue ( $testContent ) );\r\n\t\t$this->cacheManager->expects ( $this->once () )->method ( 'getCachedRepresentationWithoutPageInformation' )->will ( $this->returnValue ( $testContent ) );\r\n\t\t$this->extensionManager->expects ( $this->any () )->method ( 'areContentProcessorsEnabled' )->will ( $this->returnValue ( FALSE ) );\r\n\t\t$this->dispatcher->dispatch ();\r\n\t\t$this->assertEquals ( 4, count ( $this->triggeredEvents ) );\r\n\t\t$this->assertInstanceOf ( 'Tx_Extracache_System_Event_Events_EventOnStaticCachePreprocess', $this->triggeredEvents [0] );\r\n\t\t$this->assertInstanceOf ( 'Tx_Extracache_System_Event_Events_EventOnStaticCacheContext', $this->triggeredEvents [1] );\r\n\t\t$this->assertTrue ( $this->triggeredEvents [1]->getStaticCacheContext () );\r\n\t\t$this->assertInstanceOf ( 'Tx_Extracache_System_Event_Events_EventOnStaticCacheResponsePostProcess', $this->triggeredEvents [2] );\r\n\t}",
"public function hasPendingActions()\r\n {\r\n }",
"public function isDelivered();",
"public function isRedelivered();",
"public function isDispatched()\n {\n return $this->getStatus() === JobsConst::JOB_SET_STATUS_FINISHED_AND_DISPATCHED\n || $this->getStatus() === JobsConst::JOB_SET_STATUS_FAILED_AND_DISPATCHED;\n }",
"function isFromCache()\n\t{\n\t\treturn $this->from_cache ;\n\t}",
"public function isRedelivery()\n {\n }",
"public function deliver();",
"public function load_from_cache ()\n\t{\n\t\t//$this->rendered = \\Cache::get($this->get_cache_id());\n\t\treturn $this->rendered !== null;\n\t}",
"public function can_fetch() {\n\t\treturn ($this->connection !== null) && ($this->connection !== false) && ($this->request !== false) && ($this->storage !== false);\n\t}",
"protected function dispatch() {\n\t\t\tif ( $this->is_http_worker_disabled() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! $this->dispatched ) {\n\t\t\t\t$this->async_request();\n\t\t\t}\n\n\t\t\t$this->dispatched = true;\n\t\t}",
"protected function needsToFlush()\n {\n return\n $this->cacheIsEnabled() && $this->getCurrentRequest()->get('flush');\n }",
"public static function should_cache() {\n\t\tif ( isset( $_GET['breeze_purge'] ) || ( isset( $_POST['action'] ) && 'heartbeat' === $_POST['action'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function isAvailableOnDemand()\n {\n }",
"public function isRedelivery(): bool;",
"public function isDispatchable(Zend_Controller_Dispatcher_Token $action)\n\t{\n return $this->_dispatch($action, false);\n\t}",
"public function preDispatch()\n {\n parent::preDispatch();\n\n if (!Mage::helper('testimonials')->isEnabled()) {\n $this->setFlag('', 'no-dispatch', true);\n $this->_redirect('noRoute');\n }\n }",
"public function dispatchDeferred();",
"public function isDisplayed(): bool\n {\n return $this->authorization->isAllowed('Pronko_SelectiveCache::flush_invalidated_cache')\n && $this->getInvalidatedCacheTypes();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
true if a redirect link was set | public function hasRedirect()
{
return !empty($this->redirectUrl);
} | [
"public function hasRedirect()\n {\n return false;\n }",
"public function isRedirect();",
"public function isRedirect(): bool;",
"public function is_redirect() : bool {\n\t\tif ( isset( $this->ruleset->code ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( $this->is_external_target() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn isset( $this->ruleset->redirect ) ? $this->ruleset->redirect : true;\n\t}",
"public function isRedirect() {\n return $this->redirect;\n }",
"public function isRedirect()\n\t{\n\t\treturn ($this->headers->has('Location') && ($this->statusCode >= 300 && $this->statusCode < 400));\n\t}",
"public function redirected() {\r\n return (!empty($this->_redirectLocation));\r\n }",
"protected function isRedirect() {\r\n\t\treturn $this->response_type === self::RESPONSE_REDIR;\r\n\t}",
"public function isRedirected( )\n {\n return $this->hasHttpHeader('location');\n }",
"public function shouldRedirect(): bool;",
"public function isRedirect() {\n $ret_code = floor($this->info['http_code'] / 100);\n return ($ret_code == 3);\n }",
"public function isRedirect() {\n return substr($this->responseCode, 0, 1) == '3';\n }",
"public function isRefererForRedirectsEnabled(): bool\n {\n return $this->addReferer;\n }",
"public function mustRedirect();",
"public function isRedirect(): bool\n {\n return in_array($this->response->getStatusCode(), [301, 302, 303, 307, 308]);\n }",
"public function isRedirectDisabled() : bool {}",
"public function isRedirection()\n {\n return $this->statusCode >= 300 && $this->statusCode < 400;\n }",
"public function isTargetRedirect()\n {\n if (('/' === substr($this->target, 0, 1)) ||\n ('http' === substr($this->target, 0, 4))) {\n return true;\n }\n return false;\n }",
"public function hasRedirectHTTPStatus() { return ($this->status == 301 || $this->status == 302 || $this->status == 303); }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle state "OK" run authentication. | protected function handleStateOK()
{
$this->log(__METHOD__);
if ($accessToken = $this->getAccessToken()) {
try /* to connect to the Rublon API and get username to authenticate */ {
$this->credentials = $this->getRublon()->getCredentials($accessToken);
} catch (RublonException $e) {
throw new RublonCallbackException("Rublon API credentials error.", RublonCallbackException::ERROR_REST_CREDENTIALS, $e);
}
// Authenticate user
$this->success($this->credentials->getUsername());
} else {
throw new RublonCallbackException("Missing access token.", RublonCallbackException::ERROR_MISSING_ACCESS_TOKEN);
}
} | [
"function authenticationSucceeded() {\r\n\t\t}",
"protected function authSucceeded() {\n\t}",
"public function process_auth() {}",
"public abstract function authorisationSuccessful();",
"public function authSuccess() {\n\t\ttry {\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Common\\Auth\\Exception('Authentication was successful, but the response could not be processed.');\n\t\t}\n\t}",
"public function authenticateSuccess() {\n return TRUE;\n }",
"public function onAuthSuccess()\n {\n return true;\n }",
"public function complete_login()\n\t{\n\n\t}",
"public function doAuthentication()\n {\n }",
"abstract public function check_auth();",
"abstract protected function respondLoginSuccess();",
"public function wasAuthenticationSuccessful()\n {\n return $this->code > self::FAILURE;\n }",
"protected function handleSuccessful()\n {\n $this->updateCheckoutSession();\n }",
"public function actionSigninSucceeded() {\n TWXHttpUtils::redirect('tp-close://self');\n }",
"function login_complete()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$username = str_replace( '|', '|', $this->ipsclass->input['username'] );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Check\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( empty($this->ipsclass->input['username']) )\n\t\t{\n\t\t\t$this->login_form(\"You must enter a username before proceeding\");\n\t\t}\n\t\t\n\t\tif ( empty($this->ipsclass->input['password']) )\n\t\t{\n\t\t\t$this->login_form(\"You must enter a password before proceeding\");\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n \t// Load handler...\n \t//-----------------------------------------\n \t\n \trequire_once( ROOT_PATH.'sources/handlers/han_login.php' );\n \t$this->han_login = new han_login();\n \t$this->han_login->ipsclass =& $this->ipsclass;\n\t\t$this->han_login->is_admin_auth = 1;\n \t$this->han_login->init();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Check auth\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->han_login->login_authenticate( $username, $this->ipsclass->input['password'] );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Check return code...\n\t\t//-----------------------------------------\n\t\t\n\t\t$mem = $this->han_login->member;\n\n\t\t$username_incorrect = \"Username or password incorrect\";\n\t\t\n\t\tif( $this->ipsclass->vars['ipbli_usertype'] != 'username' )\n\t\t{\n\t\t\t$username_incorrect = \"Email address or password incorrect\";\n\t\t}\n\t\t\n\t\tif ( ( ! $mem['id'] ) or ( $this->han_login->return_code == 'NO_USER' ) )\n\t\t{\n\t\t\t$this->write_to_log( $this->ipsclass->input['username'], 'fail' );\n\t\t\t$this->login_form( $username_incorrect );\n\t\t}\n\t\t\n\t\tif ( $this->han_login->return_code != 'SUCCESS' )\n\t\t{\n\t\t\tif ( $this->han_login->return_code == 'ACCOUNT_LOCKED' )\n\t\t\t{\n\t\t\t\t$this->write_to_log( $this->ipsclass->input['username'], 'fail' );\n\t\t\t\t$this->login_form( \"Your account has been locked due to the number of failed login attempts made\" );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->write_to_log( $this->ipsclass->input['username'], 'fail' );\n\t\t\t\t$this->login_form( $username_incorrect );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get perms\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->sess->member = $mem;\n\t\t$this->ipsclass->sess->build_group_permissions();\n\t\t$mem = $this->ipsclass->sess->member;\n\t\t\n\t\tif ( $mem['g_access_cp'] != 1 )\n\t\t{\n\t\t\t$this->write_to_log( $this->ipsclass->input['username'], 'fail' );\n\t\t\t$this->login_form(\"You do not have access to the administrative CP\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Fix up query string...\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$extra_query = \"\";\n\t\t\t\n\t\t\tif ( $_POST['qstring'] )\n\t\t\t{\n\t\t\t\t$extra_query = urldecode( $_POST['qstring'] );\n\t\t\t\t$extra_query = str_replace( \"{$this->ipsclass->vars['board_url']}\" , \"\" , $extra_query );\n\t\t\t\t$extra_query = preg_replace( \"!/?admin\\.{$this->ipsclass->vars['php_ext']}!i\", \"\" , $extra_query );\n\t\t\t\t$extra_query = preg_replace( \"!^\\?!\" , \"\" , $extra_query );\n\t\t\t\t$extra_query = preg_replace( \"!adsess=(\\w){32}!\" , \"\" , $extra_query );\n\t\t\t\t$extra_query = preg_replace( \"!s=(\\w){32}!\" , \"\" , $extra_query );\n\t\t\t\t$extra_query = preg_replace( \"!act=login!\" , \"\" , $extra_query );\n\t\t\t\t$extra_query = preg_replace( \"!code=template-edit-bit!\" , \"\" , $extra_query );\n\t\t\t\t$extra_query = preg_replace( \"!code=template-bits-list!\" , \"\" , $extra_query );\n\t\t\t\t$extra_query = preg_replace( \"!bitname=(\\w)!\" \t\t , \"\" , $extra_query );\n\t\t\t\t$extra_query = $this->ipsclass->parse_clean_value( $extra_query );\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Delete old sessions..\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$this->ipsclass->DB->do_delete( 'admin_sessions', 'session_member_id='.$mem['id'] );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// All is good, rejoice as we set a\n\t\t\t// session for this user\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$sess_id = md5( uniqid( microtime() ) );\n\t\t\t\n\t\t\t$this->ipsclass->DB->do_insert( 'admin_sessions', array (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'session_id' => $sess_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'session_ip_address' => $this->ipsclass->ip_address,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'session_member_name' => $mem['name'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'session_member_id' => $mem['id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'session_member_login_key' => md5( $mem['joined'] . $mem['ip_address'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'session_location' => 'index',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'session_log_in_time' => time(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'session_running_time' => time(),\n\t\t\t\t\t\t\t\t\t\t\t)\t\t\t\t\t\t);\n\t\t\n\t\t\t$this->ipsclass->input['adsess'] = $sess_id;\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Set a session ID cookie\n\t\t\t//-----------------------------------------\n\t\t \n\t\t\t// Don't want it used for XSS...\n\t\t\t//$this->ipsclass->my_setcookie(\"ipb_admin_session_id\", $sess_id, 0);\n\t\t\t\n\t\t\t$this->write_to_log( $this->ipsclass->input['username'], 'ok' );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Lets add some data in here for the access logs...\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$extra_query .= \"&member_id=\".$mem['id'].'&password=ok';\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Redirect...\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$this->ipsclass->admin->redirect( $this->ipsclass->vars['board_url'].'/'.IPB_ACP_DIRECTORY.\"/index.\".$this->ipsclass->vars['php_ext'].\"?adsess=\".$this->ipsclass->input['adsess'].\"&\".$extra_query, 'Log In Successful' );\n\t\n\t\t\texit();\n\t\t}\n\t}",
"function ft_hook_loginsuccess() {}",
"public function post_request_auth() {\n\t\tsession_start();\n\t\t$this->init_gitlab_oauth_provider();\n\n\t\t$authUrl = $this->oauth_provider->getAuthorizationUrl();\n\t\t$_SESSION['oauth2state'] = $this->oauth_provider->getState();\n\t\theader('Location: '.$authUrl);\n\t\texit;\n\t}",
"public function checkAuthentication() {}",
"public function authenticateAction()\n {\n $opauthResponse = $this->opauth->getResponse();\n\n if (!$this->authenticateActionAlreadyCalled && $opauthResponse !== NULL) {\n $this->authenticateActionAlreadyCalled = TRUE;\n if ($opauthResponse->isAuthenticationSucceeded()) {\n $opauthAccount = $this->opauthAccountService->getAccount($opauthResponse);\n $doesAccountExists = $this->opauthAccountService->doesAccountExist($opauthAccount);\n\n if ($doesAccountExists === FALSE) {\n return $this->onOpauthAccountDoesNotExist($opauthResponse->getRawData(), $opauthAccount);\n }\n } else {\n return $this->onOpauthAuthenticationFailure($opauthResponse->getRawData());\n }\n }\n\n return parent::authenticateAction();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to put our own module position inside the component view this pulls in all modules assigned to the $position position | private function _getModulesFor( $position, $style ){
$doc = JFactory::getDocument();
$renderer = $doc->loadRenderer( 'modules' );
$raw = array( 'style' => $style );
return $renderer->render( $position, $raw, null );
} | [
"public function load($position) {\n\n\t\t\t\t\t\t// init vars\n\t\t\t\t\t\t$modules = JModuleHelper::getModules($position);\n\t\t\t\t\t\t$injected = @JFactory::getDocument()->modules[$position];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($injected) {\n\t\t\t\t\t\t\tforeach (array_reverse($injected) as $module) {\n\t\t\t\t\t\t\t\t$modules[] = $module;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// set params, force no style\n\t\t\t\t\t\t$params['style'] = 'none';\n\t\t\t\t\t\t\n\t\t\t\t\t\t// get modules content\n\t\t\t\t\t\tforeach ($modules as $module) {\n\t\t\t\t\t\t\t$module->parameter = new JRegistry($module->params);\n\t\t\t\t\t\t\t$module->menu = $module->module == 'mod_menu';\n\t\t\t\t\t\t\t$module->content = $this->_renderer->render($module, $params);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn $modules;\n\t\t\t\t\t}",
"function &getModules($position)\n\t\t\t\t{\n\t\t\t\t\t$position\t= strtolower( $position );\n\t\t\t\t\t$result\t\t= array();\n\n\t\t\t\t\t$modules =& JModuleHelper::_load();\n\t\t\t\t\t\n\t\t\t\t\t//Ohanah mapped positions\n\t\t\t\t\t$option = KRequest::get('get.option', 'string');\n\t\t\t\t\t$view = KRequest::get('get.view', 'string');\n\t\t\t\t\t\n\t\t\t\t\t$include_injected_position = false;\n\n\t\t\t\t\tif ($option == 'com_ohanah') {\n\t\t\t\t\t\t$ohanah_params = JFactory::getApplication()->getPageParameters('com_ohanah');\n\t\t\t\t\t\n\t\t\t\t\t\tif ($view == 'event') {\n\n\t\t\t\t\t\t\tif ($ohanah_params->get('singleEventModulePosition1') == $position) $include_injected_position = true;\n\t\t\t\t\t\t\tif ($ohanah_params->get('singleEventModulePosition2') == $position) $include_injected_position = true;\n\t\t\t\t\t\t\tif ($ohanah_params->get('singleEventModulePosition3') == $position)\t$include_injected_position = true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} elseif ($view == 'events') {\n\t\t\t\n\t\t\t\t\t\t\tif ($ohanah_params->get('listEventsModulePosition1') == $position) $include_injected_position = true;\n\t\t\t\t\t\t\tif ($ohanah_params->get('listEventsModulePosition2') == $position) $include_injected_position = true;\n\t\t\t\t\t\t\tif ($ohanah_params->get('listEventsModulePosition3') == $position) $include_injected_position = true;\n\t\t\t\t\t\t\tif ($ohanah_params->get('singleVenueModulePosition1') == $position) $include_injected_position = true;\n\t\t\t\t\t\t\tif ($ohanah_params->get('singleVenueModulePosition2') == $position) $include_injected_position = true;\n\t\t\t\t\t\t\tif ($ohanah_params->get('singleVenueModulePosition3') == $position) $include_injected_position = true;\n\t\t\t\t\t\t\tif ($ohanah_params->get('singleCategoryModulePosition1') == $position) $include_injected_position = true;\n\t\t\t\t\t\t\tif ($ohanah_params->get('singleCategoryModulePosition2') == $position) $include_injected_position = true;\n\t\t\t\t\t\t\tif ($ohanah_params->get('singleCategoryModulePosition3') == $position) $include_injected_position = true;\n\n\t\t\t\t\t\t} elseif ($view == 'registration') {\n\t\t\t\n\t\t\t\t\t\t\tif ($ohanah_params->get('eventRegistrationModulePosition1') == $position) $include_injected_position = true;\n\t\t\t\t\t\t\tif ($ohanah_params->get('eventRegistrationModulePosition2') == $position) $include_injected_position = true;\n\t\t\t\t\t\t\tif ($ohanah_params->get('eventRegistrationModulePosition3') == $position) $include_injected_position = true;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$total = count($modules);\n\t\t\t\t\tfor ($i = 0; $i < $total; $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($modules[$i]->position == $position) {\n\t\t\t\t\t\t\t$result[] = &$modules[$i];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (substr(JFactory::getApplication()->getTemplate(), 0, 4) != 'yoo_') {\n\t\t\t\t\t\t\t\tif ($include_injected_position) {\n\t\t\t\t\t\t\t\t\t$module = new stdClass();\n\t\t\t\t\t\t\t\t\t$module->id = 0;\n\t\t\t\t\t\t\t\t\t$module->position = null;\n\t\t\t\t\t\t\t\t\t$module->title = null;\n\t\t\t\t\t\t\t\t\t$module->content = null;\n\t\t\t\t\t\t\t\t\t$module->showtitle = null;\n\t\t\t\t\t\t\t\t\t$module->params = null;\n\t\t\t\t\t\t\t\t\t$module->module = null;\n\t\t\t\t\t\t\t\t\t$module->user = null;\n\t\t\t\t\t\t\t\t\t$result[] = $module;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(count($result) == 0) {\n\t\t\t\t\t\tif(JRequest::getBool('tp')) {\n\t\t\t\t\t\t\t$result[0] = JModuleHelper::getModule( 'mod_'.$position );\n\t\t\t\t\t\t\t$result[0]->title = $position;\n\t\t\t\t\t\t\t$result[0]->content = $position;\n\t\t\t\t\t\t\t$result[0]->position = $position;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn $result;\n\t\t\t\t}",
"function include_modules ($position) {\n global $modules;\n global $profile;\n if(isset($modules)){\n reset($modules);\n if(SESSION_STATUS != 'ok') {\n while (list ($modid, $value) = each ($modules)) {\n include_module($value, 1, $position);\n }\n }\n else {\n while (list ($modid, $value) = each ($modules)) {\n if($value['removeable'] == 1 && isset($profile['module_'.$modid])) {\n $value['visible'] = $profile['module_'.$modid];\n }\n if(!isset($profile['module_size_'.$modid])) { $profile['module_size_'.$modid] = 1; }\n include_module($value, $profile['module_size_'.$modid], $position);\n }\n }\n }\n }",
"function checkModulePosition($position) {\r\n\t$db\t= JFactory::getDbo();\r\n\t$query = ' SELECT id, title, module, position, content, showtitle, params, mm.menuid, published'\r\n\t\t.' FROM #__modules AS m'\r\n\t\t.' LEFT JOIN #__modules_menu AS mm ON mm.moduleid = m.id'\r\n\t\t.' WHERE m.published = 1'\r\n\t\t.' AND mm.menuid = 0'\r\n\t\t.' AND m.client_id = 0'\r\n\t\t.' AND m.position = \\''.$position.'\\';';\r\n\t$db->setQuery($query);\r\n\t$modules = $db->loadObjectList();\r\n\treturn $modules;\r\n}",
"function &getModules($position)\n\t{\n\t\t$position\t= strtolower( $position );\n\t\t$result\t\t= array();\n\n\t\t$modules =& JModuleHelper::_load();\n\n\t\t$total = count($modules);\n\t\tfor($i = 0; $i < $total; $i++) {\n\t\t\tif($modules[$i]->position == $position) {\n\t\t\t\t$result[] =& $modules[$i];\n\t\t\t}\n\t\t}\n\t\tif(count($result) == 0) {\n\t\t\tif(JRequest::getBool('tp')) {\n\t\t\t\t$result[0] = JModuleHelper::getModule( 'mod_'.$position );\n\t\t\t\t$result[0]->title = $position;\n\t\t\t\t$result[0]->content = $position;\n\t\t\t\t$result[0]->position = $position;\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}",
"public static function module_place($module_name, $module_path, $position)\n\t{\n\t\t$i = 0;\n\t\t$new_array = array();\n\n\t\tforeach (Ilch::$modules as $key => $value)\n\t\t{\n\t\t\tif ($position == $i) $new_array[$module_name] = $module_path;\n\t\t\t$new_array[$key] = $value;\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\tif (!isset($new_array[$module_name])) $new_array[$module_name] = $module_path;\n\t\tIlch::$modules = $new_array;\n\t}",
"function &getModules($position)\n\t{\n\t\t$result = array();\n\n\t\t$modules =& JModuleHelper::_load();\n\n\t\t$total = count($modules);\n\t\tfor($i = 0; $i < $total; $i++) {\n\t\t\tif($modules[$i]->position == $position) {\n\t\t\t\t$result[] =& $modules[$i];\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}",
"public function installPositions(){\r\n /* Display Nav Links Position */\r\n $this->_addPosition('displayNavLinks', 'Main nav bar - links', 'An area to display links');\r\n \r\n /* Display Nav Right Position */\r\n $this->_addPosition('displayNavSCL', 'Main nav bar - search, currencies and languages', 'An area to display currencies, languages and search');\r\n \r\n /* Display Slider Position */\r\n $this->_addPosition('displaySlider', 'Slider header position', 'display the slider in header');\r\n \r\n /* Display Ads Position */\r\n $this->_addPosition('displayAds', 'Advertising position', 'display ads in header');\r\n \r\n /* Display New, Featured and Specials products on home Position */\r\n $this->_addPosition('homeNFS', 'Home Products Tabs', 'New, Featured and Specials products on home');\r\n \r\n /* Display Newsletter and/or Reassurance block Position */\r\n $this->_addPosition('displayBlueBlock', 'Home Blue Block', 'Newsletter and/or Reassurance block');\r\n \r\n /* Display Newsletter and/or Reassurance block Position */\r\n $this->_addPosition('footerBar', 'Footer Bar', 'Footer Bar with Twitter');\r\n }",
"public function setModule($position, $module) {\n\t\tif(!isset($this->modules[$position])) $this->modules[$position] = array();\n\t\tif(!in_array($module, $this->modules[$position])) $this->modules[$position][] = $module;\n\t}",
"protected function assignModules()\n {\n // Get block counts per module\n $model = Pi::model('block');\n $select = $model->select()->group('module')\n ->columns(['count' => Pi::db()->expression('count(*)'), 'module']);\n $rowset = $model->selectWith($select);\n $blockCounts = [];\n foreach ($rowset as $row) {\n $blockCounts[$row->module] = $row->count;\n }\n\n // Get module list\n $modules = [];\n $moduleSet = Pi::model('module')->select(['active' => 1]);\n $widgetModule = [];\n foreach ($moduleSet as $row) {\n if ('widget' == $row->name) {\n $count = empty($blockCounts['widget']) ? '0' : $blockCounts['widget'];\n $widgetModule = [\n 'name' => $row->name,\n 'title' => $row->title . ' (' . $count . ')',\n ];\n } elseif (!empty($blockCounts[$row->name])) {\n $modules[] = [\n 'name' => $row->name,\n 'title' => $row->title . ' (' . $blockCounts[$row->name] . ')',\n ];\n }\n }\n array_unshift($modules, $widgetModule);\n\n $this->view()->assign('modules', $modules);\n }",
"public function modules_loaded() {\r\n $this->desploy_modules_position();\r\n }",
"public function addModulePositionTestsDataProvider() {}",
"private function _configureModulesVisibility()\n {\n if (!isset($this->_data['Modules'])) {\n return;\n }\n // to do - menu implementing\n /*if (!isset($this->_data['Menus']))\n return;*/\n\n $contentMenuItems = array();\n\n // to do - menu implementing\n /*foreach ($this->_data['Menus'] as $menuData)\n foreach ($menuData['items'] as $itemData)\n $contentMenuItems[] = $itemData['joomla_id'];*/\n\n $contentMenuItems[] = 0; // on all pages\n\n $contentModules = array();\n foreach ($this->_data['Modules'] as $moduleData) {\n $contentModules[] = $moduleData['joomla_id'];\n }\n\n $modules = Upage_Data_Mappers::get('module');\n\n // to do - menu implementing\n /*$menuItems = Upage_Data_Mappers::get('menuItem');\n\n $userMenuItems = array();\n $menuItemList = $menuItems->find(array('scope' => 'site'));\n foreach ($menuItemList as $menuItem) {\n if (in_array($menuItem->id, $contentMenuItems))\n continue;\n $userMenuItems[] = $menuItem->id;\n }*/\n\n $moduleList = $modules->find(array('scope' => 'site'));\n foreach ($moduleList as $moduleListItem) {\n if (in_array($moduleListItem->id, $contentModules)) {\n $modules->enableOn($moduleListItem->id, $contentMenuItems);\n } else {\n $pages = $modules->getAssignment($moduleListItem->id);\n if (1 == count($pages) && '0' == $pages[0]) {\n $modules->disableOn($moduleListItem->id, $contentMenuItems);\n }\n if (0 < count($pages) && 0 > $pages[0]) {\n $disableOnPages = array_unique(array_merge(array_map('abs', $pages), $contentMenuItems));\n $modules->disableOn($moduleListItem->id, $disableOnPages);\n }\n }\n }\n }",
"private function _createModules()\n {\n if (!isset($this->_data['Modules'])) {\n return;\n }\n\n $modulesMapper = Upage_Data_Mappers::get('module');\n\n foreach ($this->_data['Modules'] as $moduleData) {\n $modulesList = $modulesMapper->find(array('title' => $moduleData['title']));\n foreach ($modulesList as $modulesListItem) {\n $status = $modulesMapper->delete($modulesListItem->id);\n }\n }\n\n $order = array();\n\n foreach ($this->_data['Modules'] as $key => $moduleData) {\n $module = $modulesMapper->create();\n $module->title = $moduleData['title'];\n $module->position = $moduleData['position'];\n\n $params = array();\n switch ($moduleData['type']) {\n case 'menu':\n $module->module = 'mod_menu';\n $params = array\n (\n 'menutype' => $moduleData['menu'],\n 'startLevel' => '1',\n 'endLevel' => '0',\n 'showAllChildren' => '1',\n 'tag_id' => '',\n 'class_sfx' => '',\n 'window_open' => '',\n 'layout' => '_:default',\n 'moduleclass_sfx' => '',\n 'cache' => '1',\n 'cache_time' => '900',\n 'cachemode' => 'itemid'\n );\n break;\n case 'login':\n $module->module = 'mod_login';\n $params = array\n (\n 'pretext' => '',\n 'posttext' => '',\n 'login' => '',\n 'logout' => '',\n 'greeting' => '1',\n 'name' => '0',\n 'usesecure' => '0',\n 'layout' => '_:default',\n 'moduleclass_sfx' => '',\n 'cache' => '0'\n );\n break;\n case 'search':\n $module->module = 'mod_search';\n $params = array\n (\n 'layout' => '_:default',\n 'moduleclass_sfx' => '',\n 'cache' => '0'\n );\n break;\n case 'text':\n $module->module = 'mod_custom';\n $module->content = $this->_processingContent($moduleData['content']);\n $params = array\n (\n 'prepare_content' => '1',\n 'layout' => '_:default',\n 'moduleclass_sfx' => '',\n 'cache' => '1',\n 'cache_time' => '900',\n 'cachemode' => 'static'\n );\n break;\n }\n $module->showtitle = 'true' == $moduleData['showTitle'] ? '1' : '0';\n // style:\n if (isset($moduleData['style']) && isset($params['moduleclass_sfx'])) {\n $params['moduleclass_sfx'] = $moduleData['style'];\n }\n // parameters:\n $module->params = $this->_paramsToString($params);\n\n // ordering:\n if (!isset($order[$moduleData['position']])) {\n $order[$moduleData['position']] = 1;\n }\n $module->ordering = $order[$moduleData['position']];\n $order[$moduleData['position']]++;\n\n $status = $modulesMapper->save($module);\n if (is_string($status)) {\n trigger_error($status, E_USER_ERROR);\n }\n $this->_data['Modules'][$key]['joomla_id'] = $module->id;\n }\n }",
"function addModuleToPages($items, $module_name, $position = 'right', $sort_order = 1)\r\n\t{\r\n\t\tif($items && !is_array($items))\r\n\t\t\t$items = array($items);\r\n\r\n\t\tif(count($items) == 0)\r\n\t\t\treturn true;\r\n\r\n\t\t$modules = Query::create(Module, \"WHERE title=:title\")\r\n\t\t->bind(\":title\", $module_name)\r\n\t\t->execute();\r\n\r\n\t\tif(count($modules) == 0)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\t$module = $modules[0];\r\n\r\n\t\tforeach($items as $item)\r\n\t\t{\r\n\t\t\tif(!is_object($item))\r\n\t\t\t{\r\n\t\t\t\t$page = $this->searchByIdentifier($item);\r\n\t\t\t\tif(!$page) return false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$page = $item;\r\n\r\n\t\t\t$xref_class = (preg_match(\"/component/i\", (get_class($page)))) ? ComponentPageModuleXref : PageModuleXref;\r\n\t\t\t$xref = new $xref_class();\r\n\t\t\t$pk = $page->getPrimaryKey();\r\n\r\n\t\t\t$found = Query::create($xref_class, \"WHERE $pk=:$pk AND module_id=:module_id\")\r\n\t\t\t\t->bind(\":$pk\", $page->$pk, \":module_id\", $module->module_id)\r\n\t\t\t\t->executeValue(\"COUNT(1)\");\r\n\r\n\t\t\tif(!$found)\r\n\t\t\t{\r\n\t\t\t\t$xref->$pk = $page->$pk;\r\n\t\t\t\t$xref->module_id = $module->module_id;\r\n\t\t\t\t$xref->position = $position;\r\n\t\t\t\t$xref->sort_order = $sort_order;\r\n\t\t\t\t$xref->save();\r\n\t\t\t\t$this->log .= $page->format(\"Adding $xref_class record for page {identifier} to module {$module->title}\\r\\n\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->log .= \"Page identifier $identifier already linked to module {$module->title}\\r\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}",
"public function module() {\n\n $modules_system = new \\Inside4\\InsideTools\\InsideModularSystem;\n\n $modules_system->db =& $this->db;\n $modules_system->view =& $this->view;\n\n $this->data['content'] = '';\n $system_names = $this->input->get_secure('system_name');\n $system_names = explode(', ', $system_names);\n foreach ($system_names as $system_name) {\n $this->data['content'] .= $modules_system->module_info($system_name);\n }\n\n\n $this->view->render($this->data,'admin_page', 'inside_admin_template');\n }",
"function count($position) {\n\n\t\t// init vars\n\t\t$document = JFactory::getDocument();\n\t\t\n\t\treturn $document->countModules($position);\n\t}",
"public function add_to_position($content_callback=null) {\r\n $this->option('enable_position', true);\r\n $this->option('render_module', $content_callback);\r\n }",
"function count($position) {\n\t\t\t\t\t\t// init vars\n\t\t\t\t\t\t$document =& JFactory::getDocument();\n\n\t\t\t\t\t\t$count = $document->countModules($position);\n\t\t\t\t\t $count += count(@JFactory::getDocument()->modules[$position]);\n\n\t\t\t\t\t return $count;\n\t\t\t\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$query = "SELECT CT_CODE,CT_NAME_KR FROM ".TBL_COUNTRY." WHERE CT_CODE IS NOT NULL ORDER BY CT_CODE"; | function getCountrySelectList($db){
$query = "SELECT CT_CODE,CT_NAME_KR FROM ".TBL_COUNTRY." WHERE CT_CODE IS NOT NULL ORDER BY CT_NAME_KR";
return $db->getArray($query);
} | [
"function ambil_daftar_bagian(){\n $query1 = $this->db->query(\"select kd, nama_bagian from tbl_bagian where hapus is null order by nama_bagian;\");\n \n return $query1;\n }",
"function getAllNational($national_CODE)\n\t{\n\t\t$sql = \"SELECT * FROM national \";\n\t\t$sql .= \"ORDER BY national_NAME\";\n\t\t$query = mysql_query($sql) or die(\"SQL : \".$sql.\"<br>ERROR : \". mysql_error()); \n\t\t$i = 0;\n\t\twhile ($row = mysql_fetch_array($query)) {\n\t\t\t$result[$i][\"ROWIDS\"]\t\t\t= $row[\"ROWIDS\"];\n\t\t\t$result[$i][\"national_CODE\"]\t\t= $row[\"national_CODE\"];\n\t\t\t$result[$i][\"national_NAME\"]\t\t= $row[\"national_NAME\"];\t\n\t\t\t$result[$i][\"ZONECODE\"]\t\t\t= $row[\"ZONECODE\"];\n\t\t\t$i++;\t\n\t\t}\n\t\treturn $result;\n\t\t}",
"public function getListOtsNull() {\n $query = $this->db->query(\"\n SELECT oth.nro_ot_onyx,\n oth.id_orden_trabajo_hija,\n otp.n_nombre_cliente AS nombre_cliente,\n oth.ot_hija,\n oth.estado_orden_trabajo_hija,\n otp.fecha_creacion\n FROM ot_hija oth\n INNER JOIN ot_padre otp\n ON otp.k_id_ot_padre = oth.nro_ot_onyx\n WHERE oth.k_id_estado_ot IS NULL\n \");\n return $query->result();\n }",
"public function getAddressNoltlng(){\n $sql = \"SELECT * FROM $this->tableName WHERE lat IS NULL AND lng IS NULL \";\n $stmt = $this->conn->prepare($sql);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n }",
"public function get_BDE_Country($bde_code)\n {\n $query=$this->db->query(\"SELECT DISTINCT(Country) FROM ibt_prospect_data where Current_BDE_User_Code='$bde_code' \");\n return $query->result_array();\n }",
"public function get_for_browse_countries(){\n $country_name = NULL;\n $sql = \"SELECT * from travelimagedetails GROUP by CountryCodeISO\";\n $countrycodes = $this->query($sql);\n while($country = $countrycodes->fetch()){\n $sql = \"select * from geocountries where ISO ='\" . $country[\"CountryCodeISO\"]. \"'\";\n $result = $this->query($sql);\n $countrynames = $result->fetch();\n echo \"<option value='\". $countrynames[\"ISO\"] .\"'> \". $countrynames[\"CountryName\"] .\" </option>\";\n } \n }",
"function getAllCountryList() {\n\t $qry = \"SELECT * FROM countries ORDER BY name ASC\";\n return $result = $this->modelObj->fetchRows($qry);\n }",
"function chado_contact_chado_node_sync_select_query($query) {\n $query['where_clauses']['title'][] = 'contact.name <> :contact_name_null1';\n $query['where_clauses']['title'][] = 'contact.name <> :contact_name_null2';\n $query['where_args']['title'][':contact_name_null1'] = 'null';\n $query['where_args']['title'][':contact_name_null2'] = 'NULL';\n\n return $query;\n}",
"function countryList() {\n $arrClms = array('country_id', 'name');\n $varWhr = '1 ';\n $varOrderBy = 'name ASC ';\n $arrRes = $this->select(TABLE_COUNTRY, $arrClms, $varWhr, $varOrderBy);\n //pre($arrRes);\n return $arrRes;\n }",
"function countryList()\n {\n $arrClms = array(\n 'country_id',\n 'name',\n );\n $varOrderBy = 'name ASC ';\n $arrRes = $this->select(TABLE_COUNTRY, $arrClms);\n return $arrRes;\n }",
"function show_branches($bank = NULL, $state= NULL, $city = NULL)\n{\n\n $sql =\"select distinct(branch) from codelist where bank_name ='$bank' AND state = '$state' AND city = '$city' order by branch\"; \n include('admin/connect.php');\n $result = mysqli_query($conn,$sql);\n\t\tif(mysqli_num_rows($result)>0){\n\t\t while( $row = mysqli_fetch_assoc($result))\n\t\t\t{\n\t\t\t\techo '<option>'. $row['branch'] .'</option>' ;\n\t\t\t}\n } \n\tmysqli_close($conn);\n}",
"function GetSelectProvincias(){\n\t$default=0;\n\t\n\t$sql = \"SELECT pv_codigo id, pv_descripcion descripcion\n\t\t\tFROM cpv_provincias\n\t\t WHERE pv_fechabaja IS NULL\n\t\tORDER BY pv_descripcion\";\n\t\t\n\t$result = CreateSelectHTML($sql, 'Provincia', 'width:100%;', $default);\n\n\treturn $result; \t\t \n}",
"function get_country($country_code)\n {\n $country = $this->db->query(\"\n SELECT\n *\n\n FROM\n `country`\n\n WHERE\n `country_code` = ?\n \",array($country_code))->row_array();\n\n return $country;\n }",
"function get_postcodes() {\n\n\tglobal $mysqli;\n\n\tif($stmt = $mysqli->prepare(\"SELECT DISTINCT(Site_pcode),Site_suburb FROM vba WHERE (Site_suburb IS NOT NULL OR TRIM(Site_suburb)='') ORDER BY Site_suburb\")) {\n\n\t $stmt->execute();\n\t $stmt->bind_result($postcode,$suburb);\n\n\t $results = array();\n\t while ($stmt->fetch()) {\n\t\t\tarray_push($results, array( \"postcode\" => $postcode, \"suburb\" => $suburb ));\n\t }\n\n\t\treturn $results;\n\n\t}\n\n\treturn NULL;\n\n}",
"function sql_check_null_or_empty($rs, $col_name) {\r\n\t\r\n\tif(trim($rs[\"$col_name\"])!=\"\"){\r\n\t\t$null_or_emoty_sql= $col_name .\"='$rs[$col_name]'\";\r\n\t}else{\r\n\t\t$null_or_emoty_sql=\"(\" . $col_name .\" is NULL OR \" . $col_name . \"='')\";\r\n\t}\r\n\t\r\n\treturn $null_or_emoty_sql;\r\n}",
"function selcourt1(){\n\t\t$sql=\"SELECT * FROM gestion WHERE suingdate IS NOT NULL AND judicialdate IS NULL\";\n\t\t$data = $this->selcot($sql);\n\t\treturn $data; \n\t}",
"function getCountryList() {\n $this->db->select(\"distinct(cou_descrizione) as country\");\n $this->db->from('plused_tb_country');\n $this->db->orderBy('cou_descrizione');\n $result = $this->db->get();\n return ($result->num_rows() > 0) ? $result->result_array() : array();\n }",
"function wp_db_null_value( $query )\n{\n return str_ireplace( \"'NULL'\", \"NULL\", $query );\n}",
"function getCountryArr()\n{\n\t$countryArr=array();\n\t\n\t$con=new dbcon;\n\t$sql=\"select country_id,country_title,code from \".DBPREFIX.\"country order by lower(country_title)\";\n\t$con->Query($sql);\t\n\twhile($rs=$con->FetchRow())\n\t{\n\t\t$countryArr[$rs[\"country_id\"]]=$rs[\"country_title\"];\n\t}\n\t\n\treturn $countryArr;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
elementsList : '[' elements ']' ; // match bracketed list | public function elementsList()
{
$this->match(LookaheadLexer::LBRACK);
$this->elements();
$this->match(LookaheadLexer::RBRACK);
} | [
"function split_elements_list($elements_list)\r\r\r\n\t{\r\r\r\n\t\t$elements_list_length = strlen($elements_list);\r\r\r\n\t\t$elements_array = array();\r\r\r\n\t\t$element = '';\r\r\r\n\t\t$inner_parenthesis = 0;\r\r\r\n\t\tfor( $i = 0; $i < $elements_list_length; $i++ )\r\r\r\n\t\t{\r\r\r\n\t\t\t$char = $elements_list[$i];\r\r\r\n\r\r\r\n\t\t\tif( $inner_parenthesis > 0 )\r\r\r\n\t\t\t{\r\r\r\n\t\t\t\t$element .= $char;\r\r\r\n\r\r\r\n\t\t\t\tif( $char == ')' )\r\r\r\n\t\t\t\t{\r\r\r\n\t\t\t\t\t$inner_parenthesis--;\r\r\r\n\t\t\t\t}\r\r\r\n\t\t\t\telseif( $char == '(' )\r\r\r\n\t\t\t\t{\r\r\r\n\t\t\t\t\t$inner_parenthesis++;\r\r\r\n\t\t\t\t}\r\r\r\n\t\t\t}\r\r\r\n\t\t\telse\r\r\r\n\t\t\t{\r\r\r\n\t\t\t\tif( $char == ',' )\r\r\r\n\t\t\t\t{\r\r\r\n\t\t\t\t\t$elements_array[] = trim($element);\r\r\r\n\t\t\t\t\t$element = '';\r\r\r\n\t\t\t\t}\r\r\r\n\t\t\t\telse\r\r\r\n\t\t\t\t{\r\r\r\n\t\t\t\t\t$element .= $char;\r\r\r\n\r\r\r\n\t\t\t\t\tif( $char == '(' )\r\r\r\n\t\t\t\t\t{\r\r\r\n\t\t\t\t\t\t$inner_parenthesis++;\r\r\r\n\t\t\t\t\t}\r\r\r\n\t\t\t\t}\r\r\r\n\t\t\t}\r\r\r\n\t\t}\r\r\r\n\t\t$elements_array[] = trim($element);\r\r\r\n\t\treturn $elements_array;\r\r\r\n\t}",
"public function listelement(){\n $result = null;\n\n $val = null;\n\n\n try {\n {\n $this->match($this->input,$this->getToken('14'),self::$FOLLOW_14_in_listelement122); if ($this->state->failed) return $result;\n $this->pushFollow(self::$FOLLOW_value_in_listelement126);\n $val=$this->value();\n\n $this->state->_fsp--;\n if ($this->state->failed) return $result;\n if ( $this->state->backtracking==0 ) {\n $result = array('list', $val);\n }\n //loop2:\n do {\n $alt2=2;\n $LA2_0 = $this->input->LA(1);\n\n if ( ($LA2_0==$this->getToken('15')) ) {\n $alt2=1;\n }\n\n\n switch ($alt2) {\n \tcase 1 :\n \t {\n \t $this->match($this->input,$this->getToken('15'),self::$FOLLOW_15_in_listelement137); if ($this->state->failed) return $result;\n \t $this->pushFollow(self::$FOLLOW_value_in_listelement141);\n \t $val=$this->value();\n\n \t $this->state->_fsp--;\n \t if ($this->state->failed) return $result;\n \t if ( $this->state->backtracking==0 ) {\n \t $result[] = $val;\n \t }\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop2;\n }\n } while (true);\n\n $this->match($this->input,$this->getToken('16'),self::$FOLLOW_16_in_listelement147); if ($this->state->failed) return $result;\n\n }\n\n }\n \n \tcatch (RecognitionException $e) { \n \t\tthrow $e; \n \t} \n catch(Exception $e) {\n throw $e;\n }\n \n return $result;\n }",
"public function elements()\n {\n $this->element();\n while (LookaheadLexer::COMMA === $this->LA(1)) {\n $this->match(LookaheadLexer::COMMA);\n $this->element();\n }\n\n }",
"public function elements()\n {\n $this->element();\n while (BacktrackLexer::COMMA === $this->LA(1)) {\n $this->match(BacktrackLexer::COMMA);\n $this->element();\n }\n }",
"abstract public function elements();",
"function getTagsList($content, $b_left=\"[\", $b_right=\"]\") {\n $b_left = preg_quote ($b_left);\n $b_right = preg_quote ($b_right);\n $patern = '/'.$b_left.'(\\w{1,50})'.$b_right.'/siU';\n preg_match_all ( $patern , $content , $outdata);\n return array_unique($outdata[1]);\n}",
"function _parse_list( $i, $strings, &$attrs ) {\n $string = $strings[$i];\n if (!preg_match('/^\\(/',$string)) {\n // A bareword only - can be terminated by a ) if the last item\n if (preg_match('/\\)+$/',$string))\n $string = preg_replace('/\\)+$/','',$string);\n\n array_push($attrs, $string);\n } elseif (preg_match('/^\\(.*\\)$/',$string)) {\n $string = preg_replace('/^\\(/','',$string);\n $string = preg_replace('/\\)+$/','',$string);\n array_push($attrs, $string);\n } else {\n // Handle the opening cases first\n if ($string == '(') {\n $i++;\n\n } elseif (preg_match('/^\\(./',$string)) {\n $string = preg_replace('/^\\(/','',$string);\n array_push ($attrs, $string);\n $i++;\n }\n\n // Token is either a name, a $ or a ')'\n // NAME can be terminated by one or more ')'\n while (! preg_match('/\\)+$/',$strings[$i])) {\n $string = $strings[$i];\n if ($string == '$') {\n $i++;\n continue;\n }\n\n if (preg_match('/\\)$/',$string)) {\n $string = preg_replace('/\\)+$/','',$string);\n } else {\n $i++;\n }\n array_push ($attrs, $string);\n }\n }\n sort($attrs);\n\n return $i;\n }",
"protected function elements()\n {\n $this->element();\n while ($this->getCurrentToken()->getType() == ListLexer::TOKEN_TYPE_COMMA) {\n $this->match(ListLexer::TOKEN_TYPE_COMMA);\n $this->element();\n }\n }",
"public function testParseProcessListElement(): void\n {\n $sch = $this->sut->parse($this->getXs('list_0002.xsd'));\n \n self::assertElementNamespaceDeclarations(\n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n ], \n $sch\n );\n self::assertSchemaElementHasNoAttribute($sch);\n self::assertCount(1, $sch->getElements());\n \n $st = $sch->getSimpleTypeElements()[0];\n self::assertElementNamespaceDeclarations([], $st);\n self::assertSimpleTypeElementHasNoAttribute($st);\n self::assertCount(1, $st->getElements());\n \n $list = $st->getDerivationElement();\n self::assertElementNamespaceDeclarations([], $list);\n self::assertListElementHasNoAttribute($list);\n self::assertSame([], $list->getElements());\n }",
"function erl_parse_list($string, $i){\n $sb_started = false; // square_bracket\n $list = array();\n $len = strlen($string);\n while($i < $len){\n\t $l = $string[$i]; // letter\n $significant_symbol = erl_skip_unsignificant_symbols($string, $i+1);\n \t$n = $significant_symbol < $len ? $string[$significant_symbol] : false; // next letter\n \tswitch(true){\n \tcase false !== strpos(erl_config('spaces'), $l):\n \t break;\n \tcase $l === '[' && !$sb_started && $n === ']':\n \t $sb_started = true;\n \t break;\n \tcase $l === '[' && !$sb_started :\n \t $sb_started = true;\n \t list($list[], $i) = erl_parse_all($string, $i+1);\n \t continue;\n \tcase $l === ',':\n \t list($list[], $i) = erl_parse_all($string, $i+1);\n \t continue;\n \tcase $l === ']' && $sb_started:\n \t return array(array('type'=>'list', 'data'=>$list), $i);\n \t break;\n \tdefault:\n \t throw new Exception(\"Unexpected symbol $l in $i\");\n \t break;\n \t}\n \t$i++;\n }\n throw new Exception(\"Error while parsing list\");\n}",
"function expandLists($list)\n {\n for ($i = 0;$i < count($list);$i++) {\n if (is_array($list[$i])) {\n if ($list[$i][0] == '[') {\n $bnode = $this->bnodeID();\n $prop = $list[$i];\n $list[$i] = $bnode;\n $list[] = $bnode;\n $list = $this->array_concat($list, array_slice($prop, 1, -1));\n $list[] = '.';\n } else {\n die('Only [ ] lists are supported!');\n }\n }\n }\n return $list;\n }",
"function bbencode_list($message)\n{\n\t$start_length = Array();\n\t$start_length[ordered] = 8;\n\t$start_length[unordered] = 6;\n\n\t// First things first: If there aren't any \"[list\" strings in the message, we don't\n\t// need to process it at all.\n\n\tif (!strpos(strtolower($message), \"[list\"))\n\t{\n\t\treturn $message;\n\t}\n\n\t$stack = Array();\n\t$curr_pos = 1;\n\twhile ($curr_pos && ($curr_pos < strlen($message)))\n\t{\n\t\t$curr_pos = strpos($message, \"[\", $curr_pos);\n\n\t\t// If not found, $curr_pos will be 0, and the loop will end.\n\t\tif ($curr_pos)\n\t\t{\n\t\t\t// We found a [. It starts at $curr_pos.\n\t\t\t// check if it's a starting or ending list tag.\n\t\t\t$possible_ordered_start = substr($message, $curr_pos, $start_length[ordered]);\n\t\t\t$possible_unordered_start = substr($message, $curr_pos, $start_length[unordered]);\n\t\t\t$possible_end = substr($message, $curr_pos, 7);\n\t\t\tif (strcasecmp(\"[list]\", $possible_unordered_start) == 0)\n\t\t\t{\n\t\t\t\t// We have a starting unordered list tag.\n\t\t\t\t// Push its position on to the stack, and then keep going to the right.\n\t\t\t\tbbcode_array_push($stack, array($curr_pos, \"\"));\n\t\t\t\t++$curr_pos;\n\t\t\t}\n\t\t\telse if (preg_match(\"/\\[list=([a1])\\]/si\", $possible_ordered_start, $matches))\n\t\t\t{\n\t\t\t\t// We have a starting ordered list tag.\n\t\t\t\t// Push its position on to the stack, and the starting char onto the start\n\t\t\t\t// char stack, the keep going to the right.\n\t\t\t\tbbcode_array_push($stack, array($curr_pos, $matches[1]));\n\t\t\t\t++$curr_pos;\n\t\t\t}\n\t\t\telse if (strcasecmp(\"[/list]\", $possible_end) == 0)\n\t\t\t{\n\t\t\t\t// We have an ending list tag.\n\t\t\t\t// Check if we've already found a matching starting tag.\n\t\t\t\tif (sizeof($stack) > 0)\n\t\t\t\t{\n\t\t\t\t\t// There exists a starting tag.\n\t\t\t\t\t// We need to do 2 replacements now.\n\t\t\t\t\t$start = bbcode_array_pop($stack);\n\t\t\t\t\t$start_index = $start[0];\n\t\t\t\t\t$start_char = $start[1];\n\t\t\t\t\t$is_ordered = ($start_char != \"\");\n\t\t\t\t\t$start_tag_length = ($is_ordered) ? $start_length[ordered] : $start_length[unordered];\n\n\t\t\t\t\t// everything before the [list] tag.\n\t\t\t\t\t$before_start_tag = substr($message, 0, $start_index);\n\n\t\t\t\t\t// everything after the [list] tag, but before the [/list] tag.\n\t\t\t\t\t$between_tags = substr($message, $start_index + $start_tag_length, $curr_pos - $start_index - $start_tag_length);\n\t\t\t\t\t// Need to replace [*] with <LI> inside the list.\n\t\t\t\t\t$between_tags = str_replace(\"[*]\", \"<!-- BBCode --><LI>\", $between_tags);\n\n\t\t\t\t\t// everything after the [/list] tag.\n\t\t\t\t\t$after_end_tag = substr($message, $curr_pos + 7);\n\n\t\t\t\t\tif ($is_ordered)\n\t\t\t\t\t{\n\t\t\t\t\t\t$message = $before_start_tag . \"<!-- BBCode olist Start --><OL TYPE=\" . $start_char . \">\";\n\t\t\t\t\t\t$message .= $between_tags . \"</OL><!-- BBCode olist End -->\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$message = $before_start_tag . \"<!-- BBCode ulist Start --><UL>\";\n\t\t\t\t\t\t$message .= $between_tags . \"</UL><!-- BBCode ulist End -->\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$message .= $after_end_tag;\n\n\t\t\t\t\t// Now.. we've screwed up the indices by changing the length of the string.\n\t\t\t\t\t// So, if there's anything in the stack, we want to resume searching just after it.\n\t\t\t\t\t// otherwise, we go back to the start.\n\t\t\t\t\tif (sizeof($stack) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$a = bbcode_array_pop($stack);\n\t\t\t\t\t\t$curr_pos = $a[0];\n\t\t\t\t\t\tbbcode_array_push($stack, $a);\n\t\t\t\t\t\t++$curr_pos;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$curr_pos = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// No matching start tag found. Increment pos, keep going.\n\t\t\t\t\t++$curr_pos;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// No starting tag or ending tag.. Increment pos, keep looping.,\n\t\t\t\t++$curr_pos;\n\t\t\t}\n\t\t}\n\t} // while\n\n\treturn $message;\n\n}",
"static private function parseBrackets(&$expression, &$stack)\n {\n $tokens = array();\n if (preg_match('/^[[:space:]]*\\((.+)\\)(.*)$/', $expression, $tokens) == 1)\n {\n // We parse the expression inside the brackets separately.\n $subResult = self::doParse($tokens[1]);\n if ($subResult !== false)\n {\n $stack[] = $subResult;\n $expression = $tokens[2];\n return true;\n }\n else\n {\n return false;\n }\n\n\n }\n }",
"function getVarsList($content, $b_left=\"[\", $b_right=\"]\") {\n $b_left = preg_quote ($b_left);\n $b_right = preg_quote ($b_right);\n $patern = '/'.$b_left.'(.*)'.$b_right.'/siU';\n preg_match_all ( $patern , $content , $outdata);\n return array_unique($outdata[1]);\n}",
"function infixeList();",
"public function __construct($elements) {\n PapayaUtilConstraints::assertArrayOrTraversable($elements);\n $this->_list = $elements;\n }",
"function parse_list($tree) {return $this->simple_parse($tree, '<ul>', '</ul>', true, true, false);}",
"function listtag($text) {\r\n $lststyle = 'style=\"margin-top: 0px; margin-bottom: 0px;\"';\r\n\r\n if (preg_match_all('/\\[list=(.*)\\](.*)\\[\\/list\\]/siU', $text, $match)) {\r\n $return = preg_replace('/<br \\/>/', '', $match[0]);\r\n\r\n $text = str_replace($match[0], $return, $text);\r\n }\r\n \r\n $list_tags = array('/\\[list=1\\](.*)\\[\\/list\\](\\r\\n|)/siU', '/\\[list=2\\](.*)\\[\\/list\\](\\r\\n|)/siU',\r\n '/\\[list=3\\](.*)\\[\\/list\\](\\r\\n|)/siU', '/\\[\\*\\](.*)\\[\\/\\*\\]/isU');\r\n $list_html = array('<ol ' . $lststyle . '>\\\\1</ol>', '<ol ' . $lststyle . ' type=\"a\">\\\\1</ol>', \r\n '<ul ' . $lststyle . '>\\\\1</ul>', '<li>\\\\1</li>');\r\n\r\n $text = preg_replace($list_tags, $list_html, $text);\r\n $text = str_replace(\"</ul><br />\", '</ul>', $text);\r\n\r\n return $text;\r\n }",
"public function test_validate_array_defaultRegExp_valid()\n {\n $validator = new \\Gl3n\\HttpQueryStringFilterBundle\\Validator($this->_getParameterTypeChainMock('^[a-c]$'));\n $validator->validate(\n 'ids',\n ['type' => 'special', 'array' => true],\n ['a', 'b', 'c']\n );\n\n $this->boolean(true)->isTrue();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns count of 'end' list | public function getEndCount() {
return $this->count(self::END);
} | [
"public function endCount()\n {\n return (int)((($this->pagesize() - 1) * $this->current()) + $this->current());\n }",
"public function getHpEndCount()\r\n {\r\n return $this->count(self::_HP_END);\r\n }",
"public function get_list_count() { \n\t\t$this->db->select('id')\n\t\t\t\t ->where('hidden !=', '1')\n\t\t\t\t ->order_by('add_time ASC')\n\t\t\t\t ->limit($limit, $start);\n\t\t$query = $this->db->get('bw_items');\n\t\n\t\treturn $query->num_rows();\n\t}",
"public function zCount($key, $start, $end) { }",
"public function zCount($key, $start, $end) {}",
"public function getOppoDynaEndCount()\n {\n return $this->count(self::_OPPO_DYNA_END);\n }",
"public function get_total_person_counts_by_end_date($end_date)\n\n\t{\n\n\t\t$sql=\"SELECT COUNT( a.person_id ) AS total_person_count\n\n\t\t\t\tFROM (\t\n\n\n\n\t\t\t\tSELECT DISTINCT p_e.person_id\n\n\t\t\t\tFROM personevents p_e WHERE p_e.eventdatetime>= '\";\n\n\t\t$sql.=$end_date;\n\n\t\t$sql.=\"'\t) a\";\n\n\n\n\t\t$query=$this->db->query($sql);\n\n\n\n\t\tif($query->num_rows()==1)\n\n\t\t{\n\n\t\t\treturn $query->row();\n\n\t\t}\n\n\t\telse\n\n\t\t{\n\n\t\t\treturn false;\n\n\t\t}\n\n\t}",
"public function occurrences($end_date) {\n if($this->end_time && $this->end_time < $end_date) {\n $end_date = $this->end_time;\n }\n return $this->find_occurrences(function($head) use ($end_date) { \n return $head->upto($end_date);\n });\n }",
"public function get_total_event_counts_by_end_date($end_date)\n\n\t{\n\n\t\t$sql=\"\tSELECT COUNT( p_e.event_id ) AS total_event_count\n\n\t\t\t\tFROM personevents p_e WHERE p_e.eventdatetime <= '\";\n\n\t\t$sql.=$end_date;\n\n\t\t$sql.=\"'\";\n\n\t\t$query=$this->db->query($sql);\n\n\n\n\t\tif($query->num_rows()==1)\n\n\t\t{\n\n\t\t\treturn $query->row();\n\n\t\t}\n\n\t\telse\n\n\t\t{\n\n\t\t\treturn false;\n\n\t\t}\n\n\n\n\t}",
"public function getRangesEnd();",
"public function count()\n\t{\n\t\treturn \\count($this->list);\n\t}",
"public static function getAllForDateRangeCount(int $start, int $end): int\n {\n // return the number of items\n return (int) FrontendModel::getContainer()->get('database')->getVar(\n 'SELECT COUNT(i.id)\n FROM blog_posts AS i\n WHERE i.status = ? AND i.language = ? AND i.hidden = ? AND i.publish_on BETWEEN ? AND ?',\n [\n 'active',\n LANGUAGE,\n false,\n FrontendModel::getUTCDate('Y-m-d H:i:s', $start),\n FrontendModel::getUTCDate('Y-m-d H:i:s', $end),\n ]\n );\n }",
"function get_end_number() {\n\t\tglobal $wp_query;\n\n\t\t$end = $this->get_paged * $this->get_per_page;\n\n\t\tif ( $end > $this->total_items )\n\t\t\t$end = $this->total_items;\n\n\t\treturn $end;\n\t}",
"public function length()\n {\n return count($this->list);\n }",
"public function getSelfDynaEndCount()\r\n {\r\n return $this->count(self::_SELF_DYNA_END);\r\n }",
"public function getInnListCount()\n {\n return $this->count(self::INNLIST);\n }",
"public function count(): int\n {\n return count($this->list);\n }",
"public function length() {\n return count($this->listings);\n }",
"public function count()\n {\n return count($this->list);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Instance Methods / Saves a new or updated residence hall object | public function save()
{
$this->stamp();
$db = new PHPWS_DB('hms_residence_hall');
$result = $db->saveObject($this);
if (!$result || PHPWS_Error::logIfError($result)) {
throw new DatabaseException($result->toString());
}
return true;
} | [
"public function save(){\n\t\t$this->validateMainProperties();\n\t\tCompanyDAM::update($this);\n\t}",
"public function SaveHousehold() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->txtName) $this->objHousehold->Name = $this->txtName->Text;\n\t\t\t\tif ($this->lstHeadPerson) $this->objHousehold->HeadPersonId = $this->lstHeadPerson->SelectedValue;\n\t\t\t\tif ($this->chkCombinedStewardshipFlag) $this->objHousehold->CombinedStewardshipFlag = $this->chkCombinedStewardshipFlag->Checked;\n\t\t\t\tif ($this->txtMembers) $this->objHousehold->Members = $this->txtMembers->Text;\n\n\t\t\t\t// Update any UniqueReverseReferences (if any) for controls that have been created for it\n\n\t\t\t\t// Save the Household object\n\t\t\t\t$this->objHousehold->Save();\n\n\t\t\t\t// Finally, update any ManyToManyReferences (if any)\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}",
"public function updates_hall_with_valid_inputs()\n {\n //create hall\n $hallRes = $this->withHeaders(['Authorization'=> 'Bearer '.$this->userLogin()])->json('POST', 'api/halls', [\n 'hall_name' => 'beauty hall',\n 'price' => 100\n ]);\n\n $hall_id = $hallRes->decodeResponseJson()['data']['id'];\n\n // update hall\n $response = $this->withHeaders(['Authorization'=> 'Bearer '.$this->userLogin()])->json('PATCH', 'api/halls/'.$hall_id, [\n 'hall_name' => 'hall test',\n 'price' => 100\n ]);\n $response->assertStatus(201);\n }",
"public function save(){\n\n $this->validate();\n\n if ($this->shipping_price_id) {\n $shipping_price = ShippingCompanyPrice::find($this->shipping_price_id);\n } else {\n $shipping_price = new ShippingCompanyPrice();\n }\n $shipping_price->shipping_company_id = $this->shipping_company_id;\n $shipping_price->location_id = $this->location_id;\n $shipping_price->amount = $this->amount;\n $shipping_price->save();\n $this->clear();\n }",
"public function save()\n {\n if($this->id && $this->id != -1)\n {\n $this->update_target_grade();\n }\n else\n {\n $this->insert_target_grade();\n }\n }",
"public function save()\n\t{\n\t\t$adheId = $this->getVal('id', -1);\n\t\t// Enregistrer les donnees\n\t\t$where = 'adhe_id='.$adheId;\n\t\t$id = $this->update('adherents', 'adhe_', $this->getValues(), $where, '_asso');\n\n\t\t// Mise a jour de la relation adherent/users\n\t\tif ($adheId == -1)\n\t\t{\n\t\t\t$q = new Bn_query('u2a', '_asso');\n\t\t\t$q->setValue('u2a_userid', $this->getValue('userid', -1));\n\t\t\t$q->addValue('u2a_adherentid', $id);\n\t\t\t$q->setWhere('u2a_userid='.$this->getValue('userid', -1));\n\t\t\t$q->addRow();\n\t\t\tif ( $q->isError() )\n\t\t\t{\n\t\t\t\t$this->_error($q->getMsg());\n\t\t\t}\n\t\t}\n\t\tunset($q);\n\t\treturn;\n\t}",
"public function save() {\n if(!$this->id) {\n $this->create();\n } else {\n $this->update();\n }\n }",
"public function save() {\n $this->loadFields();\n $this->saveObject(__CLASS__);\n }",
"public function save(Reponsereply $reponsereply) {\n \n $reponsereplyData = array(\n 'rep_id' => $reponsereply->getReply()->getId(),\n 'reply_content' => $reponsereply->getContent(),\n 'reply_advert' => $reponsereply->getAdvert(),\n 'reply_user' => $reponsereply->getAuthor()\n );\n\n if ($reponsereply->getId()) {\n // The reponsereply has already been saved : update it\n $this->getDb()->update('reponsereply', $reponsereplyData, array('reply_id' => $reponsereply->getId()));\n } else {\n // The reponsereply has never been saved : insert it\n $this->getDb()->insert('reponsereply', $reponsereplyData);\n // Get the id of the newly created reponsereply and set it on the entity.\n $id = $this->getDb()->lastInsertId();\n $reponsereply->setId($id);\n }\n }",
"public function save(VendingLocation $vendingLocation);",
"function saveProperties()\n\t{\n\t\t$this->setProperties();\n\t\t$this->updated = $this->pg_obj->update();\n\t\tif ($this->updated === true)\n\t\t{\n\t\t\t$this->ctrl->redirect($this, \"edit\");\n\t\t\t//$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->pg_obj->addHierIDs();\n\t\t\t$this->edit();\n\t\t}\n\t}",
"public function save(){\n\n $this->validate();\n\n if ($this->shipping_id) {\n $shipping = ShippingCompany::find($this->shipping_id);\n } else {\n $shipping = new ShippingCompany();\n }\n $shipping->name = $this->name;\n $shipping->phone = $this->phone;\n $shipping->address = $this->address;\n $shipping->mobile = $this->mobile;\n $shipping->save();\n\n $this->clear();\n }",
"public function save() {\r\n $conn = GFSalsaConnector::instance();\r\n if ($conn) {\r\n $conn->saveObject($this->object, $this);\r\n }\r\n }",
"public function save(){\n\t\t$this->buildSaveDataPayload();\n\t\treturn $this->_save(array(\n\t\t\t'survey_id' => $this->survey_id,\n\t\t\t'id' => $this->exists() ? $this->id : ''\n\t\t));\n\t}",
"public function save() {\n if (!isset($this->id)) {\n $this->insert();\n } else {\n $this->update();\n }\n }",
"public function saveObjectState() {\n $this->objectState = base64_encode(serialize($this));\n $this->isNewRecord = false;\n $this->update();\n $this->reconstructCombatants();\n }",
"public function save(Vinyl $vinyl) {\n $vinylData = array(\n 'vinyl_title' => $vinyl->getTitle(),\n 'vinyl_artist' => $vinyl->getArtist(),\n 'vinyl_category' => $vinyl -> getCategory() -> getId(),\n 'vinyl_year' => $vinyl->getYear(),\n 'vinyl_price' => $vinyl->getPrice(),\n 'vinyl_sleeve' => $vinyl->getSleeve(),\n );\n if ($vinyl->getId()) {\n // The vinyl has already been saved : update it\n $this->getDb()->update('t_vinyl', $vinylData, array('vinyl_id' => $vinyl->getId()));\n } else {\n // The vinyl has never been saved : insert it\n $this->getDb()->insert('t_vinyl', $vinylData);\n // Get the id of the newly created article and set it on the entity.\n $id = $this->getDb()->lastInsertId();\n $vinyl->setId($id);\n }\n }",
"public function save () {\r\n \tglobal $dbw;\r\n \t$fields = array(\"spec_id\",\"post\",\"code\",\"hospital_id\");\r\n \treturn $dbw->update_from_object (\"core_doctors\",$fields,\"doctor_id = \".$this->doctor_id,$this);\r\n }",
"function markRentedResidence($iHouseId, $ifamilyId) {\n\n\t\t\t$this->db->where('house_id', $iHouseId);\n\t\t\t$this->db->where('family_id', $ifamilyId);\n\t\t\t$this->db->set('residence_type_id', 1); // 1 = rent\n\t\t\t$this->db->update('family_house_map');\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reactivate the current user. Set user active flag to 1 | public function reactivate()
{
$this->_CI->user_model->updateUser($this->getId(), array('active' => 1));
$this->_user->active = 1;
} | [
"public function activate() {\r\n\t\t$this->updateUser(array(\"is_activated\" => 1));\r\n\t}",
"public function deactivateUser(){\n\n\t\tglobal $db;\n\t\t\n\t\t$db->SQL = \"UPDATE ebb_users SET active='0' WHERE Username='\".$this->user.\"' LIMIT 1\";\n\t\t$db->query();\n\t}",
"public function reactivate() {\n\n $userid = $this->session->userdata('aileenuser');\n\n \n $data = array(\n 'status' => 1,\n 'modified_date' => date('y-m-d h:i:s')\n );\n\n $updatdata = $this->common->update_data($data, 'art_reg', 'user_id', $userid);\n if ($updatdata) {\n\n redirect('artistic/home', refresh);\n } else {\n\n redirect('artistic/reactivate', refresh);\n }\n }",
"public function reactivate() {\n\n $userid = $this->session->userdata('aileenuser');\n $data = array(\n 'status' => 1,\n 'modified_date' => date('y-m-d h:i:s')\n );\n\n $updatdata = $this->common->update_data($data, 'business_profile', 'user_id', $userid);\n if ($updatdata) {\n redirect('business-profile/home', refresh);\n } else {\n\n $this->load->view('business_profile/reactivate', $this->data);\n }\n }",
"public function activateUser()\n {\n $i = Input::except('_token');\n $user = \\User::find($i['id']);\n $user->user_active = $i['userActive'];\n $user->save();\n }",
"public function reactivate() {\n\n $userid = $this->session->userdata('aileenuser');\n $data = array(\n 'status' => 1,\n 'modified_date' => date('y-m-d h:i:s')\n );\n\n $updatdata = $this->common->update_data($data, 'art_reg', 'user_id', $userid);\n if ($updatdata) {\n\n redirect('artistic/art_post', refresh);\n } else {\n\n redirect('artistic/reactivate', refresh);\n }\n }",
"public function reactivateAccount()\n {\n Auth::user()->account_deleted = 0;\n Auth::user()->deleted_at = null;\n Auth::user()->save();\n return redirect('tours')->with('success', 'Account Reactivated Sucessfully!');\n }",
"public function reactivate(){\n\n if(isset($_REQUEST['oldemail'])){\n \n //store the email the user is attempting to send.\n $username = $_REQUEST['oldemail'];\n //check for a valid email.\n \n\n \n if(!filter_var($username, FILTER_VALIDATE_EMAIL)){\n\n $_SESSION['bademail'] = \"This is not a valid email. Please try again.\";\n\n }\n \n\n //get the userID for the email entered, for password checking and final steps.\n $userID = $this->userModel->getUserIdByEmail($username);\n //gets the salt for the current user.\n $userSalt = $this->userModel->getSalt($username);\n //hash and salt the password.\n $password = hash('sha512',$_REQUEST['oldpass'].$userSalt);\n \n if(empty($_REQUEST['oldpass']) || empty($_REQUEST['oldemail']))\n {\n $_SESSION['passerror'] = \"The password or email cannot be blank.\";\n\n }\n else if($this->userModel->checkPassword($userID,$password) != 1){\n $_SESSION['passerror'] = \"Incorrect password\";\n } \n else if($this->userModel->checkInactive($username, $password) == 1){\n\n $_SESSION['passerror'] = \"This account is already active.\";\n }\n else{\n //maybe not here?\n //something is not right in this method....\n $this->userModel->reactivateUser($userID);\n $_SESSION['accountSucc'] = \"Success! You have been reactivated!\";\n header(\"location: /home\");\n }\n }//end of isset if\n\n require APP . 'view/_templates/header.php';\n require APP . 'view/home/reactivate.php';\n require APP . 'view/_templates/footer.php';\n\n }",
"public function deactivate()\n {\n $this->checkCSRFForm();\n $user = $this->getUser();\n $this->checkCurrentUser($user);\n\n $this->userModel->update(array(\n 'id' => $user['id'],\n 'twofactor_activated' => 0,\n 'twofactor_secret' => '',\n ));\n\n // Allow the user to test or disable the feature\n $this->userSession->disablePostAuthentication();\n\n $this->flash->success(t('User updated successfully.'));\n $this->response->redirect($this->helper->url->to('TwoFactorController', 'index', array('user_id' => $user['id'])), true);\n }",
"function deActivateAccount(){\n\t\t$userID = Auth::getUserID();\n\t\t$this->setStatus($userID,0);\n\t\t$this->logout();\n\t\t$this->send(true);\t\n\t}",
"public function deactivateaccount() {\r\n try {\r\n // grab the current logged in user\r\n $sessVar = $this->Auth->user();\r\n\r\n // create a data object with the user's info\r\n $data = array('User' => array('id' => $sessVar['id'], 'username' => $sessVar['username'], 'deactive' => 1));\r\n\r\n Configure::write('debug', 0);\r\n $this->autoRender = false;\r\n $this->layout = null;\r\n\r\n // update the user's profile in the db\r\n if ($this->User->save($data)) {\r\n $this->Auth->logout();\r\n echo \"true\";\r\n exit;\r\n } else {\r\n echo \"There was an issue deactivating your account. Please try again, or contact help@theulink.com\";\r\n exit;\r\n }\r\n } catch (Exception $e) {\r\n $this->log(\"{UsersController#deactivateaccount} - An exception was thrown: \" . $e->getMessage());\r\n echo \"There was an issue deactivating your account. Please try again, or contact help@theulink.com\";\r\n exit;\r\n }\r\n }",
"public function reactivate() {\r\n if ( !isset( $_GET['aid'] ) )\r\n return new RedirectResponse( '/accounts/' );\r\n\r\n $account = new Account();\r\n $account->get( $_GET['aid'] );\r\n\r\n if ( $account->id ) {\r\n $account->status = Account::STATUS_ACTIVE;\r\n $account->save();\r\n\r\n // Clear CloudFlare Cache\r\n $cloudflare_zone_id = $account->get_settings('cloudflare-zone-id');\r\n\r\n if ( $cloudflare_zone_id ) {\r\n library('cloudflare-api');\r\n $cloudflare = new CloudFlareAPI( $account );\r\n $cloudflare->purge( $cloudflare_zone_id );\r\n }\r\n }\r\n\r\n $this->notify( _(\"Account reactivated\") );\r\n\r\n return new RedirectResponse( \"/accounts/actions/?aid={$_GET['aid']}\" );\r\n }",
"function activateUser()\n {\n // Sets the value of activated to yes\n $int = 1;\n\n $mysqli = $this->conn;\n\n /* Prepared statement, stage 1: prepare */\n if (!($stmt = $mysqli->prepare(\"UPDATE User SET \n \t\tactiveUser = ?\n \t\t\tWHERE ID = ?\"))\n ) {\n echo \"Prepare failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\n }\n\n /* Prepared statement, stage 2: bind and execute */\n\n if (!($stmt->bind_param(\"ii\",\n $int,\n $this->id))\n ) {\n echo \"Binding parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\n }\n\n if (!$stmt->execute()) {\n echo \"Execute failed: (\" . $stmt->errno . \") \" . $stmt->error;\n }\n\n }",
"public function reactivateAction()\n\t{\n\t\t$request = $this->getRequest();\n\t\t$token = $request->getParam('account', NULL);\n\t\tif (is_null($token)) {\n\t\t\t$request->setModuleName('default');\n\t\t\t$request->setControllerName('error');\n\t\t\t$request->setActionName('error404');\n\t\t\t$request->setDispatched(false);\n\t\t} elseif(!preg_match('/^[a-f0-9]{72}$/', $token)) {\n\t\t\t$request->setModuleName('default');\n\t\t\t$request->setControllerName('error');\n\t\t\t$request->setActionName('error404');\n\t\t\t$request->setDispatched(false);\n\t\t}\n\t\t\n\t\t// Everything looks fine...\n\t\t// Reactivate the account.\n\t\t$reactivation = new CoreFramework_Db_Table_Security_AccountReactivation();\n\t\t$userId = $reactivation->getUserIdentifier($token);\n\t\t\n\t\tif ($userId <= 0) {\n\t\t\t$request->setModuleName('default');\n\t\t\t$request->setControllerName('error');\n\t\t\t$request->setActionName('error404');\n\t\t\t$request->setDispatched(false);\n\t\t}\n\t\t\n\t\t$users = new CoreFramework_Db_Table_Users();\n\t\tif ($users->activateAccount($userId)) {\n\t\t\t$reactivation->removeToken($token);\n\t\t\t// Remove bad logins for this user aswell\n\t\t\t$bad_logins = new CoreFramework_Db_Table_Security_BadLogins();\n\t\t\t$bad_logins->resetUser($userId);\n\t\t}\n\t\t\n\t\t// Go to login page\n\t\t$request->setModuleName('default');\n\t\t$request->setControllerName('auth');\n\t\t$request->setActionName('login');\n\t\t$request->setDispatched(false);\n\t}",
"public function activateUserProfile()\n {\n $this->attivo = self::STATUS_ACTIVE;\n $ok = $this->save(false);\n if ($ok) {\n $this->user->status = User::STATUS_ACTIVE;\n $ok = $this->user->save(false);\n }\n return $ok;\n }",
"public function deactivate()\n\t{\n\t\t$data = array(\n\t\t\t'active' => 0\n\t\t);\n\t\t$this->db->where('id', $this->input->post('id'));\n\t\t$this->db->update('users', $data);\n\t}",
"public function reactivateUser($userId)\n {\n return $this->start()->uri(\"/api/user\")\n ->urlSegment($userId)\n ->urlParameter(\"reactivate\", true)\n ->put()\n ->go();\n }",
"public function ReactivateCustomerAccount()\n {\n \n # CHECK IF RECORD IS DEACTIVATED\n # ================================================\n $inactive = $this->CheckIfCustomerAccountActive();\n \n \n if ($inactive) {\n \n # DEACTIVATE contacts\n # ================================================\n $result = $this->SQL->UpdateRecord(array(\n 'table' => 'contacts',\n 'key_values' => \"`active`=1\",\n 'where' => \"`wh_id`=$this->wh_id AND `active`=0\",\n ));\n if ($this->Show_Query) echo '<br /><br />' . $this->SQL->Db_Last_Query;\n \n \n # DEACTIVATE contacts_account\n # ================================================\n $result = $this->SQL->UpdateRecord(array(\n 'table' => 'contacts_account',\n 'key_values' => \"`active`=1\",\n 'where' => \"`wh_id`=$this->wh_id AND `active`=0\",\n ));\n if ($this->Show_Query) echo '<br /><br />' . $this->SQL->Db_Last_Query;\n \n \n # DEACTIVATE contacts_billing_storage\n # ================================================\n $result = $this->SQL->UpdateRecord(array(\n 'table' => 'contacts_billing_storage',\n 'key_values' => \"`active`=1\",\n 'where' => \"`wh_id`=$this->wh_id AND `active`=0\",\n ));\n if ($this->Show_Query) echo '<br /><br />' . $this->SQL->Db_Last_Query;\n \n \n # DEACTIVATE customer_profile\n # ================================================\n $result = $this->SQL->UpdateRecord(array(\n 'table' => 'customer_profile',\n 'key_values' => \"`active`=1\",\n 'where' => \"`wh_id`=$this->wh_id AND `active`=0\",\n ));\n if ($this->Show_Query) echo '<br /><br />' . $this->SQL->Db_Last_Query;\n \n } else {\n echo \"<br /><div style='width:400px;'><h1 style='color:#990000'>USER IS CURRENTLY ACTIVE - UNABLE TO DE-ACTIVATE</h1></div>\";\n $result = false;\n }\n \n return $result;\n }",
"function reactivateAllAccounts(){\n\t\t$user_collection = new Doctrine_Collection(Doctrine_Core::getTable(\"UserAccount\"));\n\t\t$users = $this->getUsers(); //debugMessage($users->toArray());\n\t\tif($users->count() > 0){\n\t\t\tforeach ($users as $user){\n\t\t\t\tif($user->isUserInActive() && $user->getActivationKey() == md5($this->getCompanyID())){\n\t\t\t\t\t$user->setStatus(1);\n\t\t\t\t\t$user->setActivationKey('');\n\t\t\t\t\t$user_collection->add($user);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// debugMessage($user_collection->toArray());\n\t\t}\n\t\tif($user_collection->count() > 0){\n\t\t\ttry {\n\t\t\t\t$user_collection->save();\n\t\t\t} catch (Exception $e) {\n\t\t\t\tdebugMessage(\"An error occured in updating status. \".$e->getMessage());\n\t\t\t}\n\t\t}\n\t\n\t\treturn true;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
grab the url, or prev and next url and pull ws.size from it | protected function _updatePageSize() {
$url = $this->url;
if (array_key_exists('next_collection_link', $this->data)) {
$url = $this->data['next_collection_link'];
} elseif (array_key_exists('prev_collection_link', $this->data)) {
$url = $this->data['prev_collection_link'];
}
# scan querystring for ws_size
$url_parts = parse_url($url);
# we have a query string
if (array_key_exists('query', $url_parts)) {
parse_str($url_parts['query'], $params);
# we have a ws_size
if (array_key_exists('ws_size', $params)) {
# set pageSize
$this->pageSize = $params['ws_size'];
return;
}
}
# we dont have one, just count the # of entries
$this->pageSize = count($this->data['entries']);
} | [
"private function retrieve_remote_file_size($url){\n\t\t$ch = curl_init($url);\n \n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_NOBODY, TRUE);\n \n\t\t$data = curl_exec($ch);\n\t\t$size = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD);\n \n\t\tcurl_close($ch);\n\t\treturn $size;\n }",
"function getFileSize($url) {\n $headers = get_headers($url, 1);\n $c = curl_init();\n curl_setopt_array($c, array(\n CURLOPT_URL => $url,\n CURLOPT_RETURNTRANSFER => true\n ));\n curl_exec($c);\n $size = curl_getinfo($c, CURLINFO_SIZE_DOWNLOAD);\n return $size;\n curl_close($c);\n }",
"function get_page_count($url) {\n $page_count = 1;\n\n // Get the headers, so we can parse out the \"link\" section containing the final page number.\n $paginated_url = $url . '?page=1&per_page=' . RESULTS_PER_PAGE;\n $context = stream_context_create(array('http' => array('method' => 'GET',\n 'header' => 'User-Agent: BenFenner')));\n $headers = get_headers($paginated_url, 1, $context);\n\n if (string_useful($headers['link'])) {\n // There is useful \"link\" header data, so determine the page count from it.\n\n // The link variable below will contain a string that looks something like this:\n // <https://api.github.com/organizations/1214096/repos?page=2&per_page=30>; rel=\"next\", <https://api.github.com/organizations/1214096/repos?page=2&per_page=30>; rel=\"last\"\n //\n // We are only interested in the page listed as the last, so use a bit of string manipulation to get it.\n // TODO: There are probably better/cleaner ways to accomplish this, so look into improvements.\n $link = $headers['link'];\n\n $begin_phrase = '&per_page=' . RESULTS_PER_PAGE . '>; rel=\"next\", <';\n $end_phrase = '&per_page=' . RESULTS_PER_PAGE . '>; rel=\"last\"';\n $begin_index = strpos($link, $begin_phrase) + strlen($begin_phrase);\n $end_index = strrpos($link, $end_phrase);\n $length = $end_index - $begin_index;\n\n // The finale_page_url variable below should contain a string that looks something like this:\n // https://api.github.com/organizations/1214096/repos?page=2\n $final_page_number_url = substr($link, $begin_index, $length);\n\n $phrase = '?page=';\n $index = strrpos($final_page_number_url, $phrase) + strlen($phrase);\n\n $page_count = substr($final_page_number_url, $index);\n }\n\n return $page_count;\n }",
"public function get_remote_file_size() { \n\n $ch = curl_init();\n curl_setopt_array($ch, array(\n CURLOPT_URL => $this->url,\n CURLOPT_RETURNTRANSFER => true\n ));\n curl_exec($ch);\n\n $size = curl_getinfo($ch, CURLINFO_SIZE_DOWNLOAD);\n\n return $size;\n \n curl_close($c);\n\n }",
"public function urlCount(){\n return count($this->getUrlFromText());\n }",
"function getPageNumber()\n\t{\n\t\t$url = null;\n\t\t$url = isset($_GET['url']) ? $_GET['url'] : null;\n\t\t$url = rtrim($url, '/');\n\t\t$url = explode(\"/\", $url);\n\t\t$pageInfo = array();\n\t\t\n\t\tif (!isset($url[2])) {\n\t\t\tarray_push($pageInfo, 1);\n\t\t\t$previous = 0;\n\t\t\t$next = 2;\n\t\t\tarray_push($pageInfo, $previous);\n\t\t\tarray_push($pageInfo, $next);\n\t\t}else{\n\t\t\t$previous = intval($url[2]) -1;\n\t\t\t$next = intval($url[2]) +1;\n\t\t\tarray_push($pageInfo, $url[2]);\n\t\t\tarray_push($pageInfo, $previous);\n\t\t\tarray_push($pageInfo, $next);\n\t\t}\n\t\t\n\n\n\t\treturn $pageInfo;\n\t}",
"public function get_size($url){\r\n $url = 'http://'.$url.'/robots.txt';\r\n $parse = parse_url($url);\r\n $host = $parse['host'];\r\n $fp = @fsockopen ($host, 80, $errno, $errstr, 20);\r\n if(!$fp){\r\n $ret = 0;\r\n }else{\r\n $host = $parse['host'];\r\n fputs($fp, \"HEAD \".$url.\" HTTP/1.1\\r\\n\");\r\n fputs($fp, \"HOST: \".$host.\"\\r\\n\");\r\n fputs($fp, \"Connection: close\\r\\n\\r\\n\");\r\n $headers = \"\";\r\n while (!feof($fp)){\r\n $headers .= fgets ($fp, 128);\r\n }\r\n fclose ($fp);\r\n $headers = strtolower($headers);\r\n $array = preg_split(\"|[\\s,]+|\",$headers);\r\n $key = array_search('content-length:',$array);\r\n $ret = $array[$key+1];\r\n }\r\n if($array[1]==200) return $ret;\r\n $filesize = -1*$array[1];\r\n\r\n if($filesize < 32768){\r\n return 'OK';\r\n }else{\r\n return 'ОШИБКА';\r\n }\r\n }",
"function remote_file_size ($url){\r\n $head = \"\";\r\n $url_p = parse_url($url);\r\n $host = $url_p[\"host\"];\r\n if(!preg_match(\"/[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*/\",$host)){\r\n // a domain name was given, not an IP\r\n $ip=gethostbyname($host);\r\n if(!preg_match(\"/[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*/\",$ip)){\r\n //domain could not be resolved\r\n return -1;\r\n }\r\n }\r\n $port = intval($url_p[\"port\"]);\r\n if(!$port) $port=80;\r\n $path = $url_p[\"path\"];\r\n //echo \"Getting \" . $host . \":\" . $port . $path . \" ...\";\r\n\r\n $fp = fsockopen($host, $port, $errno, $errstr, 20);\r\n if(!$fp) {\r\n return false;\r\n } else {\r\n fputs($fp, \"HEAD \" . $url . \" HTTP/1.1\\r\\n\");\r\n fputs($fp, \"HOST: \" . $host . \"\\r\\n\");\r\n fputs($fp, \"User-Agent: http://www.example.com/my_application\\r\\n\");\r\n fputs($fp, \"Connection: close\\r\\n\\r\\n\");\r\n $headers = \"\";\r\n while (!feof($fp)) {\r\n $headers .= fgets ($fp, 128);\r\n }\r\n }\r\n fclose ($fp);\r\n //echo $errno .\": \" . $errstr . \"<br />\";\r\n $return = -2;\r\n $arr_headers = explode(\"\\n\", $headers);\r\n // echo \"HTTP headers for <a href='\" . $url . \"'>...\" . substr($url,strlen($url)-20). \"</a>:\";\r\n // echo \"<div class='http_headers'>\";\r\n foreach($arr_headers as $header) {\r\n // if (trim($header)) echo trim($header) . \"<br />\";\r\n $s1 = \"HTTP/1.1\";\r\n $s2 = \"Content-Length: \";\r\n $s3 = \"Location: \";\r\n if(substr(strtolower ($header), 0, strlen($s1)) == strtolower($s1)) $status = substr($header, strlen($s1));\r\n if(substr(strtolower ($header), 0, strlen($s2)) == strtolower($s2)) $size = substr($header, strlen($s2));\r\n if(substr(strtolower ($header), 0, strlen($s3)) == strtolower($s3)) $newurl = substr($header, strlen($s3));\r\n }\r\n // echo \"</div>\";\r\n if(intval($size) > 0) {\r\n $return=intval($size);\r\n } else {\r\n $return=$status;\r\n }\r\n // echo intval($status) .\": [\" . $newurl . \"]<br />\";\r\n if (intval($status)==302 && strlen($newurl) > 0) {\r\n // 302 redirect: get HTTP HEAD of new URL\r\n $return=remote_file_size($newurl);\r\n }\r\n return $return;\r\n}",
"public function getNextUrls();",
"public static function getLength()\r\n {\r\n \t$instance = self::getInstance();\r\n \treturn count($instance->uri); \r\n }",
"public function count(){\n\t\treturn count( $this->urls );\n\t}",
"function GetLinkCount($url)\n\t{\n\t\treturn $this->GetLinks($url,1)->estimatedTotalResultsCount;\n\t}",
"public function linkSize() { return $this->_m_linkSize; }",
"function get_bytes_downloaded()\n {\n if (!@$this->_is_valid_handle())\n {\n return FALSE;\n }\n $ret = @curl_getinfo($this->handle_id, CURLINFO_SIZE_DOWNLOAD);\n $this->_check_error();\n return $ret;\n }",
"public function getNextPageUrl();",
"public function pushCountWebsites();",
"function gridSize($tablename,$condition=\"\"){\n\t\t$output = array();\n\t\t$this_page = \"\";\n\t\t//parse_str($_SERVER['QUERY_STRING'], $url);\n\t\t$url = $_GET;\n\t\t// number of rows to show per page\n\t\t$rowsperpage = $this -> setting('rows_per_page');\n\t\t$rowsperpage = ((int)$rowsperpage > 0) ? (int)$rowsperpage : 10;\n\t\t// range of num links to show\n\t\t$range = 4;\n\t\t//add where to the condition if a condition has been set\n\t\tif(!empty($condition)) $condition = (stripos($condition,\"WHERE \") === false) ? \"WHERE $condition\" : $condition;\n\t\t$countsql = \"select count(*) as cnt from $tablename $condition\";\n\t\t$numrows = $this -> dbrow($countsql);\n\t\t$numrows = $numrows['cnt'];\n\t\t// find out total pages\n\t\t$totalpages = $this->mceil($numrows / $rowsperpage);\n\t\t\n\t\t// get the current page or set a default\n\t\t$currentpage = @$_GET['currentpage'];\n\t\t$currentpage = ((int)$currentpage > 0) ? (int) $_GET['currentpage'] : 1 ;\n\t\t\n\t\t// if current page is greater than total pages...\n\t\t$currentpage = ($currentpage > $totalpages) ? $totalpages : $currentpage;\n\t\t\n\t\t// if current page is less than first page...\n\t\t$currentpage = ($currentpage < 1) ? 1 : $currentpage;\n\t\t// the offset of the list, based on current page \n\t\t$offset = ($currentpage - 1) * $rowsperpage;\n\t\t$output['start'] = $offset+1;\n\t\t$output['size'] = $rowsperpage;\t\n\t\t$output['total'] = $numrows;\t\t\t\n\t\t$output['size'] = (($output['start']+$output['size'])>$output['total'])? ($output['total'] - $output['start']) + 1:$output['size'] ;\n\t\t/****** build the pagination links ******/\t\n\t\t// if not on page 1, don't show back links\n\t\t$pagination = \"\";\n\t\tif ($currentpage > 1) {\n\t\t // show << link to go back to page 1\n\t\t\t$url['currentpage'] = 1;//$currentpage;\n\t\t $pagination .= \" <a href='\".$this->makeSefUrl($this_page.\"?\".http_build_query($url)).\"'>[first]</a> \";\n\t\t // get previous page num\n\t\t $prevpage = $currentpage - 1;\n\t\t // show < link to go back to 1 page\n\t\t\t$url['currentpage'] = $prevpage;\n\t\t $pagination .= \" <a href='\".$this->makeSefUrl($this_page.\"?\".http_build_query($url)).\"'>[prev]</a> \";\n\t\t} // end if \n\t\t\n\t\t// loop to show links to range of pages around current page\n\t\tfor ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) {\n\t\t // if it's a valid page number...\n\t\t if (($x > 0) && ($x <= $totalpages)) {\n\t\t\t // if we're on current page...\n\t\t\t$url['currentpage'] = $x;\n\t\t\t $pagination .= ($x == $currentpage) ? \" [<b>$x</b>] \" : \" <a href='\".$this->makeSefUrl($this_page.\"?\".http_build_query($url)).\"'>$x</a> \";\n\t\t } // end if \n\t\t} // end for\n\t\t\t\t\t\t \n\t\t// if not on last page, show forward and last page links \n\t\tif ($currentpage != $totalpages) {\n\t\t // get next page\n\t\t $nextpage = $currentpage + 1;\n\t\t\t// echo forward link for next page \n\t\t\t$url['currentpage'] = $nextpage;\n\t\t $pagination .= \" <a href='\".$this->makeSefUrl($this_page.\"?\".http_build_query($url)).\"'>[Next]</a> \";\n\t\t // echo forward link for lastpage\n\t\t\t$url['currentpage'] = $totalpages;\n\t\t $pagination .= \" <a href='\".$this->makeSefUrl($this_page.\"?\".http_build_query($url)).\"'>[Last]</a> \";\n\t\t} // end if\n\t\t/****** end build pagination links ******/\n\t\t$output['links'] = $pagination;\n\t\treturn $output;\n\t}",
"protected function getLastPreviewRequestTransferSize() {\n $javascript = <<<JS\n(function(){\n return window.performance\n .getEntries()\n .filter(function (entry) {\n return entry.initiatorType == 'fetch' && entry.name.indexOf('/media/test_format/preview') !== -1;\n })\n .pop()\n .transferSize;\n})()\nJS;\n return $this->getSession()->evaluateScript($javascript);\n }",
"public function get_image_size_by_url( $url ) {\n\t\t$url = ! empty( $url ) ? esc_url( $url ) : '';\n\t\t$size = array( 0, 0 );\n\n\t\tif ( ! empty( $url ) ) {\n\t\t\t// get cached data\n\t\t\t$image_sizes = get_transient( 'rl-image_sizes_by_url' );\n\n\t\t\t// cached url not found?\n\t\t\tif ( $image_sizes === false || ! in_array( $url, array_keys( $image_sizes ) ) || empty( $image_sizes[$url] ) ) {\n\t\t\t\tif ( class_exists( 'Responsive_Lightbox_Fast_Image' ) ) {\n\t\t\t\t\t// loading image\n\t\t\t\t\t$image = new Responsive_Lightbox_Fast_Image( $url );\n\n\t\t\t\t\t// get size\n\t\t\t\t\t$size = $image->get_size();\n\t\t\t\t} else {\n\t\t\t\t\t// get size using php\n\t\t\t\t\t$size = getimagesize( $url );\n\t\t\t\t}\n\n\t\t\t\t// set the cache expiration, 24 hours by default\n\t\t\t\t$expire = absint( apply_filters( 'rl_object_cache_expire', DAY_IN_SECONDS ) );\n\n\t\t\t\t$image_sizes[$url] = $size;\n\n\t\t\t\tset_transient( 'rl-image_sizes_by_url', $image_sizes, $expire );\n\t\t\t// cached url found\n\t\t\t} elseif ( ! empty( $image_sizes[$url] ) )\n\t\t\t\t$size = array_map( 'absint', $image_sizes[$url] );\n\t\t}\n\n\t\treturn apply_filters( 'rl_get_image_size_by_url', $size, $url );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
NowPlaying Synchronization The most frequent sync process, which must be optimized for speed, as it runs approx. every 15 seconds. | public function syncNowplaying($force = false)
{
$this->_initSync(10);
// Prevent nowplaying from running on top of itself.
$last_start = $this->settings->getSetting('nowplaying_last_started', 0);
$last_end = $this->settings->getSetting('nowplaying_last_run', 0);
if ($last_start > $last_end && $last_start >= (time() - 10) && !$force) {
return;
}
$this->settings->setSetting('nowplaying_last_started', time());
$task = new Sync\NowPlaying($this->di);
Debug::runTimer('Run NowPlaying update', function () use ($task) {
$task->run();
});
$this->settings->setSetting('nowplaying_last_run', time());
} | [
"public function synchronizer();",
"public function sync();",
"public function synchronize() {\n\n\n\n\n\t}",
"public function afterSyncing() {}",
"public function isSyncing();",
"public function beforeSyncing() {}",
"public function pSync()\n\t{\n\t\treturn [ [true], [false] ];\n\t}",
"public function check_sync()\n {\n }",
"public function syncNext(): array;",
"public function setSyncTime(): void\n {\n }",
"protected static function schedule_sync() {\n\t\t$start_time = mktime( 0, 0, 0, date( 'n' ), date( 'j' ) + 1 );\n\t\twp_schedule_event( $start_time, 'daily', 'wc_rs_sync' );\n\t}",
"public function supportsForceSync()\n {\n return false;\n }",
"public function run_sync_process(){\n //Verify if module is enabled\n if(Mage::helper('connector')->isEnabled()) {\n\n \t//Set sync type\n \t\t$sync_type = Minematic_Connector_Model_Config::SYNC_TYPE_MAGENTO_SIDE;\n\n //Log Starting sync process msg\n Mage::helper('connector')->logSyncProcess(\"Starting synchronization task job...\", $sync_type);\n\n try {\n\n //Sync all data\n Mage::getModel('connector/synchronization')->sync_data($sync_type, Minematic_Connector_Model_Config::DATA_TYPE_ALL);\n\n } catch (Exception $e) {\n\n \t// Logging Exceptions\n Mage::helper('connector')->logSyncProcess($e->getMessage(), $sync_type, \"ERROR\");\n \t\n }\n\n //Log Finishing sync process msg\n Mage::helper('connector')->logSyncProcess(\"Finishing synchronization task job.\", $sync_type);\n }\n }",
"function show_now_playing() { \n\t\n\tStream::gc_session(); \n\tStream::gc_now_playing(); \n\n\t$web_path = Config::get('web_path'); \n\t$results = Stream::get_now_playing(); \n\trequire_once Config::get('prefix') . '/templates/show_now_playing.inc.php'; \n\n}",
"protected function syncAll()\n {\n $this->info('Koel syncing started.'.PHP_EOL);\n\n // Get the tags to sync.\n // Notice that this is only meaningful for existing records.\n // New records will have every applicable field sync'ed in.\n $tags = $this->option('tags') ? explode(',', $this->option('tags')) : [];\n\n Media::sync(null, $tags, $this->option('force'), $this);\n\n $this->output->writeln(\n PHP_EOL.PHP_EOL\n .\"<info>Completed! {$this->synced} new or updated song(s)</info>, \"\n .\"{$this->ignored} unchanged song(s), \"\n .\"and <comment>{$this->invalid} invalid file(s)</comment>.\"\n );\n }",
"public function testSync()\n {\n }",
"static function do_initial_sync() {\n\t\tif ( ! self::sync_allowed() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$initial_sync_config = array(\n\t\t\t'options' => true,\n\t\t\t'functions' => true,\n\t\t\t'constants' => true,\n\t\t\t'users' => array( get_current_user_id() ),\n\t\t);\n\n\t\tif ( is_multisite() ) {\n\t\t\t$initial_sync_config['network_options'] = true;\n\t\t}\n\n\t\tself::do_full_sync( $initial_sync_config );\n\t}",
"public function synchronizeVideoAction() {\n set_time_limit(0);\n ini_set(\"max_execution_time\", \"300\");\n ini_set(\"memory_limit\", \"256M\");\n //GET NAVIGATION\n $this->view->navigation = $navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('sitevideo_admin_main', array(), 'sitevideo_admin_main_synchronize');\n $this->view->videoCount = Engine_Api::_()->getDbtable('videos', 'sitevideo')->getVideosCount(array('synchronized' => 0));\n $this->view->otherVideoCount = Engine_Api::_()->getDbtable('videos', 'sitevideo')->getVideosCount(array('synchronized' => 0, 'type' => array( 'dailymotion', 'vimeo', 'youtube', 'iframely')));\n $this->view->mycomputerVideoCount = Engine_Api::_()->getDbtable('videos', 'sitevideo')->getVideosCount(array('synchronized' => 0, 'type' => array( 'upload', 'mydevice' )));\n $this->view->ffmpeg_path = Engine_Api::_()->getApi('settings', 'core')->sitevideo_ffmpeg_path;\n $start = $this->_getParam('start', 0);\n $this->view->autoSink = $this->_getParam('autoSink', 0);\n //1 for completed\n $this->view->status = $this->_getParam('status', 0);\n if ($start) {\n $nonSynchronizedVideos = Engine_Api::_()->getDbtable('videos', 'sitevideo')->getVideos(array('synchronized' => 0, 'selectLimit' => 10, 'custom_order' => array('type', 1, 2, 4, 3)));\n foreach ($nonSynchronizedVideos as $video) {\n\n if (!$video->checkType('upload')) {\n $thumbnailUrl = $this->handleThumbnail($video->type, $video->code);\n $video->saveVideoThumbnail($thumbnailUrl);\n $video->synchronized = 1;\n } else if ($video->checkType('upload') && !empty($this->view->ffmpeg_path)) {\n $this->generateMycomputerThumbnail($video);\n $video->synchronized = 1;\n }\n\n $video->save();\n }\n $videoCount = Engine_Api::_()->getDbtable('videos', 'sitevideo')->getVideosCount(array('synchronized' => 0));\n if ($videoCount > 0 && ($this->view->otherVideoCount > 0 || ($this->view->mycomputerVideoCount > 0 && !empty($this->view->ffmpeg_path)))) {\n $this->_redirect(\"admin/sitevideo/settings/synchronize-video?autoSink=1\");\n } else {\n if ($this->view->mycomputerVideoCount > 0 && empty($this->view->ffmpeg_path))\n $this->_redirect(\"admin/sitevideo/settings/synchronize-video?status=2\");\n else\n $this->_redirect(\"admin/sitevideo/settings/synchronize-video?status=1\");\n }\n }\n }",
"function syncPlaylists()\n{\n global $settings, $fppHome, $fppMode;\n $dir = \"playlists\";\n\n //if the fpp mode is master\n if (strtolower($fppMode) == \"master\") {\n if (isset($settings['MultiSyncRemotes']) && !empty($settings['MultiSyncRemotes'])) {\n $remotes = explode(',', $settings['MultiSyncRemotes']);\n //if we have remotes\n if (!empty($remotes)) {\n foreach ($remotes as $remote_id => $remote_ip) {\n $command = \"rsync -av --stats $fppHome/media/$dir/ $remote_ip::media/$dir/ 2>&1\";\n $command_result = exec($command);\n logEntry(\"syncPlaylists: Attempt Sync Playlists to (\" . $remote_ip . \") -- Result: \" . $command_result);\n }\n }\n }\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of apellido_titular | public function getApellido_titular()
{
return $this->apellido_titular;
} | [
"function getTitulo() {\n // mistura os arrays somente do bloco 1\n shuffle($this->bloco[1]);\n return ucfirst($this->bloco[1][0]); // deixa a primeira letra da string maiúscula\n }",
"public function getTarjTitular()\n {\n return $this->tarj_titular;\n }",
"function agenda_item_titel(){\n\t\t$return = '';\n\t\tif($this->agenda_item !== false){\n\t\t\t$return = $this->agenda_item['titel'];\n\t\t} else {\n\t\t\t$return = 'Agendaitem niet gevonden';\n\t\t}\n\t\treturn $return;\n\t}",
"public function getTitularTarje()\n {\n return $this->titularTarje;\n }",
"public function getTitile()\n {\n return $this->titile;\n }",
"public function getTitulo()\n\t{\n\n\t\treturn $this->titulo;\n\t}",
"public function getTitulo()\n\t{\n\t\treturn $this->titulo;\n\t}",
"public function getApellido()\n {\n return $this->Apellido;\n }",
"public function getTitulo()\n {\n return $this->Titulo;\n }",
"public function getTitulo() {\n return $this->titulo;\n }",
"public function getTitulo()\n {\n return $this->titulo;\n }",
"public function get_titulo()\n {\n return $this->_titulo;\n }",
"public function getApellido()\r\n\t{\r\n\t\treturn $this->apellido;\r\n\t}",
"public function getTarjtitular()\n {\n return $this->tarjtitular;\n }",
"function getApellidoP() {\r\n return $this->ApellidoP;\r\n }",
"private function getPerTitol(){\n $result = $this->llibreGateway->buscarPerTitol();\n \n return $this->crearResposta('200 OK', $result);\n }",
"public function getApellido()\n {\n return $this->apellido;\n }",
"public function getApellido()\n\t{\n\t\treturn $this->apellido;\n\t}",
"public function getTitresujet()\r\n {\r\n return $this->titresujet;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets all a user's csv metadata files which haven't been added to a zip archive. | public function getCsvFiles($user_id) {
$csv_files = Yii::app()->db->createCommand()
->select('id, path')
->from('csv_meta_paths')
->where(':user_id = user_id and :zipped = zipped',
array(':user_id' => $user_id, ':zipped' => 0))
->queryAll();
return $csv_files;
} | [
"public function csv_get_files(){\n\t\tif ($this->csv_files === null ){\n\t\t\t\n\t\t\t$handle = dir(CSV_IMPORT);\n\t\t\twhile (false !== ($file_name = $handle->read())) {\n\t\t\t\t\t\n\t\t\t\tif (strtolower(substr($file_name, -4) ) == \".csv\") {\n\t\t\t\t\t$key = substr(strtolower($file_name), 0,strlen($file_name)-4 );\n\t\t\t\t\t$this->csv_files[$key] = $key.'.csv';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$handle->close();\n\t\t\t\n\t\t}\n\t\treturn $this->csv_files;\n\t}",
"function get_list_of_not_new_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE newfile = 0 AND flaggedfile = 0 ORDER BY date DESC');\n return $result;\n }",
"public function getFilesOfCurrentUser()\r\n {\r\n $query = 'SELECT uploads.uploadid, uploads.filename, uploads.timestamp,';\r\n $query.= ' count(downloads.downloadid) as downloadcount, uploads.name, uploads.description, uploads.access';\r\n $query.= ' FROM uploads';\r\n $query.= ' LEFT JOIN downloads ON downloads.uploadid = uploads.uploadid';\r\n $query.= ' WHERE uploads.userid = :userid';\r\n $query.= ' GROUP BY uploads.uploadid, uploads.filename, uploads.timestamp, uploads.name, uploads.description, uploads.access';\r\n $query.= ' ORDER BY uploads.uploadid DESC';\r\n $query.= ' LIMIT 10 OFFSET 0';\r\n\r\n $stmt = $this->dbConnection->prepare($query);\r\n $stmt->execute([\r\n ':userid' => $this->userModel->getLoggedInUserId(),\r\n ]);\r\n $recordset = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\r\n\r\n return $this->parseUploadsRecordset($recordset);\r\n }",
"public function getRemovedFiles() {\n\t\t$fileNew = $this->getFile();\n $fileOld = AddonManager::getLocalFile($this->aid);\n\n\t\t$zipNew = new \\ZipArchive();\n\t\t$zipOld = new \\ZipArchive();\n $resNew = $zipNew->open($fileNew);\n $resOld = $zipOld->open($fileOld);\n\n if($resNew === TRUE && $resOld === TRUE) {\n\t\t\t$newFiles = array();\n for ($i = 0; $i < $zipNew->numFiles; $i++) {\n $newFiles[] = $zipNew->getNameIndex($i);\n }\n\n\t\t\t$oldFiles = [];\n for ($i = 0; $i < $zipOld->numFiles; $i++) {\n $oldFiles[] = $zipOld->getNameIndex($i);\n }\n\n\t\t\t$removed = array_diff($oldFiles, $newFiles);\n\t\t\t$removed = array_diff($removed, ['glass.json', 'version.json', 'namecheck.txt']);\n\t\t\treturn $removed;\n } else {\n return [\n\t\t\t\t\"status\" => \"error\",\n\t\t\t\t\"new\" => $resNew,\n\t\t\t\t\"old\" => $resOld\n\t\t\t];\n }\n\t}",
"function get_list_of_non_published_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE publishedfile = 0 ORDER BY date DESC');\n return $result;\n }",
"public function getExtractedFiles() {}",
"public function fileMetaColumns()\n {\n return array_filter($this->fileMetaColumns);\n }",
"public function getMetadataSets() {\n\n\t\t$ret = array();\n\n\t\t$dh = @opendir($this->directory);\n\t\tif ($dh === FALSE) {\n\t\t\tSimpleSAML_Logger::warning('Serialize metadata handler: Unable to open directory: ' . var_export($this->directory, TRUE));\n\t\t\treturn $ret;\n\t\t}\n\n\t\twhile ( ($entry = readdir($dh)) !== FALSE) {\n\n\t\t\tif ($entry[0] === '.') {\n\t\t\t\t/* Skip '..', '.' and hidden files. */\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$path = $this->directory . '/' . $entry;\n\n\t\t\tif (!is_dir($path)) {\n\t\t\t\tSimpleSAML_Logger::warning('Serialize metadata handler: Metadata directory contained a file where only directories should exist: ' . var_export($path, TRUE));\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$ret[] = rawurldecode($entry);\n\t\t}\n\n\t\tclosedir($dh);\n\n\t\treturn $ret;\n\t}",
"private function getDataFiles() : array\n {\n $dataDir = \\config('dataDir');\n $files = glob(\"$dataDir/*.csv\");\n $files = array_map(function ($file) {\n return \\basename($file);\n }, $files);\n\n return $files;\n }",
"public function getUserFiles(){\n\t\t$user_files = OSCLztoModel::newInstance()->getUserUploads( DEMO_USER_IP );\n\t\tif( false !== $user_files ){\n\t\t\t$files = array();\n\t\t\tforeach( $user_files as $file ){\n\t\t\t\t$files[$file['s_name']] = $file['s_settings'];\n\t\t\t}\n\t\t\treturn $files;\n\t\t}\n\t\treturn array();\n\t}",
"function getUnsentFiles()\n\t{\n\t\t$files = array();\n\t\t$dp = opendir($this->mail_path);\n\n\t\twhile($file = readdir($dp))\n\t\t{\n\t\t\tif(is_dir($file))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlist($uid,$rest) = explode('_',$file,2);\n\t\t\tif($uid == $this->user_id)\n\t\t\t{\n\t\t\t\tif(!is_dir($this->mail_path.'/'.$file))\n\t\t\t\t{\n\t\t\t\t\t$files[] = array(\n\t\t\t\t\t\t'name' => $rest,\n\t\t\t\t\t\t'size' => filesize($this->mail_path.'/'.$file),\n\t\t\t\t\t\t'ctime' => filectime($this->mail_path.'/'.$file)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($dp);\n\t\treturn $files;\n\t}",
"public function getAllUploadedForUser()\n {\n // Get the current user.\n $user = $_SESSION['user'];\n\n // If we don't have a user.\n if(is_null($user))\n {\n // Return false.\n return false;\n }\n\n // If the directory exists.\n if(!file_exists('../../uploads/' . $user))\n {\n // Return false.\n return false;\n }\n\n // Fetch all of the files for this user.\n $files = array_diff(scandir('../../uploads/' . $user), ['..', '.']);\n\n // Return files.\n return $files;\n }",
"public function getUserReminders() {\n\t\t$sql = \"SELECT id, user_id FROM zip_gz_downloads\n\t\t\tWHERE deletion_reminder = :deletion_reminder \n\t\t\tAND creationdate <= :creationdate \n\t\t\tGROUP BY user_id\";\n\t\t\n\t\t$user_list = Yii::app()->db->createCommand($sql)\n\t\t\t->bindValue(':deletion_reminder', 0)\n\t\t\t->bindParam(':creationdate', $this->timeOffset(20))\n\t\t\t->queryAll();\n\t\t\n\t\treturn $user_list;\n\t}",
"function get_all_metadata($reset = false) {\n static $data = null;\n \n if ($reset) {\n $data = null;\n return;\n }\n \n if ($data === null) {\n $filename = get_data_filename('metadata');\n $data = read_file_as_metadata($filename);\n }\n \n return $data;\n}",
"public function getExcludedFiles();",
"public function getUserCheckedOutFiles()\n {\n $query = $this->db->query(\"SELECT\n d.id,u.last_name, u.first_name, d.realname, d.created,d.description,d.status,d.location\n\t\t\t\tFROM \" . $this->db->dbprefix('documents') . \" as d,\n\t\t\t\t\" . $this->db->dbprefix('user') . \" as u\n WHERE d.status = $this->id\n\t\t\t\tAND d.owner = u.id\");\n\n return $query->result_object();\n }",
"protected static function getFilesFoundButNotExpected()\n {\n $files = \\Piwik\\Manifest::$files;\n $pluginsInManifest = self::getPluginsFoundInManifest();\n\n $filesFoundButNotExpected = array();\n\n foreach (self::getPathsToInvestigate() as $file) {\n if (is_dir($file)) {\n continue;\n }\n $file = substr($file, 2); // remove starting characters ./ to match format in manifest.inc.php\n\n if (self::isFileFromPluginNotInManifest($file, $pluginsInManifest)) {\n continue;\n }\n if (self::isFileNotInManifestButExpectedAnyway($file)) {\n continue;\n }\n if (self::isFileFromDirectoryThatShouldBeDeleted($file)) {\n // we already report the directory as \"Directory to delete\" so no need to repeat the instruction for each file\n continue;\n }\n\n if (!isset($files[$file])) {\n $filesFoundButNotExpected[] = $file;\n }\n }\n\n return $filesFoundButNotExpected;\n }",
"function getScanZipFiles()\n\t{\n\t\treturn $this->scanZipFiles;\n\t}",
"protected function findMissingReferencedFiles() : array {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getPlaceholderImg($width, $height, $blank=FALSE, $text=NULL) | public function testGHelperGetPlaceholderImg()
{
$width = 230;
$height = 230;
$expect = GHelper::$place_holder_url.$width.'x'.$height.'&text=No Image';
$out = GHelper::getPlaceholderImg($width, $height);
$this->assertEquals($expect, $out);
$expect = GHelper::$place_holder_url.$width.'x'.$height;
$out = GHelper::getPlaceholderImg($width, $height, TRUE);
$this->assertEquals($expect, $out);
$text = 'text';
$expect = GHelper::$place_holder_url.$width.'x'.$height.'&text='.$text;
$out = GHelper::getPlaceholderImg($width, $height, FALSE, $text);
$this->assertEquals($expect, $out);
$text = 'text';
$expect = GHelper::$place_holder_url.$width.'x'.$height;
$out = GHelper::getPlaceholderImg($width, $height, TRUE, $text);
$this->assertEquals($expect, $out);
} | [
"function inspiry_image_placeholder( $image_size ) {\n\t\techo get_inspiry_image_placeholder( $image_size );\n\t}",
"function opening_times_lazy_placeholder_img() {\n $placeholder = 'data:image/gif;base64,R0lGODdhAQABAPAAAP///wAAACwAAAAAAQABAEACAkQBADs=';\n\n return $placeholder;\n}",
"public function getPlaceholderImage()\n {\n return 'https://via.placeholder.com/300x250.png';\n }",
"public function PlaceholderImage() {\n\t\treturn SiteConfig::current_site_config()->PlaceholderImage();\n\t}",
"public function placeholderImage()\n {\n $header = 'data:image/jpeg;base64,';\n if (!empty($this->placeholder)) {\n $content = $this->placeholder;\n } else {\n // At least return something\n return $this->defaultPlaceholderImage();\n }\n\n return Template::raw($header.rawurlencode($content));\n }",
"protected function defaultPlaceholderImage(): \\Twig\\Markup\n {\n $width = 1;\n $height = 1;\n $color = '#CCC';\n\n return Template::raw(ImageOptimize::$plugin->placeholder->generatePlaceholderBox($width, $height, $color));\n }",
"function codeless_the_post_thumbnail_placeholder($html, $post_id, $post_thumbnail_id){\n if( $html == '' && ! $post_thumbnail_id )\n $html = '<img class=\"placeholder-img\" src=\"' . CODELESS_BASE_URL.'img/placeholder-img.png' . '\" alt=\"\" />';\n\n return $html;\n}",
"function placeholder($width=200, $height=200, $text=\"\"){\n return 'holder.js/'.$width.'x'.$height.'/#f0f0f0:#b9b9b9/auto/text:'.$text;\n }",
"public function getImagePlaceholder()\n {\n return config('medialibrary.image_placeholder');\n }",
"public function createPlaceholderImage() {\n $this->images = [];\n\n $this->images[] = Image::create([\"id\" => 0]);\n }",
"public function getPlaceholderImageUrl()\n {\n $image = 'Vnecoms_PdfPro::images/'.$this->getCustomImageFileName();\n if ($image) {\n $asset = $this->assetRepo->createAsset($image);\n $placeholder = $this->assetSource->getFile($asset);\n if ($placeholder) {\n return $asset->getUrl();\n }\n }\n\n return $this->assetRepo->getUrl('Vnecoms_PdfPro::images/widget.png');\n }",
"abstract protected function getBlankImage($width, $height);",
"private static function get_placeholder_image() {\n\t\t/**\n\t\t * Allows plugins and themes to modify the placeholder image.\n\t\t *\n\t\t * This filter is not prefixed with jetpack_ to provide a smoother migration\n\t\t * process from the WordPress Lazy Load plugin.\n\t\t *\n\t\t * @module lazy-images\n\t\t *\n\t\t * @since 5.6.0\n\t\t * @since 6.5.0 Default image is now a base64 encoded transparent gif.\n\t\t *\n\t\t * @param string The URL to the placeholder image\n\t\t */\n\t\treturn apply_filters(\n\t\t\t'lazyload_images_placeholder_image',\n\t\t\t'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'\n\t\t);\n\t}",
"private function maybeCreatePlaceholder(): void\n {\n if (!File::exists(storage_path($this->placeholderPath))) {\n\n $image = new PrintImage('https://lorempixel.com/640/480/?77378');\n\n $image->saveExternal($this->placeholderPath);\n }\n\n }",
"function get_placeholder_image( $image_id ) {\n\t\tglobal $maera_pb_placeholder_images;\n\t\t$return = array();\n\n\t\tif ( isset( $maera_pb_placeholder_images[ $image_id ] ) ) {\n\t\t\t$return = $maera_pb_placeholder_images[ $image_id ];\n\t\t}\n\n\t\treturn apply_filters( 'maera_get_placeholder_image', $return, $image_id, $maera_pb_placeholder_images );\n\n\t}",
"public function getPlaceholderPath()\n {\n return $this->getBaseFolderPath() . self::PLACEHOLDER_IMAGE_NAME;\n }",
"function kalium_image_placeholder_wrap_element( $image ) {\n\tif ( false !== strpos( $image, '<img' ) ) {\n\t\treturn kalium()->images->getImage( $image );\n\t}\n\n\treturn $image;\n}",
"function kalium_image_placeholder_wrap_element( $image ) {\n\tif ( false !== strpos( $image, '<img' ) ) {\n\t\treturn kalium()->images->get_image( $image );\n\t}\n\n\treturn $image;\n}",
"function GetImage ($text='expression')\n {\n switch ( $text )\n {\n case 'expression': $fill = self::GetExpression(); break;\n case 'humanized':\n $fill = self::GetHumanizedExpression();\n break;\n case\n $text = \" \".self::$ImgConfig['Prefix'].self::GetExpression().self::$ImgConfig['Suffix'].\" \";\n\n /// Create an image\n $image = imagecreatetruecolor(self::$ImgConfig['Width'], self::$ImgConfig['Height']);\n\n /// Let's choose a proper font size for image\n /// Start off with this obvious value equal to image height\n $font_size = self::$ImgConfig['Height'];\n do {\n $box = imagettfbbox($font_size, 0, self::$ImgConfig['FontFile'], $text); \n $box_width = $box[2] - $box[0];\n $box_height = $box[5] - $box[3];\n $font_size--;\n /// Special condition follows, checking whether text box fits well into canvas\n } while ( $box_width >= ( self::$ImgConfig['Width'] ) || $box_height >= ( self::$ImgConfig['Height'] ) );\n\n /// Convert hexadecimal colors to use in drawing functions\n $dec_font_color = self::ConvertHexColor(self::$ImgConfig['FontColor']);\n $img_font_color = imagecolorallocate($image, $dec_font_color[0], $dec_font_color[1], $dec_font_color[2]); \n\n $dec_back_color = self::ConvertHexColor(self::$ImgConfig['BackColor']);\n $img_back_color = imagecolorallocate($image, $dec_back_color[0], $dec_back_color[1], $dec_back_color[2]);\n\n \n /// Fill an image\n imagefill($image, 0, 0, $img_back_color);\n\n /// Make our fancy text appear!\n /// Text is ALMOST vertically and horizontally center-aligned\n /// The shit is that coordinates in imagettftext() are specified for basepoint of first character in label,\n /// not its lower-left bottom =(\n if ( !@imagettftext($image, $font_size, 0, (self::$ImgConfig['Width'] - $box_width)/2 + 1, (self::$ImgConfig['Height'] - $box_height)/2 - 1, $img_font_color, self::$ImgConfig['FontFile'], $text) )\n {\n trigger_error(\"&&E_FAILED_TO_DRAW\", E_USER_ERROR);\n }\n\n return $image;\n }\n\n /**\n * Convert a hexadecimal color string into an array containing values for red, green and blue.\n *\n * @return array Array with 3 elements, each containing integer value from 0 to 255 for red, green and blue respectively\n */\n private function ConvertHexColor ($string)\n {\n $r = hexdec($string[1].$string[2]);\n $g = hexdec($string[3].$string[4]);\n $b = hexdec($string[5].$string[6]);\n\n return array ($r, $g, $b);\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a number of timeunits (positive or negative) representing the $timeDifference $timeunit should be one of the following 's' for seconds 'm' for minutes (note the lowercase m) 'h' for hours 'd' for days 'w' for weeks 'M' for months (note the capital M) 'y' for years $timeDifference should be the difference between two timeStamps in epoch time format | function timeDiff($timeDifference, $timeunit)
{ if($timeunit === 's')
{ return $timeDifference;
}else if($timeunit === 'm')
{ return $timeDifference/60;
}else if($timeunit === 'h')
{ return $timeDifference/3600; // 60/60;
}else if($timeunit === 'd')
{ return $timeDifference/86400; // 60/60/24
}else if($timeunit === 'w')
{ return $timeDifference/604800; // 60/60/24/7
}else if($timeunit === 'M')
{ return $timeDifference/2592000; // 60/60/24/30
}else if($timeunit === 'y')
{ return $timeDifference/31536000; // 60/60/24/365
}
} | [
"function timeDiff($t1, $t2)\r\n{\r\n\tif($t1 > $t2)\r\n\t{\r\n\t\t$time1 = $t2;\r\n\t\t$time2 = $t1;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$time1 = $t1;\r\n\t\t$time2 = $t2;\r\n\t}\r\n\t$diff = array(\r\n\t\t\t//'years' => 0,\r\n\t\t\t//'months' => 0,\r\n\t\t\t//'weeks' => 0,\r\n\t\t\t//'days' => 0,\r\n\t\t\t'hours' => 0,\r\n\t\t\t'minutes' => 0,\r\n\t\t\t'seconds' =>0\r\n\t);\r\n\r\n\t//foreach(array('years','months','weeks','days','hours','minutes','seconds') as $unit)\r\n\tforeach(array('hours','minutes','seconds') as $unit)\r\n\t{\r\n\t\twhile(TRUE)\r\n\t\t{\r\n\t\t\t$next = strtotime(\"+1 $unit\", $time1);\r\n\t\t\tif($next < $time2)\r\n\t\t\t{\r\n\t\t\t\t$time1 = $next;\r\n\t\t\t\t$diff[$unit]++;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn($diff);\r\n}",
"public function getCurrentTimeDifference($time_record, $unit = 'm');",
"function TimeDifference($timedifference)\n\t{\n\t\tif ($timedifference < 60) {\n\t\t\tif ($timedifference == 1) {\n\t\t\t\t$timechange = GetLang('TimeTaken_Seconds_One');\n\t\t\t} else {\n\t\t\t\t$timechange = sprintf(GetLang('TimeTaken_Seconds_Many'), $this->FormatNumber($timedifference, 0));\n\t\t\t}\n\t\t}\n\n\t\tif ($timedifference >= 60 && $timedifference < 3600) {\n\t\t\t$num_mins = floor($timedifference / 60);\n\n\t\t\t$secs = floor($timedifference % 60);\n\n\t\t\tif ($num_mins == 1) {\n\t\t\t\t$timechange = GetLang('TimeTaken_Minutes_One');\n\t\t\t} else {\n\t\t\t\t$timechange = sprintf(GetLang('TimeTaken_Minutes_Many'), $this->FormatNumber($num_mins, 0));\n\t\t\t}\n\n\t\t\tif ($secs > 0) {\n\t\t\t\t$timechange .= ', ' . sprintf(GetLang('TimeTaken_Seconds_Many'), $this->FormatNumber($secs, 0));\n\t\t\t}\n\t\t}\n\n\t\tif ($timedifference >= 3600) {\n\t\t\t$hours = floor($timedifference/3600);\n\t\t\t$mins = floor($timedifference % 3600) / 60;\n\n\t\t\tif ($hours == 1) {\n\t\t\t\tif ($mins == 0) {\n\t\t\t\t\t$timechange = GetLang('TimeTaken_Hours_One');\n\t\t\t\t} else {\n\t\t\t\t\t$timechange = sprintf(GetLang('TimeTaken_Hours_One_Minutes'), $this->FormatNumber($mins, 0));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($hours > 1) {\n\t\t\t\tif ($mins == 0) {\n\t\t\t\t\t$timechange = GetLang('TimeTaken_Hours_Many');\n\t\t\t\t} else {\n\t\t\t\t\t$timechange = sprintf(GetLang('TimeTaken_Hours_Many_Minutes'), $this->FormatNumber($hours, 0), $this->FormatNumber($mins, 0));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// can expand this futher to years/months etc - the schedule_manage file has it all done in javascript.\n\n\t\treturn $timechange;\n\t}",
"public static function getDifferenceBetweenDates(string $date1, string $date2, string $diffUnit = 'days'): int\n\t{\n\t\t$diffUnitEqualOrBelowDays = false;\n\t\t\n\t\t$yearMultiplier = 0;\n\t\t$monthMultiplier = 0;\n\t\t$dayMultiplier = 0;\n\t\t$hourMultiplier = 0;\n\t\t$minuteMultiplier = 0;\n\t\t$secondMultiplier = 0;\n\t\tswitch ($diffUnit) {\n\t\t\tcase 'years':\n\t\t\t\t$yearMultiplier = 1;\n\t\t\t\tbreak;\n\t\t\tcase 'months':\n\t\t\t\t$yearMultiplier = 12;\n\t\t\t\t$monthMultiplier = 1;\n\t\t\t\tbreak;\n\t\t\tcase 'days':\n\t\t\t\t$dayMultiplier = 1;\n\t\t\t\t$diffUnitEqualOrBelowDays = true;\n\t\t\t\tbreak;\n\t\t\tcase 'hours':\n\t\t\t\t$hourMultiplier = 1;\n\t\t\t\t$dayMultiplier = 24;\n\t\t\t\t$diffUnitEqualOrBelowDays = true;\n\t\t\t\tbreak;\n\t\t\tcase 'minutes':\n\t\t\t\t$minuteMultiplier = 1;\n\t\t\t\t$hourMultiplier = 60;\n\t\t\t\t$dayMultiplier = 24 * 60;\n\t\t\t\t$diffUnitEqualOrBelowDays = true;\n\t\t\t\tbreak;\n\t\t\tcase 'seconds':\n\t\t\t\t$secondMultiplier = 1;\n\t\t\t\t$minuteMultiplier = 60;\n\t\t\t\t$hourMultiplier = 24 * 60;\n\t\t\t\t$dayMultiplier = 24 * 60 * 60;\n\t\t\t\t$diffUnitEqualOrBelowDays = true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new PlatformException('formatDiff parameter is not possible. ' .\n\t\t\t\t\t'Please, see which strings you can use as formatDiff parameter.',\n\t\t\t\t\tPlatformException::ERROR_PARAMETER_NOT_VALID);\n\t\t}\n\t\t\n\t\t$date1 = (new \\DateTime($date1));\n\t\t$date2 = new \\DateTime($date2);\n\t\t$diff = $date2->diff($date1);\n\t\t\n\t\tif ($diffUnitEqualOrBelowDays)\n\t\t\treturn ($diff->invert ? -1 : 1) * ($diff->days * $dayMultiplier + $diff->h * $hourMultiplier +\n\t\t\t\t\t$diff->i * $minuteMultiplier + $diff->s * $secondMultiplier);\n\t\telse\n\t\t\treturn ($diff->invert ? -1 : 1) * ($diff->y * $yearMultiplier + $diff->m * $monthMultiplier);\n\t}",
"public function getTimestamp($value, $unit) {\n\t\t$now = time();\n\t\t$convertedValue = 0;\n\t\tswitch ($unit) {\n\t\t\tcase 'days':\n\t\t\t\t$convertedValue = $value * 24 * 60 * 60;\n\t\t\t\tbreak;\n\t\t\tcase 'hours':\n\t\t\t\t$convertedValue = $value * 60 * 60;\n\t\t\t\tbreak;\n\t\t\tcase 'minutes':\n\t\t\t\t$convertedValue = $value * 60;\n\t\t\t\tbreak;\n\t\t\tcase 'seconds':\n\t\t\t\t$convertedValue = $value;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$convertedValue = $value;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $now - $convertedValue;\n\t}",
"public static function calculateTimeOffset($time,$unit) {\n switch($unit) {\n case 'secs':\n return $time;\n case 'mins':\n return $time * 60;\n case 'hours':\n return $time * 3600;\n case 'days':\n return $time * 86400;\n case 'months':\n return $time * 2629743; // average seconds in a month\n default:\n return false;\n }\n }",
"function DateDiff($date1, $date2, $unit = \"\")\n{\n switch ($unit) {\n case 's':\n $dividend = 1;\n break;\n case 'i': //分\n $dividend = 60;\n break;\n case 'h': //時\n $dividend = 3600;\n break;\n case 'd': //天\n $dividend = 86400;\n break;\n default:\n $dividend = 86400;\n }\n $time1 = strtotime($date1);\n $time2 = strtotime($date2);\n if ($time1 && $time2)\n return (float) ($time1 - $time2) / $dividend;\n return false;\n}",
"function time_diference( $time_a, $time_b, $format = '' ) {\n\t\t\n\tif ( !is_numeric( $time_a ) )\n\t\t$time_a = strtotime( $time_a );\n\t\n\tif ( !is_numeric( $time_b ) )\n\t\t$time_b = strtotime( $time_b );\n\t\n\t// COmputes the diference\n\t$timediff = $time_a - $time_b;\n\n\tswitch ( strtolower( $format ) ) {\n\n\t\tcase 'mysql' :\n\t\t\treturn date( 'Y-m-d H:i:s', abs( $timediff ) );\n\t\t\tbreak;\n\n\t\tcase 'object' :\n\t\t\treturn (object) array(\n\t\t\t\t'signal' => ( abs( $timediff ) == $timediff ? '+' : '-' ),\n\t\t\t\t'years' => round( abs( (int) $timediff / ( 24*60*60*365 ) ) ),\n\t\t\t\t'months' => date( 'n', $timediff ),\n\t\t\t\t'weeks' => round( abs( (int) $timediff / ( 24*60*60*7 ) ) ),\n\t\t\t\t'days' => round( abs( (int) ( $timediff / ( 24*60*60 ) ) ) ),\n\t\t\t\t'hours' => date( 'H', $timediff ),\n\t\t\t\t'minutes' => date( 'i', $timediff ),\n\t\t\t\t'seconds' => date( 's', $timediff ),\n\t\t\t\t'microseconds' => date( 'u', $timediff ),\n\t\t\t\t'iso8601' => date( 'c', $timediff ),\n\t\t\t\t'rfc2822' => date( 'r', $timediff ),\n\t\t\t);\n\t\t\tbreak;\n\t\t\n\t\tcase 'timestamp' :\n\t\tdefault :\n\t\t\treturn abs( $timediff );\n\t\t\tbreak;\n\n\t}\n\n\treturn false;\n\n}",
"function mylib_date_time_diff() {\n\n\t$count = func_num_args();\n\tif($count != 3){\n\t\tmylib_error('invalid_argument','mylib_date_time_diff');\n\t\treturn -1;\n\t}\n\n\t$allow_unit = array(\"H\");\n\t$arg = func_get_args();\n\n\t$unit = $arg[0];\n\t$time1 = $arg[1];\n $time2 = $arg[2];\n\n if( !preg_match(\"/[0-9]+[H]/\", $unit )) {\n\t\tmylib_error('function_return_error');\n\t return -1;\n }\n\t\n\t$diff = preg_replace(\"/[A-z]/\",\"\", $unit);\n\t$diff = mylib_trim($diff);\n\n\t$unit = preg_replace(\"/[0-9]/\",\"\", $unit);\n\t$unit = mylib_trim($unit);\n\n\tif(mylib_check_exist($allow_unit,$unit) != 0){\n\t\tmylib_error('function_return_error');\n\t return -1;\n }\n\t \n\tif ($unit == \"H\") {\n\t $diff *= ( 60 * 60 );\n\t if ( ( $time2 - $time1 ) == $diff ) {\n\t\t\t # time2 equals time1 at specific time.\n\t \t return 0;\n }elseif ( ( $time2 - $time1 ) < $diff ) {\n\t\t\t # time2 not longer than time1 at specific time\n\t\t\t return 1;\n\t }else {\n\t\t\t # time2 longer than time1 at specific time.\n\t\t\t return 2;\n\t } \n\t}\n\tmylib_error('invalid_argument','mylib_date_time_diff');\n}",
"protected static function TimeDifference()\n\t{\n\t\t$ts=0;\n\t\t$ts -= date ( \"Z\" ) * 1;\n\t\t$daylight = date ( \"I\" );\n\t\t$daylight *= 1;\n\t\t$daylight *= 3600;\n\t\t$ts += $daylight; //12600 seconds 3:30+ GMT Tehran\n\t\t$ts += self::$GMTdelta;\n\t\treturn $ts;\n\t\t\n\t}",
"public function test_get_units() {\n $units = $this->element->get_units();\n ksort($units);\n $this->assertEquals($units, array(1 => get_string('seconds'), 60 => get_string('minutes'),\n 3600 => get_string('hours'), 86400 => get_string('days'), 604800 => get_string('weeks')));\n }",
"public function test_seconds_to_unit() {\n $this->assertEquals(array(0, 60), $this->element->seconds_to_unit(0)); // Zero minutes, for a nice default unit.\n $this->assertEquals(array(1, 1), $this->element->seconds_to_unit(1));\n $this->assertEquals(array(3601, 1), $this->element->seconds_to_unit(3601));\n $this->assertEquals(array(1, 60), $this->element->seconds_to_unit(60));\n $this->assertEquals(array(3, 60), $this->element->seconds_to_unit(180));\n $this->assertEquals(array(1, 3600), $this->element->seconds_to_unit(3600));\n $this->assertEquals(array(2, 3600), $this->element->seconds_to_unit(7200));\n $this->assertEquals(array(1, 86400), $this->element->seconds_to_unit(86400));\n $this->assertEquals(array(25, 3600), $this->element->seconds_to_unit(90000));\n\n $this->element = $this->mform->addElement('duration', 'testel', null, array('defaultunit' => 86400, 'optional' => false));\n $this->assertEquals(array(0, 86400), $this->element->seconds_to_unit(0)); // Zero minutes, for a nice default unit.\n }",
"function timeElapsedString($timestamp) \r\n{\r\n\r\n $timestamp = time() - $timestamp; // to get the time since that moment\r\n $timestamp = ($timestamp<1)? 1 : $timestamp;\r\n $tokens = array (\r\n 31536000 => 'year',\r\n 2592000 => 'month',\r\n 604800 => 'week',\r\n 86400 => 'day',\r\n 3600 => 'hour',\r\n 60 => 'minute',\r\n 1 => 'second'\r\n );\r\n\r\n foreach ($tokens as $unit => $text) {\r\n if ($timestamp < $unit) continue;\r\n $numberOfUnits = floor($timestamp / $unit);\r\n return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'').' ago';\r\n }\r\n\r\n}",
"function time_difference($start_time=\"11:00:00\",$end_time=\"12:00:00\")\r\n{\r\nlist($h1,$m1,$s1) = explode(':',$start_time); \r\n$startTimeStamp = mktime($h1,$m1,$s1,0,0,0);\r\n\r\nlist($h2,$m2,$s2) = explode(':',$end_time); \r\n\r\n//check end time is in 12 hrs format:\r\nif($h2 < $h1)\r\n$h2+=12;\r\n\r\n$endTimeStamp = mktime($h2,$m2,$s2,0,0,0); \r\n$time=abs($endTimeStamp - $startTimeStamp);\r\n\r\n$value = array(\r\n\"hours\" => \"00\",\r\n\"minutes\" => \"00\",\r\n\"seconds\" => \"00\"\r\n\r\n);\r\n\r\nif($time >= 3600){\r\n$value[\"hours\"] = sprintf(\"%02d\",floor($time/3600));\r\n$time = ($time%3600);\r\n}\r\nif($time >= 60){\r\n$value[\"minutes\"] = sprintf(\"%02d\",floor($time/60));\r\n$time = ($time%60);\r\n}\r\n\r\n$value[\"seconds\"] = sprintf(\"%02d\",floor($time));\r\n\r\nreturn implode(\":\",$value); \r\n}",
"public static function calculate_seconds_from_time_params($timeunit = '', $timeamount = '') {\n $result = 0;\n\n if ($timeunit && $timeamount) {\n $amount = (int) $timeamount;\n\n if (in_array($timeunit, ['minute', 'hour', 'day']) && $amount > 0) {\n $seconds = 60;\n $mult = 1;\n\n if ($timeunit == 'hour') {\n $mult = 60;\n } else if ($timeunit == 'day') {\n $mult = 1440;\n }\n\n $result = $amount * $seconds * $mult;\n }\n }\n\n return $result;\n }",
"function time_diff ($timestamp1, $timestamp2) {\r\r\n\t\t\r\r\n\t\t//0:00:42.80\r\r\n\t\t$p1 = explode(':', $timestamp1);\r\r\n\t\t$p2 = explode(':', $timestamp2);\r\r\n\t\t\r\r\n\t\t$h1 = (float) $p1[0];\r\r\n\t\t$h2 = (float) $p2[0];\r\r\n\t\t$m1 = (float) $p1[1];\r\r\n\t\t$m2 = (float) $p2[1];\r\r\n\t\t$s1 = (float) $p1[2];\r\r\n\t\t$s2 = (float) $p2[2];\r\r\n\t\t\r\r\n\t\t$t1 = $h1 * 3600 + $m1 * 60 + $s1;\r\r\n\t\t$t2 = $h2 * 3600 + $m2 * 60 + $s2;\r\r\n\t\t\r\r\n\t\treturn abs($t1 - $t2);\r\r\n\t\t\r\r\n\t}",
"function gen_units($time) {\n\tif ($time == 1) { $units = \"second\"; }\n\telseif ($time > 1) { $units = \"seconds\"; }\n\telse { $units = \"<abbr title=\\\"Milliseconds\\\">ms</abbr>\"; }\nreturn $units; }",
"function calc_utf_period_diff( $upper_period, $lower_period )\n{\n $time_diff = $upper_period - $lower_period;\n $periods_diff = $time_diff/60;\n $minutes_diff = $periods_diff*30;\n\n return $minutes_diff;\n}",
"function calc_time_difference($time1, $time2) {\n//NOTE: submitted times should be of the format 8:00, 14:30 etc\n $start_hour = substr($time1, 0, 2);\n $start_minute = substr($time1, -2, 2);\n \n $end_hour = substr($time2, 0, 2); \n $end_minute = substr($time2, -2, 2);\n \n $total_start_minutes = (60*$start_hour)+$start_minute;\n $total_end_minutes = (60*$end_hour)+$end_minute;\n\n $interval = $total_end_minutes-$total_start_minutes; \n return $interval;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if a property is already added to favorites | function is_added_to_favorite( $property_id, $user_id = 0 ) {
if ( $property_id > 0 ) {
/* if user id is not provided then try to get current user id */
if ( ! $user_id ) {
$user_id = get_current_user_id();
}
if ( $user_id > 0 ) {
/* if logged in check in database */
global $wpdb;
$results = $wpdb->get_results( "SELECT * FROM $wpdb->usermeta WHERE meta_key='favorite_properties' AND meta_value=" . $property_id . " AND user_id=" . $user_id );
if ( isset( $results[0]->meta_value ) && ( $results[0]->meta_value == $property_id ) ) {
return true;
}
} else {
/* if not logged in check in cookies */
if ( isset( $_COOKIE['inspiry_favorites'] ) ) {
$inspiry_favorites = unserialize( $_COOKIE['inspiry_favorites'] );
if ( in_array( $property_id, $inspiry_favorites ) ) {
return true;
}
}
}
}
return false;
} | [
"function is_added_to_favorite( $property_id, $user_id = 0 ) {\n\n\t\tif ( $property_id > 0 ) {\n\n\t\t\t/* if user id is not provided then try to get current user id */\n\t\t\tif ( ! $user_id ) {\n\t\t\t\t$user_id = get_current_user_id();\n\t\t\t}\n\n\t\t\tif ( $user_id > 0 ) {\n\t\t\t\t/* if logged in check in database */\n\t\t\t\tglobal $wpdb;\n\t\t\t\t$results = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM {$wpdb->usermeta} WHERE meta_key= %s AND meta_value= %s AND user_id= %s\", 'favorite_properties', $property_id, $user_id ) );\n\t\t\t\tif ( isset( $results[0]->meta_value ) && ( $results[0]->meta_value == $property_id ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"function add_to_favorite() {\n\n\t\t/* if user is logged in then store in meta data */\n\t\tif ( isset( $_POST['property_id'] ) && is_user_logged_in() ) {\n\t\t\t$property_id = intval( $_POST['property_id'] );\n\t\t\t$user_id = get_current_user_id();\n\t\t\tif ( ( $property_id > 0 ) && ( $user_id > 0 ) ) {\n\t\t\t\tif ( add_user_meta( $user_id, 'favorite_properties', $property_id ) ) {\n\t\t\t\t\t_e( 'Added to Favorites', 'framework' );\n\t\t\t\t} else {\n\t\t\t\t\t_e( 'Failed!', 'framework' );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\techo 'false';\n\t\t}\n\n\t\tdie;\n\t}",
"public static function add_favorite() {\n header( 'HTTP/1.0 200 OK' );\n header( 'Content-Type: application/json' );\n\n $data = array();\n\n if( ! is_user_logged_in() ) {\n $data = array(\n 'success' => false,\n 'message' => __( 'You need to log in at first.', 'realia-favorites' ),\n );\n } else if ( ! empty( $_GET['id'] ) ) {\n $favorites = get_user_meta( get_current_user_id(), 'favorites', true );\n $favorites = ! is_array( $favorites ) ? array() : $favorites;\n\n if ( empty( $favorites ) ) {\n $favorites = array();\n }\n\n $post = get_post( $_GET['id'] );\n $post_type = get_post_type( $post->ID );\n\n if ( 'property' != $post_type ) {\n $data = array(\n 'success' => false,\n 'message' => __( 'This is not property ID.', 'realia-favorites' ),\n );\n } else {\n $found = false;\n\n foreach ( $favorites as $property_id ) {\n if ( $property_id == $_GET['id']) {\n $found = true;\n break;\n }\n }\n\n if ( ! $found ) {\n $favorites[] = $post->ID;\n update_user_meta( get_current_user_id(), 'favorites', $favorites );\n\n $data = array(\n 'success' => true,\n );\n } else {\n $data = array(\n 'success' => false,\n 'message' => __( 'Property is already in list', 'realia-favorites' ),\n );\n }\n }\n } else {\n $data = array(\n 'success' => false,\n 'message' => __( 'Property ID is missing.', 'realia-favorites' ),\n );\n }\n\n echo json_encode( $data );\n exit();\n }",
"function add_to_favorite() {\n\n\t\t/* if user is logged in then store in meta data */\n\t\tif ( isset( $_POST['property_id'] ) && is_user_logged_in() ) {\n\t\t\t$property_id = intval( $_POST['property_id'] );\n\t\t\t$user_id = get_current_user_id();\n\t\t\tif ( ( $property_id > 0 ) && ( $user_id > 0 ) ) {\n\t\t\t\tif ( add_user_meta( $user_id, 'favorite_properties', $property_id ) ) {\n\t\t\t\t\t_e( 'Added to Favorites', 'framework' );\n\t\t\t\t} else {\n\t\t\t\t\t_e( 'Failed!', 'framework' );\n\t\t\t\t}\n\t\t\t}\n\t\t/* otherwise store in cookies */\n\t\t} elseif ( isset( $_POST['property_id'] ) ) {\n\t\t\t$property_id = intval( $_POST[ 'property_id' ] );\n\t\t\tif ( $property_id > 0 ) {\n\t\t\t\t$inspiry_favorites = array();\n\t\t\t\tif ( isset( $_COOKIE['inspiry_favorites'] ) ) {\n\t\t\t\t\t$inspiry_favorites = unserialize( $_COOKIE['inspiry_favorites'] );\n\t\t\t\t}\n\t\t\t\t$inspiry_favorites[] = $property_id;\n\t\t\t\tif ( setcookie( 'inspiry_favorites', serialize( $inspiry_favorites ), time() + ( 60 * 60 * 24 * 30 ), '/' ) ) {\n\t\t\t\t\t_e( 'Added to Favorites', 'framework' );\n\t\t\t\t} else {\n\t\t\t\t\t_e( 'Failed!', 'framework' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\t_e( 'Invalid Parameters!', 'framework' );\n\t\t}\n\n\t\tdie;\n\t}",
"public function isFavorite() {\n if ($this->favorite->count() == 0) {\n return FALSE;\n } elseif ($this->favorite->count() > 0) {\n return TRUE;\n } else {\n return FALSE;\n }\n }",
"public function isFavourite(){\n return $this->favourites()->where('user_id', Auth::id())->count() > 0;\n }",
"function have_favorites() {\n\t\tif ($this->current_favorite + 1 < $this->favorite_count) {\n\t\t\treturn true;\n\t\t}\n\t\telseif ($this->current_favorite + 1 == $this->favorite_count && $this->favorite_count > 0) {\n\t\t\tdo_action_ref_array('xt_favorite_loop_end', array (\n\t\t\t\t& $this\n\t\t\t));\n\t\t\t// Do some cleaning up after the loop\n\t\t\t$this->rewind_favorites();\n\t\t}\n\n\t\t$this->in_the_loop = false;\n\t\treturn false;\n\t}",
"public static function favorite_add_remove($property_id, $mode = 'add', $user_id = 0)\r\n {\r\n /** first validation **/\r\n if(!$property_id) return false;\r\n \r\n $pids = self::favorite_get_pids();\r\n \r\n if($mode == 'add')\r\n {\r\n $key = array_search($property_id, $pids);\r\n if($key === false)\r\n {\r\n array_push($pids, $property_id);\r\n \r\n /** Logged in user **/\r\n $current_user_id = false;\r\n \r\n if($user_id == 0) $current_user_id = wpl_users::get_cur_user_id();\r\n elseif(wpl_users::get_user_by('id', $user_id)) $current_user_id = $user_id;\r\n \r\n if($current_user_id) wpl_db::q(\"INSERT INTO `#__wpl_addon_pro_favorites` (`user_id`,`property_id`) VALUES ('$current_user_id','$property_id')\");\r\n }\r\n }\r\n elseif($mode == 'remove')\r\n {\r\n $key = array_search($property_id, $pids);\r\n if($key !== false)\r\n {\r\n unset($pids[$key]);\r\n \r\n /** Logged in user **/\r\n $current_user_id = false;\r\n \r\n if($user_id == 0) $current_user_id = wpl_users::get_cur_user_id();\r\n elseif(wpl_users::get_user_by('id', $user_id)) $current_user_id = $user_id;\r\n \r\n if($current_user_id) wpl_db::q(\"DELETE FROM `#__wpl_addon_pro_favorites` WHERE `user_id`='$current_user_id' AND `property_id`='$property_id'\");\r\n }\r\n }\r\n \r\n $pids = array_unique($pids);\r\n self::favorite_set_cookie($pids);\r\n \r\n return true;\r\n }",
"function property_exists ($class, $property) {}",
"public function isFavorite()\n {\n if (!empty($this->settings)) {\n if (@RevsliderPrestashop::getIsset($this->settings['favorite']) && $this->settings['favorite'] == 'true') {\n return true;\n }\n }\n\n return false;\n }",
"private function _exists($property) {\n\t\treturn property_exists($this, $property);\n\t}",
"function is_favorite($id)\n\t{ \n\t\treturn in_array($id, $_SESSION['favorites']);\n\t}",
"public function isFavorited()\n {\n return $this->favorites()->where('user_id', auth()->id())->count() > 0;\n }",
"public function isFavourited()\n {\n return !!$this->favourites->where('user_id', auth()->id())->count();\n }",
"function bbp_is_favorites()\n{\n}",
"public function isFavorite()\n {\n $favorite = Favorite::where('news_id' , $this->id)\n ->where('user_id', Auth::user()->id)\n ->first();\n if (!$favorite) {\n return false;\n }\n return true;\n }",
"public function isFavorited()\n {\n return !! $this->favorites->where('user_id', auth()->id())->count();\n }",
"abstract public function hasSavedProperties();",
"private function checkFavoriteFieldsInSession() {\n\t\t$this->checkIfMultiInSetOrEmpty(\n\t\t\t'favoriteFieldsInSession',\n\t\t\tFALSE,\n\t\t\t'',\n\t\t\t'This value specifies the field names that will be stored in the '\n\t\t\t\t.'session when displaying the favorites list. This value may be '\n\t\t\t\t.'empty. Wrong values cause empty fields in the session data '\n\t\t\t\t.'array.',\n\t\t\t$this->getDbColumnNames(REALTY_TABLE_OBJECTS)\n\t\t);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns armor points to be added by checking which leggings the entity wears Check this: Each defense point will reduce any damage dealt to the player which is absorbed by armor by 4% | private function getLeggingsArmorPoints() : int{
$armor = 0;
$item = $this->getBoots();
if($item !== null && $item->getId() !== ItemIds::AIR){
if($item instanceof LeatherPants){
$armor = 2;
}else if($item instanceof GoldLeggings){
$armor = 3;
}else if($item instanceof IronLeggings){
$armor = 5;
}else if($item instanceof DiamondLeggings){
$armor = 6;
}
}
return $armor * 4;
} | [
"private function getChestplateArmorPoints() : int{\n\t\t$armor = 0;\n\t\t$item = $this->getChestplate();\n\t\tif($item !== null && $item->getId() !== ItemIds::AIR){\n\t\t\tif($item instanceof LeatherTunic){\n\t\t\t\t$armor = 3;\n\t\t\t}else if($item instanceof GoldChestplate){\n\t\t\t\t$armor = 5;\n\t\t\t}else if($item instanceof IronChestplate){\n\t\t\t\t$armor = 6;\n\t\t\t}else if($item instanceof DiamondChestplate){\n\t\t\t\t$armor = 8;\n\t\t\t}\n\t\t}\n\t\treturn $armor * 4;\n\t}",
"private function getBootsArmorPoints() : int{\n\t\t$armor = 0;\n\t\t$item = $this->getBoots();\n\t\tif($item !== null && $item->getId() !== ItemIds::AIR){\n\t\t\tif($item instanceof LeatherBoots){\n\t\t\t\t$armor = 1;\n\t\t\t}else if($item instanceof GoldBoots){\n\t\t\t\t$armor = 1;\n\t\t\t}else if($item instanceof IronBoots){\n\t\t\t\t$armor = 2;\n\t\t\t}else if($item instanceof DiamondBoots){\n\t\t\t\t$armor = 3;\n\t\t\t}\n\t\t}\n\t\treturn $armor * 4;\n\t}",
"function drink_potion(){\n\t\t// FIXME: this just gets the first potion from inventory!! Not a specific potion!\n\t\t$result = mysql_query (\"SELECT * FROM phaos_char_inventory WHERE user = '\".$this->user.\"' AND type = 'potion'\");\n\t\tif ($row = mysql_fetch_array($result)) {\n\t\t\t$potion_id = $row[\"item_id\"];\n\t\t\t$inv_id = $row[\"id\"];\n\t\t\t$result = mysql_query (\"SELECT * FROM phaos_potion WHERE id = '$potion_id'\");\n\t\t\tif ($row = mysql_fetch_array($result)) {\t// if it's a valid potion\n\t\t\t\tlist($effect,$details) = split(' ',$row[\"effect\"]);\t// determine potion effect\n\t\t\t\tif ($effect == \"heal\") {\n\t\t\t\t\t$heal_amount=$details;\n\t\t\t\t\t$new_hp_amount = $this->hit_points + $heal_amount;\n\t\t\t\t\tif($new_hp_amount > $this->max_hp) {$new_hp_amount = $this->max_hp;}\n\n\t\t\t\t\t$query = (\"UPDATE players SET hit_points = $new_hp_amount WHERE id = '\".$this->id.\"'\");\n\t\t\t\t\t$req=mysql_query($query);\n\t\t\t\t\tif (!$req) {showError(__FILE__,__LINE__,__FUNCTION__); exit;}\n\n\t\t\t\t\t$result = mysql_query($query) or die (\"Error in query: $query. \" . mysql_error());\n\t\t\t\t\t$this->hit_points=$new_hp_amount;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function applyDamage(){\n\t\treturn $this->getRandomApplyingDamageValue($this->minDmg, $this->maxDmg);\n\t}",
"public function getPointsDefense()\n {\n return $this->pointsDefense;\n }",
"public function getDamage();",
"function calculateRepairArray($rid, $totalWreckefender, $targetUser, $fleetPointsDefender, $FleetDebrisA, $targetPlanet)\n{\n\t//Only defender\n\t//Units that don't count towards a wreck field: Defense units, and default fleets units + solar sattelites.\n\t//No acs\n\t\n\t//$this->_fleet['fleet_group']\n\t\t\n\tglobal $pricelist, $resource, $reslist;\n\t\n\t$sql\t\t= \"SELECT fleet_points, honor_points, honor_rank FROM %%STATPOINTS%% WHERE `universe` = :universe AND id_owner = :id_owner;\";\n\t$militaryDefender\t= Database::get()->selectSingle($sql, array(\n\t\t':universe'\t=> 1,\n\t\t':id_owner'\t=> $targetUser['id']\n\t));\n\t\n\tif($targetPlanet['planet_type'] == 3){\n\t\t$sql\t\t= \"SELECT * FROM %%PLANETS%% WHERE galaxy = :galaxy AND system = :system AND planet = :planet AND planet_type = 1;\";\n\t\t$targetPlanet\t= Database::get()->selectSingle($sql, array(\n\t\t\t':galaxy'\t=> $targetPlanet['galaxy'],\n\t\t\t':system'\t=> $targetPlanet['system'],\n\t\t\t':planet'\t=> $targetPlanet['planet']\n\t\t));\n\t}\n\t\n\tif($totalWreckefender == 0 && $fleetPointsDefender >= $militaryDefender['fleet_points'] /100 * 5 && $fleetPointsDefender >= 150000){\n\t\t\n\t\t$RID\t\t= $rid;\n\n\t\t$sql = \"SELECT \n\t\t\traport, time,\n\t\t\t(\n\t\t\t\tSELECT\n\t\t\t\tGROUP_CONCAT(username SEPARATOR ' & ') as attacker\n\t\t\t\tFROM %%USERS%%\n\t\t\t\tWHERE id IN (SELECT uid FROM %%TOPKB_USERS%% WHERE %%TOPKB_USERS%%.rid = %%RW%%.rid AND role = 1)\n\t\t\t) as attacker,\n\t\t\t(\n\t\t\t\tSELECT\n\t\t\t\tGROUP_CONCAT(username SEPARATOR ' & ') as defender\n\t\t\t\tFROM %%USERS%%\n\t\t\t\tWHERE id IN (SELECT uid FROM %%TOPKB_USERS%% WHERE %%TOPKB_USERS%%.rid = %%RW%%.rid AND role = 2)\n\t\t\t) as defender\n\t\t\tFROM %%RW%%\n\t\t\tWHERE rid = :reportID;\";\n\t\t$reportData = database::get()->selectSingle($sql, array(\n\t\t\t':reportID'\t=> $RID\n\t\t));\n\t\t\n\t\t$combatReport\t\t\t= unserialize($reportData['raport']);\n\t\t$combatReport\t\t\t= BCWrapperPreRev2321($combatReport);\n\t\t\n\t\t$NewQueue\t= array();\n\t\t$totalDebris = 100 - ($FleetDebrisA * 100);\n\t\t$buildingAffect = $totalDebris / 100 * (45 + (0.2 * $targetPlanet['xterium_dock']));\n\t\t\n\t\tforeach($combatReport['rounds'] as $Round => $RoundInfo){\n\t\t\t\n\t\t\tforeach($RoundInfo['defender'] as $Player){\n\t\t\t\t\n\t\t\t\tforeach($Player['ships'] as $ShipID => $ShipData){\n\t\t\t\t\t\n\t\t\t\t\t$shipAmount = 0;\n\t\t\t\t\t$fleetRepairId = array(202,203,204,205,206,207,209,211,213,214,215,216,217,218,219,221,222,224,225,226,227,228,229,230);\n\t\t\t\n\t\t\t\t\tif(in_array($ShipID,$fleetRepairId)){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$shipAmountBis = ($ShipData[4] - ($ShipData[4] * $FleetDebrisA));\n\t\t\t\t\t\t$shipAmountBis = $shipAmountBis / 100 * $buildingAffect;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$shipAmount += floor($shipAmountBis);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$Rebuild = 0;\n\t\t\t\t\t\n\t\t\t\t\tif($shipAmount > 0)\n\t\t\t\t\t\t$NewQueue[]\t= $ShipID.','.$Rebuild.','.floatToString($shipAmount);\n\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\tif(!empty($NewQueue)){\n\t\t\t$sql = \"INSERT INTO %%WRECKS%% SET userID = :userID, planetID = :planetID, wreck_array = :wreck_array, startTime = :startTime, expiredTime = :expiredTime;\";\n\t\t\tdatabase::get()->insert($sql, array(\n\t\t\t\t':userID' => $targetUser['id'],\n\t\t\t\t':planetID' => $targetPlanet['id'],\n\t\t\t\t':wreck_array' => implode(';', $NewQueue),\n\t\t\t\t':startTime' => TIMESTAMP,\n\t\t\t\t':expiredTime' => (TIMESTAMP + 48*3600)\n\t\t\t));\n\t\t}\n\t}\n\treturn true;\n}",
"public function recalculateHealth() {\n\t\t$petLevel = $this->getPet()->getPetLevel();\n\t\t$baseHealth = $this->getPet()->getLoader()->getBlockPetsConfig()->getBasePetHealth();\n\t\t$scalingHealth = $this->getPet()->getLoader()->getBlockPetsConfig()->getPetHealthPerLevel();\n\n\t\t$this->getPet()->setMaxHealth((int) $baseHealth + $scalingHealth * $petLevel);\n\t\t$this->getPet()->fullHeal();\n\t}",
"public function getMagicDefense()\n {\n $magicDefense = self::MAGICDEFENSE_BASE;\n $barriers = $this->getConstruction('Barreras');\n $magicDefense += floor($barriers->getQuantity() / (float)$barriers->getBuilding()->getMagicDefenseRatio());\n foreach ($this->enchantmentsVictim as $enchantment) {\n $magicDefense += $enchantment->getSpell()->getSkill()->getMagicDefenseBonus() * $enchantment->getOwner()->getMagic();\n }\n foreach ($this->items as $item) {\n $magicDefense += $item->getArtifact()->getSkill()->getMagicDefenseBonus();\n }\n foreach ($this->contracts as $contract) {\n $magicDefense += $contract->getHero()->getSkill()->getMagicDefenseBonus() * $contract->getLevel();\n }\n return max(self::MAGICDEFENSE_BASE, min(self::MAGICDEFENSE_CAP, $magicDefense));\n }",
"function get_heal_amount($w, $player, $tbName){\r\n\tglobal $petMaxHP, $petCurrHP, $oppMaxHP, $oppCurrHP;\r\n\t$con = connect_to_server();\r\n\t\r\n\tif($player == 'pet'){\r\n\t\t$maxHP = $petMaxHP;\r\n\t\t$currHP = $petCurrHP;\r\n\t}\r\n\telseif($player == 'opp'){\r\n\t\t$maxHP = $oppMaxHP;\r\n\t\t$currHP = $oppCurrHP;\r\n\t}\r\n\t\r\n\t$percentHealLimit = $maxHP - $currHP; //prevents percent-based healers from overhealing\r\n\t\r\n\t$sql = \"SELECT * FROM `$tbName` WHERE `id` = '$w'\";\r\n\t$result = mysqli_query($con, $sql);\r\n\t$result = mysqli_fetch_array($result);\r\n\t$useage = $result['useage'];\r\n\t$heal = $result['heal'];\r\n\t\r\n\t//check for conditional healing (cond,heal_true,heal_false) (istaff/wodf)\r\n\tif(substr($heal, 0, 1) == '('){\r\n\t\t$heal = str_replace(\"(\", \"\", $heal);\r\n\t\t$heal = str_replace(\")\", \"\", $heal);\r\n\t\t$heal = explode(\",\", $heal);\r\n\t\t$cond = $heal[0];\r\n\t\tif($cond > 1000){ //% condition\r\n\t\t\t$cond = ($cond - 1000) / 100;\r\n\t\t\t$hp = $currHP / $maxHP;\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$hp = $currHP;\r\n\t\t}\r\n\t\t\r\n\t\t//set heal amount\r\n\t\tif($hp <= $cond){\r\n\t\t\t$heal = $heal[1];\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$heal = $heal[2];\r\n\t\t}\r\n\t}\r\n\telseif(strpos($heal, ',') !== false){\r\n\t\t$getFlag = explode(',', $heal);\r\n\t\t$heal = $getFlag[0];\r\n\t\t$flag = $getFlag[1];\r\n\t}\r\n\t\r\n\tif($heal > 1000){ //indicates percent healer\r\n\t\tif(!isset($flag)){\r\n\t\t\t$healPercent = ($heal - 1000) / 100;\r\n\t\t\t$healAmt = $maxHP * $healPercent;\r\n\t\t\tif($healAmt > $percentHealLimit){ //percent healers can't overheal\r\n\t\t\t\t$healAmt = $percentHealLimit;\r\n\t\t\t}\r\n\t\t}\r\n\t\telseif($flag == 'm'){ //heal based on missing health\r\n\t\t\t$healPercent = ($heal - 1000) / 100;\r\n\t\t\t$healAmt = ($maxHP - $currHP) * $healPercent;\r\n\t\t\tif($healAmt > $percentHealLimit){ //percent healers can't overheal\r\n\t\t\t\t$healAmt = $percentHealLimit;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t//heal range\r\n\telseif(strpos($heal, \":\") !== false){\r\n\t\t$healRange = explode(\":\", $heal);\r\n\t\t$healMin = $healRange[0];\r\n\t\t$healMax = $healRange[1];\r\n\t\t$healAmt = rand($healMin, $healMax);\r\n\t}\r\n\telse{\r\n\t\t$healAmt = $heal;\r\n\t}\r\n\t\r\n\t//break\r\n\t\r\n\t\r\n\treturn $healAmt;\r\n}",
"public static function sumTargetHealBonus(stdClass $data){\n\t\t//limit max earrings to 2\n\t\tself::limit($data, array('oldEarrings', 'newEarrings'), 2);\n\n\t\tif(!$data->includeTargetBonus){\n\t\t\treturn 0;\n\t\t}\n\n\t\t$bonus = 0;\n\t\t$isMw = ($data->chestEnchant==ENCHANT_MW_NINE OR $data->chestEnchant==ENCHANT_MW_TWELVE);\n\n\t\t//earrings\n\t\t$bonus += $data->oldEarrings * BONUS_EARRING_OLD;\n\t\t$bonus += $data->newEarrings * BONUS_EARRING_NEW;\n\n\t\t//earring bonus stats\n\t\tif($data->earringBonusLeft){\n\t\t\t$bonus += MISC::getEarringBonusValue($data->earringBonusLeft);\n\t\t}\n\t\tif($data->earringBonusRight){\n\t\t\t$bonus += MISC::getEarringBonusValue($data->earringBonusRight);\n\t\t}\n\n\t\t//heart potion\n\t\tif($data->heartPotion){\n\t\t\t$bonus += BONUS_HEART_POTION;\n\t\t}\n\n\t\t//if chest is disabled, stop here\n\t\tif($data->chestType==TYPE_NONE){\n\t\t\treturn $bonus;\n\t\t}\n\n\t\t//base (current only)\n\t\tif($data->chestType==TYPE_CURRENT AND $data->chestBonusBase){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_OLD_BASE : BONUS_CHEST_OLD_PLAIN);\n\t\t}\n\n\t\t//+0 (current only)\n\t\tif($data->chestType==TYPE_CURRENT AND $data->chestBonusZero){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_OLD_BASE : BONUS_CHEST_OLD_PLAIN);\n\t\t}\n\n\t\t//plus\n\t\tif($data->chestType==TYPE_CURRENT AND $data->chestBonusPlus AND $data->chestEnchant!=ENCHANT_NONE){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_OLD : BONUS_CHEST_OLD_PLAIN);\n\t\t}\n\t\telseif($data->chestBonusPlus AND $data->chestEnchant!=ENCHANT_NONE){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_NEW : BONUS_CHEST_NEW_PLAIN);\n\t\t}\n\n\t\treturn $bonus;\n\t}",
"public function getDamagePerLevel() : float;",
"public function calculate_weapon_energy($this_object, &$energy_base = 0, &$energy_mods = 0){\n\n // If this is an item the weapon energy is zero\n if (isset($this_object->item_token)){\n\n // Return zero as items are free\n $energy_new = 0;\n $energy_base = 0;\n $energy_mods = 0;\n return 0;\n\n }\n // Otherwise if ability then we have to calculate\n elseif (isset($this_object->ability_token)){\n\n // Create an options object for this function and populate\n $options = rpg_game::new_options_object();\n $extra_objects = array('options' => $options, 'this_ability' => $this_object);\n $options->energy_base = &$energy_base;\n $options->energy_mods = &$energy_mods;\n $options->energy_new = $energy_base;\n\n // Trigger this robot's item function if one has been defined for this context\n $this->trigger_custom_function('rpg-robot_calculate-weapon-energy_before', $extra_objects);\n if ($options->return_early){ return $options->return_value; }\n\n // Define the return to the ability variable\n $this_ability = $this_object;\n $ability_info = $this_ability->export_array();\n\n // Define basic robot info for caluclations\n $robot_info = array();\n $robot_info['robot_token'] = $this->robot_token;\n $robot_info['robot_class'] = $this->robot_class;\n $robot_info['robot_core'] = empty($this->counters['core_disabled']) ? $this->robot_core : '';\n $robot_info['robot_core2'] = empty($this->counters['core_disabled']) ? $this->robot_core2 : '';\n $robot_info['robot_item'] = empty($this->counters['item_disabled']) ? $this->robot_item : '';\n $robot_info['robot_skill'] = empty($this->counters['skill_disabled']) ? $this->robot_skill : '';\n $robot_info['robot_rewards'] = $this->robot_rewards;\n\n // If this was the noweapons/chargeweapons action, everything is zero\n if (in_array($this_ability->ability_token, array('action-noweapons', 'action-chargeweapons', 'action-devpower-clearmission'))){\n $options->energy_new = 0;\n $options->energy_base = 0;\n $options->energy_mods = 0;\n return 0;\n }\n\n // Pass along variables to the static function and return\n $options->energy_new = self::calculate_weapon_energy_static($robot_info, $ability_info, $options->energy_base, $options->energy_mods);\n\n // Trigger this robot's custom function if one has been defined for this context\n $this->trigger_custom_function('rpg-robot_calculate-weapon-energy_after', $extra_objects);\n if ($options->return_early){ return $options->return_value; }\n\n // Return the new energy value, whatever it is\n return $options->energy_new;\n\n }\n\n }",
"public function getHealthPoints()\n {\n return $this->healthPoints;\n }",
"public function getArmor() {\n return $this->armor;\n }",
"private function GetCharacterSpellBonusDamage() {\n $tmp_stats = array();\n $holySchool = SPELL_SCHOOL_HOLY;\n $minModifier = Utils::GetSpellBonusDamage($holySchool, $this->guid, $this->db);\n \n for ($i=1;$i<7;$i++) {\n $bonusDamage[$i] = Utils::GetSpellBonusDamage($i, $this->guid, $this->db);\n $minModifier = min($minModifier, $bonusDamage);\n }\n $tmp_stats['holy'] = round($bonusDamage[1]);\n $tmp_stats['fire'] = round($bonusDamage[2]);\n $tmp_stats['nature'] = round($bonusDamage[3]);\n $tmp_stats['frost'] = round($bonusDamage[4]);\n $tmp_stats['shadow'] = round($bonusDamage[5]);\n $tmp_stats['arcane'] = round($bonusDamage[6]);\n $tmp_stats['attack'] = -1;\n $tmp_stats['damage'] = -1;\n if($this->class == CLASS_HUNTER || $this->class == CLASS_WARLOCK) {\n $shadow = Utils::GetSpellBonusDamage(5, $this->guid, $this->db);\n $fire = Utils::GetSpellBonusDamage(2, $this->guid, $this->db);\n $tmp_stats['attack'] = Utils::ComputePetBonus(6, max($shadow, $fire), $this->class);\n $tmp_stats['damage'] = Utils::ComputePetBonus(5, max($shadow, $fire), $this->class);\n }\n $tmp_stats['fromType'] = null;\n return $tmp_stats;\n }",
"function skill_armor_bonus(&$player_conf){\n \n $armor_skill = 0; // initial bonus\n $armor_id = $player_conf['armor'] + 10;\n $filter = \"WHERE skill_id = $armor_id\n AND player_id = {$player_conf['id']}\";\n $data = qdm_player_skills($filter);\n \n if( !empty($data) ){ \n \n $exp = $data[0]['exp'];\n $skill_data = calc_skill_exp($exp);\n $armor_skill = $skill_data['lvl'];\n $player_conf['armor_add'] = $player_conf['armor_add'] + $armor_skill;\n \n }\n}",
"function bonusdefense_pvp() {\n \n global $userrow, $monsterrow, $fightrow;\n \n if ($userrow[\"bonusdefense\"] > 0) {\n \n $first = $monsterrow[\"bonusdefense\"] * 0.25;\n $sec = $monsterrow[\"bonusdefense\"] * 0.5;\n $third = $monsterrow[\"bonusdefense\"] * 0.75;\n $rand = rand(0,100);\n \n if ($rand <= $first) { $multiplier = 0; } \n elseif ($rand <= $sec) { $multiplier = 0.25; } \n elseif ($rand <= $third) { $multiplier = 0.5; } \n elseif ($rand <= $monsterrow[\"bonusdefense\"] && $rand > $third) { $multiplier = 0.75; } \n else { $multiplier = 1; }\n \n \t$fightrow[\"playerphysdamage\"] = floor($fightrow[\"playerphysdamage\"] * $multiplier);\n \t$fightrow[\"playermagicdamage\"] = floor($fightrow[\"playermagicdamage\"] * $multiplier);\n \t$fightrow[\"playerfiredamage\"] = floor($fightrow[\"playerfiredamage\"] * $multiplier);\n \t$fightrow[\"playerlightdamage\"] = floor($fightrow[\"playerlightdamage\"] * $multiplier);\n \t\n }\n \n}",
"public function defenseLuck () {\n foreach ($this->specialSkills['defense'] as $name => $skill) {\n $randomLuck = rand(0, 100);\n if (($skill['chance'] > $randomLuck) && $skill['type'] == 'passive') {\n return $skill;\n }\n }\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
testing of shell commands | public function test_shell(){
//this particular shell command is pretty simple, in production you'll probably run some program such as a PHP script, bash script, or command line application. Remember if you're using an executable alias, you need to add them to your PATH variables, otherwise you need to absolute path.
//determines if the string "Windows" exists in php_uname() function
if(stripos(php_uname(), 'windows') !== false){
//we use the windows dir command
$cmd = 'dir';
}else{
//we use the unix ls command (for Linux and Mac)
$cmd = 'ls';
}
$output = array(); //empty array (exec will append to the array, not overwrite it)
$return_value = ''; //empty string
//this would echo out the LAST LINE of the output that would exist if you did this in the command line
echo exec($cmd, $output, $return_value);
//this would dump all of output lines as an array
var_dump($output);
//this should dump out the integer 0, or else there'd be an error!
var_dump($return_value);
} | [
"public function shellCommand($cmd);",
"public function testCommandExecution(): void\n {\n $this->artisan($this->getCommandSignature());\n $this->assertStringContainsString('Repository removed successfully', $this->console()->output());\n\n $this->artisan($this->getCommandSignature());\n $this->assertStringContainsString('Repository already not exists in your database', $this->console()->output());\n }",
"public function test_it_executes_command()\n\t{\n\t\t$paths = array(\n\t\t\tvfsStream::url('bin'),\n\t\t\tvfsStream::url('sbin'),\n\t\t);\n\n\t\t$mount = $this->_root\n\t\t\t->getChild('sbin/mount')\n\t\t\t->chmod(0544);\n\n\t\t$reader = new SysInfo_System_Reader_Command('mount', $paths);\n\n\t\ttry\n\t\t{\n\t\t\t$reader->read();\n\t\t}\n\t\tcatch(SysInfo_System_Reader_Exception $e)\n\t\t{\n\t\t\t$this->assertSame(127, $e->getCode());\n\t\t\t$this->assertStringStartsWith('Error executing command [ vfs://sbin/mount 2>&1 ] with the message', $e->getMessage());\n\t\t}\n\t}",
"function test_apertium_command() {\n\tglobal $config;\n\t\n\t$command_to_test = array($config['apertium_command'], $config['apertium_unformat_command']);\n\t$return = TRUE;\n\tforeach ($command_to_test as $command) {\n\t\tif (!test_command($command)) {\n\t\t\techo $command;\n\t\t\t$return = FALSE;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\t\t\t\n\treturn $return;\n}",
"public function testHandleCommands()\n {\n }",
"public function testSubCommandsNoArguments() {\n\t\t$this->Shell->runCommand('subCommands', array());\n\t\t$output = $this->Shell->stdout->output;\n\n\t\t$expected = '';\n\t\t$this->assertEquals($expected, $output);\n\t}",
"public function testCommands() {\n\t\t$result = $this->CommandTask->commands();\n\n\t\t$expected = array(\n\t\t\t'TestPlugin.example',\n\t\t\t'TestPlugin.test_plugin',\n\t\t\t'TestPluginTwo.example',\n\t\t\t'TestPluginTwo.welcome',\n\t\t\t'acl',\n\t\t\t'api',\n\t\t\t'bake',\n\t\t\t'command_list',\n\t\t\t'completion',\n\t\t\t'console',\n\t\t\t'i18n',\n\t\t\t'schema',\n\t\t\t'server',\n\t\t\t'test',\n\t\t\t'testsuite',\n\t\t\t'upgrade',\n\t\t\t'sample'\n\t\t);\n\t\t$this->assertEquals($expected, $result);\n\t}",
"public function it_can_chain_run_commands() : void\n {\n $framptClient = $this->createFramptClient();\n\n $this->mockNative('ssh2_exec', true);\n $this->mockNative('stream_set_blocking', true);\n $this->mockNative('stream_get_contents', \"Zweihander\\n\", \"Caduceus Kite Shield\\n\");\n\n $output = $framptClient->runCommand('echo $MAIN_HAND')\n ->runCommand('echo $OFF_HAND')->getStreamOutput();\n\n $this->assertEquals(\n \"Zweihander\\nCaduceus Kite Shield\\n\",\n $output\n );\n }",
"public function testGetShellCore() {\n\t\t$result = $this->CommandTask->getShell('core.bake');\n\t\t$this->assertInstanceOf('BakeShell', $result);\n\t}",
"public function testHandleCommands5()\n {\n }",
"public function testCommandNotFound(): void\n {\n $this->processFactory->addCommand(['failed_command']);\n $this->createCommad()->print('/dev/sdb');\n }",
"function testPingCommand()\n {\n $console = new Console();\n\n ob_start();\n\n $result = $console->findCommand(\"ping\")->execute();\n\n $out = ob_get_clean();\n\n $this->assertTrue($result);\n $this->assertSame(\"Pong!\\n\", $out);\n }",
"public function testExecuteCommand()\n {\n $this->commandTester->execute(\n array(\n 'command' => $this->command->getName(),\n )\n );\n\n $this->assertRegExp('/List of development\\/production machines/', $this->commandTester->getDisplay());\n $this->assertRegExp('/Machine name/', $this->commandTester->getDisplay());\n $this->assertRegExp('/Host address/', $this->commandTester->getDisplay());\n }",
"public function testSimplestCommand()\n {\n $expected = 'tesseract image.png stdout';\n\n $actual = (new WrapTesseractOCR('image.png'))\n ->buildCommand();\n\n $this->assertEquals($expected, $actual);\n }",
"public function test_shell_exec_stubbed()\n { $shell_stub = $this->getMock('Shell');\n $shell_stub->expects($this->once())\n ->method('shell_exec')\n ->with($this->equalTo('whoami'))\n ->will($this->returnValue('john braynard'));\n\n $this->assertEquals('john braynard', $shell_stub->shell_exec('whoami'));\n }",
"public function testActsAsCommand()\n {\n if ($this->flags & self::FLAG_ACTSASCOMMAND)\n {\n return true;\n }\n return false;\n }",
"public function testCommandExitCode(): void\n {\n $this->processFactory->addCommand(['/bin/bash', '-c', 'exit 1']);\n $this->driveDiscoveryCmd->detectSystemDrives();\n }",
"public function testRunningTestInChildDirectory() {\n $task = new ShellTask('ls', 'tests');\n $history = array();\n $site = $this->getSite($history);\n $task->run($site);\n $this->assertContains('ShellTaskTest.php', $task->getOutput());\n $this->assertContains('Running shell command `ls`...', $history);\n $this->assertContains(' > ShellTaskTest.php', $history);\n }",
"public function testDetectsEcho(): void\n {\n assertEquals(0, (new ShellWrapper())->run('echo'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a GitHub client with permissions for the user associated with the current SourceRepo | private function getAuthenticatedGithubClient(Project $project): ?Client
{
$user = $this->getProject()->getParentUser();
if (null === $user) {
$user = $this->getProject()->getParentOrganization()->getCreator();
}
return $this->githubApiService->getAuthenticatedClientForUser($user);
} | [
"public function getClient()\n\t{\n\t\t$client = new \\Github\\Client;\n\n\t\t$client->authenticate($this->config['token'], null, \\Github\\Client::AUTH_HTTP_TOKEN);\n\n\t\treturn $client;\n\t}",
"protected function getClient()\n {\n static $client;\n\n if (empty($client)) {\n $client = new Client('https://api.github.com');\n\n $client->setDefaultOption('auth', [\n $this->parameters['user'],\n $this->parameters['token'],\n 'Basic'\n ]);\n }\n\n return $client;\n }",
"private function getGithubUser()\n {\n return Socialite::with('github')->user();\n }",
"public static function client()\n {\n if (is_null(static::$client)) {\n static::$client = new Client();\n static::$client->authenticate(config('github.token'), Client::AUTH_HTTP_TOKEN);\n }\n\n return static::$client;\n }",
"private function getGithubClient(Project $project): Client\n {\n\n $user = $project->getParentUser();\n\n if (null === $user) {\n $user = $project->getParentOrganization()->getCreator();\n }\n\n return $this->githubApiService->getAuthenticatedClientForUser($user);\n }",
"public function getGitHub()\n {\n return $this->getApi('github');\n }",
"public function get(string $repo_path, string $token_settings_name) : GithubInterface {\n $github = $this->container->get('github.client');\n\n $token = $this->container->get('settings')->get($token_settings_name, '');\n\n try {\n if ($token) {\n $github->authenticate($token, NULL, AuthMethod::ACCESS_TOKEN);\n }\n }\n catch (InvalidArgumentException $e) {\n $this->logger->error('Invalid Github Token');\n throw new \\InvalidArgumentException('Invalid Github Token');\n }\n\n $githubAdapter = new GithubAdapter($github, $this->container->get('logger.factory'));\n $githubAdapter->setRepositoryPath($repo_path);\n\n return $githubAdapter;\n }",
"function github_oauth_url()\n{\n $CI =& get_instance();\n $CI->config->load('github');\n $id = $CI->config->item('github_id');\n\n return 'https://github.com/login/oauth/authorize?client_id=' . $id;\n}",
"protected function getGithubUser() {\n if ($this->_github_user === null) {\n $em = $this->getEntityManager();\n $githubUser_repo = $em->getRepository(\"RRavenLaughingbearBundle:GithubUser\");\n $this->_github_user = $githubUser_repo->findOneBy(array(\"login\" => $this->getUser()->getUsername()));\n }\n return $this->_github_user;\n }",
"function get_my_repos()\n {\n return $this->github_api_request('/user/repos');\n }",
"public function get_owner_oauth_client() {\n\t\tif ( $this->owner_oauth_client instanceof OAuth_Client ) {\n\t\t\treturn $this->owner_oauth_client;\n\t\t}\n\n\t\t$user_options = new User_Options( $this->context, $this->get_owner_id() );\n\n\t\t$this->owner_oauth_client = new OAuth_Client(\n\t\t\t$this->context,\n\t\t\t$this->options,\n\t\t\t$user_options,\n\t\t\t$this->authentication->credentials(),\n\t\t\t$this->authentication->get_google_proxy(),\n\t\t\tnew Profile( $user_options ),\n\t\t\tnew Token( $user_options )\n\t\t);\n\n\t\treturn $this->owner_oauth_client;\n\t}",
"public function getGithubUserId()\n {\n return $this->githubUserId;\n }",
"public function github(){\n\n\t\t$user = '';\n\t\tif(isset($this->request->get['user'])){\n\t\t\t$user = $this->request->get['user'];\n\t\t}\n\t\t$repo = '';\n\t\tif(isset($this->request->get['repo'])){\n\t\t\t$repo = $this->request->get['repo'];\n\t\t}\n\t\t$branch = '';\n\t\tif(isset($this->request->get['branch'])){\n\t\t\t$branch = $this->request->get['branch'];\n\t\t}\n\t\tnew d_shopunity\\GitHub($user, $repo, str_replace(\"catalog/\", \"\", DIR_APPLICATION), $branch );\n\t}",
"public function getGithubAccessToken()\n {\n return $this->githubAccessToken;\n }",
"public function get_oauth_client() {\n\t}",
"public function getRepo()\n {\n return $this->repo;\n }",
"protected function ghConnect($token) {\n $filesystemAdapter = new Local(APP . '/tmp/cache/github-api-cache');\n $filesystem = new Filesystem($filesystemAdapter);\n $pool = new FilesystemCachePool($filesystem);\n\n $client = new \\Github\\Client();\n $client->addCache($pool);\n\n $client->authenticate($token, null, Github\\Client::AUTH_HTTP_TOKEN);\n\n return $client;\n }",
"public function repo()\n {\n if ($this->getGuard() == 'admin') {\n return $this->adminRepo;\n }\n\n return $this->userRepo;\n }",
"public function listOwn() {\n\t\treturn $this->request('/user/repos');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GFForms css classes that inherit Avada's button typography settings. | function avada_gform_button_typography( $typography_elements ) {
if ( class_exists( 'GFForms' ) ) {
$typography_elements['family'][] = '.gform_wrapper .gform_button';
$typography_elements['family'][] = '.gform_wrapper .button';
$typography_elements['family'][] = '.gform_page_footer input[type="button"]';
}
return $typography_elements;
} | [
"function qode_button_v2_typography_styles() {\n $selector = '.qode-btn';\n $styles = array();\n\n $font_family = qode_options()->getOptionValue('button_v2_font_family');\n if(qode_is_font_option_valid($font_family)) {\n $styles['font-family'] = qode_get_font_option_val($font_family);\n }\n\n $text_transform = qode_options()->getOptionValue('button_v2_text_transform');\n if(!empty($text_transform)) {\n $styles['text-transform'] = $text_transform;\n }\n\n $font_style = qode_options()->getOptionValue('button_v2_font_style');\n if(!empty($font_style)) {\n $styles['font-style'] = $font_style;\n }\n\n $letter_spacing = qode_options()->getOptionValue('button_v2_letter_spacing');\n if($letter_spacing !== '') {\n $styles['letter-spacing'] = qode_filter_px($letter_spacing).'px';\n }\n\n $font_weight = qode_options()->getOptionValue('button_v2_font_weight');\n if(!empty($font_weight)) {\n $styles['font-weight'] = $font_weight;\n }\n\n echo qode_dynamic_css($selector, $styles);\n }",
"function sienna_mikado_button_typography_styles() {\n\t\t$selector = '.mkdf-btn';\n\t\t$styles = array();\n\n\t\t$font_family = sienna_mikado_options()->getOptionValue('button_font_family');\n\t\tif(sienna_mikado_is_font_option_valid($font_family)) {\n\t\t\t$styles['font-family'] = sienna_mikado_get_font_option_val($font_family);\n\t\t}\n\n\t\t$text_transform = sienna_mikado_options()->getOptionValue('button_text_transform');\n\t\tif(!empty($text_transform)) {\n\t\t\t$styles['text-transform'] = $text_transform;\n\t\t}\n\n\t\t$font_style = sienna_mikado_options()->getOptionValue('button_font_style');\n\t\tif(!empty($font_style)) {\n\t\t\t$styles['font-style'] = $font_style;\n\t\t}\n\n\t\t$letter_spacing = sienna_mikado_options()->getOptionValue('button_letter_spacing');\n\t\tif($letter_spacing !== '') {\n\t\t\t$styles['letter-spacing'] = sienna_mikado_filter_px($letter_spacing).'px';\n\t\t}\n\n\t\t$font_weight = sienna_mikado_options()->getOptionValue('button_font_weight');\n\t\tif(!empty($font_weight)) {\n\t\t\t$styles['font-weight'] = $font_weight;\n\t\t}\n\n\t\techo sienna_mikado_dynamic_css($selector, $styles);\n\t}",
"function gf_add_custom_css_classes( $button, $form ) {\n\n\t$dom = new DOMDocument();\n\t$dom->loadHTML( '<?xml encoding=\"utf-8\" ?>' . $button );\n\t$input = $dom->getElementsByTagName( 'input' )->item( 0 );\n\t$classes = $input->getAttribute( 'class' );\n\t$classes .= ' btn btn-secondary';\n\t$input->setAttribute( 'class', $classes );\n\treturn $dom->saveHtml( $input );\n\n}",
"function wps_add_custom_css_classes( $button, $form ) {\n\n\t\t$dom = new DOMDocument();\n\t\t$dom->loadHTML( '<?xml encoding=\"utf-8\" ?>' . $button );\n\t\t$input = $dom->getElementsByTagName( 'input' )->item( 0 );\n\t\t$classes = $input->getAttribute( 'class' );\n\t\t$classes .= ' btn btn-secondary';\n\t\t$input->setAttribute( 'class', $classes );\n\t\treturn $dom->saveHtml( $input );\n\n\t}",
"function wpex_get_button_classes( $style = '', $color = '', $size = '', $align = '' ) {\n\n\t// Extract if style is an array of arguments\n\tif ( is_array( $style ) ) {\n\t\textract( $style );\n\t}\n\n\t// Main classes\n\tif ( 'plain-text' == $style ) {\n\t\t$classes = 'theme-txt-link';\n\t} elseif ( $style ) {\n\t\t$classes = 'theme-button '. $style;\n\t} else {\n\t\t$classes = 'theme-button';\n\t}\n\n\t// Color\n\tif ( $color ) {\n\t\t$classes .= ' '. $color;\n\t}\n\n\t// Size\n\tif ( $size ) {\n\t\t$classes .= ' '. $size;\n\t}\n\n\t// Align\n\tif ( $align ) {\n\t\t$classes .= ' align-'. $align;\n\t}\n\n\t// Apply filters and return classes\n\treturn apply_filters( 'wpex_get_theme_button_classes', $classes, $style, $color, $size, $align );\n}",
"function wphooks_change_caldera_button_class( $field_html ) {\n\n $new_field_html = str_replace( 'btn', 'button', $field_html );\n return $new_field_html;\n\n}",
"public function additional_styles() { ?>\n <style id=\"cv-theme-settings-advanced-style\">\n .css-selector {\n font-family: 'Oxygen Mono';\n background: rgba(0,0,0,0.025);\n border-radius: 3px;\n padding: 5px;\n }\n </style>\n <?php }",
"function adaptivetheme_button($element) {\n if (isset($element['#attributes']['class'])) {\n $element['#attributes']['class'] = 'form-'. $element['#button_type'] .' '. $element['#attributes']['class'];\n }\n else {\n $element['#attributes']['class'] = 'form-'. $element['#button_type'];\n }\n\n // Wrap visible inputs with span tags for button graphics\n if (stristr($element['#attributes']['style'], 'display: none;') || stristr($element['#attributes']['class'], 'fivestar-submit')) {\n return '<input type=\"submit\" '. (empty($element['#name']) ? '' : 'name=\"'. $element['#name'] .'\" ') .'id=\"'. $element['#id'] .'\" value=\"'. check_plain($element['#value']) .'\" '. drupal_attributes($element['#attributes']) .\" />\\n\";\n }\n else {\n return '<span class=\"button-wrapper '. $element['#id'] .'\"><span class=\"button\"><input type=\"submit\" '. (empty($element['#name']) ? '' : 'name=\"'. $element['#name'] .'\" ') .'id=\"'. $element['#id'] .'\" value=\"'. check_plain($element['#value']) .'\" '. drupal_attributes($element['#attributes']) .\" /></span></span>\\n\";\n }\n}",
"function mixtape_qodef_contact_form7_button_styles_4() {\n\t\t$selector = array(\n\t\t\t'.cf7_custom_style_4 input.wpcf7-form-control.wpcf7-submit'\n\t\t);\n\t\t$styles = array();\n\n\t\t$color = mixtape_qodef_options()->getOptionValue('cf7_style_4_button_color');\n\t\tif($color !== ''){\n\t\t\t$styles['color'] = $color;\n\t\t}\n\n\t\t$font_size = mixtape_qodef_options()->getOptionValue('cf7_style_4_button_font_size');\n\t\tif($font_size !== ''){\n\t\t\t$styles['font-size'] = mixtape_qodef_filter_px($font_size) . 'px';\n\t\t}\n\n\t\t$height = mixtape_qodef_options()->getOptionValue('cf7_style_4_button_height');\n\t\tif($height !== ''){\n\t\t\t$styles['height'] = mixtape_qodef_filter_px($height) . 'px';\n\t\t}\n\n\t\t$font_family = mixtape_qodef_options()->getOptionValue('cf7_style_4_button_font_family');\n\t\tif(mixtape_qodef_is_font_option_valid($font_family)) {\n\t\t\t$styles['font-family'] = mixtape_qodef_get_font_option_val($font_family);\n\t\t}\n\n\t\t$font_style = mixtape_qodef_options()->getOptionValue('cf7_style_4_button_font_style');\n\t\tif(!empty($font_style)){\n\t\t\t$styles['font-style'] = $font_style;\n\t\t}\n\n\t\t$font_weight = mixtape_qodef_options()->getOptionValue('cf7_style_4_button_font_weight');\n\t\tif(!empty($font_weight)){\n\t\t\t$styles['font-weight'] = $font_weight;\n\t\t}\n\n\t\t$text_transform = mixtape_qodef_options()->getOptionValue('cf7_style_4_button_text_transform');\n\t\tif(!empty($text_transform)){\n\t\t\t$styles['text-transform'] = $text_transform;\n\t\t}\n\n\t\t$letter_spacing = mixtape_qodef_options()->getOptionValue('cf7_style_4_button_letter_spacing');\n\t\tif($letter_spacing !== ''){\n\t\t\t$styles['letter-spacing'] = mixtape_qodef_filter_px($letter_spacing) . 'px';\n\t\t}\n\n\t\t$background_color = mixtape_qodef_options()->getOptionValue('cf7_style_4_button_background_color');\n\t\t$background_opacity = 1;\n\t\tif($background_color !== ''){\n\t\t\tif(mixtape_qodef_options()->getOptionValue('cf7_style_4_button_background_transparency') != ''){\n\t\t\t\t$background_opacity = mixtape_qodef_options()->getOptionValue('cf7_style_4_button_background_transparency');\n\t\t\t}\n\t\t\t$styles['background-color'] = mixtape_qodef_rgba_color($background_color,$background_opacity);\n\t\t}\n\n\t\t$border_color = mixtape_qodef_options()->getOptionValue('cf7_style_4_button_border_color');\n\t\t$border_opacity = 1;\n\t\tif($border_color !== ''){\n\t\t\tif(mixtape_qodef_options()->getOptionValue('cf7_style_4_button_border_transparency') != ''){\n\t\t\t\t$border_opacity = mixtape_qodef_options()->getOptionValue('cf7_style_4_button_border_transparency');\n\t\t\t}\n\t\t\t$styles['border-color'] = mixtape_qodef_rgba_color($border_color,$border_opacity);\n\t\t}\n\n\t\t$border_width = mixtape_qodef_options()->getOptionValue('cf7_style_4_button_border_width');\n\t\tif($border_width !== ''){\n\t\t\t$styles['border-width'] = mixtape_qodef_filter_px($border_width) . 'px';\n\t\t}\n\n\t\t$border_radius = mixtape_qodef_options()->getOptionValue('cf7_style_4_button_border_radius');\n\t\tif($border_radius !== ''){\n\t\t\t$styles['border-radius'] = mixtape_qodef_filter_px($border_radius) . 'px';\n\t\t}\n\n\t\t$padding_left_right = mixtape_qodef_options()->getOptionValue('cf7_style_4_button_padding');\n\t\tif($padding_left_right !== ''){\n\t\t\t$styles['padding-left'] = mixtape_qodef_filter_px($padding_left_right) . 'px';\n\t\t\t$styles['padding-right'] = mixtape_qodef_filter_px($padding_left_right) . 'px';\n\t\t}\n\n\t\techo mixtape_qodef_dynamic_css($selector, $styles);\n\t}",
"function mixtape_qodef_contact_form7_button_styles_2() {\n\t\t$selector = array(\n\t\t\t'.cf7_custom_style_2 input.wpcf7-form-control.wpcf7-submit'\n\t\t);\n\t\t$styles = array();\n\n\t\t$color = mixtape_qodef_options()->getOptionValue('cf7_style_2_button_color');\n\t\tif($color !== ''){\n\t\t\t$styles['color'] = $color;\n\t\t}\n\n\t\t$font_size = mixtape_qodef_options()->getOptionValue('cf7_style_2_button_font_size');\n\t\tif($font_size !== ''){\n\t\t\t$styles['font-size'] = mixtape_qodef_filter_px($font_size) . 'px';\n\t\t}\n\n\t\t$height = mixtape_qodef_options()->getOptionValue('cf7_style_2_button_height');\n\t\tif($height !== ''){\n\t\t\t$styles['height'] = mixtape_qodef_filter_px($height) . 'px';\n\t\t}\n\n\t\t$font_family = mixtape_qodef_options()->getOptionValue('cf7_style_2_button_font_family');\n\t\tif(mixtape_qodef_is_font_option_valid($font_family)) {\n\t\t\t$styles['font-family'] = mixtape_qodef_get_font_option_val($font_family);\n\t\t}\n\n\t\t$font_style = mixtape_qodef_options()->getOptionValue('cf7_style_2_button_font_style');\n\t\tif(!empty($font_style)){\n\t\t\t$styles['font-style'] = $font_style;\n\t\t}\n\n\t\t$font_weight = mixtape_qodef_options()->getOptionValue('cf7_style_2_button_font_weight');\n\t\tif(!empty($font_weight)){\n\t\t\t$styles['font-weight'] = $font_weight;\n\t\t}\n\n\t\t$text_transform = mixtape_qodef_options()->getOptionValue('cf7_style_2_button_text_transform');\n\t\tif(!empty($text_transform)){\n\t\t\t$styles['text-transform'] = $text_transform;\n\t\t}\n\n\t\t$letter_spacing = mixtape_qodef_options()->getOptionValue('cf7_style_2_button_letter_spacing');\n\t\tif($letter_spacing !== ''){\n\t\t\t$styles['letter-spacing'] = mixtape_qodef_filter_px($letter_spacing) . 'px';\n\t\t}\n\n\t\t$background_color = mixtape_qodef_options()->getOptionValue('cf7_style_2_button_background_color');\n\t\t$background_opacity = 1;\n\t\tif($background_color !== ''){\n\t\t\tif(mixtape_qodef_options()->getOptionValue('cf7_style_2_button_background_transparency') != ''){\n\t\t\t\t$background_opacity = mixtape_qodef_options()->getOptionValue('cf7_style_2_button_background_transparency');\n\t\t\t}\n\t\t\t$styles['background-color'] = mixtape_qodef_rgba_color($background_color,$background_opacity);\n\t\t}\n\n\t\t$border_color = mixtape_qodef_options()->getOptionValue('cf7_style_2_button_border_color');\n\t\t$border_opacity = 1;\n\t\tif($border_color !== ''){\n\t\t\tif(mixtape_qodef_options()->getOptionValue('cf7_style_2_button_border_transparency') != ''){\n\t\t\t\t$border_opacity = mixtape_qodef_options()->getOptionValue('cf7_style_2_button_border_transparency');\n\t\t\t}\n\t\t\t$styles['border-color'] = mixtape_qodef_rgba_color($border_color,$border_opacity);\n\t\t}\n\n\t\t$border_width = mixtape_qodef_options()->getOptionValue('cf7_style_2_button_border_width');\n\t\tif($border_width !== ''){\n\t\t\t$styles['border-width'] = mixtape_qodef_filter_px($border_width) . 'px';\n\t\t}\n\n\t\t$border_radius = mixtape_qodef_options()->getOptionValue('cf7_style_2_button_border_radius');\n\t\tif($border_radius !== ''){\n\t\t\t$styles['border-radius'] = mixtape_qodef_filter_px($border_radius) . 'px';\n\t\t}\n\n\t\t$padding_left_right = mixtape_qodef_options()->getOptionValue('cf7_style_2_button_padding');\n\t\tif($padding_left_right !== ''){\n\t\t\t$styles['padding-left'] = mixtape_qodef_filter_px($padding_left_right) . 'px';\n\t\t\t$styles['padding-right'] = mixtape_qodef_filter_px($padding_left_right) . 'px';\n\t\t}\n\n\t\techo mixtape_qodef_dynamic_css($selector, $styles);\n\t}",
"public function format_a_tags() {\r\n\t\t\r\n\t\t$this->skin_css .= '.'. $this->skin_slug .' a:not([class*=\"tg-element-\"]),'. \"\\r\\n\";\r\n\t\t$this->skin_css .= '.'. $this->skin_slug .' a:not([class*=\"tg-element-\"]):active,'. \"\\r\\n\";\r\n\t\t$this->skin_css .= '.'. $this->skin_slug .' a:not([class*=\"tg-element-\"]):focus,'. \"\\r\\n\";\r\n\t\t$this->skin_css .= '.'. $this->skin_slug .' .tg-item-price ins,'. \"\\r\\n\";\r\n\t\t$this->skin_css .= '.'. $this->skin_slug .' .tg-media-button i {'. \"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". 'height: auto;'. \"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". 'width: auto;'. \"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". 'margin: 0;'. \"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". 'padding: 0;'. \"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". 'color: inherit !important;'.\"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". 'text-align: inherit !important;'.\"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". 'font-size: inherit !important;'.\"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". 'font-style: inherit !important;'.\"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". 'line-height: inherit !important;'.\"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". 'font-weight: inherit !important;'.\"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". 'text-transform: inherit !important;'.\"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". 'text-decoration: inherit !important;'.\"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". 'border: none;'. \"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". '-webkit-box-shadow: none;'. \"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". 'box-shadow: none;'. \"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". '-webkit-transition: opacity 0.25s ease, color 0.25s ease;'. \"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". '-moz-transition: opacity 0.25s ease, color 0.25s ease;'. \"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". '-ms-transition: opacity 0.25s ease, color 0.25s ease;'. \"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". '-o-transition: opacity 0.25s ease, color 0.25s ease;'. \"\\r\\n\";\r\n\t\t$this->skin_css .= \"\\t\". 'transition: opacity 0.25s ease, color 0.25s ease;'. \"\\r\\n\";\r\n\t\t$this->skin_css .= '}'. \"\\r\\n\";\r\n\r\n\t}",
"function superfood_elated_contact_form7_button_styles_1() {\n\t\t$selector = array(\n\t\t\t'.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-submit'\n\t\t);\n\t\t$styles = array();\n\n\t\t$color = superfood_elated_options()->getOptionValue('cf7_style_1_button_color');\n\t\tif($color !== ''){\n\t\t\t$styles['color'] = $color;\n\t\t}\n\n\t\t$font_size = superfood_elated_options()->getOptionValue('cf7_style_1_button_font_size');\n\t\tif($font_size !== ''){\n\t\t\t$styles['font-size'] = superfood_elated_filter_px($font_size) . 'px';\n\t\t}\n\n\t\t$height = superfood_elated_options()->getOptionValue('cf7_style_1_button_height');\n\t\tif($height !== ''){\n\t\t\t$styles['height'] = superfood_elated_filter_px($height) . 'px';\n\t\t\t$styles['line-height'] = superfood_elated_filter_px($height) . 'px';\n\t\t}\n\n\t\t$font_family = superfood_elated_options()->getOptionValue('cf7_style_1_button_font_family');\n\t\tif(superfood_elated_is_font_option_valid($font_family)) {\n\t\t\t$styles['font-family'] = superfood_elated_get_font_option_val($font_family);\n\t\t}\n\n\t\t$font_style = superfood_elated_options()->getOptionValue('cf7_style_1_button_font_style');\n\t\tif(!empty($font_style)){\n\t\t\t$styles['font-style'] = $font_style;\n\t\t}\n\n\t\t$font_weight = superfood_elated_options()->getOptionValue('cf7_style_1_button_font_weight');\n\t\tif(!empty($font_weight)){\n\t\t\t$styles['font-weight'] = $font_weight;\n\t\t}\n\n\t\t$text_transform = superfood_elated_options()->getOptionValue('cf7_style_1_button_text_transform');\n\t\tif(!empty($text_transform)){\n\t\t\t$styles['text-transform'] = $text_transform;\n\t\t}\n\n\t\t$letter_spacing = superfood_elated_options()->getOptionValue('cf7_style_1_button_letter_spacing');\n\t\tif($letter_spacing !== ''){\n\t\t\t$styles['letter-spacing'] = superfood_elated_filter_px($letter_spacing) . 'px';\n\t\t}\n\n\t\t$background_color = superfood_elated_options()->getOptionValue('cf7_style_1_button_background_color');\n\t\t$background_opacity = 1;\n\t\tif($background_color !== ''){\n\t\t\tif(superfood_elated_options()->getOptionValue('cf7_style_1_button_background_transparency') !== ''){\n\t\t\t\t$background_opacity = superfood_elated_options()->getOptionValue('cf7_style_1_button_background_transparency');\n\t\t\t}\n\t\t\t$styles['background-color'] = superfood_elated_rgba_color($background_color,$background_opacity);\n\t\t}\n\n\t\t$border_color = superfood_elated_options()->getOptionValue('cf7_style_1_button_border_color');\n\t\t$border_opacity = 1;\n\t\tif($border_color !== ''){\n\t\t\tif(superfood_elated_options()->getOptionValue('cf7_style_1_button_border_transparency') !== ''){\n\t\t\t\t$border_opacity = superfood_elated_options()->getOptionValue('cf7_style_1_button_border_transparency');\n\t\t\t}\n\t\t\t$styles['border-color'] = superfood_elated_rgba_color($border_color,$border_opacity);\n\t\t}\n\n\t\t$border_width = superfood_elated_options()->getOptionValue('cf7_style_1_button_border_width');\n\t\tif($border_width !== ''){\n\t\t\t$styles['border-width'] = superfood_elated_filter_px($border_width) . 'px';\n\t\t}\n\n\t\t$border_radius = superfood_elated_options()->getOptionValue('cf7_style_1_button_border_radius');\n\t\tif($border_radius !== ''){\n\t\t\t$styles['border-radius'] = superfood_elated_filter_px($border_radius) . 'px';\n\t\t}\n\n\t\t$padding_left_right = superfood_elated_options()->getOptionValue('cf7_style_1_button_padding');\n\t\tif($padding_left_right !== ''){\n\t\t\t$styles['padding-left'] = superfood_elated_filter_px($padding_left_right) . 'px';\n\t\t\t$styles['padding-right'] = superfood_elated_filter_px($padding_left_right) . 'px';\n\t\t}\n\n\t\techo superfood_elated_dynamic_css($selector, $styles);\n\t}",
"private function getButtonStyles()\n {\n $css = '<style type=\"text/css\">\n .mklibexport {\n display: block;\n position: relative;\n }\n .mklibexport .imgbtn {\n position: relative;\n margin: 5px;\n float: left;\n }\n .mklibexport .imgbtn span.t3-icon,\n .mklibexport .imgbtn span.t3js-icon{\n left: 8px;\n margin: 0;\n position: absolute;\n }\n .mklibexport .imgbtn span.t3-icon{\n top: 2px;\n }\n .mklibexport .imgbtn span.t3js-icon{\n top: 4px;\n }\n .mklibexport span.info {\n display: none;\n position: absolute;\n padding: 5px;\n top: 25px\n }\n .mklibexport:hover span.info {\n display: block;\n }\n .mklibexport input[type=\"submit\"] {\n float: none;\n padding-left: 24px;\n }\n </style>';\n // alle umbrüche und tabs entfernen\n return str_replace([\"\\t\", \"\\n\", \"\\r\"], '', $css);\n }",
"public function start_typography_controls() {\r\n\t\t/**\r\n\t\t * Instantiate the Epsilon Typography object\r\n\t\t */\r\n\t\t$options = array(\r\n\t\t\t'stuff_typography_headings',\r\n\t\t\t'stuff_paragraphs_typography',\r\n\t\t);\r\n\r\n\t\t$handler = 'theme-css';\r\n\t\tEpsilon_Typography::get_instance( $options, $handler );\r\n\t}",
"function pt_buttons_css() {\n\t\twp_register_style ( 'shortcodes-buttons', PublishThis_Shortcodes::shortcodes_base_dir () . 'assets/css/shortcodes-buttons.css', false, '1.0.0' );\n\t\twp_enqueue_style ( 'shortcodes-buttons' );\n\t}",
"private function add_base_classes() {\n $this->classes[] = 'input-group';\n $this->classes[] = 'wpcsl-' . $this->type;\n }",
"private function get_button_style($type){\n $type .= \"_\";\n $style = array();\n $style['class'][] = 'payqr-button';\n $style['class'][] = $this->getOption($type . 'button_color');\n $style['class'][] = $this->getOption($type . 'button_form');\n $style['class'][] = $this->getOption($type . 'button_gradient');\n $style['class'][] = $this->getOption($type . 'button_text_case');\n $style['class'][] = $this->getOption($type . 'button_text_width');\n $style['class'][] = $this->getOption($type . 'button_text_size');\n $style['class'][] = $this->getOption($type . 'button_shadow');\n $style['style'][] = 'height:' . $this->getOption($type . 'button_height') . ';';\n $style['style'][] = 'width:' . $this->getOption($type . 'button_width') . ';';\n return $style;\n }",
"public function optin_form_css();",
"protected function compile()\n {\n if (!$this->bootstrap_buttonStyle) {\n $this->bootstrap_buttonStyle = 'btn-default';\n }\n\n $buttons = Factory::createFromFieldset($this->bootstrap_buttons);\n $buttons->eachChild(array($this, 'addButtonStyle'));\n\n $this->Template->buttons = $buttons;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is this order line for applying a shipping fee? | public function isShippingFee()
{
return $this->type === OrderLineType::TYPE_SHIPPING_FEE;
} | [
"public function isPaymentOnShipping();",
"public function hasShipping();",
"public function isShipping();",
"protected function _hasShipping()\n {\n return true;\n }",
"public function hasFreeShipping()\n {\n return false;\n }",
"public function isFee(){\r\n return (bool) preg_match('/Fee/', $this->getTaxName());\r\n }",
"public function has_shipping_address()\n {\n }",
"public function isFreeOrder()\n {\n return $this->staff_free_order || $this->order_type->id == 3 || $this->total_cost == 0;\n }",
"private function isShippingAddressDefined()\n {\n return $this->quote->getShippingAddress()\n && $this->quote->getShippingAddress()->getPostcode();\n }",
"public function isShippingAddressType()\n {\n return ($this->getAddressType() == self::TYPE_SHIPPING) ? true : false;\n }",
"public function shippingMatchesBillingAddress(): bool;",
"public function needs_shipping()\n {\n }",
"protected function hasShippingData()\n {\n return (bool) $this->getShipmentMethod();\n }",
"public function enable_free_shipping() {\n\t\treturn $this->free_shipping == 'yes' ? true : false;\n\t}",
"public function hasFreeShipping()\n\t{\n\t\treturn $this->freeShipping;\n\t}",
"public function requiresShipping()\n\t{\n\t\treturn ! $this->items()->with('orderable')->get([\n\t\t\t'orderable_id', 'orderable_type'\n\t\t])->filter(function($item) {\n\t\t\treturn $item->orderable->shipping_band_id > 0;\n\t\t})->isEmpty();\n\t}",
"public function hasAfterPaymentShipmentSection();",
"public function isExemptFromShipping();",
"public function areShippingMethodsAvailable()\n {\n /** @var Oggetto_OnepageCheckout_Model_Onepage $onepage */\n $onepage = Mage::getModel('onepageCheckout/onepage');\n $validationResult = $onepage->saveShipping($this->getAddress()->getData(), null);\n return !(bool)count($validationResult);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return an instance of WPXDeflectorExtensionTemplateConfiguration class from the database or onfly. | public static function init() {
$instance = parent::init( self::CONFIGURATION_NAME, __CLASS__ );
/* Or if the obfly version is different from stored version. */
if( version_compare( $instance->version, WPXDEFLECTOREXTENSIONTEMPLATE_VERSION ) < 0 ) {
/* For i.e. you would like update the version property. */
$instance->version = WPXDEFLECTOREXTENSIONTEMPLATE_VERSION;
$instance->update();
}
return $instance;
} | [
"protected function getExtensionDiscovery() {\n return new ExtensionDiscovery($this->root);\n }",
"protected function getSonata_Admin_Twig_ExtensionService()\n {\n $this->services['sonata.admin.twig.extension'] = $instance = new \\Sonata\\AdminBundle\\Twig\\Extension\\SonataAdminExtension(($this->services['sonata.admin.pool'] ?? $this->getSonata_Admin_PoolService()), ($this->privates['monolog.logger'] ?? $this->getMonolog_LoggerService()), ($this->services['translator'] ?? $this->getTranslatorService()), $this, ($this->services['security.authorization_checker'] ?? $this->getSecurity_AuthorizationCheckerService()));\n\n $instance->setXEditableTypeMapping($this->parameters['sonata.admin.twig.extension.x_editable_type_mapping']);\n\n return $instance;\n }",
"protected function getSonata_Admin_Twig_ExtensionService()\n {\n $this->services['sonata.admin.twig.extension'] = $instance = new \\Sonata\\AdminBundle\\Twig\\Extension\\SonataAdminExtension(${($_ = isset($this->services['sonata.admin.pool']) ? $this->services['sonata.admin.pool'] : $this->get('sonata.admin.pool')) && false ?: '_'}, ${($_ = isset($this->services['logger']) ? $this->services['logger'] : $this->get('logger', ContainerInterface::NULL_ON_INVALID_REFERENCE)) && false ?: '_'}, ${($_ = isset($this->services['translator']) ? $this->services['translator'] : $this->get('translator')) && false ?: '_'}, $this);\n\n $instance->setXEditableTypeMapping(array('choice' => 'select', 'boolean' => 'select', 'text' => 'text', 'textarea' => 'textarea', 'html' => 'textarea', 'email' => 'email', 'string' => 'text', 'smallint' => 'text', 'bigint' => 'text', 'integer' => 'number', 'decimal' => 'number', 'currency' => 'number', 'percent' => 'number', 'url' => 'url', 'date' => 'date'));\n\n return $instance;\n }",
"public function getDefaultConfigurationBuilder() {\n\t\treturn new Tx_Yag_Domain_Configuration_ConfigurationBuilder($this->tsConfigArray['plugin']['tx_yag']['settings']);\n\t}",
"public function getConfigClass();",
"public static function instance() {\n return Doctrine::getTable('UserConfiguration');\n }",
"public function getExtensionConfiguration()\n {\n return $this->extensionConfiguration;\n }",
"public static function init() {\n static $instance = false;\n\n if ( ! $instance ) {\n $instance = new WPUF_Email_Templates();\n }\n\n return $instance;\n }",
"static public function findExtensionConfiguration() {\n\t\t$extConf = (array) @unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::EXTENSION_KEY]);\n\t\treturn \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::removeDotsFromTS($extConf);\n\t}",
"public function getTemplateConfiguration()\n {\n return $this->_templateConfiguration;\n }",
"public static function getInstance() {\n if (!isset(self::$instance)) {\n self::$instance = new ZtExtensions();\n }\n if (isset(self::$instance)) {\n return self::$instance;\n }\n }",
"protected function getConfiguration ()\n {\n return new Configuration();\n }",
"public function getEngine()\n {\n $engine = $this->_application->config('template_engine');\n\n if (is_object($engine)) {\n $this->_setEngineWithObject($engine);\n } else {\n $configClass = __NAMESPACE__ . '\\\\Driver\\\\' . $engine;\n $engineClass = get_class((object)$this->_engine);\n\n if (strtolower($engineClass) != strtolower($configClass)) {\n $this->_getEngineWithString($configClass);\n } else {\n $this->_engine->updateConfig();\n }\n }\n\n return $this->_engine;\n }",
"public static function config()\n {\n if (self::$config === null)\n {\n self::$config = new DocBlox_Core_Config(dirname(__FILE__) . '/../../../data/docblox.tpl.xml');\n }\n\n return self::$config;\n }",
"public static function getExtensionConfiguration() {\n\t\treturn unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['powermail']);\n\t}",
"public function getConfigClass() {\n return null;\n }",
"public function getLumberjackGridFieldConfig()\n {\n return GridFieldConfig_BlogPost::create();\n }",
"protected function getConfiguration()\n {\n return new Configuration();\n }",
"public static function getInstance()\n {\n\n return Doctrine_Core::getTable( 'PluginDinLanguageDictionaryPair' );\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes an associated TenFAssessmentAsGroup | public function DeleteAssociatedTenFAssessmentAsGroup(TenFAssessment $objTenFAssessment) {
if ((is_null($this->intId)))
throw new QUndefinedPrimaryKeyException('Unable to call UnassociateTenFAssessmentAsGroup on this unsaved GroupAssessmentList.');
if ((is_null($objTenFAssessment->Id)))
throw new QUndefinedPrimaryKeyException('Unable to call UnassociateTenFAssessmentAsGroup on this GroupAssessmentList with an unsaved TenFAssessment.');
// Get the Database Object for this Class
$objDatabase = GroupAssessmentList::GetDatabase();
// Perform the SQL Query
$objDatabase->NonQuery('
DELETE FROM
`ten_f_assessment`
WHERE
`id` = ' . $objDatabase->SqlVariable($objTenFAssessment->Id) . ' AND
`group_id` = ' . $objDatabase->SqlVariable($this->intId) . '
');
// Journaling
if ($objDatabase->JournalingDatabase) {
$objTenFAssessment->Journal('DELETE');
}
} | [
"public function delete_group_assessor()\n {\n $sql = \"DELETE FROM pefs_database.pef_group_assessor WHERE gro_grp_id=?\";\n $this->db->query(\n $sql,\n array($this->gro_grp_id)\n );\n }",
"public function DeleteGroupAssessmentList() {\n\t\t\t$this->objGroupAssessmentList->UnassociateAllUsersAsAssessmentManager();\n\t\t\t$this->objGroupAssessmentList->Delete();\n\t\t}",
"public function DeleteGroup() {\n\t\t\t$this->objGroup->Delete();\n\t\t}",
"public function deleteGroup()\n {\n // If the group has system attributes, we can't delete it.\n if ($this->groupProtected) {\n $this->notify(\n __('adminhub::notifications.attribute-groups.delete_protected')\n );\n\n return;\n }\n DB::transaction(function () {\n DB::table(config('getcandy.database.table_prefix').'attributables')\n ->whereIn(\n 'attribute_id',\n $this->attributeGroupToDelete->attributes()->pluck('id')->toArray()\n )->delete();\n $this->attributeGroupToDelete->attributes()->delete();\n $this->attributeGroupToDelete->delete();\n });\n $this->deleteGroupId = null;\n $this->refreshGroups();\n\n $this->notify(\n __('adminhub::notifications.attribute-groups.deleted')\n );\n }",
"public function actionDeleteTagGroup()\n\t{\n\t\t$this->requirePostRequest();\n\t\t$this->requireAjaxRequest();\n\t\tcraft()->userSession->requireAdmin();\n\n\t\t$sectionId = craft()->request->getRequiredPost('id');\n\n\t\tcraft()->tags->deleteTagGroupById($sectionId);\n\t\t$this->returnJson(array('success' => true));\n\t}",
"public function DeleteGroupParticipation() {\n\t\t\t$this->objGroupParticipation->Delete();\n\t\t}",
"public function deletegroupAction()\n {\n \t$this->_helper->viewRenderer->setNoRender();\n \t\n \t$group = GroupNamespace::getCurrentGroup();\n \tif (isset($group))\n \t{\n \t\tGroupDAO::getGroupDAO()->deleteGroup($group);\n \t}\n \tGroupNamespace::clearCurrentGroup();\n \t$this->_helper->redirector('index', 'user');\n }",
"public function delete_group($group_id, $skip_group = false);",
"protected function actionGroupDelete() {\r\n //Delete memberships\r\n $objGroup = new class_module_user_group($this->getSystemid());\r\n //delete group\r\n if($objGroup->deleteObject()) {\r\n $this->adminReload(getLinkAdminHref($this->arrModule[\"modul\"], \"groupList\"));\r\n }\r\n else {\r\n throw new class_exception($this->getLang(\"gruppe_loeschen_fehler\"), class_exception::$level_ERROR);\r\n }\r\n }",
"public function delete_field_group($field_group)\n {\n }",
"public function testDelete(){\n $this->browse(function (Browser $browser){\n $customFieldGroup = factory(CustomFieldGroup::class)->create();\n\n $browser->loginAs($this->getAnAdmin()->userID, 'admin')\n ->visit('admin/'.\\App::getLocale().'/custom-fields/list')\n ->waitUntilMissing('@spinner')\n ->click('#toggleListBtn'.$customFieldGroup->customFieldGroupID)\n ->click('#deleteItemBtn'.$customFieldGroup->customFieldGroupID)\n ->waitFor('.noty_type__success')\n ->assertVisible('.noty_type__success');\n\n CustomFieldGroup::destroy($customFieldGroup->customFieldGroupID);\n });\n }",
"function testGroupDelete()\r\n {\r\n // instantiate notes controller\r\n $notesController = new NotesController($this->ant, $this->user);\r\n $notesController->debug = true;\r\n \r\n $params['name'] = \"UnitTest GroupName\";\r\n $params['color'] = \"eeeeee\"; \r\n \r\n // create group data\r\n $gid = $notesController->groupAdd($params);\r\n $this->assertTrue($gid > 0);\r\n \r\n // test group delete\r\n $params['gid'] = $gid;\r\n $ret = $notesController->groupDelete($params);\r\n $this->assertTrue($ret > 0);\r\n $this->assertEquals($ret, $gid);\r\n }",
"public static function delete()\r\n {\r\n if(!self::user()->hasPerm('groups_delete'))\r\n Json::printError('You are not allowed for the requested action!');\r\n $val = \\CAT\\Helper\\Validate::getInstance();\r\n $id = $val->sanitizePost('id');\r\n if(!\\CAT\\Helper\\Groups::exists($id))\r\n Json::printError('No such group!');\r\n $group = \\CAT\\Groups::getInstance()->getGroup($id);\r\n if($group['builtin']=='Y')\r\n Json::printError('Built-in elements cannot be removed!');\r\n $res = \\CAT\\Helper\\Groups::removeGroup($id);\r\n Base::json_result($res,($res?'':'Failed!'),($res?true:false));\r\n }",
"public function deleteFromGroup()\n {\n $this->rbacRepository->deleteRbacModel(Request::get('id'), Permission::class);\n }",
"public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/group-activity/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('GroupActivity', 'groupActivityId', self::$objectId);\n }",
"public function delete($grupo_linea_investigacion);",
"public function DeleteAllKingdomBusinessAssessmentsAsGroup() {\n\t\t\tif ((is_null($this->intId)))\n\t\t\t\tthrow new QUndefinedPrimaryKeyException('Unable to call UnassociateKingdomBusinessAssessmentAsGroup on this unsaved GroupAssessmentList.');\n\n\t\t\t// Get the Database Object for this Class\n\t\t\t$objDatabase = GroupAssessmentList::GetDatabase();\n\n\t\t\t// Journaling\n\t\t\tif ($objDatabase->JournalingDatabase) {\n\t\t\t\tforeach (KingdomBusinessAssessment::LoadArrayByGroupId($this->intId) as $objKingdomBusinessAssessment) {\n\t\t\t\t\t$objKingdomBusinessAssessment->Journal('DELETE');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Perform the SQL Query\n\t\t\t$objDatabase->NonQuery('\n\t\t\t\tDELETE FROM\n\t\t\t\t\t`kingdom_business_assessment`\n\t\t\t\tWHERE\n\t\t\t\t\t`group_id` = ' . $objDatabase->SqlVariable($this->intId) . '\n\t\t\t');\n\t\t}",
"public function fb_delete_group()\n {\n // Make sure that the store has a registered Firebase group\n if (!$this->fb_notification_key) {\n Log::warning(\"FB: Store {$this->code} doesn't have a valid fb_notification_key, ignoring request to delete group from Firebase!\");\n return;\n }\n\n // Deleting all the registered devices deletes the group\n $deviceIds = $this->users->pluck('fb_device_id')->filter(function ($id) {return isset($id);});\n\n // Perform the Firebase request with the required parameters\n $response = fb_curl_post([\n \"operation\" => \"remove\",\n \"notification_key_name\" => $this->code,\n \"notification_key\" => $this->fb_notification_key,\n \"registration_ids\" => $deviceIds,\n ]);\n\n // Log result of the Firebase request\n if ($response && !isset($response->error)) {\n Log::info(\"FB: Firebase group deletion for store {$this->code} completed with response \" . print_r($response, true));\n } else {\n Log::error(\"FB: Firebase group deletion for store {$this->code} failed with response \" . print_r($response, true));\n }\n }",
"function testGroupDelete()\r\n {\r\n // instantiate controllers\r\n $customerController = new CustomerController($this->ant, $this->user);\r\n $customerController->debug = true;\r\n \r\n // add group data first\r\n $params['name'] = \"UnitTest PersonalGroup\";\r\n $params['color'] = \"eeeeee\";\r\n $gid = $customerController->groupAdd($params);\r\n $this->assertTrue(count($gid ) > 0);\r\n \r\n // test group delete\r\n $params['gid'] = $gid;\r\n $ret = $customerController->groupDelete($params);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Encodes Page Builder Meta Data to json format to handle PHP `serialize` issues with UTF8 characters WordPress `update_post_meta` serializes the data and in some cases (probably depends on hostng env.) the serialized data is not being unserialized Uses `json_encode` | public static function encode_pb_metadata( $meta ) {
if ( ! is_array( $meta ) ) {
return wp_slash( $meta );
}
return wp_slash( json_encode( self::sanitize_metadata( $meta ) ) );
} | [
"function _wpsc_encode_meta_value( $value ) {\n\t$value = base64_encode( serialize( $value ) );\n\treturn $value;\n}",
"public function json_wds_postmeta() {\n\t\t$data = $this->get_request_data();\n\t\t$id = (int) $data['id'];\n\t\t$post = get_post( $id );\n\t\tdie( wp_json_encode( array(\n\t\t\t'title' => smartcrawl_get_value( 'title', $id ),\n\t\t\t'description' => smartcrawl_get_value( 'metadesc', $id ),\n\t\t\t'focus' => smartcrawl_get_value( 'focus-keywords', $id ),\n\t\t) ) );\n\t}",
"public function encodeMetadata() {\n $metaArr = array();\n foreach (self::$metadataKeys as $key) {\n if (!empty($this->{$key}))\n $metaArr[$key] = $this->{$key};\n }\n return json_encode($metaArr);\n }",
"public function filter_meta() {\n\t\tadd_filter( 'sanitize_post_meta_' . $this->meta_key, array( $this, 'allow_escaped_json_meta' ), 10, 3 );\n\t}",
"public function AddPageMeta() {\n $this->Permission('VanillaCMS.Pages.Manage');\n $this->DeliveryType(DELIVERY_TYPE_BOOL);\n $this->DeliveryMethod(DELIVERY_METHOD_JSON);\n $this->SetHeader('Content-Type', 'application/json');\n \n $TransientKey = GetIncomingValue('TransientKey', '');\n $PageMetaID = GetIncomingValue('PageMetaID');\n $PageID = GetIncomingValue('PageID', '');\n $MetaKey = GetIncomingValue('MetaKey', '');\n $MetaKeyName = GetIncomingValue('MetaKeyName', '');\n $MetaValue = htmlspecialchars(GetIncomingValue('MetaValue', '')) ;\n $MetaAsset = GetIncomingValue('MetaAsset', '');\n $MetaAssetName = GetIncomingValue('MetaAssetName', '');\n \n $InfoArray = self::AvailableModules('echo');\n \n $ApplicationFolder = 'vanillacms';\n if ($InfoArray[$MetaKey]['ApplicationFolder']) {\n $ApplicationFolder = $InfoArray[$MetaKey]['ApplicationFolder'];\n }\n $GetData = 0;\n if ($InfoArray[$MetaKey]['GetData'] == 1) {\n $GetData = 1;\n }\n $ConfigSetting = '';\n if ($InfoArray[$MetaKey]['ConfigSetting']) {\n $ConfigSetting = $InfoArray[$MetaKey]['ConfigSetting'];\n }\n \n $PageMeta = array(\n 'TransientKey' => $TransientKey,\n 'PageID' => $PageID,\n 'MetaKey' => $MetaKey,\n 'MetaKeyName' => $MetaKeyName,\n 'MetaValue' => $MetaValue,\n 'MetaAsset' => $MetaAsset,\n 'MetaAssetName' => $MetaAssetName,\n 'ApplicationFolder' => $ApplicationFolder,\n 'GetData' => $GetData,\n 'ConfigSetting' => $ConfigSetting,\n );\n \n if ($PageMetaID) { //If updating\n $PageMeta['PageMetaID'] = $PageMetaID;\n }\n \n $PageID = $this->PageMetaModel->Save($PageMeta);\n \n // if ($PageID) {\n // if ($PageMeta = $this->PageMetaModel->Get($PageID)) {\n // $this->SetJson('PageMeta', $PageMeta->Result());\n // } else {\n // $this->ErrorMessage(T('There was a problem retrieving your Custom Fields'));\n // }\n // }\n //$this->SetJson('PageMeta', $InfoArray);\n $this->Render();\n }",
"public function get_meta_json() {\n // Don't write all the meta properties to the meta file.\n // These are the ones to keep.\n $keep = Array(\n 'id',\n 'created',\n 'filename_json',\n 'filename_csv',\n 'filename_meta',\n 'filename_original',\n 'uploaded_name',\n 'uploaded_extension',\n 'url'\n );\n\n // Filter out every key not in $keep.\n $props = array_filter( $this->properties,\n function ($key) use ($keep) {\n return in_array($key, $keep);\n },\n ARRAY_FILTER_USE_KEY );\n\n // Return encoded JSON.\n return json_encode($props);\n }",
"function save_mb_value($post_id, $post)\r\n{\r\n\r\n if (!isset($_POST['save_mb_value_nonce']))\r\n {\r\n return;\r\n }\r\n\r\n if (!wp_verify_nonce($_POST['save_mb_value_nonce'], 'save_mb_value'))\r\n {\r\n return;\r\n }\r\n\r\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)\r\n {\r\n return;\r\n }\r\n\r\n if (!isset($_POST['nume_autor']))\r\n {\r\n return;\r\n }\r\n\r\n // curat input (nu stiu daca se merita cu json)\r\n $nume_autor = json_encode($_POST['nume_autor']);\r\n\r\n // insert in BD\r\n update_post_meta($post_id, '_autor_carte', $nume_autor);\r\n\r\n}",
"function acf_json_encode( $json ) {\n}",
"function acf_json_encode($json)\n{\n}",
"function bbp_register_meta()\n{\n}",
"function wp_api_encode_acf($data,$post,$context){\n $customMeta = (array) get_fields($post['ID']);\n $data['meta'] = array_merge($data['meta'], $customMeta );\n return $data;\n}",
"function siteorigin_panels_wp_import_post_meta($post_meta){\n\tforeach($post_meta as $i => $meta) {\n\t\tif($meta['key'] == 'panels_data') {\n\t\t\t$value = $meta['value'];\n\t\t\t$value = preg_replace(\"/[\\r\\n]/\", \"<<<br>>>\", $value);\n\t\t\t$value = preg_replace('!s:(\\d+):\"(.*?)\";!e', \"'s:'.strlen('$2').':\\\"$2\\\";'\", $value);\n\t\t\t$value = unserialize($value);\n\t\t\t$value = array_map('siteorigin_panels_wp_import_post_meta_map', $value);\n\n\t\t\t$post_meta[$i]['value'] = $value;\n\t\t}\n\t}\n\n\treturn $post_meta;\n}",
"function update_postmeta_hook($meta_id, $post_id, $meta_key, $meta_value) {\n log_me(\"Add or Update metda event triggered on key \". $meta_key);\n register_constants(false);\n if ($meta_key == WPUA_DATA_FIELD_KEY || $meta_key == WPUA_ARTICLE_VERSIONS_KEY) {\n if (!isJson($meta_value)) {\n log_me(\"Is not json\");\n wp_die(\"Field '\". $meta_key . \"' is not a valid json. Please write it in a valid json format.\" , \"Json Parse Exception\");\n } else {\n log_me(\"Is json\");\n }\n }\n}",
"function myguten_register_post_meta() {\n\tregister_post_meta(\n\t\t'post',\n\t\t'myguten_meta_block_field',\n\t\tarray(\n\t\t\t'show_in_rest' => true,\n\t\t\t'single' => true,\n\t\t\t'type' => 'string',\n\t\t)\n\t);\n}",
"public function register_meta() {\n\t\tforeach ( $this->post_meta_keys as $key => $args ) {\n\t\t\t// We have several data types that are stored as strings.\n\t\t\tif ( 'float' === $args['type'] || 'deadlines' === $args['type'] || 'requirements' === $args['type'] ) {\n\t\t\t\t$args['type'] = 'string';\n\t\t\t}\n\n\t\t\t$args['show_in_rest'] = true;\n\t\t\t$args['single'] = true;\n\t\t\tregister_meta( 'post', $key, $args );\n\t\t}\n\t}",
"private function prepareMeta() {\n\t\tif (is_array($this->meta) && count($this->meta)) {\n\t\t\tforeach ($this->meta as $label => $value) {\n\t\t\t\t$this->meta[$label] = str_replace(\"\\r\", '', str_replace(\"\\n\", '<br />', $value));\n\t\t\t}\n\t\t}\n\n\t\t// add generator string\n\t\t$this->meta['generator'] = 'LFEditor';\n\n\t\treturn $this->meta;\n\t}",
"function hello_gutenberg_register_meta() {\n\tregister_meta(\n\t\t'post', '_hello_gutenberg_field', array(\n\t\t\t'type'\t\t\t=> 'string',\n\t\t\t'single'\t\t=> true,\n\t\t\t'show_in_rest'\t=> true,\n\t\t)\n\t);\n}",
"public function on_wxr_importer_pre_process_post_meta( $post_meta ) {\n\t\t\tif ( '_elementor_data' === $post_meta['key'] ) {\n\t\t\t\t$post_meta['value'] = wp_slash( $post_meta['value'] );\n\t\t\t}\n\n\t\t\treturn $post_meta;\n\t\t}",
"public function getPostidentDataAsJson()\n {\n return Mage::helper('core')->jsonEncode($this->getPostidentData());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all Staff models. | public function actionIndex()
{
$searchModel = new StaffSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | [
"private function fetch_all_staff()\n {\n $staff_list = ModelsStaff::all();\n return $staff_list;\n }",
"public function actionIndex()\n {\n $searchModel = new SearchStaffMember();\n $model = new StaffMember(); \n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'model' => $model,\n ]);\n }",
"public function getAllStaff()\n\t{\n\t\t$result = $this->db->query(\"SELECT `username`, `name`, `email`, `manager` FROM staff\");\n\t\t$i = 0;\n\t\twhile($data = $result->fetch())\n\t\t{\n\t\t\t$this->staff[$i] = new RealStaff($data['username'],$data['name'],$data['manager'],$data['email'], $this->db);\n\t\t\t$i++; \n\t\t}\n\t}",
"public function index()\n\t{\n\t\t$stafs = Staf::all();\n\t\treturn view('stafs.index', compact('stafs'));\n\t}",
"public function stafflistAction() {\n\t\t$page = $this->_request->getParam('page');\n\t\t\n\t\tPageTitle::setTitle($this->view, $this->_request);\n\t\t$staffFinder = new Staff();\n\n\t\t$identity = Zend_Auth::getInstance()->getIdentity();\n\t\t$domain = $identity->domain;\n\t\t$role = $identity->role;\n\t\t$this->view->page = $page;\n\t\t\n\t\tif ( $role=='admin' ) {\n\t\t\t$this->view->staff = $staffFinder->getAllStaffForPage($page);\n\t\t} else {\n\t\t\t$this->view->staff = $staffFinder->getAllStaffForPage($page,$domain);\n\t\t}\n\t}",
"public function actionIndex()\n {\n $searchModel = new TeacherStaffSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function staffAllDataShow()\n\t\t{\n\t\t\t$sql = \"SELECT * FROM staffs\";\n\t\t\t$data = parent::dbConnection() -> query($sql);\n\t\t\treturn $data;\n\t\t}",
"public function getStaffMembers()\n {\n \treturn StaffMember::where('staff_status', 1)->get();\n }",
"public function index()\n {\n if (Auth::user()->is_admin)\n $centreStaff = Staff::all();\n else\n $centreStaff = Staff::ofCentres(Auth::user())->get();\n\n return view('staff.index', compact('centreStaff'));\n }",
"public function get_table_staffs() {\n\t\t$valid_req = check_ajax_referer( 'get_table_staffs', false, false );\n\t\tif ( false == $valid_req ) {\n\t\t\twp_die( 'Invalid get_table_staffs nonce' );\n\t\t}\n\n\t\t$staffs = Staff::findAll();\n\n\t\t$data = array();\n\n\t\tforeach ( $staffs as $row ) {\n\t\t\t$data['data'][] = array(\n\t\t\t\t'id' => $row->id,\n\t\t\t\t'full_name' => $row->full_name,\n\t\t\t\t'email' => $row->email,\n\t\t\t);\n\t\t}\n\n\t\tif ( count( $data ) > 0 ) {\n\t\t\twp_send_json( $data );\n\t\t} else {\n\t\t\t$data['sEcho'] = 0;\n\t\t\t$data['iTotalRecords'] = 0;\n\t\t\t$data['iTotalDisplayRecords'] = 0;\n\t\t\t$data['aaData'] = array();\n\t\t\twp_send_json( $data );\n\t\t}\n\t}",
"public function actionIndex()\n {\n $searchModel = new PurchaseStaffSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new LinkStaffSubjectSearch();\n $is_admin=Yii::$app->user->can('admin');\n if($is_admin){\n $searchModel->is_admin=1;\n }else{\n $searchModel->staff_id=Yii::$app->user->id;\n $searchModel->is_admin=0;\n }\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new YxStaffSearch();\n\n #在查询参数中添加公司ID\n $queryParams = Yii::$app->request->queryParams;\n if (isset($queryParams['company_id'])) {\n $queryParams['YxStaffSearch']['company_id']=$queryParams['company_id'];\n }\n\n $dataProvider = $searchModel->search($queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"private function _staffList() {\n// if (!$this->Common->checkPermissionByaction($this->params['controller'], \"manageStaff\")) {\n// $this->Session->setFlash(__(\"Permission Denied\"));\n// $this->redirect(array('controller' => 'Stores', 'action' => 'dashboard'));\n// }\n $storeID = $this->Session->read('admin_store_id');\n $value = \"\";\n $criteria = \"User.store_id =$storeID AND User.is_deleted=0 AND User.role_id=3\";\n if (!empty($this->params)) {\n if (!empty($this->params->query['keyword'])) {\n $value = trim($this->params->query['keyword']);\n }\n if ($value != \"\") {\n $criteria .= \" AND (User.fname LIKE '%\" . $value . \"%' OR User.lname LIKE '%\" . $value . \"%' OR User.email LIKE '%\" . $value . \"%')\";\n }\n }\n $this->paginate = array('conditions' => array($criteria), 'order' => array('User.created' => 'DESC'));\n $userdetail = $this->paginate('User');\n $this->set('list', $userdetail);\n $this->set('keyword', $value);\n }",
"public function getStaff()\n {\n return $this->hasMany(Staff::className(), ['position' => 'p_id']);\n }",
"public function testGetStaffList()\n {\n $response = $this->loginAsRole(Role::ADMIN)\n ->get($this->url('staff'));\n\n $response->assertStatus(200);\n\n $response->assertJsonStructure([\n 'data' => [\n [\n 'user_id',\n 'title',\n 'school_id',\n 'department_id'\n ]\n ]\n ]);\n }",
"public static function staff()\n {\n return Role::getRole('staff')->users;\n }",
"public function actionIndex()\n {\n\t\t$this->layout='main-admin';\n $searchModel = new StaffSalarySearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function getApplicationStaff()\n {\n return $this->hasMany(ApplicationStaff::className(), ['staff_id' => 'id']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function is to test downvoting an existing post/comment or reply which is upvoted | public function testDownvoteUpvotedPost()
{
$users_cnt = DB::table('users')->count();
$links_cnt = DB::table('links')->count();
$downvoted_cnt = DB::table('downvoted_links')->count();
$upvoted_cnt = DB::table('upvoted_links')->count();
$user = User::storeUser([
'username' => 'Lily',
'email' => 'lily@l.com',
'password' => '123456789',
]);
$link = Link::storeLink([
'content' => 'test content',
'title' => 'test title',
'author_username' => $user->username
]);
$this->assertEquals(DB::table('users')->count(), $users_cnt + 1);
$this->assertEquals(DB::table('links')->count(), $links_cnt + 1);
$token = auth()->login($user);
$headers = [$token];
UpvotedLink::store($user->username, $link->id);
$this->assertEquals(DB::table('upvoted_links')->count(), $upvoted_cnt + 1);
Link::incrementUpvotes($link->id);
$payload = ['link_id' => $link->id];
$this->json('POST', 'api/v1/auth/downvoteLink', $payload, $headers)
->assertStatus(200)
->assertJson([
'success' => 'true'
]);
$this->assertEquals(DB::table('upvoted_links')->count(), $upvoted_cnt);
$this->assertEquals(DB::table('downvoted_links')->count(), $downvoted_cnt + 1);
$user->delete();
$this->assertEquals(DB::table('users')->count(), $users_cnt);
$this->assertEquals(DB::table('links')->count(), $links_cnt);
$this->assertEquals(DB::table('downvoted_links')->count(), $downvoted_cnt);
} | [
"public function testVoteDown()\n {\n\n // get list of entries\n $entries = $this->getEntries( array( 'excludeVotes' => 'true' ) );\n\n $entryToVote = $entries[0]->entry;\n\n // vote down entry\n $this->voteEntry( $entryToVote->id, 'down' );\n\n // check that downvoted entry disappear from feed\n // renew list of entries\n $entries = $this->getEntries( array( 'excludeVotes' => 'true' ) );\n\n // get list of entries ids\n $entryIds = $this->getEntryIds( $entries );\n\n // check that downvoted entry is not in the list\n $this->assertFalse( in_array( $entryToVote->id, $entryIds ) );\n\n // check that voted down entry is not shown in TALENT CONNECT/MY VOTES ( GET /vote?user=<votedup user> )\n // get voted up entries of the user\n $upvotedEntries = $this->getUserUpVotedEntries();\n\n $this->assertFalse( in_array( $entryToVote->id, $this->getEntryIds( $upvotedEntries ) ) );\n }",
"public function test_message_can_be_downvoted() {\n\n $user = User::create('bar@email.com', 'secret', 'Jane Doe');\n $this->message->downvote($user);\n $this->assertEquals(1, $this->message->getDownvotes());\n\n }",
"public function testPostVoteOnAnswer(): void {\n $user = factory(User::class)->create();\n $q = factory(Question::class)->create();\n $a = factory(Answer::class)->create(['question_id' => $q->id]);\n $url = \"/api/answers/$a->id\";\n //up and cancel\n $this->get(url(\"$url/votes\"))\n ->assertStatus(200)\n ->assertJsonFragment(['total' => 0]);\n $this->post(url(\"$url/upvote\"), ['api_token' => $user->api_token])\n ->assertStatus(200)\n ->assertJsonFragment(['total' => 1, 'up' => 1]);\n $this->post(url(\"$url/upvote\"), ['api_token' => $user->api_token])\n ->assertStatus(200)\n ->assertJsonFragment(['total' => 0, 'up' => 0]);\n // down and cancel\n $this->post(url(\"$url/downvote\"), ['api_token' => $user->api_token])\n ->assertStatus(200)\n ->assertJsonFragment(['total' => -1, 'down' => 1]);\n $this->post(url(\"$url/downvote\"), ['api_token' => $user->api_token])\n ->assertStatus(200)\n ->assertJsonFragment(['total' => 0, 'down' => 0]);\n //down up down\n $this->post(url(\"$url/downvote\"), ['api_token' => $user->api_token])\n ->assertStatus(200)\n ->assertJsonFragment(['total' => -1, 'down' => 1]);\n $this->post(url(\"$url/upvote\"), ['api_token' => $user->api_token])\n ->assertStatus(200)\n ->assertJsonFragment(['total' => 1, 'up' => 1]);\n $this->post(url(\"$url/downvote\"), ['api_token' => $user->api_token])\n ->assertStatus(200)\n ->assertJsonFragment(['total' => -1, 'down' => 1]);\n\n $this->get(url(\"$url/votes\"))\n ->assertStatus(200)\n ->assertJsonFragment(['total' => -1]);\n }",
"function hasDownvoted($story, $user) {\r\n $db = Database::getInstance()->getDB();\r\n\r\n try {\r\n\t $stmt = $db->prepare('SELECT *\r\n FROM STORYDOWNVOTE\r\n WHERE storyId = ? AND userId = ?\r\n ');\r\n $stmt->execute(array($story, $user));\r\n $downvote = $stmt->fetch();\r\n\r\n if($downvote !== false)\r\n return true;\r\n else\r\n return false;\r\n }catch(PDOException $e) {\r\n return false;\r\n }\r\n }",
"function Downvote(){\n\t\t$reel = Reel::FindById($_POST['reel_id']);\n\t\t$reel->Downvote();\t\t\n\t}",
"public function testTwoUserVoted()\n {\n /** @var Post $post */\n $post = factory(Post::class)->create();\n\n /** @var User $user */\n $user = factory(User::class)->create();\n\n /** @var User $otherUser */\n $otherUser = factory(User::class)->create();\n\n $post->voteDown($user);\n $post->voteDown($otherUser);\n\n $this->assertEquals(\n -2,\n - $post->votes->count()\n );;\n }",
"public function upVote() {\r\n\t\t// TODO\r\n\t}",
"public function upvoteDownvotePostOrAnswer()\n\t{\n\t\t$arrayResponse = array();\n\n\t\ttry \n\t\t{ \t\n\t\t\tif($this->tokenData)\n\t\t\t{ \n\t\t\t\t//--Get param\n\t\t\t\t$voteData['upv_type'] = isset($this->requestData->voteTyp)?$this->requestData->voteTyp:\"\";\n\t\t\t\t$voteData['upv_usr_id'] = $this->tokenData['usr_id'];\n\t\t\t\t$voteData['upv_pst_ans_id'] = isset($this->requestData->voteId)?$this->requestData->voteId:\"\";\n\t\t\t\t$voteData['upv_createdate'] = strtotime(gmdate('Y-m-d h:i:s a').' UTC');\n\n\t\t\t\tif(empty($voteData['upv_pst_ans_id']))\n\t\t\t\t{\n\t\t\t\t\t$arrayResponse = array('success' => false, 'message' => 'Post or answer id is required.');\n\t\t\t\t}\n\t\t\t\telseif (empty($voteData['upv_type'])) \n\t\t\t\t{\n\t\t\t\t\t$arrayResponse = array('success' => false, 'message' => 'Vote type is required.');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif($voteData['upv_type'] =='Post')\n\t\t\t\t\t{\n\t\t\t\t\t\t//--get user post detail for notification\n\t\t\t\t\t\t$where1 = array('pst_id' => $voteData['upv_pst_ans_id']);\n\t\t\t\t\t\t$pstUsrDetail = $this->UserModel->singleData('pst_usr_id,pst_title','comm_posts',$where1);\n \t\t\t\t }\n \t\t\t\t else if ($voteData['upv_type'] =='Answer') \n \t\t\t\t {\n \t\t\t\t \t//--get user post comment detail for notification\n \t\t\t\t \t$where3 = array('ans_id' =>$voteData['upv_pst_ans_id']);\n\t\t\t\t\t\t$usrDetail = $this->UserModel->singleData('ans_usr_id,ans_description,and_pst_id','comm_answers',$where3);\n \t\t\t\t }\n\n\t\t\t\t\t//--Make where condition for query\n\t\t\t\t\t$where = array('upv_type' => $voteData['upv_type'], 'upv_usr_id' => $voteData['upv_usr_id'],'upv_pst_ans_id' => $voteData['upv_pst_ans_id']);\n\n\t\t\t\t\t//--Call model function for check vote status\n\t\t\t\t\t$checkFeedback = $this->UserModel->singleData('upv_id','comm_upvote',$where); \n\n\t\t\t\t\tif(empty($checkFeedback))\n\t\t\t\t\t{ \n\t\t\t\t\t\t//--Call model function for add upvote\n\t\t\t\t\t\t$response = $this->UserModel->insertData($voteData,'comm_upvote');\n\n\t\t\t\t\t\tif ($response)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$userActivity['usr_lastActivity'] = strtotime(gmdate('Y-m-d h:i:s a').' UTC');\n\t\t\t\t\t\t\t$this->UserModel->updateData('comm_users', array('usr_id' => $this->tokenData['usr_id']), $userActivity);\n\n\t\t\t\t\t\t\t\tif(isset($pstUsrDetail))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//--Get user device data\n\t\t\t\t\t\t\t\t\t$where2 = array('dev_usr_id' =>$pstUsrDetail['pst_usr_id']);\n\t\t\t\t\t\t\t\t\t$deviceData = $this->UserModel->singleData('dev_device_token','comm_devices',$where2);\n\n\t\t\t\t\t\t\t\t\t//--notification data\n\t\t\t\t\t\t\t\t\tif(strlen($pstUsrDetail['pst_title'])>60)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$message = substr($pstUsrDetail['pst_title'], 0, 57).'...';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$message = $pstUsrDetail['pst_title'];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$pushMessage = 'Your post just got an upvote';\n\n\t\t\t\t\t\t $notData['ntfy_from'] = $voteData['upv_usr_id'];\n\t\t\t\t\t\t $notData['ntfy_to'] = $pstUsrDetail['pst_usr_id'];\n\t\t\t\t\t\t $notData['ntfy_pst_id'] = $voteData['upv_pst_ans_id'];\n\t\t\t\t\t\t $notData['ntfy_message'] = $message;\n\t\t\t\t\t\t $notData['ntfy_type'] ='HIVE_UPVOTE';\n\t\t\t\t\t\t $notData['ntfy_pst_type'] ='HIVE';\n\t\t\t\t\t\t $notData['ntfy_createdate'] = $voteData['upv_createdate'];\n\t\t\t\t\t\t \n\t\t\t\t\t\t //--msg for notification\n\t\t\t\t\t\t $notifyMessage['ntfy_message'] = $pushMessage;\n\t\t\t\t\t\t $notifyMessage['ntfy_pst_type'] ='HIVE';\n\n\t\t\t\t\t\t if($voteData['upv_usr_id']!=$pstUsrDetail['pst_usr_id'])\n\t\t\t\t\t\t //-call function for send notification\n\t\t \t\t\t$this->UserModel->sendNotification($deviceData['dev_device_token'], $notifyMessage);\n\n\t\t \t\t//--Save notification data\n\t\t\t\t\t\t $this->UserModel->insertData($notData,'comm_notification');\n\t \t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif(isset($usrDetail))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//--Get user device data\n\t\t\t\t\t\t\t\t\t$where4 = array('dev_usr_id' =>$usrDetail['ans_usr_id']);\n\t\t\t\t\t\t\t\t\t$deviceData = $this->UserModel->singleData('dev_device_token','comm_devices',$where4);\n\n\t\t\t\t\t\t\t\t\tif(strlen($usrDetail['ans_description'])>60)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$message = substr($usrDetail['ans_description'], 0, 57).'...';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$message = $usrDetail['ans_description'];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$pushMessage = 'Your comment just got an upvote';\n\n\t\t\t\t\t\t $notData['ntfy_from'] = $voteData['upv_usr_id'];\n\t\t\t\t\t\t $notData['ntfy_to'] = $usrDetail['ans_usr_id'];\n\t\t\t\t\t\t $notData['ntfy_pst_id'] = $usrDetail['and_pst_id'];\n\t\t\t\t\t\t $notData['ntfy_message'] = $message;\n\t\t\t\t\t\t $notData['ntfy_type'] ='COMMENT_UPVOTE';\n\t\t\t\t\t\t $notData['ntfy_pst_type'] ='HIVE';\n\t\t\t\t\t\t $notData['ntfy_createdate'] = $voteData['upv_createdate'];\n\t\t\t\t\t\t \n\t\t\t\t\t\t //--Msg for notification\n\t\t\t\t\t\t $notifyMessage['ntfy_message'] = $pushMessage;\n\t\t\t\t\t\t $notifyMessage['ntfy_pst_type'] ='HIVE';\n\n\t\t\t\t\t\t if($voteData['upv_usr_id']!=$usrDetail['ans_usr_id'])\n\t\t\t\t\t\t\t //-call function for send notification\n\t\t\t \t\t$this->UserModel->sendNotification($deviceData['dev_device_token'], $notifyMessage);\n\n\t\t \t\t//--Save notification detail\n\t\t\t\t\t\t $this->UserModel->insertData($notData,'comm_notification');\n\t \t\t\t\t\t}\n \t\t\t\t \n\t\t\t\t\t\t\t$arrayResponse = array('success' => true, 'data' => 1, 'message' => 'Upvoted successfully.');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$arrayResponse = array('success' => false, 'message' => 'Error! in upvote, Please try again.');\n\t\t\t\t\t\t}\n\t\t\t\t\t }\n\t\t\t\t\t else\n\t\t\t\t\t {\n\t\t\t\t\t \t//--Call model function for downvote\n\t\t\t\t\t\t$response = $this->UserModel->deleteData('comm_upvote',$where);\n\n\t\t\t\t\t\tif ($response)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($voteData['upv_type'] =='Post')\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t//--Remove notification data\n\t\t\t\t\t\t\t\t$where5 = array('ntfy_from' =>$voteData['upv_usr_id'],'ntfy_to' =>$pstUsrDetail['pst_usr_id'],'ntfy_pst_id' =>$voteData['upv_pst_ans_id'],'ntfy_type' =>'HIVE_UPVOTE');\n\t\t\t\t\t\t\t\t$this->UserModel->deleteData('comm_notification',$where5);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if ($voteData['upv_type'] =='Answer') \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//--Remove notification data\n\t\t\t\t\t\t\t\t$where6 = array('ntfy_from' =>$voteData['upv_usr_id'],'ntfy_to' =>$usrDetail['ans_usr_id'],'ntfy_pst_id' =>$usrDetail['and_pst_id'] ,'ntfy_type'=>'COMMENT_UPVOTE');\n\t\t\t\t\t\t\t\t$this->UserModel->deleteData('comm_notification',$where6);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$arrayResponse = array('success' => true, 'message' => 'Downvoted successfully.', 'data' => 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$arrayResponse = array('success' => false, 'message' => 'Error! in downvote, Please try again.');\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\telse\n\t\t\t{\n\t\t\t\t$arrayResponse=array(\"success\" => false,\"message\" => \"Your session has timed out, please login again.\");\n\t\t\t}\n\n\t\t\tif(empty($arrayResponse))\n\t\t\t{\n\t\t\t\tthrow new Exception('Server Error, please try again.');\n\t\t\t}\n\t\t} \n\t\tcatch (Exception $e) \n\t\t{\n\t\t\t$arrayResponse = array('success' => false, 'message' => $e->getMessage());\n\t\t}\n\n\t\t//--Convert Response to json\n\t\t$this->getJsonData($arrayResponse);\n\t}",
"public function testVoteVotingDeactivated()\n {\n $GLOBALS['enableVoting'] = false;\n\n $uid = 1;\n $bid = $this->addBookmark();\n $this->assertFalse($this->vs->vote($bid, $uid, 1));\n }",
"public function testShowQuestionVoteUnvote()\n {\n $user = factory(User::class)->create();\n $member = factory(Member::class)->create();\n\n $question = factory(question::class)->create([\n 'user_id' => $user->id\n ]);\n $answer = factory(answer::class)->create([\n 'is_admin' => 0,\n 'member_id' => $member->id,\n 'question_id' => $question->id\n ]);\n \n Auth::guard('member')->login($member);\n $response = $this->visit('questions')\n ->click($question->topic)\n ->seePageIs('questions/' . $question->id)\n ->see($answer->body)\n ->press('VOTE')\n ->seePageIs('questions/' . $question->id)\n ->see('VOTED')\n ->see('1')\n ->press('VOTED')\n ->seePageIs('questions/' . $question->id)\n ->see('VOTE')\n ->see('0');\n \n $answer->delete();\n $question->delete();\n $user->delete();\n $member->delete();\n }",
"function TestVoting(){\n\t\t\n\t\t$POD = new PeoplePod();\n\t\t$POD->debug(1);\n\t\t$user = $POD->getPerson();\n\t\t$user->email = 'ben+test@example.com';//create user\n\t\t$user->password = 'foo';\n\t\t$user->nick = 'test';\n\t\t$user->save(); \n\t\t\n\t\t$POD->changeActor(array('id'=>$user->id));//log in as user\n\t\t\n\t\t$content = $POD->getContent();\n\t\t$content->set('headline', 'this is the headline');\n\t\t$content->set('type', 'this is the type');\n\t\t$content->save();\n\t\n\t\tfor ($i = 0; $i < 3; $i++) { \n\t\t\t\n\t\t\t//Test all vote fields initialized to zero\n\t\t\t$this->assertEqual($content->yes_votes, 0);\n\t\t\t$this->assertEqual($content->no_votes, 0);\n\t\t\t$this->assertEqual($content->yes_percent,0);\n\t\t\t$this->assertEqual($content->no_percent,0);\n\t\t\t\n\t\t\t////// begin yes_vote tests //////////\n\t\n\t\n\t\t\t//upvote\n\t\t\t$content->vote('y');\n\t\t\t$this->assertEqual($content->yes_votes, 1);\n\t\n\t\t\t\n\t\t\t//attempts to upvote twice\n\t\t\t$content->vote('y');\n\t\t\t$this->assertEqual($content->yes_votes, 1);\n\t\t\t\n\t\n\t\n\t\t\t//Test upvote percent\n\t\t\t$this->assertEqual($content->yes_percent, 100);\n\t\n\t\t\t\n\t\t\t//vote('n')should return false because it was not unvoted. There cannot be both a yes & no vote on one \t\t\t\tcontentObj\n\t\t\t// yes_vote should be unaffected\n\t\t\t$content->vote('n');\n\t\t\t$this->assertEqual($content->no_votes,1); //downvote should not count\n\t\t\t$this->assertEqual($content->yes_votes, 0); //upvote should remain unchanged\n\t\t\t$this->assertEqual($content->yes_percent, 0);//upvote % should be unchanged\n\t\t\t$this->assertEqual($content->no_percent, 100);//upvote % should be unchanged\n\t\n\t\t\t\n\t\t\t//test unvote\n\t\t\t$content->unvote(); \n\t\t\t$this->assertEqual($content->yes_votes, 0); //upvote should clear\n\t\t\t$this->assertEqual($content->yes_percent, 0); //percent should return to 0\n\t\t\t$this->assertEqual($content->no_votes, 0); //no_votes should stil be 0 \n\t\t\t$this->assertEqual($content->no_percent, 0); //no percent should be 0\n\t\t\t\n\t\t\t\n\t\t\t////// begin no_vote tests\n\t\t\t// same test sequence as above, but using no_votes\n\t\t\t$content->vote('n');\n\t\t\t$this->assertEqual($content->no_votes, 1);\n\t\t\t\n\t\t\t//attempt to add two no_votes\n\t\t\t$content->vote('n');\n\t\t\t$this->assertEqual($content->no_votes, 1);\n\t\t\t$this->assertEqual($content->no_percent, 100);\n\t\t\t\n\t\t\t//attempt to add upvote on top of no_vote. Should not be allowed\n\t\t\t$content->vote('y');\n\t\t\t$this->assertEqual($content->yes_votes, 1);\n\t\t\t$this->assertEqual($content->yes_percent, 100);\n\t\t\t$this->assertEqual($content->no_percent, 0);\n\t\t\t\n\t\t\t//remove vote\n\t\t\t$content->unvote();\n\t\t\t$this->assertEqual($content->yes_votes, 0); \n\t\t\t$this->assertEqual($content->yes_percent, 0);\n\t\t\t$this->assertEqual($content->no_votes, 0); \n\t\t\t$this->assertEqual($content->no_percent, 0); \n\t\t\t\n\t\t\t//unvote empty vote set\n\t\t\t$content->unvote();\n\t\t\t$this->assertEqual($content->yes_votes, 0); \n\t\t\t$this->assertEqual($content->yes_percent, 0);\n\t\t\t$this->assertEqual($content->no_votes, 0); \n\t\t\t$this->assertEqual($content->no_percent, 0); \n\t\t\n\t\t}\n\t\t\n\t\t/// content-votes are all set to zero, now users will be added to vote and test %'s\n\t\t$content->vote('y'); //start with one upvote\n\t\t\n\t\t\n\t\t//create a new user\n\t\t$user2 = $POD->getPerson();\n\t\t$user2->email = '2+test@example.com';//create user\n\t\t$user2->password = 'foo';\n\t\t$user2->nick = 'test2';\n\t\t$user2->save();\n\t\t\n\t\t$this->assertTrue($user2->success());\n\t\t$this->assertNotNull($user2->id);\n\t\t\n\t\t$POD->changeActor(array('id'=>$user2->id));\n\t\t\n\t\t$this->assertTrue($POD->isAuthenticated());\n\t\t$this->assertEqual($POD->currentUser()->nick, $user2->nick);\n\t\t\n\t\t$content->vote('y');\n\t\t$this->assertEqual($content->yes_votes, 2); //check to make sure up_votes are incremented\n\t\t$this->assertEqual($content->yes_percent, 100);\n\t\t\n\t\t$content->unvote();\n\t\t$content->vote('n');\n\t\t$this->assertEqual($content->yes_percent, 50);\n\t\t$this->assertEqual($content->no_percent, 50);\n\t\t\n\t\t//create yet another user to test %'s with a decimal value\n\t\t\n\t\t$user3 = $POD->getPerson();\n\t\t$user3->email = '3+test@example.com';//create user\n\t\t$user3->password = 'foo';\n\t\t$user3->nick = 'test3';\n\t\t$user3->save();\n\t\t\n\t\t$POD->changeActor(array('id'=>$user3->id));\n\t\t$this->assertTrue($POD->isAuthenticated());\n\t\t$this->assertEqual($POD->currentUser()->nick, $user3->nick);\n\t\t\n\t\t$content->vote('y');//there should now be 2 upvotes and 1 down\n\t\n\t\t$this->assertEqual($content->yes_votes, 2);\n\t\t$this->assertEqual($content->no_votes, 1);\n\t\t$this->assertEqual($content->yes_percent, 66);\n\t\t$this->assertEqual($content->no_percent, 33);\n\t\t\n\n\t\terror_log(\"------------------------------------------------------\");\n\t\terror_log(\"END VOTE TESTS\");\n\t\n\n\t\t\n\t\t// clean up\n\t\t$content->delete(); \n\t\t\n\t\t$user3->delete();\n\t\t\n\t\t$POD->changeActor(array('id'=>$user2->id));\n\t\t$user2->delete();\n\t\t\n\t\t$POD->changeActor(array('id'=>$user->id));\n\t\t$user->delete();\n\t}",
"public function test_message_can_only_be_voted_on_once() {\n\n $user = User::create('bar@email.com', 'secret', 'Jane Doe');\n $this->message->upvote($user);\n $this->message->upvote($user);\n $this->assertEquals(1, $this->message->getUpvotes());\n\n $this->message->downvote($user);\n $this->message->downvote($user);\n $this->assertEquals(1, $this->message->getDownvotes());\n\n }",
"public function setDownvote($id,$downvote){\n\t\t$result['success'] = \"true\";\n\t $result['errorCode'] = \"0\";\n\t\ttry{\n\t \t$this->db->where('id', $id);\n\t \t$this->db->update('discussion_thread', array('downvote' => $downvote));\n\t \t$num = $this->db->affected_rows();\n\t \n\t if($num>0){\n\t\t\t\t$result['success'] = \"true\";\n\t\t\t\t$result['errorCode'] = \"0\";\n\t }\t\n\t \n\t\t}catch(Exception $e){\n\t\t\t$result['success'] = \"false\";\n\t $result['errorCode'] = \"1\";\n\t\t}\n\t\treturn $result;\n\t}",
"public function voteUp(){\n return $this->vote(1);\n }",
"function hasUpvotedComment($comment, $user) {\r\n $db = Database::getInstance()->getDB();\r\n\r\n try {\r\n\t $stmt = $db->prepare('SELECT *\r\n FROM COMMENTUPVOTE\r\n WHERE commentId = ? AND userId = ?\r\n ');\r\n $stmt->execute(array($comment, $user));\r\n $upvote = $stmt->fetch();\r\n\r\n if($upvote !== false)\r\n return true;\r\n else\r\n return false;\r\n }catch(PDOException $e) {\r\n return false;\r\n }\r\n }",
"public function testUndownvoteDownvotedLink()\n {\n $users_cnt = DB::table('users')->count();\n $links_cnt = DB::table('links')->count();\n $downvoted_cnt = DB::table('downvoted_links')->count();\n $user = User::storeUser([\n 'username' => 'Lily',\n 'email' => 'lily@l.com',\n 'password' => '123456789',\n ]);\n\n $link = Link::storeLink([\n 'content' => 'test content',\n 'title' => 'test title',\n 'author_username' => $user->username\n ]);\n $this->assertEquals(DB::table('users')->count(), $users_cnt + 1);\n $this->assertEquals(DB::table('links')->count(), $links_cnt + 1);\n $token = auth()->login($user);\n $headers = [$token];\n DownvotedLink::store($user->username, $link->id);\n $this->assertEquals(DB::table('downvoted_links')->count(), $downvoted_cnt + 1);\n Link::incrementDownvotes($link->id);\n $payload = ['link_id' => $link->id];\n $this->json('POST', 'api/v1/auth/downvoteLink', $payload, $headers)\n ->assertStatus(200)\n ->assertJson([\n 'success' => 'true'\n ]);\n $this->assertEquals(DB::table('downvoted_links')->count(), $downvoted_cnt);\n $user->delete();\n $this->assertEquals(DB::table('users')->count(), $users_cnt);\n $this->assertEquals(DB::table('links')->count(), $links_cnt);\n }",
"function comment_downvoted($comment_id = 0, $user_id = 0)\n{\n $CI =& get_instance();\n $CI->load->model('vote/vote_model', 'vote');\n\n return $CI->vote->user_has_downvoted_comment($comment_id, $user_id);\n}",
"public function testPostVoteWithSwapToAgree()\n {\n $this->addNarrativeToDatabase();\n\n $n = Narrative::first();\n\n $n->comments()->save(new Comment(array(\n 'Name' => 'Unit Test User 1',\n 'Comment' => 'Test postFlag success.',\n\t 'Deleted' => 'Deleted',\n 'DateCreated' => new DateTime,\n 'Agrees' => 5,\n 'Disagrees' => 3,\n )));\n\n $c = $n->comments()->first();\n\n $response = $this->action(\n 'POST',\n 'ApiCommentController@postVote',\n array('id' => $c->CommentID),\n array('agree' => 'true', 'swap' => 'true')\n );\n\n $this->assertResponseOk();\n\n $data = json_decode($response->getContent());\n\n $this->assertTrue($data->success);\n $this->assertEquals($c->Name, $data->return->name);\n $this->assertEquals(6, $data->return->agrees);\n $this->assertEquals(2, $data->return->disagrees);\n }",
"public function upvote($id) {\n\n\t\t\t$id = intval($id);\n\t\t\t$json = array ('response'=>'success');\n\t\t\t$stmt = $this->conn->prepare(\"SELECT question_id, user_id, answer FROM answers WHERE id = ?\");\n\t\t\t$stmt->execute(array($id));\n\t\t\tif($stmt->rowCount()!=0) {\n\t\t\t\t$iii = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\t\t$user_answer = $iii['user_id'];\n\t\t\t\t$question_id = $iii['question_id'];\n\t\t\t\t$answer_text = $iii['answer'];\n\t\t\t\tif($user_answer!=USER_ID) {\n\t\t\t\t\tif(SESSION_STATUS!=false) {\n\t\t\t\t\t\t$stmt = $this->conn->prepare(\"SELECT * FROM answers_likes WHERE answer_id = ? AND user_id = ?\");\n\t\t\t\t\t\t$stmt->execute(array($id,USER_ID));\n\t\t\t\t\t\tif($stmt->rowCount()!=0) {\n\t\t\t\t\t\t\t$stmt = $this->conn->prepare(\"DELETE FROM answers_likes WHERE answer_id = ? AND user_id = ?\");\n\t\t\t\t\t\t\t$stmt->execute(array($id,USER_ID));\n\t\t\t\t\t\t\tif($stmt->rowCount()!=0) {\n\t\t\t\t\t\t\t\t$stmt = $this->conn->prepare(\"UPDATE answers SET upvotes=upvotes-1 WHERE id = ?\");\n\t\t\t\t\t\t\t\t$stmt->execute(array($id));\n\t\t\t\t\t\t\t\t$stmt = $this->conn->prepare(\"DELETE FROM points_log WHERE log_type='2' AND log_id = ? AND from_user = ?\");\n\t\t\t\t\t\t\t\t$stmt->execute(array($id,USER_ID));\n\t\t\t\t\t\t\t\t$stmt = $this->conn->prepare(\"DELETE FROM notifications WHERE type=? AND n_id = ? AND user_id = ?\");\n\t\t\t\t\t\t\t\t$stmt->execute(array('1',$id,USER_ID));\n\t\t\t\t\t\t\t\theader('ContentHeader-type: application/json'); \n\t\t\t\t\t\t\t\t$json = array(\"type\" => \"delete\");\n\t\t\t\t\t\t\t\techo json_encode($json);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse { \n\t\t\t\t\t\t\t\tdie('Error: Wntanswr-del-01! Contact administration!'); \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$stmt = $this->conn->prepare(\"INSERT INTO answers_likes (answer_id, user_id, to_user, time) VALUES (?, ?, ?, ?)\");\n\t\t\t\t\t\t\t$stmt->execute(array($id,USER_ID,$user_answer,time()));\n\t\t\t\t\t\t\tif($stmt->rowCount()!=0) {\n\t\t\t\t\t\t\t\t$stmt = $this->conn->prepare(\"UPDATE answers SET upvotes=upvotes+1 WHERE id = ?\");\n\t\t\t\t\t\t\t\t$stmt->execute(array($id));\n\t\t\t\t\t\t\t\t$stmt = $this->conn->prepare(\"INSERT INTO points_log (log_type, log_id, from_user, to_user, time) VALUES (?, ?, ?, ?, ?)\");\n\t\t\t\t\t\t\t\t$stmt->execute(array('2',$id,USER_ID,$user_answer,time()));\n\t\t\t\t\t\t\t\tif($user_answer!=USER_ID) {\n\t\t\t\t\t\t\t\t\t$stmt = $this->conn->prepare(\"INSERT INTO notifications (to_user, type, user_id, n_id, time, viewed) VALUES (?, ?, ?, ?, ?, ?)\");\n\t\t\t\t\t\t\t\t\t$stmt->execute(array($user_answer,'1',USER_ID,$id,time(),'0'));\n\t\t\t\t\t\t\t\t\tif(engine::getuserdata($user_answer, \"NOT_UPVOTE\") == 1 && engine::getuserdata($user_answer, \"ONLINE\") == 0) {\n\t\t\t\t\t\t\t\t\t\t$user_answer_link = engine::get_user_name($user_answer);\n\t\t\t\t\t\t\t\t\t\t$stmt = $this->conn->prepare(\"SELECT url FROM questions WHERE id=?\");\n\t\t\t\t\t\t\t\t\t\t$stmt->execute(array($question_id));\n\t\t\t\t\t\t\t\t\t\t$iiii = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\t\t\t\t\t\t\t\t$theme = get_text(449,1).' '.SITE_NAME.' - '.SITE_DESCRIPTION;\n\t\t\t\t\t\t\t\t\t\t$answer_text = strip_tags($answer_text);\n\t\t\t\t\t\t\t\t\t\t$body = get_text(83,1).' '.$user_answer_link.',<br><br>'.get_text(242,1).' <a href=\"http://'.SITE_DOMAIN.'/'.USER_USERNAME.'\">'.USER_USERNAME.'</a> '.get_text(455,1).' - '.$answer_text.'. <a href=\"http://'.SITE_DOMAIN.'/q/'.$iiii['url'].'\">'.get_text(252,1).'</a> '.get_text(453,1).'.<br>'.get_text(77,1).' '.SITE_NAME.'<br><br>'.get_text(78,1).',<br>'.SITE_NAME.' - '.SITE_DESCRIPTION.'<br><br><small>'.get_text(79,1).'.</small>';\n\t\t\t\t\t\t\t\t\t\t$to = engine::getuserdata($user_answer,\"EMAIL\");\n\t\t\t\t\t\t\t\t\t\tengine::send_email($to,$theme,$body);\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\theader('Content-type: application/json'); \n\t\t\t\t\t\t\t\t$json = array(\"type\" => \"add\");\n\t\t\t\t\t\t\t\techo(json_encode($json)); \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse { \n\t\t\t\t\t\t\t\tdie('Error: Wtnanswr-add-01! Contact administration!'); \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}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Insert Observation Detail information | public function insertObservationDetailInfo($postdata) {
$this->_db->insert(PREFIX.'observationinformation',$postdata);
} | [
"public function insert() {\n $this->updateCoordinates();\n $this->data['creation_datetime'] = date('Y-m-d H:i:s');\n $this->data['change_datetime'] = date('Y-m-d H:i:s');\n parent::insert();\n }",
"function insert() {\n\t \t \n\t \t$sql = \"INSERT INTO evs_database.evs_identification (idf_identification_detail_en, idf_identification_detail_th, idf_pos_id, idf_ctg_id)\n\t \t\t\tVALUES(?, ?, ?, ?)\";\n\t\t \n\t \t$this->db->query($sql, array($this->idf_identification_detail_en, $this->idf_identification_detail_th, $this->idf_pos_id, $this->idf_ctg_id));\n\t\n\t }",
"public function insert_record(){\n\n\t\t}",
"function insert_audit_trail()\n {\n $parameter_array = $this->get_parameter_array();\n \n parent::insert('siis', $parameter_array);\n }",
"function insert() {\n\t \t \n\t \t$sql = \"INSERT INTO evs_database.evs_expected_behavior (ept_expected_detail_en, ept_expected_detail_th, ept_pos_id, ept_kcp_id)\n\t \t\t\tVALUES(?, ?, ?, ?)\";\n\t \t$this->db->query($sql, array($this->ept_expected_detail_en, $this->ept_expected_detail_th, $this->ept_pos_id, $this->ept_kcp_id));\n\n\t }",
"public function insertRecord()\n {\n }",
"public function createNewSampleRecord(){\n // associative array of field name => field value pairs\n $values = array($this->_name => $this->name, $this->_surname => $this->surname);\n return $result = parent::insertInformation($this->_tableName, $values);\n }",
"public function actionCreate()\n {\n $model = new Observation();\n\n if ($model->loadAll(Yii::$app->request->post()) && $model->saveAll()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function insert () {\n\t\t$newRecord = ORM::for_table(self::CLIPS_TABLE)->create();\n\t\t$newRecord->description = $this->description;\n\t\t$newRecord->performer = $this->performer;\n\t\t$newRecord->event = $this->event;\n\t\t$newRecord->year = $this->year;\n\t\t$newRecord->url = $this->url;\n//\t\t$insstmt = \"INSERT INTO CLIPS (DESCRIPTION, URL) VALUES ($dsc, $url)\";\n\t\t$newRecord->save();\n\t\t$this->id = $newRecord->id();\n\t\treturn $newRecord->id();\n\t}",
"public function createMeta()\n {\n $table = $this->getTable();\n $invoiceData = $this->_metaData;\n $invoiceData = $this->unsetNonTableFields($invoiceData);\n $this->_invoiceId = $table->insert($invoiceData);\n }",
"public function insert_order_detail($data)\n {\n $this->db->insert('order_detail', $data);\n }",
"public function insert_order_detail($order_datas)\n\t{\n\t\t$this->db->insert_batch('order_details', $order_datas);\n\t}",
"public function insert(): void\n {\n $this->sanitize();\n $properties = ModelManager::getModelProperties($this, ['id']);\n $stmtProperties = array_map(function ($column) {\n return ':' . $column;\n }, $properties);\n\n $this->db->query('INSERT INTO ' . static::getSource() . ' (' . implode(',', $properties) . ') VALUES (' . implode(',', $stmtProperties) . ')', $this->toArray(['id']));\n }",
"public function insert(){\n\t\t$this->CI->model_social->insert(array('est_id' => $this->est_id));\n\t}",
"public function insert_order_detail($data)\n {\n $this->db->insert('order_detail', $data);\n }",
"function arrest_complaint_details_insert($data)\n\t{\n\t$this->db->insert('arrest_complaint_details', $data);\n\t}",
"protected function insert()\n {\n $cluster = isset($this->id) ? $this->id->cluster : $this->getClass()->defaultClusterId;\n\n $db = $this->getDatabase();\n $db->execute('recordCreate', [\n 'record' => $this,\n 'cluster' => $cluster\n ]);\n }",
"public function insertStats() { \n $insert_array = array(\n 'species' => $this->species,\n 'habitat' => $this->habitat,\n 'iter' => $this->iter,\n 'population' => $this->population,\n 'max_population' => $this->max_population,\n 'offspring' => $this->offspring,\n 'deaths' => $this->deaths,\n 'die_cause' => $this->die_cause\n );\n $this->db->insert($insert_array);\n }",
"public function insert_person_daily_notes(){\n\n\n //day_note->save();\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether the path pattern is root. | private function isRootPath(): bool
{
return ($this->pattern === '' || $this->pattern === '/');
} | [
"public function isRoot(): bool\n {\n return empty($this->filePath);\n }",
"function check_root($path, $root, $allow_root=true) {\n if ($path[0] != '/' or $root[0] != '/') {\n throw new ApplicationError(\"Paths must be absolute\");\n }\n\n $path = '/'.trim(($realpath = realpath($path)) ? $realpath : $path, '/');\n $root = '/'.trim($root, '/');\n\n if (!$allow_root and $path == $root) {\n return false;\n }\n\n while (true) {\n if ($path == $root) {\n return true;\n } elseif ($path == '/') {\n return false;\n } else {\n $path = dirname($path);\n }\n }\n }",
"public static function isRootDir()\n {\n $urlInfo = parse_url(self::getRequestedUrl());\n $urlPathInfo = pathinfo($urlInfo['path']);\n\n return $urlPathInfo['dirname'] == \"/\";\n }",
"public function is_root_allowed() {\n\t\treturn (\n\t\t\tisset( $this->definition['allow_root'] ) &&\n\t\t\ttrue === $this->definition['allow_root']\n\t\t);\n\t}",
"public static function is_root_model($path = null) {\n\t\t\tif (!csl_func_arg :: delimit2error() && !csl_func_arg :: string2error(0)) {\n\t\t\t\t$normPath = self :: norm($path);\n\t\t\t\t$normPath = (substr($normPath, -1, 1) !== '/' ? $normPath . '/' : $normPath);\n\t\t\t\t$root = self :: document_root();\n\t\t\t\tif (strpos($normPath, $root) === 0) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}",
"public function isRoot();",
"public static function isPathRooted ($path) {\n $path = Path::normalisePath($path);\n\n if (preg_match('#^[a-z]\\:#i', $path) == TRUE) {\n return TRUE;\n }\n\n return Path::isDirectorySeparator(substr($path, 0, 1));\n }",
"private static function is_root_url(){\n return Route::url() == Route::fix_path(ROOT_URL);\n }",
"public function isRoot(){\n return ($this->flags & self::FLAG_ROOT_USER) == self::FLAG_ROOT_USER;\n }",
"function isRoot();",
"public function isRoot()\n {\n return $this->is_root;\n }",
"public function isRoot(){\r\n\t\treturn $this->getId()==$this->getRootLevel();\r\n\t}",
"public static function isRoot() {\n\n return (\n Permissionable::$user_id == Permissionable::$root_user_id ||\n in_array(Permissionable::$root_group_id, Permissionable::$group_ids)\n );\n\n }",
"public function hasRoot()\n {\n return $this->has('root');\n }",
"public function isRoot()\n {\n $owner = $this->owner;\n return $owner instanceof RootNode;\n }",
"static public function isValidRoot($password){\n\t\treturn ($password == self::$_mRootPassword ? true : false);\n\t}",
"public function isRoot()\n {\n return $this->_parent === null;\n }",
"function isFolder(string $root): bool\n {\n $root = str_replace(\".\", \"\", $root);\n return parent::isFolderTool($this->folderRoot . $root);\n }",
"final protected function IsRoot()\n\t{\n\t\treturn $this->Parent===null;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test Webapi exception construct. | public function testConstruct()
{
$code = 1111;
$details = ['key1' => 'value1', 'key2' => 'value2'];
$apiException = new \Magento\Framework\Webapi\Exception(
__('Message'),
$code,
\Magento\Framework\Webapi\Exception::HTTP_UNAUTHORIZED,
$details
);
$this->assertEquals(
$apiException->getHttpCode(),
\Magento\Framework\Webapi\Exception::HTTP_UNAUTHORIZED,
'Exception code is set incorrectly in construct.'
);
$this->assertEquals(
$apiException->getMessage(),
'Message',
'Exception message is set incorrectly in construct.'
);
$this->assertEquals($apiException->getCode(), $code, 'Exception code is set incorrectly in construct.');
$this->assertEquals($apiException->getDetails(), $details, 'Details are set incorrectly in construct.');
} | [
"public function testPreconditionFailedHttpExceptionIsBuiltCorrectly() {\n\t\ttry {\n\t\t\tthrow new Exception\\PreconditionFailedException();\n\t\t} catch ( \\Exception $e ) {\n\t\t\t$this->assertSame( 412, $e->getStatusCode() );\n\t\t\t$this->assertSame( 'Precondition Failed', $e->getMessage() );\n\t\t}\n\t}",
"public function testHttpExceptionPresenter() :void\n {\n $e = new HttpException(500);\n $response = (new HttpExceptionPresenter($e))->response();\n $expected = [[\n 'status' => 500,\n 'title' => 'An unknown error has occurred'\n ]];\n\n $this->assertEquals($expected, $response);\n }",
"public function testSDKExceptionCreatedProperly()\n {\n $swException = new SmartwaiverSDKException(new Response(404), 'Body Content', 'Error Message');\n\n $this->assertEquals(0, $swException->getCode());\n $this->assertEquals('Error Message', $swException->getMessage());\n $this->assertEquals('Body Content', $swException->getGuzzleBody());\n $this->assertEquals(404, $swException->getGuzzleResponse()->getStatusCode());\n }",
"public function testNotFoundHttpExceptionIsBuiltCorrectly() {\n\t\ttry {\n\t\t\tthrow new Exception\\NotFoundException();\n\t\t} catch ( \\Exception $e ) {\n\t\t\t$this->assertSame( 404, $e->getStatusCode() );\n\t\t\t$this->assertSame( 'Not Found', $e->getMessage() );\n\t\t}\n\t}",
"public function testBadRequestHttpExceptionIsBuiltCorrectly() {\n\t\ttry {\n\t\t\tthrow new Exception\\BadRequestException();\n\t\t} catch ( \\Exception $e ) {\n\t\t\t$this->assertSame( 400, $e->getStatusCode() );\n\t\t\t$this->assertSame( 'Bad Request', $e->getMessage() );\n\t\t}\n\t}",
"public function testUnprocessableEntityHttpExceptionIsBuiltCorrectly() {\n\t\ttry {\n\t\t\tthrow new Exception\\UnprocessableEntityException();\n\t\t} catch ( \\Exception $e ) {\n\t\t\t$this->assertSame( 422, $e->getStatusCode() );\n\t\t\t$this->assertSame( 'Unprocessable Entity', $e->getMessage() );\n\t\t}\n\t}",
"public function testNotErrorCodeCorrespondingToHttpStatusCode()\n {\n $this->setExpectedException('Breeze\\\\Dispatcher\\\\EndRequestException');\n\n $this->_exception = new \\Exception('test', 800);\n $this->_application->expects($this->never())->method('status');\n $this->_errors->dispatchError($this->_exception);\n }",
"public function testException()\n {\n throw new ThumbNotFoundException;\n }",
"public function testException() {\n\t\t$this->sendRequest('testException', null, null, true);\n\t}",
"public function testApiRequestThrowsException()\n {\n\n $data = [\"message\" => \"Something went wrong!\"];\n\n $response = $this->getMockBuilder(\"Psr\\\\Http\\\\Message\\\\ResponseInterface\")\n ->disableOriginalConstructor()\n ->setMethods([\"getBody\"])\n ->getMockForAbstractClass();\n $response->expects($this->once())\n ->method(\"getBody\")\n ->willReturn(json_encode($data));\n\n $exception = $this->getMockBuilder(\"GuzzleHttp\\\\Exception\\\\BadResponseException\")\n ->disableOriginalConstructor()\n ->setMethods([\"getResponse\"])\n ->getMock();\n $exception->expects($this->once())\n ->method(\"getResponse\")\n ->willReturn($response);\n\n $apiClient = $this->getMockApiClient(\"test\", [\"post\"]);\n $apiClient->expects($this->once())\n ->method(\"post\")\n ->willThrowException($exception);\n\n try {\n $this->runProtectedMethod($apiClient, \"apiRequest\", [\"test\"]);\n } catch (BadResponseException $e) {\n $this->assertInstanceOf(\"Choccybiccy\\\\Telegram\\\\Entity\\\\Response\", $e->getResponse());\n $this->assertEquals($data, $this->getProtectedProperty($e->getResponse(), \"data\"));\n }\n }",
"public function makeException()\n {\n $this->thrownException = ResponseException::create($this);\n }",
"public function testConstruct()\n {\n $exception = new JSONValidationException('');\n\n $this->assertInstanceOf('Exception', $exception);\n }",
"public function testHandleRequestException(): void\n {\n $response = (new ResponseHandler())->handleException(\n new RequestException(\n 'Test request exception',\n new Request('GET', 'test'),\n new Response(400, [], \\json_encode(['message' => 'Test request exception message']) ?: '')\n )\n );\n\n self::assertSame('Test request exception message', $response->get('message'));\n self::assertSame(400, $response->getStatusCode());\n }",
"public function httpMessageRequestConstructExceptionUri(UnitTester $I)\n {\n $I->wantToTest('Http\\Message\\Request - __construct() - exception uri');\n\n $I->expectThrowable(\n new InvalidArgumentException(\n 'Invalid uri passed as a parameter'\n ),\n function () {\n $request = new Request('GET', false);\n }\n );\n }",
"public function makeException()\n {\n $this->thrownException = HodelaResponseException::create($this);\n }",
"public function testThrowBadRequest() {\n\t\t$this->setExpectedException('BadRequestException');\n\t\t$this->controller->throwBadRequest();\n\t}",
"public function testClientException()\n {\n $this->expectException(HttpException::class);\n $this->makeRequest(new GuzzleExceptions\\ClientException('foo', $this->guzzleRequest, $this->guzzleResponse));\n }",
"public function testException()\n {\n throw new Exception('This is not expected.');\n }",
"public function testError()\n {\n if ($this->checkVersion('5.3', '<')) {\n $this->markTestSkipped(\n 'Catching exceptions is not possible on Laravel 5.1'\n );\n }\n\n $crawler = $this->call(\n 'POST',\n 'api/error',\n [],\n [],\n [],\n [\n 'HTTP_ORIGIN' => 'localhost',\n 'HTTP_ACCESS_CONTROL_REQUEST_METHOD' => 'POST',\n ]\n );\n\n $this->assertEquals(\n 'localhost',\n $crawler->headers->get('Access-Control-Allow-Origin')\n );\n $this->assertEquals(500, $crawler->getStatusCode());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes a new bulk delete location custom attributes response location custom attribute delete response Builder object. | public static function init(): self
{
return new self(new BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse());
} | [
"public static function init(): self\n {\n return new self(new BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest());\n }",
"public function build(): BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest\n {\n return CoreHelper::clone($this->instance);\n }",
"public function build(): DeleteLocationCustomAttributeDefinitionResponse\n {\n return CoreHelper::clone($this->instance);\n }",
"public static function init(array $values): self\n {\n return new self(new BulkDeleteLocationCustomAttributesRequest($values));\n }",
"public function bulkDeleteLocationCustomAttributes(BulkDeleteLocationCustomAttributesRequest $body): ApiResponse\n {\n $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/locations/custom-attributes/bulk-delete')\n ->auth('global')\n ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body));\n\n $_resHandler = $this->responseHandler()\n ->type(BulkDeleteLocationCustomAttributesResponse::class)\n ->returnApiResponse();\n\n return $this->execute($_reqBuilder, $_resHandler);\n }",
"public static function init(): self\n {\n return new self(new BookingCustomAttributeDeleteResponse());\n }",
"public static function init(): self\n {\n return new self(new BulkUpsertLocationCustomAttributesResponse());\n }",
"public static function init(): self\n {\n return new self(new DeleteOrderCustomAttributeDefinitionResponse());\n }",
"public static function init(array $values): self\n {\n return new self(new BulkDeleteOrderCustomAttributesResponse($values));\n }",
"public function build(): BulkUpsertLocationCustomAttributesRequest\n {\n return CoreHelper::clone($this->instance);\n }",
"function delete_location() {\n\t $this->slplus->currentLocation->set_PropertiesViaDB( $this->slplus->ajax->query_params['location_id'] );\n\n\t $status = $this->slplus->currentLocation->delete();\n\t if ( is_int( $status ) ) {\n\t\t $count = $status;\n\t\t $status = 'ok';\n\t } else {\n\t $count = '0';\n\t\t $status = 'error';\n\t }\n\n\n\t $response = array(\n\t 'status' => $status,\n\t\t 'count' => $count,\n\t 'action' => 'delete_location',\n\t 'location_id' => $this->slplus->ajax->query_params['location_id'],\n\t );\n\n\t wp_die( json_encode( $response ) );\n }",
"public function build(): BulkDeleteOrderCustomAttributesRequest\n {\n return CoreHelper::clone($this->instance);\n }",
"public static function init(string $locationId, CustomAttribute $customAttribute): self\n {\n return new self(new BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest(\n $locationId,\n $customAttribute\n ));\n }",
"public function __construct(array $location_Attribute = array())\n {\n $this\n ->setLocation_Attribute($location_Attribute);\n }",
"public function __construct(array $location_Attribute_Reference = array())\n {\n $this\n ->setLocation_Attribute_Reference($location_Attribute_Reference);\n }",
"public static function init(): self\n {\n return new self(new BatchDeleteCatalogObjectsResponse());\n }",
"public static function init(string $orderId): self\n {\n return new self(new BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute($orderId));\n }",
"public static function init(array $values): self\n {\n return new self(new BulkUpsertLocationCustomAttributesRequest($values));\n }",
"public function build(): DeleteCustomerCustomAttributeResponse\n {\n return CoreHelper::clone($this->instance);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Factory method for creating a Mezzo module instance. | public static function make()
{
return mezzo()->module(static::class);
} | [
"public function createModuleInstance() {\n\t\tif (class_exists ($this->name)) {\n $this->srcType = MODULE_TYPE_OOP;\n\t\t\t$this->moduleObject = new $this->name();\n\t\t}\n # When Module is Procedure-styled\n\t\telse {\n }\n \n $this->updateModuleInfo();\n return $this->moduleObject;\n }",
"protected function makeMetaModuleInstance()\n {\n return new ModelMetaModule;\n }",
"static function get($module){\n if(isset(self::$instances[$module])) return self::$instances[$module];\n $instance = new $module;\n self::$instances[$module] = $instance;\n $instance->name = $module;\n $instance->directory = CHOQ_ROOT_DIRECTORY.DS.\"modules\".DS.$module;\n $instance->onInit();\n $instance->afterInit();\n foreach(self::$instances as $object) $object->afterOtherModuleInit($instance);\n return $instance;\n }",
"public function createModuleInstance($pathToMetaFile);",
"public static function factory(&$db, &$tpl, &$player, $module='Index')\r\n {\r\n if (file_exists(MOD_DIR . '/' . $module . '/index.php'))\r\n {\r\n include_once (MOD_DIR . '/' . $module . '/index.php');\r\n $classname = 'Module_' . $module;\r\n return new $classname($db, $tpl, $player);\r\n }\r\n else\r\n {\r\n // Default module to display (the home page)\r\n include_once (MOD_DIR . '/Index/index.php');\r\n return new Module_Index($db, $tpl, $player);\r\n }\r\n }",
"protected function createModule()\n {\n $module = Str::studly(class_basename($this->argument('name')));\n\n $this->call('component:module', [\n 'name' => \"{$module}\",\n '--model' => $module,\n ]);\n }",
"public function create_module() {\n\t\t$context = [];\n\t\t$this->climate->green()->out( 'Creating new Module…' );\n\n\t\t$context['name'] = null;\n\t\t$filename_module = null;\n\t\twhile ( $context['name'] == null || file_exists( $filename_module ) ) {\n\t\t\t$input = $this->climate->green()->input( \"What will your Module be called?\\r\\n>\" );\n\t\t\t$context['name'] = trim( $input->prompt() );\n\n\t\t\tif ( $context['name'] == null ) {\n\t\t\t\t$this->climate->error( Emoji::pileOfPoo() . ' Please give a name for this Module!' );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$context['name'] = Utility::modulize( $context['name'] );\n\t\t\t$context['id'] = strtolower( Utility::normalize( $context['name'] ) );\n\t\t\t$context['name_view'] = Utility::viewize( $context['name'] );\n\t\t\t$context['name_acf'] = Utility::acfize( $context['name'] );\n\n\t\t\t$filename_module = $GLOBALS['sloth']->container->get( 'path.theme' ) . DS . 'Module' . DS . $context['name'] . '.php';\n\t\t\tif ( file_exists( $filename_module ) ) {\n\t\t\t\t$this->climate->error( Emoji::pileOfPoo() . ' ' . sprintf( 'A module called %s exists!',\n\t\t\t\t\t\t$context['name'] ) );\n\t\t\t}\n\t\t}\n\n\t\t$input = $this->climate->green()->confirm( 'Do you want to use your module with Layotter?' );\n\t\t$context['layotter'] = $input->confirmed() ? [] : false;\n\n\t\tif ( is_array( $context['layotter'] ) ) {\n\t\t\t$input = $this->climate->green()->input( \"Please give a comprehensive title for your module.\\r\\n>\" );\n\t\t\t$context['layotter']['title'] = trim( $input->prompt() );\n\n\t\t\t$input = $this->climate->green()->input( \"Please give a short description of what this module will do.\\r\\n>\" );\n\t\t\t$context['layotter']['description'] = trim( $input->prompt() );\n\n\t\t\t$input = $this->climate->green()->input( \"Please choose an icon for this module.\\r\\n(choose from http://fontawesome.io/icons/)\\r\\n>\" );\n\t\t\t$context['layotter']['icon'] = trim( $input->prompt() );\n\t\t}\n\t\t/*\n\t\t\t\t$input = $this->climate->green()->confirm( 'Do you want me to create a sass file for this module?' );\n\t\t\t\t$context['sass'] = $input->confirmed();\n\n\t\t\t\t$input = $this->climate->green()->confirm( 'Do you want me to create a JavaScript file for this module?' );\n\t\t\t\t$context['js'] = $input->confirmed();\n\t\t*/\n\n\t\t# write it to file\n\t\t$view = View::make( 'Scaffold.Module.Class' );\n\t\tfile_put_contents( $filename_module, $view->with( $context )->render() );\n\n\t\t$filename_view = $GLOBALS['sloth']->container->get( 'path.theme' ) . DS . 'View' . DS . 'Module' . DS . $context['name_view'] . '.twig';\n\t\t$view = View::make( 'Scaffold.Module.View' );\n\t\tfile_put_contents( $filename_view, $view->with( $context )->render() );\n\n\n\t\t$sass_dir = DIR_ROOT . DS . 'src' . DS . 'sass' . DS;\n\t\tif ( ! is_dir( $sass_dir ) ) {\n\t\t\t$sass_dir = DIR_ROOT . DS . 'src' . DS . 'scss' . DS;\n\t\t}\n\n\t\t$filename_sass = $sass_dir . 'modules' . DS . '_' . $context['name_view'] . '.scss';\n\t\tif ( ! is_dir( dirname( $filename_sass ) ) ) {\n\t\t\tmkdir( dirname( $filename_sass ), 0777, true );\n\t\t}\n\t\t$view = View::make( 'Scaffold.Module.Sass' );\n\t\tfile_put_contents( $filename_sass, $view->with( $context )->render() );\n\n\n\t\t$filename_sass_bundle = $sass_dir . 'bundle.scss';\n\t\tfile_put_contents( $filename_sass_bundle,\n\t\t\tsprintf( \"\\n@import 'modules/%s';\", $context['name_view'] ),\n\t\t\tFILE_APPEND );\n\n\t\tif ( $context['layotter'] ) {\n\t\t\t$filename_acf = $GLOBALS['sloth']->container->get( 'path.theme' ) . DS . 'acf-json' . DS . $context['name_acf'] . '.json';\n\t\t\tif ( file_exists( $filename_acf ) ) {\n\t\t\t\t$this->climate->info( Emoji::thinkingFace() . ' ' . sprintf( 'A Field Group %s exists. Skipping scaffolding!',\n\t\t\t\t\t\t$context['name_acf'] ) );\n\t\t\t} else {\n\t\t\t\t$view = View::make( 'Scaffold.Module.Acf' );\n\t\t\t\t$data = json_decode( $view->with( $context + [ 'now' => time() ] )->render() );\n\t\t\t\tif ( json_last_error() != JSON_ERROR_NONE ) {\n\t\t\t\t\tthrow new \\Exception( 'Seems your scaffold is not correct json!' );\n\t\t\t\t}\n\t\t\t\tfile_put_contents( $filename_acf, json_encode( $data ) );\n\t\t\t}\n\t\t}\n\n\t\t$this->climate->info( sprintf( 'Module %s created!', $context['name'] ) );\n\t}",
"protected function createModuleInfo()\n\t\t{\n\t\t\treturn new Core_ModuleInfo(\n\t\t\t\t\"CMS\",\n\t\t\t\t\"LemonStand CMS features\",\n\t\t\t\t\"LemonStand eCommerce Inc.\" );\n\t\t}",
"protected function createObject()\n {\n $object = $this->reflection->newInstanceArgs($this->objectArgs);\n if ($this->objectConfig) {\n $object = Yii::configure($object, $this->objectConfig);\n }\n return $object;\n }",
"public static function create();",
"public function makeModArticle() {\n\t\t\t$this->setClass('ModArticle');\n\t\t\t\n\t\t}",
"private function createInstance()\n {\n return new Meta( $this->viewFactory, $this->htmlBuilder, $this->bladeCompiler, $this->configRepository );\n }",
"protected function createModuleInfo()\n\t\t{\n\t\t\treturn new Core_ModuleInfo(\n\t\t\t\t\"Shop\",\n\t\t\t\t\"LemonStand shopping-cart features\",\n\t\t\t\t\"LemonStand eCommerce Inc.\" );\n\t\t}",
"protected function createModuleInfo()\n\t{\n\t\treturn new Core_ModuleInfo(\n\t\t\t\"PDF Invoices\",\n\t\t\t\"Generate Invoice PDFs to send to customers\",\n\t\t\t\"Flynsarmy\"\n\t\t);\n\t}",
"protected function createModuleInfo()\n\t{\n\t\treturn new Core_ModuleInfo(\n\t\t\t'Custom Order No.',\n\t\t\t'Gives an order a randomly generated 5 character order number',\n\t\t\t'GreatPotato',\n\t\t\t'http://www.mrld.co'\n\t\t);\n\t}",
"public function getFactory();",
"function createNew()\n\t{\n\t\tinclude_once( \"Bin/Module.DataModel/ProcessGroupModuleData.php\");\n\t\t$o = new ViewProcessGroupModuleData();\n\t\treturn $o;\n\t}",
"function createNew()\n\t{\n\t\tinclude_once( \"Bin/Module.DataModel/ProcessModuleData.php\");\n\t\t$o = new ViewProcessModuleData();\n\t\treturn $o;\n\t}",
"public function createObject () {\n\t\t// check base class (non-country specific)\n\t\t$baseDir = $this->config->get('app.path') . '/services/modules/' . $this->module;\n\t\t$baseFile = $baseDir . '/' . ucfirst($this->module) . 'Service.php';\n\t\t$class = ucfirst($this->module) . 'Service';\n\t\tif (!file_exists($baseFile)) {\n\t\t\tthrow new \\Exception('Module '.$baseFile.' does not exist!');\n\t\t}\n\t\trequire_once $baseFile;\n\t\t\n\t\t// load class\n\t\t$this->object = new $class($this->config);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ update service draw notify message | public function update_service_draw_notify_msg($draw_notify_msg)
{
return db::sql("UPDATE `tl_services_draw_engine` SET notify = '$draw_notify_msg' WHERE id = '$this->id';", DB_NAME);
} | [
"public function testUpdateNotification()\n {\n }",
"public function testUpdateNotification()\n {\n\n }",
"private function notification(){\n\t\n\t}",
"public function notify()\n {\n }",
"public function notify() {\n\t\tif (empty($this->service)) {\n\t\t\t$this->stop(200, 'No services');\n\t\t}\n\t\tif (!$this->service->validate()) {\n\t\t\t$this->stop(400);\n\t\t}\n\t\t$message = $this->service->message();\n\t\tforeach ($this->notifications as $notification) {\n\t\t\t$notification->notify($message);\n\t\t}\n\t\t$this->stop(200);\n\t}",
"public function notify(){\n if(self::$_event){\n foreach($this->_observers as $obs)\n $obs->update($this);\n }\n }",
"abstract public function notify($message);",
"public function notify()\n\t\t{\n\t\t\techo \"Notifying via YM\\n\";\n\t\t}",
"public function notify(Zym_Message $notification);",
"public function notify()\n {\n $this->getLog()->debug('DataSet ' . $this->dataSetId . ' wants to notify');\n\n $this->displayFactory->getDisplayNotifyService()->collectNow()->notifyByDataSetId($this->dataSetId);\n }",
"protected function note($message)\n\t{\n\t\t$this->notify($message, 'bg=cyan');\n\t}",
"public function showUpdateNotification(){\n\t\techo $this->getUpdateNotification();\n\t}",
"public function notify()\r\n\t{\r\n\t\techo \"Notifying via User<br>\";\r\n\t}",
"public function update_notice(){\n\t\t\t\n\t\t\t\n\t\t}",
"public function notify() {\n\t\t// Loops though all observers and sends updates one at a time.\n\t\tforeach ($this->observers as $value) {\n\n\t\t\t$value->update($this);\n\t\t}\n\t}",
"public function notify() {\n foreach ($this->_observers as $key => $item) {\n $item->update($this);\n\t\t\t\n }//end foreach\n\t\t\n }",
"public function on_update() {}",
"public function notifyClientWithFlashNotifications() {\n\t\tstatic $isNotifyed = false;\n\t\tif ($isNotifyed) {\n\t\t\treturn;\n\t\t}\n\t\t$isNotifyed = true;\n\t\tforeach (Yii::app()->user->getFlashes() AS $message) {\n\t\t\t$this->notifyClient($message);\n\t\t}\n\t}",
"public function notify() {\n\t\tforeach($this->_observers as $key => $val) {\n\t\t\t$val->update($this);\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Upload::getHttpPostFiles() Devolver las variables post que contiene el archivo | function getHttpPostFiles()
{
return $this->HttpPostFiles;
} | [
"public function getFiles(){\n return $this->request->files;\n }",
"function _getFullPostData()\n\t{\n\t\t$data = $_POST;\n\t\tif (isset($_FILES))\n\t\t\tforeach ($_FILES as $firstKey => $container)\n\t\t\t\tforeach ($container as $field => $values)\n\t\t\t\t\t$this->__transformFilesValueArr($field, $values, $data[$firstKey]);\n\t\treturn $data;\n\t}",
"protected function extractUploadedFileData($postVars)\n {\n // Note: Format of posted file parameters in php is a feature of using\n // <input name='{$Name}[Uploads][]' /> for multiple file uploads\n $tmpFiles = [];\n if (!empty($postVars['tmp_name'])\n && is_array($postVars['tmp_name'])\n && !empty($postVars['tmp_name']['Uploads'])\n ) {\n for ($i = 0; $i < count($postVars['tmp_name']['Uploads'] ?? []); $i++) {\n // Skip if \"empty\" file\n if (empty($postVars['tmp_name']['Uploads'][$i])) {\n continue;\n }\n $tmpFile = [];\n foreach (['name', 'type', 'tmp_name', 'error', 'size'] as $field) {\n $tmpFile[$field] = $postVars[$field]['Uploads'][$i];\n }\n $tmpFiles[] = $tmpFile;\n }\n } elseif (!empty($postVars['tmp_name'])) {\n // Fallback to allow single file uploads (method used by AssetUploadField)\n $tmpFiles[] = $postVars;\n }\n\n return $tmpFiles;\n }",
"private static function getFormData()\n {\n $dados = array();\n $raw_data = file_get_contents('php://input');\n $boundary = substr($raw_data, 0, strpos($raw_data, \"\\r\\n\"));\n if (!$boundary) return $dados;\n\n $parts = array_slice(explode($boundary, $raw_data), 1);\n\n foreach ($parts as $part) {\n if ($part == \"--\\r\\n\") break;\n\n $part = ltrim($part, \"\\r\\n\");\n list($raw_headers, $body) = explode(\"\\r\\n\\r\\n\", $part, 2);\n\n $raw_headers = explode(\"\\r\\n\", $raw_headers);\n $headers = array();\n foreach ($raw_headers as $header) {\n list($name, $value) = explode(':', $header);\n $headers[strtolower($name)] = ltrim($value, ' ');\n }\n\n if (isset($headers['content-disposition'])) {\n $filename = null;\n preg_match(\n '/^(.+); *name=\"([^\"]+)\"(; *filename=\"([^\"]+)\")?/',\n $headers['content-disposition'],\n $matches\n );\n list(, $type, $name) = $matches;\n isset($matches[4]) and $filename = $matches[4];\n\n switch ($name) {\n case 'userfile':\n file_put_contents($filename, $body);\n break;\n default:\n $dados[$name] = substr($body, 0, strlen($body) - 2);\n break;\n }\n }\n }\n return $dados;\n }",
"public function getFiles() {\n\t\t return $this->form['files'];\n\t }",
"public function getFiles()\n\t{\n\t\treturn $_FILES;\n\t}",
"public function getUploadedFiles()\n {\n }",
"public function getPostFile($fieldName);",
"function _files()\n {\n //return original $_FILES array\n return $this->_files;\n }",
"public function get_file_params() {}",
"#[Pure]\n public function getPostFiles() {}",
"public function uploadFiles() {\n\n\t\t$files = isset($_FILES['files']) ? $_FILES['files'] : array();\n\t\t$path \t = $this['request']->get('path', 'string');\n\t\t$uploaded = array();\n\n\t\tif ($this['system']->checkToken($this['request']->get('token', 'string')) && isset($files['name']) && strlen($path) && $targetpath = $this['path']->path('media:'.$path)) {\n\t\t\tfor ($i = 0; $i < count($files['name']); $i++) {\n\t\t\t\tif (!$files['error'][$i] && preg_match('/image/i', $files['type'][$i]) && @move_uploaded_file($files['tmp_name'][$i], $targetpath.'/'.$files['name'][$i])) {\n\t\t\t\t\t$uploaded[] = $files['name'][$i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\techo json_encode($uploaded);\n\t}",
"protected function getFilesFromGlobal()\n\t{\n\t\t$arrFiles = array();\n\t\t$intCount = count($_FILES[$this->strName]['name']);\n\n\t\tfor ($i=0; $i<$intCount; $i++)\n\t\t{\n\t\t\tif ($_FILES[$this->strName]['name'][$i] == '')\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrFiles[] = array\n\t\t\t(\n\t\t\t\t'name' => $_FILES[$this->strName]['name'][$i],\n\t\t\t\t'type' => $_FILES[$this->strName]['type'][$i],\n\t\t\t\t'tmp_name' => $_FILES[$this->strName]['tmp_name'][$i],\n\t\t\t\t'error' => $_FILES[$this->strName]['error'][$i],\n\t\t\t\t'size' => $_FILES[$this->strName]['size'][$i],\n\t\t\t);\n\t\t}\n\n\t\treturn $arrFiles;\n\t}",
"public function getUploadedFiles(){\n\t\tif(isset($_FILES)){\n\t\t\t$files = array();\n\t\t\tforeach($_FILES as $file){\n\t\t\t\t$controllerFile = new ControllerUploadFile($file);\n\t\t\t\t$files[] = $controllerFile;\n\t\t\t}\n\t\t\treturn $files;\n\t\t} else {\n\t\t\treturn array();\n\t\t}\n\t}",
"private function _parseForm()\n {\n if( !empty( $this->boundary ) )\n {\n $chunks = @preg_split( '/[\\-]+'.$this->boundary.'(\\-\\-)?/', $this->input, -1, PREG_SPLIT_NO_EMPTY );\n $request = array();\n $files = array();\n $nd = 0;\n $nf = 0;\n\n if( is_array( $chunks ) )\n {\n foreach( $chunks as $index => $chunk )\n {\n $chunk = ltrim( $chunk, \"-\\r\\n\\t\\s \" );\n $lines = explode( \"\\r\\n\", $chunk );\n $levels = '';\n $name = '';\n $file = '';\n $type = '';\n $value = '';\n $path = '';\n $copy = false;\n\n // skip empty chunks\n if( empty( $chunk ) || empty( $lines ) ) continue;\n\n // extract name/filename\n if( strpos( $lines[0], 'Content-Disposition' ) !== false )\n {\n $line = $this->_line( array_shift( $lines ) );\n $name = $this->_value( @$line['name'], '', true );\n $file = $this->_value( @$line['filename'], '', true );\n }\n // extract content-type\n if( strpos( $lines[0], 'Content-Type' ) !== false )\n {\n $line = $this->_line( array_shift( $lines ) );\n $type = $this->_value( @$line['content'], '', true );\n }\n // rebuild value\n $value = trim( implode( \"\\r\\n\", $lines ) );\n\n // FILES data\n if( !empty( $type ) )\n {\n if( !empty( $value ) )\n {\n $path = str_replace( '\\\\', '/', sys_get_temp_dir() .'/php'. substr( sha1( rand() ), 0, 6 ) );\n $copy = file_put_contents( $path, $value );\n }\n if( preg_match( '/(\\[.*?\\])$/', $name, $tmp ) )\n {\n $name = str_replace( $tmp[1], '', $name );\n $levels = preg_replace( '/\\[\\]/', '['.$nf.']', $tmp[1] );\n }\n $files[ $name.'[name]'.$levels ] = $file;\n $files[ $name.'[type]'.$levels ] = $type;\n $files[ $name.'[tmp_name]'.$levels ] = $path;\n $files[ $name.'[error]'.$levels ] = !empty( $copy ) ? 0 : UPLOAD_ERR_NO_FILE;\n $files[ $name.'[size]'.$levels ] = !empty( $copy ) ? filesize( $path ) : 0;\n $nf++;\n }\n else // POST data\n {\n $name = preg_replace( '/\\[\\]/', '['.$nd.']', $name );\n $request[ $name ] = $value;\n $nd++;\n }\n }\n // finalize arrays\n $_REQUEST = array_merge( $_GET, $this->_data( $request ) );\n $_FILES = $this->_data( $files );\n return true;\n }\n }\n return false;\n }",
"public function testPostFiles() {\n foreach (self::$testParams as $upload) {\n $response = $this->generateUpload($upload['token'], $upload['file']);\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertEquals('Success', $response->getBody());\n }\n }",
"function as_post_fields_curl_array(){\n\t\n\t\t$post_array = array();\n\t\t$i=1;\n\t\t\n\t\tforeach($this->as_array(1) as $image){\n\t\t\t$post_array['file'.$i] = '@'.$image;\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\treturn $post_array;\t\n\t}",
"public function makeArrayOfFileUploaded(): array\n {\n // Creates posts if the request method is PUT and the request content type is not defined. Else it will return 'Not Acceptable' status\n if(($ret1 = RestServer::getRequestMethod()) != 'PUT' or ($ret2 = RestServer::getRequestContentType())) {\n $this->_restServer->response('', 406);\n }\n $upFileArr = array();\n $pathToTmp = tempnam(sys_get_temp_dir(), 'itapif');\n $putData = fopen('php://input', 'r');\n $fp = fopen($pathToTmp, 'w');\n while ($data = fread($putData, self::bytesAtATime)) {\n $ret = fwrite($fp, $data);\n }\n $ret = fclose($putData);\n $ret = fclose($fp);\n $upFileArr['error'] = 0;\n $upFileArr['tmp_name'] = $pathToTmp;\n $upFileArr['size'] = filesize($pathToTmp);\n return $upFileArr;\n }",
"public function ProcesFiles() {\n foreach ( $_FILES as $f )\n {\n $upfile = array();\n $upfile[\"name\"] = basename($f[\"name\"]);\n $upfile[\"tmp_name\"] = $f[\"tmp_name\"];\n $upfile[\"target_path_name\"] = $this->upload->getTargetDir() . $upfile[\"name\"];\n $upfile[\"extension\"] = pathinfo($upfile[\"name\"], PATHINFO_EXTENSION);\n $upfile[\"getimagesize\"] = getimagesize($upfile[\"tmp_name\"]);\n $upfile[\"size\"] = $f[\"size\"];\n\n $result = $this->CheckUpload( $upfile );\n $this->ResponseToUpload($result, $upfile);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
test for sub category name dupplication | public function checkSubCategoryName($key, $value)
{
if ($this->name == $value) {
$this->subCategories[$key]['name'] = '';
$this->dispatchBrowserEvent('CategoryAlreadyExist');
}
if (!empty($this->subCategories) && count($this->subCategories) > 1) {
foreach ($this->subCategories as $keySub => $subcategory) {
if ($subcategory['name'] == $value && $keySub != $key) {
$this->subCategories[$key]['name'] = '';
$this->dispatchBrowserEvent('CategoryAlreadyExist');
return;
}
}
}
} | [
"public function SubCategory ($get_category_group, $get_sub_category_name)\r\n\t\t{\r\n\t\t $check_category = \"//li//div[contains(@data-promotion-ic, '\".$get_category_group.\"')]/..//a[@title='\".$get_sub_category_name.\"']\";\r\n\t\t return $check_category;\t\r\n\t\t}",
"function is_subcat() {\n\t$subcat = SUBCAT;\n\treturn(!empty($subcat));\n}",
"function sub_cat($sub) {\n global $TABLE_PREFIX, $CACHE_DURATION;\n\n $c_q = get_result('SELECT name FROM '.$TABLE_PREFIX.'categories WHERE id='.$sub.' LIMIT 1;', true, $CACHE_DURATION);\n return unesc($c_q[0]['name']);\n}",
"function in_category($nicename) {\n return wpp::is_term_child_of($nicename, get_the_category());\n }",
"public function getSubcategoryname()\n {\n return $this->subcategoryname;\n }",
"function show_subcategory() {\n foreach((get_the_category()) as $subcategory)\n\n {\n if ($subcategory->category_parent)\n {\n $string = $subcategory->cat_name;\n $string = strip_tags($string);\n if (strlen($string) >40) {\n\n // truncate string\n $stringCut = substr($string, 0, 40);\n\n // make sure it ends in a word so \"assassinate\" doesn't become \"ass\"...\n $string = substr($stringCut, 0, strrpos($stringCut, ' ')); //.'...';\n }\n\n echo '<a href=\"' . get_category_link($subcategory->cat_ID) . '\">' . $string . '</a>';\n\n }\n }\n}",
"function charity_is_hope_woocommerce_shop_loop_subcategory_title($cat) {\n\n $cat->name = sprintf('<a href=\"%s\">%s</a>', esc_url(get_term_link($cat->slug, 'product_cat')), $cat->name);\n ?>\n <h2 class=\"woocommerce-loop-category__title\">\n <?php\n echo trim($cat->name);\n\n if ( $cat->count > 0 ) {\n echo apply_filters( 'woocommerce_subcategory_count_html', ' <mark class=\"count\">(' . esc_html( $cat->count ) . ')</mark>', $cat ); // WPCS: XSS ok.\n }\n ?>\n </h2><?php\n }",
"function nameExistInParent(){\n\n\t\t$cat = $this->add('xepan\\commerce\\Model_Category');\n\t\t$cat->addCondition('parent_category_id',$this['parent_category_id']?:null);\n\t\t$cat->addCondition('name',$this['name']);\n\t\t$cat->addCondition('id','<>',$this->id);\n\t\t$cat->tryLoadAny();\n\n\t\treturn $cat->loaded();\n\n\t\treturn $this->ref('parent_category_id')->loaded()? \n\t\t$this->ref('parent_category_id')->ref('SubCategories')\n\t\t\t\t->addCondition('name',$this['name'])\n\t\t\t\t->addCondition('id','<>',$this->id)\n\t\t\t\t->tryLoadAny()->loaded(): false;\n\t}",
"function check_category_name()\n\t{\n\t\t$data = $this->Blog_model->check_category_duplicate();\n\t\tif (empty($data))\n\t\t{\n\t\t\techo '0';\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo '1';\n\t\t}\n\t}",
"function subcategoryName($dbConn, $sub_cat_id){\n\t\t$sql = \"SELECT * FROM tbl_sub_category WHERE sub_cat_id = '$sub_cat_id'\";\n\t\t$result = dbQuery($dbConn, $sql);\n\t\tif(dbNumRows($result) > 0){\n\t\t\t$row = dbFetchAssoc($result);\n\t\t\techo $row['sub_cat_title'];\n\t\t}\n\t}",
"function isCategory($string)\n{\n if ((stripos($string, \"Categoría\") === false) && (stripos($string, \"Category\") === false)) {\n return false;\n } else {\n return true;\n }\n\n}",
"public function getSubCategoryName()\n {\n return $this->subCategoryName;\n }",
"public function getSubSubSubcategory($company,$slug){\n \n }",
"function createSubCategory($parent_id, $sub_cat_name)\n{\n $category = array(\n \"fk_i_parent_id\" => $parent_id,\n \"b_enabled\" => 1,\n \"b_price_enabled\" => 1,\n \"i_expiration_days\" => 0,\n \"i_position\" => 0\n );\n\n $category_description = array(osc_current_user_locale() => (array('s_name' => $sub_cat_name)));\n\n return Category::newInstance()->insert($category, $category_description);\n}",
"function isSubCategory($rootCat, $cat)\n {\n $rPath = $rootCat['ipath'] . '/';\n $cPath = $cat['ipath'];\n\n return strpos($cPath, $rPath) === 0;\n }",
"function lp_get_category_by_name( $name ){\n return $term_id = term_exists( $name, 'ait-dir-item-category' );\n}",
"public function subcategoryExist($cate_id, $name){\n if(Shop_subcategory::where(\"shop_category_id\",\"=\",$cate_id)->where(\"name\",\"=\",$name)->count() > 0){\n return true;\n }\n\n return false;\n }",
"function SelectTableNameFromSubcategory($conn,$subcategory){\n if($subcategory==\"Cuffie in ear\" || $subcategory==\"Cuffie on ear\" || $subcategory==\"Cuffie wireless\")\n $tableName=\"Cuffie\";\n if($subcategory==\"Casse Altoparlanti\" || $subcategory==\"Casse Bluetooth\")\n $tableName=\"Casse\";\n if($subcategory==\"Accessori Cuffie\" || $subcategory==\"Accessori Casse\")\n $tableName=\"Accessori\";\n return $tableName;\n}",
"public function test_get_category_names() {\n $coursessearcharea = \\core_search\\manager::get_search_area($this->coursesareaid);\n $sectionsearcharea = \\core_search\\manager::get_search_area($this->sectionareaid);\n $customfieldssearcharea = \\core_search\\manager::get_search_area($this->customfieldareaid);\n\n $this->assertEquals(['core-courses'], $coursessearcharea->get_category_names());\n $this->assertEquals(['core-course-content'], $sectionsearcharea->get_category_names());\n $this->assertEquals(['core-course-content', 'core-courses'], $customfieldssearcharea->get_category_names());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return current user id or null | private function getCurrentUserId() {
return (Auth::check()) ? Auth::user()->id : null;
} | [
"public function getCurrentId() {\n\t\treturn $this->current_user;\n\t}",
"protected function get_current_user_id()\n {\n }",
"function get_current_user_id()\n{\n\treturn UserModel::get_current_user_id();\n}",
"function get_current_user_id()\n{\n}",
"public function get_current_user_id()\n {\n return $this->getRequest()->query->get(self::PARAM_USER_ID, $this->get_user_id());\n }",
"private function get_user_id() {\n if (!$this->userinfo) $this->userinfo = wp_get_current_user();\n\n return $this->userinfo && isset($this->userinfo->ID) && $this->userinfo->ID > 0 ?\n $this->userinfo->ID :\n $_SERVER[\"REMOTE_ADDR\"];\n }",
"public static function current_user_id()\n\t{\n\t\treturn Session::has(Config::get('sentry::sentry.session.user'))\n\t\t\t? Session::get(Config::get('sentry::sentry.session.user'))\n\t\t\t: 0;\n\t}",
"private function getCurrentUserId()\n {\n return $this->security->getUser()->getId();\n }",
"public function get_user_id();",
"public function getCurrentId() {\n\t\treturn Sentry::getUser()->id;\n\t}",
"public function getCurrentId()\n\t{\n\t\tif ( ! $this->_currentUser) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn $this->_currentUser;\n\t\t}\n\t}",
"public static function get_user_id() {\n\t\t$user_ID = get_current_user_id();\n\t\treturn $user_ID ? $user_ID : '';\n\t}",
"public function getCurrentUserId()\n {\n return $this->currentUserId;\n }",
"public function getUserID() {\n if (!$this->isLoggedin()) {\n return -1;\n }\n return $this->user->getId();\n }",
"private function getUserId() {\n $request = $this->getRequest();\n return empty($request['uid']) ? $this->getAccount()->uid : $request['uid'];\n }",
"public function getCurrentUserID()\n {\n // Verificar si ya se valido un access_token\n if(!is_array($this->current) && !is_object($this->current)){\n return 0;\n }\n // Devolver el UserID del usuario que se verifico el Access Token\n return $this->current->id;\n }",
"public static function id()\n\t{\n\t\tif (static::config(\"USE_SESSION\")) {\n\t\t\treturn static::$session->get(\"AUTH_USER\")[\"id\"] ?? null;\n\t\t}\n\n\t\t$payload = static::validateToken(static::getSecretKey());\n\t\tif (!$payload) return null;\n\t\treturn $payload->user_id;\n\t}",
"function get_user_id() {\n\t\tif(isset($this->user_id))\n\t\t\treturn $this->user_id;\n\n\t\treturn false;\n\t}",
"protected static function getUserId()\n {\n if (admin()) {\n return admin()->id;\n } elseif (user()) {\n return user()->id;\n }\n\n return 0;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders a link if the condition is true, otherwise returns the link's name only. | function link_to_if($condition, $content, $url=null, $attributes=null) {
return $condition ? link_to($content, $url, $attributes) : $content;
} | [
"public function renderLink();",
"function cot_linkif($url, $text, $cond)\n{\n\tif ($cond)\n\t{\n\t\t$res = '<a href=\"'.$url.'\">'.$text.'</a>';\n\t}\n\telse\n\t{\n\t\t$res = $text;\n\t}\n\n\treturn $res;\n}",
"public static function link_to_if($condition, $label, $url, $html_options = array())\n {\n return (bool) $condition ? self::link_to($label, $url, $html_options) : $label;\n }",
"function smarty_function_conditionalLink( $params, &$this )\r\n{\r\n\textract($params);\r\n\r\n\tif ( !is_null($confirm) )\r\n\t\t$onClickTxt = sprintf( \"onClick=\\\"return confirmLink('%s')\\\"\", $confirm );\r\n\t\r\n\tif ( !empty($onClick) )\r\n\t\t$onClickTxt = sprintf( \"onClick=\\\"%s\\\"\", $onClick);\r\n\r\n\tif ( !isset( $class ) )\r\n\t\t$class = null;\r\n\r\n\tif ( !is_null($href) )\r\n\t\tif ( !isset($spanClass) )\r\n\t\t\treturn sprintf( \"<a href=\\\"%s\\\" class=\\\"%s\\\" %s title=\\\"%s\\\">%s</a>\", $href, $class, $onClickTxt, $title, $text );\r\n\t\telse\r\n\t\t\treturn sprintf( \"<span class=\\\"%s\\\"><a href=\\\"%s\\\" class=\\\"%s\\\" %s title=\\\"%s\\\">%s</a></span>\", $spanClass, $href, $class, $onClickTxt, $title, $text );\r\n\telse\r\n\t\treturn $text;\r\n}",
"function link_only_if($condition, $title, $url = null, $options = array(), $confirmMessage = false) {\n if (!$condition) {\n return null;\n }\n\n // Pass it through link_if() for processing.\n return $this->link_if(true, $title, $url, $options, $confirmMessage);\n }",
"public function addLinkIf($title, $condition, $attributes = array());",
"public function renderLink()\n {\n $label = $this->renderLabel();\n $uri = $this->getUri();\n if (!$uri) {\n return $label;\n }\n\n return sprintf('<a href=\"%s\"><span></span>%s</a>', $uri, $label);\n }",
"function link_to_unless($condition, $content, $url=null, $attributes=null) {\n return (!$condition) ? link_to($content, $url, $attributes) : $content;\n}",
"protected function NameLink() {\n\t$idName = $this->NameID();\n\tif (empty($idName)) {\n\t return KHT_DESCR_IS_NULL;\n\t} else {\n\t $rcName = $this->NameRecord();\n\t return $rcName->SelfLink_name();\n\t}\n }",
"public function isLink();",
"private function createLink()\n\t{\n\t\treturn \"<a href=\\\"\".$this->properties['link'].\"\\\" class='\".implode(' ', $this->properties['classes']).\"'>\".$this->properties['text'].\"</a>\";\n\t}",
"function filter_link() {\n return '???';\n }",
"function outputrel($linkname,$titletemplate,$prefix,$key)\n{\n $url = Template::get(\"$prefix:url\");\n if(is_null($titletemplate))$titletemplate=\"{{\".$prefix.\":name}}\";\n $title = Template::process($titletemplate);\n return \"<link rel=\\\"$linkname\\\" title=\\\"$title\\\" href=\\\"$url\\\"/>\\n\";\n}",
"public function render()\n {\n $options = $this->parseLinkOptions();\n\n $html = '<a ';\n $html .= 'href=\"' . htmlentities($options['link'], ENT_COMPAT, 'UTF-8') . '\" ';\n\n if ($options['target']) {\n $html .= 'target=\"' . htmlentities($options['target'], ENT_COMPAT, 'UTF-8') . '\" ';\n }\n\n if ($options['cssClass']) {\n $html .= 'class=\"' . htmlentities($options['cssClass'], ENT_COMPAT, 'UTF-8') . '\" ';\n }\n\n if ($options['title']) {\n $html .= 'title=\"' . htmlentities($options['title'], ENT_COMPAT, 'UTF-8') . '\" ';\n }\n\n $html .= '>';\n $html .= $this->renderChildren();\n $html .= '</a>';\n\n return $html;\n }",
"public function display_link() {\n\t\tprintf(\n\t\t\t'<li><a href=\"#wpseo-meta-section-%1$s\" class=\"wpseo-meta-section-link %2$s\"%3$s>%4$s</a></li>',\n\t\t\tesc_attr( $this->name ),\n\t\t\tesc_attr( $this->link_class ),\n\t\t\t( '' !== $this->link_aria_label ) ? ' aria-label=\"' . esc_attr( $this->link_aria_label ) . '\"' : '',\n\t\t\t$this->link_content\n\t\t);\n\t}",
"function uses_link_display() { return !$this->has_path(); }",
"function display_user_link($user_id, $name)\n{\n\tif ($user_id<>0)\n\t{\n\t\treturn '<b>'.$name.'</b>';\n\t}\n\telse\n\t{\n\t\treturn $name.' ('.get_lang('Anonymous').')';\n\t}\n}",
"public function displayLink()\n {\n if ($this->getUserData('id') < 1) {\n return '(Unknown Lender)';\n }\n return '<a href=\"' . Settings::getInstance()->URLS['URL_BACKEND'] . 'lenders/lender/summary/?id=' . $this->getUserData('id') . '\">' . $this->getUserData('first_name') . ' ' . $this->getUserData('last_name') . '</a>';\n }",
"public function htmlLink(): string\n {\n return '<a target=\"_blank\" href=\"'.e($this->getUrl()).'\">'.e($this->name).'</a>';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the last day a ticket can be responded to. This algorithm takes into consideration, weekends, opening hours and holidays to determine when the last day is. | function get_last_response_date(DateTime $day) {
$last_response_date = $day;
$days_to_respond = DAYS_TO_RESPOND;
//Check to see if the service desk is open (hour wise). If it isn't, then add one day
//to the response time.
$opening_hour = new DateTime($last_response_date->format('Y-M-d' . ' ' . OPEN_AT));
$dateVal = $last_response_date->diff($opening_hour);
if($dateVal->h >= OPEN_FOR_HOURS) {
$last_response_date->modify('+1 day');
$last_response_date->setTime(OPENING_HOUR,OPENING_MINUTE);
}
elseif($dateVal->h < 0 || $dateVal->invert == 0) {
$last_response_date->setTime(OPENING_HOUR,OPENING_MINUTE);
}
//Check to see if the day is a holiday. If it is, add one day to the response time.
if(is_day_a_holiday($last_response_date)) {
$last_response_date->modify('+1 day');
}
//While we still have some response time left, check to see if the day is a holiday or not.
//We always add one day to the response, but if it wasn't a holiday, we deduct one day from the
//total days to respond.
while($days_to_respond > 0) {
if(is_day_a_holiday($last_response_date)) {
$last_response_date->modify('+1 day');
}
else {
$last_response_date->modify("+1 day");
$days_to_respond--;
}
}
//After we have deducted all the response days, we'll still have to check if that day is a holiday or not.
//Therefor we have to go over the holidays once again.
while(is_day_a_holiday($last_response_date)) {
$last_response_date->modify('+1 day');
}
return $last_response_date;
} | [
"public function getLastTradingDay()\n {\n $date = $this->getCurrentTradingDay()->subWeekdays();\n\n return $this->lookingForTradingDay($date, function ($date) {\n return $date->subWeekdays();\n });\n }",
"public function lastDay();",
"public function getMaxDateForGeneratedDays() {\n\t\t$maxEventEnd = clone DateTimeConverter::convert('today');\n\t\t$maxEventEnd->modify('+' . $this->extConf->getRecurringFuture() . ' months');\n\t\tif ($this->getEventEnd() && $this->getEventEnd() < $maxEventEnd) {\n\t\t\treturn $this->getEventEnd();\n\t\t} else return $maxEventEnd;\n\t}",
"public function getMaximumdaysbeforeholiday()\n {\n return $this->maximumdaysbeforeholiday;\n }",
"function LastDayOfWeek() {\n return $this->OffsetBy(0, 0, 6 - $this->DayOfWeek());\n }",
"public function getBitacoraLastDay ()\n {\n $query =\"SELECT MAX( events_bitacora_max_timestamp ) date FROM events_bitacora\";\n $date = $this->db->select_one($query);\n return ($date?date('Y-m-d', strtotime($date)):0);\n }",
"public function lastDay()\n {\n return date('Y-m-d', mktime(0, 0, 0, $this->month, $this->day - 1, $this->year));\n }",
"public static function getAmountEndDay(): int\n {\n return static::getAmountSeconds(strtotime(\"tomorrow\") - 1);\n// $res = (strtotime(\"tomorrow\") - 1)-strtotime('now');\n// return $res ?? 3600;\n }",
"public static function getAmountEndDay()\n {\n return static::getAmountSeconds(strtotime(\"tomorrow\") - 1);\n }",
"public function getDayEnd()\n {\n return self::mkTime(\n 23,\n 59,\n 59,\n $this->format('m'),\n $this->format('d'),\n $this->format('Y')\n );\n }",
"public function getWouldBeDaysLate() {\n return max(0, $this->hasDueDate() ? DateUtils::calculateDayDiff($this->getSubmissionDueDate()) : 0);\n }",
"public function getLastPadReminderSent();",
"public function getLastDateForDisputeAttribute() {\n\t\t$start_date = date('Y-m-d', strtotime(' -15 days'));\n\n\t\tif ($this->attributes['status'] == 'Cancelled' && ($this->attributes['checkin'] <= $this->attributes['cancelled_at'])) {\n\t\t\t$start_date = date('Y-m-d', strtotime($this->attributes['cancelled_at']));\n\t\t} else if ($this->attributes['status'] == 'Accepted') {\n\t\t\tif (date('Y-m-d') > $this->attributes['checkout']) {\n\t\t\t\t$start_date = $this->attributes['checkout'];\n\t\t\t}\n\t\t}\n\n\t\t$end_date = date('Y-m-d', strtotime($start_date . ' +14 days'));\n\t\treturn $end_date;\n\t}",
"public function get_effective_current_day() {\n\t\t$effective_current_day = false;\n\t\t$allowed_days = $this->get_allowed_delivery_days();\n\t\t$ready_to_set = false;\n\n\t\t// loop forever, until break\n\t\tfor ( $x = 0; $x >= 0; $x ++ ) {\n\t\t\tforeach ( $allowed_days as $day => $allowed ) {\n\t\t\t\tif ( $ready_to_set && $allowed ) {\n\t\t\t\t\t$effective_current_day = $day;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( $this->current_day_number == $day ) {\n\t\t\t\t\tif ( $allowed ) {\n\t\t\t\t\t\t$effective_current_day = $day;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$ready_to_set = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $effective_current_day !== false ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $effective_current_day;\n\t}",
"function getLastDay(){\n\t$previous_week = strtotime(\"-1 week +1 day\");\n\n\t$start_week = strtotime(\"last sunday midnight\",$previous_week);\n\t$end_week = strtotime(\"next saturday\",$start_week);\n\n\t$start_week = date(\"Y-m-d\",$start_week);\n\t$end_week = date(\"Y-m-d\",$end_week);\n\treturn $end_week;\n}",
"public function getEndDay()\n {\n if (array_key_exists(\"endDay\", $this->_propDict)) {\n return $this->_propDict[\"endDay\"];\n } else {\n return null;\n }\n }",
"function find_last_date_of_week($date = NULL)\n {\n $date = (is_null($date)) ? new DateTime(date('Y-m-d')) : new DateTime(date($date));\n $friday = clone $date->modify('Friday this week');\n return $friday->format('y-m-d');\n }",
"static function getLastWorkingHour($calendars_id, $day) {\n global $DB;\n\n // Do not check hour if day before the end day of after the begin day\n $result = $DB->request([\n 'SELECT' => ['MAX' => 'end AS mend'],\n 'FROM' => 'glpi_calendarsegments',\n 'WHERE' => [\n 'calendars_id' => $calendars_id,\n 'day' => $day\n ]\n ])->next();\n return $result['mend'];\n }",
"public static function getNextWorkingDay(){\n $invalid_day = array('sat','sun');\n $tomorrow_unix = mktime(0, 0, 0, date(\"m\"), date(\"d\")+1, date(\"y\"));\n $tomorrow_date = date('Ymd',$tomorrow_unix);\n $tomorrow_day = strtolower(date('D',$tomorrow_unix));\n\n $datetime = new \\DateTime();\n if(!in_array($tomorrow_day,$invalid_day)){\n $datetime -> setTimestamp($tomorrow_unix);\n return $datetime;\n }else{\n switch($tomorrow_day){\n case 'sat':\n $tomorrow_unix = mktime(0, 0, 0, date(\"m\"), date(\"d\")+3, date(\"y\"));\n break;\n case 'sun':\n $tomorrow_unix = mktime(0, 0, 0, date(\"m\"), date(\"d\")+2, date(\"y\"));\n break;\n }\n $datetime -> setTimestamp($tomorrow_unix);\n return $datetime;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add payment method via account screen. We store the token locally. | public function add_payment_method()
{
$error_msg = __('There was a problem adding the payment method.', 'woocommerce-gateway-xendit');
if (empty($_POST['xendit_token']) || !is_user_logged_in()) {
wc_add_notice($error_msg, 'error');
return;
}
$token = wc_clean($_POST['xendit_token']);
$source = array(
"card_last_four" => substr(wc_clean($_POST['xendit_card_number']), -4),
"card_expiry_year" => wc_clean($_POST['xendit_card_exp_year']),
"card_expiry_month" => wc_clean($_POST['xendit_card_exp_month']),
"card_type" => wc_clean($_POST['xendit_card_type'])
);
$this->save_payment_token($token, $source);
return array(
'result' => 'success',
'redirect' => wc_get_endpoint_url('payment-methods'),
);
} | [
"public function add_payment_method() {\n\n\t\t\tif( is_user_logged_in() ) {\n\n\t\t\t\t$sage_card_type \t\t= isset($_POST[$this->id . '-card-type']) ? woocommerce_clean($_POST[$this->id . '-card-type']) : '';\n\t\t\t\t$sage_card_number \t\t= isset($_POST[$this->id . '-card-number']) ? woocommerce_clean($_POST[$this->id . '-card-number']) : '';\n\t\t\t\t$sage_card_cvc \t\t\t= isset($_POST[$this->id . '-card-cvc']) ? woocommerce_clean($_POST[$this->id . '-card-cvc']) : '';\n\t\t\t\t$sage_card_expiry\t\t= isset($_POST[$this->id . '-card-expiry']) ? woocommerce_clean($_POST[$this->id . '-card-expiry']) : '';\n\n\t\t\t\t// Format values\n\t\t\t\t$sage_card_number \t= str_replace( array( ' ', '-' ), '', $sage_card_number );\n\t\t\t\t$sage_card_expiry \t= array_map( 'trim', explode( '/', $sage_card_expiry ) );\n\t\t\t\t$sage_card_exp_month \t= str_pad( $sage_card_expiry[0], 2, \"0\", STR_PAD_LEFT );\n\t\t\t\t$sage_card_exp_year \t= $sage_card_expiry[1];\n\n\t\t\t\t$CardHolder \t\t\t= $order->billing_first_name . ' ' . $order->billing_last_name;\n\n\t\t\t\t$sage_add_card_error \t= false;\n\n\t\t\t\t/**\n\t\t\t\t * Create Token if $sage_card_token is true\n\t\t\t\t */\n\t\t\t\t$register_token = $this->sagepay_register_token( $CardHolder, $sage_card_number, $sage_card_exp_month . $sage_card_exp_year, $sage_card_cvc, $sage_card_type );\n\n\t\t\t\tif ( $register_token['Status'] === 'OK' ) {\n\n\t\t\t\t\t$this->save_token( $register_token['Token'], $sage_card_type, substr( $sage_card_number, -4 ), $sage_card_exp_month, $sage_card_exp_year );\n\n\t\t\t\t\treturn array(\n\t\t\t\t\t\t'result' => 'success',\n\t\t\t\t\t\t'redirect' => wc_get_endpoint_url( 'payment-methods' ),\n\t\t\t\t\t);\n\n\t\t\t\t} else {\n\t\t\t\t\twc_add_notice( __( 'There was a problem adding the card. ' . $register_token['StatusDetail'], 'sumopayments_sagepayform' ), 'error' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\twc_add_notice( __( 'There was a problem adding the card. Please make sure you are logged in.', 'sumopayments_sagepayform' ), 'error' );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t}",
"public function addPaymentMethod()\n {\n $data['title'] = __('Add new payment method');\n\n return view('admin.marketplace.payment.addEdit', $data);\n }",
"public function add_payment_token($token)\n {\n }",
"public function addPaymentMethod()\n {\n $aValidationResult = Validations::validatePaymentModeInputs($this->aParams);\n if ($aValidationResult['bResult'] === true) {\n $aDatabaseColumns = array(\n 'paymentMode' => ':methodName'\n );\n\n Utils::renameKeys($this->aParams, $aDatabaseColumns);\n Utils::sanitizeData($this->aParams);\n // Perform insert.\n $iQuery = $this->oPaymentModel->addPaymentMethod($this->aParams);\n\n if ($iQuery > 0) {\n $aResult = array(\n 'bResult' => true,\n 'sMsg' => 'Payment method added!'\n );\n } else {\n $aResult = array(\n 'bResult' => false,\n 'sMsg' => 'An error has occured.'\n );\n }\n } else {\n $aResult = $aValidationResult;\n }\n\n echo json_encode($aResult);\n }",
"protected function _createPaymentMethod()\n {\n /** @var oxPayment $oPayment */\n $oPayment = $this->getNew('oxPayment');\n\n if (!$oPayment->load($this->_getPayPalPlusMethodId())) {\n $oPayment->setId($this->_getPayPalPlusMethodId());\n $oPayment->oxpayments__oxactive = new oxField(1);\n $oPayment->oxpayments__oxaddsum = new oxField(0);\n $oPayment->oxpayments__oxaddsumtype = new oxField('abs');\n $oPayment->oxpayments__oxfromboni = new oxField(0);\n $oPayment->oxpayments__oxfromamount = new oxField(0);\n $oPayment->oxpayments__oxtoamount = new oxField(10000);\n $oPayment->oxpayments__oxsort = new oxField(-999); // Make the method topmost\n\n /** @var oxLang $oLanguage */\n $oLanguage = $this->getFromRegistry('oxLang');\n $aLanguages = $oLanguage->getLanguageIds();\n\n foreach ($aLanguages as $iLanguageId => $sAbbreviation) {\n $oPayment->setLanguage($iLanguageId);\n $oPayment->oxpayments__oxdesc = new oxField('PayPal Plus');\n $oPayment->oxpayments__oxlongdesc = new oxField('');\n $oPayment->save();\n }\n }\n }",
"public function setPaymentMethod($method);",
"public function addPaymentMethod()\n {\n return view('admin.delivery-and-payment-method', [\n 'delivery_and_payment_method' => new PaymentMethod,\n 'type' => 'payment_method',\n 'action' => route('admin.payment_method.create')\n ]);\n }",
"function raiser_sprint_add_sample_payment_method() {\n // Based on rules_ui_import_form_submit().\n $rules_export = '{ \"commerce_payment_commerce_payment_example\" : {\n \"LABEL\" : \"Example payment\",\n \"PLUGIN\" : \"reaction rule\",\n \"OWNER\" : \"rules\",\n \"TAGS\" : [ \"Commerce Payment\" ],\n \"REQUIRES\" : [ \"commerce_payment\" ],\n \"ON\" : { \"commerce_payment_methods\" : [] },\n \"DO\" : [\n { \"commerce_payment_enable_commerce_payment_example\" : {\n \"commerce_order\" : [ \"commerce-order\" ],\n \"payment_method\" : { \"value\" : { \"method_id\" : \"commerce_payment_example\" } }\n }\n }\n ]\n }\n}';\n\n module_load_include('inc', 'rules', 'ui/ui.forms');\n $rules_config = rules_import($rules_export);\n\n if ($existing_config = rules_config_load($rules_config->name)) {\n // Copy DB id and remove the new indicator to overwrite the existing record.\n $rules_config->id = $existing_config->id;\n unset($rules_config->is_new);\n }\n\n $rules_config->save();\n $vars = array('@entity' => t('Rules configuration'), '%label' => $rules_config->label());\n watchdog('rules_config', 'Imported @entity %label.', $vars);\n drupal_set_message(t('Imported @entity %label.', $vars));\n}",
"public function paymentMethod()\n {\n }",
"public function addPaymentMethod(Request $request)\n {\n $validator = Validator::make($request->post(), [\n 'payment_method' => 'required|string|max:255',\n ]);\n\n if ($validator->fails()) {\n return JsonResponseHelper::response(400, false, 'Invalid payment method');\n }\n\n /** @var User $user */\n $user = auth()->user();\n\n // create stripe customer if not already one\n if (! $user->stripe_id) {\n $user->createAsStripeCustomer();\n }\n\n $user->updateDefaultPaymentMethod($request->post('payment_method'));\n\n return JsonResponseHelper::response(200, true, 'Payment method added successfully');\n }",
"public static function enablePaymentMethod()\n {\n $oPayment = oxNew('oxpayment');\n $oPayment->load('oxidpaypal');\n $oPayment->oxpayments__oxactive = new oxField(1);\n $oPayment->save();\n }",
"public function manualpaymentAction() {\n\t\t$entry = array(\n\t\t\t\"date\" => $this->getRequest()->getParam( 'date', false ),\n\t\t\t\"name\" => $this->getRequest()->getParam( 'name', false ),\n\t\t\t\"account\" => $this->getRequest()->getParam( 'account', false ),\n\t\t\t\"amount\" => $this->getRequest()->getParam( 'amount', false ),\n\t\t\t\"type\" => $this->getRequest()->getParam( 'type', false ),\n\t\t\t\"mutation\" => $this->getRequest()->getParam( 'mutation', false ),\n\t\t\t\"remarks\" => $this->getRequest()->getParam( 'remarks', false ),\n\t\t\t\"identifier\" => $this->getRequest()->getParam( 'identifier', false )\n\t\t);\n\n\t\t// Create a new bankitem\n\t\t$bankmodel = Mage::getModel( 'bankintegration/bankintegration' );\n\t\t$bankmodel->setData( $entry );\n\t\t$bankmodel->save();\n\n\t\t// Return to the overview page\n\t\tMage::getSingleton( 'adminhtml/session' )->addSuccess( Mage::helper( 'bankintegration' )->__( 'Manual payment added.' ) );\n\t\t$this->getResponse()->setRedirect( $this->getUrl( '*/review/all/' ) );\n\t}",
"public function addNewStripePaymentMethod($card) {\n\t\t// create model of relationship to tokenized card\n\t\t$stripeToken = new Bf_StripeToken(array(\n\t\t\t'accountID' => $this->id,\n\t\t\t'cardDetailsID' => $card->id,\n\t\t\t'stripeCustomerID' => $card->customer\n\t\t\t));\n\n\t\t// send model to API to be created\n\t\t$createdStripeToken = Bf_StripeToken::create($stripeToken);\n\n\t\t// create model of payment method\n\t\t$stripePaymentMethod = new Bf_PaymentMethod(array(\n\t\t\t'linkID' => $createdStripeToken->id,\n\t\t\t'name' => $card->last4,\n\t\t\t'description' => \"Stripe (\" . ($card->type ? $card->type : ($card->brand ? $card->brand : \"Unknown\")) . \"): \" . $card->last4,\n\t\t\t'crmID' => $card->id,\n\t\t\t'expiryDate' => $card->exp_year. '/'. str_pad($card->exp_month, 2, \"0\", STR_PAD_LEFT),\n\t\t\t'gateway' => \"stripe\"\n\t\t\t));\n\t\t\n\t\tif (!$this->paymentMethods) {\n\t\t\t// initialize as empty array\n\t\t\t$this->paymentMethods = array();\n\t\t}\n\n\t\t// add our modelled payment method\n\t\tarray_push($this->paymentMethods, $stripePaymentMethod);\n\n\t\treturn $this;\n\t}",
"public function paymentMethodRegister()\n {\n $user = $this->input->get('id_user');\n // $user = 30;\n $this->load->model('Billing_model');\n $model['id_user'] = $user;\n $model['ptitle'] = 'Payment Method';\n $data['content'] = $this->load->view('registerPaymentMethod', $model, true);\n $this->load->view('registerPaymentMethod', $data);\n }",
"public function paidPayment()\n {\n }",
"function button_add($payment_mode) {\r\n echo ' <a href=\"javascript:popupWindow(\\'' .\r\n zen_href_link(FILENAME_SUPER_PAYMENTS, 'oID=' . $this->oID . '&payment_mode=' . $payment_mode . '&action=add', 'NONSSL') . '\\', \\'scrollbars=yes,resizable=yes,width=400,height=300,screenX=150,screenY=100,top=100,left=150\\')\">' .\r\n zen_image_button('btn_' . $payment_mode . '.gif', sprintf(ALT_TEXT_ADD, str_replace('_', ' ', $payment_mode))) . '</a>';\r\n }",
"public function makePayment()\n {\n }",
"protected function setPaymentMethod()\n {\n $payment = $this->quote->getPayment();\n $payment->setMethod(Paypal::PAYMENT_METHOD_CODE);\n $this->quote->setPayment($payment);\n }",
"public function add_payment_mode () {\n $Mode = payment_modes::all();\n return view('accountant.add_payment_modes')->with('Mode', $Mode);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the number of open reported bugs by the current user in the current project | function current_user_get_reported_open_bug_count() {
return user_get_reported_open_bug_count( auth_get_current_user_id(),
helper_get_current_project() );
} | [
"function current_user_get_assigned_open_bug_count() {\n\t\treturn user_get_assigned_open_bug_count( auth_get_current_user_id(),\n\t\t\t\t\t\t\t\t\t\t\t\t\thelper_get_current_project() );\n\t}",
"static function get_assigned_open_bug_count() {\n\t\treturn \\Core\\User::get_assigned_open_bug_count( \\Core\\Auth::get_current_user_id(), \\Core\\Helper::get_current_project() );\n\t}",
"function get_reported_open_bug_count($p_project_id, $p_cookie_str)\n{\n global $g_mantis_bug_table, $g_mantis_user_table, $g_project_cookie_val;\n\n $query = \"SELECT id\n\t\t\t\tFROM $g_mantis_user_table\n\t\t\t\tWHERE cookie_string='$p_cookie_str'\";\n $result = db_query($query);\n $t_id = db_result($result);\n\n if (\"0000000\" == $g_project_cookie_val) {\n $t_where_prj = \"1=1\";\n } else {\n $t_where_prj = \"project_id='$p_project_id'\";\n }\n $t_res = RESOLVED;\n $t_clo = CLOSED;\n $query = \"SELECT COUNT(*)\n\t\t\t\tFROM $g_mantis_bug_table\n\t\t\t\tWHERE $t_where_prj AND\n\t\t\t\t\t\tstatus<>'$t_res' AND status<>'$t_clo' AND\n\t\t\t\t\t\treporter_id='$t_id'\";\n $result = db_query($query);\n return db_result($result, 0, 0);\n}",
"public function getOpenIssueCount(): int\n {\n return count($this->client->currentUser()->issues(['state' => Issue::STATE_OPEN]));\n }",
"public function countOpenIssues()\n {\n return Project\\Issue::join('projects', 'projects.id', '=', 'projects_issues.project_id')\n ->where('projects.status', '=', Project::STATUS_OPEN)\n ->where('projects_issues.status', '=', Project\\Issue::STATUS_OPEN)\n ->count();\n }",
"public function count_assigned_issues($user_id = null) {\n\t\tif(is_null($user_id)) {\n\t\t\t$user_id = \\Auth::user()->id;\n\t\t}\n\t\treturn \\DB::table('projects_issues')\n\t\t\t\t->where('project_id', '=', $this->id)\n\t\t\t\t->where('assigned_to', '=', $user_id)\n//\t\t\t\t->where('start_at', '<=', date(\"Y-m-d\"))\n\t\t\t\t->where_null('closed_at', 'and', false)\n\t\t\t\t->count();\n\t}",
"public function getOpenBugCountForEachProduct()\n {\n // needs a scalar result because of the count aggregate function\n $dql = \"SELECT p.id, p.name, count(b.id) AS openBugs FROM Bug b JOIN \"\n . \"b.products p WHERE b.status = 'OPEN' GROUP BY p.id\";\n return $this->getEntityManager()->createQuery($dql)->getScalarResult();\n }",
"public function countClosedIssues()\n {\n return Project\\Issue::join('projects', 'projects.id', '=', 'projects_issues.project_id')\n ->where(function (Eloquent\\Builder $query) {\n $query->where('projects.status', '=', Project::STATUS_OPEN);\n $query->where('projects_issues.status', '=', Project\\Issue::STATUS_CLOSED);\n })\n ->orWhere('projects_issues.status', '=', Project\\Issue::STATUS_CLOSED)\n ->count();\n }",
"public function getMyIssuesInThisProjectCountAttribute()\n {\n return Issue::where('project_id', $this->id)->where('assignee_id', Auth::id())->count();\n }",
"public static function countClosedIssues()\n {\n return ProjectIssue::join('projects', 'projects.id', '=', 'projects_issues.project_id')\n ->where(function (Builder $query) {\n $query->where('projects.status', '=', static ::STATUS_OPEN);\n $query->where('projects_issues.status', '=', ProjectIssue::STATUS_CLOSED);\n })\n ->orWhere('projects_issues.status', '=', ProjectIssue::STATUS_CLOSED)\n ->count();\n }",
"public function countOpenProjects()\n {\n return $this->where('status', '=', Project::STATUS_OPEN)->count();\n }",
"public static function countOpenProjects()\n {\n return static::where('status', '=', static ::STATUS_OPEN)->count();\n }",
"public function count_pending_bugs() {\r\n\t\t$sql = \"SELECT COUNT(*) as c FROM `tickerr_bugs` WHERE `status`=1\";\r\n\t\t$query = $this->db->query($sql);\r\n\t\t$row = $query->row();\r\n\t\treturn $row->c;\r\n\t}",
"public function countIssues() {\n return $this->lookupIssues()->count();\n }",
"public function getIssueCount()\n {\n $issues = $this->gitHub->issues()\n ->all($this->username, $this->repository, [ 'state' => 'all', 'labels' => 'contributions-bot' ]);\n\n return count($issues);\n }",
"public function closedIssuesCount()\n {\n return $this->hasOne('Tinyissue\\Model\\Project\\Issue',\n 'project_id')->selectRaw('project_id, count(*) as aggregate')\n ->where('status', '=', ProjectIssue::STATUS_CLOSED)\n ->groupBy('project_id');\n }",
"public function getOpenIssues();",
"public function getAllIssuesInThisProjectCountAttribute()\n {\n return Issue::where('project_id', $this->id)->count();\n }",
"function summary_new_bug_count_by_date( $p_num_days = 1 ) {\n\t$c_time_length = (int)$p_num_days * SECONDS_PER_DAY;\n\n\t$t_project_id = helper_get_current_project();\n\n\t$t_specific_where = helper_project_specific_where( $t_project_id );\n\tif( ' 1<>1' == $t_specific_where ) {\n\t\treturn 0;\n\t}\n\n\tdb_param_push();\n\t$t_query = 'SELECT COUNT(*) FROM {bug}\n\t\t\t\tWHERE ' . db_helper_compare_time( db_param(), '<=', 'date_submitted', $c_time_length ) . ' AND ' . $t_specific_where;\n\t$t_result = db_query( $t_query, array( db_now() ) );\n\treturn db_result( $t_result, 0 );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new MenusLabel model. If creation is successful, the browser will be redirected to the 'view' page. | public function actionCreate()
{
$model = new MenusLabel();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
} | [
"public function actionCreate()\n {\n $model = new Menus();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate ()\n {\n $model = new Menu();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', Yii::t('app', 'Menu added'));\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Menu();\n\n if ($model->load(Yii::$app->request->post())) {\n if($model->validate()){\n $model->save(false);\n return $this->redirect(['index']);\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Label();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate() {\n $model = new Menu();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index', 'id' => $model->menu_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionMenuCreate()\n {\n $model = new AdminMenu();\n $parentMenu = AdminMenuModel::parentMenu();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['menu-view', 'id' => $model->id]);\n } else {\n return $this->render('menuCreate', [\n 'model' => $model,\n 'parentMenu' => $parentMenu,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new DsisSystemMenu();\n\n if ($model->loadAll(Yii::$app->request->post()) && $model->saveAll()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new MenuModel();\n $data = $model->find()->orderBy('parentid,listorder')->asArray()->all();\n $cats = TreeList::getNews($data)->csList();\n $pid = null;\n $aid = null;\n //如果是创建子菜单的话,获取地址参数id的值\n $id = Yii::$app->request->get('id');\n if ($id){\n $pid = $id;\n $aid = $model->findOne($id)->appid;\n }\n\n if ($model->load(Yii::$app->request->post())){\n $model->parentid =intval(Yii::$app->request->post()['parentid']);\n if ($model->save()){\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }else {\n return $this->render('create', [\n 'model' => $model,\n 'cats' => $cats,\n 'pid' => $pid,\n 'aid' => $aid,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Laporan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Weixin2Menu();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new WidgetMenu();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new SiteLang();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index', 'id' => $model->code]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Level();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Menu();\n $media = Media::find()->orderBy('id DESC')->all();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'media' => $media\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new RestaurantMenu();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new MenuItem();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n $this->updateRoles($model->id);\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create',\n [\n 'model' => $model,\n ]);\n }\n }",
"public function create() {\n\t\t\n\t\t$data['page_title'] = \"Create Label Type\";\n\n\t\t$this->load->library('form_validation');\n\n\t\t$this->form_validation->set_rules('label_name', 'Label Name', 'required');\n\n\t\tif ($this->form_validation->run() == FALSE)\n\t\t{\n\t\t\t$this->load->view('interface_assets/header', $data);\n\t\t\t$this->load->view('labels/create');\n\t\t\t$this->load->view('interface_assets/footer');\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\t$this->load->model('labels_model');\n\t\t\t$this->labels_model->addLabel();\n\t\t\t\n\t\t\tredirect('labels');\n\t\t}\n\t\n\t}",
"public function actionCreate()\n {\n $model = new Konsultasi();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new LaporanKunjungan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find the user associated with the password reset token, or end the request with a message | protected function getUserOrExit($token) {
$user = User::findByPasswordReset($token);
if ($user) {
return $user;
} else {
View::render('Password/token_expired.php');
exit;
}
} | [
"public function getResetPassword()\n {\n\t\t$http_request = Application::getHTTPRequest();\n if(isset($http_request->getGetData()['token']) && isset($http_request->getGetData()['id']))\n {\n $user_manager = new UserManager;\n $this->response['token_validity'] = $user_manager->testTokenValidity($http_request->getGetData()['id'], $http_request->getGetData()['token']);\n if(isset($this->post_params['reset-password']) && $this->response['token_validity'])\n {\n $this->response['reset_password_error'] = $user_manager->resetPassword(\n\t\t\t\t$http_request->getGetData()['id'],\n\t\t\t\t$http_request->getGetData()['token'],\n\t\t\t\t$this->post_params['password'],\n\t\t\t\t$this->post_params['retype_password']);\n } \n }\n }",
"public function getForgotPassword()\n {\n $user_manager = new UserManager;\n if(isset($this->post_params['reset-password']))\n {\n $this->response['forgot_password_error'] = $user_manager->sendResetPwdEmail($this->post_params['email']);\n }\n elseif(isset($this->post_params['find-email']))\n {\n $this->response['find_email'] = $user_manager->findEmail($this->post_params['username']);\n }\n }",
"public static function findByPasswordReset($token){\n\t\t$token = new Token($token);\n\t\t//get hashed token\n\t\t$hashed_token = $token->getHash();\n\t\t//check if token hash exists in the database\n\t\t$sql = 'SELECT * FROM users WHERE password_reset_hash = :token_hash';\n\t\t\n\t\t$db = static::getDB();\n\t\t$stmt = $db->prepare($sql);\n\t\t$stmt->bindValue(':token_hash', $hashed_token, PDO::PARAM_STR);\n\t\t$stmt->setFetchMode(PDO::FETCH_CLASS, get_called_class());\n\t\t\n\t\t$stmt->execute();\n\t\t$user = $stmt->fetch();\n\t\t\n\t\tif($user){\n\t\t\t//check password reset token hasn't expired\n\t\t\tif(strtotime($user->password_reset_expires_at)>time()){\n\t\t\t\treturn $user;\n\t\t\t}\n\t\t}\n\t}",
"private function password_reset()\n {\n //Load and store parameters\n $email = $this->Request->get('email');\n $this->responseSetParam('email', $email);\n\n //Try to retrieve corresponding user\n $UsersLib = new UsersLib($this->DB, $this->User);\n $user = $UsersLib->getFromEmail($email);\n if($user)\n {\n //Generate temporary password\n $PasswordHandler = new PasswordHandler();\n $password = $PasswordHandler->tempCreate($this->DB, $user->getID());\n\n //Send email with instructions\n $EmailHandler = new EmailHandler($this->DB);\n $EmailHandler->pattern(EmailHandler::TYPE_PASSWORDRESET, array(\n 'content' => 'text',\n 'recipient' => $email,\n 'user_id' => $user->getID(),\n 'firstname' => $user->getFirstname(),\n 'password' => $password\n ));\n }\n //Do not produce an error here because it would tell a potential attacker\n //that this email does not exist !\n else \n $this->close();\n }",
"public static function findByPasswordReset($token)\n {\n $token = new Token($token);\n $hashed_token = $token->getHash();\n\n $sql = 'SELECT * FROM user\n WHERE password_reset_hash = :token_hash';\n\n $db = static::getDB();\n $stmt = $db->prepare($sql);\n\n $stmt->bindValue(':token_hash', $hashed_token, PDO::PARAM_STR);\n\n $stmt->setFetchMode(PDO::FETCH_CLASS, get_called_class());\n\n $stmt->execute();\n\n $user = $stmt->fetch();\n\n if ($user) {\n\n // Check password reset token hasn't expired\n if (strtotime($user->password_reset_expires_at) > time()) {\n\n return $user;\n }\n }\n }",
"public function getResetPasswordToken();",
"public function getPasswordResetToken();",
"public function findUserByResetPasswordToken($token)\n {\n return $this->userRepository->findOneBy(\n [\n 'passwordResetToken' => $token,\n ]\n );\n }",
"public function pwForgot() {\n $credentials = [\n 'email' => $this->request->get('email'),\n ];\n\n $user = \\Sentinel::findByCredentials($credentials);\n\n\n if($activation = \\Activation::completed($user)) {\n // User is activated so create the activation url and email it to the user.\n $uri = '/register/' . 'pwreset/' . $user['id'] . '/' . $activation['code'];\n $activationUrl = url($uri);\n\n $this->pwResetEmail($activationUrl, $user['id']);\n $this->viewVars['msg'] = \"An email was sent to your mailbox with password reset instructions.\";\n } else {\n // User not activated yet\n $activation = \\Activation::exists($user);\n // Create the activation url and email it to the user.\n $uri = '/register/' . 'activation/' . $user['id'] . '/' . $activation['code'];\n $activationUrl = url($uri);\n\n $this->activationEmail($activationUrl, $user['id']);\n $this->viewVars['msg'] = \"An email was sent to your mailbox with activation instructions.\";\n }\n return $this->render('emails/test');\n }",
"function requestResetPassword() {\n\t\t$this->validate();\n\t\t$this->setupTemplate();\n\t\t$templateMgr =& TemplateManager::getManager();\n\n\t\t$email = Request::getUserVar('email');\n\t\t$userDao =& DAORegistry::getDAO('UserDAO');\n\t\t$user =& $userDao->getUserByEmail($email);\n\n\t\tif ($user == null || ($hash = Validation::generatePasswordResetHash($user->getId())) == false) {\n\t\t\t$templateMgr->assign('error', 'user.login.lostPassword.invalidUser');\n\t\t\t$templateMgr->display('user/lostPassword.tpl');\n\n\t\t} else {\n\t\t\t$site =& Request::getSite();\n\n\t\t\t// Send email confirming password reset\n\t\t\timport('mail.MailTemplate');\n\t\t\t$mail = new MailTemplate('PASSWORD_RESET_CONFIRM');\n\t\t\t$this->_setMailFrom($mail);\n\t\t\t$mail->assignParams(array(\n\t\t\t\t'url' => PKPRequest::url(null, 'login', 'resetPassword', $user->getUsername(), array('confirm' => $hash)),\n\t\t\t\t'siteTitle' => $site->getLocalizedTitle()\n\t\t\t));\n\t\t\t$mail->addRecipient($user->getEmail(), $user->getFullName());\n\t\t\t$mail->send();\n\t\t\t$templateMgr->assign('pageTitle', 'user.login.resetPassword');\n\t\t\t$templateMgr->assign('message', 'user.login.lostPassword.confirmationSent');\n\t\t\t$templateMgr->assign('backLink', PKPRequest::url(null, Request::getRequestedPage()));\n\t\t\t$templateMgr->assign('backLinkLabel', 'user.login');\n\t\t\t$templateMgr->display('common/message.tpl');\n\t\t}\n\t}",
"function email_reset_token($username) {\n\t\t\n\t$user = new Login();\n\tif($user->get_user_for_field_with_value(\"email\", $username))\n {\n\n\t\t// This is where you would connect to your emailer\n\t\t// and send an email with a URL that includes the token.\n\t\t\n\t\t$data = getResetDetails($username);\n\t\t\t\t\n $email = $data['email'];\n \n $mailer = new PHPMailer();\n \n $mailer->CharSet = 'utf-8';\n \n $mailer->AddAddress($email,$data['name']);\n \n $mailer->Subject = \"Your reset password request\";\n\n $mailer->From = \"passwordReset.com\";\n\t\t\n $scriptFolder = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')) ? 'https://' : 'http://';\n $scriptFolder .= $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']);\n \n $link = $scriptFolder.\n '/resetpwd.php?email='.\n urlencode($email).'&code='.\n urlencode($data['token']);\n\n $mailer->Body =\"Hello \".$data['name'].\"\\r\\n\\r\\n\".\n \"There was a request to reset your password \".\n \"Please click the link below to complete the request: \\r\\n\".$link.\"\\r\\n\".\n \"Regards,\\r\\n\";\n \n if(!$mailer->Send())\n {\n return false;\n }\n return true;\n\t\t\n\t\t\n\n\t} else {\n\t\treturn false;\n\t}\n\t\n}",
"public function passwordEmail()\n {\n $reference = Hash::get($this->args, 0);\n if (empty($reference)) {\n $this->abort(__d('cake_d_c/users', 'Please enter a username or email.'));\n }\n $resetUser = $this->Users->resetToken($reference, [\n 'expiration' => Configure::read('Users.Token.expiration'),\n 'checkActive' => false,\n 'sendEmail' => true,\n ]);\n if ($resetUser) {\n $msg = __d(\n 'cake_d_c/users',\n 'Please ask the user to check the email to continue with password reset process'\n );\n $this->out($msg);\n } else {\n $msg = __d(\n 'cake_d_c/users',\n 'The password token could not be generated. Please try again'\n );\n $this->abort($msg);\n }\n }",
"function find_user_with_token($token) {\n\tif(!has_presence($token)) {\n\t\t// We were expecting a token and didn't get one.\n\t\treturn null;\n\t} else {\n\t\t$user = find_one_in_fake_db('users', 'reset_token', sql_prep($token));\n\t\t// Note: find_one_in_fake_db returns null if not found.\n\t\treturn $user;\n\t}\n}",
"public function forgotPassword()\n {\n $credentials = [\n 'email' => $this->request->get('email'),\n ];\n\n $user = \\Sentinel::findByCredentials($credentials);\n if (empty($user)) {\n $this->success('passwords.sent');\n return $this->json();\n }\n\n $mailer = new Mail\\Mail();\n\n // if the user is not activated, resend the activation email\n if (!\\Activation::completed($user)) {\n $activation = \\Activation::exists($user);\n $mailer->activationEmail($user, $activation->code);\n $this->warning('auth.resendActivation');\n return $this->json(400);\n }\n\n // The user is active, and wants to reset the password, use Sentinel Reminders\n $reminder = \\Reminder::create($user);\n $mailer->resetPasswordEmail($user, $reminder->code);\n\n $this->success('passwords.sent');\n return $this->json();\n }",
"public function postRemindReset() {\n\t\t$credentials = Input::only(\n\t\t\t'email', 'password', 'password_confirmation', 'token'\n\t\t);\n\n\t\t$response = Password::reset($credentials, function($user, $password)\n\t\t{\n\t\t\t$user->password = Hash::make($password);\n\t\t\t$user->save();\n\t\t});\n\n\t\tswitch ($response)\n\t\t{\n\t\t\tcase Password::INVALID_PASSWORD:\n\t\t\t\treturn $this->getConflictResponse(array(\n\t\t\t\t\t'password' => Lang::get($response)\n\t\t\t\t));\n\t\t\tcase Password::INVALID_TOKEN:\n\t\t\t\treturn $this->getConflictResponse(array(\n\t\t\t\t\t'token' => Lang::get($response)\n\t\t\t\t));\n\t\t\tcase Password::INVALID_USER:\n\t\t\t\treturn $this->getConflictResponse(array(\n\t\t\t\t\t'email' => Lang::get($response)\n\t\t\t\t));\n\t\t\tcase Password::PASSWORD_RESET:\n\t\t\t\treturn $this->getJsonResponse();\n\t\t}\n\t}",
"public function action_do_password_reset() {\n\t\t$result = array('success' => false);\n\t\tif ($this->request->method == 'POST') {\n\t\t\t$token = $this->request->post('token');\t\t\t\t\t$result['token'] = $token;\n\t\t\t$password = $this->request->post('password');\t\t$result['password'] = $password;\n\t\t\tif ((strlen($token)>0) && (strlen($password)>0)) {\n\t\t\t\t$user = $this->pixie->orm->get('user')->where('token',$token)->find();\n\t\t\t\t$result['found'] = $user->loaded();\n\t\t\t\tif ($user->loaded()) {\n\t\t\t\t\t$auth = $this->pixie->auth;\n\t\t\t\t\t$user->password = $auth->provider('password')->hash_password($password);\n\t\t\t\t\t$user->token = '';\t\t// Token is single-use\n\t\t\t\t\t$user->save();\n\t\t\t\t\t// Try to log the user in using the new password (should never fail...!)\n\t\t\t\t\tif ($auth->provider('password')->login($user->identifier, $password)) {\n\t\t\t\t\t\t$result['success'] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->ajax_reply($result);\n\t}",
"public function getEmailForPasswordReset();",
"private function processPasswordResetRequest()\n\t{\n\t\t$v =& $this->scene ;\n\t\t$theAddr =& $v->send_to_email ;\n\t\t$dbAuth = $this->getProp('Auth') ;\n\t\t$theResetUtils = AuthPasswordReset::withModel($dbAuth) ;\n\t\t\n\t\tif( ! $dbAuth->isPasswordResetAllowedFor( $theAddr, $theResetUtils ) )\n\t\t{ // Deny the request.\n\t\t\t$v->err_msg = $v->getRes( 'account/msg_pw_request_denied' ) ;\n\t\t\treturn $this->requestPasswordReset(null) ;\n\t\t}\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$dbAuth->generatePasswordRequestFor( $theResetUtils ) ;\n\t\t\t$theMailer = MailUtils::buildMailerFromBitsConfig(\n\t\t\t\t\t$this->config, 'email_out' ) ;\n\t\t\t$theMailer->setFrom( $this->config['email_out/default_from'] ) ;\n\t\t\t$theResetUtils->dispatchEmailToUser( $theMailer ) ;\n\t\t}\n\t\tcatch( PasswordResetException $prx )\n\t\t{\n\t\t\t$v->err_msg = $prx->getDisplayText() ;\n\t\t\t$this->debugLog($v->err_msg) ;\n\t\t\treturn $this->requestPasswordReset(null) ;\n\t\t}\n\t\tcatch( MailUtilsException $mue )\n\t\t{\n\t\t\t$v->err_msg = $mue->getMessage() ;\n\t\t\t$this->debugLog($v->err_msg) ;\n\t\t\treturn $this->requestPasswordReset(null) ;\n\t\t}\n\t\t\n\t\t$theSuccessMsg = $this->getRes(\n\t\t\t\t'account/msg_pw_reset_email_sent/' . $v->send_to_email ) ;\n\t\t$v->addUserMsg( $theSuccessMsg ) ;\n\t\treturn $this->getHomePage() ;\n\t}",
"public static function requestPasswordReset($email)\n {\n $isReq = FALSE;\n $conn = new MySqlConnect();\n $ts = $conn -> getCurrentTs();\n $name = '';\n\n // generate a random number for tha hash key\n $randNum = rand();\n $hash = hash(\"md5\", $randNum);\n\n $isReq = $conn -> executeQuery(\"UPDATE users SET tempPassKey = '{$hash}', updateDate = '{$ts}' WHERE emailAddress = '{$email}'\");\n $conn -> freeConnection();\n // get the first and last name of the user\n $conn2 = new MySqlConnect();\n $result = $conn2 -> executeQueryResult(\"SELECT fName, lName FROM users WHERE emailAddress = '{$email}'\");\n\n if (mysql_num_rows($result) == 1)\n {\n if ($row = mysql_fetch_array($result, MYSQL_ASSOC))\n {\n $name = $row['fName'] . ' ' . $row['lName'];\n\n // send the hash key to the user's email to confirm and follow back to\n // the\n // site\n $from = ConfigProperties::$AppSourceEmail;\n $subject = 'UC Document Repository: Confirm Password Reset';\n $body = \"Dear {$name},\\n\\nPlease follow the URL to confirm your password reset request at the UC Document Repository.\\n\\n\";\n $body .= ConfigProperties::$DomainName . \"/Authentication/resetPassword.php?email={$email}&tempKey={$hash}\";\n\n // send it from the logged in user\n $to = $name . \" <\" . $email . \">\";\n\n $mailer = new DocsMailer();\n $mailer -> Subject = $subject;\n $mailer -> Body = $body;\n $mailer -> addAddress($email, $name);\n $mailer -> From = $from;\n\n if ($mailer -> send())\n {\n $errMsg = 'Password reset email sent to ' . $email . '<br />';\n }\n $mailer -> clearAddresses();\n $mailer -> clearAttachments();\n }\n }\n else\n {\n $isReq = FALSE;\n }\n\n $conn2 -> freeConnection();\n return $isReq;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get shuffled routes json key=>dir value=namespace and set in private shuffledRoutes property for cache | public function getShuffledRoutes(): array
{
if (count($this->shuffledRoutes) > 0) {
return $this->shuffledRoutes;
}
$routes = $this->getRouteConfig();
$this->shuffledRoutes = array();
foreach ($routes as $domain => $route) {
foreach ($route as $type => $routeItem) {
if ($type === 'default') {
$this->shuffledRoutes[$routeItem['dir']] = array('path' => $routeItem['dir'], 'type' => $type, 'domain' => $domain);
continue;
}
foreach ($routeItem as $item) {
if (isset($item['dir'])) {
$this->shuffledRoutes[$item['dir']] = array('path' => $item['dir'], 'type' => $type, 'domain' => $domain);
} elseif (isset($value['extend'])) {
$this->shuffledRoutes[$item['extend']] = array('path' => $item['extend'], 'type' => $type, 'domain' => $domain);
}
}
}
}
return $this->shuffledRoutes;
} | [
"public static function cache() \n\t{\n\t\t$app_routes_path = APP.'routing.yml';\n\t\t\n\t\tif (file_exists($app_routes_path)) {\n\t\t\t$root_routes = Yaml::parse(file_get_contents($app_routes_path));\n\t\t\t$cache_routes = '';\n\t\t\t\n\t\t\tif ($root_routes !== '' && $root_routes !== false) {\n\t\t\t\tforeach($root_routes as $route_name=>$route_details) {\n\t\t\t\t\tif (isset($route_details->prefix) && file_exists(BUNDLE.$route_details->bundle.'/routing.yml')) {\n\t\t\t\t\t\t$ctrl_routes = Yaml::parse(file_get_contents(BUNDLE.$route_details->bundle.'/routing.yml'));\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($ctrl_routes !== '' && $ctrl_routes !== false) {\n\t\t\t\t\t\t\tforeach($ctrl_routes as $ctrl_route_name=>$ctrl_route_details) {\n\t\t\t\t\t\t\t\tif (isset($ctrl_route_details->path)) {\n\t\t\t\t\t\t\t\t\t$cache_routes.= $ctrl_route_name . \":\\n \" . $route_details->prefix . $ctrl_route_details->path . \"\\n\\n\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (isset($route_details->path)) {\n\t\t\t\t\t\t\t$cache_routes.= $route_name . \":\\n \" . $route_details->path . \"\\n\\n\";\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$cache_routes = trim($cache_routes,\"\\n\\n\");\n\t\t\t}\n\t\t\t\n\t\t\treturn file_put_contents(APP.'cache/routes.yml', $cache_routes);\n\t\t}\n\t\telse {\n\t\t\tif (ENVIRONMENT == 'production') {\n\t\t\t\t$this->setError();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$translation = new Translation(['bundle' => null, 'theme' => 'sybil', 'domain' => 'debug']);\n\t\t\t\tApp::translate(\"app_routes_missing\",$translation);\n\t\t\t\tdie();\n\t\t\t}\n\t\t}\n\t}",
"public function cache_routes(){\n $this->db->select(\"*\");\n $query = $this->db->get($this->table);\n \n foreach ($query->result() as $row){\n $data[] = '$route[\"' . $row->slug . '\"] = \"' . $row->route . '\";';\n $output = $this->load->helper('file');\n write_file(APPPATH . \"config/custom_routes.php\", $output);\n }\n }",
"private function _serializeRoutes() {\n $cachePath = BASE_PATH.\"framework/cache/framework/router/\";\n if (!is_dir($cachePath)) {\n if (!is_dir(BASE_PATH.\"framework/cache/framework/\")) {\n if (mkdir(BASE_PATH.\"framework/cache/framework/\",775)) {\n if (!mkdir(BASE_PATH.\"framework/cache/framework/router\",755)) {\n throw new FW_Router_Exception(\"Can't create route cache\");\n }\n }\n else {\n throw new FW_Router_Exception(\"Can't create route cache\");\n }\n }\n if (!is_dir(BASE_PATH.\"framework/cache/framework/router\")) {\n mkdir(BASE_PATH.\"framework/cache/framework/router\");\n }\n }\n\n foreach (array_keys(self::$_routes) as $key) {\n $file = $cachePath.$key.\".ser\";\n $serializedRoutes = serialize(self::$_routes[$key]); \n file_put_contents($file,$serializedRoutes);\n }\n }",
"private static function getRoutes(){\n $json=file_get_contents(\"config/routes.json\");\n return json_decode($json);\n \n }",
"protected function readRoutes() {\n $cache = $this->getCache();\n\n $routes = $cache->get(self::CACHE_TYPE, self::CACHE_ID);\n if ($routes) {\n return $routes;\n }\n\n $routes = $this->io->getRoutes();\n\n $cache->set(self::CACHE_TYPE, self::CACHE_ID, $routes);\n\n return $routes;\n }",
"public function loadRoutes() {\n $this->crawler->load($this->configFolder.'/route.xml');\n foreach($this->crawler->getElementsByTagName(\"routes\")->item(0)->childNodes as $route) {\n if($route->nodeName == \"route\") { \n $newRoute = array(\n \"url\"=> $route->getAttribute(\"path\"),\n \"controller\" => $route->getElementsByTagName(\"controller\")->item(0)->nodeValue,\n \"action\" => $route->getElementsByTagName(\"action\")->item(0)->nodeValue\n );\n if($route->getElementsByTagName(\"requirements\")->length != 0) {\n $requirementsArray = array();\n $requirements = $route->getElementsByTagName(\"requirements\")->item(0)->childNodes;\n for($i=0; $i < $requirements->length; $i++) {\n if($requirements->item($i)->nodeName != \"#text\") {\n if(strpos($newRoute[\"url\"], ':'.$requirements->item($i)->nodeName) !== false) {\n $requirementsArray[$requirements->item($i)->nodeName] = $requirements->item($i)->getAttribute(\"value\");\n }\n }\n }\n if(!empty($requirementsArray)) {\n $newRoute[\"requirements\"] = $requirementsArray;\n }\n }\n $this->routes[$route->getAttribute(\"id\")] = $newRoute;\n }\n }\n }",
"private function getRoutes(){\n $fileClasses = scandir(\"./routes\");\n foreach($fileClasses as $class){\n $path = \"./routes/\".$class;\n if(is_file($path)&&file_exists($path)){\n $file_content = file($path);\n foreach($file_content as $element){\n if(!is_empty(strpos($element,'$path'))){\n $var = stristr($element, '\"');\n $var = substr($var,1);\n $lenght = stripos($var,'\"');\n $var = substr($var,0,$lenght);\n array_push($this->paths,array(\"path\"=>$var,\"file\"=>$class));\n }\n }\n \n }\n }\n $this->route();\n }",
"public static function dumpOnCache(){\n\n # Cache Instance\n $cacheInstance = new Cache();\n\n # Prepare key\n $key = Cache::getKeyWithCacheName(__CLASS__, \"routerCollection\");\n\n # Get router collection from config\n $routerConfig = Config::get(\"Router\");\n\n # Get Api 2 config\n $routerApi = Config::get(\"Api\");\n\n # Data to cache\n $dataToCache = [];\n\n # Iteration of router\n foreach(static::GROUPS as $group)\n\n # Check not empty\n if(!empty($routerConfig[\"Router\"][$group])){\n\n # Prepare prefix\n $prefix = $routerConfig[\"Router\"][\"prefix\"][$group] ?? null;\n\n # Iteration of groups\n foreach($routerConfig[\"Router\"][$group] as $router){\n\n # Check router name\n if(!isset($router[\"name\"]) || empty($router))\n\n # Check router\n continue;\n\n # Check router name doesn't exists\n if(isset($dataToCache[$router[\"name\"]]))\n\n # New Exception\n throw new CrazyException(\n \"Router \\\"\".$router[\"name\"].\"\\\" already exists in router config, make sure all router have unique name !\",\n 500,\n [\n \"custom_code\" => \"router-004\",\n ]\n );\n\n # Fill router\n if(!isset($router[\"prefix\"]))\n $router[\"prefix\"] = $prefix;\n\n # Fill group\n $router[\"group\"] = $group;\n\n # Push in data to cache\n $dataToCache[$router[\"name\"]] = $router;\n\n }\n\n # Check if group is api\n if(\n $group === \"api\" && \n isset($routerApi[\"Api\"][\"v2\"][\"enable\"]) &&\n $routerApi[\"Api\"][\"v2\"][\"enable\"] === true &&\n isset($routerApi[\"Api\"][\"v2\"][\"routers\"]) &&\n !empty($routerApi[\"Api\"][\"v2\"][\"routers\"])\n ){\n\n # Set api prefix\n $apiPrefix = \n (\n $prefix ? \n $prefix : \n \"\"\n ) . \n (\n ($routerApi[\"Api\"][\"v2\"][\"prefix\"] ?? false) ?\n (\n ($prefix ? \"/\" : \"\") .\n trim($routerApi[\"Api\"][\"v2\"][\"prefix\"], \"/\")\n ):\n \"\"\n )\n ;\n\n # Iteration des routers\n foreach($routerApi[\"Api\"][\"v2\"][\"routers\"] as $router){\n\n # Check router name\n if(!isset($router[\"name\"]) || empty($router))\n \n # Check router\n continue;\n \n # Check router name doesn't exists\n if(isset($dataToCache[$router[\"name\"]]))\n \n # New Exception\n throw new CrazyException(\n \"Api router \\\"\".$router[\"name\"].\"\\\" already exists in router config, make sure all router have unique name !\",\n 500,\n [\n \"custom_code\" => \"router-005\",\n ]\n );\n \n # Fill router\n if($apiPrefix)\n $router[\"prefix\"] = $apiPrefix;\n \n # Fill group\n $router[\"group\"] = $group;\n \n # Push in data to cache\n $dataToCache[$router[\"name\"]] = $router;\n\n }\n\n }\n\n }\n \n # Put on Cache\n $cacheInstance->set($key, $dataToCache);\n\n }",
"public function getCachedRoutesPath();",
"public static function createModuleRoutes()\n {\n if (!is_null(static::$routes)) {\n return static::$routes;\n }\n $cachePath = CLASTIC_ROOT . '/cache/routes-' . Clastic::getSiteId() . '.php';\n $routesCache = new ConfigCache($cachePath, Clastic::$debug);\n if (!$routesCache->isFresh()) {\n static::$routes = new RouteCollection();\n $finder = new Finder();\n $iterator = $finder\n ->directories()\n ->depth(0)\n ->in(static::getModulePaths());\n $tmpRoutes = array();\n foreach ($iterator as $module) {\n $tmpRoutes[$module->getRelativePathname()]['path'] = $module->getRealPath();\n if (file_exists($module->getRealPath() . '/Resources/config/routes.yml')) {\n $configRoutes = Yaml::parse($module->getRealPath() . '/Resources/config/routes.yml');\n foreach ((array)$configRoutes as $name => $route) {\n $tmpRoutes[$module->getRelativePathname()]['routes'][$name] = $route;\n }\n }\n }\n static::$routes = new RouteCollection();\n foreach ($tmpRoutes as $module => $routes) {\n $routeCollection = new RouteCollection();\n if (isset($routes['routes'])) {\n foreach ($routes['routes'] as $name => $route) {\n $params = $route;\n $controller = str_replace(array(CLASTIC_ROOT . '/app', '/'), array('', '\\\\'), $routes['path']) . '\\\\Controller\\\\' . $module . 'Controller';\n $params['_controller'] = $controller . '::handle';\n unset($params['_pattern']);\n $routeCollection->add($name, new Route($route['_pattern'], $params));\n }\n static::$routes->addCollection($routeCollection);\n }\n }\n $routesCache->write(serialize(static::$routes));\n }\n else {\n static::$routes = unserialize(Yaml::parse($cachePath));\n }\n return static::$routes;\n }",
"public function routesDir();",
"private function _loadRoutesFromPackages()\n {\n $this->_routes = array();\n\n foreach ($this->_packages as $package)\n {\n $packagePath = 'application/packages/' . str_replace('\\\\', DIRECTORY_SEPARATOR, $package);\n $routes = require $packagePath . DIRECTORY_SEPARATOR . 'configs/routes.php';\n\n foreach ($routes as $route => $value)\n {\n $value['package'] = $package;\n $this->_routes[$route] = $value;\n }\n }\n }",
"function preflightCache() {\n\t\t$moduleDir = (isset($this->bean->module_dir) && !empty($this->bean->module_dir)) ? $this->bean->module_dir : \"General\";\n\t\t$this->rulesCache = sugar_cached(\"routing/{$moduleDir}\");\n\n\t\tif(!file_exists($this->rulesCache)) {\n\t\t\tmkdir_recursive($this->rulesCache);\n\t\t}\n\t}",
"public function test_cache_append_routes()\n\t{\n\t\t$cached = Route::all();\n\n\t\t// First we create the cache\n\t\tRoute::cache(TRUE);\n\n\t\t// Now lets modify the \"current\" routes\n\t\tRoute::set('nonsensical_route', 'flabbadaga/ding_dong');\n\n\t\t$modified = Route::all();\n\n\t\t// Then try and load said cache\n\t\t$this->assertTrue(Route::cache(NULL, TRUE));\n\n\t\t// Check the route cache flag\n\t\t$this->assertTrue(Route::$cache);\n\n\t\t// And if all went ok the nonsensical route should exist with the other routes...\n\t\t$this->assertEquals(Route::all(), $cached + $modified);\n\t}",
"public function getCachedRoutesPath()\n {\n }",
"public function getRoutes() {}",
"public static function getRoutes() {}",
"private static function getRoutingTable() {\n\t\tif (!isset(self::$cachedMap)) {\n\t\t\tself::$cachedMap = [];\n\n\t\t\tforeach (self::$map as $name => $controller) {\n\t\t\t\tself::$cachedMap[$name] = $controller->toArray();\n\t\t\t}\n\n\t\t\tif (self::$saveCache) {\n\t\t\t\t// save routing table to cache, because tried to load it unsuccessfully\n\t\t\t\t$map = serialize(self::$cachedMap);\n\n\t\t\t\tif ($map) {\n\t\t\t\t\t$fileName = Server::getCacheDir() . DIRECTORY_SEPARATOR . self::CACHE_FILE_NAME;\n\t\t\t\t\tfile_put_contents($fileName, $map);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn self::$cachedMap;\n\t}",
"function cacheable_dynamic_routes()\n {\n // Order by descending dynamic_route is important so that child routes\n // will be matched before attempting to match parent level routes\n $query = $this->db->select('id, dynamic_route')\n ->from($this->table)\n ->where('dynamic_route !=', 'NULL')\n ->order_by('dynamic_route', 'desc')\n ->get();\n\n return $query->result();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Configure the Sanctum middleware and priority. | private function configureMiddleware()
{
if (!$this->isLumen()) {
$kernel = $this->app->make(Kernel::class);
$kernel->prependToMiddlewarePriority(EnsureRequestsAreStateful::class);
}
} | [
"public function preMiddleware() {\n }",
"private function setupMiddlewares()\n\t{\n\t\t$this->addMiddlewares($this->container->get('config')->get('middlewares.after'));\n\t\t$this->addMiddlewares($this->container->get('config')->get('middlewares.before'));\n\t}",
"abstract protected function addAppMiddleware();",
"function middleware($middleware){\n\t\tFrank::add_middleware($middleware);\n\t}",
"public function configureSlim()\n {\n $config = [];\n\n $config['determineRouteBeforeAppMiddleware'] = true;\n $config['addContentLengthHeader'] = true;\n\n $this->setConfig($config);\n }",
"public function registerMiddleware()\n {\n $this->app->bindShared('simpleadmin.authenticated', function($app)\n {\n return new AuthenticateAdmin($app['SimpleAdminAuthDriver']);\n });\n }",
"protected function syncMiddlewareToRouter()\n {\n $this->router->middlewarePriority = $this->middlewarePriority;\n\n foreach ($this->middlewareGroups as $key => $middleware) {\n $this->router->middlewareGroup($key, $middleware);\n }\n\n foreach ($this->routeMiddleware as $key => $middleware) {\n $this->router->aliasMiddleware($key, $middleware);\n }\n }",
"private function middleware() {\n // validate request\n $this->validateOrFail();\n\n // route request\n $this->routeOrFail();\n }",
"private function addMiddleware()\n {\n foreach ($this->middlewares as $middleware) {\n $this->handler->addMiddleware($middleware);\n }\n }",
"private function registerMiddlewares() {\n\t\t\n\t\t$this->app['router']->middlewareGroup('hotcoffee', [\n\t\t\t\\TaffoVelikoff\\HotCoffee\\Http\\Middleware\\Auth::class,\n\t\t\t\\TaffoVelikoff\\HotCoffee\\Http\\Middleware\\HotCoffee::class\n\t\t]);\n\n\t}",
"public function bootstrap()\n {\n parent::bootstrap();\n\n $this->middleware = array_merge($this->middleware, app(AddonEnvironment::class)->addonHttpMiddlewares());\n\n foreach (app(AddonEnvironment::class)->addonRouteMiddlewares() as $key => $middleware) {\n $this->router->middleware($key, $middleware);\n }\n }",
"public function registerMiddlewareGroup()\n\t{\n\t\t$middleware_key = config('formcinch.formcinch.middleware_key');\n\t\t$middleware_class = config('formcinch.formcinch.middleware_class');\n\n\t\tif (!is_array($middleware_class)) {\n\t\t\tapp()->router->pushMiddlewareToGroup($middleware_key, $middleware_class);\n\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ($middleware_class as $middleware_class) {\n\t\t\tapp()->router->pushMiddlewareToGroup($middleware_key, $middleware_class);\n\t\t}\n\t}",
"public function defaultRouteMiddlewares()\n {\n }",
"public function addMiddleware($middleware);",
"protected function setupAuthorizeMiddleware()\n {\n $auth = app(AuthContract::class);\n $gate = app(GateContract::class);\n\n $this->middleware = new Authorize($auth, $gate);\n }",
"public function on_start()\n {\n $this->app->extend(ServerInterface::class, function(ServerInterface $server) {\n // Add our custom middleware\n return $server->addMiddleware($this->app->make(Middleware::class));\n });\n }",
"protected function registerMiddlewareGroups()\n\t{\n\t\t$middlewareGroups = config('radan.middlewareGroups');\n\t\tforeach($middlewareGroups as $group => $middlewares)\n\t\t{\n\t\t\tforeach($middlewares as $middleware)\n\t\t\t{\t\t\t\t\n\t\t\t\t$this->app['router']->pushMiddlewareToGroup($group,$middleware);\n\t\t\t}\t\t\t\n\t\t}\t\t\t\t\t\n\t}",
"private static function middleware()\n {\n $files = ['Filters', 'Middleware'];\n $folder = static::$root.'Http/Middleware'.'/';\n\n self::call($files, $folder);\n\n $files = ['MiddlewareNotFoundException', 'MiddlewareWallException'];\n $folder = static::$root.'Http/Middleware/Exceptions'.'/';\n\n self::call($files, $folder);\n }",
"public function boot()\n\t{\n\t\t// $this->addMiddleware('');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get mark select box | function getMarkSelectBox($current_mark_id, $ajax_function = false)
{
//echo '$current_category_id = '.$current_category_id;
$category_structure = $this->loadCategoryStructure();
$mark_structure = $this->load_mark_structure();
//echo '<pre>';
//print_r($category_structure);
$level = 1;
$rs = '';
$rs .= '<div id="mark_id_div">';
if ($ajax_function) {
$rs .= '<select name="mark_id" id="mark_id" onchange="' . $ajax_function . '">';
} else {
$rs .= '<select name="mark_id" id="mark_id">';
}
$rs .= '<option value="0">..</option>';
foreach ($category_structure['childs'][0] as $item_id => $categoryID) {
//echo $categoryID.'<br>';
//echo 'items = '.$items.'<br>';
if ($current_category_id == $categoryID) {
$selected = " selected ";
} else {
$selected = "";
}
$rs .= '<option disabled>' . str_repeat(' . ', $level) . $category_structure['catalog'][$categoryID]['name'] . '</option>';
$rs .= $this->get_mark_option_items($categoryID, $mark_structure, $level, $current_mark_id);
$rs .= $this->getChildNodes($categoryID, $category_structure, $level + 1, $current_category_id);
}
$rs .= '</select>';
$rs .= '</div>';
return $rs;
} | [
"public function makeMarksSelect($selected='') {\n\n $returnValues = '';\n\t\t$marksSelectArray = array('A'=>'A', 'UMC'=>'UMC','I'=>'I','MU'=>'MU','Marks'=>'Marks');\n\n\n\t\tforeach($marksSelectArray as $key => $value) {\n\t\t\tif($i == $selected) {\n\t\t\t\t$returnValues .='<option value=\"'.$key.'\" SELECTED=\"SELECTED\">'.$value.'</option>';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$returnValues .='<option value=\"'.$key.'\">'.$value.'</option>';\n\t\t\t}\n\t\t}\n return $returnValues;\n }",
"protected function get_model_kenaikan_select(){\n $name = $this->get_model_name();\n $default = array( \"class\" => \"selectpicker col-md-12\" , \"name\" => $name , \"id\" => $name , 'selected' => $this->get_value($name) );\n $items = array(\"Persen\" , \"Peringkat\");\n return $this->get_select( $items , $default);\n }",
"public function getProductLabelSelect();",
"public function getSelectObject();",
"abstract public function get_selected_options();",
"function _getStructureSelect($a_selected,$a_name,$prepend = array(),$a_options_only = false)\n\t// END PATCH Lucene Search\n\t{\n\t\tglobal $lng;\n\n\t\t$items = array('Atomic','Collection','Networked','Hierarchical','Linear');\n\t\t\n\t\tforeach($prepend as $value => $translation)\n\t\t{\n\t\t\t$options[$value] = $translation;\n\t\t}\n\n\t\tforeach($items as $item)\n\t\t{\n\t\t\t$options[$item] = $lng->txt('meta_'.strtolower($item));\n\t\t}\n\t\t// BEGIN PATCH Lucene search\n\t\treturn $a_options_only ? $options : ilUtil::formSelect($a_selected,$a_name,$options,false,true);\n\t\t// END PATCH Lucene Search\n\t\treturn ilUtil::formSelect($a_selected,$a_name,$options,false,true);\n\t}",
"public function multi_select() {\n\t}",
"abstract function defaultMultiSelect();",
"function iver_select_options() {\n\t\treturn iver_select_framework()->qodeOptions;\n\t}",
"public function getSelectLabel()\n {\n return sprintf('( %s ) %s', $this->getCode(), $this->getSummary());\n }",
"function cf_select_estados_br( $selected = false ) {\n\t$estados = cf_estados_br(); ?>\n\t<div class=\"select-wrapper\">\n\t\t<select name=\"uf\" id=\"uf\" class=\"uf\">\n\t\t\t<option value=\"\"><?php _e( 'Selecione uma opção…', 'cf' ); ?></option>\n\t\t\t<?php foreach ( $estados as $k => $v) : ?>\n\t\t\t\t<option value=\"<?php echo $k; ?>\" <?php echo ( $selected == $k ) ? 'selected=\"selected\"' : '' ?>><?php echo $v; ?></option>\n\t\t\t<?php endforeach; ?>\n\t\t</select>\n\t</div>\n\t<!-- /.select-wrapper -->\n\t<?php\n}",
"public function select(): string\n {\n $attrs = $this->_buildAttrs();\n $value = $this->_getValue();\n $options = '';\n\n if ($this->_multiple) {\n if (!is_array($value)) {\n $value = [$value];\n }\n\n foreach ($this->_options as $key => $label) {\n\n if (in_array($key, $value)) {\n $match = true;\n } else {\n $match = false;\n }\n\n $checked = ($match) ? ' selected' : '';\n $options .= '<option value=\"' . $key . '\"' . $checked . '>' . $label . '</option>';\n }\n } else {\n foreach ($this->_options as $optvalue => $label) {\n $checked = $optvalue == $value ? ' selected' : '';\n $options .= '<option value=\"' . $optvalue . '\"' . $checked . '>' . $label . '</option>';\n }\n }\n\n return $this->_renderWrapperCommomField('<select ' . $attrs . '>' . $options . '</select>');\n }",
"public static function getSelectType()\n {\n $globalConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['seminars']);\n $usePageBrowser = (bool)$globalConfiguration['usePageBrowser'];\n\n return $usePageBrowser ? 'group' : 'select';\n }",
"public function getListingsSelect()\n {\n return $this->_listingsSelect;\n }",
"public function getMark()\n {\n return $this->data['fields']['mark'];\n }",
"public function mark()\n {\n\n return $this->belongsTo('Evaluation\\Mark', 'evaluation_mark_id')->select(array('mark_id', 'mark_value'));\n\n }",
"function selection ()\n\t{\n\t\treturn $this->_multiSel ;\n\t}",
"public function getSelectedOption();",
"public function makeSelect(){\n echo \"<select name=\\\"\" .$this->getName(). \"\\\"><br>\";\n $this->makeOptions($this->getValue());\n echo \"</select>\" ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return uploading attachment object | public function getUploadingAttachment()
{
return $this->uploadingAttachment;
} | [
"abstract protected function _getUploadEntity();",
"protected function getUploadedResource() {}",
"public function getAttachment()\n {\n return $this->attachment;\n }",
"public function getUpload()\n {\n return $this->media;\n }",
"public function getUpload()\n {\n }",
"protected function getUploadedFile()\n {\n return $this->file;\n }",
"public function addAttachment()\n {\n global $injector, $notification;\n\n $result = new stdClass;\n $result->action = 'addAttachment';\n if (isset($this->vars->file_id)) {\n $result->file_id = $this->vars->file_id;\n }\n $result->success = 0;\n\n /* A max POST size failure will result in ALL HTTP parameters being\n * empty. Catch that here. */\n if (!isset($this->vars->composeCache)) {\n $notification->push(_(\"Your attachment was not uploaded. Most likely, the file exceeded the maximum size allowed by the server configuration.\"), 'horde.warning');\n } else {\n $imp_compose = $injector->getInstance('IMP_Factory_Compose')->create($this->vars->composeCache);\n\n if ($imp_compose->canUploadAttachment()) {\n try {\n foreach ($imp_compose->addAttachmentFromUpload('file_upload') as $val) {\n if ($val instanceof IMP_Compose_Exception) {\n $notification->push($val, 'horde.error');\n } else {\n $result->success = 1;\n\n /* This currently only occurs when\n * pasting/dropping image into HTML editor. */\n if ($this->vars->img_data) {\n $result->img = new stdClass;\n $result->img->src = strval($val->viewUrl()->setRaw(true));\n\n $temp1 = new DOMDocument();\n $temp2 = $temp1->createElement('span');\n $imp_compose->addRelatedAttachment($val, $temp2, 'src');\n $result->img->related = array(\n $imp_compose::RELATED_ATTR,\n $temp2->getAttribute($imp_compose::RELATED_ATTR)\n );\n } else {\n $this->_base->queue->attachment($val);\n $notification->push(sprintf(_(\"Added \\\"%s\\\" as an attachment.\"), $val->getPart()->getName()), 'horde.success');\n }\n }\n }\n\n $this->_base->queue->compose($imp_compose);\n } catch (IMP_Compose_Exception $e) {\n $notification->push($e, 'horde.error');\n }\n } else {\n $notification->push(_(\"Uploading attachments has been disabled on this server.\"), 'horde.error');\n }\n }\n\n return $this->vars->json_return\n ? $result\n : new Horde_Core_Ajax_Response_HordeCore_JsonHtml($result);\n }",
"public function getAttachment()\n {\n return isset($this->Attachment) ? $this->Attachment : null;\n }",
"private function getAttachment()\n {\n global $wpdb;\n\n $table = $wpdb->posts;\n $query = $wpdb->prepare(\"SELECT ID FROM $table\n WHERE guid LIKE '%%%s'\", $this->request);\n $post_id = $wpdb->get_var($query);\n\n // If there is no post ID for the requested file and so the file is not\n // an attachment, check whether it is a resized version of an existing\n // attachment by searching for it within the postmeta table.\n if (is_null($post_id)) {\n $name = basename($this->request);\n $table = $wpdb->postmeta;\n $query = $wpdb->prepare(\"SELECT post_id FROM $table\n WHERE meta_key = '_wp_attachment_metadata'\n AND meta_value LIKE '%%%s%%'\", $name);\n $post_id = $wpdb->get_var($query);\n }\n\n $this->attachment = get_post($post_id);\n }",
"public function getUploadedFile()\n\t{\n\t\treturn $this->uploadedFile;\n\t}",
"public function AttachedFile() {\n\t\treturn $this->form->getRecord() ? $this->form->getRecord()->{$this->Name()}() : null;\n\t}",
"public function attachment()\n {\n return $this->service('AttachmentService');\n }",
"public function getFileObject()\n\t{\n\t\treturn $this->file_object;\n\t}",
"public function getAttachmentInstance()\n {\n $attachment = new Entity();\n $attachment\n ->setHttpClient($this->_getHttpClient())\n ->setService($this->_getService())\n ;\n\n return $attachment;\n }",
"public function upload_attachment(){\n\n\t\t$file_name_with_full_path = '/home/neosoft/Desktop/VS doc/download.jpeg';\n\n\t\t$request_url = 'http://localhost:3000/rest/api/content/7406823/child/attachment';\n\t\t\n\t\tif (function_exists('curl_file_create')) { \n\t\t $cFile = curl_file_create($file_name_with_full_path);\n\t\t} else { \n\t\t $cFile = '@' . realpath($file_name_with_full_path);\n\t\t}\n\n\t\t$post = array('id'=>'7406823','comment' => 'abc','file' =>$cFile);\n\n\t \t$ch = curl_init();\n\t \tcurl_setopt($ch, CURLOPT_URL, $request_url);\n\t curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\t curl_setopt($ch, CURLOPT_POST, 1);\n\t curl_setopt($ch, CURLOPT_POSTFIELDS, $post); \n\t curl_setopt($ch, CURLOPT_USERPWD, \"admin\" . \":\" . \"Abc@1234\");\n\n\t \t$headers = array();\n\t\t$headers[] = \"X-Atlassian-Token: no-check\";\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\n\t $result = curl_exec($ch);\n\t $info = curl_getinfo($ch);\n\t curl_close ($ch);\n }",
"public function upload(): Media\n {\n $this->verifyFile();\n\n $model = $this->populateModel($this->makeModel());\n\n if (is_callable($this->before_save)) {\n call_user_func($this->before_save, $model, $this->source);\n }\n\n $this->verifyDestination($model);\n $this->writeToDisk($model);\n $model->save();\n\n return $model;\n }",
"public function uploader()\r\n {\r\n return $this->uploader;\r\n }",
"public function getAttachment()\n {\n return $this->hasOne(Attachment::class, ['id' => 'attachment_id']);\n }",
"public function getFileUpload()\n\t{\n\t\ttry {\n\t\t\treturn new FileUpload($_FILES[self::$file]);\n\t\t} catch (\\bildflode\\model\\EmptyUploadException $e) {\n\t\t\t$this->message = \"File field can not be empty. Please select a file.\";\n\t\t} catch (\\bildflode\\model\\UploadFailedException $e) {\n\t\t\t$this->message = \"Upload failed. Try again or contact support.\";\n\t\t} catch (\\bildflode\\model\\FileSizeException $e) {\n\t\t\t$this->message = \"File is too big.\";\n\t\t}\n\t\treturn null;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles a request to add an artifact to a project. | function handleAddNewArtifact($projectId, $projectsDao, $configManager, $logger) {
$name = getFromBody('name');
$description = getFromBody('description');
$type = getFromBody('artifactType');
$project = $projectsDao->getProject($projectId);
// TODO: handle case when project is not found
$artifact = new ShowcaseProjectArtifact();
$artifact
->setName($name)
->setDescription($description)
->setProject($project);
$artifactId = $artifact->getId();
switch ($type) {
case 'link':
$link = getFromBody('artifactLink');
$artifact->setLink($link);
break;
case 'file':
if (!isset($_FILES['artifactFile'])) {
respond(400, 'Must include file in request to create artifact with file attachment');
}
$fileSize = $_FILES['artifactFile']['size'];
$fileTmp = $_FILES['artifactFile']['tmp_name'];
$fiveMb = 5242880;
if ($fileSize > $fiveMb) {
respond(400, 'Artifact file must be smaller than 5MB');
}
$filepath =
$configManager->getPrivateFilesDirectory() . '/' .
$configManager->get('server.upload_artifact_file_path') .
"/$artifactId";
$ok = move_uploaded_file($fileTmp, $filepath);
if (!$ok) {
respond(500, 'Failed to upload artifact file');
}
$artifact->setFileUploaded(true);
break;
}
$ok = $projectsDao->addNewProjectArtifact($artifact);
if (!$ok) {
respond(500, 'Failed to add project artifact');
}
respond(201, 'Successfully added new artifact', array('id' => $artifactId));
} | [
"public function add()\n {\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n $content = trim(file_get_contents(\"php://input\"));\n $decodedContent = json_decode($content, true);\n\n if ($decodedContent !== null) {\n $project = new Project();\n $project->add($decodedContent);\n }\n }\n }",
"public function addNewInfoDepotItemArtifact($artifact) {\n\t\ttry {\n\t\t\t\t//4/26/19: implemented, needs testing\n\t\t\t\n\t\t\t\t//idia_id is generated using a secure cryptic ID generator found in \n\t\t\t\t//./shared/classes/Util/IdGenerator.php.\n\t\t\t\t$sql = 'INSERT INTO info_depot_item_artifact ';\n\t\t\t\t$sql .= '(idia_id, idia_idi_id, idia_description, idia_file, ';\n\t\t\t\t$sql .= 'idia_mime, idia_link) ';\n\t\t\t\t$sql .= 'VALUES (:id, :itemid, :description, :file, :mime, :link)';\n\t\t\t\t\n\t\t\t\t$params = array(\n\t\t\t\t\t':id' => $artifact->getId(),\n\t\t\t\t\t':itemid' => $artifact->getParentItem()->getId(),\n\t\t\t\t\t':description' => $artifact->getDescription(),\n\t\t\t\t\t':file' => $artifact->getFile(),\n\t\t\t\t\t':mime' => $artifact->getMime(),\n\t\t\t\t\t':link' => $artifact->getLink()\n\t\t\t\t);\n\t\t\t\t$this->conn->execute($sql, $params);\n\n\t\t\t\treturn true;\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\t$this->logError('Failed to add new artifact: ' . $e->getMessage());\n\n\t\t\t\treturn false;\n }\n }",
"public function add()\n {\n //create art request attachments\n $fileUploader = new \\AppFileUpload\\FileUploader('/home/cclweb/docs/default/app/module/ArtRequest/upload/');\n\n try\n {\n //art request service entity\n $artRequestServiceEntity = $this->getDataEntity('ArtRequest\\Service\\Entity\\ArtRequestServiceEntity');\n\n //pre-add event\n $this->getEventManager()->trigger(__FUNCTION__ . EventHookType::PRE,\n $this, array('serviceEntity' => $artRequestServiceEntity));\n\n //create event\n $eventId = $this->getModel('ArtRequest\\Model\\EventModel')\n ->create($artRequestServiceEntity);\n\n //create art requestor\n $artRequestorId = $this->getModel('ArtRequest\\Model\\ArtRequestorModel')\n ->create($artRequestServiceEntity);\n\n //create art request\n $artRequestId = $this->getModel('ArtRequest\\Model\\ArtRequestModel')\n ->create($artRequestorId, $eventId, $artRequestServiceEntity);\n \n if($artRequestServiceEntity->getHasFlyerRequest() == 'true')\n {\n //create flyer art request\n $flyerRequestId = $this->getModel('ArtRequest\\Model\\FlyerArtRequestModel')\n ->create($artRequestId, $artRequestServiceEntity);\n }\n\n if($artRequestServiceEntity->getHasBannerRequest() == 'true')\n {\n //create banner art request\n $bannerRequestId = $this->getModel('ArtRequest\\Model\\BannerArtRequestModel')\n ->create($artRequestId, $artRequestServiceEntity);\n }\n\n //process art request attachments\n foreach($artRequestServiceEntity->getUploadedFiles() as $attachments)\n {\n //double loop is required because $artRequestServiceEntity->getUploadedFiles() returns\n //a multi-dimensional array\n foreach($attachments as $attachment)\n {\n \tif($attachment['name'] != \"\") {\n \t\t$file = new \\AppFileUpload\\File($attachment);\n $baseName = pathinfo($attachment['name'], PATHINFO_FILENAME);\n $attachmentName = ($baseName . \"-\" . uniqid() . \".\" . $file->getFileExtension());\n $file->setFileName($attachmentName);\n \t$this->getModel('ArtRequest\\Model\\ArtRequestAttachmentModel')\n \t->create($file->getFileName(), $artRequestId);\n \t$fileUploader->addFile($file);\n \t}\n } \n }\n \n //add art request types\n foreach($artRequestServiceEntity->getArtRequestTypes() as $artRequestTypeId)\n {\n $this->getModel('ArtRequest\\Model\\ArtRequestArtRequestTypeModel')\n ->create($artRequestId, $artRequestTypeId);\n }\n \n //save files\n $fileUploader->commit();\n \n //post-add event\n $this->getEventManager()->trigger(__FUNCTION__ . EventHookType::POST,\n $this,\n array('serviceEntity' => $this->getDataEntity('ArtRequest\\Service\\Entity\\ArtRequestServiceEntity'), 'result' => $artRequestId));\n\n //art request id\n return $artRequestId;\n } \n catch(\\Exception $e)\n {\n //roll back file upload\n $fileUploader->rollBack();\n throw new ServiceException('Error Adding Art Request', $e);\n }\n }",
"public function publish(ReleaseArtifact $artifact);",
"public abstract function fetchArtifact(Tracker_Artifact $artifact);",
"public function addAction()\n {\n $form = new Apt_Form_Project(array('method' => 'POST'));\n\n $request = $this->getRequest();\n if ($request->isPost() && $form->isValid($request->getPost())) {\n\n $project = new Apt_Model_Project();\n $project->setName($form->getValue('name'));\n $project->setSprintLength($form->getValue('length'));\n $project->setDefaultVelocity($form->getValue('velocity'));\n\n $user = $this->_em->find(\n 'Apt_Model_User',\n Zend_Auth::getInstance()->getIdentity()->getId()\n );\n $project->setProductOwner($user);\n\n $this->_em->persist($project);\n $this->_em->flush();\n\n $this->_helper->redirector->gotoSimple('index');\n return;\n\n }\n\n $this->view->form = $form;\n }",
"public function add(Project $project);",
"function addArtifactFile($session_ser,$group_id,$group_artifact_id,$artifact_id,$base64_contents,$description,$filename,$filetype) {\n\tcontinue_session($session_ser);\n\n\t$grp = group_get_object($group_id);\n\tif (!$grp || !is_object($grp)) {\n\t\treturn new soap_fault ('','addArtifactFile','Could Not Get Project','Could Not Get Project');\n\t} elseif ($grp->isError()) {\n\t\treturn new soap_fault ('','addArtifactFile',$grp->getErrorMessage(),$grp->getErrorMessage());\n\t}\n\n\t$at = new ArtifactType($grp,$group_artifact_id);\n\tif (!$at || !is_object($at)) {\n\t\treturn new soap_fault ('','addArtifactFile','Could Not Get ArtifactType','Could Not Get ArtifactType');\n\t} elseif ($at->isError()) {\n\t\treturn new soap_fault ('','addArtifactFile',$at->getErrorMessage(),$at->getErrorMessage());\n\t}\n\n\t$a = new Artifact($at,$artifact_id);\n\tif (!$a || !is_object($a)) {\n\t\treturn new soap_fault ('','addArtifactFile','Could Not Get Artifact','Could Not Get Artifact');\n\t} elseif ($a->isError()) {\n\t\treturn new soap_fault ('','addArtifactFile',$a->getErrorMessage(),$a->getErrorMessage());\n\t}\n\n\t$af = new ArtifactFile($a);\n\tif (!$af || !is_object($af)) {\n\t\treturn new soap_fault ('','addArtifactFile','Could Not Create ArtifactFile object','Could Not Create ArtifactFile object');\n\t} elseif ($af->isError()) {\n\t\treturn new soap_fault ('','addArtifactFile',$af->getErrorMessage(),$af->getErrorMessage());\n\t}\n\n\t$bin_data = base64_decode($base64_contents);\n\t$filesize = strlen($bin_data);\n\n\t// Bugfix: Send filename and not the content\n\t$tmpfname = tempnam(\"/tmp\", \"forgeupload\");\n\tfile_put_contents($tmpfname, $bin_data);\n\n\t$res = $af->create($filename,$filetype,$filesize,$tmpfname,$description);\n\n\tif (!$res) {\n\t\treturn new soap_fault ('','addArtifactFile',$af->getErrorMessage(),$af->getErrorMessage());\n\t}\n\n\treturn $res;\n}",
"function add_existing() {\n if(!ProjectSourceRepositories::canAdd($this->logged_user, $this->active_project)) {\n $this->response->forbidden();\n } // if\n\n $repository_data = $this->request->post('repository');\n if(!is_array($repository_data)) {\n $repository_data = array(\n 'visibility' => $this->active_project->getDefaultVisibility(),\n );\n } // if\n \n if ($this->request->isSubmitted()) {\n \ttry {\n \t \n $source_repository_id = null;\n $temp_source_repository_id = $repository_data['source_repository_id'];\n $this->active_repository = SourceRepositories::findById($temp_source_repository_id);\n if ($this->active_repository instanceof SourceRepository) {\n $source_repository_id = $temp_source_repository_id;\n } //if\n\t \n $this->project_object_repository->setName($this->active_repository->getName());\n $this->project_object_repository->setParentId($source_repository_id);\n $this->project_object_repository->setVisibility($repository_data['visibility']);\n $this->project_object_repository->setProjectId($this->active_project->getId());\n $this->project_object_repository->setCreatedBy($this->logged_user);\n $this->project_object_repository->setState(STATE_VISIBLE);\n \n $this->project_object_repository->save();\n \t\t\n \t\t$this->response->respondWithData($this->active_repository, array(\n \t\t 'as' => 'repository', \n \t\t 'detailed' => true, \n \t\t));\n \t} catch (Exception $e) {\n \t\t$this->response->exception($e);\n \t} // try\n } // if\n \n $this->smarty->assign(array(\n 'existing_repositories' => ProjectSourceRepositories::getForProjectRepositorySelect($this->active_project),\n 'repository_add_url' => Router::assemble('repository_add_existing', array('project_slug' => $this->active_project->getSlug())),\n 'repository_data' => $repository_data,\n 'disable_url_and_type' => false,\n 'aid_engine' => '',\n ));\n }",
"function add() {\n if(!Repository::canAdd($this->logged_user, $this->active_project)) {\n $this->httpError(HTTP_ERR_FORBIDDEN);\n } // if\n \n if (!$this->repository_engine->executableExists()) {\n flash_error('Please configure the path to SVN executable before prior to adding a repository');\n $this->redirectTo('admin_source');\n } // if\n \n $repository_data = $this->request->post('repository');\n if(!is_array($repository_data)) {\n $repository_data = array(\n 'visibility' => $this->active_project->getDefaultVisibility(),\n );\n } // if\n\n if ($this->request->isSubmitted()) {\n $repository_data['name'] = trim($repository_data['name']) == '' ? $repository_data['url'] : $repository_data['name'];\n $this->active_repository->setAttributes($repository_data);\n $this->active_repository->setProjectId($this->active_project->getId());\n $this->active_repository->setCreatedBy($this->logged_user);\n $this->active_repository->setState(STATE_VISIBLE);\n \n $this->active_repository->loadEngine($this->active_repository->getRepositoryType());\n \n $this->repository_engine = new RepositoryEngine($this->active_repository);\n $this->repository_engine->triggerred_by_handler = true;\n \n $result = $this->repository_engine->testRepositoryConnection();\n if ($result === true) {\n $save = $this->active_repository->save();\n if ($save && !is_error($save)) {\n flash_success(lang('Project repository ":name" has been added successfully'), array('name'=>$this->active_repository->getName()));\n $this->redirectToUrl(source_module_url($this->active_project));\n } else {\n $this->smarty->assign('errors', $save);\n } //if\n }\n else {\n $errors = new ValidationErrors();\n $errors->addError(lang('Failed to connect to repository: :message', array('message'=>$result)));\n $this->smarty->assign('errors', $errors);\n } // if\n \n } // if\n \n $test_connection_url = assemble_url('repository_test_connection', array('project_id'=>$this->active_project->getId()));\n js_assign('repository_test_connection_url', $test_connection_url);\n\n $this->smarty->assign(array(\n 'types' => $this->active_repository->types,\n 'update_types' => $this->active_repository->update_types,\n 'repository_add_url' => assemble_url('repository_add', array('project_id'=>$this->active_project->getId())),\n 'repository_data' => $repository_data,\n 'disable_url_and_type' => false,\n 'aid_url' => lang('Please enter the root path to the repository'),\n 'aid_engine' => ''\n ));\n }",
"public function addAction()\n {\n $request = $this->getRequest();\n $form = new Application_Model_Document_AddForm();\n $this->view->pageTitle = \"Add External File\";\n $this->view->form = $form;\n \n if($request->isPost())\n {\n $this->handleAddForm($form);\n }\n }",
"public function produceArtifact($artifactName);",
"function drush_btranslator_btr_project_add($origin, $project, $path) {\n btr::project_add($origin, $project, $path);\n foreach(btr::messages() as $msg) drush_log($msg[0], $msg[1]);\n}",
"public function addAction()\n {\n // Check this is a POST request\n if ($this->request->isPost()) {\n\n /**\n * @var $jobProcessor \\Autoq\\Services\\JobProcessor\\JobDefinitionProcessor\n */\n $jobProcessor = $this->di->get('jobProcessor');\n\n $rawDefinition = $this->request->getRawBody();\n\n // Run some basic checks on the definition and format as we want\n if ($jobProcessor->processJobDefiniton($rawDefinition)) {\n\n //Get the processed job definition\n $processedDefinition = $jobProcessor->getValidatedDefinition();\n \n // Save the validated job definition\n if (($jobID = $this->repo->save($processedDefinition)) === false) {\n $response = $this->apiHelper->responseError(\"Unable to add job\");\n } else {\n\n // Read the newly created job defintion to return to user\n if (($jobDefinition = $this->repo->getById($jobID)) === false) {\n $response = $this->apiHelper->responseError(\"Job added but unable to read!\");\n } else {\n $response = $this->apiHelper->responseSuccessWithData($jobDefinition);\n }\n }\n\n } else {\n //Send back validation error\n $response = $this->apiHelper->responseError($jobProcessor->getFirstError());\n }\n\n } else {\n $response = $this->apiHelper->responseWrongMethod();\n }\n\n return $response;\n }",
"public function addAction()\n {\n if (!isset($_FILES['file']['tmp_name']) || !strlen($_FILES['file']['tmp_name'])) {\n throw new \\RuntimeException(\"Cannot add attachment. File did not upload correctly.\");\n }\n\n $services = $this->getServiceLocator();\n $p4Admin = $services->get('p4_admin');\n $queue = $services->get('queue');\n $config = $services->get('config');\n $maxSize = $config['attachments']['max_file_size'];\n $file = $_FILES['file'];\n\n if ($file['size'] > $maxSize) {\n throw new \\RuntimeException(\n 'Attachment ' . $file['name'] . ' exceeds maximum file size of ' . $maxSize . ' bytes'\n );\n }\n\n $attachment = new Attachment($p4Admin);\n $attachment->set(\n array(\n 'name' => urldecode($file['name']),\n 'size' => $file['size'],\n 'type' => $file['type'],\n )\n );\n\n // this local file will be consumed (deleted) as part of ->save()\n $attachment->save($file['tmp_name']);\n\n // cleanup is required in case the user never posts the comment that the attachment is intended for\n // cleanup only performs a delete, not an obliterate, so the data is still recoverable\n $queue->addTask('cleanup.attachment', $attachment->getId(), null, strtotime('+24 hours'));\n\n return new JsonModel(\n array(\n 'isValid' => true,\n 'attachment' => array(\n 'id' => $attachment->getId(),\n 'name' => $attachment->get('name'),\n 'type' => $attachment->get('type'),\n 'size' => $attachment->get('size')\n )\n )\n );\n }",
"private function addMilestone($projectId, $milestone)\n\t{\n\t\t$data = array(\n\t\t\t'name' => $milestone['name'],\n\t\t\t'description' => $milestone['description'],\n\t\t\t'due_on' => $milestone['due_on'],\n\t\t);\n\t\t$this->error_log(\"Add new Milestone '{$milestone['name']}'\");\n\t\treturn $this->send_post(\"add_milestone/{$projectId}\", $data);\n\t}",
"public function add($asset);",
"function lingotek_add_project($name) {\n $output = LingotekApi::instance()->request('addProject', array('projectName' => $name));\n if ($output->results == \"success\") {\n variable_set('lingotek_project', $output->id);\n return $output->id;\n }\n}",
"public function create($project, CreateIssueRequest $request)\n {\n $issue = new Issue();\n $issue->hidden \t = $request->has('hidden');\n $issue->author_id = Auth::user()->id;\n $issue->project_id = $project->id;\n $issue->summary = $request->summary;\n $issue->priority = 'Medium';\n $issue->version\t\t= $project->current_version;\n $issue->reference = $request->reference;\n $issue->description = $request->description;\n\n if($request->assigned == '1') {\n $groupid = Group::where('name', '=', 'Client')->first()->id;\n $issue->status = 'Awaiting Client';\n $issue->assigned_to_id = $groupid;\n } else {\n $groupid = Group::where('name', '=', 'Sponge UK')->first()->id;\n $issue->status = 'New';\n $issue->assigned_to_id = $groupid;\n }\n $result = $issue->save();\n\n if($request->file('attachment')) {\n $attachment = $request->file('attachment');\n $file = array(\n \"filename\" => $attachment->getClientOriginalName(),\n \"extension\" => $attachment->getClientOriginalExtension(),\n \"filetype\" => $attachment->getMimeType()\n );\n $attachment->move(\"uploads/tmp\", $file['filename']);\n $this->dispatch(new AddAttachmentCommand($file, $issue->id, Auth::user()->id));\n }\n\n if($result) {\n $update = new IssueHistory();\n $update->hidden = false;\n $update->project_id = $issue->project->id;\n $update->issue_id = $issue->id;\n $update->author_id = $issue->author->id;\n $update->type = 'status';\n $update->status = 'created';\n $update->comment = 'Amendment was created';\n $update->save();\n }\n\n return $issue->id;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
'issue::add_comment()' Add a comment to an issue. | function // O - FALSE on failure, text on success
add_comment()
{
global $_POST, $LOGIN_EMAIL;
// Get form data...
if (array_key_exists("contents", $_POST))
$contents = trim(str_replace("\r\n", "\n", $_POST["contents"]));
else
$contents = "";
if ($contents == "")
return ("");
// Create a new text record...
$comment = new comment();
$comment->ref_id = "issue_$this->id";
$comment->contents = $contents;
// Save it...
if (!$comment->save())
return (FALSE);
return ($contents);
} | [
"function addComment(AddedComment $comment);",
"public function postComment($issue_id, $content);",
"public function addComment($comment) { $this->comments[] = $comment; }",
"public function addComment($issueKey, $params)\n {\n return $this->api(self::REQUEST_POST, sprintf(\"/rest/api/2/issue/%s/comment\", $issueKey), $params);\n }",
"public function addComment($comment) \n {\n $this->comments[] = $comment;\n }",
"public function add_comment() {\n $this->comments++;\n }",
"public function addComment($comment)\n {\n $this->comments[] = $comment;\n }",
"public function addComment(\\MiniTeam\\ScrumBundle\\Entity\\Comment $comment)\n {\n $this->comments[] = $comment;\n $comment->setStory($this);\n }",
"public function addComment(): void\n {\n $this->articleId = $_GET['articleId'];\n $this->content = $_POST['comment'];\n $this->author = $_POST['nickname'];\n $datetime = new DateTime();\n $this->date = $datetime->format('Y-m-d H:i:s');\n\n $this->commentModel->addComment($this->content, $this->date, $this->author, $this->articleId);\n\n // Redirect to the article page\n Router::redirectTo('articleDetails&id=' . $this->articleId);\n exit();\n }",
"function addComment($comment)\n {\n $this->crontabs[] = \"# $comment\\n\";\n $this->linetypes[] = self::CRON_COMMENT;\n }",
"public function addComment($issueIdOrKey, $comment)\n {\n $this->log->info(\"addComment=\\n\");\n\n if (!($comment instanceof ServiceDeskComment) || empty($comment->body)) {\n throw new JiraException('comment param must instance of Comment and have to body text.!');\n }\n\n $data = json_encode($comment);\n\n $ret = $this->exec($this->uri.\"/$issueIdOrKey/comment\", $data);\n\n $this->log->debug('add comment result='.var_export($ret, true));\n $comment = $this->json_mapper->map(\n json_decode($ret),\n new ServiceDeskComment()\n );\n\n return $comment;\n }",
"public function addComment()\n {\n $com_postId = $this->request->getParameter(\"id\"); // reprend l'id de l'url\n $author = $this->request->getParameter(\"name\"); // name dans le formulaire\n $comcontent = $this->request->getParameter(\"comment\"); // content dans le formulaire\n\n // Sauvegarde du commentaire\n $this->comment->postComment($com_postId, $author, $comcontent); // va chercher la méthode dans le Model Comment.php l.25\n // Actualisation de l'affichage de billet. Donc pas de génération de nouvelle vue\n $this->executeAction(\"post\");\n\n }",
"public function add($comment) {\n $this->save($comment);\n }",
"private function addComment() {\n\t\t$currentUser = new \\common\\model\\User($this->loginModel->getSessionUser(), \"\");\n\t\t$dbUser = $this->userDAL->findUser($currentUser);\n\t\t$comment = $this->view->getUsersComment($dbUser);\n\n\t\ttry {\n\t\t\t$this->commentDAL->addComment($comment);\n\t\t} catch (\\Exception $e) {\n\t\t\t$this->view->commentFailed();\n\t\t}\n\t}",
"public function addComment(Comment $comment)\n {\n $this->comment[] = $comment;\n }",
"function add_comment($bug_id=0)\n {\n $page = $this->page;\n\t\t\n // Valid input\n if ($bug_id==0)\n {\n $this->page['error'] = 'Invalid input.';\n $this->index();\n return;\n }\n\t\t\n // Must be a valid bug\n $bug = $this->bugmodel->get_by_id($bug_id);\n if (!isset($bug->bug_id))\n {\n $this->page['error'] = 'No such bug.';\n $this->index();\n return;\n }\n\t\t\n // Must be logged in\n if ( !isset($page['user']->id) )\n {\n $this->page['error'] = 'You are not allowed to comment if you are not logged in.';\n $this->index();\n return;\n }\n\t\t\n // Away we go\n $comment = new stdClass();\n $comment->text = $this->input->post('comment');\n $comment->user_id = $page['user']->id;\n $comment->bug_id = $bug_id;\n $this->db->insert('bug_comments', $comment);\n \n // Update the bug timestamp\n $bugupdate = new stdClass();\n $bugupdate->bug_id = $bug_id;\n $bugupdate->modified_on = null;\n $this->bugmodel->update($bug_id, $bugupdate);\n\n $this->session->set_flashdata('notice', 'Your comment has been sumbitted!');\n redirect('bugtracker/view/'.$bug_id, 'refresh');\n \n }",
"function AddComment($workorderId, $commentText)\n {\n if ($this->currentUserEmail == null || $workorderId == null || $commentText == null){\n throw new Exception(\"Operation requires user.\");\n }\n $wo = $this->Select($workorderId);\n $woViewModel = new WorkorderViewModel($wo, \"\", $this->currentUserEmail);\n if (!$woViewModel->userIsCollaborator && !$woViewModel->userIsCurrentApprover){\n throw new Exception(\"User cannot add comments at this time.\");\n }\n // Update the comments\n $comments = json_decode($wo->comments, true);\n if ($comments == null) {\n $comments = array();\n }\n $woComment = new WorkorderComment();\n $woComment->commentData = $commentText;\n $woComment->createdAt = date('Y-m-d H:i:s');\n $woComment->createdBy = $this->currentUserEmail;\n array_push($comments, $woComment);\n $wo->comments = json_encode($comments);\n \n return $this->Update($workorderId, $wo);\n\n }",
"function addComment ( $comment_text ) {\n\n $comment = new Dropio_Asset_Comment ($this);\n $comment->contents = $comment_text;\n\n return $comment->save();\n\n }",
"public function addComment($comment)\n\t{\n\t\tif(Yii::app()->params['commentNeedApproval'])\n\t\t\t$comment->status=Comment::STATUS_PENDING;\n\t\telse\n\t\t\t$comment->status=Comment::STATUS_APPROVED;\n\t\t$comment->post_id=$this->id;\n\t\treturn $comment->save();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders and returns Google Analytics code. | public function render()
{
if (!$this->isEnabled()) {
return;
}
if ($this->isAutomatic()) {
$this->addItem("ga('send', '" . self::TYPE_PAGEVIEW . "');");
}
if ($this->isAnonymised()) {
$this->addItem("ga('set', 'anonymizeIp', true);");
}
if ($this->application->environment() === 'dev') {
$this->addItem("ga('create', '{$this->id}', { 'cookieDomain': 'none' });");
} else {
$this->addItem("ga('create', '{$this->id}', '{$this->domain}');");
}
return $this->view->make('googlitics::analytics')->withItems(array_reverse($this->getItems()))->render();
} | [
"private function _render_ga()\n\t{\n\t\tif ($this->ga_tracking_id != '')\n\t\t{\n\t\t\treturn '\n\t\t\t\n<script type=\"text/javascript\">\n\n var _gaq = _gaq || [];\n _gaq.push([\\'_setAccount\\', \\''.$this->ga_tracking_id.'\\']);\n _gaq.push([\\'_trackPageview\\']);\n\n (function() {\n var ga = document.createElement(\\'script\\'); ga.type = \\'text/javascript\\'; ga.async = true;\n ga.src = (\\'https:\\' == document.location.protocol ? \\'https://ssl\\' : \\'http://www\\') + \\'.google-analytics.com/ga.js\\';\n var s = document.getElementsByTagName(\\'script\\')[0]; s.parentNode.insertBefore(ga, s);\n })();\n\n</script>\n\t\t\t';\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"function googleTrackingCode() {\n\t$trackingID = ls_option('google_analytics_tracking_id');\n\tif($trackingID):\n ?>\n <script>\n\t (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n\t (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n\t m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n\t })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n\n\t ga('create', '<?= $trackingID; ?>', 'auto');\n\t ga('send', 'pageview');\n\t</script>\n <?php\n endif;\n}",
"public function get_tracking_code(): string {\n global $OUTPUT;\n\n $settings = $this->record->get_property('settings');\n\n $template = new \\stdClass();\n $template->analyticsid = $settings['siteid'];\n $template->page = \"\";\n\n if (!empty($this->record->get_property('cleanurl'))) {\n $template->page = $this->trackurl(true, true);\n }\n\n return $OUTPUT->render_from_template('watool_ganalytics/tracking_code', $template);\n }",
"private function generateGATrackingCode() {\n # string setAccount => UA-XXXX-Y\n # string setDomainName\n # string setCookiePath\n # bool enhancedLinkAttribution\n # string trackPageview\n\n # [[+ga_options]]\n $ga_options = array();\n\n # create a GA tracker\n $GAtracker = '';\n\n if ($this->config['enhancedLinkAttribution']) $GAtracker .= \"['_require','inpage_linkid',p],\";\n $GAtracker .= \"['_setAccount','\".$this->config['setAccount'].\"'],\";\n $GAtracker .= empty($this->config['trackPageview']) ? \"['_trackPageview']\" : \"['_trackPageview', '\".$this->config['trackPageview'].\"']\";\n if (!empty($this->config['setDomainName'])) $GAtracker .= \",['_setDomainName','\".$this->config['setDomainName'].\"']\";\n if (!empty($this->config['setCookiePath'])) $GAtracker .= \",['_setCookiePath','\".$this->config['setCookiePath'].\"']\";\n\n $ga_options['ga_options'] = $GAtracker;\n return $this->getChunk('googleAnalyticsTpl',$ga_options);\n }",
"public function add_tracking_code() {\n\n if( ! $this->has_tracking_code() ) return;\n ?>\n <script>\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n\n ga('create', '<?php esc_attr( $this->get_tracking_code() ); ?>', 'auto');\n ga('send', 'pageview');\n\n </script>\n <?php }",
"function google_analytics_code() {\n if ( defined( 'GOOGLE_ANALYTICS_CODE' ) && !empty( GOOGLE_ANALYTICS_CODE ) ): ?>\n <script>\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n ga('create', '<?php echo GOOGLE_ANALYTICS_CODE; ?>', 'auto');\n ga('send', 'pageview');\n\n </script>\n <?php endif; ?>\n<?php\n}",
"function google_analytics_tracking_code(){\n ?>\n <script>\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n ga('create', 'UA-103015653-1', 'auto');\n ga('send', 'pageview');\n </script>\n <?php \n}",
"function google_analytics_tracking_code(){ ?>\n\n\t\t<script>\n\t\t\n\t\t (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n\t\t (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n\t\t m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n\t\t })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n\t\t\n\t\t ga('create', 'UA-77591609-1', 'auto');\n\t\t ga('send', 'pageview');\n\t\t\n\t\t</script>\n\t\t\n<?php\n}",
"public function GA()\n {\n $id = cfg::get('ga_id');\n\n $restrict_domain = cfg::get('ga_domain');\n\n\n if ($id && (!$restrict_domain || (preg_match('/' . $restrict_domain . '/', $_SERVER['HTTP_HOST']))) && !$this->cfg['isDraft']) {\n $html = '<script type=\"text/javascript\">'\n . 'var _gaq = _gaq || [];'\n . \"_gaq.push(['_setAccount', '\" . $id . \"']);\"\n . \" _gaq.push(['_trackPageview']);\"\n . \"(function() {\"\n . \"var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\"\n . \"ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\"\n . \"var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\"\n . '})();'\n . '</script>';\n }\n\n return $html;\n }",
"function theme58090_print_google_code() {\n\t$google_code = cherry_get_option( 'google_analytics' );\n\n\tif ( empty( $google_code ) ) {\n\t\treturn;\n\t}\n\n\tprintf( '<script>%s</script>', $google_code );\n}",
"public function osp_google_analytics (){\n \n $key = \" <!-- Global site tag (gtag.js) - Google Analytics --><script async src=\\\"https://www.googletagmanager.com/gtag/js?id=UA-169940218-1\\\"> </script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-169940218-1'); </script>\";\n echo $key;\n }",
"public function render()\r\n {\r\n if($this->_accountID !== null)\r\n {\r\n // Check to see if we need to throw in the trackPageview call\r\n if(!in_array('_trackPageview', $this->_calledOptions) && $this->autoPageview)\r\n {\r\n $this->_trackPageview();\r\n }\r\n \r\n // Get the prefix information\r\n if($this->prefix != '')\r\n {\r\n if(strpos($this->prefix, '.') === false)\r\n {\r\n $this->prefix .= '.';\r\n }\r\n }\r\n else\r\n {\r\n $this->prefix = '';\r\n }\r\n\r\n // Start the JS string\r\n $js = 'var _gaq = _gaq || [];' . PHP_EOL;\r\n foreach($this->_data as $data)\r\n {\r\n // No prefixes for the first argument.\r\n $prefixed = false;\r\n \r\n // Clean up each item\r\n foreach($data as $key => $item)\r\n {\r\n \r\n if(is_string($item))\r\n {\r\n $data[$key] = self::Q . ((!$prefixed) ? $this->prefix : '') . preg_replace('~(?<!\\\\\\)'. self::Q . '~', '\\\\' . (($prefixed) ? $this->prefix : '') . self::Q, $item) . self::Q;\r\n }\r\n else if(is_bool($item))\r\n {\r\n $data[$key] = ($item) ? 'true' : 'false';\r\n }\r\n \r\n $prefixed = true;\r\n }\r\n\r\n $js.= '_gaq.push([' . implode(',', $data) . ']);' . PHP_EOL;\r\n }\r\n $js.= <<<EOJS\r\n(function() {\r\n var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\r\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\r\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\r\n})();\r\n// Google Analytics Extension provided by TagPla.net\r\n// https://github.com/TagPlanet/yii-analytics\r\n// Copyright 2012, TagPla.net & Philip Lawrence\r\nEOJS;\r\n // Should we auto add in the analytics tag?\r\n if($this->autoRender)\r\n {\r\n Yii::app()->clientScript\r\n ->registerScript('TPGoogleAnalytics', $js, CClientScript::POS_HEAD);\r\n }\r\n else\r\n {\r\n return $js;\r\n }\r\n }\r\n return false;\r\n }",
"public function insert_google_analytics() {\n\t\t$current_domain = parse_url( home_url(), PHP_URL_HOST );\n\t\t$analytics_code = <<<EOD\n\t\t<!-- Google Analytics -->\n\t\t<script>\n\t\t(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n\t\t(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n\t\tm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n\t\t})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n\n\t\tga('create', 'UA-831873-38', 'auto');\n\t\tga('send', 'pageview');\n\t\t</script>\n\t\t<!-- End Google Analytics -->\n\tEOD;\n\n\t\tif ( 'www.cncf.io' == $current_domain && ! is_user_logged_in() ) {\n\t\t\t// this is a live site so output the analytics code.\n\t\t\techo $analytics_code; //phpcs:ignore\n\t\t}\n\t}",
"function ga_js()\n\t{\n\t\treturn '<script type=\"text/javascript\">\n'. $this->_ga_js .'\n</script>\n';\n\t}",
"private function getGoogleAnalytics() {\r\r\n $sq_google_analytics = SQ_Tools::$options['sq_google_analytics'];\r\r\n\r\r\n if ($sq_google_analytics <> '') {\r\r\n if (SQ_Tools::$options['sq_auto_amp']){\r\r\n return '<script async custom-element=\"amp-analytics\" src=\"https://cdn.ampproject.org/v0/amp-analytics-0.1.js\"></script>' . \"\\n\";\r\r\n }else {\r\r\n SQ_ObjController::getController('SQ_DisplayController', false)\r\r\n ->loadMedia('https://www.google-analytics.com/analytics.js');\r\r\n\r\r\n return sprintf(\"<script>\r\r\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\r\r\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\r\r\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\r\r\n })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\r\r\n\r\r\n ga('create', '%s', 'auto');\r\r\n ga('send', 'pageview');\r\r\n ga('require', 'linked');\r\r\n</script>\", $sq_google_analytics);\r\r\n }\r\r\n }\r\r\n\r\r\n return false;\r\r\n }",
"private function set_google_code() {\n\t\t$this->js[] = \"(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n\t(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n\tm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\";\n\t}",
"function wcv_output_vendor_ga_code( $vendor_id ){\n\t// Not a vendor? return nothing\n\tif ( ! WCV_Vendors::is_vendor( $vendor_id ) ) {\n\t\treturn '';\n\t}\n\n\t$vendor_tracking_id = get_user_meta( $vendor_id, '_wcv_custom_settings_ga_tracking_id', true ); \n\n\t// No tracking code added, return nothing \n\tif ( empty( $vendor_tracking_id ) ){ \n\t\treturn '';\n\t}\n\n\t$ga_code = sprintf('\n\t<!-- Global site tag (gtag.js) - Google Analytics added by WC Vendors Pro -->\n\t<script async src=\"https://www.googletagmanager.com/gtag/js?id=' . $vendor_tracking_id . '\"></script>\n\t<script>\n\twindow.dataLayer = window.dataLayer || [];\n\tfunction gtag(){dataLayer.push(arguments);}\n\tgtag(\\'js\\', new Date());\n\tgtag(\\'config\\', \\' ' .$vendor_tracking_id . ' \\');\n\t</script> '\n\t);\n\treturn $ga_code;\n}",
"public static function analytics_script() {\n\t\t$id = get_theme_mod( 'FCN_analytics_account' );\n\n\t\t$script = \"<script type=\\\"text/javascript\\\">\n\t\t\tvar _gaq = _gaq || [];\n\t\t\tvar pluginUrl = '//www.google-analytics.com/plugins/ga/inpage_linkid.js';\n\t\t\t_gaq.push(['_require', 'inpage_linkid', pluginUrl]);\n\t\t\t_gaq.push(['_setAccount', '$id']);\n\t\t\t_gaq.push(['_trackPageview']);\n\t\t\t(function() {\n \t\tvar ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n \t\tga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n \t\tvar s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n \t\t\t})(); </script>\";\n\t\n\t\tif (get_theme_mod( 'FCN_analytics_account' ) != '' ) \n\t\t{\n\t\t\techo $script;\n\t\t}\n\t}",
"public function google_site_output() {\n\n\t\t/**\n\t\t * @since 2.6.0\n\t\t * @param string $code The Google verification code.\n\t\t * @param int $id The current post or term ID.\n\t\t */\n\t\t$code = (string) \\apply_filters_ref_array(\n\t\t\t'the_seo_framework_googlesite_output',\n\t\t\t[\n\t\t\t\t$this->get_option( 'google_verification' ),\n\t\t\t\t$this->get_the_real_ID(),\n\t\t\t]\n\t\t);\n\n\t\tif ( $code )\n\t\t\treturn '<meta name=\"google-site-verification\" content=\"' . \\esc_attr( $code ) . '\" />' . PHP_EOL;\n\n\t\treturn '';\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a new instance of the localizable object handled by the concrete parser. | protected abstract function newLocalizableObject(); | [
"protected function getTranslationParser()\n {\n return new TranslationParser();\n }",
"public function newInstance()\n {\n return new TranslatorLocator(\n new PackageLocator,\n new FormatterLocator([\n 'basic' => function () {\n return new \\Aura\\Intl\\BasicFormatter;\n },\n 'intl' => function () {\n return new \\Aura\\Intl\\IntlFormatter;\n },\n ]),\n new TranslatorFactory,\n 'en_US'\n );\n }",
"public static function make(){\n return new Language;\n }",
"protected function getParserService()\n {\n $class = $this->getParameter('parser.class');\n $instance = new $class($this->getI18nService());\n\n return $instance;\n }",
"public static function create()\n\t{\n\t\treturn new Nameize();\n\t}",
"private function _newParserObject()\n\t{\n\t\t$parser = new classes_text_parser();\n\t\t$parser->set( array( 'parseArea' => $this->getBbcodeSection(), 'memberData' => $this->memberData, 'parseBBCode' => $this->getAllowBbcode(), 'parseHtml' => $this->getAllowHtml(), 'parseEmoticons' => $this->getAllowSmilies() ) );\n\t\t\n\t\treturn $parser;\n\t}",
"function &singleton($locale=null)\n {\n return I18N_Format::_singleton($locale,__CLASS__);\n }",
"public static function translation()\n {\n return new static::$translationModel;\n }",
"static public function from($source, Locale $locale, array $options = []): LocalizedObject\n\t{\n\t\treturn new static($source, $locale, $options); // @phpstan-ignore-line\n\t}",
"function factory($parser='Core', $tokenizer='')\n {\n $ret = new PHP_Parser;\n $ret->setParser($parser);\n $ret->setTokenizer($tokenizer);\n return $ret;\n }",
"public function newLanguage() {\n $language = new Language();\n return $language;\n }",
"protected static function createInstance()\n {\n $lang = env('APP_LANG','en');\n if (!empty($user_lang = self::getUserLang()))\n {\n $lang = $user_lang;\n }\n return new Translation($lang);\n }",
"static function &instance() {\n\t\tif(array_key_exists('core.locale', $GLOBALS)) {\n\t\t\t$instance = $GLOBALS['core.locale'];\n\t\t} \n\t\t\n\t\tif(!@is_object($instance) || get_class($instance) != 'locale') {\n\t\t\t$instance = new locale();\n\t\t\t$GLOBALS['core.locale'] = $instance;\n\t\t}\n\t\t\n\t\treturn $instance;\n\t}",
"private static function _getTranslateObject()\n {\n $mainLangDirectory = GLOBAL_LANG_PATH;\n $defaultLanguage = GLOBAL_LANG_DEFAULT;\n\n $translate = new Zend_Translate('array', $mainLangDirectory . $defaultLanguage . DIRECTORY_SEPARATOR . 'lang_main.php', $defaultLanguage);\n\n $availableLanguages = array();\n\n $languageDirectories = self::_getLanguageDirectories($mainLangDirectory);\n\n foreach ($languageDirectories as $lang) {\n if ($lang == $defaultLanguage) {\n continue;\n }\n\n $target = $mainLangDirectory . $lang . DIRECTORY_SEPARATOR . 'lang_main.php';\n if (file_exists($target)) {\n $translate->addTranslation($target, $lang);\n }\n }\n\n return $translate;\n }",
"protected function createTranslation()\n {\n $locale = $this->getLocale();\n if ($this->translations->containsKey($locale)) {\n return $this->translations->get($locale);\n }\n\n if (!isset($this->translationClassName)) {\n throw new InvalidArgumentException(\n 'Translation class name is required to create new translation instances'\n );\n }\n\n $translation = new $this->translationClassName;\n $translation->setObject($this);\n $translation->setLocale($locale);\n\n $this->setTranslation($translation);\n return $translation;\n }",
"private static function createDefaultParser()\n {\n $pslManager = new PublicSuffixListManager(dirname(dirname(__DIR__)) . '/data');\n $pslParser = new PslParser($pslManager->getList());\n \n return new Parser($pslParser);\n }",
"protected function getTranslation_LoaderService()\n {\n $a = $this->get('translation.loader.xliff');\n\n $this->services['translation.loader'] = $instance = new \\Symfony\\Bundle\\FrameworkBundle\\Translation\\TranslationLoader();\n\n $instance->addLoader('php', $this->get('translation.loader.php'));\n $instance->addLoader('yml', $this->get('translation.loader.yml'));\n $instance->addLoader('xlf', $a);\n $instance->addLoader('xliff', $a);\n $instance->addLoader('po', $this->get('translation.loader.po'));\n $instance->addLoader('mo', $this->get('translation.loader.mo'));\n $instance->addLoader('ts', $this->get('translation.loader.qt'));\n $instance->addLoader('csv', $this->get('translation.loader.csv'));\n $instance->addLoader('res', $this->get('translation.loader.res'));\n $instance->addLoader('dat', $this->get('translation.loader.dat'));\n $instance->addLoader('ini', $this->get('translation.loader.ini'));\n $instance->addLoader('json', $this->get('translation.loader.json'));\n\n return $instance;\n }",
"public static function from(string $locale): static\n {\n $info = self::parse($locale);\n\n return new static(...$info);\n }",
"protected function getTranslation_LoaderService()\n {\n $a = $this->get('translation.loader.xliff');\n\n $this->services['translation.loader'] = $instance = new \\Symfony\\Bundle\\FrameworkBundle\\Translation\\TranslationLoader();\n\n $instance->addLoader('php', $this->get('translation.loader.php'));\n $instance->addLoader('yml', $this->get('translation.loader.yml'));\n $instance->addLoader('xlf', $a);\n $instance->addLoader('xliff', $a);\n $instance->addLoader('po', $this->get('translation.loader.po'));\n $instance->addLoader('mo', $this->get('translation.loader.mo'));\n $instance->addLoader('ts', $this->get('translation.loader.qt'));\n $instance->addLoader('csv', $this->get('translation.loader.csv'));\n $instance->addLoader('res', $this->get('translation.loader.res'));\n $instance->addLoader('dat', $this->get('translation.loader.dat'));\n $instance->addLoader('ini', $this->get('translation.loader.ini'));\n\n return $instance;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return whether to track the controller | public function isTrackController()
{
return $this->getConfigFlag('track_controller');
} | [
"public static function hasController()\n {\n return false;\n }",
"public function hasController();",
"protected function isTrackable()\n {\n $request = $this->context->getRequest();\n $response = $this->context->getResponse();\n $controller = $this->context->getController();\n\n // don't add analytics:\n // * for XHR requests\n // * if not HTML\n // * if 304\n // * if not rendering to the client\n // * if HTTP headers only\n if ($request->isXmlHttpRequest() ||\n false === strpos($response->getContentType(), 'html') ||\n 304 == $response->getStatusCode() ||\n sfView::RENDER_CLIENT != $controller->getRenderMode() ||\n $response->isHeaderOnly()) {\n return false;\n } else {\n return true;\n }\n }",
"protected function canTrack()\n {\n return $this->options[\"enabled\"] === true;\n }",
"public function hasController()\n {\n return $this->_controller !== null;\n }",
"public function hasController()\n {\n return (null !== $this->controller);\n }",
"public function shouldTrack(Request $request): bool;",
"public function should_track(): bool {\n if (!is_siteadmin()) {\n return true;\n }\n\n return $this->record->get_property('trackadmin') == 1;\n }",
"public function issetController(): bool\n {\n return isset($this->controller);\n }",
"public function isTrackingConnector(): bool;",
"public function actionTrackingEnabled() {\n\t\treturn $this->plugin->getSetting('trackActions') === 'yes';\n\t}",
"public function is_control() {\n return $this->experiment()->control()->name === $this->name;\n }",
"public function is_tracking() {\n\n\t\tif ( ! isset( $this->is_tracking ) ) {\n\t\t\t$ua = monsterinsights_get_ua();\n\t\t\t$this->is_tracking = ! empty( $ua );\n\t\t}\n\n\t\treturn $this->is_tracking;\n\n\t}",
"public function isActive()\n {\n return $this->config->doNotTrackEnabled;\n }",
"public function hasController(string $event): bool;",
"private function canRequestTrack()\n {\n return\n $this->trackCanBePlayed() &&\n $this->userCanMakeRequests()\n ;\n }",
"private function isInvokedControllerMain()\n {\n $get = $_GET;\n $url = isset($get['url']) ? $get['url'] : null;\n if (!empty($url)) {\n $currentSubsystem = Loader::getCurrentSubSystem($url);\n if (!empty($currentSubsystem))\n $url = str_replace($currentSubsystem . \"/\", \"\", $url);\n $this->subSystem = $currentSubsystem;\n }\n if (empty($url)) {\n return true;\n } else {\n $urlSegments = explode(\"/\", $url);\n if (isset($urlSegments[1])) {\n return false;\n } else {\n return true;\n }\n }\n }",
"public static function isFullyTracked()\n {\n return static::$fullyTracked;\n }",
"private function tracking_allowed() {\r\n\t\t\tif ( ! UM()->options()->get( 'allow_tracking' ) )\r\n\t\t\t\treturn 0;\r\n\t\t\treturn 1;\r\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display a listing of the DocumentosIncripcion. | public function index(Request $request)
{
$documentosIncripcions = $this->documentosIncripcionRepository->paginate(10);
return view('documentos_incripcions.index')
->with('documentosIncripcions', $documentosIncripcions);
} | [
"public function listAction()\n {\n $this->view->pageTitle = \"Document List\";\n \n $service = new App_Service_DocumentService();\n $this->view->docs = $service->getDocuments();\n \n $this->setPartial();\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $docsOficiales = $em->getRepository('AppBundle:DocsOficiales')->findAll();\n\n return $this->render('docsoficiales/index.html.twig', array(\n 'docsOficiales' => $docsOficiales,\n ));\n }",
"public function actionIndex()\n {\n $searchModel = new DocumentoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->setSort([\n 'defaultOrder' => [\n 'data' => SORT_ASC\n ]]);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $documentos = $em->getRepository('SitioBundle:Documento')->findAll();\n\n return $this->render('documento/index.html.twig', array(\n 'documentos' => $documentos,\n ));\n }",
"public function actionIndex()\n {\n $searchModel = new DocumentoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $inscripcions = $em->getRepository('AppBundle:Inscripcion')->findAll();\n\n return $this->render('inscripcion/inscripcionindex.html.twig', array(\n 'inscripcions' => $inscripcions,\n ));\n }",
"public function invoiceList()\n {\n $this->view(\"admin/invoice-list\");\n }",
"public function listdocumentAction()\n {\n\n\t\t$sessionutilisateur = new Zend_Session_Namespace('utilisateur');\n\t\t//$this->_helper->layout->disableLayout();\n \t\t$this->_helper->layout()->setLayout('layoutpublicesmcadmin');\n\t\t\n\tif (!isset($sessionutilisateur->login)) {$this->_redirect('/administration/login');}\nif($sessionutilisateur->confirmation != \"\"){$this->_redirect('/administration/confirmation');}\n\n $document = new Application_Model_EuDocumentMapper();\n $this->view->entries = $document->fetchAll50($sessionutilisateur->code_source_create, $sessionutilisateur->code_monde_create, $sessionutilisateur->code_zone_create, $sessionutilisateur->id_pays, $sessionutilisateur->id_region, $sessionutilisateur->code_secteur_create, $sessionutilisateur->code_agence_create);\n\n $this->view->tabletri = 1;\n\n }",
"public function listdocumentAction()\n {\n\n\t\t$sessionutilisateur = new Zend_Session_Namespace('utilisateur');\n\t\t//$this->_helper->layout->disableLayout();\n \t\t$this->_helper->layout()->setLayout('layoutpublic');\n\t\t\n\tif (!isset($sessionutilisateur->login)) {$this->_redirect('/administration/login');}\nif($sessionutilisateur->confirmation != \"\"){$this->_redirect('/administration/confirmation');}\n\n $document = new Application_Model_EuDocumentMapper();\n $this->view->entries = $document->fetchAll50($sessionutilisateur->code_source_create, $sessionutilisateur->code_monde_create, $sessionutilisateur->code_zone_create, $sessionutilisateur->id_pays, $sessionutilisateur->id_region, $sessionutilisateur->code_secteur_create, $sessionutilisateur->code_agence_create);\n\n $this->view->tabletri = 1;\n\n }",
"protected function listAction()\n {\n $this->dispatch(EasyAdminMongoOdmEvents::PRE_LIST);\n\n $fields = $this->document['list']['fields'];\n $paginator = $this->mongoOdmFindAll($this->document['class'], $this->request->query->get('page', 1), $this->document['list']['max_results'], $this->request->query->get('sortField'), $this->request->query->get('sortDirection'));\n\n $this->dispatch(EasyAdminMongoOdmEvents::POST_LIST, ['paginator' => $paginator]);\n\n $parameters = [\n 'paginator' => $paginator,\n 'fields' => $fields,\n // RESTRICTED_ACTIONS 'delete_form_template' => $this->createDeleteForm($this->document['name'], '__id__')->createView(),\n ];\n\n return $this->executeDynamicMethod('render<DocumentName>Template', ['list', $this->document['templates']['list'], $parameters]);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('KbhGestionCongesBundle:OrganigrammeUnite')->findAll();\n \n \n //Formulaire d'import de documents\n $entity = new Document();\n $form = $this->createDocumentForm($entity);\n \n return $this->render('KbhGestionCongesBundle:Admin\\OrganigrammeUnite:index.html.twig', array(\n 'entities' => $entities,\n 'form' => $form->createView(),\n ));\n }",
"public function tutorDocumentList(){// stateless\n $this->_model=new DisplayDocumentModel();\n $this->_model->getAll();\n $formArray = $this->getValuesFromModelToForm();\n $this->buildBodyView($formArray);\n $this->sendModelView('DisplayDocument');\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $noDocentes = $em->getRepository('AppBundle:NoDocente')->findAllOrderedByApellido();\n\n return $this->render('nodocente/index.html.twig', array(\n 'noDocentes' => $noDocentes,\n ));\n }",
"public function index()\n\t{\n\t\t$documentotipos = Documentotipo::all();\n\n\t\treturn View::make('documentotipos.index', compact('documentotipos'));\n\t}",
"public function actionIndex() {\n $searchModel = new DocenteSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $internalDocs = $em->getRepository('AppBundle:InternalDoc')->findAll();\n\n return $this->render('internaldoc/index.html.twig', array(\n 'internalDocs' => $internalDocs,\n ));\n }",
"public function indexAction()\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $entities = $em->getRepository('InventarioFrontBundle:Detdocumentos')->findAll();\r\n\r\n return $this->render('InventarioFrontBundle:Detdocumentos:index.html.twig', array(\r\n 'entities' => $entities,\r\n ));\r\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('GAlterGestionBundle:Document')->findAll();\n\n return $this->render('GAlterGestionBundle:Document:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function index(Request $request)\n {\n\t\t$input=$request->all();\n\t\t$r=CaCaDoc::where('id', '<>', '0');\n\t\tif(isset($input['id']) and $input['id']<>null){\n\t\t\t$r->where('id', '=', $input['id']);\n\t\t}\n \n\t\tif(isset($input['doc']) and $input['doc']<>null){\n\t\t\t$r->where('doc', 'like', '%'.$input['doc'].'%');\n\t\t}\n\t\t$caCaDocs = $r->with('user')->paginate(25);\n\t\t//$caCaDocs = CaCaDoc::with('user')->paginate(25);\n\n return view('ca_ca_docs.index', compact('caCaDocs'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generated from protobuf field .centrifugal.centrifugo.api.BoolValue presence = 1; | public function setPresence($var)
{
GPBUtil::checkMessage($var, \RoadRunner\Centrifugal\API\DTO\V1\BoolValue::class);
$this->presence = $var;
return $this;
} | [
"public function getBoolValue()\n {\n return $this->readOneof(1);\n }",
"public function getBooleanValue()\n {\n return $this->readOneof(3);\n }",
"public function getBool()\n {\n return $this->readOneof(13);\n }",
"public function getBooleanValue()\n {\n return $this->readOneof(7);\n }",
"public function getBoolValue()\n {\n return $this->readOneof(5);\n }",
"public function getBoolValue()\n {\n return $this->readOneof(2);\n }",
"function hasPresence($value) {\n return !isBlank($value);\n }",
"public function getBooleanValue()\n {\n return $this->readOneof(4);\n }",
"public function getPresence()\n {\n return isset($this->presence) ? $this->presence : 0;\n }",
"function has_presence($value)\n {\n return !is_blank($value);\n }",
"public function getBoolValue()\n {\n return $this->readOneof(4);\n }",
"function has_presence($value) {\n return !is_blank($value);\n }",
"public function boolean(): BooleanType\n {\n return Type::boolean();\n }",
"function getPresence( )\n {\n // Return our current presence information, unaltered.\n return $this->presence;\n }",
"public function setVBool($value)\n {\n return $this->set(self::V_BOOL, $value);\n }",
"public static function Boolean()\n {\n return new self(Property::$_BOOLEAN_TYPE, new FlatTypeAdapter());\n }",
"public function setBoolValue($var)\n {\n GPBUtil::checkBool($var);\n $this->writeOneof(3, $var);\n\n return $this;\n }",
"function has_presence($value) {\n\treturn isset($value) && $value !== \"\";\n}",
"public static function true() : IBool\\Type {\n\t\t\tif (!isset(static::$singletons[1])) {\n\t\t\t\tstatic::$singletons[1] = new IBool\\Type(true);\n\t\t\t}\n\t\t\treturn static::$singletons[1];\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes an array of field values, and returns a SQL command string. Query format: "insert into job ( title, date_started, description, ad_source, filled [, applicant_filled_by_id, date_filled] if filled ) values ( varchar (64), date, text, varchar (32), bool [, int, date]); | function build_insert_job_sql($f) {
$fields_strg = "title, date_started, description, ad_source, filled";
$values_strg = "'" . $f["job_title"] . "', '";
$values_strg .= $f["date_started"] . "', '";
$values_strg .= $f["description"] . "', '";
$values_strg .= $f["ad_source"] . "', '";
$values_strg .= $f["filled"] . "'";
// If a job is filled, there are two extra fields.
if ($f["filled"] > 0) {
$fields_strg .= ", applicant_filled_by_id, date_filled";
$values_strg .= ", '" . $f["app_filled_by"] . "', '";
$values_strg .= $f["date_filled"] . "'";
}
$sql = "insert into job (" . $fields_strg . ") values (" . $values_strg . ");";
return $sql;
} | [
"private function constructInsertQuery($fieldarray) {\r\n $insertQuery = \"INSERT INTO $this->tablename SET \";\r\n foreach ($fieldarray as $item => $value) {\r\n $insertQuery .= \"`$item`='$value', \";\r\n }\r\n\r\n return rtrim($insertQuery, \", \");\r\n }",
"function db_insert_into_batch($tableName, $fieldKeys, $fieldValues) {\n\t$queryString = \"INSERT INTO \".$tableName;\n\n\tif (!empty($fieldKeys) && is_array($fieldKeys) && is_array($fieldValues)) {\n\t\t//-- Field names\n\t\t$keys = \"\";\n\t\tforeach ($fieldKeys as $fName) {\n\t\t\t$keys .= $fName.',';\n\t\t}\n\t\t$keys = trim($keys, ',');\n\n\t\t$queryString .= ' (' . $keys . ') VALUES ';\n\n\t\t//-- Field values\n\t\tforeach ($fieldValues as $itemValue) {\n\t\t\t$tmpString = \"\";\n\t\t\tforeach ($itemValue as $fValue) {\n\t\t\t\t$tmpString .= ($fValue).\",\";\n\t\t\t}\n\t\t\t$tmpString = trim($tmpString, ',');\n\t\t\t\t\n\t\t\t$queryString .= '(' . $tmpString . '),';\n\t\t}\n\n\t\t$queryString = trim($queryString, ',');\n\t}\n\treturn $queryString;\n}",
"private static function _mysqlFieldsArrayToStatement($fields)\n {\n return \"`\".implode(\"`, `\", $fields).\"`\";\n }",
"public function exec_INSERTquery($table, $fields_values, $no_quote_fields = false);",
"function gw_sql_insert($SQLnamesA, $table, $isFields = 1, $intCnt = 0, $is_delayed = 0)\r\n{\r\n\t$query = '';\r\n\t$SQLfileds = '';\r\n\t$SQLfiledA = $SQLvalueA = array();\r\n\tif (is_array($SQLnamesA))\r\n\t{\r\n\t\tfor (reset($SQLnamesA); list($k, $v) = each($SQLnamesA);)\r\n\t\t{\r\n\t\t\t$v = gw_text_sql($v);\r\n\t\t\tif ($v == '') {\r\n\t\t\t\t$vF = \"''\";\r\n\t\t\t}\r\n\t\t\telseif ( preg_match(\"/^[0-9]{3,12}$/\", $v) && !preg_match(\"/^[0-1]/\", $v)\r\n\t\t\t\t\t|| preg_match(\"/^0x[0-9a-f]/\", $v)) {\r\n\t\t\t\t// enum('0','1', .. ,'9'), timestamp(14), hex\r\n\t\t\t\t$vF = $v;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$vF = \"'\" . $v . \"'\";\r\n\t\t\t}\r\n\t\t\t$SQLfiledA[] = $k;\r\n\t\t\t$SQLvalueA[] = $vF;\r\n\t\t}\r\n\t\t$SQLvalues = implode(',', $SQLvalueA);\r\n\t\tif ($isFields) { $SQLfileds = ' (`' . implode('`, `', $SQLfiledA) . '`)'; }\r\n\t\tif (!$intCnt)\r\n\t\t{\r\n\t\t\t$query = CRLF.'INSERT '.($is_delayed ? 'DELAYED ': '').'INTO `' . $table .'`'. $SQLfileds . ' VALUES ('.$SQLvalues.')';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$query = ', ('.$SQLvalues.')';\r\n\t\t}\r\n\t}\r\n\treturn $query;\r\n}",
"private function formatInsertCommand( )\n {\n $data_buffer_length = @ count( $this->data_buffer );\n if ( $data_buffer_length == 0 )\n return false;\n\n $sql = 'INSERT INTO ' . $this->table_name . ' ';\n $sql_columns = '(';\n $sql_values = ' VALUE(';\n $this->quote( );\n $i = 0;\n foreach ( $this->data_buffer as $k => $v )\n {\n $sql_columns .= $k;\n $sql_values .= $v;\n if ( ( $i + 1 ) < $data_buffer_length )\n {\n $sql_columns .= ',';\n $sql_values .= ',';\n }\n $i++;\n }\n $sql_columns .= ')';\n $sql_values .= ')';\n $sql .= $sql_columns . $sql_values;\n return $sql;\n }",
"public function getBulkInsertQuery()\n {\n if (count($this->insertData) == 0) {\n return '';\n }\n foreach ($this->insertData as $key => $data) {\n $this->insertData[$key] = array_filter($data);\n }\n\n $firstElement = current($this->insertData);\n $insertDataKeys = array_map('pg_escape_string', array_keys($firstElement));\n $inserts = [];\n foreach ($this->insertData as $data) {\n $insertDataValues = array_map('pg_escape_string', array_values($data));\n $inserts[] = ' (\\'' . implode('\\',\\'', $insertDataValues) . '\\')';\n }\n $queryStr = 'INSERT INTO ' . $this->table\n . '(\\'' . implode(',', $insertDataKeys) . '\\')'\n . ' VALUES '.implode(',', $inserts);\n return $queryStr;\n }",
"private function createInsertSQL()\n {\n $field_data = \"\";\n foreach($this->db_fields as $field){\n $field_data .= \"`{$field}`,\";\n }\n $field_data = substr($field_data, 0, -1);\n\n $value_data = \"\";\n foreach($this->db_values as $val){\n $value_data .= \"{$this->db_con->quote($val)},\";\n }\n $value_data = substr($value_data, 0, -1);\n\n return \"INSERT INTO `{$this->db_table}` ({$field_data}) VALUES({$value_data})\";\n }",
"private function _arrayToSQLstring(array $myParametersArray)\n {\n $sql = 'INSERT INTO tAssignments (';\n $sqlValues = ') VALUES (';\n foreach ($myParametersArray as $key => $value) {\n $sql = $sql.$key.', ';\n $sqlValues = $sqlValues.\"'\".$value.\"', \";\n }\n\n $sql = trim($sql);\n $sql = rtrim($sql, ',');\n $sqlValues = trim($sqlValues);\n $sqlValues = rtrim($sqlValues, ',');\n $sql = $sql.$sqlValues;\n $sql = $sql.');';\n return $sql;\n\n }",
"function query_insert($table, $data_array){\n if(gettype($table) == \"string\" && gettype($data_array) == \"array\"){\n\n $i = 0;\n $array_len = count($data_array);\n $req_str = \"insert into \".$table;\n\n # In case the array is associative, add the list of attributes to the request\n if(is_array_assosiative($data_array)){\n $req_str = $req_str.\" (\";\n foreach ($data_array as $key => $value){\n $req_str = $req_str.$key;\n $i++;\n if($i < $array_len){\n $req_str = $req_str.\", \";\n }\n }\n $i = 0;\n $req_str = $req_str.\") \\n\";\n }\n\n # Add the list of data itself to the request\n $req_str = $req_str.\" values(\";\n foreach ($data_array as $key => $value){\n if (gettype($value) == \"string\"){\n $req_str = $req_str.\"'\".$value.\"'\";\n } else {\n $req_str = $req_str.$value;\n }\n\n $i++;\n if($i < $array_len){\n $req_str = $req_str.\", \";\n }\n }\n return $req_str.\")\";\n }\n else {\n return null;\n }\n }",
"public function insertArrayQuery() {\r\n $fields = $values = array();\r\n\r\n foreach ($this->data as $key => $val) {\r\n $fields[] = '`' . $key . '`';\r\n $values[] = '\\'' . call_user_func_array($this->escapeCallback, array($val)) . '\\'';\r\n }\r\n\r\n if ($this->encryptedData) {\r\n foreach ($this->encryptedData as $key => $val) {\r\n $fields[] = '`' . $key . '`';\r\n $values[] = $this->encryptionFunction . '(\\'' . call_user_func_array($this->escapeCallback, array($val)) . '\\')';\r\n }\r\n }\r\n\r\n $fields = implode(\",\", $fields);\r\n $values = implode(\",\", $values);\r\n\r\n $this->query = 'INSERT INTO `' . $this->table . '` (' . $fields . ') VALUES (' . $values . ')';\r\n }",
"function INSERTquery($table,$fields_values)\t{\n\n\t\t\t// Table and fieldnames should be \"SQL-injection-safe\" when supplied to this function (contrary to values in the arrays which may be insecure).\n\t\tif (is_array($fields_values) && count($fields_values))\t{\n\n\t\t\t\t// Add slashes old-school:\n\t\t\tforeach($fields_values as $k => $v)\t{\n\t\t\t\t$fields_values[$k] = $this->fullQuoteStr($fields_values[$k], $table);\n\t\t\t}\n\n\t\t\t\t// Build query:\n\t\t\t$query = 'INSERT INTO '.$table.'\n\t\t\t\t(\n\t\t\t\t\t'.implode(',\n\t\t\t\t\t',array_keys($fields_values)).'\n\t\t\t\t) VALUES (\n\t\t\t\t\t'.implode(',\n\t\t\t\t\t',$fields_values).'\n\t\t\t\t)';\n\n\t\t\t\t// Return query:\n\t\t\tif ($this->debugOutput || $this->store_lastBuiltQuery) $this->debug_lastBuiltQuery = $query;\n\t\t\treturn $query;\n\t\t}\n\t}",
"function query_insert_post_str($table, $requested_inputs, $post_arr, $type_inputs = null)\n\t{\n\t\t\n\t\t// Define in the query string the action and table\n\t\t$query = \"INSERT INTO `\" . $table . \"`\";\n\t\t\n\t\t// Create string elements and values to be inserted\n\t\t$query_params = \" (\";\n\t\t$query_values = \" (\";\n\t\t$separator = \"\";\n\t\t\n\t\tforeach ($requested_inputs as $element)\n\t\t{\n\t\t\tif (!strcmp($element['name'], \"password\"))\n\t\t\t{\n\t\t\t\t$query_params = $query_params . $separator . \"`password_hash`\";\n\t\t\t\t$query_values = $query_values . $separator . \"'\" . sha1($post_arr[$element['name']]) . \"'\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (!strcmp($element['type'], \"string\")) // We add the quotes around the value\n\t\t\t\t{\n\t\t\t\t\t$query_params = $query_params . $separator . \"`\" . $element['name'] . \"`\";\n\t\t\t\t\t$query_values = $query_values . $separator . \"'\" . $post_arr[$element['name']] . \"'\";\n\t\t\t\t}\n\t\t\t\telse if (!strcmp($element['type'], \"date\")) // We add the quotes around the value. It may be something different\n\t\t\t\t{\n\t\t\t\t\t$query_params = $query_params . $separator . \"`\" . $element['name'] . \"`\";\n\t\t\t\t\t$query_values = $query_values . $separator . \"'\" . $post_arr[$element['name']] . \"'\";\n\t\t\t\t}\n\t\t\t\telse if (!strcmp($element['type'], \"datetime\")) // We add the quotes around the value. It may be something different\n\t\t\t\t{\n\t\t\t\t\t$query_params = $query_params . $separator . \"`\" . $element['name'] . \"`\";\n\t\t\t\t\t$query_values = $query_values . $separator . \"'\" . $post_arr[$element['name']] . \"'\";\n\t\t\t\t}\n\t\t\t\telse if (!strcmp($element['type'], \"number\")) // We don't add the quotes around the value\n\t\t\t\t{\n\t\t\t\t\t$query_params = $query_params . $separator . \"`\" . $element['name'] . \"`\";\n\t\t\t\t\t$query_values = $query_values . $separator . $post_arr[$element['name']];\n\t\t\t\t}\n\t\t\t\telse // Treat it as a string\n\t\t\t\t{\n\t\t\t\t\t$query_params = $query_params . $separator . \"`\" . $element['name'] . \"`\";\n\t\t\t\t\t$query_values = $query_values . $separator . \"'\" . $post_arr[$element['name']] . \"'\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$separator = \", \";\n\t\t}\n\t\t$query_params = $query_params . \")\";\n\t\t$query_values = $query_values . \")\";\n\t\t\n\t\t// Put all the pieces together\n\t\t$query = $query . $query_params . \" VALUES\" . $query_values;\n\t\t\n\t\treturn $query;\n\t}",
"function dbPerform($table, $fieldsArray, $specialFields, $condition=''){\r\n\t$link\t= dbConnect(DB_HOST, DB_USER, DB_PASS, DB_NAME);\r\n\t\r\n\t$action = ($condition==\"\" ? \"insert\" : \"update\");\r\n\r\n\tif($action==\"insert\")\r\n\t\t$query = _prepareInsertQuery($table, $fieldsArray, $specialFields,$link);\r\n\telse\r\n\t\t$query = _prepareUpdateQuery($table, $fieldsArray, $specialFields, $condition,$link);\r\n\treturn dbQuery($query);\r\n}",
"private function genInsertValuesString(array $values){\n\t\t$sql = '';\n\t\t$i = 0;\n\t\t$cnt = count($values);\n\t\tforeach($values as $val){\n\t\t\t$sql .= $this->prepareValue($val);\n\t\t\tif($i++ != $cnt-1) $sql .= ', ';\n\t\t}\n\t\treturn $sql;\n\t}",
"private function buildValues() {\n\t\t$sql = \"\";\n\t\tif (!empty($this->fields)) {\n\t\t\t$i=0;\n\t\t\t$fields = \"\";\n\t\t\t$values = \"\";\n\t\t\tforeach ($this->fields as $field => $value) {\n\t\t\t\t$fields .= ($i > 0 ? \", \" : \"\") . $this->escapeField($field);\n\t\t\t\t$values .= ($i > 0 ? \", \" : \"\");\n\t\t\t\t\n\t\t\t\tif (is_array($value)) {\n\t\t\t\t\tif (isset($value['bind_value']) && $value['bind_value'] === false)\n\t\t\t\t\t\t$values .= (isset($value['escape']) && $value['escape'] ? $this->escapeField($value['value']) : $value['value']);\n\t\t\t\t\telse {\n\t\t\t\t\t\t$values .= \"?\";\n\t\t\t\t\t\t$this->values[] = $value['value'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$values .= \"?\";\n\t\t\t\t\t$this->values[] = $value;\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t\n\t\t\t$sql .= \" (\" . $fields . \") VALUES (\" . $values . \")\";\n\t\t}\n\t\t\n\t\treturn $sql;\n\t}",
"function prepareInsertQuery($tableName, $array) {\n\t$statement = \"INSERT INTO \" . $tableName . \" (\";\n\t// Fill up query with the column name array\n\tforeach($array as $val) {\n\t\t$statement .= \"$val, \";\n\t}\n\t$statement = substr($statement, 0, -2) . \")\"; // Remove last lingering comma and end segment\n\t$statement .= \" VALUES (\";\n\t// Fill values with :name\n\tforeach($array as $val) {\n\t\t$statement .= \"?, \";\n\t}\n\t$statement = substr($statement, 0, -2) . \")\"; // Remove last lingering comma and finish statement\n\treturn $statement;\n}",
"protected function build_insert() {\n\t\t$query = [];\n\t\t$query[] = 'INSERT INTO';\n\t\t$query[] = $this->quote_identifier( $this->table_name );\n\t\t$field_list = \\array_map( [ $this, 'quote_identifier' ], \\array_keys( $this->dirty_fields ) );\n\t\t$query[] = '(' . \\join( ', ', $field_list ) . ')';\n\t\t$query[] = 'VALUES';\n\t\t$placeholders = $this->create_placeholders( $this->dirty_fields );\n\t\t$query[] = \"({$placeholders})\";\n\n\t\treturn \\join( ' ', $query );\n\t}",
"private function buildInsert(){\n if ($this->action !== self::INSERT || $this->columns->size() !== $this->values->size()) die (\"query is not Insert or number of columns != number of values\");\n $query = 'INSERT INTO '.$this->table;\n if ($this->columns->size() > 0){\n $query .= ' ('.Arrays::merge($this->columns->getAll(),',').')';\n }\n $query .= ' VALUES ('.Arrays::merge($this->values->getAll(),',').');';\n return $query;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Accepts a file upload. Returns true on success, false on failure (or no upload). Only accepts jpg, png, gif, swf and webm (for now). NOTE: Caller is responsible for deleting the temp file! | function accept_file_upload(&$tmp_path, $max_size = MAX_FILE_SIZE) {
// NOTE: Code modelled after http://php.net/manual/en/features.file-upload.php
if (!isset($_FILES['file']['error']) || is_array($_FILES['file']['error'])) {
return false;
}
switch ($_FILES['file']['error']) {
case UPLOAD_ERR_OK:
break;
case UPLOAD_ERR_NO_FILE:
case UPLOAD_ERR_INI_SIZE:
case UPLOAD_ERR_FORM_SIZE:
default:
return false;
}
if ($_FILES['file']['size'] > $max_size) {
return false;
}
$finfo = new finfo(FILEINFO_MIME_TYPE);
$ext = array_search(
$finfo->file($_FILES['file']['tmp_name']),
array(
'jpg' => 'image/jpeg',
'png' => 'image/png',
'gif' => 'image/gif',
'swf' => 'application/x-shockwave-flash',
'webm' => 'video/webm',
),
true);
if ($ext === FALSE) {
return false;
}
mkdirs("/uploads/temp/");
$file_path = sprintf(SITE_ROOT."uploads/temp/%s.%s", md5_file($_FILES['file']['tmp_name']), $ext);
if (!move_uploaded_file($_FILES['file']['tmp_name'], $file_path)) return false;
$tmp_path = $file_path;
return true;
} | [
"public function upload(): bool {\n if ($this->fileToUpload['error'] === 0 && $this->isAllowedMimeType($this->fileToUpload['type'])) {\n $tmp_name = $this->fileToUpload[\"tmp_name\"];\n $this->finalName = $this->getRandomName($this->fileToUpload[\"name\"]);\n return move_uploaded_file($tmp_name, $_SERVER['DOCUMENT_ROOT'] . $this->destination . $this->finalName);\n }\n\n return false;\n }",
"public function handleUpload() {\n\n\t\t/** @var $uploadedFile UploadedFileInterface */\n\t\t$uploadedFile = FALSE;\n\t\tif ($this->formUtility->isMultiparted()) {\n\n\t\t\t// Default case\n\t\t\t$uploadedFile = GeneralUtility::makeInstance('Fab\\Media\\FileUpload\\MultipartedFile');\n\t\t} elseif ($this->formUtility->isOctetStreamed()) {\n\n\t\t\t// Fine Upload plugin would use it if forceEncoded = false and paramsInBody = false\n\t\t\t$uploadedFile = GeneralUtility::makeInstance('Fab\\Media\\FileUpload\\StreamedFile');\n\t\t} elseif ($this->formUtility->isUrlEncoded()) {\n\n\t\t\t// Used for image resizing in BE\n\t\t\t$uploadedFile = GeneralUtility::makeInstance('Fab\\Media\\FileUpload\\Base64File');\n\t\t}\n\n\t\tif (!$uploadedFile) {\n\t\t\t$this->throwException('Could not instantiate an upload object... No file was uploaded?');\n\t\t}\n\n\t\t$fileName = $this->getFileName($uploadedFile);\n\n\t\t$this->checkFileSize($uploadedFile->getSize());\n\t\t$this->checkFileAllowed($fileName);\n\n\t\t$saved = $uploadedFile->setInputName($this->inputName)\n\t\t\t->setUploadFolder($this->uploadFolder)\n\t\t\t->setName($fileName)\n\t\t\t->save();\n\n\t\tif (!$saved) {\n\t\t\t$this->throwException('Could not save uploaded file. The upload was cancelled, or server error encountered');\n\t\t}\n\n\t\t// Optimize file if the uploaded file is an image.\n\t\tif ($uploadedFile->getType() == \\TYPO3\\CMS\\Core\\Resource\\File::FILETYPE_IMAGE) {\n\t\t\t$uploadedFile = ImageOptimizer::getInstance($this->storage)->optimize($uploadedFile);\n\t\t}\n\t\treturn $uploadedFile;\n\t}",
"function upload($filename = '', $accept_type = '', $extention = '') {\r\n\t\tif (!$filename || $filename == \"none\") {\r\n\t\t\t$this->errors[0] = \"No file was uploaded\";\r\n\t\t\t$this->accepted = false;\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Copy PHP's global $_FILES array to a local array\r\n\t\t$this->file = $_FILES[$filename];\t\t\r\t\t//$this->file['file'] = $filename;\r\t\t\r\t\tif (!$this->file) {\r\t\t\t$this->file = $_POST[$filename];\t\t\t\r\t\t} \t\t\r\t\t\r\t\tAddError(0,\"Info :tmp is \" . $this->file['tmp_name']);\r\r\t\tif (!$this->file) {\r\n\t\t\tAddError(__FILE__ . __LINE__ , \"W: no llega el fichero!\");\r\n\t\t} else\r\n\t\t\tAddError(__FILE__ . __LINE__ , \"Info: algo llega\");\r\n\r\n\t\t// test max size\r\n\t\tif ($this->max_filesize && ($this->file[\"size\"] > $this->max_filesize)) {\r\t\t\tAddError(__FILE__ . __LINE__ , \"Info: tamaño no permitido\");\r\n\t\t\t$this->errors[1] = \"Maximum file size exceeded. File may be no larger than \".($this->max_filesize / 1000).\"KB (\".$this->max_filesize.\" bytes).\";\r\n\t\t\t$this->accepted = false;\r\n\t\t\treturn false;\r\n\t\t}\r\t\t\r\t\t\r\n\r\n\t\tif (ereg(\"image\", $this->file[\"type\"])) {\r\n\r\n\t\t\t/* IMAGES */\r\n\r\n\t\t\t$image = getimagesize($this->file[\"tmp_name\"]);\r\n\t\t\t$this->file[\"width\"] = $image[0];\r\n\t\t\t$this->file[\"height\"] = $image[1];\r\n\r\n\t\t\t// test max image size\r\n\t\t\tif (($this->max_image_width || $this->max_image_height) && (($this->file[\"width\"] > $this->max_image_width) || ($this->file[\"height\"] > $this->max_image_height))) {\r\n\t\t\t\t$this->errors[2] = \"Maximum image size exceeded. Image may be no more than \".$this->max_image_width.\" x \".$this->max_image_height.\" pixels\";\r\n\t\t\t\t$this->accepted = false;\r\n\t\t\t\t\r\t\t\t\tAddError(__FILE__ . __LINE__ , \"W: tamaño de imagen ilegal\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t// Image Type is returned from getimagesize() function\r\n\t\t\tswitch ($image[2]) {\r\n\t\t\t\tcase 1 :\r\n\t\t\t\t\t$this->file[\"extention\"] = \".gif\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2 :\r\n\t\t\t\t\t$this->file[\"extention\"] = \".jpg\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3 :\r\n\t\t\t\t\t$this->file[\"extention\"] = \".png\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 4 :\r\n\t\t\t\t\t$this->file[\"extention\"] = \".swf\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 5 :\r\n\t\t\t\t\t$this->file[\"extention\"] = \".psd\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 6 :\r\n\t\t\t\t\t$this->file[\"extention\"] = \".bmp\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 7 :\r\n\t\t\t\t\t$this->file[\"extention\"] = \".tif\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 8 :\r\n\t\t\t\t\t$this->file[\"extention\"] = \".tif\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault :\r\n\t\t\t\t\t$this->file[\"extention\"] = $extention;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\telseif (!ereg(\"(\\.)([a-z0-9]{3,5})$\", $this->file[\"name\"]) && !$extention) {\r\n\t\t\t// Try and autmatically figure out the file type\r\n\t\t\t// For more on mime-types: http://httpd.apache.org/docs/mod/mod_mime_magic.html\r\n\t\t\tswitch ($this->file[\"type\"]) {\r\n\t\t\t\tcase \"text/plain\" :\r\n\t\t\t\t\t$this->file[\"extention\"] = \".txt\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"text/richtext\" :\r\n\t\t\t\t\t$this->file[\"extention\"] = \".txt\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault :\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->file[\"extention\"] = $extention;\r\n\t\t}\r\n\r\n\t\t\r\t\tAddError(__FILE__ . __LINE__ , \"Info: extension: '\" . $this->file[\"extention\"] . \"' , file: '\". $this->file['file'].\"'\");\r\n\r\n\t\t// check to see if the file is of type specified\r\n\t\tif ($accept_type) {\r\n\t\t\tif (ereg(strtolower($accept_type), strtolower($this->file[\"type\"]))) {\r\n\t\t\t\t$this->accepted = TRUE;\r\n\t\t\t} else {\r\n\t\t\t\t$this->accepted = FALSE;\r\n\t\t\t\t$this->errors[3] = \"Only \".ereg_replace(\"\\|\", \" or \", $accept_type).\" files may be uploaded\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->accepted = TRUE;\r\n\t\t}\r\n\t\t\r\n\t\tAddError(__FILE__ . __LINE__ , \"Info: raw_name: '\" . $this->file[\"raw_name\"] . \"' , filename: '\". $this->file['filename'].\"'\");\r\t\t\r\n\t\treturn $this->accepted;\r\n\t}",
"function isUploaded()\n\t{\n\t\t$temp = $this->tempLocation;\n\t\tif (@is_uploaded_file($temp)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$this->setErrorMessage(UPLOAD_ERROR_NOFILE);\n\t\t\treturn false;\n\t\t}\n\t}",
"function upload($filename='', $accept_type='', $extention='') {\n \n $this->acceptable_file_types = trim($accept_type); // used by error messages\n \n if (!isset($_FILES) || !is_array($_FILES[$filename]) || !$_FILES[$filename]['name']) {\n $this->error = $this->get_error(0);\n $this->accepted = FALSE;\n return FALSE;\n }\n \n // Copy PHP's global $_FILES array to a local array\n $this->file = $_FILES[$filename];\n $this->file['file'] = $filename;\n \n // Initialize empty array elements\n if (!isset($this->file['extention'])) $this->file['extention'] = \"\";\n if (!isset($this->file['type'])) $this->file['type'] = \"\";\n if (!isset($this->file['size'])) $this->file['size'] = \"\";\n if (!isset($this->file['width'])) $this->file['width'] = \"\";\n if (!isset($this->file['height'])) $this->file['height'] = \"\";\n if (!isset($this->file['tmp_name'])) $this->file['tmp_name'] = \"\";\n if (!isset($this->file['raw_name'])) $this->file['raw_name'] = \"\";\n \n // test max size\n if($this->max_filesize && ($this->file[\"size\"] > $this->max_filesize)) {\n $this->error = $this->get_error(1);\n $this->accepted = FALSE;\n return FALSE;\n }\n \n if(stristr($this->file[\"type\"], \"image\")) {\n \n /* IMAGES */\n $image = getimagesize($this->file[\"tmp_name\"]);\n $this->file[\"width\"] = $image[0];\n $this->file[\"height\"] = $image[1];\n \n // test max image size\n if(($this->max_image_width || $this->max_image_height) && (($this->file[\"width\"] > $this->max_image_width) || ($this->file[\"height\"] > $this->max_image_height))) {\n $this->error = $this->get_error(2);\n $this->accepted = FALSE;\n return FALSE;\n }\n // Image Type is returned from getimagesize() function\n switch($image[2]) {\n case 1:\n $this->file[\"extention\"] = \".gif\"; break;\n case 2:\n $this->file[\"extention\"] = \".jpg\"; break;\n case 3:\n $this->file[\"extention\"] = \".png\"; break;\n case 4:\n $this->file[\"extention\"] = \".swf\"; break;\n case 5:\n $this->file[\"extention\"] = \".psd\"; break;\n case 6:\n $this->file[\"extention\"] = \".bmp\"; break;\n case 7:\n $this->file[\"extention\"] = \".tif\"; break;\n case 8:\n $this->file[\"extention\"] = \".tif\"; break;\n\t\t\t\t\t\t\t\tcase 2:\n $this->file[\"extention\"] = \".pdf\"; break;\n default:\n $this->file[\"extention\"] = $extention; break;\n }\n } elseif(!ereg(\"(\\.)([a-z0-9]{3,5})$\", $this->file[\"name\"]) && !$extention) {\n // Try and autmatically figure out the file type\n // For more on mime-types: http://httpd.apache.org/docs/mod/mod_mime_magic.html\n switch($this->file[\"type\"]) {\n case \"text/plain\":\n $this->file[\"extention\"] = \".txt\"; break;\n case \"text/richtext\":\n $this->file[\"extention\"] = \".txt\"; break;\n default:\n break;\n }\n } else {\n $this->file[\"extention\"] = $extention;\n }\n \n // check to see if the file is of type specified\n if($this->acceptable_file_types) {\n if(trim($this->file[\"type\"]) && (stristr($this->acceptable_file_types, $this->file[\"type\"]) || stristr($this->file[\"type\"], $this->acceptable_file_types)) ) {\n $this->accepted = TRUE;\n } else { \n $this->accepted = FALSE;\n $this->error = $this->get_error(3);\n }\n } else { \n $this->accepted = TRUE;\n }\n \n return (bool) $this->accepted;\n }",
"private function isFileUploaded() {\n if(!empty($_FILES[\"inputFile\"]) && ($_FILES[\"inputFile\"][\"error\"] == 0) ) {\n return true;\n }\n return false;\n }",
"abstract protected function validateUpload();",
"public function isUploadedFile()\n {\n return false;\n }",
"function checkFileType(){\r\n\r\n\tif (isset($_FILES['myFile']['tmp_name'])) {\r\n\r\n\t\t$finfo = finfo_open(FILEINFO_MIME_TYPE);\r\n\t\t$mime = finfo_file($finfo, $_FILES['myFile']['tmp_name']);\r\n\r\n\t\tif ($mime == 'text/plain') {\r\n\t\t\techo \"File is valid. MIME type:plain/text\";\r\n\t\t} else {\r\n\t\t\techo \"File is invalid\";\r\n\r\n\t\t\t// Redirect back\r\n //echo \"<script> window.location.assign('../index.php?mainmenu=importFile'); </script>\";\r\n exit();\r\n\t\t}\r\n\r\n\t\tfinfo_close($finfo);\r\n\t}\r\n}",
"public function uploadAllowed() {\n return $this->validateFileType() && $this->validateExtension();\n }",
"public function isAllowUserUpload();",
"function validateUpload()\n\t{\n\t\t$db = &singleton('database');\n\t\t$tpl = &singleton('template');\n\t\t\n\t\tif(!isset($this->files['upload'])) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$file = &$this->files['upload'];\n\t\t$isError = false;\n\t\t$errors = array();\n\t\t\n\t\tif($file['error'] != UPLOAD_ERR_OK) { // Upload error ...\n\t\t\tif($file['error'] == UPLOAD_ERR_INI_SIZE || $file['error'] == UPLOAD_ERR_FORM_SIZE) {\n\t\t\t\t$isError = true;\n\t\t\t\t$errors[] = $this->lang['uploads_err_big_file'];\n\t\t\t} elseif($file['error'] == UPLOAD_ERR_PARTIAL) {\n\t\t\t\t$isError = true;\n\t\t\t\t$errors[] = $this->lang['uploads_err_partial'];\n\t\t\t} elseif($file['error'] == UPLOAD_ERR_NO_FILE || !is_uploaded_file($file['name'])) {\n\t\t\t\t$isError = true;\n\t\t\t\t$errors[] = $this->lang['uploads_err_no_file'];\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($file['size'] > ($this->cfg['upload_max_size'] * 1024)) { // File is too big ...\n\t\t\t$isError = true;\n\t\t\t$errors[] = $this->lang['uploads_err_big_file'];\n\t\t}\n\t\t\n\t\tif($file['size'] == 0) { // No file uploaded, zero-sized file ...\n\t\t\t$isError = true;\n\t\t\t$errors[] = $this->lang['uploads_err_no_file'];;\n\t\t}\n\t\t\n\t\t$file['ext'] = preg_replace('/^.+?\\.(?=[A-Za-z0-9]+$)/', '', $file['name']);\n\t\t$file['local'] = sha1($file['name']);\n\t\t\t\t\n\t\t// Now validate user name and file description.\n\t\tif(!in_array($file['ext'], $this->uploadFileTypes)) {\n\t\t\t$isError = true;\n\t\t\t$errors[] = $this->lang['uploads_err_type'];\n\t\t}\n\t\t\n\t\tif($this->loggedIn) {\n\t\t\t$this->fileUserId = $this->user['user_id'];\n\t\t\t$this->fileUserName = '';\n\t\t} else {\n\t\t\t$this->fileUserId = 0;\n\t\t\t$this->fileUserName = isset($this->post['upload_user']) ? trim($this->post['upload_user']) : '';\n\t\t\t\n\t\t\tif($this->fileUserName != '' && is_array($this->getUser($this->fileUserName, true))) {\n\t\t\t\t$errors[] = $this->lang['edit_username_taken'];\n\t\t\t\t$isError = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->fileDesc = isset($this->post['upload_desc']) ? substr(trim($this->post['upload_desc']), 0, 255) : '';\n\t\t\n\t\t/**\n\t\t * Checks if an uploaded file already exists. Displays\n\t\t * the confirmation dialog if we got a file conflict.\n\t\t */\n\t\t$result = $db->query('SELECT * FROM '.DB_PREFIX.'uploads WHERE file_orig_name = \"'.addslashes($file['name']).'\"');\n\t\t\n\t\tif($db->numRows($result) > 0 && !$this->fileConfirm) {\n\t\t\tif(!move_uploaded_file($file['tmp_name'], $this->cfg['doc_root'].'/uploads/tmp/'.$file['local'])) {\n\t\t\t\t$isError = true;\n\t\t\t\t$errors[] = $this->lang['uploads_err_move'];\n\t\t\t} else {\n\t\t\t\t$tpl->assign('fileLocalName', $file['local']);\n\t\t\t\t$tpl->assign('fileName', $file['name']);\n\t\t\t\t$tpl->assign('fileUser', htmlentities($this->fileUserName));\n\t\t\t\t$tpl->assign('fileDesc', htmlentities($this->fileDesc));\n\t\t\t\t\n\t\t\t\t$this->uploadTemplate = 'special_uploads_confirm.tpl';\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif($db->numRows($result) > 0) {\n\t\t\t$row = $db->fetch($result);\n\t\t\t$this->fileData = $row;\n\t\t}\n\t\t\n\t\tif($isError) {\n\t\t\t$tpl->assign('valUploadDesc', htmlentities($this->fileDesc));\n\t\t\t$tpl->assign('valUploadUser', htmlentities($this->fileUserName));\n\t\t\t\n\t\t\tif($this->loggedIn) {\n\t\t\t\t$tpl->assign('valUploadUser', htmlentities($this->user['user_name']));\n\t\t\t}\n\t\t\t\n\t\t\t$this->uploadError = $errors;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function do_upload() {\n\n if (!$this->upload->do_upload()) {\n\n return false;\n } else {\n //$data = array('upload_data' => $this->upload->data());\n\n return true;\n }\n }",
"public function isUpload()\n {\n return $_POST['extUpload'] == 'false' ? false : true;\n }",
"function is_file_valid($file) {\n // Check #1 - Check that the file exists\n if (!file_exists($file['tmp_name'])) {\n // Validation failed - file not uploaded. Display error message\n return \"No file has been uploaded. Try again.<br>\";\n }\n // Check #2 - Validate that the file type is a text file with .txt extension\n elseif ($file['type'] != \"text/plain\") {\n // Validation failed - file not txt. Display error message\n return \"Only files with .txt extension are accepted.<br>\";\n }\n // Return empty string indicating no errors on validation success\n return \"\";\n}",
"abstract public function canUpload();",
"public function isUploaded();",
"function isUpload()\n {\n return ($this->type->getTypeName() == 'file');\n }",
"public function testFile() {\n $this->assertTrue(Validate::file(array(\n 'name' => 'file1.jpg',\n 'type' => 'image/jpeg',\n 'tmp_name' => '/tmp/phpUkYTB5',\n 'error' => 0,\n 'size' => 307808\n )));\n\n $this->assertFalse(Validate::file('file1.jpg'));\n $this->assertFalse(Validate::file(array(\n 'name' => 'file1.jpg',\n 'type' => 'image/jpeg',\n 'tmp_name' => '/tmp/phpUkYTB5',\n 'error' => UPLOAD_ERR_CANT_WRITE,\n 'size' => 307808\n )));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Use this function to be able to make a post request. This function takes 3 parameters url: your api url endpoint data: body of data you are post should be in JSON format. api_key: Access token if required for the endpoint you are posting to if your api endpoint do not require this, you can edit this and make it suitable for you. | public function post_to_api_by_curl($url, $data, $api_key)
{
$ch = curl_init($url);
// Setup request to send json via POST.
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json', 'Authorization:' . $api_key));
// Return response instead of printing.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Send request.
$result = curl_exec($ch);
curl_close($ch);
// Print response.
return $result;
} | [
"function kappaApiPost($url, $data) {\n $APISettings = \\Tohur\\SocialConnect\\Models\\Apisettings::instance()->get('api', []);\n if (!strlen($APISettings['Streamelements']['streamelementskey']))\n throw new ApplicationException('Streamelements API access is not configured. Please configure it on the API Settings page.');\n $token = $APISettings['Streamelements']['streamelementskey'];\n $Postdata = $data;\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n curl_setopt($ch, CURLOPT_POSTFIELDS, $Postdata);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Authorization: Bearer ' . $token,\n 'Accept: application/json',\n 'Content-Type: text/plain'\n ));\n curl_exec($ch);\n curl_close($ch);\n }",
"function postDataToUrl($url, $data) {\r\n $curl = curl_init();\r\n curl_setopt($curl, CURLOPT_URL, $url);\r\n curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 1);\r\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($curl, CURLOPT_VERBOSE, 0);\r\n curl_setopt($curl, CURLOPT_HEADER, 1);\r\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));\r\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\r\n $response = curl_exec ($curl);\r\n curl_close ($curl);\r\n\treturn $response;\r\n}",
"private function _URLPost($url, $data_array) {\n // Need to encode spaces, otherwise services such\n // as Google will return 400 bad request!\n $url = str_replace(\" \", \"%20\", $url);\n\n // Construct the contexts for the POST requests\n $opts = array(\n 'https'=>array(\n 'method'=>\"POST\",\n 'header'=>\n \"Accept: application/json, text/javascript, */*; q=0.01\\r\\n\".\n \"Content-type: application/x-www-form-urlencoded; charset=UTF-8\\r\\n\".\n \"User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36\\r\\n\".\n \"Referer: https://api.example.com/\\r\\n\",\n 'content' => http_build_query($data_array)\n )\n ,\n 'http'=>array(\n 'method'=>\"POST\",\n 'header'=>\n \"Accept: application/json, text/javascript, */*; q=0.01\\r\\n\".\n \"Content-type: application/x-www-form-urlencoded; charset=UTF-8\\r\\n\".\n \"User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36\\r\\n\".\n \"Referer: https://api.example.com/\\r\\n\",\n 'content' => http_build_query($data_array)\n )\n );\n\n $context = stream_context_create($opts);\n $result = null;\n $dh = fopen(\"$url\",'rb', false, $context);\n if( !$dh )\n return null;\n\n if( $dh !== false )\n $result = stream_get_contents($dh);\n\n fclose($dh);\n\n return $result;\n }",
"function postRequest($url, $post_data) {\n if (!function_exists('curl_init')) {\n error_log('Curl is not enabled.');\n return 'error: curl is not enabled.';\n }\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n $result = curl_exec($ch);\n curl_close($ch);\n\n return $result;\n}",
"function __apiCall($url, $post_parameters = FALSE) {\n \n \t// Initialize the cURL session\n\t $curl_session = curl_init();\n\t \t\n\t // Set the URL of api call\n\t\tcurl_setopt($curl_session, CURLOPT_URL, $url);\n\t\t \n\t\t// If there are post fields add them to the call\n\t\tif($post_parameters !== FALSE) {\n\t\t\tcurl_setopt ($curl_session, CURLOPT_POSTFIELDS, $post_parameters);\n\t\t}\n\t\t \n\t\t// Return the curl results to a variable\n\t curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, 1);\n\t\t \n\t // Execute the cURL session\n\t $contents = curl_exec ($curl_session);\n\t\t \n\t\t// Close cURL session\n\t\tcurl_close ($curl_session);\n\t\t \n\t\t// Return the response\n\t\treturn json_decode($contents);\n \n }",
"function callAPIWithAPIKeyGuzzlePOST($method, $url, $bodydata)\n{\n $client = new Client();\n\n $response = $client->request(\n $method,\n $url,\n [\n 'headers' => [\n 'Content-Type' => 'application/json',\n 'Accept' => 'application/json',\n 'api-key' => API_KEY,\n ],\n 'json' => $bodydata\n ]\n );\n\n\n return json_decode($response->getBody(), true);\n}",
"function post($url,$data){\n\tglobal $proxy;\n\tglobal $port;\n\t$post_string=\"\";\n\tforeach($data as $key=>$value) { $post_string .= $key.'='.$value.'&'; }\n\trtrim($post_string,'&');\n \t$ch = curl_init(); \n \tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch,CURLOPT_POST,count($data));\n\t//Required for proxy\n\tcurl_setopt($ch,CURLOPT_PROXYPORT,$port);\n\tcurl_setopt($ch, CURLOPT_PROXY, $proxy);\n\t\n\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$post_string); \n \tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n \t$output = curl_exec($ch); \n \tcurl_close($ch);\n \treturn $output;\n }",
"function post2api($data, $url, $type) { \n\n switch ($type) {\n case \"json\": $postData = json_encode($data);\n $contentType = \"application/json\";\n \t\tbreak;\n case \"yaml\": $postData = Spyc::YAMLDump($data);\n\t\t $contentType = \"text/yaml\";\n\t\tbreak;\n }\n\n // Setup cURL\n\n $ch = curl_init($url);\n curl_setopt_array($ch, array(\n CURLOPT_POST => TRUE,\n CURLOPT_RETURNTRANSFER => TRUE,\n CURLOPT_HTTPHEADER => array(\n 'Content-Type: $contentType'\n ),\n CURLOPT_POSTFIELDS => $postData\n ));\n \n // Send the request\n $response = curl_exec($ch);\n \n // Check for errors\n if($response === FALSE){\n die(curl_error($ch));\n }\n\n // Return the data from the response\n return ($response);\n}",
"public function post(string $url, array $values = []): string;",
"public function postJSON($url, $body);",
"public function curlApi($url,$fields)\n {\n\n try\n {\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,$url);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //to suppress the curl output\n $result = curl_exec($ch);\n curl_close ($ch);\n\n return $result;\n }\n catch (FacebookApiException $e)\n {\n //print_r($_REQUEST);\n echo \"<pre>\";\n print_r($e);\n }\n }",
"public static function post( $url, $post, $token = null )\n\t{\n\t\treturn self::http( 'POST', $url, $post, $token );\n\t}",
"public function PostRequest($url, $headers, $params, $callback, $state) {\r\n\t\t\t\t$data = http_build_query($params);\r\n\t\t\t\t\r\n\t\t\t\t$conn = curl_init($url);\r\n\t\t\t\tcurl_setopt($conn, CURLOPT_RETURNTRANSFER, true);\r\n\t\t\t\tcurl_setopt($conn, CURLOPT_CUSTOMREQUEST, \"POST\");\r\n\t\t\t\t\r\n\t\t\t\tcurl_setopt($conn, CURLOPT_POSTFIELDS, $data);\r\n\t\t\t\tcurl_setopt($conn, CURLOPT_HTTPHEADER, $headers);\r\n\t\t\t\t\r\n\t\t\t\t$response = curl_exec($conn);\r\n\t\t\t\tif($callback !== NULL)\r\n\t\t\t\t\t$callback($response, $state);\r\n\t\t\t}",
"function sendReceiveJSONPOST($url,$data) {\r\n $data = http_build_query($data);\r\n $options = array(\r\n 'http' => array(\r\n 'method' => 'POST',\r\n 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\".\"Content-Length: \" . strlen($data) . \"\\r\\n\",\r\n 'content' => $data\r\n \r\n )\r\n );\r\n\r\n $context = stream_context_create( $options );\r\n $result = file_get_contents('http://localhost/finalProject471/website/'.$url, false, $context );\r\n $response = json_decode( $result, true );\r\n return $response;\r\n }",
"function doPost($url) {\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t// receive server response\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$response = curl_exec ($ch);\n\t\tcurl_close ($ch);\n\t\treturn $response;\n\t}",
"public function test_api_post_tokens() {\n $api_service = new Disqus_Api_Service( 'APISECRETKEY', 'ACCESSTOKEN' );\n\n $api_data = $api_service->api_post( 'forums/update', array() );\n\n $this->assertNotFalse( strpos( $api_data->response->url, 'forums/update.json' ) );\n $this->assertNotFalse( strpos( $api_data->response->url, 'api_secret=APISECRETKEY' ) );\n $this->assertNotFalse( strpos( $api_data->response->url, 'access_token=ACCESSTOKEN' ) );\n }",
"public function sendRequest()\n {\n if ($this->verbosity) echo \"- sendRequest -\\n\\r\";\n\n if ($this->url == \"\") throw new Exception(\"Invalid URL\");\n\n $ch = curl_init($this->url);\n $apiParams['url'] = $this->url;\n $apiParams['api_version'] = $this->getVersion();\n $apiParams['api_id'] = $this->getId();\n $this->setTimestamp();\n $apiParams['api_timestamp'] = $this->getTimestamp();\n\n // Sign request\n if (isset($this->params) && is_array($this->params) && count($this->params) > 0) {\n $this->setSignature(array_merge($apiParams, $this->params));\n } else {\n $this->setSignature($apiParams);\n }\n $apiParams['api_signature'] = $this->getSignature();\n\n if (isset($this->params) && is_array($this->params) && count($this->params) > 0) {\n $payload = json_encode(array_merge($apiParams, $this->params));\n } else {\n $payload = json_encode($apiParams);\n }\n\n curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));\n // Define the CURL_IGNORE_SSL_ERRORS constant if you want to skip SSL verification (not recommended)\n if (defined(\"CURL_IGNORE_SSL_ERRORS\") && CURL_IGNORE_SSL_ERRORS) {\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Skip verifying peer certificate/name\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // Skip verifying host certificate/name\n }\n\n # Return response instead of printing.\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n # Send request.\n $result = curl_exec($ch);\n $err = curl_error($ch);\n $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n if ($this->verbosity) echo \"- sendRequest Complete - Result: \" . $result . \" Error: \" . $err . \"\\n\\r\";\n if ($result === false) {\n $result = json_encode(['code' => 500, 'message' => $err]);\n } else if ($code != 200) {\n $result = json_encode(['code' => $code, 'message' => $result]);\n }\n\n return $result;\n }",
"function bpCurl($url, $apiKey, $post = false) {\n global $bpOptions;\n\n if((isset($url) && trim($url) != '') && (isset($apiKey) && trim($apiKey) != '')) {\n try {\n $curl = curl_init();\n $length = 0;\n\n if ($post) {\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $post);\n $length = strlen($post);\n }\n\n $uname = base64_encode($apiKey);\n\n if($uname) {\n $header = array(\n 'Content-Type: application/json',\n 'Content-Length: ' . $length,\n 'Authorization: Basic ' . $uname,\n 'X-BitPay-Plugin-Info: phplib1.6',\n );\n\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_PORT, 443);\n curl_setopt($curl, CURLOPT_HTTPHEADER, $header);\n curl_setopt($curl, CURLOPT_TIMEOUT, 10);\n curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ) ;\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 1); // verify certificate\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); // check existence of CN and verify that it matches hostname\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_FORBID_REUSE, 1);\n curl_setopt($curl, CURLOPT_FRESH_CONNECT, 1);\n\n $responseString = curl_exec($curl);\n\n if($responseString == false) {\n $response = array('error' => curl_error($curl));\n if($bpOptions['useLogging'])\n bpLog('Error: ' . curl_error($curl));\n } else {\n if(function_exists('json_decode'))\n $response = json_decode($responseString, true);\n else\n $response = bpJSONdecode($responseString);\n\n if (!$response) {\n $response = array('error' => 'invalid json');\n if($bpOptions['useLogging'])\n bpLog('Error - Invalid JSON.');\n }\n }\n\n curl_close($curl);\n return $response;\n } else {\n curl_close($curl);\n if($bpOptions['useLogging'])\n bpLog('Invalid data found in apiKey value passed to bpCurl. (Failed: base64_encode(apikey))');\n return array('error' => 'Invalid data found in apiKey value passed to bpCurl. (Failed: base64_encode(apikey))');\n }\n } catch (Exception $e) {\n @curl_close($curl);\n if($bpOptions['useLogging'])\n bpLog('Error: ' . $e->getMessage());\n return array('error' => $e->getMessage());\n }\n } else {\n // Invalid parameter specified\n if($bpOptions['useLogging'])\n bpLog('Error: You must supply non-empty url and apiKey parameters.');\n return array('error' => 'You must supply non-empty url and apiKey parameters.');\n }\n\n}",
"function postData() {\n //Post data to: https://webhook.site/d419ed99-5060-49c1-bff0-c699a4af5da4\n $url = \"https://webhook.site/d419ed99-5060-49c1-bff0-c699a4af5da4\";\n $curl = curl_init($url);\n\n $data = [\n \"first_name\" => $this->fname,\n \"email\" => $this->email,\n \"hex_id\" => $this->hexId\n ];\n\n #echo $this->fname;\n #echo $this->email;\n #echo $this->hexId;\n\n if($this->hasLname) {\n $data[\"last_name\"] = $this->lname;\n #echo $this->lname;\n }\n\n if($this->hasNumber) {\n $data[\"number\"] = $this->number;\n #echo $this->number;\n }\n\n //Posting data to the API endpoint\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));\n curl_setopt($curl, CURLOPT_HTTPHEADER, [\n \"APIKEY: 111111111111111111111111111\",\n \"Content-Type: application/json\",\n ]);\n\n //If posted correctly, response should = 1\n $response = curl_exec($curl);\n curl_close($curl);\n\n //Response should equal to 1 if post was completed\n return $response;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Asserts the number of elements of an array, \Countable or \Traversable that is stored in an attribute. | public function assertAttributeCount($expectedCount, $haystackAttributeName, $haystackClassOrObject) {
$this->callAssertMethod(__FUNCTION__, [
'expected' => $key,
]);
} | [
"public static function assertAttributeCount($expectedCount, $haystackAttributeName, $haystackClassOrObject, $message = '') {}",
"static function assertAttributeCount($expectedCount, $haystackAttributeName, $haystackClassOrObject, $message = '')\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::assertAttributeCount', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }",
"public function testAssertAtLeastNumElements(): void\n {\n $element = $this->createMock(NodeElement::class);\n\n $page = $this->createMock(DocumentElement::class);\n $page->expects($this->once())->method('findAll')->with($this->equalTo('css'), $this->equalTo('.foo'))->willReturn([$element, $element, $element]);\n\n $session = $this->createMock(Session::class);\n $session->expects($this->once())->method('getPage')->willReturn($page);\n\n $trait = $this->getExtraWebAssertMock();\n $trait->expects($this->once())->method('getSession')->willReturn($session);\n\n $trait->assertAtLeastNumElements(2, '.foo'); // @phpstan-ignore-line\n }",
"public function testGetAttributes()\n {\n $this->laracart->setAttribute('test1', 1);\n $this->laracart->setAttribute('test2', 2);\n\n $this->assertCount(2, $attributes = $this->laracart->getAttributes());\n\n $this->assertEquals(1, $attributes['test1']);\n $this->assertEquals(2, $attributes['test2']);\n }",
"function count() {\n return sizeof($this->_attributes);\n }",
"public function testGetAttribute()\n {\n $this->assertEquals(array('count'=>1, 'Bieber'), $this->object->getAttribute('bbieber2', 'sn'));\n }",
"public function count(): int {\n return count($this->attrs);\n }",
"public function testRuleIsLength(): void {\r\n\r\n //Should pass\r\n foreach(['12345', 12345] as $data) {\r\n\r\n $validator = new Validator(['field' => $data]);\r\n $validator -> field('field') -> isLength(5);\r\n $this -> assertTrue($validator -> passes());\r\n $this -> assertFalse($validator -> fails());\r\n }\r\n\r\n //Should fail\r\n foreach([null, (object) [], [], 'abcdef', true] as $data) {\r\n \r\n $validator = new Validator(['field' => $data]);\r\n $validator -> field('field') -> isLength(5);\r\n $this -> assertFalse($validator -> passes());\r\n }\r\n\r\n //Should fail\r\n $validator = new Validator();\r\n $validator -> field('field') -> isLength(5);\r\n $this -> assertFalse($validator -> passes());\r\n }",
"public function testCountable()\n {\n \\PHPUnit_Framework_Assert::assertInstanceOf(\\Countable::class, $this->complexMap);\n \\PHPUnit_Framework_Assert::assertCount(count($this->keys), $this->complexMap);\n \\PHPUnit_Framework_Assert::assertCount(count($this->values), $this->complexMap);\n }",
"public function testAssertAtLeastNumElementsNotEnough(): void\n {\n $element = $this->createMock(NodeElement::class);\n\n $page = $this->createMock(DocumentElement::class);\n $page->expects($this->once())->method('findAll')->with($this->equalTo('css'), $this->equalTo('.foo'))->willReturn($element);\n\n $session = $this->createMock(Session::class);\n $session->expects($this->once())->method('getPage')->willReturn($page);\n\n $trait = $this->getExtraWebAssertMock();\n $trait->expects($this->once())->method('getSession')->willReturn($session);\n\n $this->expectException(\\Exception::class);\n $this->expectExceptionMessage(\"1 \\\".foo\\\" found on the page, but should at least 2.\");\n\n $trait->assertAtLeastNumElements(2, '.foo'); // @phpstan-ignore-line\n }",
"public function testCount()\n {\n $myArray = new BasicArray();\n $myArray->push('one');\n $this->assertEquals(1, count($myArray));\n }",
"public function testIterate() {\n $attribute = new Attribute(['class' => ['example-class'], 'id' => 'example-id']);\n\n $counter = 0;\n foreach ($attribute as $key => $value) {\n if ($counter == 0) {\n $this->assertEquals('class', $key);\n $this->assertEquals(new AttributeArray('class', ['example-class']), $value);\n }\n if ($counter == 1) {\n $this->assertEquals('id', $key);\n $this->assertEquals(new AttributeString('id', 'example-id'), $value);\n }\n $counter++;\n }\n }",
"public function count()\n {\n return count($this->attributes);\n }",
"public function count(): int\n {\n\n return \\count( $this->_attributes );\n\n }",
"public function testConstructAssociative()\n {\n $collection = new BaseCollection(['a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5]);\n\n $this->assertAttributeInternalType('array', 'elements', $collection);\n $this->assertAttributeNotEmpty('elements', $collection);\n $this->assertAttributeCount(5, 'elements', $collection);\n $this->assertAttributeEquals(['a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5], 'elements', $collection);\n }",
"public function testAssertTraversable() {\n $this->assertTrue(Inspector::assertTraversable([]));\n $this->assertTrue(Inspector::assertTraversable(new \\ArrayObject()));\n $this->assertFalse(Inspector::assertTraversable(new \\stdClass()));\n $this->assertFalse(Inspector::assertTraversable('foo'));\n }",
"public function count()\n {\n return count($this->_attribs);\n }",
"public function countNodeArrayValue(): int\n {\n return count($this->nodeValue);\n }",
"public function testSize():void{\n\t\t$this::assertCount($this->matrix->getSize(), $this->matrix->getMatrix(true));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A player has many cards | public function cards()
{
return $this->hasMany(Card::class, 'player_id');
} | [
"public function cards()\n {\n return $this->hasMany('App\\Card');\n }",
"public function players() {\n \treturn $this->hasMany('App\\Player');\n }",
"public function cards()\n {\n return $this->hasMany(Card::class, 'vendor_id');\n }",
"public function players()\n {\n return $this->hasMany(Player::class);\n }",
"public function addCardToPlayer(){\n $newDeck = $this->addCard(json_decode($this->player_deck));\n $this->player_deck = $newDeck;\n $this->save();\n }",
"public function players()\n {\n return $this->hasMany('App\\Models\\Player','team_id', 'team_id');\n }",
"public function getCards()\n {\n return $this->hasMany(Cards::className(), ['cardtype_id' => 'id']);\n }",
"public function card()\n {\n return $this->belongsTo(Card::class);\n }",
"public function card(){\n\t\treturn $this->hasMany('App\\card','mtgset_id','id');\n\t}",
"public function player(){\n return $this->belongsTo('App\\Models\\player');\n }",
"public function collectPerPlayerCard()\n {\n return $this->hasOne(CollectPerPlayerCard::class);\n }",
"public function distributeCards(){\n $this->distributeCardsToPlayers();\n $this->distributeCardsToPlayers();\n $this->distributeCard($this->getTable());\n $this->distributeCard($this->getTable());\n $this->distributeCard($this->getTable());\n }",
"public function dealCards(): void\n {\n foreach ($this->players as $player) {\n $playerCardsCount = $player->getCards()->count();\n $neededCountForDealing = 2 - $playerCardsCount;\n if ($neededCountForDealing > 0) {\n $cards = $this->deckOfCards->dealRandomCards($neededCountForDealing);\n foreach ($cards as $card) {\n $player->addCard($card);\n }\n }\n }\n\n $tableCardsCount = $this->getCards()->count();\n $neededCountForDealing = 5 - $tableCardsCount;\n if ($neededCountForDealing > 0) {\n $cards = $this->deckOfCards->dealRandomCards($neededCountForDealing);\n foreach ($cards as $card) {\n $this->addCard($card);\n }\n }\n }",
"public function itens()\n {\n //collun card_id \n return $this->hasMany(Item::class);\n }",
"public function dealCardsToPlayers() {\n $this->gameDeck->dealCards(52);\n\n for ($i = 0; $i < 13; $i++) {\n array_push($this->players[0], $this->gameDeck->dealtCards[$i]);\n array_push($this->players[1], $this->gameDeck->dealtCards[$i + 13]);\n array_push($this->players[2], $this->gameDeck->dealtCards[$i + 26]);\n array_push($this->players[3], $this->gameDeck->dealtCards[$i + 39]);\n }\n }",
"private function get_cards() {\n\t\tif ( count($this->cards) > 0 )\n\t\t\treturn false ;\n\t\tif ( $this->get_data('all', false) ) {\n\t\t\t$this->cards = Card::$cache ;\n\t\t\t$this->cards_rarity['C'] = $this->cards ;\n\t\t\t//$cards = $db_cards->select(\"SELECT `card`.`name` FROM `card` ORDER BY `card`.`id` ASC\") ;\n\t\t} else {\n\t\t\tglobal $db_cards ;\n\t\t\t$cards = $db_cards->select(\"SELECT `card`.`name`\n\t\t\tFROM `card_ext`, `card`\n\t\t\tWHERE\n\t\t\t\t`card_ext`.`card` = `card`.`id` AND\n\t\t\t\t`card_ext`.`ext` = {$this->id}\n\t\t\tORDER BY `card`.`id` ASC\") ;\n\t\t\tforeach ( $cards as $card )\n\t\t\t\t$this->add_card(Card::get($card->name, $this->se)) ;\n\t\t}\n\t}",
"public function getPlayerCards(Player $player) : CardCollection\n {\n return $this->cardPlayers[$this->getPlayerKey($player)];\n }",
"public function playerO(){\n return $this->hasOne(\"App\\Models\\Auth\\User\", \"id\", \"player_o_id\");\n }",
"public function cardImage()\n {\n return $this->hasMany('App\\Models\\CardImage','movie_id');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pinned message, for supergroups and channel chats. Returned only in getChat. | public function getPinnedMessage(): ?Message
{
return $this->pinned_message;
} | [
"public function getIsPinned()\n {\n return $this->isPinned;\n }",
"public function isPinned() {\n\t\treturn $this->is_pinned;\n\t}",
"public function isPinned()\n {\n return $this->pinned === true ? true : false;\n }",
"public function pin()\n {\n $member = Member::currentUser();\n $discussion = Discussion::get()\n ->byID($this->getRequest()->param(\"ID\"));\n\n if ($discussion && $discussion->canPin($member)) {\n $this->setSessionMessage(\n \"message good success\",\n _t(\"Discussions.Pinned\", \"Pinned\") . \" '{$discussion->Title}'\"\n );\n\n if ($discussion->Pinned) {\n $discussion->Pinned = 0;\n } else {\n $discussion->Pinned = 1;\n }\n\n $discussion->write();\n }\n\n return $this->redirectBack();\n }",
"public function setPinned($value)\n {\n return $this->set('Pinned', $value);\n }",
"public function getIsPinned()\n {\n if (array_key_exists(\"isPinned\", $this->_propDict)) {\n return $this->_propDict[\"isPinned\"];\n } else {\n return null;\n }\n }",
"public function myPinnedPost()\n {\n return $this->posts()\n ->get()\n ->firstWhere('pinned', 1);\n }",
"public function togglePinned()\n {\n $this->timestamps = false;\n\n return $this->update([\n 'is_pinned' => (1 - $this->is_pinned)\n ]);\n }",
"public function setPinned(string $pinned)\n {\n $this->pinned = $pinned;\n\n return $this;\n }",
"public function unMarkPinned() {\n $this->updatePinStatus();\n }",
"public function pinnedInForum($id)\n {\n return static::with([\n 'user',\n 'repliesCount',\n 'latestReply',\n 'latestReply.user',\n ])\n ->where('forum_id', $id)\n ->where('pinned', true)\n ->orderBy('updated_at', 'desc');\n }",
"public function getPinnedMessages(): ?array {\n $val = $this->getBackingStore()->get('pinnedMessages');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, PinnedChatMessageInfo::class);\n /** @var array<PinnedChatMessageInfo>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'pinnedMessages'\");\n }",
"public function setPinned($pinned)\n {\n $this->pinned = (boolean) $pinned;\n return $this;\n }",
"public function getCanPinMessages(): ?bool\n {\n return $this->canPinMessages;\n }",
"function MarkAsUnread () {\n\n // Do not change the status of a Draft message.\n if ($this->Location == FOLDER_DRAFTS) return (FALSE);\n\n // Check if user owns this message.\n if ($this->CheckReadAccess () == FALSE) {\n global $gMESSAGEID;\n $gMESSAGEID = $this->tID;\n $this->Message = __(\"Message Access Denied\", array ( \"id\" => $gMESSAGEID ) );\n $this->Error = -1;\n return (FALSE);\n } // if \n\n $classlocation = $this->LocateMessage ($this->Identifier);\n\n // Save some cycles by only updating if it's currely READ.\n if ($this->$classlocation->Standing == MESSAGE_READ) {\n $this->$classlocation->Standing = MESSAGE_UNREAD;\n $this->$classlocation->Update ();\n } // if\n\n $this->Message = __( \"Message Marked Unread\" );\n\n return (TRUE);\n\n }",
"public function pinChatMessage(array $content)\n {\n return $this->endpoint('pinChatMessage', $content);\n }",
"public static function getMyInbox($markAsRead = false) {\n global $login;\n $sql = <<<eos\nSELECT inbox_id, thread_id, post_id, is_read\nFROM msg_inbox i\nWHERE recipient=$login->userId AND is_read<=1\nORDER BY post_id DESC;\neos;\n $miids = array();\n $inbox = array();\n $res = query($sql);\n while ($row = mysql_fetch_array($res, MYSQL_ASSOC)) {\n $mtid = $row['thread_id'];\n $mpid = $row['post_id'];\n $isUnread = ($row['is_read'] == '0');\n if (! array_key_exists($mtid, $inbox)) {\n $inbox[$mtid] = array();\n }\n if ($isUnread) {\n $inbox[$mtid][] = $mpid;\n if ($markAsRead) {\n $miids[] = $row['inbox_id'];\n }\n }\n }\n if ($markAsRead && count($miids) > 0) {\n $in = implode(',', $miids);\n $sql = <<<eos\nUPDATE msg_inbox\nSET is_read=1\nWHERE inbox_id IN ($in);\neos;\n query($sql);\n }\n return $inbox;\n }",
"function unpin_topic()\n\t{\n\t\tif ($this->topic['pinned'] == 0)\n\t\t{\n\t\t\t$this->moderate_error();\n\t\t}\n\t\t\n\t\t$passed = 0;\n\t\t\n\t\tif ($this->ipsclass->member['g_is_supmod'] == 1)\n\t\t{\n\t\t\t$passed = 1;\n\t\t}\n\t\t\n\t\telse if ($this->moderator['unpin_topic'] == 1)\n\t\t{\n\t\t\t$passed = 1;\n\t\t}\n\t\telse {\n\t\t\t$passed = 0;\n\t\t}\n\t\t\n\t\tif ($passed != 1) $this->moderate_error();\n\t\t\n\t\t$this->modfunc->topic_unpin($this->topic['tid']);\n\t\t\n\t\t$this->moderate_log( $this->ipsclass->lang['acp_unpinned_topic'] );\n\t\n\t\t$this->ipsclass->print->redirect_screen( $this->ipsclass->lang['p_unpinned'], \"showtopic=\".$this->topic['tid'].\"&st=\".intval($this->ipsclass->input['st']) );\n\t}",
"function setIsPinned($value) {\n return $this->setBooleanField1($value);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if there is at least one valid attack of this type from the set of all possible attackers and defenders. If $includeOptional is FALSE, then optional attacks are excluded. These include skill attacks involving warrior dice. | public function find_attack($game, $includeOptional = TRUE) {
$targets = $game->defenderAllDieArray;
return $this->search_onevone($game, $this->validDice, $targets);
} | [
"public function find_attack($game, $includeOptional = TRUE) {\n return $this->search_onevmany(\n $game,\n $game->attackerAllDieArray,\n $game->defenderAllDieArray\n );\n }",
"protected function are_attack_params_reasonable() {\n // if attack has not been set, ask player to select attack\n if (!isset($this->attack)) {\n $this->playerArray[$this->activePlayerIdx]->waitingOnAction = TRUE;\n return FALSE;\n }\n\n // validate attacker player idx\n if ($this->activePlayerIdx !== $this->attack['attackerPlayerIdx']) {\n $this->message = 'Attacker must be current active player.';\n $this->attack = NULL;\n return FALSE;\n }\n\n // validate defender player idx\n if ($this->attack['attackerPlayerIdx'] === $this->attack['defenderPlayerIdx']) {\n $this->message = 'Attacker must be different to defender.';\n $this->attack = NULL;\n return FALSE;\n }\n\n return TRUE;\n }",
"protected static function are_dice_in_attack_valid($args) {\n if (!is_array($args['attackers']) ||\n (0 == count($args['attackers'])) ||\n !is_array($args['defenders']) ||\n (0 == count($args['defenders']))) {\n return FALSE;\n }\n\n return TRUE;\n }",
"function _playerHasRequiredSkills($requirements, $playerSkills){ \r\n if (empty($requirements)){\r\n return true; // there are no requirements!\r\n } else if (empty($playerSkills)) { \r\n return false; // there are requirements, but player has no skills at all!\r\n }\r\n $playerSkills = Set::combine($playerSkills, '{n}.id', '{n}.id');\r\n $requirements = Set::combine($requirements, '{n}.id', '{n}.id');\r\n $unfulfilled = sizeof($requirements); // this has to decrease to 0!\r\n foreach ($requirements as $id){\r\n if (isset($playerSkills[$id])){\r\n $unfulfilled --;\r\n }\r\n }\r\n return($unfulfilled==0); // if nothing is unfulfilled, true => allow!\r\n }",
"public function hasBattleAttackTotal()\n {\n return $this->battle_attack_total !== null;\n }",
"public static function shouldShowADs() {\n global $wgMoegirlADEnabled, $wgMoegirlADEditCountQualification;\n\n if (!$wgMoegirlADEnabled) return false;\n\n $currentReqContext = RequestContext::getMain();\n $currentTitle = $currentReqContext->getTitle();\n // Special namespace has NSID -1\n $isSpecialPage = $currentTitle->getNamespace() === -1;\n\n // Ignore advertisements for all special pages on mobile device\n if (MoegirlADHooks::isMobileView() && $isSpecialPage) return false;\n\n if (!$isSpecialPage) {\n // Ignore advertisements if page attribute is set\n $pageProps = PageProps::getInstance();\n\n // See the magic word definition\n $suppressAdAttributes = $pageProps->getProperties($currentTitle, 'noad');\n\n // Suppress advertisement if attribute is set\n if (!empty($suppressAdAttributes)) return false;\n }\n\n // Show advertisements for users that have given edits (default: 5) or less / guests\n $currentUser = $currentReqContext->getUser();\n return !( $currentUser->getEditCount() > $wgMoegirlADEditCountQualification);\n }",
"public function hasBattlesAttacked()\n {\n return $this->battles_attacked !== null;\n }",
"public function mayApply(\n UserInterface $user,\n AllianceInterface $alliance\n ): bool;",
"public function isAngry(): bool {\n\t\treturn $this->target !== null;\n\t}",
"public function defenseLuck () {\n foreach ($this->specialSkills['defense'] as $name => $skill) {\n $randomLuck = rand(0, 100);\n if (($skill['chance'] > $randomLuck) && $skill['type'] == 'passive') {\n return $skill;\n }\n }\n return false;\n }",
"function skill_weapon_bonus(&$player_conf){\n \n $weapon_skill = 0; // initial bonus\n \n $filter = \"WHERE skill_id = {$player_conf['weapon']}\n AND player_id = {$player_conf['id']}\";\n \n $data = qdm_player_skills($filter); // player skills\n\n if( !empty($data) ){ \n \n $exp = $data[0]['exp'];\n $skill_data = calc_skill_exp($exp); // calc skill rank\n $weapon_skill = floor($skill_data['lvl'] / 2); // 2 per 1 dmg\n $player_conf['weapon_add'] = $player_conf['weapon_add'] + $weapon_skill;\n }\n \n \n // Check anatomy - rank 5 will give add dmg\n \n $filter = \"WHERE skill_id = \" . SKILL_ANATOMY . \"\n AND player_id = {$player_conf['id']}\";\n \n $data = qdm_player_skills($filter); // player skills\n\n if( !empty($data) ){ \n \n $exp = $data[0]['exp'];\n $skill_data = calc_skill_exp($exp); // calc skill rank\n $weapon_skill = $skill_data['lvl']; // 2 per 1 dmg\n \n if( $weapon_skill > 4 ){ $player_conf['weapon_add']++; }\n }\n \n}",
"public function hasRequiredArgument($includeBase = true)\n {\n Assert::boolean($includeBase, 'The parameter $includeBase must be a boolean. Got: %s');\n\n if (!$this->hasOptionalArg && count($this->arguments) > 0) {\n return true;\n }\n\n if ($includeBase && $this->baseFormat) {\n return $this->baseFormat->hasRequiredArgument();\n }\n\n return false;\n }",
"public function testCanAttack()\n {\n $optimalSkillSelector = new OptimalSkillSelectorService();\n $this->entity->setOptimalSkillSelector($optimalSkillSelector);\n\n $stats = new PlayerStats();\n $stats->setStrength(30);\n\n $skillCollection = new SkillCollection();\n $attackSkill = AttackSkill::attachTo($this->entity);\n $skillCollection->add($attackSkill);\n $this->entity->setSkills($skillCollection);\n\n $broadcaster = $this->getMockBuilder(MessageBroadcaster::class)\n ->setMethods(['broadcast'])->getMock();\n $broadcaster->method('broadcast')->willReturn('');\n $this->entity->setBroadcaster($broadcaster);\n $attackSkill->setBroadcaster($broadcaster);\n\n $this->entity->setStats($stats);\n $strikes = $this->entity->attack();\n $strike = reset(reset($strikes));\n $this->assertEquals(30, $strike->getPower());\n }",
"protected function allows_fire_overshooting() {\n if ('Power' != $this->attack['attackType']) {\n return FALSE;\n }\n\n $attackerPlayerIdx = $this->attack['attackerPlayerIdx'];\n\n if (!$this->playerArray[$attackerPlayerIdx]->fireOvershooting) {\n return FALSE;\n }\n\n $attackerDieIdx = $this->attack['attackerAttackDieIdxArray'][0];\n $attackerDie = $this->playerArray[$attackerPlayerIdx]\n ->activeDieArray[$attackerDieIdx];\n $attackerDieArray = array($attackerDie);\n\n $defenderPlayerIdx = $this->attack['defenderPlayerIdx'];\n $defenderDieIdx = $this->attack['defenderAttackDieIdxArray'][0];\n $defenderDie = $this->playerArray[$defenderPlayerIdx]\n ->activeDieArray[$defenderDieIdx];\n $defenderDieArray = array($defenderDie);\n\n $attack = BMAttack::create('Power');\n\n $bounds = $attack->help_bounds_specific($this, $attackerDieArray, $defenderDieArray);\n if (0 == $bounds[1]) {\n return FALSE;\n }\n\n if ($attack->validate_attack(\n $this,\n $attackerDieArray,\n $defenderDieArray,\n max(1, $defenderDie->value - $attackerDie->value + 1)\n )) {\n $this->log_action(\n 'allows_firing',\n $this->playerArray[$this->attackerPlayerIdx]->playerId,\n array(\n 'attackType' => $this->attack['attackType'],\n 'attackDice' => $this->get_action_log_data(\n $attackerDieArray,\n $defenderDieArray\n ),\n )\n );\n\n return TRUE;\n }\n\n return FALSE;\n }",
"public function hasSameTypeAttackBonusMultiplier()\n {\n return $this->same_type_attack_bonus_multiplier !== null;\n }",
"function check() // Checks for errors before the start of combat.\n\t{\n\t\t$sql = new DBAccess();\n\t\t$attacker = $this->attacker;\n\t\t$target = $this->target;\n\t\t\n\t\t$possible = array('required_turns', 'ignores_stealth', 'self_use',\n\t\t 'clan_forbidden');\n\t\t//Initializes all the possible param indexes.\n\t\tforeach( $possible as $loop_index){\n\t\t\t$$loop_index = isset($this->params[$loop_index])? $this->params[$loop_index] : NULL;\n\t\t}\n\t\t\n\t\tif (!is_object($this->attacker)){\n\t\t\t$this->error = 'Invalid attacker.';\n \t\treturn FALSE;\n\t\t} elseif (!is_object($this->target)){\n \t\t$this->error = 'No valid target was found.';\n \t\treturn FALSE;\n \t} elseif (!isset($this->params['required_turns'])){\n \t\t$this->error = 'The required number of turns was not specified.';\n \t\treturn FALSE;\n \t}\n \t$target_status = $target->getStatus();\n\n\t\t$second_interval_limiter_on_attacks = '.20';\n\t\t$sel_last_started_attack = \"select player_id from players \n\t\t\twhere player_id = '\".intval($this->attacker->player_id).\"' \n\t\t\tand ((now() - interval '\".$second_interval_limiter_on_attacks.\" second') >= last_started_attack) limit 1\";\n\t\t$attack_later_than_limit = $sql->QueryItem($sel_last_started_attack);\n\t\t// Returns a player id if the enough time has passed, or else or false/null.\n\n\t\tswitch(true) {\n\t\t // *** START OF ILLEGAL ATTACK ERROR LIST ***\n\t\t case (!$attack_later_than_limit): \n\t\t\t\t$this->error = \"Even the fastest ninja cannot attack more than five times in a second.\";\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t case ($target->vo->uname == \"\"):\n\t\t\t $this->error = \"Your target does not exist.\";\n\t\t\t\treturn false;\n\t\t\t break;\n\t\t case ($target->player_id == $attacker->player_id && !$self_use):\n\t\t\t $this->error = \"Commiting suicide is a tactic reserved for samurai.\";\n\t\t\t\treturn false;\n\t\t\t break;\n\t\t case ($attacker->vo->turns < $required_turns):\n\t\t\t $this->error = \"You do not have enough turns to attack in this way.\";\n\t\t\t\treturn false;\n\t\t\t break;\n\t\t case (isset($_SESSION) && $target->vo->ip == $_SESSION['ip'] && $_SESSION['ip'] != '127.0.0.1' && !$self_use):\n\t\t\t $this->error = \"You can not attack a ninja from the same domain.\";\n\t\t\t\treturn false;\n\t\t\t break;\n\t\t case ($target->vo->confirmed == 0):\n\t\t\t $this->error = \"You can not attack an inactive ninja.\";\n\t\t\t\treturn false;\n\t\t\t break;\n\t\t case ($target->vo->health<1):\n\t\t\t $this->error = \"Your target is a ghost.\";\n\t\t\t\treturn false;\n\t\t\t break;\n\t\t case ($target_status['Stealth'] && !$ignores_stealth):\n\t\t \t// Attacks that ignore stealth will skip this.\n\t\t\t $this->error = \"Your target is stealthed. You can only hit this ninja using certain skills.\";\n\t\t\t\treturn false;\n\t\t\t break; \n\t\t case ($clan_forbidden && ($target->vo->clan == $attacker->vo->clan && $attacker->vo->clan !=\"\" && !$self_use)):\n\t\t\t $this->error = \"Your clan would outcast you if you attacked one of your own.\";\n\t\t\t\treturn false;\n\t\t\t\tbreak; \n\t\t case ($target->vo->health > 0):\n\t\t\t return true; // *** ATTACK IS LEGAL ***\n\t\t\t break;\n\t\t default: // *** CATCHALL ERROR MESSAGE ***\n\t\t\t $this->error = \"There was a problem with your attack.\";\n\t\t\t error_log('The problem catch-all for attackLegal object was triggered, which should not occur.');\n\t\t\t return false;\n\t\t\t break;\n\t\t}\n\t}",
"public static function check_include_entities($input_include_entities)\n\t{\n\t\treturn is_bool($input_include_entities);\n\t}",
"public function hasPermitsRequired()\n {\n return $this->permitsRequired !== null;\n }",
"public function hasRequestedIncludes(): bool;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensure UUIDs are unique for fork/child processes This test will ensure that the PHP driver is producing unique UUIDs for all child processes that get created during fork() operations in web servers (e.g. Apache, nginx, ...etc). | public function testUniqueInChild() {
if (!function_exists("pcntl_fork")) {
$this->markTestSkipped("Unable to Execute testUniqueInChild Unit Test: pcntl_fork() does not exists");
} else {
// Create a PHP script to call within a PHPUnit test (exit call fails test)
$script = <<<EOF
<?php
// Get and open the file for appending child UUIDs
\$uuidsFilename = \$_SERVER['argv'][1];
\$numberOfForks = \$_SERVER['argv'][2];
// Create requested children process; create UUIDs and append to a file
\$children = array();
foreach (range(1, \$numberOfForks) as \$i) {
// Create the child process
\$pid = pcntl_fork();
// Ensure the child process was create successfully
if (\$pid < 0) {
die("Unable to Create Fork: Unique UUID test cannot complete");
} else if (\$pid === 0) {
// Create a UUID and add it to the file
\$uuid = new \Cassandra\Uuid();
file_put_contents(\$uuidsFilename, \$uuid->uuid() . PHP_EOL, FILE_APPEND);
// Terminate child process
exit(0);
} else {
// Parent process: Add the process ID to force waiting on children
\$children[] = \$pid;
}
}
// Wait on each child process to finish
foreach (\$children as \$pid) {
pcntl_waitpid(\$pid, \$status);
}
?>
EOF;
$numProcesses = 64;
// Execute the PHP script passing in the filename for the UUIDs to be stored
$uuidsFilename = tempnam(sys_get_temp_dir(), "uuid");
$scriptFilename = tempnam(sys_get_temp_dir(), "uuid");
file_put_contents($scriptFilename, $script, FILE_APPEND);
exec(PHP_BINARY . " {$scriptFilename} {$uuidsFilename} $numProcesses");
unlink($scriptFilename);
// Get the contents of the file
$uuids = file($uuidsFilename);
unlink($uuidsFilename);
// Ensure all the UUIDs are unique
$this->assertEquals($numProcesses, count(array_unique($uuids)));
}
} | [
"public static function createUuidsNormally()\n {\n static::$uuidFactory = null;\n }",
"function GeneratePID() {\n // Hint: 16Byte = 128 bit = 32 characters\n\n // try to get unique PID max 3 times\n for ($i = 1; $i <= 3; $i++) {\n if (function_exists('random_bytes')) {\n // php 7 or newer\n $pid = bin2hex(random_bytes(16));\n } else {\n // php pre 7\n $pid = bin2hex(openssl_random_pseudo_bytes(16));\n }\n $sql = \"SELECT PID FROM data WHERE PID=?\";\n $ret = GetOneSQLValue($sql, array($pid));\n if ($ret === 0) {\n return $pid;\n }\n }\n // Always collisions or SQL errors?\n return false;\n}",
"public function testCreationOfUuid() : void\n {\n\n $this->assertEquals(38, mb_strlen(Tools::createUuid()));\n $this->assertEquals(38, mb_strlen(Tools::createUuid(true)));\n $this->assertEquals(36, mb_strlen(Tools::createUuid(false)));\n $this->assertEquals(36, mb_strlen(trim(Tools::createUuid(), '{}')));\n }",
"private function _forkNodes(){\n for($x=0; $x<$this->config['server']['fork_nodes']; $x++){\n $pid = pcntl_fork();\n if ($pid == -1){\n die('could not fork');\n }\n elseif ($pid) {\n $this->_registerNode($pid);\n } else {\n new PHPi_node($this->config['server']['socket_path'], $this->routes);\n exit();\n }\n }\n }",
"function createUUID() {\n return createGUID();\n}",
"public function __construct($puid = null, $guid = null, $umask = null)\n {\n// if (substr(PHP_OS, 0, 3) === 'WIN') {\n// throw new ZendX_Console_Process_Exception('Cannot run on windows');\n// } else if (!in_array(substr(PHP_SAPI, 0, 3), array('cli', 'cgi'))) {\n// throw new ZendX_Console_Process_Exception('Can only run on CLI or CGI enviroment');\n// } else if (!function_exists('shmop_open')) {\n// throw new ZendX_Console_Process_Exception('shmop_* functions are required');\n// } else if (!function_exists('pcntl_fork')) {\n// throw new ZendX_Console_Process_Exception('pcntl_* functions are required');\n// } else if (!function_exists('posix_kill')) {\n// throw new ZendX_Console_Process_Exception('posix_* functions are required');\n// }\n\n $this->_isRunning = false;\n\n $this->_name = md5(uniqid(rand()));\n $this->_guid = $guid;\n $this->_puid = $puid;\n\n if ($umask !== null) {\n umask($umask);\n }\n\n $this->setChildaction([$this, '_run']);\n\n // TODO allow more sophisticated IPC setup; allow to run later\n // Try to create the shared memory segment. The variable\n // $this->_ipcIsOkay contains the return code of this operation and must\n // be checked before forking\n// if ($this->_createIpcSegment() && $this->_createIpcSemaphore()) {\n// $this->_ipcIsOkay = true;\n// } else {\n// $this->_ipcIsOkay = false;\n// }\n }",
"public function testUuid() {\n $this->assertRegExp('/^[a-f0-9]{8}\\-[a-f0-9]{4}\\-4[a-f0-9]{3}\\-[89AB]{1}[a-f0-9]{3}\\-[a-f0-9]{12}$/i', String::uuid());\n $this->assertRegExp('/^[a-f0-9]{8}\\-[a-f0-9]{4}\\-4[a-f0-9]{3}\\-[89AB]{1}[a-f0-9]{3}\\-[a-f0-9]{12}$/i', String::uuid());\n $this->assertRegExp('/^[a-f0-9]{8}\\-[a-f0-9]{4}\\-4[a-f0-9]{3}\\-[89AB]{1}[a-f0-9]{3}\\-[a-f0-9]{12}$/i', String::uuid());\n }",
"public function testUuidPassesPythonTests()\n {\n // This array is taken directly from the Python tests, more or less\n $tests = array(\n array(\n 'string' => '00000000-0000-0000-0000-000000000000',\n 'curly' => '{00000000-0000-0000-0000-000000000000}',\n 'hex' => '00000000000000000000000000000000',\n 'bytes' => 'AAAAAAAAAAAAAAAAAAAAAA==',\n 'int' => '0',\n 'fields' => array(\n 'time_low' => '0',\n 'time_mid' => '0',\n 'time_hi_and_version' => '0',\n 'clock_seq_hi_and_reserved' => '0',\n 'clock_seq_low' => '0',\n 'node' => '0',\n ),\n 'urn' => 'urn:uuid:00000000-0000-0000-0000-000000000000',\n 'time' => '0',\n 'clock_seq' => '0000',\n 'variant' => Uuid::RESERVED_NCS,\n 'version' => null,\n ),\n array(\n 'string' => '00010203-0405-0607-0809-0a0b0c0d0e0f',\n 'curly' => '{00010203-0405-0607-0809-0a0b0c0d0e0f}',\n 'hex' => '000102030405060708090a0b0c0d0e0f',\n 'bytes' => 'AAECAwQFBgcICQoLDA0ODw==',\n 'int' => '5233100606242806050955395731361295',\n 'fields' => array(\n 'time_low' => '10203',\n 'time_mid' => '405',\n 'time_hi_and_version' => '607',\n 'clock_seq_hi_and_reserved' => '8',\n 'clock_seq_low' => '9',\n 'node' => '0a0b0c0d0e0f',\n ),\n 'urn' => 'urn:uuid:00010203-0405-0607-0809-0a0b0c0d0e0f',\n 'time' => '607040500010203',\n 'clock_seq' => '0809',\n 'variant' => Uuid::RESERVED_NCS,\n 'version' => null,\n ),\n array(\n 'string' => '02d9e6d5-9467-382e-8f9b-9300a64ac3cd',\n 'curly' => '{02d9e6d5-9467-382e-8f9b-9300a64ac3cd}',\n 'hex' => '02d9e6d59467382e8f9b9300a64ac3cd',\n 'bytes' => 'Atnm1ZRnOC6Pm5MApkrDzQ==',\n 'int' => '3789866285607910888100818383505376205',\n 'fields' => array(\n 'time_low' => '02d9e6d5',\n 'time_mid' => '9467',\n 'time_hi_and_version' => '382e',\n 'clock_seq_hi_and_reserved' => '8f',\n 'clock_seq_low' => '9b',\n 'node' => '9300a64ac3cd',\n ),\n 'urn' => 'urn:uuid:02d9e6d5-9467-382e-8f9b-9300a64ac3cd',\n 'time' => '82e946702d9e6d5',\n 'clock_seq' => '0f9b',\n 'variant' => Uuid::RFC_4122,\n 'version' => 3,\n ),\n array(\n 'string' => '12345678-1234-5678-1234-567812345678',\n 'curly' => '{12345678-1234-5678-1234-567812345678}',\n 'hex' => '12345678123456781234567812345678',\n 'bytes' => 'EjRWeBI0VngSNFZ4EjRWeA==',\n 'int' => '24197857161011715162171839636988778104',\n 'fields' => array(\n 'time_low' => '12345678',\n 'time_mid' => '1234',\n 'time_hi_and_version' => '5678',\n 'clock_seq_hi_and_reserved' => '12',\n 'clock_seq_low' => '34',\n 'node' => '567812345678',\n ),\n 'urn' => 'urn:uuid:12345678-1234-5678-1234-567812345678',\n 'time' => '678123412345678',\n 'clock_seq' => '1234',\n 'variant' => Uuid::RESERVED_NCS,\n 'version' => null,\n ),\n array(\n 'string' => '6ba7b810-9dad-11d1-80b4-00c04fd430c8',\n 'curly' => '{6ba7b810-9dad-11d1-80b4-00c04fd430c8}',\n 'hex' => '6ba7b8109dad11d180b400c04fd430c8',\n 'bytes' => 'a6e4EJ2tEdGAtADAT9QwyA==',\n 'int' => '143098242404177361603877621312831893704',\n 'fields' => array(\n 'time_low' => '6ba7b810',\n 'time_mid' => '9dad',\n 'time_hi_and_version' => '11d1',\n 'clock_seq_hi_and_reserved' => '80',\n 'clock_seq_low' => 'b4',\n 'node' => '00c04fd430c8',\n ),\n 'urn' => 'urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8',\n 'time' => '1d19dad6ba7b810',\n 'clock_seq' => '00b4',\n 'variant' => Uuid::RFC_4122,\n 'version' => 1,\n ),\n array(\n 'string' => '6ba7b811-9dad-11d1-80b4-00c04fd430c8',\n 'curly' => '{6ba7b811-9dad-11d1-80b4-00c04fd430c8}',\n 'hex' => '6ba7b8119dad11d180b400c04fd430c8',\n 'bytes' => 'a6e4EZ2tEdGAtADAT9QwyA==',\n 'int' => '143098242483405524118141958906375844040',\n 'fields' => array(\n 'time_low' => '6ba7b811',\n 'time_mid' => '9dad',\n 'time_hi_and_version' => '11d1',\n 'clock_seq_hi_and_reserved' => '80',\n 'clock_seq_low' => 'b4',\n 'node' => '00c04fd430c8',\n ),\n 'urn' => 'urn:uuid:6ba7b811-9dad-11d1-80b4-00c04fd430c8',\n 'time' => '1d19dad6ba7b811',\n 'clock_seq' => '00b4',\n 'variant' => Uuid::RFC_4122,\n 'version' => 1,\n ),\n array(\n 'string' => '6ba7b812-9dad-11d1-80b4-00c04fd430c8',\n 'curly' => '{6ba7b812-9dad-11d1-80b4-00c04fd430c8}',\n 'hex' => '6ba7b8129dad11d180b400c04fd430c8',\n 'bytes' => 'a6e4Ep2tEdGAtADAT9QwyA==',\n 'int' => '143098242562633686632406296499919794376',\n 'fields' => array(\n 'time_low' => '6ba7b812',\n 'time_mid' => '9dad',\n 'time_hi_and_version' => '11d1',\n 'clock_seq_hi_and_reserved' => '80',\n 'clock_seq_low' => 'b4',\n 'node' => '00c04fd430c8',\n ),\n 'urn' => 'urn:uuid:6ba7b812-9dad-11d1-80b4-00c04fd430c8',\n 'time' => '1d19dad6ba7b812',\n 'clock_seq' => '00b4',\n 'variant' => Uuid::RFC_4122,\n 'version' => 1,\n ),\n array(\n 'string' => '6ba7b814-9dad-11d1-80b4-00c04fd430c8',\n 'curly' => '{6ba7b814-9dad-11d1-80b4-00c04fd430c8}',\n 'hex' => '6ba7b8149dad11d180b400c04fd430c8',\n 'bytes' => 'a6e4FJ2tEdGAtADAT9QwyA==',\n 'int' => '143098242721090011660934971687007695048',\n 'fields' => array(\n 'time_low' => '6ba7b814',\n 'time_mid' => '9dad',\n 'time_hi_and_version' => '11d1',\n 'clock_seq_hi_and_reserved' => '80',\n 'clock_seq_low' => 'b4',\n 'node' => '00c04fd430c8',\n ),\n 'urn' => 'urn:uuid:6ba7b814-9dad-11d1-80b4-00c04fd430c8',\n 'time' => '1d19dad6ba7b814',\n 'clock_seq' => '00b4',\n 'variant' => Uuid::RFC_4122,\n 'version' => 1,\n ),\n array(\n 'string' => '7d444840-9dc0-11d1-b245-5ffdce74fad2',\n 'curly' => '{7d444840-9dc0-11d1-b245-5ffdce74fad2}',\n 'hex' => '7d4448409dc011d1b2455ffdce74fad2',\n 'bytes' => 'fURIQJ3AEdGyRV/9znT60g==',\n 'int' => '166508041112410060672666770310773930706',\n 'fields' => array(\n 'time_low' => '7d444840',\n 'time_mid' => '9dc0',\n 'time_hi_and_version' => '11d1',\n 'clock_seq_hi_and_reserved' => 'b2',\n 'clock_seq_low' => '45',\n 'node' => '5ffdce74fad2',\n ),\n 'urn' => 'urn:uuid:7d444840-9dc0-11d1-b245-5ffdce74fad2',\n 'time' => '1d19dc07d444840',\n 'clock_seq' => '3245',\n 'variant' => Uuid::RFC_4122,\n 'version' => 1,\n ),\n array(\n 'string' => 'e902893a-9d22-3c7e-a7b8-d6e313b71d9f',\n 'curly' => '{e902893a-9d22-3c7e-a7b8-d6e313b71d9f}',\n 'hex' => 'e902893a9d223c7ea7b8d6e313b71d9f',\n 'bytes' => '6QKJOp0iPH6nuNbjE7cdnw==',\n 'int' => '309723290945582129846206211755626405279',\n 'fields' => array(\n 'time_low' => 'e902893a',\n 'time_mid' => '9d22',\n 'time_hi_and_version' => '3c7e',\n 'clock_seq_hi_and_reserved' => 'a7',\n 'clock_seq_low' => 'b8',\n 'node' => 'd6e313b71d9f',\n ),\n 'urn' => 'urn:uuid:e902893a-9d22-3c7e-a7b8-d6e313b71d9f',\n 'time' => 'c7e9d22e902893a',\n 'clock_seq' => '27b8',\n 'variant' => Uuid::RFC_4122,\n 'version' => 3,\n ),\n array(\n 'string' => 'eb424026-6f54-4ef8-a4d0-bb658a1fc6cf',\n 'curly' => '{eb424026-6f54-4ef8-a4d0-bb658a1fc6cf}',\n 'hex' => 'eb4240266f544ef8a4d0bb658a1fc6cf',\n 'bytes' => '60JAJm9UTvik0Ltlih/Gzw==',\n 'int' => '312712571721458096795100956955942831823',\n 'fields' => array(\n 'time_low' => 'eb424026',\n 'time_mid' => '6f54',\n 'time_hi_and_version' => '4ef8',\n 'clock_seq_hi_and_reserved' => 'a4',\n 'clock_seq_low' => 'd0',\n 'node' => 'bb658a1fc6cf',\n ),\n 'urn' => 'urn:uuid:eb424026-6f54-4ef8-a4d0-bb658a1fc6cf',\n 'time' => 'ef86f54eb424026',\n 'clock_seq' => '24d0',\n 'variant' => Uuid::RFC_4122,\n 'version' => 4,\n ),\n array(\n 'string' => 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6',\n 'curly' => '{f81d4fae-7dec-11d0-a765-00a0c91e6bf6}',\n 'hex' => 'f81d4fae7dec11d0a76500a0c91e6bf6',\n 'bytes' => '+B1Prn3sEdCnZQCgyR5r9g==',\n 'int' => '329800735698586629295641978511506172918',\n 'fields' => array(\n 'time_low' => 'f81d4fae',\n 'time_mid' => '7dec',\n 'time_hi_and_version' => '11d0',\n 'clock_seq_hi_and_reserved' => 'a7',\n 'clock_seq_low' => '65',\n 'node' => '00a0c91e6bf6',\n ),\n 'urn' => 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6',\n 'time' => '1d07decf81d4fae',\n 'clock_seq' => '2765',\n 'variant' => Uuid::RFC_4122,\n 'version' => 1,\n ),\n array(\n 'string' => 'fffefdfc-fffe-fffe-fffe-fffefdfcfbfa',\n 'curly' => '{fffefdfc-fffe-fffe-fffe-fffefdfcfbfa}',\n 'hex' => 'fffefdfcfffefffefffefffefdfcfbfa',\n 'bytes' => '//79/P/+//7//v/+/fz7+g==',\n 'int' => '340277133821575024845345576078114880506',\n 'fields' => array(\n 'time_low' => 'fffefdfc',\n 'time_mid' => 'fffe',\n 'time_hi_and_version' => 'fffe',\n 'clock_seq_hi_and_reserved' => 'ff',\n 'clock_seq_low' => 'fe',\n 'node' => 'fffefdfcfbfa',\n ),\n 'urn' => 'urn:uuid:fffefdfc-fffe-fffe-fffe-fffefdfcfbfa',\n 'time' => 'ffefffefffefdfc',\n 'clock_seq' => '3ffe',\n 'variant' => Uuid::RESERVED_FUTURE,\n 'version' => null,\n ),\n array(\n 'string' => 'ffffffff-ffff-ffff-ffff-ffffffffffff',\n 'curly' => '{ffffffff-ffff-ffff-ffff-ffffffffffff}',\n 'hex' => 'ffffffffffffffffffffffffffffffff',\n 'bytes' => '/////////////////////w==',\n 'int' => '340282366920938463463374607431768211455',\n 'fields' => array(\n 'time_low' => 'ffffffff',\n 'time_mid' => 'ffff',\n 'time_hi_and_version' => 'ffff',\n 'clock_seq_hi_and_reserved' => 'ff',\n 'clock_seq_low' => 'ff',\n 'node' => 'ffffffffffff',\n ),\n 'urn' => 'urn:uuid:ffffffff-ffff-ffff-ffff-ffffffffffff',\n 'time' => 'fffffffffffffff',\n 'clock_seq' => '3fff',\n 'variant' => Uuid::RESERVED_FUTURE,\n 'version' => null,\n ),\n );\n\n foreach ($tests as $test) {\n $uuids = array(\n Uuid::fromString($test['string']),\n Uuid::fromString($test['curly']),\n Uuid::fromString($test['hex']),\n Uuid::fromBytes(base64_decode($test['bytes'])),\n Uuid::fromString($test['urn']),\n );\n foreach ($uuids as $uuid) {\n $this->assertEquals($test['string'], (string) $uuid);\n $this->assertEquals($test['hex'], $uuid->getHex());\n $this->assertEquals(base64_decode($test['bytes']), $uuid->getBytes());\n if ($this->hasMoontoastMath()) {\n $this->assertEquals($test['int'], (string) $uuid->getInteger());\n }\n $this->assertEquals($test['fields'], $uuid->getFieldsHex());\n $this->assertEquals($test['fields']['time_low'], $uuid->getTimeLowHex());\n $this->assertEquals($test['fields']['time_mid'], $uuid->getTimeMidHex());\n $this->assertEquals($test['fields']['time_hi_and_version'], $uuid->getTimeHiAndVersionHex());\n $this->assertEquals($test['fields']['clock_seq_hi_and_reserved'], $uuid->getClockSeqHiAndReservedHex());\n $this->assertEquals($test['fields']['clock_seq_low'], $uuid->getClockSeqLowHex());\n $this->assertEquals($test['fields']['node'], $uuid->getNodeHex());\n $this->assertEquals($test['urn'], $uuid->getUrn());\n if ($uuid->getVersion() == 1) {\n $this->assertEquals($test['time'], $uuid->getTimestampHex());\n }\n $this->assertEquals($test['clock_seq'], $uuid->getClockSequenceHex());\n $this->assertEquals($test['variant'], $uuid->getVariant());\n $this->assertEquals($test['version'], $uuid->getVersion());\n }\n }\n }",
"public function testSplitFork()\n {\n\n $this->expectOutputString(json_encode([\n 'test1' => [(object) [\n 'key' => 'test1',\n 'message' => 'Hello world'\n ]],\n 'test2' => [(object) [\n 'key' => 'test2',\n 'message' => 'Hello world'\n ]],\n ]));\n\n \\Fork\\Fork::createChildren(['test1', 'test2'], function(\\Fork\\ChildProcess $child) {\n\n // Wait 1 second to allow the broadcast to come through\n sleep(1);\n\n $child->sendToParent([\n 'key' => $child->getKey(),\n 'message' => $child->receivedFromParent()\n ]);\n\n })->then(function(\\Fork\\ParentProcess $parent) {\n\n $parent->broadcast('Hello world');\n\n // Wait for all children to finish running and output messages\n $parent->waitForChildren();\n\n echo json_encode($parent->receivedFromChildren());\n\n // Ask the parent to clean up after itself\n $parent->cleanup();\n\n });\n\n }",
"public static function createNormally()\n {\n static::$uuidFactory = null;\n }",
"public static function create_uuid()\n {\n /* If we're on Linux, then we'll use a system function for that. */\n\n if (file_exists(\"/proc/sys/kernel/random/uuid\")) {\n return trim(file_get_contents(\"/proc/sys/kernel/random/uuid\"));\n }\n\n /* On other systems (as well as on some other Linux distributions)\n * fall back to the original implementation (which is NOT safe - we had\n * one duplicate during 3 years of its running). */\n\n return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n mt_rand(0, 0xffff), mt_rand(0, 0xffff),\n mt_rand(0, 0xffff),\n mt_rand(0, 0x0fff) | 0x4000,\n mt_rand(0, 0x3fff) | 0x8000,\n mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)\n );\n }",
"public function testGeneratedUUID()\n\t{\n\t\t$this->assertContains('PieChart_', $this->chart->uuid());\n\t}",
"public function useUUID() : void\n {\n $this->useUUID = true;\n }",
"public function testUuidV6()\n {\n $this->assertNotNull(UUID::v6());\n }",
"public function testParentProcessWillNotBeChangedItsOwnPidAfterDaemonized()\n {\n $pid = $this->daemon->fork();\n if ($this->daemon->isParentProcess()) {\n $this->waitAllProcess();\n $this->assertSame('true', $this->get(__METHOD__ . 'isParentProcess'), \"This is not 1st forked process.\");\n $this->assertSame('false', $this->get(__METHOD__ . 'isChildProcess'), \"This is not 1st forked process.\");\n $this->assertSame('false', $this->get(__METHOD__ . 'isDaemon'), \"This is not 1st forked process.\");\n $this->executed = true;\n } else {\n $before = posix_getpid();\n $this->daemon->daemonize();\n if ($before === posix_getpid()) {\n $this->set(__METHOD__ . 'isParentProcess', $this->daemon->isParentProcess() ? 'true' : 'false');\n $this->set(__METHOD__ . 'isChildProcess', $this->daemon->isChildProcess() ? 'true' : 'false');\n $this->set(__METHOD__ . 'isDaemon', $this->daemon->isDaemon() ? 'true' : 'false');\n }\n $this->incrementExit();\n }\n $this->checkExecute();\n }",
"private function uuid(){\n return uniqid('');\n }",
"public function testMultiplePrepareDirectory() {\n if (!function_exists('pcntl_fork')) {\n $this->markTestSkipped('Requires the pcntl_fork() function');\n }\n $directories = [];\n for ($i = 1; $i <= 10; $i++) {\n $directories[] = 'public://a/b/c/d/e/f/g/h/' . $i;\n }\n\n $file_system = $this->container->get('file_system');\n\n $time_to_start = microtime(TRUE) + 0.1;\n // This loop creates a new fork to create each directory.\n foreach ($directories as $directory) {\n $pid = pcntl_fork();\n if ($pid == -1) {\n $this->fail(\"Error forking\");\n }\n elseif ($pid == 0) {\n // Sleep so that all the forks start preparing the directory at the same\n // time.\n usleep((int) (($time_to_start - microtime(TRUE)) * 1000000));\n $file_system->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY);\n exit();\n }\n }\n\n // This while loop holds the parent process until all the child threads\n // are complete - at which point the script continues to execute.\n while (pcntl_waitpid(0, $status) != -1);\n\n foreach ($directories as $directory) {\n $this->assertDirectoryExists($directory);\n }\n\n // Remove the database connection because it will have been destroyed when\n // the forks exited. This allows\n // \\Drupal\\KernelTests\\KernelTestBase::tearDown() to reopen it.\n Database::removeConnection('default');\n }",
"public function testGetDuplicateReceivingProcessById()\n {\n }",
"public function seed_generated_uuids_are_equal(): void\n {\n $this->assertSame(UUID::generate('seed')->toString(), UUID::generate('seed')->toString());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Connects to an existing browser using it's web socket uri. usage: ``` $browserFactory = new BrowserFactory(); $browser = $browserFactory>createBrowser(); $uri = $browser>getSocketUri(); $existingBrowser = BrowserFactory::connectToBrowser($uri); ``` | public static function connectToBrowser(string $uri, array $options = []): Browser
{
$logger = self::createLogger($options);
if ($logger) {
$logger->debug('Browser Factory: connecting using '.$uri);
}
// connect to browser
$connection = new Connection($uri, $logger, $options['sendSyncDefaultTimeout'] ?? 5000);
// try to connect
try {
$connection->connect();
} catch (HandshakeException $e) {
throw new BrowserConnectionFailed('Invalid socket uri', 0, $e);
}
// make sure it is connected
if (!$connection->isConnected()) {
throw new BrowserConnectionFailed('Cannot connect to the browser, make sure it was not closed');
}
// connection delay
if (\array_key_exists('connectionDelay', $options)) {
$connection->setConnectionDelay($options['connectionDelay']);
}
return new Browser($connection);
} | [
"protected function connect() {\n\t\t$server = stream_socket_client(\"tcp://localhost:{$this->port}\", $errno, $errstr, 5);\n\t\tif (is_resource($server)) {\n\t\t\t$this->server = $server;\n\t\t} else {\n\t\t\tthrow new \\RuntimeException(\"could not connect to webkit_server\");\n\t\t}\n\t}",
"protected function connect()\n\t{\n\t\t$hostname = $this->getHostname();\n\t\t$port = $this->getPort();\n\t\t$timeout = $this->getTimeout();\n\n\t\t// Connect to server\n\t\t$errno = null;\n\t\t$errstr = null;\n\t\t$socket = @fsockopen('tcp://' . $hostname, $port, $errno, $errstr, $timeout);\n\t\t$this->lastError = $errstr;\n\t\treturn $socket;\n\t}",
"public function getSocketUri();",
"public function connect($uri, $options = null);",
"function socket_connect($socket, $addr, $port = null) {}",
"public function createBrowser()\n {\n return new SimpleBrowser();\n }",
"public function connect() {\r\n // Initialize the connection by fetching data we need.\r\n $this->init();\r\n\r\n // Create the connection.\r\n $this->createConnection();\r\n $this->startWebsocketServer();\r\n\r\n // Test the connection.\r\n $this->test();\r\n }",
"protected function connectToZMQ()\n\t{\n\t\t$context = \\App::make('ZMQContext');\n\n\t\t$this->socket = $context->getSocket(\\ZMQ::SOCKET_PUSH, \\Config::get('larapush.persistent_socket_name'));\n\t\t$this->socket->connect($this->getPusherConnect());\n\n\t\treturn $this->socket;\n\t}",
"function connect () {\n $context = stream_context_create($this->context);\n $flags = $this->getFlags();\n\n $this->sock = stream_socket_client($this->url, $errno, $errstr, \n ini_get(\"default_socket_timeout\"), \n $flags, $context);\n\n if (! $this->sock) {\n throw new \\Exception(\"Failed to connect stream socket {$this->url}, ($errno, $errstr): flags $flags\", 7568);\n } else if (($flags & STREAM_CLIENT_PERSISTENT) && $this->stfp > 0) {\n $this->stfp = ftell($this->sock);\n foreach (self::$All as $sock) {\n if ($sock !== $this && $sock->getCK() == $this->getCK()) {\n /* TODO: Investigate whether mixing persistent and\n * non-persistent connections to the same URL can\n * provoke errors. */\n $this->sock = null;\n throw new \\Exception(sprintf(\"Stream socket connection created a new wrapper object for \" .\n \"an existing persistent connection on URL %s\", $this->url), 8164);\n }\n }\n }\n if (! stream_set_blocking($this->sock, 0)) {\n throw new \\Exception(\"Failed to place stream connection in non-blocking mode\", 2795);\n }\n $this->connected = true;\n self::$All[] = $this;\n }",
"public function connect(): void\n {\n $this->getSocket();\n }",
"public function createSocket(): Socket\n {\n return new Socket(\n $this->hostname(),\n $this->port(),\n (($this->isHttps()) ? ('ssl://') : (null))\n );\n }",
"public function start()\n {\n $this->sessionId = $this->getString(\"getNewBrowserSession\", array($this->browser, $this->browserUrl));\n return $this->sessionId;\n }",
"function connect()\r\n\t{\r\n\t\t\r\n\t\t$this->sock = @fsockopen($this->host,$this->port,&$this->errno,&$this->errstr,30);\r\n\t\t@set_socket_blocking($this->sock,false);\r\n\t\treturn $this->sock;\r\n\t}",
"public function getWebsocket()\n {\n $websocket = $this->manager->getWebsocket($this->containerId);\n\n return new Websocket($websocket);\n }",
"public function getSocket();",
"protected function connectClient($socket)\n {\n $client = new WebSocketClient($this, $socket);\n\n $this->clients[] = $client;\n $this->sockets[] = $socket;\n\n $this->debug('Socket #' . $client->id . ' connected.');\n\n $this->onClientConnected($client);\n }",
"protected function _getSocket() {\n\t\t$f3 = \\Base::instance();\n\t\t$host = $f3->get(\"pushconfig.host\");\n\t\t$port = $f3->get(\"pushconfig.port\");\n\t\tif (!$this->_socket) {\n\t\t\t$this->_socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n\t\t\tif($f3->get(\"pushconfig.enabled\")) {\n\t\t\t\t$result = @socket_connect($this->_socket, $host, $port);\n\t\t\t\t$f3->set(\"push_socket_status\", $result);\n\t\t\t\tif(!$result) {\n\t\t\t\t\t$err = socket_last_error();\n\t\t\t\t\t$str = socket_strerror($err);\n\t\t\t\t\t$log = new \\Log(\"push.log\");\n\t\t\t\t\t$log->write(\"Failed to create socket connection: [$err] $str\");\n\t\t\t\t\t$f3->set(\"error\", \"An error occurred connecting to the push server.\");\n\t\t\t\t}\n\t\t\t\tsocket_write($this->_socket, \"TEST MESSAGE\");\n\t\t\t}\n\t\t}\n\t\treturn $this->_socket;\n\t}",
"public function createClient($address)\n {\n $that = $this;\n $factory = $this->rawFactory;\n\n return $this->resolve($address)->then(function ($address) use ($factory, $that){\n $deferred = new Deferred();\n\n $socket = $factory->createFromString($address, $scheme);\n if ($socket->getType() !== SOCK_STREAM) {\n $socket->close();\n throw new Exception('Not a stream address scheme');\n }\n\n $socket->setBlocking(false);\n\n try{\n // socket is nonblocking, so connect should emit EINPROGRESS\n $socket->connect($address);\n\n // socket is already connected immediately?\n $deferred->resolve(new Connection($socket, $that->getSocketLoop()));\n }\n catch(Exception $exception)\n {\n if ($exception->getCode() === SOCKET_EINPROGRESS) {\n // connection in progress => wait for the socket to become writable\n $that->getSocketLoop()->addWriteStream($socket->getResource(), function ($resource, $loop) use ($deferred, $socket){\n // only poll for writable event once\n $loop->removeWriteStream($resource);\n\n try {\n // assert that socket error is 0 (no TCP RST received)\n $socket->assertAlive();\n }\n catch (Exception $e) {\n // error returned => connected failed\n $socket->close();\n\n $deferred->reject(new Exception('Error while establishing connection' , $e->getCode(), $e));\n return;\n }\n\n // no error => connection established\n $deferred->resolve(new Connection($socket, $loop));\n });\n } else {\n // re-throw any other socket error\n $socket->close();\n $deferred->reject($exception);\n }\n }\n return $deferred->promise();\n });\n }",
"public function getSocket()\n {\n if (is_null($this->socket)) {\n $this->gateway = $this->getGateway();\n $this->socket = new Client($this->gateway);\n }\n\n return $this->socket;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |