query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Get compare fields data. | function basel_get_compare_fields() {
$fields = array(
'basic' => '',
);
$fields_settings = basel_get_opt('fields_compare');
if ( class_exists( 'XTS\Options' ) && count( $fields_settings ) > 1 ) {
$fields_labels = basel_compare_available_fields( true );
foreach ( $fields_settings as $field ) {
if ( isset( $fields_labels [ $field ] ) ) {
$fields[ $field ] = $fields_labels [ $field ]['name'];
}
}
return $fields;
}
if ( isset( $fields_settings['enabled'] ) && count( $fields_settings['enabled'] ) > 1 ) {
$fields = $fields + $fields_settings['enabled'];
unset( $fields['placebo'] );
}
return $fields;
} | [
"public function getComparisonFields() {\n return $this->comparisonFields;\n }",
"public function getChangedData()\n {\n\t\t$data = [];\n\t\t$changed_fields = $this->changedFields();\n\t\tforeach ($changed_fields as $field) {\n\t\t\t$data[$field] = $this->{$field};\n\t\t}\n\t\treturn $data;\n\t}",
"public function getChangedFields()\n {\n // the eventual list of changed fields and values\n $changed = [];\n\n // the list of relations\n $related = $this->type->getRelationNames();\n\n // go through all the data elements and their presumed new values\n foreach ($this->data as $field => $new) {\n\n // if the field is a related record or collection, skip it.\n // technically, we should ask it if it has changed at all.\n if (in_array($field, $related)) {\n continue;\n }\n\n // if the field is not part of the initial data ...\n if (! array_key_exists($field, $this->initial_data)) {\n // ... then it's a change from the initial data.\n $changed[$field] = $new;\n continue;\n }\n\n // what was the old (initial) value?\n $old = $this->initial_data[$field];\n\n // are both old and new values numeric?\n $numeric = is_numeric($old) && is_numeric($new);\n\n // if both old and new are numeric, compare loosely.\n if ($numeric && $old != $new) {\n // loosely different, retain the new value\n $changed[$field] = $new;\n }\n\n // if one or the other is not numeric, compare strictly\n if (! $numeric && $old !== $new) {\n // strictly different, retain the new value\n $changed[$field] = $new;\n }\n }\n\n // done!\n return $changed;\n }",
"public function getCommonFields()\n {\n return $this->common_fields;\n }",
"public function getDataFields()\n {\n \treturn $this->_data_fields;\n }",
"public function testCompareFields() {\n\t\t$this->Customer->data = array(\n\t\t\t'Customer' => array(\n\t\t\t\t'field1' => 'foo',\n\t\t\t\t'field2' => 'bar'));\n\t\t$this->assertFalse($this->Customer->compareFields('field1', 'field2'));\n\n\t\t$this->Customer->data = array(\n\t\t\t'Customer' => array(\n\t\t\t\t'field1' => 'foo',\n\t\t\t\t'field2' => 'foo'));\n\t\t$this->assertTrue($this->Customer->compareFields('field1', 'field2'));\n\t}",
"public function getCompare()\n {\n return $this->compare_value;\n }",
"public function getDataFields()\n {\n return $this->dataFields;\n }",
"function _rules_diff_difference_data_info() {\n return array(\n 'type' => array(\n 'type' => 'integer',\n 'label' => t('The difference type'),\n 'options list' => '_rules_diff_differences_types',\n ),\n 'subject_name' => array(\n 'type' => 'text',\n 'label' => t('The name of the comparison subject'),\n ),\n 'line' => array(\n 'type' => 'integer',\n 'label' => t('The line where the difference appears'),\n ),\n 'difference' => array(\n 'type' => 'text',\n 'label' => t('The difference'),\n ),\n 'order' => array(\n 'type' => 'integer',\n 'label' => t('Order'),\n ),\n );\n}",
"public function getContactDataFields();",
"public function field_data()\n {\n return array();\n }",
"public function field_data()\r\n {\r\n return array();\r\n }",
"public function getMergeFields();",
"public function getFields();",
"public function getData() {\n $result = array();\n foreach ($this->log_entry_fields as $field) {\n $result[$field] = $this->$field;\n }\n return $result;\n }",
"public function getFieldsChanged() {\n\t\t$changed=array();\n\t\tif (!$this->isChanged()) {\n\t\t\treturn $changed;\n\t\t}\n\t\t$old=$this->getOldInstance()->toArray();\n\t\t$new=$this->toArray();\n\t\tforeach ($old as $fieldId=>$value) {\n\t\t\tif ($new[$fieldId]!==$value) {\n\t\t\t\t$changed[]=$fieldId;\n\t\t\t}\n\t\t}\n\t\treturn $changed;\n\t}",
"public function loadFieldsData()\n {\n return $this->db_connector_object->loadAllFieldsData();\n }",
"public function getFields()\n {\n return array_keys($this->data);\n }",
"public function getActualFields(){\r\n $fields=$this->getFields();\r\n $new_fields=array();\r\n $actual_fields=$this->actual_fields;\r\n if(!is_null($actual_fields)){\r\n foreach($actual_fields as $field)if(isset($fields[$field])){\r\n $new_fields[$field]=$fields[$field];\r\n }\r\n }else{\r\n foreach($fields as $field=>$def){\r\n if($def->visible()===true)$new_fields[$field]=$def;\r\n }\r\n }\r\n return $new_fields;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add_filter( 'login_errors', 'ZPDBRAND_login_errors' ); ============================================================================================================ ================================================== DEMO 2 ================================================== ============================================================================================================ Add ZPD custom login logo | function ZPDBRAND_login_logo() {
$logo_url = ZPDBRAND_PLUGIN_URL . 'img/zpd-login-logo.png';
echo "
<style>
body.login #login h1 a {
background: url('" . $logo_url . "') no-repeat scroll center top transparent !important;
height: 64px;
width: 100%;
}
</style>
";
} | [
"public function custom_login_logo() {\n\t echo '<style type=\"text/css\">\n\t .login h1 a { background-size:auto; width:100%; height:150px; background-position:center center; background-image:url('.get_bloginfo('template_directory').'/public/images/logos/admin-logo.svg) !important; }\n\t </style>';\n\t}",
"function revolt_login_logo()\n{\n?>\n <style type=\"text/css\">\n #adminmenu,\n #adminmenu .wp-submenu,\n #adminmenuback,\n #adminmenuwrap,\n #wp-auth-check-wrap #wp-auth-check {\n background: #000;\n }\n\n #login h1 a,\n .login h1 a {\n background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/assets/images/logo.png);\n height: auto;\n width: 320px;\n background-size: contain;\n background-repeat: no-repeat;\n padding-bottom: 50px;\n }\n\n body.login {\n background: #000;\n }\n\n body.login form {\n background: #fff;\n box-shadow: 0 5px 30px 0 rgba(255, 255, 255, 0.17);\n }\n\n body.login form label {\n color: #000;\n }\n\n body.login form input[type=\"text\"],\n body.login form input[type=\"password\"],\n body.login form input[type=\"checkbox\"] {\n background: #fff !important;\n border-color: #000;\n outline: 0;\n }\n\n body.login form input[type=\"text\"]:focus,\n body.login form input[type=\"password\"]:focus,\n body.login form input[type=\"checkbox\"]:focus {\n outline: 0;\n box-shadow: none;\n }\n\n body.login .button.wp-hide-pw .dashicons {\n color: #000;\n }\n\n body.login form input[type=\"submit\"] {\n background: #fb5778 !important;\n border-color: #fb5778 !important;\n transition: all 0.4s ease !important;\n text-shadow: none !important;\n box-shadow: none !important;\n border-radius: 0 !important;\n }\n\n body.login form input[type=\"submit\"]:hover {\n background: #3edea8 !important;\n border-color: #3edea8 !important;\n color: #fff !important;\n text-shadow: none !important;\n }\n\n body.login #login_error,\n body.login .message,\n body.login .success {\n border-left: 4px solid #fb5778;\n }\n\n\n\n .login #backtoblog a,\n .login #nav a {\n color: #3edea8 !important;\n transition: color 0.4s ease;\n }\n\n .login #backtoblog a:hover,\n .login #nav a:hover,\n .login h1 a:hover {\n color: #3edea8 !important;\n }\n </style>\n<?php\n}",
"function thaim_login_screen_logo() {\n\t$logo_icon_url = get_site_icon_url( 84 );\n\n\tif ( ! empty( $logo_icon_url ) ) {\n\t\twp_add_inline_style( 'login', sprintf( '\n\t\t\t#login h1 a {\n\t\t\t\tbackground-image: none, url(%s);\n\t\t\t}\n\n\t\t\t#login p.submit .button-primary.button-large {\n\t\t\t\tcolor: #FFF;\n\t\t\t\tbackground-color: #23282d;\n\t\t\t\tborder-color: #23282d;\n\t\t\t\t-webkit-box-shadow: none;\n\t\t\t\tbox-shadow: none;\n\t\t\t\ttext-shadow: none;\n\t\t\t}\n\n\t\t\t#login p.submit .button-primary.button-large:hover {\n\t\t\t\tcolor: #23282d;\n\t\t\t\tbackground-color: #FFF;\n\t\t\t\tborder-color: #23282d;\n\t\t\t}\n\n\t\t\ta:focus {\n\t\t\t\tcolor: #23282d;\n\t\t\t\t-webkit-box-shadow: none;\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n\n\t\t\t#login input[type=\"text\"]:focus,\n\t\t\t#login input[type=\"password\"]:focus {\n\t\t\t\tborder-color: #23282d;\n\t\t\t\t-webkit-box-shadow: none;\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n\t\t', esc_url_raw( $logo_icon_url ) ) );\n\t}\n}",
"function sp_custom_login_logo() {\n echo '<style type=\"text/css\">\n\t\tbody.login{ background-color:#ffffff; }\n .login h1 a { background-image:url('.SP_ASSETS_THEME.'images/logo.png) !important; height:87px !important; width:395px !important; background-size: auto auto !important; margin-left:-35px;}\n </style>';\n}",
"public function custom_login_logo() {\n\t\techo '<style type=\"text/css\">\n\t\th1 a { background-image: url('.get_bloginfo('template_directory').'/assets/img/logo.svg) !important;\n\t\t background-size: 100% !important;\n\t\t width: 100% !important;\n\t\t height: 125px !important;\n\t\t pointer-events: none;\n\t\t}\n\t\t</style>';\n\t}",
"public function customLoginLogo()\n\t\t{\n\t\t\t$login_logo = thb_get_option('login_logo');\n\n\t\t\tif ( empty( $login_logo ) || $login_logo == '' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$url = thb_image_get_size( $login_logo );\n\t\t\t$background_size = 'auto';\n\t\t\t$attachment_metadata = wp_get_attachment_metadata( $login_logo );\n\n\t\t\tif ( $attachment_metadata ) {\n\t\t\t\t$height = $attachment_metadata['height'];\n\t\t\t\t$width = $attachment_metadata['width'];\n\t\t\t\t$ratio = $width/$height;\n\n\t\t\t\tif ( $width > 320 ) {\n\t\t\t\t\t$background_size = 'contain';\n\t\t\t\t\t$width = 320;\n\t\t\t\t\t$height = $width/$ratio;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\techo '<style type=\"text/css\">\n\t\t\t\t.login h1 a {\n\t\t\t\t\twidth: ' . intval($width) . 'px;\n\t\t\t\t\theight: ' . intval($height) . 'px;\n\t\t\t\t\tmargin: 0 auto;\n\t\t\t\t\tbackground-size: ' . $background_size . ';\n\t\t\t\t\tbackground-image: url(\"'. $url .'\") !important;\n\t\t\t\t}\n\t\t\t</style>';\n\t\t}",
"public function custom_login_logo() {\n echo '<style type=\"text/css\">';\n echo '.login h1 a {';\n echo 'width:100%;';\n echo 'background-image: url('.$this->theme_url( 'assets/images/logo.png' ).');';\n echo 'background-size: 100%;';\n echo 'padding-bottom: 30px;}';\n echo '</style>';\n }",
"function ts_admin_login_logo() {\n $admin_logo = ts_get_option( 'slupy_adminlogo' );\n if ( $admin_logo ) {\n $admin_logo = wp_get_attachment_image_src( $admin_logo, 'full' );\n echo '<style type=\"text/css\">\n body.login div#login h1 a {\n background-image: url(\"'.esc_url( $admin_logo[0] ).'\");\n padding-bottom: 70px;\n width: auto;\n background-size: 100%;\n }\n </style>';\n }\n }",
"function add_login_logo() {\n\t$logo = Altis\\get_config()['modules']['cms']['login-logo'];\n\t?>\n\t<style>\n\t\t.login h1 a {\n\t\t\tbackground-image: url('<?php echo esc_url( get_site_url( get_main_site_id( get_main_network_id() ), $logo ) ); ?>');\n\t\t\tbackground-size: contain;\n\t\t\twidth: auto;\n\t\t}\n\t</style>\n\t<?php\n}",
"function wp_login_fluency_custom_logo() {\n\techo get_option('fluency_login_logo')!='' ? '<style type=\"text/css\">#login h1 a { background-image:url('.get_option('fluency_login_logo').') !important; }</style>' : null;\n}",
"function eazy_login_logo_settings_callback_function() {\n _e('<p class=\"eazy-site-settings-section-descrip\">You can add a custom login logo to the wp-admin login screen.</p>', 'ez-site-settings');\n }",
"public function login_head() { \n\n\t\t\t// Get the custom logo from the Customizer.\t\t\t\n\t\t\t$logo = wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ) , 'full' );\n\n\t\t\t// Make sure the logo is PNG.\n\t\t\tif( $logo && $this->get_image_type( $logo[0] ) === 'image/png' ) {\n\n\t\t\t\t$logo['brightness'] = $this->image_brightness( imagecreatefrompng( $logo[0] ) ); ?>\n\t\t\t\n\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t\n\t\t\t\t\t<?php \n\t\t\t\t\t// If the logo is too bright, change the body background color. \n\t\t\t\t\tif( $logo['brightness'] >= apply_filters( 'ascripta_login_threshold', 30.00 ) ) { ?>\n\t\t\t\t\tbody {\n\t\t\t\t\t\tbackground-color: #222;\n\t\t\t\t\t}\n\t\t\t\t\t<?php } ?>\n\n\t\t\t\t\t<?php // If we are using a custom logo, change the default login one. \n\t\t\t\t\tif( $logo ): ?>\n\t\t\t\t\t.login h1 a {\n\t\t\t\t\t\tmargin-bottom: 2em;\n\t\t\t\t\t\twidth: <?php echo $logo[1] . 'px'; ?>;\n\t\t\t\t\t\theight: <?php echo $logo[2] . 'px'; ?>;\n\t\t\t\t\t\tbackground-image: url( '<?php echo $logo[0]; ?>' );\n\t\t\t\t\t\tbackground-size: <?php echo $logo[1] . 'px'; ?> <?php echo $logo[2] . 'px'; ?>\n\t\t\t\t\t}\n\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t</style>\n\n\t\t\t<?php } ?>\n\n\t\t<?php }",
"function pxls_login_logo_title() {\n\treturn \"Powered by WordPress and PXLS:Themes\";\n}",
"function hc_replace_login_logo() {\n\n\t?><style type=\"text/css\">\n\t\t.login h1 a {\n\t\t\tbackground-image: url(<?php echo get_stylesheet_directory_uri() ?>/build/images/login-logo.svg);\n\n\t\t\t/* Adjust to the dimensions of your logo. WP Default: 80px 80px */\n\t\t\tbackground-size: 70px 80px;\n\t\t\twidth: 70px;\n\t\t\theight: 80px;\n\t\t}\n\t</style>\n\t<?php\n\n}",
"function bfg_replace_login_logo() {\n\n\t?><style type=\"text/css\">\n\t\tbody.login h1 a {\n\t\t\tbackground-image: url(<?php echo get_stylesheet_directory_uri(); ?>/images/login-logo.svg);\n\n\t\t\t/* Adjust to the dimensions of your logo. WP Default: 84px 84px */\n\t\t\tbackground-size: 84px 84px;\n\t\t\twidth: 84px;\n\t\t\theight: 84px;\n\t\t}\n\t</style>\n\t<?php\n\n}",
"private function print_login_logo() {\n\t\t\t$logo_url = get_header_image();\n\t\t\tif ( $logo_url ) {\n\t\t\t\t$logo_url_stylesheet = '<style type=\"text/css\">';\n\t\t\t\t$logo_url_stylesheet .= '#login h1 a, .login h1 a {background-image: url(';\n\t\t\t\t$logo_url_stylesheet .= $logo_url;\n\t\t\t\t$logo_url_stylesheet .= ')}';\n\t\t\t\t$logo_url_stylesheet .= '</style>';\n\t\t\t\techo $logo_url_stylesheet;\n\t\t\t}\n\t\t}",
"function custom_logo_login_url() {\n return home_url();\n}",
"static public function login_logo() {\n return '<img src=\"/packages/cmf/img/peskycmf-logo-black.svg\" width=\"340\" alt=\" \" class=\"mb15\">';\n }",
"function klyp_admin_login_logo_url_title()\n{\n return 'Site by Klyp';\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns element from 'topics' list at given offset | public function getTopicsAt($offset)
{
return $this->get(self::topics, $offset);
} | [
"public function itemAt($offset) {\n $slice = array_slice($this->items, $offset, 1);\n return $slice[0];\n }",
"public function offsetGet($offset);",
"public function offsetGet($offset) {\n $hash = md5($offset);\n if (isset($this->items[$hash])) {\n return $this->items[$hash];\n }\n\n $indexElement = $this->findInIndex($offset);\n\n if (!empty($indexElement)) {\n return $indexElement;\n }\n\n return $this->findElement($offset);\n }",
"public function offsetGet($offset){\r\n return $this->collection[$offset];\r\n }",
"public function offsetGet($offset)\n {\n return $this->tokens[$offset];\n }",
"public function offsetGet($offset)\n {\n return $this->body[$offset];\n }",
"public static function offset($stamp, $offset);",
"function offsetGet ($offset)\n\t{\n\t\tif (is_numeric($offset)) {\n\t\t\t$found = parent::offsetGet($offset);\n\t\t} else {\n\t\t\t$found = null;\n\t\t}\n\t\tif (!$found && is_string($offset)) {\n\t\t\t$found = $this->namedItem($offset);\n\t\t\tif ($found->length === 0) {\n\t\t\t\t$found = null;\n\t\t\t}\n\t\t}\n\t\treturn $found;\n\t}",
"function offsetGet ($offset)\n\t{\n\t\tif (is_numeric($offset)) {\n\t\t\t$found = parent::offsetGet($offset);\n\t\t} else {\n\t\t\t$found = null;\n\t\t}\n\t\tif (!$found && is_string($offset)) {\n\t\t\t$found = $this->namedItem($offset);\n\t\t}\n\t\treturn $found;\n\t}",
"public function getTechAt($offset)\n {\n return $this->get(self::TECH, $offset);\n }",
"public function getTutorialAt($offset)\n {\n return $this->get(self::_TUTORIAL, $offset);\n }",
"public function getMsgListAt($offset)\n {\n return $this->get(self::msg_list, $offset);\n }",
"public function getTalksAt($offset)\n {\n return $this->get(self::TALKS, $offset);\n }",
"public function offsetGet($offset)\n {\n return $this->_handler->get($offset);\n }",
"function offsetGet($offset)\n {\n return $this->transformations[$offset];\n }",
"public function getItemAt($offset)\n {\n return $this->get(self::ITEM, $offset);\n }",
"public function findOneByOffset($offset)\n {\n $extensions = $this->findAll();\n $extensions = array_values($extensions);\n $offset = (int)$offset;\n if (!empty($extensions[$offset])) {\n return $extensions[$offset];\n }\n return null;\n }",
"public function urlAt($offset) {\n return $this->urls->get($offset);\n }",
"public function offsetGet($offset)\n\t{\n\t\treturn $this->_data[$offset];\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for getDeviceSwitchRoutingInterfaces List layer 3 interfaces for a switch. | public function testGetDeviceSwitchRoutingInterfaces()
{
} | [
"public function testGetNetworkSwitchStackRoutingInterfaces()\n {\n }",
"public function testUpdateDeviceSwitchRoutingInterface()\n {\n }",
"function get_interfaces_with_gateway() {\n\n\t$ints = array();\n\n\t/* loop interfaces, check config for outbound */\n\tforeach (config_get_path('interfaces', []) as $ifdescr => $ifname) {\n\t\tswitch ($ifname['ipaddr']) {\n\t\t\tcase \"dhcp\":\n\t\t\tcase \"pppoe\":\n\t\t\tcase \"pptp\":\n\t\t\tcase \"l2tp\":\n\t\t\tcase \"ppp\":\n\t\t\t\t$ints[$ifdescr] = $ifdescr;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif (substr($ifname['if'], 0, 4) == \"ovpn\" ||\n\t\t\t\t !empty($ifname['gateway'])) {\n\t\t\t\t\t$ints[$ifdescr] = $ifdescr;\n\t\t\t\t} elseif (substr($ifname['if'], 0, 5) == \"ipsec\" ||\n\t\t\t\t !empty($ifname['gateway'])) {\n\t\t\t\t\t$ints[$ifdescr] = $ifdescr;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn $ints;\n}",
"private function mapInterfaces()\n {\n $log = new Log();\n $oidList = $this->getBaseData();\n foreach ($oidList->getAll() as $oid => $value) {\n if (strpos($oid, '1.3.6.1.2.1.2.2.1.2.') !== false) {\n try {\n $boom = explode(\".\", $oid);\n $interfaceID = $boom[count($boom) - 1];\n\n try {\n $interfaceType = $oidList->get('1.3.6.1.2.1.2.2.1.3.' . $interfaceID);\n /**\n * Some interface types, we don't want to show.\n * 6 = Ethernet\n * 71 = Radio Spread Spectrum\n * 157 = Wireless P2P\n * 250 = GPON\n */\n if (!in_array($interfaceType, [6, 71, 157, 250])) {\n continue;\n }\n\n if (!isset($this->interfaces[$interfaceID])) {\n $this->interfaces[$interfaceID] = new NetworkInterface($interfaceID);\n }\n\n $this->interfaces[$interfaceID]->setName($value);\n\n $this->interfaces[$interfaceID]->setType($interfaceType);\n } catch (SnmpException $e) {\n $log->exception($e, [\n 'ip' => $this->device->getIp()\n ]);\n continue;\n }\n\n try {\n if (Formatter::validateMac($oidList->get('1.3.6.1.2.1.2.2.1.6.' . $interfaceID)) === true) {\n $this->interfaces[$interfaceID]->setMacAddress($oidList->get('1.3.6.1.2.1.2.2.1.6.' . $interfaceID));\n }\n } catch (SnmpException $e) {\n $log->exception($e, [\n 'ip' => $this->device->getIp()\n ]);\n }\n\n try {\n // ifOperStatus 1 = up\n // ifOperStatus 2 = down\n $this->interfaces[$interfaceID]->setStatus($oidList->get('1.3.6.1.2.1.2.2.1.8.' . $interfaceID) == 1);\n } catch (SnmpException $e) {\n $log->exception($e, [\n 'ip' => $this->device->getIp()\n ]);\n }\n\n try {\n $speed = $oidList->get('1.3.6.1.2.1.2.2.1.5.' . $interfaceID);\n if (is_numeric($speed) && $speed > 0) {\n $this->interfaces[$interfaceID]->setSpeedIn((int)ceil($speed/1000**2));\n $this->interfaces[$interfaceID]->setSpeedOut((int)ceil($speed/1000**2));\n }\n } catch (SnmpException $e) {\n $log->exception($e, [\n 'ip' => $this->device->getIp()\n ]);\n }\n\n //Try 64bit counters first, then fall back to 32bit\n try {\n $this->interfaces[$interfaceID]->setOctetsIn($oidList->get('1.3.6.1.2.1.31.1.1.1.6.' . $interfaceID));\n } catch (Throwable $e) {\n try {\n $this->interfaces[$interfaceID]->setOctetsIn($oidList->get('1.3.6.1.2.1.2.2.1.10.' . $interfaceID));\n } catch (Throwable $e) {\n $log->exception($e, [\n 'ip' => $this->device->getIp()\n ]);\n }\n }\n\n try {\n $this->interfaces[$interfaceID]->setOctetsOut($oidList->get('1.3.6.1.2.1.31.1.1.1.10.' . $interfaceID));\n } catch (Throwable $e) {\n try {\n $this->interfaces[$interfaceID]->setOctetsOut($oidList->get('1.3.6.1.2.1.2.2.1.16.' . $interfaceID));\n } catch (Throwable $e) {\n $log->exception($e, [\n 'ip' => $this->device->getIp()\n ]);\n }\n }\n\n try {\n $this->interfaces[$interfaceID]->setPpsIn($oidList->get('1.3.6.1.2.1.31.1.1.1.7.' . $interfaceID));\n } catch (Throwable $e) {\n try {\n $this->interfaces[$interfaceID]->setPpsIn($oidList->get('1.3.6.1.2.1.2.2.1.11.' . $interfaceID));\n } catch (Throwable $e) {\n $log->exception($e, [\n 'ip' => $this->device->getIp()\n ]);\n }\n }\n\n try {\n $this->interfaces[$interfaceID]->setPpsOut($oidList->get('1.3.6.1.2.1.31.1.1.1.11.' . $interfaceID));\n } catch (Throwable $e) {\n try {\n $this->interfaces[$interfaceID]->setPpsOut($oidList->get('1.3.6.1.2.1.2.2.1.17.' . $interfaceID));\n } catch (Throwable $e) {\n $log->exception($e, [\n 'ip' => $this->device->getIp()\n ]);\n }\n }\n\n try {\n $this->interfaces[$interfaceID]->setDiscardsIn($oidList->get('1.3.6.1.2.1.2.2.1.13.' . $interfaceID));\n } catch (Throwable $e) {\n $log->exception($e, [\n 'ip' => $this->device->getIp()\n ]);\n }\n\n try {\n $this->interfaces[$interfaceID]->setErrorsIn($oidList->get('1.3.6.1.2.1.2.2.1.14.' . $interfaceID));\n } catch (Throwable $e) {\n $log->exception($e, [\n 'ip' => $this->device->getIp()\n ]);\n }\n\n try {\n $this->interfaces[$interfaceID]->setDiscardsOut($oidList->get('1.3.6.1.2.1.2.2.1.19.' . $interfaceID));\n } catch (Throwable $e) {\n $log->exception($e, [\n 'ip' => $this->device->getIp()\n ]);\n }\n\n try {\n $this->interfaces[$interfaceID]->setErrorsOut($oidList->get('1.3.6.1.2.1.2.2.1.20.' . $interfaceID));\n } catch (Throwable $e) {\n $log->exception($e, [\n 'ip' => $this->device->getIp()\n ]);\n }\n } catch (Throwable $e) {\n $log->exception($e, [\n 'ip' => $this->device->getIp()\n ]);\n }\n }\n }\n }",
"public function testGetDeviceSwitchRoutingInterface()\n {\n }",
"function getInterfaces();",
"public function getDeviceSwitchRoutingInterfacesWithHttpInfo($serial)\n {\n $returnType = 'object';\n $request = $this->getDeviceSwitchRoutingInterfacesRequest($serial);\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 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function testUpdateNetworkSwitchStackRoutingInterface()\n {\n }",
"function get_ipv6_if_list() {\n global $err_lib, $config, $section;\n $list = array('' => '');\n $interfaces = get_configured_interface_with_descr(true);\n $dyn_v6_ifs = array();\n foreach ($interfaces as $iface => $ifacename) {\n switch ($config['interfaces'][$iface]['ipaddrv6']) {\n case \"6to4\":\n case \"6rd\":\n case \"dhcp6\":\n $dyn_v6_ifs[$iface] = array(\n 'name' => $ifacename,\n 'ipv6_num_prefix_ids' => pow(2, (int) calculate_ipv6_delegation_length($iface)) - 1);\n break;\n default:\n continue 2;\n }\n }\n return($dyn_v6_ifs);\n}",
"public function getInterfaces() {}",
"public function getInterfaces();",
"protected function getDeviceSwitchRoutingInterfacesRequest($serial)\n {\n // verify the required parameter 'serial' is set\n if ($serial === null || (is_array($serial) && count($serial) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $serial when calling getDeviceSwitchRoutingInterfaces'\n );\n }\n\n $resourcePath = '/devices/{serial}/switch/routing/interfaces';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($serial !== null) {\n $resourcePath = str_replace(\n '{' . 'serial' . '}',\n ObjectSerializer::toPathValue($serial),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function guifi_get_device_interfaces($id,$iid = NULL, $used = NULL) {\n\n if (!is_array($used))\n $used = array(''=>t('Create new remote interface'));\n\n if (empty($id))\n return $used;\n\n if (empty($iid))\n $iid = 0;\n\n guifi_log(GUIFILOG_TRACE,'guifi_get_device_interfaces(id - iid)',$id.' - '.$iid);\n guifi_log(GUIFILOG_TRACE,'guifi_get_device_interfaces(iid)',$id);\n\n $did = explode('-',$id);\n\n if (!is_numeric($did[0]))\n return $used;\n\n $sql_i = '\n SELECT id, interface_type, connto_iid\n FROM {guifi_interfaces}\n WHERE device_id = ' .$did[0];\n\n $sql_i .=\n ' AND ( interface_class = \"ethernet\" OR interface_class = \"vlan\" OR interface_class = \"bridge\" OR\n ( interface_class is NULL AND (radiodev_counter is NULL OR upper(interface_type) IN (\"WLAN/LAN\"))))';\n\n guifi_log(GUIFILOG_TRACE,'guifi_get_devicename(sql)',$sql_i);\n\n $qi = db_query($sql_i);\n\n while ($i = db_fetch_object($qi)) {\n if ( ((empty($i->connto_did)) and (empty($i->connto_iid)) ) or ($i->id == $iid)) {\n $trimmed_itype = trim($i->interface_type);\n if (!empty($trimmed_itype))\n $used[$i->id] = $i->interface_type;\n }\n }\n\n return $used;\n}",
"public function testGetNetworkSwitchStackRoutingInterface()\n {\n }",
"public function testGetDeviceSwitchRoutingInterfaceDhcp()\n {\n }",
"function get_ipv6_if_list() {\n\tglobal $err_lib, $config, $section;\n\t$list = array('' => '');\n\t$interfaces = get_configured_interface_with_descr(true);\n\t$dyn_v6_ifs = array();\n\tforeach ($interfaces as $iface => $ifacename) {\n\t\tswitch ($config['interfaces'][$iface]['ipaddrv6']) {\n\t\t\tcase \"6to4\":\n\t\t\tcase \"6rd\":\n\t\t\tcase \"dhcp6\":\n\t\t\t\t$dyn_v6_ifs[$iface] = array(\n\t\t\t\t\t'name' => $ifacename,\n\t\t\t\t\t'ipv6_num_prefix_ids' => pow(2, (int) calculate_ipv6_delegation_length($iface)) - 1);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tcontinue 2;\n\t\t}\n\t}\n\treturn($dyn_v6_ifs);\n}",
"function captiveportal_zone_interfaces($cpcfg) {\n\tglobal $FilterIflist;\n\n\t$interfaces = '';\n\tforeach (explode(\",\", $cpcfg['interface']) as $cpifgrp) {\n\t\tif (isset($FilterIflist[$cpifgrp])) {\n\t\t\t$realif = get_real_interface($cpifgrp);\n\t\t\tif (!empty($realif) && get_interface_ip($realif)) {\n\t\t\t\t$interfaces .= $realif . ' ';\n\t\t\t}\n\t\t}\n\t}\n\treturn $interfaces;\n}",
"protected function getNetworkSwitchStackRoutingInterfacesRequest($network_id, $switch_stack_id)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling getNetworkSwitchStackRoutingInterfaces'\n );\n }\n // verify the required parameter 'switch_stack_id' is set\n if ($switch_stack_id === null || (is_array($switch_stack_id) && count($switch_stack_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $switch_stack_id when calling getNetworkSwitchStackRoutingInterfaces'\n );\n }\n\n $resourcePath = '/networks/{networkId}/switch/stacks/{switchStackId}/routing/interfaces';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n // path params\n if ($switch_stack_id !== null) {\n $resourcePath = str_replace(\n '{' . 'switchStackId' . '}',\n ObjectSerializer::toPathValue($switch_stack_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testUpdateDeviceSwitchRoutingInterfaceDhcp()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve the value for the "TimezoneSetting" output from this CreateEvent execution. | public function getTimezoneSetting()
{
return $this->get('TimezoneSetting');
} | [
"protected function timezone()\n {\n return config('watchdog.date.timezone', 'UTC');\n }",
"public function getTimezone() {\n return $this->timezone;\n }",
"function get_timezone(){\n\t\t$tzvalue = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_GOOGLE_CALENDAR_FEED, 'timezone');\n\t\treturn $tzvalue[0]['attribs']['']['value'];\n\t}",
"public function getUserTimezone()\n {\n if (array_key_exists(\"userTimezone\", $this->_propDict)) {\n return $this->_propDict[\"userTimezone\"];\n } else {\n return null;\n }\n }",
"public function getOutputTimezone(): string\n {\n return $this->outputTimezone;\n }",
"public function getEventTimezoneObj(){\n if( $this->_eventTimezoneObj === null ){\n $this->_eventTimezoneObj = new DateTimeZone( $this->getTimezoneName() );\n }\n return $this->_eventTimezoneObj;\n }",
"public function get_timezone()\n\t{\n\t\treturn $this->timezone;\n\t}",
"public function getTimezoneName(){\n return $this->timezoneName;\n }",
"public function getDisplayTimezone()\n {\n if (!empty(Yii::$app->params['locationTimezone'])) {\n return Yii::$app->params['locationTimezone'];\n } elseif (!empty($this->locationTimezone)) {\n return $this->displayTimezone;\n } else {\n return null;\n }\n }",
"public function getTimeZone()\n {\n return $this->readOneof(3);\n }",
"public function getTimeZone()\n {\n return $this->time_zone;\n }",
"protected function scheduleTimezone()\n {\n $config = $this->app['config'];\n\n return $config->get('app.schedule_timezone', $config->get('app.timezone'));\n }",
"public function getSystemTimezone()\n {\n return config('app.timezone');\n }",
"public function getTimezoneObject()\r\n\t{\r\n\t return Time::getTimezoneObject($this->getTimezone());\r\n\t}",
"public function getTimeZone()\n {\n if (array_key_exists(\"timeZone\", $this->_propDict)) {\n return $this->_propDict[\"timeZone\"];\n } else {\n return null;\n }\n }",
"public function getTimezoneString();",
"public function getTzid()\n {\n return $this->tzid;\n }",
"public function getTimezoneAttribute()\n {\n return $this->m_timezoneAttribute;\n }",
"public function getTimezoneConversion()\n {\n return $this->timezoneConversion;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the axis labels | public function getAxisLabels()
{
return $this->googleChart->getParam('chxl');
} | [
"public function getLabelsOnAxis() {\r\n return $this->labels->bOnAxis;\r\n }",
"public function get_axis_label() {\n return $this->axis_label;\n }",
"public function getXAxisLabels() {\n $data = $this->_getSpreadSheetData(2, null, 1, 1);\n return $data[1];\n }",
"private function getLabels() {\n\t\t$x = 0;\n\t\t$y = 0;\n\t\t$labels = [];\n\n\t\tif ($this->type == GRAPH_YAXIS_SIDE_BOTTOM) {\n\t\t\t$axis = 'x';\n\t\t\t$y = $this->height - CSvgGraph::SVG_GRAPH_X_AXIS_LABEL_MARGIN;\n\t\t}\n\t\telse {\n\t\t\t$axis = 'y';\n\t\t\t$x = ($this->type == GRAPH_YAXIS_SIDE_RIGHT)\n\t\t\t\t? CSvgGraph::SVG_GRAPH_Y_AXIS_RIGHT_LABEL_MARGIN\n\t\t\t\t: $this->width - CSvgGraph::SVG_GRAPH_Y_AXIS_LEFT_LABEL_MARGIN;\n\t\t}\n\n\t\tforeach ($this->labels as $pos => $label) {\n\t\t\t$$axis = $pos;\n\n\t\t\tif ($this->type == GRAPH_YAXIS_SIDE_LEFT || $this->type == GRAPH_YAXIS_SIDE_RIGHT) {\n\t\t\t\t// Flip upside down.\n\t\t\t\t$y = $this->height - $y;\n\t\t\t}\n\n\t\t\tif ($this->type == GRAPH_YAXIS_SIDE_BOTTOM) {\n\t\t\t\tif (count($labels) == 0) {\n\t\t\t\t\t$text_tag_x = max($this->x + $x, strlen($label) * 4);\n\t\t\t\t}\n\t\t\t\telseif (end($this->labels) === $label) {\n\t\t\t\t\t$text_tag_x = (strlen($label) * 4 > $this->width - $x) ? $this->x + $x - 10 : $this->x + $x;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$text_tag_x = $this->x + $x;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$text_tag_x = $this->x + $x;\n\t\t\t}\n\n\t\t\t$labels[] = new CSvgText($text_tag_x, $this->y + $y, $label);\n\t\t}\n\n\t\treturn $labels;\n\t}",
"public function getAxisLabelPosition() {\n return $this->axisLabelPosition;\n }",
"public function get_labels() {\n\t\treturn [];\n\t}",
"public function getLabels();",
"public function get_x_axis_label()\n {\n return $this->x_axis_label;\n }",
"protected function Labels($axis_text = '')\n {\n $labels = $axis_text;\n if(!empty($this->label_h) || !empty($this->label_v)) {\n $label_text = array('text-anchor' => 'middle');\n if($this->label_font != $this->axis_font)\n $label_text['font-family'] = $this->label_font;\n if($this->label_font_size != $this->axis_font_size)\n $label_text['font-size'] = $this->label_font_size;\n if($this->label_font_weight != 'normal')\n $label_text['font-weight'] = $this->label_font_weight;\n $label_text['fill'] = $this->GetFirst($this->label_colour_h,\n $this->label_colour, $this->axis_text_colour_h,\n $this->axis_text_colour);\n\n if(!empty($this->label_h)) {\n $label_text['y'] = $this->height - $this->label_bottom_offset;\n $label_text['x'] = $this->pad_left +\n ($this->width - $this->pad_left - $this->pad_right) / 2;\n $labels .= $this->Text($this->label_h, $this->label_font_size,\n $label_text);\n }\n\n $labels .= $this->VLabel($label_text);\n }\n\n if(!empty($labels)) {\n $font = array(\n 'font-size' => $this->axis_font_size,\n 'font-family' => $this->axis_font,\n 'fill' => $this->GetFirst($this->axis_text_colour, $this->axis_colour),\n );\n $labels = $this->Element('g', $font, NULL, $labels);\n }\n return $labels;\n }",
"public function getPostedDimensionLabels()\n {\n\n }",
"public function getAxisYLabelOffsetX()\n\t{\n\t\treturn $this->axis_ylabel_offX;\n\t}",
"public function getLabels()\r\n {\r\n // Fields\r\n $fields = $this->getFields();\r\n // All Labels\r\n $allLabels = ArrayHelper::column($fields, 'label', 'name');\r\n // Checkboxes & Radio Buttons Labels\r\n $checboxAndRadioLabels = ArrayHelper::column($fields, 'groupLabel', 'name');\r\n // Replace with Checkboxes & Radio Buttons labels\r\n $labels = array_merge($allLabels, $checboxAndRadioLabels);\r\n return $labels;\r\n }",
"public function getLabel() {\n return $this->cntLabels;\n }",
"function get_labels(){\n\t\t$labels=array();\n\t\tforeach ($this->form_obj as $key => $value) {\n\t\t\t$labels[$key]=$value->label;\n\t\t}\n\t\treturn $labels;\n\t}",
"protected function getHighChartXAxis($label){\n\t\tforeach ($this->data AS $datasetname => $dataset) {\n\t\t\tforeach ($dataset AS $records) {\n\t\t\t\t$labels[] = $records[$label];\n\t\t\t}\n\t\t}\n\t\treturn $labels;\n\t}",
"public function labels()\n {\n $labels = [];\n foreach ($this->getSelected() as $option) {\n $labels[] = $option->label();\n }\n return $labels;\n }",
"public function getFieldLabels()\n {\n return $this->labels;\n }",
"protected function labels() {\n // The admin has specified the exact labels that should be used.\n if ($this->getSetting('override_labels')) {\n return [\n 'singular' => $this->getSetting('label_singular'),\n 'plural' => $this->getSetting('label_plural'),\n ];\n }\n else {\n $this->initializeIefController();\n return $this->iefHandler->labels();\n }\n }",
"protected function getLabels()\n\t{\n\t\tpreg_match_all(\n\t\t\t'/\\\\[((?:[^\\\\x17[\\\\]]|\\\\[[^\\\\x17[\\\\]]*\\\\])*)\\\\]/',\n\t\t\t$this->text,\n\t\t\t$matches,\n\t\t\tPREG_OFFSET_CAPTURE\n\t\t);\n\t\t$labels = [];\n\t\tforeach ($matches[1] as $m)\n\t\t{\n\t\t\t$labels[$m[1] - 1] = strtolower($m[0]);\n\t\t}\n\n\t\treturn $labels;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function To Add Child Specification // | public function addChildSpecification($childName,$childCretedDte,$childUpdtedDte,$childWidth,$childheight,$childNo,$childX,$childY,$childCntType,$childText,$childImgPath,$childTextClr,$childTextSize,$childVdoPath,$childRefLink,$childRefLinkBg)
{
$this->chldName = $childName;
$this->chldCrDte = $childCretedDte;
$this->chldUpDte = $childUpdtedDte;
$this->chldWdth = $childWidth;
$this->chldHght = $childheight;
$this->childNo = $childNo;
$this->childX = $childX;
$this->childY = $childY;
$this->childCntType = $childCntType;
$this->childText = $childText;
$this->childImgPath = $childImgPath;
$this->childTextClr = $childTextClr;
$this->childTextSize= $childTextSize;
$this->childVdoPath = $childVdoPath;
$this->childRefLink = $childRefLink;
$this->childRefLinkBg = $childRefLinkBg;
} | [
"public function addChildSpecification($childName,$childCretedDte,$childUpdtedDte,$childWidth,$childheight,$childNo,$childX,$childY,$childCntType,$childText,$childImgPath)\n\t\t{\n\t\t\t$this->chldName\t\t=\t$childName;\n\t\t\t$this->chldCrDte\t=\t$childCretedDte;\n\t\t\t$this->chldUpDte\t=\t$childUpdtedDte;\n\t\t\t$this->chldWdth\t\t=\t$childWidth;\n\t\t\t$this->chldHght\t\t=\t$childheight;\n\t\t\t$this->childNo\t\t=\t$childNo;\n\t\t\t$this->childX\t\t=\t$childX;\n\t\t\t$this->childY\t\t=\t$childY;\n\t\t\t$this->childCntType\t=\t$childCntType;\n\t\t\t$this->childText\t=\t$childText;\n\t\t\t$this->childImgPath\t=\t$childImgPath;\n\t\t}",
"public function getSubSpecs();",
"public function getChildSpecification()\n\t\t{\n\t\t\t$i\t\t\t\t=\t0;\n\t\t\t\n\t\t\t$chldspeDisp\t=\t'';\n\t\t\t$chldspeDisp\t.=\t\"<table id='specfcatnTabl'>\";\n\t\t\t$chldspeDisp\t.= \"<tr>\";\n\t\t\t$chldspeDisp\t.=\t\"<td colspan='3' style='text-align:center'>Specifications<input type='hidden' name='chldCnt' id='chldCnt' value='\".$this->childNo.\"'></td>\";\n\t\t\t$chldspeDisp\t.=\t\"</tr>\";\n\t\t\t$chldspeDisp\t.=\t\"<tr height='5px'></tr>\";\n\t\t\t$chldspeDisp\t.=\t\"<tr>\";\n\t\t\t$chldspeDisp\t.=\t\"<td>Width</td>\";\n\t\t\t$chldspeDisp\t.=\t\"<td>:</td>\";\n\t\t\t$chldspeDisp\t.=\t\"<td><input type='text' name='chldWdth' id='chldWdth' onchange='return chngChldSpec($this->childNo,$this->childCntType)' value='\".$this->chldWdth.\"'/></td>\";\n\t\t\t$chldspeDisp\t.=\t\"</tr>\";\n\t\t\t$chldspeDisp\t.=\t\"<tr height='5px'></tr>\";\n\t\t\t$chldspeDisp\t.=\t\"<tr>\";\n\t\t\t$chldspeDisp\t.=\t\"<td>Height</td>\";\n\t\t\t$chldspeDisp\t.=\t\"<td>:</td>\";\n\t\t\t$chldspeDisp\t.=\t\"<td><input type='text' name='chldHght' id='chldHght' onchange='return chngChldSpec($this->childNo,$this->childCntType)' value='\".$this->chldHght.\"'/></td>\";\n\t\t\t$chldspeDisp\t.=\t\"</tr>\";\n\t\t\t$chldspeDisp\t.=\t\"<tr height='5px'></tr>\";\n\t\t\t$chldspeDisp\t.=\t\"<tr>\";\n\t\t\t$chldspeDisp\t.=\t\"<td>X-Cordinate</td>\";\n\t\t\t$chldspeDisp\t.=\t\"<td>:</td>\";\n\t\t\t$chldspeDisp\t.=\t\"<td><input type='text' name='childX' id='childX' value='\".$this->childX.\"' readonly/></td>\";\n\t\t\t$chldspeDisp\t.=\t\"</tr>\";\n\t\t\t$chldspeDisp\t.=\t\"<tr height='5px'></tr>\";\n\t\t\t$chldspeDisp\t.=\t\"<tr>\";\n\t\t\t$chldspeDisp\t.=\t\"<td>Y-Cordinate</td>\";\n\t\t\t$chldspeDisp\t.=\t\"<td>:</td>\";\n\t\t\t$chldspeDisp\t.=\t\"<td><input type='text' name='childY' id='childY' value='\".$this->childY.\"' readonly/></td>\";\n\t\t\t$chldspeDisp\t.=\t\"</tr>\";\n\t\t\t$chldspeDisp\t.=\t\"<tr height='5px'></tr>\";\n\t\t\tif($this->childCntType == 1)\n\t\t\t{\n\t\t\t\t$Sizeoption\t\t=\t'';\n\t\t\t\tfor($i=8;$i<=36;$i++)\n\t\t\t\t{\n\t\t\t\t\tif($this->childTextSize == $i){ $selected\t=\t'Selected';}\n\t\t\t\t\telse{ $selected\t=\t''; }\n\t\t\t\t\t$Sizeoption\t.=\t'<option value=\"'.$i.'\" '.$selected.'>'.$i.'</option>';\n\t\t\t\t}\n\t\t\t\t$colorPick2\t=\t'';\n\t\t\t\t$colorArray2\t=\tarray('ffffff','ffce93','fffc9e','ffffc7','9aff99','96fffb','cdffff','185871','cbcefb','cfcfcf','fd6864',\n\t\t\t\t\t\t\t\t\t'fe996b','fffe65','fcff2f','67fd9a','38fff8','68fdff','9698ed','c0c0c0','fe0000','f8a102','ffcc67',\n\t\t\t\t\t\t\t\t\t'f8ff00','34ff34','68cbd0','34cdf9','6665cd','9b9b9b','cb0000','f56b00','ffcb2f','ffc702','32cb00',\n\t\t\t\t\t\t\t\t\t'00d2cb','3166ff','6434fc','656565','9a0000','ce6301','cd9934','999903','009901','329a9d','3531ff',\n\t\t\t\t\t\t\t\t\t'6200c9','343434','680100','963400','986536','646809','036400','34696d','00009b','303498','000000',\n\t\t\t\t\t\t\t\t\t'330001','643403','663234','343300','013300','003532','010066','340096');\n\t\t\t\tfor($cj=0;$cj<count($colorArray2);$cj++)\n\t\t\t\t{\n\t\t\t\t\tif($this->childTextClr == $colorArray2[$cj]){ $selCol\t=\t'selected'; }\n\t\t\t\t\telse{$selCol\t=\t''; } \n\t\t\t\t\t$colorPick2 .= '<option value=\"'.$colorArray2[$cj].'\" '.$selCol.'>#'.$colorArray2[$cj].'</option>';\n\t\t\t\t}\n\t\t\t\t$chldspeDisp\t.=\t\"<tr>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td>Text</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td>:</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td style='text-align:center'>\n\t\t\t\t\t\t\t\t\t\t<textarea name='chldTxt$this->childNo' id='chldTxt$this->childNo' onchange='return changeChildText($this->childNo,$this->childCntType)'>$this->childText</textarea>\n\t\t\t\t\t\t\t\t\t</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"</tr>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<tr height='5px'></tr>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<tr>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td>Color</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td>:</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td style=''>\n\t\t\t\t\t\t\t\t\t\t<select name='chldTxtClr$this->childNo' id='chldTxtClr$this->childNo' onchange='return changeChildTextClr($this->childNo,$this->childCntType)' style='width:120px'>\n\t\t\t\t\t\t\t\t\t\t\t$colorPick2\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"</tr>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<tr height='5px'></tr>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<tr>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td>Size</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td>:</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td style=''>\n\t\t\t\t\t\t\t\t\t\t<select name='chldTxtSize$this->childNo' id='chldTxtSize$this->childNo' onchange='return changeChildTextSize($this->childNo,$this->childCntType)' style='width:120px'>\n\t\t\t\t\t\t\t\t\t\t\t$Sizeoption\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"</tr>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<tr height='5px'></tr>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<tr>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td>Style</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td>:</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td style=''>\n\t\t\t\t\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<td width='20px' style='border:1px solid #fff;background:#000;cursor:pointer;color:#fff' onclick='return changeFntWght(1,$this->childNo,$this->childCntType)'><b>B</b></td><td width='2px'></td>\n\t\t\t\t\t\t\t\t\t\t\t\t<td width='20px' style='border:1px solid #fff;background:#000;cursor:pointer;font-style:Italic;color:#fff' onclick='return changeFntWght(2,$this->childNo,$this->childCntType)'>I</td><td width='2px'></td>\n\t\t\t\t\t\t\t\t\t\t\t\t<td width='20px' style='border:1px solid #fff;background:#000;cursor:pointer;color:#fff' onclick='return changeFntWght(3,$this->childNo,$this->childCntType)'><u>U</u></td><td width='2px'></td>\n\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"</tr>\";\n\t\t\t}\n\t\t\telse if($this->childCntType == 2){ \n\t\t\t\t$chldspeDisp\t.=\t\"<tr>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td>Image</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td>:</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td style='text-align:center'>\n\t\t\t\t\t\t\t\t\t\t<form name='childImgFrm' method='post' autocomplete='off' enctype='multipart/form-data'>\n\t\t\t\t\t\t\t\t\t\t<input type='file' name='chldImg' id='chldImg' onchange='return ChldBgImgURL(this,$this->childNo,$this->childCntType)'/>\n\t\t\t\t\t\t\t\t\t\t<input type='hidden' name='chldImgName$this->childNo' id='chldImgName$this->childNo' value='\".$this->childImgPath.\"' /></form>\n\t\t\t\t\t\t\t\t\t</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"</tr>\";\n\t\t\t}\n\t\t\telse if($this->childCntType == 3){\n\t\t\t\t$chldspeDisp\t.=\t\"<tr>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td>Video Path</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td>:</td>\";\n\t\t\t\t\n\t\t\t\t$chldspeDisp\t.=\t\"<td>\n\t\t\t\t\t\t\t\t\t\t<form name='childVideoFrm' method='post' autocomplete='off' enctype='multipart/form-data'>\n\t\t\t\t\t\t\t\t\t\t\t<input type='file' name='childVdoPath$this->childNo' id='childVdoPath$this->childNo' onchange='return changeChildVdo($this->childNo,$this->childCntType)' value='$this->childVdoPath'/>\n\t\t\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t\t\t</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"</tr>\";\n\t\t\t}\n\t\t\telse if($this->childCntType == 4){\n\t\t\t\t$chldspeDisp\t.=\t\"<tr>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td>Bg Image</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td>:</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td>\n\t\t\t\t\t\t\t\t\t\t<form name='childRefImgFrm' method='post' autocomplete='off' enctype='multipart/form-data'>\n\t\t\t\t\t\t\t\t\t\t<input type='file' name='chldRefBgImg' id='chldRefBgImg' onchange='return ChldRefBgImgURL(this,$this->childNo,$this->childCntType)'/>\n\t\t\t\t\t\t\t\t\t\t<input type='hidden' name='chldRefBgImg$this->childNo' id='chldRefBgImg$this->childNo' value='\".$this->childRefLinkBg.\"' /></form>\n\t\t\t\t\t\t\t\t\t</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"</tr>\";\n\t\t\t\n\t\t\t\t$chldspeDisp\t.=\t\"<tr>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td>Link</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td>:</td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"<td><input type='text' name='childRefLink$this->childNo' id='childRefLink$this->childNo' value='$this->childRefLink' onchange='return chngChldSpec($this->childNo,$this->childCntType)'/></td>\";\n\t\t\t\t$chldspeDisp\t.=\t\"</tr>\";\n\t\t\t}\n\t\t\t$chldspeDisp\t.=\t\"</table>\";\n\t\t\t\n\t\t\treturn $chldspeDisp;\n\t\t}",
"public function testAddChild_Modification()\n\t{\n\t\t$this->object->AddChild($this->child);\n\t\t$this->child->attribute = \"changed att\";\n\t\t$this->assertEquals(\"changed att\", $this->object->childList[0]->attribute);\n\t}",
"public function addChild($child, array $options = array());",
"public function testCreateResellerChild()\n {\n }",
"function makechild(&$child) \n {\n $child->where = $this->where;\n $child->having = $this->having;\n $child->roottable = $this->roottable;\n $child->tables = $this->tables;\n $child->jointypes = $this->jointypes;\n $child->leftcols = $this->leftcols;\n $child->rightcols = $this->rightcols;\n\n legacy_db_SelectMonster::bond($child,$this);\n }",
"function is_child_of($descriptor,$parent)\r\n {\r\n return(mysql_num_rows(database::query(\"SELECT parent.ID FROM entry,parent,linktype WHERE entry.descriptor='1' and entry.ID='$descriptor' and parent.child='$descriptor' and parent.parent='$parent' and parent.type=linktype.ID and linktype.hyrarchic='1'\")));\r\n }",
"public function addChildDocument($child){}",
"public function testCreate_Child()\n {\n $childDAO = new childDAO();\n\n $childTest = new childModel(8, \"Red Ranger\", \"None\", \"Tom\", 1);\n $child_id = $childDAO->insert($childTest);\n\n $childFound=$childDAO->find($child_id);\n\n $this->assertEquals($child_id, $childFound->child_id);\n $this->assertEquals(8, $childFound->parent_id);\n $this->assertEquals(\"Red Ranger\", $childFound->child_name);\n $this->assertEquals(\"None\", $childFound->allergies);\n $this->assertEquals(\"Tom\", $childFound->trusted_parties);\n }",
"abstract public function addItemChild($itemName, $childName);",
"public function testCreateSecondaryChildAssocation()\n {\n }",
"public function getChild(string $childPath): SpecPathInterface;",
"public function testAddChildFullRestCreation(): void\n {\n $productSku = 'configurable-product-sku';\n $childSku = 'simple-product-sku';\n\n $this->createConfigurableProduct($productSku);\n $attribute = $this->attributeRepository->get('catalog_product', 'test_configurable');\n\n $this->addOptionToConfigurableProduct(\n $productSku,\n (int)$attribute->getAttributeId(),\n [\n [\n 'value_index' => $attribute->getOptions()[1]->getValue()\n ]\n ]\n );\n\n $this->createSimpleProduct(\n $childSku,\n [\n [\n 'attribute_code' => 'test_configurable',\n 'value' => $attribute->getOptions()[1]->getValue()\n ]\n ]\n );\n\n $res = $this->addChild($productSku, $childSku);\n $this->assertTrue($res);\n\n // confirm that the simple product was added\n $children = $this->getChildren($productSku);\n $added = false;\n foreach ($children as $child) {\n if ($child['sku'] == $childSku) {\n $added = true;\n break;\n }\n }\n $this->assertTrue($added);\n\n // clean up products\n\n $this->deleteProduct($productSku);\n $this->deleteProduct($childSku);\n }",
"public function addChild(CompositeInterface $child);",
"function addChild($key, IBabylonModel $child) : IBabylonModel;",
"public function getSpecification();",
"function addChild($parent_id, $child_id){\n $parent = getSketchObject($parent_id);\n if(!in_array($child_id, $parent['child'])){\n array_push($parent['child'], $child_id);\n }\n\n saveSketch($parent);\n}",
"abstract protected function createChild(string $name): Item;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
LDAP Tab Settings \\ | private function tabLDAP($site_settings) {
// Generate inputs and descriptions
$bodies[1] = $this->settingsTab(array('ACTIVE_DIRECTORY','AD_LOGIN_SELECTOR','AD_ACCOUNT_CREATION','AD_PREFERRED','AD_FAILOVER',6,'AD_SERVER','AD_RDN','AD_BASE_DN','AD_FILTER'), $site_settings);
// Build form groups
$bodies[1]['inputs'] = $this->buildFormGroups($bodies[1]['inputs']);
// Create the list of allowed member data types
$options = '';
foreach($this->getMemberDataTypes() as $k => $v) {
$options .= '<option value="' . $v['constant'] . '">' . $v['constant'] . '</option>';
}
// Return with no options
if(empty($options)) {
$options = '<option value="0">-- no valid options found --</option>';
}
// Table
if(isset($site_settings['AD_ATTRIBUTES'])) {
$bodies[1]['inputs'] .= '<div class="row"><div class="col-xl-12">
<div class="form-group attributes-input">
<label for="SITE_AD_ATTRIBUTES" class="form-control-label">' . $site_settings['AD_ATTRIBUTES']['title'] . '</label>
<div class="input-group">
<select class="form-control" id="SITE_AD_ATTRIBUTES">' . $options . '</select>
<input type="text" class="form-control attribute-name" placeholder="attribute name"/>
<div class="input-group-append">
<button type="button" class="btn btn-sm fks-btn-success add">Add</button>
</div>
</div>
<div class="form-control-feedback"></div>
<small name="AD_ATTRIBUTES" class="form-text text-muted">' . $site_settings['AD_ATTRIBUTES']['help_text'] . '</small>
</div>
</div></div><div class="row"><div class="col-xl-12">
<ul class="fks-list-group fks-list-group-sm attributes-list">
<li class="list-group-item">Here is the Title<div class="actions"><button type="button" class="btn fks-btn-danger remove"><i class="fa fa-times fa-fw"></i></button></div></li>
</ul>
</div></div>';
}
// Return the generated HTML
return '<div class="row"><div class="col-xl-7">' . $bodies[1]['inputs'] . '</div><div class="col-xl-5">' . $bodies[1]['descriptions'] . '</div></div>';
} | [
"function LdapRealm() {\n }",
"public function settings_tab() {\n\t\twoocommerce_admin_fields( self::get_settings() );\n\t}",
"public function getTabSetting()\n {\n \n $servermgrId = common::serverManagerId();\n $login = common::getUserid($servermgrId['login']);\n return $res = $this->tabselectmodel->getTab($servermgrId['server_name'], $login);\n }",
"function show_ad_trust_dir()\n\t{\n\t\t$this->show_enum(\n\t\t\tarray(\n\t\t\t\tarray(\"value\"=>\"0\",\"display_name\"=>gettext(\"Disabled\")),\n\t\t\t\tarray(\"value\"=>\"1\",\"display_name\"=>gettext(\"One-Way: Incoming\")),\n\t\t\t\tarray(\"value\"=>\"2\",\"display_name\"=>gettext(\"One-Way: Outgoing\")),\n\t\t\t\tarray(\"value\"=>\"3\",\"display_name\"=>gettext(\"Two-Way\"))\n\t\t\t\t)\n\t\t\t);\n\t}",
"function add_settings() {\n\tadd_settings_section( 'sgdd_auth', __( 'Step 1: Authorization', 'skaut-google-drive-documents' ), '\\\\Sgdd\\\\Admin\\\\SettingsPages\\\\Basic\\\\OAuthGrant\\\\display', 'sgdd_basic' );\n\n\t\\Sgdd\\Admin\\Options\\Options::$authorized_domain->add_field( true, true );\n\t\\Sgdd\\Admin\\Options\\Options::$authorized_origin->add_field( true, true );\n\t\\Sgdd\\Admin\\Options\\Options::$redirect_uri->add_field( true, true );\n\t\\Sgdd\\Admin\\Options\\Options::$client_id->add_field();\n\t\\Sgdd\\Admin\\Options\\Options::$client_secret->add_field();\n}",
"function teamspeak3_admin_authentication() {\n\n $form = array();\n\n $form['auth_settings'] = array(\n '#type' => 'fieldset',\n '#title' => t('Authentication settings'),\n '#collapsible' => FALSE,\n '#collapsed' => FALSE,\n '#group' => 'settings',\n );\n\n $form['auth_settings']['teamspeak3_username'] = array(\n '#type' => 'textfield',\n '#title' => t('Username'),\n '#default_value' => variable_get('teamspeak3_username', ''),\n '#size' => 40,\n '#required' => TRUE,\n '#description' => t(\"Server query username\"),\n );\n\n $form['auth_settings']['teamspeak3_password'] = array(\n '#type' => 'password',\n '#title' => t('Password'),\n '#default_value' => variable_get('teamspeak3_password', ''),\n '#size' => 40,\n '#required' => TRUE,\n '#description' => t(\"Server query password\"),\n );\n\n return system_settings_form($form);\n\n}",
"function ss_ls_addon_settings() {\n\tadd_options_page('Literacy Source U-Design Addon Settings', 'U-Design Addon Settings', 'manage_options', 'udesign_options', 'ls_addon_options_page');\n}",
"function ldap_config()\n{\n return [\n 'enabled' => Settings::get('ldap-enabled', false),\n 'hosts' => Settings::get('ldap-hosts', []),\n 'bind_user' => Settings::get('ldap-bind-user', ''),\n 'bind_password' => Settings::get('ldap-bind-password', ''),\n 'tree_base' => Settings::get('ldap-tree-base', ''),\n 'base_user_ou_dn' => Settings::get('ldap-base-user-dn', ''),\n 'base_group_ou_dn' => Settings::get('ldap-base-group-dn', ''),\n 'delete_users' => Settings::get('ldap-delete-users', false),\n 'duties_map_to_ou' => Settings::get('ldap-duties-map-to-ou', true),\n 'home_drive_letter' => Settings::get('ldap-home-drive-letter', ''),\n 'home_drive_path_pattern' => Settings::get('ldap-home-drive-path-pattern', ''),\n 'email_domain' => Settings::get('ldap-email-domain', ''),\n 'use_trash_ou' => Settings::get('ldap-use-trash-ou', true)\n ];\n}",
"function office_theme_settings_tab()\n{\n $CI = &get_instance();\n $CI->app_tabs->add_settings_tab('admin-theme-settings', [\n 'name' => '' . _l('perfex_office_theme_settings_first') . '',\n 'view' => 'perfex_office_theme/perfex_office_theme_settings',\n 'position' => 48,\n ]);\n}",
"function wsl_register_admin_tab( $component, $tab, $label, $action, $visible = false, $pull_right = false ) \r\n{ \r\n\tGLOBAL $WORDPRESS_SOCIAL_LOGIN_ADMIN_TABS;\r\n\r\n\t$config = array();\r\n\r\n\t$config[\"component\"] = $component;\r\n\t$config[\"label\"] = $label;\r\n\t$config[\"visible\"] = $visible;\r\n\t$config[\"action\"] = $action;\r\n\t$config[\"pull_right\"] = $pull_right;\r\n\r\n\t$WORDPRESS_SOCIAL_LOGIN_ADMIN_TABS[ $tab ] = $config;\r\n}",
"function charitable_get_admin_settings() {\r\n\treturn charitable_get_helper( 'Admin_Settings' );\r\n}",
"function LDAP_addServerTophpLdapAdmin($name,$host,$base,$pwd,$port=389)\n{\n\nLDAP_checkphpLdapAdminConfiguration();\n\n$cmd=\nEDIT_searchLastLineNumber(PHPLDAPADMIN_CONFIG, \"new Datastore();\").\nEDIT_insertAfterLineNumber(PHPLDAPADMIN_CONFIG, SED_foundLine, \"\n\\$servers->newServer('ldap_pla');\n\\$servers->setValue('server','name','$name');\n\\$servers->setValue('server','host','$host');\n\\$servers->setValue('server','port',$port);\n\\$servers->setValue('server','base',array('$base'));\n\\$servers->setValue('login','auth_type','config');\n\\$servers->setValue('login','bind_id','cn=admin,$base');\n\\$servers->setValue('login','bind_pass','$pwd');\n\\$servers->setValue('server','tls',false);\n\\$servers->setValue('server','read_only',false);\n\\$servers->setValue('auto_number','enable',false);\n\\$servers->setValue('auto_number','mechanism','search');\n\\$servers->setValue('auto_number','search_base','ou=People,$base');\n\\$servers->setValue('auto_number','min',array('uidNumber'=>1000,'gidNumber'=>1000));\n\\$servers->setValue('server','visible',true);\n\");\n\nsystem($cmd);\n}",
"function ldap_settings() {\n\tglobal $user_photo_url, $ldap_host, $ldap_dn, $ldap_username, $ldap_password, $ldap_filter, $site_admin_username, $site_admin_password;\n\t//Database information\n\t$servername = \"127.0.0.1\";\n\t$username = \"who_what\";\n\t$password = \"who_what\";\n\t$dbname = \"who_what\";\n\n\t// Create connection\n\t$conn = new mysqli($servername, $username, $password, $dbname);\n\t// Check connection\n\tif ($conn->connect_error) {\n\t\tdie(\"Connection failed: \" . $conn->connect_error);\n\t} \n\n\t//Query all site configuration info\n\t$sql = \"SELECT * from tbl_configuration WHERE configType REGEXP '(site_admin|ldap_host|ldap_dn|ldap_username|ldap_password|ldap_filter|site_photo_url)'\";\n\t$result = $conn->query($sql);\n\t//Set global variables\n\tif ($result->num_rows > 1) {\n\t\t// output data of each row\n\t\twhile($row = $result->fetch_assoc()) {\n\t\t\tif ($row[\"configType\"] == \"ldap_host\") {\n\t\t\t\t$ldap_host = $row[\"configValue\"];\n\t\t\t}\n\t\t\tif ($row[\"configType\"] == \"ldap_dn\") {\n\t\t\t\t$ldap_dn = $row[\"configValue\"];\n\t\t\t}\t\n if ($row[\"configType\"] == \"ldap_username\") {\n $ldap_username = $row[\"configValue\"];\n }\n if ($row[\"configType\"] == \"ldap_password\") {\n $ldap_password = $row[\"configValue\"];\n }\t\n if ($row[\"configType\"] == \"ldap_filter\") {\n $ldap_filter = $row[\"configValue\"];\n }\n if ($row[\"configType\"] == \"site_photo_url\") {\n $user_photo_url = $row[\"configValue\"];\n }\n if ($row[\"configType\"] == \"site_admin_username\" && !empty($row[\"configValue\"])) {\n $site_admin_username = $row[\"configValue\"];\n }\n if ($row[\"configType\"] == \"site_admin_password\" && !empty($row[\"configValue\"])) {\n $site_admin_password = $row[\"configValue\"];\n }\n\n\n\t\t}\n\t} else {\n\t\techo \"0 results\";\n\t}\n\t$conn->close();\n\n\n}",
"function show_settings_tab(){\n woocommerce_admin_fields($this->get_settings());\t\t\n }",
"function account_settings(){\n\t\t$profile_data=$this->accounts_model->profile($this->session->userdata('username'));\n\t\t$this->view->render(array(\n\t\t\t'profile_data'=>$profile_data));\n\t}",
"function addFieldsToFieldSettingsforAD()\n\t{\n\t\t$arrSetVals = array();\n\t\t$arrSetVals['strName'] = 'displayname';\n\t\t$arrSetVals['EditFormat'] = 'Text Field';\n\t\t$arrSetVals['validation']['validationArr'][] = 'IsRequired';\n\t\t$this->jsSettings['tableSettings'][$this->tName]['fieldSettings']['displayname'][$this->pageType] = $arrSetVals;\n\t\t\n\t\t$arrSetVals = array();\n\t\t$arrSetVals['strName'] = 'name';\n\t\t$arrSetVals['EditFormat'] = 'Text Field';\n\t\t$arrSetVals['validation']['validationArr'][] = 'IsRequired';\n\t\t$this->jsSettings['tableSettings'][$this->tName]['fieldSettings']['name'][$this->pageType] = $arrSetVals;\n\t\t\n\t\t$arrSetVals = array();\n\t\t$arrSetVals['strName'] = 'category';\n\t\t$arrSetVals['EditFormat'] = 'Text Field';\n\t\t$arrSetVals['validation']['validationArr'][] = 'IsRequired';\n\t\t$this->jsSettings['tableSettings'][$this->tName]['fieldSettings']['category'][$this->pageType] = $arrSetVals;\n\t}",
"private function user_settings() {\n\n\t\t$controller = new Mlp_Redirect_User_Settings();\n\t\t$controller->setup();\n\t}",
"public function testUpdateLdapConfig()\n {\n }",
"public function settings_tab( $tab ) {\n\t\t$active = 'dclt_options' === $tab;\n\t\t?>\n <a href=\"?page=wp_discourse_options&tab=dclt_options\"\n class=\"nav-tab <?php echo $active ? 'nav-tab-active' : ''; ?>\"><?php esc_html_e( 'Latest Topics', 'dclt' ); ?>\n </a>\n\t\t<?php\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set an accounting reference Method will set an accounting reference record | public function setAccountingReference($nodeid, $type, $reference)
{
return $this->quickbooks->setAccountingReference($nodeid, $type, $reference);
} | [
"public function setReference($reference);",
"function set_reference_id($theReferenceId) {\n\t\t$this->myReferenceId = $theReferenceId;\n\t}",
"function setRefId($a_refid)\n\t{\n\t\t$this->refid = $a_refid;\n\t}",
"function set_reference($ref = NULL) \n\t{\n\t\t// Fixme: Comprobar si el pedido/presupuesto es de compras o de ventas.\n\t\tif ((!isset($ref) OR empty($ref)) AND (empty($this->_aPedido['referencia']) OR is_numeric($ref))) {\n\t\t\tif ($this->_fPedido & inmPed_VENTA) $sufijo = 'ventas';\n\t\t\telse $sufijo = 'compras';\n\t\t\t//crear la referencia e incrementar el contador\n\t\t\t$consulta = \"SELECT \".\n\t\t\t\t\t\t\t\"prefijo_ped_$sufijo as 'prefijo_ped', \".\n\t\t\t\t\t\t\t\"sufijo_ped_$sufijo as 'sufijo_ped', \".\n\t\t\t\t\t\t\t\"contador_ped_$sufijo as 'contador_ped', \".\n\t\t\t\t\t\t\t\"digitos_ped_$sufijo as 'digitos_ped' \".\n\t\t\t\t\t\t\t\"FROM Empresas where id_empresa = \".$this->_aPedido['id_empresa'];\n\t\t\t$idrs = $this->_db->query($consulta);\n\t\t\tif (!$this->_db->num_rows($idrs)) return FALSE;\n\t\t\t$aPrefs=$this->_db->fetch_assoc($idrs);\n\n\t\t\t//relleno de digitos para la numeracion del pedido\n\t\t\t$temporal = pow(10,( (int)$aPrefs['digitos_ped'] ));\n\t\t\t$temporal += $aPrefs['contador_ped'];\n\t\t\t$t = substr((string)$temporal,1);\n\n\t\t\t// $ref = $aPrefs[prefijo_ped].((!empty($aPrefs[prefijo_ped])) ? \"-\" : \"\").$t.\n\t\t\t\t\t\t// ((!empty($aPrefs[sufijo_ped])) ? \"-\" : \"\").$aPrefs[sufijo_ped];\n\t\t\t$ref = $aPrefs['prefijo_ped'].$t.$aPrefs['sufijo_ped'];\n\t\t\t$cons= \"update Empresas set contador_ped_$sufijo = contador_ped_$sufijo + 1 where id_empresa = \".$this->_aPedido['id_empresa'];\n\t\t\t$this->_db->query($cons);\n\n\t\t\t/** **\n\t\t\t// Comprobar si es presupuesto...\n\t\t\t$consulta = \"select prefijo_pre , sufijo_pre , contador_pre , digitos_pre \".\n\t\t\t\t\t\t\t\t\t\"FROM Empresas where id_empresa = $usuario[id]\";\n\t\t\t$resul22=$oDb->query($consulta);\n\t\t\t$row22=$oDb->fetch_array($resul22);\n\n\t\t\t//relleno de digitos para la numeracion del presupuesto\n\t\t\t$temporal = pow(10,( (int) $row22[digitos_pre] ));\n\t\t\t$temporal += $row22[contador_pre];\n\t\t\t$t = substr((string)$temporal,1);\n\n\t\t\t$registro[\"referencia\"] = $row22[prefijo_pre] . $t . $row22[sufijo_pre];\n\t\t\t$consulta = \"update Empresas set contador_pre = contador_pre + 1 where id_empresa = $usuario[id]\";\n\t\t\t$oDb->query($consulta);\n\t\t\t//depurar_array($registro);\n\t\t\t/** **/\n\t\t} elseif (!empty($this->_aPedido['referencia'])) {\n\t\t\tif (!isset($ref) OR empty($ref)) return TRUE;\n\t\t}\n\t\t// debug(\"set_reference($ref)\");\n\t\t$this->_change_flags(inmPed_CHG_MAIN | inmPed_DB_COMMIT);\n\t\t$this->_aPedido['referencia'] = $ref;\n\t\treturn TRUE;\n\t}",
"public function updateReferenceID( $referenceID );",
"protected function setInvoiceBillingReferenceIfExists(): void\n {\n $billingReferenceContent = '';\n\n $billingId = $this->invoice->invoice_billing_id ?? null;\n\n if($billingId) {\n\n $billingReferenceContent = (new GetXmlFileAction)->handle('xml_billing_reference');\n\n $billingReferenceContent = str_replace(\"SET_INVOICE_NUMBER\", $billingId, $billingReferenceContent);\n\n $this->setXmlInvoiceItem('SET_BILLING_REFERENCE', $billingReferenceContent);\n\n }\n\n $this->setXmlInvoiceItem('SET_BILLING_REFERENCE', $billingReferenceContent);\n }",
"public function setTransactionReference($reference);",
"public function setRef( $ref=null ){\n\t\tif ( !$ref )\n\t\t\t$ref = $this->label;\n\t\t$ref = $this->format( $ref );\n\t\t\n\t\t$i = 0;\n\t\t$checker = $ref;\n\t\twhile( $this->exists($checker) ){\n\t\t\t$checker = $ref.$i;\n\t\t\t$i++;\n\t\t}\t\t\n\t\t$this->ref = $ref;\t\t\t\t\n\t}",
"public function setRef(Ref $ref)\n {\n $this->ref = $ref;\n $this->refString = $ref->getRef();\n }",
"public function testSetReference1() {\n\n $obj = new DevisCommercialEntetes();\n\n $obj->setReference1(\"reference1\");\n $this->assertEquals(\"reference1\", $obj->getReference1());\n }",
"public function setReceiptReference($reference);",
"public function setReferenceId(?string $referenceId): void\n {\n $this->referenceId['value'] = $referenceId;\n }",
"public function setOrderReference($orderReference);",
"public function setReference($ref, $code)\n {\n $this->checkRef($ref, $code);\n $this->reference = $ref;\n $this->reference_code = $code;\n }",
"public function setRef($ref): self;",
"public function setAccountRef($type, $id, $name = '')\n {\n $this->data[$type.'AccountRef'] = [\n 'value' => $id,\n 'name' => $name,\n ];\n\n return $this;\n }",
"public function setReferenceFor(Record $record, $relationName, $reference)\n {\n $relation = $this->getRelation($relationName);\n $relation->setReferenceFor($record, $relationName, $reference);\n }",
"public function setInvoice_reference($invoice_reference)\n {\n $this->invoice_reference = $invoice_reference;\n }",
"function set_cache_reference( $key = '', $reference = '' ) {\n\t\t\n\t\t// bail early if not active\n\t\tif( !$this->is_active() ) return false;\n\t\t\n\t\t\n\t\t// add\n\t\t$this->reference[ $key ] = $reference;\t\n\t\t\n\t\t\n\t\t// resturn\n\t\treturn $key;\n\t\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Return the count of Users In Department | public function countUsersInDepartment ($deptId)
{
$result = $this->objMysql->_query ("SELECT COUNT(*) AS COUNT FROM poms_users WHERE dept_id = ?", [$deptId]);
if ( isset ($result[0]) && !empty ($result[0]) )
{
return $result[0]['COUNT'];
}
return 0;
} | [
"public function getTotalCasesInDept(){\n $dept = $this->dept;\n $users = User::where(['department' => $dept->id])->select('users.id')->get();\n $sum = 0;\n foreach($users as $user){\n $numberOfCasesIntaken = LegalCase::where(['staff' => $user->id])->count();\n $sum += $numberOfCasesIntaken;\n }\n return $sum;\n }",
"public function countDepartment(){\n\t\t\t\t\t return count($this->listeDepartment());\n\t\t\t\t\t }",
"public static function getUsersCount();",
"public static function get_user_count()\r\n\t\t{\r\n\t\t\t\r\n\t\t\t// Get a DB handle.\r\n\t\t\t$dbh = Legato_DB::get( 'Main' );\r\n\t\t\t\r\n\t\t\t// Form the query.\r\n\t\t\t$query = 'SELECT advisor_id, COUNT(*) as \"num_users\"\r\n\t\t\t FROM users\r\n\t\t\t GROUP BY advisor_id';\r\n\t\t\t\r\n\t\t\t// Get the result.\r\n\t\t\t$rows = $dbh->prepare( $query )->execute()->fetch_all_array();\r\n\t\t\t\r\n\t\t\t// Loop through each row returned and format it into an array.\r\n\t\t\tforeach ( $rows as $row )\r\n\t\t\t\t$user_count[$row['advisor_id']] = $row['num_users'];\r\n\t\t\t\r\n\t\t\t// Return the user count.\r\n\t\t\treturn $user_count;\r\n\t\t\t\t\r\n\t\t}",
"public function countUsers();",
"function get_all_department_count()\n {\n $this->db->from('department');\n return $this->db->count_all_results();\n }",
"function count_admins_by_department($department_id){\n global $connection;\n $department_id = mysql_prep($department_id);\n\n $query = \"SELECT count(*) AS 'number_of_admins' FROM tbladmins WHERE admin_department_id = '$department_id'\";\n\n $count_admin_department = $connection->query($query) or die(mysqli_error($connection));\n\n return $count_admin_department;\n}",
"public function countUser();",
"public function count_user(){\n\t\treturn ORM::factory('user')->count_all();\n\t}",
"public function getTotalNumberofRegisteredUsers(){\n \n $q = $this->em->createQuery(\"SELECT count(u.id) AS t_count from \\Rideorama\\Entity\\User u\");\n $result = $q->execute();\n $result = $result[0];\n return $result['t_count'];\n }",
"function UserCount()\n{\n\tglobal $log;\n\t$log->debug(\"Entering UserCount() method ...\");\n\tglobal $adb;\n\t$result=$adb->query(\"select * from ec_users where deleted =0;\");\n\t$user_count=$adb->num_rows($result);\n\t$result=$adb->query(\"select * from ec_users where deleted =0 AND is_admin != 'on';\");\n\t$nonadmin_count = $adb->num_rows($result);\n\t$admin_count = $user_count-$nonadmin_count;\n\t$count=array('user'=>$user_count,'admin'=>$admin_count,'nonadmin'=>$nonadmin_count);\n\t$log->debug(\"Exiting UserCount method ...\");\n\treturn $count;\n}",
"public function countUser()\n {\n //counter query\n $countUserQuery = \"SELECT count(`id`) AS `countId` FROM `LPV_user`\";\n\n //Preparation of the \"counter\" request\n $countUserResult = $this->db->prepare($countUserQuery);\n //Recovery of values and execute\n if ($countUserResult->execute()) {\n //PDO method for recuperation of values array\n /**\n * user id count values array\n * \n * @var array $dataCountUser\n */\n $dataCountUser = $countUserResult->fetchAll();\n return $dataCountUser;\n }\n }",
"function getadminCount(){\n$collection = $GLOBALS['db']->users;\nreturn $collection->count(array('user_type'=>'superadmin','status' =>1));\n}",
"public function getUserCounts() {\n $result = array(\n 'admins' => 0,\n 'users' => 0,\n );\n $user_rows = $this->db->get_where('users', array('role' => 1) )->result();\n if ($user_rows) {\n $result['admins'] = count($user_rows);\n }\n $user_rows = $this->db->get_where('users', array('role' => 2) )->result();\n if ($user_rows) {\n $result['users'] = count($user_rows);\n }\n return $result;\n }",
"public static function verifiedUserCount();",
"public static function verifiedUserCount()\n {\n return UserCategory::where('verified', 1)->count();\n }",
"public function getTotalUsersCount(){\n\t\treturn number_format(Member::get()->count());\n\t}",
"public function getCountUsers(){\n $connect = ConnectionManager::get('default');\n $fila = $connect->execute(\"select count(*) from Usuarios;\")->fetchAll();\n return $fila[0];\n }",
"public function getCount(): int\n {\n return count($this->departments);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the blockDeviceSetupRetryByUser property value. Allow the user to retry the setup on installation failure | public function setBlockDeviceSetupRetryByUser(?bool $value): void {
$this->getBackingStore()->set('blockDeviceSetupRetryByUser', $value);
} | [
"public function setRetryAllowed($allowed = TRUE);",
"abstract public function setRetry(int $retry): void;",
"public function setSmimeSigningCertificateUserOverrideEnabled($val)\n {\n $this->_propDict[\"smimeSigningCertificateUserOverrideEnabled\"] = boolval($val);\n return $this;\n }",
"public function setIsRetrying()\n\t{\n\t\t$this->is_retrying = true;\n\t}",
"public function setupUserPasswordResetFlag( $user_login )\n {\n $this->setConstant( 'ALM_USER_PASSWORD_RESET_STARTED', true );\n }",
"public function setRetries($value) {\n\t\t$this->retries = $value;\n\t}",
"public function setRetryOption(string $retryOption): void\n {\n $this->retryOption = $retryOption;\n }",
"public function getBlockDeviceSetupRetryByUser(): ?bool {\n $val = $this->getBackingStore()->get('blockDeviceSetupRetryByUser');\n if (is_null($val) || is_bool($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'blockDeviceSetupRetryByUser'\");\n }",
"public function setFactoryResetBlocked(?bool $value): void {\n $this->getBackingStore()->set('factoryResetBlocked', $value);\n }",
"public function setAllowNonBlockingAppInstallation(?bool $value): void {\n $this->getBackingStore()->set('allowNonBlockingAppInstallation', $value);\n }",
"public function setFactoryResetBlocked($val)\n {\n $this->_propDict[\"factoryResetBlocked\"] = boolval($val);\n return $this;\n }",
"public function overrideUser($user)\n {\n $this->userOverride = $user;\n }",
"public function setRetry($flag = true)\n {\n $this->_retry = $flag;\n return $this;\n }",
"public function setKioskCustomizationPowerButtonActionsBlocked($val)\n {\n $this->_propDict[\"kioskCustomizationPowerButtonActionsBlocked\"] = boolval($val);\n return $this;\n }",
"public function setEarlyLaunchAntiMalwareDriverProtection($val)\n {\n $this->_propDict[\"earlyLaunchAntiMalwareDriverProtection\"] = $val;\n return $this;\n }",
"public function setRetries($retries);",
"public function testSetJobRetries()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"private function setFailedLaunch()\n {\n if ($this->stepCounter != 0) {\n $this->lastFailedStepItemID = $this->lastStepItemID;\n }\n $this->isFailedLaunch = true;\n }",
"public function disableAutoSetupFabric()\n\t{\n\t\t$this->autoSetupFabric = false;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes the specified instance template. If you delete an instance template that is being referenced from another instance group, the instance group will not be able to create or recreate virtual machine instances. Deleting an instance template is permanent and cannot be undone. (instanceTemplates.delete) | public function delete($project, $instanceTemplate, $optParams = array())
{
$params = array('project' => $project, 'instanceTemplate' => $instanceTemplate);
$params = array_merge($params, $optParams);
return $this->call('delete', array($params), "Forminator_Google_Service_Compute_Operation");
} | [
"function delete()\n {\n $Account = Account::getInstance();\n $this->instance_id = $Account->instance_id;\n\n $query = <<<SQL\nDELETE\nFROM\n template\nWHERE\n id = $this->id AND\n instance_id = $this->instance_id\nSQL;\n $result = $this->DB->execute($query,\"Deleting template #$this->id\");\n if($result)\n if($this->_deleteQuestionAssociation())\n\treturn TRUE;\n else\n\treturn FALSE;\n else\n {\n $this->error = 'Unable to delete template due to a database error: \"'.$this->DB->getError().'\"';\n return FALSE;\n }\n }",
"public function deleteById($templateId);",
"public function delete_template(Template $template) {\n\t\tswitch(get_class($template)) {\n\t\tcase 'SOATemplate':\n\t\t\t$stmt = $this->database->prepare('DELETE FROM soa_template WHERE id = ?');\n\t\t\tbreak;\n\t\tcase 'NSTemplate':\n\t\t\t$stmt = $this->database->prepare('DELETE FROM ns_template WHERE id = ?');\n\t\t\tbreak;\n\t\t}\n\t\t$stmt->bindParam(1, $template->id, PDO::PARAM_INT);\n\t\t$stmt->execute();\n\t}",
"public function deleteMailTemplate(MailTemplate $mailTemplate);",
"public function deleted(Template $template)\n {\n if ($template->images) {\n $this->deleteFiles($template);\n }\n }",
"public function DeleteInspectTemplate(\\Google\\Cloud\\Dlp\\V2\\DeleteInspectTemplateRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.privacy.dlp.v2.DlpService/DeleteInspectTemplate',\n $argument,\n ['\\Google\\Protobuf\\GPBEmpty', 'decode'],\n $metadata, $options);\n }",
"public function test_template_deleted() {\n $this->resetAfterTest(true);\n $this->setAdminUser();\n $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');\n\n $template = $lpg->create_template();\n\n // Trigger and capture the event.\n $sink = $this->redirectEvents();\n api::delete_template($template->get('id'));\n\n // Get our event event.\n $events = $sink->get_events();\n $event = reset($events);\n\n // Check that the event data is valid.\n $this->assertInstanceOf('\\core\\event\\competency_template_deleted', $event);\n $this->assertEquals($template->get('id'), $event->objectid);\n $this->assertEquals($template->get('contextid'), $event->contextid);\n $this->assertEventContextNotUsed($event);\n $this->assertDebuggingNotCalled();\n }",
"private function _deleteTemplate()\n {\n $this->model->deleteTemplate();\n $this->view->display($this->model);\n }",
"public function delete(): void\n {\n $removetemp = rex_sql::factory();\n $removetemp->setTable(\\rex::getTablePrefix() . 'template');\n $removetemp->setWhere(['id' => $this->d2u_template_id]);\n $removetemp->delete();\n\n // remove addon config\n if ($this->rex_addon->hasConfig('template_'. $this->d2u_template_id)) {\n $this->rex_addon->removeConfig('template_'. $this->d2u_template_id);\n }\n\n // template specific uninstall action\n if (file_exists($this->template_folder . self::TEMPLATE_UNINSTALL)) {\n include $this->template_folder . self::TEMPLATE_UNINSTALL;\n }\n }",
"function delete_template($template_id)\n {\n $parameter_array = array();\n \n array_push($parameter_array, array(\n 'and',\n 'id',\n '=',\n $template_id\n ));\n \n parent::delete('i', $parameter_array);\n }",
"public function delete()\n {\n $this->forge->deleteNginxTemplate($this->serverId, $this->id);\n }",
"public function deleteInvoiceTemplate(string $template_id)\n {\n $this->apiEndPoint = \"v2/invoicing/templates/{$template_id}\";\n\n $this->verb = 'delete';\n\n return $this->doPayPalRequest(false);\n }",
"public function delete_template($type) {\n global $currentgroup;\n\n $delparams = array(new stdClass());\n $delparams[0]->name = 'group_id';\n $delparams[0]->value = $currentgroup;\n $delparams[0]->operator = 'equals';\n\n $delparams[1] = new stdClass();\n $delparams[1]->name = 'type';\n $delparams[1]->value = $type;\n $delparams[1]->operator = 'equals';\n\n return $this->delete_record('templates', $delparams);\n }",
"public function deleteByTemplateId($template_id)\n {\n $this->tableGateway->delete(array('template_id' => (int) $template_id));\n }",
"public function delete() {\n\t\t$removemod = rex_sql::factory();\n\t\t$removemod->setTable(\\rex::getTablePrefix() . 'template');\n\t\t$removemod->setWhere(['id' => $this->d2u_template_id]);\n\t\t$removemod->delete();\n\n\t\t// remove addon config\n\t\tif($this->rex_addon->hasConfig(\"template_\". $this->d2u_template_id)) {\n\t\t\t$this->rex_addon->removeConfig(\"template_\". $this->d2u_template_id);\n\t\t}\n\t\t\n\t\t// template specific uninstall action\n\t\tif(file_exists($this->template_folder .\"install.php\")) {\n\t\t\t$success = include $this->template_folder .\"install.php\";\n\t\t\tif(!$success) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}",
"public function on_wxbutton_deletetemplate()\n\t{\n\t\t// Which template does the user wish to delete ?\n\t\t$user_selection = $this->wxlistbox_templates->GetSelection();\n\t\tif( $user_selection == wxNOT_FOUND ) return;\n\t\t\n\t\t$user_choice = $this->wxlistbox_templates->GetString(\n\t\t\t$user_selection\n\t\t);\n\t\t\n\t\t\n\t\t$result = $this->website_project->db_delete(\n\t\t\tDILL2_CORE_CONSTANT_DB_TABLE_TEMPLATE_NAME,\n\t\t\tarray(\n\t\t\t\tDILL2_CORE_CONSTANT_DB_TABLE_TEMPLATE_COLUMN_TEMPLATENAME,\n\t\t\t\t\"=\",\n\t\t\t\t$user_choice,\n\t\t\t\tSQLITE3_TEXT\n\t\t\t)\n\t\t);\n\t\t\n\t\tif( $result )\n\t\t{\n\t\t\t$this->refresh_related_controls();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// The template could not be deleted due to an error.\n\t\t\t$wxdialog_error = new wxMessageDialog(\n\t\t\t\t$wxdialog,\n\t\t\t\t\"The selected template could not be deleted.\",\n\t\t\t\tDILL2_TEXT_DIALOG_ERROR_CAPTION,\n\t\t\t\twxOK | wxCENTRE | wxICON_ERROR\n\t\t\t);\n\t\t\t$wxdialog_error->ShowModal();\t\t\t\n\t\t}\n\t}",
"public function delete(int $hostTemplateId): void;",
"public function forceDeleted(Template $template): void\n {\n //\n }",
"public function deleteTemplate()\n {\n $this->page->setTemplate('generic/json');\n $this->page->layout_template = 'contentonly.phtml';\n\n if (empty($this->vars['id'])) {\n $this->page->setStatus(400, 'Lacking id of template to delete');\n return;\n }\n\n if (!$this->model->deleteTemplate(intval($this->vars['id']))) {\n $this->page->setStatus(500, 'Failed to delete template');\n return;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the default registry config | protected function getDefaultRegistryConfig()
{
return [
'track_loaded' => false,
'ignore_duplicates' => true,
];
} | [
"function get_registry($key, $default = null)\n{\n\t$registry = registry_container();\n\treturn array_dot_get($registry, $key, $default);\n}",
"public function get_default_settings();",
"public function getConfigDefaults()\n {\n return $this->_config_defaults;\n }",
"public function getDefaultConfig()\r\n\t{\r\n\t\treturn $this->config['connections'][$this->config['default']];\r\n\t}",
"public function getDefaultConfiguration()\n {\n return $this\n ->getConfigurations()\n ->first();\n }",
"public function getMergedDefaultConfiguration();",
"public function getDefaultService()\n {\n return $this->config->get('default');\n }",
"public function getDefaultLoggerConfig()\n {\n return $this->getConfig()['default'];\n }",
"public function getDefaultConfigLoader() {\n return ConfigLoaderFacade::getFacadeRoot();\n }",
"public function getDefaultClient()\n {\n return Arr::get($this->config, 'default', 'default');\n }",
"private static function getDefaults()\n {\n return include __DIR__ . '/../../config/config.php';\n }",
"function get_defaultsetting() {\n return $this->defaultsetting;\n }",
"protected function getRegistry()\n {\n return $this->getHelper()->getRegistry();\n }",
"public function getDefaultConfigPath(): string|null;",
"private function _get_default_settings() {\n\t\treturn isset( $this->metadata['default_settings'] ) && is_array( $this->metadata['default_settings'] ) ? $this->metadata['default_settings'] : array();\n\t}",
"public static function getRegistry() {\n global $registry;\n return $registry;\n }",
"protected function getDefaultProvider()\n {\n return $this->config('provider');\n }",
"public function getMainRegistry()\n {\n return $this->registry;\n }",
"public function getDefaultClient(): string\n {\n return $this->getPackageConfig('default', 'default');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unpacks a callback returning a callable array for callbacks wrapped using the Tribe__Utils__Callback class. | protected function unpack_callback( $callback ) {
if ( $callback instanceof Tribe__Utils__Callback ) {
$callback = array( tribe( $callback->get_slug() ), $callback->get_method() );
}
return $callback;
} | [
"public static function call_user_func_array($callback, $param_array){}",
"protected function resolveCallback($callback)\n {\n // Explode by method separater.\n $segments = explode('@', $callback);\n // Set default method if required.\n $method = count($segments) == 2 ? $segments[1] : 'sanitize';\n // Return the constructed callback.\n return array($this->container->make($segments[0]), $method);\n }",
"abstract protected function getCallbackArguments(): array;",
"abstract protected function getCallbacks(): array;",
"function unpack(callable $function) : callable\n{\n return partial('call_user_func_array', $function);\n}",
"static function parse_visits_callback_function( $callback = '' ) {\r\n $explode = explode( ',', $callback );\r\n\r\n $return = $callback;\r\n\tif( count( $explode ) == 2 ) //if callback is in the form classname, methodname\r\n\t $return = array( trim( $explode[0] ), trim( $explode[1] ) );\r\n\r\n return $return;\r\n }",
"abstract protected function get_callback_arguments() : array;",
"public function getCallback();",
"function regularFunctionCallbackArray($callbackFunction, $param_array)\n{\n echo $callbackFunction(...$param_array); //Call the callback and passing the parameters by using ... for variable arguments PHP 5.6+\n}",
"public function parseCallback($callback)\n {\n if (is_callable($callback) == true)\n {\n return $callback;\n } else {\n // stay tune\n }\n }",
"public static function getCallbackFromArray($array)\n\t{\n\t\tif(count($array) == 2)\n\t\t{\n\t\t\t$class = $array[0];\n\t\t\t$classMethod = $array[1];\n\n\t\t\tif(class_exists($class))\n\t\t\t{\n\t\t\t\t$obj = new $class();\n\t\t\t\tif(method_exists($obj, $classMethod))\n\t\t\t\t{\n\t\t\t\t\t$reflection = new \\ReflectionMethod($obj, $classMethod);\n\t\t\t\t\t$closure = $reflection->getClosure($obj);\n\n\t\t\t\t\tif(is_callable($closure))\n\t\t\t\t\t\treturn $closure;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"private function parseCallback(array $url) : array\n {\n\n if (filter_var($value = implode($url), FILTER_VALIDATE_URL) === false)\n return [\n key($url) => route($value, $this->gatewayName)\n ];\n\n return $url;\n }",
"private function parse($callback)\n {\n if ($callback instanceof ICallback) {\n foreach ($callback->getInfo() as $var => $value) {\n $this->{$var} = $value;\n }\n $this->callback = (string)$callback;\n $this->callable = $callback;\n } else if ($callback instanceof \\Closure) {\n $this->type = 'closure';\n $this->class = 'Closure';\n $this->callback = 'Closure';\n $this->callable = $callback;\n } else if (is_object($callback)) {\n $constructor = (new \\ReflectionClass($callback))->getConstructor();\n $this->type = 'class';\n $this->class = get_class($callback);\n $this->method = '__construct';\n $this->numargs = $constructor ? $constructor->getNumberOfParameters() : 0;\n $this->callback = $this->class . '[' . ($this->numargs ?: '') . ']';\n $this->callable = $callback;\n } else if (is_array($callback)) {\n if (!is_callable($callback)) {\n if (isset($callback[0]) && is_object($callback[0])) {\n $callback[0] = '{' . get_class($callback[0]) . '}';\n }\n throw new \\InvalidArgumentException(sprintf(static::ERR_CALLBACK_1, json_encode($callback)));\n }\n $this->type = 'class';\n $this->static = !is_object($callback[0]);\n $this->class = $this->static ? $callback[0] : get_class($callback[0]);\n $this->method = $callback[1];\n if ($this->static) {\n $this->numargs = 0;\n } else {\n $constructor = (new \\ReflectionClass($callback[0]))->getConstructor();\n $this->numargs = $constructor ? $constructor->getNumberOfParameters() : 0;\n }\n $this->callback = $this->class .\n ($this->static ? '::' : '[' . ($this->numargs ?: '') . ']->') . $this->method;\n $this->callable = $this->static ? null : $callback[0];\n } else {\n if ($callback == '' || is_numeric($callback)) {\n throw new \\InvalidArgumentException(sprintf(static::ERR_CALLBACK_1, $callback));\n }\n preg_match('/^([^\\[:-]*)(\\[([^\\]]*)\\])?(::|->)?([^:-]*(?:parent::|self::|)[^:-]*)$/', $callback, $matches);\n if (count($matches) == 0 || $matches[1] == '') {\n throw new \\InvalidArgumentException(sprintf(static::ERR_CALLBACK_1, $callback));\n }\n if ($matches[4] == '' && $matches[2] == '') {\n $this->type = 'function';\n $this->method = $matches[1];\n $this->callback = $this->method;\n } else {\n $this->type = 'class';\n $this->class = $matches[1];\n if ($this->class[0] == '\\\\') {\n $this->class = ltrim($this->class, '\\\\');\n }\n $this->numargs = (int)$matches[3];\n $this->static = ($matches[4] == '::');\n $this->method = $matches[5] ?: '__construct';\n $this->callback = $this->class .\n ($this->static ? '::' . $this->method : '[' . ($this->numargs ?: '') . ']' .\n ($this->method != '__construct' ? '->' . $this->method : ''));\n }\n }\n }",
"public function invoke(callable $callback, array $args = []);",
"public function map($callback)\n {\n $new = [];\n foreach ($this->getItems() as $item) {\n $new[] = $callback($item);\n }\n\n return $new;\n }",
"static function get_data_from_callback()\n {\n $callbackJSONData = file_get_contents('php://input');\n return json_decode($callbackJSONData);\n }",
"function czr_fn_fire_cb_array( $cb, $params = array(), $return = false ) {\r\n $to_return = false;\r\n //method of a class => look for an array( 'class_name', 'method_name')\r\n if ( is_array($cb) && 2 == count($cb) ) {\r\n if ( is_object($cb[0]) ) {\r\n $to_return = call_user_func_array( array( $cb[0] , $cb[1] ), $params );\r\n }\r\n //instantiated with an instance property holding the object ?\r\n else if ( class_exists($cb[0]) ) {\r\n\r\n /* PHP 5.3- compliant*/\r\n $class_vars = get_class_vars( $cb[0] );\r\n\r\n if ( isset( $class_vars[ 'instance' ] ) && method_exists( $class_vars[ 'instance' ], $cb[1]) ) {\r\n $to_return = call_user_func_array( array( $class_vars[ 'instance' ] , $cb[1] ), $params );\r\n }\r\n\r\n else {\r\n $_class_obj = new $cb[0]();\r\n if ( method_exists($_class_obj, $cb[1]) )\r\n $to_return = call_user_func_array( array( $_class_obj, $cb[1] ), $params );\r\n }\r\n }\r\n }\r\n else if ( is_string($cb) && function_exists($cb) ) {\r\n $to_return = call_user_func_array($cb, $params);\r\n }\r\n\r\n if ( $return )\r\n return $to_return;\r\n}",
"public function streamCallback(): callable;",
"public function getCallbackArguments()\n {\n return (array) $this->callbackArguments;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Execute the command Ensure the component is indeed installed, and run component configuration again. This will copy all the configuraiton over the existing one, so the executor is warned about this, and must confirm this action. | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->input = $input;
$this->output = $output;
$component = $this->finalizeComponent([
"name" => strtolower($this->input->getArgument("name")),
"version" => $this->input->getArgument("version") ?? "",
"installFlags" => ""
]);
if ($this->isInstalled($component["name"]) === false) {
return;
}
$confirm = new Question(
"WARNING! This will run a complete reconfiguration of the component. "
. "Any changes made in existing configuration of the component will be discarded."
. "\nProceed? (y/N): ",
["y", "n"]
);
$reconfig = strtolower($this->getHelper("question")->ask($this->input, $this->output, $confirm)) === "y";
if ($reconfig === false) {
$this->output->writeln("<comment>Reconfiguration aborted.</>");
return;
}
$this->output->writeln("<comment>Beginning reconfiguration.</>");
if ($this->configComponent($component["name"]) === false) {
$this->output->writeln("<error>ERROR: Component reconfiguration failed.</>");
}
$this->output->writeln("<comment>Component{$component["name"]} successfully reconfigured.</>");
} | [
"protected function afterInstall()\n {\n $configSourceFile = __DIR__ . DIRECTORY_SEPARATOR . 'config.example.php';\n $configTargetFile = \\Craft::$app->getConfig()->configDir . DIRECTORY_SEPARATOR . $this->handle . '.php';\n\n if (!file_exists($configTargetFile)) {\n copy($configSourceFile, $configTargetFile);\n }\n }",
"private function ensureConfigurationApplied()\n {\n if (!$this->configurationChanged) {\n return;\n }\n\n $this->configurationChanged = false;\n }",
"public function testExecuteInteractiveConfirmOverwritingExistingConfiguration()\n {\n $application = new Application();\n $application->add(new InitCommand());\n\n $command = $application->find('init');\n\n $commandTester = new CommandTester($command);\n $commandTester->setInputStream(\"\\n0\\nexample.com\\n/var/www/example.com\\nssh\\nn\\nNonExistingTask\\nExecuteCommandTask\\nn\\n\\nn\\n\");\n\n $input = new ArrayInput(\n array(\n 'command' => $command->getName(),\n '--no-ansi',\n '--working-dir' => __DIR__,\n )\n );\n $output = new StreamOutput(fopen('php://memory', 'w', false));\n\n $io = new SymfonyStyle($input, $output);\n\n $questionHelper = new SymfonyQuestionHelper();\n $questionHelper->setInputStream($commandTester->getInputStream());\n\n $questionHelperReflectionProperty = new ReflectionProperty(SymfonyStyle::class, 'questionHelper');\n $questionHelperReflectionProperty->setAccessible(true);\n $questionHelperReflectionProperty->setValue($io, $questionHelper);\n\n $commandTester->injectIntoCommandProperty('io', $io);\n\n touch(__DIR__.'/accompli.json');\n\n $commandTester->execute($input, array(), $output);\n\n $this->assertRegExp('/An Accompli configuration file already exists. Do you wish to overwrite it?/', $commandTester->getDisplay());\n $this->assertEquals('', file_get_contents(__DIR__.'/accompli.json'));\n }",
"protected function finaliseInstall()\n\t{\n\t\t// Clobber any possible pending updates\n\t\t$update = Table::getInstance('update');\n\t\t$uid = $update->find(\n\t\t\tarray(\n\t\t\t\t'element' => $this->element,\n\t\t\t\t'type' => 'module',\n\t\t\t\t'client_id' => $this->clientId,\n\t\t\t)\n\t\t);\n\n\t\tif ($uid)\n\t\t{\n\t\t\t$update->delete($uid);\n\t\t}\n\n\t\t// Lastly, we will copy the manifest file to its appropriate place.\n\t\tif ($this->route !== 'discover_install')\n\t\t{\n\t\t\tif (!$this->parent->copyManifest(-1))\n\t\t\t{\n\t\t\t\t// Install failed, rollback changes\n\t\t\t\tthrow new \\RuntimeException(\\JText::_('JLIB_INSTALLER_ABORT_MOD_INSTALL_COPY_SETUP'));\n\t\t\t}\n\t\t}\n\t}",
"protected function finaliseInstall()\n\t{\n\t\t// Clobber any possible pending updates\n\t\t/** @var Update $update */\n\t\t$update = Table::getInstance('update');\n\t\t$uid = $update->find(\n\t\t\tarray(\n\t\t\t\t'element' => $this->element,\n\t\t\t\t'type' => $this->type,\n\t\t\t\t'folder' => $this->group,\n\t\t\t)\n\t\t);\n\n\t\tif ($uid)\n\t\t{\n\t\t\t$update->delete($uid);\n\t\t}\n\n\t\t// Lastly, we will copy the manifest file to its appropriate place.\n\t\tif ($this->route !== 'discover_install')\n\t\t{\n\t\t\tif (!$this->parent->copyManifest(-1))\n\t\t\t{\n\t\t\t\t// Install failed, rollback changes\n\t\t\t\tthrow new \\RuntimeException(\n\t\t\t\t\t\\JText::sprintf(\n\t\t\t\t\t\t'JLIB_INSTALLER_ABORT_PLG_INSTALL_COPY_SETUP',\n\t\t\t\t\t\t\\JText::_('JLIB_INSTALLER_' . $this->route)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}",
"public function runInstallation()\n\t{\n\t\tif (!$this->isInstalled()){\n\t\t\t$msg = 'Configuration of this plug-in is not done.';\n\t\t\t$msg .= \"<br/>\\n\".$this->testParentMetadataConfig();\n\t\t\tthrow new BizException('' , 'Server', null, $msg);\n\t\t}\n\t}",
"private function configureNewInstallation()\n {\n /**\n * @var string $code\n * @var array $data\n */\n foreach ($this->attributeContainer->getAttributeProperties() as $code => $data) {\n $this->attributeInstaller->install($code, (array) $data);\n }\n\n /** Set the Frenet cache type enabled by default when module is installed. */\n $this->cacheType->setEnabled(true);\n }",
"public function runInstallMode(): void\n {\n $this->init();\n }",
"protected function updateAfterInstall() {}",
"public function install()\n {\n Symphony::Configuration()->set('example-data', 'example-value', 'config_to_params');\n Symphony::Configuration()->write();\n \n }",
"public function afterInstall()\n\t{}",
"public function manualInstallationAction() {\n\t\t$this->writeMergedComposerJson();\n\t\t$this->assignViewVariables();\n\t}",
"protected function configureCommand(): void\n {\n }",
"private static function finish_installation() {\n\t\t$state = self::get_state();\n\t\tif ( empty( $state['steps'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $state['steps'] as $step ) {\n\t\t\tif ( ! empty( $step['last_error'] ) ) {\n\t\t\t\t$state['status'] = 'has_error';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( 'has_error' !== $state['status'] ) {\n\t\t\t$state['status'] = 'finished';\n\t\t}\n\n\t\tWC_Helper_Options::update( 'product_install', $state );\n\t}",
"public function testPhpBenchDistConfig()\n {\n list($exitCode, $results) = $this->execCommand('env/config_dist', 'run');\n $this->assertEquals(0, $exitCode);\n $this->assertContains('Done', $results);\n }",
"public function configure()\n {\n $artisan = $this->installer->findArtisan();\n\n /*\n $baseCommands = [\n \"$artisan vendor:publish\",\n \"$artisan optimize\",\n ];\n\n if($this->installer->requiresMIKConfiguration()) {\n $baseCommands[] = \"$artisan session:table\";\n }\n */\n\n $commands = $this->installer->formatCommands([\n \"$artisan vendor:publish\",\n \"$artisan optimize\",\n \"$artisan session:table\"\n ]);\n\n $commands[] = \"$artisan soda:setup\";\n\n $this->installer->runCommands($commands);\n }",
"public function testConfigDirChange() {\n $this->installProcedure->shouldBeCalledTimes(2);\n $this->updateProcedure->shouldNotBeCalled();\n\n $this->cachedInstall->install($this->installer, $this->updater);\n $this->cachedInstall->setConfigDir($this->appRoot . '/config/b');\n $this->cachedInstall->install($this->installer, $this->updater);\n\n $this->assertSiteInstalled();\n $this->assertSiteCached($this->cachedInstall->getInstallCacheId());\n $this->assertSiteCached($this->cachedInstall->getUpdateCacheId());\n }",
"public function run_install_process() {}",
"public function hookConfigure(): void\n {\n $this->say(\"Executing the Plugin's configure hook...\");\n $this->_exec(\"php ./src/hook_configure.php\");\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Maximum embedded payload fraction. Must be 64. | public function maxPayloadFrac() { return $this->_m_maxPayloadFrac; } | [
"public function leafPayloadFrac() { return $this->_m_leafPayloadFrac; }",
"public function minPayloadFrac() { return $this->_m_minPayloadFrac; }",
"protected function maximumFileUploadSize() {\n\t\treturn min(Files::sizeStringToBytes(ini_get('post_max_size')), Files::sizeStringToBytes(ini_get('upload_max_filesize')));\n\t}",
"public function getMaxModulusSize()\n {\n return $this->max_modulus_size;\n }",
"public function setMaximumFractionDigits($maximumFractionDigits);",
"public function getMaxBytesSpecUrl()\n {\n $value = $this->get(self::MAX_BYTES_SPEC_URL);\n return $value === null ? (string)$value : $value;\n }",
"public function getMaxLength()\n {\n return 254;\n }",
"protected function maxUploadSizeInBytes()\n\t{\n\t\treturn $this->params->get('maxUploadSizeInBytes', 800000);\n\t}",
"public function getMaxSizeTransformation()\n\t{\n\t\treturn Configuration::getMaxSizeForDocumentTransformation();\n\t}",
"public function getMaximumUploadSize();",
"public function getMaxSize() {\n\treturn number_format($this->_max/1048576, 1) . \"MB\"; // number_format() formats a number with grouped thousands\n }",
"public function getMaxAbstractLength()\n {\n return 200;\n// return tx_rnbase_configurations::getExtensionCfgValue(\n// 'mksearch',\n// 'abstractMaxLength_' . $this->extKey->getValue() . '_' . $this->contentType->getValue()\n// );\n }",
"public function fileUploadMaxSize()\n {\n\n function bytes( $val )\n {\n $val = trim( $val );\n $last = strtolower( $val[strlen( $val ) - 1] );\n switch($last) {\n case 'g':\n $val *= 1024;\n case 'm':\n $val *= 1024;\n case 'k':\n $val *= 1024;\n }\n\n return $val;\n }\n\n $max_size = bytes( ini_get( 'post_max_size' ) );\n $upload_max = bytes( ini_get( 'upload_max_filesize' ) );\n\n if( $upload_max > 0 && $upload_max < $max_size )\n $max_size = $upload_max;\n\n return $max_size;\n }",
"public function getMaxSize()\n {\n return $this->maxSize;\n }",
"public function getMaxAttributeLength()\n {\n return (int)$this->floatValue('recorded.value.max.length', 1200);\n }",
"public function getMaximumFileUploadSize()\n {\n return min(convertPHPSizeToBytes(ini_get('post_max_size')), convertPHPSizeToBytes(ini_get('upload_max_filesize')));\n }",
"public function max_broadcast_length() {\n\t\treturn 140;\n\t}",
"public function max_file_size() {\n\n\t\tif ( ! empty( $this->field_data['max_size'] ) ) {\n\n\t\t\t// Strip any suffix provided (eg M, MB etc), which leaves is wit the raw MB value.\n\t\t\t$max_size = preg_replace( '/[^0-9.]/', '', $this->field_data['max_size'] );\n\t\t\t$max_size = wpforms_size_to_bytes( $max_size . 'M' );\n\n\t\t} else {\n\t\t\t$max_size = wpforms_max_upload( true );\n\t\t}\n\n\t\treturn $max_size;\n\t}",
"public static function getMaxUploadFileSize() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test we can properly check if a cookie is a session cookie (has no expiry time) | public function testIsSessionCookie()
{
$cookies = array(
'cookie=foo; path=/foo/baz; secure; expires=Tue, 21-Nov-2006 08:33:44 GMT; domain=.example.com;' => false,
'cookie=foo; path=/; domain=.example.com;' => true,
'cookie=foo; path=/; secure; domain=.example.com;' => true,
'cookie=foo; path=/; domain=.example.com; secure; expires=' . date(DATE_COOKIE) => false
);
foreach ($cookies as $cstr => $issession) {
$cookie = Zend_Http_Cookie::fromString($cstr);
if (! $cookie) $this->fail('Got no cookie object from a valid cookie string');
$this->assertEquals($issession, $cookie->isSessionCookie(), 'isSessionCookie is not as expected');
}
} | [
"public function isSetSessionCookie() {}",
"public function isSessionCookie()\n\t{\n\t\treturn $this->expires === 0;\n\t}",
"public function us_is_cookie_session(){\n\t\treturn (!h::cC('usID') or h::cC('usID', $this->us->usID));\n\t\t}",
"function hasSessionCookie() {\n\t\tglobal $wgDisableCookieCheck;\n\n\t\treturn $wgDisableCookieCheck ? true : $this->getRequest()->checkSessionCookie();\n\t}",
"public static function sessionCookieExists(){\n\t\treturn \\filter_has_var(\\INPUT_COOKIE, \\session_name());\n\t}",
"private function validateSessionId ( )\n\t{\n\t\t$this->wipe( );\n\t\t\n\t\t/*\n\t\t * try SID from cookies\n\t\t */\n\t\t$this->sid = '';\n\t\tif ( array_key_exists(self::COOKIE_SESSIONID, $_COOKIE) )\n\t\t\t$this->sid = (string)$_COOKIE[self::COOKIE_SESSIONID];\n\n\t\t/**\n\t\t * Check if session Id from cookies is valid.\n\t\t */\n\t\tif ( $this->sid != '' )\n\t\t{\n\t\t\t$sql = $this->pdo->prepare( \"SELECT `\" . self::F_UID . \"`\n\t\t\t\t\tFROM `\" . self::T_SESSIONS . \"`\n\t\t\t\t\tWHERE `\" . self::F_SID . \"` = :sid\n\t\t\t\t\tAND `\" . self::F_CLID . \"` = :cid\" );\n\t\t\t\n\t\t\t$sql->bindValue( ':sid', $this->sid );\n\t\t\t$sql->bindValue( ':cid', $this->cid );\n\t\t\t\n\t\t\tif ( $this->uid = (int)pdo1f( $sql ) )\n\t\t\t{\n\t\t\t\t $this->signed = true;\n\t\t\t\t \n\t\t\t\t $this->pdo->prepare( \"UPDATE `\" . self::T_SESSIONS . \"`\n\t\t\t\t\tSET `\" . self::F_VALID . \"` = (NOW() + INTERVAL \" . self::SESSIONEXPIRATION * 60 . \" MINUTE)\n\t\t\t\t\tWHERE `\" . self::F_SID . \"` = ?\n\t\t\t\t\tAND `\" . self::F_CLID . \"` = ?\" )->execute( array( $this->sid, $this->cid ) );\n\t\t\t\t \n\t\t\t\t_fw_set_cookie( self::COOKIE_SESSIONID, $this->sid, 0 );\n\t\t\t\t\n\t\t\t\t$this->load( );\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t$this->uid = NULL;\n\t\t}\n\t\treturn false;\n\t}",
"public function isSetSessionCookie()\n {\n return ($this->newSessionID || $this->forceSetCookie) && $this->lifetime == 0;\n }",
"public static function checkExpiredSession()\n\t{\n\t\tglobal $ilSetting;\n\t\t\n\t\t// do not check session in fixed duration mode\n\t\tif( $ilSetting->get('session_handling_type', 0) != 1 )\n\t\t\treturn;\n\n\t\t// check for expired sessions makes sense\n\t\t// only when public section is not enabled\n\t\t// because it is not possible to determine\n\t\t// wether the sid cookie relates to a session of an\n\t\t// authenticated user or a anonymous user\n\t\t// when the session dataset has allready been deleted\n\n\t\tif(!$ilSetting->get(\"pub_section\"))\n\t\t{\n\t\t\tglobal $lng;\n\n\t\t\t$sid = null;\n\n\t\t\tif( !isset($_COOKIE[session_name()]) || !strlen($_COOKIE[session_name()]) )\n\t\t\t{\n\t\t\t\tself::debug('Browser did not send a sid cookie');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sid = $_COOKIE[session_name()];\n\n\t\t\t\tself::debug('Browser sent sid cookie with value ('.$sid.')');\n\n\t\t\t\tif(!self::isValidSession($sid))\n\t\t\t\t{\n\t\t\t\t\tself::debug('remove session cookie for ('.$sid.') and trigger event');\n\n\t\t\t\t\t// raw data will be updated (later) with garbage collection [destroyExpired()]\n\t\t\t\t\t\n\t\t\t\t\tself::removeSessionCookie();\n\n\t\t\t\t\t// Trigger expiredSessionDetected Event\n\t\t\t\t\tglobal $ilAppEventHandler;\n\t\t\t\t\t$ilAppEventHandler->raise(\n\t\t\t\t\t\t'Services/Authentication', 'expiredSessionDetected', array()\n\t\t\t\t\t);\n\n\t\t\t\t\tilUtil::redirect('login.php?expired=true'.'&target='.$_GET['target']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function session_verify() {\n global $CFG;\n\n /// disable checks when working in cookieless mode\n if (empty($CFG->usesid) || !empty($_COOKIE['MoodleSession'.$CFG->sessioncookie])) {\n if ($this->session != NULL) {\n if (empty($_COOKIE['MoodleSessionTest'.$CFG->sessioncookie])) {\n $this->report_session_error();\n } else if (isset($this->session->session_test) && $_COOKIE['MoodleSessionTest'.$CFG->sessioncookie] != $this->session->session_test) {\n $this->report_session_error();\n }\n }\n }\n }",
"public function is_cookie_set()\n {\n }",
"function IsValidSession($sessionid=false) {\n\t\tif (!$sessionid) return false;\n\t\t$db = &GetDatabase();\n\t\tif (!$db) return false;\n\t\t$qry = \"SELECT 1 FROM \" . TRACKPOINT_TABLEPREFIX . \"cookies WHERE sessionid='\" . addslashes($sessionid) . \"'\";\n\t\t$result = $db->Query($qry);\n\t\t$row = $db->Fetch($result);\n\t\tif (empty($row)) return false;\n\t\treturn true;\n\t}",
"public function testCookies()\n {\n static::$config->cookies(false, false, '/dominio', 'dominio', true);\n $this->assertEquals(false, ini_get(\"session.use_only_cookies\"));\n $this->assertEquals(false, ini_get(\"session.use_only_cookies\"));\n $this->assertEquals('/dominio', ini_get(\"session.cookie_path\"));\n $this->assertEquals('dominio', ini_get(\"session.cookie_domain\"));\n $this->assertEquals(true, ini_get(\"session.cookie_secure\"));\n }",
"public function sessionCheck() {\n\t\treturn !CommonComponent::cookiesDisabled();\n\t\t/*\n\t\tif (!empty($_COOKIE) && !empty($_COOKIE[Configure::read('Session.cookie')])) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t\t*/\n\t}",
"protected function checkSession()\n {\n $cookie = Cookie::getInstance();\n $sessId = $cookie->get($this->name);\n\n // Deletes session cookie if empty session ID\n if ($sessId == '') {\n $cookie->delete($this->name);\n }\n\n // Reset session id if it is invalid\n if ($sessId == '' || preg_match('/([^A-Za-z0-9\\-]+)/', $sessId)) {\n $sessId = substr(md5(uniqid(mt_rand(), true)), 0, 26);\n\n session_id($sessId);\n }\n }",
"protected function isSetSessionCookie()\n {\n return isset($_COOKIE[$this->name])\n ? true\n : false;\n }",
"public static function check ()\n\t{\n\t\treturn isset($_COOKIE[SESSION_COOKIE]);\n\t}",
"public static final function checkCookie() {\n\n\t\ttry {\n\t\t\n\t\t\tSiteCookie::extract('vcd_cookie');\n\n\t\t\t// Check if we find the desired values in the cookie\n\t\t\tif (isset($_COOKIE['session_id']) && isset($_COOKIE['session_uid'])) {\n\t\t\t\t$old_sessionid = $_COOKIE['session_id'];\t\t\t\n\t\t\t\t$user_id \t = $_COOKIE['session_uid'];\n\t\t\t\t$session_time = $_COOKIE['session_time'];\n\t\t\t\t\n\t\t\t\tif (UserServices::isValidSession($old_sessionid, $session_time, $user_id)) {\n\t\t\t\t\t\n\t\t\t\t\t//Update users cookie\n\t\t\t\t\tSiteCookie::extract(\"vcd_cookie\");\n\t\t\t\t\tif (isset($_COOKIE['language'])) {\n\t\t\t\t\t\t$sess_lang = $_COOKIE['language'];\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$Cookie = new SiteCookie(\"vcd_cookie\");\n\t\t\t\t\t$Cookie->clear();\n\t\t\t\t\t$Cookie->put(\"session_id\", $old_sessionid);\t\n\t\t\t\t\t$Cookie->put(\"session_time\", VCDUtils::getmicrotime());\n\t\t\t\t\t$Cookie->put(\"session_uid\", $user_id);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$Cookie->put(\"language\", $sess_lang);\n\t\t\t\t\t$Cookie->set();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// And finally log the user in and add userObj to session\n\t\t\t\t\t$user = UserServices::getUserByID($user_id);\n\t\t\t\t\t\n\t\t\t\t\t// Check if user has been deleted from last visit .\n\t\t\t\t\tif ($user instanceof userObj ) {\n\t\t\t\t\t\t$_SESSION['user'] = $user;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Invalidate the cookie ...\n\t\t\t\t\t\t$Cookie->clear();\n\t\t\t\t\t\t$Cookie->put(\"language\", $sess_lang);\n\t\t\t\t\t\t$Cookie->set();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Throw new Exception to notify user of the deleted account.\n\t\t\t\t\t\tVCDException::display(\"User account has been disabled.\");\n\t\t\t\t\t\tredirect();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Check if we are supposed to log this event ..\n\t\t\t\t\tif (VCDLog::isInLogList(VCDLog::EVENT_LOGIN )) {\n\t\t\t\t\t\tVCDLog::addEntry(VCDLog::EVENT_LOGIN, \"User authenticated from cookie\");\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t} catch (Exception $ex) {\n\t\t\tthrow $ex;\n\t\t}\n\t}",
"function check_existing_session($cookie_containing_session){\n //TODO: santize to be safe\n \n $valid_session = false;\n\n $query = (\"SELECT * FROM sessions WHERE session_id='$cookie_containing_session'\");\n $dbConn = pgConnect();\n $results = pgQuery($dbConn, $query);\n //if (mysql_num_rows($result)==0) $valid_session = false; //not needed just for readability\n\n $tuple = pg_fetch_assoc($results);\n if(count($tuple) == 0) return $valid_session;\n if($tuple['session_id'] == $cookie_containing_session && $tuple['ipaddr']==$_SERVER['REMOTE_ADDR']) $valid_session = true; // if false delete session?\n // Could potentially delete session on server if that's more secure\n else{\n end_session();\n //courtest of http://stackoverflow.com/questions/686155/remove-a-cookie\n if (isset($_COOKIE['c_sId'])) {\n unset($_COOKIE['c_sId']);\n setcookie('c_sId', '', time() - 3600, '/'); // empty value and old timestamp\n // die(\"in loop\");\n }\n if (isset($_COOKIE['PHPSESSID'])) {\n unset($_COOKIE['PHPSESSID']);\n setcookie('PHPSESSID', '', time() - 3600, '/'); // empty value and old timestamp\n } \n } \n pgDisconnect($dbConn);\n return $valid_session;\n }",
"public static function isCookie() {\n return self::$auth_type == self::T_COOKIE;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Functions to do with the database table name root. | abstract public function
get_database_table_name_root(); | [
"function getFullTableName () {return $this->db->getPrefix () . $this->getTableName ();}",
"function table_name()\n\t{\n\t\treturn( \"t_base\" );\n\t}",
"abstract protected function fetchTableNamesDb();",
"static function get_table_name()\r\n {\r\n return Utilities :: get_classname_from_namespace(self :: CLASS_NAME, true);\r\n }",
"protected function getStaticDatabaseTableName() {\r\n $paramDbPrefix=Parameter::getGlobalParameter('paramDbPrefix');\r\n return $paramDbPrefix . self::$_databaseTableName;\r\n }",
"protected function getStaticDatabaseTableName() {\r\n global $paramDbPrefix;\r\n return $paramDbPrefix . self::$_databaseTableName;\r\n }",
"abstract protected function getTableName();",
"function make_table_name() {\n\n\t\tglobal $wpdb;\n\n\t\t// get WP's table preffix\n\t\t$table_prefix = $wpdb->prefix;\n\t\t$t_name = \"subform_settings\";\n\n\t\t$table_name = $table_prefix . $t_name;\n\n\t\treturn $table_name;\n\t}",
"protected function getStaticDatabaseTableName() {\r\n $paramDbPrefix = Parameter::getGlobalParameter ( 'paramDbPrefix' );\r\n return $paramDbPrefix . self::$_databaseTableName;\r\n }",
"public function get_table_name()\n {\n }",
"function testTablePrefix($dbTableName);",
"public function defaultTableName(){\n\t\t$file = explode('/', $this->databaseFile);\n\t\t$fileName = explode('.', $file[count($file)-1]);\n\t\treturn $fileName[0];\n\t}",
"function dok_tn($table_name) {\n\treturn DOK_MYSQL_TABLES_PREFIX.$table_name;\n}",
"abstract public function getMySQLTableName();",
"public function stlHandleTable(){\n\t\t$table = $this->getTable();\n\t\tif( $prefix = $this->getPrefix() ){\n\t\t\t$table = str_replace($prefix, '', $table);\n\t\t}\n\t\treturn strtolower($table);\n\t}",
"public abstract function getTableName();",
"public function findRootSequenceTable($table_name){\n\t\treturn $table_name;\n\t}",
"public function get_table_name() {\n\t\treturn $this->table_prefix . self::TABLE_NAME;\n\t}",
"private function _getFullTableName() : string\n {\n return $this->_serverName . \".\" . $this->_name;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the [oehdbordbuilddate] column value. | public function getOehdbordbuilddate()
{
return $this->oehdbordbuilddate;
} | [
"public function getBuildDate()\n {\n if ($data = $this->getBuildData()) {\n return $data['date'];\n }\n }",
"public function getBuildDate(): string {\n return DateTimeHelper::timestampToFormattedDateTime($this->getBuildTimestamp()) ?? '';\n }",
"public function getDate()\n {\n\n if ($this->lodge_date === null) {\n return null;\n } else {\n\n $lodgedDateTime = \\DateTime::createFromFormat('Y-m-d', $this->lodge_date);\n return $lodgedDateTime;\n }\n\n }",
"public function getRevisionDate()\n {\n $value = $this->get(self::REVISIONDATE);\n return $value === null ? (string)$value : $value;\n }",
"function GetLastBuildDate()\n {\n return $this->lastBuildDate;\n }",
"public function getBuildTimestamp(): int {\n return static::BUILD_DATE;\n }",
"public function getDoDate()\n {\n return $this->data['fields']['do_date'];\n }",
"protected function convertBuildDate()\n {\n if (null === $this->buildDate) {\n $this->generatebuildDate();\n }\n return date(\"d. M Y H:i\", $this->buildDate);\n }",
"public function getDate(): string\n {\n return $this->getVersionFile()->getDate();\n }",
"public function lastBuildDate(): ?string\n {\n if (null !== $this->lastBuildDate) {\n return $this->lastBuildDate->format('D d M Y H:i:s O');\n }\n\n return null;\n }",
"private function _getLastBuildDate() {\n\t\tif( file_exists( $this->lastBuildFile ) ) {\n\t\t\treturn file_get_contents( $this->lastBuildFile );\n\t\t} else {\n\t\t\treturn $this->_calcLastBuildDate( );\n\t\t}\n\t}",
"public function getDate()\r\n {\r\n return (string) $this->svnInfo->date;\r\n }",
"public function getScheduledUpdateDate()\n {\n $this->_checkBuildRequirement();\n return $this->scheduled_update_date;\n }",
"public function get_dated()\n {\n return $this->_dated;\n }",
"public function getDate() {\n return $this->getEvalAttribute('date');\n }",
"public function getLogdate()\n {\n return $this->logdate;\n }",
"public function getIssueDate()\n {\n return isset($this->issue_date) ? $this->issue_date : '';\n }",
"public function getWaybillDate()\n {\n return $this->waybillDate;\n }",
"public function getChildOrderDate() : string\n {\n return $this->child_order_date;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Appends value to 'phoneda' list | public function appendPhoneda($value)
{
return $this->append(self::PHONEDA, $value);
} | [
"public function append($value) {\n\t\t$this->array[] = $value;\n\t}",
"public function add($value){\n $this->list[] = $value;\n }",
"public function append($value)\n {\n $this->items[] = $value;\n }",
"public function append($value){}",
"function prepend($value)\n {\n if ($this->contains($value)) return;\n $this->list = $value.($this->list ? ',' : '').$this->list;\n }",
"private function addToBindings($value)\n {\n if (is_array($value)){\n $this->bindings = array_merge($this->bindings , array_values($value));\n }\n else{\n $this->bindings[] = $value;\n }\n }",
"public function append($value);",
"public function appendStHeroIdList($value)\n {\n return $this->append(self::STHEROIDLIST, $value);\n }",
"private function addToBindings($value) {\n // 0 => 1\n // 1 => 3\n // 2 => 2\n // 3 => 4\n if (is_array($value)) {\n $this->bindings = array_merge($this->bindings, array_values($value));\n } else {\n $this->bindings[] = $value;\n }\n }",
"function import_append($valuelist)\r\n\t{\r\n\t\tforeach ($valuelist as $key => $value)\r\n\t\t{\r\n\t\t\t$this->set($key, $value);\r\n\t\t} \r\n\t}",
"function append(array $array, $value = null)\n{\n $array[] = $value;\n\n return $array;\n}",
"public function addValue($value)\n\t{\n\t\t// Check if this Parameter has a previously set value\n\t\tif($this->value === null)\n\t\t{\n\t\t\t// Initialize this Parameters value to a new array\n\t\t\t$this->value = array();\n\t\t}\n\t\t\n\t\t// Check if the new value is an array\n\t\tif(!is_array($value))\n\t\t{\n\t\t\t// Append new single value to this Parameters value array\n\t\t\t$this->value[] = $value;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Append every new value to this Parameters value array\n\t\t\tforeach($value as $v) $this->value[] = $v;\n\t\t}\n\t}",
"public function addValue($value);",
"public function addtobinding($value)\n {\n if(! is_null($this->bindings))\n {\n $this->bindings = array_merge($this->bindings,array_values($value)); \n }\n else\n {\n $this->bindings = $value; \n }\n }",
"function add_poem_to_list($wp_id) {\n // Get the current line count\n // $line_count = curr_line_count($wp_id);\n\n\t// CHECK for earlier poems otherwise create array for poems\n\tif ( isset($_COOKIE[\"my_working_poems\"]) ) {\n\t\t//echo \"cookie before update: \";\n\t\t$my_working_poems = json_decode($_COOKIE[\"my_working_poems\"], true);\n\t} else {\n\t\t$my_working_poems = array();\n\t}\n\t// Ad current if to my poems var\n\t$my_working_poems[] = $wp_id;\n\n\t// Remember which working poems this user has added to\n\tsetcookie(\"my_working_poems\", json_encode($my_working_poems), time()+(60*60*36), \"/\");\n}",
"public function append($value)\n {\n $this->set($this->get() . $value);\n }",
"function AddIntoArray($value,$array){\n\tif(!in_array($value, $array)){\n\t\t$array[] =$value;\n\t};\n\treturn $array;\n}",
"function &gs_array_append($name, $value) {\n static $instance = null;\n if($instance === null) {\n $instance =& GlobalStorage::instance();\n } // if\n return $instance->arrayAppend($name, $value);\n }",
"public function appendPromotions(\\service\\message\\common\\PromotionRule $value)\n {\n return $this->append(self::promotions, $value);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get PDP Button Design | public function getPDPButtonDesign($store = \Magento\Store\Model\ScopeInterface::SCOPE_STORE)
{
return $this->scopeConfig->getValue(self::XML_CONFIG_PDP_BUTTON_DESIGN, $store);
} | [
"public function getButtonDesign()\n {\n if ($this->helper('breadcheckout')->getUseCustomCssCart()) {\n return $this->helper('breadcheckout')->getButtonDesign();\n } else {\n return $this->helper('breadcheckout')->getCartButtonDesign();\n }\n }",
"public function getButton() {}",
"function getButton(){\r\n\t\treturn '';\r\n\t\treturn '<div style=\"width: 45px; height:18px; border:1px ridge #000000; margin:0; ' .\r\n\t\t\t\t'background-color:#' .$this->get(). '; '.\r\n\t\t\t\t'padding:0; float:left;\" ' .\r\n\t\t\t\t'onClick=\"showColorPicker(this,document.forms[0].rgb2)\"' .\r\n\t\t\t\t'>Change</div>';\r\n\t}",
"function getButtonType() { return $this->_buttontype; }",
"abstract protected function get_create_button_text();",
"public function get_button_shape() {\n\n\t\treturn $this->get_option( 'button_shape' );\n\t}",
"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 }",
"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 }",
"function _getButtonName()\r\n\t{\r\n\t\treturn $this->buttonPrefix.\"-\".$this->renderOrder;\r\n\t}",
"private function get_button_type() {\n\t\treturn isset( $this->settings['payment_request_button_type'] ) ? $this->settings['payment_request_button_type'] : 'default';\n\t}",
"public function getButtonColor();",
"protected static function _getButton()\n\t{\n\t\treturn '<button '.self::ATTR_MASK.'>'.self::INNER_HTML_MASK.'</button>';\n\t}",
"public function get_button_text();",
"function _getButtonName()\n\t{\n\t\treturn $this->_buttonPrefix.\"-\".$this->renderOrder;\n\t}",
"public function getButton(){\n\t\t$this->_buttonObj->setId('yuiWysiwigButton_' . $this->getId());\n\t\t$this->_buttonObj->setText($this->getButtonText());\n\t\t$this->_buttonObj->setType('onClick');\n\t\t$this->_buttonObj->setTitle($this->getButtonTitle());\n\t\t$this->_buttonObj->setDisabled($this->getDisabled());\n\t\t$this->_buttonObj->setHidden($this->getHidden());\n\t\t$this->_buttonObj->setWidth(120);\n\t\t$this->_buttonObj->setOnClick($this->getButtonOnClick());\n\n\t\treturn $this->_buttonObj->getHTML();\n\t}",
"public function getButtons();",
"public function button($button) { return $this->getButton($button);}",
"function CreateBtn($caption,$btn_type,$color,$size,$class,$icon,$tooltip,$confirmation_template)\n{\n $btn_type=$btn_type==NULL ? 'button' : $btn_type;\n return '<button type=\"'.$btn_type.'\" '.BtnCore($caption,$color,$size,$class,$icon,$tooltip,$confirmation_template).'</button>';\n\n\n}",
"protected function getPayButtonHtml()\n\t{\n\t\treturn $this->getChildHtml('pay_button');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets query for [[MenuTops0]]. | public function getMenuTops0()
{
return $this->hasMany(MenuTop::className(), ['updatedBy' => 'id']);
} | [
"public function getTrnMenuQuery()\n {\n\t\t$sql = $this->getQueryContent('TrnMenuQuery');\n\t\treturn $this->db->fireSqlFetchAll($sql,'TrnMenuQuery');\n\t}",
"public function getTipeMenu(){\n\t\t$query = \"SELECT * FROM tipe_menu\";\n\t\t$result = $this->executeQuery($query);\n\t\twhile ( $row = mysqli_fetch_assoc($result[0]) ) {\n\t $this->tipeMenu[] = $row;\n\t }\n\t return $this->tipeMenu;\n\t}",
"public function getMenuItem() {\r\n $criteria = new CDbCriteria;\r\n $criteria->compare('level', 1);\r\n $criteria->order='rank ASC';\r\n return Menu::model()->findAll($criteria);\r\n }",
"public function Menu()\n\t{\n\t\t$menu = self::getInstance('Menu');\n\t\t$menu->_query = &$this->_query;\n\t\t$menu->_tbl_alias = 'menu';\n\t\t$menu->_query->select('mm.menuid');\n\t\t$menu->_query->leftJoin('#__modules_menu AS mm ON(mm.moduleid = m.id)');\n\t\t$menu->_query->leftJoin('#__menu AS menu ON(menu.id = mm.menuid)');\n\t\t\n\t\t//Create a reference to back to scope\n\t\t$menu->addReference($this->getName(),get_class($this));\n\t\t\n\t\treturn $menu;\n\t}",
"public static function find()\n\t{\n\t\treturn new MenuItemQuery(get_called_class());\n\t}",
"public function getMenuObject($params = array('menu' => 'core_main')) {\n $selectQuery = $this->getMenusQuery($params);\n return Engine_Api::_()->getDbtable('menuItems', 'core')->fetchAll($selectQuery);\n }",
"public function getMenu() {\n //first thing - clear down the menu\n $this->menu->clear(); \n\n //get a new instance of the call\n $getMenuCall = new GetMenuCall();\n \n //generate the body\n $body = ['takeawayID' => $this->takeaway->getId(),\n 'domain' => $this->request->host(),\n 'subDomain' => '',\n ];\n\n //make the request\n $response = $getMenuCall->makeRequest(\n '/api/Takeaway/GetMenu', $getMenuCall->createRequestMessage($body)\n );\n\n //handle the response\n $getMenuCall->handleResult($response); \n }",
"function getMenu() {\r\n\t\t\t$menu = '';\r\n\t\t\t$table = 'tx_pmkglossary_glossary';\r\n\t\t\t$fields = 'pid,uid,sys_language_uid,left(ucase(wordtitle),1) AS firstchar';\r\n\t\t\tif ($this->conf['TYPO3localization']) {\r\n\t\t\t\t$where = '(pid='. intval($GLOBALS['TSFE']->id) .' OR pid IN ('.$this->conf['pid_list'].')) AND (sys_language_uid IN (-1,0) OR (sys_language_uid='.$GLOBALS['TSFE']->sys_language_uid.' AND l10n_parent=0)) '.$this->cObj->enableFields($table);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$where = '(pid='. intval($GLOBALS['TSFE']->id) .' OR pid IN ('.$this->conf['pid_list'].')) AND sys_language_uid IN (-1,'.$GLOBALS['TSFE']->sys_language_uid.') '.$this->cObj->enableFields($table);\r\n\t\t\t}\r\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $table, $where,'firstchar','firstchar');\r\n\t\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {\r\n\t\t\t\t$data = array();\r\n\t\t\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\r\n\t\t\t\t\t$data[] = $row;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// MYSQL's \"ORDER BY\" doesn't sort correctly when string contains national characters\r\n\t\t\t\t// So we need to sort the data using custom PHP callback sorting function\r\n\t\t\t\tusort($data, array($this, '_firstchar_sort'));\r\n\r\n\t\t\t\t$count = 0;\r\n\t\t\t\tforeach ($data as $row) {\r\n\t\t\t\t\t$this->cObj->data = $row;\r\n\t\t\t\t\t$count++;\r\n\t\t\t\t\t$this->cObj->data['blockid'] = $count;\r\n\t \t\t\t\t$menu .= $this->cObj->cObjGetSingle($this->conf['menuItem'], $this->conf['menuItem.']).PHP_EOL;\r\n\r\n\t\t\t\t}\r\n\t\t\t\t$menu = str_replace('|', $menu, $this->conf['menuWrap']);\r\n\t\t\t}\r\n\t\t\treturn $menu;\r\n\t\t}",
"public function getForMenu()\n {\n $staticPageRep = $this->em->getRepository('entities\\StaticPage');\n return $staticPageRep->findBy(array('showMenu' => true));\n }",
"public function getAllMenu(){\n $query = $this->db->get('s_menu');\n return $query->custom_result_object('Menu');\n }",
"static function getMenus($papeis=0){\n\t\t$sqlMenu = \"SELECT m.id, m.nome, m.nome_maquina FROM `system_menu` m WHERE m.`ativo` = 1 AND m.`papel` IN (0,$papeis);\";\n\t\t$db = new DBExecutor();\n\t\t$menuData = $db->db_get($sqlMenu);\n\t\treturn $menuData;\n\t}",
"public function getMenu()\n {\n return $this->menu;\n }",
"public function getMenu()\n {\n return $this->_menu;\n }",
"function getMenuItem($menu){\r\n $sql = \"select * from menu\\n\"\r\n . \"where Item_Name = :menu\";\r\n $result = $db ->prepare($sql);\r\n $result -> bindParam(':menu', $menu);\r\n $result -> execute();\r\n $getMenu = $result2->fetch(PDO::FETCH_ASSOC);\r\n return $getMenu;\r\n }",
"public function getMenuItems(){\n return MenuItem::query()->where('parent_id', '=', null)->where('menuItem','=',true)->get();\n }",
"function GetMenus($options = array()) {\r\n\t\t\r\n\t\t// QUALIFICATION\r\n\t\tif (isset($options['idmenu']))\r\n\t\t\t$this->db->where('idmenu', $options['idmenu']);\t\t\r\n\t\tif (isset($options['menuname']))\r\n\t\t\t$this->db->where('menuname', $options['menuname']);\t\t\r\n\t\tif (isset($options['menudescription']))\r\n\t\t\t$this->db->where('menudescription', $options['menudescription']);\t\t\t\r\n\t\tif (isset($options['menustatus']))\r\n\t\t\t$this->db->where('menustatus', $options['menustatus']);\r\n\t\tif (isset($options['parent']))\r\n\t\t\t$this->db->where('parent', $options['parent']);\r\n\t\tif (isset($options['idcategory']))\r\n\t\t\t$this->db->where('idcategory', $options['idcategory']);\t\r\n\t\tif (isset($options['idarticle']))\r\n\t\t\t$this->db->where('idarticle', $options['idarticle']);\t\t\t\t\t\t\r\n\r\n\t\t//so you don't get any deleted values\r\n\t\tif(!isset($options['menustatus'])) $this->db->where('menustatus !=', 'deleted');\r\n\t\t\r\n\t\t// LIMIT OFFSET\r\n\t\tif (isset($options['limit']) && isset($options['offset']))\r\n\t\t\t$this->db->limit($options['limit'], $options['offset']);\r\n\t\telseif (isset($options['limit']))\r\n\t\t\t$this->db->limit($options['limit']);\r\n\t\t\t\r\n\t\t// SORT\r\n\t\tif (isset($options['sortBy']) && isset($options['sortDirection']))\r\n\t\t\t$this->db->order_by($options['sortBy'], $options['sortDirection']);\r\n\t\t\r\n\r\n\t\t$query = $this->db->get('menus');\r\n\t\t\r\n\t\tif(isset($options['count'])) return $query->num_rows();\r\n\t\t\r\n\t\tif (isset($options['idmenu']))\r\n\t\t\treturn $query->row(0);\r\n\t\r\n\t\treturn $query->result();\r\n\t\t\r\n\t}",
"public function retrieveByName($menuName);",
"public function getMenusInativo();",
"public function getMenuByType($type){\n $query = \"\";\n if($type=='all'){\n $query = $this->db->get(\"menu\");\n }\n else{\n $query=$this->db->get_where('menu',array('type'=>$type));\n }\n return $query->result();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A Dusk test to perform a skeletal search by provenance 2 and validate the results for a manager. | public function SearchProvenance2Manager()
{
// Test user login
$user = $this->testAccounts["org-manager"];
$this->browse(function ($browser) use ($user) {
$browser->visit(new loginPage)
->loginUser($user['email'], $user['password'])
->pause(3000)
->assertSee('Welcome');
// Skeletal elements search set up
$browser->visit(new specimenPage)
->pause(5000)
->clear('@cora-search-options')
->type('@cora-search-options','Provenance 2')
->keys('@cora-search-options', ['{ARROW_DOWN}'])
->keys('@cora-search-options', ['{ENTER}'])
->pause(500)
->keys('@cora-search-options-provenance2','X-232G',['{ENTER}'])
->pause(1000)
->keys('@cora-search-options-provenance2',['{tab}'])
->press('@search-btn')
->pause(50000)
// Search Result Assertions for os coxa CIL 2003-116:G-25:X-232G:903
->waitForLink('CIL 2003-116:G-25:X-232G:903')
->assertSeeLink('CIL 2003-116:G-25:X-232G:903')
->assertSee('Key')
->assertSee('Bone Group')
->assertSee('Bone')
->assertSee('Side')
->assertSee('DNA Sample Number')
// Specimen Assertions
->clickLink('CIL 2003-116:G-25:X-232G:903')
->pause(1000)
->driver->switchTo()->window(collect($browser->driver->getWindowHandles())->last());
$browser
->pause(2000)
->assertSee('CIL 2003-116:G-25:X-232G:903')
->assertVue('form.accession_number','CIL 2003-116', '@specimen')
->assertVue('form.provenance1','G-25', '@specimen')
->assertVue('form.provenance2','X-232G', '@specimen')
->assertInputValue('@designator', '903')
->assertVue('form.sb_id','77','@specimen')
->assertVue('form.side', 'Unsided', '@specimen')
->assertVue('form.completeness', 'Incomplete', '@specimen')
->assertVue('form.measured', null, '@specimen')
->assertVue('form.dna_sampled', null , '@specimen' )
->assertVue('form.isotope_sampled', null, '@specimen')
->assertVue('form.inventoried', true, '@specimen')
->assertVue('form.inventoried_at', null, '@specimen')
->assertVue('form.ct_scanned', null, '@specimen')
->assertVue('form.xray_scanned', null, '@specimen')
->assertVue('form.individual_number', null, '@specimen')
->assertVue('form.tags', null, '@specimen')
->logoutUser();
;
});
} | [
"public function SearchProvenance2DNAManager()\n {\n // seComparison user login\n $user = $this->testAccounts[\"org-manager\"];\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new loginPage)\n ->loginUser($user['email'], $user['password'])\n ->waitForText('Welcome')\n ->assertSee('Welcome');\n\n // DNA search set up\n $browser->visit(new specimenPage)\n ->pause(5000)\n ->clear('@cora-search-options')\n ->type('@cora-search-options','Provenance 2')\n ->keys('@cora-search-options', ['{ARROW_DOWN}'])\n ->keys('@cora-search-options', ['{ARROW_DOWN}'])\n ->keys('@cora-search-options', ['{ENTER}'])\n ->pause(500)\n ->keys('@cora-search-options-provenance2','X-232G',['{ENTER}'])\n ->pause(1000)\n ->keys('@cora-search-options-provenance2',['{tab}'])\n ->press('@search-btn')\n ->pause(30000)\n\n // Search Result Assertions for os coxa CIL 2003-116:G-25:X-232G:903\n ->waitForLink('CIL 2003-116:G-25:X-232G:903')\n ->assertSeeLink('CIL 2003-116:G-25:X-232G:903')\n ->assertSee('Key')\n ->assertSee('Bone Group')\n ->assertSee('Bone')\n ->assertSee('Side')\n ->assertSee('Sample Number')\n\n // DNA Assertions\n ->clickLink('CIL 2003-116:G-25:X-232G:903')\n ->pause(1000)\n ->driver->switchTo()->window(collect($browser->driver->getWindowHandles())->last());\n\n $browser\n ->pause(2000)\n ->assertSee('View Specimen - CIL 2003-116:G-25:X-232G:903')\n ->assertVue('form.accession_number','CIL 2003-116', '@specimen')\n ->assertVue('form.provenance1','G-25', '@specimen')\n ->assertVue('form.provenance2','X-232G', '@specimen')\n ->assertInputValue('@designator', '903')\n ->assertVue('form.sb_id','77','@specimen')\n ->assertVue('form.side', 'Unsided', '@specimen')\n ->assertVue('form.completeness', 'Incomplete', '@specimen')\n ->assertVue('form.measured', null, '@specimen')\n ->assertVue('form.dna_sampled', null , '@specimen' )\n ->assertVue('form.isotope_sampled', null, '@specimen')\n ->assertVue('form.inventoried', true, '@specimen')\n ->assertVue('form.inventoried_at', null, '@specimen')\n ->assertVue('form.ct_scanned', null, '@specimen')\n ->assertVue('form.xray_scanned', null, '@specimen')\n ->assertVue('form.individual_number', null, '@specimen')\n ->assertVue('form.tags', null, '@specimen')\n\n ->logoutUser();\n ;\n });\n }",
"public function SearchProvenance1DNAOrgAdmin()\n {\n // seComparison user login\n $user = $this->testAccounts[\"org-admin\"];\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new loginPage)\n ->loginUser($user['email'], $user['password'])\n ->waitForText('Welcome')\n ->assertSee('Welcome');\n\n // DNA search set up\n $browser->visit(new specimenPage)\n ->pause(5000)\n ->clear('@cora-search-options')\n ->type('@cora-search-options','Provenance 1')\n ->keys('@cora-search-options', ['{ARROW_DOWN}'])\n ->keys('@cora-search-options', ['{ARROW_DOWN}'])\n ->keys('@cora-search-options', ['{ENTER}'])\n ->pause(500)\n ->keys('@cora-search-options-provenance1','G-04',['{ENTER}'])\n ->pause(1000)\n ->keys('@cora-search-options-provenance1',['{tab}'])\n ->press('@search-btn')\n ->pause(30000)\n\n // Search Result Assertions for cranium CIL 2003-116:G-04:X-56A:101\n ->waitForLink('CIL 2003-116:G-04:X-56A:101')\n ->assertSeeLink('CIL 2003-116:G-04:X-56A:101')\n ->assertSee('Key')\n ->assertSee('Bone Group')\n ->assertSee('Bone')\n ->assertSee('Side')\n ->assertSee('Sample Number')\n\n // DNA Assertions\n ->clickLink('CIL 2003-116:G-04:X-56A:101')\n ->pause(1000)\n ->driver->switchTo()->window(collect($browser->driver->getWindowHandles())->last());\n\n $browser\n ->pause(1000)\n ->assertSee('View Specimen - CIL 2003-116:G-04:X-56A:101')\n ->assertVue('form.accession_number','CIL 2003-116', '@specimen')\n ->assertVue('form.provenance1','G-04', '@specimen')\n ->assertVue('form.provenance2','X-56A', '@specimen')\n ->assertInputValue('@designator', '101')\n ->assertVue('form.sb_id','18','@specimen')\n ->assertVue('form.side', 'Middle', '@specimen')\n ->assertVue('form.completeness', 'Complete', '@specimen')\n ->assertVue('form.measured', null, '@specimen')\n ->assertVue('form.dna_sampled', true , '@specimen' )\n ->assertVue('form.isotope_sampled', null, '@specimen')\n ->assertVue('form.inventoried', true, '@specimen')\n ->assertVue('form.inventoried_at', null, '@specimen')\n ->assertVue('form.ct_scanned', null, '@specimen')\n ->assertVue('form.xray_scanned', null, '@specimen')\n ->assertVue('form.individual_number', null, '@specimen')\n ->assertVue('form.tags', null, '@specimen')\n\n ->logoutUser();\n });\n }",
"public function SearchPagesManager()\n {\n // Test user login\n $user = $this->testAccounts[\"org-manager\"];\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new loginPage)\n ->loginUser($user['email'], $user['password'])\n ->pause(3000)\n ->assertSee('Welcome');\n\n // Skeletal elements search set up\n $browser->visit(new specimenPage)\n ->pause(1000)\n ->clear('@cora-search-options')\n ->type('@cora-search-options','Accession')\n ->pause(1000)\n ->keys('@cora-search-options', ['{ARROW_DOWN}'])\n ->keys('@cora-search-options', ['{ENTER}'])\n ->keys('@cora-search-options-accessions','CIL 2018-337',['{ENTER}'])\n ->pause(1000)\n ->keys('@cora-search-options-accessions',['{tab}'])\n ->press('@search-btn')\n ->pause(35000)\n\n // Search Result Assertions\n ->assertSee('Specimen search by Accession Number: CIL 2018-337')\n ->waitForLink('CIL 2018-337::X-100:201')\n ->assertSeeLink('CIL 2018-337::X-100:201')\n ->assertSee('Key')\n ->assertSee('Bone Group')\n ->assertSee('Bone')\n ->assertSee('Side')\n ->assertSee('DNA Sample Number')\n ->assertSee('1-100 of ')\n\n // Search Pagination Assertions\n ->click('@se-next')\n ->pause(5000)\n ->waitForText('101-118 of 118')\n ->click('@se-firstpage')\n ->pause(5000)\n ->waitForText('1-100 of 118')\n ->click('@se-lastpage')\n ->pause(5000)\n ->waitForText('101-118 of 118')\n\n ->logoutUser();\n });\n }",
"public function SearchCriteriaManager()\n {\n $user = $this->testAccounts[\"org-manager\"];\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new loginPage)\n ->loginUser($user['email'], $user['password'])\n ->pause(3000)\n ->assertSee('Welcome');\n\n $browser->visit(new specimenPage)\n ->pause(5000)\n// checking invalid input results\n ->press('@cora-search-options')\n ->input('@cora-search-options', '123')\n ->assertSee('No data available')\n ->clear('@cora-search-options')\n ->press('@cora-search-options')\n ->pause(1000)\n //Check Search By Options\n ->assertSee('Bone')\n ->assertSee('Composite Key')\n ->assertSee('Accession')\n ->assertSee('Provenance 1')\n ->assertSee('Provenance 2')\n ->assertSee('Designator')\n ->assertSee('Individual Number')\n ->assertSee('Tags')\n ->logoutUser();\n });\n }",
"public function SearchIndividualNumberManager()\n {\n // Test user login\n $user = $this->testAccounts[\"org-manager\"];\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new loginPage)\n ->loginUser($user['email'], $user['password'])\n ->pause(3000)\n ->assertSee('Welcome');\n\n // Skeletal elements search set up\n $browser->visit(new specimenPage)\n ->pause(5000)\n ->clear('@cora-search-options')\n ->type('@cora-search-options','Individual Number')\n ->pause(1000)\n ->keys('@cora-search-options', ['{ARROW_DOWN}'])\n ->keys('@cora-search-options', ['{ENTER}'])\n ->keys('@cora-search-options-individual-number','CIL 2003-116-I-136',['{ENTER}'])\n ->pause(1000)\n ->keys('@cora-search-options-individual-number',['{tab}'])\n ->press('@search-btn')\n ->pause(50000)\n // Search Result Assertions\n ->assertSee('Specimen search by Individual Number: CIL 2003-116-I-136')\n ->waitForLink('CIL 2003-116:G-01:X-234A:202')\n ->assertSeeLink('CIL 2003-116:G-01:X-234A:202')\n ->assertSee('Key')\n ->assertSee('Bone Group')\n ->assertSee('Bone')\n ->assertSee('Side')\n ->assertSee('DNA Sample Number')\n\n // Specimen Assertions\n ->clickLink('CIL 2003-116:G-01:X-234A:202')\n ->pause(1000)\n ->driver->switchTo()->window(collect($browser->driver->getWindowHandles())->last());\n\n $browser\n ->pause(1000)\n ->assertSee('CIL 2003-116:G-01:X-234A:202')\n ->assertVue('form.accession_number','CIL 2003-116', '@specimen')\n ->assertVue('form.provenance1','G-01', '@specimen')\n ->assertVue('form.provenance2','X-234A', '@specimen')\n ->assertInputValue('@designator', '202')\n ->assertVue('form.sb_id','37','@specimen')\n ->assertVue('form.side', 'Right', '@specimen')\n ->assertVue('form.completeness', 'Complete', '@specimen')\n ->assertVue('form.measured', true, '@specimen')\n ->assertVue('form.dna_sampled', true , '@specimen' )\n ->assertVue('form.isotope_sampled', null, '@specimen')\n ->assertVue('form.inventoried', true, '@specimen')\n ->assertVue('form.inventoried_at', null, '@specimen')\n ->assertVue('form.ct_scanned', true, '@specimen')\n ->assertVue('form.xray_scanned', null, '@specimen')\n ->assertVue('form.individual_number', 'CIL 2003-116-I-136', '@specimen')\n ->assertVue('form.tags', null, '@specimen')\n\n ->logoutUser();\n\n });\n }",
"public function testSearch()\n {\n // ensure there is at least one person in the database\n $this->person();\n\n $this->doSearch()\n ->assertSearchResponse();\n }",
"public function SearchDesignator()\n {\n // Test user login\n $user = $this->testAccounts[\"anthro-analyst\"];\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new loginPage)\n ->loginUser($user['email'], $user['password'])\n ->pause(3000)\n ->assertSee('Welcome');\n\n // Skeletal elements search set up\n $browser->visit(new specimenPage)\n ->pause(5000)\n ->clear('@cora-search-options')\n ->type('@cora-search-options','Designator')\n ->pause(1000)\n ->keys('@cora-search-options', ['{ARROW_DOWN}'])\n ->keys('@cora-search-options', ['{ENTER}'])\n ->type('@cora-search','101')\n ->keys('@cora-search','{enter}')\n ->pause(50000)\n\n // Search Result Assertions\n ->waitForLink('CIL 2003-116:G-25:X-247C:101')\n ->assertSeeLink('CIL 2003-116:G-25:X-247C:101')\n ->assertSee('Key')\n ->assertSee('Bone Group')\n ->assertSee('Bone')\n ->assertSee('Side')\n ->assertSee('DNA Sample Number')\n\n // Specimen Assertions\n ->clickLink('CIL 2003-116:G-25:X-247C:101')\n ->pause(1000)\n ->driver->switchTo()->window(collect($browser->driver->getWindowHandles())->last());\n\n $browser\n ->pause(1000)\n ->assertSee('CIL 2003-116:G-25:X-247C:101')\n ->assertVue('form.accession_number','CIL 2003-116', '@specimen')\n ->assertVue('form.provenance1','G-25', '@specimen')\n ->assertVue('form.provenance2','X-247C', '@specimen')\n ->assertInputValue('@designator', '101')\n ->assertVue('form.sb_id','18','@specimen')\n ->assertVue('form.side', 'Middle', '@specimen')\n ->assertVue('form.completeness', 'Incomplete', '@specimen')\n ->assertVue('form.measured', null, '@specimen')\n ->assertVue('form.dna_sampled', true , '@specimen' )\n ->assertVue('form.isotope_sampled', null, '@specimen')\n ->assertVue('form.inventoried', true, '@specimen')\n ->assertVue('form.inventoried_at', null, '@specimen')\n ->assertVue('form.ct_scanned', null, '@specimen')\n ->assertVue('form.xray_scanned', null, '@specimen')\n ->assertVue('form.individual_number', 'CIL 2003-116-I-86', '@specimen')\n ->assertVue('form.tags', null, '@specimen')\n\n ->logoutUser();\n\n });\n }",
"public function testSearchOneResult()\n {\n\n \n $this->browse(function (Browser $browser) {\n //When I visit the home page\n $browser->visit('/') \n //When I search for Jane\n ->keys('#search', 'jane', '{enter}')\n // Then I only see Pride and prejudice\n ->assertSee('Pride and Prejudice')\n ->assertSee('Jane Austen')\n ->assertDontSee('Alice\\'s Adventures in wonderland')\n ->assertDontSee('Adventures of Tom Sawyer')\n ->assertDontSee('Lewis Carroll')\n ->assertDontSee('Mark Twain');\n });\n }",
"public function reviewArticulationsManager()\n {\n // Test user login\n $user = $this->testAccounts[\"org-manager\"];\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new loginPage)\n ->loginUser($user['email'], $user['password'])\n ->pause(3000)\n ->assertSee('Welcome');\n\n\n // Skeletal elements search set up\n $browser->visit(new specimenPage)\n ->pause(1000)\n ->maximize()\n\n //Search for bone Humerus\n ->click ('@cora-search-options-bones')\n ->type('@cora-search-options-bones','Humerus')\n ->pause(1000)\n ->keys('@cora-search-options-bones', ['{ENTER}'])\n ->keys('@search-btn','{enter}')\n ->pause(2000)\n\n //Click the skeletal element\n ->visit('/skeletalelements/51670')\n ->pause(2000)\n //click action button\n ->click ('@actions-button')\n ->pause(2000)\n //Review page\n ->visit('/skeletalelements/51670/review')\n ->pause(2000)\n ->click('@associations-step')\n ->pause(1000)\n\n //Articulations\n ->assertSee('Articulations')\n ->click('@articulations-panel')\n ->pause(1000)\n ->click('@articulations-menu')\n ->pause(1000)\n ->assertSee('You can apply multiple articulations to this specimen')\n ->pause(1000)\n //save button\n ->click('@association-review-save')\n ->pause(1000)\n //accept button\n ->click('@association-review-accept')\n ->pause(1000)\n\n ->logoutUser();\n });\n }",
"public function testSearchKeo()\n {\n }",
"public function SearchCompositeKeyDNAManager()\n {\n // seComparison user login\n $user = $this->testAccounts[\"org-manager\"];\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new loginPage)\n ->loginUser($user['email'], $user['password'])\n ->waitForText('Welcome')\n ->assertSee('Welcome');\n\n // DNA search set up\n $browser->visit(new specimenPage)\n ->pause(5000)\n ->clear('@cora-search-options')\n ->type('@cora-search-options','Composite Key')\n ->pause(1000)\n ->keys('@cora-search-options', ['{ARROW_DOWN}'])\n ->keys('@cora-search-options', ['{ARROW_DOWN}'])\n ->keys('@cora-search-options', ['{ENTER}'])\n ->type('@cora-search','CIL 2003-116:G-25:X-247A:202')\n ->keys('@cora-search','{enter}')\n ->pause(30000)\n//\n// // Search Result Assertions for humerus ABC999-888-777-555\n ->waitForLink('CIL 2003-116:G-25:X-247A:202')\n ->assertSeeLink('CIL 2003-116:G-25:X-247A:202')\n ->assertSee('Humerus')\n ->assertSee('Right')\n ->assertSee('Bone')\n ->assertSee('Side')\n ->assertSee('Sample Number')\n//\n// // Specimen Assertions\n ->clickLink('CIL 2003-116:G-25:X-247A:202')\n ->pause(1000)\n ->driver->switchTo()->window(collect($browser->driver->getWindowHandles())->last());\n//\n $browser\n ->pause(1000)\n ->assertSee('View Specimen - CIL 2003-116:G-25:X-247A:202')\n ->assertVue('form.accession_number','CIL 2003-116', '@specimen')\n ->assertVue('form.provenance1','G-25', '@specimen')\n ->assertVue('form.provenance2','X-247A', '@specimen')\n ->assertInputValue('@designator', '202')\n ->assertVue('form.sb_id','37','@specimen')\n ->assertVue('form.side', 'Right', '@specimen')\n ->assertVue('form.completeness', 'Incomplete', '@specimen')\n ->assertVue('form.measured', null, '@specimen')\n ->assertVue('form.dna_sampled', null , '@specimen' )\n ->assertVue('form.isotope_sampled', null, '@specimen')\n ->assertVue('form.inventoried', true, '@specimen')\n ->assertVue('form.inventoried_at', null, '@specimen')\n ->assertVue('form.ct_scanned', null, '@specimen')\n ->assertVue('form.xray_scanned', null, '@specimen')\n ->assertVue('form.individual_number', null, '@specimen')\n ->assertVue('form.tags', null, '@specimen')\n\n ->logoutUser();\n });\n }",
"public function auStrDNASearchManager()\n {\n $user = $this->testAccounts[\"org-manager\"];\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new loginPage)\n ->loginUser($user['email'], $user['password'])\n ->waitForText('Welcome')\n ->assertSee('Welcome');\n\n // Navigate to the mt DNA Search Menu\n $browser->visit(new specimenPage)\n ->pause(50000)\n ->press('@leftsidebar-expand')\n ->assertSee('DNA')\n ->clickLink('DNA')\n ->pause(1000)\n ->assertSee('auStr DNA Report')\n\n // Verify the mt DNA search takes the user to the page to create a mt DNA report\n ->pause(60000)\n ->assertSee('AuSTR DNA Report')\n ->assertPathIs('/reports/austrdna')\n ->assertSee('AuSTR Sequence Number')\n ->assertSee('AuSTR Sequence Subgroup')\n\n ->logoutUser();\n });\n }",
"public function testSearchKepw()\n {\n }",
"public function SearchPages()\n {\n // Test user login\n $user = $this->testAccounts[\"anthro-analyst\"];\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new loginPage)\n ->loginUser($user['email'], $user['password'])\n ->pause(3000)\n ->assertSee('Welcome');\n\n // Skeletal elements search set up\n $browser->visit(new specimenPage)\n ->pause(1000)\n ->clear('@cora-search-options')\n ->type('@cora-search-options','Accession')\n ->pause(1000)\n ->keys('@cora-search-options', ['{ARROW_DOWN}'])\n ->keys('@cora-search-options', ['{ENTER}'])\n ->keys('@cora-search-options-accessions','CIL 2018-337',['{ENTER}'])\n ->pause(1000)\n ->keys('@cora-search-options-accessions',['{tab}'])\n ->press('@search-btn')\n ->pause(35000)\n\n // Search Result Assertions\n ->assertSee('Specimen search by Accession Number: CIL 2018-337')\n ->waitForLink('CIL 2018-337::X-100:201')\n ->assertSeeLink('CIL 2018-337::X-100:201')\n ->assertSee('Key')\n ->assertSee('Bone Group')\n ->assertSee('Bone')\n ->assertSee('Side')\n ->assertSee('DNA Sample Number')\n ->assertSee('1-100 of ')\n\n // Search Pagination Assertions\n ->click('@se-next')\n ->pause(5000)\n ->waitForText('101-118 of 118')\n ->click('@se-firstpage')\n ->pause(5000)\n ->waitForText('1-100 of 118')\n ->click('@se-lastpage')\n ->pause(5000)\n ->waitForText('101-118 of 118')\n\n ->logoutUser();\n });\n }",
"public function testSearcher()\n {\n $users = ['kfr', 'frog'];\n $mplatforms = [new Github([])];\n $users = \\Yii::$app->searcher->search($mplatforms, $users);\n\n foreach ($users as $user){\n $this->assertTrue($user instanceof User);\n }\n }",
"public function testSearchMultipleResults()\n {\n\n \n $this->browse(function (Browser $browser) {\n //When I visit the home page\n $browser->visit('/') \n //When I search for adventures\n ->keys('#search', 'Adventures', '{enter}')\n // I should see Adventures of Tom Sawyer and Alice\\'s Adventures in wonderland\n ->assertDontSee('Pride and Prejudice')\n ->assertDontSee('Jane Austen')\n ->assertSee('Alice\\'s Adventures in wonderland')\n ->assertSee('Adventures of Tom Sawyer')\n ->assertSee('Lewis Carroll')\n ->assertSee('Mark Twain');\n });\n }",
"protected function searchSuccess1() {\n $prepareSearch = $this->buildSearch('test')\n ->range(1, 2)\n ->sort($this->getFieldId('id'), 'ASC');\n sleep(1);\n $results = $prepareSearch->execute();\n $this->assertEqual($results->getResultCount(), 4, 'Search for »test« returned correct number of results.');\n $this->assertEqual(\n array_keys($results->getResultItems()), $this->getItemIds(\n array(\n 2,\n 3,\n )\n ), 'Search for »test« returned correct result.'\n );\n $this->assertIgnored($results);\n $this->assertWarnings($results);\n\n $ids = $this->getItemIds(array(2));\n $id = reset($ids);\n $this->assertEqual(key($results->getResultItems()), $id);\n $this->assertEqual($results->getResultItems()[$id]->getId(), $id);\n $this->assertEqual($results->getResultItems()[$id]->getDatasourceId(), 'entity:entity_test');\n\n $prepareSearch = $this->buildSearch('test foo')\n ->sort($this->getFieldId('id'), 'ASC');\n sleep(1);\n $results = $prepareSearch->execute();\n $this->assertEqual($results->getResultCount(), 3, 'Search for »test foo« returned correct number of results.');\n $this->assertEqual(\n array_keys(\n $results->getResultItems()\n ),\n $this->getItemIds(\n array(1, 2, 4)\n ),\n 'Search for »test foo« returned correct result.'\n );\n $this->assertIgnored($results);\n $this->assertWarnings($results);\n\n $prepareSearch = $this->buildSearch('foo', array('type,item'))\n ->sort($this->getFieldId('id'), 'ASC');\n sleep(1);\n $results = $prepareSearch->execute();\n $this->assertEqual($results->getResultCount(), 2, 'Search for »foo« returned correct number of results.');\n $this->assertEqual(\n array_keys($results->getResultItems()), $this->getItemIds(\n array(\n 1,\n 2,\n )\n ), 'Search for »foo« returned correct result.'\n );\n $this->assertIgnored($results);\n $this->assertWarnings($results);\n\n $keys = array(\n '#conjunction' => 'AND',\n 'test',\n array(\n '#conjunction' => 'OR',\n 'baz',\n 'foobar',\n ),\n array(\n '#conjunction' => 'OR',\n '#negation' => TRUE,\n 'bar',\n 'fooblob',\n ),\n );\n $prepareSearch = $this->buildSearch($keys);\n sleep(1);\n $results = $prepareSearch->execute();\n $this->assertEqual($results->getResultCount(), 1, 'Complex search 1 returned correct number of results.');\n $this->assertEqual(array_keys($results->getResultItems()), $this->getItemIds(array(4)), 'Complex search 1 returned correct result.');\n $this->assertIgnored($results);\n $this->assertWarnings($results);\n }",
"public function testSearchKeok()\n {\n }",
"public function EditMeasurementsMaxManager()\n {\n // Test user login\n $user = ['email' => 'testmanageruno@unomaha.edu', 'password' => 'Password!23'];\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new loginPage)\n ->loginUser($user['email'], $user['password'])\n ->assertSee('Welcome');\n\n // Skeletal elements search set up\n $browser->visit(new specimenPage)\n ->pause(1000)\n ->select('@search-type-selector','SE-P1')\n ->pause(1000)\n ->type('@cora-search','888')\n ->keys('@cora-search','{enter}')\n\n // Search Result Assertions for humerus ABC999-888-777-555\n ->waitForLink('ABC999-888-777-555')\n ->assertSeeLink('ABC999-888-777-555')\n ->assertSee('Radius')\n ->assertSee('Left')\n ->assertSee('Bone')\n ->assertSee('Side')\n ->assertSee('DNA Sampled')\n\n // Specimen Assertions\n ->clickLink('ABC999-888-777-555')\n ->assertSee('View Specimen - ABC999-888-777-555')\n\n // Click through the menu to be able to edit the specimen\n ->click('@se-details-menu')\n ->click('@se-measurements-menu')\n ->assertSee('View Measurements: ABC999-888-777-555')\n\n ->click('@se-measurement-menu')\n ->click('@se-measurements-edit-button-1')\n ->assertSee('Edit Measurements: ABC999-888-777-555')\n\n // Box 1 Test\n ->type('@se-measurement-0','777')\n ->click('@se-measurement-save')\n ->pause(500)\n ->acceptDialog()\n ->pause(500)\n ->assertSee('Edit Measurements: ABC999-888-777-555')\n ->assertPathIs('/skeletalelements/1220/measurements/edit')\n\n // Box 2 Test\n ->type('@se-measurement-1','151')\n ->click('@se-measurement-save')\n ->pause(500)\n ->acceptDialog()\n ->pause(500)\n ->assertSee('Edit Measurements: ABC999-888-777-555')\n ->assertPathIs('/skeletalelements/1220/measurements/edit')\n\n // Box 3 Test\n ->type('@se-measurement-2','117')\n ->click('@se-measurement-save')\n ->pause(500)\n ->acceptDialog()\n ->pause(500)\n ->assertSee('Edit Measurements: ABC999-888-777-555')\n ->assertPathIs('/skeletalelements/1220/measurements/edit')\n\n // Box 4 Test\n ->type('@se-measurement-3','61')\n ->click('@se-measurement-save')\n ->pause(500)\n ->acceptDialog()\n ->pause(500)\n ->assertSee('Edit Measurements: ABC999-888-777-555')\n ->assertPathIs('/skeletalelements/1220/measurements/edit')\n\n // Box 5 Test\n ->type('@se-measurement-4','49')\n ->click('@se-measurement-save')\n ->pause(500)\n ->acceptDialog()\n ->pause(500)\n ->assertSee('Edit Measurements: ABC999-888-777-555')\n ->assertPathIs('/skeletalelements/1220/measurements/edit')\n\n // Box 6 Test\n ->type('@se-measurement-5','111')\n ->click('@se-measurement-save')\n ->pause(500)\n ->acceptDialog()\n ->pause(500)\n ->assertSee('Edit Measurements: ABC999-888-777-555')\n ->assertPathIs('/skeletalelements/1220/measurements/edit')\n\n // Box 7 Test\n ->type('@se-measurement-6','105')\n ->click('@se-measurement-save')\n ->pause(500)\n ->acceptDialog()\n ->pause(500)\n ->assertSee('Edit Measurements: ABC999-888-777-555')\n ->assertPathIs('/skeletalelements/1220/measurements/edit')\n\n // Box 8 Test\n ->type('@se-measurement-7','49')\n ->click('@se-measurement-save')\n ->pause(500)\n ->acceptDialog()\n ->pause(500)\n ->assertSee('Edit Measurements: ABC999-888-777-555')\n ->assertPathIs('/skeletalelements/1220/measurements/edit')\n\n // Box 9 Test\n ->type('@se-measurement-8','63')\n ->click('@se-measurement-save')\n ->pause(500)\n ->acceptDialog()\n ->pause(500)\n ->assertSee('Edit Measurements: ABC999-888-777-555')\n ->assertPathIs('/skeletalelements/1220/measurements/edit')\n\n ->logoutUser();\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This Function is to decode the url | public function decode($str)
{
return urldecode($str);
} | [
"protected function decode_url()\n\t\t{\n\t\t\t$this->update(urldecode($this->toclean));\n\t\t\t\n\t\t}",
"function url_decode() {\n\t\tif(!defined('SWEBOO_URL_DECODED')){\n\t\t\tarray_walk($_GET, array('Request', 'perform_url_decode'));\n\t\t\tdefine('SWEBOO_URL_DECODED',true);\n\t\t}\n\t}",
"function urldecode($str){}",
"public static function decode(string $url): string;",
"public function getUrlDecode(){\n\t\tif($referrer = $this->request->getParam('referrer')){\n\t\t\t$url = base64_decode(strtr($referrer, '-_,', '+/='));\n\t\t\treturn $this->_urlBuilder->sessionUrlVar($url);\n\t\t}else{\n\t\t\treturn $this->_urlBuilder->getUrl();\n\t\t}\n\t}",
"static function decompress($url){\n $res=base64_decode($url,true);\n if($res) $url=$res;\n return $url;\n }",
"function url_decode($text)\n {\n return base64_decode(str_pad(strtr($text, '-_', '+/'), strlen($text) % 4, '=', STR_PAD_RIGHT));\n }",
"public function decode($url)\n {\n return \\urldecode($url);\n }",
"function Url_decode($content)\n\t{\n\t\treturn utf8_decode( rawurldecode( $content ) );\n\t}",
"public function decodeUrlForLocation($url){\n if( isset($url) ){\n $url = htmlspecialchars_decode($url);\n }\n return $url;\n }",
"private function decode_facebook_url($url){\n\t\t$url = str_replace('u00253A', ':', $url);\n\t\t$url = str_replace('\\u00255C\\u00252F', '/', $url);\n\t\t$url = str_replace('u00252F', '/', $url);\n\t\t$url = str_replace('u00253F', '?', $url);\n\t\t$url = str_replace('u00253D', '=', $url);\n\t\t$url = str_replace('u002526', '&', $url);\n\n\t\treturn $url;\n\t}",
"function base64url_decode($data){ \n return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT)); \n }",
"function _decodeCIURL($toDecrypt) {\n $CI =& get_instance();\n return $CI->encrypt->decode(str_replace(' ', '+', $toDecrypt));\n }",
"function decode_url($string, $key=\"\")\n {\n if($key==null || $key==\"\")\n {\n $key=\"tyz_mydefaulturlencryption\";\n }\n $CI =& get_instance();\n $string = strtr(\n $string,\n array(\n '.' => '+',\n '-' => '=',\n '~' => '/'\n )\n );\n return $CI->encrypt->decode($string, $key);\n }",
"public function decodeURL($url) {\n $base = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $limit = strlen($url);\n $decoded = strpos($base, $url[0]);\n for($i = 1; $i < $limit; $i++) {\n $decoded = 62 * $decoded + strpos($base, $url[$i]);\n }\n\n $short_url = ShortURL::find($decoded);\n\n return redirect('gif/' . $short_url->gif_id);\n }",
"function decode_url() {\r\n\t\t// Get the default query\r\n\t\t$default_query = '';\r\n\t\tforeach ($this->default as $module => $action)\r\n\t\t\t$default_query = \"module=$module&action=$action\";\r\n\r\n\t\t// Get the query string\r\n\t\t$query = $_SERVER['QUERY_STRING'];\r\n\t\tparse_str($query);\r\n\r\n\t\tif (!isset($url)) {\r\n\t\t\t// No hash specified\r\n\t\t\tif (!isset($module) && !isset($action)) {\r\n\t\t\t\t// No module or action, select default action\r\n\t\t\t\t$query = $default_query;\r\n\t\t\t} else {\r\n\t\t\t\t// Some module:action specified, check if an exception\r\n\t\t\t\tif (in_array(\"$module:$action\", $this->exceptions)) {\r\n\t\t\t\t\t// Valid exception, pass through the query\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Invalid exception, select default action\r\n\t\t\t\t\t$query = $default_query;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// URL hash is specified\r\n\t\t\tif (!isset($_SESSION['url_hash']) || !isset($_SESSION['url_hash'][$url]))\r\n\t\t\t\t// No hash table or invalid hash\r\n\t\t\t\t$query = $default_query;\r\n\t\t\telse {\r\n\t\t\t\t// Valid hash\r\n\t\t\t\t$query = $_SESSION['url_hash'][$url];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Return the query\r\n\t\treturn $query;\r\n\t}",
"function decode (){ // methode to unhide\n\t\t\n\t\tif($_REQUEST[$this->var_name]){ \n\t\t\t$this->decode_url=base64_decode($_REQUEST[$this->var_name]); \n\t\t\tparse_str($this->decode_url, $tbl); \n\t\t\t\n\t\t\tforeach($tbl as $k=>$v){\n\t\t\t\t$_REQUEST[$k]=$v;\n\t\t\t\tglobal $$k; \n\t\t\t\t$$k=$v;\n\t\t\t}\n\t\t} \n\t}",
"public static function decodeUrl($uri) {\n $encode_chars = self::charsToEscape();\n $keys = array_keys($encode_chars);\n $replace = array_values($encode_chars);\n $uri = str_replace($replace, $keys, $uri);\n return str_replace('_a', '_', $uri);\n }",
"public function base64urlDecode($data);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
if station was unable to get or confirm update, resent update | function checkupdatestate(){
require('publishupdateflag.php');
require('publishnewsettings.php');
include ('connect.php');
$stmt = $connect->prepare("SELECT stationid FROM stationsettings WHERE updatestate=0");
$stmt->execute();
$ids = $stmt->fetchAll(PDO::FETCH_ASSOC);
foreach ($ids as $id) {
echo 'Resending update to stationid:'.$id['stationid']."!\n";
publishupdateflag($id['stationid']);
publishnewsettings($id['stationid']);
}
} | [
"public function is_update_available();",
"public function syncstatusAction() {\r\n\t\t$model = Mage::getModel('lastmile/lastmile');\r\n\t\t$apiurl = Mage::getStoreConfig('carriers/dlastmile/gateway_url');\r\n\t\t$token = Mage::getStoreConfig('carriers/dlastmile/licensekey');\t\t\r\n\t\tif($apiurl && $token)\r\n\t\t{\r\n\t\t\t$waybills = $model->findAwbToUpdate();\r\n\t\t\tif(count($waybills)){ //No update to perform if count is zero\r\n\t\t\t\t$awbs = '';\r\n\t\t\t\tforeach($waybills as $waybill){\r\n\t\t\t\t\tif(is_array($waybill)){\r\n\t\t\t\t\t $awbs .= $waybill['awb'].','; \r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tmage::log(\"Status Updated for these waybills $awbs\");\r\n\t\t\t\t$path = $apiurl.'api/packages/json/?verbose=0&token='.$token.'&waybill='.$awbs;\t\r\n\t\t\t\t$retValue = Mage::helper('lastmile')->Executecurl($path,'','');\r\n\t\t\t\t$statusupdates = json_decode($retValue);\r\n\t\t\t\tforeach ($statusupdates->ShipmentData as $item) {\t\t\t \t\t \r\n\t\t\t\t $lmawb = Mage::getModel('lastmile/lastmile')->loadByAwb($item->Shipment->AWB);\r\n\t\t\t\t $model = Mage::getModel('lastmile/lastmile');\r\n\t\t\t\t $data = array();\r\n\t\t\t\t $data['awb'] = $item->Shipment->AWB;\r\n\t\t\t\t $data['status'] = preg_replace('/\\s+/', '', $item->Shipment->Status->Status);\t\t \r\n\t\t\t\t $model->setData($data)->setId($lmawb)->save();\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tMage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('lastmile')->__(count($waybills).' Waybill(s) Updated Successfully'));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tMage::getSingleton('adminhtml/session')->addError(Mage::helper('lastmile')->__('Please add valid License Key and Gateway URL in plugin configuration'));\r\n\t\t}\t\t\r\n\t\t$this->_redirect('*/*/');\r\n }",
"public function updateNecessary() : bool {}",
"public static function check_for_updates()\n {\n }",
"function check_update_version()\n\t{\n\t\tlog_write(\"debug\", \"api_phpfreeradius\", \"Executing check_update_version()\");\n\n\n\t\tif ($this->auth_online)\n\t\t{\n\t\t\t$obj_server\t\t= New radius_server;\n\t\t\t$obj_server->id\t\t= $this->auth_server;\n\n\t\t\t$obj_server->load_data();\n\n\t\t\tif ($obj_server->data[\"sync_status_config\"])\n\t\t\t{\n\t\t\t\tlog_write(\"debug\", \"api_phpfreeradius\", \"Configuration is OUT OF SYNC!\");\n\n\t\t\t\treturn sql_get_singlevalue(\"SELECT value FROM config WHERE name='SYNC_STATUS_CONFIG' LIMIT 1\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlog_write(\"debug\", \"api_phpfreeradius\", \"Configuration is all up-to-date\");\n\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new SoapFault(\"Sender\", \"ACCESS_DENIED\");\n\t\t}\n\n\t}",
"function do_undismiss_core_update() {}",
"public function checkForUpdates()\n {\n $model = Mage::getModel('shopgate/feed');\n $model->checkUpdate();\n }",
"public static function checkUpdateASAP()\n {\n $now = time();\n $config = Patching::getPatchingConfig();\n $config['last_checked'] = $now - $config['check_interval'];\n SystemConfig::setConfig('Patching', $config);\n return 'updated';\n\n }",
"public function test_if_failed_update()\n {\n }",
"function qruqsp_core_stationSettingsUpdate(&$q) {\n //\n // Find all the required and optional arguments\n //\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'prepareArgs');\n $rc = qruqsp_core_prepareArgs($q, 'no', array(\n 'station_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Station'), \n 'station-name'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Station Name'), \n 'station-category'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Category'), \n 'station-permalink'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Permalink'), \n 'station-tagline'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Tagline'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n //\n // Check access to station_id as owner\n //\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'checkAccess');\n $rc = qruqsp_core_checkAccess($q, $args['station_id'], 'qruqsp.core.stationSettingsUpdate');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Check the permalink is proper format\n //\n if( isset($args['station-permalink']) && preg_match('/[^a-z0-9\\-_]/', $args['station-permalink']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'qruqsp.core.143', 'msg'=>'Illegal characters in permalink. It can only contain lowercase letters, numbers, underscores (_) or dash (-)'));\n }\n\n //\n // Turn off autocommit\n //\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbTransactionStart');\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbTransactionRollback');\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbTransactionCommit');\n $rc = qruqsp_core_dbTransactionStart($q, 'qruqsp.core');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Check if name or tagline was specified\n //\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbQuote');\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbUpdate');\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbInsert');\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbAddModuleHistory');\n $strsql = \"\";\n if( isset($args['station-name']) && $args['station-name'] != '' ) {\n $strsql .= \", name = '\" . qruqsp_core_dbQuote($q, $args['station-name']) . \"'\";\n qruqsp_core_dbAddModuleHistory($q, 'qruqsp.core', 'qruqsp_core_history', $args['station_id'], \n 2, 'qruqsp_core_stations', '', 'name', $args['station-name']);\n }\n if( isset($args['station-permalink']) ) {\n $strsql .= \", permalink = '\" . qruqsp_core_dbQuote($q, $args['station-permalink']) . \"'\";\n qruqsp_core_dbAddModuleHistory($q, 'qruqsp.core', 'qruqsp_core_history', $args['station_id'], \n 2, 'qruqsp_core_stations', '', 'permalink', $args['station-permalink']);\n }\n if( isset($args['station-category']) ) {\n $strsql .= \", category = '\" . qruqsp_core_dbQuote($q, $args['station-category']) . \"'\";\n qruqsp_core_dbAddModuleHistory($q, 'qruqsp.core', 'qruqsp_core_history', $args['station_id'], \n 2, 'qruqsp_core_stations', '', 'category', $args['station-category']);\n }\n if( isset($args['station-tagline']) ) {\n $strsql .= \", tagline = '\" . qruqsp_core_dbQuote($q, $args['station-tagline']) . \"'\";\n qruqsp_core_dbAddModuleHistory($q, 'qruqsp.core', 'qruqsp_core_history', $args['station_id'], \n 2, 'qruqsp_core_stations', '', 'tagline', $args['station-tagline']);\n }\n //\n // Always update last_updated for sync purposes\n //\n $strsql = \"UPDATE qruqsp_core_stations SET last_updated = UTC_TIMESTAMP()\" . $strsql \n . \" WHERE id = '\" . qruqsp_core_dbQuote($q, $args['station_id']) . \"' \";\n $rc = qruqsp_core_dbUpdate($q, $strsql, 'qruqsp.core');\n if( $rc['stat'] != 'ok' ) {\n qruqsp_core_dbTransactionRollback($q, 'qruqsp.core');\n return $rc;\n }\n\n //\n // Allowed station detail keys \n //\n $allowed_keys = array(\n 'contact-address-street1',\n 'contact-address-street2',\n 'contact-address-city',\n 'contact-address-province',\n 'contact-address-postal',\n 'contact-address-country',\n 'contact-person-name',\n 'contact-phone-number',\n 'contact-cell-number',\n 'contact-fax-number',\n 'contact-email-address',\n 'qruqsp-manage-css',\n 'social-facebook-url',\n 'social-twitter-station-name',\n 'social-twitter-username',\n 'social-flickr-url',\n 'social-etsy-url',\n 'social-pinterest-username',\n 'social-tumblr-username',\n 'social-youtube-url',\n 'social-vimeo-url',\n 'social-instagram-username',\n 'social-linkedin-url',\n );\n foreach($q['request']['args'] as $arg_name => $arg_value) {\n if( in_array($arg_name, $allowed_keys) ) {\n $strsql = \"INSERT INTO qruqsp_core_station_settings (station_id, detail_key, detail_value, date_added, last_updated) \"\n . \"VALUES ('\" . qruqsp_core_dbQuote($q, $args['station_id']) . \"'\"\n . \", '\" . qruqsp_core_dbQuote($q, $arg_name) . \"'\"\n . \", '\" . qruqsp_core_dbQuote($q, $arg_value) . \"'\"\n . \", UTC_TIMESTAMP(), UTC_TIMESTAMP()) \"\n . \"ON DUPLICATE KEY UPDATE detail_value = '\" . qruqsp_core_dbQuote($q, $arg_value) . \"' \"\n . \", last_updated = UTC_TIMESTAMP() \"\n . \"\";\n $rc = qruqsp_core_dbInsert($q, $strsql, 'qruqsp.core');\n if( $rc['stat'] != 'ok' ) {\n qruqsp_core_dbTransactionRollback($q, 'qruqsp.core');\n return $rc;\n }\n qruqsp_core_dbAddModuleHistory($q, 'qruqsp.core', 'qruqsp_core_history', $args['station_id'], \n 2, 'qruqsp_core_station_settings', $arg_name, 'detail_value', $arg_value);\n// $q['syncqueue'][] = array('push'=>'qruqsp.core.stationsettings', \n// 'args'=>array('id'=>$arg_name));\n }\n }\n\n $rc = qruqsp_core_dbTransactionCommit($q, 'qruqsp.core');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n return array('stat'=>'ok');\n}",
"public function syncstatusAction() {\r\n\t\t$model = Mage::getModel('lastmile/lastmile');\r\n\t\t//$apiurl = Mage::getStoreConfig('carriers/dlastmile/gateway_url');\r\n\t\t$apiurl = Mage::helper('lastmile')->getApiUrl('syncAWB');\r\n\t\t$token = Mage::getStoreConfig('carriers/dlastmile/licensekey');\t\t\r\n\t\tif($apiurl && $token)\r\n\t\t{\r\n\t\t\t$waybills = $model->findAwbToUpdate();\r\n\t\t\tif(count($waybills)){ //No update to perform if count is zero\r\n\t\t\t\t$awbs = '';\r\n\t\t\t\tforeach($waybills as $waybill){\r\n\t\t\t\t\tif(is_array($waybill)){\r\n\t\t\t\t\t $awbs .= $waybill['awb'].',';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$path = $apiurl.'json/?verbose=0&token='.$token.'&waybill='.$awbs;\t\r\n\t\t\t\t$retValue = Mage::helper('lastmile')->Executecurl($path,'','');\r\n\t\t\t\t$statusupdates = json_decode($retValue);\r\n\t\t\t\t\r\n\t\t\t\tforeach ($statusupdates->ShipmentData as $item) {\t\t\t \t\t \r\n\t\t\t\t $lmawb = Mage::getModel('lastmile/lastmile')->loadByAwb($item->Shipment->AWB);\r\n\t\t\t\t $model = Mage::getModel('lastmile/lastmile');\r\n\t\t\t\t $data = array();\r\n\t\t\t\t $data['awb'] = $item->Shipment->AWB;\r\n\t\t\t\t $data['status'] = preg_replace('/\\s+/', '', $item->Shipment->Status->Status);\r\n\t\t\t\t $data['status_type'] = $item->Shipment->Status->StatusType;\r\n\t\t\t\t $model->setData($data)->setId($lmawb)->save();\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tMage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('lastmile')->__(count($waybills).' Waybill(s) Updated Successfully'));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tMage::getSingleton('adminhtml/session')->addError(Mage::helper('lastmile')->__('Please add valid License Key and Gateway URL in plugin configuration'));\r\n\t\t}\t\t\r\n\t\t$this->_redirect('*/*/');\r\n }",
"function reset_table_station() {\n\tglobal $db;\n\t$result\t= $db->fetchAll(\"update station set status = 'ready'\");\n\t$result\t= $db->fetchAll(\"update station set request = 'done'\");\n}",
"public function testUpdateSingleSuccess();",
"public function checkUpdate()\n {\n $response = null;\n $this_version = $this->get('esm:version');\n $update_url = $this->get('esm:website').'/esm-web/update/'.$this_version;\n\n if (!function_exists('curl_version'))\n {\n $tmp = @file_get_contents($update_url);\n $response = json_decode($tmp, true);\n }\n else\n {\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_CONNECTTIMEOUT => 10,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_SSL_VERIFYPEER => false,\n CURLOPT_TIMEOUT => 60,\n CURLOPT_USERAGENT => 'eZ Server Monitor `Web',\n CURLOPT_URL => $update_url,\n ));\n\n $response = json_decode(curl_exec($curl), true);\n\n curl_close($curl);\n }\n\n if (!is_null($response) && !empty($response))\n {\n if (is_null($response['error']))\n {\n return $response['datas'];\n }\n }\n }",
"function checkForUpdates() {\r\n $state = get_option($this->optionName);\r\n if ( empty($state) ){\r\n $state = new StdClass;\r\n $state->lastCheck = 0;\r\n $state->checkedVersion = '';\r\n $state->update = null;\r\n }\r\n\r\n $state->lastCheck = time();\r\n $state->checkedVersion = $this->getInstalledVersion();\r\n update_option($this->optionName, $state); // Save before checking in case something goes wrong\r\n\r\n $state->update = $this->requestUpdate();\r\n update_option($this->optionName, $state);\r\n }",
"public function testUpdateUnsuccessfulReason()\n {\n }",
"function check_update_version()\n\t{\n\t\tlog_write(\"debug\", \"api_namedmanager\", \"Executing check_update_version()\");\n\n\n\t\tif ($this->auth_online)\n\t\t{\n\t\t\t$obj_server\t\t= New name_server;\n\t\t\t$obj_server->id\t\t= $this->auth_server;\n\n\t\t\t$obj_server->load_data();\n\n\t\t\tif (isset($obj_server->data[\"sync_status_config\"]))\n\t\t\t{\n\t\t\t\tlog_write(\"debug\", \"api_namedmanager\", \"Configuration is OUT OF SYNC!\");\n\n\t\t\t\treturn sql_get_singlevalue(\"SELECT value FROM config WHERE name='SYNC_STATUS_CONFIG' LIMIT 1\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlog_write(\"debug\", \"api_namedmanager\", \"Configuration is all up-to-date\");\n\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new SoapFault(\"Sender\", \"ACCESS_DENIED\");\n\t\t}\n\n\t}",
"function AJsubmitComputerStateLater() {\n\t\t$compid = getContinuationVar('compid');\n\t\t$maintenanceonly = getContinuationVar('maintenanceonly', 0);\n\t\t$start = getContinuationVar('reloadstart');\n\t\t$end = $start + SECINYEAR;\n\t\t$startdt = unixToDatetime($start);\n\t\t$enddt = unixToDatetime($end);\n\t\t$vmprofileid = getContinuationVar('vmprofileid', 0);\n\t\t$oldprofileid = getContinuationVar('oldprofileid', 0);\n\t\t$newstateid = getContinuationVar('newstateid', 0);\n\t\t$oldstateid = getContinuationVar('oldstateid', 0);\n\t\t$imageid = getContinuationVar('imageid');\n\t\t$revid = getProductionRevisionid($imageid);\n\t\t$mode = processInputVar('mode', ARG_STRING);\n\t\t$msg = '';\n\t\t$refreshcount = 0;\n\n\t\tif($oldstateid == 10 && $newstateid == 20 &&\n\t\t ! is_null($mode) && $mode != 'direct' && $mode != 'reload') {\n\t\t\t$errmsg = \"Invalid information submitted\";\n\t\t\t$ret = array('status' => 'error',\n\t\t\t 'errormsg' => $errmsg);\n\t\t\tsendJSON($ret);\n\t\t\treturn;\n\t\t}\n\n\t\t$delayed = 0;\n\n\t\t# maintenance directly back to vmhostinuse\n\t\tif($mode == 'direct') {\n\t\t\t$vmids = getContinuationVar('vmids');\n\t\t\tif(count($vmids)) {\n\t\t\t\t$allids = implode(',', $vmids);\n\t\t\t\t$query = \"UPDATE computer \"\n\t\t\t\t . \"SET stateid = 2, \"\n\t\t\t\t . \"notes = '' \"\n\t\t\t\t . \"WHERE id in ($allids)\";\n\t\t\t\tdoQuery($query);\n\t\t\t}\n\t\t\t$query = \"UPDATE computer \"\n\t\t\t . \"SET stateid = 20, \"\n\t\t\t . \"notes = '' \"\n\t\t\t . \"WHERE id = $compid\";\n\t\t\tdoQuery($query);\n\t\t\t$msg .= \"The computer has been moved back to the vmhostinuse state and \";\n\t\t\t$msg .= \"the appropriate VMs have been moved to the available state.\";\n\t\t\t$title = \"Change to vmhostinuse\";\n\t\t\t$refreshcount = 1;\n\t\t}\n\t\t# maintenance back to vmhostinuse with a reload\n\t\telseif($mode == 'reload') {\n\t\t\t$vmids = getContinuationVar('vmids');\n\t\t\tif(count($vmids))\n\t\t\t\t$this->scheduleVMsToAvailable($vmids);\n\t\t\t$start = getReloadStartTime();\n\t\t\t$rc = $this->scheduleTovmhostinuse($compid, $imageid, $start,\n\t\t\t $vmprofileid, $oldprofileid);\n\n\t\t\tif($rc == 0) {\n\t\t\t\t$errmsg .= \"A problem was encountered while attempting to reload the \";\n\t\t\t\t$errmsg .= \"computer with the selected VM Host Profile. Please try \";\n\t\t\t\t$errmsg .= \"again at a later time.\\n\";\n\t\t\t\t$errmsg = preg_replace(\"/(.{1,76}([ \\n]|$))/\", '\\1<br>', $errmsg);\n\t\t\t\t$ret = array('status' => 'error',\n\t\t\t\t 'errormsg' => $errmsg);\n\t\t\t\tsendJSON($ret);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$msg .= \"The computer has been scheduled to go back to the vmhostinuse \";\n\t\t\t$msg .= \"state and the appropriate VMs have been scheduled to go back \";\n\t\t\t$msg .= \"to the available state at %s.\";\n\t\t\t$title = \"Change to vmhostinuse\";\n\t\t}\n\t\t# anything else to vmhostinuse\n\t\telseif($oldstateid != 20 && $newstateid == 20) {\n\t\t\tmoveReservationsOffComputer($compid);\n\t\t\tcleanSemaphore();\n\t\n\t\t\t$mnid = findManagementNode($compid, unixToDatetime($start), 'future');\n\t\t\t$tmp = getCompFinalReservationTime($compid, 21);\n\t\t\t$checkstart = getExistingChangeStateStartTime($compid, 21);\n\t\t\tif(! $checkstart && $checkstart != $start && $tmp > $start) {\n\t\t\t\t$delayed = 1;\n\t\t\t\t$start = $tmp;\n\t\t\t\t$end = $start + SECINYEAR;\n\t\t\t\t$startdt = unixToDatetime($start);\n\t\t\t\t$enddt = unixToDatetime($end);\n\t\t\t}\n\t\t\t$vclreloadid = getUserlistID('vclreload@Local');\n\t\t\tif($maintenanceonly) {\n\t\t\t\tif(! retryGetSemaphore($imageid, $revid, $mnid, $compid, $start, $end)) {\n\t\t\t\t\t$errmsg = \"An error was encountered while trying to schedule this<br>\\n\";\n\t\t\t\t\t$errmsg .= \"computer for the maintenance state. Please try again later.\\n\";\n\t\t\t\t\t$ret = array('status' => 'error',\n\t\t\t\t\t 'errormsg' => $errmsg);\n\t\t\t\t\tsendJSON($ret);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t# create a tomaintenance reservation\n\t\t\t\tif(! (simpleAddRequest($compid, $imageid, $revid, $startdt, $enddt,\n\t\t\t\t 18, $vclreloadid))) {\n\t\t\t\t\t$errmsg = \"An error was encountered while trying to schedule this<br>\\n\";\n\t\t\t\t\t$errmsg .= \"computer for the maintenance state. Please try again later.\\n\";\n\t\t\t\t\t$ret = array('status' => 'error',\n\t\t\t\t\t 'errormsg' => $errmsg);\n\t\t\t\t\tsendJSON($ret);\n\t\t\t\t\tcleanSemaphore();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t$msg .= \"The computer has been scheduled to be moved to the \";\n\t\t\t\t$msg .= \"maintenance state at %s.\";\n\t\t\t\t$title = \"Change to maintenance state\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t# create a reload reservation to load machine with image\n\t\t\t\t# corresponding to selected vm profile\n\t\t\t\t$rc = $this->scheduleTovmhostinuse($compid, $imageid, $start,\n\t\t\t\t $vmprofileid, $oldprofileid);\n\t\t\t\tif(isset($this->startchange)) {\n\t\t\t\t\t$start = $this->startchange;\n\t\t\t\t\t$delayed = 1;\n\t\t\t\t}\n\t\t\t\tif($rc == 0) {\n\t\t\t\t\t$errmsg = \"An error was encountered while trying to convert this \";\n\t\t\t\t\t$errmsg .= \"computer to a VM host server. Please try again later.\";\n\t\t\t\t\t$errmsg = preg_replace(\"/(.{1,76}([ \\n]|$))/\", '\\1<br>', $errmsg);\n\t\t\t\t\t$ret = array('status' => 'error',\n\t\t\t\t\t 'errormsg' => $errmsg);\n\t\t\t\t\tsendJSON($ret);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t$msg .= \"The computer has been scheduled to be moved to the \";\n\t\t\t\t$msg .= \"vmhostinuse state at %s.\";\n\t\t\t\t$title = \"Change to vmhostinuse state\";\n\t\t\t}\n\t\t\tcleanSemaphore();\n\t\t}\n\t\t# vmhostinuse to available\n\t\telseif($oldstateid == 20 && $newstateid == 2) {\n\t\t\t$tmp = getCompFinalVMReservationTime($compid, 1);\n\t\t\tif($tmp == -1) {\n\t\t\t\t$errmsg .= \"A problem was encountered while attempting to schedule \";\n\t\t\t\t$errmsg .= \"assigned VMs to be removed from the computer. Please \";\n\t\t\t\t$errmsg .= \"try again at a later time.\\n\";\n\t\t\t\t$errmsg = preg_replace(\"/(.{1,76}([ \\n]|$))/\", '\\1<br>', $errmsg);\n\t\t\t\t$ret = array('status' => 'error',\n\t\t\t\t 'errormsg' => $errmsg);\n\t\t\t\tsendJSON($ret);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telseif($tmp > $start) {\n\t\t\t\t$delayed = 1;\n\t\t\t\t$start = $tmp;\n\t\t\t\t$end = $start + SECINYEAR;\n\t\t\t\t$startdt = unixToDatetime($start);\n\t\t\t\t$enddt = unixToDatetime($end);\n\t\t\t}\n\t\t\t$vclreloadid = getUserlistID('vclreload@Local');\n\t\t\t$query = \"SELECT vm.id \"\n\t\t\t . \"FROM computer vm, \"\n\t\t\t . \"vmhost v \"\n\t\t\t . \"WHERE v.computerid = $compid AND \"\n\t\t\t . \"vm.vmhostid = v.id\";\n\t\t\t$qh = doQuery($query);\n\t\t\t$fail = 0;\n\t\t\twhile($row = mysqli_fetch_assoc($qh)) {\n\t\t\t\tif(! simpleAddRequest($row['id'], $imageid, $revid, $startdt,\n\t\t\t\t $enddt, 18, $vclreloadid)) {\n\t\t\t\t\t$fail = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcleanSemaphore();\n\t\t\tif($fail) {\n\t\t\t\t$errmsg = \"A problem was encountered while attempting to remove VMs \";\n\t\t\t\t$errmsg .= \"from the computer. Please try again at a later time.\\n\";\n\t\t\t\t$errmsg = preg_replace(\"/(.{1,76}([ \\n]|$))/\", '\\1<br>', $errmsg);\n\t\t\t\t$ret = array('status' => 'error',\n\t\t\t\t 'errormsg' => $errmsg);\n\t\t\t\tsendJSON($ret);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$start = $start + 300;\n\t\t\t\t$end = $start + SECINYEAR;\n\t\t\t\t$startdt = unixToDatetime($start);\n\t\t\t\t$enddt = unixToDatetime($end);\n\t\t\t\tif(! simpleAddRequest($compid, $imageid, $revid, $startdt,\n\t\t\t\t $enddt, 19, $vclreloadid)) {\n\t\t\t\t\t$errmsg = \"A problem was encountered while attempting to schedule \";\n\t\t\t\t\t$errmsg .= \"the computer back to the available state. Please try \";\n\t\t\t\t\t$errmsg .= \"again at a later time.\\n\";\n\t\t\t\t\t$errmsg = preg_replace(\"/(.{1,76}([ \\n]|$))/\", '\\1<br>', $errmsg);\n\t\t\t\t\t$title = 'Change State to Available Failed';\n\t\t\t\t\t$ret = array('status' => 'error',\n\t\t\t\t\t 'errormsg' => $errmsg);\n\t\t\t\t\tsendJSON($ret);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t$msg .= \"The computer has been scheduled to be moved to the \";\n\t\t\t\t$msg .= \"available state at %s.\";\n\t\t\t\t$title = \"Change to available state\";\n\t\t\t}\n\t\t}\n\t\t# vmhostinuse to maintenance\n\t\t# vmhostinuse to vmhostinuse with a profile change\n\t\telseif(($oldstateid == 20 && $newstateid == 10) ||\n\t\t ($oldstateid == 20 && $newstateid == 20 &&\n\t\t $oldprofileid != $vmprofileid)) {\n\n\t\t\tif($newstateid == 10) {\n\t\t\t\t$tomaintenance = 1;\n\t\t\t\t$reloadstateid = 18;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$tomaintenance = 0;\n\t\t\t\t$reloadstateid = 21;\n\t\t\t}\n\n\t\t\tmoveReservationsOffVMs($compid);\n\t\t\tcleanSemaphore();\n\t\n\t\t\t$mnid = findManagementNode($compid, unixToDatetime($start), 'future');\n\t\t\t$tmp = getCompFinalVMReservationTime($compid, 1, 1);\n\t\t\tif($tmp == -1) {\n\t\t\t\tif($tomaintenance) {\n\t\t\t\t\t$errmsg .= \"A problem was encountered while attempting to schedule \";\n\t\t\t\t\t$errmsg .= \"assigned VMs to be moved to the maintenance state. \";\n\t\t\t\t\t$errmsg .= \"Please try again at a later time.\\n\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$errmsg .= \"A problem was encountered while attempting to schedule \";\n\t\t\t\t\t$errmsg .= \"assigned VMs to be moved to the maintenance state while \";\n\t\t\t\t\t$errmsg .= \"the computer is reloaded. Please try again at a later time.\\n\";\n\t\t\t\t}\n\t\t\t\t$errmsg = preg_replace(\"/(.{1,76}([ \\n]|$))/\", '\\1<br>', $errmsg);\n\t\t\t\t$ret = array('status' => 'error',\n\t\t\t\t 'errormsg' => $errmsg);\n\t\t\t\tsendJSON($ret);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telseif($tmp > $start)\n\t\t\t\t$delayed = 1;\n\t\t\t$vclreloadid = getUserlistID('vclreload@Local');\n\t\t\t$start = $tmp;\n\t\t\t$end = $start + SECINYEAR;\n\t\t\t$startdt = unixToDatetime($start);\n\t\t\t$enddt = unixToDatetime($end);\n\t\t\t$fail = 0;\n\t\t\t$vmids = array();\n\t\t\t$query = \"SELECT vm.id \"\n\t\t\t . \"FROM computer vm, \"\n\t\t\t . \"vmhost v \"\n\t\t\t . \"WHERE v.computerid = $compid AND \"\n\t\t\t . \"vm.vmhostid = v.id\";\n\t\t\t$qh = doQuery($query);\n\t\t\twhile($row = mysqli_fetch_assoc($qh)) {\n\t\t\t\t$checkstart = getExistingChangeStateStartTime($row['id'], 18);\n\t\t\t\tif($checkstart) {\n\t\t\t\t\tif($checkstart > $start)\n\t\t\t\t\t\t# update start time of existing tomaintenance reservation\n\t\t\t\t\t\tupdateExistingToState($row['id'], $startdt, 18);\n\t\t\t\t\t# leave existing tomaintenance reservation as is\n\t\t\t\t}\n\t\t\t\telseif(! simpleAddRequest($row['id'], $imageid, $revid, $startdt,\n\t\t\t\t $enddt, 18, $vclreloadid)) {\n\t\t\t\t\t$fail = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$vmids[] = $row['id'];\n\t\t\t}\n\t\t\tif(count($vmids)) {\n\t\t\t\t$allids = implode(',', $vmids);\n\t\t\t\t$query = \"UPDATE computer \"\n\t\t\t\t . \"SET notes = 'maintenance with host $compid' \"\n\t\t\t\t . \"WHERE id IN ($allids)\";\n\t\t\t\tdoQuery($query);\n\t\t\t}\n\t\t\tcleanSemaphore();\n\t\t\tif($fail) {\n\t\t\t\t$errmsg = \"A problem was encountered while attempting to schedule \";\n\t\t\t\t$errmsg .= \"the VMs to the maintenance state. Please try \";\n\t\t\t\t$errmsg .= \"again at a later time.\\n\";\n\t\t\t\t$errmsg = preg_replace(\"/(.{1,76}([ \\n]|$))/\", '\\1<br>', $errmsg);\n\t\t\t\t$ret = array('status' => 'error',\n\t\t\t\t 'errormsg' => $errmsg);\n\t\t\t\tsendJSON($ret);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$start = $start + 300;\n\t\t\t\t$end = $start + SECINYEAR;\n\t\t\t\t$startdt = unixToDatetime($start);\n\t\t\t\t$enddt = unixToDatetime($end);\n\t\t\t\t$checkstart = getExistingChangeStateStartTime($compid, 18);\n\t\t\t\tif($checkstart) {\n\t\t\t\t\tif($checkstart > $start)\n\t\t\t\t\t\t# update start time of existing tomaintenance reservation\n\t\t\t\t\t\tupdateExistingToState($compid, $startdt, 18);\n\t\t\t\t\t# leave existing tomaintenance reservation as is\n\t\t\t\t}\n\t\t\t\telseif(! simpleAddRequest($compid, $imageid, $revid, $startdt,\n\t\t\t\t $enddt, $reloadstateid, $vclreloadid)) {\n\t\t\t\t\tif($tomaintenance) {\n\t\t\t\t\t\t$errmsg = \"A problem was encountered while attempting to schedule \";\n\t\t\t\t\t\t$errmsg .= \"the node to the maintenance state. Please try \";\n\t\t\t\t\t\t$errmsg .= \"again at a later time.\\n\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$errmsg = \"A problem was encountered while attempting to schedule \";\n\t\t\t\t\t\t$errmsg .= \"the node to be reloaded. Please try again at a later time.\\n\";\n\t\t\t\t\t}\n\t\t\t\t\t$errmsg = preg_replace(\"/(.{1,76}([ \\n]|$))/\", '\\1<br>', $errmsg);\n\t\t\t\t\t$ret = array('status' => 'error',\n\t\t\t\t\t 'errormsg' => $errmsg);\n\t\t\t\t\tsendJSON($ret);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif($tomaintenance) {\n\t\t\t\t\t$msg .= \"The computer has been scheduled to be moved to the \";\n\t\t\t\t\t$msg .= \"maintenance state at %s.\";\n\t\t\t\t\t$title = \"Change to maintenance state\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$msg .= \"The computer has been scheduled to be reloaded with \";\n\t\t\t\t\t$msg .= \"the selected VM Host Profile at %s.\";\n\t\t\t\t\t$title = \"Reload Computer\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t# anything else to maintenance\n\t\telseif($oldstateid != 10 && $newstateid == 10) {\n\t\t\t$mnid = findManagementNode($compid, unixToDatetime($start), 'future');\n\t\t\tif(! retryGetSemaphore($imageid, $revid, $mnid, $compid, $start, $end)) {\n\t\t\t\t$errmsg = \"An error was encountered while trying to schedule this<br>\\n\";\n\t\t\t\t$errmsg .= \"computer for the maintenance state. Please try again later.\\n\";\n\t\t\t\t$ret = array('status' => 'error',\n\t\t\t\t 'errormsg' => $errmsg);\n\t\t\t\tsendJSON($ret);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t# create a tomaintenance reservation\n\t\t\t$vclreloadid = getUserlistID('vclreload@Local');\n\t\t\tif(! (simpleAddRequest($compid, $imageid, $revid, $startdt, $enddt,\n\t\t\t 18, $vclreloadid))) {\n\t\t\t\t$errmsg = \"An error was encountered while trying to schedule this<br>\\n\";\n\t\t\t\t$errmsg .= \"computer for the maintenance state. Please try again later.\\n\";\n\t\t\t\t$ret = array('status' => 'error',\n\t\t\t\t 'errormsg' => $errmsg);\n\t\t\t\tsendJSON($ret);\n\t\t\t\tcleanSemaphore();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$msg .= \"The computer has been scheduled to be moved to the \";\n\t\t\t$msg .= \"maintenance state at %s.\";\n\t\t\t$title = \"Change to maintenance state\";\n\t\t}\n\t\tif($delayed) {\n\t\t\t$note = \"<strong>NOTE: The time for the scheduled change has been updated \";\n\t\t\t$note .= \"from what was previously reported.</strong><br>\\n\";\n\t\t\t$msg = $note . $msg;\n\t\t}\n\t\t$schtime = date('g:i a \\o\\n n/j/y', $start);\n\t\t$msg = sprintf($msg, $schtime);\n\t\t$msg = preg_replace(\"/(.{1,76}([ \\n]|$))/\", '\\1<br>', $msg);\n\n\t\t$ret = array('status' => 'success',\n\t\t 'title' => $title,\n\t\t 'clearselection' => 1,\n\t\t 'refreshcount' => $refreshcount,\n\t\t 'msg' => $msg);\n\t\tsendJSON($ret);\n\t}",
"private function needToUpdateResponse()\n {\n return $this->collectQueries || !$this->debug->isEmpty();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create and setup QLabel lblTipo | public function lblTipo_Create($strControlId = null) {
$this->lblTipo = new QLabel($this->objParentObject, $strControlId);
$this->lblTipo->Name = QApplication::Translate('Tipo');
$this->lblTipo->Text = $this->objImportacion->Tipo;
$this->lblTipo->Required = true;
return $this->lblTipo;
} | [
"public function lblTipo_Create($strControlId = null) {\n\t\t\t$this->lblTipo = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblTipo->Name = QApplication::Translate('Tipo');\n\t\t\t$this->lblTipo->PreferredRenderMethod = 'RenderWithName';\n\t\t\t$this->lblTipo->LinkedNode = QQN::Examen()->Tipo;\n\t\t\t$this->lblTipo->Text = $this->objExamen->Tipo;\n\t\t\treturn $this->lblTipo;\n\t\t}",
"protected function lblId_Create() {\n\t\t\t$this->lblId = new QLabel($this);\n\t\t\t$this->lblId->Name = QApplication::Translate('Id');\n\t\t\tif ($this->blnEditMode)\n\t\t\t\t$this->lblId->Text = $this->objOperation->Id;\n\t\t\telse\n\t\t\t\t$this->lblId->Text = 'N/A';\n\t\t}",
"public function creaLabel($label) {\n $this->label = $label;\n }",
"protected function createHTMLLabels() {\n\t\tglobal $type;\n\n\t\t$this->tpl->addTemplateData(\n\t\t\t'main',\n\t\t\tarray(\n\t\t\t\t'title' => strtoupper(sm_get_lang('system', 'title')),\n\t\t\t\t'subtitle' => sm_get_lang('system', $type),\n\t\t\t\t'active_' . $type => 'active',\n\t\t\t\t'label_servers' => sm_get_lang('system', 'servers'),\n\t\t\t\t'label_users' => sm_get_lang('system', 'users'),\n\t\t\t\t'label_log' => sm_get_lang('system', 'log'),\n\t\t\t\t'label_config' => sm_get_lang('system', 'config'),\n\t\t\t\t'label_update' => sm_get_lang('system', 'update'),\n\t\t\t\t'label_help' => sm_get_lang('system', 'help'),\n\t\t\t)\n\t\t);\n\t}",
"public function lblNeumaticos_Create($strControlId = null) {\n\t\t\t$this->lblNeumaticos = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblNeumaticos->Name = QApplication::Translate('Neumaticos');\n\t\t\t$this->lblNeumaticos->Text = $this->objFichas->Neumaticos;\n\t\t\treturn $this->lblNeumaticos;\n\t\t}",
"public function lblNivel_Create($strControlId = null) {\n\t\t\t$this->lblNivel = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblNivel->Name = QApplication::Translate('Nivel');\n\t\t\t$this->lblNivel->PreferredRenderMethod = 'RenderWithName';\n\t\t\t$this->lblNivel->LinkedNode = QQN::Nivel()->Nivel;\n\t\t\t$this->lblNivel->Text = $this->objNivel->Nivel;\n\t\t\treturn $this->lblNivel;\n\t\t}",
"public function lblNome_Create($strControlId = null) {\n\t\t\t$this->lblNome = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblNome->Name = QApplication::Translate('Nome');\n\t\t\t$this->lblNome->Text = $this->objTecido->Nome;\n\t\t\t$this->lblNome->Required = true;\n\t\t\treturn $this->lblNome;\n\t\t}",
"public function lblPosicion_Create($strControlId = null) {\n\t\t\t$this->lblPosicion = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblPosicion->Name = QApplication::Translate('Posicion');\n\t\t\t$this->lblPosicion->Text = $this->objFichas->Posicion;\n\t\t\treturn $this->lblPosicion;\n\t\t}",
"public function lblAnio_Create($strControlId = null, $strFormat = null) {\n\t\t\t$this->lblAnio = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblAnio->Name = QApplication::Translate('Anio');\n\t\t\t$this->lblAnio->Text = $this->objFichas->Anio;\n\t\t\t$this->lblAnio->Format = $strFormat;\n\t\t\treturn $this->lblAnio;\n\t\t}",
"private function setLabels()\n {\n $this->widgetSchema->setLabels(array(\n 'label' => 'Nom du champ',\n 'default_value' => 'Valeur par défaut',\n 'required' => 'Obligatoire'\n ));\n }",
"public function lblType_Create($strControlId = null) {\n\t\t\t$this->lblType = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblType->Name = QApplication::Translate('Type');\n\t\t\t$this->lblType->Text = $this->objRestaurant->Type;\n\t\t\t$this->lblType->Required = true;\n\t\t\treturn $this->lblType;\n\t\t}",
"public function lblNombre_Create($strControlId = null) {\n\t\t\t$this->lblNombre = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblNombre->Name = QApplication::Translate('Nombre');\n\t\t\t$this->lblNombre->Text = $this->objEmpleado->Nombre;\n\t\t\t$this->lblNombre->Required = true;\n\t\t\treturn $this->lblNombre;\n\t\t}",
"public function lblNome_Create($strControlId = null) {\n\t\t\t$this->lblNome = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblNome->Name = QApplication::Translate('Nome');\n\t\t\t$this->lblNome->Text = $this->objColecao->Nome;\n\t\t\t$this->lblNome->Required = true;\n\t\t\treturn $this->lblNome;\n\t\t}",
"public function lblPeso_Create($strControlId = null) {\n\t\t\t$this->lblPeso = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblPeso->Name = QApplication::Translate('Peso');\n\t\t\t$this->lblPeso->Text = $this->objFichas->Peso;\n\t\t\treturn $this->lblPeso;\n\t\t}",
"public function lblOpcion6_Create($strControlId = null) {\n\t\t\t$this->lblOpcion6 = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblOpcion6->Name = QApplication::Translate('Opcion 6');\n\t\t\t$this->lblOpcion6->Text = $this->objEncuestas->Opcion6;\n\t\t\t$this->lblOpcion6->Required = true;\n\t\t\treturn $this->lblOpcion6;\n\t\t}",
"public function lblTitulo_Create($strControlId = null) {\n\t\t\t$this->lblTitulo = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblTitulo->Name = QApplication::Translate('Titulo');\n\t\t\t$this->lblTitulo->Text = $this->objEncuestas->Titulo;\n\t\t\t$this->lblTitulo->Required = true;\n\t\t\treturn $this->lblTitulo;\n\t\t}",
"public function lblTitulo_Create($strControlId = null) {\n\t\t\t$this->lblTitulo = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblTitulo->Name = QApplication::Translate('Titulo');\n\t\t\t$this->lblTitulo->Text = $this->objMagazineNotas->Titulo;\n\t\t\t$this->lblTitulo->Required = true;\n\t\t\treturn $this->lblTitulo;\n\t\t}",
"public function lblPrecio_Create($strControlId = null) {\n\t\t\t$this->lblPrecio = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblPrecio->Name = QApplication::Translate('Precio');\n\t\t\t$this->lblPrecio->Text = $this->objFichas->Precio;\n\t\t\t$this->lblPrecio->Required = true;\n\t\t\treturn $this->lblPrecio;\n\t\t}",
"public function lblOpcion1_Create($strControlId = null) {\n\t\t\t$this->lblOpcion1 = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblOpcion1->Name = QApplication::Translate('Opcion 1');\n\t\t\t$this->lblOpcion1->Text = $this->objEncuestas->Opcion1;\n\t\t\t$this->lblOpcion1->Required = true;\n\t\t\treturn $this->lblOpcion1;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function for get_album_by_name Parm: $shortcode Return: report | function get_album_by_name($album_name){
global $KEY,$DBNAME;
$db_connect = get_database_connection();
mysql_select_db($DBNAME) or die("Cannot select DB");
$sql = mysql_query("SELECT * FROM ".TBL_ALBUM." WHERE album_name LIKE '$album_name' ");
$row=mysql_fetch_array($sql);
return $row;
} | [
"function rtmedia_album_name() {\n\tglobal $rtmedia_media;\n\tif ( $rtmedia_media->album_id ) {\n\t\tif ( rtmedia_type( $rtmedia_media->album_id ) == 'album' ) {\n\t\t\treturn get_rtmedia_title( $rtmedia_media->album_id );\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t} else {\n\t\treturn false;\n\t}\n}",
"public function album()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" album ?\");\n\t}",
"function get_album_name($album_id=0) {\n\n\t\tif (!$album_id) { $album_id = $this->album; } \n\n\t\t$sql = \"SELECT name,prefix FROM album WHERE id='\" . sql_escape($album_id) . \"'\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t$results = mysql_fetch_assoc($db_results);\n\n\t\tif ($results['prefix']) { \n\t\t\treturn $results['prefix'] . \" \" .$results['name'];\n\t\t}\n\t\telse {\n\t\t\treturn $results['name'];\n\t\t}\n\n\t}",
"public function getAlbum($album_name) {\n $query = \"SELECT\n al.id,\n al.name,\n al.year,\n al.version,\n al.location,\n al.sport,\n al.event_type,\n al.manufacturer,\n al.url\n FROM \" . $this->__schema . \".album al\n WHERE al.name = \" . $this->db()->quote($album_name);\n $data = $this->db()->getRow($query);\n if ($data) {\n return [\n 'success' => TRUE,\n 'payload' => $data,\n ];\n }\n else {\n return [\n 'success' => FALSE,\n 'payload' => NULL,\n ];\n }\n }",
"public function find_album($name){\n\t\t$pageToken = '';\n\t\t$end = false;\n\t\twhile(!$end){\n\t\t\t\n\t\t\t$albums = $this->get_album_list( $pageToken );\n\t\t\tif($albums && count($albums) > 0){\n\t\t\t\t\n\t\t\t\tforeach($albums as $key => $album){\n\t\t\t\t\tif($album['title'] == $name){\n\t\t\t\t\t\treturn $key;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($pageToken == ''){\n\t\t\t\t\t$end = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$end = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"public static function get_album_info($artist_name, $album_name, $mb_id = null) {\r\n\t\t\tif ($mb_id) {\r\n\t\t\t\treturn(file_get_contents('http://ws.audioscrobbler.com/2.0/?method=album.getinfo&format=json&api_key=' . LAST_FM_API_KEY . '&autocorrect=1&mbid=' . urlencode($mb_id)));\r\n\t\t\t} else {\r\n\t\t\t\treturn(file_get_contents('http://ws.audioscrobbler.com/2.0/?method=album.getinfo&format=json&api_key=' . LAST_FM_API_KEY . '&autocorrect=1&artist=' . urlencode($artist_name) . '&album=' . urlencode($album_name)));\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t}",
"function get_alb_name($alb_id){\r\n\t\t$alb_id = (int)$alb_id;\r\n\t\t$album = $this->get_term($alb_id, 'gmedia_album');\r\n\t\tif(!$album || is_wp_error($album)){\r\n\t\t\treturn '';\r\n\t\t}\r\n\r\n\t\treturn $album->name;\r\n\t}",
"function brochure_tools_image_album_shortcode( $atts ) {\n\t\tob_start();\n\t\trequire( NARNOO_BROCHURE_TOOLS_PLUGIN_PATH . 'libs/album/album.php' );\n\t\treturn ob_get_clean();\n\t}",
"public function getAlbum($index)\n\t{\n\t\t$album = '';\n\t\t\n\t\t// retrieve albums\n\t\t$nodeAlbum \t= $this->dom->getElementsByTagName('album')->item($index);\n\t\t$album = $nodeAlbum->getAttribute('albumname');\t\t\n\t\t\n\t\treturn $album;\n\t}",
"public static function Get_album_name_image()\n {\n $perpage=1;\n $res=DB::table('albums')\n ->paginate(4);\n\n return $res;\n }",
"function getAlbumByName($userName, $albumName) {\n\n Util::throwExceptionIfNullOrBlank($userName, \"User Name\");\n Util::throwExceptionIfNullOrBlank($albumName, \"Album Name\");\n $encodedUserName = Util::encodeParams($userName);\n $encodedAlbumName = Util::encodeParams($albumName);\n $objUtil = new Util($this->apiKey, $this->secretKey);\n try {\n\t\t $params = null;\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $signParams['userName'] = $userName;\n $signParams['albumName'] = $albumName;\n $signature = urlencode($objUtil->sign($signParams)); //die();\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL . \"/album/\" . $encodedUserName . \"/\" . $encodedAlbumName;\n $response = RestClient::get($baseURL, $params, null, null, $contentType, $accept,$headerParams);\n $albumResponseObj = new AlbumResponseBuilder();\n $albumObj = $albumResponseObj->buildResponse($response->getResponse());\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $albumObj;\n }",
"public function findAlbumByName($name)\n {\n $qb = $this->createQueryBuilder('a');\n\n $qb->where('lower(a.name) = lower(:name)')\n ->setMaxResults(1)\n ->setParameter('name', $name);\n\n return $qb->getQuery()->getOneOrNullResult();\n }",
"function searchSongsInAlbum($conn, $album_name) //done2\n {\n $sql = \"SELECT * FROM album_song WHERE album_name = ?\";\n $stmt = $conn->prepare($sql);\n $stmt->bind_param('s', $album_name);\n $stmt->execute();\n $result = $stmt->get_result();\n return $result;\n }",
"function album_name($key) {\n\t$name = \"\";\n\tif(open_db()) {\n\t $name = $GLOBALS['db']->querySingle(\"SELECT Albums.title FROM Albums WHERE Albums.id = $key\");\n\t}\n\treturn $name;\n}",
"function ReturnAlbumUri($albumInfo) {\n return ReturnLink('album/' . $albumInfo['album_url'],null,0,'media');\n}",
"function get_all_albums_by_name($aName){\n\t\t\t$albums = array();\n\t\t\t$query = \"SELECT * FROM albums WHERE (aName LIKE '%\".$aName.\"%');\";\n\t\t\t$result = $this->connection->query($query);\n\t\t\twhile ( $row = $result->fetch_row() ){\n\t\t\t\t$album = new Albums($row[0], $row[1], $row[2], $row[3], $row[4]);\n\t\t\t\t$albums[] = $album;\n\t\t\t}\n\t\t\treturn $albums;\n\t\t}",
"public function getAlbumImageName($album_id)\n\t\t\t{\n\t\t\t\t$sql = 'SELECT m.large_width, m.large_height, m.thumb_width, m.thumb_height, m.medium_width, m.medium_height, m.music_id, m.music_server_url, m.music_thumb_ext, mfs.file_name'.' '.\n\t\t\t\t\t\t'FROM '.$this->CFG['db']['tbl']['music'].' AS m JOIN '.$this->CFG['db']['tbl']['music_files_settings'].' AS mfs ON mfs.music_file_id = m.thumb_name_id, '\n\t\t\t\t\t\t.$this->CFG['db']['tbl']['music_album'].' AS ma, '.$this->CFG['db']['tbl']['users'].' AS u '.\n\t\t\t\t\t\t'WHERE u.user_id = m.user_id AND m.music_album_id = ma.music_album_id AND u.usr_status = \\'Ok\\'\n\t\t\t\t\t\tAND m.music_status = \\'Ok\\' AND m.music_thumb_ext <> \" \" AND ma.music_album_id = \\''.$album_id.'\\''.$this->getAdultQuery('m.', 'music').' '.\n\t\t\t\t\t\t'AND (m.user_id = '.$this->CFG['user']['user_id'].' OR m.music_access_type = \\'Public\\''.$this->getAdditionalQuery().') LIMIT 0 , 1';\n\n\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t if (!$rs)\n\t\t\t\t\ttrigger_db_error($this->dbObj);\n\n\t\t\t\t$album_image = $rs->FetchRow();\n\t\t\t\treturn $album_image;\n\n\t\t\t}",
"function GetAlbumImage($chosenalbum){\n\t\n\t//Name of the file where is the track list information\n $fileName = \"/var/www/GooglePlayWebTv/Info/TrackList.txt\";\n\n //Declaration of arrays\n $songsurl = array();\n $songsalbum = array();\n\n //Title, artist, and album description\n $str_url = '\"url\": \"';\n $str_album = '\"album\": \"';\n\n\n //Get the variables form the track list\n $songsalbum = GetVariableList($fileName,$str_album);\n $songsurl = GetVariableList($fileName,$str_url);\n\t\n\tfor($x=0;$x<sizeof($songsurl);$x++){\n\t\t$songsurl[$x] = substr($songsurl[$x],2,-1);\n\t}\n\n\t$matrixalbumurl = array($songsalbum,$songsurl);\n\t\n\tfor($x=0;$x<sizeof($matrixalbumurl[0]);$x++){\n\t\n\t\tif($matrixalbumurl[0][$x] == $chosenalbum){\n\t\t\t$chosenurl = $matrixalbumurl[1][$x];\n\t\t\tbreak;\n\t\t}\t\t\n\n\t}\n\t\n\treturn $chosenurl;\t\n\n\t}",
"public function getAlbum() {\r\n\treturn $this->album;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Default constructor: It loads the necessary helpers (URL helper), and libraries (Form Validation & Session Libraries), and sets the the default timezone to the Nigerian timezone. | public function __construct() {
parent::__construct();
date_default_timezone_set('Africa/Lagos'); // set the default timezone to Nigeria
$this->load->helper('url'); // Load the URL helper
$this->load->library('session'); // Load the Session Library
$this->load->library('form_validation'); // Load the Form Validation Library
} | [
"public function __construct()\n {\n date_default_timezone_set($this->_defaultTz);\n setlocale(LC_ALL, $this->_defaultLocale);\n $this->_tzCache['GMT'] = new DateTimeZone('GMT');\n }",
"function __construct(){\n date_default_timezone_set('Asia/Jakarta');\n }",
"public function __construct()\n {\n date_default_timezone_set($this->_defaultTz);\n setlocale(LC_ALL, $this->_defaultLocale);\n $this->_tzCache['UTC'] = new DateTimeZone('UTC');\n $this->_initFormatters($this->_defaultLocale);\n self::$_localeSettings = $this->getLocaleDefaultFormats($this->_defaultLocale);\n }",
"public function __construct()\n {\n date_default_timezone_set('UTC');\n\n parent::__construct();\n }",
"protected function _initTimezone()\n\t{\n\t\t// Set date/time zone\n\t\tdate_default_timezone_set('Europe/Berlin');\n\t}",
"public function __construct($timezone = null)\r\n\t{\r\n\t\t// Call the parent constructor\r\n\t\tif ($timezone)\r\n\t\t{\r\n\t\t\tparent::__construct('now', $timezone);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tparent::__construct('now', new DateTimeZone('Europe/Berlin'));\r\n\t\t}\r\n\t\t\r\n\t\t// Assign values to protected variables\r\n\t\t$this->_year = $this->format('Y');\r\n\t\t$this->_month = $this->format('n');\r\n\t\t$this->_day = $this->format('j');\t\r\n\t}",
"protected function setDefaultTimezone()\n {\n date_default_timezone_set($this->c['config']['locale']['date']['php_date_default_timezone']); // Set Default Time Zone Identifer. \n }",
"public static function set_timezone(){\n\t\ttry{\n\t\t\tdate_default_timezone_set(Application::config(\"general->application_timezone\"));\n\t\t}catch(Exception $e){\n\t\t\tthrow $e;\n\t\t}\n\t}",
"public static function setTimeZone() {\n \n if(!is_null(self::$config))\n date_default_timezone_set(self::$config->timezone);\n }",
"public function _time_zone_set()\n {\n $time_zone = $this->config->item('time_zone');\n if ($time_zone== '') {\n $time_zone=\"Europe/Dublin\";\n }\n date_default_timezone_set($time_zone);\n }",
"protected function _initDate() {\n $config = $this->getContainer()->get('config');\n \tdate_default_timezone_set($config->settings->application->datetime);\n }",
"public function setDefaultTimeZone() {\n if ($time_zone = $this->getTimeZone()) {\n date_default_timezone_set($time_zone);\n }\n }",
"public static function setDefaultTimezone() {\r\n return self::setTimeZone(TIMEZONE_DEFAULT);\r\n }",
"public function __construct()\n\t{\n\t\t$this->localizationHelper = Mage::helper('borderfreelocalization');\n\t\t$this->localizationUrlHelper = Mage::helper('borderfreelocalization/url');\n\t}",
"public function setTimezone();",
"public function __construct()\n {\n parent::__construct();\n must_be_logged_in();\n\t\tload_language_file( 'agenda' );\n }",
"public function setTimezone()\n {\n if (!ini_get('date.timezone')) {\n date_default_timezone_set('UTC');\n }\n }",
"protected function setDefaultTimezone()\n {\n $timezone = 'UTC';\n if (is_link('/etc/localtime')) {\n // Mac OS X (and older Linuxes)\n // /etc/localtime is a symlink to the timezone in /usr/share/zoneinfo.\n $filename = readlink('/etc/localtime');\n if (strpos($filename, '/usr/share/zoneinfo/') === 0) {\n $timezone = substr($filename, 20);\n }\n } elseif (file_exists('/etc/timezone')) {\n // Ubuntu / Debian.\n $data = file_get_contents('/etc/timezone');\n if ($data) {\n $timezone = trim($data);\n }\n } elseif (file_exists('/etc/sysconfig/clock')) {\n // RHEL/CentOS\n $data = parse_ini_file('/etc/sysconfig/clock');\n if (!empty($data['ZONE'])) {\n $timezone = trim($data['ZONE']);\n }\n }\n date_default_timezone_set($timezone);\n }",
"public function set_timezone() {\n\t\t$this->timezone = get_option( 'timezone_string' );\n\n\t\treturn;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Performs a credit card authorization for the given order. | public function credit_card_authorization( \WC_Order $order ) {
$request = $this->get_new_credit_card_request( $order );
$request->set_authorization_data();
return $this->perform_request( $request );
} | [
"public function credit_card_authorization( WC_Order $order ) {\n\n\t\t$this->order = $order;\n\n\t\t$request = $this->get_new_request();\n\n\t\t$request->create_authorization();\n\n\t\treturn $this->perform_request( $request );\n\t}",
"public function authorize(CardAuth $cardInfo, SalesOrder $order);",
"public function create_credit_card_charge( WC_Order $order ) {\n\n\t\t$this->create_transaction( self::AUTH_CAPTURE, $order );\n\t}",
"public function create_credit_card_charge( WC_Order $order ) {\n\n\t\t$this->order = $order;\n\n\t\t$this->create_transaction( self::AUTH_CAPTURE );\n\t}",
"public function credit_card_charge( \\WC_Order $order ) {\n\n\t\t$request = $this->get_new_credit_card_request( $order );\n\n\t\t$request->set_charge_data();\n\n\t\treturn $this->perform_request( $request );\n\t}",
"public static function authorizeOrder($orderId, $debug=false)\n {\n $request = new OrdersAuthorizeRequest($orderId);\n $request->body = self::buildRequestBody();\n // 3. Call PayPal to authorize an order\n $client = PayPalClient::client();\n $response = $client->execute($request);\n // 4. Save the authorization ID to your database. Implement logic to save authorization to your database for future reference.\n if ($debug)\n {\n print \"Status Code: {$response->statusCode}\\n\";\n print \"Status: {$response->result->status}\\n\";\n print \"Order ID: {$response->result->id}\\n\";\n print \"Authorization ID: {$response->result->purchase_units[0]->payments->authorizations[0]->id}\\n\";\n print \"Links:\\n\";\n foreach($response->result->links as $link)\n {\n print \"\\t{$link->rel}: {$link->href}\\tCall Type: {$link->method}\\n\";\n }\n print \"Authorization Links:\\n\";\n foreach($response->result->purchase_units[0]->payments->authorizations[0]->links as $link)\n {\n print \"\\t{$link->rel}: {$link->href}\\tCall Type: {$link->method}\\n\";\n }\n // To toggle printing the whole response body comment/uncomment the following line\n echo json_encode($response->result, JSON_PRETTY_PRINT), \"\\n\";\n }\n return $response;\n }",
"public function performEasyCreditAuthorizeRequest(\n OrderTransfer $orderTransfer,\n ComputopApiHeaderPaymentTransfer $computopApiHeaderPayment\n );",
"public function proccess()\n\t{\n\t\t$creditCard = new \\PagSeguro\\Domains\\Requests\\DirectPayment\\CreditCard();\n\n\t\t$creditCard->setReceiverEmail('nandokstro@gmail.com');\n\n\t\t// Set a reference code for this payment request. It is useful to identify this payment\n\t\t// in future notifications.\n\t\t$creditCard->setReference(\"CEL-\" . $this->order->getId());\n\t\t// Set the currency\n\t\t$creditCard->setCurrency(\"BRL\");\n\n\t\tforeach (unserialize($this->order->getItems()) as $i) {\n\t\t\t$creditCard->addItems()->withParameters(\n\t\t\t\t$i['id'],\n\t\t\t\t$i['name'],\n\t\t\t\t1,\n\t\t\t\t$i['price']\n\t\t\t);\n\t\t}\n\n\t\t// Set your customer information.\n\t\t// If you using SANDBOX you must use an email @sandbox.pagseguro.com.br\n\t\t$userName = $this->order->getUser()->getFirstName() . ' ' . $this->order->getUser()->getLastName();\n\t\t$creditCard->setSender()->setName($userName);\n\t\t$creditCard->setSender()->setEmail('email@sandbox.pagseguro.com.br');\n\t\t$creditCard->setSender()->setPhone()->withParameters(\n\t\t\t11,\n\t\t\t56273440\n\t\t);\n\t\t$creditCard->setSender()->setDocument()->withParameters(\n\t\t\t'CPF',\n\t\t\t'13927261661'\n\t\t);\n\t\t$creditCard->setSender()->setHash($this->hashUser);\n\t\t$creditCard->setSender()->setIp('127.0.0.0');\n\n\t\t// Set shipping information for this payment request\n\t\t$creditCard->setShipping()->setAddress()->withParameters(\n\t\t\t'Av. Brig. Faria Lima',\n\t\t\t'1384',\n\t\t\t'Jardim Paulistano',\n\t\t\t'01452002',\n\t\t\t'São Paulo',\n\t\t\t'SP',\n\t\t\t'BRA',\n\t\t\t'apto. 114'\n\t\t);\n\n\t\t//Set billing information for credit card\n\t\t$creditCard->setBilling()->setAddress()->withParameters(\n\t\t\t'Av. Brig. Faria Lima',\n\t\t\t'1384',\n\t\t\t'Jardim Paulistano',\n\t\t\t'01452002',\n\t\t\t'São Paulo',\n\t\t\t'SP',\n\t\t\t'BRA',\n\t\t\t'apto. 114'\n\t\t);\n\n\t\t// Set credit card token\n\t\t$creditCard->setToken($this->tokenCard);\n\n\t\t// Set the installment quantity and value (could be obtained using the Installments\n\t\t// service, that have an example here in \\public\\getInstallments.php)\n\t\t$installment = explode('|', $this->installments);\n\n\t\t$creditCard->setInstallment()->withParameters($installment[0], $installment[1], 12);\n\n\t\t// Set the credit card holder information\n\t\t$creditCard->setHolder()->setBirthdate('01/10/1979');\n\t\t$creditCard->setHolder()->setName('João Comprador'); // Equals in Credit Card\n\t\t$creditCard->setHolder()->setPhone()->withParameters(\n\t\t\t11,\n\t\t\t56273440\n\t\t);\n\t\t$creditCard->setHolder()->setDocument()->withParameters(\n\t\t\t'CPF',\n\t\t\t'13927261661'\n\t\t);\n\n\t\t// Set the Payment Mode for this payment request\n\t\t$creditCard->setMode('DEFAULT');\n\t\t// Set a reference code for this payment request. It is useful to identify this payment\n\t\t// in future notifications.\n\n\t\t//Get the crendentials and register the boleto payment\n\t\t$result = $creditCard->register(\n\t\t\t$this->creditials\n\t\t);\n\n\t\treturn $result;\n\t}",
"function processCard($amount=0,$orderId,$ccNumber,$expM,$expY,$ccCode,$description=\"\")\r\n\t{\r\n\t\tglobal $_SETTINGS;\r\n\t\t\r\n\t\t// GET METHOD\r\n\t\t$method = $_SETTINGS['ecommerce_cc_processor'];\r\n\t\t\r\n\t\t//\r\n\t\t// AUTHORIZE.net == PROCESSOR ID 1\r\n\t\t//\r\n\t\tif($method == \"1\"){\r\n\t\t\t// IF TESTING / NOT LIVE\r\n\t\t\tif($_SETTINGS['anet_live'] == 0){\t\t\r\n\t\t\t\t// By default, this sample code is designed to post to our test server for\r\n\t\t\t\t// developer accounts: https://test.authorize.net/gateway/transact.dll\r\n\t\t\t\t// for real accounts (even in test mode), please make sure that you are\r\n\t\t\t\t// posting to: https://secure.authorize.net/gateway/transact.dll\t\t\r\n\t\t\t\t$post_url = \"https://test.authorize.net/gateway/transact.dll\";\t\r\n\t\t\t\t$loginid = $_SETTINGS['anet_test_login_id'];\r\n\t\t\t\t$transkey = $_SETTINGS['anet_test_transaction_key'];\t\t\t\t\r\n\t\t\t} elseif($_SETTINGS['anet_live'] == 1){\r\n\t\t\t\t$post_url = \"https://secure.authorize.net/gateway/transact.dll\";\t\r\n\t\t\t\t$loginid = $_SETTINGS['anet_production_login_id'];\r\n\t\t\t\t$transkey = $_SETTINGS['anet_production_transaction_key'];\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t\t$expY = substr($expY,2);\r\n\t\t\r\n\t\t\t$post_values = array(\t\t\t\r\n\t\t\t\t// the API Login ID and Transaction Key must be replaced with valid values\r\n\t\t\t\t\"x_login\"\t\t\t=> $loginid,\r\n\t\t\t\t\"x_tran_key\"\t\t=> $transkey,\r\n\r\n\t\t\t\t\"x_version\"\t\t\t=> \"3.1\",\r\n\t\t\t\t\"x_delim_data\"\t\t=> \"TRUE\",\r\n\t\t\t\t\"x_delim_char\"\t\t=> \"|\",\r\n\t\t\t\t\"x_relay_response\"\t=> \"FALSE\",\r\n\r\n\t\t\t\t\"x_type\"\t\t\t=> \"AUTH_CAPTURE\",\r\n\t\t\t\t\"x_method\"\t\t\t=> \"CC\",\r\n\t\t\t\t\"x_card_num\"\t\t=> $ccNumber,\r\n\t\t\t\t\"x_exp_date\"\t\t=> $expM.$expY,\r\n\t\t\t\t\"x_card_code\"\t\t=> $ccCode,\r\n\t\t\t\t\r\n\t\t\t\t\"x_amount\"\t\t\t=> $amount,\r\n\t\t\t\t\"x_description\"\t\t=> $description\r\n\r\n\t\t\t\t//\"x_first_name\"\t\t=> \"\".$_POST['firt_name'].\"\",\r\n\t\t\t\t//\"x_last_name\"\t\t=> \"\".$_POST['last_name'].\"\",\r\n\t\t\t\t//\"x_address\"\t\t\t=> \"\".$_POST['address1'].\"\",\r\n\t\t\t\t//\"x_state\"\t\t\t=> \"\".$_POST['state'].\"\",\r\n\t\t\t\t//\"x_zip\"\t\t\t\t=> \"\".$_POST['zip'].\"\"\r\n\t\t\t\t// Additional fields can be added here as outlined in the AIM integration\r\n\t\t\t\t// guide at: http://developer.authorize.net\r\n\t\t\t);\r\n\t\t\r\n\t\t\t// This section takes the input fields and converts them to the proper format\r\n\t\t\t// for an http post. For example: \"x_login=username&x_tran_key=a1B2c3D4\"\r\n\t\t\t$post_string = \"\";\r\n\t\t\tforeach( $post_values as $key => $value )\r\n\t\t\t\t{ $post_string .= \"$key=\" . urlencode( $value ) . \"&\"; }\r\n\t\t\t$post_string = rtrim( $post_string, \"& \" );\r\n\r\n\t\t\t// This sample code uses the CURL library for php to establish a connection,\r\n\t\t\t// submit the post, and record the response.\r\n\t\t\t// If you receive an error, you may want to ensure that you have the curl\r\n\t\t\t// library enabled in your php configuration\r\n\t\t\t$request = curl_init($post_url); // initiate curl object\r\n\t\t\t\tcurl_setopt($request, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response\r\n\t\t\t\tcurl_setopt($request, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)\r\n\t\t\t\tcurl_setopt($request, CURLOPT_POSTFIELDS, $post_string); // use HTTP POST to send form data\r\n\t\t\t\tcurl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE); // uncomment this line if you get no gateway response.\r\n\t\t\t\t$post_response = curl_exec($request); // execute curl post and store results in $post_response\r\n\t\t\t\t// additional options may be required depending upon your server configuration\r\n\t\t\t\t// you can find documentation on curl options at http://www.php.net/curl_setopt\r\n\t\t\tcurl_close ($request); // close curl object\r\n\r\n\t\t\t// This line takes the response and breaks it into an array using the specified delimiting character\r\n\t\t\t$response_array = explode($post_values[\"x_delim_char\"],$post_response);\t\t\r\n\t\t\t$response_string = \"\";\r\n\t\r\n\t\t\t// The results are output to the screen in the form of an html numbered list.\r\n\t\t\t//echo \"<OL>\\n\";\r\n\t\t\t//foreach ($response_array as $value)\r\n\t\t\t//{\r\n\t\t\t\t//echo \"<LI>\" . $value . \" </LI>\\n\";\r\n\t\t\t//\t$i++;\r\n\t\t\t//}\r\n\t\t\t\r\n\t\t\t//echo \"</OL>\\n\";\r\n\t\t\t//die();\r\n\t\t\t//exit();\r\n\t\t\t// individual elements of the array could be accessed to read certain response\r\n\t\t\t// fields. For example, response_array[0] would return the Response Code,\r\n\t\t\t// response_array[2] would return the Response Reason Code.\r\n\t\t\t// for a list of response fields, please review the AIM Implementation Guide\r\n\t\r\n\t\t\t$response_string = \"\".date(\"Y-m-d H:i:s\").\"|\".$price.\"|\".$response_array[4].\"\";\r\n\t\t\t$response = $response_array;\r\n\t\t\t//echo \"<br><br>\";\r\n\t\t\t//var_export($post_values);\r\n\t\t\t\r\n\t\t\t//die();\r\n\t\t\t//exit();\r\n\t\t\t\r\n\t\t\t// RETURN TRANSACTION\r\n\t\t\t\r\n\t\t\t$array = array($response_array[0],$response_array[3],$response_array);\r\n\t\t\treturn $array;\r\n\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\t// PAYPAL WEBSITE PAYMENTS PRO\r\n\t\t// TODO...\r\n\t\tif($method==\"2\"){\r\n\t\t\t$array = array(0,\"\",\"\");\r\n\t\t\treturn $array;\r\n\t\t}\t\t\r\n\t}",
"public function authorizeCommandHandle(array $orderItems, OrderTransfer $orderTransfer);",
"public function initiateCreditCardPayment($orderId, $generateToken, $paymentToken);",
"abstract public function charge($token, $order);",
"public function initiateVerifyCreditCardPayment($orderId);",
"public function do_credit_card() {\r\n\r\n if( method_exists( $this->gateway, 'do_credit_card' ) ) {\r\n return $this->gateway->do_credit_card();\r\n }\r\n\r\n return false;\r\n\r\n}",
"function authorize($amount,$tax,$card_name,$card_number,$card_expiration,$cvv,$address,$description = \"\",$email = \"\",$phone = \"\",$customer = \"\") {\n\t\t\t// Clean up the amount and tax.\n\t\t\t$amount = number_format(round(floatval(str_replace(array('$',','),\"\",$amount)),2),2);\n\t\t\t$tax = number_format(round(floatval(str_replace(array('$',','),\"\",$tax)),2),2);\n\t\t\t\n\t\t\t// Make card number only have numeric digits\n\t\t\t$card_number = preg_replace('/\\D/', '', $card_number);\n\n\t\t\tif ($this->Service == \"authorize.net\") {\n\t\t\t\treturn $this->authorizeAuthorize($amount,$tax,$card_name,$card_number,$card_expiration,$cvv,$address,$description,$email,$phone,$customer);\n\t\t\t} elseif ($this->Service == \"paypal\") {\n\t\t\t\treturn $this->authorizePayPal($amount,$tax,$card_name,$card_number,$card_expiration,$cvv,$address,$description,$email,$phone,$customer);\n\t\t\t} elseif ($this->Service == \"paypal-rest\") {\n\t\t\t\treturn $this->authorizePayPalREST($amount,$tax,$card_name,$card_number,$card_expiration,$cvv,$address,$description,$email,$phone,$customer);\n\t\t\t} elseif ($this->Service == \"payflow\") {\n\t\t\t\treturn $this->authorizePayflow($amount,$tax,$card_name,$card_number,$card_expiration,$cvv,$address,$description,$email,$phone,$customer);\n\t\t\t} elseif ($this->Service == \"linkpoint\") {\n\t\t\t\treturn $this->authorizeLinkPoint($amount,$tax,$card_name,$card_number,$card_expiration,$cvv,$address,$description,$email,$phone,$customer);\t\n\t\t\t}\n\t\t}",
"function tryAddCreditFromOrder($payment_token) {\n\t\n\n\t$sql = \t\" SELECT a.credit, a.type, b.user_uid FROM product as a, orderinfo as b \".\n\t\t\" WHERE a.id=b.product_id and b.payment_token='\".$payment_token.\"'\";\n\t$result = query($sql);\n\tif ($row = mysqli_fetch_array($result) ) {\n\t\t$type = $row['type'];\n\t\tif($type==\"TBC\") { // Bear Coin\n\t\t\t$points = $row['credit'];\n\t\t\t$user_uid = $row['user_uid'];\n\t\t\t$sql = \"UPDATE member SET credit=credit+\".$points.\" where uid='\".$user_uid.\"'\";\n\t\t\tquery($sql);\n\t\t\t//if(mysqli_affected_rows($dbConn) > 0) {\n\t\t\t\t\treturn 1;\n\t\t\t//}\n\t\t\t\n\t\t}\n\t}\n\treturn 0;\n}",
"public function claim($user, $order, $cost);",
"public function authorize(Varien_Object $payment, $amount)\n {\n $request = Mage::app()->getRequest();\n $nonce = $request->getPost('payment_method_nonce');\n\n if (!$nonce && !$this->useVault()) {\n Mage::throwException(Mage::helper('fris_pay')->__('No payment method nonce received. Cannot authorize payment. Please edit your Payment Information and try again.'));\n }\n $order = $payment->getOrder();\n\n $args = array(\n 'amount' => $amount,\n 'paymentMethodNonce' => $nonce,\n 'orderId' => $order->getIncrementId(),\n 'channel' => $this->getChannel(),\n 'options' => array(\n 'submitForSettlement' => true,\n 'storeInVaultOnSuccess' => $this->useVault(),\n 'storeShippingAddressInVault' => $this->useVault(),\n 'addBillingAddressToPaymentMethod' => $this->useVault(),\n ),\n );\n $billing = $order->getBillingAddress();\n $shipping = $order->getShippingAddress();\n\n // See https://developers.braintreepayments.com/javascript+php/sdk/server/transaction-processing/create-from-vault\n if ($this->useVault() && $order->getCustomerId()) {\n $customerId = $this->_generateBraintreeCustomerId($order->getCustomerId(), $order->getCustomerEmail());\n if ($this->getBraintreeCustomer($customerId)) {\n // Customer already exists, so just pass their ID.\n $args['customerId'] = $customerId;\n }\n else {\n // Create a new customer on Braintree with the given ID.\n $args['customer'] = array(\n 'id' => $customerId,\n 'company' => $billing->getCompany(),\n 'firstName' => $billing->getFirstname(),\n 'lastName' => $billing->getLastname(),\n 'phone' => $billing->getTelephone(),\n 'fax' => $billing->getFax(),\n 'email' => $order->getCustomerEmail(),\n //'website' => 'N.A.',\n );\n }\n }\n // If 'customerId' is supplied will 'billing' and 'shipping' be\n // updated automatically, if changed during Magento checkout?\n if ($billing) {\n $args['billing'] = $this->toBraintreeAddress($billing);\n }\n if ($shipping) {\n $args['shipping'] = $this->toBraintreeAddress($shipping);\n }\n if (!empty($this->_merchantAccountId)) {\n // This causes an exception in Braintree v.zero when the merchant\n // has not set up a merchantAccountId identical to the one below, as\n // specified on the Magento Payment Method configuration page.\n // Merchant accounts may be used to deal with different currencies.\n $args['merchantAccountId'] = $this->_merchantAccountId;\n }\n $deviceData = $request->getPost('device_data');\n if (/*$this->getConfigData('fraudprotection') &&*/ $deviceData) {\n $args['deviceData'] = $deviceData;\n }\n\n $this->_debug($args);\n\n $result = Braintree_Transaction::sale($args);\n\n if (empty($result->success)) {\n $this->_debug($result->errors->deepAll());\n \n $error = 'ERROR ';\n if (empty($result->transaction)) {\n $error .= empty($result->message) ? '?' : $result->message;\n } else {\n $error .= '(' . $result->transaction->processorResponseCode . '): '\n . $result->transaction->processorResponseText;\n }\n $msg = Mage::helper('fris_pay')->__('Please try again later or contact merchant.');\n Mage::throwException($error . \"\\n\\n\" . $msg);\n }\n else {\n $this->setStore($order->getStoreId());\n $this->_processSale($payment, $result);\n }\n return $this;\n }",
"public function payWithCreditCard()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle the Marker "force deleted" event. | public function forceDeleted(Marker $marker): void
{
//
} | [
"protected function afterDelete()\n {\n $this->fireMapperEvent(static::EVENT_DELETED, false);\n }",
"public function forceDeleted(Entry $entry)\n {\n //\n }",
"protected function afterDeletion() {}",
"protected function afterDelete () {}",
"public function on_delete() {}",
"public function deleted()\n {\n // do something after delete\n }",
"protected function afterDelete()\n {\n }",
"public function flagAsDeleted () {\n // xxx finish\n }",
"public function forceDeleted(Event $event)\n {\n //\n }",
"protected function after_delete() {\n\n\t}",
"public function deleted(Marker $marker): void\n {\n $marker->markerMedia->each(function ($markerMedia) {\n $markerMedia->delete();\n });\n }",
"protected function before_delete() {\n\n\t}",
"public function after_delete() {}",
"public function onAfterDeleteCommit(MapperEvent $e)\n {\n }",
"public function onBeforeDelete() {\n\t\tif ( !$this->owner->Syndicated && ($this->owner->Status == 'Unpublished' || $this->owner->IsDeletedFromStage) ) {\n\t\t\t$record = new BlogSyndicatorDeletedEntry();\n\t\t\t$record->EntryID = $this->owner->ID;\n\t\t\t$record->write();\n\t\t}\n\t}",
"public function onBeforeDelete() {\n\t\tDynamicCache::inst()->clear();\n\t}",
"public function deleted(EntryInterface $entry)\n {\n //$this->dispatch(new DeleteStream($entry));\n\n parent::deleted($entry);\n }",
"abstract public function handleDelete($event);",
"public function deleted(Entry $entry)\n {\n //\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generated from protobuf field .temporal.api.filter.v1.WorkflowExecutionFilter execution_filter = 5; | public function setExecutionFilter($var)
{
GPBUtil::checkMessage($var, \Temporal\Api\Filter\V1\WorkflowExecutionFilter::class);
$this->writeOneof(5, $var);
return $this;
} | [
"public function setWorkflowExecution($var)\n {\n GPBUtil::checkMessage($var, \\Temporal\\Api\\Common\\V1\\WorkflowExecution::class);\n $this->workflow_execution = $var;\n\n return $this;\n }",
"public function filterByExecution($execution = null, $comparison = null)\n {\n if (is_array($execution)) {\n $useMinMax = false;\n if (isset($execution['min'])) {\n $this->addUsingAlias(PerformanceScoreTableMap::COL_EXECUTION, $execution['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($execution['max'])) {\n $this->addUsingAlias(PerformanceScoreTableMap::COL_EXECUTION, $execution['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PerformanceScoreTableMap::COL_EXECUTION, $execution, $comparison);\n }",
"public function getWorkflowExecution()\n {\n return $this->workflow_execution;\n }",
"public function getExecution()\n {\n return $this->readOneof(5);\n }",
"public function getWorkflowExecutionType()\n {\n if (array_key_exists(\"workflowExecutionType\", $this->_propDict)) {\n if (is_a($this->_propDict[\"workflowExecutionType\"], \"\\Beta\\Microsoft\\Graph\\IdentityGovernanceNamespace\\Model\\WorkflowExecutionType\") || is_null($this->_propDict[\"workflowExecutionType\"])) {\n return $this->_propDict[\"workflowExecutionType\"];\n } else {\n $this->_propDict[\"workflowExecutionType\"] = new WorkflowExecutionType($this->_propDict[\"workflowExecutionType\"]);\n return $this->_propDict[\"workflowExecutionType\"];\n }\n }\n return null;\n }",
"public function getExecution(): WorkflowExecution;",
"public function getExecutionConditions()\n {\n if (array_key_exists(\"executionConditions\", $this->_propDict)) {\n if (is_a($this->_propDict[\"executionConditions\"], \"\\Beta\\Microsoft\\Graph\\IdentityGovernanceNamespace\\Model\\WorkflowExecutionConditions\") || is_null($this->_propDict[\"executionConditions\"])) {\n return $this->_propDict[\"executionConditions\"];\n } else {\n $this->_propDict[\"executionConditions\"] = new WorkflowExecutionConditions($this->_propDict[\"executionConditions\"]);\n return $this->_propDict[\"executionConditions\"];\n }\n }\n return null;\n }",
"public function setExecution( ymcPipeExecution $execution );",
"public function setExecution($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\AIPlatform\\V1\\Execution::class);\n $this->execution = $var;\n\n return $this;\n }",
"public function getFilterExecutor(): FilterInterface\n {\n return $this->filterExecutor;\n }",
"public function setExecutionId($var)\n {\n GPBUtil::checkString($var, True);\n $this->execution_id = $var;\n\n return $this;\n }",
"public function getExecution()\n {\n return $this->execution;\n }",
"public function setExecution($var)\n {\n GPBUtil::checkMessage($var, \\Types\\ExecutionStatus::class);\n $this->writeOneof(5, $var);\n\n return $this;\n }",
"public function getExecutionSpec()\n {\n return $this->execution_spec;\n }",
"public function getExecutionId()\n {\n return $this->execution_id;\n }",
"public function executionId(?string $executionId): TaskQueryInterface;",
"public function getWorkflowExecutionSignaledEventAttributes()\n {\n return $this->readOneof(26);\n }",
"public function getExecutionId()\n {\n return $this->executionId;\n }",
"public function filter(){\n $value = null;\n\n $constraint18 = null;\n\n\n try {\n // Sparql10.g:166:5: ( FILTER constraint ) \n // Sparql10.g:166:7: FILTER constraint \n {\n $this->match($this->input,$this->getToken('FILTER'),self::$FOLLOW_FILTER_in_filter973); \n $this->pushFollow(self::$FOLLOW_constraint_in_filter975);\n $constraint18=$this->constraint();\n\n $this->state->_fsp--;\n\n $value = new Erfurt_Sparql_Query2_Filter($constraint18);\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return $value;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handler of the add_filter('crypton_blog_filter_tgmpa_required_plugins','crypton_blog_searchfilter_tgmpa_required_plugins'); | function crypton_blog_searchfilter_tgmpa_required_plugins($list=array()) {
if (crypton_blog_storage_isset('required_plugins', 'search-filter')) {
$list[] = array(
'name' => crypton_blog_storage_get_array('required_plugins', 'search-filter'),
'slug' => 'search-filter',
'required' => false
);
}
return $list;
} | [
"function pmprobbpress_init() {\r\n\tif ( !defined('PMPRO_VERSION') || !class_exists('bbPress') )\r\n\t\treturn;\r\n\t\r\n\tif ( is_admin() )\r\n\t\tadd_action( 'admin_menu', 'pmprobbp_add_meta_box' );\r\n\r\n\t//apply search filter to bbpress searches\r\n\t$filterqueries = pmpro_getOption(\"filterqueries\");\r\n\tif(!empty($filterqueries))\r\n\t add_filter( 'pre_get_posts', 'pmprobb_pre_get_posts' );\r\n}",
"function dd_base_register_required_plugins() {\n\n\t\t$plugins = array(\n\t\t\tarray(\n\t\t\t\t'name' => esc_html__( 'TP Framework', 'dd-base' ),\n\t\t\t\t'slug' => 'tp-framework',\n\t\t\t\t'required' => false\n\t\t\t),\n\t\t);\n\n\t\t$config = array(\n\t\t\t'has_notices' => true,\n\t\t\t'is_automatic' => false\n\t\t);\n\n\t\ttgmpa( $plugins, $config );\n\t}",
"function crypton_blog_mailchimp_tgmpa_required_plugins($list=array()) {\n\t\tif (crypton_blog_storage_isset('required_plugins', 'mailchimp-for-wp')) {\n\t\t\t$list[] = array(\n\t\t\t\t'name' \t\t=> crypton_blog_storage_get_array('required_plugins', 'mailchimp-for-wp'),\n\t\t\t\t'slug' \t\t=> 'mailchimp-for-wp',\n\t\t\t\t'required' \t=> false\n\t\t\t);\n\t\t}\n\t\treturn $list;\n\t}",
"public function plugins_loaded()\n\t{\n\t\t// Have the login plugin use frontend notifictions plugin\n\t\tif ( apply_filters( \"{$this->prefix}/create_object/use_sewn_notifications\", true ) )\n\t\t{\n\t\t\tif (! class_exists('Sewn_Notifications') ) {\n\t\t\t\tadd_filter( \"{$this->prefix}/create_object/use_sewn_notifications\", '__return_false', 9999 );\n\t\t\t}\n\t\t}\n\t}",
"function hypnotherapy_mailchimp_tgmpa_required_plugins($list=array()) {\n\t\tif (in_array('mailchimp-for-wp', hypnotherapy_storage_get('required_plugins')))\n\t\t\t$list[] = array(\n\t\t\t\t'name' \t\t=> esc_html__('MailChimp for WP', 'hypnotherapy'),\n\t\t\t\t'slug' \t\t=> 'mailchimp-for-wp',\n\t\t\t\t'required' \t=> false\n\t\t\t);\n\t\treturn $list;\n\t}",
"function chocorocco_mailchimp_tgmpa_required_plugins($list=array()) {\n\t\tif (in_array('mailchimp-for-wp', chocorocco_storage_get('required_plugins')))\n\t\t\t$list[] = array(\n\t\t\t\t'name' \t\t=> esc_html__('MailChimp for WP', 'chocorocco'),\n\t\t\t\t'slug' \t\t=> 'mailchimp-for-wp',\n\t\t\t\t'required' \t=> false\n\t\t\t);\n\t\treturn $list;\n\t}",
"public function get_required_plugins() {\n\t\treturn (array) apply_filters( 'wds_required_plugins', array() );\n\t}",
"private function model_custom_wp_filters() {\n\t\t$this->add_filter( 'prso_mailchimp_listSubscribe', 'list_subscribe', 1, 2 );\n\t\t\n\t}",
"function my_theme_register_required_plugins() {\n\t/*\n\t* Array of plugin arrays. Required keys are name and slug.\n\t* If the source is NOT from the .org repo, then source is also required.\n\t*/\n\t$plugins = array(\n\t\t// Pre-packaged with a theme\n\t\tarray(\n\t\t\t'name' => 'Revolution Slider', // The plugin name\n\t\t\t'slug' => 'revslider', // The plugin slug (typically the folder name)\n\t\t\t'source' => WM_LIBRARY . 'plugins/revslider.zip', // The plugin source\n\t\t\t'required' => true, // If false, the plugin is only 'recommended' instead of required\n\t\t\t'version' => '4.6.92', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented\n\t\t\t'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch\n\t\t\t'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins\n\t\t\t'external_url' => '', // If set, overrides default API URL and points to an external URL\n\t\t),\n\t);\n\n\ttgmpa( $plugins );\n}",
"public function filters()\n {\n\n add_filter(\n 'mce_external_plugins',\n array(&$this,'appendBtns')\n );\n\n add_filter(\n 'mce_buttons',\n array(&$this, 'registerButtons')\n );\n }",
"public static function add_third_party_plugin_integrations(){\n\t\tif ( class_exists('Woocommerce_Price_Per_Word') ){\n\t\t\t//Price per word by Angell EYE\n\t\t\tadd_filter( 'wc_price_args', array( __CLASS__ , 'price_per_word_price_args' ) );\t\t\t\n\t\t}\n\t}",
"public function load_hooks() {\n\t\t\tadd_filter( 'plugins_api_result', [ $this, 'plugins_api_result' ], 10, 3 );\n\t\t\tadd_filter( 'upgrader_post_install', [ $this, 'upgrader_post_install' ], 10, 3 );\n\t\t}",
"function itcompany_register_required_plugins() {\n\t$plugins = array(\n\t\tarray(\n\t\t\t'name' => esc_html__( 'Jet Plugin Wizard', 'itcompany' ),\n\t\t\t'slug' => 'jet-plugins-wizard',\n\t\t\t'source' => 'https://github.com/ZemezLab/jet-plugins-wizard/archive/master.zip',\n\t\t\t'external_url' => 'https://github.com/ZemezLab/jet-plugins-wizard',\n\t\t),\n\t);\n\t$config = array(\n\t\t'id' => 'itcompany',\n\t\t'default_path' => '',\n\t\t'menu' => 'tgmpa-install-plugins',\n\t\t'has_notices' => true,\n\t\t'dismissable' => true,\n\t\t'dismiss_msg' => '',\n\t\t'is_automatic' => true,\n\t\t'message' => '',\n\t);\n\ttgmpa( $plugins, $config );\n}",
"function prostart_mailchimp_tgmpa_required_plugins($list=array()) {\n\t\tif (prostart_storage_isset('required_plugins', 'mailchimp-for-wp')) {\n\t\t\t$list[] = array(\n\t\t\t\t'name' \t\t=> prostart_storage_get_array('required_plugins', 'mailchimp-for-wp'),\n\t\t\t\t'slug' \t\t=> 'mailchimp-for-wp',\n\t\t\t\t'required' \t=> false\n\t\t\t);\n\t\t}\n\t\treturn $list;\n\t}",
"function parquecv_register_required_plugins() {\r\n \r\n /**\r\n * Array of plugin arrays. Required keys are name and slug.\r\n * If the source is NOT from the .org repo, then source is also required.\r\n */\r\n $plugins = array(\r\n \r\n \r\n // This is an example of how to include a plugin from the WordPress Plugin Repository.\r\n array(\r\n 'name' => __('WP Gallery Custom Links','parquecv'),\r\n 'slug' => 'wp-gallery-custom-links',\r\n 'required' => false,\r\n ),\r\n\r\n array(\r\n 'name' => __('Instagram Feed','parquecv'),\r\n 'slug' => 'instagram-feed',\r\n 'required' => false,\r\n ),\r\n\r\n );\r\n \r\n /**\r\n * Array of configuration settings. Amend each line as needed.\r\n * If you want the default strings to be available under your own theme domain,\r\n * leave the strings uncommented.\r\n * Some of the strings are added into a sprintf, so see the comments at the\r\n * end of each line for what each argument will be.\r\n */\r\n $config = array(\r\n 'id' => 'parquecv', // Unique ID for hashing notices for multiple instances of TGMPA.\r\n 'default_path' => '', // Default absolute path to bundled plugins.\r\n 'menu' => 'tgmpa-install-plugins', // Menu slug.\r\n 'has_notices' => true, // Show admin notices or not.\r\n 'dismissable' => true, // If false, a user cannot dismiss the nag message.\r\n 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.\r\n 'is_automatic' => false, // Automatically activate plugins after installation or not.\r\n 'message' => '', // Message to output right before the plugins table.\r\n );\r\n \r\n tgmpa( $plugins, $config );\r\n \r\n}",
"function autoparts_woocommerce_tgmpa_required_plugins($list=array()) {\n\t\tif (in_array('woocommerce', autoparts_storage_get('required_plugins')))\n\t\t\t$list[] = array(\n\t\t\t\t\t'name' \t\t=> esc_html__('WooCommerce', 'autoparts'),\n\t\t\t\t\t'slug' \t\t=> 'woocommerce',\n\t\t\t\t\t'required' \t=> false\n\t\t\t\t);\n\n\t\treturn $list;\n\t}",
"public static function init() {\n\t\tadd_filter('gb_addons', array(get_class(),'gb_addon'), 10, 1);\n\t}",
"function installHooks() {\r\n\r\n\t\t\tadd_filter( 'pre_set_site_transient_update_plugins' , array( $this , 'update_check' ) );\r\n\t\t\tadd_filter( 'plugins_api' \t\t\t\t\t\t\t, array( $this , 'inject_info' ) , 10 , 3 );\r\n\t\t\tadd_action( 'upgrader_process_complete' , array( $this , 'after_plugin_update' ) , 10 , 2 );\r\n\r\n\t\t\tregister_deactivation_hook( $this->pluginFile , array( $this , 'clear_plugin_update_data' ) );\r\n\r\n }",
"function santo_flickr_gallery_shortcode_exist() {\r\n\t\tadd_action( 'wp_footer', 'santo_flickr_js',100 );\r\n\t\tadd_action( 'wp_enqueue_scripts', 'santo_flickr_scripting' );\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is this user a developer? | public function isdeveloper()
{
return is_object($this->hasrole('Site', 'Developer'));
} | [
"function is_developer() {\n\t// Check if user is logged in\n\tif ( ! is_user_logged_in() ) {\n\t\treturn false;\n\t}\n\t// Approved developer\n\t$approved = array(\n\t\t'iamnickdavis',\n\t\t'nick',\n\t);\n\t// Get the current user\n\t$current_user = wp_get_current_user();\n\t$current_user = strtolower( $current_user->user_login );\n\n\t// Check if current user is approved developer\n\treturn in_array( $current_user, $approved );\n}",
"public function isDeveloper()\n {\n return ($this->get('user_type') == 'developer');\n }",
"public function developer()\n {\n return $this->authUser() && $this->authUser()->isDeveloper();\n }",
"public function isDeveloper( ) {\n $developer_exist = $this->developer;\n if ( !is_null( $developer_exist ) && is_object( $developer_exist ) ) {\n return TRUE;\n }\n \n return FALSE;\n }",
"public function isDeveloper()\n {\n return in_array(Role::DEVELOPER, $this->roles()->lists('id')->all());\n }",
"abstract function is_developer();",
"public function isContentDeveloper()\n\t{\n\t\treturn ($this->hasRole('contentdeveloper'));\n\t}",
"public function getIsDeveloper() : bool\n {\n return $this->isDeveloper;\n }",
"public function isUser()\n {\n return ($this->getType() == 'user');\n }",
"public function isUser()\n\t{\n\t\treturn $this->getType() == self::TYPE_USER;\n\t}",
"public function isUserAuthor()\n {\n\t return Yii::$app->user->identity->id === $this->getUserAuthor();\n }",
"private function isDeveloper(Game $game, User $user)\n {\n foreach ($game->developmentStudio()->get() as $studio)\n {\n if ($studio->users()->get()->contains($user))\n {\n return true;\n }\n }\n return false;\n }",
"public function isUserAssignable(): bool;",
"public function isUser()\n {\n if($this->getRole() == NULL) return False;\n return $this->getRole() == \"user\";\n }",
"public static function isDeveloper()\n\t{\n\t\tif(!is_null(self::$bIsDeveloper)) {\n\t\t\treturn self::$bIsDeveloper;\n\t\t}\n\n\t\treturn self::$bIsDeveloper = in_array(self::getClientIP(), _Config::get(array('developer', 'ips')));\n\t}",
"public function hasUserInformation () {\n\t\treturn $this->getUser() && $this->getUser()->getEmail();\n\t}",
"public function isUser()\n\t{\n\t\treturn $this->role()->where('type', 'User')->exists();\n\t}",
"public function getIsAuthor()\r {\r $createdByAttribute = $this->createdByAttribute;\r if ($createdByAttribute === false) {\r return false;\r }\r return Yii::$app->user->identity->id === $this->user_id;\r }",
"public function isVendorUser()\n {\n return isset($this->auth['user_type']) && $this->auth['user_type'] == 'V';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ function to delete recorrido | function delete_recorrido($recorrido_id)
{
return $this->db->delete('recorrido',array('recorrido_id'=>$recorrido_id));
} | [
"public function deleteRecargas()\n {\n $recargas = $this->getRecargas();\n if (count($recargas)) {\n // Si tengo vieja las vuelo e inserto las nuevas\n $recargas[0]->delete([$this->primkeys[0] => $this->getIdPED()]);\n }\n }",
"public function deleteIrRemout(){\n }",
"function delete_rso($rsoName) {\n // TODO delete rso\n refresh();\n}",
"static public function ctrBorrarPropietario(){\n\t\tif (isset($_POST['idPropietario'])) {\n\t\t\tif ($_POST['fotoPropietario'] != \"\") {\n\t\t\t\tunlink($_POST[\"fotoPropietario\"]);\n\t\t\t\trmdir('Views/img/propietarios/'.$_POST['propietario']);\n\t\t\t}\n\t\t$answer=adminph\\Propietary::find($_POST['idPropietario']);\n\t\t$answer->delete();\n\t\t}\n\t}",
"public function delete($concepto_cumplimiento);",
"function borrar_opciones(){\n $tuplas = $this->references(\"opcion\");\n foreach($tuplas as $valor){\n $eliminar=$this->Connection->DB->get_object_by_id(\"opcion\", $valor->id_opcion);\n $eliminar->delete();\n }\n }",
"public function eliminaRecurso(){\n\t//carga la base de datos\n\t$this->load->database();\n\t//ejecuta la elminación\n\t$this->db->delete('RECURSOS', array('ID' => $_POST[1])); \n\t}",
"function eliminar_recepcion($iddeta,$tipo_r,$nro_r)\n{\n\t\t$sql = 'select id from recepciones where tipo_recepcion=\"'.$tipo_r.'\" and numero=\"'.$nro_r.'\" and id_detalle_pedido='.$iddeta;\n\t\t\n\t\t\n $query = $this->db->query($sql);\n $codigo=$query->row();\n\t\tif ($query->num_rows() > 0)\n\t\t{\t\n\t\t//borro la recepcion\n\t\t$sql = 'delete from recepciones where id= \"'. $codigo->id.'\"';\n\t\t$consulta=$this->db->query($sql);\n\t\t\t\n\t\t}\n\t$a= $codigo->id;\n}",
"function delete_Anexo_detalle_reunion($con, $idanexo)\n{\n $sql = \"DELETE FROM public.anexos_detalle_reunion\n WHERE idanexos_detalle_reunion = $idanexo;\";\n return executeQueryInsert($con, $sql);\n}",
"static public function ctrBorrarUnidad(){\n\t\tif (isset($_POST['idUnidad'])) {\n\t\t$answer=adminph\\Organization::find($_POST['idUnidad']);\n\t\t\tif ($_POST['fotoUnidad'] != \"\") {\n\t\t\t\tunlink($_POST[\"fotoUnidad\"]);\n\t\t\t\tunlink($answer->logo2);\n\t\t\t\trmdir('Views/img/organizaciones/'.$_POST['codigoUnidad']);\n\t\t\t}\n\t\t$answer->delete();\n\t\t}\n\t}",
"function eliminarRelacionProceso(){\n $this->objFunc=$this->create('MODObligacionPago');\n $this->res=$this->objFunc->eliminarRelacionProceso($this->objParam);\n $this->res->imprimirRespuesta($this->res->generarJson());\n }",
"public function remover() {\n\n $oDaoOrcamItemJulg = new cl_pcorcamjulg;\n $oDaoOrcamVal = new cl_pcorcamval();\n $oDaoOrcamDescla = new cl_pcorcamdescla();\n $oDaoOrcamItem = new cl_pcorcamitem();\n $oDaoOrcamento = new cl_pcorcam();\n switch ($this->getTipoOrcamento()) {\n\n case OrcamentoCompra::TIPO_ORCAMENTO_LICITACAO:\n\n $oDaoItem = new cl_pcorcamitemlic();\n break;\n\n case OrcamentoCompra::TIPO_ORCAMENTO_SOLICITACAO:\n\n $oDaoItem = new cl_pcorcamitemsol();\n break;\n\n case OrcamentoCompra::TIPO_ORCAMENTO_PROCESSO:\n\n $oDaoItem = new cl_pcorcamitemproc();\n break;\n }\n\n foreach ($this->getItens() as $oItem) {\n\n $oDaoOrcamItemJulg->excluir($oItem->getCodigo());\n if ($oDaoOrcamItemJulg->erro_status == 0) {\n throw new BusinessException(_M(self::ARQUIVO_MENSAGEM . \"erro_exclusao_itens_julgamento\"));\n }\n\n $oDaoOrcamVal->excluir(null, $oItem->getCodigo());\n if ($oDaoOrcamVal->erro_status == 0) {\n throw new BusinessException(_M(self::ARQUIVO_MENSAGEM . \"erro_exclusao_valor_fornecedores\"));\n }\n\n $oDaoOrcamDescla->excluir($oItem->getCodigo());\n if ($oDaoOrcamDescla->erro_status == 0) {\n throw new BusinessException(_M(self::ARQUIVO_MENSAGEM . \"erro_exclusao_fornecedores_desclassificados\"));\n }\n\n $oDaoOrcamDescla->excluir($oItem->getCodigo());\n if ($oDaoOrcamDescla->erro_status == 0) {\n throw new BusinessException(_M(self::ARQUIVO_MENSAGEM . \"erro_exclusao_fornecedores_desclassificados\"));\n }\n\n $oDaoItem->excluir($oItem->getCodigo());\n if ($oDaoItem->erro_status == 0) {\n throw new BusinessException(_M(self::ARQUIVO_MENSAGEM . \"erro_exclusao_item\"));\n }\n\n $oDaoOrcamItem->excluir($oItem->getCodigo());\n if ($oDaoOrcamItem->erro_status == 0) {\n throw new BusinessException(_M(self::ARQUIVO_MENSAGEM . \"erro_exclusao_item\"));\n }\n\n }\n\n $oDaoOrcamForne = new cl_pcorcamforne();\n $oDaoOrcamForne->excluir(null, \"pc21_codorc = {$this->getCodigo()}\");\n if ($oDaoOrcamForne->erro_status == 0) {\n throw new BusinessException(_M(self::ARQUIVO_MENSAGEM . \"erro_exclusao_fornecedores\"));\n }\n\n $oDaoOrcamento->excluir($this->getCodigo());\n if ($oDaoOrcamento->erro_status == 0) {\n throw new BusinessException(_M(self::ARQUIVO_MENSAGEM . \"erro_exclusao_orcamento\"));\n }\n }",
"public function EliminarRecursoAction() {\n\t\t$route = $this->getRequest ()->getPost ( 'route', null );\n\t\t$idRecurso = $this->getEvent ()->getRouteMatch ()->getParam ( 'id' );\n\t\tif ($idRecurso [0] == 'A') {\n\t\t\t$idRecursoUrl = ltrim ( $idRecurso, 'A' );\n\t\t} \n\t\telse {\n\t\t\t$idRecursoUrl = ltrim ( $idRecurso, 'D' );\n\t\t}\n\t\t$verificahijos = $this->verificarHijos ( $idRecursoUrl );\n\t\t$recurso = $this->entityManager->getRepository ( Recurso::class )->findBy ( array ('idRecurso' => $idRecursoUrl) );\n\t\t$tipoDirectorio = $recurso [0]->getTipoDirectorio ();\n\t\t$tipoRecurso = $recurso [0]->getTipoRecurso ();\n\t\tif ($tipoRecurso == 'D') {\n\t\t\tif ($tipoDirectorio == 'H') {\n\t\t\t\tif ($verificahijos [0] != null) {\n\t\t\t\t\t$idP2 = $this->ObtenerIdPadre ( $idRecursoUrl );\n\t\t\t\t\t$idP3 = $this->ObtenerIdPadre ( $idP2 );\n\t\t\t\t\t$idPadre = $this->ObtenerIdPadre ( $idP3 );\n\t\t\t\t} else {\n\t\t\t\t\t$idP2 = $this->ObtenerIdPadre ( $idRecursoUrl );\n\t\t\t\t\t$idPadre = $this->ObtenerIdPadre ( $idP2 );\n\t\t\t\t}\n\t\t\t} \n\t\t\telse {\n\t\t\t\t$idPadre = $this->ObtenerIdPadre ( $idRecursoUrl );\n\t\t\t}\n\t\t} else {\n\t\t\t$idP2 = $this->ObtenerIdPadre ( $idRecursoUrl );\n\t\t\t$recurso2 = $this->entityManager->getRepository ( Recurso::class )->findBy ( array ('idRecurso' => $idP2) );\n\t\t\t$tipoDirectorio2 = $recurso2 [0]->getTipoDirectorio ();\n\t\t\tif ($tipoDirectorio2 == 'H') {\n\t\t\t\t$idP3 = $this->ObtenerIdPadre ( $idP2 );\n\t\t\t\t$idPadre = $this->ObtenerIdPadre ( $idP3 );\n\t\t\t} else {\n\t\t\t\t$idPadre = $this->ObtenerIdPadre ( $idP2 );\n\t\t\t}\n\t\t}\n\t\t$valida = $this->ValidarPermisosEditar ( $idPadre );\n\t\tif ($valida == true) {\n\t\t\tif ($idRecurso [0] == 'A') {\n\t\t\t\t$idRecurso = ltrim ( $idRecurso, 'A' );\n\t\t\t\t$idPadre = $this->ObtenerIdPadre ( $idRecurso );\n\t\t\t\t$nombreRecurso = $this->BuscarRecursoporId ( $idRecurso );\n\t\t\t\t$ruta = 'public/upload/' . $this->CrearRuta ( $idPadre ) . $nombreRecurso;\n\t\t\t\tdate_default_timezone_set(\"America/Lima\");\n\t\t\t\t$fecha = date(\"Y-m-d H:i:s\");\n\t\t\t\t$timestamp = strtotime($fecha);\n\t\t\t\t$rutapapelera = 'public/upload/papelera/'.$timestamp.'_'.$nombreRecurso;\n\t\t\t\tif(!copy($ruta,$rutapapelera)){\n\t\t\t\t\techo \"Error al pasar a la papelera\";\n\t\t\t\t}\n\t\t\t\tif (! unlink ( $ruta )) {\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\techo (\"Archivo borrado : $nombreRecurso\");\n\t\t\t\t\t$this->AgregarRecursoPapelera($nombreRecurso,$ruta,$rutapapelera);\n\t\t\t\t\t$this->EliminarRecurso ( $idRecurso );\n\t\t\t\t\t$this->agregarAuditoria($idRecurso, 'Eliminación');\n\t\t\t\t\treturn $this->response;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$idRecurso = ltrim ( $idRecurso, 'D' );\n\t\t\t\t$idPadre = $this->ObtenerIdPadre ( $idRecurso );\n\t\t\t\t$nombreRecurso = $this->BuscarRecursoporId ( $idRecurso );\n\t\t\t\t$nombreRecurso = rtrim ( $nombreRecurso, \".\" );\n\t\t\t\t$ruta = 'public/upload/' . $this->CrearRuta ( $idPadre ) . $nombreRecurso;\n\t\t\t\t$this->DeleteAllFiles ( $ruta ); // Borro archivos dentro de la carpeta\n\t\t\t\t$this->EliminarRecursosDirectorio ( $idRecurso ); // Elimino datos en la base de datos de los archivos\n\t\t\t\t$this->EliminarRecurso ( $idRecurso ); // por ultimo elimino la carpeta en la base de datos\n\t\t\t\t$this->agregarAuditoria($idRecurso, 'Eliminación');\n\t\t\t}\n\t\t\treturn $this->response;\n\t\t} else {\n\t\t\t$this->getResponse ()->setStatusCode ( 404 ); // SI NO TIENE PERMISOS DE ELIMINAR\n\t\t\treturn $this->response;\n\t\t}\n\t}",
"public function borrarPregunta(){\n \t$queryForDelete = array(\"_id\"=>new MongoId($this->id));\n \treturn $this->bbdd->eliminar($queryForDelete);\n }",
"function deletePreDetalle(){\n $sql='DELETE FROM predetalle WHERE idCliente = ?';\n $params=array($this->cliente);\n return Database::executeRow($sql, $params);\n }",
"function cot_rezume_delete($id, $rrez = array())\n{\n\tglobal $db, $db_rezume, $db_structure, $cache, $cfg, $cot_extrafields, $structure, $L;\n\tif (!is_numeric($id) || $id <= 0)\n\t{\n\t\treturn false;\n\t}\n\t$id = (int)$id;\n\tif (count($rrez) == 0)\n\t{\n\t\t$rrez = $db->query(\"SELECT * FROM $db_rezume WHERE rez_id = ?\", $id)->fetch();\n\t\tif (!$rrez)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif ($rrez['rez_state'] == 0)\n\t{\n\t\t$db->query(\"UPDATE $db_structure SET structure_count=structure_count-1 WHERE structure_area='rezume' AND structure_code = ?\", $rrez['rez_cat']);\n\t}\n\n\tforeach ($cot_extrafields[$db_rezume] as $exfld)\n\t{\n\t\tcot_extrafield_unlinkfiles($rrez['rez_' . $exfld['field_name']], $exfld);\n\t}\n\n\t$db->delete($db_rezume, \"rez_id = ?\", $id);\n\tcot_log(\"Deleted rezume #\" . $id, 'adm');\n\n\t/* === Hook === */\n\tforeach (cot_getextplugins('rezume.edit.delete.done') as $pl)\n\t{\n\t\tinclude $pl;\n\t}\n\t/* ===== */\n\n\tif ($cache)\n\t{\n\t\tif ($cfg['cache_rezume'])\n\t\t{\n\t\t\t$cache->rezume->clear('rezume/' . str_replace('.', '/', $structure['rezume'][$rrez['rez_cat']]['path']));\n\t\t}\n\t\tif ($cfg['cache_index'])\n\t\t{\n\t\t\t$cache->rezume->clear('index');\n\t\t}\n\t}\n\n\treturn true;\n}",
"public function delrub() {\n\n $id = $this->uri->segment(4); // Dato\n $rub = $this->uri->segment(3); // Rubro\n\n\n if ($id != 0) {\n\n // Poner alerta\n\n $rubro = ORM::factory('datos_rubro')\n ->where(array('dato_id' => $id, 'rubro_id' => $rub))\n ->find();\n\n //echo kohana::debug($rubro);\n\n if ($rubro) {\n $rubro->delete();\n }\n if (isset($_SESSION['urledit'])) {\n url::redirect($_SESSION['urledit']);\n } else {\n url::redirect($_SESSION['request']);\n }\n }\n }",
"public function delete($costo);",
"function delPromo_a($auth,$r){\n// Vista: /promosAdmin/gestion.php\n// Controlador: /promosAdmin/js/controller.promosAdmin.js\n//---------------------------------------------\n// Autenticacion: Requerida como Administrador\n// Objetivo: Eliminar promociones\n\n $cdgo = $r->id_code; //Nombre del codigo promocional recibido en la solicitud\n\n //Se elimina de la base de datos el codigo solicitado\n $cmd = \"DELETE FROM promocodes WHERE cdgo = '$cdgo'\";\n $code = executeSQL($cmd);\n\n if ($code === response_ok) {\n //Se elimina listado de clientes enlazados a la promocion eliminada\n $cmd = \"DELETE FROM assignm WHERE id_code = '$cdgo'\";\n $code = executeSQL($cmd);\n }\n\n $response = array();\n SendResponse($code,$response); //Se envia respuesta del servidor\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Encodes the current record header (and body if needed) and sends the record to the active FCGI process. This could be optimized by sending header, body and padding separately, but the overhead for most requests seems minimal enough. | public function write()
{
if ($this->type == MFCGI::BEGIN_REQUEST) {
// Encode the Begin Request record body
$this->content = chr(0).chr($this->role);
$this->content .= chr($this->flags);
$this->content .= str_repeat(chr(0), 5); // reserved
$this->length = 8;
} elseif ($this->type == MFCGI::PARAMS || $this->type == MFCGI::STDIN) {
$this->length = strlen($this->content);
} else {
$this->length = 0;
$this->content = '';
}
// Calculate any padding
$this->padding = (8 - ($this->length % 8)) % 8;
// Build the header
$record = chr($this->version)
.chr($this->type)
.chr(($this->requestID >> 8) & 0xFF)
.chr($this->requestID & 0xFF)
.chr(($this->length >> 8) & 0xFF)
.chr($this->length & 0xFF)
.chr($this->padding)
.chr(0) // reserved
;
// Add the body content with any padding
if ($this->content != '') {
$record .= $this->content;
if ($this->padding) {
$record .= str_repeat(chr(0), $this->padding);
}
}
// Send the record and clear any current content
if (($sent = @fwrite($this->socket, $record)) === false) {return false;}
if ($this->debug) {cecho("--> Sent record ({$this->requestID}:{$this->type}:{$sent}/{$this->length})\n");}
$this->content = '';
return true;
} | [
"function _store_header() {\n $record = 0x0014; // Record identifier\n\n $str = $this->_header; // header string\n $cch = strlen($str); // Length of header string\n $length = 1 + $cch; // Bytes to follow\n\n $header = pack(\"vv\", $record, $length);\n $data = pack(\"C\", $cch);\n\n $this->_append($header . $data . $str);\n }",
"function _store_print_headers()\n {\n $record = 0x002a; // Record identifier\n $length = 0x0002; // Bytes to follow\n \n $fPrintRwCol = $this->_print_headers; // Boolean flag\n \n $header = pack(\"vv\", $record, $length);\n $data = pack(\"v\", $fPrintRwCol);\n $this->_prepend($header.$data);\n }",
"protected function _storePrintHeaders()\n {\n $record = 0x002a; // Record identifier\n $length = 0x0002; // Bytes to follow\n\n $fPrintRwCol = $this->_print_headers; // Boolean flag\n\n $header = \\pack('vv', $record, $length);\n $data = \\pack('v', $fPrintRwCol);\n $this->_prepend($header . $data);\n }",
"protected abstract function writeHeader();",
"public function writeHeader();",
"public function send(){\n if($this->sent){\n return;\n }\n \n $header = count($this->value) === 0 ? $this->header : $this->header.\": \".join(\",\", array_keys($this->value));\n header($header, $this->erase);\n \n $this->sent = true;\n }",
"protected function sendRecord (Record $record)\n {\n \\fwrite($this->socket, (string) $record, \\count($record));\n }",
"public function flushHeader() {\r\r\n $buffers = array();\r\r\n\r\r\n\r\r\n try {\r\r\n if (function_exists('ob_list_handlers')) {\r\r\n $buffers = @ob_list_handlers();\r\r\n\r\r\n if (sizeof($buffers) > 0) {\r\r\n if (is_string($buffers[sizeof($buffers) - 1])) {\r\r\n if (strtolower($buffers[sizeof($buffers) - 1]) == strtolower(get_class($this) . '::getBuffer')) {\r\r\n @ob_end_flush();\r\r\n $buffers = @ob_list_handlers();\r\r\n }\r\r\n }\r\r\n }\r\r\n }\r\r\n } catch (Exception $ex) {\r\r\n //error\r\r\n }\r\r\n }",
"private function writeHeader() {\n $this->write($this->header);\n }",
"public function _sendHeaders(): void {\n\t\tManager::getInstance()->getHeader()->sendHeaders();\n\t}",
"function _storeCodepage()\n {\n $record = 0x0042; // Record identifier\n $length = 0x0002; // Number of bytes to follow\n $cv = $this->_codepage; // The code page\n\n $header = pack('vv', $record, $length);\n $data = pack('v', $cv);\n\n $this->_append($header . $data);\n }",
"private function writeHeaders()\n {\n if ($this->protocol == 'mail')\n {\n $this->subject = $this->headers['Subject'];\n unset($this->headers['Subject']);\n }\n\n $this->setHeader('X-Sender', $this->headers['From']);\n $this->setHeader('X-Mailer', $this->useragent);\n $this->setHeader('X-Priority', $this->priorities[$this->priority - 1]);\n $this->setHeader('Mime-Version', '1.0');\n $this->headerStr = \"\";\n\n foreach ($this->headers as $key => $val)\n {\n $val = trim($val);\n\n if ($val != \"\")\n {\n $this->headerStr .= $key.\": \".$val.$this->newline;\n }\n }\n\n if ($this->protocol == 'mail')\n {\n $this->headerStr = rtrim($this->headerStr);\n }\n }",
"private function addHeaderRecord() {\n // Record Type\n $line = self::HEADER_RECORD;\n\n // File name, must be blank\n $line .= str_repeat(' ', 20);\n\n //Number of messages\n $line .= str_pad($this->numberRecords, 3, '0', STR_PAD_LEFT);\n\n $this->addLine($line);\n }",
"public function flushHeader() {\r\n $buffers = array();\r\n if (function_exists('ob_list_handlers'))\r\n $buffers = @ob_list_handlers();\r\n\r\n if (sizeof($buffers) > 0 && strtolower($buffers[sizeof($buffers) - 1]) == strtolower('Model_SQ_Frontend::getBuffer')) {\r\n @ob_end_flush();\r\n }\r\n }",
"public function send() {\r\n\t\t\r\n\t\tforeach ($this->_Headers as $header_name => $header)\r\n\t\t{\r\n\t\t\t//TODO make this more readable..\r\n\t\t\theader($header[0],$header[1]);\r\n\t\t}\r\n\t\techo $this->_Content;\r\n\t\tob_end_flush();\r\n\t}",
"public function prepareHeaders()\n {\n // set current date before render it\n $this->addHeader(HttpProtocol::HEADER_DATE, gmdate(DATE_RFC822));\n\n // render content length to header\n $this->addHeader(HttpProtocol::HEADER_CONTENT_LENGTH, $this->getContentLength());\n }",
"private function _writeHeader()\n {\n // Identifier.\n fwrite($this->_targetHandle, \"ID3\");\n\n // Version.\n fwrite($this->_targetHandle, $this->_tagWriter->getVersion());\n\n // Flags.\n fwrite($this->_targetHandle, \"\\x00\");\n\n // Tag-Size.\n $sizeSynchSafe = Helpers::addSynchSafeBits($this->_tagSize);\n fwrite($this->_targetHandle, $sizeSynchSafe);\n }",
"public function flush() {\n header($this->_name.': '.$this->_value);\n }",
"protected function _storeCodepage()\n {\n $record = 0x0042; // Record identifier\n $length = 0x0002; // Number of bytes to follow\n $cv = $this->_codepage; // The code page\n\n $header = \\pack('vv', $record, $length);\n $data = \\pack('v', $cv);\n\n $this->_append($header . $data);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of star | public function getStar()
{
return $this->star;
} | [
"public function getRcodeStar()\n {\n return $this->rcode_star;\n }",
"public function getstars()\n {\n return $this->stars;\n }",
"public function getFullStar()\n {\n return $this->fullStar;\n }",
"public function getStar2()\n {\n return $this->star2;\n }",
"public function getStar5()\n {\n return $this->star5;\n }",
"public function getStarCount()\n {\n return $this->star_count;\n }",
"public function getStar4()\n {\n return $this->star4;\n }",
"public function getFeedbackRatingStar()\n {\n return $this->feedbackRatingStar;\n }",
"public function get_stars() {\n $stars = [];\n for ($i=0; $i < floor($this->average_rating); $i++) { \n $stars[] = '<i class=\"fal fa-star\"></i>';\n }\n if ($this->average_rating > 0 && is_float(floatval($this->average_rating)) && floor($this->average_rating) < $this->average_rating) {\n $stars[] = '<i class=\"fal fa-star-half\"></i>';\n }\n // return data\n return $stars = implode('',$stars);\n }",
"public function getRatingValue();",
"function printStar($avgStar){\n $num_star = 0;\n $star_html = \"\";\n while($num_star < floor($avgStar)){\n $star_html .= \"<i class='fas fa-star color-yellow'></i>\";\n $num_star++;\n }\n //add half star\n if($avgStar - $num_star > 0){\n $star_html.= \"<i class='fas fa-star-half-alt color-yellow'></i>\";\n $num_star++;\n }\n $num_no_star = 0;\n while($num_no_star < 5 - $num_star){\n $star_html.= \"<i class='far fa-star color-yellow'></i>\";\n $num_no_star++;\n }\n $star_html .= \" \";\n return $star_html;\n }",
"public function setStar($var)\n {\n GPBUtil::checkInt32($var);\n $this->Star = $var;\n\n return $this;\n }",
"public function getStarColor()\n {\n return $this->getConfig('rating_star_color', 'product');\n }",
"function calc_stars_from_rating($rating) {\n return $rating / 5 * 80;\n}",
"public function rating_value_to_star( $rating ) {\n\t\tif ( $rating < 1 || $rating > 5 ) {\n\t\t\treturn;\n\t\t}\n\t\t$int = intval( $rating );\n\t\t$blank = 5 - $int;\n\t\t$html = str_repeat( $this->star( '#d56e0c' ), $int );\n\t\tif ( is_float( $rating ) ) {\n\t\t\t$html .= $this->star( '#d56e0c', 0.5 );\n\t\t\t$blank--;\n\t\t}\n\t\tif ( $blank > 0 ) {\n\t\t\t$html .= str_repeat( $this->star(), $blank );\n\t\t}\n\t\treturn $html;\n\t}",
"public function renderStar( $num ){\n\t\t$pos = strpos($num, '.');\n\t\tif ($pos === false) {\n\t\t\t$star = $num;\n\t\t\t$half_star = 0;\n\t\t} else{\n\t\t\t$star = intval($num);\n\t\t\t$half_star = 1;\n\t\t}\n\t\t$star_string = '';\n\t\tfor($i=0; $i<$star; $i++){\n\t\t\t$star_string .= '<img src=\"'.$this->webroot.'/front_end/raty/img/star-on.png\" />';\n\t\t}\n\t\tif( $half_star > 0 ){\n\t\t\t$star_string .= '<img src=\"'.$this->webroot.'/front_end/raty/img/star-half.png\" />';\n\t\t}\n\t\treturn $star_string;\n\t}",
"function get_star_icon($star){\r\n\tglobal $option;\r\n\tif ($star == 4){$alt = Blickfeld;}\r\n\tif ($star == 3){$alt = WeitererKreis;}\r\n\tif ($star == 2){$alt = InternationaleKlasse;}\r\n\tif ($star == 1){$alt = Weltklasse;}\r\n\tif (file_exists($option['ulidirroot'].'/theme/graphics/icons/star'.$star.'.png')){\r\n\t\t$html = '<img src = \"'.$option['uliroot'].'/theme/graphics/icons/star'.$star.'.png\" title=\"'.$alt.'\" alt=\"'.$alt.'\">';\r\n\t}\r\n\tif ($html){return $html;}\r\n\telse {return FALSE;}\r\n}",
"function _show_rate_stars ($CUR_RATE = 0) {\n\t\t// Prepare stars\n\t\tfor ($i = 0; $i < $this->NUM_STARS; $i++) {\n\t\t\t$cur_img_name = \"off\";\n\t\t\tif (($i + 1) <= $CUR_RATE) {\n\t\t\t\t$cur_img_name = \"on\";\n\t\t\t} elseif ($CUR_RATE >= ($i + 0.5)) {\n\t\t\t\t$cur_img_name = \"half\";\n\t\t\t}\n\t\t\t$STARS_ARRAY[] = array(\n\t\t\t\t\"number\"\t\t=> $i + 1,\n\t\t\t\t\"cur_image\"\t\t=> \"rating_\".$cur_img_name,\n\t\t\t\t\"insert_half\"\t=> $cur_img_name == \"half\" ? ($i + 1) : 0,\n\t\t\t);\n\t\t}\n\t\treturn $STARS_ARRAY;\n\t}",
"protected function getStars(): string\n {\n $length = strlen((string) $this->attributes['contributions']);\n\n return str_repeat(self::STAR, $length);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an array of strings, strip out mentions of specific words provided | public function removeProvidedWords($arrayOfStrings, $wordsToDrop)
{
$array = explode(",", str_replace($wordsToDrop, "", implode(",", $arrayOfStrings)));
$array = array_map(array($this, 'basicClean'), $array);
return $array;
} | [
"function remove_words($input, $replace, $words_array = array(), $unique_words = true) {\r\n //separate all words based on spaces\r\n $input_array = explode(' ', $input);\r\n\r\n //create the return array\r\n $return = array();\r\n\r\n //loops through words, remove bad words, keep good ones\r\n foreach ($input_array as $word) {\r\n //if it's a word we should add...\r\n if (!in_array($word, $words_array) && ($unique_words ? !in_array($word, $return) : true)) {\r\n $return[] = $word;\r\n }\r\n }\r\n\r\n //return good words separated by dashes\r\n return implode($replace, $return);\r\n}",
"function excludecommonwords($array,$commonwords) {\n for ($i=0;$i<sizeof($array);$i++) if (array_search($array[$i],$commonwords)!=false) $array[$i]='';\n return $array;\n}",
"public function removeNoise(array $words);",
"function _strip_junk_words($words)\n\t{\n\t\t$bad=array('the','of','to','and','a','in','is','it','you','that','he','was','for','on','are',\n\t\t\t'with','as','I','his','they','be','at','this','or','had','by','but','what','some','we','can',\n\t\t\t'out','other','were','all','there','when','your','how','an','which','do','so','these','has','go',\n\t\t\t'come','did','no','my','where','me','our','thing','site','website');\n\t\t$_words=array();\n\t\tforeach ($words as $i=>$b)\n\t\t{\n\t\t\tif (!in_array($b,$bad))\n\t\t\t{\n\t\t\t\tif ((($b!='chat') || (!array_key_exists($i+1,$words)) || (($words[$i+1]!='room') && ($words[$i+1]!='rooms'))) && (($b!='user') || (!array_key_exists($i+1,$words)) || (($words[$i+1]!='group') && ($words[$i+1]!='groups'))))\n\t\t\t\t\t$_words[]=$b;\n\t\t\t\telse // Special case of compound terms that are actually single words in ocPortal; fix the word, and also stop ridiculous amounts of spurious result\n\t\t\t\t\t$words[$i+1]=$b.$words[$i+1];\n\t\t\t}\n\t\t}\n\t\treturn $_words;\n\t}",
"static function clean_dirty_words($message) {\n\t\t$words = \"shit, piss, fuck, cunt, cock, fuk, sucker, mother, fucker, tits, turd, twat, nigger, nigro, beaner, spic, gooback, sandmonkey, homo, ligpa, likpa, kyakpa, kyagpa\";\n\n\t\t$badwords = array();\n\t\t$badwords = explode(\",\", $words);\n\t\t$message = explode(\" \", $message);\n\n\t\tforeach($message as $key=>$word) {\n\n\t\t\tforeach($badwords as $bad) {\n\n\t\t\t\tif ( trim(strtolower($bad)) === trim(strtolower($word))) {\n\t\t\t\t\t$word = '!@#$';\n\t\t\t\t\tbreak;\n\t\t\t\t} \n\t\t\t}\n\t\t\t$array[\"$key\"] = $word;\n\t\t}\n\t\treturn $array;\n\t}",
"public function remove(string ...$tokens);",
"function removeCommonWords($str){\n\t// call by reference (actually changes the variable)\n\t$remove = array (\n\t\t'at',\n\t\t'the',\n\t\t'and',\n\t\t'of',\n\t\t'in',\n\t\t'with',\n\t\t'&');\n\tfor ($x = 0; $x < count($remove); $x++) {\n\t\t$str = preg_replace('/\\b' . $remove[$x] .'\\b/i', '', $str);\n\t}\n\n\treturn($str);\n}",
"function remove_ignored_keywords_from_array($keywords_array)\n\t{\n\t\t//Load all short search terms we wish to ignore\n\t\t$path_and_filename = SITE_ROOT_DIR . '/config/ignored_search_terms.txt';\n\t\tif(!file_exists($path_and_filename))\n\t\t{\n\t\t\ttrigger_error('ignored search terms config file is missing',E_USER_WARNING);\n\t\t\treturn $keywords_array;\n\t\t}\n\t\t\t\n\t\t$ignored_search_terms = file_get_contents($path_and_filename);\n\t\t$ignored_search_terms_as_array = explode(',',$ignored_search_terms);\n\n\t\t//Remove ignored search terms\n\t\t$clean_keywords = array_diff($keywords_array,$ignored_search_terms_as_array);\n\t\n\t\t//Remove short keywords < 2 chars\n\t\t$long_keywords = array_filter($clean_keywords,create_function('$keyword','return strlen($keyword) > 2;'));\n\t\t$nice_keywords = array_filter($long_keywords,create_function('$keyword','return strlen($keyword) < 15;'));\n\t\t\n\t\treturn $nice_keywords;\t\t\t\n\t}",
"public static function remove_words($words) {\n $words = is_array($words) ? $words : array($words);\n self::$remove_list = array_merge(self::$remove_list, $words);\n }",
"public static function remove_words ($words)\n {\n\t\t$words = is_array ($words) ? $words : array ($words);\n\t\tself::$remove_list = array_merge (self::$remove_list, $words);\n\t}",
"function clean_array_string_contain($array, $crap){\n\t\t//Requires string_contain()\n\t\tfor ($i = 0; $i < count($array); $i++) {\n\t\t\tif(string_contain($array[$i], $crap)) {\n\t\t\t\tarray_splice($array, $i, 1);\n\t\t\t\t$i--;\n\t\t\t}\n\t\t}\n\t\treturn $array;\n\t}",
"function string_contains_all_words( $string, $array ) {\n\t$missed = false;\n\n\tforeach ( $array as $word ) {\n\t\tif ( strpos( $string, $word ) !== false ) {\n\t\t\tcontinue;\n\t\t} else {\n\t\t\t$missed = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn ! $missed;\n}",
"function wordfilter($checkstr,$output){\n\n/////////////////////////////////// Regaular Cleaning\n\n$iarray = explode(\",\",$checkstr) ;\n\nforeach($iarray as $i){\n\n$output = eregi_replace(trim($i),' ***** ',$output) ;\n\n}\n/////////////////////////////////////////////////////\n\n////////////////////////////////////// Phonetic Filter\n\n\nforeach($iarray as $i){\n//---------------------------------------------------------------- 1\n$checkz = explode(\" \",$output) ;\n\nforeach($checkz as $c){\n//---------------------------------------------------------------- 2\n\nif(metaphone(trim($c))== metaphone(trim($i))){\n\n$output = eregi_replace($c,' ***** ',$output) ;\n\n}\n\n//---------------------------------------------------------------- 2\n\n}\n//---------------------------------------------------------------- 1\n\n}\n\n//////////////////////////////////////////////////////\nreturn $output ;\n\n}",
"private static function badword_filter() {\n if(empty(self::$words) || !is_array(self::$words)) {\n self::$words = trim(settings::get('badwords', true));\n if(empty(self::$words)) return;\n self::$words = explode(\",\",self::$words);\n }\n\n if(count(self::$words) >= 1) {\n foreach(self::$words as $word) {\n self::$string = preg_replace_callback(\"#\".$word.\"#i\",\n create_function('$matches','return str_repeat(\"*\", strlen($matches[0]));'),self::$string);\n } unset($word);\n }\n }",
"function remove_empty2(&$str_arr){\r\n foreach($str_arr as $index => $word){\r\n if(!$word)\r\n unset($str_arr[$index]);\r\n }\r\n}",
"function remove_stop_words($input) {\n\t/*\n\t$commonWords = array('a', 'as', 'à', 'às', 'o', 'os', 'ao', 'aos', 'da', 'de',\n\t\t\t\t\t\t 'do', 'das', 'dos', 'para', 'em', 'e', 'é', 'um', 'com');\n\t*/\n\t\n $commonWords = array('a', 'as', 'à', 'À', 'às', 'Às', 'o', 'os', 'ao', 'aos', 'da', 'de', \n \t\t\t\t\t 'do', 'das', 'dos', 'para', 'em', 'e', 'é', 'É', 'um', 'com');\n \n /*\n * This line of code below doesn't work properly: i.e. Durão returns Durã\n * $output = preg_replace('/\\b('.implode('|',$commonWords).')\\b/ui', '', $input);\n */\n \n $output = explode(' ', $input);\n \n foreach ($output as $key => $word) {\n \tif (in_array(strtolower($word), $commonWords)) {\n \t\t$output[$key] = '';\n \t}\n }\n \n $output = implode(' ', $output);\n $output = remove_extra_spaces($output);\n return $output;\n}",
"protected function _scrubExcludedPhrases(array $phrases) {\n /** @var $patterns array */\n $patterns = Mage::helper('ew_untranslatedstrings')->getExcludePattens();\n\n if(empty($patterns)) { //quick short circuit if feature not used\n return $phrases;\n }\n\n $scrubbedPhrases = array();\n foreach($phrases as $phrase) {\n $excluded = false;\n\n foreach($patterns as $pattern) {\n if(preg_match('/' . $pattern . '/', $phrase['code'])) {\n $excluded = true;\n break;\n }\n }\n\n if(!$excluded) {\n $scrubbedPhrases[] = $phrase;\n }\n }\n\n return $scrubbedPhrases;\n }",
"function filterWords($word) {\n $blacklist = array(\n 'The', 'the',\n 'At', 'at',\n 'And', 'and',\n 'Or', 'or',\n 'In', 'in',\n 'A', 'a',\n 'Of', 'of',\n 'To', 'to'\n );\n return !in_array($word, $blacklist);\n}",
"public function stem(array $words);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Form submission handler for facetapi_facet_filters_form(). | function facetapi_facet_filters_form_submit($form, &$form_state) {
// Pulls variables for code readability.
$adapter = $form['#facetapi']['adapter'];
$realm = $form['#facetapi']['realm'];
$facet = $form['#facetapi']['facet'];
$settings = $form['#facetapi']['settings'];
// Merges passed settings in with the settings object.
$form_state_values_settings = $form_state['values']['settings'];
// Go though all filters and if filter is enabled save its form settings.
foreach ($form_state_values_settings['filters'] as $filter_name => $filter_settings) {
if ($filter_settings['status'] && !empty($form_state['values'][$filter_name])) {
$form_state_values_settings += $form_state['values'][$filter_name];
}
}
$settings->settings = array_merge($settings->settings, $form_state_values_settings);
// Saves the configuration options.
if (FALSE !== ctools_export_crud_save('facetapi', $settings)) {
drupal_set_message(t('The configuration options have been saved.'));
}
else {
drupal_set_message(t('Error saving configuration options.'), 'error');
}
// Redirects back to the realm settings page if necessary.
$clicked = $form_state['clicked_button']['#value'];
if (t('Save and go back to realm settings') == $clicked) {
$form_state['redirect'] = $adapter->getPath($realm['name']);
}
} | [
"function commercebox_catalog_filters_edit_form_submit($form, &$form_state) {\n}",
"function commercebox_core_filters_settings_form($form, &$form_state) {\n module_load_include('inc', 'facetapi', 'facetapi.admin');\n\n $searcher = 'search_api@product_display';\n $adapter = facetapi_adapter_load($searcher);\n $facet_info = facetapi_get_facet_info($searcher);\n $realm_name = 'block';\n $realm = facetapi_realm_load($realm_name);\n\n $cb_filters_settings = variable_get('commercebox_core_filters_settings', array());\n\n $form['filters'] = array(\n '#tree' => TRUE,\n );\n\n // Initialize some filters to display rows depending to filters weight.\n foreach ($cb_filters_settings as $key => $value) {\n $form['filters'][$key] = array();\n }\n\n foreach ($facet_info as $facet_name => $facet) {\n $settings = $adapter->getFacetSettings($facet, $realm);\n\n if ($settings->enabled) {\n $form['filters'][$facet_name]['drag'] = array();\n $form['filters'][$facet_name]['enabled'] = array(\n '#type' => 'checkbox',\n '#default_value' => empty($cb_filters_settings[$facet_name]) ? FALSE : $cb_filters_settings[$facet_name]['enabled'],\n );\n $form['filters'][$facet_name]['filter'] = array('#markup' => $facet['label']);\n $form['filters'][$facet_name]['title'] = array(\n '#type' => 'container',\n '#attributes' => array(\n 'class' => array('container-inline'),\n ),\n 'rewrite' => array(\n '#type' => 'checkbox',\n '#default_value' => isset($cb_filters_settings[$facet_name]) ? $cb_filters_settings[$facet_name]['title']['rewrite'] : 0,\n ),\n 'value' => array(\n '#type' => 'textfield',\n '#default_value' => isset($cb_filters_settings[$facet_name]) ? $cb_filters_settings[$facet_name]['title']['value'] : NULL,\n '#size' => 30,\n ),\n );\n\n // Builds array of operations to use in the dropbutton.\n $destination = drupal_get_destination();\n $operations = array();\n $operations[] = array(\n 'title' => t('Display'),\n 'href' => facetapi_get_settings_path($searcher, $realm['name'], $facet_name, 'edit'),\n 'query' => $destination,\n );\n if ($facet['dependency plugins']) {\n $operations[] = array(\n 'title' => t('Dependencies'),\n 'href' => facetapi_get_settings_path($searcher, $realm['name'], $facet_name, 'dependencies'),\n 'query' => $destination,\n );\n }\n if (facetapi_filters_load($facet_name, $searcher, $realm['name'])) {\n $operations[] = array(\n 'title' => t('Filters'),\n 'href' => facetapi_get_settings_path($searcher, $realm['name'], $facet_name, 'filters'),\n 'query' => $destination,\n );\n }\n $form['filters'][$facet_name]['operations'] = array(\n '#theme' => 'links__ctools_dropbutton',\n '#links' => $operations,\n '#attributes' => array(\n 'class' => array('inline', 'links', 'actions', 'horizontal', 'right')\n ),\n );\n\n // Position (weight, drag&drop)\n $form['filters'][$facet_name]['weight'] = array(\n '#type' => 'textfield',\n '#default_value' => isset($cb_filters_settings[$facet_name]) ? $cb_filters_settings[$facet_name]['weight'] : 0,\n '#size' => 3,\n '#attributes' => array('class' => array('filter-weight')), // needed for table dragging\n );\n }\n }\n\n $form['additional'] = array(\n '#type' => 'container',\n '#attributes' => array('class' => array('additional-filter-settings')),\n 'value' => array(\n '#theme' => 'link',\n '#path' => 'admin/config/search/search_api/index/product_display',\n '#text' => t('Advanced filters settings'),\n '#options' => array(\n 'attributes' => array('class' => array('advanced-filter-settings')),\n 'html' => FALSE,\n ),\n ),\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n );\n\n // Attach the same css styles as used on the default facets form.\n $form['#attached']['css'] = array(\n drupal_get_path('module', 'facetapi') . '/facetapi.admin.css' => array(\n 'weight' => 1,\n ),\n drupal_get_path('module', 'commercebox') . '/commercebox.css',\n );\n\n return $form;\n}",
"function globallink_entity_dashboard_filter_form_submit($form, &$form_state) {\n $op = $form_state['values']['op'];\n\n $filters = globallink_build_filters(FALSE);\n\n switch ($op) {\n case t('Filter'):\n case t('Refine'):\n // Apply every filter that has a choice selected other than 'any'.\n foreach ($filters as $filter => $options) {\n switch ($filter) {\n case 'modified-after':\n if (isset($form_state['values'][$filter]) && $form_state['values'][$filter] != '') {\n list($month, $day, $year) = explode('/', $form_state['values'][$filter]);\n $time_stamp = mktime(0, 0, 0, $month, $day, $year);\n $_SESSION['globallink_entity_filter'][$filter] = array($filter, $time_stamp);\n }\n\n break;\n case 'modified':\n if (isset($form_state['values'][$filter]) && $form_state['values'][$filter] != '') {\n $_SESSION['globallink_entity_filter'][$filter] = array($filter, $form_state['values'][$filter]);\n }\n\n break;\n case 'title':\n if (isset($form_state['values'][$filter]) && $form_state['values'][$filter] != '') {\n $_SESSION['globallink_entity_filter'][$filter] = array($filter, $form_state['values'][$filter]);\n }\n\n break;\n case 'node_parent':\n if (isset($form_state['values']['node_parent']) && $form_state['values']['node_parent'] != '') {\n $_SESSION['globallink_entity_filter']['node_parent'] = array('node_parent', $form_state['values']['node_parent']);\n }\n\n break;\n default:\n if ($filter == 'language_name') {\n $_SESSION['globallink_entity_source_locale'] = $form_state['values'][$filter];\n }\n\n if (isset($form_state['values'][$filter]) && $form_state['values'][$filter] != '[any]') {\n // Merge an array of arrays into one if necessary.\n $options = ($filter == 'type') ? form_options_flatten($filters[$filter]['options']) : $filters[$filter]['options'];\n\n // Only accept valid selections offered on the dropdown, block bad input.\n if (isset($options[$form_state['values'][$filter]])) {\n if ($filter == 'status') {\n $_SESSION['globallink_entity_filter'][$filter] = array($filter, $form_state['values'][$filter]);\n }\n else {\n if (!isset($_SESSION['globallink_entity_filter'][$filter])) {\n $_SESSION['globallink_entity_filter'][$filter] = array($filter, $form_state['values'][$filter]);\n }\n }\n }\n }\n }\n }\n\n break;\n case t('Undo'):\n array_pop($_SESSION['globallink_entity_filter']);\n\n break;\n case t('Reset'):\n $_SESSION['globallink_entity_source_locale'] = '';\n $_SESSION['globallink_entity_filter'] = array();\n\n break;\n case t('Update'):\n return;\n }\n\n $form_state['redirect'] = 'admin/globallink-translations/dashboard/entity';\n\n return;\n}",
"function kolab_lead_filter_form_submit($form, &$form_state) {\n $filters = kolab_lead_filters();\n switch ($form_state['values']['op']) {\n case t('Filter'):\n case t('Refine'):\n // Apply every filter that has a choice selected other than 'any'.\n foreach ($filters as $filter => $options) {\n if (isset($form_state['values'][$filter]) && $form_state['values'][$filter] != '[any]') {\n // Flatten the options array to accommodate hierarchical/nested options.\n $flat_options = form_options_flatten($filters[$filter]['options']);\n // Only accept valid selections offered on the dropdown, block bad input.\n if (isset($flat_options[$form_state['values'][$filter]])) {\n $_SESSION['kolab_lead_overview_filter'][] = array($filter, $form_state['values'][$filter]);\n }\n }\n }\n break;\n case t('Undo'):\n array_pop($_SESSION['kolab_lead_overview_filter']);\n break;\n case t('Reset'):\n $_SESSION['kolab_lead_overview_filter'] = array();\n break;\n }\n}",
"function lendingform_filter_form_submit($form, &$form_state) {\r\n $filters = lendingform_filters();\r\n switch ($form_state['values']['op']) {\r\n case t('Filter'):\r\n case t('Refine'):\r\n // Apply every filter that has a choice selected other than 'any'.\r\n foreach ($filters as $filter => $options) {\r\n if (isset($form_state['values'][$filter]) && $form_state['values'][$filter] != '[any]') {\r\n // Flatten the options array to accommodate hierarchical/nested options.\r\n $flat_options = form_options_flatten($filters[$filter]['options']);\r\n // Only accept valid selections offered on the dropdown, block bad input.\r\n if (isset($flat_options[$form_state['values'][$filter]])) {\r\n $_SESSION['lendingform_overview_filter'][] = array($filter, $form_state['values'][$filter]);\r\n }\r\n }\r\n }\r\n break;\r\n case t('Undo'):\r\n array_pop($_SESSION['lendingform_overview_filter']);\r\n break;\r\n case t('Reset'):\r\n $_SESSION['lendingform_overview_filter'] = array();\r\n break;\r\n }\r\n}",
"function facetapi_facet_display_form_submit($form, &$form_state) {\n\n // Pulls variables for code readability.\n $adapter = $form['#facetapi']['adapter'];\n $realm = $form['#facetapi']['realm'];\n $facet = $form['#facetapi']['facet'];\n $global_values = $form_state['values']['global'];\n unset($form_state['values']['global']);\n\n // Loads settings, saves all form values as settings other than excluded.\n $facet_settings = $adapter->getFacet($facet)->getSettings($realm);\n $facet_settings->settings = array_merge($facet_settings->settings, array_diff_key(\n $form_state['values'],\n array_flip($form['#facetapi']['excluded_values'])\n ));\n\n $global_settings = $adapter->getFacet($facet)->getSettings();\n foreach ($global_values as $key => $value) {\n $global_settings->settings[$key] = $value;\n }\n\n $success = TRUE;\n if (FALSE === ctools_export_crud_save('facetapi', $facet_settings)) {\n drupal_set_message(t('Error saving configuration options.'), 'error');\n $success = FALSE;\n }\n if (FALSE === ctools_export_crud_save('facetapi', $global_settings)) {\n drupal_set_message(t('Error saving configuration options.'), 'error');\n $success = FALSE;\n }\n\n // Sets message if both sets of configurations were saved.\n if ($success) {\n drupal_set_message(t('The configuration options have been saved.'));\n }\n\n // Redirects back to the realm settings page if necessary.\n $clicked = $form_state['clicked_button']['#value'];\n if (t('Save and go back to realm settings') == $clicked) {\n $form_state['redirect'] = $adapter->getPath($realm['name']);\n }\n}",
"function apachesolr_enabled_facets_form_submit($form, &$form_state) {\r\n $enabled = array();\r\n foreach ($form_state['values']['apachesolr_enabled_facets'] as $module => $facets) {\r\n $enabled[$module] = array_filter($facets);\r\n }\r\n apachesolr_save_enabled_facets($enabled);\r\n // This cache being stale can prevent new facet filters from working.\r\n apachesolr_clear_cache();\r\n drupal_set_message($form_state['values']['submit_message'], 'warning');\r\n}",
"function culturefeed_search_ui_date_facet_form_submit($form, &$form_state) {\n\n $query = drupal_get_query_parameters(NULL, array('q', 'page'));\n unset($query['facet']['datetype']);\n\n if (empty($query['facet'])) {\n unset($query['facet']);\n }\n\n if (!empty($form_state['values']['date_range'])) {\n $query['date_range'] = $form_state['values']['date_range'];\n }\n\n $form_state['redirect'] = array(\n $_GET['q'],\n array('query' => $query)\n );\n\n}",
"function file_entity_filter_form() {\n $session = isset($_SESSION['file_entity_overview_filter']) ? $_SESSION['file_entity_overview_filter'] : array();\n $filters = file_filters();\n\n $i = 0;\n $form['filters'] = array(\n '#type' => 'fieldset',\n '#title' => t('Show only items where'),\n '#theme' => 'exposed_filters__file_entity',\n );\n foreach ($session as $filter) {\n list($type, $value) = $filter;\n if ($type == 'term') {\n // Load term name from DB rather than search and parse options array.\n $value = module_invoke('taxonomy', 'term_load', $value);\n $value = $value->name;\n }\n else {\n $value = $filters[$type]['options'][$value];\n }\n $t_args = array('%property' => $filters[$type]['title'], '%value' => $value);\n if ($i++) {\n $form['filters']['current'][] = array('#markup' => t('and where %property is %value', $t_args));\n }\n else {\n $form['filters']['current'][] = array('#markup' => t('where %property is %value', $t_args));\n }\n if (in_array($type, array('type', 'uri'))) {\n // Remove the option if it is already being filtered on.\n unset($filters[$type]);\n }\n }\n\n $form['filters']['status'] = array(\n '#type' => 'container',\n '#attributes' => array('class' => array('clearfix')),\n '#prefix' => ($i ? '<div class=\"additional-filters\">' . t('and where') . '</div>' : ''),\n );\n $form['filters']['status']['filters'] = array(\n '#type' => 'container',\n '#attributes' => array('class' => array('filters')),\n );\n foreach ($filters as $key => $filter) {\n $form['filters']['status']['filters'][$key] = array(\n '#type' => 'select',\n '#options' => $filter['options'],\n '#title' => $filter['title'],\n '#default_value' => '[any]',\n );\n }\n\n $form['filters']['status']['actions'] = array(\n '#type' => 'actions',\n '#attributes' => array('class' => array('container-inline')),\n );\n if (count($filters)) {\n $form['filters']['status']['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => count($session) ? t('Refine') : t('Filter'),\n );\n }\n if (count($session)) {\n $form['filters']['status']['actions']['undo'] = array('#type' => 'submit', '#value' => t('Undo'));\n $form['filters']['status']['actions']['reset'] = array('#type' => 'submit', '#value' => t('Reset'));\n }\n\n drupal_add_js('misc/form.js');\n\n return $form;\n}",
"function filefield_stats_report_filter_form() {\n $form = array();\n\n $form['filter'] = array(\n '#type' => 'fieldset',\n '#title' => t('Filter'),\n '#collapsible' => TRUE,\n '#collapsed' => !(isset($_GET['start']) || isset($_GET['end']) || isset($_GET['pager_size'])),\n );\n\n\n $start = (isset($_GET['start']) && (int)$_GET['start'] > 0) ? date('d-m-Y H:i:s', (int)$_GET['start']) : FALSE;\n $form['filter']['start'] = array(\n '#type' => 'textfield',\n '#title' => t('Start'),\n '#prefix' => '<div class=\"container-inline form-item\">',\n '#suffix' => '</div>',\n '#default_value' => $start === FALSE ? '' : $start,\n );\n\n $end = (isset($_GET['end']) && (int)$_GET['end'] > 0) ? date('d-m-Y H:i:s', (int)$_GET['end']) : FALSE;\n $form['filter']['end'] = array(\n '#type' => 'textfield',\n '#title' => t('End'),\n '#prefix' => '<div class=\"container-inline form-item\">',\n '#suffix' => '</div>',\n '#default_value' => $end === FALSE ? '' : $end,\n );\n\n $pager_size = (isset($_GET['pager_size']) && (int)$_GET['pager_size'] > 0) ? (int)$_GET['pager_size'] : FILEFIELD_STATS_PAGER_SIZE_DEFAULT;\n $form['filter']['pager_size'] = array(\n '#type' => 'textfield',\n '#title' => t('Pager Size'),\n '#prefix' => '<div class=\"container-inline form-item\">',\n '#suffix' => '</div>',\n '#default_value' => $pager_size,\n '#maxlength' => 3,\n '#size' => 2,\n '#description' => '<div>'. t('Set the pager size here if you would like larger lists below. Warning: if this is set too high, the page could take a long time to load') .'</div>',\n );\n\n $form['filter']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Submit'),\n );\n\n $form['filter']['reset'] = array(\n '#type' => 'submit',\n '#value' => t('Reset'),\n );\n\n return $form;\n}",
"function member_filter_form () {\n\n // Available filters \n $filters = array(\n 'all' => 'All',\n 'voting' => 'Voting',\n 'active' => 'Active'\n );\n \n // Default filter\n $selected = empty($_SESSION['member_filter_option']) ? 'all' : $_SESSION['member_filter_option'];\n \n // Construct hidden fields to pass GET params\n $hidden = array();\n foreach ($_GET as $key => $val) {\n $hidden[$key] = $val;\n }\n \n $form = array(\n 'type' => 'form',\n 'method' => 'get',\n 'command' => 'member_filter',\n 'hidden' => $hidden,\n 'fields' => array(\n array(\n 'type' => 'fieldset',\n 'label' => 'Filter',\n 'fields' => array(\n array(\n 'type' => 'select',\n 'name' => 'filter',\n 'options' => $filters,\n 'selected' => $selected\n ),\n array(\n 'type' => 'submit',\n 'value' => 'Filter'\n )\n )\n )\n )\n );\n \n return $form;\n}",
"function kolab_lead_filter_form() {\n $session = isset($_SESSION['kolab_lead_overview_filter']) ? $_SESSION['kolab_lead_overview_filter'] : array();\n $filters = kolab_lead_filters();\n\n $i = 0;\n $form['filters'] = array(\n '#type' => 'fieldset',\n '#title' => t('Show only items where'),\n '#theme' => 'exposed_filters__lead',\n );\n foreach ($session as $filter) {\n list($type, $value) = $filter;\n \n $value = $filters[$type]['options'][$value];\n \n $t_args = array('%property' => $filters[$type]['title'], '%value' => $value);\n if ($i++) {\n $form['filters']['current'][] = array('#markup' => t('and where %property is %value', $t_args));\n }\n else {\n $form['filters']['current'][] = array('#markup' => t('where %property is %value', $t_args));\n }\n if (in_array($type, array('type', 'language'))) {\n // Remove the option if it is already being filtered on.\n unset($filters[$type]);\n }\n }\n\n $form['filters']['status'] = array(\n '#type' => 'container',\n '#attributes' => array('class' => array('clearfix')),\n '#prefix' => ($i ? '<div class=\"additional-filters\">' . t('and where') . '</div>' : ''),\n );\n $form['filters']['status']['filters'] = array(\n '#type' => 'container',\n '#attributes' => array('class' => array('filters')),\n );\n foreach ($filters as $key => $filter) {\n $form['filters']['status']['filters'][$key] = array(\n '#type' => 'select',\n '#options' => $filter['options'],\n '#title' => $filter['title'],\n '#default_value' => '[any]',\n );\n }\n\n $form['filters']['status']['actions'] = array(\n '#type' => 'actions',\n '#attributes' => array('class' => array('container-inline')),\n );\n $form['filters']['status']['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => count($session) ? t('Refine') : t('Filter'),\n );\n if (count($session)) {\n $form['filters']['status']['actions']['undo'] = array('#type' => 'submit', '#value' => t('Undo'));\n $form['filters']['status']['actions']['reset'] = array('#type' => 'submit', '#value' => t('Reset'));\n }\n\n drupal_add_js('misc/form.js');\n\n return $form;\n}",
"function parse_facet() {\n // TODO: We should probably do some validation here\n // Handle normal faceting. This comes in the form of http://...&facet=langauge\n if (!empty($this->http_request->params['facet'][0])) {\n $facets = array();\n foreach ($this->http_request->params['facet'] as $facet) {\n $this->solr_data_store_request->params['f.' . $facet . '.facet.mincount'] = 1;\n\n if (!empty($this->http_request->params['facet_limit_' . $facet][0])) {\n $this->solr_data_store_request->params['f.' . $facet . '.facet.limit'] = $this->http_request->params['facet_limit_' . $facet][0];\n }\n }\n $this->solr_data_store_request->params['facet.field'] = $this->http_request->params['facet'];\n $this->solr_data_store_request->params['facet'] = 'true';\n }\n\n // Handle facet query faceting. This comes in the form of http://...&facet_query=circ_fac_score:[2 TO *]\n if (!empty($this->http_request->params['facet_query'][0])) { \n $this->solr_data_store_request->params['facet.query'] = $this->http_request->params['facet_query'];\n $this->solr_data_store_request->params['facet'] = 'true';\n }\n }",
"public function updateFilterValuesFromForm()\n {\n $post = array_merge(\n (array)$this->getRequest()->getPost(),\n (array)$this->getRequest()->getQuery()\n );\n\n foreach ($this->getFilters() as $filterClass) {\n\n /** @var \\Common\\Data\\Object\\Search\\Aggregations\\Terms\\TermsAbstract $filterClass */\n if (isset($post['filter'][$filterClass->getKey()]) && !empty($post['filter'][$filterClass->getKey()])) {\n $filterClass->setValue($post['filter'][$filterClass->getKey()]);\n }\n }\n }",
"function user_filter_form_submit($form, &$form_state) {\n $op = $form_state['values']['op'];\n $filters = user_filters();\n switch ($op) {\n case t('Filter'): case t('Refine'):\n if (isset($form_state['values']['filter'])) {\n $filter = $form_state['values']['filter'];\n // Merge an array of arrays into one if necessary.\n $options = $filter == 'permission' ? call_user_func_array('array_merge', $filters[$filter]['options']) : $filters[$filter]['options'];\n if (isset($options[$form_state['values'][$filter]])) {\n $_SESSION['user_overview_filter'][] = array($filter, $form_state['values'][$filter]);\n }\n }\n break;\n case t('Undo'):\n array_pop($_SESSION['user_overview_filter']);\n break;\n case t('Reset'):\n $_SESSION['user_overview_filter'] = array();\n break;\n case t('Update'):\n return;\n }\n\n $form_state['redirect'] = 'admin/user/user';\n return;\n}",
"function node_filter_form() {\n $session = &$_SESSION['node_overview_filter'];\n $session = is_array($session) ? $session : array();\n $filters = node_filters();\n\n $i = 0;\n $form['filters'] = array('#type' => 'fieldset',\n '#title' => t('Show only items where'),\n '#theme' => 'node_filters',\n );\n foreach ($session as $filter) {\n list($type, $value) = $filter;\n if ($type == 'category') {\n // Load term name from DB rather than search and parse options array.\n $value = module_invoke('taxonomy', 'get_term', $value);\n $value = $value->name;\n }\n else {\n $value = $filters[$type]['options'][$value];\n }\n $string = ($i++ ? '<em>and</em> where <strong>%a</strong> is <strong>%b</strong>' : '<strong>%a</strong> is <strong>%b</strong>');\n $form['filters']['current'][] = array('#value' => t($string, array('%a' => $filters[$type]['title'] , '%b' => $value)));\n }\n\n foreach ($filters as $key => $filter) {\n $names[$key] = $filter['title'];\n $form['filters']['status'][$key] = array('#type' => 'select', '#options' => $filter['options']);\n }\n\n $form['filters']['filter'] = array('#type' => 'radios', '#options' => $names, '#default_value' => 'status');\n $form['filters']['buttons']['submit'] = array('#type' => 'submit', '#value' => (count($session) ? t('Refine') : t('Filter')));\n if (count($session)) {\n $form['filters']['buttons']['undo'] = array('#type' => 'submit', '#value' => t('Undo'));\n $form['filters']['buttons']['reset'] = array('#type' => 'submit', '#value' => t('Reset'));\n }\n\n return drupal_get_form('node_filter_form', $form);\n}",
"function node_filter_form() {\n $session = &$_SESSION['node_overview_filter'];\n $session = is_array($session) ? $session : array();\n $filters = node_filters();\n\n $i = 0;\n $form['filters'] = array(\n '#type' => 'fieldset',\n '#title' => t('Show only items where'),\n '#theme' => 'node_filters',\n );\n $form['#submit'][] = 'node_filter_form_submit';\n foreach ($session as $filter) {\n list($type, $value) = $filter;\n if ($type == 'category') {\n // Load term name from DB rather than search and parse options array.\n $value = module_invoke('taxonomy', 'get_term', $value);\n $value = $value->name;\n }\n else if ($type == 'language') {\n $value = empty($value) ? t('Language neutral') : module_invoke('locale', 'language_name', $value);\n }\n else {\n $value = $filters[$type]['options'][$value];\n }\n if ($i++) {\n $form['filters']['current'][] = array('#value' => t('<em>and</em> where <strong>%a</strong> is <strong>%b</strong>', array('%a' => $filters[$type]['title'], '%b' => $value)));\n }\n else {\n $form['filters']['current'][] = array('#value' => t('<strong>%a</strong> is <strong>%b</strong>', array('%a' => $filters[$type]['title'], '%b' => $value)));\n }\n if (in_array($type, array('type', 'language'))) {\n // Remove the option if it is already being filtered on.\n unset($filters[$type]);\n }\n }\n\n foreach ($filters as $key => $filter) {\n $names[$key] = $filter['title'];\n $form['filters']['status'][$key] = array('#type' => 'select', '#options' => $filter['options']);\n }\n\n $form['filters']['filter'] = array('#type' => 'radios', '#options' => $names, '#default_value' => 'status');\n $form['filters']['buttons']['submit'] = array('#type' => 'submit', '#value' => (count($session) ? t('Refine') : t('Filter')));\n if (count($session)) {\n $form['filters']['buttons']['undo'] = array('#type' => 'submit', '#value' => t('Undo'));\n $form['filters']['buttons']['reset'] = array('#type' => 'submit', '#value' => t('Reset'));\n }\n\n drupal_add_js('misc/form.js', 'core');\n\n return $form;\n}",
"function theme_commercebox_core_filters_settings_form($vars) {\n $form = $vars['form'];\n\n $header = array(\n 'drag' => t('Position'),\n 'enabled' => t('Enabled'),\n 'filter' => t('filter'),\n 'title' => t('Rewrite title'),\n 'operations' => t('Configure'),\n 'weight' => t('Weight'),\n );\n\n $rows = array();\n foreach (element_children($form['filters']) as $key) {\n $row = array();\n $row['data'] = array();\n foreach ($header as $fieldname => $title) {\n if ($fieldname == 'operations') {\n $row['data'][] = array(\n 'data' => drupal_render($form['filters'][$key][$fieldname]),\n 'class' => 'facetapi-operations',\n );\n }\n else {\n $row['data'][] = drupal_render($form['filters'][$key][$fieldname]);\n }\n }\n $row['class'] = array('draggable'); // needed for table dragging\n $rows[] = $row;\n }\n\n $table_id = 'cb-filters-table';\n\n $output = theme('table', array(\n 'header' => $header,\n 'rows' => $rows,\n 'attributes' => array('id' => $table_id), // needed for table dragging\n ));\n\n $output .= drupal_render_children($form);\n drupal_add_tabledrag($table_id, 'order', 'sibling', 'filter-weight'); // needed for table dragging\n\n return $output;\n}",
"public function onPostSubmit(FormEvent $event): void\n {\n $form = $event->getForm();\n\n if (! $form->isRoot() && ! $this->getRootFormCascadeOption($form)) {\n return;\n }\n\n $clientData = $form->getData();\n\n if (! is_object($clientData)) {\n return;\n }\n\n $this->filterService->filterEntity($clientData);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets columns for coupon listing on edit.php page | function clpr_edit_columns( $columns ) {
$columns = array(
'cb' => '<input type="checkbox" />',
'title' => __( 'Coupon Title', APP_TD ),
'author' => __( 'Submitted By', APP_TD ),
APP_TAX_STORE => __( 'Store Name', APP_TD ),
APP_TAX_CAT => __( 'Categories', APP_TD ),
APP_TAX_TYPE => __( 'Coupon Type', APP_TD ),
'coupon_code' => __( 'Coupon', APP_TD ),
'comments' => '<div class="vers"><img alt="" src="' . esc_url( admin_url( 'images/comment-grey-bubble.png' ) ) . '" /></div>',
'date' => __( 'Date', APP_TD ),
'expire_date' => __( 'Expiration Date', APP_TD ),
'votes' => __( 'Votes', APP_TD ),
'clicks' => __( 'Clicks / Views', APP_TD ),
'ctr' => __( 'CTR', APP_TD )
);
return $columns;
} | [
"public function edit_coupon() {\n\n\t\t$view = $this->getView('cart', 'html');\n\t\t$view->setLayout('edit_coupon');\n\n\t\t// Display it all\n\t\t$view->display();\n\t}",
"public function coupon_option( $edit ) {\n\n\t\tglobal $wpdb;\n\n\t\tadd_filter( 'affwp_is_admin_page', '__return_true' );\n\t\taffwp_admin_scripts();\n\n\t\t$user_id = 0;\n\t\t$user_name = '';\n\n\t\tif( $edit > 0 ) {\n\t\t\t$table = $wpdb->prefix . 'affiliate_wp_affiliatemeta';\n\t\t\t$affiliate_id = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM $table WHERE meta_key = %s\", 'affwp_discount_pmp_' . $edit ) );\n\t\t} else {\n\t\t\t$affiliate_id = false;\n\t\t}\n\t\tif( $affiliate_id ) {\n\t\t\t$user_id = affwp_get_affiliate_user_id( $affiliate_id );\n\t\t\t$user = get_userdata( $user_id );\n\t\t\t$user_name = $user ? $user->user_login : '';\n\t\t}\n\t\t?>\n\t\t<table class=\"form-table\">\n\t\t\t<tbody>\n\t\t\t\t<tr>\n\t\t\t\t\t<th scope=\"row\" valign=\"top\"><label for=\"user_name\"><?php _e( 'Affiliate Discount?', 'affiliate-wp' ); ?></label></th>\n\t\t\t\t\t<td class=\"form-field affwp-pmp-coupon-field\">\n\t\t\t\t\t\t<span class=\"affwp-ajax-search-wrap\">\n\t\t\t\t\t\t\t<span class=\"affwp-pmp-coupon-input-wrap\">\n\t\t\t\t\t\t\t\t<input type=\"text\" name=\"user_name\" id=\"user_name\" value=\"<?php echo esc_attr( $user_name ); ?>\" class=\"affwp-user-search\" data-affwp-status=\"active\" autocomplete=\"off\" style=\"width:150px\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<small class=\"pmpro_lite\"><?php _e( 'If you would like to connect this discount to an affiliate, enter the name of the affiliate it belongs to.', 'affiliate-wp' ); ?></small>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<?php wp_nonce_field( 'affwp_pmp_coupon_nonce', 'affwp_pmp_coupon_nonce' ); ?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t\t<?php\n\t}",
"function custom_coupon_column( $column, $post_id ) {\r\n wpcoupon_setup_coupon( $post_id );\r\n switch ( $column ) {\r\n case 'coupon_type' :\r\n\r\n if ( wpcoupon_coupon()->get_type() == 'code' ) {\r\n if ( $code = wpcoupon_coupon()->get_code() ) {\r\n echo '<br/><code>'.esc_html( $code ).'</code>';\r\n } else {\r\n echo '<br/>'; esc_html_e( '[No Code]', 'wp-coupon' );\r\n }\r\n } else {\r\n echo strtoupper( wpcoupon_coupon()->get_coupon_type_text() );\r\n }\r\n break;\r\n case 'expires' :\r\n if ( wpcoupon_coupon()->has_expired() ) {\r\n esc_html_e( 'Expired', 'wp-coupon' );\r\n echo ' - ';\r\n echo wpcoupon_coupon()->get_expires( get_option( 'date_format' ).' '.get_option( 'time_format' ), true );\r\n } else {\r\n echo wpcoupon_coupon()->get_expires( get_option( 'date_format' ).' '.get_option( 'time_format' ) );\r\n }\r\n\r\n break;\r\n case 'stats' :\r\n echo '<span title=\"'.esc_attr__( 'Vote Up' ,'wp-coupon' ).'\" style=\"color: #458b1b\"><span class=\"dashicons dashicons-arrow-up\"></span>' .wpcoupon_coupon()->_wpc_vote_up.'</span> ';\r\n echo '<span title=\"'.esc_attr__( 'Vote Down' ,'wp-coupon' ).'\" style=\"color: #fc702e\"><span class=\"dashicons dashicons-arrow-down\"></span>' . wpcoupon_coupon()->_wpc_vote_down .'</span> / ';\r\n echo '<span title=\"'.esc_attr__( 'Total Used' ,'wp-coupon' ).'\" ><span class=\"dashicons dashicons-migrate\"></span>' . wpcoupon_coupon()->get_total_used() .'</span>';\r\n break;\r\n\r\n }\r\n\r\n }",
"function set_Columns() {\n\n // For all views\n //\n $this->columns = array(\n 'sl_id' => __('ID' ,'csa-slplus'),\n 'sl_store' => __('Name' ,'csa-slplus'),\n 'sl_address' => __('Street' ,'csa-slplus'),\n 'sl_address2' => __('Street 2' ,'csa-slplus'),\n 'sl_city' => __('City' ,'csa-slplus'),\n 'sl_state' => __('State' ,'csa-slplus'),\n 'sl_zip' => __('Zip' ,'csa-slplus'),\n 'sl_country' => __('Country' ,'csa-slplus'),\n );\n\n // FILTER: slp_manage_normal_location_columns - add columns to normal view on manage locations\n //\n $this->columns = apply_filters('slp_manage_priority_location_columns', $this->columns);\n\n // Expanded View\n //\n if (get_option('sl_location_table_view')!=\"Normal\") {\n $this->columns = array_merge($this->columns,\n array(\n 'sl_description'=> __('Description' ,'csa-slplus'),\n 'sl_url' => get_option('sl_website_label','Website'),\n 'sl_email' => __('Email' ,'csa-slplus'),\n 'sl_hours' => $this->plugin->settings->get_item('label_hours','Hours','_'),\n 'sl_phone' => $this->plugin->settings->get_item('label_phone','Phone','_'),\n 'sl_fax' => $this->plugin->settings->get_item('label_fax' ,'Fax' ,'_'),\n )\n );\n // FILTER: slp_manage_expanded_location_columns - add columns to expanded view on manage locations\n //\n $this->columns = apply_filters('slp_manage_expanded_location_columns', $this->columns);\n\n }\n\n // For all views, add-ons go on the end by default.\n // FILTER: slp_manage_location_columns - add columns to normal and expanded view on manage locations\n //\n $this->columns = apply_filters('slp_manage_location_columns', $this->columns);\n }",
"function set_custom_columns() {\n\treturn array(\n\t\t'cb' => '<input type=\"checkbox\"/>',\n\t\t'title' => 'Name of Venue',\n\t\t'event_id' => 'Event ID',\n\t\t'performance_date' => 'Performance Date',\n\t\t'menu_order' => 'Order Number',\n\t);\n}",
"function show_suppliers_custom_columns( $column, $post_id){\r\n\t\trequire('include/suppliers_list_extra_columns.php');\r\n\t}",
"public function render_list_table_columns_preferences()\n {\n }",
"protected function setColumns()\n {\n // choose what columns should be displayed in the table.\n // For table display, we need to specify the column name for the result query.\n\n $this->addCheckableColumn();\n\n $this->columns['id'] = array(\n 'label' => 'ID',\n 'sortable' => true,\n 'table_column' => 'users.id',\n );\n\n $this->columns['username'] = array(\n 'label' => 'Username',\n 'sortable' => true,\n 'table_column' => 'users.username',\n );\n\n $this->columns['email'] = array(\n 'label' => 'Email',\n 'sortable' => true,\n 'classes' => 'some_class some_class2',\n 'table_column' => 'users.email',\n 'thead_attr' => 'style=\"width:200px\" data-some-attr=\"example\"',\n );\n\n $this->columns['created_at'] = array(\n 'label' => 'Created At',\n 'sortable' => true,\n 'table_column' => 'users.created_at',\n );\n\n $this->addActionColumn();\n\n }",
"function free_coupon_list() {\n\t $data['free_coupon_list'] = $this->login_model->get_record_join_two_table('free_coupon_category', 'free_coupon_list', 'free_coupon_category_id', 'fee_coupon_category_id','*',''); \n\t\t$this->load->view('newadmin/menu');\n $this->load->view('newadmin/header');\n $this->load->view('newadmin/listing/free_coupon_list_view', $data);\n $this->load->view('newadmin/footer');\n }",
"function show_coupons_list($coupons,$instance,$unsortedurl,$currentsort){\n\t\n\t\tif(!$coupons){\n\t\t\treturn $this->output->heading(get_string('nocoupons','enrol_coupon'), 3, 'main');\n\t\t}\n\t\n\t\t$table = new html_table();\n\t\t$table->id = ENROL_COUPON_FRANKY . '_cpanel';\n\t\t$table->head = array(\n\t\t\thtml_writer::link(new moodle_url($unsortedurl,array('sort'=>$currentsort =='iddsc' ? 'idasc' : 'iddsc')),get_string('id', 'enrol_coupon')),\n\t\t\thtml_writer::link(new moodle_url($unsortedurl,array('sort'=>$currentsort =='namedsc' ? 'nameasc' : 'namedsc')),get_string('couponname', 'enrol_coupon')),\n\t\t\thtml_writer::link(new moodle_url($unsortedurl,array('sort'=>$currentsort =='typedsc' ? 'typeasc' : 'typedsc')),get_string('coupontype', 'enrol_coupon')),\n\t\t\thtml_writer::link(new moodle_url($unsortedurl,array('sort'=>$currentsort =='couponcodedsc' ? 'couponcodeasc' : 'couponcodedsc')),get_string('couponcode', 'enrol_coupon')),\n\t\t\thtml_writer::link(new moodle_url($unsortedurl,array('sort'=>$currentsort =='maxusesdsc' ? 'maxusesasc' : 'maxusesdsc')),get_string('maxuses', 'enrol_coupon')),\n\t\t\tget_string('actions', 'enrol_coupon')\n\t\t);\n\t\t$table->headspan = array(1,1,1,1,1,3);\n\t\t$table->colclasses = array(\n\t\t\t'couponid','couponname','coupontype', 'couponcode','actions'\n\t\t);\n\n\t\t//sort by start date\n\t\t//core_collator::asort_objects_by_property($coupons,'timecreated',core_collator::SORT_NUMERIC);\n\n\t\t//loop through the homoworks and add to table\n\t\tforeach ($coupons as $coupon) {\n\t\t\t$row = new html_table_row();\n\t\t\n\t\t\t$couponidcell = new html_table_cell($coupon->id);\t\n\t\t\t$couponnamecell = new html_table_cell($coupon->name);\t\n\t\t\tswitch($coupon->type){\n\t\t\t\tcase ENROL_COUPON_TYPE_STANDARD:\n\t\t\t\t\t//actuallystandard should not enter results here, just in case\n\t\t\t\t\t$coupontype = get_string('standard',ENROL_COUPON_FRANKY);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ENROL_COUPON_TYPE_BULK:\n\t\t\t\t\t$coupontype = get_string('bulk',ENROL_COUPON_FRANKY);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ENROL_COUPON_TYPE_RANDOMBULK:\n\t\t\t\t\t$coupontype = get_string('randombulk',ENROL_COUPON_FRANKY);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$coupontype = get_string('unknown',ENROL_COUPON_FRANKY);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$coupontypecell = new html_table_cell($coupontype);\n\t\t\t\n\t\t\t$couponcodecell = new html_table_cell($coupon->couponcode);\n\t\t\t\n\t\t\t$maxusescell = new html_table_cell($coupon->maxuses);\n\t\t\n\t\t\t$actionurl = '/enrol/coupon/managecoupons.php';\n\t\t\t$editurl = new moodle_url($actionurl, array('id'=>$instance->id,'couponid'=>$coupon->id));\n\t\t\t$editlink = html_writer::link($editurl, get_string('editcoupon', 'enrol_coupon'));\n\t\t\t$editcell = new html_table_cell($editlink);\n\n\t\t\t$reporturl = new moodle_url('/enrol/coupon/reports.php',array('itemid'=>$coupon->id, 'id'=>$instance->id, 'report'=>'coupondetails'));\n\t\t\t$reportlink = html_writer::link($reporturl, get_string('details', 'enrol_coupon'));\n\t\t\t$reportcell = new html_table_cell($reportlink);\n\t\t\n\t\t\t$deleteurl = new moodle_url($actionurl, array('id'=>$instance->id,'couponid'=>$coupon->id,'action'=>'confirmdelete'));\n\t\t\t$deletelink = html_writer::link($deleteurl, get_string('deletecoupon', 'enrol_coupon'));\n\t\t\t$deletecell = new html_table_cell($deletelink);\n\n\t\t\t$row->cells = array(\n\t\t\t\t$couponidcell, $couponnamecell, $coupontypecell, $couponcodecell, $maxusescell,$reportcell, $editcell, $deletecell\n\t\t\t);\n\t\t\t$table->data[] = $row;\n\t\t}\n\n\t\treturn html_writer::table($table);\n\n\t}",
"public function render_list_table_columns_preferences() {\n\n\t\t$columns = get_column_headers( $this );\n\t\t$hidden = get_hidden_columns( $this );\n\n\t\tif ( ! $columns ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$legend = ! empty( $columns['_title'] ) ? $columns['_title'] : __( 'Columns' );\n\t\t?>\n\t\t<fieldset class=\"metabox-prefs\">\n\t\t<legend><?php echo $legend; ?></legend>\n\t\t<?php\n\t\t$special = array( '_title', 'cb', 'comment', 'media', 'name', 'title', 'username', 'blogname' );\n\n\t\tforeach ( $columns as $column => $title ) {\n\t\t\t// Can't hide these for they are special\n\t\t\tif ( in_array( $column, $special ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( empty( $title ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * The Comments column uses HTML in the display name with some screen\n\t\t\t * reader text. Make sure to strip tags from the Comments column\n\t\t\t * title and any other custom column title plugins might add.\n\t\t\t */\n\t\t\t$title = wp_strip_all_tags( $title );\n\n\t\t\t$id = \"$column-hide\";\n\t\t\techo '<label>';\n\t\t\techo '<input class=\"hide-column-tog\" name=\"' . $id . '\" type=\"checkbox\" id=\"' . $id . '\" value=\"' . $column . '\"' . checked( ! in_array( $column, $hidden ), true, false ) . ' />';\n\t\t\techo \"$title</label>\\n\";\n\t\t}\n\t\t?>\n\t\t</fieldset>\n\t\t<?php\n\t}",
"function sugarform_edit_columns($cols) {\n $cols = array(\n 'cb' => '<input type=\"checkbox\"/>',\n 'title' => 'Title',\n 'sugar_module' => 'Import Module',\n 'sugar_record_owner' => 'Record Owner',\n 'sugarform_notification_email' => 'Notification Email',\n 'sugarform_confirmation_page' => 'Confirmation Page'\n );\n return $cols;\n }",
"function edit_spotlight_columns() {\n\t$columns = array(\n\t'cb' => '<input type=\"checkbox\" />',\n\t'title' => 'Title',\n\t'spotlight_start'\t=> 'Adv Start Date',\n\t'spotlight_end'\t=> 'Adv End Date',\n\t'spotlight_category' => 'Category',\n\t'post' \t\t => 'Post',\t\n\t'publish_date'=> 'Date',\n\t);\n\treturn $columns;\n}",
"function origami_render_metabox_columns(){\n\tget_template_part('admin/metabox', 'columns');\n}",
"function load_edit() {\n\n\t\t// run filter to sort columns when requested\n\t\t$this->add_filter( 'request', array($this, 'sort_columns') );\n\n\t}",
"function pmproship_pmpro_memberslist_extra_cols_header()\n{\n?>\n<th><?php _e('Shipping Address', 'pmpro');?></th>\n<?php\n}",
"function ccc_editcomments_load()\n{\n $screen = get_current_screen();\n\n add_filter(\"manage_{$screen->id}_columns\", 'ccc_editcomments_add_columns');\n}",
"protected function createAdminColumns ()\n {\n\n //Adds Column labels. Can be enabled/disabled using screen options.\n add_filter('manage_' . $this->uglify($this->postType) . '_posts_columns', function () {\n\n $additionalLabels = [];\n foreach($this->additionalFields as $name => $label) {\n if($name != 'first_name' && $name != 'last_name' && $name != 'full_name') {\n $additionalLabels[$name] = $label;\n }\n }\n\n $defaults = array_merge(\n [\n 'title' => 'Name',\n 'email_address' => 'Email',\n 'phone_number' => 'Phone Number',\n ], $additionalLabels\n );\n\n $defaults['date'] = 'Date Posted'; //always last\n\n return $defaults;\n }, 0);\n\n //Assigns values to columns\n add_action('manage_' . $this->uglify($this->postType) . '_posts_custom_column', function ($column_name, $post_ID) {\n if($column_name != 'title' && $column_name != 'date'){\n switch ($column_name) {\n case 'email_address':\n $email_address = get_post_meta($post_ID, 'lead_info_email_address', true);\n echo(isset($email_address) ? '<a href=\"mailto:' . $email_address . '\" >' . $email_address . '</a>' : null);\n break;\n case 'phone_number':\n $phone_number = get_post_meta($post_ID, 'lead_info_phone_number', true);\n echo(isset($phone_number) ? '<a href=\"tel:' . $phone_number . '\" >' . $phone_number . '</a>' : null);\n break;\n default:\n echo get_post_meta($post_ID, 'lead_info_' . $column_name, true);\n }\n }\n }, 0, 2);\n }",
"function edit_feedsubmission_columns() {\n\t$columns = array(\n\t\t'cb' \t=> '<input type=\"checkbox\" />',\n\t\t'title' \t=> 'Title',\n\t\t'image' \t\t=> 'Image',\n\t\t'service'\t\t=> 'Service',\n\t\t'orig_pub_time' => 'Original Submission Date',\n\t\t'post_status'\t=> 'Post Status',\n\t);\n\treturn $columns;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Queue the handler class. | protected function queueHandler($class, $method, $arguments)
{
[$listener, $job] = $this->createListenerAndJob($class, $method, $arguments);
$connection = $this->resolveQueue()->connection(method_exists($listener, 'viaConnection')
? $listener->viaConnection()
: $listener->connection ?? null);
$queue = method_exists($listener, 'viaQueue')
? $listener->viaQueue()
: $listener->queue ?? null;
isset($listener->delay)
? $connection->laterOn($queue, $listener->delay, $job)
: $connection->pushOn($queue, $job);
} | [
"protected function callQueueMethodOnHandler($class, $method, $arguments)\n {\n }",
"public function queue() \n {\n IoC::resolve('queue')->push_test($this);\n }",
"public function getHandlerClass();",
"public function handle()\n {\n // Do your queued job\n }",
"public function createHandler($handlerClass);",
"public function handler()\n {\n }",
"public function addMiddleware($className)\n {\n $this->queue[] = $className;\n }",
"final public function addHandlerOnClassDependency(hookHandler $handler, $className) {\n\t\tforeach ($this->classes[$className] as $o) {\n\t\t\t$this->addHandlerOnHandlerDependency($handler,$o);\n\t\t}\n\n\t\t// take into account the handlers registered via do_action/do_filter\n\t\tforeach ($this->getCoreHokkCallbacks() as $priority => $hook) {\n\t\t\t$callback = $hook['function'];\n\t\t\tif (is_array($callback)) {\n\t\t\t\tif (get_class($callback[0]) == $className) {\n\t\t\t\t\t$this->addHandlerOnPriorityDependency($handler,$priority);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function startQueue() {}",
"public function process()\n {\n foreach ($this->handler as $handler)\n {\n $handler->process();\n }\n }",
"public function registerHandler(string $commandClass, callable|string $handler): void;",
"public function addHandler($handler, $commandClassName)\n {\n if (is_callable($handler)) {\n parent::addHandler($handler, $commandClassName);\n }\n $this->commandClasses[$commandClassName] = $handler;\n }",
"public function addHandler($eventClass, $handler);",
"public function setHandlerClass($class)\n {\n $this->handlerClass = $class;\n return $this;\n }",
"public static function queue($event)\n {\n }",
"private function initiateHandlers()\n {\n foreach ($this->handlers as $h) {\n $this->handlerInstances[] = new $h($this->statHandlerObject);\n }\n }",
"protected function initialiseHandlers(){\n foreach($this->handlers as $key=>$handler){\n //initialise the current handler and replace its class in the array with that\n $this->handlers[$key] = new $handler();\n }\n }",
"public function getHandler();",
"public function setHandler($handler);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Outputs the Funnel Lead column image based on image ID. | function funnel_lead_col_image( $url, $size, $link = null ) {
if ( ! $url )
return;
?>
<?php if ( $link ) : ?><a href="<?php echo esc_url( $link ); ?>"><?php endif; ?>
<img src="<?php esc_attr_e( $url ); ?>" alt="<?php echo get_the_title(); ?>" width="" height="" class="col-image>" />
<?php if ( $link ) : ?></a><?php endif; ?>
<?php } | [
"function toImageId($id) {\n return \"pendeltileid$id\";\n}",
"function dIcon($id,$table){\r\n\t\t//get the path of dynamic column icon\r\n\t\t$dpath = t3lib_extMgm::extRelPath(\"nsdynamicc\").'icon/icon-column.png';\r\n\t\t$dHTML = '<a class=\"dcolumn\" data-dinfo=\"'.$id.','.$table.'\" href=\"#\"><img src=\"'.$dpath.'\" alt=\"dcolumn\" /></a>';\r\n\t\treturn $dHTML; \r\n\t}",
"function displayAwardImage($id) \n{\n\n\t$m_images = new controllerClass();\n\t$results=$m_images->getImagesByAwardId($id);\n\tif($results){?>\n\t\t\t<tr>\n<?php\t$i=0;\n\t\twhile($row = mysql_fetch_array($results))\n\t\t{\n\t\t\tif($i%3==0 && $i!=0)\n\t\t\t{\n\t\t\t\techo \"\t\t\t\t</tr>\\n\";\n\t\t\t\techo \"\t\t\t\t<tr valign=\\\"top\\\">\\n\";\n\t\t\t}\n\n\t\t?>\t\t\t\n\t\t\t<td><a href=\"<?php echo $row['image_directory'].$row['image_name']?>\" rel=\"lightbox\" title=\"<?php echo stripslashes($row['image_title']); ?>\">\n\t\t\t<img src=\"<?php echo trim($row['image_directory']).\"/small/\".trim($row['image_name']); ?>\" alt=\"<?php echo stripslashes($row['image_title']); ?>\"></a></td>\n\t\t\t\n<?php \t$i++;\n\t\t} ?>\n\t</tr>\n<?php\n\t}\n}",
"public function showImage()\n\t{\n\t\t$str = \"\";\n\t\tfor ($y = 0; $y < $this->height; $y++) \n\t\t{\n\t\t\t//show y axis\n\t\t\t$str .= (($y + 1) % 10);\n\t\t\t\n\t\t\t//show a line\n\t\t\tfor ($x = 0; $x < $this->width; $x++)\n\t\t\t{\t$id = $this->getId($x, $y);\n\t\t\t\tif ($this->image[$id] == 1)\t{\t$str .= $this->value1;\t}\n\t\t\t\telse\t\t\t\t\t\t{\t$str .= $this->value0;\t}\n\t\t\t}\n\t\t\t$str .= \"<br>\";\n\t\t}\n\t\t\n\t\t//show x axis\n\t\t$str .= \"-\";\n\t\tfor ($x = 0; $x < $this->width; $x++)\n\t\t{\t$str .= (($x + 1) % 10);\t}\n\t\t$str .= \"<br>\";\n\t\treturn $str;\n\t}",
"static function buildImgFonHotels() {\r\n\t\t\techo '<div align=\"center\">';\r\n\t\t\r\n\t\t\techo '<TABLE bgcolor=\"#D2E9FF\">';\r\n\t\t\techo '<TR bgcolor=\"#D2E9FF\">';\r\n\t\t\techo '<TD bgcolor=\"#D2E9FF\">';\r\n\t\t\r\n\t\t\techo '<A href=\"#\"><img src=\"../../../images/imagenfondohotels.jpg\" alt=\"Simadi\" title=\"Fondo\" height=\"620\" width=\"850\"></a>';\r\n\t\t\r\n\t\t\techo '</TD>';\r\n\t\t\techo '</TR>';\r\n\t\t\techo '</TABLE>';\r\n\t\t\techo '</div>';\r\n\t\t\r\n\t\t}",
"public function getDisplayImageIdName()\n {\n $data = $this->model->where($this->role, $this->roleId)->get(['id', 'image_name', 'image_extension'])->toArray();\n\n if($data)\n {\n $this->imageId = $data[0]['id'];\n $this->imageName = $data[0]['image_name'] . '.' . $data[0]['image_extension'];\n }\n }",
"function buildImageDisplay($imageArray) {\n $id = '<ul id=\"image-display\">';\n foreach ($imageArray as $image) {\n $id .= '<li>';\n $id .= \"<img src='$image[imgPath]' title='$image[invMake] $image[invModel] image on PHP Motors.com' alt='$image[invMake] $image[invModel] image on PHP Motors.com'>\";\n $id .= \"<p><a href='/phpmotors/uploads?action=delete&imgId=$image[imgId]&filename=$image[imgName]' title='Delete the image'>Delete $image[imgName]</a></p>\";\n $id .= '</li>';\n }\n $id .= '</ul>';\n return $id;\n }",
"function imgPrinting() {\n\t\n\t\trequire 'connection.php';\n\n\t\t// find row count for a loop\n\t\t$sql = \"SELECT * FROM img\";\n\t\t\t$rs = odbc_exec($connection,$sql);\n\t\t\todbc_fetch_row($rs);\n\t\t\t$rows = odbc_num_rows($rs);\n\n\t\tfor ($i=1; $i <= $rows; $i++) { \n\t\t\t\n\t\t\t$sql = \"SELECT imgPath FROM img WHERE ID=$i\";\n\t\t\t\t$rs = odbc_exec($connection,$sql);\n\t\t\t\todbc_fetch_row($rs);\n\t\t\t\t$imgPath = odbc_result($rs,\"imgPath\");\n\t\t\t\n\t\t\tswitch ($i) {\n\t\t\t\tcase 1:\n\t\t\t\t\t$slideImgs .= \t'<li id=\"' . $i . '\" class=\"hideable\" style=\"display:block;\"> \n \t\t\t\t<img src=\"images/' . $imgPath . '.jpg\" alt=\"i1\" height=\"100%\" max-width= \"580px\" width=\"100%\"> \n \t\t\t\t</li>';\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\t$slideImgs .= \t'<li id=\"' . $i . '\" class=\"hideable\"> \n \t\t\t\t<img src=\"images/' . $imgPath . '.jpg\" alt=\"i2\" height=\"100%\" max-width= \"580px\" width=\"100%\"> \n \t\t\t\t</li>';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $slideImgs;\n\t}",
"function buildImageDisplay($imageArray) {\n $id = '<ul id=\"image-display\">';\n foreach ($imageArray as $image) {\n\n $id .= '<li>';\n $id .= \"<img src='$image[imgPath]' title='$image[invMake] $image[invModel] image on PHP Motors.com' alt='$image[invMake] $image[invModel] image on PHP Motors.com'>\";\n $id .= \"<p><a href='/phpmotors/uploads?action=delete&imgId=$image[imgId]&filename=$image[imgName]' title='Delete the image'>Delete $image[imgName]</a></p>\";\n $id .= '</li>';\n }\n $id .= '</ul>';\n return $id;\n }",
"function get_log_img($id){\n\t\t$id=(int)$id;\n\t\tswitch ($id){\n\t\t\tcase AUTH_LOGGED:\n\t\t\t\t$buffer='<img src=\"images/active.gif\" alt=\"'.$GLOBALS['admin'][112].'\" title=\"'.$GLOBALS['admin'][112].'\" />';\n\t\t\tbreak;\n\t\t\tcase AUTH_FAILED:\n\t\t\t\t$buffer='<img src=\"images/inactive.gif\" alt=\"'.$GLOBALS['admin'][113].'\" title=\"'.$GLOBALS['admin'][113].'\" />';\n\t\t\tbreak;\t\t\n\t\t}\n\t\treturn $buffer;\n\t}",
"function displayPlaqueImage($id) \n{\n\n\t$m_images = new controllerClass();\n\t$results=$m_images->getImagesByPlaqueId($id);\n\tif($results){?>\n\t\t\t<tr>\n<?php\t$i=0;\n\t\twhile($row = mysql_fetch_array($results))\n\t\t{\n\t\t\tif($i%3==0 && $i!=0)\n\t\t\t{\n\t\t\t\techo \"\t\t\t\t</tr>\\n\";\n\t\t\t\techo \"\t\t\t\t<tr valign=\\\"top\\\">\\n\";\n\t\t\t}\n\n\t\t?>\t\t\t\n\t\t\t<td><a href=\"<?php echo $row['image_directory'].$row['image_name']?>\" rel=\"lightbox\" title=\"<?php echo stripslashes($row['image_title']); ?>\">\n\t\t\t<img src=\"<?php echo trim($row['image_directory']).\"/small/\".trim($row['image_name']); ?>\" alt=\"<?php echo stripslashes($row['image_title']); ?>\"></a></td>\n\t\t\t\n<?php \t} ?>\n\t</tr>\n<?php\n\t}\n}",
"public function generate_main_image_id()\n {\n }",
"function get6ColLayout() {\n $return = '';\n\n $return .= '<section class=\"content-panel six-column\">';\n\n $panelTitle = get_sub_field('panel_title');\n if ($panelTitle) {\n $return .= ' <div class=\"row\">\n <div class=\"col-xs-12 text-center padbottom\">\n <h2 class=\"panel-title yellow-underline\">' . $panelTitle . '</h2>\n </div>\n </div>';\n }\n\n $return .= ' <div class=\"image-grid-row\">'; //start row\n //get requested data for each column\n $columns = get_sub_field('column');\n //$columnsCount = count($columns);\n //print_r($columns);\n foreach ($columns as $column) {\n $return .= ' <div class=\"image-grid-col\">'; //start column\n $data = $column['data'];\n \n $imageArr = $data['column_image_field'];\n //var_dump($imageArr['alt']);\n \n $columnInfo = ''; \n //$image = '<img height=\"\" width=\"\" alt=\"'.$imageArr['alt'].'\" class=\"ximg-responsive\" src=\"' . $imageArr['url'] . '\" />';\n //echo $imageArr['url'];\n\n $imgStyle = 'data-bg=\"'.$imageArr['url'].'\"';\n\n $cta_link = $data['image_cta'];\n $ctaText = $data['image_cta_text'];\n\t\t\n\t\t$bgColor = $data['button_color'];\n\n if (!empty($cta_link)) {\n\t\t\tif(!empty($imageArr['url'])) {\n \t$columnInfo = '<a class=\"six-col-img lazyload\" href=\"' . $cta_link . '\" '.$imgStyle.'></a>';\n\t\t\t}\n if (!empty($ctaText)) {\n $columnInfo .= '<p class=\"text-center sub-caption-bottom ' . $bgColor . '\"><a href=\"' . $cta_link . '\" target=\"_blank\">' . $ctaText . '</a></p>';\n }\n } else {\n $columnInfo = $image;\n } \n \n $return .= $columnInfo;\n $return .= '</div>'; //end column\n }\n\n $return .= '</div>'; //end row\n\n $return .= ' </section>'; // end div.container and section.content-panel\n return $return;\n}",
"private function image_block($alliance_image)\n {\n if ($alliance_image != '') {\n return '<tr><th colspan=\"2\">' . FunctionsLib::setImage($alliance_image, $alliance_image) . '</td></tr>';\n }\n\n return '';\n }",
"static function buildImgFonEvaluations() {\r\n\t\t\techo '<div align=\"center\">';\r\n\t\t\t\r\n\t\t\techo '<TABLE bgcolor=\"#D2E9FF\">';\r\n\t\t\techo '<TR bgcolor=\"#D2E9FF\">';\r\n\t\t\techo '<TD bgcolor=\"#D2E9FF\">';\r\n\t\t\t\r\n\t\t\techo '<A href=\"#\"><img src=\"../../../images/imagenfondoeva.jpg\" alt=\"Simadi\" title=\"Fondo\" height=\"500\" width=\"660\"></a>';\r\n\t\r\n\t\t\techo '</TD>';\r\n\t\t\techo '</TR>';\r\n\t\t\techo '</TABLE>';\r\n\t\t\techo '</div>';\r\n\t\r\n\t\t}",
"public function getNextDealImage($id)\n {\n $query = $this->createQueryBuilder('dd')\n ->select('dd.dealCode', 'dd.dealApiId as apiId', 'dcat.name as categoryName', 'dc.cityName', 'di.id as image')\n ->innerJoin('DealBundle:DealCity', 'dc', 'WITH', \"dd.dealCityId=dc.id\")\n ->leftJoin('DealBundle:DealDetailToCategory', 'ddtc', 'WITH', \"dd.id=ddtc.dealDetailsId\")\n ->leftJoin('DealBundle:DealCategory', 'dcat', 'WITH', \"ddtc.dealCategoryId=dcat.apiCategoryId\")\n ->leftJoin('DealBundle:DealImage', 'di', 'WITH', \"dd.id=di.dealDetailId\")\n ->where('dd.id = :detailsId')\n ->setParameter(':detailsId', $id)\n ->orderBy('di.isDefault', 'DESC')\n ->getQuery();\n\n $result = $query->getScalarResult();\n return $result;\n }",
"function dfcg_image_column_contents( $column_name, $post_id ) {\r\n \r\n\tglobal $dfcg_baseimgurl, $dfcg_options, $dfcg_postmeta;\r\n \r\n\t// Check we're only messing with my column\r\n\tif( $column_name !== 'dfcg_image_column' ) return;\r\n \r\n\t// First see if we are using Featured Images for the DCG\r\n\tif( $dfcg_options['image-url-type'] == \"auto\" ) {\r\n \t\r\n\t\t// Grab the manual override URL if it exists\r\n if( $image = get_post_meta( $post_id, $dfcg_postmeta['image'], true ) ) {\r\n \r\n \t$image = $dfcg_baseimgurl . $image;\r\n\t\t\techo '<a href=\"'.$image.'\" class=\"thickbox\" title=\"DCG Metabox URL Override: '.$image.'\">DCG Metabox image</a>';\r\n\t\t\techo '<br /><i>'.__('Featured image is overridden by DCG Metabox image.', DFCG_DOMAIN).'</i><br />';\r\n \t\r\n\t\t\treturn;\t\r\n } \r\n \t\r\n \t\r\n // No override, so show the featured image\r\n\t\t$img = dfcg_get_featured_image( $post_id );\r\n\t\t\t\r\n\t\t//$thumb = get_the_post_thumbnail( $post_id, 'DCG Thumb 100x75 TRUE' );\r\n\t\t\t\r\n\t\tif( $img ) {\r\n\t\t\t\r\n\t\t\t$img_title = 'Featured Image. Size of DCG version: '.$img['w'].'x'.$img['h'].' px';\r\n\t\t\t$info = '(DCG gallery dimensions are '.$dfcg_options['gallery-width'].'x'.$dfcg_options['gallery-height'].' px)';\r\n\t\t\t\t\r\n\t\t\techo '<a href=\"'.$img['src'].'\" class=\"thickbox\" title=\"'.$img_title.' '.$info.'\">';\r\n\t\t\tthe_post_thumbnail( 'DCG_Thumb_100x75_true' );\r\n\t\t\techo '</a><br />';\r\n\t\t\techo 'Featured image';\r\n\t\t} else {\r\n\t\t\techo '<i>' . __('Featured image not set', DFCG_DOMAIN) . '</i>';\r\n }\r\n\t\t\r\n\t// We're using FULL or Partial manual images\r\n\t} else {\r\n\t\t\r\n\t\techo 'DCG Metabox URL:<br />';\r\n\t\t\t\r\n\t\tif( $image = get_post_meta( $post_id, $dfcg_postmeta['image'], true ) ) {\r\n\t\t\t$image = $dfcg_baseimgurl . $image;\r\n\t\t\techo '<a href=\"'.$image.'\" class=\"thickbox\" title=\"DCG Metabox URL: '.$image.'\">'.$image.'</a>';\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\techo '<i>' . __('Not found', DFCG_DOMAIN) . '</i>';\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n}",
"public function convertToImage($imageId);",
"function getImagePanel() {\n //get data submitted on admin page\n \n $return = '';\n $return .= '<section class=\"image-panel container-fluid\">'; // create content-panel section\n\n //get requested data for each column\n $image_rows = get_sub_field('image_row');\n\t$imageRowNum = 0;\n foreach ($image_rows as $image) {\n\t\t$imageRowNum += 1;\n\t\t$imageObj = $image['image'];\n\n if($imageRowNum % 2 != 0){ \n\t\t\t$return .= '<div class=\"row ' . $image['background_color'] . '\">';\n\t\t\t$return .= ' <div class=\"col-sm-4 col-xs-12\">\n\t\t\t\t\t\t\t\t <h4>' . $image['image_title'] . '</h4>\n\t\t\t\t\t\t\t\t <p>' . $image['image_text'] . '</p>';\n\t\t\t if($image['image_links']) {\n\t\t\t\t\t\t\t\t foreach ($image['image_links'] as $image_link) {\n\t\t\t$return .= ' \t <a href=\"' . $image_link['image_link_url'] . '\">' . $image_link['image_link_text'] . '</a>';\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t }\n\t\t\t$return .= ' </div>';\n\t\t\t$return .= ' <div class=\"col-sm-8 col-xs-12\">\n\t\t\t <div class=\"image-display\">';\n\t\t\t\t\t\t\t\t if ($image['image_overlay']['image_overlay_link']) { \n\t\t\t$return .= ' \t\t <a href=\"' . $image['image_overlay']['image_overlay_link'] . '\">';\n\t\t\t\t\t\t\t\t }\n\t\t\t$return .= '\t\t\t <img class=\"img-responsive lazyload\" src=\"' . $imageObj['url'] . '\" alt=\"' . $imageObj['alt'] .'\" />';\n\t\t\t\t\t\t\t\t\t\t\tif ($image['image_overlay']['image_overlay_text']) { \n\t\t\t\t\t\t\t\t\t\t\t $return .= ' <div class=\"image-overlay-text\">' . $image['image_overlay']['image_overlay_text'] . '</div>';;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t if ($image['image_overlay']['image_overlay_link']) { \n\t\t\t$return .= ' </a>';\n\t\t\t\t\t\t\t\t }\n\t\t\t$return .= '\t\t</div>\n\t\t\t </div>';\n\t\t\t$return .= '</div>';\n\t\t} else {\n\t\t\t$return .= '<div class=\"row ' . $image['background_color'] . '\">';\n\t\t\t$return .= ' <div class=\"col-sm-8 col-xs-12\">\n\t\t\t <div class=\"image-display\">';\n\t\t\t\t\t\t\t\t if ($image['image_overlay']['image_overlay_link']) { \n\t\t\t$return .= ' \t\t <a href=\"' . $image['image_overlay']['image_overlay_link'] . '\">';\n\t\t\t\t\t\t\t\t }\n\t\t\t$return .= '\t\t\t <img class=\"img-responsive lazyload\" src=\"' . $imageObj['url'] . '\" alt=\"' . $imageObj['alt'] .'\" />';\n\t\t\t\t\t\t\t\t\t\t\tif ($image['image_overlay']['image_overlay_text']) { \n\t\t\t\t\t\t\t\t\t\t\t $return .= ' <div class=\"image-overlay-text\">' . $image['image_overlay']['image_overlay_text'] . '</div>';;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t if ($image['image_overlay']['image_overlay_link']) { \n\t\t\t$return .= ' </a>';\n\t\t\t\t\t\t\t\t }\n\t\t\t$return .= ' </div>';\n\t\t\t$return .= '</div>';\n\t\t\t$return .= ' <div class=\"col-sm-4 col-xs-12\">\n\t\t\t\t\t\t\t\t <h4>' . $image['image_title'] . '</h4>\n\t\t\t\t\t\t\t\t <p>' . $image['image_text'] . '</p>';\n\t\t\t if($image['image_links']) {\n\t\t\t\t\t\t\t\t foreach ($image['image_links'] as $image_link) {\n\t\t\t$return .= ' \t <a href=\"' . $image_link['image_link_url'] . '\">' . $image_link['image_link_text'] . '</a>';\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t }\n\t\t\t$return .= ' </div>';\n\t\t\t$return .= '</div>';\n\t\t}\n\t}\n\t$return .= '</section>'; // end section/container\n return $return;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate a ticket request. If successful reserve the tickets and redirect to checkout | public function postValidateTickets(Request $request, $event_id)
{
/*
* Order expires after X min
*/
$order_expires_time = Carbon::now()->addMinutes(config('attendize.checkout_timeout_after'));
$event = Event::findOrFail($event_id);
if (!$request->has('tickets')) {
return response()->json([
'status' => 'error',
'message' => 'No tickets selected',
]);
}
$ticket_ids = $request->get('tickets');
/*
* Remove any tickets the user has reserved
*/
ReservedTickets::where('session_id', '=', session()->getId())->delete();
/*
* Go though the selected tickets and check if they're available
* , tot up the price and reserve them to prevent over selling.
*/
$validation_rules = [];
$validation_messages = [];
$tickets = [];
$order_total = 0;
$total_ticket_quantity = 0;
$booking_fee = 0;
$organiser_booking_fee = 0;
$quantity_available_validation_rules = [];
foreach ($ticket_ids as $ticket_id) {
$current_ticket_quantity = (int)$request->get('ticket_' . $ticket_id);
if ($current_ticket_quantity < 1) {
continue;
}
$total_ticket_quantity = $total_ticket_quantity + $current_ticket_quantity;
$ticket = Ticket::find($ticket_id);
$ticket_quantity_remaining = $ticket->quantity_remaining;
$max_per_person = min($ticket_quantity_remaining, $ticket->max_per_person);
$quantity_available_validation_rules['ticket_' . $ticket_id] = [
'numeric',
'min:' . $ticket->min_per_person,
'max:' . $max_per_person
];
$quantity_available_validation_messages = [
'ticket_' . $ticket_id . '.max' => 'The maximum number of tickets you can register is ' . $ticket_quantity_remaining,
'ticket_' . $ticket_id . '.min' => 'You must select at least ' . $ticket->min_per_person . ' tickets.',
];
$validator = Validator::make(['ticket_' . $ticket_id => (int)$request->get('ticket_' . $ticket_id)],
$quantity_available_validation_rules, $quantity_available_validation_messages);
if ($validator->fails()) {
return response()->json([
'status' => 'error',
'messages' => $validator->messages()->toArray(),
]);
}
$order_total = $order_total + ($current_ticket_quantity * $ticket->price);
$booking_fee = $booking_fee + ($current_ticket_quantity * $ticket->booking_fee);
$organiser_booking_fee = $organiser_booking_fee + ($current_ticket_quantity * $ticket->organiser_booking_fee);
$tickets[] = [
'ticket' => $ticket,
'qty' => $current_ticket_quantity,
'price' => ($current_ticket_quantity * $ticket->price),
'booking_fee' => ($current_ticket_quantity * $ticket->booking_fee),
'organiser_booking_fee' => ($current_ticket_quantity * $ticket->organiser_booking_fee),
'full_price' => $ticket->price + $ticket->total_booking_fee,
];
/*
* Reserve the tickets for X amount of minutes
*/
$reservedTickets = new ReservedTickets();
$reservedTickets->ticket_id = $ticket_id;
$reservedTickets->event_id = $event_id;
$reservedTickets->quantity_reserved = $current_ticket_quantity;
$reservedTickets->expires = $order_expires_time;
$reservedTickets->session_id = session()->getId();
$reservedTickets->save();
for ($i = 0; $i < $current_ticket_quantity; $i++) {
/*
* Create our validation rules here
*/
$validation_rules['ticket_holder_first_name.' . $i . '.' . $ticket_id] = ['required'];
$validation_rules['ticket_holder_last_name.' . $i . '.' . $ticket_id] = ['required'];
$validation_rules['ticket_holder_email.' . $i . '.' . $ticket_id] = ['required', 'email'];
$validation_messages['ticket_holder_first_name.' . $i . '.' . $ticket_id . '.required'] = 'Ticket holder ' . ($i + 1) . '\'s first name is required';
$validation_messages['ticket_holder_last_name.' . $i . '.' . $ticket_id . '.required'] = 'Ticket holder ' . ($i + 1) . '\'s last name is required';
$validation_messages['ticket_holder_email.' . $i . '.' . $ticket_id . '.required'] = 'Ticket holder ' . ($i + 1) . '\'s email is required';
$validation_messages['ticket_holder_email.' . $i . '.' . $ticket_id . '.email'] = 'Ticket holder ' . ($i + 1) . '\'s email appears to be invalid';
/*
* Validation rules for custom questions
*/
foreach ($ticket->questions as $question) {
if ($question->is_required && $question->is_enabled) {
$validation_rules['ticket_holder_questions.' . $ticket_id . '.' . $i . '.' . $question->id] = ['required'];
$validation_messages['ticket_holder_questions.' . $ticket_id . '.' . $i . '.' . $question->id . '.required'] = "This question is required";
}
}
}
}
if (empty($tickets)) {
return response()->json([
'status' => 'error',
'message' => 'No tickets selected.',
]);
}
if (config('attendize.enable_dummy_payment_gateway') == TRUE) {
$activeAccountPaymentGateway = new AccountPaymentGateway();
$activeAccountPaymentGateway->fill(['payment_gateway_id' => config('attendize.payment_gateway_dummy')]);
$paymentGateway = $activeAccountPaymentGateway;
} else {
$activeAccountPaymentGateway = count($event->account->active_payment_gateway) ? $event->account->active_payment_gateway : false;
$paymentGateway = count($event->account->active_payment_gateway) ? $event->account->active_payment_gateway->payment_gateway : false;
}
/*
* The 'ticket_order_{event_id}' session stores everything we need to complete the transaction.
*/
session()->put('ticket_order_' . $event->id, [
'validation_rules' => $validation_rules,
'validation_messages' => $validation_messages,
'event_id' => $event->id,
'tickets' => $tickets,
'total_ticket_quantity' => $total_ticket_quantity,
'order_started' => time(),
'expires' => $order_expires_time,
'reserved_tickets_id' => $reservedTickets->id,
'order_total' => $order_total,
'booking_fee' => $booking_fee,
'organiser_booking_fee' => $organiser_booking_fee,
'total_booking_fee' => $booking_fee + $organiser_booking_fee,
'order_requires_payment' => (ceil($order_total) == 0) ? false : true,
'account_id' => $event->account->id,
'affiliate_referral' => Cookie::get('affiliate_' . $event_id),
'account_payment_gateway' => $activeAccountPaymentGateway,
'payment_gateway' => $paymentGateway
]);
/*
* If we're this far assume everything is OK and redirect them
* to the the checkout page.
*/
if ($request->ajax()) {
return response()->json([
'status' => 'success',
'redirectUrl' => route('showEventCheckout', [
'event_id' => $event_id,
'is_embedded' => $this->is_embedded,
]) . '#order_form',
]);
}
/*
* Maybe display something prettier than this?
*/
exit('Please enable Javascript in your browser.');
} | [
"function ticketBuyValidation(){\n //Validirung der Daten\n if($_SERVER['REQUEST_METHOD']==='POST') {\n\n //getPostData gebt die Daten aus dem $_POST zurück (als array)\n $ticketdata = $this->getPostData();\n\n //Validiert die ganzen daten (Serverside Validation)\n $errors = $this->validate($ticketdata);\n\n //Falls keine Fehler / eingabefehler\n if($errors['errorCount'] === 0) {\n if ($this->ticketlistModel === '') {\n $this->ticketlistModel = new TicketlistModel();\n }\n //Daten werden in Datenbank eingetragen\n $this->ticketlistModel->insertTicket($ticketdata['firstname'], $ticketdata['lastname'],\n $ticketdata['email'], $ticketdata['phone'], $ticketdata['reductionid'], $ticketdata['concertid']);\n\n //Zurück zum Form, falls man mehrere Einträge machen möchte\n header('Location: ' . ROOT_URL . '/newticket');\n }\n }\n //Erstellen neue ConcertModel und ReductionModel objekte falls noch keine vorhanden\n if($this->concertModel === ''){\n $this->concertModel = new ConcertModel();\n }\n if($this->reducitonModel === ''){\n $this->reducitonModel = new ReductionModel();\n }\n\n //Aufrufen der Funktionen\n $concerts=$this->concertModel->getConcerts();\n $reductions=$this->reducitonModel->getReduction();\n\n //Einbinden des Views (nur bei Falschinformationen)\n require 'app/Views/buyTicket.view.php';\n }",
"public function postValidateTickets(Request $request, $event_id)\n {\n /*\n * Order expires after X min\n */\n $order_expires_time = Carbon::now()->addMinutes(config('attendize.checkout_timeout_after'));\n\n $event = Event::findOrFail($event_id);\n\n if (!$request->has('tickets')) {\n return response()->json([\n 'status' => 'error',\n 'message' => 'No tickets selected',\n ]);\n }\n\n $ticket_ids = $request->get('tickets');\n\n /*\n * Remove any tickets the user has reserved\n */\n ReservedTickets::where('session_id', '=', session()->getId())->delete();\n\n /*\n * Go though the selected tickets and check if they're available\n * , tot up the price and reserve them to prevent over selling.\n */\n\n $validation_rules = [];\n $validation_messages = [];\n $tickets = [];\n $order_total = 0;\n $total_ticket_quantity = 0;\n $booking_fee = 0;\n $organiser_booking_fee = 0;\n $quantity_available_validation_rules = [];\n\n foreach ($ticket_ids as $ticket_id) {\n $current_ticket_quantity = (int)$request->get('ticket_' . $ticket_id);\n\n if ($current_ticket_quantity < 1) {\n continue;\n }\n\n $total_ticket_quantity = $total_ticket_quantity + $current_ticket_quantity;\n $ticket = Ticket::find($ticket_id);\n $max_per_person = min($ticket->quantity_remaining, $ticket->max_per_person);\n\n $quantity_available_validation_rules['ticket_' . $ticket_id] = [\n 'numeric',\n 'min:' . $ticket->min_per_person,\n 'max:' . $max_per_person\n ];\n\n $quantity_available_validation_messages = [\n 'ticket_' . $ticket_id . '.max' => 'The maximum number of tickets you can register is ' . $max_per_person,\n 'ticket_' . $ticket_id . '.min' => 'You must select at least ' . $ticket->min_per_person . ' tickets.',\n ];\n\n $validator = Validator::make(['ticket_' . $ticket_id => (int)$request->get('ticket_' . $ticket_id)],\n $quantity_available_validation_rules, $quantity_available_validation_messages);\n\n if ($validator->fails()) {\n return response()->json([\n 'status' => 'error',\n 'messages' => $validator->messages()->toArray(),\n ]);\n }\n\n $order_total = $order_total + ($current_ticket_quantity * $ticket->price);\n $booking_fee = $booking_fee + ($current_ticket_quantity * $ticket->booking_fee);\n $organiser_booking_fee = $organiser_booking_fee + ($current_ticket_quantity * $ticket->organiser_booking_fee);\n\n $tickets[] = [\n 'ticket' => $ticket,\n 'qty' => $current_ticket_quantity,\n 'price' => ($current_ticket_quantity * $ticket->price),\n 'booking_fee' => ($current_ticket_quantity * $ticket->booking_fee),\n 'organiser_booking_fee' => ($current_ticket_quantity * $ticket->organiser_booking_fee),\n 'full_price' => $ticket->price + $ticket->total_booking_fee,\n ];\n\n /*\n * Reserve the tickets for X amount of minutes\n */\n $reservedTickets = new ReservedTickets();\n $reservedTickets->ticket_id = $ticket_id;\n $reservedTickets->event_id = $event_id;\n $reservedTickets->quantity_reserved = $current_ticket_quantity;\n $reservedTickets->expires = $order_expires_time;\n $reservedTickets->session_id = session()->getId();\n $reservedTickets->save();\n\n for ($i = 0; $i < $current_ticket_quantity; $i++) {\n /*\n * Create our validation rules here\n */\n $validation_rules['ticket_holder_first_name.' . $i . '.' . $ticket_id] = ['required'];\n $validation_rules['ticket_holder_last_name.' . $i . '.' . $ticket_id] = ['required'];\n $validation_rules['ticket_holder_email.' . $i . '.' . $ticket_id] = ['required', 'email'];\n\n $validation_messages['ticket_holder_first_name.' . $i . '.' . $ticket_id . '.required'] = 'Ticket holder ' . ($i + 1) . '\\'s first name is required';\n $validation_messages['ticket_holder_last_name.' . $i . '.' . $ticket_id . '.required'] = 'Ticket holder ' . ($i + 1) . '\\'s last name is required';\n $validation_messages['ticket_holder_email.' . $i . '.' . $ticket_id . '.required'] = 'Ticket holder ' . ($i + 1) . '\\'s email is required';\n $validation_messages['ticket_holder_email.' . $i . '.' . $ticket_id . '.email'] = 'Ticket holder ' . ($i + 1) . '\\'s email appears to be invalid';\n\n /*\n * Validation rules for custom questions\n */\n foreach ($ticket->questions as $question) {\n if ($question->is_required && $question->is_enabled) {\n $validation_rules['ticket_holder_questions.' . $ticket_id . '.' . $i . '.' . $question->id] = ['required'];\n $validation_messages['ticket_holder_questions.' . $ticket_id . '.' . $i . '.' . $question->id . '.required'] = \"This question is required\";\n }\n }\n }\n }\n\n if (empty($tickets)) {\n return response()->json([\n 'status' => 'error',\n 'message' => 'No tickets selected.',\n ]);\n }\n\n $activeAccountPaymentGateway = $event->account->getGateway($event->account->payment_gateway_id);\n //if no payment gateway configured and no offline pay, don't go to the next step and show user error\n if (empty($activeAccountPaymentGateway) && !$event->enable_offline_payments) {\n return response()->json([\n 'status' => 'error',\n 'message' => 'No payment gateway configured',\n ]);\n }\n\n $paymentGateway = $activeAccountPaymentGateway ? $activeAccountPaymentGateway->payment_gateway : false;\n\n /*\n * The 'ticket_order_{event_id}' session stores everything we need to complete the transaction.\n */\n session()->put('ticket_order_' . $event->id, [\n 'validation_rules' => $validation_rules,\n 'validation_messages' => $validation_messages,\n 'event_id' => $event->id,\n 'tickets' => $tickets,\n 'total_ticket_quantity' => $total_ticket_quantity,\n 'order_started' => time(),\n 'expires' => $order_expires_time,\n 'reserved_tickets_id' => $reservedTickets->id,\n 'order_total' => $order_total,\n 'booking_fee' => $booking_fee,\n 'organiser_booking_fee' => $organiser_booking_fee,\n 'total_booking_fee' => $booking_fee + $organiser_booking_fee,\n 'order_requires_payment' => PaymentUtils::requiresPayment($order_total),\n 'account_id' => $event->account->id,\n 'affiliate_referral' => Cookie::get('affiliate_' . $event_id),\n 'account_payment_gateway' => $activeAccountPaymentGateway,\n 'payment_gateway' => $paymentGateway\n ]);\n\n /*\n * If we're this far assume everything is OK and redirect them\n * to the the checkout page.\n */\n if ($request->ajax()) {\n return response()->json([\n 'status' => 'success',\n 'isEmbedded' => $this->is_embedded,\n 'redirectUrl' => route('showEventCheckout', [\n 'event_id' => $event_id,\n ]) . '#order_form',\n ]);\n }\n\n /*\n * Maybe display something prettier than this?\n */\n exit('Please enable Javascript in your browser.');\n }",
"private function check_ticket() {\n if (!check_ticket(Request::option('ticket'))) {\n throw new InvalidArgumentException(dgettext('doormanplugin', 'Das Ticket für diese Aktion ist ungültig.'));\n }\n }",
"protected function customerValidate(){\n\t\tif($this->config->get('ts_login')){\n\t\t\tif(!$this->customer->getId()){\n\t\t\t\tif(!isset($this->session->data['ts_customer'])){\n\t\t\t\t\t$this->session->data['redirect'] = $this->url->link('ticketsystem/generatetickets','','SSL');\n\t\t\t\t\t$this->response->redirect($this->url->link('ticketsystem/login','','SSL'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function buyTickets(Request $request){\n // Set your secret key: remember to change this to your live secret key in production\n // See your keys here https://dashboard.stripe.com/account/apikeys\n \\Stripe\\Stripe::setApiKey(env('STRIPE_SECRET'));\n\n // Get the credit card details submitted by the form\n $token = $request->token;\n $party = Party::find($request->party_id);\n $total = $request->amount * $party->price * 100;\n\n // Create the charge on Stripe's servers - this will charge the user's card\n try {\n $charge = \\Stripe\\Charge::create(array(\n \"amount\" => $total, // amount in cents, again\n \"currency\" => \"usd\",\n \"source\" => $token,\n \"description\" => \"{$party->amount} ticket(s) to {$party->name}\"\n ));\n event(new TicketPurchased($request));\n\n } catch(\\Stripe\\Error\\Card $e) {\n // The card has been declined\n }\n }",
"public function newticketAction() {\n try {\n $data = $this->getRequest()->getParams();\n if ($data['ticket_id'] != '') {\n $ticketModel = Mage::getModel('inchoo_supportticket/ticket');\n $ticketModel->load($data['ticket_id']);\n } else {\n $ticketModel = Mage::getModel('inchoo_supportticket/ticket');\n }\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n\n if($this->getRequest()->getPost() && !empty($data)) {\n $ticketModel->updateTicketData($customer, $data);\n $ticketModel->save();\n $successMessage = Mage::helper('inchoo_supportticket')->__('New ticket created');\n Mage::getSingleton('core/session')->addSuccess($successMessage);\n\n // used for sending the email\n Mage::dispatchEvent('ticket_added_event_handle', array('customer' => $customer, 'data' => $ticketModel));\n } else {\n throw new Exception(\"Insufficient Data provided\");\n }\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('core/session')->addError($e->getMessage());\n $this->_redirect('*/*/');\n }\n $this->_redirect('tickets/support/list');\n }",
"public function makeRequest()\n {\n\n /** \n * get the information about the ticketed requested\n */ \n\n $number_adults = request('adult');\n $number_child = request('child');\n if(auth()->check()){\n $user_id = auth()->user()->id;\n }\n $email = request('email');\n $name = request('name');\n $vendor_id = request('vendor_id');\n $event_id = request('event_id');\n $event = request('event');\n $adultP = request('adultP');\n $childP = request('childP');\n\n\n /** \n * save in the information in the database \n */ \n \n TicketsRequests::create([\n 'vendors_id' => $vendor_id,\n 'numberTickets_adult' => $number_adults,\n 'numberTickets_child' => !empty($number_child) ? $number_child : null,\n 'user_id' => !empty($user_id) ? $user_id : null,\n 'userName' => $name,\n 'email' =>$email, \n ]);\n\n /** \n *\n * calculate amount to be paid\n *\n */ \n\n $totalChildExpence = $number_child * $childP;\n $totalAdultExpence = $number_adults * $adultP;\n $totalAmountPayment = ($totalAdultExpence + $totalChildExpence) * 100;\n\n /** \n *\n * perform payment\n *\n */ \n\n $token = request('stripeToken');\n Stripe::setApiKey('sk_test_Lguw2wK24pKwyayFLm3jPJUD');\n\n \\Stripe\\Charge::create(array(\n \"amount\" => $totalAmountPayment,\n \"currency\" => \"usd\",\n \"source\" => $token, // obtained with Stripe.js\n \"description\" => \"Charge for ticket event: $event\"\n ));\n\n /** \n * issue tickets and send emails to customer with tickets\n */ \n\n\n\t\t for($i=0; $i < $number_adults; $i++)\n {\n $ticket_adult = ticketed::create([\n \"ticketNumber\" => str_random(10),\n \"email\" => $email,\n \"ticket_type\" => \"adult\",\n 'visitor_name' => $name,\n 'visitor_email' => $email,\n 'user_id' => !empty($user_id) ? $user_id : null,\n 'vendors_id' => $vendor_id,\n 'event_id' => $event_id\n ]);\n }\n if(!empty($number_child))\n {\n for($i=0; $i < $number_child; $i++)\n {\n $random_serial = str_random(10);\n $ticket_child = ticketed::create([\n \"ticketNumber\" => str_random(10),\n \"email\" => $email,\n \"ticket_type\" => \"child\",\n 'visitor_name' => $name,\n 'visitor_email' => $email,\n 'user_id' => !empty($user_id) ? $user_id : null,\n 'vendors_id' => $vendor_id,\n 'event_id' => $event_id\n ]);\n }\n }\n \n // query db to send tickets to users\n\n $query = ticketed::selectRaw('ticketNumber,ticket_type,visitor_name')\n ->where('visitor_email',$email)\n ->whereDate('created_at',date(\"Y-m-d\"))\n ->get();\n \n \n for($i=0; $i < $query->count() ; $i++)\n {\n Mail::to($email)->send(new ticket($query[$i]));\n }\n\n $albums = new album;\n $latestAlbum = $albums->take(4)->get();\n $locations = new locations;\n $locationFooter = $locations->take(6)->get();\n\t\treturn view('completedPurchase',compact('event_id','latestAlbum','locationFooter'));\n }",
"public function check_ticket(){\n $rs = array();\n $arrWhere = array();\n $global_response = array();\n $success_response = array();\n $error_response = array();\n \n $fcode = $this->repo;\n $fticket = $this->input->post('fticket', TRUE);\n $arrWhere = array('fticket'=>$fticket);\n \n //Parse Data for cURL\n $rs_data = send_curl($arrWhere, $this->config->item('api_list_outgoings'), 'POST', FALSE);\n $rs = $rs_data->status ? $rs_data->result : array();\n \n if(!empty($rs)){\n $ticket = \"\";\n $code = \"\";\n foreach ($rs as $r){\n $ticket = filter_var($r->outgoing_ticket, FILTER_SANITIZE_STRING);\n $code = filter_var($r->fsl_code, FILTER_SANITIZE_STRING);\n }\n\n if($code === $fcode){\n $global_response = array(\n 'status' => 1,\n 'message'=> 'FSE Confirmed'\n );\n }else{\n $global_response = array(\n 'status' => 0,\n 'message'=> 'You cannot continue the transaction, please just ask for parts in your own FSL!'\n );\n }\n $response = $global_response;\n }else{\n $success_response = array(\n 'status' => 1,\n 'message'=> 'FSE Confirmed'\n );\n $response = $success_response;\n }\n return $this->output\n ->set_content_type('application/json')\n ->set_output(\n json_encode($response)\n );\n }",
"abstract function validateTicket($ticket, $service);",
"public function testB4aInvalidTicket()\n {\n // test with a date in the past\n $resDateExpired = $this->http->post('/api/v1/organizers/demo1/events/wsc-2019/registration?token='.$this->getLoginToken(), [\n 'json' => [\n 'ticket_id' => 2,\n 'session_ids' => [9, 11],\n ],\n ]);\n\n $this->assertStatusCode(401, $resDateExpired);\n $this->assertResponse([\n 'message' => 'Ticket is no longer available',\n ], $resDateExpired);\n\n // do registration for last available tickets (ticket id 7 already has 34 of 35)\n $resLastAvailable = $this->http->post('/api/v1/organizers/demo1/events/react-conf-2019/registration?token='.$this->getLoginToken(), [\n 'json' => [\n 'ticket_id' => 7,\n 'session_ids' => [24],\n ],\n ]);\n\n $this->assertStatusCode(200, $resLastAvailable);\n $this->assertResponse([\n 'message' => 'Registration successful',\n ], $resLastAvailable);\n\n // register for the same event again, should now longer be possible\n $resMaxAmountReached = $this->http->post('/api/v1/organizers/demo1/events/react-conf-2019/registration?token='.$this->getLoginToken('attendee2'), [\n 'json' => [\n 'ticket_id' => 7,\n 'session_ids' => [24],\n ],\n ]);\n\n $this->assertStatusCode(401, $resMaxAmountReached);\n $this->assertResponse([\n 'message' => 'Ticket is no longer available',\n ], $resMaxAmountReached);\n }",
"function purchase_ticket()\n\t{\n\n $r = $this->ipsclass->DB->build_and_exec_query( array( 'select' => \t\t\t'MAX(round) as round',\n\t\t\t'from' => 'lotto_champs'\n) );\n$new_round = $r['round'] + 1;\n\n\t\t\t$count = $this->ipsclass->DB->build_and_exec_query( array( \t\t\t'select' => 'COUNT(round) AS total',\n\t\t\t'from' => 'lotto',\n\t\t\t'where' => 'm_id='.$this->ipsclass->member['id'].' AND round='.$new_round,\n\t\t\t) );\n\n if($count['total'] >= $this->ipsclass->vars['lotto_limit'])\n\t\t{\n\t\t\t$this->ipsclass->Error(array(LEVEL => 1, MSG => 'error_max_tickets'));\n\t\t}\n\n if($this->ipsclass->vars['lotto_price'] > $this->ipsclass->member['points'])\n\t\t{\n\t\t\t$this->ipsclass->Error(array(LEVEL => 1, MSG => 'error_not_enough_for_ticket'));\n\t\t}\n\t\t\t\t\t \n\t\t$this->output .= $this->ipsclass->compiled_templates['skin_points']->buy_tickets();\t\n\t\t\n\t\t$this->page_title = $this->ipsclass->lang['buy_ticket'];\n\t\t$this->nav[] = $this->ipsclass->lang['navigation'];\n\t}",
"public function test_guest_access_to_ticket_create_page()\n {\n $response = $this->call('GET', '/tickets/create');\n $this->assertEquals(302, $response->status());\n $response->assertRedirect('login');\n }",
"public function new_ticket_transaction(){\n if(wp_verify_nonce($_POST['_wpnonce'], 'aact_continue_to_payment')){\n $api_key = DPAPIKEY;\n $orderid = $this->order->get_order_id();\n $order = $this->order->get_order($orderid);\n $_SESSION['cancelkey'] = wp_generate_uuid4();\n $order['complete_url'] = get_permalink(get_page_by_path('ticket-order-complete'));\n $order['cancel_url'] = get_permalink(get_page_by_path('ticket-test'));\n $order['return_url'] = get_permalink(get_page_by_path('confirm-ticket-order'));\n $order['cancel_key'] = $_SESSION['cancelkey'];\n $transaction = $this->transaction->send_transcation_info($order, $api_key);\n\n\n if(!is_wp_error($transaction)){\n $url = add_query_arg( 'ticket_token', $transaction->ticket_token, $transaction->redirect_url);\n wp_redirect( $url );\n exit;\n }\n\n $_SESSION['alert'] = $transaction->get_error_message().' Order Ref: '.$order['details']->orderID;\n $this->transaction->register_transaction();\n }\n }",
"function hasValidTicket(){\n $ticket = $_GET[\"jatkt\"];\n\t\t \n if ($ticket == null || strlen($ticket) == 0) return false;\n //dump( $ticket );\n $decry = $this->decrypt($ticket);\n $this->parseUserProfile($decry);\n //echo $decry;\n //dump($this->userProfile);\n\t\t //exit;\n if ($this->userProfile == NULL) {\n return false;\n }else {\n $ses = $this->userProfile[\"ja3rdpartySessionID\"];\n if ($ses == NULL || !$ses==session_id()) return false;\n $timestamp = $this->userProfile[\"jaThisLoginTime\"];\n if ($this->isTimestampValid($timestamp)) {\n $this->ticketFromServer = $ticket;\n $this->returnURL = $this->userProfile[\"jaReturnUrl\"];\n return true;\n }else {\n return false;\n }\n }\n }",
"public function resolveTicket()\n {\n $input = Input::all();\n $user = User::where('id', $input['user_id'])->first();\n $ticket = Ticket::where('id', $input['ticket_number'])->first();\n\n if($user->id == $ticket->assignee || $user->role < 2){\n\n if($ticket->category==NULL)\n return redirect()->back()->with('error', 'Please set category first before closing the ticket!');\n\n if($input['resolution']==\"\") return redirect()->back()->with('error', 'Resolution is required when closing a ticket.');\n\n $ticket->resolution = $input['resolution'];\n $ticket->status = 5;\n $ticket->save();\n //$mailer->sendStatusChanged($created_by);\n\n $log = Comment::create([\n 'is_comment' => 0,\n 'comment' => ' closed the ticket.',\n 'user_id' => $user->id,\n 'commenter_role' => $user->role,\n 'ticket_id' => $ticket->id,\n 'class' => 'fa-ticket'\n ]);\n\n return redirect('closed-tickets')->with('message', 'Successfully closed ticket!');\n }\n else return redirect()->back()->with('error', 'You have no permission to close this ticket!');\n }",
"public function store(TicketRequest $request)\n\t{\n\t\t$ticket = Ticket::create([\n\t\t\t'server_check_result_id' => $request->get('server_check_result_id'),\n\t\t\t'raised_at' => Carbon::now(),\n\t\t\t'reference' => $request->get('reference'),\n\t\t\t'ticket_category_id' => $request->get('ticket_category_id'),\n\t\t\t'ticket_priority_id' => $request->get('ticket_priority_id'),\n\t\t\t'ticket_type_id' => $request->get('ticket_type_id'),\n\t\t\t'summary' => $request->get('summary'),\n\t\t\t'description' => $request->get('description'),\n\t\t]);\n\t\t\n\t\t$server_check_result = ServerCheckResult::find($request->get('server_check_result_id'));\n\t\t$server_check_result->ticket_id = $ticket->id;\n\t\t$server_check_result->save();\n\t\tforeach ($server_check_result->serverCheckResults as $child)\n\t\t{\n\t\t\t$child->ticket_id = $ticket->id;\n\t\t\t$child->save();\n\t\t}\n\t\t\n\t\treturn redirect('status/server/' . $request->get('server_id'));\n\t}",
"protected function doesTicketFitCourse()\n\t{\n if ($this->ticket && $this->course) {\n // Check if the course still has space for the wanted ticket\n $bookedTicketsQuantity = $this->course->bookingdetails()\n ->where('ticket_id', $this->ticket->id)\n ->where('customer_id', $this->customer->id)\n ->where('booking_id', $this->booking_id)\n ->count();\n\n if ($bookedTicketsQuantity >= $this->course->tickets()->where('id', $this->ticket->id)->first()->pivot->quantity) {\n\t\t\t\tthrow new HTTPForbiddenException(['The ticket cannot be assigned because the course\\'s limit for the ticket is reached.']);\n }\n }\n\t}",
"public function approveTicket(Request $request)\n\t\t{\n\t\t\tif(isset($_POST['ticket_id']))\n\t\t\t{\t\n\t\t\t\t$ticket_id = $_POST['ticket_id'];\n\t\t\t\t$ins_data['status'] = 'approve';\n\t\t\t\ttickets::where('id',$ticket_id)->update($ins_data);\n\t\t\t}\n\t\t}",
"public function newcheckreqAction()\n {\n // If no case ID or case need ID was provided, bail out.\n if (!$this->_hasParam('caseId')) {\n throw new UnexpectedValueException('No case ID parameter provided');\n }\n\n if (!$this->_hasParam('needId')) {\n throw new UnexpectedValueException('No case need ID parameter provided');\n }\n\n // Get information on the case associated with this new check request.\n $service = new App_Service_Member();\n $case = $service->getCaseById($this->_getParam('caseId'));\n\n // Don't allow any new check requests on needs in closed cases.\n if ($case->getStatus() === 'Closed') {\n throw new DomainException(\"Can't modify closed cases\");\n }\n\n // Create the check request form.\n $needId = $this->_getParam('needId');\n $this->view->pageTitle = 'New Check Request';\n $this->view->case = $case;\n $this->view->form = new Application_Model_Member_CheckReqForm($case, $needId);\n\n // If this isn't a POST request or form validation fails, bail out.\n $request = $this->getRequest();\n\n if (!$request->isPost()) {\n return;\n }\n\n if (!$this->view->form->isValid($request->getPost())) {\n return;\n }\n\n // If everyone's kosher with the form, then we can add the check request and redirect back\n // to the case view page.\n $userId = Zend_Auth::getInstance()->getIdentity()->user_id;\n\n $needs = $case->getNeeds();\n $need = $needs[$needId];\n\n $checkReq = $this->view->form->getCheckReq();\n $checkReq\n ->setCaseNeedId($needId)\n ->setUserId($userId)\n ->setRequestDate(date('Y-m-d'))\n ->setAmount($need->getAmount())\n ->setStatus('P');\n\n $service->createCheckRequest($checkReq);\n\n $this->_helper->redirector('viewCase', App_Resources::MEMBER, null, array(\n 'id' => $case->getId(),\n ));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the rolls as an array. | public function GetRollsAsArray() {
return $this->rolls;
} | [
"public function roll() : array\n {\n $this->lastRoll = [];\n foreach ($this->dices as $dice) {\n $this->lastRoll[] = $dice->roll();\n }\n return $this->getLastRoll();\n }",
"public function getRolls()\n {\n return $this->rolls;\n }",
"public function getDiceArray()\n {\n return $this->diceArray;\n }",
"public function getRolComoArray()\n {\n $objetoRol=$this->rol;\n $roles = [\"0\"=>$objetoRol->getRol()];\n return $roles;\n }",
"public function roll()\n {\n $this->lastRoll = [];\n for ($i = 0; $i < $this->dices; $i++) {\n array_push($this->lastRoll, $this->random());\n }\n return $this->lastRoll;\n }",
"public function trueRoll(): array\n {\n // Check what user wanna keep\n $trueRoll = [false, false, false, false, false];\n $check = session(\"check\");\n if ($check) {\n $len = sizeof($check);\n for ($i = 0; $i < $len; $i++) {\n $trueRoll[$check[$i]] = true;\n }\n }\n\n return $trueRoll;\n }",
"public function rolls()\n\t{\n\t\treturn $this->hasMany('Roll');\n\t}",
"public function getSails() {\n if ($this->rotation === null)\n return array();\n return $this->__get('rotation')->sails;\n }",
"public function toArray()\n {\n return $this->rings;\n }",
"public function getTotal() \r\n {\r\n return array_sum($this->lastRoll);\r\n }",
"function toArray(){\n\t\treturn $this->_SessionStorer->toArray();\n\t}",
"public function getLogsArray()\n {\n $result = array();\n foreach ($this->getLogs() as $log) {\n $result[] = $log->toArray();\n }\n\n return $result;\n }",
"public function getShelvesArray()\r\n {\r\n return $this->pushers()\r\n ->groupBy('shelf_number')\r\n ->lists('shelf_number');\r\n }",
"public function convertSheetsToArray($sheets);",
"public function resultsAsArray();",
"public function rolls()\n {\n return $this->getRows(\"SELECT * FROM `article` ORDER BY `id` DESC LIMIT 3\");\n }",
"public function toArray(): array\n\t{\n\t\treturn $this->stories->toArray();\n\t}",
"function getAllRotations(){\n\t\ttry{\n\t\t\t$data = array();\n\t\t\t$stmt = $this->db->prepare(\"SELECT * FROM rotation\");\n\t\t\t$stmt->execute();\n\n\t\t\t$data = $stmt->fetchAll(PDO::FETCH_CLASS,'rotation');\n\n\t\t\treturn $data;\n\t\t}\n\t\tcatch(PDOException $e){\n\t\t\techo \"getAllRotations - \".$e->getMessage();\n\t\t\tdie();\n\t\t}\n\t\treturn $data;\n\t}",
"public function getOrderMealsAsArray()\r\n {\r\n $orderMeals = $this->orderMeals instanceof Collection ? $this->orderMeals->toArray() : $this->orderMeals;\r\n\r\n return array_values($orderMeals);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the user can store an Attachment to the patient. | public function storeAttachment(User $user, Patient $patient)
{
return $user->isAdminOrPractitioner() || $user->is($patient->user);
} | [
"public function allowsAttachments() {\n\t\treturn (bool) $this->attachments;\n\t}",
"public function canPostAttachments() {\n return $this->xpdo->discuss->user->isLoggedIn && $this->xpdo->hasPermission('discuss.thread_attach');\n }",
"abstract protected function is_valid_attach_for_request();",
"public function hasAttachment(): bool\n {\n return false;\n }",
"public function isAttachment(): bool\n\t{\n\t\treturn $this->isOfType( static::TYPE_ATTACHMENT );\n\t}",
"protected function check_attachment_auth()\n\t{\n\t\treturn $this->attachment->object_type == ext::TITANIA_CONTRIB &&\n\t\t\t!$this->attachment->is_orphan &&\n\t\t\t$this->attachment->attachment_access == access::PUBLIC_LEVEL;\n\t}",
"function yzea_is_user_can_edit_attachments() {\r\n\t\r\n\t$can = false;\r\n\r\n\tif ( yzea_is_moderator() || 'on' == yz_options( 'yzea_attachments_edition' ) ) {\r\n\t\t$can = true;\r\n\t}\r\n\t\r\n\treturn apply_filters( 'yzea_is_user_can_edit_attachments', $can );\r\n}",
"public function isAttachment() {\n return (MIME_DISPOSITION_ATTACHMENT == $this->disposition);\n }",
"abstract protected function _canUploadAndManageAttachments(array $contentData, array $viewingUser);",
"protected function is_submission_feedback_attachment()\n {\n if (is_null($this->get_submission_id()))\n {\n return false;\n }\n \n $assignment_submission = WeblcmsTrackingDataManager::retrieve_by_id(\n AssignmentSubmission::class_name(), \n $this->get_submission_id());\n \n if ($assignment_submission->get_publication_id() != $this->get_publication_id())\n {\n return false;\n }\n \n $feedbacks = WeblcmsTrackingDataManager::retrieves(\n SubmissionFeedback::class_name(), \n new EqualityCondition(\n new PropertyConditionVariable(\n SubmissionFeedback::class_name(), \n SubmissionFeedback::PROPERTY_SUBMISSION_ID), \n new StaticConditionVariable($assignment_submission->get_id())));\n \n while ($feedback = $feedbacks->next_result())\n {\n $content_object = \\Chamilo\\Core\\Repository\\Storage\\DataManager::retrieve_by_id(\n ContentObject::class_name(), \n $feedback->get_content_object_id());\n if ($content_object->is_attached_to_or_included_in($this->get_object_id()))\n {\n return true;\n }\n }\n \n return false;\n }",
"public function is_valid_save() {\n\t\tif ( ! $this->is_profile_page() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $this->verified_nonce_in_request() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$params = func_get_args();\n\t\treturn $this->is_valid_attach_for_object( $params[0] );\n\t}",
"public function attachmentPermissionCheck( $member, $id1, $id2, $id3 )\n\t{\n\t\treturn TRUE;\n\t}",
"function user_may_access_attachment( $user, $id )\r\n {\r\n // NOTE: This implementation is pretty dumb...\r\n \r\n // Get the component parameters\r\n jimport('joomla.application.component.helper');\r\n $params = JComponentHelper::getParams('com_attachments');\r\n $who_can_see = $params->get('who_can_see', 'logged_in');\r\n $logged_in = $user->get('username') <> '';\r\n \r\n if ( ( $who_can_see == 'anyone' ) ||\r\n ( ($who_can_see == 'logged_in') && $logged_in ) ) {\r\n return true;\r\n }\r\n \r\n return false;\r\n }",
"public function hasAttachment()\n {\n return $this->Attachment !== null;\n }",
"public function isAllowUserUpload();",
"function canPdf()\n {\n if (!isset($this->Permissions[\"can_pdf\"])) {\n $this->Permissions[\"can_pdf\"] = $this->checkAccess('pdf');\n }\n\n return ($this->Permissions[\"can_pdf\"] == 1);\n }",
"function can_edit( $attachment ) {\n\treturn $attachment && current_user_can( 'edit_post', $attachment->ID ) && $attachment->post_type === 'attachment';\n}",
"protected function canUpload() {\n // If the property has been set, return it\n if (isset($this->canUpload)) {\n return $this->canUpload;\n } else {\n // Check config and user role upload permission\n if (c('Garden.AllowFileUploads', true) && Gdn::session()->checkPermission('Plugins.Attachments.Upload.Allow', false)) {\n // Check category-specific permission\n $permissionCategory = CategoryModel::permissionCategory(Gdn::controller()->data('Category'));\n $this->canUpload = val('AllowFileUploads', $permissionCategory, true);\n } else {\n $this->canUpload = false;\n }\n }\n return $this->canUpload;\n }",
"public function attachmentExists()\n {\n foreach ($this->attachment as $attachment) {\n if ($attachment[6] == 'attachment') {\n return true;\n }\n }\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get feed message by id | public function getFeedMessageById($id)
{
$sql = 'SELECT * FROM chat_feed_message WHERE id=:id ';
return $this->_rdb->fetchRow($sql, array('id' => $id));
} | [
"public function get_message_by_id($id){\n $sql = \"SELECT * FROM messages WHERE message_ID='$id';\";\n $result = mysqli_query($this->connection, $sql);\n if($result){\n return $this->get_message_data($result);\n }\n }",
"public function getById($id) {\n\n $sql = \"SELECT * FROM feed WHERE id = {$id}\";\n return $this->query($sql);\n }",
"public function getMessageById($id)\n {\n foreach ($this->messages as $message) {\n if ($id == $message->getId()) {\n return $message;\n }\n }\n\n }",
"public function findById($id)\n\t{\n\t\treturn Message::find($id);\n\t}",
"public function getByID($id)\n {\n return $this->dao->select('*')->from(TABLE_MESSAGE)->where('id')->eq($id)->fetch('', false);\n }",
"function get_message_by_id($id) {\n\t\t$this->connect();\n\n\t\t$prepare_stmt = $this->connection->prepare(\"SELECT * FROM message WHERE id = ?\");\n\t\t$prepare_stmt->bind_param('i', $id);\n\t\t$prepare_stmt->execute();\n\n\t\t$result = $prepare_stmt->get_result();\n\t\t\n\t\t$row = $result->fetch_assoc();\n\n\t\trequire_once($_SERVER['DOCUMENT_ROOT'].\"/model/message_model.php\");\n\t\t$msg_model = new MessageModel($row['text'], $row['date'], $row['time_to_live'], $row['id']);\n\t\t$prepare_stmt->close();\n\t\treturn $msg_model;\n\t\t\n\t}",
"function getMessageById($id){\n\t\t\t$xmlParser = new St_XmlParser();\n\t\t\t$messageArray = $xmlParser->parseMessagesToArray($this->messageFile);\n\t\t\t\n\t\t\tif(is_array($messageArray)){\n\t\t\t\tforeach ($messageArray as $key=>$value){\n\t\t\t\t\tif($value['datetime'] == $id){\n\t\t\t\t\t\t$messageFound = $messageArray[$key];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(isset($messageFound)){\n\t\t\t\treturn $messageFound;\n\t\t\t}else{\n\t\t\t\treturn null;\n\t\t\t}\t\t\n\t\t\t\n\t\t}",
"public function findMessageById($message_id);",
"public function read($id)\n\t{\n\t\t$data['title'] = 'Messagerie';\n\t\t$data['conversations'] = $this->messaging_model->lists($id);\n\t\t$data['id_autre'] = $id;\n\t\tif(empty($data['conversations'])) //redirection if id does not exist private message\n\t\t\tredirect('messaging/index');\n\t\t$this->messaging_model->markRead($id);\n\t\t$this->construct_page('messaging/read', $data);\n\t}",
"function getNotification($id);",
"public static function find_one_by_id($id = null)\n {\n $id = \\DB::escape($id);\n $result = \\DB::query(\"SELECT * FROM `messages` WHERE `id` = $id LIMIT 1\")->as_object()->execute();\n if (count($result) != 1)\n {\n return false;\n }\n return $result[0];\n }",
"public function findAllMyMessageById($id) {\r\n $query = $this->conn->prepare('SELECT t2.* FROM (SELECT t.id, c.Speudo, t.Creator, t.Message, t.Date\r\n FROM `folowers` f\r\n INNER JOIN tweet t ON t.Creator = f.id_profile\r\n INNER JOIN compte c ON c.id = f.id_profile\r\n WHERE f.id_follower = :id\r\n UNION\r\n SELECT t.id, c.Speudo, t.Creator, t.Message, t.Date\r\n FROM tweet t\r\n INNER JOIN compte c ON c.id = t.Creator\r\n WHERE t.Creator = :id\r\n UNION\r\n SELECT t.id, c.Speudo, t.Creator, t.Message, t.Date\r\n \tFROM user_tweet us\r\n \tINNER JOIN tweet t ON t.id = us.tweet_id\r\n INNER JOIN compte c ON c.id = t.Creator\r\n WHERE us.user_id = :id\r\n )AS t2 ORDER BY t2.Date DESC');\r\n $query->execute([\r\n ':id' => $id\r\n ]); \r\n $elements = $query->fetchAll(\\PDO::FETCH_ASSOC);\r\n if (count($elements) === 0) return null;\r\n \r\n $messages = [];\r\n $message = null;\r\n foreach($elements as $element) {\r\n $message = new MessageGateway($this->app);\r\n $message->hydrate($element);\r\n\r\n $messages[] = $message;\r\n }\r\n\r\n return $messages;\r\n }",
"public function readMessage($id) {\n\t\t$response = null;\n\t\tif ($id) {\n\t\t\t$urlMessage = \"{$this->apiHost}/read_message\";\n\t\t\t$postData = sprintf ( \"id=%s&uh=%s\", $id, $this->modHash );\n\t\t\t$response = $this->runCurl ( $urlMessage, $postData );\n\t\t}\n\t\treturn $response;\n\t}",
"public function byId($id)\n {\n return Conversation::find($id);\n }",
"public function findConversation($id);",
"public function get($id)\n {\n try {\n $conversation = $this->conversation\n ->where('id', $id)\n ->with([\n 'messages' => function ($query) {\n $query->orderBy('created_at', 'DESC');\n },\n 'messages.sender'])\n ->with(['userOne', 'userTwo', 'latestMessage.sender'])\n ->firstOrFail();\n return $conversation;\n } catch (ModelNotFoundException $e) {\n return false;\n }\n }",
"public function selectMessageByID($id) {\n $result = $this->sdb->query(\n 'select m.*,to_char(m.time_sent, \\'YYYY-MM-DD\"T\"HH24:MI:SS\\') as sent_date from messages m where m.id = $1',\n array($id));\n $all = array();\n while ($row = $this->sdb->fetchrow($result))\n {\n array_push($all, $row);\n }\n\n if (count($all) === 1)\n return $all[0];\n\n return array();\n\n }",
"public function find(string $event, string $id): ?Message\n {\n return $this->items[$event][$id] ?? null;\n }",
"public function getById($id)\n {\n $sql = sprintf('SELECT * FROM ats_feed_type WHERE id = %d', $id);\n return $this->_db->query($sql)->fetch();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For example, file 2 in batch size of 10. Ordinal, 1based numbering. Note: Not yet supported on iOS. Generated from protobuf field int32 batch_num = 4; | public function setBatchNum($var)
{
GPBUtil::checkInt32($var);
$this->batch_num = $var;
return $this;
} | [
"public function getNextBatchNumber() : int\n {\n return $this->getLastBatchNumber() + 1;\n }",
"function GetBatchCount(){}",
"public function batchSize($batchSize){}",
"public function batchSize(): int\n {\n }",
"public function getNextBatchNumber()\n {\n return $this->getLastBatchNumber() + 1;\n }",
"public function getBatchLimit(): int\n {\n }",
"public static function autoBatchCount(): int;",
"public function createBatch()\n {\n //creation url du batch\n $url=$this->url.\"/upload/\";\n\n //creation de la requete\n $reponse=\\Guzzle::post($url,[\n 'auth' => [ $this->user, $this->pass],\n ]);\n\n //récupère la réponse http contenant le batchid\n $out=$reponse->getBody();\n\n #decode le json en array\n $out=json_decode($out,true);\n\n /*print \"Batchid : \";\n print_r($out);*/\n\n //retourne l'uid du dossier/fichier créé\n return $out['batchId'];\n\n }",
"protected function get_max_batch_size()\n {\n }",
"public function getBatchCount()\n {\n return $this->batches;\n }",
"public function determineLastBatchId() {\n\n }",
"function getCurrentChunkNumber();",
"public function getBatchId()\n {\n return $this->batch_id;\n }",
"public function getBatchId()\n {\n return $this->_batchId;\n }",
"public function getBatchID()\n {\n return $this->batchID;\n }",
"public function process( $batch_size = null );",
"public function getLastBatchNumber()\n {\n return $this->table()->max('batch');\n }",
"private static function create_generic_batch() {\n\t\t$batch_name = self::get_generic_batch_name();\n\t\t$batch_id = TranslationProxy_Batch::update_translation_batch( $batch_name );\n\n\t\treturn $batch_id;\n\t}",
"function tool_copy_buckets_batch_size( $value ) {\n\t\t// Example decreases number of attachments in batch to analyse.\n\t\treturn 50;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all the instructors including those in groups | public function getAllInstructors(); | [
"public function getInstructors() {\n \treturn $this->getOffering()->getInstructors();\n }",
"public function getInstructors()\n {\n $deptList = array();\n return $deptList;\n }",
"public function instructors()\n {\n return $this->belongsToMany('User', 'course_instructor');\n }",
"public function getInstructors() {\n\t\t$where = array(\n\t\t\t\"Status\" => 1,\n\t\t\t\"MarkAsDelete\" => 0\n\t\t);\n\t\t$query = $this->db->order_by('InstrucId','desc');\n\t\t$query = $this->db->get_where('instructor',$where);\n\t\t$result = $query->result_array();\n\t\tif($query){\n\t\t\treturn $result;\n\t\t}else{\n\t\t\treturn false;\n\t\t} \n\t}",
"public function fetchInstructors()\n {\n $aInstructors = $this->oInstructorsModel->fetchInstructors();\n\n // Filter the data before returning to front-end.\n foreach ($aInstructors as $iKey => $aInstructor) {\n $aInstructors[$iKey]['fullName'] = $aInstructor['firstName'] . ' ' . $aInstructor['lastName'];\n }\n\n echo json_encode($aInstructors);\n }",
"public function fetchInstructors()\n {\n // Prepare a select query.\n $oStatement = $this->oConnection->prepare(\"\n SELECT\n tu.userId AS id, tu.firstName, tu.middleName, tu.lastName,\n tu.contactNum, tu.email, tu.certificationTitle, tu.status\n FROM tbl_users tu\n WHERE tu.position = 'Instructor'\n \");\n\n // Execute the above statement.\n $oStatement->execute();\n\n // Return the number of rows returned by the executed query.\n return $oStatement->fetchAll();\n }",
"static function getInstructor_Courses() {\n $sql = \"SELECT Distinct Instructor.FirstName,Instructor.LastName,Course.CourseShortName,Course.CourseLongName,\n Instructor_Course.InstructorID,Instructor_Course.CourseID\n FROM Instructor join Course \n join Instructor_Course\n on Instructor.InstructorID=Instructor_Course.InstructorID\n and Instructor_Course.CourseID = Course.CourseID;\";\n\n //Prepare the Query\n self::$_db->query($sql);\n self::$_db->execute();\n //Return the results\n return self::$_db->resultset();\n //Return row\n }",
"function getInstructors()\n {\n try\n {\n $dbObj = new Database();\n $db = $dbObj->getConnection();\n $query = \"Select UserID, FirstName, LastName , Email \"\n . \"From UserAccount \"\n . \"Where UserRole = 2 OR UserRole = 4\";\n $statement = $db->prepare($query);\n $statement->execute();\n $instructors = $statement->fetchAll();\n $statement->closeCursor();\n\n return $instructors;\n } catch (PDOException $e)\n {\n //$error_message = $e->getMessage();\n //error_log($error_message, (int)0,\"./error.txt\");\n return \"Could not retrieve instructor list\";\n }\n }",
"public function _load_instructors() {\n\t\t$this->data['instructors'] = array();\n\n\t\t$sql = \"SELECT * FROM sirasgn WHERE sirasgn_crn = :crn AND sirasgn_term_code = :term_code\";\n\n\t\t$args = array(\n\t\t\t'crn' => $this->crn,\n\t\t\t'term_code' => $this->term_code\n\t\t);\n\n\t\tif($results = \\PSU::db('banner')->Execute($sql, $args)) {\n\t\t\tforeach($results as $row) {\n\t\t\t\t$row = \\PSU::cleanKeys('sirasgn_', '', $row);\n\t\t\t\t$this->data['instructors'][] = $row['pidm'];\n\t\t\t}//end foreach\n\t\t}//end if\n\t}",
"public static function getAllInstructors($a_provider_id, $a_with_archived = false)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$sql = \"SELECT id,last_name,first_name\".\n\t\t\t\" FROM adn_ta_instructor\".\n\t\t\t\" WHERE ta_provider_id = \".$ilDB->quote($a_provider_id, \"integer\");\n\t\tif(!$a_with_archived)\n\t\t{\n\t\t\t$sql .= \" AND archived < \".$ilDB->quote(1, \"integer\");\n\t\t}\n\t\t$res = $ilDB->query($sql);\n\t\t$all = array();\n\t\t$ids = array();\n\t\twhile($row = $ilDB->fetchAssoc($res))\n\t\t{\n\t\t\t$ids[] = $row[\"id\"];\n\t\t\t$all[$row[\"id\"]] = $row;\n\t\t}\n\n\t\t// add instructor training types\n\t\t$set = $ilDB->query(\"SELECT ta_instructor_id,training_type\".\n\t\t\t\" FROM adn_ta_instr_ttype\".\n\t\t\t\" WHERE \".$ilDB->in(\"ta_instructor_id\", $ids, false, \"integer\"));\n\t\twhile ($rec = $ilDB->fetchAssoc($set))\n\t\t{\n\t\t\t$all[$rec[\"ta_instructor_id\"]][\"type_of_training\"][] = $rec[\"training_type\"];\n\t\t}\n\n\t\t// add instructor expertise\n\t\t$set = $ilDB->query(\"SELECT ta_instructor_id,ta_expertise_id\".\n\t\t\t\" FROM adn_ta_instructor_exp\".\n\t\t\t\" WHERE \".$ilDB->in(\"ta_instructor_id\", $ids, false, \"integer\"));\n\t\twhile ($rec = $ilDB->fetchAssoc($set))\n\t\t{\n\t\t\t$all[$rec[\"ta_instructor_id\"]][\"area_of_expertise\"][] = $rec[\"ta_expertise_id\"];\n\t\t}\n\n\t\treturn $all;\n\t}",
"public function getInstructorsForOffering (osid_id_Id $offeringId);",
"protected function get_ask_instructor_users() {\n\n // If we don't already have a cached list of Ask Instructor instructors, then retrieve the user list from the database.\n if($this->instructors === null) {\n $this->instructors = get_users_by_capability($this->context, 'block/quickmail:recieveaskinstructor', 'u.id, u.firstname, u.lastname, u.email, u.mailformat');\n }\n\n // Return the list of instructors who should recieve Ask Instructor users in this context.\n return $this->instructors;\n }",
"public function single_course_instructors() {\n\t\t\t$course = LP_Global::course();\n\n\t\t\t$course_id = $course->get_id();\n\t\t\t$instructors = $this->get_instructors( $course_id );\n\n\t\t\tlearn_press_get_template( 'single-course-tab.php', array( 'instructors' => $instructors ), learn_press_template_path() . '/addons/co-instructors/', LP_ADDON_CO_INSTRUCTOR_TEMPLATE );\n\t\t}",
"public function getInstructorIds() {\n \t$val = $this->cacheGetObj('instructor_ids');\n \tif (is_null($val))\n \t\treturn $this->cacheSetObj('instructor_ids', $this->getOffering()->getInstructorIds());\n \telse\n \t\treturn $val;\n }",
"public function instructorsAction()\n {\n $this->_initInstructordoc();\n $this->loadLayout();\n $this->getLayout()->getBlock('instructordoc.edit.tab.instructor')\n ->setInstructordocInstructors($this->getRequest()->getPost('instructordoc_instructors', null));\n $this->renderLayout();\n }",
"public abstract function getcoursesbyinstructor($instructor);",
"function getAllCoursesByInstructorID($instructor_id){\n\t\tcheckConnectivity1();\n\n\t\t$list= array();\n\t\t$query =sprintf(\"select * from course where instructor_id = %s\",$instructor_id);\n\t\t$result =mysqli_query($GLOBALS['connection_link'],$query);\n\t\twhile($row = mysqli_fetch_assoc($result)){\n\t\t\t$list[]=$row;\n\t\t}\n\n\t\treturn $list;\n\n\t}",
"public abstract function getextcoursesbyinstructor($instructor);",
"public function get_organisers(){\n $sql = \"SELECT DISTINCT * from members WHERE members.id IN \"\n .\"(SELECT organiserID FROM tournamentOrganisers WHERE tournamentID=$this->id)\";\n return Member::find_by_sql($sql);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
HouseholdClusterByTeam. /=================================================================================== ChildClusterByLocation ================================================================================== Return child cluster x location table. This method can be used to get a matrix of clusters by locations for the child dataset. | public function ChildClusterByLocation()
{
return
$this->getMatrixTable(
self::kDDICT_CHILD_ID,
'Clusters',
self::kDATASET_OFFSET_CLUSTER,
self::kDATASET_OFFSET_LOCATION
); // ==>
} | [
"public function ChildClusterByTeam()\n\t{\n\t\treturn\n\t\t\t$this->getMatrixTable(\n\t\t\t\tself::kDDICT_CHILD_ID,\n\t\t\t\t'Clusters',\n\t\t\t\tself::kDATASET_OFFSET_CLUSTER,\n\t\t\t\tself::kDATASET_OFFSET_TEAM\n\t\t\t);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ==>\n\n\t}",
"public function MotherClusterByLocation()\n\t{\n\t\treturn\n\t\t\t$this->getMatrixTable(\n\t\t\t\tself::kDDICT_MOTHER_ID,\n\t\t\t\t'Clusters',\n\t\t\t\tself::kDATASET_OFFSET_CLUSTER,\n\t\t\t\tself::kDATASET_OFFSET_LOCATION\n\t\t\t);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ==>\n\n\t}",
"public function cluster()\n {\n $pairs = $this->generatePairs($this->inputData);\n $this->clusters = $this->doCluster($pairs);\n return $this->clusters;\n }",
"public function HouseholdTeamByLocation()\n\t{\n\t\treturn\n\t\t\t$this->getMatrixTable(\n\t\t\t\tself::kDDICT_HOUSEHOLD_ID,\n\t\t\t\t'Teams',\n\t\t\t\tself::kDATASET_OFFSET_TEAM,\n\t\t\t\tself::kDATASET_OFFSET_LOCATION\n\t\t\t);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ==>\n\n\t}",
"public function getClusters() {\r\n $clusters = Array();\r\n foreach ($this->_clusters as $value) {\r\n $clusters[] = new Cluster($this->_db, $value);\r\n }\r\n return $clusters;\r\n }",
"public function MotherTeamByLocation()\n\t{\n\t\treturn\n\t\t\t$this->getMatrixTable(\n\t\t\t\tself::kDDICT_MOTHER_ID,\n\t\t\t\t'Teams',\n\t\t\t\tself::kDATASET_OFFSET_TEAM,\n\t\t\t\tself::kDATASET_OFFSET_LOCATION\n\t\t\t);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ==>\n\n\t}",
"public function getClusterObject(): \\Couchbase\\Cluster\n\t{\n\t\treturn $this->_cluster_object;\n\t}",
"private function load_game_clusters() {\n $this->game_location_clusters = db_table_query(sprintf(\n \"SELECT `cluster_id`, `num_locations`, `description`, `force_location_on_enter` FROM `game_location_clusters` WHERE `game_id` = %s ORDER BY `cluster_id` ASC\",\n $this->game_id\n ));\n Logger::debug(sprintf(\n \"Game #%s has %d location clusters\",\n $this->game_id,\n count($this->game_location_clusters)\n ), __FILE__, $this->owning_context);\n }",
"public function hcluster() {\n $this->init();\n while( count($this->clusters) >1 ) {\n //for($c=0;$c<2;$c++) {\n extract( $this->findClosestPair() ); //pair,distance\n $branches['left'] = $this->clusters[reset($pair)];\n $branches['right'] = $this->clusters[end($pair)];\n $avgVec = $branches['left']->mergeVec($branches['right']);\n \n $id = $branches['left']->id .'_'. $branches['right']->id;\n \n $mergedCluster = new Cluster($avgVec, $id, $branches['left'], $branches['right'], $distance);\n $this->insertCluster($mergedCluster);\n }\n \n return $mergedCluster;\n }",
"public function getCluster()\r\n {\r\n $clusterList = array();\r\n\r\n if(isset($this->queryVars->projectConfiguration['has_cluster']) && $this->queryVars->projectConfiguration['has_cluster'] == 1 )\r\n {\r\n\t\t\t$query = \"SELECT * FROM \".$this->settingVars->clustertable;\r\n\t\t\t$clusters = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->projectManagerLinkid, db\\ResultTypes::$TYPE_OBJECT);\r\n\r\n if(!empty($clusters) && is_array($clusters))\r\n {\r\n $clusterData = array();\r\n foreach($clusters as $data)\r\n $clusterData[$data['cl']] = $data['cl_name'];\r\n }\r\n\r\n if (isset($this->queryVars->projectConfiguration['cluster_default_load']) && !empty($this->queryVars->projectConfiguration['cluster_default_load']))\r\n $defaultLoad = $this->queryVars->projectConfiguration['cluster_default_load'];\r\n \r\n $_REQUEST['clusterID'] = $defaultLoad;\r\n $this->settingVars->setCluster();\r\n\r\n if (isset($this->queryVars->projectConfiguration['cluster_settings']) && !empty($this->queryVars->projectConfiguration['cluster_settings']))\r\n {\r\n $settings = explode(\"|\", $this->queryVars->projectConfiguration['cluster_settings']);\r\n foreach($settings as $data)\r\n {\r\n $tmp = array();\r\n $tmp['cl'] = $data;\r\n $tmp['CLUSTER'] = $clusterData[$data];\r\n \r\n if($defaultLoad == $data)\r\n $tmp['defaultLoad'] = 1;\r\n else\r\n $tmp['defaultLoad'] = 0;\r\n \r\n $clusterList[] = $tmp;\r\n }\r\n }\r\n }\r\n\r\n $this->jsonOutput['CLUSTER_LIST'] = $clusterList;\r\n }",
"public function getCluster()\n {\n return $this->cluster;\n }",
"public function getRouteReflectorClusterId()\n\t{\n\t\treturn $this->route_reflector_cluster_id;\n\t}",
"public function getCluster() {\n return $this->_cluster;\n }",
"public abstract function calculateClusters();",
"public static function getCluster()\n {\n return (new Node\\Builder)\n ->onPort(static::getTestPort())\n ->buildCluster(['riak1.company.com', 'riak2.company.com', 'riak3.company.com',]);\n }",
"function splitBy($distance)\n{\n\t$clusters = array($this);\n\twhile (true)\n\t{\n \t\tif (!property_exists($clusters[0], 'distance') || $clusters[0]->distance < $distance)\n\t\t\tbreak;\n\t\t# highest nth is at [0], split it into left and right\n\t\t# note: it's always guarenteed to be splittable since\n\t\t# we check n/nth at the top\n\t\t$c = array_shift($clusters);\n\t\t$clusters[] = $c->left;\n\t\t$clusters[] = $c->right;\n\t}\n\treturn $clusters;\n}",
"static public function getSecondaryClusters() {\r\n\t\tglobal $wgMemc;\r\n\t\twfProfileIn( __METHOD__ );\r\n\r\n\t\t$key = \"wikifactory:clusters\";\r\n\t\t$clusters = $wgMemc->get( $key );\r\n\t\tif ( !is_array( $clusters ) ) {\r\n\r\n\t\t\t$dbr = self::db( DB_SLAVE );\r\n\t\t\t$oRes = $dbr->select(\r\n\t\t\t\tarray( \"city_list\" ),\r\n\t\t\t\tarray( \"city_cluster as cluster\" ),\r\n\t\t\t\t'',\r\n\t\t\t\t__METHOD__,\r\n\t\t\t\tarray( \"GROUP BY\" => \"city_cluster\" )\r\n\t\t\t);\r\n\r\n\t\t\twhile ( $oRow = $dbr->fetchObject( $oRes ) ) {\r\n\t\t\t\t$clusters[] = strtolower( $oRow->cluster );\r\n\t\t\t}\r\n\t\t\t$dbr->freeResult( $oRes );\r\n\r\n\t\t\t$wgMemc->set( $key, $clusters, 60*60*12 );\r\n\t\t}\r\n\r\n\t\twfProfileOut( __METHOD__ );\r\n\t\treturn $clusters;\r\n\t}",
"function splitBy($distance)\n {\n $clusters = array($this);\n while (true)\n {\n if (!property_exists($clusters[0], 'distance') || $clusters[0]->distance < $distance)\n break;\n # highest nth is at [0], split it into left and right\n # note: it's always guarenteed to be splittable since\n # we check n/nth at the top\n $c = array_shift($clusters);\n $clusters[] = $c->left;\n $clusters[] = $c->right;\n }\n return $clusters;\n }",
"public function getCluster()\n {\n return [\n [\n (new Node\\Builder)\n ->onPort(static::TEST_NODE_PORT)\n ->buildCluster(['riak1.company.com', 'riak2.company.com', 'riak3.company.com',])\n ],\n ];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Modify to the first occurrence of a given day of the week in the current year. If no dayOfWeek is provided, modify to the first day of the current year. Use the supplied consts to indicate the desired dayOfWeek, ex. static::MONDAY. | public function firstOfYear($dayOfWeek = null); | [
"public function weekYear($year = null, $dayOfWeek = null, $dayOfYear = null);",
"public function setToDayOfWeek($dayOfWeek) {\n $dayOfWeek %= 7;\n return $this->modify(static::$days[$dayOfWeek >= 0 ? $dayOfWeek : 7 + $dayOfWeek]);\n }",
"public function set_week_start($day){\n\t\tif(in_array($day, $this->day_order))\n\t\t{\n\t\t\t$arr = $this->weekdays;\n\t\t\tforeach($this->weekdays as $key => $value)\n\t\t\t{\n\t\t\t\tif($day != $key)\n\t\t\t\t{\n\t\t\t\t\t$elm = array_shift($arr);\n\t\t\t\t\tarray_push($arr, $elm);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->weekdays = $arr;\n\t\t\t$this->start_week = $day;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->errors[] = \"Incorrect day of the week\";\n\t\t}\n\t}",
"public static function firstSundayOfYear($year = null)\n {\n $year = $year ? (int) $year : Date('Y');\n $sunday = Carbon::parse($year . '-01-01')->startOfWeek(Carbon::SUNDAY);\n return ((int) $sunday->format('Y') === $year) ? $sunday : $sunday->addDays(7);\n }",
"static public function getFirstDayOfWeek($weeknr = 0, $year = 0) \r\n {\r\n \t// Use current week if 0\r\n \tif ($weeknr == 0)\r\n \t{\r\n \t\t$weeknr = date('W');\r\n \t}\r\n\r\n \t// Use current year if 0\r\n \tif ($year == 0)\r\n \t{\r\n \t\t$year = date('Y');\r\n \t}\r\n \t\r\n \t// Make ts for first day of this year\r\n \t$firstday = mktime(0, 0, 0, 1, 1, $year);\r\n \t\r\n \t// Get weekday nr of first day\r\n \t$firstday_weekday = date('N', $firstday);\r\n \t\r\n \t// If first day is a monday\r\n \tif ($firstday_weekday == 1)\r\n \t{\r\n \t\t$first_monday = $firstday;\r\n \t}\r\n \telse\r\n \t{\r\n \t\t// Find previous monday\r\n \t\t$first_monday = $firstday - (($firstday_weekday - 1) * 86400);\r\n \t}\r\n\r\n \t// Correct for week 52/53 cases\r\n \tif (date('W', $firstday) != 1)\r\n \t{\r\n \t\t// Shift +1 week\r\n \t\t$first_monday += (7 * 86400);\r\n \t}\r\n\r\n \t// Jump to correct monday\r\n \tif ($weeknr > 1)\r\n \t{\r\n \t\treturn $first_monday + (($weeknr - 1) * 7 * 86400);\r\n \t}\r\n \telse\r\n \t{\r\n \t\treturn $first_monday;\r\n \t}\r\n\t}",
"public function setDayOfWeek(string $day_of_week);",
"function setFirstDay()\n {\n $weekDays = $this->cE->getWeekDays(\n $this->calendar->thisYear(),\n $this->calendar->thisMonth(),\n $this->calendar->thisDay()\n );\n $endDays = array();\n $tmpDays = array();\n $begin = false;\n foreach ($weekDays as $day) {\n if ($begin) {\n $endDays[] = $day;\n } else if ($day === $this->firstDay) {\n $begin = true;\n $endDays[] = $day;\n } else {\n $tmpDays[] = $day;\n }\n }\n $this->daysOfWeek = array_merge($endDays, $tmpDays);\n }",
"public static function palmSundayDate($year = \"\") {\n $easter = EpiscopalDate::easterDate($year);\n return strtotime(date(\"Y-m-d\", $easter) . \" -1 week\");\n }",
"public function weekly($day = 1)\n {\n if (is_string($day)) {\n\n // If day is a string range 0-7\n if (!isset($this->daysOfWeek[$day])) {\n return $this->updateRunTime('dayOfWeek', $day)->at('00:00');\n }\n\n // Date is a string like monday, mon, tuesday, tues etc\n return $this->updateRunTime('dayOfWeek', $this->daysOfWeek[$day])->at('00:00');\n }\n\n // Default integer\n return $this->updateRunTime('dayOfWeek', $day)->at('00:00');\n }",
"function get_first_sunday() {\n $dow = intval(gmstrftime(\"%w\", gmmktime(11,0,0,1,1,$this->year)));\n if ( $dow == 0 ) { $dow = 7; }\n $delta = 7 - $dow;\n return intval(gmmktime(11,0,0,1,1+$delta,$this->year));\n }",
"private function _get_start_first_week() {\n\t\t$yearStart = $this->_get_year_start();\n\t\tif ($yearStart->dayNo == 1) {\n\t\t\treturn $yearStart;\n\t\t} \n\t\t$yearStart->adjust_day((7-$yearStart->dayNo)+1);\n\t\tif ($yearStart->epoc <= $this->epoc) {\n\t\t\treturn $yearStart;\n\t\t}\n\t\t\n\t\t$yearStart->year--;\n\t\t$yearStart->day = 1;\n\t\tif ($yearStart->dayNo == 1) {\n\t\t\treturn $yearStart;\n\t\t}\n\t\t\n\t\t$yearStart->adjust_day((7-$yearStart->dayNo)+1);\n\t\treturn $yearStart;\n\t}",
"public static function getFirstDayOfWeek() {\n $date = new DateTime();\n $date->modify('this week');\n return strtotime($date->format('Y-m-d 00:00:00'));\n }",
"public static function firstDay() \r\n {\r\n return new CalendarWeekRule(\"FirstDay\", 0);\r\n }",
"function firstDayOfWeek($week, $year)\n {\n $jan1 = new Horde_Date(array('year' => $year, 'month' => 1, 'mday' => 1));\n $start = $jan1->dayOfWeek();\n if ($start > HORDE_DATE_THURSDAY) {\n $start -= 7;\n }\n return (($week * 7) - (7 + $start)) + 1;\n }",
"public static function getEasterMonday(int $year = null): Date {\n return static::getEasterSunday($year)->jumpDays(1);\n }",
"public function getFirstWeekDay() {\n $firstWeekDay = clone $this->date;\n $firstWeekDay = (int) $firstWeekDay->modify('first day of this month')->format('w');\n\n return ($firstWeekDay === 0) ? $firstWeekDay = 7 : $firstWeekDay;\n }",
"public static function firstWeekOfYear($year = null)\n {\n $year = $year ? (int) $year : Date('Y');\n return Carbon::parse($year . '-01-01')->startOfWeek(Carbon::SUNDAY);\n }",
"private function incrementWeekday(): void\n {\n if($this->isIntercalary()){\n $this->visualWeekdayIndex++;\n if(($this->day >= 1 && !$this->previousState->get('isIntercalary')) || $this->visualWeekdayIndex > $this->weekdayCount()-1 || $this->day === 1) {\n $this->visualWeekdayIndex = 0;\n $this->visualWeekIndex++;\n }\n return;\n }\n\n if($this->previousState->get('isIntercalary') && !$this->isIntercalary()){\n $this->visualWeekIndex++;\n }\n\n if(!($this->previousState->get('isIntercalary') && $this->monthIndexOfYear === 1)) {\n $this->weekdayIndex++;\n }\n $this->incrementWeek();\n $this->visualWeekdayIndex = $this->weekdayIndex;\n }",
"public function setDayOfWeek($dayOfWeek);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$end_index = number this is relative from start word $cutMode = 'M' = map $cutMode = 'R' = rip $cutMode = 'C' = cut $startMode && $endMode 'L','R' | function findAbsoluteIndex($haystack, $startword, $endword, $start_index = 0, $end_index_relative = 0, $startMode = 'L', $endMode = 'R'){
$eIndex = $end_index_relative;
$sIndex = $start_index;
$arrStart = arrStrpos($haystack, $startword, $startMode);
if(!isset($arrStart[$sIndex])){
return '';
}
$trashHaystack = substr($haystack, 0, $arrStart[$sIndex]);
$trashIndex = substr_count($trashHaystack, $endword);
$haystack = substr($haystack, $arrStart[$sIndex]);
$arrEnd = arrStrpos($haystack, $endword, $endMode);
if(!isset($arrEnd[$eIndex])){
return '';
}
$end_index_relative = $trashIndex + $eIndex;
return $end_index_relative;
} | [
"function fetch_data_obligatorily_in_the_middle_of_2_comparative_signs_setting_range($stringg,$setting_range,$settingstring,$endingstring,$n)\r\n{\r\n\t$pos_start=strpos($stringg,$settingstring,$setting_range+1);\r\n\t$pos_end=strpos($stringg,$endingstring,$pos_start+5);\r\n\t\r\n\t//***********************************************8\r\n\t\r\n\t//$pos2=strpos($stringg,$firstsign,$pos1+$n);\r\n\t//$pos3=strpos($stringg,$secondsign,$pos2);\r\n\t//echo \"Position of \".$settingstring.\" is \".$pos1.\"<br>\";\r\n\t//echo \"Position of \".$firstsign.\" is \".$pos2.\"<br>\";\r\n\t//echo \"Position of \".$secondsign.\" is \".$pos3.\"<br>\";\r\n\t$outcome=substr($stringg,$pos2+1,$pos3-$pos2-1);\r\n\t//echo $outcome.\"<br>\";\r\n\t$stringg=substr_replace($stringg,'',$pos1,$pos3+2);\r\n\t//echo $stringg;\r\n\treturn $outcome;\r\n}",
"function fetch_data_obligatorily_in_the_middle_of_2_signs_setting_range($stringg,$setting_range,$settingstring,$firstsign,$secondsign,$n)\r\n{\r\n\t$pos1=strpos($stringg,$settingstring,$setting_range);\r\n\t$pos2=strpos($stringg,$firstsign,$pos1+$n);\r\n\t$pos3=strpos($stringg,$secondsign,$pos2);\r\n\t//echo \"Position of \".$settingstring.\" is \".$pos1.\"<br>\";\r\n\t//echo \"Position of \".$firstsign.\" is \".$pos2.\"<br>\";\r\n\t//echo \"Position of \".$secondsign.\" is \".$pos3.\"<br>\";\r\n\t$outcome=substr($stringg,$pos2+1,$pos3-$pos2-1);\r\n\t//echo $outcome.\"<br>\";\r\n\t$stringg=substr_replace($stringg,'',$pos1,$pos3+2);\r\n\t//echo $stringg;\r\n\treturn $outcome;\r\n}",
"protected function setCutFlag()\n {\n $this->cutFlag = $this->cut() | $this->cutIfEmpty() | $this->cutIf();\n }",
"function cutHTML( $html, $len, $cut='' ) {\n\t\t\n\t\t// find the cut point ( do not include html tags )\n\t\t$c = 0;\n\t\t$c2 = 0;\n\t\t\n\t\t$parts = explode(\">\", $html);\n\t\t\n\t\tforeach($parts as $key=>$part) {\n\t\t\t$pL = \"\";\n\t\t\t$pR = \"\";\n\t\t\t\t\n\t\t\tif (($pos = strpos($part, \"<\")) === false) {\n\t\t\t\t$pL = $part;\n\t\t\t\t\n\t\t\t} else/*if ($pos > 0)*/ {\n\t\t\t\t$pL = substr($part, 0, $pos);\n\t\t\t\t$pR = substr($part, $pos, strlen($part));\n\t\t\t}\n\t\t\t\n\t\t\tif (($c2+strlen($pL))>=$len) {\n\t\t\t\t$c += $len-$c2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$c+=strlen($pL) + strlen($pR)+1;\n\t\t\t\n\t\t\t$c2+=strlen($pL);\n\t\t\t\n\t\t}\n\t\t\n\t\t$snippet = substr ( $html, 0, $c );\n\t\t\n\t\t$snippet = strrpos ( $snippet, \"<\" ) > strrpos ( $snippet, \">\" ) ? rtrim ( substr ( $str, 0, strrpos ( $snippet, \"<\" ) ) ) . $cut : rtrim ( $snippet ) . $cut;\n\t\t\n\t\t$snippet = wproUtilities::closeTags ( $snippet );\n\t\t\n\t\treturn $snippet;\n\t}",
"public function addStartEndBounds(){\n\t\t$this->orderedBounds[0] = $this->STARTBOUND;\n\t\t$e = mb_strlen($this->txtDoc);\n\t\t$this->orderedBounds[$e] = $this->ENDBOUND;\t\t\n\t}",
"function WordEndPosition($pos, $onlyWordCharacters){}",
"function &__calcStartCell(&$cell, &$start, &$end, $axis, $word, &$pos) {\n $x = $cell->x;\n $y = $cell->y;\n\n if ($axis == PC_AXIS_H) {\n $t =& $x;\n $s = $cell->x - $start->x;\n $e = $end->x - $cell->x;\n }\n else {\n $t =& $y;\n $s = $cell->y - $start->y;\n $e = $end->y - $cell->y;\n }\n\n $l = strlen($word);\n\n do {\n $offset = isset($pos) ? $pos + 1 : 0;\n $pos = strpos($word, $cell->letter, $offset);\n $a = $l - $pos - 1;\n if ($pos <= $s && $a <= $e) {\n $t -= $pos;\n return $this->grid->cells[$x][$y];\n }\n } while ($pos !== FALSE);\n\n return FALSE;\n }",
"function longWordBreak($str, $cols=40, $cut=' ') {\n\t $len = strlen($str);\n\t $tag = 0;\n\t\t $result = '';\n\t\t $wordlen = 0;\n\t for ($i = 0; $i < $len; $i++) {\n\t\t $chr = $str[$i];\n\t\t if ($chr == '<') {\n\t\t\t $tag++;\n\t\t } elseif ($chr == '>') {\n\t\t\t $tag--;\n\t\t } elseif ((!$tag) && (wproUtilities::_isWhitespace($chr))) {\n\t\t\t $wordlen = 0;\n\t\t } elseif (!$tag) {\n\t\t\t $wordlen++;\n\t\t }\n\t\t if ((!$tag) && ($wordlen) && (!($wordlen % $cols))) {\n\t\t\t $chr .= $cut;\n\t\t }\n\t\t $result .= $chr;\n\t }\n\t return $result;\n\t}",
"function pinsides($start, $end, $content = false)\r\n{\r\n $org_content = $content;\r\n if ($content===false)\r\n $content = g('html');\r\n if (is_array($content)) {\r\n $startp=$content[1];\r\n $content=$content[0];\r\n } else $startp=0;\r\n $r = array(); $s=0;\r\n while ( ($s = strpos($content, $start,$s) ) !== false ) {\r\n $s += strlen($start);\r\n $e = strpos($content, $end, $s);\r\n if ($e !== false) {\r\n $r[] = array(trim(substr($content, $s, $e - $s)),$s+$startp);\r\n $s = $e + strlen($end);\r\n }\r\n }\r\n\r\n if (DEV)\r\n xlogc('pinsides', $r, $start, $end, $org_content);\r\n return $r;\r\n}",
"public static function cutStr($str='', $start_cut_str=0, $end_cut_str=0){\n if($str != ''){\n if($start_cut_str > 0){\n $str = substr($str, $start_cut_str);\n }\n if($end_cut_str < 0 && strlen($str) > abs($end_cut_str)){\n $str = substr($str, 0, $end_cut_str);\n }\n return intval($str);\n }\n return '';\n }",
"private static function getTerm(int $mode, string $term): string\n {\n return match ($mode) {\n self::MODE_STARTS_WITH => $term . '%',\n self::MODE_ENDS_WITH => '%' . $term,\n default => '%' . $term . '%', // self::MODE_FULL\n };\n }",
"public static function split_string($string, $setpoint, $beforaft, $incorexc) {\n $lowercasestring = strtolower ( $string );\n $marker = strtolower ( $setpoint );\n \n if ($beforaft == 'before') { // Return text before the setpoint\n if ($incorexc == 'exclude') {\n // Return text without the setpoint\n $split_here = strpos ( $lowercasestring, $marker );\n } else {\n // Return text and include the setpoint\n $split_here = strpos ( $lowercasestring, $marker ) + strlen ( $marker );\n }\n $result_string = substr ( $string, 0, $split_here );\n } else { // Return text after the setpoint\n if ($incorexc == 'exclude') {\n // Return text without the setpoint\n $split_here = strpos ( $lowercasestring, $marker ) + strlen ( $marker );\n } else {\n // Return text and include the setpoint\n $split_here = strpos ( $lowercasestring, $marker );\n }\n $result_string = substr ( $string, $split_here, strlen ( $string ) );\n }\n return $result_string;\n}",
"static function strcut($str, $start, $length = null)\r\n {\r\n return mb_strcut($str, $start, self::ENC);\r\n }",
"function input_annotation($sentence,$input,$segmentation,$filter) {\n global $biconcor;\n list($words,$coverage_vector) = split(\"\\t\",$input);\n\n # get information from line in input annotation file\n $coverage = array();\n foreach (split(\" \",$coverage_vector) as $item) {\n if (preg_match(\"/[\\-:]/\",$item)) {\n list($from,$to,$corpus_count,$ttable_count,$ttable_entropy) = preg_split(\"/[\\-:]/\",$item);\n $coverage[$from][$to][\"corpus_count\"] = $corpus_count;\n $coverage[$from][$to][\"ttable_count\"] = $ttable_count;\n $coverage[$from][$to][\"ttable_entropy\"] = $ttable_entropy;\n }\n }\n $word = split(\" \",$words);\n\n # compute the display level for each input phrase\n for($j=0;$j<count($word);$j++) {\n $box[] = array();\n $separable[] = 1;\n }\n $max_level = 0;\n for($length=1;$length<=7;$length++) {\n for($from=0;$from<count($word)-($length-1);$from++) {\n $to = $from + ($length-1);\n if (array_key_exists($from,$coverage) &&\n array_key_exists($to,$coverage[$from]) &&\n array_key_exists(\"corpus_count\",$coverage[$from][$to])) {\n $level=0;\n\t$available = 0;\n\twhile(!$available) {\n\t $available = 1;\n\t $level++;\n\t for($j=$from;$j<=$to;$j++) {\n if (array_key_exists($level,$box) &&\n array_key_exists($j,$box[$level])) {\n\t $available = 0;\n\t }\n }\n }\n\tfor($j=$from;$j<=$to;$j++) {\n\t $box[$level][$j] = $to;\n\t}\n\t$max_level = max($max_level,$level);\n\tfor($j=$from+1;$j<=$to;$j++) {\n\t $separable[$j] = 0;\n\t}\n }\n }\n }\n $separable[count($word)] = 1;\n\n # display input phrases\n $sep_start = 0;\n for($sep_end=1;$sep_end<=count($word);$sep_end++) {\n if ($separable[$sep_end] == 1) {\n # one table for each separable block\n print \"<table cellpadding=1 cellspacing=0 border=0 style=\\\"display: inline-table;\\\">\";\n for($level=$max_level;$level>=1;$level--) {\n # rows for phrase display\n\tprint \"<tr style=\\\"height:5px;\\\">\";\n\tfor($from=$sep_start;$from<$sep_end;$from++) {\n\t if (array_key_exists($from,$box[$level])) {\n\t $to = $box[$level][$from];\n $size = $to - $from + 1;\n\t if ($size == 1) {\n\t print \"<td><div style=\\\"height:0px; opacity:0; position:relative; z-index:-9;\\\">\".$word[$from];\n }\n\t else {\n\t\t$color = coverage_color($coverage[$from][$to]);\n\t\t$phrase = \"\";\n\t\t$highlightwords = \"\";\n $lowlightwords = \"\";\n\t\tfor($j=$from;$j<=$to;$j++) {\n\t\t if ($j>$from) { $phrase .= \" \"; }\n\t\t $phrase .= $word[$j];\n $highlightwords .= \" document.getElementById('inputword-$sentence-$j').style.backgroundColor='#ffff80';\";\n $lowlightwords .= \" document.getElementById('inputword-$sentence-$j').style.backgroundColor='\".coverage_color($coverage[$j][$j]).\"';\";\n\t\t}\n\t print \"<td colspan=$size><div style=\\\"background-color: $color; height:3px;\\\" onmouseover=\\\"show_word_info($sentence,\".$coverage[$from][$to][\"corpus_count\"].\",\".$coverage[$from][$to][\"ttable_count\"].\",\".$coverage[$from][$to][\"ttable_entropy\"].\"); this.style.backgroundColor='#ffff80';$highlightwords\\\" onmouseout=\\\"hide_word_info($sentence); this.style.backgroundColor='$color';$lowlightwords;\\\"\".($biconcor?\" onclick=\\\"show_biconcor($sentence,'\".base64_encode($phrase).\"');\\\"\":\"\").\">\";\n }\n print \"</div></td>\";\n\t $from += $size-1;\n\t }\n\t else {\n\t print \"<td><div style=\\\"height:\".($from==$to ? 0 : 3).\"px;\\\"></div></td>\";\n\t }\n\t}\n\tprint \"</tr>\\n\";\n }\n # display input words\n print \"<tr><td colspan=\".($sep_end-$sep_start).\"><div style=\\\"position:relative; z-index:1;\\\">\";\n for($j=$sep_start;$j<$sep_end;$j++) {\n if ($segmentation && array_key_exists($j,$segmentation[\"input_start\"])) {\n $id = $segmentation[\"input_start\"][$j];\n print \"<span id=\\\"input-$sentence-$id\\\" style=\\\"border-color:#000000; border-style:solid; border-width:1px;\\\" onmouseover=\\\"highlight_phrase($sentence,$id);\\\" onmouseout=\\\"lowlight_phrase($sentence,$id);\\\">\";\n }\n if (array_key_exists($j,$coverage)) {\n $color = coverage_color($coverage[$j][$j]);\n $cc = $coverage[$j][$j][\"corpus_count\"];\n $tc = $coverage[$j][$j][\"ttable_count\"];\n $te = $coverage[$j][$j][\"ttable_entropy\"];\n }\n else { # unknown words\n\t $color = '#ffffff';\n $cc = 0; $tc = 0; $te = 0;\n }\n print \"<span id=\\\"inputword-$sentence-$j\\\" style=\\\"background-color: $color;\\\" onmouseover=\\\"show_word_info($sentence,$cc,$tc,$te); this.style.backgroundColor='#ffff80';\\\" onmouseout=\\\"hide_word_info($sentence); this.style.backgroundColor='$color';\\\"\".($biconcor?\" onclick=\\\"show_biconcor($sentence,'\".base64_encode($word[$j]).\"');\\\"\":\"\").\">\";\n\tif ($word[$j] == $filter) {\n\t print \"<b><font color=#ff0000>\".$word[$j].\"</font></b>\";\n\t}\n\telse {\n\t print $word[$j];\n\t}\n\tprint \"</span>\";\n if ($segmentation && array_key_exists($j,$segmentation[\"input_end\"])) {\n print \"</span>\";\n }\n print \" \";\n }\n print \"</div></td></tr>\\n\";\n print \"</table>\\n\";\n $sep_start = $sep_end;\n }\n }\n print \"<br>\";\n}",
"public static function __cutDAG($sentence, $options = array())\n {\n $defaults = array(\n 'mode'=>'default'\n );\n\n $options = array_merge($defaults, $options);\n\n $words = array();\n\n $N = mb_strlen($sentence, 'UTF-8');\n $DAG = Jieba::getDAG($sentence);\n\n Jieba::calc($sentence, $DAG);\n\n $x = 0;\n $buf = '';\n\n while ($x < $N) {\n $current_route_keys = array_keys(Jieba::$route[$x]);\n $y = $current_route_keys[0]+1;\n $l_word = mb_substr($sentence, $x, ($y-$x), 'UTF-8');\n\n if (($y-$x)==1) {\n $buf = $buf.$l_word;\n } else {\n if (mb_strlen($buf, 'UTF-8')>0) {\n if (mb_strlen($buf, 'UTF-8')==1) {\n if (isset(self::$word_tag[$buf])) {\n $buf_tag = self::$word_tag[$buf];\n } else {\n $buf_tag = 'x';\n }\n $words[] = array('word' => $buf, 'tag' => $buf_tag);\n $buf = '';\n } else {\n if (! isset(Jieba::$FREQ[$buf])) {\n $regognized = self::__cutDetail($buf);\n foreach ($regognized as $key => $word) {\n $words[] = $word;\n }\n } else {\n $elem_array = preg_split('//u', $buf, -1, PREG_SPLIT_NO_EMPTY);\n foreach ($elem_array as $word) {\n if (isset(self::$word_tag[$word])) {\n $buf_tag = self::$word_tag[$word];\n } else {\n $buf_tag = 'x';\n }\n $words[] = array('word' => $word, 'tag' => $buf_tag);\n }\n }\n $buf = '';\n }\n }\n\n if (isset(self::$word_tag[$l_word])) {\n $buf_tag = self::$word_tag[$l_word];\n } else {\n $buf_tag = 'x';\n }\n $words[] = array('word' => $l_word, 'tag' => $buf_tag);\n }\n $x = $y;\n }\n\n if (mb_strlen($buf, 'UTF-8')>0) {\n if (mb_strlen($buf, 'UTF-8')==1) {\n if (isset(self::$word_tag[$buf])) {\n $buf_tag = self::$word_tag[$buf];\n } else {\n $buf_tag = 'x';\n }\n $words[] = array('word'=>$buf, 'tag'=>$buf_tag);\n } else {\n if (! isset(Jieba::$FREQ[$buf])) {\n $regognized = self::__cutDetail($buf);\n foreach ($regognized as $key => $word) {\n $words[] = $word;\n }\n } else {\n $elem_array = preg_split('//u', $buf, -1, PREG_SPLIT_NO_EMPTY);\n foreach ($elem_array as $word) {\n if (isset(self::$word_tag[$word])) {\n $buf_tag = self::$word_tag[$word];\n } else {\n $buf_tag = 'x';\n }\n $words[] = array('word'=>$word, 'tag'=>$buf_tag);\n }\n }\n }\n }\n\n return $words;\n }",
"function AutoCompGetDropRestOfWord(){}",
"protected function deriveJumpTable()\n {\n $maxJump = strlen($this->substring);\n\n // loop over letters of \n for ($i = strlen($this->substring) - 2; $i >= 0; $i--) {\n if (!array_key_exists($this->substring{$i}, $this->jumpTable)) {\n $this->jumpTable[$this->substring{$i}] = $maxJump - $i - 1;\n }\n }\n }",
"function cut($data = '', $long = '', $option = FALSE)\n\t{\n\t\t$str = $data;\n\n\t\tif ( isset($data) && isset($long))\n\t\t{\n\t\t\tif ($option == FALSE)\n\t\t\t{\n\t\t\t\t$str = html_entity_decode($str);\n\t\t\t\t$str = strip_tags($str);\n\t\t\t\t$str = mb_substr($str, 0, $long);\n\t\t\t\t$str = mb_substr($str, 0, strrpos($str,\" \"));\n\t\t\t} \n\t\t\telse\n\t\t\t{\n\t\t\t\t$str = mb_substr($str,0,$long);\n\t\t\t}\n\t\t}\n\n\t\treturn $str;\n\t}",
"function rawWikiSlices($range,$id,$rev=''){\n list($from,$to) = split('-',$range,2);\n $text = io_readFile(wikiFN($id,$rev));\n if(!$from) $from = 0;\n if(!$to) $to = strlen($text)+1;\n\n $slices[0] = substr($text,0,$from-1);\n $slices[1] = substr($text,$from-1,$to-$from);\n $slices[2] = substr($text,$to);\n\n return $slices;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for getMarketsPrices List market prices. | public function testGetMarketsPrices()
{
} | [
"public function testGETPriceListIdPrices()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testApiV2MarketsGet()\n {\n }",
"public function getPrices()\n {\n }",
"public function getListPrice();",
"public static function getMarkets()\n {\n return self::getMarketsQuery()\n ->get();\n }",
"public function testGetItemPrices()\n {\n $customerGroupId = 1;\n $customerGroupCode = 'general';\n $productSkus = ['SKU1', 'SKU2'];\n $customerGroup = $this->getMockBuilder(GroupInterface::class)\n ->disableOriginalConstructor()->getMock();\n $this->customerGroupRepository->expects($this->once())\n ->method('getById')->with($customerGroupId)->willReturn($customerGroup);\n $customerGroup->expects($this->once())->method('getCode')->willReturn($customerGroupCode);\n $tierPrice = $this->getMockBuilder(TierPriceInterface::class)\n ->disableOriginalConstructor()->getMock();\n $this->tierPriceStorage->expects($this->once())\n ->method('get')->with($productSkus)->willReturn([$tierPrice, $tierPrice]);\n $tierPrice->expects($this->exactly(2))->method('getCustomerGroup')\n ->willReturnOnConsecutiveCalls($customerGroupCode, 'custom_group');\n $tierPrice->expects($this->exactly(2))->method('getQuantity')->willReturn(1);\n $this->assertEquals([$tierPrice], $this->tierPriceManagement->getItemPrices($customerGroupId, $productSkus));\n }",
"public function testPriceListWithCurrencyData()\n {\n $out = [];\n $rates = [\n 'SEK' => '0.1',\n 'EUR' => '1',\n 'USD' => '1.3345',\n 'LTL' => '3.4546',\n ];\n $toPrintList = [\n 'EUR',\n 'LTL',\n ];\n $templates = [\n 'ONGRCurrencyExchangeBundle::currency_list.html.twig',\n 'ONGRCurrencyExchangeBundle::price_list.html.twig'\n ];\n // Case #1 the default currency is used.\n $expectedParams = [\n 'prices' => [\n [\n 'value' => '100 ',\n 'currency' => 'eur',\n ],\n [\n 'value' => '345.46 ',\n 'currency' => 'ltl',\n ],\n ],\n ];\n $out[] = [$rates, $toPrintList, 'EUR', 100, $expectedParams, $templates];\n // Case #2 currency not in the toPrintlist is used.\n $expectedParams = [\n 'prices' => [\n [\n 'value' => '74.93 ',\n 'currency' => 'eur',\n ],\n [\n 'value' => '258.87 ',\n 'currency' => 'ltl',\n ],\n ],\n ];\n $out[] = [$rates, $toPrintList, 'USD', 100, $expectedParams, $templates];\n // Case #3 currency in the toPrintlist is used.\n $expectedParams = [\n 'prices' => [\n [\n 'value' => '28.95 ',\n 'currency' => 'eur',\n ],\n [\n 'value' => '100 ',\n 'currency' => 'ltl',\n ],\n ],\n ];\n $out[] = [$rates, $toPrintList, 'LTL', 100, $expectedParams, $templates];\n\n return $out;\n }",
"public function actionGet_markets()\n { \n // mark markets as non-existing\n Market::updateAll(['exist' => 0], 'exist = 1');\n \n $url = self::PROTO . self::HOST . self::URI;\n \n $document = new Document($url, true);\n\n // find nodes containing markets by selector\n $elements = $document->find('a.store-pod');\n \n foreach ($elements as $element)\n {\n $this->addMarket($element);\n }\n\n // remove from database non-existing markets on the site\n Market::deleteAll('exist = 0');\n }",
"abstract protected function getProductPagePrices($actualPrices);",
"public function testGetPricelist()\n {\n }",
"function get_markets() {\r\n $command = 'public/getmarkets';\r\n $params = '';\r\n $query = $command . $params;\r\n $result = make_public_api_call($query);\r\n \r\n return $result;\r\n}",
"public function testInventorySellingPriceGETRequestInventoryIDSellingPricesGet()\n {\n }",
"public function getMarketPrice()\n {\n return $this->market_price;\n }",
"public function testProductAPIGetProductPriceList()\n {\n\n }",
"public function gETMarketIdPriceListRequest($market_id)\n {\n // verify the required parameter 'market_id' is set\n if ($market_id === null || (is_array($market_id) && count($market_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $market_id when calling gETMarketIdPriceList'\n );\n }\n\n $resourcePath = '/markets/{marketId}/price_list';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($market_id !== null) {\n $resourcePath = str_replace(\n '{' . 'marketId' . '}',\n ObjectSerializer::toPathValue($market_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getPrices()\n {\n return $this->prices;\n }",
"public function listMarkets($symbol)\n\t{\n\t\trequire_once($this->basePath.'/yaamp/core/core.php');\n\n\t\t$coin = getdbosql('db_coins', \"symbol=:sym\", array(':sym'=>$symbol));\n\t\tif (!$coin) die(\"coin $symbol not found!\\n\");\n\n\t\t$markets = new db_markets;\n\t\tforeach ($markets->findAll(\"coinid={$coin->id} ORDER BY disabled, price DESC\") as $market) {\n\t\t\t$price = $market->disabled ? '*DISABLED*' : bitcoinvaluetoa($market->price);\n\t\t\tif (market_get($market->name, $symbol, \"disabled\") || $market->deleted) $price = ' *DELETED*';\n\t\t\techo \"{$price} {$market->name}\\n\";\n\t\t}\n\t}",
"protected function calculatePrices()\n {\n }",
"public function getPrices() {\n\n\t\t//First of all we can skip Euros (might take this out of coins list entirely)\n\n //Secondly, bitcoins are handled differently. All other coins are priced in bitcoin at whichever exchange they were bought from, bitcoin is priced in Euro based on Kraken exchange\n\n $coins = Coin::where(\"code\", \"!=\", \"EUR\")->where(\"code\", \"!=\", \"XBT\")->get();\n\n $xbt = Coin::where(\"code\", \"=\", \"XBT\")->first();\n\n //Create the array of asset pairs to pass to the kraken ticker\n $kraken_pairs = array();\n $bittrex_coins = array();\n\n //Preset first kraken pair to XBTEUR\n $kraken_pairs[] = \"XBTEUR\";\n foreach($coins as $coin) {\n if($coin->exchange == \"kraken\") $kraken_pairs[] = $coin->code.\"XBT\";\n else if($coin->exchange == \"bittrex\") $bittrex_coins[] = $coin;\n }\n\n //KRAKEN VERSION - Gets all tickers with one call\n\n //Get Ticker prices\n $ticker = KrakenAPIFacade::getTickers($kraken_pairs);\n\n if(isset($ticker['result'])) {\n\n //Save the bitcoin one\n if(isset($ticker['result']['XXBTZEUR'])) {\n $price = new CoinPrice();\n $price->coin_id = $coin->id;\n $price->current_price = $ticker['result']['XXBTZEUR']['a'][0];\n $price->save();\n $price->coin_code = \"XBT\";\n $latest_prices[] = $price;\n unset($ticker['result']['XXBTZEUR']);\n }\n\n //Figure out the rest, kraken has weird codes!\n foreach($ticker['result'] as $pair=>$values) {\n if(substr($pair, strlen($pair)-4, 4) == \"XXBT\") $code = substr($pair, 1, 3);\n else $code = substr($pair, 0, 4);\n\n //Get the coin id and save the price\n $coin = Coin::where(\"code\", \"=\", $code)->first();\n $price = new CoinPrice();\n $price->coin_id = $coin->id;\n $price->current_price = $values['a'][0];\n $price->save();\n $price->coin_code = $coin->code;\n $latest_prices[] = $price;\n }\n }\n\n //BITTREX VERSION - does tickers singly\n\n //Get latest price from bittrex (BITCOIN)\n foreach($bittrex_coins as $coin) {\n $info = Bittrex::getTicker(\"BTC-\".$coin->code);\n if((is_array($info)) && (isset($info['result']))) $latest = $info['result']['Last'];\n \n //Save the price\n if($latest) {\n $price = new CoinPrice();\n $price->coin_id = $coin->id;\n $price->current_price = $latest;\n $price->save();\n $price->coin_code = $coin->code;\n $latest_prices[] = $price;\n }\n }\n\n\n //send pusher event informing of latest coin prices\n $data = array();\n foreach($latest_prices as $price) {\n $data[$price->coin_code] = array();\n $data[$price->coin_code]['price'] = $price->current_price;\n $data[$price->coin_code]['updated_at'] = $price->created_at;\n $data[$price->coin_code]['updated_at_short'] = $price->created_at->format('D G:i');\n }\n broadcast(new \\App\\Events\\PusherEvent(json_encode($data)));\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get list from Settings as array. | protected function getSettingsList()
{
return array_map('trim', explode(',', Settings::get('list', '')));
} | [
"function get_settings_array(){\n return $this->get_values_array('name', 'value'); \n }",
"public function list_settings()\n {\n $return = array();\n if (!$this->is_loggedin) return $return;\n $return = array();\n $json = json_encode(array());\n $content = $this->exec_curl($this->baseurl . \"/api/s/\" . $this->site . \"/get/setting\", \"json=\" . $json);\n $content_decoded = json_decode($content);\n if (isset($content_decoded->meta->rc)) {\n if ($content_decoded->meta->rc == \"ok\") {\n if (is_array($content_decoded->data)) {\n foreach ($content_decoded->data as $setting) {\n $return[] = $setting;\n }\n }\n }\n }\n return $return;\n }",
"public static function getAll()\n {\n $array = [];\n $settings = self::all();\n foreach ($settings as $setting) {\n $array[$setting->key] = json_decode($setting->value);\n }\n\n return $array;\n }",
"function settings_list(){\n\n return $this->Settings;\n }",
"public function getAllSettings()\n {\n return $this->_settings_array;\n }",
"public function getValues() {\n\t\t\t$a = array();\n\t\t\tforeach($this->contents as $c) if(get_class($c) == 'SettingValue') $a[] = $c;\n\t\t\treturn $a;\n\t\t}",
"public function all() {\n $rawSettings = parent::all();\n $settings = [];\n foreach ($rawSettings as $setting) {\n $settings[$setting->name] = $setting;\n }\n return $settings;\n }",
"private function requestedSettings()\n {\n $settings = app('request')->input('settings');\n\n return array_map(function ($label, $value) {\n return [\n 'label' => $label,\n 'value' => $value,\n ];\n }, array_keys($settings), $settings);\n }",
"private function getSettings(): array\n {\n $unusedSettings = $this->settingService->findUnusedSettings();\n $settings = [];\n\n foreach ($unusedSettings as $setting) {\n $settings[$setting] = $setting;\n }\n\n return $settings;\n }",
"public function all()\n {\n $rawSettings = parent::all();\n\n $settings = [];\n foreach ($rawSettings as $setting) {\n $settings[$setting->name] = $setting;\n }\n\n return $settings;\n }",
"public function getSettings(){\n\t\t$sql=\"SELECT * FROM \".SETTING_TABLE;\n\t\t$result=$this->query($sql);\n\t\t$settings=array();\n\t\tif($result)\n\t\t\twhile($row=$result->fetch_assoc())\n\t\t\t\t$settings[$row['Setting']]=$row['Value'];\n\t\treturn $settings;\n\t}",
"public function getAll()\n\t{\n\t\treturn $this->settings;\n\t}",
"public function getAllSettings() {\n\t\ttry {\n\t\t\t\n\t\t\t$data = $this->invoke('getAllSettings', array());\n\t\t\t$results = array();\n\t\t\tforeach ($data as $settingsObj) {\n\t\t\t\tarray_push($results, VCDSoapTools::GetSettingsObj($settingsObj));\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\treturn $results;\n\t\t\t\n\t\t} catch (Exception $ex) {\n\t\t\tthrow $ex;\n\t\t}\n\t}",
"public function getSettingsAsArray($groups = null, $flag = null)\n {\n return $this->getFilteredAsArray($this->settings, $groups, $flag);\n }",
"public function getSettingsAsArray($group = null);",
"public function getSettingData()\n {\n return array();\n }",
"public function initSettings(): array;",
"public function getConfigAsArray()\n {\n return $this->getConfig()->toArray();\n }",
"public function get_settings_list()\n\t{\n\t\t// init data obj\n\t\t$data = new stdClass();\n\n\t\t// sort tabs\n\t\t$tabs = $this->db->select('tab')->distinct()->get('settings')->result();\n\n\t\t// foreach of those tabs, we get all\n\t\t// options in that tab\n\t\tforeach ($tabs as &$tab)\n\t\t{\n\t\t\t// get the list for the tab\n\t\t\t$tab->list = $this->db->where('tab', $tab->tab)->get('settings')->result();\n\n\t\t\t// foreach of the list items\n\t\t\tforeach ($tab->list as &$item)\n\t\t\t{\n\t\t\t\t// we build the form field so we can just echo it \n\t\t\t\t// in the view\n\t\t\t\t$item->input = $this->obcore->build_form_field($item->field_type, $item->name, $item->value, $item->options);\n\t\t\t}\n\t\t}\n\n\t\t// load up the object with the info\n\t\t$data->settings = $tabs;\n\n\t\t// send it off\n\t\treturn $data;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the idViaje column Example usage: $query>filterByIdviaje(1234); // WHERE idViaje = 1234 $query>filterByIdviaje(array(12, 34)); // WHERE idViaje IN (12, 34) $query>filterByIdviaje(array('min' => 12)); // WHERE idViaje > 12 | public function filterByIdviaje($idviaje = null, $comparison = null)
{
if (is_array($idviaje)) {
$useMinMax = false;
if (isset($idviaje['min'])) {
$this->addUsingAlias(ViajesTableMap::COL_IDVIAJE, $idviaje['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($idviaje['max'])) {
$this->addUsingAlias(ViajesTableMap::COL_IDVIAJE, $idviaje['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ViajesTableMap::COL_IDVIAJE, $idviaje, $comparison);
} | [
"public function filterByIdviaje($idviaje = null, $comparison = null)\n {\n if (is_array($idviaje)) {\n $useMinMax = false;\n if (isset($idviaje['min'])) {\n $this->addUsingAlias(ViajeMensajeTableMap::COL_IDVIAJE, $idviaje['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idviaje['max'])) {\n $this->addUsingAlias(ViajeMensajeTableMap::COL_IDVIAJE, $idviaje['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ViajeMensajeTableMap::COL_IDVIAJE, $idviaje, $comparison);\n }",
"public function filterByIdcliente($idcliente = null, $comparison = null)\n {\n if (is_array($idcliente)) {\n $useMinMax = false;\n if (isset($idcliente['min'])) {\n $this->addUsingAlias(ClientePeer::IDCLIENTE, $idcliente['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idcliente['max'])) {\n $this->addUsingAlias(ClientePeer::IDCLIENTE, $idcliente['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ClientePeer::IDCLIENTE, $idcliente, $comparison);\n }",
"public function filterByIdCliente($idCliente = null, $comparison = null)\n\t{\n\t\tif (is_array($idCliente)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idCliente['min'])) {\n\t\t\t\t$this->addUsingAlias(FacturaPeer::ID_CLIENTE, $idCliente['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idCliente['max'])) {\n\t\t\t\t$this->addUsingAlias(FacturaPeer::ID_CLIENTE, $idCliente['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(FacturaPeer::ID_CLIENTE, $idCliente, $comparison);\n\t}",
"public function getFilter($id);",
"function clients_getFilter($id) {\n\tglobal $Auth;\n\n\t## multiclient\n\t$client_id = $Auth->auth[\"client_id\"];\n\t\n\t## prepare the db-object\n\t$db = new DB_Sql();\n\n\t## then get the correct values\n\t$query = \"SELECT * FROM \".DB_PREFIX.$GLOBALS['_MODULE_DATAOBJECTS_DBPREFIX'].\"_filters WHERE id='$id'\";\n\n\t$result = $db->query($query);\t\n\t$counter = 0;\n\t$return_value = array();\n\tif($db->next_record(MYSQL_ASSOC)) {\n\t\t$return_value = $db->Record;\n\t}\n\treturn $return_value;\t\n}",
"function filterBy_S_A_F_E($SEDE, $AREA, $FACULTAD, $ESCUELA,$TABLE_I)\n{\n global $mysqli;\n $TINS = $TABLE_I;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,fac_iia,esc_iia,car_iia,fac_iiia,esc_iiia,car_iiia\n FROM \" .$TINS. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? \");\n $parametros = array(\"iiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}",
"public function filterByIdFeria($idFeria = null, $comparison = null)\n\t{\n\t\tif (is_array($idFeria)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idFeria['min'])) {\n\t\t\t\t$this->addUsingAlias(FeriaSelloeditorialPeer::ID_FERIA, $idFeria['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idFeria['max'])) {\n\t\t\t\t$this->addUsingAlias(FeriaSelloeditorialPeer::ID_FERIA, $idFeria['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(FeriaSelloeditorialPeer::ID_FERIA, $idFeria, $comparison);\n\t}",
"public function filterByIdCliente($idCliente = null, $comparison = null)\n {\n if (is_array($idCliente)) {\n $useMinMax = false;\n if (isset($idCliente['min'])) {\n $this->addUsingAlias(ClientePeer::ID_CLIENTE, $idCliente['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idCliente['max'])) {\n $this->addUsingAlias(ClientePeer::ID_CLIENTE, $idCliente['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ClientePeer::ID_CLIENTE, $idCliente, $comparison);\n }",
"public function filterByIdFeria($idFeria = null, $comparison = null)\n\t{\n\t\tif (is_array($idFeria)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idFeria['min'])) {\n\t\t\t\t$this->addUsingAlias(ActividadPeer::ID_FERIA, $idFeria['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idFeria['max'])) {\n\t\t\t\t$this->addUsingAlias(ActividadPeer::ID_FERIA, $idFeria['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(ActividadPeer::ID_FERIA, $idFeria, $comparison);\n\t}",
"public function filterByIdservicio($idservicio = null, $comparison = null)\n {\n if (is_array($idservicio)) {\n $useMinMax = false;\n if (isset($idservicio['min'])) {\n $this->addUsingAlias(CargoconsultaPeer::IDSERVICIO, $idservicio['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idservicio['max'])) {\n $this->addUsingAlias(CargoconsultaPeer::IDSERVICIO, $idservicio['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CargoconsultaPeer::IDSERVICIO, $idservicio, $comparison);\n }",
"public function filterByIdCaja($idCaja = null, $comparison = null)\n\t{\n\t\tif (is_array($idCaja)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idCaja['min'])) {\n\t\t\t\t$this->addUsingAlias(UsuarioCajaPeer::ID_CAJA, $idCaja['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idCaja['max'])) {\n\t\t\t\t$this->addUsingAlias(UsuarioCajaPeer::ID_CAJA, $idCaja['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(UsuarioCajaPeer::ID_CAJA, $idCaja, $comparison);\n\t}",
"public function filterByIdvale($idvale = null, $comparison = null)\n {\n if (is_array($idvale)) {\n $useMinMax = false;\n if (isset($idvale['min'])) {\n $this->addUsingAlias(ValePeer::IDVALE, $idvale['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idvale['max'])) {\n $this->addUsingAlias(ValePeer::IDVALE, $idvale['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ValePeer::IDVALE, $idvale, $comparison);\n }",
"public function filterByClienteId($clienteId = null, $comparison = null)\n\t{\n\t\tif (is_array($clienteId)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($clienteId['min'])) {\n\t\t\t\t$this->addUsingAlias(TicketPeer::CLIENTE, $clienteId['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($clienteId['max'])) {\n\t\t\t\t$this->addUsingAlias(TicketPeer::CLIENTE, $clienteId['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(TicketPeer::CLIENTE, $clienteId, $comparison);\n\t}",
"private function nroSecuenciaFilter($params, &$where, &$queryParams) {\n if($this->paramExists($params, 'nro_secuencia')) {\n $queryParams[':nro_secuencia'] = $params['nro_secuencia'];\n $where = $this->addWhereSentence($where, \"Protocolo.nro_secuencia = :nro_secuencia\");\n }\n }",
"public function filterByIdproducto($idproducto = null, $comparison = null)\n {\n if (is_array($idproducto)) {\n $useMinMax = false;\n if (isset($idproducto['min'])) {\n $this->addUsingAlias(ProductomaterialPeer::IDPRODUCTO, $idproducto['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idproducto['max'])) {\n $this->addUsingAlias(ProductomaterialPeer::IDPRODUCTO, $idproducto['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ProductomaterialPeer::IDPRODUCTO, $idproducto, $comparison);\n }",
"public function filterByClienteId($clienteId = null, $comparison = null)\n\t{\n\t\tif (is_array($clienteId)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($clienteId['min'])) {\n\t\t\t\t$this->addUsingAlias(EnderecoPeer::CLIENTE, $clienteId['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($clienteId['max'])) {\n\t\t\t\t$this->addUsingAlias(EnderecoPeer::CLIENTE, $clienteId['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(EnderecoPeer::CLIENTE, $clienteId, $comparison);\n\t}",
"public function filterByIdventa($idventa = null, $comparison = null)\n {\n if (is_array($idventa)) {\n $useMinMax = false;\n if (isset($idventa['min'])) {\n $this->addUsingAlias(VentadetallePeer::IDVENTA, $idventa['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idventa['max'])) {\n $this->addUsingAlias(VentadetallePeer::IDVENTA, $idventa['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(VentadetallePeer::IDVENTA, $idventa, $comparison);\n }",
"public function filterUser(int|UniqueId $id): self;",
"public function filterByIdFuncao($idFuncao = null, $comparison = null)\r\n {\r\n if (is_array($idFuncao)) {\r\n $useMinMax = false;\r\n if (isset($idFuncao['min'])) {\r\n $this->addUsingAlias(KitsEnsaioPeer::ID_FUNCAO, $idFuncao['min'], Criteria::GREATER_EQUAL);\r\n $useMinMax = true;\r\n }\r\n if (isset($idFuncao['max'])) {\r\n $this->addUsingAlias(KitsEnsaioPeer::ID_FUNCAO, $idFuncao['max'], Criteria::LESS_EQUAL);\r\n $useMinMax = true;\r\n }\r\n if ($useMinMax) {\r\n return $this;\r\n }\r\n if (null === $comparison) {\r\n $comparison = Criteria::IN;\r\n }\r\n }\r\n\r\n return $this->addUsingAlias(KitsEnsaioPeer::ID_FUNCAO, $idFuncao, $comparison);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the acceleration vector | public function acceleration(): Vector
{
return $this->acceleration;
} | [
"public function getAcceleration()\n {\n if (is_object($this->engineKit))\n {\n return $this->engineKit->getAcceleration();\n }\n return 0.0;\n }",
"public function velocity(): Vector\n {\n return $this->velocity;\n }",
"public function calcAcceleration($currentVelocity, $time, $prevVelocity);",
"public function getAccelerationDenominator()\n {\n return $this->accelerationDenominator;\n }",
"public function getVelocity(): Vector\n {\n return $this->object->get('velocity');\n }",
"public function getAccelerationPercent()\n\t{\n\t\treturn $this->accelerationPercent;\n\t}",
"public function calculateFrontVector() : vec3\n\t{\n\t\t$vec3 = new vec3(\n\t\t\t- (sin(\\glm\\radians($this->rotation->y)) * cos(\\glm\\radians($this->rotation->x))),\n\t\t\tsin(\\glm\\radians($this->rotation->x)),\n\t\t\tcos(\\glm\\radians($this->rotation->y)) * cos(\\glm\\radians($this->rotation->x))\n\t\t);\n\n\t\t// normalize\n\t\t$vec3->normalize();\n\n\t\treturn $vec3;\n\t}",
"public function accelerate($velocity = 0);",
"public function getAngularVelocity(): int\n {\n return $this->object->angularVelocity;\n }",
"public function getDeceleration()\n {\n return $this->deceleration;\n }",
"public function getAccelerationThreshold()\n {\n return $this->accelerationThreshold;\n }",
"public function getConstantDeceleration()\n {\n return $this->constantDeceleration;\n }",
"public function getAngle(): float\n {\n return $this->angle;\n }",
"public function updatePosition(): void\n {\n $this->velocity['x'] += $this->acceleration['x'];\n $this->velocity['y'] += $this->acceleration['y'];\n $this->velocity['z'] += $this->acceleration['z'];\n $this->position['x'] += $this->velocity['x'];\n $this->position['y'] += $this->velocity['y'];\n $this->position['z'] += $this->velocity['z'];\n }",
"public function get_inputVoltage(): float\n {\n // $res is a double;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::INPUTVOLTAGE_INVALID;\n }\n }\n $res = $this->_inputVoltage;\n return $res;\n }",
"public function getAngle(): float;",
"function get_z()\n {\n $arr = sloodle_vector_to_array($this->primdrop_pos);\n if (!$arr) return 0.0;\n return (float)$arr['z'];\n }",
"public function getGravity () {}",
"public function accelere($delta)\n {\n if($this->vitesse + $delta > self::VITESSE_MAX)\n {\n $this->vitesse = self::VITESSE_MAX;\n }\n else\n {\n $this->vitesse += $delta;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns HTML for not configure for a server replication | public static function getHtmlForNotServerReplication()
{
$_url_params = $GLOBALS['url_params'];
$_url_params['mr_configure'] = true;
$html = '<fieldset>';
$html .= '<legend>' . __('Master replication') . '</legend>';
$html .= sprintf(
__(
'This server is not configured as master in a replication process. '
. 'Would you like to <a href="%s">configure</a> it?'
),
'server_replication.php' . Url::getCommon($_url_params)
);
$html .= '</fieldset>';
return $html;
} | [
"function seo_server_conf($html = true)\n\t{\n\t\t// get mods server_conf tpls\n\t\t$mods_ht = $this->get_mods_server_conf();\n\t\t$default_slash = '/';\n\t\t$wierd_slash = '';\n\t\t$phpbb_path = trim($this->core->seo_path['phpbb_script'], '/');\n\t\t$show_rewritebase_opt = false;\n\t\t$rewritebase = '';\n\t\t$wierd_slash = $this->new_config['wslash'] ? '/' : '';\n\t\t$default_slash = $this->new_config['slash'] ? '' : '/';\n\n\t\t$red_slash = '<b style=\"color:red\">/</b>';\n\n\t\tif (!empty($phpbb_path))\n\t\t{\n\t\t\t$phpbb_path = $phpbb_path . '/';\n\n\t\t\tif ($this->new_config['rbase'])\n\t\t\t{\n\t\t\t\t$rewritebase = $phpbb_path;\n\t\t\t\t$default_slash = $this->new_config['slash'] ? '/' : '';\n\t\t\t}\n\n\t\t\t$show_rewritebase_opt = $this->core->seo_opt['virtual_root'] ? false : true;\n\t\t}\n\n\t\t$colors = array(\n\t\t\t'color'\t\t=> '<b style=\"color:%1$s\">%2$s</b>',\n\t\t\t'static'\t=> '#A020F0',\n\t\t\t'ext'\t\t=> '#6A5ACD',\n\t\t\t'delim'\t\t=> '#FF00FF',\n\t\t);\n\n\t\t$spritf_tpl = array(\n\t\t\t'paginpage'\t=> '/?(<b style=\"color:' . $colors['static'] . '\">%1$s</b>([0-9]+)<b style=\"color:' . $colors['ext'] . '\">%2$s</b>)?',\n\t\t\t'pagin'\t\t=> '(<b style=\"color:' . $colors['delim'] . '\">%1$s</b>([0-9]+))?<b style=\"color:' . $colors['ext'] . '\">%2$s</b>',\n\t\t\t'static'\t=> sprintf($colors['color'] , $colors['static'], '%1$s'),\n\t\t\t'ext'\t\t=> sprintf($colors['color'] , $colors['ext'], '%1$s'),\n\t\t\t'delim'\t\t=> sprintf($colors['color'] , $colors['delim'], '%1$s'),\n\t\t);\n\n\t\t$modrtype = array(\n\t\t\t1\t\t=> 'SIMPLE',\n\t\t\t2\t\t=> 'MIXED',\n\t\t\t3\t\t=> 'ADVANCED',\n\t\t\t'type'\t=> intval($this->core->modrtype),\n\t\t);\n\n\t\tif (!empty($default_slash) && $this->new_config['more_options'])\n\t\t{\n\t\t\t$default_slash = $red_slash;\n\t\t}\n\n\t\tif (!empty($wierd_slash) && $this->new_config['more_options'])\n\t\t{\n\t\t\t$wierd_slash = $red_slash;\n\t\t}\n\n\t\t// The tpl array\n\t\t$rewrite_tpl_vars = array();\n\n\t\t// handle the suffixes properly in RegEx\n\t\t// set up pagination RegEx\n\t\t// set up ext bits\n\t\t$seo_ext = array(\n\t\t\t// force '/' for both / and empty ext to add /? in RegEx (which allows both cases)\n\t\t\t'pagination'\t=> trim($this->core->seo_ext['pagination'], '/') ? str_replace('.', '\\\\.', $this->core->seo_ext['pagination']) : '/',\n\t\t);\n\n\t\t$reg_ex_page = sprintf($spritf_tpl['paginpage'], $this->core->seo_static['pagination'], $seo_ext['pagination'] . ($seo_ext['pagination'] === '/' ? '?' : ''));\n\n\t\tforeach ($this->core->seo_ext as $type => $value)\n\t\t{\n\t\t\t$_value = trim($value, '/');\n\t\t\t// force '/' for both / and empty ext to add /? in RegEx (which allows both cases)\n\t\t\t$seo_ext[$type] = $_value ? str_replace('.', '\\\\.', $value) : '/';\n\t\t\t$rewrite_tpl_vars['{' . strtoupper($type) . '_PAGINATION}'] = $_value ? sprintf($spritf_tpl['pagin'], $this->core->seo_delim['start'], $seo_ext[$type]) : $reg_ex_page;\n\t\t\t// use url/? to allow both url and url/ to work as expected\n\t\t\t$rewrite_tpl_vars['{EXT_' . strtoupper($type) . '}'] = sprintf($spritf_tpl['ext'] , $seo_ext[$type]) . ($_value ? '' : '?');\n\t\t}\n\n\t\t$rewrite_tpl_vars['{PAGE_PAGINATION}'] = $reg_ex_page;\n\n\t\t// static bits\n\t\tforeach ($this->core->seo_static as $type => $value)\n\t\t{\n\t\t\tif (!is_array($this->core->seo_static[$type]))\n\t\t\t{\n\t\t\t\t$rewrite_tpl_vars['{STATIC_' . strtoupper($type) . '}'] = sprintf($spritf_tpl['static'], $this->core->seo_static[$type]);\n\t\t\t}\n\t\t}\n\n\t\t// delim bits\n\t\tforeach ($this->core->seo_delim as $type => $value)\n\t\t{\n\t\t\t$rewrite_tpl_vars['{DELIM_' . strtoupper($type) . '}'] = sprintf($spritf_tpl['delim'], $this->core->seo_delim[$type]);\n\t\t}\n\n\t\t$hostname = str_replace(array('https://', 'http://'), array('', ''), trim($this->core->seo_path['root_url'], '/ '));\n\t\t$hostname_no_www = '';\n\n\t\tif (preg_match('`^www\\.`', $hostname))\n\t\t{\n\t\t\t$hostname_no_www = preg_replace('`^www\\.`', '', $hostname);\n\t\t}\n\n\t\t$hostname_escaped = str_replace('.', '\\\\.', $hostname);\n\t\t// common server_conf vars\n\t\t$rewrite_tpl_vars += array(\n\t\t\t'{HOSTNAME}'\t\t=> $hostname,\n\t\t\t'{HOSTNAME_ESCAPED}'\t=> $hostname_escaped,\n\t\t\t'{REWRITEBASE}'\t\t=> $rewritebase,\n\t\t\t'{PHP_EX}'\t\t=> $this->php_ext,\n\t\t\t'{PHPBB_LPATH}'\t\t=> ($this->new_config['rbase'] || $this->core->seo_opt['virtual_root']) ? '' : $phpbb_path,\n\t\t\t'{PHPBB_RPATH}'\t\t=> $this->new_config['rbase'] ? '' : $phpbb_path,\n\t\t\t'{DEFAULT_SLASH}'\t=> $default_slash,\n\t\t\t'{WIERD_SLASH}'\t\t=> $wierd_slash,\n\t\t\t'{RED_SLASH}'\t\t=> $this->new_config['more_options'] ? $red_slash : '/',\n\t\t\t'{MOD_RTYPE}'\t\t=> $modrtype[$modrtype['type']],\n\t\t);\n\n\t\t// prettify rules\n\t\t$prettify_common = array(\n\t\t\t'comments' => array(\n\t\t\t\t'find' => array(\n\t\t\t\t\t'`^(\\s*)(#.*)$`m',\n\t\t\t\t\t'`^(\\s*)(//.*)$`m',\n\t\t\t\t\t'`^(\\s*)(/\\*.*\\*/)$`Um',\n\t\t\t\t),\n\t\t\t\t'replace' => '\\1<b style=\"color:blue\">\\2</b>',\n\t\t\t),\n\t\t\t'rewrite' => array(\n\t\t\t\t'find' => '`^(\\s*)(rewrite|RewriteRule|RewriteCond|RewriteBase|RewriteEngine)`m',\n\t\t\t\t'replace' => '\\1<b style=\"color:green\">\\2</b>',\n\t\t\t),\n\t\t);\n\n\t\t$rewrite_conf = array(\n\t\t\t'apache' => array(\n\t\t\t\t'header' => \"<IfModule mod_rewrite.c>\n\t# You may need to un-comment the following lines\n\t# Options +FollowSymlinks\n\t# To make sure that rewritten dir or file (/|.html) will not load dir.php in case it exist\n\t# Options -MultiViews\n\t# REMEBER YOU ONLY NEED TO STARD MOD REWRITE ONCE\n\tRewriteEngine On\n\n\t# Uncomment the statement below if you want to make use of\n\t# HTTP authentication and it does not already work.\n\t# This could be required if you are for example using PHP via Apache CGI.\n\t# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]\n\n\t# REWRITE BASE\n\tRewriteBase /{REWRITEBASE}\n\n\t# HERE IS A GOOD PLACE TO FORCE CANONICAL DOMAIN\n\t# Define fully qualified ssl aware protocol\n\t# RewriteCond %{SERVER_PORT}s ^(443(s)|[0-9]+s)$\n\t# RewriteRule ^.*$ - [env=HttpFullProto:http%2://]\n\t# RewriteCond %{HTTP_HOST} !^{HOSTNAME_ESCAPED}$ [NC]\n\t# RewriteRule ^(.*)$ %{ENV:HttpFullProto}{HOSTNAME}/{REWRITEBASE}$1 [QSA,L,R=301]\n\n\t# DO NOT GO FURTHER IF THE REQUESTED FILE / DIR DOES EXISTS\n\tRewriteCond %{REQUEST_FILENAME} -f [OR]\n\tRewriteCond %{REQUEST_FILENAME} -d\n\tRewriteRule . - [L]\",\n\n\t\t\t\t'footer' => '\t#\n\t# The following 3 lines will rewrite URLs passed through the front controller\n\t# to not require app.php in the actual URL. In other words, a controller is\n\t# by default accessed at /app.php/my/controller, but can also be accessed at\n\t# /my/controller\n\t#\n\tRewriteCond %{REQUEST_FILENAME} !-f\n\tRewriteCond %{REQUEST_FILENAME} !-d\n\tRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}(.*)$ {DEFAULT_SLASH}{PHPBB_RPATH}app.{PHP_EX} [QSA,L]\n\n</IfModule>\n\n# With Apache 2.4 the \"Order, Deny\" syntax has been deprecated and moved from\n# module mod_authz_host to a new module called mod_access_compat (which may be\n# disabled) and a new \"Require\" syntax has been introduced to mod_authz_host.\n# We could just conditionally provide both versions, but unfortunately Apache\n# does not explicitly tell us its version if the module mod_version is not\n# available. In this case, we check for the availability of module\n# mod_authz_core (which should be on 2.4 or higher only) as a best guess.\n<IfModule mod_version.c>\n\t<IfVersion < 2.4>\n\t\t<Files \"config.php\">\n\t\t\tOrder Allow,Deny\n\t\t\tDeny from All\n\t\t</Files>\n\t\t<Files \"common.php\">\n\t\t\tOrder Allow,Deny\n\t\t\tDeny from All\n\t\t</Files>\n\t</IfVersion>\n\t<IfVersion >= 2.4>\n\t\t<Files \"config.php\">\n\t\t\tRequire all denied\n\t\t</Files>\n\t\t<Files \"common.php\">\n\t\t\tRequire all denied\n\t\t</Files>\n\t</IfVersion>\n</IfModule>\n<IfModule !mod_version.c>\n\t<IfModule !mod_authz_core.c>\n\t\t<Files \"config.php\">\n\t\t\tOrder Allow,Deny\n\t\t\tDeny from All\n\t\t</Files>\n\t\t<Files \"common.php\">\n\t\t\tOrder Allow,Deny\n\t\t\tDeny from All\n\t\t</Files>\n\t</IfModule>\n\t<IfModule mod_authz_core.c>\n\t\t<Files \"config.php\">\n\t\t\tRequire all denied\n\t\t</Files>\n\t\t<Files \"common.php\">\n\t\t\tRequire all denied\n\t\t</Files>\n\t</IfModule>\n</IfModule>',\n\t\t\t\t'prettify' => array(\n\t\t\t\t\t'struct' => array(\n\t\t\t\t\t\t'find' => array(\n\t\t\t\t\t\t\t'`^(\\s*)(\\<(IfModule|IfVersion|Files)([^>]+)\\>)$`Um',\n\t\t\t\t\t\t\t'`^(\\s*)(\\</(IfModule|IfVersion|Files)\\>)$`Um',\n\t\t\t\t\t\t\t'`(\\s+)(\\[[A-Z0-9,=]+\\])$`Um'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'replace' => array(\n\t\t\t\t\t\t\t'\\1<b style=\"color:brown\"><\\3</b><b style=\"color:#FF00FF\">\\4</b><b style=\"color:brown\">></b>',\n\t\t\t\t\t\t\t'\\1<b style=\"color:brown\">\\2</b>',\n\t\t\t\t\t\t\t'\\1<b style=\"color:brown\">\\2</b>',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'header_title' => $this->user->lang['SEO_APACHE_CONF'],\n\t\t\t\t'header_message' => $show_rewritebase_opt && $this->new_config['rbase'] ?\n\t\t\t\t\tsprintf($this->user->lang['SEO_HTACCESS_FOLDER_MSG'], '<em style=\"color:#000\">' . $this->core->seo_path['phpbb_url'] . '</em>') :\n\t\t\t\t\tsprintf($this->user->lang['SEO_HTACCESS_ROOT_MSG'], '<em style=\"color:#000\">' . $this->core->seo_path['root_url'] . '</em>'),\n\t\t\t\t'filename' => '.htaccess',\n\t\t\t\t'rewrite_padding' => '\t',\n\t\t\t),\n\n\t\t\t// ngix\n\t\t\t'ngix' => array(\n\t\t\t\t'header' => '# Sample nginx configuration file for phpBB.\n# Global settings have been removed, copy them\n# from your system\\'s nginx.conf.\n# Tested with nginx 0.8.35.\n\n# If you want to use the X-Accel-Redirect feature,\n# add the following to your config.php.\n#\n# define(\\'PHPBB_ENABLE_X_ACCEL_REDIRECT\\', true);\n#\n# See http://wiki.nginx.org/XSendfile for the details\n# on X-Accel-Redirect.\nhttp {\n\t# Compression - requires gzip and gzip static modules.\n\tgzip on;\n\tgzip_static on;\n\tgzip_vary on;\n\tgzip_http_version 1.1;\n\tgzip_min_length 700;\n\n\t# Compression levels over 6 do not give an appreciable improvement\n\t# in compression ratio, but take more resources.\n\tgzip_comp_level 6;\n\n\t# IE 6 and lower do not support gzip with Vary correctly.\n\tgzip_disable \"msie6\";\n\t# Before nginx 0.7.63:\n\t#gzip_disable \"MSIE [1-6]\\.\";\n\n\t# Catch-all server for requests to invalid hosts.\n\t# Also catches vulnerability scanners probing IP addresses.\n\tserver {\n\t\t# default specifies that this block is to be used when\n\t\t# no other block matches.\n\t\tlisten 80 default;\n\n\t\tserver_name bogus;\n\t\treturn 444;\n\t\troot /var/empty;\n\t}\n\n\t# The actual board domain.\n\tserver {\n\t\t#listen 80;\n\t\tserver_name {HOSTNAME};\n\n\t\troot /{REWRITEBASE};\n\n\t\tlocation / {\n\t\t\t# phpbb uses index.htm\n\t\t\tindex index.php index.html index.htm;\n\n\t\t\t# multi domain ssl aware canonical hostname\n\t\t\t# if ($host != {HOSTNAME}) {\n\t\t\t# \trewrite ^ $scheme://{HOSTNAME}$request_uri permanent;\n\t\t\t# }\n\n\t\t\t# DO NOT GO FURTHER IF THE REQUESTED FILE / DIR DOES EXISTS\n\t\t\tif (-e $request_filename) {\n\t\t\t\tbreak;\n\t\t\t}',\n\t\t\t\t// footer\n\t\t\t\t'footer' => '\t\t\t#\n\t\t\t# The following 3 lines will rewrite URLs passed through the front controller\n\t\t\t# to not require app.php in the actual URL. In other words, a controller is\n\t\t\t# by default accessed at /app.php/my/controller, but can also be accessed at\n\t\t\t# /my/controller\n\t\t\t#\n\t\t\tif (!-e $request_filename) {\n\t\t\t\trewrite ^{WIERD_SLASH}{PHPBB_RPATH}(.*)$ {DEFAULT_SLASH}{PHPBB_RPATH}app.{PHP_EX} last;\n\t\t\t}\n\n\t\t}\n\t\t# Deny access to internal phpbb files.\n\t\tlocation ~ /(config\\.php|common\\.php|includes|cache|files|store|images/avatars/upload) {\n\t\t\tdeny all;\n\t\t\t# deny was ignored before 0.8.40 for connections over IPv6.\n\t\t\t# Use internal directive to prohibit access on older versions.\n\t\t\tinternal;\n\t\t}\n\n\t\t# Deny access to version control system directories.\n\t\tlocation ~ /\\.svn|/\\.git {\n\t\t\tdeny all;\n\t\t\tinternal;\n\t\t}\n\t}\n\n\t# If running php as fastcgi, specify php upstream.\n\tupstream php {\n\t\tserver unix:/tmp/php.sock;\n\t}\n}',\n\t\t\t\t'prettify' => array(\n\t\t\t\t\t'struct' => array(\n\t\t\t\t\t\t'find' => array(\n\t\t\t\t\t\t\t'`(break|last|permanent);$`m',\n\t\t\t\t\t\t\t'`^(\\s*)(location|http|server(_name)?|return|root|listen|index |upstream|gzip(_[a-z_]+)?)`m',\n\t\t\t\t\t\t\t'`^(\\s*)if \\(([^)]+)\\) {$`Um',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'replace' => array(\n\t\t\t\t\t\t\t'<b style=\"color:brown\">\\1</b>;',\n\t\t\t\t\t\t\t'\\1<b style=\"color:brown\">\\2</b>',\n\t\t\t\t\t\t\t'\\1<b style=\"color:brown\">if </b>(<b style=\"color:#FF00FF\">\\2</b>) {',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'translate' => array(\n\t\t\t\t\t'find' => array(\n\t\t\t\t\t\t'RewriteRule',\n\t\t\t\t\t\t'[QSA,L,NC]',\n\t\t\t\t\t\t'[QSA,L,NC,R=301]',\n\t\t\t\t\t\t'{WIERD_SLASH}',\n\t\t\t\t\t\t'{DEFAULT_SLASH}',\n\t\t\t\t\t),\n\t\t\t\t\t'replace' => array(\n\t\t\t\t\t\t'rewrite',\n\t\t\t\t\t\t'last;',\n\t\t\t\t\t\t'permanent;',\n\t\t\t\t\t\t$wierd_slash ? '' : '{RED_SLASH}',\n\t\t\t\t\t\t$rewritebase ? ($this->new_config['slash'] ? '' : '{RED_SLASH}') : '{RED_SLASH}',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'header_title' => $this->user->lang['SEO_NGIX_CONF'],\n\t\t\t\t'header_message' => $this->user->lang['SEO_NGIX_CONF_EXPLAIN'],\n\t\t\t\t'filename' => 'ngix.conf',\n\t\t\t\t'rewrite_padding' => '\t\t\t',\n\t\t\t),\n\t\t);\n\n\t\t$rewrite_rules = array();\n\t\tif (!empty($this->core->seo_static['index']))\n\t\t{\n\t\t\t$rewrite_rules += array(\n\t\t\t\t'forum_index' => '# FORUM INDEX\nRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}{STATIC_INDEX}{EXT_INDEX}$ {DEFAULT_SLASH}{PHPBB_RPATH}index.{PHP_EX} [QSA,L,NC]',\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$rewrite_rules += array(\n\t\t\t\t'forum_index' => '# FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. \"forum\" REQUIRES TO BE SET AS FORUM INDEX\n# RewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}forum\\.html$ {DEFAULT_SLASH}{PHPBB_RPATH}index.{PHP_EX} [QSA,L,NC]',\n\t\t\t);\n\t\t}\n\t\t$rewrite_rules += array(\n\t\t\t'forum' => '# FORUM ALL MODES\nRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}({STATIC_FORUM}|[a-z0-9_-]*{DELIM_FORUM})([0-9]+){FORUM_PAGINATION}$ {DEFAULT_SLASH}{PHPBB_RPATH}viewforum.{PHP_EX}?f=$2&start=$4 [QSA,L,NC]',\n\t\t\t\t'topic_vfolder' => '# TOPIC WITH VIRTUAL FOLDER ALL MODES\nRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}({STATIC_FORUM}|[a-z0-9_-]*{DELIM_FORUM})([0-9]+)/({STATIC_TOPIC}|[a-z0-9_-]*{DELIM_TOPIC})([0-9]+){TOPIC_PAGINATION}$ {DEFAULT_SLASH}{PHPBB_RPATH}viewtopic.{PHP_EX}?f=$2&t=$4&start=$6 [QSA,L,NC]',\n\n\t\t\t'topic_nofid' => '# TOPIC WITHOUT FORUM ID & DELIM ALL MODES\nRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}([a-z0-9_-]*)/?({STATIC_TOPIC}|[a-z0-9_-]*{DELIM_TOPIC})([0-9]+){TOPIC_PAGINATION}$ {DEFAULT_SLASH}{PHPBB_RPATH}viewtopic.{PHP_EX}?forum_uri=$1&t=$3&start=$5 [QSA,L,NC]',\n\t\t);\n\t\tif ($this->core->seo_opt['profile_noids'])\n\t\t{\n\t\t\t$rewrite_rules += array(\n\t\t\t\t'profile' => '# PROFILES THROUGH USERNAME\nRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}{STATIC_USER}/([^/]+)/?$ {DEFAULT_SLASH}{PHPBB_RPATH}memberlist.{PHP_EX}?mode=viewprofile&un=$1 [QSA,L,NC]',\n\n\t\t\t\t'user_messages' => '# USER MESSAGES THROUGH USERNAME\nRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}{STATIC_USER}/([^/]+)/(topics|posts){USER_PAGINATION}$ {DEFAULT_SLASH}{PHPBB_RPATH}search.{PHP_EX}?author=$1&sr=$2&start=$4 [QSA,L,NC]',\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$rewrite_rules += array(\n\t\t\t\t'profile' => '# PROFILES ALL MODES WITH ID\nRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}({STATIC_USER}|[a-z0-9_-]*{DELIM_USER})([0-9]+){EXT_USER}$ {DEFAULT_SLASH}{PHPBB_RPATH}memberlist.{PHP_EX}?mode=viewprofile&u=$2 [QSA,L,NC]',\n\n\t\t\t\t'user_messages' => '# USER MESSAGES ALL MODES WITH ID\nRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}({STATIC_USER}|[a-z0-9_-]*{DELIM_USER})([0-9]+){DELIM_SR}(topics|posts){USER_PAGINATION}$ {DEFAULT_SLASH}{PHPBB_RPATH}search.{PHP_EX}?author_id=$2&sr=$3&start=$5 [QSA,L,NC]',\n\t\t\t);\n\t\t}\n\n\t\t$rewrite_rules += array(\n\t\t\t'group' => '# GROUPS ALL MODES\nRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}({STATIC_GROUP}|[a-z0-9_-]*{DELIM_GROUP})([0-9]+){GROUP_PAGINATION}$ {DEFAULT_SLASH}{PHPBB_RPATH}memberlist.{PHP_EX}?mode=group&g=$2&start=$4 [QSA,L,NC]',\n\t\t\t'posts' => '# POSTS\nRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}{STATIC_POST}([0-9]+){EXT_POST}$ {DEFAULT_SLASH}{PHPBB_RPATH}viewtopic.{PHP_EX}?p=$1 [QSA,L,NC]',\n\n\t\t\t'active_topics' => '# ACTIVE TOPICS\nRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}{STATIC_ATOPIC}{ATOPIC_PAGINATION}$ {DEFAULT_SLASH}{PHPBB_RPATH}search.{PHP_EX}?search_id=active_topics&start=$2&sr=topics [QSA,L,NC]',\n\n\t\t\t'unanswered_topics' => '# UNANSWERED TOPICS\nRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}{STATIC_UTOPIC}{UTOPIC_PAGINATION}$ {DEFAULT_SLASH}{PHPBB_RPATH}search.{PHP_EX}?search_id=unanswered&start=$2&sr=topics [QSA,L,NC]',\n\n\t\t\t'new_posts' => '# NEW POSTS\nRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}{STATIC_NPOST}{NPOST_PAGINATION}$ {DEFAULT_SLASH}{PHPBB_RPATH}search.{PHP_EX}?search_id=newposts&start=$2&sr=topics [QSA,L,NC]',\n\n\t\t\t'unread_posts' => '# UNREAD POSTS\nRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}{STATIC_URPOST}{URPOST_PAGINATION}$ {DEFAULT_SLASH}{PHPBB_RPATH}search.{PHP_EX}?search_id=unreadposts&start=$2 [QSA,L,NC]',\n\n\t\t\t'the_team' => '# THE TEAM\nRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}{STATIC_LEADERS}{EXT_LEADERS}$ {DEFAULT_SLASH}{PHPBB_RPATH}memberlist.{PHP_EX}?mode=team [QSA,L,NC]',\n\n\t\t\t'comment_more_rules' => '# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES\n',\n\t\t);\n\n\t\t// mods server_conf pos1\n\t\tif (!empty($mods_ht['pos1']))\n\t\t{\n\t\t\t$rewrite_rules += $mods_ht['pos1'];\n\t\t}\n\n\t\t$rewrite_rules += array(\n\t\t\t'comment_forum_noid' => '# FORUM WITHOUT ID & DELIM ALL MODES\n# THESE LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY',\n\t\t);\n\n\t\tif (trim($this->core->seo_ext['forum'],'/'))\n\t\t{\n\t\t\t$rewrite_rules += array(\n\t\t\t\t'forum_noid' => array(\n\t\t\t\t\t'apache' => 'RewriteCond %{REQUEST_FILENAME} !-f\nRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}([a-z0-9_-]+?)(-([0-9]+))?{EXT_FORUM}$ {DEFAULT_SLASH}{PHPBB_RPATH}viewforum.{PHP_EX}?forum_uri=$1&start=$3 [QSA,L,NC]',\n\t\t\t\t\t'ngix' => 'if (!-e $request_filename) {\n\trewrite ^{WIERD_SLASH}{PHPBB_LPATH}([a-z0-9_-]+?)(-([0-9]+))?{EXT_FORUM}$ {DEFAULT_SLASH}{PHPBB_RPATH}viewforum.{PHP_EX}?forum_uri=$1&start=$3 last;\n}',\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$rewrite_rules += array(\n\t\t\t\t'forum_noid' => array(\n\t\t\t\t\t'apache' => 'RewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}([a-z0-9_-]+){FORUM_PAGINATION}$ {DEFAULT_SLASH}{PHPBB_RPATH}viewforum.{PHP_EX}?forum_uri=$1&start=$3 [QSA,L,NC]',\n\t\t\t\t\t'ngix' => 'if (!-e $request_filename) {\n\trewrite ^{WIERD_SLASH}{PHPBB_LPATH}([a-z0-9_-]+){FORUM_PAGINATION}$ {DEFAULT_SLASH}{PHPBB_RPATH}viewforum.{PHP_EX}?forum_uri=$1&start=$3 last;\n}',\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\t$fix_left_match = '';\n\t\t$fix_301_redirect = ',R=301';\n\t\tif ($this->core->seo_opt['virtual_root'])\n\t\t{\n\t\t\t$fix_left_match = '.+/';\n\t\t\t// do not 301 css and other broken links as this would means many\n\t\t\t// just serve them as usual instead, it's no such big deal if assets\n\t\t\t// are served from two urls as long as it's not on the same page.\n\t\t\t// of course, better would be to fix links from start but it's not\n\t\t\t// that obvious as long as phpBB does not fully enforces PHPBB_USE_BOARD_URL_PATH (for exts etc ...)\n\t\t\t$fix_301_redirect = '';\n\t\t}\n\n\t\t$rewrite_rules += array(\n\t\t\t'relative_files' => '# FIX RELATIVE PATHS : FILES\nRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}' . $fix_left_match . '(style\\.{PHP_EX}|ucp\\.{PHP_EX}|mcp\\.{PHP_EX}|faq\\.{PHP_EX}|posting\\.{PHP_EX}|download/file\\.{PHP_EX}|report\\.{PHP_EX}|adm/index\\.{PHP_EX}|cron\\.{PHP_EX})$ {DEFAULT_SLASH}{PHPBB_RPATH}$1 [QSA,L,NC' . $fix_301_redirect . ']',\n\n\t\t\t'relative_images' => '# FIX RELATIVE PATHS : IMAGES\nRewriteRule ^{WIERD_SLASH}{PHPBB_LPATH}' . $fix_left_match . '(styles/.*|images/.*|assets/.*|ext/.*)$ {DEFAULT_SLASH}{PHPBB_RPATH}$1 [QSA,L,NC' . $fix_301_redirect . ']',\n\t\t);\n\n\t\t// mods server_conf pos2\n\t\tif (!empty($mods_ht['pos2']))\n\t\t{\n\t\t\t$rewrite_rules += $mods_ht['pos2'];\n\t\t}\n\n\t\t// build rewrite conf\n\t\t$rewrite_conf_result = array();\n\t\t$html_output = '';\n\t\tforeach ($rewrite_conf as $engine => $setup)\n\t\t{\n\t\t\t$translate = !empty($setup['translate']) ? $setup['translate'] : false;\n\n\t\t\tif (!empty($translate))\n\t\t\t{\n\t\t\t\t$setup['header'] = str_replace($translate['find'], $translate['replace'], $setup['header']);\n\t\t\t\t$setup['footer'] = str_replace($translate['find'], $translate['replace'], $setup['footer']);\n\t\t\t}\n\n\t\t\t$rewrite_conf_result[$engine] = $setup['header'] . \"\\n\";\n\n\t\t\t// add rewrite rules\n\t\t\tforeach ($rewrite_rules as $key => $rule)\n\t\t\t{\n\t\t\t\tif (is_array($rule))\n\t\t\t\t{\n\t\t\t\t\t$rule = $rule[$engine];\n\t\t\t\t}\n\t\t\t\tif (!empty($translate))\n\t\t\t\t{\n\t\t\t\t\t$rule = str_replace($translate['find'], $translate['replace'], $rule);\n\t\t\t\t}\n\n\t\t\t\t$rewrtie_padding = $setup['rewrite_padding'];\n\t\t\t\t$rewrite_conf_result[$engine] .= $rewrtie_padding . str_replace(\"\\n\", \"\\n$rewrtie_padding\", $rule) . \"\\n\";\n\t\t\t}\n\n\t\t\t$rewrite_conf_result[$engine] .= $setup['footer'] . \"\\n\";\n\n\t\t\t// parse template variables\n\t\t\t$rewrite_conf_result[$engine] = array(\n\t\t\t\t'html' => str_replace(array_keys($rewrite_tpl_vars), array_values($rewrite_tpl_vars), utf8_htmlspecialchars($rewrite_conf_result[$engine])),\n\t\t\t);\n\t\t\t$rewrite_conf_result[$engine]['raw'] = str_replace(array('<', '>', '&'), array('<', '>', '&'), strip_tags($rewrite_conf_result[$engine]['html']));\n\t\t\tif ($html)\n\t\t\t{\n\t\t\t\t// prettify\n\t\t\t\tforeach ($prettify_common as $type => $prettify)\n\t\t\t\t{\n\t\t\t\t\t$rewrite_conf_result[$engine]['html'] = preg_replace($prettify['find'], $prettify['replace'], $rewrite_conf_result[$engine]['html']);\n\t\t\t\t}\n\n\t\t\t\tif (!empty($setup['prettify']))\n\t\t\t\t{\n\t\t\t\t\tforeach ($setup['prettify'] as $_type => $_prettify)\n\t\t\t\t\t{\n\t\t\t\t\t\t$rewrite_conf_result[$engine]['html'] = preg_replace($_prettify['find'], $_prettify['replace'], $rewrite_conf_result[$engine]['html']);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$rewrite_conf_result[$engine]['html_output'] = '<div class=\"content\">\n\t<div id=\"' . $engine . '_toggle\" title=\"' . $this->user->lang['SEO_SHOW'] . ' / ' . $this->user->lang['SEO_HIDE'] . '\">\n\t\t<h3>' . $setup['header_title'] . '</h3>\n\t\t<b style=\"color:red\">' . $setup['header_message'] . '</b><br><br>\n\t</div>\n\t<div id=\"' . $engine . '_code\">\n\t\t<dl style=\"padding:5px;background-color:#FFFFFF;border:1px solid #d8d8d8;font-size:12px;\">\n\t\t\t<dt style=\"border-bottom:1px solid #CCCCCC;margin-bottom:3px;font-weight:bold;display:block;\"> <a id=\"' . $engine . '_select\">' . $this->user->lang['SEO_SELECT_ALL'] . '</a></dt>\n\t\t\t<dd >\n\t\t\t\t<code style=\"padding-top:5px;line-height:1.3em;color:#8b8b8b;font-weight:bold;font-family: monospace;white-space: pre;\" id=\"' . $engine . '_code_select\">\n' . str_replace(array(\"\\n\", \"\\t\"), array('<br>', ' '), $rewrite_conf_result[$engine]['html']) . '\n\t\t\t\t</code>\n\t\t\t</dd>\n\t\t</dl>\n\t</div>\n</div>';\n\t\t\t\t$html_output .= $rewrite_conf_result[$engine]['html_output'];\n\t\t\t}\n\t\t}\n\n\t\t$this->template->assign_vars(array(\n\t\t\t'SEO_REWRITE_ENGINES'\t=> '[\"' . (implode('\",\"', array_keys($rewrite_conf))) . '\"]',\n\t\t));\n\n\t\tif ($html)\n\t\t{\n\t\t\t// HTML output\n\t\t\t$html_output = '</p>' . $html_output;\n\t\t\t$html_output .= '<div style=\"padding:5px;margin-top:10px;background-color:#FFFFFF;border:1px solid #d8d8d8;font-size:12px;\"><b>' . $this->user->lang['SEO_SERVER_CONF_CAPTION'] . ':</b><ul style=\"margin-left:30px;margin-top:10px;font-weight:bold;font-size:12px;\">\n\t<li style=\"color:blue\"> ' . $this->user->lang['SEO_SERVER_CONF_CAPTION_COMMENT'] . '</li>\n\t<li style=\"color:#A020F0\"> ' . $this->user->lang['SEO_SERVER_CONF_CAPTION_STATIC'] . '</li>\n\t<li style=\"color:#6A5ACD\"> ' . $this->user->lang['SEO_SERVER_CONF_CAPTION_SUFFIX'] . '</li>\n\t<li style=\"color:#FF00FF\"> ' . $this->user->lang['SEO_SERVER_CONF_CAPTION_DELIM'] . '</li>' . \"\\n\";\n\n\t\t\tif ($this->new_config['more_options'])\n\t\t\t{\n\t\t\t\t$html_output .= '<li style=\"color:red\"> ' . $this->user->lang['SEO_SERVER_CONF_CAPTION_SLASH'] . '</li>' . \"\\n\";\n\t\t\t}\n\n\t\t\t$html_output .= '</ul></div><p>' . \"\\n\";\n\t\t\treturn $html_output;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// File output\n\t\t\tforeach ($rewrite_conf as $engine => $setup)\n\t\t\t{\n\t\t\t\t$file = $this->core->seo_opt['cache_folder'] . $setup['filename'];\n\t\t\t\t$update = $rewrite_conf_result[$engine]['raw'];\n\t\t\t\t$this->write_cache($file, $update);\n\t\t\t}\n\t\t}\n\t}",
"public function getHtmlForPrimaryConfiguration(): string\n {\n $databaseMultibox = $this->getHtmlForReplicationDbMultibox();\n\n return $this->template->render(\n 'server/replication/primary_configuration',\n ['database_multibox' => $databaseMultibox]\n );\n }",
"function PMA_replication_print_status_table ($type, $hidden = false, $title = true) {\n global ${\"{$type}_variables\"};\n global ${\"{$type}_variables_alerts\"};\n global ${\"{$type}_variables_oks\"};\n global ${\"server_{$type}_replication\"};\n global ${\"strReplicationStatus_{$type}\"};\n\n // TODO check the Masters server id?\n // seems to default to '1' when queried via SHOW VARIABLES , but resulted in error on the master when slave connects\n // [ERROR] Error reading packet from server: Misconfigured master - server id was not set ( server_errno=1236)\n // [ERROR] Got fatal error 1236: 'Misconfigured master - server id was not set' from master when reading data from binary log\n //\n //$server_id = PMA_DBI_fetch_value(\"SHOW VARIABLES LIKE 'server_id'\", 0, 1);\n\n echo '<div id=\"replication_'. $type .'_section\" style=\"'. ($hidden ? 'display: none' : '') .'\"> '.\"\\n\";\n\n if ($title) {\n echo '<h4><a name=\"replication_'. $type .'\"></a>'.${\"strReplicationStatus_{$type}\"} .'</h4>'.\"\\n\";\n } else {\n echo '<br />'.\"\\n\";\n }\n\n echo ' <table id=\"server'. $type .'replicationsummary\" class=\"data\"> '.\"\\n\";\n echo ' <thead>'.\"\\n\";\n echo ' <tr>'.\"\\n\";\n echo ' \t<th>'. $GLOBALS['strVar'] .'</th>'.\"\\n\";\n echo '\t\t<th>'. $GLOBALS['strValue'] .'</th>'.\"\\n\";\n echo ' </tr>'.\"\\n\";\n echo ' </thead>'.\"\\n\";\n echo ' <tbody>'.\"\\n\";\n\n $odd_row = true;\n foreach (${\"{$type}_variables\"} as $variable) {\n echo ' <tr class=\"'. ($odd_row ? 'odd' : 'even') .'\">'.\"\\n\";\n echo ' <td class=\"name\">'.\"\\n\";\n echo $variable.\"\\n\";\n echo ' </td>'.\"\\n\";\n echo ' <td class=\"value\">'.\"\\n\";\n\n\n // TODO change to regexp or something, to allow for negative match\n if (isset(${\"{$type}_variables_alerts\"}[$variable])\n && ${\"{$type}_variables_alerts\"}[$variable] == ${\"server_{$type}_replication\"}[0][$variable]\n ) {\n echo '<span class=\"attention\">'.\"\\n\";\n }\n\n if (isset(${\"{$type}_variables_oks\"}[$variable])\n && ${\"{$type}_variables_oks\"}[$variable] == ${\"server_{$type}_replication\"}[0][$variable]\n ) {\n echo '<span class=\"allfine\">'.\"\\n\";\n } else {\n echo '<span>'.\"\\n\";\n }\n echo ${\"server_{$type}_replication\"}[0][$variable];\n echo '</span>'.\"\\n\";\n\n echo ' </td>'.\"\\n\";\n echo ' </tr>'.\"\\n\";\n\n $odd_row = !$odd_row;\n }\n\n echo ' </tbody>'.\"\\n\";\n echo ' </table>'.\"\\n\";\n echo ' <br />'.\"\\n\";\n echo '</div>'.\"\\n\";\n\n}",
"public static function getHtmlForSlaveConfiguration(\n $server_slave_status, array $server_slave_replication\n ) {\n $html = '<fieldset>';\n $html .= '<legend>' . __('Slave replication') . '</legend>';\n /**\n * check for multi-master replication functionality\n */\n $server_slave_multi_replication = $GLOBALS['dbi']->fetchResult(\n 'SHOW ALL SLAVES STATUS'\n );\n if ($server_slave_multi_replication) {\n $html .= __('Master connection:');\n $html .= '<form method=\"get\" action=\"server_replication.php\">';\n $html .= Url::getHiddenInputs($GLOBALS['url_params']);\n $html .= ' <select name=\"master_connection\">';\n $html .= '<option value=\"\">' . __('Default') . '</option>';\n foreach ($server_slave_multi_replication as $server) {\n $html .= '<option' . (isset($_REQUEST['master_connection'])\n && $_REQUEST['master_connection'] == $server['Connection_name'] ?\n ' selected=\"selected\"' : '') . '>' . $server['Connection_name']\n . '</option>';\n }\n $html .= '</select>';\n $html .= ' <input type=\"submit\" value=\"' . __('Go') . '\" id=\"goButton\" />';\n $html .= '</form>';\n $html .= '<br /><br />';\n }\n if ($server_slave_status) {\n $html .= '<div id=\"slave_configuration_gui\">';\n\n $_url_params = $GLOBALS['url_params'];\n $_url_params['sr_take_action'] = true;\n $_url_params['sr_slave_server_control'] = true;\n\n if ($server_slave_replication[0]['Slave_IO_Running'] == 'No') {\n $_url_params['sr_slave_action'] = 'start';\n } else {\n $_url_params['sr_slave_action'] = 'stop';\n }\n\n $_url_params['sr_slave_control_parm'] = 'IO_THREAD';\n $slave_control_io_link = 'server_replication.php'\n . Url::getCommon($_url_params);\n\n if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') {\n $_url_params['sr_slave_action'] = 'start';\n } else {\n $_url_params['sr_slave_action'] = 'stop';\n }\n\n $_url_params['sr_slave_control_parm'] = 'SQL_THREAD';\n $slave_control_sql_link = 'server_replication.php'\n . Url::getCommon($_url_params);\n\n if ($server_slave_replication[0]['Slave_IO_Running'] == 'No'\n || $server_slave_replication[0]['Slave_SQL_Running'] == 'No'\n ) {\n $_url_params['sr_slave_action'] = 'start';\n } else {\n $_url_params['sr_slave_action'] = 'stop';\n }\n\n $_url_params['sr_slave_control_parm'] = null;\n $slave_control_full_link = 'server_replication.php'\n . Url::getCommon($_url_params);\n\n $_url_params['sr_slave_action'] = 'reset';\n $slave_control_reset_link = 'server_replication.php'\n . Url::getCommon($_url_params);\n\n $_url_params = $GLOBALS['url_params'];\n $_url_params['sr_take_action'] = true;\n $_url_params['sr_slave_skip_error'] = true;\n $slave_skip_error_link = 'server_replication.php'\n . Url::getCommon($_url_params);\n\n if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') {\n $html .= Message::error(\n __('Slave SQL Thread not running!')\n )->getDisplay();\n }\n if ($server_slave_replication[0]['Slave_IO_Running'] == 'No') {\n $html .= Message::error(\n __('Slave IO Thread not running!')\n )->getDisplay();\n }\n\n $_url_params = $GLOBALS['url_params'];\n $_url_params['sl_configure'] = true;\n $_url_params['repl_clear_scr'] = true;\n\n $reconfiguremaster_link = 'server_replication.php'\n . Url::getCommon($_url_params);\n\n $html .= __(\n 'Server is configured as slave in a replication process. Would you ' .\n 'like to:'\n );\n $html .= '<br />';\n $html .= '<ul>';\n $html .= ' <li><a href=\"#slave_status_href\" id=\"slave_status_href\">';\n $html .= __('See slave status table') . '</a>';\n $html .= self::getHtmlForReplicationStatusTable('slave', true, false);\n $html .= ' </li>';\n\n $html .= ' <li><a href=\"#slave_control_href\" id=\"slave_control_href\">';\n $html .= __('Control slave:') . '</a>';\n $html .= ' <div id=\"slave_control_gui\" class=\"hide\">';\n $html .= ' <ul>';\n $html .= ' <li><a href=\"' . $slave_control_full_link . '\">';\n $html .= (($server_slave_replication[0]['Slave_IO_Running'] == 'No' ||\n $server_slave_replication[0]['Slave_SQL_Running'] == 'No')\n ? __('Full start')\n : __('Full stop')) . ' </a></li>';\n $html .= ' <li><a class=\"ajax\" id=\"reset_slave\"'\n . ' href=\"' . $slave_control_reset_link . '\">';\n $html .= __('Reset slave') . '</a></li>';\n if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') {\n $html .= ' <li><a href=\"' . $slave_control_sql_link . '\">';\n $html .= __('Start SQL Thread only') . '</a></li>';\n } else {\n $html .= ' <li><a href=\"' . $slave_control_sql_link . '\">';\n $html .= __('Stop SQL Thread only') . '</a></li>';\n }\n if ($server_slave_replication[0]['Slave_IO_Running'] == 'No') {\n $html .= ' <li><a href=\"' . $slave_control_io_link . '\">';\n $html .= __('Start IO Thread only') . '</a></li>';\n } else {\n $html .= ' <li><a href=\"' . $slave_control_io_link . '\">';\n $html .= __('Stop IO Thread only') . '</a></li>';\n }\n $html .= ' </ul>';\n $html .= ' </div>';\n $html .= ' </li>';\n $html .= ' <li>';\n $html .= self::getHtmlForSlaveErrorManagement($slave_skip_error_link);\n $html .= ' </li>';\n $html .= ' <li><a href=\"' . $reconfiguremaster_link . '\">';\n $html .= __('Change or reconfigure master server') . '</a></li>';\n $html .= '</ul>';\n $html .= '</div>';\n\n } elseif (! isset($_REQUEST['sl_configure'])) {\n $_url_params = $GLOBALS['url_params'];\n $_url_params['sl_configure'] = true;\n $_url_params['repl_clear_scr'] = true;\n\n $html .= sprintf(\n __(\n 'This server is not configured as slave in a replication process. '\n . 'Would you like to <a href=\"%s\">configure</a> it?'\n ),\n 'server_replication.php' . Url::getCommon($_url_params)\n );\n }\n $html .= '</fieldset>';\n\n return $html;\n }",
"function network_admin_html()\n {\n }",
"public function return_server_admin_panel()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $ret = '<div id=\"bmlt_admin_server_admin_disclosure_div\" class=\"bmlt_admin_server_admin_disclosure_div bmlt_admin_server_admin_disclosure_div_closed\">';\n $ret .= '<a class=\"bmlt_admin_server_admin_disclosure_a\" href=\"javascript:admin_handler_object.toggleServerAdmin();\">';\n $ret .= htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['server_admin_disclosure']);\n $ret .= '</a>';\n $ret .= '</div>';\n $ret .= '<div id=\"bmlt_admin_server_admin_wrapper_div\" class=\"bmlt_admin_server_admin_wrapper_div bmlt_admin_server_admin_wrapper_div_hidden\">';\n $ret .= '<div class=\"bmlt_admin_server_admin_banner_div\">';\n $ret .= '<div class=\"bmlt_admin_meeting_editor_banner_container_div\">';\n $ret .= '</div>';\n $ret .= '</div>';\n\n\n $ret .= '<div id=\"bmlt_admin_server_admin_editor_div\" class=\"bmlt_admin_server_admin_editor_div\">';\n $ret .= '<fieldset id=\"bmlt_admin_server_admin_editor_fieldset\" class=\"bmlt_admin_server_admin_editor_fieldset\">';\n $ret .= '<legend id=\"bmlt_admin_server_admin_editor_fieldset_legend\" class=\"bmlt_admin_server_admin_editor_fieldset_legend\">';\n // Put the select menu, or \"popup\", here\n if ($this->my_user->GetUserLevel() == _USER_LEVEL_SERVER_ADMIN) {\n $ret .= '<select id=\"bmlt_admin_server_admin_select\" class=\"bmlt_admin_server_admin_select\" onchange=\"admin_handler_object.toggleServerAdminSelect();\">';\n $ret .= '<option value=\"update_world_ids\" selected>'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['update_world_ids_from_spreadsheet_dropdown_text']).'</option>';\n $ret .= '<option value=\"naws_import\">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['import_service_bodies_and_meetings_dropdown_text']).'</option>';\n $ret .= '</select>';\n } else {\n $ret .= '<span class=\"server_admin_title_span\">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['update_world_ids_from_spreadsheet_dropdown_text']).'</span>';\n }\n $ret .= '</legend>';\n\n // World IDs update\n $ret .= '<div id=\"bmlt_admin_server_admin_update_world_ids_edit_form_inner_div\" class=\"bmlt_admin_server_admin_update_world_ids_edit_form_inner_div\">';\n $ret .= '<div class=\"bmlt_admin_server_admin_edit_form_inner_div\">';\n $ret .= '<div class=\"bmlt_admin_one_line_in_a_form clear_both\">';\n $ret .= '<span class=\"bmlt_admin_med_label_right\">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['server_admin_naws_spreadsheet_label']).'</span>';\n $ret .= '<span class=\"bmlt_admin_value_left\">';\n $ret .= '<input name=\"bmlt_admin_naws_spreadsheet_file_input\" id=\"bmlt_admin_naws_spreadsheet_file_input\" onchange=\"javascript:admin_handler_object.handleWorldIDFileInputChange();\" type=\"file\" />';\n $ret .= '</span>';\n $ret .= '</div>';\n $ret .= '<div class=\"bmlt_admin_one_line_in_a_form clear_both\">';\n $ret .= '<span class=\"bmlt_admin_med_label_right\"> </span>';\n $ret .= '<span id=\"bmlt_admin_update_world_ids_ajax_button_span\" class=\"bmlt_admin_value_left\"><a id=\"bmlt_admin_update_world_ids_ajax_button\" href=\"javascript:admin_handler_object.handleUpdateWorldIDsFromSpreadsheet();\" class=\"bmlt_admin_ajax_button button_disabled\">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['update_world_ids_button_text']).'</a></span>';\n $ret .= '<span id=\"bmlt_admin_update_world_ids_ajax_button_throbber_span\" class=\"bmlt_admin_value_left item_hidden\"><img src=\"local_server/server_admin/style/images/ajax-throbber-white.gif\" alt=\"AJAX Throbber\" /></span>';\n $ret .= '<div class=\"clear_both\"></div>';\n $ret .= '</div>';\n $ret .= '</div>';\n $ret .= '</div>';\n\n // NAWS Import\n $ret .= '<div id=\"bmlt_admin_server_admin_naws_import_edit_form_inner_div\" class=\"bmlt_admin_server_admin_naws_import_edit_form_inner_div item_hidden\">';\n $ret .= '<div class=\"bmlt_admin_server_admin_edit_form_inner_div\">';\n $ret .= '<div class=\"bmlt_admin_one_line_in_a_form clear_both\">';\n $ret .= '<span class=\"bmlt_admin_med_label_right\">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['server_admin_naws_import_spreadsheet_label']).'</span>';\n $ret .= '<span class=\"bmlt_admin_value_left\">';\n $ret .= '<input name=\"bmlt_admin_naws_import_file_input\" id=\"bmlt_admin_naws_import_file_input\" onchange=\"javascript:admin_handler_object.handleNAWSImportFileInputChange();\" type=\"file\" />';\n $ret .= '</span>';\n $ret .= '</div>';\n $ret .= '<div class=\"bmlt_admin_one_line_in_a_form clear_both\">';\n $ret .= '<span class=\"bmlt_admin_med_label_right\">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['server_admin_naws_import_initially_publish']).'</span>';\n $ret .= '<span class=\"bmlt_admin_value_left\">';\n $ret .= '<input type=\"checkbox\" name=\"bmlt_admin_naws_import_publish_checkbox\" id=\"bmlt_admin_naws_import_publish_checkbox\" checked=\"checked\" onchange=\"javascript:admin_handler_object.handleNAWSImportFileInputChange();\" />';\n $ret .= '</span>';\n $ret .= '<span class=\"span.bmlt_admin_unpublished_note_span\">  '.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['server_admin_naws_import_explanation']).'</span>';\n $ret .= '</div>';\n $ret .= '<div class=\"bmlt_admin_one_line_in_a_form clear_both\">';\n $ret .= '<span class=\"bmlt_admin_med_label_right\"> </span>';\n $ret .= '<span id=\"bmlt_admin_naws_import_ajax_button_span\" class=\"bmlt_admin_value_left\"><a id=\"bmlt_admin_naws_import_ajax_button\" href=\"javascript:admin_handler_object.handleNAWSImport();\" class=\"bmlt_admin_ajax_button button_disabled\">'.htmlspecialchars($this->my_localized_strings['comdef_server_admin_strings']['import_service_bodies_and_meetings_button_text']).'</a></span>';\n $ret .= '<span id=\"bmlt_admin_naws_import_ajax_button_throbber_span\" class=\"bmlt_admin_value_left item_hidden\"><img src=\"local_server/server_admin/style/images/ajax-throbber-white.gif\" alt=\"AJAX Throbber\" /></span>';\n $ret .= '<div class=\"clear_both\"></div>';\n $ret .= '</div>';\n $ret .= '</div>';\n $ret .= '</div>';\n\n\n\n $ret .= '</fieldset>';\n $ret .= '</div>';\n\n $ret .= '</div>';\n\n return $ret;\n }",
"function PMA_replication_print_slaves_table($hidden = false) {\n\n // Fetch data\n $data = PMA_DBI_fetch_result('SHOW SLAVE HOSTS', null, null); \n\n echo ' <br />';\n echo ' <div id=\"replication_slaves_section\" style=\"' . ($hidden ? 'display: none' : '') . '\"> ';\n echo ' <table class=\"data\">';\n echo ' <thead>';\n echo ' <tr>';\n echo ' <th>' . $GLOBALS['strBinLogServerId'] . '</th>';\n echo ' <th>' . $GLOBALS['strHost'] . '</th>';\n echo ' </tr>';\n echo ' </thead>';\n echo ' <tbody>';\n\n $odd_row = true;\n foreach ($data as $slave) {\n echo ' <tr class=\"' . ($odd_row ? 'odd' : 'even') . '\">';\n echo ' <td class=\"value\">' . $slave['Server_id'] . '</td>';\n echo ' <td class=\"value\">' . $slave['Host'] . '</td>';\n echo ' </tr>';\n\n $odd_row = ! $odd_row;\n }\n\n echo ' </tbody>';\n echo ' </table>';\n echo ' <br />';\n PMA_Message::notice('strReplicationShowConnectedSlavesNote')->display();\n echo ' <br />';\n echo ' </div>';\n}",
"private function showConfig()\n {\n $this->removeHTMLContent();\n $this->htmlContent .= \"<h4>Welcome to the configuration page. You can reset the admin password</h4>\";\n }",
"function show_server_form($defaults = array(), $number = FALSE) {\n ?>\n<form method=\"post\" action=\"\">\n <?php echo get_hidden_inputs();?>\n <input type=\"hidden\" name=\"action\" value=\"addserver_real\" />\n <?php\n echo get_hidden_cfg();\n if (!($number === FALSE)) {\n echo '<input type=\"hidden\" name=\"server\" value=\"' . $number . '\" />';\n }\n $hi = array ('bookmarktable', 'relation', 'table_info', 'table_coords', 'pdf_pages', 'column_info', 'designer_coords', 'history', 'AllowDeny');\n foreach ($hi as $k) {\n if (isset($defaults[$k]) && (!is_string($defaults[$k]) || strlen($defaults[$k]) > 0)) {\n echo '<input type=\"hidden\" name=\"' . $k . '\" value=\"' . htmlspecialchars(serialize($defaults[$k])) . '\" />';\n }\n }\n show_config_form(array(\n array('Server hostname', 'host', 'Hostname where MySQL server is running'),\n array('Server port', 'port', 'Port on which MySQL server is listening, leave empty for default'),\n array('Server socket', 'socket', 'Socket on which MySQL server is listening, leave empty for default'),\n array('Connection type', 'connect_type', 'How to connect to server, keep tcp if unsure', array('tcp', 'socket')),\n array('PHP extension to use', 'extension', 'What PHP extension to use, use mysqli if supported', array('mysql', 'mysqli')),\n array('Compress connection', 'compress', 'Whether to compress connection to MySQL server', FALSE),\n array('Authentication type', 'auth_type', 'Authentication method to use', array('cookie', 'http', 'config', 'signon')),\n array('User for config auth', 'user', 'Leave empty if not using config auth'),\n array('Password for config auth', 'password', 'Leave empty if not using config auth', 'password'),\n array('Only database to show', 'only_db', 'Limit listing of databases in left frame to this one'),\n array('Verbose name of this server', 'verbose', 'Name to display in server selection'),\n array('phpMyAdmin control user', 'controluser', 'User which phpMyAdmin can use for various actions'),\n array('phpMyAdmin control user password', 'controlpass', 'Password for user which phpMyAdmin can use for various actions', 'password'),\n array('phpMyAdmin database for advanced features', 'pmadb', 'phpMyAdmin will allow much more when you enable this. Table names are filled in automatically.'),\n array('Session name for signon auth', 'SignonSession', 'Leave empty if not using signon auth'),\n array('Login URL for signon auth', 'SignonURL', 'Leave empty if not using signon auth'),\n array('Logout URL', 'LogoutURL', 'Where to redirect user after logout'),\n ),\n 'Configure server',\n ($number === FALSE) ? 'Enter new server connection parameters.' : 'Editing server ' . get_server_name($defaults, $number),\n $defaults, $number === FALSE ? 'Add' : '', 'Servers_');\n ?>\n</form>\n <?php\n}",
"public function actionConfigSyncKickoff(): Response\n {\n return $this->renderTemplate('_special/configsync');\n }",
"function serverNotAvailable() {\n\t\t$this->setCacheLevelNone();\n\t\t$this->addHeader(self::HEADER_STATUS, self::HEADER_STATUS_503);\n\t\t$this->render($this->getTpl('503', '/error'));\n\t}",
"function PMA_select_server($not_only_options, $ommit_fieldset)\n{\n // Show as list?\n if ($not_only_options) {\n $list = $GLOBALS['cfg']['DisplayServersList'];\n $not_only_options =! $list;\n } else {\n $list = false;\n }\n\n if ($not_only_options) {\n echo '<form method=\"post\" action=\"index.php\" target=\"_parent\">';\n echo PMA_generate_common_hidden_inputs();\n\n if (! $ommit_fieldset) {\n echo '<fieldset>';\n }\n echo '<label for=\"select_server\">' . $GLOBALS['strServer'] . ':</label> ';\n\n echo '<select name=\"server\" id=\"select_server\"'\n . ' onchange=\"if (this.value != \\'\\') this.form.submit();\">';\n echo '<option value=\"\">(' . $GLOBALS['strServers'] . ') ...</option>' . \"\\n\";\n } elseif ($list) {\n echo $GLOBALS['strServer'] . ':<br />';\n echo '<ul id=\"list_server\">';\n }\n\n foreach ($GLOBALS['cfg']['Servers'] as $key => $server) {\n if (empty($server['host'])) {\n continue;\n }\n\n if (!empty($GLOBALS['server']) && (int) $GLOBALS['server'] === (int) $key) {\n $selected = 1;\n } else {\n $selected = 0;\n }\n\n if (!empty($server['verbose'])) {\n $label = $server['verbose'];\n } else {\n $label = $server['host'];\n if (!empty($server['port'])) {\n $label .= ':' . $server['port'];\n }\n }\n if (! empty($server['only_db'])) {\n if (! is_array($server['only_db'])) {\n $label .= ' - ' . $server['only_db'];\n // try to avoid displaying a too wide selector\n } elseif (count($server['only_db']) < 4) {\n $label .= ' - ' . implode(', ', $server['only_db']);\n }\n }\n if (!empty($server['user']) && $server['auth_type'] == 'config') {\n $label .= ' (' . $server['user'] . ')';\n }\n\n if ($list) {\n echo '<li>';\n if ($selected && !$ommit_fieldset) {\n echo '<strong>' . htmlspecialchars($label) . '</strong>';\n } else {\n\n echo '<a class=\"item\" href=\"index.php'\n . PMA_generate_common_url(array('server' => $key))\n . '\" target=\"_top\">' . htmlspecialchars($label) . '</a>';\n }\n echo '</li>';\n } else {\n echo '<option value=\"' . $key . '\" '\n . ($selected ? ' selected=\"selected\"' : '') . '>'\n . htmlspecialchars($label) . '</option>' . \"\\n\";\n }\n } // end while\n\n if ($not_only_options) {\n echo '</select>';\n // Show submit button if we have just one server (this happens with no default)\n echo '<noscript>';\n echo '<input type=\"submit\" value=\"' . $GLOBALS['strGo'] . '\" />';\n echo '</noscript>';\n if (! $ommit_fieldset) {\n echo '</fieldset>';\n }\n echo '</form>';\n } elseif ($list) {\n echo '</ul>';\n }\n}",
"public static function allowServerInfo()\n\t{\n\t\treturn MHTTPD::$config['Admin']['allow_server_info'];\n\t}",
"public static function get_server_url(): string {\n return get_config('mod_onlyoffice', 'documentserverurl');\n }",
"protected function backendNotHttpsEnabledContent() {\n\t\t$content = '<p style=\"color:red;\">ERROR: You are using an insecure connection to your TYPO3 backend. This is a major security risk. This extension will not work if the TYPO3 backend is not secured with ssl (https). Please contact your TYPO3 Administrator.</p>';\n\t\treturn($this->doc->section('Connection to the backend not secured with ssl', $content, 0, 1));\n\t}",
"public function network_config_page()\n {\n }",
"public function connectionView() {\n try {\n $connected = false;\n return $this->twig->render(\"connectionView\\connectionView.html.twig\", [\"connected\"=>$connected]);\n } catch (\\Exception $e){\n return $e->getMessage();\n }\n }",
"public function vp_config_page()\r\n\t{\r\n\t\t$attributes = array( 'vp_instance' => &$this );\r\n\t\techo vp_get_template_html( 'admin', $attributes );\r\n\t}",
"protected function createHTMLUpdate() {\n\t\t$this->setTemplateId('servers_update', 'servers.tpl.html');\n\n\t\t$server_id = $_GET['edit'];\n\n\t\t$tpl_data = array();\n\n\t\tswitch(intval($server_id)) {\n\t\t\tcase 0:\n\t\t\t\t// insert mode\n\t\t\t\t$tpl_data['titlemode'] = sm_get_lang('system', 'insert');\n\t\t\t\t$tpl_data['edit_server_id'] = '0';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// edit mode\n\n\t\t\t\t// get server entry\n\t\t\t\t$edit_server = $this->db->selectRow(\n\t\t\t\t\tSM_DB_PREFIX.'servers',\n\t\t\t\t\tarray('server_id' => $server_id)\n\t\t\t\t);\n\t\t\t\tif (empty($edit_server)) {\n\t\t\t\t\t$this->message = 'Invalid server id';\n\t\t\t\t\treturn $this->createHTMLList();\n\t\t\t\t}\n\n\t\t\t\t$tpl_data = array_merge($tpl_data, array(\n\t\t\t\t\t'titlemode' => sm_get_lang('system', 'edit') . ' ' . $edit_server['label'],\n\t\t\t\t\t'edit_server_id' => $edit_server['server_id'],\n\t\t\t\t\t'edit_value_label' => $edit_server['label'],\n\t\t\t\t\t'edit_value_ip' => $edit_server['ip'],\n\t\t\t\t\t'edit_value_port' => $edit_server['port'],\n\t\t\t\t\t'edit_type_selected_' . $edit_server['type'] => 'selected=\"selected\"',\n\t\t\t\t\t'edit_active_selected_' . $edit_server['active'] => 'selected=\"selected\"',\n\t\t\t\t\t'edit_email_selected_' . $edit_server['email'] => 'selected=\"selected\"',\n\t\t\t\t\t'edit_sms_selected_' . $edit_server['sms'] => 'selected=\"selected\"',\n\t\t\t\t));\n\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$this->tpl->addTemplateData(\n\t\t\t$this->getTemplateId(),\n\t\t\t$tpl_data\n\t\t);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether string is an md5 hash | function is_md5 ($string) {
return is_string($string) && preg_match('/^[0-9a-f]{32}$/', $string);
} | [
"public static function is_md5 ($string) {\n\t\treturn is_string($string) && preg_match('/^[0-9a-z]{32}$/', $string);\n\t}",
"static function is_md5($str)\n\t{\n\t\treturn preg_match('/^[0-9a-f]{32}$/',$str);\n\t}",
"public static function isMD5Str(string $md5)\n {\n return preg_match('#^[a-f0-9]{32}$#', $md5) ? true : false;\n }",
"function verifyMD5Hash() {\n if ( !isset( $this->md5String ) )\n return false;\n\n if ( $this->response['MD5 Hash'] == '' )\n return false;\n\n if ( strtoupper(md5( $this->md5String )) == $this->response['MD5 Hash'] )\n return true;\n\n return false;\n }",
"function isValidMd5($md5 ='')\n\t{\n\t\treturn preg_match('/^[a-f0-9]{32}$/', $md5);\n\t}",
"public static function isValidMd5($value)\n {\n return (strlen($value) == 32 and ctype_xdigit($value));\n }",
"function Md5($str){\r\n\t\treturn md5($str);\r\n\t}",
"function hashString($string){\n return hash ( \"md5\", $string, FALSE); // md5 Hash (One-Direction)\n }",
"function yourls_has_md5_password( $user ) {\n\tglobal $yourls_user_passwords;\n\treturn( isset( $yourls_user_passwords[ $user ] )\n\t && substr( $yourls_user_passwords[ $user ], 0, 4 ) == 'md5:'\n\t\t && strlen( $yourls_user_passwords[ $user ] ) == 42 // http://www.google.com/search?q=the+answer+to+life+the+universe+and+everything\n\t\t );\n}",
"public function md5($string) {\n\t\treturn md5($string);\n\t}",
"private function _isShaOne(string $string)\n {\n return (bool)preg_match('/^[0-9a-f]{40}$/i', $string);\n }",
"public static function md5($string)\n\t{\n\t\treturn static::factory(Hash::MD5, $string);\n\t}",
"public static function is_sha1($string) {\n if (ctype_xdigit($string) && strlen($string) == 40) {\n return TRUE;\n }\n return FALSE;\n }",
"public function md5Filter($string){\n return md5($string);\n }",
"public static function hash($string)\n {\n return md5($string);\n }",
"public static function isValidHash($str) {\n return !empty($str) && preg_match('/^[0-9A-Fa-f]{64}/', $str);\n }",
"public function md5($input);",
"function smd5($string)\t{\n\t\t$md5String = md5($string);\n\t\t$sha1String = sha1($md5String);\n\t\treturn $sha1String;\n\t}",
"public static function md5Match($asset_id, $md5){\n\t\t$sql = \"SELECT md5 FROM remote_assets WHERE id = $asset_id\";\n\t\t$db = Database::sqlite();\n\t\tif($old_md5 = $db->querySingle($sql)){\n\t\t\tif($old_md5 === $md5){\n\t\t\t\treturn TRUE;\n\t\t\t} else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\t$db->close();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns locations holding stock of a product !important: currently support for single and configurable products | public function getStockLocations($productId)
{
if($this->_stockLocations !== null) {
return $this->_stockLocations;
}
$return = array();
$warehouses = Mage::getModel('temando/warehouse')->getCollection();
foreach($warehouses->getItems() as $warehouse) {
if($warehouse->hasProduct($productId)) {
$warehouse->setElementId('qty_to_ship_'.$productId);
$return[] = $warehouse;
}
}
return $return;
} | [
"function getCurrentStock($product_id)\n\t{\n\t\t$location_id = $this->getCurrentLocationId();\n\n\t\t$sql = \"SELECT amount + reservations as stock\n\t\t\t\tFROM ia32_stockcurrent\n\t\t\t\tWHERE product_id = '\".stripQuotes($product_id).\"' AND location_id = '\".stripQuotes($location_id).\"'\";\n\n\t\t$recs = $this->db32select($sql);\n\t\t$stock = $recs[0]['stock'];\n\n\t\treturn $stock;\n\t}",
"public function getStockFromProducts()\n\t{\n\t\t$queryGenerator = new \\App\\QueryGenerator('Products');\n\t\t$queryGenerator->setStateCondition('All');\n\t\t$queryGenerator->setFields(['id', 'qtyinstock', 'ean'])->permissions = false;\n\t\t$queryGenerator->addCondition('id', $this->products, 'e');\n\t\treturn $queryGenerator->createQuery()->all();\n\t}",
"public function getProductStockInformation()\n {\n $stockSelect = $this->adapter->select()\n ->from(\n ['c_s_i' => $this->adapter->getTableName($this->_prefix . 'cataloginventory_stock_item')],\n array('entity_id' => 'product_id', 'value'=>'is_in_stock')\n );\n\n $childrenSelect = $this->adapter->select()\n ->from(\n ['c_p_r' => $this->adapter->getTableName($this->_prefix . 'catalog_product_relation')],\n ['c_p_r.child_id']\n )\n ->joinLeft(\n ['c_p_e' => $this->adapter->getTableName($this->_prefix . 'catalog_product_entity')],\n 'c_p_e.entity_id = c_p_r.parent_id',\n ['c_p_e.entity_id']\n )\n ->join(['t_d' => new \\Zend_Db_Expr(\"( \". $stockSelect->__toString() . ' )')],\n 't_d.entity_id = c_p_r.child_id',\n ['t_d.value']\n )\n ->where('t_d.value = ?', Mage_CatalogInventory_Model_Stock::STOCK_IN_STOCK);\n\n $parentSelect = $this->adapter->select()\n ->from(\n ['c_p_r' => $this->adapter->getTableName($this->_prefix . 'catalog_product_relation')],\n ['c_p_r.parent_id', 'entity_id' => 'c_p_r.child_id']\n )\n ->joinLeft(['t_d' => new \\Zend_Db_Expr(\"( \". $stockSelect->__toString() . ' )')],\n 't_d.entity_id = c_p_r.parent_id',\n ['t_d.value']\n )\n ->where('t_d.value = ?', Mage_CatalogInventory_Model_Stock::STOCK_IN_STOCK);\n\n $childCountSql = $this->adapter->select()\n ->from(\n [\"child_select\"=> new \\Zend_Db_Expr(\"( \". $childrenSelect->__toString() . ' )')],\n [\"child_count\" => new \\Zend_Db_Expr(\"COUNT(child_select.child_id)\"), 'entity_id']\n )\n ->group(\"child_select.entity_id\");\n\n $parentCountSql = $this->adapter->select()\n ->from(\n [\"parent_select\"=> new \\Zend_Db_Expr(\"( \". $parentSelect->__toString() . ' )')],\n [\"parent_count\" => new \\Zend_Db_Expr(\"COUNT(parent_select.parent_id)\"), 'entity_id']\n )\n ->group(\"parent_select.entity_id\");\n\n $select = $this->adapter->select()\n ->from(\n ['c_s_i' => $this->adapter->getTableName($this->_prefix . 'cataloginventory_stock_item')],\n array('entity_id' => 'product_id', 'qty', 'is_in_stock')\n )\n ->joinLeft(\n ['c_p_e' => $this->adapter->getTableName($this->_prefix . 'catalog_product_entity')],\n 'c_p_e.entity_id = c_s_i.product_id',\n ['c_p_e.type_id']\n )\n ->joinLeft(\n ['c_p_r' => $this->adapter->getTableName($this->_prefix . 'catalog_product_relation')],\n 'c_s_i.product_id = c_p_r.child_id',\n ['c_p_r.parent_id']\n );\n\n if($this->isDelta)$select->where('product_id IN(?)', $this->exportIds);\n\n $configurableType = Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE;\n $groupedType = Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE;\n $finalSelect = $this->adapter->select()\n ->from(\n [\"entity_select\" => new \\Zend_Db_Expr(\"( \". $select->__toString() . \" )\")],\n [\n \"entity_select.entity_id\",\n \"entity_select.qty\",\n \"is_in_stock\" => new \\Zend_Db_Expr(\"\n (CASE \n WHEN (entity_select.type_id = '{$configurableType}' OR entity_select.type_id = '{$groupedType}') AND entity_select.is_in_stock = '1' THEN IF(child_count.child_count > 0, 1, 0)\n WHEN entity_select.parent_id IS NOT NULL AND entity_select.is_in_stock = '1' THEN IF(parent_stock.parent_count > 0, 1, 0)\n ELSE entity_select.is_in_stock\n END\n )\"\n )\n ]\n )\n\n ->joinLeft(\n [\"child_count\"=> new \\Zend_Db_Expr(\"( \". $childCountSql->__toString() . \" )\")],\n \"child_count.entity_id = entity_select.entity_id\",\n []\n )\n ->joinLeft(\n [\"parent_stock\"=> new \\Zend_Db_Expr(\"( \". $parentCountSql->__toString() . \" )\")],\n \"parent_stock.entity_id = entity_select.entity_id\",\n []\n );\n\n return $this->adapter->fetchAll($finalSelect);\n }",
"public function findProductStockExtractedDataProvider() {\n\t\treturn array(\n\t\t\t'different-branches' => array(\n\t\t\t\t'variant-active-1',\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'branch-stock-1',\n\t\t\t\t\t\t'shop_branch_id' => 'branch-1',\n\t\t\t\t\t\t'stock' => '10',\n\t\t\t\t\t\t'shop_product_variant_id' => 'variant-active-1'\n\t\t\t\t\t), array(\n\t\t\t\t\t\t'id' => 'branch-stock-2',\n\t\t\t\t\t\t'shop_branch_id' => 'branch-2',\n\t\t\t\t\t\t'stock' => '15',\n\t\t\t\t\t\t'shop_product_variant_id' => 'variant-active-1'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'no-stock-added' => array(\n\t\t\t\t'no-stock-added',\n\t\t\t\tarray()\n\t\t\t),\n\t\t\t'variant-out-of-stock-1' => array(\n\t\t\t\t'variant-out-of-stock-1',\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'branch-stock-3',\n\t\t\t\t\t\t'shop_branch_id' => 'branch-1',\n\t\t\t\t\t\t'stock' => '0',\n\t\t\t\t\t\t'shop_product_variant_id' => 'variant-out-of-stock-1'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}",
"public function getProdStock()\n {\n return $this->prod_stock;\n }",
"public function getProductLocations()\n {\n return $this->getLocations();\n }",
"public function getStock($data)\n\t{\n\t\tparent::_checkInputValues($data, 2);\n\t\t\n\t\t$location = \"\";\n\t\t\n\t\tif($data[1] > 0)\n\t\t{\n\t\t\t$location = sprintf(\n\t\t\t\t\"\tAND\t\tproducts_stock.locationID = %d\",\n\t\t\t\t$data[1]\n\t\t\t);\n\t\t}\n\t\t\n\t\t$query = sprintf(\n\t\t\t\"\tSELECT\t\tIF(products_stock.stock IS NOT NULL, products_stock.stock, 0) AS stock,\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\tSELECT\t\tSUM(orders_product.quantity)\n\t\t\t\t\t\t\t\tFROM\t\torders_product\n\t\t\t\t\t\t\t\tINNER JOIN\torders ON orders.orderID = orders_product.orderID\n\t\t\t\t\t\t\t\tINNER JOIN\torder_statuses ON order_statuses.statusID = orders.statusID\n\t\t\t\t\t\t\t\tWHERE\t\torders_product.productID = %d\n\t\t\t\t\t\t\t\t\tAND\t\torder_statuses.finished = 0\n\t\t\t\t\t\t\t\t\tAND \torder_statuses.declined = 0\n\t\t\t\t\t\t\t) AS reserved\n\t\t\t\tFROM\t\tproducts\n\t\t\t\tLEFT JOIN\tproducts_stock ON products_stock.productID = products.productID\n\t\t\t\t\t%s\n\t\t\t\tWHERE\t\tproducts.productID = %d\",\n\t\t\t$data[0],\n\t\t\t$location,\n\t\t\t$data[0]\n\t\t);\n\t\t$result = parent::query($query);\n\t\t$row = parent::fetch_assoc($result);\n\t\t\n\t\t$row['stock'] = intval($row['stock']);\n\t\t$row['reserved'] = intval($row['reserved']);\n\t\t\n\t\treturn $row;\n\t}",
"public function testGETStockLocationIdInventoryStockLocations()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function stock() {\r\n\t\treturn POS_HOST_Stocks::instance();\r\n\t}",
"function wc_get_stock_html($product)\n {\n }",
"function wpsc_the_variation_stock() {\n\tglobal $wpsc_query, $wpdb;\n\t$out_of_stock = false;\n\tif(($wpsc_query->variation_group_count == 1) && ($wpsc_query->product['quantity_limited'] == 1)) {\n\t\t$product_id = $wpsc_query->product['id'];\n\t\t$variation_group_id = $wpsc_query->variation_group['variation_id'];\n\t\t$variation_id = $wpsc_query->variation['id'];\n\t\t\n\n\t\t$priceandstock_id = $wpdb->get_var(\"SELECT `priceandstock_id` FROM `\".WPSC_TABLE_VARIATION_COMBINATIONS.\"` WHERE `product_id` = '{$product_id}' AND `value_id` IN ( '$variation_id' ) AND `all_variation_ids` IN('$variation_group_id') LIMIT 1\");\n\t\t\n\t\t$variation_stock_data = $wpdb->get_var(\"SELECT `stock` FROM `\".WPSC_TABLE_VARIATION_PROPERTIES.\"` WHERE `id` = '{$priceandstock_id}' LIMIT 1\");\n\t\t\n\t}\n\treturn $variation_stock_data;\n}",
"public function getStock(){\r\n $defaults = $this->loadByRow(\"user\", $_SESSION[\"user\"]);\r\n \r\n return $defaults->search_stock;\r\n }",
"function dsf_get_options_stock($products_id, $options_id){\n \n $product_info_query = dsf_db_query(\"select product_options_stock from \" . DS_DB_SHOP . \".products where products_id='\" . (int)$products_id . \"'\");\n $product_info = dsf_db_fetch_array($product_info_query);\n \n \t\t\t\t\t\t$stock_counter =0;\n\t\t\t\t\t\t$product_items = explode(\"\\n\", $product_info['product_options_stock']);\t// make seperate lines\n\t\t\t\t\t\n\t\t\t\t\tforeach($product_items as $pi) {\n\t\t\t\t\t\t$pa = explode(\"~\" , $pi);\t\t// make seperate arrays\n\t\t\t\t\t\t $dosort = asort($pa);\n\t\t\t\t\t\t$pa_back='';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// put it back together.\n\t\t\t\t\t\t\tforeach($pa as $individuals) {\n\t\t\t\t\t\t\t\t\t\t$pa_back .= '~' . $individuals;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$pa_back = trim(str_replace(\"~~\",\"~\",$pa_back));\n\t\t\t\t\t\n\t\t\t\t\t// seperate it into two fields for array\n\t\t\t\t\t\t\t\t$pitems = explode(\"~ZZZStock:\" , $pa_back);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$id=trim($pitems[0]);\n\t\t\t\t\t\t\t\t$text=trim($pitems[1]);\n\t\t\t\t\t\n\t\t\t\t\t\tif ($text) $stock_array[$id] = $text;\n\t\t\t\t\t\t$stock_counter ++;\n\t\t\t\t\t}\n return (int)$stock_array[$options_id];\n \n }",
"public function getStock()\n {\n return $this->stock;\n }",
"public function getManageStock();",
"public function getStock()\n {\n return $this->stock;\n }",
"public function getEcommerceStockLocation() : bool\n {\n return $this->ecommerceStockLocation;\n }",
"public function getForcedStock();",
"public static function get_all_instock_products() {\r\n\r\n global $wpdb;\r\n\r\n // ****************************************************************************\r\n // General Vars\r\n // ****************************************************************************\r\n\r\n // WooCommerce > Settings > Product > Inventory\r\n $inventory_management = get_option( 'woocommerce_manage_stock' );\r\n\r\n $managed_join_query = \"\r\n LEFT JOIN $wpdb->postmeta post_meta_table2\r\n ON post_meta_table2.post_id = post_meta_table1.ID\r\n AND post_meta_table2.meta_key = '_manage_stock'\r\n AND post_meta_table2.meta_value = 'yes'\r\n LEFT JOIN $wpdb->postmeta post_meta_table3\r\n ON post_meta_table3.post_id = post_meta_table2.post_id\r\n AND (\r\n ( post_meta_table3.meta_key = '_stock' AND post_meta_table3.meta_value > 0 )\r\n OR\r\n ( post_meta_table3.meta_key = '_backorders' AND post_meta_table3.meta_value IN ( 'yes' , 'notify' ) )\r\n )\r\n \";\r\n\r\n $unmanaged_join_query = \"\r\n LEFT JOIN $wpdb->postmeta post_meta_table2\r\n ON post_meta_table2.post_id = post_meta_table1.ID\r\n AND post_meta_table2.meta_key = '_manage_stock'\r\n AND post_meta_table2.meta_value = 'no'\r\n LEFT JOIN $wpdb->postmeta post_meta_table3\r\n ON post_meta_table3.post_id = post_meta_table2.post_id\r\n AND post_meta_table3.meta_key = '_stock_status'\r\n AND post_meta_table3.meta_value = 'instock'\r\n \";\r\n\r\n\r\n // ****************************************************************************\r\n // Get variable product ids\r\n // ****************************************************************************\r\n $variable_product_term_taxonomy_id = self::get_variable_product_term_taxonomy_id();\r\n $managed_has_stock_variable_product_ids = self::get_managed_variable_product_ids_with_stock( $inventory_management , $variable_product_term_taxonomy_id );\r\n $managed_no_stock_variable_product_ids = self::get_managed_variable_product_ids_with_no_stock( $inventory_management , $variable_product_term_taxonomy_id );\r\n $unmanaged_variable_product_ids = self::get_unmanaged_variable_product_ids( $inventory_management , $variable_product_term_taxonomy_id );\r\n $variable_product_ids = self::get_variable_product_ids( $inventory_management , $variable_product_term_taxonomy_id , $managed_has_stock_variable_product_ids , $managed_no_stock_variable_product_ids , $unmanaged_variable_product_ids );\r\n\r\n\r\n // ****************************************************************************\r\n // Non-variable product query\r\n // ****************************************************************************\r\n $instock_non_variable_products_id = self::get_instock_none_variable_products_ids( $inventory_management , $variable_product_ids );\r\n\r\n if ( $inventory_management == 'yes' ) {\r\n\r\n // ****************************************************************************\r\n // Since this is managed variable product and the stock qty is set to zero,\r\n // then all we have to do is check the variations that is also managed and has\r\n // stock qty set to greater than zero.\r\n //\r\n // If at least one variation of the current variable product comply with this,\r\n // then we display this variable product on the wholesale order form page.\r\n //\r\n // The reason for this is, if variation is unmanaged, and the parent variable\r\n // product is set to managed, and has stock qty of 0, then the unmanged\r\n // variation inherits the parent variable qty which is 0.\r\n //\r\n // Therefore we can conclude that unmanaged variations under a managed variable\r\n // product that has qty of 0 is automatically out of stock too.\r\n // ****************************************************************************\r\n\r\n $instock_managed_no_stock_variable_product_ids = array();\r\n if ( !empty( $managed_no_stock_variable_product_ids ) ) {\r\n\r\n $managed_no_stock_variable_product_ids_str = implode( ',' , $managed_no_stock_variable_product_ids );\r\n\r\n $query = \"\r\n SELECT DISTINCT post_meta_table1.post_parent\r\n FROM $wpdb->posts post_meta_table1\r\n \";\r\n\r\n $where_query = \"\r\n WHERE post_meta_table1.post_status = 'publish'\r\n AND post_meta_table1.post_type = 'product_variation'\r\n AND post_meta_table1.post_parent IN (\" . $managed_no_stock_variable_product_ids_str . \")\r\n \";\r\n\r\n $query_results = $wpdb->get_results( $query . $managed_join_query . $where_query , ARRAY_A );\r\n\r\n foreach ( $query_results as $qr )\r\n $instock_managed_no_stock_variable_product_ids[] = (int) $qr[ 'post_parent' ];\r\n\r\n }\r\n\r\n // ****************************************************************************\r\n // Since this is managed variable product with stock qty greater than 0\r\n // then we need to check both variations that are un-managed and managed\r\n // ****************************************************************************\r\n $instock_managed_has_stock_variable_product_ids = array();\r\n if ( !empty( $managed_has_stock_variable_product_ids ) ) {\r\n\r\n $managed_has_stock_variable_product_ids_str = implode( \",\" , $managed_has_stock_variable_product_ids );\r\n\r\n $query = \"\r\n SELECT DISTINCT post_meta_table1.post_parent\r\n FROM $wpdb->posts post_meta_table1\r\n \";\r\n\r\n $where_query = \"\r\n WHERE post_meta_table1.post_status = 'publish'\r\n AND post_meta_table1.post_type = 'product_variation'\r\n AND post_meta_table1.post_parent IN (\" . $managed_has_stock_variable_product_ids_str . \")\r\n \";\r\n\r\n // Manged Instock Products\r\n $managed_list = array();\r\n $query_results = $wpdb->get_results( $query . $managed_join_query . $where_query , ARRAY_A );\r\n\r\n foreach ( $query_results as $qr )\r\n $managed_list[] = (int) $qr[ 'post_parent' ];\r\n\r\n // Unmanaged Instock Products\r\n $unmanaged_list = array();\r\n $query_results = $wpdb->get_results( $query . $unmanaged_join_query . $where_query , ARRAY_A );\r\n\r\n foreach ( $query_results as $qr )\r\n $unmanaged_list[] = (int) $qr[ 'post_parent' ];\r\n\r\n $instock_managed_has_stock_variable_product_ids = array_unique( array_merge( $managed_list , $unmanaged_list ) );\r\n\r\n }\r\n\r\n // ****************************************************************************\r\n // Un-managed variable product, we need to check both\r\n // un-managed and managed variations\r\n // ****************************************************************************\r\n $instock_unmanaged_variable_product_ids = array();\r\n if ( !empty( $unmanaged_variable_product_ids ) ) {\r\n\r\n $unmanaged_variable_product_ids_str = implode( \",\" , $unmanaged_variable_product_ids );\r\n\r\n $query = \"\r\n SELECT DISTINCT post_meta_table1.post_parent\r\n FROM $wpdb->posts post_meta_table1\r\n \";\r\n\r\n $where_query = \"\r\n WHERE post_meta_table1.post_status = 'publish'\r\n AND post_meta_table1.post_type = 'product_variation'\r\n AND post_meta_table1.post_parent IN (\" . $unmanaged_variable_product_ids_str . \")\r\n \";\r\n\r\n // Manged Instock Products\r\n $managed_list = array();\r\n $query_results = $wpdb->get_results( $query . $managed_join_query . $where_query , ARRAY_A );\r\n\r\n foreach ( $query_results as $qr )\r\n $managed_list[] = (int) $qr[ 'post_parent' ];\r\n\r\n // Unmanaged Instock Products\r\n $unmanaged_list = array();\r\n $query_results = $wpdb->get_results( $query . $unmanaged_join_query . $where_query , ARRAY_A );\r\n\r\n foreach ( $query_results as $qr )\r\n $unmanaged_list[] = (int) $qr[ 'post_parent' ];\r\n\r\n $instock_unmanaged_variable_product_ids = array_unique( array_merge( $managed_list , $unmanaged_list ) );\r\n\r\n }\r\n\r\n $instock_variable_products_id = array_unique( array_merge( $instock_managed_no_stock_variable_product_ids , $instock_managed_has_stock_variable_product_ids , $instock_unmanaged_variable_product_ids ) );\r\n\r\n } else { // Inventory management is disabled. We still need to check the stock status though.\r\n\r\n $instock_variable_products_id = array();\r\n\r\n $q = \"\r\n SELECT DISTINCT post_meta_table1.post_parent\r\n FROM $wpdb->posts post_meta_table1\r\n LEFT JOIN $wpdb->postmeta post_meta_table2\r\n ON post_meta_table2.post_id = post_meta_table1.ID\r\n WHERE post_meta_table1.post_status = 'publish'\r\n AND post_meta_table2.meta_key = '_stock_status'\r\n AND post_meta_table2.meta_value = 'instock'\r\n AND post_meta_table1.post_type = 'product_variation'\"\r\n ;\r\n\r\n $query_results = $wpdb->get_results( $q , ARRAY_A );\r\n\r\n foreach ( $query_results as $qr )\r\n $instock_variable_products_id[] = $qr[ 'post_parent' ];\r\n\r\n }\r\n\r\n // **************************************\r\n // Merge in stock non-variable and\r\n // variable product ids\r\n // **************************************\r\n $instock_products_id = array_unique( array_merge( $instock_non_variable_products_id , $instock_variable_products_id ) );\r\n\r\n // If empty, we return an array that has a single value of zero\r\n // This is necessary to indicate that no instock products is present\r\n if ( empty( $instock_products_id ) )\r\n $instock_products_id = array( 0 );\r\n\r\n return $instock_products_id;\r\n\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get ResourceBookings by 'user_id' property. | function getResourceBookingsByUserId($a_iUserId)
{
$oResourceBookingSelector = getResourceBookingSelector();
$oResourceBookingSelector->setUserId($a_iUserId);
$oResourceBookingCollection = $this->read($oResourceBookingSelector);
return $oResourceBookingCollection;
} | [
"public function getBookingsForUser($a_user_id) {\r\n\t\t$set = $this->ilDB->query('SELECT * FROM ' . dbc::BOOKINGS_TABLE . ' WHERE pool_id = ' . $this->ilDB->quote($this->pool_id, 'integer')\r\n\t\t\t. ' AND user_id = ' . $this->ilDB->quote($a_user_id, 'integer') . ' AND (date_from >= \"' . date('Y-m-d H:i:s') . '\"' . ' OR date_to >= \"'\r\n\t\t\t. date('Y-m-d H:i:s') . '\")' . ' ORDER BY date_from ASC');\r\n\t\t$bookings = array();\r\n\t\twhile ($row = $this->ilDB->fetchAssoc($set)) {\r\n\t\t\t$bookings[] = $row;\r\n\t\t}\r\n\r\n\t\treturn $bookings;\r\n\t}",
"public function showBookings(User $user)\n {\n return response()->json($user->bookings()->with(['servicerenders','vendor','vehicle'])->get(),200);\n }",
"public function getByUserId($user_id)\n {\n return Bookmarks::where('user_id', '=', $user_id)\n ->get([\n 'user_id as userId',\n 'place_id as placeId'\n ]);\n }",
"public function getBorrowersByUserID($user_id) {\n\t\ttry {\n\t\t\t\n\t\t\t$data = $this->invoke('getBorrowersByUserID', array('user_id' => $user_id));\n\t\t\t$results = array();\n\t\t\tforeach ($data as $obj) {\n\t\t\t\tarray_push($results, VCDSoapTools::GetBorrowerObj($obj));\n\t\t\t}\n\t\t\treturn $results;\n\t\t\t\n\t\t} catch (Exception $ex) {\n\t\t\tthrow $ex;\n\t\t}\n\t}",
"public function getBookByUserId( $userId ){\n\t\t$bookDAO = new LivroDao();\n\t\t$resultSearchBookByUserId = $bookDAO->getBookByUserId( $userId );\n\t\treturn $resultSearchBookByUserId;\n\t}",
"public function findByUser($user)\n {\n $em = $this->container->get('doctrine.orm.entity_manager');\n $listings = $em->getRepository('AppBundle:Listing')\n ->findBy(array('user'=>$user));\n return $listings;\n }",
"public function getAllToInvoice(?User $user = null): array\n {\n $rsm = new ResultSetMappingBuilder($this->getEntityManager(), ResultSetMappingBuilder::COLUMN_RENAMING_INCREMENT);\n $rsm->addRootEntityFromClassMetadata(Booking::class, 'booking');\n $rsm->addJoinedEntityFromClassMetadata(Bookable::class, 'bookable', 'booking', 'bookable');\n $selectClause = $rsm->generateSelectClause();\n\n $userFilter = $user ? 'AND user.id = :user' : '';\n\n $sql = \"\n SELECT $selectClause FROM booking\n JOIN bookable ON booking.bookable_id = bookable.id\n JOIN user ON booking.owner_id = user.id AND user.role NOT IN (:roles)\n LEFT JOIN account ON user.id = account.owner_id\n LEFT JOIN transaction_line ON\n account.id = transaction_line.debit_id\n AND transaction_line.bookable_id = bookable.id\n AND transaction_line.transaction_date >= :currentYear\n AND transaction_line.transaction_date < :nextYear\n WHERE\n user.status != :userStatus\n $userFilter\n AND bookable.booking_type IN (:bookingType)\n AND booking.status = :bookingStatus\n AND booking.start_date < :nextYear\n AND (booking.end_date IS NULL OR booking.end_date >= :nextYear)\n AND bookable.is_active\n AND bookable.periodic_price != 0\n AND transaction_line.id IS NULL\n ORDER BY booking.owner_id ASC, bookable.name ASC\n \";\n\n $query = $this->getEntityManager()->createNativeQuery($sql, $rsm)\n ->setParameter('bookingType', [BookingTypeType::MANDATORY, BookingTypeType::ADMIN_ASSIGNED, BookingTypeType::ADMIN_APPROVED], ArrayParameterType::STRING)\n ->setParameter('bookingStatus', BookingStatusType::BOOKED)\n ->setParameter('userStatus', User::STATUS_ARCHIVED)\n ->setParameter('currentYear', ChronosDate::now()->firstOfYear()->toDateString())\n ->setParameter('nextYear', ChronosDate::now()->firstOfYear()->addYears(1)->toDateString())\n ->setParameter('roles', [User::ROLE_BOOKING_ONLY], ArrayParameterType::STRING);\n\n if ($user) {\n $query->setParameter('user', $user->getId());\n }\n\n $result = $query->getResult();\n\n return $result;\n }",
"public function getItemsBorrowedByUser()\n {\n $id = $this->request->id;\n $user = new BorrowerService();\n try {\n $result = $user->getItemsBorrowedByuserId($id);\n if (count($result) > 0) {\n return response()->json([\n 'Success' => true,\n 'Items' => $result\n ], 200);\n }\n return response()->json([\n 'Success' => false,\n 'Items' => \"no items found for user with ID $id\"\n ], 404);\n\n } catch (Exception $ex) {\n return response()->json([\n 'success' => false,\n 'message' => 'your request could not be completed'\n ], 500);\n }\n }",
"public function showBookingsServices(User $user)\n {\n return response()->json($user->servicerenders()->with(['bookings'])->get(),200);\n //return response()->json($user->bookings()->with(['servicerenders'])->get(),200);\n }",
"public function findBookableResources()\n {\n $q = new ullQuery('UllBookingResource');\n $q\n ->addWhere('x.is_bookable = ?', true)\n ->addOrderBy('Translation->name')\n ;\n return $q->execute();\n }",
"public function getEmailsBookerResource($resource_id) {\n\n $sql = \"SELECT DISTINCT user.email AS email \n\t\t\t\tFROM core_users AS user\n\t\t\t\tINNER JOIN bk_calendar_entry AS bk_calendar_entry ON user.id = bk_calendar_entry.recipient_id\n\t\t\t\tWHERE bk_calendar_entry.resource_id=?\n AND deleted=0\n\t\t\t\tAND user.is_active = 1 \n\t\t\t\t;\";\n $req = $this->runRequest($sql, array($resource_id));\n return $req->fetchAll();\n }",
"public function getBillingsWithUserId($userId)\n {\n $user = User::find($userId);\n\n return $user->cards;\n }",
"public function get($userId, $shelf, $optParams = array())\n {\n $params = array('userId' => $userId, 'shelf' => $shelf);\n $params = array_merge($params, $optParams);\n return $this->call('get', array($params), \"Google_Service_Books_Bookshelf\");\n }",
"public function findAllUserBooks(string $userUid): array;",
"function get_bookings($id)\n {\n $result = $this->db->get_where('bookings', array(\n 'id' => $id\n ))->row_array();\n $db_error = $this->db->error();\n if (! empty($db_error['code'])) {\n echo 'Database error! Error Code [' . $db_error['code'] . '] Error: ' . $db_error['message'];\n exit();\n }\n return $result;\n }",
"public function findBookingById($id);",
"public function get($userId, $shelf, $optParams = array())\n {\n $params = array('userId' => $userId, 'shelf' => $shelf);\n $params = array_merge($params, $optParams);\n return $this->call('get', array($params), \"Books_Bookshelf\");\n }",
"public function getBooks(User $user)\n {\n return $this->paginate($this->bookService->prepareBooks($user->getBooks()));\n }",
"public function getBooking($id){\n \treturn Self::find($id);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
single premium member details | public function show_premium_member_details($id)
{
$data['PremiumMemberDetails'] = $this->PaymentModel->PremiumMemberDetails($id);
$this->load->view('admin/pages/show_premium_member',$data);
} | [
"public function getMemberDetails() {\r\n $id = $this->session->gets('ameriaa_user_id');\r\n $sql = \"SELECT * FROM \".DB_PREFIX.\"members WHERE member_id = '$id' \" ;\r\n return $this->db->find($sql);\r\n \r\n }",
"function memberInfo($member_id, $member_name=\"\") {\n\t \t$this->profile($member_id);\n \t}",
"public function getPremium()\n {\n return $this->premium;\n }",
"public function getPremiumInfo() {\n return $this->get(self::PREMIUM_INFO);\n }",
"public function getMember();",
"public function get_member()\r\n {\r\n return $this->member;\r\n }",
"public function getPremiumMembershipDetails($date)\n {\n $data = User::where('users.premium_at', '>=', $date->start_day)\n ->where('users.premium_at', '<=', $date->end_day)\n ->selectRaw('users.premium_at, u1.username as sponsor, '\n . 'users.username')\n ->leftJoin('users as u1', 'users.sponsor_id', '=', 'u1.id')\n ->orderBy('users.premium_at')\n ->get();\n\n return ['details' => $data];\n }",
"public function getPremium()\n {\n return isset($this->premium) ? $this->premium : null;\n }",
"function custom_profile_data()\n\t{\n\n\t\t$member_id = ( ! ee()->TMPL->fetch_param('member_id')) ? ee()->session->userdata('member_id') : ee()->TMPL->fetch_param('member_id');\n\n\t\t$member = ee('Model')\n\t\t\t->get('Member', $member_id)\n\t\t\t->with('MemberGroup')\n\t\t\t->first();\n\n\t\tif ( ! $member)\n\t\t{\n\t\t\treturn ee()->TMPL->tagdata = '';\n\t\t}\n\n\t\t$results = $member->getValues() + array('group_title' => $member->MemberGroup->group_title);\n\t\t$default_fields = $results;\n\n\t\t// Is there an avatar?\n\t\t$avatar_path = $member->getAvatarUrl();\n\t\tif (ee()->config->item('enable_avatars') == 'y' && ! empty($avatar_path))\n\t\t{\n\t\t\t$avatar_width\t= $results['avatar_width'];\n\t\t\t$avatar_height\t= $results['avatar_height'];\n\t\t\t$avatar\t\t\t= TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$avatar_path\t= '';\n\t\t\t$avatar_width\t= '';\n\t\t\t$avatar_height\t= '';\n\t\t\t$avatar\t\t\t= FALSE;\n\t\t}\n\n\t\t// Is there a member photo?\n\t\tif (ee()->config->item('enable_photos') == 'y' AND $results['photo_filename'] != '')\n\t\t{\n\t\t\t$photo_path\t\t= ee()->config->item('photo_url').$results['photo_filename'];\n\t\t\t$photo_width\t= $results['photo_width'];\n\t\t\t$photo_height\t= $results['photo_height'];\n\t\t\t$photo\t\t\t= TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$photo_path\t= '';\n\t\t\t$photo_width\t= '';\n\t\t\t$photo_height\t= '';\n\t\t\t$photo\t\t\t= FALSE;\n\t\t}\n\n\t\t// Is there a signature image?\n\t\tif (ee()->config->item('enable_signatures') == 'y')\n\t\t{\n\t\t\t$sig_img_path\t= $member->getSignatureImageUrl();\n\t\t\t$sig_img_width\t= $results['sig_img_width'];\n\t\t\t$sig_img_height\t= $results['sig_img_height'];\n\t\t\t$sig_img_image\t= TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sig_img_path\t= '';\n\t\t\t$sig_img_width\t= '';\n\t\t\t$sig_img_height\t= '';\n\t\t\t$sig_img\t\t= FALSE;\n\t\t}\n\n\t\t// Parse variables\n\t\tif ($this->in_forum == TRUE)\n\t\t{\n\t\t\t$search_path = $this->forum_path.'member_search/'.$this->cur_id.'/';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$search_path = ee()->functions->fetch_site_index(0, 0).QUERY_MARKER.'ACT='.ee()->functions->fetch_action_id('Search', 'do_search').'&mbr='.urlencode($results['member_id']);\n\t\t}\n\n\t\t$more_fields = array(\n\t\t\t\t\t\t\t'send_private_message'\t=> $this->_member_path('messages/pm/'.$member_id),\n\t\t\t\t\t\t\t'search_path'\t\t\t=> $search_path,\n\t\t\t\t\t\t\t'avatar_url'\t\t\t=> $avatar_path,\n\t\t\t\t\t\t\t'avatar_filename'\t\t=> $results['avatar_filename'],\n\t\t\t\t\t\t\t'avatar_width'\t\t\t=> $avatar_width,\n\t\t\t\t\t\t\t'avatar_height'\t\t\t=> $avatar_height,\n\t\t\t\t\t\t\t'photo_url'\t\t\t\t=> $photo_path,\n\t\t\t\t\t\t\t'photo_filename'\t\t=> $results['photo_filename'],\n\t\t\t\t\t\t\t'photo_width'\t\t\t=> $photo_width,\n\t\t\t\t\t\t\t'photo_height'\t\t\t=> $photo_height,\n\t\t\t\t\t\t\t'signature_image_url'\t\t=> $sig_img_path,\n\t\t\t\t\t\t\t'signature_image_filename'\t=> $results['sig_img_filename'],\n\t\t\t\t\t\t\t'signature_image_width'\t\t=> $sig_img_width,\n\t\t\t\t\t\t\t'signature_image_height'\t=> $sig_img_height\n\t\t\t\t\t\t);\n\n\t\t$default_fields = array_merge($default_fields, $more_fields);\n\n\t\t// Fetch the custom member field definitions\n\t\t$fields = array();\n\n\t\tee()->db->select('m_field_id, m_field_name, m_field_fmt');\n\t\t$query = ee()->db->get('member_fields');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach ($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$fields[$row['m_field_name']] = array($row['m_field_id'], $row['m_field_fmt']);\n\t\t\t}\n\t\t}\n\n\t\tee()->load->library('typography');\n\t\tee()->typography->initialize();\n\n\t\tee()->load->library('api');\n\t\tee()->legacy_api->instantiate('channel_fields');\n\n\t\t$cond = $default_fields;\n\n\t\t// Get field names present in the template, sans modifiers\n\t\t$clean_field_names = array_map(function($field)\n\t\t{\n\t\t\t$field = ee('Variables/Parser')->parseVariableProperties($field);\n\n\t\t\treturn $field['field_name'];\n\t\t}, array_flip(ee()->TMPL->var_single));\n\n\t\t// Get field IDs for the member fields we need to fetch\n\t\t$member_field_ids = array();\n\t\tforeach ($clean_field_names as $field_name)\n\t\t{\n\t\t\tif (isset($fields[$field_name][0]))\n\t\t\t{\n\t\t\t\t$member_field_ids[] = $fields[$field_name][0];\n\t\t\t}\n\t\t}\n\n\t\t// Cache member fields here before we start parsing\n\t\tif ( ! empty($member_field_ids))\n\t\t{\n\t\t\t$this->member_fields = ee('Model')->get('MemberField', array_unique($member_field_ids))\n\t\t\t\t->all()\n\t\t\t\t->indexBy('field_id');\n\t\t}\n\n\t\tforeach (array($results) as $row)\n\t\t{\n\t\t\t$cond['avatar']\t= $avatar;\n\t\t\t$cond['photo'] = $photo;\n\n\t\t\tforeach($fields as $key => $value)\n\t\t\t{\n\t\t\t\t$cond[$key] = ee()->typography->parse_type($row['m_field_id_'.$value['0']],\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'text_format'\t=> $value['1'],\n\t\t\t\t\t\t'html_format'\t=> 'safe',\n\t\t\t\t\t\t'auto_links'\t=> 'y',\n\t\t\t\t\t\t'allow_img_url' => 'n'\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t}\n\n\t\t\tee()->TMPL->tagdata = ee()->functions->prep_conditionals(ee()->TMPL->tagdata, $cond);\n\n\t\t\t$dates = array(\n\t\t\t\t'last_visit' => (empty($default_fields['last_visit'])) ? '' : $default_fields['last_visit'],\n\t\t\t\t'last_activity' => (empty($default_fields['last_activity'])) ? '' : $default_fields['last_activity'],\n\t\t\t\t'join_date' => (empty($default_fields['join_date'])) ? '' : $default_fields['join_date'],\n\t\t\t\t'last_entry_date' => (empty($default_fields['last_entry_date'])) ? '' : $default_fields['last_entry_date'],\n\t\t\t\t'last_forum_post_date' => (empty($default_fields['last_forum_post_date'])) ? '' : $default_fields['last_forum_post_date'],\n\t\t\t\t'last_comment_date' => (empty($default_fields['last_comment_date'])) ? '' : $default_fields['last_comment_date']\n\t\t\t);\n\n\t\t\t// parse date variables\n\t\t\tee()->TMPL->tagdata = ee()->TMPL->parse_date_variables(ee()->TMPL->tagdata, $dates);\n\n\t\t\t// Swap Variables\n\t\t\tforeach (ee()->TMPL->var_single as $key => $val)\n\t\t\t{\n\t\t\t\t// parse default member data\n\n\t\t\t\t// {name}\n\t\t\t\t$name = ( ! $default_fields['screen_name']) ? $default_fields['username'] : $default_fields['screen_name'];\n\n\t\t\t\t$name = $this->_convert_special_chars($name);\n\n\t\t\t\tif ($key == \"name\")\n\t\t\t\t{\n\t\t\t\t\tee()->TMPL->tagdata = $this->_var_swap_single($val, $name, ee()->TMPL->tagdata);\n\t\t\t\t}\n\n\t\t\t\t// {member_group}\n\t\t\t\tif ($key == \"member_group\")\n\t\t\t\t{\n\t\t\t\t\tee()->TMPL->tagdata = $this->_var_swap_single($val, $default_fields['group_title'], ee()->TMPL->tagdata);\n\t\t\t\t}\n\n\t\t\t\t// {email}\n\t\t\t\tif ($key == \"email\")\n\t\t\t\t{\n\t\t\t\t\tee()->TMPL->tagdata = $this->_var_swap_single($val, ee()->typography->encode_email($default_fields['email']), ee()->TMPL->tagdata, FALSE);\n\t\t\t\t}\n\n\t\t\t\t// {timezone}\n\t\t\t\tif ($key == \"timezone\")\n\t\t\t\t{\n\t\t\t\t\t$timezone = ($default_fields['timezone'] != '') ? ee()->lang->line($default_fields['timezone']) : '';\n\n\t\t\t\t\tee()->TMPL->tagdata = $this->_var_swap_single($val, $timezone, ee()->TMPL->tagdata);\n\t\t\t\t}\n\n\t\t\t\t// {local_time}\n\t\t\t\tif (strncmp($key, 'local_time', 10) == 0)\n\t\t\t\t{\n\t\t\t\t\t$locale = FALSE;\n\n\t\t\t\t\tif (ee()->session->userdata('member_id') != $this->cur_id)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Default is UTC?\n\t\t\t\t\t\t$locale = ($default_fields['timezone'] == '') ? 'UTC' : $default_fields['timezone'];\n\t\t\t\t\t}\n\n\t\t\t\t\tee()->TMPL->tagdata = $this->_var_swap_single(\n\t\t\t\t\t\t$key,\n\t\t\t\t\t\tee()->localize->format_date($val, NULL, $locale),\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\t\t\t\t}\n\n\n\t\t\t\t// Special consideration for {total_forum_replies}, and\n\t\t\t\t// {total_forum_posts} whose meanings do not match the\n\t\t\t\t// database field names\n\t\t\t\tif ($key == 'total_forum_replies')\n\t\t\t\t{\n\t\t\t\t\tee()->TMPL->tagdata = $this->_var_swap_single($key, $default_fields['total_forum_posts'], ee()->TMPL->tagdata);\n\t\t\t\t}\n\n\t\t\t\tif ($key == 'total_forum_posts')\n\t\t\t\t{\n\t\t\t\t\t$total_posts = $default_fields['total_forum_topics'] + $default_fields['total_forum_posts'];\n\t\t\t\t\tee()->TMPL->tagdata = $this->_var_swap_single($key, $total_posts, ee()->TMPL->tagdata);\n\t\t\t\t}\n\n\t\t\t\t// parse basic fields (username, screen_name, etc.)\n\t\t\t\tif (array_key_exists($key, $default_fields))\n\t\t\t\t{\n\t\t\t\t\tee()->TMPL->tagdata = $this->_var_swap_single($val, $default_fields[$val], ee()->TMPL->tagdata);\n\t\t\t\t}\n\n\t\t\t\t// Custom member fields\n\t\t\t\t$field = ee('Variables/Parser')->parseVariableProperties($key);\n\t\t\t\t$val = $field['field_name'];\n\n\t\t\t\t// parse custom member fields\n\t\t\t\tif (isset($fields[$val]))\n\t\t\t\t{\n\t\t\t\t\tif (array_key_exists('m_field_id_'.$fields[$val]['0'], $row))\n\t\t\t\t\t{\n\t\t\t\t\t\tee()->TMPL->tagdata = $this->parseField(\n\t\t\t\t\t\t\t$fields[$val]['0'],\n\t\t\t\t\t\t\t$field,\n\t\t\t\t\t\t\t$row['m_field_id_'.$fields[$val]['0']],\n\t\t\t\t\t\t\tee()->TMPL->tagdata,\n\t\t\t\t\t\t\t$member_id,\n\t\t\t\t\t\t\tarray(),\n\t\t\t\t\t\t\t$key\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tee()->TMPL->tagdata = ee()->TMPL->swap_var_single(\n\t\t\t\t\t\t$key,\n\t\t\t\t\t\t'',\n\t\t\t\t\t\tee()->TMPL->tagdata\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 ee()->TMPL->tagdata;\n\t}",
"function svbk_rcp_export_member_row( $data, $member ) {\n\t\n\t$fields = svbk_rcp_company_fields();\n\t\n\t$all_user_meta = get_user_meta( $member->ID );\n\t\n\tforeach ($fields as $field_name => $field_label) {\n\t\t $data[$field_name] = isset($all_user_meta[$field_name]) ? $all_user_meta[$field_name][0] : '';\n\t}\n\t\n\treturn $data;\n}",
"public function getMember()\n {\n return Member::get_by_id(Member::class, $this->slug);\n }",
"function team_member_info() {\n \n // Get codeigniter object instance\n $CI = get_instance();\n \n // Load Team Model\n $CI->load->model('team');\n \n // Get member_id's input\n $member_id = $CI->input->get('member_id');\n \n // Get member details\n $get_member = $CI->team->get_member( $CI->user_id, $member_id );\n \n // If members exists\n if ( $get_member ) {\n \n // Display success message\n $data = array(\n 'success' => TRUE,\n 'member_info' => $get_member,\n 'date' => time(),\n 'never' => $CI->lang->line( 'mu326' )\n );\n \n echo json_encode($data);\n \n } else {\n\n // Display error message\n $data = array(\n 'success' => FALSE,\n 'message' => $CI->lang->line( 'mm3' )\n );\n\n echo json_encode($data); \n\n }\n \n }",
"public function getMember()\n {\n }",
"public function getMember()\n {\n return $this->member;\n }",
"public function premium()\n {\n $pageTitle = \"Business Services For B2B Customers | Premium membership for B2B Customers | Weafricans.com\";\n $metaDescription = \"Weafricans provide a extra facility to premium membership customers that help transform a small mid and semi large size african business and get connected to potential business partners,importers and real buyers.\";\n $flag = 1;\n\n if (Auth::check() && Auth::user()->currency && Auth::user()->currency != 'NGN') {\n $userCurrency = Auth::user()->currency ? Auth::user()->currency : 'NGN';\n\n if ($userCurrency != 'NGN') {\n $currency = Helper::convertCurrency(strtoupper('NGN'), strtoupper($userCurrency), 1);\n } else {\n $currency = Helper::convertCurrency(strtoupper('NGN'), strtoupper('NGN'), 1);\n }\n\n $array['price'] = \"IF((currency = '\".strtoupper($userCurrency).\"'), (price), (price * \".$currency.\")) as price\";\n $array['currency'] = \"IF((currency = '\".strtoupper($userCurrency).\"'), (currency), ('\".$userCurrency.\"')) as currency\";\n\n $plans = SubscriptionPlan::select('*', DB::raw(implode(\", \", $array)))->where('type', 'like', '%Premium%')->where('is_blocked',0)->get();\n } elseif(!Auth::check()) {\n\n $userCurrency = 'USD';\n\n $currency = Helper::convertCurrency(strtoupper('NGN'), strtoupper($userCurrency), 1);\n\n $array['price'] = \"IF((currency = '\".strtoupper($userCurrency).\"'), (price), (price * \".$currency.\")) as price\";\n $array['currency'] = \"IF((currency = '\".strtoupper($userCurrency).\"'), (currency), ('\".$userCurrency.\"')) as currency\";\n\n $plans = SubscriptionPlan::select('*', DB::raw(implode(\", \", $array)))->where('type', 'like', '%premium%')->where('is_blocked', 0)->get();\n }else{\n $plans = SubscriptionPlan::where('type', 'like', '%Premium%')->where('is_blocked',0)->get();\n \n }\n \n return view('subscription-plan-pages.premium', compact('pageTitle', 'flag', 'plans', 'metaDescription'));\n }",
"public function is_premium()\n {\n }",
"function get_member_data()\n\t{\n\t\tif (isset($_SERVER['HTTP_X_REQUESTED_WITH']) AND $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')\n\t\t{\n\t\t\tglobal $IN, $LANG, $DB, $PREFS;\n\n\t\t\t// Is the requested member banned, a guest or pending? If so, we'll bail with a suitable\n\t\t\t// message since a banned member would generate an error message\n\t\t\t// We'll also use this query if the request is valid\n\t\t\t$query = $DB->query(\"SELECT * FROM exp_members WHERE member_id = '\".$DB->escape_str($IN->GBL('member_id', 'GET')).\"'\");\n\t\t\t\n\t\t\tif ($query->num_rows <> 1 OR $query->row['group_id'] == 2 OR $query->row['group_id'] == 3 OR $query->row['group_id'] == 4)\n\t\t\t{\n\t\t\t\t$LANG->fetch_language_file('member');\n\t\t\t\t$LANG->fetch_language_file('pur_member_utilities');\n\t\t\t\techo $LANG->line('profile_not_available').'. '.$LANG->line('pur_member_utilities_use_profile_link');\n\t\t\t\texit;\n\t\t\t}\n\t\t\t\n\t\t\tif ( ! class_exists('Member'))\n\t \t{\n\t \t\trequire PATH_MOD.'member/mod.member.php';\n\t \t}\n\t\n\t\t\tif ( ! class_exists('Member_settings'))\n\t \t{\n\t \t\trequire PATH_MOD.'member/mod.member_settings.php';\n\t \t}\n\n\t \t$MS = new Member_settings();\n\n\t \tforeach(get_object_vars($this) as $key => $value)\n\t\t\t{\n\t\t\t\t$MS->{$key} = $value;\n\t\t\t}\n\t\t\t\n\t\t\t$MS->cur_id = $IN->GBL('member_id', 'GET');\n\t\t\t$MS->theme_path = PATH_MBR_THEMES.'default/profile_theme.php';\n\n\t \t$r = $MS->public_profile();\n\n\t\t\t// So now we need to sort out the non-parsed language\n\t\t\tpreg_match_all(\"/{lang:(.+)}/sU\", $r, $matches);\n\t\t\t\n\t\t\t$search = $matches[0];\n\t\t\t$replace = array();\n\n\t\t\t$LANG->fetch_language_file('member');\n\t\t\t$LANG->fetch_language_file('myaccount');\n\t\t\t\n\t\t\tforeach($matches[1] AS $key => $val)\n\t\t\t{\n\t\t\t\t$replace[] = ($LANG->line($val) != '') ? $LANG->line($val) : $LANG->line('mbr_'.$val);\n\t\t\t}\n\n\t\t\t$r = str_replace($search, $replace, $r);\n\n\t\t\t// Now let's parse the image stuff\n\t\t\tif ($PREFS->ini('enable_photos') == 'y' AND $query->row['photo_filename'] != '')\n\t\t\t{\n\t\t\t\t$photo_path\t\t= $PREFS->ini('photo_url', 1).$query->row['photo_filename'];\n\t\t\t\t$photo_width\t= $query->row['photo_width'];\n\t\t\t\t$photo_height\t= $query->row['photo_height'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$photo_path\t= $PREFS->ini('theme_folder_url').'profile_themes/'.$PREFS->ini('profile_themes', 1).$PREFS->ini('member_theme').'/images/';\n\t\t\t\t$photo_width\t= '';\n\t\t\t\t$photo_height\t= '';\n\t\t\t}\n\t\t\t\n\t\t\t$image_path\t= $PREFS->ini('theme_folder_url').'profile_themes/'.$PREFS->ini('profile_themes', 1).$PREFS->ini('member_theme').'/images/';\n\t\t\t\n\t\t\t$r = str_replace('{path:photo_url}', $photo_path, $r);\n\t\t\t\n\t\t\t$r = str_replace('{path:image_url}', $image_path, $r);\n\n\t\t\t// Okay, lastly let's sort out the link for viewing all posts if forum module installed\n\t\t\t$query = $DB->query(\"SELECT * FROM exp_modules WHERE module_name = 'Forum'\");\n\t\t\tif ($query->num_rows == 1)\n\t\t\t{\n\t\t\t\t$separator = '';\n\t\t\t\t\n\t\t\t\tif ($PREFS->ini('site_index'))\n\t\t\t\t{\n\t\t\t\t\t$separator = '/';\n\t\t\t\t}\n\t\t\t\t// Okay, the forum is installed, let's get its search path\n\t\t\t\t$r = str_replace('?ACT={AID:Search:do_search}&mbr=', $separator.'forums/member_search/', $r);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// We remove the link entirely\n\t\t\t\t$r = preg_replace('/<a\\s+.*{AID:Search:do_search}.*<\\/a>/U', '', $r);\n\t\t\t}\n\t\t\t\n\t\t\t// Remove Edit Ignore List - that should be done in My Account\n\t\t\t$r = preg_replace('/<a\\s+.*\\/member\\/edit_ignore_list\\/.*<\\/a>/U', '', $r);\n\n\t\t\t$css = '<style type=\"text/css\">'.$this->_profile_css().'</style>';\n\t\t\t\n\t\t\t$r = $css . $r;\n\t\t\t\n\t\t\techo $r;\n\t\t}\n\t}",
"protected function profile() {\n\n $this->view->experience = $this->_experienceModel->getExperienceByMember($this->_idMember);\n $this->view->study = $this->_studyModel->getStudyByMember($this->_idMember);\n $this->view->skills = $this->_skillsModel->getSkillsByMember($this->_idMember);\n }",
"public function getMemberInfo()\n {\n return $this->member_info;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set model home directory | protected function setModelsHome($dir)
{
$this->_modelsHome = $dir;
return $this;
} | [
"public function setHome()\n {\n if($this->os == 'win')\n {\n $this->home = $this->temp;\n }\n else\n {\n $this->home = getenv('HOME') . DS;\n }\n }",
"public static function ModelFolder()\n {\n return dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . Configuration::getApplicationFolder() . DIRECTORY_SEPARATOR . 'Model';\n }",
"public function getUserHomePath();",
"public static function setModelDirectory($dir)\n\t{\n\t\tself::$_modelDir = rtrim($dir, '/');\n\t}",
"public function getUserHomePath()\n {\n return $this->serverBag->get('HOME');\n }",
"public function setSavePath()\n {\n $savePath = $this->app->getDataRoot() . \"upload/\" . date('Ym/', $this->now);\n if(!file_exists($savePath)) @mkdir($savePath, 0777, true);\n $this->savePath = dirname($savePath) . '/';\n }",
"private function autodetect_home() {\n\t\tif ($this->home !== null)\n\t\t\treturn;\n\t\tif (php_sapi_name() == 'cli')\n\t\t\treturn $this->home = '/';\n\t\t$home = dirname($_SERVER['SCRIPT_NAME']);\n\t\t$home = !$home || $home[0] != '/'\n\t\t\t? '/' : rtrim($home, '/') . '/';\n\t\t$this->home = $home;\n\t}",
"protected function modelBasePath()\n {\n return app_path() . \"/Models/Championship\";\n\n }",
"protected function setUploadDirectory()\n {\n $config = Config::getInstance();\n $this->dir = '../' . $config->get('upload_dir') . '/users/' . $this->user->get('directory');\n }",
"private function _getModelPath()\n {\n return APPPATH.'models';\n }",
"protected function makeModelDirectory()\n {\n return $this->makeDirectory($this->modelPath);\n }",
"private function setUserDir()\n\t{\n\t\t$now = Carbon::now();\n\n\t\t// the 'D' means directory, nothing pervy\n\t\t$d_segments = array(\n\t\t\tpublic_path(), \n\t\t\t'pictures', \n\t\t\t$this->profile->user->username, \n\t\t\t$now->year, \n\t\t\t$now->month, \n\t\t\t$now->day\n\t\t);\n\t\t$d_name = '';\n\n\t\t//if a directory for the user doesn't exist, create one\n\t\tforeach ($d_segments as $segment) {\n\t\t\t$d_name .= $segment. '/';\n\n\t\t\tif (! \\File::isDirectory($d_name)) {\n\t\t\t\t\\File::makeDirectory($d_name, 0777, true);\n\t\t\t}\n\t\t}\n\n\t\t$this->user_dir = $d_name;\n\t}",
"public function getModelsDir(){\n return $this->getRootDir() . 'models/';\n }",
"public static function getHomeDirectory() {\n return isset($_SERVER['HOME']) ? $_SERVER['HOME'] : getenv('HOME');\n }",
"private static function home_dir()\n\t{\n\t\tif(function_exists(\"posix_getpwnam\"))\n\t\t{\n\t\t\t// using posix\n\t\t\t$user_info = posix_getpwnam(self::whoami());\n\t\t\t$home_dir = $user_info['dir'].\"/\";\n\t\t\t//print_r($user_info);\n\t\t} else\n\t\t{\n\t\t\t// Looking for Windows environment variables\n\t\t\t$home_dir = getenv('HOMEDRIVE').getenv('HOMEPATH').'\\\\';\n\t\t\tif($home_dir == \"\\\\\")\n\t\t\t{\n\t\t\t\t// Looking for *nix environment variables\n\t\t\t\t$home_dir = getenv('HOME').\"/\";\n\t\t\t}\n\t\t}\n\n\treturn $home_dir;\n\n\t}",
"private function setWorkingDir()\n {\n $this->workingDirBackup = getcwd();\n chdir(PATH_SITE);\n }",
"private function _setWorkingDir()\n {\n Utility\\SessionManage::set('workingDir', str_replace('/Lib', '', __DIR__));\n }",
"private function setBasePathToModel(ViewModel $model)\n {\n /* @var $config ModuleOptions */\n $config = $this->serviceLocator->get('EscoMail\\Options');\n\n if ($config->getBaseUri()) {\n $model->setVariable('basePath', $config->getBaseUri());\n }\n\n return $model;\n }",
"private function _createTempHomeDirectory()\n\t{\n\t\t$temp_file = tempnam(sys_get_temp_dir(), 'sb_');\n\t\tunlink($temp_file);\n\t\tmkdir($temp_file);\n\n\t\tputenv('HOME=' . $temp_file);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a JOIN clause to the query using the SocioAlquiler relation | public function joinSocioAlquiler($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('SocioAlquiler');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'SocioAlquiler');
}
return $this;
} | [
"protected abstract function getJoinStatement();",
"private function addJoinsToQuery()\n {\n if (!empty($this->joins)) {\n foreach ($this->joins as $join) {\n $this->query .= \" {$join->type} `{$this->dbName}`.`{$join->tableToJoin}`\";\n \n if (!empty($join->alias)) {\n $this->query .= \" AS {$join->alias}\";\n }\n \n $this->query .= \" ON `{$this->dbName}`.\";\n \n $this->query .= \"`\".(!empty($join->alias) ? $join->alias : $join->tableToJoin).\"`.\";\n \n $this->query .= \"`{$join->tableField}` =\";\n \n $this->query .= \" `{$this->dbName}`.`{$join->parentTable}`.`{$join->parentField}`\";\n if ($join->additionalCondition) {\n $this->query .= \" \".$join->additionalCondition;\n }\n }\n }\n }",
"private function join()\n {\n $a = $this->prefix($this->pk(), $this->table());\n $b = $this->prefix($this->pk(), $this->ee_table);\n\n ee()->db->join($this->ee_table, $a . ' = ' . $b, 'inner');\n }",
"private function sql_join() {\n $sql = '';\n foreach ($this->query['join'] as $value) {\n $sql .= $value['type'] . ' JOIN ' . $value['table'] . ' ON ' . $value['condition'] . ' ';\n }\n return $sql;\n }",
"function join($column,$filter,$foreign_column, $kind='inner', $filter_in_join=false)\n \t{\n \t\t$this->joins[]=new Join($column,$filter,$foreign_column,$kind, $filter_in_join);\n \t}",
"public function query() {\n parent::query();\n\n // Specify the type of relationships to join\n if (isset($this->options['participant_type']) && $this->options['participant_type']) {\n $this->query->table_queue[$this->alias]['join']->extra[] = array(\n 'value' => $this->options['participant_type'],\n 'numeric' => TRUE,\n 'field' => 'role_id',\n );\n }\n }",
"private function buildJoin()\n {\n if (empty($this->join)) {\n return;\n }\n\n foreach ($this->join as $data) {\n list ($joinType, $joinTable, $joinCondition) = $data;\n\n if (is_object($joinTable)) {\n $joinStr = $this->buildPair(\"\", $joinTable);\n } else {\n $joinStr = $joinTable;\n }\n\n $this->query .= \" \".$joinType.\" JOIN \".$joinStr.\n (false !== stripos($joinCondition, 'using') ? \" \" : \" ON \")\n .$joinCondition;\n }\n }",
"#[@arg]\n public function setJoin() {\n $this->criteria->setFetchmode(Fetchmode::join('Person'));\n }",
"protected function _buildJoin () {\r\n if (empty ($this->_join))\r\n return;\r\n\r\n foreach ($this->_join as $data) {\r\n list ($joinType, $joinTable, $joinCondition) = $data;\r\n\r\n if (is_object ($joinTable))\r\n $joinStr = $this->_buildPair (\"\", $joinTable);\r\n else\r\n $joinStr = $joinTable;\r\n\r\n $this->_query .= \" \" . $joinType. \" JOIN \" . $joinStr .\" on \" . $joinCondition;\r\n\r\n // Add join and query\r\n if (!empty($this->_joinAnd) && isset($this->_joinAnd[$joinStr])) {\r\n foreach($this->_joinAnd[$joinStr] as $join_and_cond) {\r\n list ($concat, $varName, $operator, $val) = $join_and_cond;\r\n $this->_query .= \" \" . $concat .\" \" . $varName;\r\n $this->conditionToSql($operator, $val);\r\n }\r\n }\r\n }\r\n }",
"private function joins()\r\n {\r\n /* SELECT* FROM DOCUMENT WHERE DOCUMENT.\"id\" IN ( SELECT ID FROM scholar WHERE user_company_id = 40 )*/\r\n\r\n $query = EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n ->sql();\r\n\r\n $table = EyufDocument::find()\r\n ->where('\"id\" IN ' . $query)\r\n ->all();\r\n\r\n $second = EyufDocument::findAll(EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n );\r\n\r\n vdd($second);\r\n }",
"function slt_se_join_sql( $join, $query ) {\n\n\tif ( slt_se_apply_hook( $query, 'join' ) ) {\n\t\tglobal $wpdb;\n\t\t$join .= \", $wpdb->postmeta \";\n\t}\n\n\treturn $join;\n}",
"private static function sqlJoining() : string {\n $relations = self::getsRelationsHasOne();\n\n $baseTable = static::tableName();\n $baseProperties = self::getProperties();\n foreach ($baseProperties as &$property) {\n $property = $baseTable . '.' . $property;\n }\n $colsFromBaseTabel = implode(', ', $baseProperties);\n $colsFromJoinedTables = '';\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $modelProperties = $modelNamespace::getProperties();\n foreach ($modelProperties as $key => &$value) {\n $value = $modelTableName . '.' . $value . ' AS ' . $modelTableName . '_' . $value;\n }\n $colsFromJoinedTables .= ', ' . implode(', ', $modelProperties);\n\n }\n $sql = 'SELECT ' . $colsFromBaseTabel . ' ' . $colsFromJoinedTables . ' FROM ' . $baseTable;\n\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $sql .= ' INNER JOIN ' . $modelTableName . ' ON ' . $baseTable . '.' . $relation['column'] . ' = ' . $modelTableName . '.' . $relation['joined-table-column'];\n }\n\n return $sql . ' WHERE ' . $baseTable . '.';\n }",
"function summary_join() {\n $field = $this->handler->table . '.' . $this->handler->field;\n $join = $this->get_join();\n\n // shortcuts\n $options = $this->handler->options;\n $view = &$this->handler->view;\n $query = &$this->handler->query;\n\n if (!empty($options['require_value'])) {\n $join->type = 'INNER';\n }\n\n if (empty($options['add_table']) || empty($view->many_to_one_tables[$field])) {\n return $query->ensure_table($this->handler->table, $this->handler->relationship, $join);\n }\n else {\n if (!empty($view->many_to_one_tables[$field])) {\n foreach ($view->many_to_one_tables[$field] as $value) {\n $join->extra = array(\n array(\n 'field' => $this->handler->real_field,\n 'operator' => '!=',\n 'value' => $value,\n 'numeric' => !empty($this->definition['numeric']),\n ),\n );\n }\n }\n return $this->add_table($join);\n }\n }",
"public function addJoin(JoinQueryComponent $component) { $this->joins[] = $component; }",
"public function joinFoo()\n {\n $this->db->join($this->M_foo->table, \"{$this->M_foo->table}.{$this->M_foo->primaryKey} = {$this->table}.foo_id\");\n }",
"abstract function appendJoin(AbstractQuery &$query, $sourceAlias, $targetAlias, $left_join = false);",
"private function getJoinClause() : string\n {\n $sql = '';\n foreach ($this->join as $j) {\n $sql .= sprintf(' %s %s %s', $j['type'], $j['table'], $j['alias']);\n if ($j['keyCol'] && $j['refCol']) {\n $sql .= sprintf(' ON %s=%s.%s', $j['keyCol'], $j['alias'], $j['refCol']);\n }\n }\n\n return $sql;\n }",
"public function compile(){\n if ($this->_type){\n $sql = strtoupper($this->_type).' JOIN';\n }else{\n $sql = 'JOIN';\n }\n\n // Quote the table name that is being joined\n $sql .= ' '. $this->quoter->quoteTable($this->_table) . ' ON ';\n\n $conditions = array();\n foreach ($this->_on as $condition){\n // Split the condition\n list($c1, $op, $c2) = $condition;\n\n if ($op){\n // Make the operator uppercase and spaced\n $op = ' '.strtoupper($op);\n }\n\n // Quote each of the identifiers used for the condition\n $conditions[] = $this->quoter->quoteIdentifier($c1) . $op . ' ' .$this->quoter->quoteIdentifier($c2);\n }\n\n // Concat the conditions \"... AND ...\"\n $sql .= '(' . implode(' AND ', $conditions) . ')';\n\n return $sql;\n }",
"public function innerJoin(string $table, string $on) : SqlQueryable;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets query for [[Lesson]]. | public function getLesson()
{
return $this->hasOne(Lesson::className(), ['id' => 'lesson_id']);
} | [
"public function getLesson() {\r\n return $this->lesson;\r\n }",
"public function getLesson()\n {\n return $this->hasOne(Lesson::className(), ['id' => 'lessonID']);\n }",
"public function getLesson()\n {\n return $this->hasOne(Lesson::className(), ['lesson_id' => 'lesson_id']);\n }",
"public\n function getQuestionsFromLesson()\n {\n //Get the lesson ID\n $lessonID = request()->lessonID;\n $lessonName = Lesson::find($lessonID)->lesson_name;\n $questions = Lesson::find($lessonID)->questions;\n\n $data = array(\n 'lessonName' => $lessonName,\n 'questions' => $questions,\n );\n\n return $data;\n }",
"public function findTodayLesson()\n {\n $em = $this->getEntityManager();\n\n return $em->createQuery(\n '\n SELECT l\n FROM ProjectAppBundle:Lesson l\n WHERE CURRENT_TIMESTAMP() BETWEEN l.startDate AND l.endDate\n '\n )\n ->getOneOrNullResult();\n }",
"function getLessonsByCourse($courseid)\n {\n global $DB;\n $results = $DB->get_records_sql('SELECT * FROM {lesson} WHERE course = ?', array($courseid));\n return $results;\n }",
"final protected function get_lesson() {\n return $this->lesson;\n }",
"public function get_lessons_query( $course_id , $term_id ){\n\n if( empty( $term_id ) || empty( $course_id ) ){\n\n return array();\n\n }\n\n $args = array(\n 'post_type' => 'lesson',\n 'post_status' => 'publish',\n 'posts_per_page' => -1,\n 'meta_query' => array(\n array(\n 'key' => '_lesson_course',\n 'value' => intval($course_id),\n 'compare' => '='\n )\n ),\n 'tax_query' => array(\n array(\n 'taxonomy' => 'module',\n 'field' => 'id',\n 'terms' => intval( $term_id )\n )\n ),\n 'orderby' => 'menu_order',\n 'order' => 'ASC',\n 'suppress_filters' => 0\n );\n\n if (version_compare( Sensei()->version, '1.6.0', '>=')) {\n $args['meta_key'] = '_order_module_' . intval( $term_id );\n $args['orderby'] = 'meta_value_num date';\n }\n\n $lessons_query = new WP_Query( $args );\n\n return $lessons_query;\n\n }",
"public function getLessons()\n {\n return $this->hasMany(Lesson::className(), ['courseID' => 'id']);\n }",
"public function lessons()\n {\n return $this->hasMany(Lesson::class);\n }",
"public function getLessons()\n {\n return $this->hasMany(Lesson::className(), ['teacher_id' => 'id']);\n }",
"public function findLessonBy(array $criteria);",
"public function findAll() {\n $sql = \"SELECT * FROM lesson ORDER BY less_id\";\n $result = $this->getDb()->fetchAll($sql);\n\n // Convert query result to an array of domain objects\n $lesson = array();\n foreach ($result as $row) {\n $lessonId = $row['less_id'];\n $lesson[$lessonId] = $this->buildDomainObject($row);\n }\n return $lesson;\n }",
"function getLessons()\n {\n $returned_lessons = $GLOBALS['DB']->query(\"SELECT * FROM lessons WHERE unit_id = {$this->getId()};\");\n $unit_lessons = array();\n foreach ($returned_lessons as $lesson) {\n $lesson_id = $lesson['id'];\n $found_lesson = Lesson::find($lesson_id);\n\n array_push($unit_lessons, $found_lesson);\n }\n return $unit_lessons;\n }",
"public function getQuery();",
"public function get_lesson(): ?Lesson {\n\t\t/**\n\t\t * Filters a topic lesson.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param Lesson|null $lesson Lesson model.\n\t\t * @param Topic $topic Topic model.\n\t\t *\n\t\t * @return Lesson|null Topic lesson model.\n\t\t *\n\t\t * @ignore\n\t\t */\n\t\treturn apply_filters(\n\t\t\t'learndash_model_topic_lesson',\n\t\t\t$this->get_lesson_from_trait(),\n\t\t\t$this\n\t\t);\n\t}",
"public function lessons()\n {\n return $this->hasMany('App\\Lesson');\n }",
"function learndash_course_get_lessons( $course_id = 0, $query_args = array() ) {\n\t$lessons = array();\n\n\t$course_id = absint( $course_id );\n\tif ( ! empty( $course_id ) ) {\n\t\t$ld_course_object = LDLMS_Factory_Post::course( intval( $course_id ) );\n\t\tif ( ( $ld_course_object ) && ( is_a( $ld_course_object, 'LDLMS_Model_Course' ) ) ) {\n\t\t\t$query_args_defaults = array(\n\t\t\t\t'return_type' => 'WP_Post',\n\t\t\t);\n\n\t\t\t$query_args = wp_parse_args( $query_args, $query_args_defaults );\n\n\t\t\t$lessons = $ld_course_object->get_lessons( $query_args );\n\t\t}\n\t}\n\n\treturn $lessons;\n}",
"function get_lesson_by_id($id)\n{\n\t$db = get_db_connection();\n\t$sql = \"SELECT * FROM tbl_lesson WHERE id = $id;\";\n\t$result = $db->query($sql);\n\t$row = $result->fetch();\n\treturn $row;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the Kendaraan model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown. | protected function findModel($id)
{
if (($model = Kendaraan::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
} | [
"protected function findModel($id)\n {\n if (($model = KendaraanRitasiAspal::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel(array $pk) {\n /** @var ActiveRecord $class */\n $class = $this->getModelClass();\n if (($model = $class::findOne($pk)) !== null) {\n return $model;\n }\n\n $error = \\Yii::t('yii', 'The requested page does not exist.');\n Yii::$app->session->addFlash('error', $error );\n\n return null;\n }",
"public function find(mixed $primaryKey): ?ModelInterface;",
"protected function findModel($id){\n\t\tif (($model = JobApplication::findOne($id)) !== NULL){\n\t\t\treturn $model;\n\t\t}\n\n\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t}",
"protected function findModel($id)\n\t{\n\t\tif (($model = Budget::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"protected function findModel($id_riwayat)\n {\n if (($model = Riwayat::findOne($id_riwayat)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n $modelClass = $this->getModel();\n if (($model = $modelClass->findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, Yii::t('app', 'The requested page does not exist.'));\n }\n }",
"public static function find( $primaryKey )\n\t{\n\t\tself::init();\n\t\t\n\t\t// Select one item by primary key in Database\n\t\t$result = Database::selectOne(\"SELECT * FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $primaryKey);\t\t\n\t\tif( $result == null )\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Create & return new object of Model\n\t\treturn self::newItem($result);\n\t}",
"protected function findModel($id) {\n if (($model = Config::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }",
"protected function findModel($idPesquisador)\n {\n if (($model = Pesquisador::findOne($idPesquisador)) !== null)\n {\n return $model;\n } else\n {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = WiRequest::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"protected function findModel($id)\n {\n if (($model = Timetable::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }",
"protected function findModel($id)\n {\n if (($model = ApiKeys::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($idColeta)\n {\n if (($model = Coleta::findOne($idColeta)) !== null)\n {\n return $model;\n } else\n {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = CalendarExtensionCalendarEntry::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }",
"protected function findModel($tahun, $Kd_Urusan, $Kd_Bidang, $Kd_Unit, $Kd_Program, $Kd_Kegiatan)\n {\n if (($model = KegiatanSkpd::findOne(['tahun' => $tahun, 'Kd_Urusan' => $Kd_Urusan, 'Kd_Bidang' => $Kd_Bidang, 'Kd_Unit' => $Kd_Unit, 'Kd_Program' => $Kd_Program, 'Kd_Kegiatan' => $Kd_Kegiatan])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n \n // var_dump(StaEventos::findOne($id)); die();\n if (($model = StaEventos::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('sta.labels', 'The requested page does not exist.'));\n }",
"public function findOrFail($key): Model;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a head content component | public function set(HeadContent $component) {
if ($component instanceof Title) {
$this->setDocumentTitle($component);
} else if ($component instanceof Base) {
$this->setBaseAddress($component);
} else if ($component instanceof LinkInterface) {
$this->setLink($component);
} else if ($component instanceof MetaData) {
$this->setMeta($component);
} else if ($component instanceof Script) {
$this->setScript($component);
} else {
$this->content()->append($component);
}
return $this;
} | [
"private function setHeadTag()\r\n {\r\n $front = FrontController::getInstance();\r\n $parametros = $front->getPlugin('PluginParametros');\r\n $nombreSitio = $parametros->obtener('NOMBRE_SITIO');\r\n $tituloVista = $nombreSitio.' | '.$parametros->obtener('METATAG_TITLE');\r\n $descriptionVista = $parametros->obtener('METATAG_DESCRIPTION');\r\n $keywordsVista = $parametros->obtener('METATAG_KEYWORDS');\r\n\r\n $this->getTemplate()->set_var(\"pathUrlBase\", $this->getRequest()->getBaseTagUrl());\r\n $this->getTemplate()->set_var(\"sTituloVista\", $tituloVista);\r\n $this->getTemplate()->set_var(\"sMetaDescription\", $descriptionVista);\r\n $this->getTemplate()->set_var(\"sMetaKeywords\", $keywordsVista);\r\n\r\n //js de home\r\n $this->getTemplate()->load_file_section(\"gui/vistas/comunidad/invitaciones.gui.html\", \"jsContent\", \"JsContent\");\r\n\r\n return $this;\r\n }",
"private function setHeadTag()\r\n {\r\n $front = FrontController::getInstance();\r\n $parametros = $front->getPlugin('PluginParametros');\r\n $nombreSitio = $parametros->obtener('NOMBRE_SITIO');\r\n $tituloVista = $nombreSitio.' | '.$parametros->obtener('METATAG_TITLE');\r\n $descriptionVista = $parametros->obtener('METATAG_DESCRIPTION');\r\n $keywordsVista = $parametros->obtener('METATAG_KEYWORDS');\r\n\r\n $this->getTemplate()->set_var(\"pathUrlBase\", $this->getRequest()->getBaseTagUrl());\r\n $this->getTemplate()->set_var(\"sTituloVista\", $tituloVista);\r\n $this->getTemplate()->set_var(\"sMetaDescription\", $descriptionVista);\r\n $this->getTemplate()->set_var(\"sMetaKeywords\", $keywordsVista);\r\n\r\n //js de home\r\n $this->getTemplate()->load_file_section(\"gui/vistas/comunidad/instituciones.gui.html\", \"jsContent\", \"JsContent\");\r\n\r\n return $this;\r\n }",
"public function setHead($head)\n {\n return $this->setParam(self::LAYOUT_HEAD, $head);\n }",
"private function setHeadTag()\r\n {\r\n $front = FrontController::getInstance();\r\n $parametros = $front->getPlugin('PluginParametros');\r\n $nombreSitio = $parametros->obtener('NOMBRE_SITIO');\r\n $tituloVista = $nombreSitio.' | '.$parametros->obtener('METATAG_TITLE');\r\n $descriptionVista = $parametros->obtener('METATAG_DESCRIPTION');\r\n $keywordsVista = $parametros->obtener('METATAG_KEYWORDS');\r\n\r\n $this->getTemplate()->set_var(\"pathUrlBase\", $this->getRequest()->getBaseTagUrl());\r\n $this->getTemplate()->set_var(\"sTituloVista\", $tituloVista);\r\n $this->getTemplate()->set_var(\"sMetaDescription\", $descriptionVista);\r\n $this->getTemplate()->set_var(\"sMetaKeywords\", $keywordsVista);\r\n\r\n //js de home\r\n $this->getTemplate()->load_file_section(\"gui/vistas/index/instituciones.gui.html\", \"jsContent\", \"JsContent\");\r\n\r\n return $this;\r\n }",
"public function set_head($head)\n\t{\n\t\t\t$this->head = $head;\n\t}",
"public function setHead(Head $head)\n {\n $this->head = $head;\n }",
"function add_head($head){\n\t\t\n\t\t$this->data['head'] .= $head;\n\t\t\n\t}",
"public function setHead(HeadTagInterface $tag);",
"public function buildHead()\n {\n $this->role->setHead('common head');\n }",
"protected function renderHeadContent(): void\n {\n ?>\n <style>\n <?php\n require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'admin.css';\n ?>\n </style>\n <?php\n // Render the custom HEAD content.\n }",
"function Set_aboveHeadBanner($content) {\r\n\t\t$this->aboveHeadBanner .= $content;\r\n\t}",
"private function WriteHead(){\n //ob_start();\n \n $headdata = $this->headData;\n include $this->myDir.\"/script/head.php\";\n \n }",
"public function fxm_head_top_content()\n {\n // get_template_part('partials/head/head', 'top');\n }",
"public function setContentHeader($header) {\r\n\t\t$this->header = $header;\r\n\t}",
"public function setEmailHeadHtml($value) { $this->_emailHeadHtml = $value; }",
"private function _renderXhtmlHead() {\r\n\t\t\r\n?>\r\n\t<head>\r\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n\t\t<title><?php echo \"$this->_title\"; ?></title>\r\n\t\t<link rel=\"shortcut icon\" href=\"favicon.png\" type=\"image/png\" />\r\n<?php\r\n\r\n\t\t$this->_stylesheets->render();\r\n\t\t$this->_scripts->render();\r\n\t\t$this->_keywords->render();\r\n\r\n\t\tif (isset($this->_description)) {\r\n?>\r\n\t\t<meta name=\"description\" content=\"<?php echo \"$this->_description\"; ?>\" />\r\n<?php\r\n\r\n\t\t}\r\n\r\n?>\r\n\t</head>\r\n<?php\r\n\t\t\r\n\t}",
"function drupstrap_html_head_alter(&$head) {\n if (isset($head['system_meta_content_type']['#attributes']['content'])) {\n $head['system_meta_content_type']['#attributes'] = array(\n 'charset' => str_replace('text/html; charset=', '',\n $head['system_meta_content_type']['#attributes']['content'])\n );\n }\n}",
"private function appendMetaTags( AbstractXhtml &$head ) {\n foreach ( $this->metaTags as $meta ) {\n $head->addContent( $meta );\n }\n }",
"function addCustomHeadTag( $html )\n\t{\n\t\t$document=& JFactory::getDocument();\n\t\tif($document->getType() == 'html') {\n\t\t\t$document->addCustomTag($html);\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replace the bound instance with a fake. | public static function fake()
{
static::swap(new WHMApiFake);
} | [
"public static function fake()\n {\n $bound = static::getFacadeRoot();\n\n if ($bound instanceof FakeRelay) {\n return $bound;\n }\n\n static::swap($fake = new FakeRelay($bound));\n\n return $fake;\n }",
"public static function fake()\n {\n static::swap(new NotificationFake);\n }",
"public static function fake()\n {\n static::swap(new KeenIOFake);\n }",
"public function createFake();",
"public static function fake()\n {\n }",
"private function replaceWithFakeRandomUserImporter(): void\n {\n $importer = $this->app->make(RandomUserImporterInterface::class);\n $importer = $this->getMockBuilder(get_class($importer))\n ->disableOriginalConstructor()\n ->onlyMethods(['makeFetcher'])\n ->getMock();\n\n /**\n * Fetcher will work with text string read from our prepared file\n */\n $fetcherMock = $this->createPartialMock(HttpClientRandomUserFetcher::class, ['getApiTextResponse']);\n $fetcherMock->method('getApiTextResponse')->willReturn(self::$randomUserDataString);\n\n $importer->method('makeFetcher')->willReturn($fetcherMock);\n\n $importer->__construct($this->em);\n\n $this->app->bind(RandomUserImporterInterface::class, fn() => $importer);\n }",
"public function testInstancesAreDifferentWhenUsingFactory()\n {\n $this->container->bindFactory($this->baseClass, function () {\n return new $this->concreteFoo;\n });\n $instance1 = $this->container->resolve($this->baseClass);\n $instance2 = $this->container->resolve($this->baseClass);\n $this->assertNotSame($instance1, $instance2);\n }",
"public function override()\n {\n $binder = new stubBinder();\n $binder->bind('stubInjectorImplementedByTestCase_Person')->to('stubInjectorImplementedByTestCase_Mikey');\n $injector = $binder->getInjector();\n $person = $injector->getInstance('stubInjectorImplementedByTestCase_Person');\n $this->assertInstanceOf('stubInjectorImplementedByTestCase_Mikey', $person);\n }",
"public function testUniversallyBindingInstanceToInterface()\n {\n $instance = new $this->concreteFoo();\n $this->container->bind($this->fooInterface, $instance);\n $this->assertSame($instance, $this->container->makeShared($this->fooInterface));\n $this->assertSame($instance, $this->container->makeShared($this->concreteFoo));\n }",
"public static function fake(): CaptchavelFake\n {\n $instance = static::getFacadeRoot();\n\n if ($instance instanceof CaptchavelFake) {\n return $instance;\n }\n\n static::swap($instance = static::getFacadeApplication()->make(CaptchavelFake::class));\n\n return $instance;\n }",
"public function testAppBindingRemainsOriginal()\n {\n $app = new Container;\n\n $app->bind('Fiz', Fiz::class);\n\n $this->assertTrue(($app->getContainer() === $app['Fiz']->app));\n }",
"private function setFakeRepository()\n {\n if(!is_object($this->repository)) {\n $repository = new PublicRepository();\n $repository->entity_type = 'FakeEntity';\n $repository->entity_id = 777;\n $repository->path = ModelRepositories::buildPath(\n $repository->entity_type, $repository->entity_id, $repository->visibility\n );\n $this->repository = $repository;\n }\n }",
"public function testMakingNewForTarget()\n {\n $this->container->bind($this->fooInterface, $this->concreteFoo, $this->constructorWithIFoo);\n $instance1 = $this->container->makeNew($this->fooInterface, $this->constructorWithIFoo);\n $instance2 = $this->container->makeNew($this->fooInterface, $this->constructorWithIFoo);\n $this->assertInstanceOf($this->concreteFoo, $instance1);\n $this->assertInstanceOf($this->concreteFoo, $instance2);\n $this->assertNotSame($instance1, $instance2);\n }",
"public static function reset()\n {\n static::$fake = false;\n\n Fakes\\BuilderFake::setCommands([]);\n Fakes\\BuilderFake::setCaptured([]);\n }",
"public function reset()\n {\n DI::set(__CLASS__, function () {\n return 'FooBar';\n });\n DI::get(__CLASS__);\n\n DI::reset();\n\n self::assertSame(__CLASS__, DI::get(__CLASS__));\n }",
"protected function prepareViewMock()\n {\n /** @var Mockery\\Mock $viewMock */\n $viewMock = Mockery::mock(Factory::class);\n $viewMock->shouldReceive('make')->andReturn('testing');\n $viewMock->shouldReceive('share')->andReturnSelf();\n\n $this->app->instance(Factory::class, $viewMock);\n }",
"public function testSwapProxyService()\n {\n $alias = 'Foo';\n $proxy = 'Statical\\\\Tests\\\\Fixtures\\\\FooProxy';\n $id = 'foo';\n $container = Utils::container();\n\n // Set foo instance in the container and register it\n $container->set($id, $this->fooInstance);\n $this->manager->addProxyService($alias, $proxy, $container, $id);\n\n $expected = get_class($this->fooInstance);\n $this->assertEquals($expected, \\Foo::getClass());\n\n // Set bar closure in the container\n $container->set($id, Utils::barClosure());\n\n $expected = get_class($this->barInstance);\n $this->assertEquals($expected, \\Foo::getClass());\n }",
"public function testShouldCreateStubInheritingClassTypeFromOriginal()\n {\n $mock = mockery('MockeryTest_SimpleClass', array('get' => 'foo'));\n $this->assertEquals('foo', $mock->get());\n }",
"public function testUnbindingTargetedBinding()\n {\n $this->container->for($this->constructorWithIFoo, function (IContainer $container) {\n $container->bindPrototype($this->fooInterface, $this->concreteFoo);\n });\n $this->container->for($this->constructorWithIFoo, function (IContainer $container) {\n $container->unbind($this->fooInterface);\n });\n $this->assertFalse($this->container->for($this->constructorWithIFoo, function (IContainer $container) {\n return $container->hasBinding($this->fooInterface);\n }));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get ID of article. | function getArticleId() {
return $this->getData('articleId');
} | [
"public function getIdArticle()\n {\n return $this->idArticle;\n }",
"public function getArticleId() {\n\t\tif($this->isArticleLoaded()) {\n\t\t\treturn $this->article['id'];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getArticleId(){\n\t\treturn($this->articleId);\n\t}",
"public function getArticleId(){\n\t\treturn ($this->articleId);\n\t}",
"public function getArticleid()\n {\n return $this->articleid;\n }",
"public function getId_article()\n {\n return $this->id_article;\n }",
"public function getID_ARTICLE()\n {\n return $this->ID_ARTICLE;\n }",
"function getPublishedArticleId() {\n\t\treturn $this->getData('publishedArticleId');\n\t}",
"public function get_article_id() { return $this->root_post_id; }",
"function getInsertArticleId() {\n\t\treturn $this->getInsertId('articles', 'article_id');\n\t}",
"public function getCommentArticleId() : Uuid {\n\t\treturn ($this->commentArticleId);\n\t}",
"public static function getNotfoundArticleId()\n {\n return rex_addon::get('structure')->getProperty('notfound_article_id', 1);\n }",
"private function getNewsId()\n {\n $news = explode('_', $this->item->find(' .views ')->attr('id'));\n $this->id = $news[5];\n \n return $this->id;\n }",
"public function getFk_id_article()\n {\n return $this->fk_id_article;\n }",
"function getArticleIdByTitle($atitle) {\n\t\t$retval = NULL;\n\t\t// select id\n\t\t$sql = \"SELECT id FROM \" . TBL_ARTICLES . \" WHERE title = '$atitle'\";\n\t\tif ($result = mysqli_query($this->connection, $sql)) {\n\t\t\t$row = mysqli_fetch_row($result);\n\t\t\t$retval = $row['0'];\n\t\t\tmysqli_free_result($result);\n\t\t}\n\t\treturn $retval;\n\t}",
"public function getClapArticleId() : Uuid {\n return $this->clapArticleId;\n }",
"public function getClapArticleId() : Uuid{\n\t\treturn($this->clapArticleId);\n\t}",
"public function getLastArticleId()\n {\n return $this->last_article_id;\n }",
"function getArticleId($title, $lngId, $create = FALSE) {\n if ($this->articleId == 0 || $create === TRUE) {\n $sql = \"SELECT article_node_id, article_title, article_lng\n FROM %s\n WHERE article_title = '%s'\n AND article_lng = '%s'\";\n $sqlParams = array($this->tableArticle, $title, $lngId);\n $articleId = 0;\n if ($res = $this->databaseQueryFmt($sql, $sqlParams)) {\n if ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $articleId = $row['article_node_id'];\n }\n }\n // Optionally create the article node\n if ($articleId == 0 && $create === TRUE) {\n $articleId = $this->createArticle($title, $lngId);\n }\n $this->articleId = $articleId;\n }\n // By default, simply return the article id or 0\n return $this->articleId;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update Employee Test Case | public function testUpdateEmployee()
{
//422
$response = $this->post("employees/update/1", []);
$response->assertResponseStatus(422);
$response->seeJsonStructure([
"last_name",
"first_name",
"middle_name",
"nick_name",
"department",
"position",
"birth_date",
"hired_date",
"email_address",
"status"
]);
//Create employee factory
$employee = factory(\App\Models\Employee::class)->create();
//200
$response = $this->post("employees/update/{$employee->uuid}", [
"last_name" => $employee->last_name,
"first_name" => $employee->first_name,
"middle_name" => $employee->middle_name,
"nick_name" => $employee->nick_name,
"department" => $employee->department,
"position" => $employee->position,
"birth_date" => $employee->birth_date,
"hired_date" => $employee->hired_date,
"email_address" => $employee->email_address,
"status" => $employee->status
]);
$response->assertResponseStatus(200);
$response->seeJsonStructure([
'message'
]);
} | [
"public function updateEmployee(Employee $employee);",
"public function testUpdateEmployeeById()\n {\n\n $employeeData = array(\n 'id' => $this->getEmployeeId(),\n 'first_name' => \"Bob\",\n 'last_name' => \"Smith\",\n 'email' => \"bob.smith@domain.com\"\n );\n\n $geoPal = $this->getMockedGeoPalObj(\n array(\n 'status' => true,\n 'employee_data' => array_merge($employeeData, array())\n )\n );\n\n $response = $geoPal->updateEmployeeById(\n $this->getEmployeeId(),\n \"\",\n \"\",\n $employeeData['first_name'],\n $employeeData['last_name'],\n $employeeData['email']\n );\n\n $this->assertEquals(true, is_array($response));\n\n $this->assertArrayHasKey('id', $response);\n $this->assertArrayHasKey('first_name', $response);\n $this->assertArrayHasKey('last_name', $response);\n $this->assertArrayHasKey('email', $response);\n\n $this->assertEquals($this->getEmployeeId(), $response['id']);\n $this->assertEquals($employeeData['first_name'], $response['first_name']);\n $this->assertEquals($employeeData['last_name'], $response['last_name']);\n $this->assertEquals($employeeData['email'], $response['email']);\n }",
"public function testUpdateEmployeePeer()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function updated(Employee $employee)\n {\n //\n }",
"public function updateEmployees($employee){\n $result = $this->db->pdo->prepare('UPDATE employees SET \n lastName = :lastName, \n firstName = :firstName,\n extension = :extension,\n email = :email,\n officeCode = :officeCode,\n reportsTo = :reportsTo,\n jobTitle = :jobTitle\n WHERE employeeNumber = :employeeNumber');\n \n $result->bindParam(':employeeNumber', $employee['employeeNumber'], \\PDO::PARAM_INT);\n $result->bindParam(':lastName', $employee['lastName'], \\PDO::PARAM_STR);\n $result->bindParam(':firstName', $employee['firstName'], \\PDO::PARAM_STR);\n $result->bindParam(':extension', $employee['extension'], \\PDO::PARAM_STR);\n $result->bindParam(':email', $employee['email'], \\PDO::PARAM_STR);\n $result->bindParam(':officeCode', $employee['officeCode'], \\PDO::PARAM_STR);\n $result->bindParam(':reportsTo', $employee['reportsTo'], \\PDO::PARAM_INT);\n $result->bindParam(':jobTitle', $employee['jobTitle'], \\PDO::PARAM_STR);\n $result->execute();\n \n if(!is_null($this->db->error()[1])){\n return array(\n 'success' => false,\n 'description' => $this->db->error()[2]\n );\n }\n return array(\n 'success' => true,\n 'description' => 'The employee was updated'\n );\n }",
"public function testLoggedinAsEmployeeUpdateEmployee()\n {\n // Simulate if user logged in as Employee\n $_SESSION['user_privilege'] = 1;\n $update_account_info = new Account(\"Update New Employee\", \"updEmployee\", \"updateEmployee@gmail.com\", 1);\n $this->assertEquals(false, test_update_employee(1, $update_account_info));\n }",
"public function updateEmployee(Employee $employee){\r\n\t\t$this->employeeModel->setData($employee);\r\n\t\treturn $this->employeeModel->updateEmployee();\r\n\t}",
"public function only_authenticated_users_can_update_employee_details()\n {\n $this->withoutExceptionHandling();\n\n $this->actingAs(factory(User::class)->create([\n 'status' => $this->faker->randomNumber($nbDigits = NULL, $strict = false)\n ]));\n\n $employees = factory('App\\User')->create([\n 'id' => $this->faker->randomNumber($nbDigits = NULL, $strict = false),\n 'status' => $this->faker->randomNumber($nbDigits = NULL, $strict = false)\n ]);\n\n $this->patch($employees->updatePath(), [\n 'name' => \"New name\"\n ]);\n\n $this->assertDatabaseHas('users', ['name' => \"New name\"]);\n }",
"public function testUpdateEmployeeRole()\n {\n\n }",
"function updateEmployee(){\n\t\t\n\t\t\t$query = \"UPDATE employee SET firstName=?, lastName=?, userName=?, emailAdd=?, contactNo=?, address=? where employeeId=?\";\n\t\t\t$stmt = $this->conn->prepare($query);\n\t\t\t$stmt->bindparam(1,$this->firstName);\n\t\t\t$stmt->bindparam(2,$this->lastName);\n\t\t\t$stmt->bindparam(3,$this->userName);\n\t\t\t$stmt->bindparam(4,$this->emailAdd);\n\t\t\t$stmt->bindparam(5,$this->contactNo);\n\t\t\t$stmt->bindparam(6,$this->address);\n\t\t\t$stmt->bindparam(7,$this->employeeId);\n\t\t\n\t\t\tif($stmt->execute()){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"function addEditEmployee($inEmployeeId, $inFirstName, $inLastName, $inHourlyWage, $inExemptStatus,$inEmployeeType,$tax) {\n\n $this->dbConnect();\n\n if ($inEmployeeId == 0) {\n\n $inputSql = \"Insert Into Employees (employee_first_name, employee_last_name, hourly_wage, exempt_flag,employee_type,standard_tax_deductions) \n\t VALUES (?, ?, ?, ?,?,?);\";\n\n $sth = $this->inDBH->prepare($inputSql);\n $sth->execute(Array($inFirstName, $inLastName, $inHourlyWage, $inExemptStatus,$inEmployeeType,$tax));\n }\n\n else {\n $inputSql = \"Update Employees set employee_first_name = ?, employee_last_name = ?, hourly_wage = ?, \n\t exempt_flag = ? ,employee_type=?,standard_tax_deductions=?\n\t Where employee_id = ?\";\n\n $sth = $this->inDBH->prepare($inputSql);\n $sth->execute(Array($inFirstName, $inLastName, $inHourlyWage, $inExemptStatus,$inEmployeeType,$tax ,$inEmployeeId));\n\n }\n\n }",
"function addEditEmployee($inEmployeeId, $inFirstName, $inLastName, $inHourlyWage, $inExemptStatus) {\n\n $this->dbConnect();\n\n if ($inEmployeeId == 0) {\n\n $inputSql = \"Insert Into Employees (employee_first_name, employee_last_name, hourly_wage, exempt_flag) \n\t VALUES (?, ?, ?, ?);\";\n\n $sth = $this->inDBH->prepare($inputSql);\n $sth->execute(Array($inFirstName, $inLastName, $inHourlyWage, $inExemptStatus));\n }\n\n else {\n $inputSql = \"Update Employees set employee_first_name = ?, employee_last_name = ?, hourly_wage = ?, \n\t exempt_flag = ? \n\t Where employee_id = ?\";\n\n $sth = $this->inDBH->prepare($inputSql);\n $sth->execute(Array($inFirstName, $inLastName, $inHourlyWage, $inExemptStatus, $inEmployeeId));\n\n }\n\n }",
"public function updateEmployee() {\n\n $employeeModel = $GLOBALS[\"employeeModel\"];\n\n $emp = $employeeModel->getOneByEmployeeID($_SESSION[\"workerID\"]);\n\n $givenOldLogin_Password = filter_input(INPUT_POST, \"givenOldLogin_Password\");\n $givenNewLogin_Password = filter_input(INPUT_POST, \"givenNewLogin_Password\");\n if (($givenOldLogin_Password != NULL) && ($givenNewLogin_Password != NULL)) {\n $oldLogin_Password_encrypted = sha1($givenOldLogin_Password);\n\n if ($oldLogin_Password_encrypted == $emp[\"Login_Password\"]) {\n $givenNewLogin_Password = sha1($givenNewLogin_Password);\n }\n } \n else {\n $givenNewLogin_Password = $emp[\"Login_Password\"];\n //kanskje en error beskjed ?\n }\n\n // set the value in the update...\n $updateFirst_name = filter_input(INPUT_POST, 'First_name');\n $updateLast_name = filter_input(INPUT_POST, 'Last_name');\n $updateBirth = filter_input(INPUT_POST, 'Birth');\n $updatePhone_Number = filter_input(INPUT_POST, 'Phone_Number');\n $updateHome_Address = filter_input(INPUT_POST, 'Home_Address');\n $updateZip_Code = filter_input(INPUT_POST, 'Zip_Code');\n $EmployeeID = filter_input(INPUT_POST, 'EmployeeID');\n\n $employeeModel->updateEmployee($updateFirst_name, $updateLast_name, $updateBirth, $updatePhone_Number, $updateHome_Address, $updateZip_Code, $EmployeeID,$givenNewLogin_Password);\n $GLOBALS[\"included_employees\"] = $employeeModel->getAll();\n\n return $this->render(\"listEmployees\");\n }",
"public function testLoggedinAsManagerUpdateEmployee()\n {\n // Simulate if user logged in as Manager\n $_SESSION['user_privilege'] = 2;\n $update_account_info = new Account(\"Update New Employee\", \"updEmployee\", \"updateEmployee@gmail.com\", 1);\n $this->assertEquals(true, test_update_employee(1, $update_account_info));\n }",
"public function updateEmployesAction()\n {\n\n $dataRequest = $this->request->getJsonPost();\n\n $dateTime = new \\DateTime();\n\n $fields = array(\n \"id\"\n );\n\n $optional = array(\n \"name\",\n \"document\",\n \"phone\",\n \"email\",\n \"address\",\n \"type_employee\",\n \"image\"\n );\n\n if ($this->_checkFields($dataRequest, $fields, $optional)) {\n\n try {\n\n $employes = Employes::findFirst(array(\n \"conditions\" => \"id = ?1\",\n \"bind\" => array(1 => $dataRequest->id)\n ));\n\n if (isset($dataRequest->name))\n $employes->name = $dataRequest->name;\n\n if (isset($dataRequest->document))\n $employes->document = $dataRequest->document;\n\n if (isset($dataRequest->phone))\n $employes->phone = $dataRequest->phone;\n\n if (isset($dataRequest->email))\n $employes->email = $dataRequest->email;\n\n if (isset($dataRequest->address))\n $employes->address = $dataRequest->address;\n\n if (isset($dataRequest->type_employee))\n $employes->type_employee = $dataRequest->type_employee;\n\n if (isset($dataRequest->image))\n $employes->image = $dataRequest->image;\n\n\n $employes->updated_at = $dateTime->format('Y-m-d H:i:s');\n\n if ($employes->save()){\n $this->setJsonResponse(ControllerBase::SUCCESS, ControllerBase::SUCCESS_MESSAGE, array(\n \"return\" => true,\n \"message\" => \"update\",\n \"status\" => ControllerBase::SUCCESS\n ));\n\n } else {\n\n $this->setJsonResponse(ControllerBase::FAILED, ControllerBase::SUCCESS_MESSAGE, array(\n \"return\" => false,\n \"message\" => EmployesConstants::EMPLOYES_UPDATE_FAILURE,\n \"status\" => ControllerBase::FAILED\n ));\n }\n \n } catch (Exception $e) {\n $this->logError($e, $dataRequest);\n }\n \n }\n }",
"public function setEmployee($value)\n {\n $this->employee = $value;\n }",
"public function updateEmployee(){\n// require once db connection\n\n\t$id=$this->employeeid;\n\t$sql=\"UPDATE Employee SET firts_name=?,last_name=?,employmentDate=?,gender=?,contact_no=?,role=? WHERE empID='$id'\";\n\n\t$stmt = $dbconn->prepare($sql);\n\n\t$fname=$this->firstname;\n\t$laname=$this->lastname;\n\t$edate=$this->employmentdate;\n\t$gen=$this->gender;\n\t$contact=$this->contactnumber;\n\t$rl=$this->role;\n\n\t$stmt->bind_param('i','s','s','s','s','i','s', $id,$fname,$lname,$edate,$gender,$contact,$rl);\n\t$stmt->execute(); \n $stmt->close();\n}",
"public function setEmployee($employee): void\n {\n $this->employee = $employee;\n }",
"public function updateEmployeeWithLowerSalaryRange()\n {\n $response = $this->get($this->endpoint);\n $employee = $response->json()[0];\n $data = [\n 'first_name' => 'Tega',\n 'last_name' => 'Adigu',\n 'salary' => 40000,\n 'hire_date' => (new Carbon())->format('Y-m-d H:i:s'),\n 'position_id' => $employee['position_id'],\n 'is_active' => true,\n ];\n $response = $this->putJson($this->endpoint.$employee['id'], $data);\n\n $this->assertEquals('salary doesnt fall under position range.', $response->json());\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is general replacement for die(), allows templated output in users (or default) language, etc. $msg_code can be one of these constants: GENERAL_MESSAGE : Use for any simple text message, eg. results of an operation, authorisation failures, etc. GENERAL ERROR : Use for any error which occurs _AFTER_ the common.php include and session code, ie. most errors in pages/functions CRITICAL_MESSAGE : Used when basic config data is available but a session may not exist, eg. banned users CRITICAL_ERROR : Used when config data cannot be obtained, eg no database connection. Should _not_ be used in 99.5% of cases | function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '')
{
global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path, $nav_links, $gen_simple_header, $images;
global $userdata, $user_ip, $session_length;
global $starttime;
if(defined('HAS_DIED'))
{
die("message_die() was called multiple times. This isn't supposed to happen. Was message_die() used in page_tail.php?");
}
define('HAS_DIED', 1);
$sql_store = $sql;
//
// Get SQL error if we are debugging. Do this as soon as possible to prevent
// subsequent queries from overwriting the status of sql_error()
//
if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) )
{
$sql_error = $db->sql_error();
$debug_text = '';
if ( $sql_error['message'] != '' )
{
$debug_text .= '<br /><br />SQL Error : ' . $sql_error['code'] . ' ' . $sql_error['message'];
}
if ( $sql_store != '' )
{
$debug_text .= "<br /><br />$sql_store";
}
if ( $err_line != '' && $err_file != '' )
{
$debug_text .= '<br /><br />Line : ' . $err_line . '<br />File : ' . basename($err_file);
}
}
if( empty($userdata) && ( $msg_code == GENERAL_MESSAGE || $msg_code == GENERAL_ERROR ) )
{
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
}
//
// If the header hasn't been output then do it
//
if ( !defined('HEADER_INC') && $msg_code != CRITICAL_ERROR )
{
if ( empty($lang) )
{
if ( !empty($board_config['default_lang']) )
{
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.'.$phpEx);
}
else
{
include($phpbb_root_path . 'language/lang_english/lang_main.'.$phpEx);
}
}
if ( empty($template) || empty($theme) )
{
$theme = setup_style($board_config['default_style']);
}
//
// Load the Page Header
//
if ( !defined('IN_ADMIN') )
{
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
}
else
{
include($phpbb_root_path . 'admin/page_header_admin.'.$phpEx);
}
}
switch($msg_code)
{
case GENERAL_MESSAGE:
if ( $msg_title == '' )
{
$msg_title = $lang['Information'];
}
break;
case CRITICAL_MESSAGE:
if ( $msg_title == '' )
{
$msg_title = $lang['Critical_Information'];
}
break;
case GENERAL_ERROR:
if ( $msg_text == '' )
{
$msg_text = $lang['An_error_occured'];
}
if ( $msg_title == '' )
{
$msg_title = $lang['General_Error'];
}
break;
case CRITICAL_ERROR:
//
// Critical errors mean we cannot rely on _ANY_ DB information being
// available so we're going to dump out a simple echo'd statement
//
include($phpbb_root_path . 'language/lang_english/lang_main.'.$phpEx);
if ( $msg_text == '' )
{
$msg_text = $lang['A_critical_error'];
}
if ( $msg_title == '' )
{
$msg_title = 'phpBB : <b>' . $lang['Critical_Error'] . '</b>';
}
break;
}
//
// Add on DEBUG info if we've enabled debug mode and this is an error. This
// prevents debug info being output for general messages should DEBUG be
// set TRUE by accident (preventing confusion for the end user!)
//
if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) )
{
if ( $debug_text != '' )
{
$msg_text = $msg_text . '<br /><br /><b><u>DEBUG MODE</u></b>' . $debug_text;
}
}
if ( $msg_code != CRITICAL_ERROR )
{
if ( !empty($lang[$msg_text]) )
{
$msg_text = $lang[$msg_text];
}
if ( !defined('IN_ADMIN') )
{
$template->set_filenames(array(
'message_body' => 'message_body.tpl')
);
}
else
{
$template->set_filenames(array(
'message_body' => 'admin/admin_message_body.tpl')
);
}
$template->assign_vars(array(
'MESSAGE_TITLE' => $msg_title,
'MESSAGE_TEXT' => $msg_text)
);
$template->pparse('message_body');
if ( !defined('IN_ADMIN') )
{
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
else
{
include($phpbb_root_path . 'admin/page_footer_admin.'.$phpEx);
}
}
else
{
echo "<html>\n<body>\n" . $msg_title . "\n<br /><br />\n" . $msg_text . "</body>\n</html>";
}
exit;
} | [
"function message_die($msg_text = '', $msg_title = '') {\n\t\techo \"<html>\\n<body>\\n\" . $msg_title . \"\\n<br /><br />\\n\" . $msg_text . \"</body>\\n</html>\";\n\t\tinclude('includes/footer.php');\n\t\texit;\n\t}",
"function die_header($code, $msg) {\r\n\t\tswitch ($code) {\r\n\t\t\tcase 500:\r\n\t\t\t\theader(\"HTTP/1.1 500 Internal Server Error\");\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase 405:\r\n\t\t\t\theader(\"HTTP/1.1 405 Method Not Allowed\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 404:\r\n\t\t\t\theader(\"HTTP/1.1 404 Not Found\");\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase 400:\r\n\t\t\t\theader(\"HTTP/1.1 400 Bad Request\");\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\theader(\"Content-Type: text/plain\");\r\n\t\techo $msg;\r\n\t\t\r\n\t\t// clean up and exit\r\n\t\tglobal $sock;\r\n\t\tif ($sock) {\r\n\t\t\tfclose($sock);\r\n\t\t}\r\n\t\texit();\r\n\t}",
"function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '')\n{\n\tglobal $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path, $nav_links, $gen_simple_header, $images;\n\tglobal $userdata, $user_ip, $session_length;\n\tglobal $starttime, $plus_config;\n\tglobal $HTTP_COOKIE_VARS;\n\t//-- mod : categories hierarchy --------------------------------------------------------------------\n//-- add\n\tglobal $tree;\n//-- fin mod : categories hierarchy ----------------------------------------------------------------\n\n//+MOD: Fix message_die for multiple errors MOD\n\tstatic $msg_history;\n\tif( !isset($msg_history) )\n\t{\n\t\t$msg_history = array();\n\t}\n\t$msg_history[] = array(\n\t\t'msg_code'\t=> $msg_code,\n\t\t'msg_text'\t=> $msg_text,\n\t\t'msg_title'\t=> $msg_title,\n\t\t'err_line'\t=> $err_line,\n\t\t'err_file'\t=> $err_file,\n\t\t'sql'\t\t=> $sql\n\t);\n//-MOD: Fix message_die for multiple errors MOD\n\n\tif(defined('HAS_DIED'))\n\t{\n\t\t//+MOD: Fix message_die for multiple errors MOD\n\n\t\t//\n\t\t// This message is printed at the end of the report.\n\t\t// Of course, you can change it to suit your own needs. ;-)\n\t\t//\n\t\t$custom_error_message = 'Please, contact the %swebmaster%s. Thank you.';\n\t\tif ( !empty($board_config) && !empty($board_config['board_email']) )\n\t\t{\n\t\t\t$custom_error_message = sprintf($custom_error_message, '<a href=\"mailto:' . $board_config['board_email'] . '\">', '</a>');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$custom_error_message = sprintf($custom_error_message, '', '');\n\t\t}\n\t\techo \"<html>\\n<body>\\n<b>Critical Error!</b><br />\\nmessage_die() was called multiple times.<br /> <hr />\";\n\t\tfor( $i = 0; $i < count($msg_history); $i++ )\n\t\t{\n\t\t\techo '<b>Error #' . ($i+1) . \"</b>\\n<br />\\n\";\n\t\t\tif( !empty($msg_history[$i]['msg_title']) )\n\t\t\t{\n\t\t\t\techo '<b>' . $msg_history[$i]['msg_title'] . \"</b>\\n<br />\\n\";\n\t\t\t}\n\t\t\techo $msg_history[$i]['msg_text'] . \"\\n<br /><br />\\n\";\n\t\t\tif( !empty($msg_history[$i]['err_line']) )\n\t\t\t{\n\t\t\t\techo '<b>Line :</b> ' . $msg_history[$i]['err_line'] . '<br /><b>File :</b> ' . $msg_history[$i]['err_file'] . \"</b>\\n<br />\\n\";\n\t\t\t}\n\t\t\tif( !empty($msg_history[$i]['sql']) )\n\t\t\t{\n\t\t\t\techo '<b>SQL :</b> ' . $msg_history[$i]['sql'] . \"\\n<br />\\n\";\n\t\t\t}\n\t\t\techo \" <hr />\\n\";\n\t\t}\n\t\techo $custom_error_message . '<hr /><br clear=\"all\">';\n\t\tdie(\"</body>\\n</html>\");\n//-MOD: Fix message_die for multiple errors MOD\n\n\t}\n\t\n\tdefine('HAS_DIED', 1);\n\t\n\n\t$sql_store = $sql;\n\t\n\t//\n\t// Get SQL error if we are debugging. Do this as soon as possible to prevent \n\t// subsequent queries from overwriting the status of sql_error()\n\t//\n\tif ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) )\n\t{\n\t\t$sql_error = $db->sql_error();\n\n\t\t$debug_text = '';\n\n\t\tif ( $sql_error['message'] != '' )\n\t\t{\n\t\t\t$debug_text .= '<br /><br />SQL Error : ' . $sql_error['code'] . ' ' . $sql_error['message'];\n\t\t}\n\n\t\tif ( $sql_store != '' )\n\t\t{\n\t\t\t$debug_text .= \"<br /><br />$sql_store\";\n\t\t}\n\n\t\tif ( $err_line != '' && $err_file != '' )\n\t\t{\n\t\t\t$debug_text .= '<br /><br />Line : ' . $err_line . '<br />File : ' . basename($err_file);\n\t\t}\n\t}\n\n\tif( empty($userdata) && ( $msg_code == GENERAL_MESSAGE || $msg_code == GENERAL_ERROR ) )\n\t{\n\t\t$userdata = session_pagestart($user_ip, PAGE_INDEX);\n\t\tinit_userprefs($userdata);\n\t}\n\n\t//\n\t// If the header hasn't been output then do it\n\t//\n\tif ( !defined('HEADER_INC') && $msg_code != CRITICAL_ERROR )\n\t{\n\t\tif ( empty($lang) )\n\t\t{\n\t\t\tif ( !empty($board_config['default_lang']) )\n\t\t\t{\n\t\t\t\tinclude($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.'.$phpEx);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tinclude($phpbb_root_path . 'language/lang_english/lang_main.'.$phpEx);\n\t\t\t}\n\t\t\t//-- mod : language settings -----------------------------------------------------------------------\n//-- add\n\t\t\tinclude($phpbb_root_path . './includes/lang_extend_mac.' . $phpEx);\n//-- fin mod : language settings -------------------------------------------------------------------\n\n\t\t}\n\n\t\tif ( empty($template) || empty($theme) )\n\t\t{\n\t\t\t$theme = setup_style($board_config['default_style']);\n\t\t}\n\n\t\t//\n\t\t// Load the Page Header\n\t\t//\n\t\tif ( !defined('IN_ADMIN') )\n\t\t{\n\t\t\tinclude($phpbb_root_path . 'includes/page_header.'.$phpEx);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tinclude($phpbb_root_path . 'admin/page_header_admin.'.$phpEx);\n\t\t}\n\t}\n\n\tswitch($msg_code)\n\t{\n\t\tcase GENERAL_MESSAGE:\n\t\t\tif ( $msg_title == '' )\n\t\t\t{\n\t\t\t\t$msg_title = $lang['Information'];\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase CRITICAL_MESSAGE:\n\t\t\tif ( $msg_title == '' )\n\t\t\t{\n\t\t\t\t$msg_title = $lang['Critical_Information'];\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase GENERAL_ERROR:\n\t\t\tif ( $msg_text == '' )\n\t\t\t{\n\t\t\t\t$msg_text = $lang['An_error_occured'];\n\t\t\t}\n\n\t\t\tif ( $msg_title == '' )\n\t\t\t{\n\t\t\t\t$msg_title = $lang['General_Error'];\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase CRITICAL_ERROR:\n\t\t\t//\n\t\t\t// Critical errors mean we cannot rely on _ANY_ DB information being\n\t\t\t// available so we're going to dump out a simple echo'd statement\n\t\t\t//\n\t\t\tinclude($phpbb_root_path . 'language/lang_english/lang_main.'.$phpEx);\n\n\t\t\tif ( $msg_text == '' )\n\t\t\t{\n\t\t\t\t$msg_text = $lang['A_critical_error'];\n\t\t\t}\n\n\t\t\tif ( $msg_title == '' )\n\t\t\t{\n\t\t\t\t$msg_title = 'phpBB : <b>' . $lang['Critical_Error'] . '</b>';\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\t//\n\t// Add on DEBUG info if we've enabled debug mode and this is an error. This\n\t// prevents debug info being output for general messages should DEBUG be\n\t// set TRUE by accident (preventing confusion for the end user!)\n\t//\n\tif ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) )\n\t{\n\t\tif ( $debug_text != '' )\n\t\t{\n\t\t\t$msg_text = $msg_text . '<br /><br /><b><u>DEBUG MODE</u></b>' . $debug_text;\n\t\t}\n\t}\n\n\tif ( $msg_code != CRITICAL_ERROR )\n\t{\n\t\tif ( !empty($lang[$msg_text]) )\n\t\t{\n\t\t\t$msg_text = $lang[$msg_text];\n\t\t}\n\n\t\tif ( !defined('IN_ADMIN') )\n\t\t{\n\t\t\t$template->set_filenames(array(\n\t\t\t\t'message_body' => 'message_body.tpl')\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$template->set_filenames(array(\n\t\t\t\t'message_body' => 'admin/admin_message_body.tpl')\n\t\t\t);\n\t\t}\n\n\t\t$template->assign_vars(array(\n\t\t\t'PLUS_VERSION' => $plus_config['plus_version'],\n\t\t\t'MESSAGE_TITLE' => $msg_title,\n\t\t\t'MESSAGE_TEXT' => $msg_text)\n\t\t);\n\t\t$template->pparse('message_body');\n\n\t\tif ( !defined('IN_ADMIN') )\n\t\t{\n\t\t\tinclude($phpbb_root_path . 'includes/page_tail.'.$phpEx);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tinclude($phpbb_root_path . 'admin/page_footer_admin.'.$phpEx);\n\t\t}\n\t}\n\telse\n\t{\n\t\techo \"<html>\\n<body>\\n\" . $msg_title . \"\\n<br /><br />\\n\" . $msg_text . \"</body>\\n</html>\";\n\t}\n\n\texit;\n}",
"function manage_generic_error_code($error_code){\n\t\n\tmsg_general_operation_failed ($erro_code);\n\texit();\n\t\n}",
"private function generateMessage($code) {\n\t\tstatic $ERRORS = array(\n\t\t\t0x0001 => 'Missing required trait',\n\t\t\t0x0002 => 'Missing configuration file',\n\t\t\t0x0003 => 'Configuration file did not return an array',\n\t\t\t0x0004 => 'Driver load failed',\n\t\t\t0x0005 => 'Critical file missing',\n\t\t\t0x0006 => 'Critical class missing',\n\t\t\t0x0007 => 'Request instance not loaded',\n\t\t\t0x0008 => 'Response instance not loaded',\n\t\t\t0x0009 => 'View initialization error'\n\t\t);\n\n\t\t// Find the error and return it\n\t\tif (isset($ERRORS[$code])) {\n\t\t\treturn $ERRORS[$code];\n\t\t}\n\n\t\t// Not found\n\t\treturn 'Unknown exception';\n\t}",
"public function failure_msg($msg)\n\t\t{\n\t\t\tprint '\t<br /><br /><div align=\"center\" style=\"background:#FFF2F2; padding:5px; font-size:13px; font-family:verdana; border:1px solid #FF8080;\">\n\t\t\t\t\t' . $msg . '\n\t\t\t\t\t</div><br />';\n\t\t}",
"function error_msg ($err_code) {\n\n global $error_setup;\n\n $template = file_get_contents($error_setup[\"template_url\"]);\n if($template == \"\")\n $template = \"<h1>Error #%CODE%</h1><p>An error occurred. Please contact us at %MAIL%.<br>%MSG%</p>\";\n\n $error_list = file_get_contents($error_setup[\"messages_list_url\"]);\n $error_list = json_decode($error_list, true);\n\n if(!isset($error_list[$err_code]))\n $msg = \"There was an error while loading the error messages list\";\n else\n $msg = $error_list[$err_code];\n\n $error_info = array(\"host\" => $_SERVER[\"SERVER_NAME\"], \"request\" => $_SERVER[\"REQUEST_URI\"], \"GET\" => $_GET, \"POST\" => $_POST);\n $error_info = \"ERR:$err_code,\".base64_encode(json_encode($error_info)).\";\";\n\n $page = str_replace(\"%CODE%\", $err_code, $template);\n $page = str_replace(\"%MAIL%\", \"<a href=\\\"mailto:{$error_setup[mail_address]}\\\">{$error_setup[mail_address]}</a>\", $page);\n $page = str_replace(\"%MSG%\", $msg, $page);\n $page = str_replace(\"%EINFO%\", $error_info, $page);\n\n if($page == \"\")\n $page = \"<h1>Error #$err_code</h1>\";\n\n header(\"Content-type: text/html\");\n exit($page);\n\n}",
"private function getMessageTemplate()\n {\n return 'Undefined error code :errorCode.';\n }",
"function wizGradeDie($msg) {\r\n\t\t\t\r\n\t\t\tglobal $erroMsg, $msgEnd;\r\n\t\r\n$err = <<<END\r\n\r\n\t\t\t$erroMsg $msg $msgEnd\r\n\t\t\r\nEND;\r\n\r\n\t\t\techo $err; exit;\r\n\t\r\n\t\t}",
"public function getMessage(string $code);",
"function critical_error($code,$relay=NULL,$exit=true)\n\t{\n\t\terror_reporting(0);\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\tif ((function_exists('browser_matches')) && ((is_null($relay)) || (strpos($relay,'Allowed memory')===false)))\n\t\t\t\tif ((!browser_matches('ie')) && (strpos(ocp_srv('SERVER_SOFTWARE'),'IIS')===false)) header('HTTP/1.0 500 Internal server error');\n\t\t}\n\n\t\t$error='Unknown critical error type: this should not happen, so please report this to ocProducts.';\n\n\t\tswitch ($code)\n\t\t{\n\t\t\tcase 'MISSING_SOURCE':\n\t\t\t\t$error='A source-code ('.$relay.') file is missing/corrupt/incompatible.';\n\t\t\t\tbreak;\n\t\t\tcase 'PASSON':\n\t\t\t\t$error=$relay;\n\t\t\t\tbreak;\n\t\t\tcase 'MEMBER_BANNED':\n\t\t\t\t$error='The member you are masquerading as has been banned. We cannot finish initialising the virtualised environment for this reason.';\n\t\t\t\tbreak;\n\t\t\tcase 'BANNED':\n\t\t\t\t$error='The IP address you are accessing this website from ('.get_ip_address().') has been banished from this website. If you believe this is a mistake, contact the staff to have it resolved (typically, postmaster@'.get_domain().' will be able to reach them).</div>'.chr(10).'<div>If you are yourself staff, you should be able to unban yourself by editing the <kbd>usersubmitban_ip</kbd> table in a database administation tool, by removing rows that qualify against yourself. This error is raised to a critical error to reduce the chance of this IP address being able to further consume server resources.';\n\t\t\t\tbreak;\n\t/*\t\tcase 'PHP':\n\t\t\t\t$error='<p>This is a PHP error.</div>'.chr(10).'<div style=\"padding-left: 50px\">'.$relay;\n\t\t\t\tbreak;\n\t*/\n\t\t\tcase 'TEST':\n\t\t\t\t$error='This is a test error.';\n\t\t\t\tbreak;\n\t\t\tcase 'BUSY':\n\t\t\t\t$error='This is a less-critical error that has been elevated for quick dismissal due to high server load.</div>'.chr(10).'<div style=\"padding-left: 50px\">'.$relay;\n\t\t\t\tbreak;\n\t\t\tcase 'EMERGENCY':\n\t\t\t\t$error='This is an error that has been elevated to critical error status because it occurred during the primary error mechanism reporting system itself (possibly due to it occuring within the standard output framework). It may be masking a secondary error that occurred before this, but was never output - if so, it is likely strongly related to this one, thus fixing this will fix the other.</div>'.chr(10).'<div style=\"padding-left: 50px\">'.$relay;\n\t\t\t\tbreak;\n\t\t\tcase 'RELAY':\n\t\t\t\t$error='This is a relayed critical error, which means that this less-critical error has occurred during startup, and thus halted startup.</div>'.chr(10).'<div style=\"padding-left: 50px\">'.$relay;\n\t\t\t\tbreak;\n\t\t\tcase 'FILE_DOS':\n\t\t\t\t$error='This website was prompted to download a file ('.htmlentities($relay).') which seemingly has a never-ending chain of redirections. Because this could be a denial of service attack, execution has been terminated.';\n\t\t\t\tbreak;\n\t\t\tcase 'DATABASE_FAIL':\n\t\t\t\t$error='The website\\'s first database query (checking the page request is not from a banned IP address or reading the site configuration) has failed. This almost always means that the database is not set up correctly, which in turns means that either backend database configuration has changed (perhaps the database has been emptied), or the configuration file (info.php) has been incorrectly altered (perhaps to point to an empty database), or you have moved servers and not updated your info.php settings properly or placed your database. It could also mean that the <kbd>'.get_table_prefix().'usersubmitban_ip</kbd> table or <kbd>'.get_table_prefix().'config</kbd> table alone is missing or corrupt, but this is unlikely. As this is an error due to the website\\'s environment being externally altered by unknown means, the website cannot continue to function or solve the problem itself.';\n\t\t\t\tbreak;\n\t\t\tcase 'INFO.PHP':\n\t\t\t\t$install_url='install.php';\n\t\t\t\tif (!file_exists($install_url)) $install_url='../install.php';\n\t\t\t\tif (file_exists($install_url))\n\t\t\t\t{\n\t\t\t\t\t$likely='ocPortal files have been placed, yet installation not completed. To install ocPortal, <a href=\"'.$install_url.'\">run the installer</a>.';\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$likely='ocPortal files have been placed by direct copying from a non-standard source that included neither a configuration file nor installation script, or info.php has become corrupt after installation. The installer (install.php) is not present: it is advised that you replace info.php from backup, or if you have not yet installed, use an official ocProducts installation package.';\n\t\t\t\t}\n\t\t\t\t$error='The top-level configuration file (info.php) is either not-present or empty. This file is created upon installation, and the likely cause of this error is that '.$likely;\n\t\t\t\tbreak;\n\t\t\tcase 'INFO.PHP_CORRUPTED':\n\t\t\t\t$error='The top-level configuration file (info.php) appears to be corrupt. Perhaps it was incorrectly uploaded, or a typo was made. It must be valid PHP code.';\n\t\t\t\tbreak;\n\t\t\tcase 'CRIT_LANG':\n\t\t\t\t$error='The most basic critical error language file (lang/'.fallback_lang().'/critical_error.ini) is missing. It is likely that other files are also, for whatever reason, missing from this ocPortal installation.';\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$edit_url='config_editor.php';\n\t\tif (!file_exists($edit_url)) $edit_url='../'.$edit_url;\n\t\tif (isset($GLOBALS['SITE_INFO']['base_url'])) $edit_url=$GLOBALS['SITE_INFO']['base_url'].'/config_editor.php';\n\n\t\t$extra='';\n\n\t\tif ((function_exists('debug_backtrace')) && (strpos($error,'Allowed memory')===false) && ((is_null($relay)) || (strpos($relay,'Stack trace')===false)) && (function_exists('ocp_srv')) && (((ocp_srv('REMOTE_ADDR')==ocp_srv('SERVER_ADDR')) && (ocp_srv('HTTP_X_FORWARDED_FOR')=='')) || (preg_match('#^localhost(\\.|\\:|$)#',ocp_srv('HTTP_HOST'))!=0) && (function_exists('get_base_url')) && (substr(get_base_url(),0,16)=='http://localhost')))\n\t\t{\n\t\t\t$_trace=debug_backtrace();\n\t\t\t$extra='<div class=\"medborder medborder_box\"><h2>Stack trace…</h2>';\n\t\t\tforeach ($_trace as $stage)\n\t\t\t{\n\t\t\t\t$traces='';\n\t\t\t\tforeach ($stage as $key=>$value)\n\t\t\t\t{\n\t\t\t\t\tif ((is_object($value) && (is_a($value,'ocp_tempcode'))) || (is_array($value) && (strlen(serialize($value))>500)))\n\t\t\t\t\t{\n\t\t\t\t\t\t$_value=gettype($value);\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\tif (strpos($error,'Allowed memory')!==false) // Actually we don't call this code path any more, as stack trace is useless (comes from the catch_fatal_errors function)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_value=gettype($value);\n\t\t\t\t\t\t\tswitch ($_value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase 'integer':\n\t\t\t\t\t\t\t\t\t$_value=strval($value);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'string':\n\t\t\t\t\t\t\t\t\t$_value=$value;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t@ob_start();\n\t\t\t\t\t\t\tif (function_exists('var_export'))\n\t\t\t\t\t\t\t\t/*var_dump*/var_export($value);\n\t\t\t\t\t\t\t$_value=ob_get_contents();\n\t\t\t\t\t\t\tob_end_clean();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tglobal $SITE_INFO;\n\t\t\t\t\tif ((isset($SITE_INFO['db_site_password'])) && (strlen($SITE_INFO['db_site_password'])>4))\n\t\t\t\t\t\t$_value=str_replace($SITE_INFO['db_site_password'],'(password removed)',$_value);\n\t\t\t\t\tif ((isset($SITE_INFO['db_forums_password'])) && (strlen($SITE_INFO['db_forums_password'])>4))\n\t\t\t\t\t\t$_value=str_replace($SITE_INFO['db_forums_password'],'(password removed)',$_value);\n\n\t\t\t\t\t$traces.=ucfirst($key).' -> '.htmlentities($_value).'<br />'.chr(10);\n\t\t\t\t}\n\t\t\t\t$extra.='<p>'.$traces.'</p>'.chr(10);\n\t\t\t}\n\t\t\t$extra.='</div>';\n\t\t}\n\n\t\t$headers_sent=headers_sent();\n\t\tif (!$headers_sent)\n\t\t{\n\t\t\t@header('Content-type: text/html');\n\t\t\techo <<<END\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"EN\" lang=\"EN\">\n<head>\n\t<title>Critical error</title>\n\t<style type=\"text/css\"><![CDATA[\nEND;\nif (strpos($error,'Allowed memory')===false)\n{\n\t$file_contents=file_get_contents($GLOBALS['FILE_BASE'].'/themes/default/css/global.css');\n} else\n{\n\t$file_contents=''; // Can't load files if dying due to memory limit\n}\n$css=((preg_replace('#/\\*\\s*\\*/\\s*#','',str_replace('url(\\'\\')','none',str_replace('url(\"\")','none',preg_replace('#\\{\\$[^\\}]*\\}#','',$file_contents))))));\necho htmlentities($css);\necho <<<END\n\t\t.main_page_title { text-decoration: underline; display: block; min-height: 42px; padding: 3px 0 0 0; }\n\t\ta[target=\"_blank\"], a[onclick$=\"window.open\"] { padding-right: 0; }\n\t]]></style>\n</head>\n<body><div class=\"global_middle\">\nEND;\n\t\t}\n\t\techo '<h1 class=\"main_page_title\">Critical error – bailing out</h1>'.chr(10).'<div class=\"red_alert\">'.$error.'</div>'.chr(10);\n\t\tflush();\n\t\tif ((strpos($_SERVER['PHP_SELF'],'upgrader.php')!==false) && (strpos($error,'Allowed memory')===false))\n\t\t{\n\t\t\trequire_code('upgrade');\n\t\t\techo '<div class=\"medborder medborder_box\"><h2>Integrity check</h2><p><strong>If you think this problem could be due to corruption caused by a failed upgrade (e.g. time-out during extraction), check the following integrity check…</strong></p>',run_integrity_check(true),'</div><br />';\n\t\t}\n\t\tflush();\n\t\techo $extra,chr(10);\n\t\techo '<p>Details here are intended only for the website/system-administrator, not for regular website users.<br />» <strong>If you are a regular website user, please let the website staff deal with this problem.</strong></p>'.chr(10).'<p class=\"associated_details\">Depending on the error, and only if the website installation finished, you may need to <a href=\"#\" onclick=\"if (!window.confirm(\\'Are you staff on this site?\\')) return false; this.href=\\''.htmlentities($edit_url).'\\';\">edit the installation options</a> (the <kbd>info.php</kbd> file).</p>'.chr(10).'<p class=\"associated_details\">ocProducts maintains full documentation for all procedures and tools. These may be found on the <a href=\"http://ocportal.com\">ocPortal website</a>. If you are unable to easily solve this problem, we may be contacted from our website and can help resolve it for you.</p>'.chr(10).'<hr />'.chr(10).'<p style=\"font-size: 0.8em\"><a href=\"http://ocportal.com/\">ocPortal</a> is a <abbr title=\"Content Management System\">CMS</abbr> for building websites, developed by ocProducts.</p>'.chr(10);\n\t\techo '</div></body>'.chr(10).'</html>';\n\t\t$GLOBALS['SCREEN_TEMPLATE_CALLED']='';\n\t\tif ($exit) exit();\n\t}",
"private function getDefaultMessage(int $code): string\n {\n $message = '';\n\n if (401 === $code) {\n $message = sprintf('Please authenticate using the \"%s\" command', LoginCommand::NAME);\n } elseif (402 === $code) {\n $message = 'An active subscription is required to perform this action';\n } elseif (403 === $code) {\n $message = 'You are not authorized to perform this action';\n } elseif (404 === $code) {\n $message = 'The requested resource does not exist';\n } elseif (409 === $code) {\n $message = 'This operation is already in progress';\n } elseif (410 === $code) {\n $message = 'The requested resource is being deleted';\n } elseif (429 === $code) {\n $message = 'You are attempting this action too often';\n }\n\n return $message;\n }",
"public function error($msg) {\n\n\t\t\tprint \"$msg\";\n\t\t\tdie;\n\t\t}",
"public static final function toMessage(int $code): string\n {\n return self::MESSAGES[$code] ?? 'Unknown error';\n }",
"function haltmsg($msg) {\n printf(\"<b>Template Error:</b> %s<br/>\\n\", $msg);\n }",
"function haltmsg($msg) {\n printf(\"<b>Template Error:</b> %s<br>\\n\", $msg);\n }",
"function error($msg){\n //\n die($msg.\"<br/> Error occured in page \".$this->page_filename);\n }",
"function HTTPFailWithCode($code, $message)\n{\n header(reasonForCode($code));\n exit($message);\n}",
"function error($msg) {\n $err = $this->getHeader(\"ERREUR MySQL\");\n $err = \"<TR>\n <TD BGCOLOR=\\\"#D16D31\\\" ALIGN=\\\"left\\\"><FONT FACE=\\\"Verdana,Helvetica,Arial\\\" COLOR=\\\"#FFFD3E\\\" SIZE=\\\"2\\\"><B>Erreur</B></FONT></TD>\n <TD BGCOLOR=\\\"#CCCCCC\\\" ALIGN=\\\"left\\\"><FONT FACE=\\\"Verdana,Helvetica,Arial\\\" COLOR=\\\"#893737\\\" SIZE=\\\"2\\\"><B>\" . nl2br($msg) . \"</B></FONT></TD>\n </TR>\n <TR>\n <TD BGCOLOR=\\\"#D16D31\\\" ALIGN=\\\"left\\\"><FONT FACE=\\\"Verdana,Helvetica,Arial\\\" COLOR=\\\"#FFFD3E\\\" SIZE=\\\"2\\\"><B>N° erreur MySQL</B></FONT></TD>\n <TD BGCOLOR=\\\"#CCCCCC\\\" ALIGN=\\\"left\\\"><FONT FACE=\\\"Verdana,Helvetica,Arial\\\" COLOR=\\\"#893737\\\" SIZE=\\\"2\\\">\" . @mysql_errno() . \" </FONT></TD>\n </TR>\n <TR>\n <TD BGCOLOR=\\\"#D16D31\\\" ALIGN=\\\"left\\\"><FONT FACE=\\\"Verdana,Helvetica,Arial\\\" COLOR=\\\"#FFFD3E\\\" SIZE=\\\"2\\\"><B>Message MySQL</B></FONT></TD>\n <TD BGCOLOR=\\\"#CCCCCC\\\" ALIGN=\\\"left\\\"><FONT FACE=\\\"Verdana,Helvetica,Arial\\\" COLOR=\\\"#893737\\\" SIZE=\\\"2\\\">\" . @mysql_error() . \" </FONT></TD>\n </TR>\";\n echo $this->getFooter();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return true when category mode is activated in shop prefs | public static function isCategoryMode(){
if(self::$isCategoryMode !== -1){
return self::$isCategoryMode;
}
$db = new DB_WE();
self::$isCategoryMode = f('SELECT pref_value FROM ' . SETTINGS_TABLE . ' WHERE tool="shop" AND pref_name="category_mode"', '', $db, 0) ? true : false;
return self::$isCategoryMode;
} | [
"public function isFlatCategoryEnable()\n {\n return $this->scopeConfig->getValue(\n 'catalog/frontend/flat_catalog_category',\n ScopeInterface::SCOPE_STORE\n );\n }",
"public function categoriesAreRequested()\n {\n return (bool) Mage::getStoreConfig('bxSearch/autocomplete/category');\n }",
"protected function _isCategory() {\n return $this->_getRouteName() == 'catalog'\n && $this->_getControllerName() == 'category';\n }",
"function is_category() {\n\t$pcat = CAT_ID;\n\treturn(!empty($pcat));\n}",
"public static function isEnabled()\n\t{\n\t\treturn XenForo_Application::get('options')->get('toggleME_lang_cat_enable');\n\t}",
"public function canPurgeCatalogCategory()\n {\n return $this->_scopeConfig->isSetFlag(self::XML_FASTLY_PURGE_CATALOG_CATEGORY);\n }",
"function is_catalog_mode($boolCheck)\r\n{\r\n\treturn ($boolCheck==$_SESSION['_CATALOG_MODE']);\r\n}",
"public function isCategory() {\n\t\treturn $this->libraryType == self::TYPE_CATEGORY;\n\t}",
"function photo_perfect_is_category_navigation_active( $control ) {\n\n\t\tif ( $control->manager->get_setting( 'theme_options[show_category_dropdown]' )->value() ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}",
"public function supportsCategories();",
"function osc_category_price_enabled() {\n return (boolean)osc_category_field(\"b_price_enabled\");\n }",
"public function isProductMode()\n {\n return $this->getCurrentCategory()->getDisplayMode()==Mage_Catalog_Model_Category::DM_PRODUCT;\n }",
"public function hasCategoryList(){\n\t\treturn true;\n\t}",
"function is_NewsCategory() {\n\treturn in_context(ZP_ZENPAGE_NEWS_CATEGORY);\n}",
"public function getCategoryIsActive()\n {\n return $this->category_is_active;\n }",
"function ol_get_active_category( $active ) {\n\tif ( ! isset( $_SESSION['mstore_category'] ) && 'all' === $active ) {\n\t\treturn true;\n\t}\n\n\treturn ( $active === $_SESSION['mstore_category'] );\n}",
"public function getShowInCategoryMenu() {\n return $this->getListMenu() == Ultimate_ModuleCreator_Model_Source_Entity_Menu::CATEGORY_MENU;\n }",
"public function hasCategoryList(){\n\t\treturn false;\n\t}",
"public function isAssignedToCategory()\n {\n $_currentProduct = $this->getProduct();\n $_categoryIds = $_currentProduct->getCategoryIds();\n if($_categoryIds) {\n return true;\n } else {\n return false;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function checks if user session has expired (PCI compliance requirement) If user session has expired, logged user will be redirected to login page, otherwise expiration time will be updated to current time | public static function is_expired()
{
$conf = $GLOBALS['CONF'];
if (!$conf)
{
$conf = new Ossim_conf();
$GLOBALS['CONF'] = $conf;
}
$expired_timeout = intval($conf->get_conf('session_timeout')) * 60;
if ($expired_timeout != 0)
{
$time = gmdate('U');
if (isset($_SESSION['_expiration_time']) && intval($_SESSION['_expiration_time']) + $expired_timeout < $time)
{
$ossim_link = $conf->get_conf('ossim_link');
$login_location = preg_replace("/(\/)+/","/",$ossim_link . '/session/login.php?action=logout');
header("Location: $login_location");
}
//Only update if not exists bypass => header ajax responses
if (intval(GET('bypassexpirationupdate')) != 1 && intval(POST('bypassexpirationupdate')) != 1)
{
$_SESSION['_expiration_time'] = $time;
Session_activity::update($_SESSION['_expiration_time']);
}
}
} | [
"public static function checkTimer()\r\n {\r\n // make sure the SESSION is not expired\r\n if (isset($_SESSION['authenticated_user']) && isset($_SESSION['time_expiration']) )\r\n {\r\n // check time\r\n $time_now = time();\r\n\r\n if ($time_now > $_SESSION['time_expiration'])\r\n {\r\n session_destroy();\r\n header(\"Location: ?page=login\");\r\n }\r\n }\r\n }",
"private static function expire()\n {\n $now = time();\n $last = isset($_SESSION['lastActive']) ? $_SESSION['lastActive'] : null;\n $user = self::isUserAuthenticated();\n if (!is_null($last) && ($now > $last + self::SESSION_TIME_LIMIT)) {\n self::destroy();\n // User was authenticated before expiration: create a session var to inform user to login again\n // Look at AdminUserController->showAdminAccess()\n if ($user != false) {\n $_SESSION['expiredSession']['state'] = true;\n $_SESSION['expiredSession']['inactivity'] = true;\n }\n $isExpired = true;\n } else {\n $isExpired = false;\n }\n $_SESSION['lastActive'] = $now;\n return $isExpired;\n }",
"protected function handleSessionLifeTimeExpired()\n {\n if ($this->isInitialInstallationInProgress()) {\n $this->redirect();\n } else {\n /** @var $message \\TYPO3\\CMS\\Install\\Status\\ErrorStatus */\n $message = GeneralUtility::makeInstance(\\TYPO3\\CMS\\Install\\Status\\ErrorStatus::class);\n $message->setTitle('Session expired');\n $message->setMessage(\n 'Your Install Tool session has expired. You have been logged out, please log in and try again.'\n );\n $this->output($this->loginForm($message));\n }\n }",
"public function expire()\n {\n if ($this->getBag('attributes')->get('uid') == '0') {\n // no need to do anything for guests without sessions\n if ($this->getBag('attributes')->get('anonymoussessions') == '0' && !session_id()) {\n return;\n }\n\n // no need to display expiry for anon users with sessions since it's invisible anyway\n // handle expired sessions differently\n $this->createNew(session_id(), $this->object['ipaddr']);\n // session is not new, remove flag\n $this->isNew = false;\n $this->regenerate(true);\n return;\n }\n\n // for all logged in users with session destroy session and set flag\n //session_destroy();\n $this->expired = true;\n }",
"public static function checkExpiredSession()\n\t{\n\t\tglobal $ilSetting;\n\t\t\n\t\t// do not check session in fixed duration mode\n\t\tif( $ilSetting->get('session_handling_type', 0) != 1 )\n\t\t\treturn;\n\n\t\t// check for expired sessions makes sense\n\t\t// only when public section is not enabled\n\t\t// because it is not possible to determine\n\t\t// wether the sid cookie relates to a session of an\n\t\t// authenticated user or a anonymous user\n\t\t// when the session dataset has allready been deleted\n\n\t\tif(!$ilSetting->get(\"pub_section\"))\n\t\t{\n\t\t\tglobal $lng;\n\n\t\t\t$sid = null;\n\n\t\t\tif( !isset($_COOKIE[session_name()]) || !strlen($_COOKIE[session_name()]) )\n\t\t\t{\n\t\t\t\tself::debug('Browser did not send a sid cookie');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sid = $_COOKIE[session_name()];\n\n\t\t\t\tself::debug('Browser sent sid cookie with value ('.$sid.')');\n\n\t\t\t\tif(!self::isValidSession($sid))\n\t\t\t\t{\n\t\t\t\t\tself::debug('remove session cookie for ('.$sid.') and trigger event');\n\n\t\t\t\t\t// raw data will be updated (later) with garbage collection [destroyExpired()]\n\t\t\t\t\t\n\t\t\t\t\tself::removeSessionCookie();\n\n\t\t\t\t\t// Trigger expiredSessionDetected Event\n\t\t\t\t\tglobal $ilAppEventHandler;\n\t\t\t\t\t$ilAppEventHandler->raise(\n\t\t\t\t\t\t'Services/Authentication', 'expiredSessionDetected', array()\n\t\t\t\t\t);\n\n\t\t\t\t\tilUtil::redirect('login.php?expired=true'.'&target='.$_GET['target']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function check_login()\n // Make sure user is logged in. Redirect to login page if not.\n {\n if (!isset ($_SESSION['uid']) || !$_SESSION['uid'] || $_SESSION['ip']!=allIPs() || time()>=$_SESSION['expires_on'])\n {\n\t\t\theader(\"location: ../ressources/controleur/action/logout.php\");\n }\n $_SESSION['expires_on']=time()+INACTIVITY_TIMEOUT; // User accessed a page : Update his/her session expiration date.\n }",
"private function expired()\n\t{\n\t\treturn (time() - $this->session['last_activity']) > ($this->config->get('session.lifetime') * 60);\n\t}",
"public static function expire()\n {\n if (self::getVar('uid') == '0') {\n // no need to do anything for guests without sessions\n if (System::getVar('anonymoussessions') == '0' && !session_id()) {\n return;\n }\n\n // no need to display expiry for anon users with sessions since it's invisible anyway\n // handle expired sessions differently\n self::_createNew(session_id(), $GLOBALS['_ZSession']['obj']['ipaddr']);\n // session is not new, remove flag\n unset($GLOBALS['_ZSession']['new']);\n self::regenerate(true);\n return;\n }\n\n // for all logged in users with session destroy session and set flag\n session_destroy();\n $GLOBALS['_ZSession']['expired'] = true;\n }",
"public function expiry() {\n\t\t\n\t\tif (Auth::check()) {\n\t\t\treturn $this->respond([\n\t\t\t\t'message' => 'You are good to go!'\n\t\t\t]);\n\t\t} else {\n\t\t\treturn $this->respondUnauthorized('Your session has been expired!');\n\t\t}\n\t}",
"public function isExpired()\r\n\t{\r\n\t\treturn ($this->_session->loggedIn === true && !$this->_session->expiringLogin);\r\n\t}",
"public function checkSessionExpire()\n {\n $sess_exp = session_cache_expire() * 60;\n\n if (isset($_SESSION['admin_expire_time']) && time() - $_SESSION['admin_expire_time'] >= $sess_exp) {\n return false;\n } else {\n $_SESSION['admin_expire_time'] = $_SERVER['REQUEST_TIME'];\n return true;\n }\n }",
"function isSessionExpired() {\n $lastActivity = $_SESSION['LAST_ACTIVITY'];\n $timeOut = $_SESSION['IDLE_TIME_LIMIT'];\n // Check if session has been active longer than IDLE_TIME_LIMIT\n if(time() - $lastActivity >= $timeOut) {\n return true;\n } else { false; }\n }",
"public function check_login_max_time(){\n\t\t// if(isset($_SESSION['login_time']) and !empty($_SESSION['login_time'])){\n\t\t// \tif( (time() - $_SESSION['login_time']) > 600 ){\n\t\t// \t\tsession_destroy();\n\t\t// \t\treturn false;\n\t\t// \t}\n\t\t// \telse{\n\t\t// \t\t$_SESSION['login_time'] = time();\n\t\t \t\treturn true;\n\t\t// \t}\n\t\t// }\n\t}",
"function sessionIdExpired() {\r\n if (!isset($_SESSION['regenerated'])) {\r\n $_SESSION['regenerated'] = time();\r\n return false;\r\n }\r\n\r\n $expiry_time = time() - $this->session_id_ttl;\r\n\r\n if ($_SESSION['regenerated'] <= $expiry_time) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }",
"public function check_for_inactivity() {\n\t\tif ( is_user_logged_in() ) {\n\t\t\t$user_id = get_current_user_id();\n\t\t\t$time = get_user_meta( $user_id, self::ID . '_last_active_time', true );\n\n\t\t\tif ( is_numeric($time) ) {\n\t\t\t\tif ( (int) $time + $this->get_idle_time_setting() < time() ) {\n\t\t\t\t\twp_redirect( wp_login_url() . '?idle=1' );\n\t\t\t\t\twp_logout();\n\t\t\t\t\t$this->clear_activity_meta( $user_id );\n\t\t\t\t\texit;\n\t\t\t\t} else {\n\t\t\t\t\tupdate_user_meta( $user_id, self::ID . '_last_active_time', time() );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdelete_user_meta( $user_id, self::ID . '_last_active_time' );\n\t\t\t\tupdate_user_meta( $user_id, self::ID . '_last_active_time', time() );\n\t\t\t}\n\t\t}\n\t}",
"public function sess_expire()\n {\n $render_arr = array(\n \"login_entry_url\" => $this->config->item(\"admin_url\") . $this->mod_enc_url['user_login_entry']\n );\n $this->smarty->assign($render_arr);\n $file_name = \"admin_sess_expire_template\";\n $this->set_template($file_name);\n $this->loadView(\"sess_expire\");\n }",
"function checkAuthentication($redirect) {\n global $maxInactiveTime, $loginPage, $authenticated;\n session_start();\n // check the value of the timeout\n if(!isset($_SESSION['timeout']) || $_SESSION['timeout'] + $maxInactiveTime < time()) {\n // expired or new session\n if(!isset($_SESSION['timeout'])) {\n $message = 'In order to view this page you must be authenticated';\n } else {\n $message = 'Your session expired. Please log in again';\n }\n \n session_unset();\n session_destroy();\n if($redirect) {\n // go to login\n goToPage(\"$loginPage?error=$message\");\n die();\n }\n } else {\n // valid session, update the timeout\n $_SESSION['timeout'] = time();\n $authenticated = true;\n }\n}",
"function check_user() {\n $current_user = wp_get_current_user();\n \n if( $current_user->ID ) {\n $last_login = ( isset( $current_user->last_login ) ) ? strtotime( $current_user->last_login ) : 0;\n \n $duration = 24 * 60 * 60; //24hours\n if( (time() - $last_login ) > $duration ) {\n $this->update( $current_user->ID );\n }\n }\n }",
"protected function checkIdleExpire()\r\n {\r\n if ($this->session->isIdled()) {\r\n $this->session->setStatus(Auth::IDLE);\r\n }\r\n \r\n if ($this->session->isExpired()) {\r\n $this->session->setStatus(Auth::EXPIRED);\r\n }\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of cli_historial | public function getCli_historial()
{
return $this->cli_historial;
} | [
"public function commandValue()\n {\n return $this->parseCommand()[1];\n }",
"public function getChatHistId()\n {\n return $this->chat_hist_id;\n }",
"public function getIDHistorial(){\n return $this->ID_Historial;\n }",
"public function getHistoria()\n {\n return $this->historia;\n }",
"public function getHistorico() {\n\t\treturn $this->iCodigoHistorico;\n\t}",
"public function getIdHistoricodedu()\n {\n return $this->id_historicodedu;\n }",
"public function getValorHistorico(){\n return $this->valorHistorico;\n }",
"function getHistorico()\n {\n return $this->sHistorico;\n }",
"public function getHistogramRegisterCmd()\n {\n return $this->readOneof(6);\n }",
"public function getHistogramEntry()\n {\n return $this->histogramEntry;\n }",
"public function getShellArg(): string\n {\n\n return '--3d ' . $this->value;\n\n }",
"public function getHistorial()\n {\n $stmt = Conexion::conectar()->prepare('SELECT *from historiales');\n $stmt->execute();\n }",
"public function getAptbconfeicheckhist()\n {\n return $this->aptbconfeicheckhist;\n }",
"public function getAptbconfmyeclrpohist()\n {\n return $this->aptbconfmyeclrpohist;\n }",
"public function get_historico()\n {\n $historico = [];\n $historico = array_merge($historico, $this->processo->historico);\n $historico = array_merge($historico, $this->captacao->liberacao->historico);\n $historico = array_merge($historico, $this->captacao->historico);\n return $historico;\n }",
"public function getCli() {\n\t\treturn $this->cli;\n\t}",
"public function getCdHistorico()\n {\n return $this->cd_historico;\n }",
"static public function getHistoryInstance()\r\n {\r\n $allInstances = AccountCollection::getHistory();\r\n if((isset($_GET['number']))&&(isset($allInstances[$_GET['number']])))\r\n return $allInstances[$_GET['number']];\r\n else\r\n return $allInstances[0];\r\n }",
"public function getStdOutOfOccCommand() {\n\t\treturn $this->lastStdOut;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a new validToken Indicates whether the token is valid. | public function setValidToken($validToken)
{
$this->validToken = $validToken;
return $this;
} | [
"public function setValid()\n {\n $this->valid = true;\n }",
"private function set_valid(bool $_valid)\n {\n $this->_valid = $_valid;\n }",
"public function setToken();",
"private function setToken()\r\n {\r\n $this->token = $this->response->data->sl_token;\r\n\r\n $this->setTokenExpiryDate();\r\n }",
"public function setToken($token);",
"public function isValid($token);",
"public function tokenIsValid();",
"private function isValidToken()\r\n {\r\n return ($this->token || !$this->isTokenExpired());\r\n }",
"protected function hasValidToken()\n {\n return $this->config->get('authentication.token') && time() < $this->config->get('authentication.expires_at');\n }",
"function setToken($token){\n\t\t\\Clever::setToken(($this->token = $token));\n\t}",
"public function set_token($access_token) {\n\t\tif (is_array($access_token)) {\n\t\t\tif (isset($access_token['access_token'])) {\n\t\t\t\t$this->token = $access_token['access_token'];\n\t\t\t\tif (check_token_validity($access_token) !== true) //TODO: check_token_validity is legacy code\n\t\t\t\t\tcontextual_error_log('FtApiHandler: Warning: token is not valid.');\n\t\t\t\treturn (true);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcontextual_error_log('FtApiHandler: set_token failed: no access token found in array');\n\t\t\t\treturn (false);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$this->token = $access_token;\n\t\t\tif (check_token_validity($access_token) !== true)\n\t\t\t\tcontextual_error_log('FtApiHandler: Warning: token is not valid.');\n\t\t\treturn (true);\n\t\t}\n\t}",
"public function hasValidToken()\n {\n try {\n $oAuthToken = new OAuthToken($this);\n $oAuthToken->refresh(true);\n return true;\n }\n catch (Exception $e) {\n return false;\n }\n }",
"public function testSetToken() : void\n {\n // INIT\n //-----\n\n // Create the user\n $user = new User();\n\n // Add a token\n $user->setToken();\n\n // TEST\n //-----\n\n // Test if token is not null\n $this->assertNotNull(\n $user->getToken(),\n 'Token must be not null when token is set'\n );\n\n // Test if token validity is not null\n $this->assertNull(\n $user->getTokenValidity(),\n 'Token validity must be null when token is set to a new user'\n );\n\n // Test if token is not expired\n $this->assertNotTrue(\n $user->isTokenExpired(),\n 'Token must not be not exipred when token is set'\n );\n }",
"public function setInvalid()\n {\n $this->valid = false;\n }",
"function isTokenValid($token){\n\t\t$tokenObj = new Token();\n\t\t$isValid = ($tokenObj->checkTokenValidity($token))['isTokenValid'];\n\t\treturn $isValid;\n\t}",
"protected function _set_is_valid( $valid )\n {\n static::$is_valid = $valid;\n return static::$is_valid;\n }",
"public function testGetSetToken()\n {\n $this->assertEquals('raw', $this->token->getToken());\n\n $this->token->setToken('foo');\n $this->assertEquals('foo', $this->token->getToken());\n }",
"public function isValidToken() {\n\t\treturn (null !== $this->request && $this->token === $this->request->getToken());\n\t}",
"public function setTokenValidation($tokenValidation) {\n $this->tokenValidation = $tokenValidation;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process a file attachement as follows: 1. Check that the folder and file exist in the 'temp' directory 2. If the file is an image, create a thumbnail 3. move the whole directory in the the 'files' directory | public function process($data = []) {
//path to this directory in the temp folder
$file_path = BASE_DIR . "/storage/temp/" . $data["attachment_directory"] . "/" . $data["attachment_filename"];
$old_dir_path = BASE_DIR . "/storage/temp/" . $data["attachment_directory"];
$new_dir_path = BASE_DIR . "/storage/files/" . $data["attachment_directory"];
$extension = pathinfo($file_path, PATHINFO_EXTENSION);
$thumbname = generateThumbnailName($data["attachment_filename"]); //if its an image
//file extension and file size (human readable)
$data += [
'attachment_extension' => $extension,
'attachment_size' => humanFileSize(filesize($file_path)),
];
//validation: file exists
if (!file_exists($file_path)) {
Log::error("the attachment could not be found", ['process' => '[AttachmentRepository]', 'ref' => config('app.debug_ref'), 'function' => __function__, 'file' => basename(__FILE__), 'line' => __line__, 'path' => __file__, 'path' => $file_path]);
return false;
}
//check if the file is an image
if (is_array(getimagesize($file_path))) {
//data
$data += [
'attachment_type' => 'image',
'attachment_thumbname' => $thumbname,
];
} else {
//data
$data += [
'attachment_type' => 'file',
'attachment_thumbname' => '',
];
}
//move directory
File::moveDirectory($old_dir_path, $new_dir_path, true);
//save to database
$attachment_id = $this->create($data);
} | [
"public function createThumbnail(MOXMAN_Vfs_IFile $file, $localTempFile = null) {\n\t\t$config = $file->getConfig();\n\n\t\t// Thumbnails disabled in config\n\t\tif (!$config->get('thumbnail.enabled')) {\n\t\t\treturn $file;\n\t\t}\n\n\t\t// File is not an image\n\t\tif (!MOXMAN_Media_ImageAlter::canEdit($file)) {\n\t\t\treturn $file;\n\t\t}\n\n\t\t// No write access to parent path\n\t\t$dirFile = $file->getParentFile();\n\t\tif (!$dirFile->canWrite()) {\n\t\t\treturn $file;\n\t\t}\n\n\t\t$thumbnailFolderPath = MOXMAN_Util_PathUtils::combine($file->getParent(), $config->get('thumbnail.folder'));\n\t\t$thumbnailFile = MOXMAN::getFile($thumbnailFolderPath, $config->get('thumbnail.prefix') . $file->getName());\n\n\t\t// Never generate thumbs in thumbs dirs\n\t\tif (basename($file->getParent()) == $config->get('thumbnail.folder')) {\n\t\t\treturn $file;\n\t\t}\n\n\t\t$thumbnailFolderFile = $thumbnailFile->getParentFile();\n\t\tif ($thumbnailFile->exists()) {\n\t\t\tif ($file->isDirectory()) {\n\t\t\t\treturn $file;\n\t\t\t}\n\n\t\t\treturn $thumbnailFile;\n\t\t}\n\n\t\tif (!$thumbnailFolderFile->exists()) {\n\t\t\t$thumbnailFolderFile->mkdir();\n\t\t\t$this->fireThumbnailFileAction(MOXMAN_Vfs_FileActionEventArgs::ADD, $thumbnailFolderFile);\n\t\t}\n\n\t\t// TODO: Maybe implement this inside MOXMAN_Media_ImageAlter\n\t\tif ($file instanceof MOXMAN_Vfs_Local_File) {\n\t\t\tif ($config->get('thumbnail.use_exif') && function_exists(\"exif_thumbnail\") && preg_match('/jpe?g/i', MOXMAN_Util_PathUtils::getExtension($file->getName()))) {\n\t\t\t\t$imageType = null;\n\t\t\t\t$width = 0;\n\t\t\t\t$height = 0;\n\n\t\t\t\ttry {\n\t\t\t\t\t// Silently fail this, hence the @, some exif data can be corrupt.\n\t\t\t\t\t$exifImage = @exif_thumbnail(\n\t\t\t\t\t\t$localTempFile ? $localTempFile : $file->getInternalPath(),\n\t\t\t\t\t\t$width,\n\t\t\t\t\t\t$height,\n\t\t\t\t\t\t$imageType\n\t\t\t\t\t);\n\n\t\t\t\t\tif ($exifImage) {\n\t\t\t\t\t\t$stream = $thumbnailFile->open(MOXMAN_Vfs_IFileStream::WRITE);\n\t\t\t\t\t\t$stream->write($exifImage);\n\t\t\t\t\t\t$stream->close();\n\n\t\t\t\t\t\t$this->fireThumbnailFileAction(MOXMAN_Vfs_FileActionEventArgs::ADD, $thumbnailFile);\n\t\t\t\t\t\treturn $thumbnailFile;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t// Ignore exif failure\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$imageAlter = new MOXMAN_Media_ImageAlter();\n\n\t\tif ($localTempFile) {\n\t\t\t$imageAlter->load($localTempFile);\n\t\t} else {\n\t\t\t$imageAlter->loadFromFile($file);\n\t\t}\n\n\t\t$imageAlter->createThumbnail($config->get('thumbnail.width'), $config->get('thumbnail.height'), $config->get('thumbnail.mode', \"resize\"));\n\t\t$imageAlter->saveToFile($thumbnailFile, $config->get('thumbnail.jpeg_quality'));\n\n\t\t$this->fireThumbnailFileAction(MOXMAN_Vfs_FileActionEventArgs::ADD, $thumbnailFile);\n\n\t\treturn $thumbnailFile;\n\t}",
"function uploadThumbnail($files, $id)\n{\n $target_dir = 'upload/';\n $extention = pathinfo($files['thumbnail'][\"name\"], PATHINFO_EXTENSION);\n move_uploaded_file($files['thumbnail'][\"tmp_name\"], $target_dir . $id[0] . '_0.' . $extention);\n copy(($target_dir . $id[0] . '_0.' . $extention), ($target_dir . $id[0] . '_1.' . $extention));\n}",
"function handle_images($gallery, $source, $file, $extra = NULL)\n { \n global $smfgSettings, $context, $ext, $db_prefix, $boarddir;\n\n if ($source == 0) {\n // Find the extension and generate filename and target directory\n $ext = findexts($file['name']); \n } else if($source == 1) {\n // Find the extension and generate filename and target directory\n $ext = findexts($file['url_image']); \n }\n \n $ran = rand();\n $dir = $boarddir.'/'.$smfgSettings['upload_directory'];\n $attach_filename = $gallery.\"_gallery_\".$ran.\".\".$ext;\n $target = $dir.$attach_filename; \n $processed = $dir.\"cache/\".$attach_filename;\n\n // Makesure the cache dir exists\n if(!is_dir($dir.\"cache\"))\n mkdir($dir.\"cache\");\n\n if ($source == 0) {\n // Move the uploaded file to uploads dir\n move_uploaded_file($file['tmp_name'],$target);\n \n // Generate the thumbnail and assign its attributes.\n make_thumbnail($attach_filename, 0);\n $attach_thumb_filename = $gallery.\"_gallery_\".$ran.\"_thumb.\".$ext;\n $attach_thumb_dimensions = getimagesize($dir.\"cache/\".$attach_thumb_filename);\n if(!$smfgSettings['image_processor']) {\n /* No way to make Thumbs\n Need to force the image size to be the max thumbsize\n And keep it proposionate */\n if ($attach_thumb_dimensions[0] > $attach_thumb_dimensions[1]) {\n $divider = $attach_thumb_dimensions[0] / $smfgSettings['thumbnail_resolution'];\n\n\t\t$attach_thumb_dimensions[0] = $smfgSettings['thumbnail_resolution'];\n $attach_thumb_dimensions[1] = $attach_thumb_dimensions[1] / $divider;\n } else if ($attach_thumb_dimensions[1] > $attach_thumb_dimensions[0]) {\n $divider = $attach_thumb_dimensions[1] / $smfgSettings['thumbnail_resolution'];\n\n\t\t$attach_thumb_dimensions[1] = $smfgSettings['thumbnail_resolution'];\n $attach_thumb_dimensions[0] = $attach_thumb_dimensions[0] / $divider;\n } else {\n\t\t$attach_thumb_dimensions[0] = $smfgSettings['thumbnail_resolution'];\n $attach_thumb_dimensions[1] = $smfgSettings['thumbnail_resolution'];;\n }\n }\n $attach_thumb_width = $attach_thumb_dimensions[0];\n $attach_thumb_height = $attach_thumb_dimensions[1];\n \n // Determine if the file is an image\n $attach_dimensions = getimagesize($processed);\n if($attach_dimensions[2] == 1 || 2 || 3 || 4) $attach_is_image = 1; \n else $attach_is_image = 0; \n \n // Get image filesizes\n $attach_filesize = filesize($processed);\n $attach_thumb_filesize = filesize($dir.\"cache/\".$attach_thumb_filename);\n \n $request = db_query(\"\n INSERT INTO {$db_prefix}garage_images (vehicle_id, attach_location, attach_ext, attach_file, attach_thumb_location, attach_thumb_width, attach_thumb_height, attach_is_image, attach_date, attach_filesize, attach_thumb_filesize, attach_desc) \n VALUES (\".$context['vehicle_id'].\", '\".$attach_filename.\"', '\".$ext.\"', '\". $file['name'].\"', '\".$attach_thumb_filename.\"', \".$attach_thumb_width.\", \".$attach_thumb_height.\", \".$attach_is_image.\", \".$context['date_created'].\", \".$attach_filesize.\", \".$attach_thumb_filesize.\", '\".$extra['attach_desc'].\"')\", __FILE__,__LINE__);\n $context['image_id'] = db_insert_id($request);\n \n // If a remote image was supplied, use it instead \n } else if($source == 1) {\n // Go get the remote image, thumb it and store them\n // then gather some file attributes\n getRemoteImage($file['url_image'],$target);\n // Get image filesize before thumbing, or it will not exist by then! \n $attach_filesize = filesize($target);\n make_thumbnail($attach_filename, $smfgSettings['store_remote_images_locally'], $source);\n $attach_thumb_filename = $gallery.\"_gallery_\".$ran.\"_thumb.\".$ext; \n // Get thumb filesize and dimensions\n $attach_thumb_filesize = filesize($dir.\"cache/\".$attach_thumb_filename); \n $attach_thumb_dimensions = getimagesize($dir.\"cache/\".$attach_thumb_filename);\n if(!$smfgSettings['image_processor']) {\n /* No way to make Thumbs\n Need to force the image size to be the max thumbsize\n And keep it proposionate */\n if ($attach_thumb_dimensions[0] > $attach_thumb_dimensions[1]) {\n $divider = $attach_thumb_dimensions[0] / $smfgSettings['thumbnail_resolution'];\n\n\t\t$attach_thumb_dimensions[0] = $smfgSettings['thumbnail_resolution'];\n $attach_thumb_dimensions[1] = $attach_thumb_dimensions[1] / $divider;\n } else if ($attach_thumb_dimensions[1] > $attach_thumb_dimensions[0]) {\n $divider = $attach_thumb_dimensions[1] / $smfgSettings['thumbnail_resolution'];\n\n\t\t$attach_thumb_dimensions[1] = $smfgSettings['thumbnail_resolution'];\n $attach_thumb_dimensions[0] = $attach_thumb_dimensions[0] / $divider;\n } else {\n\t\t$attach_thumb_dimensions[0] = $smfgSettings['thumbnail_resolution'];\n $attach_thumb_dimensions[1] = $smfgSettings['thumbnail_resolution'];;\n }\n }\n $attach_thumb_width = $attach_thumb_dimensions[0];\n $attach_thumb_height = $attach_thumb_dimensions[1];\n\n // Check if local storage of remote images is enabled\n if($smfgSettings['store_remote_images_locally']) {\n $context['display_as_remote'] = 0;\n $target = $processed;\n } else {\n $context['display_as_remote'] = 1; \n }\n \n // Determine if the file is an image\n $attach_dimensions = getimagesize($target);\n if($attach_dimensions[2] == 1 || 2 || 3 || 4) $attach_is_image = 1; \n else $attach_is_image = 0; \n \n // Prep the URL for query\n $url_image = urlencode($file['url_image']);\n \n $request = db_query(\"\n INSERT INTO {$db_prefix}garage_images (vehicle_id, attach_location, attach_ext, attach_file, attach_thumb_location, attach_thumb_width, attach_thumb_height, attach_is_image, attach_date, attach_filesize, attach_thumb_filesize, attach_desc, is_remote) \n VALUES (\".$context['vehicle_id'].\", '\".$attach_filename.\"', '\".$ext.\"', '\".$url_image.\"', '\".$attach_thumb_filename.\"', \".$attach_thumb_width.\", \".$attach_thumb_height.\", \".$attach_is_image.\", \".$context['date_created'].\", \".$attach_filesize.\", \".$attach_thumb_filesize.\", '\".$file['attach_desc'].\"', \".$context['display_as_remote'].\")\", __FILE__,__LINE__);\n $context['image_id'] = db_insert_id($request); \n }\n }",
"protected function create_thumbnail()\n\t{\n\t\tif ($this->file_data['thumbnail'])\n\t\t{\n\t\t\t$source = $this->file->get('destination_file');\n\t\t\t$destination = $this->file->get('destination_path') . '/thumb_' . $this->file->get('realname');\n\n\t\t\tif (!create_thumbnail($source, $destination, $this->file->get('mimetype')))\n\t\t\t{\n\t\t\t\t$this->file_data['thumbnail'] = 0;\n\t\t\t}\n\t\t}\n\t}",
"public function processFileAttachments()\n {\n if (isset($_FILES['imagedata'])\n && is_uploaded_file($_FILES['imagedata']['tmp_name'])\n && $_FILES['imagedata']['error']==UPLOAD_ERR_OK) {\n global $_UNL_UCBCN;\n $this->imagemime = $_FILES['imagedata']['type'];\n $this->imagedata = file_get_contents($_FILES['imagedata']['tmp_name']);\n }\n }",
"abstract public function process($image, $actions, $dir, $file);",
"protected function _handleThumbnails($x3dDir, $uniqid)\n {\n $thnInfo = new SplFileInfo($_FILES['x3d_texture_file']['name']);\n $thnFile = $x3dDir . DIRECTORY_SEPARATOR . 'or_' . $uniqid . '.' . $thnInfo->getExtension();\n move_uploaded_file($_FILES['x3d_thn_file']['tmp_name'], $thnFile);\n\n $Omeka_File_Derivative_Image_Creator = Zend_Registry::get('file_derivative_creator');\n $Omeka_File_Derivative_Image_Creator->addDerivative('pr', 360, false);\n $Omeka_File_Derivative_Image_Creator->addDerivative('square_thumbnail', 360, true);\n $Omeka_File_Derivative_Image_Creator->create($thnFile, $uniqid . '.' . $thnInfo->getExtension(), 'image/jpeg');\n\n $squareThumbnail = $x3dDir . DIRECTORY_SEPARATOR . 'square_thumbnail_' . $uniqid . '.' . $thnInfo->getExtension();\n if (is_file($squareThumbnail) && is_readable($squareThumbnail)) {\n rename(\n $squareThumbnail,\n $x3dDir . DIRECTORY_SEPARATOR . 'sq_' . $uniqid . '.' . $thnInfo->getExtension()\n );\n }\n return $thnInfo;\n }",
"function internalmail_add_compose_attachment_temp_file($print=0, $filelocation) {\r\n global $CFG;\r\n\r\n //$filelocation = optional_param('attachdir', NULL, PARAM_CLEAN);\r\n $tempfiles_location = $CFG->dataroot . '/temp/internalmail/' . $filelocation;\r\n\r\n // display files\r\n internalmail_add_compose_attachment_temp_display($tempfiles_location, $print);\r\n}",
"function _cf7bdb_add_attachment( $file, $pid )\n{\n $filename = basename($file);\n $testtype = wp_check_filetype_and_ext($file, $filename, null);\n\n // Check if a proper filename was given for in incorrect filename and use it instead\n if( $testtype['proper_filename'] )\n $filename = $testtype['proper_filename'];\n\n if( (!$testtype['type'] || !$testtype['ext']) && !current_user_can( 'unfiltered_upload' ) )\n return __('Sorry, this file type is not permitted for security reasons.');\n\n if( !$testtype['ext'] )\n $testtype['ext'] = ltrim(strrchr($filename, '.'), '.');\n \n // Check if the uploads directory exists/create it. If it fails, the parent directory probably isn't writable.\n if( !($uploads = wp_upload_dir(null)) )\n return $uploads['error'];\n\n // Correct the directory separators, mainly on Windows servers...\n //$uploads['path'] = realpath($uploads['path']);\n \n $filename = wp_unique_filename( $uploads['path'], $filename );\n \n $new_file = $uploads['path'] .'/'. $filename;\n \n // Copy the uploaded file to the correct uploads folder.\n if( false === @copy($file, $new_file) )\n return sprintf(__('The uploaded file could not be moved to %s.'), $uploads['path']);\n\n // Set correct file permissions\n $stat = stat(dirname($new_file));\n $perms = $stat['mode'] & 0000666;\n @chmod( $new_file, $perms );\n \n $attachment = array(\n 'post_mime_type' => $testtype['type'],\n 'post_title' => preg_replace('/\\.[^.]+$/', '', $filename),\n 'post_content' => '',\n 'post_status' => 'inherit',\n );\n // Add the attachment\n $att_id = wp_insert_attachment( $attachment, $new_file, $pid );\n \n // Test for an image and only perform the rest if the upload is an image...\n if( @getimagesize($new_file) !== false )\n {\n require_once ABSPATH .'wp-admin/includes/image.php';\n \n $att_data = wp_generate_attachment_metadata( $att_id, $new_file );\n wp_update_attachment_metadata( $att_id, $att_data );\n }\n return true;\n}",
"function updateAttachmentThumbnail($filename, $id_attach, $id_msg, $old_id_thumb = 0, $real_filename = '')\n{\n\tglobal $modSettings;\n\n\t$attachment = array('id_attach' => $id_attach);\n\n\t// Load our image functions, it will determine which graphics library to use\n\t$image = new Image($filename);\n\n\t// Image is not autorotated because it was at the time of upload (hopefully)\n\t$thumb_filename = (!empty($real_filename) ? $real_filename : $filename) . '_thumb';\n\t$thumb_image = $image->createThumbnail($modSettings['attachmentThumbWidth'], $modSettings['attachmentThumbHeight']);\n\n\tif ($thumb_image instanceof Image)\n\t{\n\t\t// So what folder are we putting this image in?\n\t\t$attachmentsDir = new AttachmentsDirectory($modSettings, database());\n\t\t$id_folder_thumb = $attachmentsDir->currentDirectoryId();\n\n\t\t// Calculate the size of the created thumbnail.\n\t\t$size = $thumb_image->getImageDimensions();\n\t\tlist ($attachment['thumb_width'], $attachment['thumb_height']) = $size;\n\t\t$thumb_size = $thumb_image->getFilesize();\n\n\t\t// Figure out the mime type and other details\n\t\t$thumb_mime = getValidMimeImageType($size[2]);\n\t\t$thumb_ext = substr($thumb_mime, strpos($thumb_mime, '/') + 1);\n\t\t$thumb_hash = getAttachmentFilename($thumb_filename, 0, null, true);\n\n\t\t// Add this beauty to the database.\n\t\t$db = database();\n\t\t$db->insert('',\n\t\t\t'{db_prefix}attachments',\n\t\t\tarray('id_folder' => 'int', 'id_msg' => 'int', 'attachment_type' => 'int', 'filename' => 'string-255', 'file_hash' => 'string-40', 'size' => 'int', 'width' => 'int', 'height' => 'int', 'fileext' => 'string-8', 'mime_type' => 'string-255'),\n\t\t\tarray($id_folder_thumb, $id_msg, 3, $thumb_filename, $thumb_hash, (int) $thumb_size, (int) $attachment['thumb_width'], (int) $attachment['thumb_height'], $thumb_ext, $thumb_mime),\n\t\t\tarray('id_attach')\n\t\t);\n\n\t\t$attachment['id_thumb'] = $db->insert_id('{db_prefix}attachments');\n\t\tif (!empty($attachment['id_thumb']))\n\t\t{\n\t\t\t$db->query('', '\n\t\t\t\tUPDATE {db_prefix}attachments\n\t\t\t\tSET id_thumb = {int:id_thumb}\n\t\t\t\tWHERE id_attach = {int:id_attach}',\n\t\t\t\tarray(\n\t\t\t\t\t'id_thumb' => $attachment['id_thumb'],\n\t\t\t\t\t'id_attach' => $attachment['id_attach'],\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$thumb_realname = getAttachmentFilename($thumb_filename, $attachment['id_thumb'], $id_folder_thumb, false, $thumb_hash);\n\t\t\tif (file_exists($filename . '_thumb'))\n\t\t\t{\n\t\t\t\trename($filename . '_thumb', $thumb_realname);\n\t\t\t}\n\n\t\t\t// Do we need to remove an old thumbnail?\n\t\t\tif (!empty($old_id_thumb))\n\t\t\t{\n\t\t\t\trequire_once(SUBSDIR . '/ManageAttachments.subs.php');\n\t\t\t\tremoveAttachments(array('id_attach' => $old_id_thumb), '', false, false);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $attachment;\n}",
"public function moveFiles()\n {\n $files = $this->filesystem->files($this->upload_folder);\n\n foreach ($files as $file)\n {\n if( substr($this->getFilename($file), 0, 4) !== 'temp')\n {\n $this->filesystem->move($file, $this->final_folder . $this->getFilename($file));\n }\n }\n }",
"function HandleFileUpload($_files, $fileToUpload) {\n /*\n * The file is first stored at $_FILES[$fileToUpload][\"tmp_name\"]\n */\n $target_dir = \"../media/img/\";\n $target_file = $target_dir . basename($_files[$fileToUpload][\"name\"]);\n\n $imgFileType = pathinfo($target_file, PATHINFO_EXTENSION);\n\n echo \"Type : $imgFileType </br>\";\n\n //Get image size\n $imgSize = getimagesize($_files[$fileToUpload][\"tmp_name\"]);\n\n if ( file_exists($target_file) ) {\n echo \"File exists, operation aborted...\";\n } else {\n $ret = move_uploaded_file($_files[$fileToUpload][\"tmp_name\"], $target_file);\n echo \"Ret : $ret <br>\";\n }\n }",
"public function createThumbnail() {\n\t\t$file = $this->getFileNameWithoutExtension($this->storePath); // storepath should be the entire filelength. \n\t\t$target = $this->getFileNameWithoutExtension($this->thumbPath);\n\t\texec(\"{$this->pathToFfmpeg} -i {$file}mp4 -ss 00:00:00.000 -f image2 -vframes 1 {$target}png 2>&1\");\n\t\texec(\"chmod 777 -R {$target}png 2>&1\"); // 2>&1.. \n\t}",
"function flashUploadFile($fileInput) {\n global $CONFIG;\n\n //got from common.php getUploadDirTree\n $rel_path = getUploadDirTree($CONFIG ['flash'] ['uploadPath']);\n $total_path = $CONFIG ['server']['root'] . $rel_path;\n\n $fileInfo = array();\n $fileName = time() . '-' . str_replace(array(' '), array('-'), $_FILES[$fileInput]['name']);\n $fileName = preg_replace('/[^a-z0-9A-Z\\.]/', '-', $fileName);\n $thumb = \"thumb_\" . $fileName;\n $fileSize = round($_FILES[$fileInput]['size'] / 1024);\n $file = $rel_path . basename($fileName);\n\n if (@move_uploaded_file($_FILES[$fileInput]['tmp_name'], $file)) {\n $fileInfo ['filename'] = $fileName;\n $fileInfo ['size'] = $fileSize;\n $fileInfo ['vpath'] = $rel_path;\n $fileInfo ['thumb'] = $thumb;\n\n $fileInfo ['type'] = mime_content_type($file);\n\n if (strstr($fileInfo['type'], 'image') == null) {\n @unlink($file);\n return false;\n }\n mediaRotateImage($file);\n\n $thumbWidth = 190;\n $thumbHeight = 105;\n photoThumbnailCreate($total_path . $fileName, $total_path . $thumb, $thumbWidth, $thumbHeight);\n\n return $fileInfo;\n } else {\n return false;\n }\n}",
"function poster_image_upload($album_slug){\n\n\tglobal $MainContentDirecoty;\n\t$username = get_username();\n\n\t$file = $_FILES[\"poster_image\"]['tmp_name'];\n\tlist($width, $height) = getimagesize($file);\n $file_ext = array('jpg','png','gif','bmp','JPG','jpeg');\n $post_ext = end(explode('.',$_FILES['poster_image']['name']));\n $photo_name = explode(' ', trim(strtolower($_FILES['poster_image']['name'])));\n $photo_name = implode('_', $photo_name);\n $photo_type = $_FILES['poster_image']['type'];\n $photo_size = $_FILES['poster_image']['size'];\n $photo_tmp = $_FILES['poster_image']['tmp_name'];\n $photo_error= $_FILES['poster_image']['error'];\n \n if( in_array($post_ext,$file_ext) && ($photo_error == 0 )){\n \n \t\t$fullpath = $MainContentDirecoty.$album_slug.'/';\n\n \t\t/*directory create*/\n\t\t\tif (!file_exists($fullpath))\n\t\t\t mkdir($fullpath, 0777, true);\n \n $destination = $fullpath.'poster_'.$photo_name;\n if(move_uploaded_file($photo_tmp,$destination)){\n\n \t$log = new Logger(\"logs/contentlog/content\");\n\t \t\t \t$log->logWrite(\"$username|poster|$destination|uploaded\");\n\n\t \t\t \t$_SESSION['alert_message']='Image Uploaded Successfully !!!.';\n return $destination;\n\n }else{\n\n \t$_SESSION['alert_message']='Directory Missing !!!.';\n\t\t\t\treturn 0;\n }\n \n }else{\n\n \t$_SESSION['alert_message']='Something Wrong in image. Please Try again !!!.';\n\t\t\treturn 0;\n }\n\n}",
"function recreateImage($file,$new_filename,$thumbnail = true) {\n\n\t//Set data\n\t\t$result \t\t= false;\n\t\t$tmp_filename \t= basename($file[\"tmp_name\"]);\n\t\t$tmp_src \t\t= _UPLOAD_TMP.'/'.$tmp_filename;\n\t\t$dest \t\t\t= _UPLOAD_TMP.'/'.$new_filename;\n\n\t//Move file from tmp location to my _UPLOAD_TMP folder\n\tif( move_uploaded_file($file[\"tmp_name\"], $tmp_src) ){\n\t\t//Check mime from image\n\t\t$mime = image_type_to_mime_type(exif_imagetype($tmp_src));\n\n\t\t//Select how to recreate it\n\t\tif($mime !== false){\n\t\t\tswitch ($mime) {\n\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t$im = @imagecreatefromgif($tmp_src);\n\t\t\t\t\tif($im !== false){\n\t\t\t\t\t\t$result = imagegif($im, $dest);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \"image/png\":\n\t\t\t\t\t$im = @imagecreatefrompng($tmp_src);\n\t\t\t\t\tif($im !== false){\n\t\t\t\t\t\t//Support transparency\n\t\t\t\t\t\timagesavealpha($im, true);\n\t\t\t\t\t\t$result = imagepng($im, $dest,8.5);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\t$im = @imagecreatefromjpeg($tmp_src);\n\t\t\t\t\tif($im !== false){\n\t\t\t\t\t\t$result = imagejpeg($im, $dest,85);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t//Add Thumbnail, if success\n\t\tif($result && $thumbnail){\n\t\t\tcreateThumbnail($new_filename,$im,$mime);\n\t\t}\n\t\t//Delete tmp/original, correct or not\n\t\tif(file_exists($tmp_src)){\n\t\t\tunlink($tmp_src);\n\t\t}\n\t\treturn $result;\n\t}\n\treturn false;\n}",
"function ProcessOneImage ($filename, $filetype, $tempname, $watermark = false, $overwrite = false, $allowed_reserved_names = false) {\n\tglobal $PHOTOS_GALLERY, $SLIDES, $THUMBNAILS, $MATTED, $FRAMED, $ORIGINALS, $MAILED_DIR;\n\tglobal $PROCESSED_PHOTOS, $PROCESSED_SLIDES, $PROCESSED_THUMBNAILS, $PROCESSED_MATTED, $PROCESSED_FRAMED, $PROCESSED_ORIGINALS;\n\tglobal $BASEDIR, $LOGS;\n\tglobal $msg, $error;\n\t\n\t$DEBUG = 0;\n\t$EMAILMSG = false;\n\t\n\t$DEBUG && $msg .= basename(__FILE__) .\":\".__FUNCTION__ .\": BEGIN (called by \".getCallingFunction().\")<BR>\";\n\t\n\t$result = false;\n\n\t$DEBUG && fp_error_log(__FUNCTION__.\": $filename\", 3, FP_PICTURES_LOG);\n\tif (!$filename) {\n\t\tfp_error_log(__FUNCTION__.\": *** Oops! No filename given! Called by \".getCallingFunction(), 3, FP_PICTURES_LOG);\n\t\treturn false;\n\t}\n\t\t\n\t// If we are already processing this file, don't try to do it again!\n\tif (is_processing_image ($filename)) {\n\t\tfp_error_log(__FUNCTION__.\": Oops, attempt to process '$filename' when it is already being processed!\", 3, FP_PICTURES_LOG);\n\t\treturn ;\n\t} else {\t\n\t\tset_lock_for_file ($filename);\n\t}\n\t\n\t$starttime = microtime(true);\n\n\t$fileinfo = array();\n\t\n\tif ($filetype != \"image/jpeg\") {\n\t\treturn array ('error' => \"Image is not JPEG\");\n\t}\n\n\t// Check size of image: keep within config bounds\n\t\n\t$imgsize = GetLocalImageSize($tempname);\n\t$width = $imgsize[0];\n\t$height = $imgsize[1];\n\t$DEBUG && $msg .= basename(__FILE__) .\":\".__FUNCTION__ .\":\".__LINE__ . \": MAXPIXELS = \". MAXPIXELS.\"<BR>\".ArrayToTable ($imgsize);\n\tif (($width * $height) > MAXPIXELS) {\n\t\tfp_error_log(__FUNCTION__.\":\".__LINE__.\": Cannot process this image: The image size is $width x $height = \". ($width * $height).\", but this system can only handle pictures up to \".MAXPIXELS.\" in size.<BR>\", 3, FP_PICTURES_LOG);\n\t\t$error .= \"Cannot process this image: The image size is $width x $height = \". ($width * $height).\", but this system can only handle pictures up to \".MAXPIXELS.\" in size.<BR>\";\n\t\tunlinkb ($tempname);\n\t\treturn array ();\n\t}\n\t\n\t// New resized pix will be in the processed directories, awaiting creation of new database entry.\n\t// If exists file with same name, rename as filename-1, or -2 if -1 exists, etc.\n\t\n\t// clean up evil characters in name\n\t$newname = basename ($filename);\n\t$newname = preg_replace ('/(\\$|\\!|\\ |\\=|\\&|\\?|\\!|\\\"|\\'|\\@|\\#|\\\\|\\%|\\^|\\&|\\*)+/', \"_\", $newname);\n\t$newname = preg_replace ('/_-/', \"-\", $newname);\n\t$DEBUG && $msg .= __FUNCTION__.__LINE__.\": Original pic name: $filename<BR>New name: $newname<BR>\";\n\t\n\t// Make sure name isn't a reserved name, like \"missing_image\" or \"artist_portrait...\"\n\t$allowed_reserved_names || $newname = FixNameIfReserved ($newname);\n\t$DEBUG && $msg .= __FUNCTION__.__LINE__.\": Original pic name: $filename<BR>New name: $newname<BR>\";\n\t\n\t// Make sure won't overwrite existing IF overwrite flag not set\n\t// Check existing AND processed pix for existing names\n\tif (!$overwrite) {\n\t\t$newname = UniqueFilename (\"$BASEDIR/$PROCESSED_ORIGINALS\",$newname);\n\t\t$newname = UniqueFilename (\"$BASEDIR/$ORIGINALS\",$newname);\n\t}\n\t$newpath = \"$BASEDIR/$PROCESSED_ORIGINALS/$newname\";\n\n\t$DEBUG && $msg .= __FUNCTION__ .\":\".__LINE__ . \": tempname = $tempname<BR>\";\n\t$DEBUG && (file_exists ($tempname) && $msg .= __FUNCTION__ .\":\".__LINE__ . \": tempname exists<BR>\");\n\t$DEBUG && $msg .= __FUNCTION__ .\":\".__LINE__ . \": copy $tempname --> $newpath<BR>\";\n\t\n\tif (file_exists ($tempname) && !empty($newname) && copy ($tempname, $newpath)) {\n\t\tunlinkb ($tempname);\n\t\tchmod ($newpath, 0644);\n\n\t\t// If there's an accompanying info file, copy it, too\n\t\t// JPG ONLY! Generalize for any extension, later...\n\t\t$infoTempFilename = str_ireplace(\".jpg\",\".txt\",basename($tempname));\n\t\t$tempInfoPath = dirname($tempname).\"/\".$infoTempFilename;\n\t\t$newInfoFilename = str_ireplace(\".jpg\",\".txt\",$newname);\n\t\t$newInfoPath = dirname($newpath).\"/\".$newInfoFilename;\n\t\tif (file_exists ($tempInfoPath) && !empty($infoTempFilename) && copy ($tempInfoPath, $newInfoPath)) {\n\t\t unlinkb ($tempInfoPath);\n\t\t}\n\n\t\t// Lock the file against further processing \n\t\t// I don't think this is necessary...once it's moved here, nothing else will try to touch it.\n\t} else {\n\t\tfp_error_log(__FUNCTION__.\":\".__LINE__.\": Could not copy file from \\r$tempname\\r to \\r$newpath\\r (check permissions? All photo directories must be 755!)<BR>\", 3, FP_PICTURES_LOG);\n\t}\n\n\t$DEBUG && fp_error_log(__FUNCTION__.__LINE__.\": Resize $newname\", 3, FP_PICTURES_LOG);\n\t$DEBUG && $msg .= __FUNCTION__.__LINE__.\": Original pic name: $filename<BR>New name: $newname<BR>\";\n\tif (file_exists ($newpath)) {\n\t\t$result = ResizeNewImages ($newpath, $newname, $watermark);\n\t\t// Remember the original name\n\t\t$fileinfo['fp_filename'] = basename($newname);\n\t\t$result = $fileinfo;\n\t} else {\n\t\t$result = false;\n\t}\n\n\t!$result && fp_error_log(__FUNCTION__.__LINE__.\": *** Processing failed.\", 3, FP_PICTURES_LOG);\n\n\tclear_lock_for_file ($filename);\t\n\tfp_error_log(__FUNCTION__.__LINE__.\": Processing $filename took \".round (microtime(true) - $starttime, 2). \" seconds.\", 3, FP_PICTURES_LOG);\n\treturn $result;\n}",
"public function onFileAction(MOXMAN_Vfs_FileActionEventArgs $args) {\n\t\tif (isset($args->getData()->thumb)) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch ($args->getAction()) {\n\t\t\tcase MOXMAN_Vfs_FileActionEventArgs::DELETE:\n\t\t\t\t$this->deleteThumbnail($args->getFile());\n\t\t\t\tbreak;\n\n\t\t\tcase MOXMAN_Vfs_FileActionEventArgs::COPY:\n\t\t\t\t$this->copyThumbnail($args->getFile(), $args->getTargetFile());\n\t\t\t\tbreak;\n\n\t\t\tcase MOXMAN_Vfs_FileActionEventArgs::MOVE:\n\t\t\t\t$this->moveThumbnail($args->getFile(), $args->getTargetFile());\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function uploadFile( $filename = '', $upload_dir = '', $strict = false, $thumbnail = array( 0 => false, 'width' => 64,'height' => 64), $filetype = '' )\n\t{\n\t\tif ( !empty($filename) ) $this->file_name = $filename;\n\t\t\n\t\tif ( !empty($upload_dir) )\n\t\t{ \n\t\t\tif ( !$this->setUploadDir( $upload_dir ) ) return false;\n\t\t}\n\t\t\n\t\tif ( !empty($filetype) ) $this->filetype = $filetype;\n\t\t\n\t\t$target = $this->upload_dir.$this->file_name;\n\t\t\n\t\tif ( !move_uploaded_file($this->file_resource['tmp_name'], $target) )\n\t\t{\n\t\t\t$this->errorHandler( array('File upload failed', 500) );\n\t\t\treturn false;\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( 'image' == $this->file_type )\n\t\t\t{\n\t\t\t\tif ( !getimagesize($target) )\n\t\t\t\t{\n\t\t\t\t\t$this->errorHandler( array('Image failed integrity test.', 501) );\n\t\t\t\t\tunlink( $target );\n\t\t\t\t\treturn false;\t\n\t\t\t\t}\n\t\t\t\telse if ( $thumbnail[0] ) $target = $this->uploadResized($target, $thumbnail['width'], $thumbnail['height']);\n\t\t\t\telse if ( $strict ) \n\t\t\t\t{\n\t\t\t\t\tlist($width, $height) = getimagesize($target);\n\t\t\t\t\t$target = $this->uploadResized($target, $width, $height);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( !$target ) return false;\n\t\telse return array( 'filename' => $this->file_name, 'filepath' => $target );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create an array of room number of VIP room | function createArrayType1()
{
for ($floors = 0; $floors < 10; $floors++) {
$rooms[$floors] = ($floors+1) . "13";
}
return $rooms;
} | [
"function roomCount() {\n $rooms = rand(5, 12);\n\n return $rooms;\n}",
"function members($room) {\n $members = array();\n foreach (range(1, 10) as $id) {\n $members[] = array(\n 'id' => 'uid' . $id,\n 'uid' => 'uid' . $id,\n 'nick' => 'user'.$id\n ); \n }\n return $members;\n }",
"function totalRooms(){\n\t\t$totalRooms = array(''=>'Please Select Total Rooms');\n\t\tfor($i=1;$i<=10;$i++){\n\t\t\t$totalRooms[$i] = $i;\n\t\t}\n\t\treturn $totalRooms;\n\t}",
"function parseNumberOfRooms()\n {\n //check for numbers less than 8, this should be the number of rooms\n foreach ($this->_Number_Array as $No) {\n if (in_array($No, $this->_Search_Array)) {\n //set the number of rooms\n $this->_Bedroom_Number = $No;\n }\n } \n }",
"public function get_rooms(){\n\t\t$final_rows = array();\n\t\t$rooms = Rooms::where('type', '!=', 'home')->get();\n\t\t\n\t\tforeach($rooms as $room){\n\t\t\t$logged_count = Users::where('chat_room', '=', $room->id)->count();\n\t\t\t$final_rows = array_add($final_rows, $room->id, array('id'=>$room->id, 'room_name'=>$room->room_name, 'logged_count'=>$logged_count, 'access'=>$room->type));\n\t\t}\n\t\t\n\t\treturn $final_rows;\n\t}",
"public function getAllRoomIds() {\r\n\t\t$resRoomIds = $this->ilDB->query('SELECT id FROM ' . dbc::ROOMS_TABLE . ' WHERE pool_id = ' . $this->ilDB->quote($this->pool_id, 'integer'));\r\n\t\t$room_ids = array();\r\n\t\twhile ($row = $this->ilDB->fetchAssoc($resRoomIds)) {\r\n\t\t\t$room_ids[] = $row['id'];\r\n\t\t}\r\n\r\n\t\treturn $room_ids;\r\n\t}",
"function City_Distribution_Room_Info($n,$room)\n {\n return\n array\n (\n //array(\"\",$this->City_Distribution_Room_Title($room)),\n // $this->City_Distribution_Room_Titles($n,$room),\n $this->City_Distribution_Room_Row($n,$room),\n );\n }",
"public function members($room) {\n //TODO: DEMO CODE\n return array_map( array($this, '_member'), range(1, 10) );\n }",
"private function getCboRooms($rooms) {\n \n $nt = new stdClass();\n\n $nt->id = 0;\n $nt->organization = \"Visas organizācijas\";\n $nt->title = \"Visas telpas\";\n \n array_push($rooms, $nt);\n return $rooms;\n }",
"function getGuestCapacityArr()\n{\n\t$RoomTypeArr=array();\n\t$con=new dbcon;\n\t$sql=\"select guest_capacity_id,guest_capacity_range from \".DBPREFIX.\"guest_capacity \";\n\t$con->Query($sql);\n\twhile($rs=$con->FetchRow())\n\t{\n\t\t$RoomTypeArr[$rs[\"guest_capacity_id\"]]=$rs[\"guest_capacity_range\"];\n\t}\n\treturn $RoomTypeArr;\n}",
"public function getRooms();",
"public function getNumberRooms(){\n return count($this->arRooms);\n }",
"public function getRoomInfo(){\r\n $tempinfo = $this->roomResource;\r\n foreach ($tempinfo as $key => $value) {\r\n if($value[2]!==NULL){\r\n $tempinfo[$key][4] = true;\r\n }\r\n if($value[0]!==NULL){\r\n $tempinfo[$key][0] = $value[0]->username;\r\n $tempinfo[$key][2] = $value[0]->readyStatus;\r\n }\r\n if($value[1]!==NULL){\r\n $tempinfo[$key][1] = $value[1]->username;\r\n $tempinfo[$key][3] = $value[1]->readyStatus;\r\n }\r\n }\r\n return $tempinfo;\r\n }",
"function getValidRooms($type){\n if (1 == $type) {\n $validRooms = createArrayType1();\n } elseif (2 == $type) {\n $validRooms = createArrayType2();\n } elseif (3 == $type) {\n $validRooms = createArrayType3();\n } else {\n $validRooms = createArrayType4();\n }\n return $validRooms;\n }",
"function Rooms()\n {\n if (empty($this->Rooms))\n {\n $this->Rooms=\n $this->RoomsObj()->Sql_Select_Hashes\n (\n array\n (\n \"Unit\" => $this->Unit(\"ID\"),\n \"Event\" => $this->Event(\"ID\"),\n )\n );\n }\n\n return $this->Rooms;\n }",
"function loadRoomIds(){\n\t$conn = dbConnect();\n\t$sql = \"select id,room_name from mrbs_room\";\n \t$res = $conn->query($sql);\n\t$roomIds = array();\n\twhile($row = mysqli_fetch_array($res)){\n\t\t$roomIds[$row[1]] = $row[0];\n\t\t// echo $row[1].\" - \".$row[0].\"<br>\";\n\t}\n\t$conn->close();\n\treturn $roomIds;\n}",
"function TimesRoomsInitTopology($date,$times,$rooms)\n {\n $this->Topology=array();\n foreach ($times as $id => $time)\n {\n $timeid=$time[ \"ID\" ];\n\n if ($time[ \"Type\" ]==2)\n {\n $this->Topology[ $timeid ]=array();\n continue;\n }\n \n $row=array();\n foreach ($rooms as $room)\n {\n $roomid=$room[ \"ID\" ];\n \n $submission=0;\n if (!empty($this->Schedules[ $timeid ][ $roomid ]))\n {\n $submission=$this->Schedules[ $timeid ][ $roomid ][ \"Submission\" ];\n }\n \n $row[ $roomid ]=\n array\n (\n \"ID\" => $submission,\n \"Count\" => 1,\n );\n }\n\n $this->Topology[ $timeid ]=$row;\n }\n }",
"public function livingRooms() : int\n {\n return $this->get('livingRooms');\n }",
"public function getRoomInfoListCount()\n {\n return $this->count(self::ROOMINFOLIST);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an Acumulus model. | protected function getModel(): AcumulusModelAcumulus
{
if (!isset($this->model)) {
/**
* @noinspection PhpDeprecationInspection : Get the model through
* the MVCFactory instead.
* @noinspection PhpFieldAssignmentTypeMismatchInspection
*/
$this->model = BaseDatabaseModel::getInstance('Acumulus', 'AcumulusModel');
}
return $this->model;
} | [
"public function getAfraModel()\n {\n return $this->_aframark;\n }",
"public function model()\n {\n return $this;\n }",
"public function model()\n {\n $model = $this->_app['config']->get('auth.model');\n\n return $this->_obj_provider->getObject( $model );\n\n }",
"public function getApmodel()\n\t{\n\t\treturn $this->apmodel;\n\t}",
"public static function model() {\n return parent::model(get_called_class());\n }",
"public function getAprioriModel()\n {\n return $this->aprioriModel;\n }",
"public static function get_model($model = NULL)\n\t\t{\n\t\t\t$acf_model = NULL;\n\t\t\t// determine if using ACF or ACF Pro and instantiate appropriate model\n\t\t\tif (SyncACFModelInterface::MODEL_ID_ACF_PRO === $model || (NULL === $model && self::_is_acf_pro())) {\n\t\t\t\tWPSiteSync_ACF::get_instance()->load_class('acfpromodel');\n\t\t\t\t$acf_model = new SyncACFProModel();\n// TODO: remove this when SyncACFProModel is implemented\n$acf_model = NULL;\n\t\t\t} else if (SyncACFModelInterface::MODEL_ID_ACF_590 === $model || (NULL === $model && self::_is_acf_590())) {\n\t\t\t\tWPSiteSync_ACF::get_instance()->load_class('acf590model');\n\t\t\t\t$acf_model = new SyncACF590Model();\n\t\t\t} else if (SyncACFModelInterface::MODEL_ID_ACF === $model || (NULL === $model && !self::_is_acf_pro())) {\n\t\t\t\tWPSiteSync_ACF::get_instance()->load_class('acfmodel');\n\t\t\t\t$acf_model = new SyncACFModel();\n\t\t\t}\n\nSyncDebug::log(__METHOD__.'():' . __LINE__ . ' returning instance of: ' . get_class($acf_model));\n\t\t\treturn $acf_model;\n\t\t}",
"public function getRecord(): Model;",
"public function apparelModel() { return $this->apparelModel; }",
"public function get_model(){\n return $this->ui_model->get_model();\n }",
"public static function getDrumModel() {\n if (self::$_instance == NULL) {\n self::$_instance = new DrumModel();\n }\n return self::$_instance;\n }",
"abstract public function getPrimaryModel();",
"private function getOwnerModel(): Model\n {\n $ownerModel = new OwnerModel();\n $requestDatas = json_decode(file_get_contents('php://input'), true);\n if (isset($requestDatas['dataset']) && !empty($requestDatas['dataset'])) {\n $addressModel = new AddressModel();\n $addressModel->id = $requestDatas['dataset']['address']['id'] ?? null;\n $addressModel->street = $requestDatas['dataset']['address']['street'] ?? '';\n $addressModel->houseNo = $requestDatas['dataset']['address']['houseNo'] ?? '';\n $addressModel->zipCode = $requestDatas['dataset']['address']['zipCode'] ?? '';\n $addressModel->city = $requestDatas['dataset']['address']['city'] ?? '';\n $addressModel->country = $requestDatas['dataset']['address']['country'] ?? '';\n\n $ownerModel = new OwnerController();\n $ownerModel->id = $requestDatas['dataset']['id'] ?? null;\n $ownerModel->name = $requestDatas['dataset']['name'] ?? '';\n $ownerModel->address = $addressModel;\n }\n\n return $ownerModel;\n }",
"public function getAutomlModel()\n {\n return $this->readOneof(2);\n }",
"public function getIntermediateModel(){ }",
"public static function &get() {\n\t\tif (DataModel::$model == null) {\n\t\t\tDataModel::$model = new DataModel();\n\t\t\t$model = &DataModel::$model;\n\t\t\t$components = PNApplication::sortComponentsByDependencies();\n\t\t\t// TODO better for prod version, but data model can include sub files....\n\t\t\tforeach ($components as $c) {\n\t\t\t\t$file = \"component/\".$c->name.\"/datamodel.inc\";\n\t\t\t\tif (file_exists($file))\n\t\t\t\t\tinclude $file;\n\t\t\t}\n\t\t\tforeach ($components as $c) {\n\t\t\t\t$file = \"component/\".$c->name.\"/datamodel_delay.inc\";\n\t\t\t\tif (file_exists($file))\n\t\t\t\t\tinclude $file;\n\t\t\t}\n\t\t\tforeach ($components as $c) {\n\t\t\t\t$file = \"component/\".$c->name.\"/datamodel_display.inc\";\n\t\t\t\tif (file_exists($file))\n\t\t\t\t\tinclude $file;\n\t\t\t}\n#DEV\n\t\t\tforeach ($model->internalGetTables(true) as $table) {\n\t\t\t\tif ($table->getPrimaryKey() <> null) continue;\n\t\t\t\t$key = $table->getKey();\n\t\t\t\tif ($key == null || count($key) == 0) PNApplication::error(\"Invalid datamodel: table \".$table->getName().\" does not have a key\");\n\t\t\t}\n#END\n\t\t}\n\t\treturn DataModel::$model;\n\t}",
"public static function getAccountModel() {\n if (self::$_instance == NULL) {\n self::$_instance = new AccountModel();\n }\n return self::$_instance;\n }",
"public static function getAccountModel() {\r\n if (self::$_instance == NULL) {\r\n self::$_instance = new AccountModel();\r\n }\r\n return self::$_instance;\r\n }",
"public function getCurrentAnalyticModel()\n {\n $serviceRoute = $this->requestStack->getCurrentRequest()->get('service');\n\n // Locate the model definition\n return $this->getAnalyticModel($serviceRoute);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query by a related SuperAdmin object | public function filterBySuperAdmin($superAdmin, $comparison = null)
{
if ($superAdmin instanceof SuperAdmin) {
return $this
->addUsingAlias(UserPeer::ID, $superAdmin->getUserId(), $comparison);
} elseif ($superAdmin instanceof PropelObjectCollection) {
return $this
->useSuperAdminQuery()
->filterByPrimaryKeys($superAdmin->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterBySuperAdmin() only accepts arguments of type SuperAdmin or PropelCollection');
}
} | [
"public function filter()\n {\n $this->items->filter([$this->filter, 'viewable']);\n }",
"public function _admin_filters()\n {\n }",
"private function _applyEditableParam()\n {\n if ($this->editable) {\n // Limit the query to only the global sets the user has permission to edit\n $editableSetIds = Craft::$app->getGlobals()->getEditableSetIds();\n $this->subQuery->andWhere(['elements.id' => $editableSetIds]);\n }\n }",
"public function isIncludedInSupertypeQuery();",
"public function getAdmin(): Query\n {\n return $this->admin;\n }",
"public function searchByAdminId($fk_admin)\n {\n $select = $this->select()->setIntegrityCheck(false)\n ->from(DbTable_Admin_Permission::_tableName, null)\n ->join(\n DbTable_Admin_Privilege::_tableName,\n sprintf('%s=%s', DbTable_Admin_Permission::COL_FK_ADMIN_PRIVILEGE, DbTable_Admin_Privilege::COL_ADMIN_PRIVILEGE_ID),\n array(\n DbTable_Admin_Privilege::COL_ADMIN_PRIVILEGE_ID,\n DbTable_Admin_Privilege::COL_ADMIN_PRIVILEGE_NAME,\n DbTable_Admin_Privilege::COL_ADMIN_PRIVILEGE_ACTION,\n DbTable_Admin_Privilege::COL_ADMIN_PRIVILEGE_DISPLAY\n )\n )\n ->join(\n DbTable_Admin_Resource::_tableName,\n sprintf('%s=%s', DbTable_Admin_Privilege::COL_FK_ADMIN_RESOURCE, DbTable_Admin_Resource::COL_ADMIN_RESOURCE_ID),\n array(\n DbTable_Admin_Resource::COL_ADMIN_RESOURCE_DISPLAY,\n DbTable_Admin_Resource::COL_ADMIN_RESOURCE_NAME,\n DbTable_Admin_Resource::COL_ADMIN_RESOURCE_CONTROLLER\n )\n )\n ->join(\n DbTable_Admin_Module::_tableName,\n sprintf('%s=%s', DbTable_Admin_Resource::COL_FK_ADMIN_MODULE, DbTable_Admin_Module::COL_ADMIN_MODULE_ID),\n array(\n DbTable_Admin_Module::COL_FK_ADMIN_COMPONENT,\n DbTable_Admin_Module::COL_ADMIN_MODULE_NAME,\n DbTable_Admin_Module::COL_ADMIN_MODULE_ID\n )\n )\n ->where(DbTable_Admin_Permission::COL_FK_ADMIN . '=?', intval($fk_admin))\n ->where(DbTable_Admin_Resource::COL_ADMIN_RESOURCE_ACTIVE . '=?', Application_Constant_Db_Config_Active::ACTIVE)\n ->where(DbTable_Admin_Privilege::COL_ADMIN_PRIVILEGE_ACTIVE . '=?', Application_Constant_Db_Config_Active::ACTIVE)\n ->order(DbTable_Admin_Module::COL_ADMIN_MODULE_PRIORITY . ' DESC')\n ->order(DbTable_Admin_Resource::COL_ADMIN_RESOURCE_PRIORITY . ' DESC')\n ->order(DbTable_Admin_Privilege::COL_ADMIN_PRIVILEGE_PRIORITY . ' DESC')\n ;\n return $this->fetchAll($select);\n }",
"function filterByOwner($user_id);",
"function views_filter(&$query, $base_table = '', $relationship = ''){\n switch ($base_table) {\n case 'og_membership' :\n if (!isset($query->space_og_proccessed)) {\n //Add our view arguments to the first where group\n $where_group = key($query->where);\n $query->space_og_proccessed = 1;\n }\n else {\n // If using multiple spaces_current_space we need to OR them together\n $query->set_group_operator('OR');\n $where_group = $query->set_where_group('AND');\n }\n\n // Ensure that the og_membership relationship was added\n $table = $query->ensure_table('og_membership', $relationship);\n if ($table) {\n\n // Add og_membership relationship parameters\n $query->add_where($where_group, $table . '.gid', $this->og->nid, '=');\n $query->add_where($where_group, $table . '.group_type', $this->group_type, '=');\n }\n break;\n }\n }",
"function query() {\n $this->query->add_filter($this);\n }",
"public function filterOwnedOrManaged();",
"public function addVisibleFilter()\n {\n return $this->addFieldToFilter('additional_table.is_visible', 1);\n }",
"public function isVisibleInAdminList();",
"function searchfilter($query) {\n \n if ($query->is_search && !is_admin() ) {\n $query->set('post_type',array('post', 'product'));\n }\n \n return $query;\n }",
"protected function addFilterByRelation($relation)\n {\n $entity = $this->getEntity();\n// $queryClass = $this->getQueryClassName();\n $foreignEntity = $relation->getForeignEntity();\n\n// $foreignBuilder = $this->getObjectClassName();\n $fkStubObjectBuilder = $this->getBuilder()->getNewObjectBuilder($foreignEntity);\n $this->getDefinition()->declareUse($fkStubObjectBuilder->getFullClassName());\n\n $fkPhpName = '\\\\' . $this->getClassNameFromBuilder($fkStubObjectBuilder, true);\n $relationName = $this->getRelationPhpName($relation);\n $objectName = '$' . $foreignEntity->getCamelCaseName();\n\n $description = \"Filter the query by a related $fkPhpName object.\";\n\n $body = \"\nif ($objectName instanceof $fkPhpName) {\n return \\$this\";\n foreach ($relation->getFieldObjectsMapArray() as $map) {\n list ($localColumnObject, $foreignColumnObject) = $map;\n $body .= \"\n ->addUsingAlias(\" . $localColumnObject->getFQConstantName() . \", \" . $objectName . \"->get\" . $foreignColumnObject->getName() . \"(), \\$comparison)\";\n }\n $body .= \";\";\n if (!$relation->isComposite()) {\n $localColumnConstant = $relation->getLocalField()->getFQConstantName();\n $foreignColumnName = $relation->getForeignField()->getName();\n $keyColumn = $relation->getForeignEntity()->hasCompositePrimaryKey() ? $foreignColumnName : 'PrimaryKey';\n $body .= \"\n} elseif ($objectName instanceof ObjectCollection) {\n if (null === \\$comparison) {\n \\$comparison = Criteria::IN;\n }\n\n return \\$this\n ->addUsingAlias($localColumnConstant, {$objectName}->toKeyValue('$keyColumn', '$foreignColumnName'), \\$comparison);\";\n}\n $body .= \"\n} else {\";\n if ($relation->isComposite()) {\n $body .= \"\n throw new PropelException('filterBy$relationName() only accepts arguments of type $fkPhpName');\";\n } else {\n $body .= \"\n throw new PropelException('filterBy$relationName() only accepts arguments of type $fkPhpName or Collection');\";\n }\n $body .= \"\n}\n\";\n\n $methodName = \"filterBy$relationName\";\n $variableParameter = new PhpParameter($foreignEntity->getCamelCaseName());\n\n if ($relation->isComposite()) {\n $variableParameter->setType($fkPhpName);\n $variableParameter->setTypeDescription(\"The related object to use as filter\");\n } else {\n $variableParameter->setType(\"$fkPhpName|ObjectCollection\");\n $variableParameter->setTypeDescription(\"The related object(s) to use as filter\");\n }\n\n $this->addMethod($methodName)\n ->addParameter($variableParameter)\n ->addSimpleDescParameter('comparison', 'string', 'Operator to use for the column comparison, defaults to Criteria::EQUAL', null)\n ->setDescription($description)\n ->setType(\"\\$this|\" . $this->getQueryClassName())\n ->setTypeDescription(\"The current query, for fluid interface\")\n ->setBody($body);\n\n }",
"public function allButAdmin();",
"public function addInCmsPageFilter()\n {\n return $this->getSelect()->where('main_table.in_cms_page = 1');\n }",
"public function scopeAdmin($query)\n {\n return $query->where('admin', true);\n }",
"public function scopeAdmin($query)\n\t{\n\t\treturn $query->where('name','=','admin');\n\t}",
"public function getFilterQueries(){}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation restElasticSyncSyncSyncIdPutWithHttpInfo Update a sync. | public function restElasticSyncSyncSyncIdPutWithHttpInfo($sync_id)
{
$request = $this->restElasticSyncSyncSyncIdPutRequest($sync_id);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
$e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
$responseBody = $response->getBody();
switch($statusCode) {
case 200:
if ('\OpenAPI\Client\Model\ElasticSyncSync' === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ElasticSyncSync', []),
$response->getStatusCode(),
$response->getHeaders()
];
}
$returnType = '\OpenAPI\Client\Model\ElasticSyncSync';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\OpenAPI\Client\Model\ElasticSyncSync',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"public function restElasticSyncSyncSyncIdOptionsPutAsyncWithHttpInfo($sync_id)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\ElasticSyncSync';\n $request = $this->restElasticSyncSyncSyncIdOptionsPutRequest($sync_id);\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 = (string) $responseBody;\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 restElasticSyncSyncSyncIdPut($sync_id)\n {\n list($response) = $this->restElasticSyncSyncSyncIdPutWithHttpInfo($sync_id);\n return $response;\n }",
"protected function restElasticSyncSyncSyncIdMatchesPutRequest($sync_id)\n {\n // verify the required parameter 'sync_id' is set\n if ($sync_id === null || (is_array($sync_id) && count($sync_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $sync_id when calling restElasticSyncSyncSyncIdMatchesPut'\n );\n }\n\n $resourcePath = '/rest/elastic-sync/sync/{syncId}/matches';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($sync_id !== null) {\n $resourcePath = str_replace(\n '{' . 'syncId' . '}',\n ObjectSerializer::toPathValue($sync_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function restElasticSyncSyncSyncIdMatchingPostAsyncWithHttpInfo($sync_id)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\ElasticSyncMatching';\n $request = $this->restElasticSyncSyncSyncIdMatchingPostRequest($sync_id);\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 = (string) $responseBody;\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 }",
"protected function restElasticSyncSyncSyncIdOptionsPutRequest($sync_id)\n {\n // verify the required parameter 'sync_id' is set\n if ($sync_id === null || (is_array($sync_id) && count($sync_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $sync_id when calling restElasticSyncSyncSyncIdOptionsPut'\n );\n }\n\n $resourcePath = '/rest/elastic-sync/sync/{syncId}/options';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($sync_id !== null) {\n $resourcePath = str_replace(\n '{' . 'syncId' . '}',\n ObjectSerializer::toPathValue($sync_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function restElasticSyncSyncSyncIdMatchesPostAsyncWithHttpInfo($sync_id)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\ElasticSyncMatching';\n $request = $this->restElasticSyncSyncSyncIdMatchesPostRequest($sync_id);\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 = (string) $responseBody;\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 ordersV2PutAsyncWithHttpInfo($id2, $amount, $customer_id, $currency_code, $created_utc, $vat_amount, $roundings_amount, $delivered_amount, $delivered_vat_amount, $delivered_roundings_amount, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $your_reference, $our_reference, $invoice_address1, $invoice_address2, $invoice_city, $invoice_country_code, $invoice_customer_name, $invoice_postal_code, $delivery_method_name, $delivery_method_code, $delivery_term_name, $delivery_term_code, $eu_third_party, $customer_is_private_person, $order_date, $status, $number, $modified_utc, $delivery_date, $house_work_amount, $house_work_automatic_distribution, $house_work_corporate_identity_number, $house_work_property_name, $rows, $shipped_date_time, $rot_reduced_invoicing_type, $rot_property_type, $persons, $reverse_charge_on_construction_services, $uses_green_technology, $id)\n {\n $returnType = 'object';\n $request = $this->ordersV2PutRequest($id2, $amount, $customer_id, $currency_code, $created_utc, $vat_amount, $roundings_amount, $delivered_amount, $delivered_vat_amount, $delivered_roundings_amount, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $your_reference, $our_reference, $invoice_address1, $invoice_address2, $invoice_city, $invoice_country_code, $invoice_customer_name, $invoice_postal_code, $delivery_method_name, $delivery_method_code, $delivery_term_name, $delivery_term_code, $eu_third_party, $customer_is_private_person, $order_date, $status, $number, $modified_utc, $delivery_date, $house_work_amount, $house_work_automatic_distribution, $house_work_corporate_identity_number, $house_work_property_name, $rows, $shipped_date_time, $rot_reduced_invoicing_type, $rot_property_type, $persons, $reverse_charge_on_construction_services, $uses_green_technology, $id);\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 restElasticSyncSyncPostWithHttpInfo()\n {\n $request = $this->restElasticSyncSyncPostRequest();\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() ? (string) $e->getResponse()->getBody() : 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 switch($statusCode) {\n case 200:\n if ('\\OpenAPI\\Client\\Model\\ElasticSyncSync' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\ElasticSyncSync', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\ElasticSyncSync';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\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 '\\OpenAPI\\Client\\Model\\ElasticSyncSync',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function cbtIdPutAsyncWithHttpInfo($id, $sortOrder = null, $name = null, $visible = null, $level = null)\n {\n $returnType = '\\VATUSA\\Client\\Model\\OK';\n $request = $this->cbtIdPutRequest($id, $sortOrder, $name, $visible, $level);\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 restElasticSyncSyncChangeCsvPutWithHttpInfo()\n {\n $request = $this->restElasticSyncSyncChangeCsvPutRequest();\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() ? (string) $e->getResponse()->getBody() : 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 switch($statusCode) {\n case 200:\n if ('\\OpenAPI\\Client\\Model\\ElasticSyncSync' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\ElasticSyncSync', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\ElasticSyncSync';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\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 '\\OpenAPI\\Client\\Model\\ElasticSyncSync',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function auManagerRosterShiftPutAsyncWithHttpInfo($roster_shift_id, $publish, $business_id, $shift_model, string $contentType = self::contentTypes['auManagerRosterShiftPut'][0])\n {\n $returnType = '';\n $request = $this->auManagerRosterShiftPutRequest($roster_shift_id, $publish, $business_id, $shift_model, $contentType);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\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 (string) $response->getBody()\n );\n }\n );\n }",
"public function restElasticSyncSyncPostAsyncWithHttpInfo()\n {\n $returnType = '\\OpenAPI\\Client\\Model\\ElasticSyncSync';\n $request = $this->restElasticSyncSyncPostRequest();\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 = (string) $responseBody;\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 restElasticSyncSyncSyncIdOptionPostAsyncWithHttpInfo($sync_id)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\ElasticSyncOption';\n $request = $this->restElasticSyncSyncSyncIdOptionPostRequest($sync_id);\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 = (string) $responseBody;\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 quotesV2PutAsyncWithHttpInfo($id2, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology, $id)\n {\n $returnType = 'object';\n $request = $this->quotesV2PutRequest($id2, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology, $id);\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 devicesIdDistancePutAsyncWithHttpInfo($id, $body)\n {\n $returnType = '';\n $request = $this->devicesIdDistancePutRequest($id, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\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 restElasticSyncSyncSyncIdMatchesGetAsyncWithHttpInfo($sync_id)\n {\n $returnType = 'object';\n $request = $this->restElasticSyncSyncSyncIdMatchesGetRequest($sync_id);\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 = (string) $responseBody;\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 gitlabSyncUpdateWithHttpInfo($id, $x_phrase_app_otp = null, $account_id = null, $phrase_project_code = null, $gitlab_project_id = null, $gitlab_branch_name = null)\n {\n $request = $this->gitlabSyncUpdateRequest($id, $x_phrase_app_otp, $account_id, $phrase_project_code, $gitlab_project_id, $gitlab_branch_name);\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() ? (string) $e->getResponse()->getBody() : 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 switch($statusCode) {\n case 200:\n if ('\\Phrase\\Model\\GitlabSync' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\Phrase\\Model\\GitlabSync', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\Phrase\\Model\\GitlabSync';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\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 '\\Phrase\\Model\\GitlabSync',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function songCurrentSongPutAsyncWithHttpInfo()\n {\n $returnType = '';\n $request = $this->songCurrentSongPutRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\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 restElasticSyncSyncSyncIdOptionsPutAsync($sync_id)\n {\n return $this->restElasticSyncSyncSyncIdOptionsPutAsyncWithHttpInfo($sync_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Plugin Name: WPeSocialIcons Version: 1.0 Plugin URI: Description: An easily way to print social icons without javascript to share on more populars social networks. Author: etruel Author URI: | function wpe_socialicons(){
$SIuri = plugin_dir_url( __FILE__ );
$SIdir = plugin_dir_path( __FILE__ );
?><style>
.wpeicons a {
text-decoration: none;
}
.wpeicons a img {
opacity:.6;
padding: 0px;width: 20px;
filter: url(filters.svg#grayscale); /* Firefox 3.5+ */
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(1); /* Google Chrome & Safari 6+ */
}
.wpeicons a:hover img {
opacity:1;
filter: none;
-webkit-filter: grayscale(0);
}
.box .wpeicons {
background: #FFF;
text-align: center;
padding: 10px;
margin: 1px;
}
.box .wpeicons a img {
width: 32px;
margin-left: 10px;
}
</style>
<span class="wpeicons">
<a title="Click para compartir en Facebook!" onclick="return fbs_click()" href="http://www.facebook.com/share.php?u=<?php the_permalink(); ?>" target="_blank" rel="me">
<img src="<?php echo $SIuri; ?>images/s-face.png" alt="Facebook">
</a>
<a title="Click para compartir en Twitter!" href="http://twitter.com/home?status=Comparto <?php the_permalink(); ?>" target="_blank" rel="me">
<img src="<?php echo $SIuri; ?>images/s-twit.png" alt="Twitter">
</a>
<a title="Click para compartir en Google Plus!" href="https://plus.google.com/share?url=<?php the_permalink(); ?>" target="_blank" rel="me">
<img src="<?php echo $SIuri; ?>images/s-gplus.png" alt="Gplus">
</a>
<a href="http://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink(); ?>&title=<?php the_title(); ?>&summary=<?php the_excerpt(' Leer mas '); ?>" target="_blank" >
<img src="<?php echo $SIuri; ?>images/s-in.png" alt="Gplus" />
</a>
<a title="Click para compartir en Pinterest!" href="//pinterest.com/pin/create/button/?url=<?php echo urlencode(get_permalink()); ?>&media=<?php
if ( has_post_thumbnail() ) {
echo urlencode( wp_get_attachment_url( get_post_thumbnail_id() ) );
}
?>&description=<?php echo urlencode(get_the_title()); ?>" target="_blank" rel="me">
<img src="<?php echo $SIuri; ?>images/s-pinit.png" alt="PinIt">
</a>
</span>
<?php
} | [
"function catchwebtools_social_icons(){\n\techo catchwebtools_get_social_icons();\n}",
"function storefront_social_icons() {\n\t\tif ( class_exists( 'Subscribe_And_Connect' ) ) {\n\t\t\techo '<div class=\"subscribe-and-connect-connect\">';\n\t\t\tsubscribe_and_connect_connect();\n\t\t\techo '</div>';\n\t\t}\n\t}",
"function storefront_social_icons() {\n if ( class_exists( 'Subscribe_And_Connect' ) ) {\n echo '<div class=\"subscribe-and-connect-connect\">';\n subscribe_and_connect_connect();\n echo '</div>';\n }\n }",
"function shop_isle_social_icons() {\n\t\tif ( class_exists( 'Subscribe_And_Connect', false ) ) {\n\t\t\techo '<div class=\"subscribe-and-connect-connect\">';\n\t\t\tsubscribe_and_connect_connect();\n\t\t\techo '</div>';\n\t\t}\n\t}",
"function displaySocialMediaIcons()\r\n\t{\r\n\t\t// Social Media Template Tag\r\n\t\treturn getSocialMediaProfiles();\r\n\t}",
"function outputSocialIcons() {\n\tglobal $ybwp_data;\n\n\t$socialicons = '';\n\n\tif( $ybwp_data['opt-text-social-twitter'] != \"\" ) {\n\t\t$socialicons .= '<li class=\"social-twitter\"><a href=\"http://www.twitter.com/'.$ybwp_data['opt-text-social-twitter'].'\" target=\"_blank\" title=\"'.__( 'Twitter', 'yb' ).'\">'.__( 'Twitter', 'yb' ).'</a></li>';\n\t}\n\tif( $ybwp_data['opt-text-social-forrst'] != \"\" ) {\n\t\t$socialicons .= '<li class=\"social-forrst\"><a href=\"'.$ybwp_data['opt-text-social-forrst'].'\" target=\"_blank\" title=\"'.__( 'Forrst', 'yb' ).'\">'.__( 'Forrst', 'yb' ).'</a></li>';\n\t}\n\tif( $ybwp_data['opt-text-social-dribbble'] != \"\" ) {\n\t\t$socialicons .= '<li class=\"social-dribbble\"><a href=\"'.$ybwp_data['opt-text-social-dribbble'].'\" target=\"_blank\" title=\"'.__( 'Dribbble', 'yb' ).'\">'.__( 'Dribbble', 'yb' ).'</a></li>';\n\t}\n\tif( $ybwp_data['opt-text-social-flickr'] != \"\" ) {\n\t\t$socialicons .= '<li class=\"social-flickr\"><a href=\"'.$ybwp_data['opt-text-social-flickr'].'\" target=\"_blank\" title=\"'.__( 'Flickr', 'yb' ).'\">'.__( 'Flickr', 'yb' ).'</a></li>';\n\t}\n\tif( $ybwp_data['opt-text-social-facebook'] != \"\" ) {\n\t\t$socialicons .= '<li class=\"social-facebook\"><a href=\"'.$ybwp_data['opt-text-social-facebook'].'\" target=\"_blank\" title=\"'.__( 'Facebook', 'yb' ).'\">'.__( 'Facebook', 'yb' ).'</a></li>';\n\t}\n\tif( $ybwp_data['opt-text-social-skype'] != \"\" ) {\n\t\t$socialicons .= '<li class=\"social-skype\"><a href=\"'.$ybwp_data['opt-text-social-skype'].'\" target=\"_blank\" title=\"'.__( 'Skype', 'yb' ).'\">'.__( 'Skype', 'yb' ).'</a></li>';\n\t}\n\tif( $ybwp_data['opt-text-social-digg'] != \"\" ) {\n\t\t$socialicons .= '<li class=\"social-digg\"><a href=\"'.$ybwp_data['opt-text-social-digg'].'\" target=\"_blank\" title=\"'.__( 'Digg', 'yb' ).'\">'.__( 'Digg', 'yb' ).'</a></li>';\n\t}\n\tif( $ybwp_data['opt-text-social-googleplus'] != \"\" ) {\n\t\t$socialicons .= '<li class=\"social-googleplus\"><a href=\"'.$ybwp_data['opt-text-social-googleplus'].'\" target=\"_blank\" title=\"'.__( 'Google+', 'yb' ).'\">'.__( 'Google+', 'yb' ).'</a></li>';\n\t}\n\tif( $ybwp_data['opt-text-social-instagram'] != \"\" ) {\n\t\t$socialicons .= '<li class=\"social-instagram\"><a href=\"'.$ybwp_data['opt-text-social-instagram'].'\" target=\"_blank\" title=\"'.__( 'Instagram', 'yb' ).'\">'.__( 'Instagram', 'yb' ).'</a></li>';\n\t}\n\tif( $ybwp_data['opt-text-social-linkedin'] != \"\" ) {\n\t\t$socialicons .= '<li class=\"social-linkedin\"><a href=\"'.$ybwp_data['opt-text-social-linkedin'].'\" target=\"_blank\" title=\"'.__( 'LinkedIn', 'yb' ).'\">'.__( 'LinkedIn', 'yb' ).'</a></li>';\n\t}\n\tif( $ybwp_data['opt-text-social-vimeo'] != \"\" ) {\n\t\t$socialicons .= '<li class=\"social-vimeo\"><a href=\"'.$ybwp_data['opt-text-social-vimeo'].'\" target=\"_blank\" title=\"'.__( 'Vimeo', 'yb' ).'\">'.__( 'Vimeo', 'yb' ).'</a></li>';\n\t}\n\tif( $ybwp_data['opt-text-social-yahoo'] != \"\" ) {\n\t\t$socialicons .= '<li class=\"social-yahoo\"><a href=\"'.$ybwp_data['opt-text-social-yahoo'].'\" target=\"_blank\" title=\"'.__( 'Yahoo', 'yb' ).'\">'.__( 'Yahoo', 'yb' ).'</a></li>';\n\t}\n\tif( $ybwp_data['opt-text-social-tumblr'] != \"\" ) {\n\t\t$socialicons .= '<li class=\"social-tumblr\"><a href=\"'.$ybwp_data['opt-text-social-tumblr'].'\" target=\"_blank\" title=\"'.__( 'Tumblr', 'yb' ).'\">'.__( 'Tumblr', 'yb' ).'</a></li>';\n\t}\n\tif( $ybwp_data['opt-text-social-youtube'] != \"\" ) {\n\t\t$socialicons .= '<li class=\"social-youtube\"><a href=\"'.$ybwp_data['opt-text-social-youtube'].'\" target=\"_blank\" title=\"'.__( 'YouTube', 'yb' ).'\">'.__( 'YouTube', 'yb' ).'</a></li>';\n\t}\n\tif( $ybwp_data['opt-text-social-deviantart'] != \"\" ) {\n\t\t$socialicons .= '<li class=\"social-deviantart\"><a href=\"'.$ybwp_data['opt-text-social-deviantart'].'\" target=\"_blank\" title=\"'.__( 'DeviantArt', 'yb' ).'\">'.__( 'DeviantArt', 'yb' ).'</a></li>';\n\t}\n\tif( $ybwp_data['opt-text-social-behance'] != \"\" ) {\n\t\t$socialicons .= '<li class=\"social-behance\"><a href=\"'.$ybwp_data['opt-text-social-behance'].'\" target=\"_blank\" title=\"'.__( 'Behance', 'yb' ).'\">'.__( 'Behance', 'yb' ).'</a></li>';\n\t}\n\tif( $ybwp_data['opt-text-social-pinterest'] != \"\" ) {\n\t\t$socialicons .= '<li class=\"social-pinterest\"><a href=\"'.$ybwp_data['opt-text-social-pinterest'].'\" target=\"_blank\" title=\"'.__( 'Pinterest', 'yb' ).'\">'.__( 'Pinterest', 'yb' ).'</a></li>';\n\t}\n\tif( $ybwp_data['opt-text-social-delicious'] != \"\" ) {\n\t\t$socialicons .= '<li class=\"social-delicious\"><a href=\"'.$ybwp_data['opt-text-social-delicious'].'\" target=\"_blank\" title=\"'.__( 'Delicious', 'yb' ).'\">'.__( 'Delicious', 'yb' ).'</a></li>';\n\t}\n\tif( $ybwp_data['opt-checkbox-social-rss'] ) {\n\t\t$socialicons .= '<li class=\"social-rss\"><a href=\"'.get_bloginfo('rss2_url').'\" target=\"_blank\" title=\"'.__( 'RSS', 'yb' ).'\">'.__( 'RSS', 'yb' ).'</a></li>';\n\t}\n\n\treturn $socialicons;\n}",
"function swpf_header_icon() {\n\n\t$icon_url = plugins_url('images/swpf-icon-header.png', __FILE__ ); ?>\n \t\n\t<div id=\"icon-myplugin\" class=\"icon32\"><img src=\"<?php echo $icon_url; ?>\"></div><?php\n\n}",
"public function plugin_page_icon() {\r\n\t\treturn '';\r\n\t}",
"function sp_social_media_profile_icons() {\n\t$output = '';\n\t$buttons = array();\n\n\t$target = apply_filters( 'sp_social_media_profile_icons_open_target', '_blank' );\n\n\t$output .= '<ul class=\"social-media-profile-buttons\">' . PHP_EOL;\t\n\t\n\tif ( sp_get_option( 'facebook_enable', 'is', 'on' ) )\n\t\t$buttons['facebook'] = '<li class=\"facebook\"><a href=\"' . esc_url( sp_get_option( 'facebook_account' ) ) . '\" title=\"' . esc_attr__( 'Join Us on Facebook', 'sp-theme' ) . '\" class=\"sp-tooltip\" data-toggle=\"tooltip\" data-placement=\"bottom\" target=\"' . esc_attr( $target ) . '\"><i class=\"icon-' . apply_filters( 'sp_social_media_facebook_profile_icon_class', 'facebook' ) . '\" aria-hidden=\"true\"></i></a></li>' . PHP_EOL;\n\n\tif ( sp_get_option( 'twitter_enable', 'is', 'on' ) ) \n\t\t$buttons['twitter'] = '<li class=\"twitter\"><a href=\"' . esc_url( sp_get_option( 'twitter_account' ) ) . '\" title=\"' . esc_attr__( 'Follow our Tweets', 'sp-theme' ) . '\" class=\"sp-tooltip\" data-toggle=\"tooltip\" data-placement=\"bottom\" target=\"' . esc_attr( $target ) . '\"><i class=\"icon-' . apply_filters( 'sp_social_media_twitter_profile_icon_class', 'twitter' ) . '\" aria-hidden=\"true\"></i></a></li>' . PHP_EOL;\t\n\n\tif ( sp_get_option( 'pinterest_enable', 'is', 'on' ) ) \n\t\t$buttons['pinterest'] = '<li class=\"pinterest\"><a href=\"' . esc_url( sp_get_option( 'pinterest_account' ) ) . '\" title=\"' . esc_attr__( 'Follow our Pins', 'sp-theme' ) . '\" class=\"sp-tooltip\" data-toggle=\"tooltip\" data-placement=\"bottom\" target=\"' . esc_attr( $target ) . '\"><i class=\"icon-' . apply_filters( 'sp_social_media_pinterest_profile_icon_class', 'pinterest' ) . '\" aria-hidden=\"true\"></i></a></li>' . PHP_EOL;\t\n\n\tif ( sp_get_option( 'flickr_enable', 'is', 'on' ) ) \n\t\t$buttons['flickr'] = '<li class=\"flickr\"><a href=\"' . esc_url( sp_get_option( 'flickr_account' ) ) . '\" title=\"' . esc_attr__( 'Checkout our Flickr Photos', 'sp-theme' ) . '\" class=\"sp-tooltip\" data-toggle=\"tooltip\" data-placement=\"bottom\" target=\"' . esc_attr( $target ) . '\"><i class=\"icon-' . apply_filters( 'sp_social_media_flickr_profile_icon_class', 'flickr' ) . '\" aria-hidden=\"true\"></i></a></li>' . PHP_EOL;\t\n\n\tif ( sp_get_option( 'gplus_enable', 'is', 'on' ) ) \n\t\t$buttons['gplus'] = '<li class=\"gplus\"><a href=\"' . esc_url( sp_get_option( 'gplus_account' ) ) . '\" title=\"' . esc_attr__( 'Checkout our Google Plus Profile', 'sp-theme' ) . '\" class=\"sp-tooltip\" data-toggle=\"tooltip\" data-placement=\"bottom\" target=\"' . esc_attr( $target ) . '\"><i class=\"icon-' . apply_filters( 'sp_social_media_gplus_profile_icon_class', 'google-plus' ) . '\" aria-hidden=\"true\"></i></a></li>' . PHP_EOL;\t\n\n\tif ( sp_get_option( 'youtube_enable', 'is', 'on' ) ) \n\t\t$buttons['youtube'] = '<li class=\"youtube\"><a href=\"' . esc_url( sp_get_option( 'youtube_account' ) ) . '\" title=\"' . esc_attr__( 'Checkout our YouTube Videos', 'sp-theme' ) . '\" class=\"sp-tooltip\" data-toggle=\"tooltip\" data-placement=\"bottom\" target=\"' . esc_attr( $target ) . '\"><i class=\"icon-' . apply_filters( 'sp_social_media_youtube_profile_icon_class', 'youtube' ) . '\" aria-hidden=\"true\"></i></a></li>' . PHP_EOL;\t\n\t\n\tif ( sp_get_option( 'rss_enable', 'is', 'on' ) ) \n\t\t$buttons['rss'] = '<li class=\"rss\"><a href=\"' . esc_url( get_bloginfo( 'rss2_url' ) ) . '\" title=\"' . esc_attr__( 'Get Fed on our Feeds' , 'sp-theme' ) . '\" class=\"sp-tooltip\" data-toggle=\"tooltip\" data-placement=\"bottom\" target=\"' . esc_attr( $target ) . '\"><i class=\"icon-' . apply_filters( 'sp_social_media_rss_profile_icon_class', 'rss' ) . '\" aria-hidden=\"true\"></i></a></li>' . PHP_EOL;\t\n\n\t$buttons = apply_filters( 'sp_social_media_profile_icons', $buttons );\n\t\n\t// loop through buttons\n\tforeach( $buttons as $button ) {\n\t\t$output .= $button;\n\t}\n\n\t$output .= '</ul>' . PHP_EOL;\n\n\treturn $output;\n}",
"function dispalySocialMediaIcons() {\n\n // Social Media Template Tag\n\n return getSocialMediaProfiles();\n\n }",
"function shipyard_render_customizer_social_icons() {\n\tob_start(); ?>\n\n\t<ul class=\"social-link-list\">\n\t\t<?php foreach( [ 'facebook', 'twitter', 'instagram', 'pinterest', 'youtube' ] as $social_link ) :\n\t\t\tif ( get_theme_mod( 'shipyard_' . $social_link ) ) : ?>\n\t\t\t\t<li>\n\t\t\t\t\t<a class=\"social-link\" href=\"<?php echo esc_url( get_theme_mod( 'shipyard_' . $social_link ) ); ?>\" target=\"_blank\">\n\t\t\t\t\t\t<?php echo shipyard_render_svg( \"{$social_link}-square\" ) ?>\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n\t\t\t<?php endif;\n\t\tendforeach; ?>\n\t</ul>\n\n\t<?php return ob_get_clean();\n}",
"function uni_coworking_theme_footer_social_icons_output(){\r\n if ( ot_get_option( 'uni_social_section_enable' ) === 'on' ) {\r\n ?>\r\n <div class=\"footerSocial\">\r\n <?php\r\n $aSocialLinks = maybe_unserialize( ot_get_option('uni_social_links_list') );\r\n if ( isset($aSocialLinks) && is_array($aSocialLinks) && !empty($aSocialLinks) ) {\r\n foreach( $aSocialLinks as $aLink ) {\r\n ?>\r\n <div class=\"footerSocialItem\">\r\n <a href=\"<?php echo esc_url( $aLink['uni_s_icon_link'] ) ?>\" target=\"_blank\">\r\n <i class=\"<?php echo esc_attr( $aLink['uni_s_icon_type'] ) ?>\"></i>\r\n <?php echo esc_html( $aLink['uni_s_icon_title'] ) ?>\r\n </a>\r\n </div>\r\n <?php\r\n }\r\n }\r\n ?>\r\n </div>\r\n <?php\r\n }\r\n }",
"function audioman_social_icons_init() {\n\tregister_widget( 'Audioman_Social_Icons_Widget' );\n}",
"function display_social_media_icons() {\n $social_sites = theme_customizer_social_media_array();\n $output = false;\n\n /* Add social media links to an array if they aren't blank */\n\n foreach ($social_sites as $key => $value) {\n if (strlen(get_theme_mod($key)) > 0) {\n $active_sites[$key] = $value;\n }\n }\n\n /* For each active social site, add it as a list item */\n\n if (!empty($active_sites)) {\n $output = '\n <ul class=\"social-media-icons\">\n ';\n \n foreach ($active_sites as $key => $value) {\n $class = 'fab fa-' . $key;\n\n if ($key == 'email') {\n $email = get_theme_mod($key);\n\n if ($email) {\n if (is_email($email)) {\n $output .= '\n <li>\n <a class=\"email\" target=\"_blank\" href=\"mailto:' . antispambot($email) . '\">\n <i class=\"fas fa-envelope\" title=\"Email\"></i>\n </a>\n </li>\n ';\n }\n }\n } else {\n $output .= '\n <li>\n <a class=\"' . $key . '\" target=\"_blank\" href=\"' . esc_url(get_theme_mod($key)) . '\">\n <i class=\"' . esc_attr($class) . '\" title=\"' . $value . '\"></i>\n </a>\n </li>\n ';\n }\n }\n\n $output .= '</ul>';\n }\n\n return $output;\n}",
"function quadro_social_icons_header() {\n\tquadro_social_icons('social_header_display', 'header-social-icons', 'header_icons_scheme', 'header_icons_color_type');\n}",
"function cdn_do_social_share_buttons() {\n\techo do_shortcode( '[easy-social-share buttons=\"facebook,pinterest,more,twitter,google,mail\" morebutton=\"1\" morebutton_icon=\"plus\" counters=1 counter_pos=\"hidden\" total_counter_pos=\"leftbig\" style=\"button\" template=\"fancy-retina\"]' );\n}",
"function print_embed_sharing_button()\n{\n}",
"function wp_site_icon()\n {\n }",
"function ragnar_socialLink_footer() {\n\t$social = '';\n\tglobal $ragnar_data; \n\t$icons = $ragnar_data['socialicons'];\n\tif(is_array($icons)){\n\t\tforeach ($icons as $icon){\n\t\t\t$social .= '<a target=\"_blank\" href=\"'.esc_url($icon['link']).'\" title=\"'.esc_attr($icon['title']).'\"><i class=\"fa '.esc_attr($icon['url']).'\"></i><span>'.esc_attr($icon['title']).'</span></a>';\t\n\t\t}\n\t}\n\techo $social;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
In each plugin we will define a CONST such as plguin_installed that will be used weather plugin is installed or not ie define("editorspick_install","installed"); is_installed('editorspic'); | function is_installed($plugin)
{
if (defined($plugin . "_install"))
return true;
else
return false;
} | [
"abstract function is_plugin_new_install();",
"function room_revslider_importer_required_plugins($not_installed='', $list='') {\n\t\t//if (in_array('revslider', room_storage_get('required_plugins')) && !room_exists_revslider() )\n\t\tif (strpos($list, 'revslider')!==false && !room_exists_revslider() )\n\t\t\t$not_installed .= '<br>Revolution Slider';\n\t\treturn $not_installed;\n\t}",
"function isInstalled()\r\n {\r\n $success = false;\r\n \r\n jimport('joomla.filesystem.file');\r\n if (JFile::exists(JPATH_ADMINISTRATOR.'/components/com_juga/defines.php')) \r\n {\r\n JLoader::register( \"Juga\", JPATH_ADMINISTRATOR.\"/components/com_juga/defines.php\" );\r\n if (version_compare(Juga::getVersion(), '2.2.0', '>=')) \r\n {\r\n $success = true;\r\n }\r\n } \r\n return $success;\r\n }",
"function _isInstalled()\r\n {\r\n $success = false;\r\n\r\n jimport( 'joomla.filesystem.file' );\r\n $filePath = JPATH_ADMINISTRATOR.\"/components/com_ambra/defines.php\";\r\n if (JFile::exists($filePath))\r\n {\r\n $success = true;\r\n if ( !class_exists('Ambra') )\r\n { \r\n JLoader::register( \"Ambra\", JPATH_ADMINISTRATOR.\"/components/com_ambra/defines.php\" );\r\n }\r\n } \r\n return $success;\r\n }",
"function planmyday_revslider_importer_required_plugins($not_installed='', $list='') {\n\t\t//if (in_array('revslider', planmyday_storage_get('required_plugins')) && !planmyday_exists_revslider() )\n\t\tif (planmyday_strpos($list, 'revslider')!==false && !planmyday_exists_revslider() )\n\t\t\t$not_installed .= '<br>' . esc_html__('Revolution Slider', 'planmyday');\n\t\treturn $not_installed;\n\t}",
"function is_installed(){\n\n $constants = \"'\".implode(\"', '\",$this->settings_list()).\"'\";\n $q = db_query(\"select COUNT(*) FROM \".SETTINGS_TABLE.\"\n WHERE settings_constant_name IN (\".$constants.\")\");\n list($cnt) = db_fetch_row($q);\n\n return ($cnt != 0 );\n }",
"function succulents_qodef_core_plugin_installed() {\n\t\treturn defined( 'QODE_CORE_VERSION' );\n\t}",
"function yogastudio_vc_importer_required_plugins($not_installed='', $list='') {\n\t\tif (!yogastudio_exists_visual_composer() )\t\t// && yogastudio_strpos($list, 'visual_composer')!==false\n\t\t\t$not_installed .= '<br>' . esc_html__('WPBakery PageBuilder', 'yogastudio');\n\t\treturn $not_installed;\n\t}",
"function canBeInstalled() ;",
"function isInstalled()\r\n {\r\n $success = false;\r\n \r\n jimport('joomla.filesystem.file');\r\n if (JFile::exists(JPATH_ADMINISTRATOR.'/components/com_billets/defines.php')) \r\n {\r\n JLoader::register( \"Billets\", JPATH_ADMINISTRATOR.\"/components/com_billets/defines.php\" );\r\n \r\n if (version_compare(Billets::getInstance()->getVersion(), '4.2.0', '>=')) \r\n {\r\n $success = true;\r\n }\r\n } \r\n return $success;\r\n }",
"public function checkIfPluginToBeUsed()\n {\n $boxalinoGlobalPluginStatus = Mage::helper('core')->isModuleOutputEnabled('Boxalino_Intelligence');\n if($boxalinoGlobalPluginStatus)\n {\n if(Mage::helper('boxalino_intelligence')->isPluginEnabled())\n {\n\n return true;\n }\n }\n\n return false;\n }",
"function hh_plugin_available() {\n // First checks if the plugin is actually installed\n $plugin_exists = is_dir(HELMHOLTZ_PLUGIN_FOLDER_PATH) && file_exists(HELMHOLTZ_PLUGIN_FILE_PATH);\n if ($plugin_exists) {\n return true;\n }\n return false;\n}",
"function yogastudio_revslider_importer_required_plugins($not_installed='', $list='') {\n\t\tif (yogastudio_strpos($list, 'revslider')!==false && !yogastudio_exists_revslider() )\n\t\t\t$not_installed .= '<br>' . esc_html__('Revolution Slider', 'yogastudio');\n\t\treturn $not_installed;\n\t}",
"public function checkIfPluginToBeUsed()\n {\n $boxalinoGlobalPluginStatus = Mage::helper('core')->isModuleOutputEnabled('Boxalino_Intelligence');\n if($boxalinoGlobalPluginStatus)\n {\n if(Mage::helper('boxalino_intelligence')->isPluginEnabled())\n {\n return true;\n }\n }\n\n return false;\n }",
"function __bptb_cap_install_plugins() {\n\n\t\treturn 'install_plugins';\n\t}",
"public function plugin_enable(){\r\n\r\n\t}",
"function booklovers_instagram_widget_importer_required_plugins($not_installed='', $list='') {\n\t\tif (booklovers_strpos($list, 'instagram_widget')!==false && !booklovers_exists_instagram_widget() )\n\t\t\t$not_installed .= '<br>' . esc_html__('WP Instagram Widget', 'booklovers');\n\t\treturn $not_installed;\n\t}",
"function p8i_is_installed() {\n return !!p8i_get_theme();\n}",
"function is_installed() {\n\t\treturn version_compare(get_option('gengo_version'), $this->version, '==');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if at least one payment plan is enabled in Bo | public function hasEnabledPaymentPlansInBo(): bool
{
$hasActivePlans = false;
$inConfigPaymentPlans = $this->getEnabledConfigPaymentPlans();
foreach ($inConfigPaymentPlans as $paymentPlan) {
if ($paymentPlan->isEnabled()) {
return true;
}
}
return $hasActivePlans;
} | [
"public function hasActiveSavingsPlan();",
"public function hasPaidPlan()\n {\n return in_array($this->subscription_plan, $this->validPlans());\n }",
"abstract function has_paid_plan();",
"public function hasMultiplePlans() : bool\n {\n return count($this->plans) > 1;\n }",
"private static function _canManagePlans()\n {\n $license = new \\pm_License();\n $properties = $license->getProperties();\n\n $hasHostingPlans = $properties['can-manage-customers'];\n $hasResellerPlans = $properties['can-manage-resellers'];\n\n if (!$hasHostingPlans || !$hasResellerPlans) {\n return false;\n } else {\n return true;\n }\n }",
"public function makePaymentAvailable()\r\n {\r\n foreach($this->projects()->get() as $project)\r\n {\r\n if($project->status!=\"EXCLUDE\" && $project->lastContractNoWP() !=null &&\r\n $project->lastContractNoWP()->paid < $project->lastContractNoWP()->price &&\r\n in_array($project->stage,array(\"WOM\", 'WALKTHRU',\"DROP\", \"DROP/IMG\", \"ARCHIVE\",\"PHASE2\",\"CONTRACT\"))\r\n && ($project->stage==\"WALKTHRU\"||$project->lastContractNoWP()->type==\"IGUP\"||$project->lastContractNoWP()->type==\"PPA\" || new \\DateTime($project->actionDate) <= new \\DateTime()))\r\n return 1;\r\n }\r\n return 0;\r\n }",
"public function hasPayments();",
"public function isTeamPurchasedPlan(): bool;",
"public function needsPayment()\n {\n return $this->getBalance()->isPositive();\n }",
"abstract protected function local_has_paid_plan();",
"function hasPayment(): bool;",
"protected function _isPaymentRequired()\n {\n $this->getQuote()->collectTotals();\n return !intval($this->getQuote()->getGrandTotal()) && !$this->getQuote()->hasNominalItems();\n }",
"public function hasPlan()\n {\n return $this->plan !== null;\n }",
"public function isPayment();",
"function isPaymentPending(): bool;",
"function check_autopay_capable()\n\t{\n\t\tlog_write(\"debug\", \"invoice_autopay\", \"Executing check_autopay_capable()\");\n\n\n\t\t// fetch customer/vendor information\n\t\tif ($this->type_invoice == \"ap\")\n\t\t{\n\t\t\t$this->id_org\t= sql_get_singlevalue(\"SELECT vendorid as value FROM account_ar WHERE id='\". $this->id_invoice .\"' LIMIT 1\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->id_org\t= sql_get_singlevalue(\"SELECT customerid as value FROM account_ar WHERE id='\". $this->id_invoice .\"' LIMIT 1\");\n\t\t}\n\n\n\t\t// check credit pool\n\t\tif ($this->type_invoice == \"ap\")\n\t\t{\n\t\t\t$credit = sql_get_singlevalue(\"SELECT SUM(amount_total) as value FROM vendors_credits WHERE id_vendor='\". $this->id_org .\"' LIMIT 1\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$credit = sql_get_singlevalue(\"SELECT SUM(amount_total) as value FROM customers_credits WHERE id_customer='\". $this->id_org .\"' LIMIT 1\");\n\t\t}\n\n\t\tif ($credit > 0)\n\t\t{\n\t\t\tlog_write(\"debug\", \"invoice_autopay\", \"There is credit ($credit) available for autopayments\");\n\n\t\t\t$this->capable = 1;\n\t\t\treturn 1;\n\t\t}\n\n\n\t\t// no autopayment sources\n\t\treturn 0;\n\n\t}",
"public function isAnnualBillingSwitchPossible(): bool;",
"public function hasPaymentInstructions()\n {\n return !empty($this->iban) && !empty($this->bic);\n }",
"function required_plan_checks() {\n\t$availability = \\Jetpack_Gutenberg::get_cached_availability();\n\t$slug = 'premium-content/container';\n\treturn ( isset( $availability[ $slug ] ) && $availability[ $slug ]['available'] );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
will return the kahoapplication service object | public static function getKaHOAppSerIns() {
if (is_null(self::$kahoapplicationservice)) {
self::$kahoapplicationservice = new Kahoapplicationservice();
}
return self::$kahoapplicationservice;
} | [
"private function getApplicationService()\n {\n $service = new ApplicationService();\n $this->assertInstanceOf('\\CPCCore\\Application\\ApplicationService', $service);\n return $service;\n }",
"protected function getApplicationService()\n {\n return $this->services['TYPO3\\\\CMS\\\\Backend\\\\Http\\\\Application'] = \\TYPO3\\CMS\\Backend\\ServiceProvider::getApplication($this);\n }",
"protected function getAppClient()\n\t{\n\t\tif (!isset($this->app_client))\n\t\t{\n\t\t\t$this->app_client = ECash::getFactory()->getWebServiceFactory()->getWebService('application');\n\t\t}\n\n\t\treturn $this->app_client;\n\t}",
"protected function getApplication2Service()\n {\n return $this->services['TYPO3\\\\CMS\\\\Frontend\\\\Http\\\\Application'] = \\TYPO3\\CMS\\Frontend\\ServiceProvider::getApplication($this);\n }",
"function app(string $service = null)\n{\n if ($service == null) {\n return Application::getInstance();\n }\n return Application::getInstance()->get($service);\n}",
"protected final function getApplication() { \r\n\t\t\treturn (APPLICATION::getInstance());\r\n\t\t}",
"protected function getAppService()\n {\n return new AppService($this->getInitialContext());\n }",
"public function get_service_application($aWhere = array())\n\t{\n\t\tif ($this->service_application === null) {\n\n\t\t\t$oOrm = new Orm;\n\n\t\t\t$oOrm->select(array('*'))\n\t\t\t\t ->from('service_application');\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t $aWhere['id_vat'] = $this->get_id();\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t \n $this->service_application = $oOrm->where($aWhere)\n\t\t\t\t\t\t ->load(false, '\\Venus\\src\\Helium\\Entity');\n }\n\n\t\treturn $this->service_application;\n\t}",
"function application()\n {\n return di()->get('application');\n }",
"function getCloudmunchService() {\r\n\t\t$cloudmunchService = new CloudmunchService($this->appContext);\r\n\t\treturn $cloudmunchService;\r\n\t}",
"protected function getServiceConfig(){\n $serviceConfig=api.\"config\\\\app\";\n $serviceConfig=new $serviceConfig();\n return $serviceConfig;\n }",
"public static function getApplication()\n {\n return static::$instance;\n }",
"protected function _getAPI()\n {\n return Services_AMEE_API::singleton();\n }",
"public function get_service(){\n\t\t\t\n\t\t\treturn $this->data_map->get_service();\n\t\t\t\n\t\t}",
"abstract public function getCloudService();",
"function app() {\n if (!empty($this->_app))\n return $this->_app;\n\n // Replace these values with your application's consumer key and secret\n $consumer_key = self::$API_KEY;\n $consumer_secret = self::$API_SECRET;\n\n $schoology = new SchoologyApi($consumer_key, $consumer_secret, '', '', '', TRUE);\n $login = $schoology->validateLogin();\n $this->_errors = [];\n $this->_app = $schoology;\n return $schoology;\n }",
"function gi()\n{\n return Service::getInstance();\n}",
"function app()\r\n{\r\n return App::getInstance();\r\n}",
"abstract protected function getService();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Where Search User profile has qualification, pass profile ID return result............................................. | function where_search_User_profile_has_qualification_profile_id($value)
{
$this->db->where('user_profile_iduser_profile', $value);
$query = $this->db->get('user_profile_has_qualification');
if ($query->result()) {
return $query->result();
} else {
return false;
}
} | [
"function all_search_User_profile_has_qualification()\n {\n\n $query = $this->db->get('user_profile_has_qualification');\n return $query->result();\n\n\n }",
"function searchPeople($arrArg = array()) {\r\n /*\r\n * USer Must Have a valid entry in\r\n * personal_profile,qualifation,address,photo,experiance\r\n */\r\n $sql = \"select \n\t\t\tp.user_id as id,\n\t\t\tp.first_name,p.last_name,\n\t\t\tphoto.path \n\t\tfrom \n\t\t\tpersonal_profile p \n\t\t\tleft join address a on p.user_id=a.user_id\n\t\t\tleft join qualification q on q.user_id=p.user_id\n\t\t\tleft join photo photo on p.profile_pic_id=photo.id\r\n left join users u on u.user_id=p.user_id \";\r\n $cond = \" \";\r\n // Based on City\r\n if (! empty ( $arrArg ['city'] )) {\r\n foreach ( $arrArg ['city'] as $val ) {\r\n if ($val != \"\") {\r\n $val = strip_tags ( mysql_real_escape_string ( $val ) );\r\n $cond .= \" a.city='$val' OR \";\r\n }\r\n }\r\n $cond = rtrim ( $cond, \"OR \" );\r\n $cond .= \") AND (\";\r\n }\r\n // Based On gender\r\n $val = $arrArg ['gender'];\r\n if ($val != \"\" && $val != \"Both\") {\r\n $val = strip_tags ( mysql_real_escape_string ( $val ) );\r\n $cond .= \" p.gender='$val' \";\r\n $cond .= \") AND (\";\r\n }\r\n // Based On Degree\r\n if (! empty ( $arrArg ['degree'] )) {\r\n foreach ( $arrArg ['degree'] as $val ) {\r\n if ($val != \"\") {\r\n $val = strip_tags ( mysql_real_escape_string ( $val ) );\r\n $cond .= \" q.class='$val' OR \";\r\n }\r\n }\r\n $cond = rtrim ( $cond, \"OR \" );\r\n $cond .= \") AND (\";\r\n }\r\n $cond = rtrim ( $cond, \"AND (\" );\r\n \r\n if ($cond != \"\") {\r\n $sql .= \" where u.type='0' AND ( \" . $cond . \" group by id\";\r\n // echo $sql;\r\n $res = $this->executeSQLP ( $sql );\r\n if ($res) {\r\n while ( $result [] = $res->fetch ( PDO::FETCH_ASSOC ) ) {\r\n }\r\n return $result;\r\n } else {\r\n echo \"Error!!\";\r\n return false;\r\n }\r\n }\r\n }",
"public function searchAllUserProfiles() {\n $error_occured = false;\n $UserProfileId = $this->input->post('user_profile_id');\n \n $search = $this->input->post('search');\n \n if($UserProfileId == \"\") {\n $msg = \"Please select user profile\";\n $error_occured = true;\n } else if($search == \"\" || count($search) == 0) {\n $msg = \"Please enter something to search\";\n $error_occured = true;\n } else {\n\n $res_u = $this->User_Model->searchAllUserProfiles($UserProfileId, $search);\n\n if(count($res_u) > 0) {\n\n $msg = \"Profile information found successfully\";\n\n } else {\n $msg = \"No user profile Found\";\n $error_occured = true;\n }\n }\n\n if($error_occured == true) {\n $array = array(\n \"status\" => 'failed',\n \"message\" => $msg,\n );\n } else {\n\n $array = array(\n \"status\" => 'success',\n \"result\" => $res_u,\n \"message\" => $msg,\n );\n }\n displayJsonEncode($array);\n }",
"public function searchUserProfilesForConnect() {\n $error_occured = false;\n $UserProfileId = $this->input->post('user_profile_id');\n \n $search = $this->input->post('search');\n \n if($UserProfileId == \"\") {\n $msg = \"Please select user profile\";\n $error_occured = true;\n } else {\n\n $res_u = $this->User_Model->searchUserProfilesForConnect($UserProfileId, $search);\n\n if(count($res_u) > 0) {\n\n $msg = \"Profile information found successfully\";\n\n } else {\n $msg = \"No user profile Found\";\n $error_occured = true;\n }\n }\n\n if($error_occured == true) {\n $array = array(\n \"status\" => 'failed',\n \"message\" => $msg,\n );\n } else {\n\n $array = array(\n \"status\" => 'success',\n \"result\" => $res_u,\n \"message\" => $msg,\n );\n }\n displayJsonEncode($array);\n }",
"function svc_getProfilesByUsername($search, $staffonly){\n\n\tglobal $db, $debug;\n\n\t$searchquery = \"%\".$search.\"%\";\n\t$query = \"SELECT p.prof_first_name, p.prof_last_name, p.prof_main_character, p.prof_catchphrase, a.user_username, a.user_type, r.rank_consec_games \n\tFROM user_profile p \n\tINNER JOIN user_authentication a on p.UUID = a.UUID \n\tINNER JOIN user_ranking r on r.UUID = p.UUID \n\tWHERE a.user_locked in (0, 1, 4) \";\n\n\tif ($staffonly){\n\t\t$query .= \" AND (a.user_type BETWEEN 2 AND 4)\";\n\t} else {\n\t\t$query .= \" AND (a.user_type BETWEEN 1 AND 4)\";\n\t}\n\n\tif ($search != null){\n\t\t$query .= \" AND (a.user_username LIKE '$searchquery' OR p.prof_first_name LIKE '$searchquery' OR p.prof_last_Name LIKE '$searchquery')\";\n\t}\n\n\t$query .= \" ORDER BY a.user_username ASC\";\n\n\t$result = mysqli_query($db, $query);\n\twriteLog(TRACE, \"Directory query = \".$query);\n\n\tif (!$result){\n\t\twriteLog(SEVERE, \"getProfilesByUsername FAILED with search=\".$search.\", staffonly=\".$staffonly);\n\t\twriteLog(SEVERE, \"Query: \".$query);\n\t\twriteLog(SEVERE, \"MySQL Error: \".mysqli_error($db));\n\t} else {\n\t\twriteLog(DEBUG, \"getProfilesByUsername called with search=\".$search.\", staffonly=\".$staffonly);\n\t}\n\n\treturn $result;\n\n}",
"public function searchMyFriendFollowerAndFollowing() {\n $error_occured = false;\n $UserProfileId = $this->input->post('user_profile_id');\n \n $search = $this->input->post('search');\n $search = trim($search);\n \n if($UserProfileId == \"\") {\n $msg = \"Please select user profile\";\n $error_occured = true;\n } else {\n\n $res_u = $this->User_Model->searchMyFriendFollowerAndFollowing($UserProfileId, $search);\n\n if(count($res_u) > 0) {\n\n $msg = \"Profile information found successfully\";\n\n } else {\n $msg = \"No user profile Found\";\n $error_occured = true;\n }\n }\n\n if($error_occured == true) {\n $array = array(\n \"status\" => 'failed',\n \"message\" => $msg,\n );\n } else {\n\n $array = array(\n \"status\" => 'success',\n \"result\" => $res_u,\n \"message\" => $msg,\n );\n }\n displayJsonEncode($array);\n }",
"function searchPeople($userID, $searchKey = \"\", $limit = 0)\t\n\t\t{\n\t\t\t$searchKey = strtolower($searchKey);\t\t\t\n\t\t\t$sql = \"SELECT UR.role_name, USER.first_name,USER.last_name,USER.profile_image,USER.user_id, \n\t\t\t\t\tSUBSTRING(USER.about_me, 1, 105) AS about_me, COUNTRY.country_name, STATE.state_name, \n\t\t\t\t\tULOGIN.user_group, FREQ.friend_request_id AS request \t\t\t \n\t\t\t\t\tFROM tblusers AS USER \t\n\t\t\t\t\tLEFT JOIN tbluser_login AS ULOGIN ON USER.login_id = ULOGIN.login_id \n\t\t\t\t\tLEFT JOIN tbluser_roles AS UR ON ULOGIN.user_role = UR.role_id \t\t\t\t\n\t\t\t\t\tLEFT JOIN tblcountries AS COUNTRY ON USER.country_id = COUNTRY.country_id\n\t\t\t\t\tLEFT JOIN tblstates AS STATE ON USER.state_id = STATE.state_id\n\t\t\t\t\tLEFT JOIN tbluser_employment AS E ON E.user_id = USER.user_id\n\t\t\t\t\tLEFT JOIN tblfriends_request AS FREQ ON (USER.user_id = FREQ.user_id AND FREQ.friends_id = $userID) OR \n\t\t\t\t\t(USER.user_id = FREQ.friends_id AND FREQ.user_id = $userID) AND FREQ.status != 3 \n\t\t\t\t\tWHERE (LOWER(UR.role_name) LIKE '%$searchKey%' OR \n\t\t\t\t\tLOCATE(LOWER(UR.role_name), '$searchKey') > 0 OR \n\t\t\t\t\tLOWER(concat_ws(' ',USER.first_name,USER.last_name)) LIKE '%$searchKey%' OR \n\t\t\t\t\tLOCATE(LOWER(concat_ws(' ',USER.first_name,USER.last_name)), '$searchKey') > 0 OR \n\t\t\t\t\tLOWER(USER.college) LIKE '%$searchKey%' OR \t\t\t\t\t\n\t\t\t\t\tLOWER(E.employer) LIKE '%$searchKey%' OR \t\t\t\t\t\n\t\t\t\t\tLOWER(E.occupation) LIKE '%$searchKey%' OR \t\t\t\t\t\n\t\t\t\t\tLOWER(COUNTRY.country_name) LIKE '%$searchKey%' OR \n\t\t\t\t\tLOCATE(LOWER(COUNTRY.country_name), '$searchKey') > 0 OR\n\t\t\t\t\tLOWER(STATE.state_name) LIKE '%$searchKey%' OR \n\t\t\t\t\tLOCATE(LOWER(STATE.state_name), '$searchKey') > 0 OR\n\t\t\t\t\tLOWER(USER.about_me) LIKE '%$searchKey%') AND (\n\t\t\t\t\tUSER.user_id != $userID AND ULOGIN.user_group = 1 AND USER.is_deleted = 0) \n\t\t\t\t\tGROUP BY User.user_id\";\n\t\t\t\n\t\t\t//if(!empty($searchKey)) like '\".$data[\"name\"].\"%' \"\n\t\t\t\t//$sql .= \" LIMIT 0, $limit\";\t\n\t\t\t$sql .= \" ORDER BY CONCAT(USER.first_name, ' ', USER.last_name) ASC\";\t\t\t\n\t\t\tif($limit)\n\t\t\t\t$sql .= \" LIMIT 0, $limit\";\t\n\t\t\t\n\t\t\t\t\t\t\n\t\t\t$resultArry\t\t=\t$this->getdbcontents_sql($sql,0);\t\t\t\t\t\n\t\t\treturn $resultArry;\n\t\t}",
"function searchStudent($value)\n {\n// $q = $this->db->query($sql);\n// return $q->result();\n //$this->db->where('profile.account_type !=', '4');\n $this->db->select('*');\n $this->db->from('profile');\n $this->db->join('canteen_personal_load_info','profile.user_id = canteen_personal_load_info.cpli_user_id', 'left');\n $this->db->where('account_type !=', 4);\n $this->db->where('account_type', 5);\n $this->db->like('lastname', $value, 'both');\n $q = $this->db->get();\n return $q->result();\n }",
"function get_role_quals($userID, $role, $search = '', $familyID = -1, $courseID = -1)\n{\n global $DB;\n $sql = \"SELECT id FROM {role} WHERE \";\n $params = array();\n if(is_array($role))\n {\n $count = 0;\n //then we split it.\n foreach($role AS $r)\n {\n $count++;\n if($count != 1)\n {\n $sql .= ' OR';\n }\n $sql .= ' shortname = ?';\n $params[] = $r;\n } \n }\n else\n {\n $sql .= \" shortname = ?\";\n $params[] = $role;\n }\n $roleDB = $DB->get_records_sql($sql, $params);\n if($roleDB)\n {\n $roles = array();\n foreach($roleDB AS $role)\n {\n $roles[] = $role->id;\n }\n return get_users_quals($userID, $roles, $search, $familyID, $courseID);\n } \n return false;\n}",
"function testForceSearchWithProfiletype()\n\t\t{\t\n\t\t\t\t\n\t\t$this->open(JOOMLA_LOCATION.'/index.php?option=com_xius');\n\t\t$this->waitPageLoad();\n\t\t\n\t\t$this->select(\"//select[@name='field20']\", \"Single\");\n\t\t$this->select(\"//select[@id='field2']\", \"Male\");\n\t\t$this->select(\"xiusjoin\", \"label=Any\");\n\t\t\t\t\n\t\t$this->click(\"xiussearch\");\n \t$this->waitPageLoad();\n \t$this->assertTrue($this->isElementPresent(\"//span[@id='total_2']\"));\n \t\n \t$this->click(\"xiusSliderImg\");\n \t\t$this->select(\"//select[@id='field19']\", \"Free Member\");\n \t\t$this->click(\"//img[@class='xius_test_addinfo_9']\");\n \t\t$this->waitPageLoad();\n \t\t$this->assertTrue($this->isElementPresent(\"//span[@id='total_2']\"));\n \t\t\n \t\t$this->click(\"//img[@class='xius_test_remove_Single']\");\n \t\t$this->waitPageLoad();\n \t\t$this->assertTrue($this->isElementPresent(\"//span[@id='total_2']\"));\n \t\t\n \t\t$this->click(\"xiusSliderImg\");\n \t\t$this->select(\"//select[@id='field2']\", \"Female\");\n \t\t$this->click(\"//img[@class='xius_test_addinfo_12']\");\n \t$this->waitPageLoad();\n \t$this->assertTrue($this->isElementPresent(\"//span[@id='total_5']\"));\n }",
"function limiting_jprofile_query($viewer=\"\",$viewed=\"\",$for_edit_master=0)\n//viewprofile\n{\n\tglobal $jprofile_result;\n\tif($viewer && $viewed)\n\t{\n\t\t//include_once(\"ntimes_function.php\");\n\t\t$sql=\"SELECT PROFILEID , SOURCE , SUBSCRIPTION , EMAIL , GENDER , MTONGUE , CASTE , SHOWPHONE_RES , SHOWPHONE_MOB , SHOW_HOROSCOPE , BTIME , CITY_BIRTH , COUNTRY_BIRTH , OCCUPATION , PRIVACY , GET_SMS , COUNTRY_RES , CITY_RES , ACTIVATED , AGE , MOD_DT , SHOW_PARENTS_CONTACT , PARENTS_CONTACT , CONTACT , PINCODE , STD , SHOWADDRESS , PHONE_RES , PHONE_MOB , MESSENGER_ID , MESSENGER_CHANNEL , PHOTOSCREEN , HAVEPHOTO , PHOTO_DISPLAY , USERNAME , HEIGHT , RELATION , MSTATUS , HAVECHILD , MANGLIK , BTYPE , COMPLEXION , DIET , SMOKE , DRINK , RES_STATUS , HANDICAPPED , RELIGION , INCOME , EDU_LEVEL , EDU_LEVEL_NEW , FAMILY_BACK , FAMILYINFO , FAMILY_TYPE , FAMILY_STATUS , FAMILY_VALUES , MOTHER_OCC , T_BROTHER , M_BROTHER ,T_SISTER , M_SISTER , WIFE_WORKING , MARRIED_WORKING , PARENT_CITY_SAME , SUBCASTE , YOURINFO , JOB_INFO , SPOUSE , FATHER_INFO , SCREENING , GOTHRA , NAKSHATRA , EDUCATION , DTOFBIRTH , SIBLING_INFO , SHOWMESSENGER , LAST_LOGIN_DT , CITIZENSHIP , BLOOD_GROUP , WEIGHT , NATURE_HANDICAP , HIV , PHONE_NUMBER_OWNER , PHONE_OWNER_NAME , MOBILE_NUMBER_OWNER , MOBILE_OWNER_NAME , TIME_TO_CALL_START , TIME_TO_CALL_END , WORK_STATUS , RASHI , ANCESTRAL_ORIGIN , HOROSCOPE_MATCH , SPEAK_URDU , INCOMPLETE , ENTRY_DT , ISD , MOB_STATUS , LANDL_STATUS , PHONE_FLAG FROM newjs.JPROFILE WHERE PROFILEID IN($viewer,$viewed)\";\n\t\tif($for_edit_master)\n\t\t\t$res=mysql_query_decide($sql) or logError(\"Due to a temporary problem your request could not be processed. Please try after a couple of minutes\",$sql,\"ShowErrTemplate\");\n\t\telse\n\t\t\t$res=mysql_query_optimizer($sql) or logError(\"Due to a temporary problem your request could not be processed. Please try after a couple of minutes\",$sql,\"ShowErrTemplate\");\n\t\twhile($row=mysql_fetch_assoc($res))\n\t\t{\n\t\t\t$user_type='viewed';\n\t\t\tif($row['PROFILEID']==$viewer)\n\t\t\t\t$user_type=\"viewer\";\n\n\t\t\t//$ntimes = ntimes_count($row['PROFILEID'],\"SELECT\");\n\t\t\t//$jprofile_result[$user_type][\"NTIMES\"]=$ntimes;\n\t\t\tforeach($row as $key=>$val)\n\t\t\t\t$jprofile_result[\"$user_type\"][\"$key\"]=$val;\n }\n\t\tif($viewer==$viewed)\n\t\t\t$jprofile_result['viewed']=$jprofile_result['viewer'];\n\t\t\t\n\t\t\n\t}\n\telse\n\t{\n\t\tif($viewer)\n\t\t{\n\t\t\t\t$sql=\"SELECT PROFILEID , SOURCE , SUBSCRIPTION , EMAIL , GENDER , MTONGUE , CASTE , SHOWPHONE_RES , SHOWPHONE_MOB , SHOW_HOROSCOPE , BTIME , CITY_BIRTH , COUNTRY_BIRTH , OCCUPATION , PRIVACY , GET_SMS , COUNTRY_RES , CITY_RES , ACTIVATED , AGE , MOD_DT , SHOW_PARENTS_CONTACT , PARENTS_CONTACT , CONTACT , PINCODE , STD , SHOWADDRESS , PHONE_RES , PHONE_MOB , MESSENGER_ID , MESSENGER_CHANNEL , PHOTOSCREEN , HAVEPHOTO , PHOTO_DISPLAY , USERNAME , HEIGHT , RELATION , MSTATUS , HAVECHILD , MANGLIK , BTYPE , COMPLEXION , DIET , SMOKE , DRINK , RES_STATUS , HANDICAPPED , RELIGION , INCOME , EDU_LEVEL , EDU_LEVEL_NEW , FAMILY_BACK , FAMILYINFO , FAMILY_TYPE , FAMILY_STATUS , FAMILY_VALUES , MOTHER_OCC , T_BROTHER , M_BROTHER ,T_SISTER , M_SISTER , WIFE_WORKING , MARRIED_WORKING , PARENT_CITY_SAME , SUBCASTE , YOURINFO , JOB_INFO , SPOUSE , FATHER_INFO , SCREENING , GOTHRA , NAKSHATRA , EDUCATION , DTOFBIRTH , SIBLING_INFO , SHOWMESSENGER , LAST_LOGIN_DT , CITIZENSHIP , BLOOD_GROUP , WEIGHT , NATURE_HANDICAP , HIV , PHONE_NUMBER_OWNER , PHONE_OWNER_NAME , MOBILE_NUMBER_OWNER , MOBILE_OWNER_NAME , TIME_TO_CALL_START , TIME_TO_CALL_END , WORK_STATUS , RASHI , ANCESTRAL_ORIGIN , HOROSCOPE_MATCH , SPEAK_URDU , INCOMPLETE , ENTRY_DT , ISD , MOB_STATUS , LANDL_STATUS , PHONE_FLAG FROM newjs.JPROFILE WHERE PROFILEID=$viewer\";\n\t\t\t\tif($for_edit_master)\n\t\t\t\t\t$res=mysql_query_decide($sql) or logError(\"Due to a temporary problem your request could not be processed. Please try after a couple of minutes\",$sql,\"ShowErrTemplate\");\n\t\t\t\telse\n\t\t\t\t\t$res=mysql_query_optimizer($sql) or logError(\"Due to a temporary problem your request could not be processed. Please try after a couple of minutes\",$sql,\"ShowErrTemplate\");\n\t\t\t\t$row=mysql_fetch_assoc($res);\n\t\t\t\tif($row)\n\t\t\t\t{\n\t\t\t\t\tforeach($row as $key=>$val)\n\t\t\t\t\t\t$jprofile_result[\"viewer\"][\"$key\"]=$val;\n\t\t\t\t}\n\t\t}\t\n\n\t\tif($viewed)\n\t\t{\n\t\t\t//include_once(\"ntimes_function.php\");\n\t\t\t//$ntimes = ntimes_count($viewed,\"SELECT\");\n\n\t\t\t$sql=\"SELECT PROFILEID , SOURCE , SUBSCRIPTION , EMAIL , GENDER , MTONGUE , CASTE , SHOWPHONE_RES , SHOWPHONE_MOB , SHOW_HOROSCOPE , BTIME , CITY_BIRTH , COUNTRY_BIRTH , OCCUPATION , PRIVACY , GET_SMS , COUNTRY_RES , CITY_RES , ACTIVATED , AGE , MOD_DT , SHOW_PARENTS_CONTACT , PARENTS_CONTACT , CONTACT , PINCODE , STD , SHOWADDRESS , PHONE_RES , PHONE_MOB , MESSENGER_ID , MESSENGER_CHANNEL , PHOTOSCREEN , HAVEPHOTO , PHOTO_DISPLAY , USERNAME , HEIGHT , RELATION , MSTATUS , HAVECHILD , MANGLIK , BTYPE , COMPLEXION , DIET , SMOKE , DRINK , RES_STATUS , HANDICAPPED , RELIGION , INCOME , EDU_LEVEL , EDU_LEVEL_NEW , FAMILY_BACK , FAMILYINFO , FAMILY_TYPE , FAMILY_STATUS , FAMILY_VALUES , MOTHER_OCC , T_BROTHER , M_BROTHER ,T_SISTER , M_SISTER , WIFE_WORKING , MARRIED_WORKING , PARENT_CITY_SAME , SUBCASTE , YOURINFO , JOB_INFO , SPOUSE , FATHER_INFO , SCREENING , GOTHRA , NAKSHATRA , EDUCATION , DTOFBIRTH , SIBLING_INFO , SHOWMESSENGER , LAST_LOGIN_DT , CITIZENSHIP , BLOOD_GROUP , WEIGHT , NATURE_HANDICAP , HIV , PHONE_NUMBER_OWNER , PHONE_OWNER_NAME , MOBILE_NUMBER_OWNER , MOBILE_OWNER_NAME , TIME_TO_CALL_START , TIME_TO_CALL_END , WORK_STATUS , RASHI , ANCESTRAL_ORIGIN , HOROSCOPE_MATCH , SPEAK_URDU , INCOMPLETE , ENTRY_DT , ISD , MOB_STATUS , LANDL_STATUS , PHONE_FLAG FROM newjs.JPROFILE WHERE PROFILEID=$viewed\";\n\t\t\tif($for_edit_master)\n\t\t\t\t$res=mysql_query_decide($sql) or logError(\"Due to a temporary problem your request could not be processed. Please try after a couple of minutes\",$sql,\"ShowErrTemplate\");\n\t\t\telse\n\t\t\t\t$res=mysql_query_optimizer($sql) or logError(\"Due to a temporary problem your request could not be processed. Please try after a couple of minutes\",$sql,\"ShowErrTemplate\");\n\t\t\t$row=mysql_fetch_array($res);\n\t\t\tif($row)\n\t\t\t{\n\t\t\t\tforeach($row as $key=>$val)\n\t\t\t\t\t$jprofile_result[\"viewed\"][\"$key\"]=$val;\n\t\t\t\t//$jprofile_result[\"viewed\"][\"NTIMES\"]=$ntimes;\n\t\t\t}\n\n\t\t}\n\t\telse// if no profile is found for this profileid, show error message\n\t\t{\n\t\t\tif (function_exists('showProfileError_DP')) \n\t\t\t\tshowProfileError_DP();\n\t\t\telse\n\t\t\t\t showProfileError();\n\t\t}\n\t}\n}",
"public function getAllUserProfilesByQuickSearch($request,$gender) {\n extract($request);\n \n $sql = \"SELECT * FROM user_profile_tab,user_tab WHERE user_tab.user_id = user_profile_tab.user_id AND user_tab.user_gender !='$gender' \";\n\n if ($language != '') {\n $sql .= \"AND user_profile_tab.user_mother_tongue = '$language' \";\n }\n if ($religion != '') {\n $sql .= \"AND user_tab.user_caste = '$religion' \";\n }\n if ($filter_aged_from != '') {\n $sql .= \"AND DATEDIFF(CURRENT_DATE, user_profile_tab.user_dob) >= ('$filter_aged_from' * 365.25) \";\n }\n if ($filter_aged_to != '') {\n $sql .= \"AND DATEDIFF(CURRENT_DATE, user_profile_tab.user_dob) <= ('$filter_aged_to' * 365.25) \";\n }\n $sql .= \"AND user_tab.user_status='1' AND user_tab.user_doc_verified='1' ORDER BY user_tab.user_id DESC\";\n\n $result = $this->db->query($sql);\n if ($result->num_rows() <= 0) {\n return false;\n } else {\n return $result->result_array();\n }\n }",
"function filter_users( $type, $limit = null, $page = 1, $user_id = false, $search_terms = false, $populate_extras = true ) {\r\n\t\t\t\tglobal $wpdb, $bp;\r\n\r\n\t\t\t\tif ( !function_exists('xprofile_install') )\r\n\t\t\t\t\twp_die( 'This requires BuddyPress Extended Profiles to be turned on', 'bp-memberfilter' );\r\n\r\n\t\t\t\t$sql = array();\r\n\r\n\t\t\t\t$sql['select_main'] = \"SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.display_name, u.user_email\";\r\n\r\n\t\t\t\tif ( 'active' == $type || 'online' == $type )\r\n\t\t\t\t\t$sql['select_active'] = \", um.meta_value as last_activity\";\r\n\r\n\t\t\t\tif ( 'popular' == $type )\r\n\t\t\t\t\t$sql['select_popular'] = \", um.meta_value as total_friend_count\";\r\n\r\n\t\t\t\tif ( 'alphabetical' == $type )\r\n\t\t\t\t\t$sql['select_alpha'] = \", pd.value as fullname\";\r\n\r\n\t\t\t\t$sql['from'] = \"FROM \" . CUSTOM_USER_TABLE . \" u LEFT JOIN \" . CUSTOM_USER_META_TABLE . \" um ON um.user_id = u.ID\";\r\n\r\n\t\t\t\t// XProfile field prefix\r\n\t\t\t\t$field = \"field_\";\r\n\r\n\t\t\t\t// Construct pieces based on filter criteria\r\n\t\t\t\tforeach ( $_REQUEST as $key => $value ) {\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t\tif ( strstr( $key, $field ) && !empty( $value ) ) {\r\n\r\n\t\t\t\t\t\t// Get ID of field to filter\r\n\t\t\t\t\t\t$field_id = substr( $key, 6, strlen( $key ) - 6 );\r\n\t\t\t\t\t\t$field_value = $value;\r\n\r\n\t\t\t\t\t\t$sql['join_profiledata'] .= \"LEFT JOIN {$bp->profile->table_name_data} pd$i ON u.ID = pd$i.user_id \";\r\n\r\n\t\t\t\t\t\tif ( !$sql['where'] )\r\n\t\t\t\t\t\t\t$sql['where'] = 'WHERE ' . bp_core_get_status_sql( 'u.' );\r\n\r\n\t\t\t\t\t\t$sql['where_profiledata'] .= \"AND pd$i.field_id = {$field_id} AND pd$i.value LIKE '%%$field_value%%' \";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( 'active' == $type || 'online' == $type )\r\n\t\t\t\t\t$sql['where_active'] = \"AND um.meta_key = 'last_activity'\";\r\n\r\n\t\t\t\tif ( 'popular' == $type )\r\n\t\t\t\t\t$sql['where_popular'] = \"AND um.meta_key = 'total_friend_count'\";\r\n\r\n\t\t\t\tif ( 'online' == $type )\r\n\t\t\t\t\t$sql['where_online'] = \"AND DATE_ADD( FROM_UNIXTIME(um.meta_value), INTERVAL 5 MINUTE ) >= NOW()\";\r\n\r\n\t\t\t\tif ( 'alphabetical' == $type )\r\n\t\t\t\t\t$sql['where_alpha'] = \"AND pd.field_id = 1\";\r\n\r\n\t\t\t\tif ( $user_id && function_exists( 'friends_install' ) ) {\r\n\t\t\t\t\t$friend_ids = friends_get_friend_user_ids( $user_id );\r\n\t\t\t\t\t$friend_ids = $wpdb->escape( implode( ',', (array)$friend_ids ) );\r\n\r\n\t\t\t\t\t$sql['where_friends'] = \"AND u.ID IN ({$friend_ids})\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( $search_terms && function_exists( 'xprofile_install' ) ) {\r\n\t\t\t\t\t$search_terms = like_escape( $wpdb->escape( $search_terms ) );\r\n\t\t\t\t\t$sql['where_searchterms'] = \"AND pd.value LIKE '%%$search_terms%%'\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tswitch ( $type ) {\r\n\t\t\t\t\tcase 'active': case 'online': default:\r\n\t\t\t\t\t\t$sql[] = \"ORDER BY FROM_UNIXTIME(um.meta_value) DESC\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'newest':\r\n\t\t\t\t\t\t$sql[] = \"ORDER BY u.user_registered DESC\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'alphabetical':\r\n\t\t\t\t\t\t$sql[] = \"ORDER BY pd.value ASC\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'random':\r\n\t\t\t\t\t\t$sql[] = \"ORDER BY rand()\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'popular':\r\n\t\t\t\t\t\t$sql[] = \"ORDER BY CONVERT(um.meta_value, SIGNED) DESC\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( $limit && $page )\r\n\t\t\t\t\t$sql['pagination'] = $wpdb->prepare( \"LIMIT %d, %d\", intval( ( $page - 1 ) * $limit), intval( $limit ) );\r\n\r\n\t\t\t\t// Get paginated results\r\n\t\t\t\t$paged_users = $wpdb->get_results( $wpdb->prepare( join( ' ', (array)$sql ) ) );\r\n\r\n\t\t\t\t// Re-jig the SQL so we can get the total user count\r\n\t\t\t\tunset( $sql['select_main'] );\r\n\r\n\t\t\t\tif ( !empty( $sql['select_active'] ) )\r\n\t\t\t\t\tunset( $sql['select_active'] );\r\n\r\n\t\t\t\tif ( !empty( $sql['select_popular'] ) )\r\n\t\t\t\t\tunset( $sql['select_popular'] );\r\n\r\n\t\t\t\tif ( !empty( $sql['select_alpha'] ) )\r\n\t\t\t\t\tunset( $sql['select_alpha'] );\r\n\r\n\t\t\t\tif ( !empty( $sql['pagination'] ) )\r\n\t\t\t\t\tunset( $sql['pagination'] );\r\n\r\n\t\t\t\tarray_unshift( $sql, \"SELECT COUNT(DISTINCT u.ID)\" );\r\n\r\n\t\t\t\t// Get total user results\r\n\t\t\t\t$total_users = $wpdb->get_var( $wpdb->prepare( join( ' ', (array)$sql ) ) );\r\n\r\n\t\t\t\t// Lets fetch some other useful data in a separate queries\r\n\t\t\t\t// This will be faster than querying the data for every user in a list.\r\n\t\t\t\t// We can't add these to the main query above since only users who have\r\n\t\t\t\t// this information will be returned (since the much of the data is in\r\n\t\t\t\t// usermeta and won't support any type of directional join)\r\n\t\t\t\tif ( is_array( $paged_users ) )\r\n\t\t\t\t\tforeach ( $paged_users as $user )\r\n\t\t\t\t\t\t$user_ids[] = $user->id;\r\n\r\n\t\t\t\t$user_ids = $wpdb->escape( join( ',', (array)$user_ids ) );\r\n\r\n\t\t\t\t// Add additional data to the returned results\r\n\t\t\t\tif ( $populate_extras )\r\n\t\t\t\t\t$paged_users = BP_Core_User::get_user_extras( &$paged_users, &$user_ids );\r\n\r\n\t\t\t\t// Return to lair\r\n\t\t\t\treturn array( 'users' => $paged_users, 'total' => $total_users );\r\n\t\t\t}",
"public function searchProfile($name){\n return $this->securityDAO->searchProfilesDAO($name);\n }",
"function removeProfileFromSearch($SearchParamtersObj,$seperator,$loggedInProfileObj,$profileFromUrl=\"\",$noAwaitingContacts='',$removeMatchAlerts=\"\",$notInArray = '',$showOnlineArr='',$getFromCache = 0,$tempContacts = \"\")\n\t{\n\t\t//print_r($SearchParamtersObj);die;\n\t\tif($profileFromUrl)\n\t\t{\n\t\t\tif($SearchParamtersObj->getIgnoreProfiles())\n \t$SearchParamtersObj->setIgnoreProfiles($SearchParamtersObj->getIgnoreProfiles().\" \".$profileFromUrl);\n \telse\n \t$SearchParamtersObj->setIgnoreProfiles($profileFromUrl);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$pid = $loggedInProfileObj->getPROFILEID();\n\t\t\tif(get_class($SearchParamtersObj) == \"FeaturedProfile\")\n\t\t\t{\n\t\t\t\t$fplObj = new NEWJS_FEATURED_PROFILE_LOG(SearchConfig::getSearchDb());\n\t\t\t\t$profiles = $fplObj->getProfilesToIgnore($pid,$seperator);\n\t\t\t\tif($profiles)\n\t\t\t\t{\n\t\t\t\t\tif($SearchParamtersObj->getIgnoreProfiles())\n\t\t\t\t\t\t$SearchParamtersObj->setIgnoreProfiles($SearchParamtersObj->getIgnoreProfiles().\" \".$profiles);\n\t\t\t\t\telse\n\t\t\t\t\t\t$SearchParamtersObj->setIgnoreProfiles($profiles);\t\n\t\t\t\t}\n\t\t\t\tunset($fplObj);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($pid)\n\t\t\t\t{\n if($getFromCache == 1){\n $memObject=JsMemcache::getInstance();\n $hideArr = $memObject->get('SEARCH_MA_IGNOREPROFILE_'.$pid);\n }\n if(!$hideArr){\n /* ignored profiles two way */\n $IgnoredProfilesObj = new IgnoredProfiles();\n $hideArr = $IgnoredProfilesObj->listIgnoredProfile($pid,$seperator);\n\n /* contacted profiles */\n $Obj = new ContactsRecords;\n $hideArr.= $Obj->getContactsList($pid,$seperator,$noAwaitingContacts);\n \n if($getFromCache == 1){\n $memObject->set('SEARCH_MA_IGNOREPROFILE_'.$pid,$hideArr,SearchConfig::$matchAlertCacheLifetime);\n }\n }\n\t\t\t\t\t/** matchAlerts Profile **/\n\t\t\t\t\t\n\t\t\t\t\tif($removeMatchAlerts)\n\t\t\t\t\t{\n\t\t\t\t\t\t$matchalerts_LOG = new matchalerts_LOG();\n\t\t\t\t\t\t$hideArr.= $matchalerts_LOG->getProfilesSentInMatchAlerts($pid,$seperator);\n\t\t\t\t\t}\n\n\n\t\t\t\t\t\n\t\t\t\t\t$request = sfContext::getInstance()->getRequest();\t\n\t\t\t\t\tif($request->getParameter('hitFromMyjs') == 1 && $request->getParameter('caching') == 0)\n\t\t\t\t\t{\t\n\t\t\t\t\t$stype = $request->getParameter('stype');\t\n\t\t\t\t\t$listnameForMyjs = $request->getParameter('listingName');\n\t\t\t\t\t$cacheCriteria = MyjsSearchTupplesEnums::getListNameForCaching($listnameForMyjs);\n\n\n\t $forNextPrev = JsMemcache::getInstance()->get(\"cached\".$cacheCriteria.\"Myjs\".$pid);\n\t\t\t\t\t\t$forNextPrev = unserialize($forNextPrev);\n\t\t\t\t\t\tif(is_array($forNextPrev))\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t$forNextPrevTemp = $forNextPrev;\n\t\t\t\t\t\t\t$forNextPrev = implode(\" \",$forNextPrevTemp);\n\t\t\t\t\t\t\t$hideArr.= $forNextPrev;\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\t\n\t\t\t\t}\n\t\t\t\t// adding code to remove temporary contacts sent by the user while the user is unscreened.\n\t\t\t\tif($tempContacts)\n\t\t\t\t{\t\t\n\t\t\t\t\t$contactsTempObj = new NEWJS_CONTACTS_TEMP(SearchConfig::getSearchDb());\n\t\t\t\t\t$hideArr.= $contactsTempObj->getTempContactProfilesForUser($pid,$seperator);\n\t\t\t\t}\n\t\t\t\tif($SearchParamtersObj->getONLINE()==SearchConfig::$onlineSearchFlag)\n\t\t\t\t/* For Online search */\n\t\t\t\t{\n\t\t\t\t\t$ChatLibraryObj = new ChatLibrary(SearchConfig::getSearchDb());\n\t\t\t\t\t$tempArr = $ChatLibraryObj->findOnlineProfiles($seperator,$SearchParamtersObj);\n\t\t\t\t\t$SearchParamtersObj->setOnlineProfiles($tempArr);\n\t\t\t\t\tunset($tempArr);\n\t\t\t\t}\n\t\t\t\tif($SearchParamtersObj->getVIEWED() && $pid)\n\t\t\t\t/*Viewed - Not Viewed Clusters */\n\t\t\t\t{\n\t\t\t\t\t$ViewedLogObj = new ViewedLog;\n\t\t\t\t\tif($SearchParamtersObj->getVIEWED()==$this->viewed)\n\t\t\t\t\t{\n\t\t\t\t\t\t$showArrCluster=1;\n\t\t\t\t\t\t$showArr.= $ViewedLogObj->findViewedProfiles($pid,$seperator);\n\t\t\t\t\t}\n\t\t\t\t\telseif($SearchParamtersObj->getVIEWED()==$this->notViewed)\n\t\t\t\t\t\t$hideArr.= $ViewedLogObj->findViewedProfiles($pid,$seperator);\n\t\t\t\t}\n\t\t\t\tif( ($SearchParamtersObj->getMATCHALERTS_DATE_CLUSTER() || $SearchParamtersObj->getKUNDLI_DATE_CLUSTER())&& $pid)\n\t\t\t\t{\n\t\t\t\t\t$alreadyInShowStr = $SearchParamtersObj->getProfilesToShow();\n\t\t\t\t\t$SearchParamtersObj->setProfilesToShow('');\n\t\t\t\t\t$alreadyInShowArr = explode(\" \",$alreadyInShowStr);\n\t\t\t\t\tif($showArrCluster==1 && $showArr)\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($alreadyInShowArr1);\n\t\t\t\t\t\t$alreadyInShowArr1 = explode(\" \",$showArr);\n\t\t\t\t\t\tif($alreadyInShowArr && $alreadyInShowArr[0]!='')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$alreadyInShowArr = array_intersect($alreadyInShowArr1,$alreadyInShowArr);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\t\t\t\n\t\t\t\t\t\t\t$alreadyInShowArr = $alreadyInShowArr1;\n\t\t\t\t\t}\n\t\t\t\t\tif($SearchParamtersObj->getMATCHALERTS_DATE_CLUSTER())\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$week= $SearchParamtersObj->getMATCHALERTS_DATE_CLUSTER();\n\t\t\t\t\t\tif($week=='All')\n\t\t\t\t\t\t\t$week='';\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$weekArr = explode(\",\",$week);\n\t\t\t\t\t\t\trsort($weekArr);\n\t\t\t\t\t\t\t$week = $weekArr[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//if($week || $SearchParamtersObj->getNEWSEARCH_CLUSTERING() || ($_GET[\"moreLinkCluster\"] && in_array($_GET[\"moreLinkCluster\"],array('OCCUPATION','EDU_LEVEL_NEW'))))\n\t\t\t\t\t\t//{\n\t\t\t\t\t\t\t//$MatchAlerts = new MatchAlerts();\n\t\t\t\t\t\t\t//$matArr1 = $MatchAlerts->getProfilesWithOutSortishowOnlineArrng($pid,$week);\n\t\t\t\t\t\t//}\n\t\t\t\t\t\t//else\n\t\t\t\t\t\t\t//$matArr1 = $SearchParamtersObj->getAlertsDateConditionArr();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t//if($week=='')\n\t\t\t\t\t\t//\t$matArr1 = $SearchParamtersObj->getAlertsDateConditionArr();\n\t\t\t\t\t\t//else{\n\t\t\t\t\t\t\t\t$MatchAlerts = new MatchAlerts();\n\t\t\t\t\t\t\t$matArr1 = $MatchAlerts->getProfilesWithOutSorting($pid,$week);\n\t\t\t\t\t\t//}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$matArr1 = KundliAlerts::getProfilesWithOutSorting($pid);\n\t\t\t\t\tif(is_array($matArr1))\n\t\t\t\t\t\t$matArr = array_keys($matArr1);\n\t\t\t $SearchParamtersObj->setAlertsDateConditionArr($matArr1);\n\t\t\t\t\tunset($matArr1);\n\t\t\t\t\tif($matArr)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($alreadyInShowArr && $alreadyInShowArr[0]!='')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$intersectArr = array_intersect($matArr,$alreadyInShowArr);\n\t\t\t\t\t\t\tif($intersectArr)\n\t\t\t\t\t\t\t\t$showArr= implode(\" \",$intersectArr);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$showArr = '0 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\tif($showArrCluster==1)\n\t\t\t\t\t\t\t\t$showArr = '0 0';\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$showArr= implode(\" \",$matArr);\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\t$showArr = '0 0';\n\t\t\t\t}\n //remove profiles for AP cron\n if($notInArray)\n {\n $hideArr.= $notInArray;\n }\n\t\t\t\tif($hideArr)\n\t\t\t\t{\n\t\t\t\t\tif($SearchParamtersObj->getIgnoreProfiles())\n\t\t\t\t\t\t$SearchParamtersObj->setIgnoreProfiles($SearchParamtersObj->getIgnoreProfiles().\" \".$hideArr);\n\t\t\t\t\telse\n\t\t\t\t\t\t$SearchParamtersObj->setIgnoreProfiles($hideArr);\n\t\t\t\t}\n\t\t\t\tif($showOnlineArr)\n\t\t\t\t{\n\t\t\t\t\t$showArr.= \" \".$showOnlineArr;\n\t\t\t\t}\n\t\t\t\tif($showArr)\n\t\t\t\t{\n\t\t\t\t\tif($SearchParamtersObj->getProfilesToShow())\n\t\t\t\t\t\t$SearchParamtersObj->setProfilesToShow($SearchParamtersObj->getProfilesToShow().\" \".$showArr);\n\t\t\t\t\telse\n\t\t\t\t\t\t$SearchParamtersObj->setProfilesToShow($showArr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static function getDetailsProfile(){\n return Profile::find()\n ->joinWith('userService')\n ->joinWith('user')\n ->where(['profile.status' => 10, 'user.status'=> 10])\n ->distinct()->all();\n }",
"function searchById() {\n $oAccesoDatos = new AccesoDatos();\n $sQuery = \"\";\n $aFila = null;\n $bRet = false;\n if ($this -> id == \"\")\n throw new Exception(\"UserProfile->searchById(): error de codificación, faltan datos\");\n else {\n if ($oAccesoDatos -> conectar()) {\n $sQuery = \"SELECT id, first_name, last_name, about_me, url_img, phone_number, address, birthday, country, gender\n FROM app_user_profile \n WHERE id = '\" . $this -> id . \"'\";\n $aFila = $oAccesoDatos -> ejecutarConsulta($sQuery);\n $oAccesoDatos -> desconectar();\n if ($aFila) {\n $this -> id = $aFila[0][0];\n $this -> first_name = $aFila[0][1];\n $this -> last_name = $aFila[0][2];\n $this -> about_me = $aFila[0][3];\n $this -> url_img = $aFila[0][4];\n $this -> phone_number = $aFila[0][5];\n $this -> address = $aFila[0][6];\n $this -> birthday = $aFila[0][7];\n $this -> country = $aFila[0][8];\n $this -> gender = $aFila[0][9];\n $bRet = true;\n }\n }\n }\n return $bRet;\n }",
"function search(){\n\t\t$query = $this->uri->uri_to_assoc(3);\n\t\t$q = base64_decode($query['q']);\n\t\t$limit = isset($query['limit']) ? $query['limit'] : null;\n\n\t\t//print_r($query);\n\t\t$this->load->model('users');\n\t\t$results = $this->users->search($q, $limit);\n\t\tif (count($results) == 0){ //if I empty try with wildcard\n\t\t\t$results = $this->users->search(\"%$q\", $limit);\n\t\t}\n//\t\tprint_r($results);\n\t\t$users = array();\n\t\t//$unique = array();\n\t\tfor ($i = 0; $i < count($results); $i++){\n\t\t\t$users[] = array(\n\t\t\t\t'id' => $results[$i]['user_id'],\n\t\t\t\t'email' => (isset($results[$i]['email'])) ? $results[$i]['email'] : \"\",\n\t\t\t\t'value' => $results[$i]['display_name']\n\t\t\t);\n\t\t}\n\n\t\t$this->output\n ->set_content_type('application/json')\n ->set_output(json_encode($users));\n\t}",
"public function getByProfileScore()\n {\n return $this->tutor\n ->live()\n ->whereHas('profile', function($q) {\n $q->where('quality', '!=', '0');\n })\n ->select('users.*', $this->database->raw(\"(\n select `profile_score`\n from `user_profiles`\n where `user_profiles`.`user_id` = `users`.`id`\n ) as `profile_score`\"))\n ->orderBy('profile_score')\n ->takePage($this->page, $this->perPage)\n ->get();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filters the sidebar markup for accessibility. Removes invalid span for comments and removes links for thumbnails when no thumbnail is present | function ucinews_filter_sidebar($sidebarName){
ob_start();
$str = '';
$bool = dynamic_sidebar( $sidebarName );
if ( $bool ){
$str = ob_get_contents();
$str = "<li><ul>".$str."</ul></li>";
$doc = new DOMDocument();
$doc->loadXML($str);
$xpath = new DomXpath($doc);
$elements = $xpath->query("//*[@id='bunyad-latest-posts-widget-2']/ul/li/div/span");
if($elements!==False){
foreach($elements as $element){
$element->parentNode->removeChild($element);
}
}
$elements = $xpath->query("//*[@id='bunyad-latest-posts-widget-2']/ul/li/a");
if($elements!==False){
foreach($elements as $element){
if($element->firstChild->nodeType!=XML_ELEMENT_NODE){
$element->parentNode->removeChild($element);
}
}
}
$str = $doc->saveXML($doc->documentElement, LIBXML_NOXMLDECL);
}
ob_end_clean();
return $str;
} | [
"function cdn_adjust_sidebar() {\n\tif ( is_page_template() || is_search() ) {\n\t\tremove_action( 'genesis_sidebar', 'genesis_do_sidebar' );\n\t\tadd_action( 'genesis_sidebar', 'cdn_do_lpht_sidebar' );\n\t}\n\telse if( is_category() || is_404() ) {\n\t\tremove_action( 'genesis_sidebar', 'genesis_do_sidebar' );\n\t\tremove_action( 'genesis_after_content', 'genesis_get_sidebar' );\n\t}\n}",
"function remove_sidebar() {\n\t\t$post = $GLOBALS['post'];\n\n\t\tif ( $post->post_type == 'presentation' )\n\t\t\tadd_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );\n\t}",
"public function sanitize_sidebar_widgets($widget_ids)\n {\n }",
"function spotfinder_remove_sidebar() {\r\n\r\n /* un register the category page and detail page sidebar */\r\n $args = get_option('templatic_custom_taxonomy');\r\n $args1 = get_option('templatic_custom_post');\r\n $exclude_array = array('event', 'listing', 'property');\r\n if ($args):\r\n foreach ($args as $key => $_args) {\r\n if ((in_array($_args['post_type'], $exclude_array) || file_exists(get_stylesheet_directory() . \"/taxonomy-\" . $_args[\"labels\"][\"singular_name\"] . \".php\")) && $_args['post_type'] != 'classified') {\r\n unregister_sidebar('after_' . $_args[\"labels\"][\"singular_name\"] . '_header');\r\n /* Listing page Sidebar bar */\r\n $_name = @$args1[$_args[\"post_slug\"]]['labels']['name'];\r\n unregister_sidebar($_args[\"labels\"][\"singular_name\"] . '_listing_sidebar');\r\n\r\n register_sidebars(1, array('id' => '' . $_args[\"labels\"][\"singular_name\"] . '_listing_above_content', 'name' => apply_filters('listing_page_sidebar_title', sprintf(__('%s Category - Above Content', TDOMAIN), ucfirst($_name)), $_name), 'description' => sprintf(__('Display widgets on %s category pages above content.', TDOMAIN), $_name), 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">', 'after_widget' => '</div>', 'before_title' => '<h3 class=\"widget-title\">', 'after_title' => '</h3>'));\r\n /* Single post Type Sidebar bar */\r\n unregister_sidebar($_args[\"post_slug\"] . '_detail_sidebar');\r\n }\r\n /* Add sidebar for listing page below header */\r\n }\r\n endif;\r\n\r\n $args = get_option('templatic_custom_tags');\r\n $args1 = get_option('templatic_custom_post');\r\n if ($args):\r\n foreach ($args as $key => $_args) {\r\n $_name = @$args1[$_args[\"post_slug\"]]['labels']['name'];\r\n if ((in_array($_args['post_type'], $exclude_array) || file_exists(get_stylesheet_directory() . \"/taxonomy-\" . $_args[\"labels\"][\"singular_name\"] . \".php\")) && $_args['post_type'] != 'classified') {\r\n /* Listing page Sider bar */\r\n\r\n unregister_sidebar('' . $_args[\"labels\"][\"singular_name\"] . '_tag_listing_sidebar');\r\n\r\n /* category page above content */\r\n register_sidebars(1, array('id' => '' . $_args[\"labels\"][\"singular_name\"] . '_listing_above_content', 'name' => apply_filters('listing_page_sidebar_title', sprintf(__('%s Tags - Above Content', TDOMAIN), ucfirst($_name)), $_name), 'description' => sprintf(__('Display widgets on %s Tags pages above content.', TDOMAIN), $_name), 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">', 'after_widget' => '</div>', 'before_title' => '<h3 class=\"widget-title\">', 'after_title' => '</h3>'));\r\n }\r\n }\r\n endif;\r\n\r\n unregister_sidebar('after_event_header');\r\n}",
"function remove_redundant_markup() {\n\t// Remove .site-inner everywhere.\n\tadd_filter( 'genesis_markup_site-inner', '__return_null' );\n\t// Remove .content-sidebar-wrap only when we're using full width content.\n\tif ( 'full-width-content' === genesis_site_layout() ) {\n\t\tadd_filter( 'genesis_markup_content-sidebar-wrap', '__return_null' );\n\t}\n}",
"function cleanyeti_widget_area_primary_aside() {\n do_action('widget_area_primary_aside');\n}",
"public function renderAdminSidebar()\r\n\t{\r\n\t\treturn;\r\n\t}",
"function remove_some_widgets(){\n\n\tunregister_sidebar( 'secondary-aside' );\n\tunregister_sidebar( '1st-subsidiary-aside' );\n\tunregister_sidebar( '2nd-subsidiary-aside' );\n\tunregister_sidebar( '3rd-subsidiary-aside' );\n\tunregister_sidebar( 'index-top' );\n\tunregister_sidebar( 'index-insert' );\n\tunregister_sidebar( 'index-bottom' );\n\tunregister_sidebar( 'single-top' );\n\tunregister_sidebar( 'single-insert' );\n\tunregister_sidebar( 'single-bottom' );\n\tunregister_sidebar( 'page-top' );\n\tunregister_sidebar( 'page-bottom' );\n}",
"private static function get_raw_sidebar_widgets() {\n\t\treturn self::$unfiltered_sidebar_widgets;\n\t}",
"function mk_filter_native_widgets_edited( $widget_output, $widget_type, $widget_id, $sidebar_id ) {\n\t// echo 'Widget type: ' . $widget_type;\n $html = $widget_output;\n\n if ( 'calendar' == $widget_type ) {\n \t$html = phpQuery::newDocument( $widget_output );\n \tpq('#prev')->prepend(Mk_SVG_Icons::get_svg_icon_by_class_name(false, 'mk-icon-chevron-left', 14));\n \tpq('#next')->prepend(Mk_SVG_Icons::get_svg_icon_by_class_name(false, 'mk-icon-chevron-right', 14));\n }\n\n if ( 'nav_menu' == $widget_type ) {\n \t$html = phpQuery::newDocument( $widget_output );\n \tpq('li:not(.menu-item-has-children) a')->prepend(Mk_SVG_Icons::get_svg_icon_by_class_name(false, 'mk-icon-circle'));\n }\n\n if ( 'meta' == $widget_type ) {\n \t$html = phpQuery::newDocument( $widget_output );\n \tpq('a')->prepend(Mk_SVG_Icons::get_svg_icon_by_class_name(false, 'mk-icon-angle-right', 14));\n }\n\n if ( 'rss' == $widget_type ) {\n \t$html = phpQuery::newDocument( $widget_output );\n \tpq('li a')->prepend(Mk_SVG_Icons::get_svg_icon_by_class_name(false, 'mk-icon-angle-right', 14));\n }\n\n if ( 'recent-comments' == $widget_type ) {\n \t$html = phpQuery::newDocument( $widget_output );\n \tpq('.recentcomments')->prepend(Mk_SVG_Icons::get_svg_icon_by_class_name(false, 'mk-icon-comment-o', 14));\n }\n\n return $html;\n}",
"function wpi_sidebar_dir_filter(){\n\t\n\t$sc = is_at();\n\t$direction = false;\n\t$css = PHP_EOL.PHP_T;\n\t$NL = PHP_EOL.PHP_T;\n\t\t\n\tif (wpiSection::HOME == $sc){\n\t\t$direction = wpi_option('home_sidebar_position');\n\t\t\n\t\tif ($direction == 'left'){\t\t\n\t\t\t$css .= '.home #main,.home #main-bottom{float:right!important}'.$NL;\n\t\t\t$css .= '.home .hentry .postmeta-date{float:right!important;background-position:-82px 0px;margin: 0pt -30px 0pt 0pt !important}'.$NL;\n\t\t\t$css .= '.home .postmeta-date .date-month{padding:0pt}'.$NL; \n\t\t\t$css .= '.home .hentry{padding-left:0px}'.$NL;\n\t\t\t$css .= '.home .hentry .entry-title{padding:0px 10px 0px 0px}'.$NL;\n\t\t\t$css .= '.home #sidebar{margin-left:10px}';\n\t\t\t\n\t\t\tif (wpi_option('frontpage_style') == 'frontpage-a.php'){\n\t\t\t\t$css .= '.frontpage-type-a #main{padding-left:10px}'.$NL;\n\t\t\t}\n\t\t}\t\t\n\t}\n\t\n\tif ($direction) echo $css;\n}",
"function remove_sidebar() {\n\tglobal $post, $up_options;\n\tif(!is_single()){\n\t\tif(!$up_options->enablesidebar){\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t} elseif(get_post_meta($post->ID,\"custom_post_template\",true) == \"blog.php\"){\n\t\treturn TRUE;\n\t}\n}",
"function remove_sidebar() {\r\n if(is_page()){\r\n return TRUE;\r\n } else {\r\n return FALSE;\r\n }\r\n}",
"function acf_allow_unfiltered_html() { }",
"public static function search_sidebar(){\n if(ICL_LANGUAGE_CODE == \"en\"):\n\n ?>\n <div class=\"sidebar\">\n <?\n $blog_cta = __(\"View All Blog Posts\", \"digital-river\");\n $title = __(\"Recent Blog Posts\", \"digital-river\");\n\n $blog_array = Blog::get_Recent();\n\n $recent = true;\n // else:\n // $Resources_Section = new ResourcesSection();\n // $blog_results = $Resources_Section->resourcesJSON(array_column($blog_array1, \"ID\"));\n // $blog_array = json_decode($blog_results);\n ?>\n <div class=\"eyebrow-wrapper clearfix\">\n <h2 class=\"eyebrow\"><?php echo $title; ?></h2>\n <a class=\"brackets view-all\" href=\"/resources/blog\"><?php echo $blog_cta; ?></a>\n </div>\n <?php\n foreach ($blog_array as $result):\n $Detailed_List_Item = new DetailedListItem($result->post_title, $result->post_excerpt, $result->guid);\n $Detailed_List_Item->display();\n endforeach;\n ?>\n </div>\n <?\n endif;\n\n }",
"protected function sidebar() {\n\n\t\t\t?>\t\t<div class=\"sidebar\">\n\t\t\t\t\t\t<a href=\"<?php echo $GLOBALS['adminFilePath'] ?>/edit?exhibitions\">exhibitions</a>\n\t\t\t\t\t\t<a href=\"<?php echo $GLOBALS['adminFilePath'] ?>/edit?events\">events</a>\n\t\t\t\t\t\t<a href=\"<?php echo $GLOBALS['adminFilePath'] ?>/edit?static-pages\">static pages</a>\n\t\t\t\t\t</div>\n\t\t\t<?php\n\t\t}",
"function wp_register_unused_sidebar() {\n }",
"private function filter_content() {\n\t\tadd_filter( 'neve_top_bar_content', 'wptexturize' );\n\t\tadd_filter( 'neve_top_bar_content', 'convert_smilies' );\n\t\tadd_filter( 'neve_top_bar_content', 'convert_chars' );\n\t\tadd_filter( 'neve_top_bar_content', 'wpautop' );\n\t\tadd_filter( 'neve_top_bar_content', 'shortcode_unautop' );\n\t\tadd_filter( 'neve_top_bar_content', 'do_shortcode' );\n\t}",
"function acf_allow_unfiltered_html()\n{\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get map rotate control. | public function getRotateControl(); | [
"public function getRotateControl()\n {\n return $this->rotateControl;\n }",
"public function getRotate()\r\n\t{\r\n\t\treturn $this->rotate;\r\n\t}",
"protected function getIvoryGoogleMap_RotateControlService()\n {\n return $this->get('ivory_google_map.rotate_control.builder')->build();\n }",
"public function getRotation();",
"public function getRotation() {}",
"public function setRotateControl($value);",
"public function getRotation()\r\n {\r\n return $this->getAdapter()->getRotation();\r\n }",
"public function getMapTypeControl()\n {\n return $this->mapTypeControl;\n }",
"protected function renderRotateControls()\n {\n if ($this->showRotateControls === false) {\n return '';\n }\n\n $html = [];\n\n // wrapper\n if ($this->rotateControlsWrapperOptions !== false) {\n $rotateControlsWrapperTag = ArrayHelper::remove($this->rotateControlsWrapperOptions, 'tag', 'div');\n $html[] = Html::beginTag($rotateControlsWrapperTag, $this->rotateControlsWrapperOptions);\n }\n\n // rotate left button\n $html[] = $this->renderButton('rotateLeftButtonOptions');\n\n // rotate right button\n $html[] = $this->renderButton('rotateRightButtonOptions');\n\n // end wrapper\n if ($this->rotateControlsWrapperOptions !== false) {\n $html[] = Html::endTag($rotateControlsWrapperTag);\n }\n\n return implode(\"\\n\", $html);\n }",
"public function getPanControl()\n {\n return $this->panControl;\n }",
"public function getRotation(): array {\n\t\treturn $this->rotation;\n\t}",
"public function getRotationAngle() {\r\n return $this->rotateDegree;\r\n }",
"public function getMapTypeControl();",
"public function getAutoRotation() {\n return $this->autoRotation;\n }",
"public function handleRotate()\n {\n }",
"public function getControlPlane()\n {\n return $this->control_plane;\n }",
"public function getRotation(): float\n {\n return rad2deg($this->angle);\n }",
"function getControl()\n\t{\n\t\treturn $this->control;\n\t}",
"public function rotate()\n\t{\n\t\t// Allowed rotation values\n\t\t$degs = array(90, 180, 270, 'vrt', 'hor');\n\n\t\tif ($this->rotation_angle === '' OR ! in_array($this->rotation_angle, $degs))\n\t\t{\n\t\t\t$this->set_error('imglib_rotation_angle_required');\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Reassign the width and height\n\t\tif ($this->rotation_angle === 90 OR $this->rotation_angle === 270)\n\t\t{\n\t\t\t$this->width\t= $this->orig_height;\n\t\t\t$this->height\t= $this->orig_width;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->width\t= $this->orig_width;\n\t\t\t$this->height\t= $this->orig_height;\n\t\t}\n\n\t\t// Choose resizing function\n\t\tif ($this->image_library === 'imagemagick' OR $this->image_library === 'netpbm')\n\t\t{\n\t\t\t$protocol = 'image_process_'.$this->image_library;\n\t\t\treturn $this->$protocol('rotate');\n\t\t}\n\n\t\treturn ($this->rotation_angle === 'hor' OR $this->rotation_angle === 'vrt')\n\t\t\t? $this->image_mirror_gd()\n\t\t\t: $this->image_rotate_gd();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load the ACL to the Registry if is not there This function takes care about generating the acl from the db if the info is not in the registry and/or APC. If the acl is inside APC we load it from there. | public static function load(){
if(! self::_checkIfExist()) {
if(! $acl = self::_getFromApc()) {
$acl = self::_generateFromDb();
self::_storeInApc($acl);
}
self::_storeInRegistry($acl);
}
} | [
"public static function loadAcl(){\n global $db;\n\n $query = \"SELECT * FROM \" . TABLE_USER_ACL . \" ORDER BY LEVEL\";\n $rows = $db->getResultsArray($query);\n\n BuckysUserAcl::$USER_ACL = $rows;\n\n return;\n }",
"function fetchAcl() {\n // Add roles to ACL\n $factory = new Acl_Role_Factory();\n $roles = $factory->fetchAll();\n\n $roletree = new Zoo_Object_Tree($roles, 'id', 'parent');\n $this->addRolesFromTree($roletree);\n\n // Add resources to ACL\n $factory = new Acl_Resource_Factory();\n $resources = $factory->fetchAll();\n\n $resourcetree = new Zoo_Object_Tree($resources, 'id', 'parent');\n $this->addResourcesFromTree($resourcetree);\n\n // Add rules to ACL\n $factory = new Acl_Rule_Factory();\n $rules = $factory->fetchAll();\n foreach ($rules as $rule) {\n $role = $roletree->getByKey($rule->roleid);\n $resource = $resourcetree->getByKey($rule->resourceid);\n $privileges = null;\n if ($rule->privilege != \"\") {\n $privileges = $rule->privilege;\n if ($rule->type != \"\") {\n $privileges .= \".\" . $rule->type;\n }\n }\n $this->service->allow($role, $resource, $privileges);\n }\n try {\n Zoo::getService(\"cache\")->getCache('acl')->save($this->service, \"acl\");\n } catch (Zoo_Exception_Service $e) {\n // Cache unavailable\n }\n }",
"private function _loadAclRules()\n {\n $this->_loadRoles();\n $this->_loadResources();\n $this->_loadUsers();\n $this->_loadPermissions();\n }",
"protected function _loadAccess()\n {\n $this->access->load($this->auth, $this->role);\n }",
"protected static function initAcl () {\r\n $cache = self::getCache();\r\n $db = self::getDb();\r\n $selectRes = new Zend_Db_Select($db);\r\n $roleResources = $selectRes->from('mod_role_resource')\r\n ->query(Zend_Db::FETCH_GROUP)\r\n ->fetchAll();\r\n //Zend_Registry::get ( 'logger' )->notice ( 'Role and Resources:' );\r\n //Zend_Registry::get ( 'logger' )->debug ( $roleResources );\r\n $acl = new Zend_Acl();\r\n $dbRoles = array(self::GUEST);\r\n $acl->addRole(self::GUEST);\r\n foreach ($roleResources as $roleKey => $resources) {\r\n $role = strtolower($roleKey);\r\n if (! (self::GUEST === $role)) {\r\n if (! $acl->hasRole($role)) {\r\n $acl->addRole($role, self::GUEST);\r\n $dbRoles[] = $role;\r\n } else {\r\n Zend_Registry::get('logger')->debug(\r\n 'Duplicate role : \"' . $role . '\"');\r\n }\r\n }\r\n foreach ($resources as $key => $resource) {\r\n $res = strtolower(\r\n $resource['module_id'] . '_' . $resource['controller_id'] . '_' .\r\n $resource['action_id']);\r\n if (! $acl->has($res)) {\r\n $acl->addResource($res);\r\n }\r\n $acl->allow($role, $res);\r\n }\r\n }\r\n $commonAcl = array('acl'=>$acl, 'dbRoles' => $dbRoles);\r\n $cache->save($commonAcl, 'commonAcl');\r\n Zend_Registry::get('logger')->debug('Common ACL cached.');\r\n \r\n return $commonAcl;\r\n }",
"private function loadPermissions() {\n\tif ($this->permissionsloaded) {return;}\n\t//$mem = DStructMemCache::getInstance();\n\t//if (!$this->permissions = $mem->get(md5(get_class($this->activecontainer).$this->areaname.$this->activecontainer->getID()))) {\n\t\t$this->permissions = $this->activecontainer->permissions();\n\t//\t$mem->set(md5(get_class($this->activecontainer).$this->areaname.$this->activecontainer->getID()), $this->permissions);\n\t//}\n\t$this->permissionsloaded = true;\n}",
"function load_acl($uid) {\n global $sql,$default_acl;\n die((__FUNCTION__).\" is legacy and shouldn't be used. Someone fix that.\");\n \n $acl=$default_acl;\n $q=$sql->query(\"SELECT tr.r FROM usertokens ut JOIN tokenrights tr ON tr.t=ut.t WHERE ut.u='$uid'\");\n while($d=$sql->fetch($q)) {\n $acl[$d[r]]=1;\n }\n\n return $acl;\n}",
"function LoadACL($tag, $privilege, $useDefaults = 1)\t// @@@\n\t{\n\t\tif ((!$acl = $this->LoadSingle(\"\n\t\t\tSELECT \".mysql_real_escape_string($privilege).\"_acl\n\t\t\tFROM \".$this->GetConfigValue('table_prefix').\"acls\n\t\t\tWHERE `page_tag` = '\".mysql_real_escape_string($tag).\"'\n\t\t\tLIMIT 1\"\n\t\t\t)) && $useDefaults)\n\t\t{\n\t\t\t$acl = array(\n\t\t\t\t'page_tag' => $tag,\t\t\t// @@@ when is this needed? NEVER\n\t\t\t\t$privilege.'_acl' => $this->GetConfigValue('default_'.$privilege.'_acl')\n\t\t\t\t);\n\t\t}\n\t\t// @@@ normalize ACL before returning\n\t\treturn $acl;\n\t}",
"protected function _initAcl ( )\n {\n $acl = new Zend_Acl;\n $registry = $this->getRegistry();\n $registry->set('acl', $acl);\n }",
"abstract protected function getAcl();",
"protected function _saveAcl()\n {\n $registry = Zend_Registry::getInstance();\n $registry->set('acl', $this->_acl);\n }",
"protected function _loadAclClasses()\n {\n $loader = new Zend_Loader_PluginLoader(array(\n 'Brightfame_Acl_Role' => APPLICATION_PATH . '/../library/Brightfame/Acl/Role/'\n ));\n foreach (array('Guest', 'Member', 'Administrator') as $role) {\n $loader->load($role);\n }\n }",
"private function loadAccessoriesSubSec(){\n }",
"protected function _initAcl()\n {\n }",
"public function getAcl()\n { \n // instanciate the ACL\n $acl = new Zend_Acl(); \n // load the availble roles\n $systemRoles = TDProject_Core_Model_Utils_RoleUtil::getHome($this->getContainer())\n ->findAll();\n // load the system roles\n foreach ($systemRoles as $systemRole) {\n $this->_loadRole($acl, $systemRole);\n }\n\t // initialize the API\n\t $api = new TDProject_Core_Common_Api();\n\t $api->parse();\n // initialze the XPath expression\n $xPath = new DOMXPath($api);\n // load the DOMNodeList with the resources by a XPath query\n $resources = $xPath->query(\"/resources/resource/@name\");\n // iterate recursively over the found resources\n\t\t$this->_processFile($acl, $api, $resources);\n\t\t$this->_processDatabase($acl);\n\t\t// return the initialized ACL\n\t\treturn $acl;\n }",
"private function carregaACLResources(Zend_Acl &$acl)\n\t{\n\t\t// recuperando acoes da aplicacao\n\t\t$objsAcaoAplicacaoAtivos = Basico_OPController_AcaoAplicacaoOPController::getInstance()->retornaTodosObjetosAcaoAplicacaoAtivos();\n\n\t\t// verificando se as acoes foram carregadas\n\t\tif (count($objsAcaoAplicacaoAtivos) > 0) {\n\t\t\t// loop para carregar os \"resources\" do Zend_Acl\n\t\t\tforeach ($objsAcaoAplicacaoAtivos as $objAcaoAplicacaoAtivo) {\n\t\t\t\t// carregando os resources\n\t\t\t\t$acl->addResource(new Zend_Acl_Resource($this->retornaNomeAcaoAplicacaoCompleta($objAcaoAplicacaoAtivo->getModuloObject()->nome, $objAcaoAplicacaoAtivo->controller, $objAcaoAplicacaoAtivo->action)));\n\t\t\t}\n\t\t}\n\t}",
"public function getAcl()\n\t{\n\t\tif (!isset($this->persistent->acl)) {\n\n\t\t\t$acl = new AclList();\n\n\t\t\t$acl->setDefaultAction(Acl::DENY);\n\n\t\t\t// Register roles\n\t\t\t$roles = [\n\t\t\t\t'users' => new Role(\n\t\t\t\t\t'Users',\n\t\t\t\t\t'Member privileges, granted after sign in.'\n\t\t\t\t),\n\t\t\t\t'guests' => new Role(\n\t\t\t\t\t'Guests',\n\t\t\t\t\t'Anyone browsing the site who is not signed in is considered to be a \"Guest\".'\n\t\t\t\t)\n\t\t\t];\n\n\t\t\tforeach ($roles as $role) {\n\t\t\t\t$acl->addRole($role);\n\t\t\t}\n\n\t\t\t//Private area resources\n\t\t\t$privateResources = [\n\t\t\t\t'areas' => ['index', 'search', 'new', 'edit', 'save', 'create', 'delete'],\n\t\t\t\t'events' => ['index', 'search', 'new', 'edit', 'save', 'create', 'delete'],\n\t\t\t\t'exhibitors' => ['index','search', 'edit', 'delete','testinvio'],\n\t\t\t\t'notereservations' => ['index', 'search', 'new', 'edit', 'save', 'create', 'delete'],\n\t\t\t\t'reservations' => ['index','search', 'edit', 'delete', 'anteprimalettera','excelgen','facsimilefattura','daticatalogo','scrivinota'],\n\t\t\t\t'reservationservices' => ['index', 'search', 'new', 'edit', 'save', 'create', 'delete'],\n\t\t\t\t'services' => ['index', 'search', 'new', 'edit', 'save', 'create', 'delete'],\n\t\t\t\t'statireservations' => ['index', 'search', 'new', 'edit', 'save', 'create', 'delete'],\n\t\t\t\t'users' => ['index', 'search', 'new', 'edit', 'save', 'create', 'delete'],\n\t\t\t\t'index' => ['csvespositori','csvcatalogo','xlsespositori','xlscatalogo'],\n\t\t\t];\n\t\t\tforeach ($privateResources as $resource => $actions) {\n\t\t\t\t$acl->addResource(new Resource($resource), $actions);\n\t\t\t}\n\n\t\t\t//Public area resources\n\t\t\t$publicResources = [\n\t\t\t\t'index' => ['index'],\n\t\t\t\t'errors' => ['show401', 'show404', 'show500'],\n\t\t\t\t'session' => ['index', 'register', 'start', 'end', 'forgot','reset','newpass','savenewpassword'],\n\t\t\t\t'reservations' => ['new', 'save', 'create','invialettera'],\n\t\t\t\t'exhibitors' => [ 'new', 'nuovo', 'validate', 'save', 'create', 'coespositore','coespositorecreate'],\n\t\t\t];\n\t\t\tforeach ($publicResources as $resource => $actions) {\n\t\t\t\t$acl->addResource(new Resource($resource), $actions);\n\t\t\t}\n\n\t\t\t//Grant access to public areas to both users and guests\n\t\t\tforeach ($roles as $role) {\n\t\t\t\tforeach ($publicResources as $resource => $actions) {\n\t\t\t\t\tforeach ($actions as $action){\n\t\t\t\t\t\t$acl->allow($role->getName(), $resource, $action);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//Grant access to private area to role Users\n\t\t\tforeach ($privateResources as $resource => $actions) {\n\t\t\t\tforeach ($actions as $action){\n\t\t\t\t\t$acl->allow('Users', $resource, $action);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//The acl is stored in session, APC would be useful here too\n\t\t\t$this->persistent->acl = $acl;\n\t\t}\n\n\t\treturn $this->persistent->acl;\n\t}",
"private function & _getACL()\n {\n global $arrConf;\n\n if (is_null($this->_pACL)) {\n $pDB_acl = $this->_getDB($arrConf['elastix_dsn']['acl']);\n $this->_pACL = new paloACL($pDB_acl);\n }\n return $this->_pACL;\n }",
"public function getAcl() {\n//\t\t$acl = $this->cache->get('acl-cache');\n//\t\tif (!$acl) {\n // No existe, crear objeto ACL\n\n $acl = new Phalcon\\Acl\\Adapter\\Memory();\n $acl->setDefaultAction(Phalcon\\Acl::DENY);\n//\t\t\t$acl = $this->acl;\n\n $userroles = Role::find();\n\n $modelManager = Phalcon\\DI::getDefault()->get('modelsManager');\n\n $sql = \"SELECT Resource.name AS resource, Action.name AS action \n FROM Action\n JOIN Resource ON (Action.idResource = Resource.idResource)\";\n\n $results = $modelManager->executeQuery($sql);\n\n $userandroles = $modelManager->executeQuery('SELECT Role.name AS rolename, Resource.name AS resname, Action.name AS actname\n FROM Allowed\n JOIN Role ON (Role.idRole = Allowed.idRole) \n JOIN Action ON (Action.idAction = Allowed.idAction) \n JOIN Resource ON (Action.idResource = Resource.idResource)');\n\n //Registrando roles\n foreach ($userroles as $role) {\n $acl->addRole(new Phalcon\\Acl\\Role($role->name));\n }\n\n //Registrando recursos\n $resources = array();\n foreach ($results as $key) {\n if (!isset($resources[$key['resource']])) {\n $resources[$key['resource']] = array($key['action']);\n }\n $resources[$key['resource']][] = $key['action'];\n }\n\n foreach ($resources as $resource => $actions) {\n $acl->addResource(new Phalcon\\Acl\\Resource($resource), $actions);\n }\n\n //Relacionando roles y recursos desde la base de datos\n foreach ($userandroles as $role) {\n $acl->allow($role->rolename, $role->resname, $role->actname);\n }\n\n//\t\t\t$this->cache->save('acl-cache', $acl);\n//\t\t}\n // Retornar ACL\n $this->_dependencyInjector->set('acl', $acl);\n return $acl;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a divider (a horizontal line) spanning the entire width of the wireframe | public function addDivider():void {
$this->addHtml(new Html('<hr>'), self::COLUMN_BOTH);
} | [
"public function addDivider():void {\r\n\t\t$row = $this->addRow();\r\n\t\t$cell = $row->addCell();\r\n\t\t$cell->addWidth('sm', 12);\r\n\t\t$cell->setVerticalPadding(false);\r\n\t\t$cell->addElement(new Html('<hr>'));\r\n\t}",
"function sp_woo_divider_line() {\n\techo '<hr class=\"divider\" />';\n}",
"public function divider()\n {\n $this->makeItem('divider');\n }",
"public function addDivider() {\n $this->data[] = new SlackBlockDivider();\n return $this;\n }",
"function divider_shortcode() {\n\treturn '<hr>';\n}",
"function mts_wc_single_product_bottom_divider() {\n\t\techo '<hr />';\n\t}",
"public function getDivider()\n {\n return $this->divider;\n }",
"public function isDivider();",
"public static function divider()\n {\n ?>\n <li> </li><?php\n }",
"public function addDivider()\n\t{\n\t\t$this->items[] = new MenuItem(array('name' => 'divider'));\n\n\t\treturn $this;\n\t}",
"public function addDivider()\n {\n $this->items[] = new MenuItem(array('name' => 'divider'));\n\n return $this;\n }",
"function crumble_divider_1px($atts, $content = null) {\r\n\treturn '<div class=\"divider-1px\"></div>';\r\n}",
"private function renderRowSeparator()\r\n {\r\n if (0 === $count = $this->getNumberOfColumns()) {\r\n return;\r\n }\r\n\r\n $markup = $this->crossingChar;\r\n for ($column = 0; $column < $count; ++$column) {\r\n $markup .= str_repeat($this->horizontalBorderChar, $this->getColumnWidth($column))\r\n .$this->crossingChar\r\n ;\r\n }\r\n\r\n $this->output->writeln(sprintf($this->borderFormat, $markup));\r\n }",
"function PrintListDivider() {\n\t$image = \"img/blank.gif\";\n\t$background = \"img/strichel.gif\";\n\techo \"<tr valign=bottom>\";\n\techo \"<td bgcolor=#ffffff background=$background colspan=13><img src=$image width=1 height=1></td>\";\n\tEndRow();\n}",
"public static function makeSeparator() {\n self::make(\"------------------------------------------------------\", array(), FALSE, 0);\n }",
"private function drawSeparator() {\n\t\t\n\t\tif ($this->separator) {\n\t\t\t$imW = $this->separatorWidth;\n\t\t\t$imH = $this->paneHeight - $this->border * 2;\n\t\t\tif ($this->parObj->type == 'preview') {\n\t\t\t\tif ($imW <= 1) $imW = 2;\n\t\t\t}\n\t\t\t$imHZ = ($imH/3) * 0.25;\n\t\t\t$imBZ = ($imH/3) * 0.75;\n\n\t\t\t$im = imagecreatetruecolor($imW, $imH);\n\t\t\t$imWR = imagecreatetruecolor($imW, $imHZ);\n\t\t\t$white = imagecolorallocate($im, 250, 250, 250);\n\t\t\t$black = imagecolorallocate($im, 0, 0, 0);\n\t\t\timagefill($im, 0, 0, $black);\n\t\t\timagefilledrectangle($imWR, 0, 0, $imW, $imHZ, $this->paneColors['white']);\n\t\n\t\t\timagecopymerge($im, $imWR, 0, 0, 0, 0, $imW, $imHZ, 100);\n\t\t\timagecopymerge($im, $imWR, 0, ($imHZ + $imBZ), 0, 0, $imW, $imHZ, 100);\n\t\t\timagecopymerge($im, $imWR, 0, ($imHZ*2 + $imBZ*2), 0, 0, $imW, $imHZ, 100);\n\t\t\t\n\t\t\tif ($this->separator == 2) {\n\t\t\t\t$im_x = ($this->border - $this->separatorWidth);\n\t\t\t} else {\n\t\t\t\t$im_x = ($this->paneWidth - $this->border);\n\t\t\t}\n\n\t\t\timagecopymerge($this->paneIm, $im, $im_x, $this->border, 0, 0, $imW, $imH, 100);\n\t\t}\n\t}",
"public function isDivider()\n\t{\n\t\treturn $this->name == 'divider';\n\t}",
"private function addDivider(ItemInterface $menu)\n {\n $menu->addChild('divider-' . rand(1, 99999))\n ->setLabel('')\n ->setExtra('divider', true)\n ->setExtra('position', 15); // after manage report, we have 10 there\n }",
"public function addSeparator()\n\t{\n\t\t$this->body .= '<hr>';\n\t\treturn $this;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get CustomerNumber 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 getCustomerNumber(): ?string
{
return isset($this->CustomerNumber) ? $this->CustomerNumber : null;
} | [
"public function getCustomerNumber()\n {\n return $this->customerNumber;\n }",
"public function getCustomerPhone()\n {\n if (array_key_exists(\"customerPhone\", $this->_propDict)) {\n return $this->_propDict[\"customerPhone\"];\n } else {\n return null;\n }\n }",
"public function GetCustomerNumber()\n {\n $sCustNr = parent::GetCustomerNumber();\n if (empty($sCustNr)) {\n $oShop = TdbShop::GetInstance();\n $sCustNr = $oShop->GetNextFreeCustomerNumber();\n $aData = $this->sqlData;\n $aData['customer_number'] = $sCustNr;\n $this->LoadFromRow($aData);\n }\n\n return $this->fieldCustomerNumber;\n }",
"public function getCustomerPhone(){\n $attributeCustomer = JSON::decode($this->attribute1);\n return isset($attributeCustomer['phone_number']) ? $attributeCustomer['phone_number'] : '';\n }",
"public function getCustomerReferenceNumber()\n {\n return isset($this->CustomerReferenceNumber) ? $this->CustomerReferenceNumber : null;\n }",
"public function customerNumber()\n {\n return $this->credentials->customerNumber();\n }",
"public function getCustomerNumberString()\n {\n if (is_object($this->customer))\n return $this->customer->getMobileNumber();\n return '';\n }",
"public function getCustomerPhone()\n {\n return $this->customerPhone;\n }",
"public function getPhoneNumber(){\n return $this->customerPhone;\n }",
"function getPhoneNumber(){\n return $this->customerPhone;\n }",
"public function testgetCustomerNr() {\n $customer = $this->createCustomer();\n $customer->setData(array('name' => \"\"));\n $this->assertEquals(0, $customer->getCustomerNr());\n }",
"public function getCustomerId(): ?string\n {\n return isset($this->CustomerId) ? $this->CustomerId : null;\n }",
"public function getCustomerID(): ?string\n {\n return isset($this->CustomerID) ? $this->CustomerID : null;\n }",
"public function getCustomercode()\n\t{\n\t\treturn $this->customercode;\n\t}",
"public function getCustomerId()\n {\n return $this->_fields['CustomerId']['FieldValue'];\n }",
"public function getCustomerErpNumber();",
"public function getCustomercode()\n {\n\n return $this->customercode;\n }",
"public function getCustomerReference()\n {\n if (isset($this->data['object']) && 'customer' === $this->data['object']) {\n return $this->data['id'];\n }\n\n if (isset($this->data['object']) && ('payment_method' === $this->data['object'] || 'payment_intent' === $this->data['object'])) {\n if (!empty($this->data['customer'])) {\n return $this->data['customer'];\n }\n }\n\n return null;\n }",
"public function getCustomerServicePhone()\n {\n $value = $this->get(self::customer_service_phone);\n return $value === null ? (string)$value : $value;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates a namespace. (namespaces.patch) | public function patch($name, ServicedirectoryNamespace $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('patch', [$params], ServicedirectoryNamespace::class);
} | [
"protected abstract function updateNamespaceRecord();",
"abstract public function setNamespace();",
"public function testPatchNamespaceStatus()\n {\n }",
"public function setNamespace($namespace);",
"public function testReplaceNamespaceStatus()\n {\n }",
"public function replaceNamespace(string $namespace, $hints): self;",
"public function testUpdateRecordNamespaceKey()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testPatchCoreV1NamespaceStatus()\n {\n\n }",
"public function setNamespace( $ns ) { $this->namespace = $ns; }",
"public function replaceNamespace(&$stub, $name);",
"public static function formatNamespace(array $old, array $new): string\n {\n return trim(($old['namespace'] ?? '') . '/' . ($new['namespace'] ?? ''), '/');\n }",
"public function testBindNamespaceUpdatesNamespaceWhenPrefixBoundMultipleNamespaces(): void\n {\n $this->sut->bindNamespace('foo', 'http://example.org/foo');\n $this->sut->bindNamespace('foo', 'http://example.org/newfoo');\n self::assertSame('http://example.org/newfoo', $this->sut->lookupNamespace('foo'));\n }",
"public function testReplaceCoreV1Namespace()\n {\n\n }",
"#[@fromDia(xpath= 'namespace::dia', value= 'namespace')]\n public function addNamespace($namespace) {\n list($prefix, $uri)= each($namespace);\n $this->ns[$prefix]= $uri;\n }",
"public function updateNamespace(Request $request, Project $project, Project_namespace $namespace) {\n\n if(!Auth::user()->projects()->find($project->id)) {\n\n return response()->json([], 404);\n }\n\n $namespace = $project->namespaces()->find($namespace->id);\n\n if (!$namespace) {\n\n return response()->json([], 404);\n }\n\n if (!$namespace->update($request->all())) {\n\n return response()->json([], 500);\n }\n\n return response()->json($namespace, 200);\n }",
"function changeNamespaces()\n\t{\n\t\t$tpl = &singleton('template');\n\t\t$config = $this->getOrigConfig();\n\t\t\n\t\t$defaultNamespace = isset($this->post['default_namespace']) ? $this->post['default_namespace'] : $config['default']['default_namespace'];\n\t\t$specialNamespace = isset($this->post['special_namespace']) ? $this->post['special_namespace'] : $config['default']['special_namespace'];\n\t\t$userNamespace = isset($this->post['user_namespace']) ? $this->post['user_namespace'] : $config['default']['users_namespace'];\n\t\t\n\t\tif(!in_array($defaultNamespace, $config['namespaces'])) {\n\t\t\t$defaultNamespace = $config['default']['default_namespace'];\n\t\t}\n\t\tif(!in_array($specialNamespace, $config['namespaces'])) {\n\t\t\t$specialNamespace = $config['default']['special_namespace'];\n\t\t}\n\t\tif(!in_array($userNamespace, $config['namespaces'])) {\n\t\t\t$userNamespace = $config['default']['users_namespace'];\n\t\t}\n\t\t\n\t\t$this->setConfigItem('default', 'default_namespace', $defaultNamespace);\n\t\t$this->setConfigItem('default', 'special_namespace', $specialNamespace);\n\t\t$this->setConfigItem('default', 'users_namespace', $userNamespace);\n\t\t\n\t\t$this->rewriteConfig();\n\t\t\n\t\t$tpl->assign('isMessage', true);\n\t\t$tpl->assign('message', $this->lang['admin_config_updated']);\n\t}",
"protected function set_namespaces()\n\t{\n\n\t\tif($namespaces = $this->get_namespaces())\n\t\t{\n\n\t\t\tforeach($namespaces as $ns => $url)\n\t\t\t{\n\n\t\t\t\t$this->document->createAttributeNS($url, $ns.':attr');\n\n\t\t\t}\n\n\t\t}\n\n\t}",
"public function patchNetNamespace(\n $body,\n $name,\n $pretty = null\n ) {\n\n //the base uri for api requests\n $_queryBuilder = Configuration::$BASEURI;\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.'/oapi/v1/netnamespaces/{name}';\n\n //process optional query parameters\n $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array (\n 'name' => $name,\n ));\n\n //process optional query parameters\n APIHelper::appendUrlWithQueryParameters($_queryBuilder, array (\n 'pretty' => $pretty,\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'APIMATIC 2.0',\n 'Accept' => 'application/json',\n 'content-type' => 'application/json; charset=utf-8'\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::PATCH, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::patch($_queryUrl, $_headers, Request\\Body::Json($body));\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n $mapper = $this->getJsonMapper();\n\n return $mapper->mapClass($response->body, 'OpenShiftAPIWithKubernetesLib\\\\Models\\\\V1NetNamespace');\n }",
"public function testReplaceRecordNamespaceKey()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the width of the player. | public function setWidth($width); | [
"public function setWidth($width) {}",
"public function setWidth(int $width);",
"function setWidth($width) {\n $this->width = $width;\n }",
"function setWidth($width)\n\t{\n\t\t$this -> width = $width;\n\t}",
"function set_width($width)\r\n {\r\n if (is_int($width))\r\n $this->width = $width . \"px\"; // for compatibility reasons (until V5.10 HAWHAW interpreted int as px)\r\n else\r\n $this->width = $width;\r\n }",
"public function setWidth($width){\n\t\t/**\n\t\t* Set width value that given by user\n\t\t*/\n\t\t$this->newWidth = $width;\n\t\t/**\n\t\t* Set height value automatically \n\t\t* in ratio of user given width \n\t\t*/\n\t\t$this->newHeight = ($width * $img_src_height) / $img_src_width;\n\t}",
"public function setWidth($var)\n {\n GPBUtil::checkUint32($var);\n $this->width = $var;\n\n return $this;\n }",
"public function setWidth($var)\n {\n GPBUtil::checkInt32($var);\n $this->width = $var;\n\n return $this;\n }",
"public function set_width($value)\r\n\t{\r\n\t\treturn $this->set_attr('width', $value);\r\n\t}",
"public function set_width($width) {\n $this->getProduct()->set_width($width);\n }",
"public function setWidth(int $width) : void\n {\n if ($width > 0 && $width < 999)\n $this->_options['bg']['width'] = $width;\n }",
"function SetCustomPaintWidth($width){}",
"public function setWidth($var)\n {\n GPBUtil::checkInt32($var);\n $this->Width = $var;\n\n return $this;\n }",
"public function setWidth(string $screen, $value);",
"public function set_min_width($width)\n {\n $this->_min_width = $width;\n }",
"public function setWidth($width)\n {\n $this->width = $width;\n\n return $this->changeWindowSize($this->width, $this->height);\n }",
"public function setWidth($var)\n {\n GPBUtil::checkDouble($var);\n $this->width = $var;\n\n return $this;\n }",
"function SetWidths($w){\n $this->widths=$w;\n }",
"function SetWidths($w)\r\n{\r\n $this->widths=$w;\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change state of patch deployment back to "ACTIVE". Patch deployment in active state continues to generate patch jobs. (patchDeployments.resume) | public function resume($name, ResumePatchDeploymentRequest $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('resume', [$params], PatchDeployment::class);
} | [
"public function resetDeploymentStatus()\n {\n $this->deploymentLock()->release();\n\n $this->update([\n 'deployment_status' => null,\n 'deployment_started_at' => null,\n ]);\n }",
"public function activate() {\n $this->databaseHandle->exec(\"UPDATE deployment SET status = \" . DeploymentManaged::ACTIVE . \" WHERE deployment_id = $this->identifier\");\n }",
"public function testUpdateJobSuspensionState()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function update_patch_deployment_sample(): void\n{\n // Create a client.\n $osConfigServiceClient = new OsConfigServiceClient();\n\n // Prepare any non-scalar elements to be passed along with the request.\n $patchDeploymentInstanceFilter = new PatchInstanceFilter();\n $patchDeploymentOneTimeScheduleExecuteTime = new Timestamp();\n $patchDeploymentOneTimeSchedule = (new OneTimeSchedule())\n ->setExecuteTime($patchDeploymentOneTimeScheduleExecuteTime);\n $patchDeployment = (new PatchDeployment())\n ->setInstanceFilter($patchDeploymentInstanceFilter)\n ->setOneTimeSchedule($patchDeploymentOneTimeSchedule);\n\n // Call the API and handle any network failures.\n try {\n /** @var PatchDeployment $response */\n $response = $osConfigServiceClient->updatePatchDeployment($patchDeployment);\n printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());\n } catch (ApiException $ex) {\n printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());\n }\n}",
"function AJupdateRevisionProduction() {\n\t\t$imageid = getContinuationVar('imageid');\n\t\t$revisionid = getContinuationVar('revisionid');\n\t\t$query = \"UPDATE imagerevision \"\n\t\t . \"SET production = 0 \"\n\t\t . \"WHERE imageid = $imageid\";\n\t\tdoQuery($query, 101);\n\t\t$query = \"UPDATE imagerevision \"\n\t\t . \"SET production = 1 \"\n\t\t . \"WHERE id = $revisionid\";\n\t\tdoQuery($query, 101);\n\t}",
"public function testUpdateBatchSuspensionState()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function updateEnvironmentsAction()\n {\n $tasks = $this->_queueTable->getNotProcessedTasks();\n $envManager = new Deploy_Model_Environment_Manager();\n\n foreach ($tasks as $task) {\n if ($envManager->updateEnvironment($task)) {\n $this->msg(\"Task \" . $task->id . \" processed\");\n } else {\n $this->msg(\n \"Error occurred on task \"\n . $task->id . \". See task log for more details\"\n );\n }\n }\n }",
"public function cleanupDeployments()\n {\n // Mark any pending steps as cancelled\n ServerLog::where('status', '=', ServerLog::PENDING)\n ->update(['status' => ServerLog::CANCELLED]);\n\n // Mark any running steps as failed\n ServerLog::where('status', '=', ServerLog::RUNNING)\n ->update(['status' => ServerLog::FAILED]);\n\n // Mark any running/pending deployments as failed\n Deployment::whereIn('status', [Deployment::DEPLOYING, Deployment::PENDING])\n ->update(['status' => Deployment::FAILED]);\n\n // Mark any aborting deployments as aborted\n Deployment::whereIn('status', [Deployment::ABORTING])\n ->update(['status' => Deployment::ABORTED]);\n\n // Mark any deploying/pending projects as failed\n Project::whereIn('status', [Project::DEPLOYING, Project::PENDING])\n ->update(['status' => Project::FAILED]);\n }",
"public function actionPending()\n\t{\n\t\t$this->requirePostRequest();\n\n\t\t$status = ApplicationStatus::Pending;\n\t\t$applicationId = craft()->request->getRequiredPost('applicationId');\n\n\t\tif (craft()->applications->updateStatus($applicationId, $status)) {\n\t\t\tcraft()->userSession->setNotice(Craft::t('The application was {status}.', array(\n\t\t\t\t'status' => $status\n\t\t\t)));\n\t\t}\n\t\telse {\n\t\t\tcraft()->userSession->setError(Craft::t('Unable to change the application to {status}.', array(\n\t\t\t\t'status' => $status\n\t\t\t)));\n\t\t}\n\t}",
"function setImageProduction() {\n\t$requestid = getContinuationVar('requestid');\n\t$data = getRequestInfo($requestid);\n\tforeach($data[\"reservations\"] as $res) {\n\t\tif($res[\"forcheckout\"]) {\n\t\t\t$prettyimage = $res[\"prettyimage\"];\n\t\t\tbreak;\n\t\t}\n\t}\n\tprint \"<H2>Change Test Image to Production</H2>\\n\";\n\tprint \"This will update the <b>$prettyimage</b> \";\n\tprint \"environment to be the newly created revision so that people will \";\n\tprint \"start getting it when they checkout the environment. It will also \";\n\tprint \"cause all the blades that currently have this image preloaded to be \";\n\tprint \"reloaded with this new image. Are you sure the image works \";\n\tprint \"correctly?<br>\\n\";\n\tprint \"<TABLE>\\n\";\n\tprint \" <TR>\\n\";\n\tprint \" <TD>\\n\";\n\tprint \" <FORM action=\\\"\" . BASEURL . SCRIPT . \"\\\" method=post>\\n\";\n\t$cdata = array('requestid' => $requestid);\n\t$cont = addContinuationsEntry('submitSetImageProduction', $cdata, SECINDAY, 0, 0);\n\tprint \" <INPUT type=hidden name=continuation value=\\\"$cont\\\">\\n\";\n\tprint \" <INPUT type=submit value=Yes>\\n\";\n\tprint \" </FORM>\\n\";\n\tprint \" </TD>\\n\";\n\tprint \" <TD>\\n\";\n\tprint \" <FORM action=\\\"\" . BASEURL . SCRIPT . \"\\\" method=post>\\n\";\n\t$cont = addContinuationsEntry('viewRequests');\n\tprint \" <INPUT type=hidden name=continuation value=\\\"$cont\\\">\\n\";\n\tprint \" <INPUT type=submit value=No>\\n\";\n\tprint \" </FORM>\\n\";\n\tprint \" </TD>\\n\";\n\tprint \" </TR>\\n\";\n\tprint \"</TABLE>\\n\";\n}",
"public function modify_stage()\n {\n $viewData = new ViewData();\n $deployment = $this->getDeployment('deployment_error');\n $deployInfo = RevDeploy::getDeploymentInfo($deployment);\n $deployHostSearches = RevDeploy::getDeploymentHostSearches($deployment);\n $deployStaticHosts = RevDeploy::getDeploymentStaticHosts($deployment);\n if (empty($deployInfo)) {\n $viewData->header = $this->getErrorHeader('deployment_error');\n $viewData->error = 'Unable to fetch deployment information from data store for '.$deployment;\n $this->sendError('generic_error', $viewData);\n }\n $_SESSION[$deployment]['deployments'] = $deployHostSearches;\n $_SESSION[$deployment]['static-deployments'] = $deployStaticHosts;\n if (($return = $this->checkGroupAuthByGroup(SUPERMEN, true)) === false) {\n $viewData->notsupermen = true;\n }\n $viewData->deployInfo = $deployInfo;\n $viewData->action = 'modify_write';\n $viewData->locations = HostInputs::fetchLocations();\n $viewData->inputs = HostInputs::fetchInputs();\n $viewData->deployment = $deployment;\n $viewData->crepos = RevDeploy::getCommonRepos();\n $authmodule = AUTH_MODULE;\n $amodule = new $authmodule();\n $viewData->authtitle = $amodule->getTitle();\n $this->sendResponse('deployment_action_stage', $viewData);\n }",
"public function deployAction()\n {\n $api = $this->api();\n $db = $this->db();\n\n $checksum = $this->params->get('checksum');\n if ($checksum) {\n $config = IcingaConfig::load(Util::hex2binary($checksum), $db);\n } else {\n $config = IcingaConfig::generate($db);\n $checksum = $config->getHexChecksum();\n }\n\n $api->wipeInactiveStages($db);\n $current = $api->getActiveChecksum($db);\n if ($current === $checksum) {\n if ($this->params->get('force')) {\n echo \"Config matches active stage, deploying anyway\\n\";\n } else {\n echo \"Config matches active stage, nothing to do\\n\";\n\n return;\n }\n\n } else {\n if ($api->dumpConfig($config, $db)) {\n $this->printf(\"Config '%s' has been deployed\\n\", $checksum);\n } else {\n $this->fail(\n sprintf(\"Failed to deploy config '%s'\\n\", $checksum)\n );\n }\n }\n }",
"public function testUpdateSuspensionState()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function switchToProduction()\n {\n $this->environment = PaymentManagerContract::PRODUCTION;\n }",
"public function resetWorkflow()\n {\n $this->setWorkflowState('initial');\n \n $serviceManager = ServiceUtil::getManager();\n $workflowHelper = $serviceManager->get('rk_team_module.workflow_helper');\n \n $schemaName = $workflowHelper->getWorkflowName($this['_objectType']);\n $this['__WORKFLOW__'] = [\n 'module' => 'RKTeamModule',\n 'state' => $this['workflowState'],\n 'obj_table' => $this['_objectType'],\n 'obj_idcolumn' => 'id',\n 'obj_id' => 0,\n 'schemaname' => $schemaName\n ];\n }",
"public function reset_update_product_statusAction(){\n\n $start = microtime(true);\n\n if($this->getRequest()->getParam('key') == \"gorhdufzk\"){\n\n $iProducts = Mage::getModel('xcentia_coster/product')\n ->getCollection();\n\n foreach($iProducts as $iProduct) {\n\n $iProduct->setUpdate_product_status(self::STATE_VOID)->save();\n\n }\n\n }else{\n echo \"Wrong key!\";\n }\n\n $time_elapsed_secs = microtime(true) - $start;\n echo \"Done in \".round($time_elapsed_secs).\" seconds!\";\n }",
"public function queueRestart()\n {\n $this->readConfig();\n $this->config['ToDo']['raspi_reboot'] = 'True';\n $this->saveConfig();\n }",
"function reapprove() {\n $comment = \"Set to In Progress status for re-approval.\";\n foreach ($this->approvals_required() as $ap_type_id => $ap_type_desc) {\n $this->approve($ap_type_id, \"\", $comment);\n } // foreach\n }",
"function worker_patch_apply($patch) {\n return worker_execute('patch -p0 -i ' . escapeshellarg($patch));\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assambles all user Ids of the given $users into an array | private static function getUserIdArray($users)
{
$result = [];
foreach($users as $user) {
$result[] = $user->id;
}
return $result;
} | [
"private function _userids($users)\n\t{\n\t\t$db = \\App::get('db');\n\n\t\tif (empty($db))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$usernames = array();\n\t\t$userids = array();\n\n\t\tif (!is_array($users))\n\t\t{\n\t\t\t$users = array($users);\n\t\t}\n\n\t\tforeach ($users as $u)\n\t\t{\n\t\t\tif (is_numeric($u))\n\t\t\t{\n\t\t\t\t$userids[] = $u;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$usernames[] = $db->quote($u);\n\t\t\t}\n\t\t}\n\n\t\tif (empty($usernames))\n\t\t{\n\t\t\treturn $userids;\n\t\t}\n\n\t\t$set = implode($usernames, \",\");\n\n\t\t$sql = \"SELECT id FROM `#__users` WHERE username IN ($set);\";\n\n\t\t$db->setQuery($sql);\n\n\t\t$result = $db->loadColumn();\n\n\t\tif (empty($result))\n\t\t{\n\t\t\t$result = array();\n\t\t}\n\n\t\t$result = array_merge($result, $userids);\n\n\t\treturn $result;\n\t}",
"protected function userArray($users)\n { \n $user_array = array();\n foreach ($users as $user) \n {\n $user_array[$user->getId()] = $user;\n }\n return $user_array;\n }",
"public function getUserIds();",
"public function getUserIds()\n {\n return $this->users->lists('id')->toArray();\n }",
"function getUserIDsv5($users)\n {\n $return = array();\n foreach ($this->getUsersv5($users) as $i) {\n $return[] = $i->id();\n }\n\n return $return;\n }",
"function _drush_user_get_users_from_arguments($users) {\n $uids = array();\n if ($users !== '') {\n $users = _convert_csv_to_array($users);\n foreach($users as $user) {\n $uid = _drush_user_get_uid($user);\n if ($uid !== FALSE) {\n $uids[] = $uid;\n }\n }\n }\n return $uids;\n}",
"private function get_ids_from_usernames( $usernames ) {\r\n\r\n\t\t\t$users = explode( ',', trim( $usernames ) );\r\n\t\t\t$user_ids = (array) get_transient( 'jr_insta_user_ids' );\r\n\t\t\t$return_ids = array();\r\n\r\n\t\t\tif ( is_array( $users ) && !empty( $users ) ) {\r\n\r\n\t\t\t\tforeach ( $users as $user ) {\r\n\r\n\t\t\t\t\tif ( isset( $user_ids[$user] ) ) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$url = str_replace( '{username}', urlencode( trim( $user ) ), self::USERNAME_URL );\r\n\t\t\t\t\t$response = wp_remote_get( $url, array( 'sslverify' => false, 'timeout' => 60 ) );\r\n\r\n\t\t\t\t\tif ( is_wp_error( $response ) ) {\r\n\r\n\t\t\t\t\t\treturn $response->get_error_message();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ( $response['response']['code'] == 200 ) {\r\n\r\n\t\t\t\t\t\t$results = json_decode( $response['body'], true );\r\n\r\n\t\t\t\t\t\tif ( $results && is_array( $results ) ) {\r\n\r\n\t\t\t\t\t\t\t$user_id = isset( $results['user']['id'] ) ? $results['user']['id'] : false;\r\n\r\n\t\t\t\t\t\t\tif ( $user_id ) {\r\n\r\n\t\t\t\t\t\t\t\t$user_ids[$user] = $user_id;\r\n\r\n\t\t\t\t\t\t\t\tset_transient( 'jr_insta_user_ids', $user_ids );\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}\r\n\r\n\t\t\tforeach ( $users as $user ) {\r\n\t\t\t\tif ( isset( $user_ids[$user] ) ) {\r\n\t\t\t\t\t$return_ids[] = $user_ids[$user];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn $return_ids;\r\n\t\t}",
"private function get_all_users() {\n\t\tstatic $user_ids;\n\n\t\tif ( ! isset( $user_ids ) ) {\n\t\t\t$user_ids = \\get_users(\n\t\t\t\t[\n\t\t\t\t\t'fields' => 'ID',\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$user_ids = array_map( 'intval', $user_ids );\n\t\t\tsort( $user_ids );\n\t\t}\n\n\t\treturn $user_ids;\n\t}",
"function loadUserIds ()\n\t{\n\t\t$ids\t\t\t\t\t= array();\n\n\t\t$query\t\t\t\t\t= '\n\t\t\tSELECT *\n\t\t\tFROM zen_customers_fe_users\n\t\t';\n\n\t\t$result\t\t\t\t\t= $this->db->Execute( $query );\n\n\t\twhile( ! $result->EOF )\n\t\t{\n\t\t\t$this->zcUsers[]\t= $result->fields[ 'customers_id' ];\n\t\t\t$this->t3Users[]\t= $result->fields[ 'uid' ];\n\t\t\t$result->MoveNext();\n\t\t}\n\t}",
"function uids_load_all() {\n\tglobal $db;\n\t$users = $db->array_load_all('USER');\n\t$uids = array();\n\tforeach ($users as $user) {\n\t\t$uids[] = $user['User_ID'];\n\t}\n\treturn $uids;\n}",
"public static function get_by_ids($ids)\n {\n $ids = array_unique(array_filter($ids, 'is_int'));\n if (!$ids)\n return array();\n $ids = implode(', ', $ids);\n\n global $db;\n $query = query($db,\n \"SELECT user_id, username, email\n FROM users WHERE user_id IN ($ids)\");\n\n $result = array();\n while (($row = $query->fetch()) !== false) {\n $inst = new User($row->user_id);\n $inst->fill_info($row);\n $result[$row->user_id] = $inst;\n }\n return $result;\n }",
"function getFbIds($users)\n{\n\t$data = array();\n\t$q = 'SELECT fb_id FROM users WHERE fb_id != 0 AND (';\n\tforeach($users as $u)\n\t{\n\t\t$q .= 'user_id='.$u.' OR ';\n\t}\n\t$q = substr($q,0,strlen($q)-4);\n\t$q .= ')';\n\n\t$res = mysql_query($q)\n\t\tor die(mysql_error());\n\twhile($row = mysql_fetch_array($res))\n\t{\n\t\t$data[] = $row['fb_id'];\n\t}\n\treturn $data;\n}",
"public function getAllUsersIds()\n {\n $ids = [$this->owner_id];\n foreach ($this->companyUsers as $companyUser) {\n array_push($ids, $companyUser->user_id);\n }\n\n return $ids;\n }",
"public function getUserIdsArray()\n {\n $userObjects = null;\n $userIdsArray = [];\n\n if (($krasojizda = Krasojizda::find(auth()->user()->krasojizda_id)) !== null) {\n $userObjects = $krasojizda->users;\n }\n\n if ($userObjects !== null) {\n foreach ($userObjects as $userObject) {\n $userIdsArray[] = $userObject->id;\n }\n }\n\n return $userIdsArray;\n }",
"function getUserIDs($users)\r\n {\r\n\r\n if($this->_apiVersion != 5) {\r\n throw new APIVersionException(\"getUsers() [which calls getUsersV5()] is only valid on API Version 5\");\r\n }\r\n\r\n return $this->getUserIDsV5($users);\r\n }",
"protected function load_selected_users() {\n // See if we got anything.\n if ($this->multiselect) {\n $userids = optional_param_array($this->name, array(), PARAM_RAW);\n } else if ($userid = optional_param($this->name, 0, PARAM_RAW)) {\n $userids = array($userid);\n }\n return $userids;\n //exit(print_r($userids));\n //return $userids;\n // If there are no users there is nobody to load.\n if (empty($userids)) {\n return array();\n }\n\n // If we did, use the find_users method to validate the ids.\n $this->validatinguserids = $userids;\n $groupedusers = $this->find_users('');\n $this->validatinguserids = null;\n\n // Aggregate the resulting list back into a single one.\n $users = array();\n foreach ($groupedusers as $group) {\n foreach ($group as $user) {\n if (!isset($users[$user->id]) && empty($user->disabled) && in_array($user->id, $userids)) {\n $users[$user->id] = $user;\n }\n }\n }\n\n // If we are only supposed to be selecting a single user, make sure we do.\n if (!$this->multiselect && count($users) > 1) {\n $users = array_slice($users, 0, 1);\n }\n\n return $users;\n }",
"public function getAllIds()\n {\n return array_divide(array_dot($this->userModel->get(['id'])->toArray()))[1];\n }",
"public function ensureUsers($users)\r\n {\r\n if (!is_array($users)) {\r\n $users = array($users);\r\n }\r\n\r\n $userIds = array();\r\n $userName = array();\r\n\t\t \r\n\t\t $table_name = $this->_tables['users'];\r\n\r\n // Anything already typed as an integer is assumed to be a user id.\r\n foreach ($users as $userIndex => $user) {\r\n if (is_int($user)) {\r\n $userIds[$userIndex] = $user;\r\n } else {\r\n $userName[$user] = $userIndex;\r\n }\r\n }\r\n\r\n // Get the ids for any users that already exist.\r\n \r\n if (count($userName)) {\r\n $userName;\r\n $sql = 'SELECT user_id, user_name FROM ' .$table_name\r\n . ' WHERE user_name IN (\"' . implode('\",\"', array_keys($userName)) . '\")';\r\n\r\n\r\n\t\t\t\t\t//$res =& $this->_db->exec($sql);\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t$res =& $this->_db->query($sql);\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\twhile ($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC)) {\r\n\t\t\t\t\t\t // Assuming MDB2's default fetchmode is MDB2_FETCHMODE_ORDERED\r\n\t\t\t\t\t\t $userIndex = $userName[$row['user_name']];\r\n unset($userName[$row['user_name']]);\r\n $userIds[$userIndex] = $row['user_id']; \r\n\t\t\t\t\t}\t \r\n\r\n }\r\n\t\t\t\t\r\n\t\t\t\t\r\n\r\n\t\t\t$types = array('text');\r\n\t\t\t$this->_db->loadModule('Extended');\t\t\t\t\r\n\t\t\t\t\r\n\r\n // Create any users that didn't already exist\r\n\t\t foreach ($userName as $user => $userIndex) {\r\n\t\t \r\n\t\t\t\t$fields_values = array(\r\n\t\t\t\t\t'user_name' => \"$user\"\r\n\t\t\t\t);\r\n\t\t\r\n\t\t\t\t$affectedRows = $this->_db->extended->autoExecute($table_name, $fields_values,\r\n\t\t\t\t\t\t\t\t\t\tMDB2_AUTOQUERY_INSERT, null, $types);\r\n\t\t\t\tif ($affectedRows){\r\n\t\t\t\t\r\n\t\t\t\t\t$query = 'SELECT user_id FROM '. $table_name .' WHERE user_name = \"'.$user.'\"';\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($id = $this->_db->queryOne($query)) {\r\n\t\t\t\t\t\t$userIds[$userIndex] = $id;\r\n\t\t\t\t\t} \r\n\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\r\n\t\t }\t\t\t\t\t\t\r\n\r\n return $userIds;\r\n }",
"protected function getUsersWithAddressesArray($users)\n {\n // Addresses for users\n $query = Doctrine_Query::create()->from('rtAddress a');\n $query->select('a.*')\n ->andWhere('a.model = ?', 'rtGuardUser');\n\n $user_addresses = $query->execute(array(), Doctrine_Core::HYDRATE_SCALAR);\n\n $clean_users = array();\n $clean_addresses = array();\n\n foreach($users as $user)\n {\n $clean_users[$user['u_id']] = $user;\n }\n\n foreach($user_addresses as $address)\n {\n $clean_addresses[$address['a_model_id']][] = $address;\n }\n\n $users_with_addresses = array();\n foreach($clean_users as $ukey => $user)\n {\n // Clean values to prevent export errors\n foreach($user as $key => $value)\n {\n $users_with_addresses[$ukey][$key] = $this->cleanExportValue($value);\n }\n if(isset($clean_addresses[$ukey]))\n {\n foreach($clean_addresses[$ukey] as $key => $address)\n {\n // Clean values to prevent export errors\n foreach($address as $key => $value)\n {\n $users_with_addresses[$ukey]['u_addresses'][$address['a_type']][$key] = $this->cleanExportValue($value);\n }\n }\n }\n }\n return $users_with_addresses;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Built plugin creator form. | public function pluginController_creator_create($sender) {
// Check for legitimation.
$sender->permission('Garden.Settings.Manage');
$sender->addSideMenu('plugin/creator');
$sender->Form = new Gdn_Form();
$sender->addCssFile('creator.css', 'plugins/creator');
$sender->setData('Title', t('Plugin Creator'));
// Include external resources (header & snippets info).
include __DIR__.'/plugininfo.php';
$sender->setData('PluginInfo', $pluginInfo);
$snippets = [];
foreach (glob(__DIR__.'/snippets/*.php') as $snippet) {
include $snippet;
}
$sender->setData('Snippets', $snippets);
// Ensure snippets have a unique name in the form.
$duplicateNames = array_intersect(
array_keys($snippets),
array_keys($pluginInfo)
);
if (count($duplicateNames) > 0) {
// Ugly, ugly, ugly...
decho('Snippets are not allowed to have the same name as PluginInfo keys!');
decho($duplicateNames);
die;
}
if ($sender->Form->authenticatedPostBack() !== false) {
$formValues = $sender->Form->formValues();
// Check for errors in plugin info fieldset.
$errors = $this->pluginInfoValidation($formValues, $pluginInfo);
$sender->Form->setValidationResults($errors);
// Add required snippets and required PluginInfo entries.
$formValues = $this->dissolveSnippetRequirements($formValues, $snippets);
// Only proceed if there were no validation errors.
if ($errors == []) {
$pluginCode = $this->getSourceCode(
$formValues,
$pluginInfo,
$snippets
);
$filename = 'class.'.strtolower($formValues['PluginTitle']).'.plugin.php';
/*
$path = __DIR__.'../'.$formValues['PluginTitle'];
if (!mkdir($path, '0775')) {
$sender->informMessage('Directory could not be created!');
}
if (!file_put_contents($path.'/'.$filename)) {
$sender->informMessage('Plugin could not be saved!');
*/
header('Content-Length: '.strlen($pluginCode));
header('Content-type: application/octet-stream');
header('Content-Disposition: attachment; filename='.$filename);
echo $pluginCode;
exit;
/*
}
$sender->informMessage('Your plugin has been saved to '.$path.'/'.$filename);
*/
}
} else {
// Set Default values.
foreach ($pluginInfo as $name => $info) {
if ($info['Default'] != '') {
$sender->Form->setValue($name, $info['Default']);
}
}
}
$sender->render('creator', '', 'plugins/creator');
} | [
"public function build_plugin() {\n\t\t$class_name = apply_filters( self::FILTER_PLUGIN_CLASS, $this->info->get_class_name() );\n\n\t\t/** @var AbstractPlugin $plugin */\n\t\t$this->plugin = new $class_name( $this->info );\n\t}",
"protected function createForm() {\n /*\n * Create and store the values of plugin manager form.\n */\n $form = $this->Form();\n\n //checkbox which determines whether the Einkaufspreis (merchant price) includes Tax\n $form->setElement('checkbox', 'includesTax', array(\n 'label' => 'Einkaufspreis inkl. Mwst.',\n 'value' => false,\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP\n ));\n\n $form->setElement('text', 'shippingCosts', array(\n 'label' => 'Versandkosten (fix oder prozentual)',\n 'value' => '',\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP\n ));\n\n $form->setElement('text', 'runningCosts', array(\n 'label' => 'Laufende Kosten (fix oder prozentual)',\n 'value' => '',\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP\n ));\n }",
"function &buildForm();",
"public function buildForm();",
"public function buildForm()\n\t{\n\t\t// edit_p1_v1\n\t\t$buildFunctionName = $this->accessMode . '_p' . $this->page . '_v' . $this->version;\n\t\t\n\t\t// call the internal function to build the zend form\n\t\t$this->form = $this->$buildFunctionName();\n\t}",
"public function buildForm()\n {\n $this\n // ->addSelect('type', $this->getCodeList('DescriptionType', 'Activity'), trans('elementForm.description_type'), $this->addHelpText('Activity_Description-type'), '1', true)\n ->add(\n 'type',\n 'hidden',\n [\n 'value' => '1'\n ]\n )\n ->addGeneralDescription('narrative', trans('elementForm.text'), ['narrative_required' => true])\n ->addAddMoreButton('add_narrative', 'narrative')\n ->addRemoveThisButton('remove_description');\n }",
"public function buildForm()\n {\n $this\n ->add('value', 'text', ['label' => trans('elementForm.value')])\n ->addCollection('location', 'Activity\\TargetLocation', 'target_location', [], trans('elementForm.location'))\n ->addAddMoreButton('add_target_location', 'target_location')\n ->addCollection('dimension', 'Activity\\TargetDimension', 'target_dimension', [], trans('elementForm.dimension'))\n ->addAddMoreButton('add_target_dimension', 'target_dimension')\n ->addComments();\n }",
"public function plugin_construction() {\t\r\n\t\r\n\t}",
"public function buildForm()\n {\n $this\n ->add(\n 'new_organization_group',\n 'collection',\n [\n 'type' => 'form',\n 'options' => [\n 'class' => 'App\\SuperAdmin\\Forms\\OrganizationGroupInformation',\n 'label' => false,\n ]\n ]\n )\n ->add(\n 'group_admin_information',\n 'collection',\n [\n 'type' => 'form',\n 'options' => [\n 'class' => 'App\\SuperAdmin\\Forms\\GroupAdmin',\n 'label' => false,\n ]\n ]\n )\n ->addSaveButton();\n }",
"function buildSettingsForm() {}",
"public function output_setup_form() {\n\t\t$this->output_controls_html( 'wordpress' );\n\t}",
"public function buildForm()\n {\n $this\n ->add(\n 'date',\n 'date',\n ['label' => trans('elementForm.date'), 'help_block' => $this->addHelpText('Activity_ActivityDate-iso_date'), 'required' => true, 'attr' => ['placeholder' => 'YYYY-MM-DD']]\n )\n ->addSelect('type', $this->getCodeList('ActivityDateType', 'Activity'), trans('elementForm.activity_date_type'), $this->addHelpText('Activity_ActivityDate-type'), null, true)\n ->addNarrative('narrative')\n ->addAddMoreButton('add_narrative', 'narrative')\n ->addRemoveThisButton('remove_activity_date');\n }",
"public function admin_add_new() {\n?>\n\t<div class=\"wrap\">\n\t\t<h2><?php _e( 'Add New Form', 'visual-form-builder-pro' ); ?></h2>\n<?php\n\t\tinclude_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/admin-new-form.php' );\n?>\n\t</div>\n<?php\n\t}",
"public function build() {\n $this->define_my_steps();\n\n // @todo Risky?\n list($plugin, $name) = explode('_', $this->name);\n\n $this->add_step(new moodle1_module_structure_step(\"{$this->name}_module\", $name));\n $this->built = true;\n }",
"function build_editing_form()\n {\n $this->addElement($this->add_name_field());\n $this->addElement('hidden', PlatformCategory :: PROPERTY_ID);\n $this->build_footer('Update');\n }",
"public function buildForm()\n {\n $this->add('organization_identifier_code', 'text', ['label' => trans('elementForm.organisation_identifier_code')])\n ->add('receiver_activity_id', 'text', ['label' => trans('elementForm.receiver_activity_id')])\n ->addSelect('type', $this->getCodeList('OrganisationType', 'Activity'), trans('elementForm.type'), $this->addHelpText('Activity_ParticipatingOrg-type'))\n ->addNarrative('receiver_org_narrative')\n ->addAddMoreButton('add_receiver_org_narrative', 'receiver_org_narrative');\n }",
"public function buildForm()\n {\n $this\n ->addSelect(\n 'organization_role',\n $this->getCodeList('OrganisationRole', 'Activity'),\n trans('elementForm.organisation_role'),\n $this->addHelpText('Activity_ParticipatingOrg-role'),\n null,\n true\n )\n ->add('identifier', 'text', ['label' => trans('elementForm.identifier'), 'help_block' => $this->addHelpText('Activity_ParticipatingOrg-ref')])\n ->addSelect('organization_type', $this->getCodeList('OrganisationType', 'Activity'), trans('elementForm.organisation_type'), $this->addHelpText('Activity_ParticipatingOrg-type'))\n ->add('activity_id', 'text', ['label' => trans('elementForm.activity_id')])\n ->add('crs_channel_code','text',['label' => 'Crs Channel Code'])\n ->addNarrative('narrative', trans('elementForm.organisation_name'))\n ->addAddMoreButton('add', 'narrative')\n ->addRemoveThisButton('remove_narrative');\n }",
"public function making_license_form() {\n\n $array_Plugins = get_plugins();\n $html = '';\n if (!empty($array_Plugins)) {\n foreach ($array_Plugins as $plugin_file => $plugin_data) {\n if (is_plugin_active($plugin_file)) {\n $plugin_name = $plugin_data['Name'];\n\n\n if ($plugin_name == \"WP E-Signature\") {\n\n if ($plugin_name != \"WP E-Signature\") {\n $this->item_plugshortname = str_replace(\"WP E-Signature \", \"\", \"$plugin_name\");\n } else {\n $this->item_plugshortname = $plugin_name;\n }\n\n $this->item_pluginname = 'esig_' . preg_replace('/[^a-zA-Z0-9_\\s]/', '', str_replace(' ', '_', strtolower($this->item_plugshortname)));\n\n $this->license_active = trim($this->settings->get_generic($this->item_pluginname . '_license_active'));\n\n\n if ($this->license_active == \"valid\") {\n $this->license_key = trim($this->settings->get_generic($this->item_pluginname . '_license_key'));\n } else {\n $this->license_key = null;\n }\n\n if (!empty($this->license_key)) {\n $this->output_key = $this->license_key;\n } else {\n $this->output_key = '';\n }\n\n $esig_license_type = $this->settings->get_generic($this->item_pluginname . '_license_type');\n\n // display license kye last four digit.\n if (!empty($this->output_key)) {\n $license_key = str_repeat('*', (strlen($this->output_key) - 4)) . substr($this->output_key, -4, 4);\n $input_readonly = isset($license_key) ? 'readonly' : \"\";\n } else {\n $license_key = \"\";\n $input_readonly = \"\";\n }\n\n $html .='<tr class=\"esig-settings-wrap\">\n\t\t\t\t\t\t\t\t<th><label for=\"license_key\" id=\"license_key_label\">' . $plugin_name . ' License Key <span class=\"description\"> (required)</span></label></th>\n\t\t\t\t\t\t\t\t<td><input type=\"text\" name=\"' . $this->item_pluginname . '_license_key' . '\" id=\"first_name\" value=\"' . $license_key . '\" class=\"regular-text\" ' . $input_readonly . ' />';\n if ($this->license_active == \"valid\") {\n\n $html .='<input type=\"submit\" class=\"button-appme button\" name=\"' . $this->item_pluginname . '_license_key_deactivate' . '\" value=\"Deactivate License\">';\n }\n if ($this->license_active == \"invalid\") {\n $html .='<input type=\"submit\" class=\"button-appme button\" name=\"' . $this->item_pluginname . '_license_key_activate' . '\" value=\"Activate License\">';\n }\n $html .= '</td>\n\t\t\t\t\t\t\t\t</tr>';\n // getting license expire date \n $esig_license_expire = $this->settings->get_generic($this->item_pluginname . '_license_expires');\n\n if (!empty($license_key)) {\n if ($this->settings->esig_license_expired()) {\n $html .='<tr><td colspan=\"3\">' . __('Your e-signature license is expired.', 'esign') . ' </td></tr>';\n } else {\n\n if (isset($esig_license_expire) && !empty($esig_license_expire)) {\n $html .= sprintf(__('<tr><td colspan=\"3\">Your e-signature license will expire on %s </td></tr>', 'esign'), $esig_license_expire);\n }\n } // expire else end here \n }\n }\n }\n }\n } else {\n return;\n }\n\n return $html;\n }",
"public function create_options_form() {\n\t\tadd_action( 'admin_init', array( $this, 'register_settings' ) );\n\t\tadd_action( 'after_setup_theme', array( $this, 'create_file_options' ) );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
===================== = Tiny MCE Defaults = ===================== Default TinyMCE widget | public function getTinymceWidget()
{
return new sfWidgetFormTextareaTinyMCE(
array(
'width' => '700',
'height' => '600',
// 'config' => TinyMceConfiguration::get(),
),
array('class' => 'tinyMCE')
);
} | [
"function define_wp_tiny_mce() {\n\t\tfunction wp_tiny_mce() {\n\t\t\treturn;\n\t\t}\n\t}",
"function populateSimpleTinyMceEditor($field_name='', $value='')\n\t{\n\t\tglobal $CFG;\n\t\tglobal $LANG;\n?>\n\n\t\t<script type=\"text/javascript\" src=\"<?php echo $CFG['site']['url'];?>js/lib/tinymce/tiny_mce.js\"></script>\n\t\t<script type=\"text/javascript\">\n\n\t\ttinyMCE.init({\n\t\t\t// General options\n\t\t\tmode : \"exact\",\n\t\t\telements: \"<?php echo $field_name; ?>\",\n\t\t\ttheme : \"advanced\",//\"advanced\", \"simple\"\n\t\t\tplugins : \"safari,advlink,emotions,inlinepopups,noneditable,xhtmlxtras\",\n\n\t\t\t// Theme options\n\t\t\ttheme_advanced_buttons1 : \"bold,italic,underline,strikethrough,|,undo,redo,cleanup,|,styleselect,formatselect,fontselect,fontsizeselect,\",\n\t\t\ttheme_advanced_buttons2 : \"bullist,numlist,|,justifyleft,justifycenter,justifyright,justifyfull,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,|,link,unlink,|,forecolor,|,code\",\n\t\t\ttheme_advanced_buttons3 : false,\n\t\t\ttheme_advanced_buttons4 : false,\n\n\t\t\ttheme_advanced_toolbar_location : \"top\",\n\t\t\ttheme_advanced_toolbar_align : \"left\",\n\t\t\ttheme_advanced_statusbar_location : \"none\",\n\t\t\twidth: \"100%\",\n\t\t\theight : \"370\",\n\t\t\ttheme_advanced_resizing_min_height : 370,\n\t\t\ttheme_advanced_resizing_max_height : 500,\n\t\t\tuse_native_selects : true,\n\t\t\tconvert_urls : false,\n \t\t\tremove_script_host : false,\n\t\t\t//relative_urls : false,\n\t\t\t//theme_advanced_resizing : true,\n\t\t\t//auto_resize: true\n\t\t\tcleanup_on_startup : true\n\n\t\t\t// Replace values for the template plugin\n\t\t\t/*template_replace_values : {\n\t\t\t\tusername : \"Some User\",\n\t\t\t\tstaffid : \"991234\"\n\t\t\t}*/\n\t\t});\n\t\t</script>\n\t\t<div id=\"desc_textarea\"><textarea name=\"<?php echo $field_name; ?>\"><?php echo $value; ?></textarea></div>\n\t\t<noscript><p><b><?php echo $LANG['javascript_enabled'];?></b></p></noscript>\n<?php\n\t}",
"function twentytwenty_block_editor_settings() {}",
"function wp_super_edit_set_user_default() {\n\tglobal $wp_super_edit, $wp_super_edit_tinymce_default;\n\n\t// Output buffering to get default TinyMCE init - Since it's the core editor we want the DFW(distraction free writing)\n\tob_start();\n\tif ( function_exists( 'wp_editor' ) ) \n\t\twp_editor( '', 'null', array( 'dfw' => true ) );\n\telse\n\t\twp_tiny_mce();\n\tob_end_clean();\n\t\t\n\t$wp_super_edit->register_user_settings( 'wp_super_edit_default', 'Default Editor Settings', $wp_super_edit_tinymce_default, 'single' );\n\n\t$wp_super_edit->set_option( 'tinymce_scan', $wp_super_edit_tinymce_default );\n\t$wp_super_edit->set_option( 'management_mode', 'single' );\n\t\n\t/**\n\t* Remove old options for versions 2.2\n\t*/\t\n\tdelete_option( 'wp_super_edit_tinymce_scan' );\n\t\n\t/**\n\t* Remove old options for versions 1.5 \n\t*/\t\n\tdelete_option( 'superedit_options' );\n\tdelete_option( 'superedit_buttons' );\n\tdelete_option( 'superedit_plugins' );\n}",
"function wp_super_edit_wordpress_button_defaults() {\n\tglobal $wp_super_edit;\n\n\tif ( !$wp_super_edit->is_installed ) return;\n\t\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'bold', \n\t\t'nicename' => __( 'Bold', 'wp-super-edit' ), \n\t\t'description' => __( 'Bold content with strong HTML tag. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'italic', \n\t\t'nicename' => __( 'Italic', 'wp-super-edit' ), \n\t\t'description' => __( 'Italicize content with em HTML tag. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'strikethrough', \n\t\t'nicename' => __( 'Strikethrough', 'wp-super-edit' ), \n\t\t'description' => __( 'Strike out content with strike HTML tag. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'bullist', \n\t\t'nicename' => __( 'Bulleted List', 'wp-super-edit' ), \n\t\t'description' => __( 'An unordered list. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'numlist', \n\t\t'nicename' => __( 'Numbered List', 'wp-super-edit' ), \n\t\t'description' => __( 'An ordered list. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'blockquote', \n\t\t'nicename' => __( 'Block Quote', 'wp-super-edit' ), \n\t\t'description' => __( 'Blockquotes are used when quoting other content. Usually this content is displayed as indented.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'justifyleft', \n\t\t'nicename' => __( 'Left Justification', 'wp-super-edit' ), \n\t\t'description' => __( 'Set the alignment to left justification. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'justifycenter', \n\t\t'nicename' => __( 'Center Justification', 'wp-super-edit' ), \n\t\t'description' => __( 'Set the alignment to center justification. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'justifyright', \n\t\t'nicename' => __( 'Right Justification', 'wp-super-edit' ), \n\t\t'description' => __( 'Set the alignment to right justification. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'link', \n\t\t'nicename' => __( 'Create Link', 'wp-super-edit' ), \n\t\t'description' => __( 'Create a link. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'unlink', \n\t\t'nicename' => __( 'Remove Link', 'wp-super-edit' ), \n\t\t'description' => __( 'Remove a link. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'wp_more', \n\t\t'nicename' => __( 'Wordpress More Tag', 'wp-super-edit' ), \n\t\t'description' => __( 'Insert Wordpress MORE tag to divide content to multiple views. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'spellchecker', \n\t\t'nicename' => __( 'Spell Check', 'wp-super-edit' ), \n\t\t'description' => __( 'Wordpress spell check. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'wp_adv', \n\t\t'nicename' => __( 'Show/Hide Advanced toolbar', 'wp-super-edit' ), \n\t\t'description' => __( 'Built in Wordpress button <strong>normally hidden</strong>. When pressed it will show extra rows of buttons (or press Ctrl-Alt-V on FF, Alt-V on IE).', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'formatselect', \n\t\t'nicename' => __( 'Paragraphs and Headings', 'wp-super-edit' ), \n\t\t'description' => __( 'Set Paragraph or Headings for content.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'underline', \n\t\t'nicename' => __( 'Underline Text', 'wp-super-edit' ), \n\t\t'description' => __( 'Built in Wordpress button to underline selected text.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'justifyfull', \n\t\t'nicename' => __( 'Full Justification', 'wp-super-edit' ), \n\t\t'description' => __( 'Set the alignment to full justification. Built in Wordpress button.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'forecolor', \n\t\t'nicename' => __( 'Foreground color', 'wp-super-edit' ), \n\t\t'description' => __( 'Set foreground or text color. May produce evil font tags. Built in Wordpress button.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'pastetext', \n\t\t'nicename' => __( 'Paste as Text', 'wp-super-edit' ), \n\t\t'description' => __( 'Paste clipboard text and remove formatting. Useful for pasting text from applications that produce substandard HTML. Built in Wordpress button.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'pasteword', \n\t\t'nicename' => __( 'Paste from Microsoft Word', 'wp-super-edit' ), \n\t\t'description' => __( 'Attempts to clean up HTML produced by Microsoft Word during cut and paste. Built in Wordpress button.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'removeformat', \n\t\t'nicename' => __( 'Remove HTML Formatting', 'wp-super-edit' ), \n\t\t'description' => __( 'Removes HTML formatting from selected item. Built in Wordpress button.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'media', \n\t\t'nicename' => __( 'Media', 'wp-super-edit' ), \n\t\t'description' => __( 'Add or edit embedded media like Flash, Quicktime, or Windows Media. Different from WordPress Media tools.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'charmap', \n\t\t'nicename' => __( 'Special Characters', 'wp-super-edit' ), \n\t\t'description' => __( 'Insert special characters or entities using a visual interface. Built in Wordpress button.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'outdent', \n\t\t'nicename' => __( 'Decrease Indentation', 'wp-super-edit' ), \n\t\t'description' => __( 'This will decrease the level of indentation based on content position. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'indent', \n\t\t'nicename' => __( 'Increase Indentation', 'wp-super-edit' ), \n\t\t'description' => __( 'This will increase the level of indentation based on content position. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'undo', \n\t\t'nicename' => __( 'Undo option', 'wp-super-edit' ), \n\t\t'description' => __( 'Undo previous formatting changes. Not useful once you save. Built in Wordpress button.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'redo', \n\t\t'nicename' => __( 'Redo option', 'wp-super-edit' ), \n\t\t'description' => __( 'Redo previous formatting changes. Not useful once you save. Built in Wordpress button.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'wp_help', \n\t\t'nicename' => __( 'Wordpress Help', 'wp-super-edit' ), \n\t\t'description' => __( 'Built in Wordpress help documentation. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\n\t// End WordPress Defaults\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'cleanup', \n\t\t'nicename' => __( 'Clean up HTML', 'wp-super-edit' ), \n\t\t'description' => __( 'Attempts to clean up bad HTML in the editor. Built in Wordpress button.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'image', \n\t\t'nicename' => __( 'Image Link', 'wp-super-edit' ), \n\t\t'description' => __( 'Insert linked image. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\t\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'anchor', \n\t\t'nicename' => __( 'Anchors', 'wp-super-edit' ), \n\t\t'description' => __( 'Create named anchors.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'sub', \n\t\t'nicename' => __( 'Subscript', 'wp-super-edit' ), \n\t\t'description' => __( 'Format text as Subscript.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'sup', \n\t\t'nicename' => __( 'Superscript', 'wp-super-edit' ), \n\t\t'description' => __( 'Format text as Superscript.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'backcolor', \n\t\t'nicename' => __( 'Background color', 'wp-super-edit' ), \n\t\t'description' => __( 'Set background color for selected tag or text. ', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'code', \n\t\t'nicename' => __( 'HTML Source', 'wp-super-edit' ), \n\t\t'description' => __( 'View and edit the HTML source code.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'wp_page', \n\t\t'nicename' => __( 'Wordpress Next Page Tag', 'wp-super-edit' ), \n\t\t'description' => __( 'Insert Wordpress Next Page tag to divide page content into multiple views.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'wp_help', \n\t\t'nicename' => __( 'Wordpress Editor Help', 'wp-super-edit' ), \n\t\t'description' => __( 'Shows some visual editor documentation and shortcut information', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\t\n\t\n\t// Start Included Plugin Defaults\n\n\t// fullscreen\n\t// Someday we deal with wp_fullscreen\n\t\n\t// WP Super Edit options for this plugin\n\t\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'fullscreen', \n\t\t'nicename' => __( 'Full Screen', 'wp-super-edit' ), \n\t\t'description' => __( 'Toggle Full Screen editor mode.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'wp_fullscreen', \n\t\t'nicename' => __( 'WordPress Distraction Free Writing', 'wp-super-edit' ), \n\t\t'description' => __( 'Toggle WordPress Full Screen editor mode for distraction free writing.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\t\n\t\n\t// advhr\n\t\n\t// WP Super Edit options for this plugin\n\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'advhr', \n\t\t'nicename' => __( 'Advanced Horizontal Rule Lines', 'wp-super-edit' ), \n\t\t'description' => __( 'Advanced rule lines with options for <hr> HTML tag.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'advhr', \n\t\t'nicename' => __( 'Horizontal Rule Lines', 'wp-super-edit' ), \n\t\t'description' => __( 'Options for using the <hr> HTML tag', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'advhr', \n\t\t'status' => 'no'\n\t));\n\t\n\t// advimage\n\t\n\t// WP Super Edit options for this plugin\n\t\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'advimage', \n\t\t'nicename' => __( 'Advanced Image Link', 'wp-super-edit' ), \n\t\t'description' => __( 'A more advanded dialog for the Image Link button.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// advlink\n\t\n\t// WP Super Edit options for this plugin\n\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'advlink', \n\t\t'nicename' => __( 'Advanced Link', 'wp-super-edit' ), \n\t\t'description' => __( 'A more advanded dialog for the Create Link button.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// contextmenu\n\t\n\t// WP Super Edit options for this plugin\n\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'contextmenu', \n\t\t'nicename' => __( 'Context Menu', 'wp-super-edit' ), \n\t\t'description' => __( 'TinyMCE context menu is used by some plugins. The context menu is activated by right mouse click or crtl click on Mac in the editor area.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// fonttools\n\n\t// WP Super Edit options for this plugin\n\t\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'fonttools', \n\t\t'nicename' => __( 'Font Tools', 'wp-super-edit' ), \n\t\t'description' => __( 'Adds the Font Family and Font Size buttons to the editor.', 'wp-super-edit' ), \n\t\t'provider' => 'tinymce', \n\t\t'status' => 'no', \n\t\t'url' => 'none',\t\t\n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'fontselect', \n\t\t'nicename' => __( 'Font Select', 'wp-super-edit' ), \n\t\t'description' => __( 'Shows a drop down list of Font Typefaces.', 'wp-super-edit' ), \n\t\t'provider' => 'tinymce', \n\t\t'plugin' => 'fonttools',\n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'fontsizeselect', \n\t\t'nicename' => __( 'Font Size Select', 'wp-super-edit' ), \n\t\t'description' => __( 'Shows a drop down list of Font Sizes.', 'wp-super-edit' ), \n\t\t'provider' => 'tinymce', \n\t\t'plugin' => 'fonttools', \n\t\t'status' => 'no'\n\t));\n\t\n\t// insertdatetime\n\t\n\t// WP Super Edit options for this plugin\n\t\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'insertdatetime', \n\t\t'nicename' => __( 'Insert Date / Time Plugin', 'wp-super-edit' ), \n\t\t'description' => __( 'Adds insert date and time buttons to automatically insert date and time.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'insertdate', \n\t\t'nicename' => __( 'Insert Date', 'wp-super-edit' ), \n\t\t'description' => __( 'Insert current date in editor', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'insertdatetime', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'inserttime', \n\t\t'nicename' => __( 'Insert Time', 'wp-super-edit' ), \n\t\t'description' => __( 'Insert current time in editor', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'insertdatetime', \n\t\t'status' => 'no'\n\t));\n\t\n\t// layer\n\t\n\t// WP Super Edit options for this plugin\n\t\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'layer', \n\t\t'nicename' => __( 'Layers (DIV) Plugin', 'wp-super-edit' ), \n\t\t'description' => __( 'Insert layers using DIV HTML tag. This plugin will change the editor to allow all DIV tags. Provides the Insert Layer, Move Layer Forward, Move Layer Backward, and Toggle Layer Positioning Buttons.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'insertlayer', \n\t\t'nicename' => __( 'Insert Layer', 'wp-super-edit' ), \n\t\t'description' => __( 'Insert a layer using the DIV HTML tag. Be careful layers are tricky to position.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'layer', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'moveforward', \n\t\t'nicename' => __( 'Move Layer Forward', 'wp-super-edit' ), \n\t\t'description' => __( 'Move selected layer forward in stacked view.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'layer', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'movebackward', \n\t\t'nicename' => __( 'Move Layer Backward', 'wp-super-edit' ), \n\t\t'description' => __( 'Move selected layer backward in stacked view.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'layer', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'absolute', \n\t\t'nicename' => __( 'Toggle Layer Positioning', 'wp-super-edit' ), \n\t\t'description' => __( 'Toggle the layer positioning as absolute or relative. Be careful layers are tricky to position.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'layer', \n\t\t'status' => 'no'\n\t));\n\t\n\t// nonbreaking\n\t\n\t// WP Super Edit options for this plugin\n\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'nonbreaking', \n\t\t'nicename' => __( 'Nonbreaking Spaces', 'wp-super-edit' ), \n\t\t'description' => __( 'Adds button to insert nonbreaking space entity.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'nonbreaking', \n\t\t'nicename' => __( 'Nonbreaking Space', 'wp-super-edit' ), \n\t\t'description' => __( 'Inserts nonbreaking space entities.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'nonbreaking', \n\t\t'status' => 'no'\n\t));\n\t\n\t// print\n\t\n\t// WP Super Edit options for this plugin\n\t\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'print', \n\t\t'nicename' => __( 'Print Button Plugin', 'wp-super-edit' ), \n\t\t'description' => __( 'Adds print button to editor that should print only the edit area contents.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'print', \n\t\t'nicename' => __( 'Print', 'wp-super-edit' ), \n\t\t'description' => __( 'Print editor area contents.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'print', \n\t\t'status' => 'no'\n\t));\n\t\n\t// searchreplace\n\n\t// WP Super Edit options for this plugin\n\t\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'searchreplace', \n\t\t'nicename' => __( 'Search and Replace Plugin', 'wp-super-edit' ), \n\t\t'description' => __( 'Adds search and replace buttons and options to the editor.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'search', \n\t\t'nicename' => __( 'Search', 'wp-super-edit' ), \n\t\t'description' => __( 'Search for text in editor area.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'searchreplace', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'replace', \n\t\t'nicename' => __( 'Replace', 'wp-super-edit' ), \n\t\t'description' => __( 'Replace text in editor area.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'searchreplace', \n\t\t'status' => 'no'\n\t));\n\t\n\t// style\n\t\n\t// WP Super Edit options for this plugin\n\t\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'style', \n\t\t'nicename' => __( 'Advanced CSS / styles Plugin', 'wp-super-edit' ), \n\t\t'description' => __( 'Allows access to properties that can be used in a STYLE attribute. Provides the Style Properties Button.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'styleprops', \n\t\t'nicename' => __( 'Style Properties', 'wp-super-edit' ), \n\t\t'description' => __( 'Interface for properties that can be manipulated using the STYLE attribute.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'style', \n\t\t'status' => 'no'\n\t));\n\t\n\t// table\n\t\n\t// WP Super Edit options for this plugin\n\t\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'table', \n\t\t'nicename' => __( 'Tables Plugin', 'wp-super-edit' ), \n\t\t'description' => __( 'Allows the creation and manipulation of tables using the TABLE HTML tag. Provides the Tables and Table Controls Buttons.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'table', \n\t\t'nicename' => __( 'Tables', 'wp-super-edit' ), \n\t\t'description' => __( 'Interface to create and change table, row, and cell properties.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'table', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'tablecontrols', \n\t\t'nicename' => __( 'Table controls', 'wp-super-edit' ), \n\t\t'description' => __( 'Interface to manipulate tables and access to cell and row properties.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'table', \n\t\t'status' => 'no'\n\t));\n\t\n\t// xhtmlxtras\n\t\n\t// WP Super Edit options for this plugin\n\t\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'xhtmlxtras', \n\t\t'nicename' => __( 'XHTML Extras Plugin', 'wp-super-edit' ), \n\t\t'description' => __( 'Allows access to interfaces for some XHTML tags like CITE, ABBR, ACRONYM, DEL and INS. Also can give access to advanced XHTML properties such as javascript events. Provides the Citation, Abbreviation, Acronym, Deletion, Insertion, and XHTML Attributes Buttons.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'cite', \n\t\t'nicename' => __( 'Citation', 'wp-super-edit' ), \n\t\t'description' => __( 'Indicate a citation using the HTML CITE tag.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'xhtmlxtras', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'abbr', \n\t\t'nicename' => __( 'Abbreviation', 'wp-super-edit' ), \n\t\t'description' => __( 'Indicate an abbreviation using the HTML ABBR tag.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'xhtmlxtras', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'acronym', \n\t\t'nicename' => __( 'Acronym', 'wp-super-edit' ), \n\t\t'description' => __( 'Indicate an acronym using the HTML ACRONYM tag.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'xhtmlxtras', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'del', \n\t\t'nicename' => __( 'Deletion', 'wp-super-edit' ), \n\t\t'description' => __( 'Use the HTML DEL tag to indicate recently deleted content.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'xhtmlxtras', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'ins', \n\t\t'nicename' => __( 'Insertion', 'wp-super-edit' ), \n\t\t'description' => __( 'Use the HTML INS tag to indicate newly inserted content.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'xhtmlxtras', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'attribs', \n\t\t'nicename' => __( 'XHTML Attributes', 'wp-super-edit' ), \n\t\t'description' => __( 'Modify advanced attributes and javascript events.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'xhtmlxtras', \n\t\t'status' => 'no'\n\t));\n\t\n}",
"function change_mce_options($init) {\r\n $default_colors = ' \"000000\", \"Black\",\r\n \"FFFFFF\", \"White\",\r\n \"4D4D4D\", \"Grey\",\r\n \"58CDCA\", \"Teal\",\r\n \"369F9C\", \"Dark Teal\"';\r\n $init['textcolor_map'] = '['.$default_colors.']';\r\n return $init;\r\n}",
"function tinyMceComment() {\n\n $init = '\n mode : \"textareas\",\n theme : \"advanced\",\n editor_selector : \"mceEditor\",\n plugins : \"safari,paste,inlinepopups,autosave\",\n width: \"100%\",\n height: 200,\n theme_advanced_toolbar_location : \"top\",\n theme_advanced_toolbar_align : \"left\",\n theme_advanced_buttons1 : \"undo,redo,pastetext,pasteword,selectall,|,bold,italic,underline,strikethrough,|,image,link,unlink,|,numlist,bullist,|,cleanup,code\",\n theme_advanced_buttons2 : \"\",\n theme_advanced_buttons3 : \"\",\n theme_advanced_statusbar_location : \"bottom\",\n entity_encoding : \"raw\",\n relative_urls : false,\n inline_styles : false,\n ';\n return $this->tinyMceInit($init);\n\n }",
"public function editor_settings() {\n\t\treturn array(\n\t\t\t'teeny' => true,\n\t\t\t'media_buttons' => false,\n\t\t\t'textarea_rows' => 5,\n\t\t\t'tinymce' => false,\n\t\t\t'quicktags' => array(\n\t\t\t\t'buttons' => 'strong,em,del,ul,ol,li,close,link',\n\t\t\t),\n\t\t);\n\t}",
"function pm_tinymce() {\n\t\tif ( bp_is_messages_component() && isset( $_POST['send'] ) && empty( $_POST['content'] ) && !empty( $_POST['message_content'] ) ) {\n\t\t\t$_POST['content'] = $_POST['message_content'];\n\t\t}\n\t}",
"function islamic_center_print_tinymce_editor(){\n\t\t\t\twp_editor( islamic_center_stopbackslashes($_POST['content']), \n\t\t\t\t\t$_POST['id'], array('textarea_name'=> $_POST['name']) );\t\t\t\n\t\t\t\tdie();\n\t\t\t}",
"public function load_tiny_mce() {\r\n\t\twp_tiny_mce( false, array(\r\n\t\t\t'editor_selector' => 'story[story_content]'\r\n\t\t\t)\r\n\t\t);\r\n\t}",
"public static function loadTinyMCE($admin = false)\n {\n $tinyMCE = '<!--TinyMCE Editor Load Start-->\n <script type=\"text/javascript\" src=\"/portfolio/Unus/plugins/Admin_TinyMCE/js/tiny_mce/tiny_mce.js\"></script>\n <script type=\"text/javascript\">\n tinyMCE.init({\n // General options\n mode : \"textareas\",\n theme : \"advanced\",\n skin : \"o2k7\",\n skin_variant : \"silver\",\n height: \"450\",\n margin: \"4px\",\n plugins : \"safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager\",\n \n // Theme options\n theme_advanced_buttons1 : \"save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect\",\n theme_advanced_buttons2 : \"cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor\",\n theme_advanced_buttons3 : \"tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen\",\n theme_advanced_buttons4 : \"insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage\",\n theme_advanced_toolbar_location : \"top\",\n theme_advanced_toolbar_align : \"left\",\n theme_advanced_statusbar_location : \"bottom\",\n \n // Example content CSS (should be your site CSS)';\n if ($admin)\n {\n $tinyMCE .= 'content_css : \"'.WEBPATH.'/admin/stylesheet.css\",';\n }\n else\n {\n $tinyMCE .= 'content_css : \"'.WEBPATH.'/stylesheet.css\",';\n }\n \n $tinyMCE .= '\n \n });\n </script>\n <!--TinyMCE Editor End-->';\n echo $tinyMCE;\n }",
"function load_wp_tiny_mce() {\n\t\t\tif ( ! $this->is_eddpromo_page() )\n\t\t\t\treturn;\n\n\t\t\t$settings = array(\n\t\t\t\t'editor_selector' => 'edd_promo_template',\n\t\t\t\t'height' => '400'\n\t\t\t);\n\n\t\t\twp_tiny_mce( false, $settings );\n\t\t}",
"function cp_get_editor_settings() {\n\t$settings = array(\n\t\t'wpautop' => true,\n\t\t'media_buttons' => false,\n\t\t'teeny' => false,\n\t\t'dfw' => true,\n\t\t'tinymce' => array(\n\t\t\t'setup' => 'function(ed){ ed.onChange.add(function(ed, l){ed.save(); jQuery(\"#\"+ed.id).valid();})}'\n\t\t),\n\t\t'quicktags' => array(\n\t\t\t'buttons' => 'strong,em,ul,ol,li,link,close',\n\t\t),\n\t);\n\n\treturn $settings;\n}",
"function aw_tinymce_global_description_js(){\r\n \r\n global $wp_version;\r\n \r\n if ( version_compare($wp_version, '3.9', '>=') ) { // WP 3.9 and on uses TinyMCE 4 ?>\r\n <script type=\"text/javascript\">\r\n jQuery(document).ready(function ($) {\r\n var settings = { menubar : false, selector : '#global_description'};\r\n try {\r\n tinymce.init( settings );\r\n } catch(e) {}\r\n });\r\n </script>\r\n <?php } else { // Older WP version than 3.9 uses TinyMCE 3 ?>\r\n <?php if($post->post_type == 'product'): ?>\r\n <script type=\"text/javascript\">\r\n jQuery(document).ready( tinymce_excerpt );\r\n function tinymce_excerpt() {\r\n jQuery(\"#global_description\").addClass(\"mceEditor\");\r\n var tinymceConfigs = [{\r\n theme : \"advanced\",\r\n mode : \"none\",\r\n height:\"200\",\r\n width:\"100%\",\r\n theme_advanced_layout_manager : \"SimpleLayout\",\r\n theme_advanced_toolbar_location : \"top\",\r\n theme_advanced_toolbar_align : \"left\",\r\n theme_advanced_buttons1 : \"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,code\", \r\n theme_advanced_buttons2 : \"\",\r\n forced_root_block : \"\",\r\n theme_advanced_buttons3 : \"\",\r\n convert_urls: false }];\r\n\r\n tinyMCE.settings = tinymceConfigs[0];\r\n tinyMCE.execCommand(\"mceAddControl\", false, \"global_description\");\r\n }\r\n </script>\r\n <?php endif; \r\n }\r\n}",
"function bbp_use_wp_editor($default = 1)\n{\n}",
"protected function setUpTinyMcePlugin()\n {\n if (!current_user_can('edit_posts') &&\n !current_user_can('edit_pages') &&\n !get_user_option('rich_editing')) {\n return;\n }\n\n add_filter('mce_external_plugins', array($this, 'addTinyMcePlugin'));\n add_filter('mce_buttons', array($this, 'addTinyMceButtons'));\n add_filter('mce_css', array($this, 'addTinyMceCss'));\n }",
"public function checkForTinyMCE() {\n $useTiny = $this->modx->getOption('gallery.use_richtext',$this->gallery->config,false);\n if ($useTiny) {\n $tinyCorePath = $this->modx->getOption('tiny.core_path',null,$this->modx->getOption('core_path').'components/tinymce/');\n if (file_exists($tinyCorePath.'tinymce.class.php')) {\n \n /* First fetch the gallery+tiny specific settings */\n $cb1 = $this->modx->getOption('gallery.tiny.buttons1',null,'undo,redo,selectall,pastetext,pasteword,charmap,separator,image,modxlink,unlink,media,separator,code,help');\n $cb2 = $this->modx->getOption('gallery.tiny.buttons2',null,'bold,italic,underline,strikethrough,sub,sup,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,justifyfull');\n $cb3 = $this->modx->getOption('gallery.tiny.buttons3',null,'styleselect,formatselect,separator,styleprops');\n $cb4 = $this->modx->getOption('gallery.tiny.buttons4',null,'');\n $cb5 = $this->modx->getOption('gallery.tiny.buttons5',null,'');\n $plugins = $this->modx->getOption('gallery.tiny.custom_plugins',null,'');\n $theme = $this->modx->getOption('gallery.tiny.theme',null,'');\n $bfs = $this->modx->getOption('gallery.tiny.theme_advanced_blockformats',null,'');\n $css = $this->modx->getOption('gallery.tiny.theme_advanced_css_selectors',null,'');\n \n /** @var modAction $browserAction */\n $browserAction = null;\n if ($this->modx->getVersionData()['version'] < 3){\n //V2\n $browserAction = $this->modx->getObject('modAction',array('controller' => 'browser'));\n }\n \n /* If the settings are empty, override them with the generic tinymce settings. */\n $tinyProperties = array(\n 'accessibility_warnings' => false,\n 'browserUrl' => $browserAction ? $this->modx->getOption('manager_url',null,MODX_MANAGER_URL).'index.php?a='.$browserAction->get('id').'&source=1' : null,\n 'cleanup' => true,\n 'cleanup_on_startup' => false,\n 'compressor' => '',\n 'execcommand_callback' => 'Tiny.onExecCommand',\n 'file_browser_callback' => 'Tiny.loadBrowser',\n 'force_p_newlines' => true,\n 'force_br_newlines' => false,\n 'formats' => array(\n 'alignleft' => array('selector' => 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', 'classes' => 'justifyleft'),\n 'alignright' => array('selector' => 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', 'classes' => 'justifyright'),\n 'alignfull' => array('selector' => 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', 'classes' => 'justifyfull'),\n ),\n 'frontend' => false,\n 'plugin_insertdate_dateFormat' => '%Y-%m-%d',\n 'plugin_insertdate_timeFormat' => '%H:%M:%S',\n 'preformatted' => false,\n 'resizable' => true,\n 'relative_urls' => true,\n 'remove_script_host' => true,\n 'theme_advanced_disable' => '',\n 'theme_advanced_resizing' => true,\n 'theme_advanced_resize_horizontal' => true,\n 'theme_advanced_statusbar_location' => 'bottom',\n 'theme_advanced_toolbar_align' => 'left',\n 'theme_advanced_toolbar_location' => 'top',\n \n \n 'height' => $this->modx->getOption('gallery.tiny.height',null,200),\n 'width' => $this->modx->getOption('gallery.tiny.width',null,'95%'),\n 'tiny.custom_buttons1' => (!empty($cb1)) ? $cb1 : $this->modx->getOption('tiny.custom_buttons1',null,'undo,redo,selectall,separator,pastetext,pasteword,separator,search,replace,separator,nonbreaking,hr,charmap,separator,image,modxlink,unlink,anchor,media,separator,cleanup,removeformat,separator,fullscreen,print,code,help'),\n 'tiny.custom_buttons2' => (!empty($cb2)) ? $cb2 : $this->modx->getOption('tiny.custom_buttons2',null,'bold,italic,underline,strikethrough,sub,sup,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect,separator,styleprops'),\n 'tiny.custom_buttons3' => (!empty($cb3)) ? $cb3 : $this->modx->getOption('tiny.custom_buttons3',null,''),\n 'tiny.custom_buttons4' => (!empty($cb4)) ? $cb4 : $this->modx->getOption('tiny.custom_buttons4',null,''),\n 'tiny.custom_buttons5' => (!empty($cb5)) ? $cb5 : $this->modx->getOption('tiny.custom_buttons5',null,''),\n 'tiny.custom_plugins' => (!empty($plugins)) ? $plugins : $this->modx->getOption('tiny.custom_plugins',null,'style,advimage,advlink,modxlink,searchreplace,print,contextmenu,paste,fullscreen,noneditable,nonbreaking,xhtmlxtras,visualchars,media'),\n 'tiny.editor_theme' => (!empty($theme)) ? $theme : $this->modx->getOption('tiny.editor_theme',null,'cirkuit'),\n 'tiny.skin_variant' => $this->modx->getOption('tiny.skin_variant',null,''),\n 'tiny.theme_advanced_blockformats' => (!empty($bfs)) ? $bfs : $this->modx->getOption('tiny.theme_advanced_blockformats',null,'p,h1,h2,h3,h4,h5,h6,div,blockquote,code,pre,address'),\n 'tiny.css_selectors' => (!empty($css)) ? $css : $this->modx->getOption('tiny.css_selectors',null,''),\n );\n require_once $tinyCorePath.'tinymce.class.php';\n $tiny = new TinyMCE($this->modx,$tinyProperties);\n $tiny->setProperties($tinyProperties);\n $html = $tiny->initialize();\n $this->addHtml($html);\n }\n }\n }",
"function link() {\r\n\t\t// Passing default values to tinyMCE\r\n\t\t$this->data['Editor'] = $this->params['form'];\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks the validity of a block ok $x=>[ 'data' => [id,generator,height], 'trx_data'=> [[arr1],[arr2],[arr3]], 'miner_public_key'=>11, 'miner_reward_signature'=>11, 'mn_public_key'=>11, 'mn_reward_signature'=>11, 'from_host'=>'' ], | public function check($x){
$data=$x['data'];
$prv=$this->prev($data['height']);
//hash
if ($this->hasha($x['miner_public_key'],$data['height'],$data['date'],$data['nonce'],$x['trx_data'],$data['signature'], $data['difficulty'],$data['argon'])!=$data['id']) {
$this->log('block.inc->check block hash false',0,true);
return false;
}
// generator's public key must be valid
//$Account = Accountinc::getInstance();
//check the argon hash and the nonce to produce a valid block
if (!$this->mine($x['miner_public_key'], $data['nonce'], $data['argon'], $data['difficulty'], $prv['id'], $prv['height'], $data['date'])) {
$this->log('block.inc->check mine false',0,true);
return false;
}
//height
if ($data['height']-$prv['height']!=1) {
$this->log('block.inc->check block height false',0,true);
return false;
}
//date
if ($data['date']-$prv['date']<=30) {
$this->log('block.inc->check block date false',0,true);
return false;
}
//nonce
//signature
if ($this->check_signature($data['generator'],$data['height'],$data['date'],$data['nonce'],$x['trx_data'],$x['miner_public_key'],$data['difficulty'], $data['argon'],$data['signature'])==false) {
$this->log('block.inc->check block signature false',0,true);
return false;
}
//difficulty
if ($this->valid_difficulty($data['height'],$data['difficulty'])==false) {
$this->log('block.inc->check block diff false',0,true);
return false;
}
//argon
if (strlen($data['argon']) < 20) {
$this->log('block.inc->check block argon false',0,true);
return false;
}
//transactions
if (count($x['trx_data'])!=$data['transactions']) {
$this->log('block.inc->check trx count false',0,true);
return false;
}
//reward
$my_trx_list=[];
$miner_reward=0;
$mn_reward=0;
foreach ($x['trx_data'] as $value) {
if ($value['version']!=0 and $value['version']!=4 and $value['version']!=111) {
$my_trx_list[]=$value;
}
if ($value['version']==0) {
$miner_reward=$value['val'];
}
if ($value['version']==4) {
$mn_reward=$value['val'];
}
}
// return array('miner_reward' => $miner_reward, 'mn_reward'=>$mn_reward,'max_reward'=>$max_reward,'destroy_reward'=>$destroy_reward);
$get_reward=$this->reward($data['height'], $my_trx_list);
if (bccomp($miner_reward, $get_reward['miner_reward'], 8)!=0) {
$this->log('Block.inc->check miner_reward false',0,true);
return false;
}
if ($mn_reward!==0) {
if (bccomp($mn_reward, $get_reward['mn_reward'], 8)!=0) {
$this->log('Block.inc->check mn_reward false',0,true);
return false;
}
}
$this->log('block.inc->check block finshed true',0,true);
return true;
} | [
"public function verify_block($data) {\n $record = ['date' => $data['date'], 'hid' => $data['hid'], 'data' => $data['data'], 'previous_hash' => $data['previous_hash']];\n $hash = hash('sha256', serialize($record));\n if ($hash == $data['hash']) {\n return TRUE;\n } else {\n return FALSE;\n }\n }",
"public function parse_block($block, $height, $data, $test=true){\n\tglobal $db;\n\t// data must be array\n\tif($data===false) return false;\n\t$acc=new Account;\n\t$trx=new Transaction;\n\t// no transactions means all are valid\n\tif(count($data)==0) return true;\n\n\t// check if the number of transactions is not bigger than current block size\n\t$max=$this->max_transactions();\n\tif(count($data)>$max) return false;\n\n\t$balance=array();\n\tforeach($data as &$x){\n\t\t// get the sender's account if empty\n\t\tif(empty($x['src'])) $x['src']=$acc->get_address($x['public_key']);\n\n\t\t//validate the transaction\n\t\tif(!$trx->check($x,$height)) return false;\n\t\t\n\t\t// prepare total balance\t\n\t\t$balance[$x['src']]+=$x['val']+$x['fee'];\t\n\n\t\t// check if the transaction is already on the blockchain\n\t\tif($db->single(\"SELECT COUNT(1) FROM transactions WHERE id=:id\",array(\":id\"=>$x['id']))>0) return false; \t\n\n\t}\n\t\n\t// check if the account has enough balance to perform the transaction\n\tforeach($balance as $id=>$bal){\n\t\t$res=$db->single(\"SELECT COUNT(1) FROM accounts WHERE id=:id AND balance>=:balance\",array(\":id\"=>$id, \":balance\"=>$bal));\n\t\tif($res==0) return false; // not enough balance for the transactions\t\n\t}\n\t\n\t// if the test argument is false, add the transactions to the blockchain\n\tif($test==false){\n\t\t\n\t\tforeach($data as $d){\n\t\t\t$res=$trx->add($block, $height, $d);\n\t\t\tif($res==false) return false;\n\t\t}\n\t}\n\t\n\treturn true;\n}",
"public function validate() : bool\n {\n $index = 0;\n $previous_hash = '0';\n foreach ($this->blocks as $block) {\n if ($block->index !== $index) {\n return false;\n }\n\n if ($block->previous_hash != $previous_hash) {\n return false;\n }\n\n if ($block->hash != $block->hash()) {\n return false;\n }\n\n $index = $block->index + 1;\n $previous_hash = $block->hash;\n }\n\n return true;\n }",
"private function checkBlockConds()\n {\n if( !is_null($this->blockconds) && is_array($this->blockconds) )\n {\n if(( isset($this->blockconds['item']) && isset($this->blockconds['operator']) && isset($this->blockconds['status'])\n && is_array($this->blockconds['item']) && is_array($this->blockconds['operator']) && is_array($this->blockconds['status'])\n && count($this->blockconds['item']) > 0 && (count($this->blockconds['item']) == (count($this->blockconds['operator']) == (count($this->blockconds['status']))))\n ) )\n {\n \n $error = false;\n foreach( $this->blockconds['item'] as $key => $value )\n {\n $item = new item();\n if( !(is_numeric($value) && $item->load($value)) )\n { \n $error = false;\n break;\n }\n else\n {\n if($item->getType() == 'CONTAINER')\n {\n $error = false;\n break;\n }\n \n if( !($this->blockconds['operator'][$key] == '=') )\n {\n $error = false;\n break;\n }\n \n if( !($this->blockconds['status'][$key] == 'COMPLETED' || $this->blockconds['status'][$key] == 'INCOMPLETE' || $this->blockconds['status'][$key] == 'PASSED'))\n {\n $error = false;\n break;\n }\n \n if($key > 0)\n {\n if( !($this->blockconds['condition'][$key-1] == 'AND' || $this->blockconds['condition'][$key-1] == 'OR') )\n {\n $error = false;\n break;\n } \n }\n \n }\n }\n \n if( $error )\n {\n return false;\n }\n else\n {\n return true;\n }\n }\n else\n {\n return false;\n }\n \n }\n else\n {\n return false;\n }\n }",
"private function validBlock()\n {\n if (is_array($this->context) && !array_key_exists('block', $this->context)) {\n $this->setBlock();\n }\n }",
"function validatefreeblock()\r\n{\r\n\t$array = new SplFixedArray(MAX); //initialize an array of size MAX with each element equal to zero initially.\r\n\tfor ($i=0;$i<MAX;$i++)\r\n\t{\r\n\t\t$array[$i]=0;\r\n\t}\r\n\t\r\n\t$directory = getcwd();\r\n\t$file0 = 'fusedata.';\r\n\t$superblock = $directory.'/FS/FS/'.$file0;\r\n\t\r\n\tfor ($i=1; $i<=30; $i++) // For Blocks which contain fusedata.x change corresponding value of array element to 2.\r\n\t\r\n\t{\r\n\t\r\n\t$file=$superblock.$i;\r\n\t$parameter = file_get_contents($file,FILE_USE_INCLUDE_PATH);\r\n\t$parameter = json_decode($parameter);\r\n\t\r\n\tif(isset($parameter->filename_to_inode_dict)) \r\n\t{\r\n\t\t$parameter1=$parameter->filename_to_inode_dict;\r\n\t\t$N=count($parameter1);\r\n\t\tfor ($j=0;$j<=$N;$j++)\r\n\t\t{\r\n\t\t\tif(isset($parameter1[$j]->location))\r\n\t\t\t{\r\n\t\t\t\t$array[$parameter1[$j]->location]=2;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\t\r\n\tfor ($i=1; $i<=25; $i++) // For Free Block elements given in fusedata.x change corresponding array elements to 1.\r\n\t\r\n\t{\r\n\t\r\n\t$file=$superblock.$i;\r\n\t$parameter = file_get_contents($file,FILE_USE_INCLUDE_PATH);\r\n\t$parameter = json_decode($parameter);\r\n\t$N=count($parameter);\r\n\t\r\n\tfor ($j=0;$j<$N;$j++)\r\n\t{\r\n\t\t$array[$parameter[$j]]=1;\r\n\t}\r\n\t}\r\n\t\r\n\tfor ($i=0;$i<=30;$i++)\r\n\t{\r\n\t\t$array[$i]=2;\r\n\t}\r\n\t\r\n\t\r\n\tfor ($i=0;$i<MAX;$i++) // Now only the free block elements that are not listed will have their corresponding array elements equal to zero.\r\n\t\t\t\t\t\t\t// Find those elements and list them. And add them to the Free Block List.\r\n\t{\r\n\t\tif ($array[$i]==2)\r\n\t\t\t\r\n\t\t{\r\n\t\t\techo \"Block\".$i.\"not included in Free Block List because it stores the file fusedata.\".$i.\"<br>\";\r\n\t\t}\r\n\t\t\r\n\t\tif ($array[$i]==0)\r\n\t\t{\r\n\t\t\techo \"Block\".$i.\"was not included in Free Block List. It is included now\".\"<br>\";\r\n\t\t\tfile_put_contents($superblock.'1', $i,FILE_USE_INCLUDE_PATH| LOCK_EX) or die(\"File suddenly lost!\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\r\n\techo \"All Remaining Blocks are included in Free Block List\";\r\n\t\r\n}",
"public static function isValidBlock( $ipblock ) {\n\t\treturn ( count(self::toArray($ipblock)) == 1 + 5 );\n\t}",
"public function verifyBankTransactionIpnHash($params) {\n // get params\n $status = $params['status'];\n $amount = $params['amount'];\n $type = $params['type'];\n $country_code = $params['country_code'];\n $currency = $params['currency'];\n $sandbox = $params['sandbox'];\n $state = $params['state'];\n $target = $params['target'];\n $transaction_id = $params['transaction_id'];\n $developer_trans_id = $params['developer_trans_id'];\n $transaction_type = $params['transaction_type'];\n $hash = $params['hash'];\n\n // check hash\n $check_hash = md5($amount . $country_code . $currency . $developer_trans_id . $sandbox . $state . $status . $target . $transaction_id . $transaction_type . $type . $this->SECRET_KEY);\n if ($check_hash !== $hash) {\n // return check hash fail\n }\n\n // check transaction status\n if ($status === 1) {\n // return transaction success \n return array(\n 'error_code' => 0,\n 'amount' => $amount\n );\n } else {\n return array(\n 'error_code' => 1,\n 'amount' => 0\n );\n }\n }",
"public function checkBlockData($data)\n {\n if ($data == '1') {\n return true;\n } elseif ($data == '0') {\n return false;\n }\n }",
"public function testBlock() {\n\t\t$this->assertEquals(0, Student::block(909876543,$this->db));\n\t\t$this->assertEquals(1, Student::unblock(200000052,$this->db));\n\t\t$this->assertEquals(1, Student::block(200000052,$this->db));\n\t}",
"public function testValidateTx()\n\t{\n\t\t/*$response = $this->call('GET', 'api/7xDsRLyXEd1PgJ6Glrhs6d/validate-transaction?password=strong_pass_plz&txid=xxx');\n\t\t$jsonResult = json_decode($response->getContent());\n\t\t$this->assertStringStartsWith('#validateTransaction: get transaction exception', $jsonResult->error);*/\n\n\t\t/* now validate correct tx */\n\t\t$txId = '075b23645199bfc3448d15ec0c9be9547f5da9f9394c0d6fe2ebb71230dae9d6';\n\n\t\t$response = $this->call('GET', 'api/7xDsRLyXEd1PgJ6Glrhs6d/validate-transaction?password=strong_pass_plz&txid='.$txId);\n\t\t$jsonResult = json_decode($response->getContent());\n\t\t$this->assertEquals(true, $jsonResult->is_valid);\n\t\t$this->assertEquals($txId, $jsonResult->tx_id);\n\t}",
"function validateData() {}",
"function checkBlockParam($blockId)\n{\n require \"config.php\";\n if (empty($blockId)) {\n sendError(\"Parameter 'bid' is required\");\n return false;\n }\n if (!in_array($blockId, $installedModules)) {\n sendError(\"Parameter 'bid' does not indicate a valid block\");\n return false;\n }\n return true;\n}",
"public function actionCheckLatest()\n\t{\n\t\tset_time_limit(60); //imposto il time limit unlimited\n\n\t\t$user_id = Yii::$app->user->id;\n\n\t\t//carico info del wallet\n\t\t$wallets = MPWallets::find()->where(['id_user'=>$user_id])->one();\n\n\t\tif (null === $wallets){\n\t\t\treturn Json::encode(['success'=>false]);\n\t\t}\n\n\t\t$behind_blocks = 15;\n\n\t\t$fromAddress = $wallets->wallet_address;\n\t\t$blockLatest = $this->getChainBlock($user_id);\n\t\t$chainBlock = $blockLatest->number;\n\n\t\t$savedBlock = '0x'. dechex (hexdec($blockLatest->number) - $behind_blocks );\n\n\t\t// Inizio il ciclo sui blocchi\n\t\tfor ($x=0; $x <= $behind_blocks; $x++)\n\t\t{\n\t\t\t//$transactions = [];\n\t\t\tif ((hexdec($savedBlock)+$x) <= hexdec($chainBlock)){\n\t\t\t\t//somma del valore del blocco in decimali\n\t\t\t\t$searchBlock = '0x'. dechex (hexdec($savedBlock) + $x );\n\t\t\t \t// ricerco le informazioni del blocco tramite il suo numero\n\t\t\t\t$block = $this->getChainBlock($user_id, $searchBlock, true);\n\t\t\t\t$transactions = $block->transactions;\n\t\t\t\t// echo '\\r\\n<br>search: '.$searchBlock.', chain: '.$chainBlock;\n\n\t\t\t\tif (!empty($transactions))\n\t\t\t\t{\n\t\t\t\t\t// echo '<pre>'.print_r($transactions,true).'</pre>';\n\t\t\t\t\t// exit;\n\n\t\t\t\t\tforeach ($transactions as $idx => $trans)\n\t\t\t\t\t{\n\t\t\t\t\t\t$inputinfo = $trans->input;\n\t\t\t\t\t\t$inputinit = substr($inputinfo,0,10);\n\n\t\t\t\t\t\t# Check if transaction is a contract transfer\n\t\t\t\t\t\tif ($trans->value == '0x0' && $inputinit != '0xa9059cbb') {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t# Check if transaction is a contract transfer\n\t\t\t\t\t\tif ($inputinit == '0xa9059cbb') {\n\t\t\t\t\t\t\t$smartContracts = SmartContracts::find()->where(['smart_contract_address'=>$trans->to])->one();\n\t\t\t\t\t\t\tif (null === $smartContracts) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$data = (object)[\n\t\t\t\t\t\t\t\t'contract_value' => hexdec('0x'.substr($inputinfo,-64)),\n\t\t\t\t\t\t\t\t'timestamp' => hexdec($block->timestamp),\n\t\t\t\t\t\t\t\t'txfrom' => $trans->from,\n\t\t\t\t\t\t\t\t'txto' => '0x'.substr($inputinfo,34,40),\n\t\t\t\t\t\t\t\t'blocknumber' => $block->number,\n\t\t\t\t\t\t\t\t'txhash' => $trans->hash,\n\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\t// cerco la transazione nella tabella transactions tramite txhash\n\t\t\t\t\t\t\t$tokens = Transactions::find()->findByHash($trans->hash);\n\n\t\t\t\t\t\t\tif (null === $tokens){\n\t\t\t\t\t\t\t\t// ho trovato una transazinoe che non è nel DB.\n\t\t\t\t\t\t\t\t$this->saveAndSendPushMessages([\n\t\t\t\t\t\t\t\t\t'userid' => $user_id,\n\t\t\t\t\t\t\t\t\t'smartContracts' => $smartContracts,\n\t\t\t\t\t\t\t\t\t'data' => $data,\n\t\t\t\t\t\t\t\t\t'fromAddress' => $fromAddress,\n\t\t\t\t\t\t\t\t\t'tokens' => null,\n\t\t\t\t\t\t\t\t\t'receiver' => true,\n\t\t\t\t\t\t\t\t\t'sender' => true,\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t// ho trovato la tx in db ma non ho ancora\n\t\t\t\t\t\t\t\t// aggiornato il ricevente...\n\t\t\t\t\t\t\t\t$this->saveAndSendPushMessages([\n\t\t\t\t\t\t\t\t\t'userid' => $user_id,\n\t\t\t\t\t\t\t\t\t'smartContracts' => $smartContracts,\n\t\t\t\t\t\t\t\t\t'data' => $data,\n\t\t\t\t\t\t\t\t\t'fromAddress' => $fromAddress,\n\t\t\t\t\t\t\t\t\t'tokens' => $tokens,\n\t\t\t\t\t\t\t\t\t'receiver' => ($tokens->token_received == 0) ? true : false,\n\t\t\t\t\t\t\t\t\t'sender' => ($tokens->status == 'new') ? true : false,\n\t\t\t\t\t\t\t\t]);\n\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t } // per ogni transazione trovata\n\t\t\t }// if not empty transaction\n\n\t\t\t //aggiorno il numero dei blocchi sul wallet\n\t\t\t // print_r($searchBlock);\n\t\t\t // $wallets->blocknumber = $searchBlock;\n\t\t\t // $wallets->update();\n\t\t }else{\n\t\t\t break;\n\t\t }\n\t } // ciclo for\n\t // exit;\n\t // // fwrite($myfile, date('Y/m/d h:i:s a', time()) . \" : Searching for transactions. Latest block #: $searchBlock: \\n\");\n\n\t $difference = hexdec($chainBlock) - hexdec($searchBlock);\n\t // echo \"\\r\\n<pre>differenza è: $difference</pre>\";\n\t // echo \"\\r\\n<pre>txfound è : \".$this->getTransactionsFound() .\"</pre>\";\n\t // echo '\\r\\n<pre>il transactiopn found finale è'.print_r($this->getTransactionsFound(),true).'</pre>';\n\n\n\t \t$timeToComplete = time() - hexdec($block->timestamp);\n\n\t\t$txFound = $this->getTransactionsFound();\n\t // if (!(empty($txFound)))\n\t // $this->log(\"getTransaction: <pre>\".print_r($txFound,true).\"</pre>\\n\");\n\n\n\t $return = [\n\t \t// 'id'=>time(),\n\t \t'success'=>true,\n\t \t'message'=>'response from check-transactions',\n\n\t \t'searchFromBlockNumber' => $savedBlock,\n\t \t// \"headerMessage\"=> Yii::t('app', \"{n} blocks left.\", ['n' => $difference]),\n\t \t\"transactions\"=>$txFound,\n\t \t \"walletBlocknumber\"=>$wallets->blocknumber,\n\t \t \"chainBlocknumber\"=>$chainBlock,\n\t \t \"headerMessage\"=> Yii::t('app', \"{n} blocks left.\", ['n' => $difference]),\n\t \t \"difference\"=> $difference,\n\t \t \"user_address\"=>$wallets->wallet_address,\n\t \t \"relativeTime\" => Yii::$app->formatter->asDuration($timeToComplete),\n\t ];\n\n\t // $this->log(\"<pre>il test found finale è: \".print_r($return,true).\"</pre>\");\n\n\t\treturn $this->json($return);\n\n\t}",
"public function blocknotify($block_hash) {\n\t\t$this->CI->load->model('users_model');\n\t\t$this->CI->load->model('logs_model');\n\t\t\t\t\t\n\t\t// First task, maintain a record of the processed blocks.\n\t\tif($this->CI->bitcoin_model->have_block($block_hash) == FALSE) {\n\t\t\t$block = $this->getblock($block_hash);\n\t\t\t\n\t\t\tif($block !== NULL && !isset($block['code']) && isset($block['height']))\n\t\t\t\t$this->CI->bitcoin_model->add_block($block_hash, $block['height']);\n\t\t}\n\t\t\n\t\t// Load all pending transactions, and abort if there's none.\n\t\t$pending = $this->CI->bitcoin_model->get_pending_txns();\n\t\tif($pending == FALSE)\n\t\t\treturn FALSE;\n\t\t\t\n\t\t// Prepare to build arrays of any transactions who need to be credited or have their confirmations changed.\n\t\t$credits = array();\n\t\t$confirmations = array();\n\t\t\n\t\t// Loop through pending transactions.\n\t\tforeach($pending as $txn) {\n\t\t\t$transaction = $this->gettransaction($txn['txn_id']);\n\n\t\t\t// Probably don't need this check as it will have been done before,\n\t\t\t// but do it just in case.\n\t\t\tif(!isset($transaction['code'])) {\n\t\t\t\t$array = array('txn_id' => $txn['txn_id'],\n\t\t\t\t\t\t\t 'user_hash' => $txn['user_hash'],\n\t\t\t\t\t\t\t 'confirmations' => $transaction['confirmations'],\n\t\t\t\t\t\t\t 'category' => $txn['category'],\n\t\t\t\t\t\t\t 'value' => $txn['value'] );\t// Re-cast as float, avoids error code.\n\t\t\t\t\n\t\t\t\t// Try to credit the balance to a users account if the topup transaction has reached 7 confirmations.\n\t\t\t\tif($txn['category'] == 'receive' && $transaction['details'][0]['account'] == 'topup' && $txn['credited'] == '0' && $array['confirmations'] > 6) {\n\t\t\t\t\tarray_push($credits, $array);\n\t\t\t\t\t$this->CI->bitcoin_model->set_credited($txn['txn_id']);\n\t\t\t\t\t\n\t\t\t\t\t$to_address = $this->new_main_address();\n\t\t\t\t\t$send = $this->sendfrom(\"topup\", $to_address, (float)$array['value']);\n\t\t\t\t\tif(isset($send['code'])) {\n\t\t\t\t\t\t$accounts = $this->listaccounts();\n\t\t\t\t\t\t$this->CI->logs_model->add('Block Notify Callback', \"Error moving funds from 'topup' account\", \"Current Balance: BTC {$accounts['topup']}\\nMove some funds into the topup address to cover transaction fee's.\", \"Severe.\");\n\t\t\t\t\t}\t\n\t\t\t\t}\n\n\t\t\t\t// If the transaction is to do with fee's, then check if the number of transactions exceeds one.\n\t\t\t\t// If the entry_payment still exists, and the confirmed balance >= the amount, then delete the \n\t\t\t\t// record and activate the account.\n\t\t\t\tif($txn['category'] == 'receive' && $transaction['details'][0]['account'] == 'fees' && $transaction['confirmations'] >1 ) {\n\t\t\t\t\t$user_hash = $this->CI->users_model->get_payment_address_owner($txn['address']);\n\t\t\t\t\t$entry = $this->CI->users_model->get_entry_payment($user_hash);\n\t\t\t\n\t\t\t\t\tif($entry !== FALSE) {\n\t\t\t\t\t\t$addr_balance = $this->getreceivedbyaddress($txn['address']);\n\n\t\t\t\t\t\tif($addr_balance >= $entry['amount'])\n\t\t\t\t\t\t\tif($this->CI->users_model->delete_entry_payment($user_hash))\n\t\t\t\t\t\t\t\t$this->CI->users_model->set_entry_paid($user_hash);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// If the transaction has more than 50 confirmations, stop tracking it.\n\t\t\t\tif($array['confirmations'] > 50)\n\t\t\t\t\t$array['confirmations'] = '>50';\n\t\t\t\t\t\n\t\t\t\t// If the number of confirmations has changed, update it.\n\t\t\t\tif($txn['confirmations'] !== $transaction['confirmations'])\n\t\t\t\t\tarray_push($confirmations, $array);\n\t\t\t}\n\t\t}\n\t\n\t\t// Update confirmations/balances in the database.\n\t\t$this->CI->bitcoin_model->update_confirmations($confirmations);\n\t\t$this->CI->bitcoin_model->update_credits($credits);\n\t}",
"function checkStructure() {\r\n\t\t$max=$this->data[crs][course][max_fields_cst];\r\n\t\tfor ($row=0;$row<count($this->data[cst]);$row++) {\r\n\t\t\t$value=$this->data[cst][$row][member];\r\n\t\t\tif ((is_array($value) && count($value)>$max) || (!is_array($value) && $max==1)) {\r\n\t\t\t\t$this->errorText[]=\"CRS-File: max_fields_cst does not match number of fields in the CST-File\";\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//additional validation statements\r\n\t\t//\r\n\t\t//\r\n\t\t\r\n\t}",
"function secp256k1_schnorrsig_verify_batch($context, $scratch, array $pubkeys, array $msg32s, array $sigs, int $numsigs): int {}",
"public function validateData();",
"public function checkStatus() {\n $blockCheckStatusResponse = new BlockCheckStatusResponse();\n $blockCheckStatusResult = new BlockCheckStatusResult();\n try{\n if(Tools::isEmpty(General::getInstance()->getUrl())) {\n throw new SDKException(\"URL_EMPTY_ERROR\", null);\n }\n $baseUrl = General::getInstance()->blockCheckStatusUrl();\n $result = Http::get($baseUrl);\n if (Tools::isEmpty($result)) {\n throw new SDKException(\"CONNECTNETWORK_ERROR\", null);\n }\n $blockCheckStatusLedgerResponse = Tools::jsonToClass($result, new BlockCheckStatusLedgerSeqResponse());\n $ledger_sequence = $blockCheckStatusLedgerResponse->ledger_manager->ledger_sequence;\n $chain_max_ledger_seq = $blockCheckStatusLedgerResponse->ledger_manager->chain_max_ledger_seq;\n if(!is_string($ledger_sequence)) {\n $ledger_sequence = number_format($ledger_sequence);\n }\n if (!is_string($chain_max_ledger_seq)) {\n $chain_max_ledger_seq = number_format($chain_max_ledger_seq);\n }\n if (bccomp($ledger_sequence, $chain_max_ledger_seq) < 0) {\n $blockCheckStatusResult->is_synchronous = false;\n }\n else {\n $blockCheckStatusResult->is_synchronous = true;\n }\n $blockCheckStatusResponse->buildResponse(\"SUCCESS\", null, $blockCheckStatusResult);\n }\n catch(SDKException $e) {\n $blockCheckStatusResponse->buildResponse($e->getErrorCode(), $e->getErrorDesc(), $blockCheckStatusResult);\n }\n catch (\\Exception $e) {\n $blockCheckStatusResponse->buildResponse(20000, $e->getMessage(), $blockCheckStatusResult);\n }\n return $blockCheckStatusResponse;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load merged files by storeId | public function loadByStoreId($storeId)
{
$this->setStoreId($storeId);
if (is_dir($this->_getMergedFilesPath())) {
$findedDirectories = array_diff(scandir($this->_getMergedFilesPath()), array('..', '.'));
foreach ($findedDirectories as $_directory) {
$dirPath = $this->_getMergedFilesPath() . DS . $_directory;
$this->_mergedFiles[$_directory] = array(
'if' => $this->_getDirFilesAsArray($dirPath . DS . 'if', true, false),
'params' => $this->_getDirFilesAsArray($dirPath . DS . 'params', true, false),
'common' => $this->_getDirFilesAsArray($dirPath . DS . 'common', true, false)
);
}
}
return $this;
} | [
"public function mergeModifiedFiles();",
"protected function seedMergeStorage() {\n // Clear out any existing data.\n $this->mergedStorage->deleteAll();\n\n // First, export all configuration from the active storage.\n // Get raw configuration data without overrides.\n foreach ($this->configManager->getConfigFactory()->listAll() as $name) {\n $this->mergedStorage->write($name, $this->configManager->getConfigFactory()->get($name)->getRawData());\n }\n // Get all override data from the remaining collections.\n foreach ($this->activeStorage->getAllCollectionNames() as $collection) {\n $collection_storage = $this->activeStorage->createCollection($collection);\n $merged_collection_storage = $this->mergedStorage->createCollection($collection);\n $merged_collection_storage->deleteAll();\n foreach ($collection_storage->listAll() as $name) {\n $merged_collection_storage->write($name, $collection_storage->read($name));\n }\n }\n }",
"public function loadAll() {\n\t\t$this->linkedStore->loadAll();\n\t}",
"private function loadChunk()\n {\n $portion = $this->api->getFilesChunk($this->options, $this->reverse);\n\n $this->options = $portion['params'];\n if ($portion['files']) {\n $this->container = array_merge($this->container, $portion['files']);\n }\n\n if (!count($portion['params'])) {\n $this->fullyLoaded = true;\n }\n }",
"public static function import() {\n $count = 0;\n $records = array();\n foreach (self::getSources() as $source) {\n $items = self::readFile($source['path']);\n\n foreach ($items as $item) {\n $item['active'] = true;\n $item['id'] = ++$count;\n $item['name'] = $source['name'];\n $item['type'] = $source['type'];\n $records[$count] = $item;\n }\n }\n self::saveRecords($records);\n }",
"public function getStoreWithStorePhotos($storeId)\n {\n return $this->model->where('id', $storeId)\n ->with('storePhoto')\n ->first()->toArray();\n }",
"protected function loadFiles() {\r\n\r\n // Query for file ID's and construct file array\r\n $query = new w2p_Database_Query();\r\n $query->addTable(COrder::_TBL_PREFIKS_ . \"_module_files\");\r\n $query->addWhere(\"module_id=$this->id\");\r\n $results = $query->loadList();\r\n\r\n $files = array();\r\n foreach($results as $row) {\r\n $file = new CFile();\r\n $file->load($row[\"file_id\"]);\r\n $files[] = $file;\r\n }\r\n\r\n $this->files = $files;\r\n }",
"function importFilesLoad() {\n\t\tif (!is_dir($this->import_dir)) {\n\t\t\t$Clients = new Clients($this->Database);\n\t\t\t$Clients->createClientImportsDirectory($this->config['code']);\n\t\t}\n\t\t$entries = scandir($this->import_dir);\n\t\tforeach ($entries as $entry) {\n\t\t\tif (is_dir($this->import_dir . '/' . $entry)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$entry = pathinfo($entry);\n\t\t\t$this->import_files[$entry['filename']] = $entry['basename'];\n\t\t}\n\t}",
"public function merge();",
"public abstract function loadAll();",
"public abstract function getStagedFiles();",
"protected function loadSources() {\n if ($this->loaded === true) {\n return;\n }\n foreach ($this->sources as $source) {\n /* @var $source \\Royalcms\\Component\\DirectoryHasher\\Source\\SourceInterface */\n $this->result->addFileResults(\n $source->getFileResults()\n );\n }\n $this->loaded = true;\n }",
"private function mergeData()\n {\n $files = $this->files;\n if($files) {\n foreach($files as $file) {\n $file['parent_id'] = $this->parentId;\n $this->items[] = $file;\n }\n }\n\n if(!$this->limit) {\n return $this->items;\n }\n $this->items = Paginator::make($this->items, $this->folders->getTotal(), $this->folders->getPerPage());\n return true;\n }",
"public function merge(...$stores) {\n\n\t\t$newStore = $this->data;\n\n\t\tforeach($stores as $store) {\n\n\t\t\tif(is_array($store) === true) {\n\n\t\t\t\t$newStore = $newStore + $store;\n\n\t\t\t} else if($store instanceof Store) {\n\n\t\t\t\t$newStore = $newStore + $store->data;\n\n\t\t\t}\n\n\t\t}\n\n\t\t$this->data = $newStore;\n\n\t}",
"private function loadSubmissionFiles() {\n $submitter_id = $this->graded_gradeable->getSubmitter()->getId();\n $gradeable = $this->graded_gradeable->getGradeable();\n $course_path = $this->core->getConfig()->getCoursePath();\n $config = $gradeable->getAutogradingConfig();\n\n // Get the path to load files from (based on submission type)\n $dirs = $gradeable->isVcs() ? ['submissions', 'checkout'] : ['submissions'];\n\n\n foreach ($dirs as $dir) {\n $this->meta_files[$dir] = [];\n $this->files[$dir][0] = [];\n\n $path = FileUtils::joinPaths($course_path, $dir, $gradeable->getId(), $submitter_id, $this->version);\n\n // Now load all files in the directory, flattening the results\n $submitted_files = FileUtils::getAllFiles($path, [], true);\n foreach ($submitted_files as $file => $details) {\n if (substr(basename($file), 0, 1) === '.') {\n $this->meta_files[$dir][$file] = $details;\n }\n else {\n $this->files[$dir][0][$file] = $details;\n }\n }\n // If there is only one part (no separation of upload files),\n // be sure to set the \"Part 1\" files to the \"all\" files\n if ($config->getNumParts() === 1 && !$config->isNotebookGradeable()) {\n $this->files[$dir][1] = $this->files[$dir][0];\n }\n\n $part_names = $config->getPartNames();\n $notebook_model = null;\n if ($config->isNotebookGradeable()) {\n $notebook_model = $config->getUserSpecificNotebook($submitter_id);\n\n $part_names = range(1, $notebook_model->getNumParts());\n }\n\n // A second time, look through the folder, but now split up based on part number\n foreach ($part_names as $i => $name) {\n foreach ($submitted_files as $file => $details) {\n $dir_name = \"part{$i}/\";\n $index = $i;\n if ($config->isNotebookGradeable() && isset($notebook_model->getFileSubmissions()[$i])) {\n $dir_name = $notebook_model->getFileSubmissions()[$i][\"directory\"];\n $index = $name;\n }\n\n if (substr($file, 0, strlen($dir_name)) === $dir_name) {\n $this->files[$dir][$index][substr($file, strlen($dir_name))] = $details;\n }\n }\n }\n }\n }",
"private function mergeData()\n {\n\n $files = $this->files;\n $folders = $this->folders;\n $this->templates = [];\n\n if($this->deletedTemplates) {\n\n if ($folders) {\n foreach ($folders as $item) {\n if ($item->is_dir) {\n $this->templates[] = $item;\n } else {\n $this->folderReferenceFiles[] = $item;\n $this->templates[] = $this->fileFindById($item->reference_id);\n }\n }\n }\n\n } else {\n\n if ($folders) {\n foreach ($folders as $item) {\n if ($item->is_dir) {\n $this->templates[] = $item;\n } else {\n $this->folderReferenceFiles[] = $item;\n }\n }\n }\n\n if($files) {\n foreach($files as $file) {\n $file['parent_id'] = $this->findParentIdByRefId($file->id);\n $file['ancestors'] = $this->getFileAncestors($file->id);\n $this->templates[] = $file;\n }\n }\n }\n\n if(!$this->limit) {\n return $this->templates;\n }\n $this->templates = Paginator::make($this->templates, $this->folders->getTotal(), $this->folders->getPerPage());\n return true;\n }",
"function LoadAllFiles($dirname){}",
"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 }",
"function getFilesForId($id);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
executes using interface types | public function testExecutesUsingInterfaceTypes()
{
$source = '
{
__typename
name
friends {
__typename
name
woofs
meows
}
}';
$expected = [
'__typename' => 'Person',
'name' => 'John',
'friends' => [
['__typename' => 'Person', 'name' => 'Liz'],
['__typename' => 'Dog', 'name' => 'Odie', 'woofs' => true],
]
];
/** @noinspection PhpUnhandledExceptionInspection */
$result = execute($this->schema, parse($source), $this->john);
$this->assertSame($expected, $result->getData());
} | [
"abstract protected function executeWith($object);",
"abstract public function execute($params);",
"abstract protected function exec();",
"abstract protected function _execute();",
"abstract public function executeQuery($query,$ret_type=\"objects\");",
"public function executar();",
"public function implementsInterface($interface){}",
"abstract public function execute($ids);",
"public function execute($data);",
"abstract public function execute( $arguments );",
"public function make(string $interface, array $parameters = []);",
"abstract public function exec($arParams);",
"function doInterface(IProduct $product)\n {\n echo $product->apples();\n echo $product->oranges();\n }",
"abstract public function execute(array $ids);",
"public function Bind($Interface);",
"protected abstract function performImpl();",
"abstract public function executeCommand ();",
"public function process(OrderInterface $order)\n {\n foreach ($this->operations as $operation) {\n $operation->process($order);\n }\n }",
"abstract public function perform();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
method validation when calledWhenTheresNoBetInDB should returnServiceActionResultTrueAndCreateNewBet | public function test_validation_calledWhenTheresNoBetInDB_returnServiceActionResultTrueAndCreateNewBet()
{
$expected = new ActionResult(true);
$date = new \DateTime();
list($playConfig,$euroMillionsDraw) = $this->getPlayConfigAndEuroMillionsDraw();
$this->userRepository_double->find(Argument::any())->willReturn($this->getUser());
$this->lotteryService_double->getNextDateDrawByLottery('EuroMillions', new \DateTime('2015-09-16 00:00:00'))->willReturn($date);
$this->betRepository_double->getBetsByDrawDate($date)->willReturn(null);
$this->callValidationApi(true);
$this->lotteryValidation_double->getXmlResponse()->willReturn(new \SimpleXMLElement(self::$content_with_ok_result));
$this->lotteryValidation_double->getCastilloId()->willReturn(1);
$this->logValidationApi_double->add(Argument::type($this->getEntitiesToArgument('LogValidationApi')))->shouldBeCalled();
$this->betRepository_double->add(Argument::any())->willReturn(true);
$this->userRepository_double->add(Argument::any())->willReturn(true);
$entityManager_stub = $this->getEntityManagerDouble();
$entityManager_stub->persist(Argument::any())->shouldBeCalled();
$this->iDontCareAboutFlush();
$sut = $this->getSut();
$actual = $sut->validation($playConfig,$euroMillionsDraw, $date, new \DateTime('2015-09-16 00:00:00'), $this->lotteryValidation_double->reveal());
$this->assertEquals($expected,$actual);
} | [
"public function createBet() {\n \n $betForm = new CreateBetForm($_POST);\n\n $betForm->validate();\n\n if($betForm->getErrors()) {\n $this->redirectWithErrors(BET_CREATION, $betForm->getErrors() );\n }\n\n $date = TypeConverter::stringifyDate(new DateTime());\n $betName = Cleaner::cleanHtml($_POST[\"bet_name\"]);\n $betDescription = Cleaner::cleanHtml($_POST['bet_description']);\n $betAvailableDate = $_POST[\"bet_available\"];\n $betUnAvailableDate = $_POST[\"bet_unavailable\"];\n $betCategory = $_POST[\"bet_category\"];\n\n $betQuestions = Cleaner::cleanArray( $_POST[\"bet_questions\"] );\n $betResponses = Cleaner::cleanArray( array_values($_POST[\"bet_responses\"]));\n\n\n $betId = $this->betModel->insert($betName, $betDescription, $date, $this->user->idUser, $betAvailableDate, $betUnAvailableDate, $betCategory);\n\n if($betId) {\n\n foreach($betQuestions as $k=>$question) {\n\n $qId = $this->questionModel->insert($betId, htmlspecialchars( $question ), $k);\n\n if($qId) {\n \n $this->answerModel->insertMany($betResponses[$k],$qId);\n\n }\n else \n {\n throw new \\Exception(\"The question hasn't been created\"); \n }\n \n }\n $this->redirect(\\BET_LIST_PRIVATE, \"Le pari a correctement été créé\");\n } \n else {\n throw new \\Exception(\"The bet hasn't been created\");\n }\n\n }",
"public function validate(Bet $bet);",
"public function test_validation_calledToValidationApi_returnActionResultFalse()\n {\n $expected = new ActionResult(false);\n list($playConfig, $euroMillionsDraw) = $this->exerciseValidationBet($expected);\n $sut = $this->getSut();\n $actual = $sut->validation($playConfig,$euroMillionsDraw, new \\DateTime(), new \\DateTime('2015-09-16 00:00:00'), $this->lotteryValidation_double->reveal());\n $this->assertEquals($expected,$actual);\n\n }",
"public function test_validateBet_calledWithTicketUsed_returnActionResultFalse()\n {\n $this->markTestSkipped('This test don\\'t works anymore :( | Fix it? ');\n\n $actual = $this->exerciseValidation(new CastilloTicketId('2176681082'), new \\DateTime('2016-10-04'));\n $expected = new ActionResult(false,'Ticket id (2176681082) already received.');\n $this->assertEquals($expected,$actual);\n\n }",
"public function doBet() {\r\n $matchTeamRepository = $this->app['em']->getRepository('App\\Model\\Entity\\Matchteam');\r\n $betMatchRepository = $this->app['em']->getRepository('App\\Model\\Entity\\Betmatchs');\r\n $matchTeamList = $matchTeamRepository->find(null, 0, array(\"score\" => NULL));\r\n\r\n foreach($matchTeamList as $matchTeam) {\r\n if (strtotime(\"-15 minutes\",$matchTeam->getIdmatchs()->getDate()->getTimestamp()) > time()) {\r\n $matchTeamIdList[] = $matchTeam->getIdmatchteam();\r\n }\r\n }\r\n\r\n $betForm = $this->app['form.factory']->create(new \\App\\Form\\BetType($matchTeamIdList));\r\n $betForm->bind($this->app['request']);\r\n if ($betForm->isValid()){\r\n $datas = $betForm->getData();\r\n\r\n foreach($matchTeamList as $matchTeam) {\r\n $userRepository = $this->app['em']->getRepository('App\\Model\\Entity\\Players');\r\n $user = $userRepository->getUserByUsername($this->app['security']->getToken()->getUser()->getUsername());\r\n\r\n $betMatch = $betMatchRepository->find(array(\"idmatchteam\" => $matchTeam, \"idplayers\" => $user ));\r\n if (in_array($matchTeam->getIdmatchteam(), $matchTeamIdList)) {\r\n if ($betMatch) {\r\n $betMatch->setScore($datas[\"score\".$matchTeam->getIdmatchteam()]);\r\n $betMatchRepository->update($betMatch);\r\n } else {\r\n $betMatch = new Betmatchs();\r\n $betMatch->setIdmatchteam($matchTeam);\r\n $betMatch->setIdplayers($user);\r\n $betMatch->setScore($datas[\"score\".$matchTeam->getIdmatchteam()]);\r\n $betMatchRepository->save($betMatch);\r\n }\r\n }\r\n }\r\n\r\n //add flash success\r\n $this->app['session']->getFlashBag()->add('success', $this->app['translator']->trans('save succeed'));\r\n } else {\r\n $this->app['session']->getFlashBag()->add('error', $this->app['translator']->trans('save error'));\r\n }\r\n\r\n return $this->app->redirect($this->app[\"url_generator\"]->generate(\"match.index\"));\r\n }",
"public function isValidBet($bet);",
"public function ValidatorInsertDBsuccesfull(){\n }",
"public function validForCreate()\n {\n return $this->passes();\n }",
"public function shouldValidate();",
"protected function validateSave () {}",
"public function validateGetValidateResult();",
"public function test_validateBet_apiReturnOK_returnActionResultTrue()\n {\n list($bet, $castilloCypherKey) = $this->prepareForSendingValidation(self::$content_with_ok_result);\n $this->prepareCurl();\n\n $actual = $this->exerciseValidate($bet,$castilloCypherKey);\n $expected = new ActionResult(true);\n $this->assertEquals($expected,$actual);\n }",
"protected function validateAsset(){\n if(empty(request()->asset_name)){\n return redirect()->back()->withErrors(\"Department Name is needed\");\n }elseif(empty(request()->price)){\n return redirect()->back()->withErrors('Price is needed, to continue');\n }elseif(empty(request()->initial_quantity)){\n return redirect()->back()->withErrors('Initial Quantity is needed, to continue');\n }else{\n return $this->createAsset();\n }\n }",
"public function validateCreate(){\n $currentUser=$this->getCurrentUser();\n /** @noinspection PhpMethodParametersCountMismatchInspection */\n $this->input->field('miner')\n ->addRule(IValidator::REQUIRED,'Miner ID is required!')\n ->addRule(IValidator::CALLBACK,'Requested miner is not available!',function($value)use($currentUser){\n try{\n $miner=$this->minersFacade->findMiner($value);\n }catch(\\Exception $e){\n return false;\n }\n if (!($miner->getUserId()==$currentUser->userId)){return false;}\n return $miner->metasource->state==Metasource::STATE_AVAILABLE;\n });\n /** @noinspection PhpMethodParametersCountMismatchInspection */\n $this->input->field('minSupport')\n ->addRule(IValidator::REQUIRED,'Min value of support is required!')\n ->addRule(IValidator::RANGE,'Min value of support has to be in interval [0;1]!',[0,1]);\n }",
"public function postDentalSave()\n {\n $data = Input::all();\n\n $validator = Validator::make($data, ServiceProcedureDental::$roles);\n\n if ($validator->passes()) {\n // Check duplicate\n\n $procedure = new ServiceProcedureDental();\n\n $procedure->service_id = $data['service_id'];\n $procedure->hospcode = Auth::user()->hospcode;\n $procedure->user_id = Auth::id();\n $procedure->procedure_id = $data['procedure_id'];\n $procedure->tcount = $data['tcount'];\n $procedure->rcount = $data['rcount'];\n $procedure->dcount = $data['dcount'];\n $procedure->tcode = $data['tcode'];\n $procedure->provider_id = $data['provider_id'];\n $procedure->price = $data['price'];\n\n $isDuplicate = ServiceProcedureDental::isDuplicate((int) $data['service_id'], (int) $data['procedure_id'])->count();\n\n if ($isDuplicate) {\n $json = ['ok' => 0, 'error' => 'รายการซ้ำ'];\n } else {\n try {\n $procedure->save();\n $json = ['ok' => 1, 'id' => $procedure->id];\n } catch (Exception $e) {\n $json = ['ok' => 0, 'error' => $e->getMessage()];\n }\n }\n } else {\n $json = ['ok' => 0, 'error' => 'ข้อมูลไม่ครบถ้วนกรุณาตรวจสอบอีกครั้ง'];\n }\n\n return Response::json($json);\n }",
"public function postCreate(Request $request){\n //Set validation rules for user inputs, set validation attributes and return offer\n //create page with validation errors if validator fails.\n $validator = Validator::make($request->all(), $this->offer_model->new_offer_validation_rules);\n $validator->setAttributeNames($this->offer_model->validation_attribute);\n if ($validator->fails()) {\n return redirect('offer/create')\n ->withErrors($validator)\n ->withInput();\n };\n $data = $this->constructData($request);\n //placement ids, input\n $placement_ids = $data['placement_ids'];\n $placement_flag = $this->validateOfferPlacements($data['valid_until'], $placement_ids);\n if($placement_flag){\n return redirect('offer/create')\n ->withErrors($validator)\n ->withInput()\n ->with('placement_notice', $placement_flag);\n }\n if(isset($data['offer_status'])):\n $offer_statuses = $data['offer_status'];\n endif;\n //ji user ids, input\n $ji_user_ids = null;\n if(isset($data['ji_user_ids'])):\n $ji_user_ids = $data['ji_user_ids'];\n endif;\n unset($data['offer_status'], $data['ji_user_ids'], $data['placement_ids']);\n try {\n $data['valid_from'] = $this->getDateFormat($data['valid_from']);\n $data['valid_until'] = $this->getDateFormat($data['valid_until']);\n $data['offer_code'] = $this->verifyOfferCode();\n //Insert all the offer's info/data into database and redirect to offer listing\n //page with success notice if all info/data is inserted successfully.\n $insert_flag = $this->offer_model->insertOffer($data);\n if(empty($insert_flag)):\n throw new Exception('Could not insert offer now. Please try again.');\n endif;\n $insert_offer_id = $insert_flag->id;\n if($ji_user_ids){\n $ji_user_flag = $this->offer_user_model->insertByOffer($insert_offer_id, $ji_user_ids);\n }\n $offer_placement_data = $this->offerPlacementData($insert_offer_id, $data['valid_until'], $placement_ids);\n $offer_placement_flag = $this->offer_placement_model->insertOfferPlacement($offer_placement_data);\n if(empty($offer_placement_flag)):\n $this->offer_model->deleteOffer($insert_offer_id);\n throw new Exception('Could not insert in offer_placement table. Please try again.');\n endif;\n if(isset($offer_statuses)):\n $offer_status_flag = $this->offer_offer_status_model->insertOfferStatus($insert_offer_id, $offer_statuses);\n if(empty($offer_status_flag)):\n $this->offer_model->deleteOffer($insert_offer_id);\n throw new Exception('Could not insert in offer_offer_status table. Please try again.');\n endif;\n endif;//End if isset, offer status\n $this->updateCommunicationPackage($data['has_communication_package'], $insert_offer_id, 'new', '');\n //Redirect to offer listing page with success notice\n return redirect('offer/index')->with('added_notice', 'New offer has been added successfully.');\n } catch (\\Exception $e) {\n return response()->json(['exc' => utf8_encode($e->getMessage())]);\n }//End try-catch\n }",
"public function saveSingleBet(Request $request)\n\t{\n\t\t$data \t\t\t= [];\n\t\t$data['status']\t= 'Error';\n\t\tif($this->user_id) {\n\t\t\t$stake_array\t= \t$request->stake_amount;\n\t\t\t$odds_array\t\t= \t$request->odds_values;\n\t\t\t$count \t\t\t=\t0;\n\t\t\t$betwise_stake\t=\t[];\n\t\t\t$error\t\t\t=\t0;\n\t\t\t$currency\t\t= Session::get('conf_user_details')->currency;\n\t\t\tforeach (session('pre_match_selected_bet') as $odd_id => $each_bet) {\n\t\t\t\tif(isset(getBetRule()->straight_bet_min_limit->{$currency}) && abs($stake_array[$count]) < getBetRule()->straight_bet_min_limit->{$currency}) {\n\t\t\t\t\t$data['message']\t= __('alert_info. Minimum Stake Limit is ').getBetRule()->straight_bet_min_limit->{$currency};\n\t\t\t\t\t$error++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telseif (isset(getBetRule()->straight_bet_max_limit->{$currency}) && abs($stake_array[$count]) > getBetRule()->straight_bet_max_limit->{$currency}) {\n\t\t\t\t\t$data['message']\t= __('alert_info. Maximum Stake Limit is ').getBetRule()->straight_bet_max_limit->{$currency};\n\t\t\t\t\t$error++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse {\n\n\t\t\t\t\tif ($each_bet['type'] == 'live') {\n\t\t\t\t\t\tif($this->isValidLiveOdd($each_bet['country'], $each_bet['league'], $each_bet['match_id'], $each_bet['market_id'], $each_bet['bet_for'])) {\n\t\t\t\t\t\t\tif ($odds_array[$count] != round($this->live_odd_details['odds_value'], 2)) {\n\t\t\t\t\t\t\t\t$this->odds_value_changed = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ($request->except_single_odds_changes != 1 && $this->odds_value_changed == true) {\n\t\t\t\t\t\t\t\t$data['message']\t= __('alert_info. You need to agree to except all odds changes to place this bet');\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t$this->setLiveBetIntoSession();\n\t\t\t\t\t\t\t\t$betwise_stake[$odd_id]\t=\tceil(abs($stake_array[$count]));\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($this->isValidOdd($odd_id)) {\n\t\t\t\t\t\t\tif ($odds_array[$count] != round($this->odd_details->odds_value, 2)) {\n\t\t\t\t\t\t\t\t$this->odds_value_changed = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ($request->except_single_odds_changes != 1 && $this->odds_value_changed == true) {\n\t\t\t\t\t\t\t\t$data['message']\t= __('alert_info. You need to agree to except all odds changes to place this bet');\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t$this->setBetIntoSession();\n\t\t\t\t\t\t\t\t$betwise_stake[$odd_id]\t=\tceil(abs($stake_array[$count]));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t$count++;\n\t\t\t}\n\t\t\tif($error == 0) {\n\t\t\t\t$data\t=\t$this->saveSingleBetIntoDb($betwise_stake);\n\t\t\t}\n\t\t} else {\n\t\t\t$data['message']\t= __('alert_info. Please Login First!');\n\t\t}\n\t\techo json_encode($data);\n\t}",
"public function validateInsert() {}",
"public function customerValidation() {\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the predefined parameters | public function predefinedParameters()
{
return $this->predefinedParams;
} | [
"public function getDefinedParameters();",
"function getParams() {}",
"public function getParameters()\r\n {\r\n }",
"public function getPossibleParams();",
"public function getGetParameters()\n {\n return;\n }",
"public function getAdditionalParameters();",
"public function getExtraParameters();",
"protected function getInternalParameters()\n {\n return [];\n }",
"public function get_default_params()\n {\n }",
"protected function get_global_params()\n {\n $params = [];\n\n if (! empty($this->options['quality'])) {\n $params[\"quality\"] = $this->options['quality'];\n }\n\n // if ( ! empty ( $this->options['auto_enhance'] ) ) {\n // \tarray_push( $auto, 'enhance' );\n // }\n\n if (! empty($this->options['auto_compress'])) {\n $params[\"compress\"] = \"true\";\n }\n\n return $params;\n }",
"function getParamsConf()\n {\n return array();\n }",
"protected function _getAllParams()\r\n\t{\r\n\t\treturn Katharsis_Request::getParams();\r\n\t}",
"function getParams()\n {\n $params = array();\n $params['user'] = array('label' => _L(\"Username\"), 'type' => 'text');\n $params['password'] = array('label' => _L(\"Password\"), 'type' => 'text');\n $params['ssl'] = array('label' => _L(\"Use SSL\"),\n 'type' => 'boolean',\n 'required' => false);\n $params['delivery_report'] = array('label' => _L(\"URL for your script delivery status report\"),\n 'type' => 'text',\n 'required' => false);\n\n\n return $params;\n }",
"public function listParams()\n {\n return [$this->prefetchSize, $this->prefetchCount, $this->global];\n }",
"public function getRequestParameters();",
"private function _get_params() {\n\t\treturn $this->_params;\n\t}",
"public static function getProviderParameters();",
"public function getParameters(): array\n {\n return [\n 'm' => $this->m,\n 'b' => $this->b,\n ];\n }",
"protected function getRequiredParameters()\n {\n return array();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test generation of unique event ids | public function testGeneratesUniqueValues() {
$eventIds = array();
for ($i = 0; $i < 100; $i++) {
$eventIds[] = EventIdGenerator::guidv4();
}
$eventIds = array_unique($eventIds);
$this->assertEquals(100, count($eventIds));
} | [
"public function testGenerateUniqueIds(): void\n {\n $order = $this->getMockBuilder(Order::class)\n ->setMethods(['getId'])\n ->setMethods(['getDetails'])\n ->disableOriginalConstructor()\n ->getMock();\n\n $order->method('getId')->willReturn('A1');\n $order->method('getDetails')->willReturn(['test']);\n\n $courier = new ExampleCourier();\n $results = [];\n $numSamples = 1000;\n\n for ($i = 0; $i < $numSamples; $i++) {\n $results[] = $courier->generateConsignmentId($order);\n }\n\n $uniqueResults = array_unique($results);\n $this->assertEquals(count($uniqueResults), count($results));\n }",
"public function testGeneratingId()\n {\n $entity = new stdClass();\n $idGenerator = new UuidV4Generator();\n $id1 = $idGenerator->generate($entity);\n $id2 = $idGenerator->generate($entity);\n $this->assertNotSame($id1, $id2);\n $this->assertEquals(36, strlen($id1));\n $this->assertEquals(36, strlen($id2));\n }",
"public function testGenerateMessageId()\n {\n if ( ezcMailTools::generateMessageID( \"doe.com\" ) === ezcMailTools::generateMessageID( \"doe.com\") )\n {\n $this->fail( \"testGenerateMessageID generated the same ID twice\" );\n }\n }",
"public function testUniqueEvent()\n\t{\n\t\t$event = \"event\";\n\t\t\n\t\t$this->statpro\n\t\t\t->expects($this->once())\n\t\t\t->method(\"hitUniqueStat\")\n\t\t\t->with(\n\t\t\t\t$this->equalTo($event),\n\t\t\t\t$this->equalTo($this->getAttribute(\"application_id\")),\n\t\t\t\t$this->equalTo($this->getAttribute(\"track_key\")),\n\t\t\t\t$this->equalTo($this->getAttribute(\"space_key\")));\n\t\t\n\t\t$this->driver\n\t\t\t->expects($this->once())\n\t\t\t->method(\"getStatProClient\")\n\t\t\t->will($this->returnValue($this->statpro));\n\n\t\t$params = array(\"unique\" => \"TRUE\", \"event\" => $event);\n\t\t\n\t\t$action = new VendorAPI_CFE_Actions_RecordEvent($params);\n\n\t\t$action->execute($this->context);\n\t}",
"public function testCreateRepetitiveEventWithoutConflict(){\n\n $email = \"testUser@test.test\";\n $user = User::where(\"email\", $email)->first();\n $this->actingAs($user, \"api\");\n\n\t\t$payload = [\n\t\t\t\"title\" \t\t=> \t\"Test\",\n\t\t\t\"start\"\t\t\t=> \tCarbon::create(2019, 1, 1, 7, 0, 0)->timestamp,\n\t\t\t\"end\"\t\t\t=> \tCarbon::create(2019, 1, 1, 8, 30, 0)->timestamp,\n\t\t\t\"longitude\" \t=> \t45.478133,\n\t\t\t\"latitude\"\t \t=> \t9.227356,\n\t\t\t\"description\"\t=> \t\"this is a test event\",\n\t\t\t\"category\" \t\t=> \t\"test\",\n\t\t\t\"repetitive\" \t=> \ttrue,\n\t\t\t\"until\"\t\t\t=> \tCarbon::create(2019, 2, 1, 7, 0, 0)->timestamp,\n\t\t\t\"frequency\"\t\t=> 'day',\n\t\t\t\"flexible\" \t\t=> \tfalse,\n\t\t\t\"travel\" \t\t=> \tfalse,\n\t\t\t\"adjustements\" \t=> \t[]\n\t\t];\n\n\t\t$endpoint = \"api/v1/event\";\n $method = \"POST\";\n \n $response = $this->call($method, $endpoint, $payload ,[],[], [\"HTTP_Accept\" => \"application/json\"], [] );\n \n $content = json_decode($response->getContent());\n\n $this->assertEquals(200, $response->status());\n $this->assertEquals(\"Event creation successful\", $content->message);\n\n $start = $payload[\"start\"];\n $end = $payload[\"end\"];\n $until = $payload[\"until\"];\n $frequency = $payload[\"frequency\"];\n $it = 0;\n\n while ($start <= $until) {\n\n \t$this->assertDatabaseHas(\n\t \t\"events\", \n\t\t [\n\t\t \t\"userId\"\t\t=> $user->id,\n\t\t \t\"id\" \t\t\t=> \t$content->events[$it]->id,\n\t\t \t\"title\" \t\t=> \t$payload[\"title\"],\n\t\t \t\"start\" \t\t=> \t$start,\n\t\t\t\t\t\"end\"\t\t\t=> \t$end,\n\t\t\t\t\t\"longitude\" \t=> \t$payload[\"longitude\"],\n\t\t\t\t\t\"latitude\"\t \t=> \t$payload[\"latitude\"],\n\t\t\t\t\t\"description\"\t=> \t$payload[\"description\"],\n\t\t\t\t\t\"category\" \t\t=> \t$payload[\"category\"],\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$this->assertDatabaseHas(\n\t \t\"repetitiveEvents\", \n\t\t [\n\t\t \t\"eventId\"\t\t=> $content->events[$it]->id,\n\t\t \t\"groupId\" \t\t=> \t$content->events[$it]->repetitive_info->groupId,\n\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$it++;\n\t switch ($frequency) {\n\t case 'day':\n\t $start = Carbon::createFromTimestamp($start)->addDay()->timestamp;\n\t $end = Carbon::createFromTimestamp($end)->addDay()->timestamp;\n\t break;\n\t case 'week':\n\t $start = Carbon::createFromTimestamp($start)->addWeek()->timestamp;\n\t $end = Carbon::createFromTimestamp($end)->addWeek()->timestamp;\n\t break;\n\t case 'month':\n\t $start = Carbon::createFromTimestamp($start)->addMonth()->timestamp;\n\t $end = Carbon::createFromTimestamp($end)->addMonth()->timestamp;\n\t break;\n\t case 'year':\n\t $start = Carbon::createFromTimestamp($start)->addYear()->timestamp;\n\t $end = Carbon::createFromTimestamp($end)->addYear()->timestamp;\n\t break;\n\t default:\n\t break;\n\t }\n }\n\n }",
"public function testResponseIdShouldNotBeGeneratedOnceGiven(): void\n {\n $response = new ResponseSchema(['response_id' => 'unique-id']);\n\n self::assertEquals('unique-id', $response->getResponseId());\n }",
"public function testGeneratedUUID()\n\t{\n\t\t$this->assertContains('PieChart_', $this->chart->uuid());\n\t}",
"public function testGetUniqueIdFalse() {\n\t\t\n\t\t$this->assertFalse($this->ApiBehavior->getUniqueID($this->TestModel));\n\t\t\n\t}",
"public function testUUIDV5UniquenessWithDifferentSeed()\n {\n $oGenerator = oxNew('oxUniversallyUniqueIdGenerator');\n\n $aIds = array();\n for ($i = 0; $i < 100; $i++) {\n $aIds[] = $oGenerator->generateV5('seed' . $i, 'salt');\n }\n\n $this->assertEquals(100, count(array_unique($aIds)));\n }",
"public function testGetInvalidEventByEventId() : void {\n\t\t//grab a profile id that exceeds the maximum allowable profile Id\n\t\t$event = Event::getEventByEventId($this->getPDO(), generateUuidV4());\n\t\t$this->assertNull($event);\n\t}",
"public function testUniqueNoIUnique()\n\t{\n\t\t$event = \"event\";\n\t\t\n\t\t$this->statpro\n\t\t\t->expects($this->never())\n\t\t\t->method(\"hitStat\");\n\t\t\t\n\t\t$this->statpro =\n\t\t\t$this->getMock(\n\t\t\t\"VendorAPI_StatPro_Client\",\n\t\t\tarray(),\n\t\t\tarray(),\n\t\t\t\"\",\n\t\t\tFALSE);\n\t\t\n\t\t$this->driver\n\t\t\t->expects($this->once())\n\t\t\t->method(\"getStatProClient\")\n\t\t\t->will($this->returnValue($this->statpro));\n\n\t\t$params = array(\"event\" => $event, \"unique\" => \"true\");\n\t\t\n\t\t$action = new VendorAPI_CFE_Actions_RecordEvent($params);\n\n\t\t$action->execute($this->context);\n\t}",
"public function testGetInvalidEventByEventId() {\n\t\t//grab a truck id that exceeds the maximum allowable truck id\n\t\t$event = Event::getEventByEventId($this->getPDO(), CrumbTrailTest::INVALID_KEY);\n\t\t$this->assertNull($event);\n\t}",
"public function testUUIDV5UniquenessWithDifferentSalt()\n {\n $oGenerator = oxNew('oxUniversallyUniqueIdGenerator');\n\n $aIds = array();\n for ($i = 0; $i < 100; $i++) {\n $aIds[] = $oGenerator->generateV5('seed', 'salt' . $i);\n }\n\n $this->assertEquals(100, count(array_unique($aIds)));\n }",
"public function testGetInvalidEventByEventProfileId(): void {\n\t\t//grab a profile id that exceeds the maximum allowable profile Id\n\t\t$event = Event::getEventByEventProfileId($this->getPDO(), generateUuidV4());\n\t\t$this->assertCount(0, $event);\n\t}",
"protected function generate_event_id() {\n\n\t\ttry {\n\t\t\t$data = random_bytes( 16 );\n\n\t\t\t$data[6] = chr( ord( $data[6] ) & 0x0f | 0x40 ); // set version to 0100\n\t\t\t$data[8] = chr( ord( $data[8] ) & 0x3f | 0x80 ); // set bits 6-7 to 10\n\n\t\t\treturn vsprintf( '%s%s-%s-%s-%s-%s%s%s', str_split( bin2hex( $data ), 4 ) );\n\n\t\t} catch ( \\Exception $e ) {\n\n\t\t\t// fall back to mt_rand if random_bytes is unavailable\n\t\t\treturn sprintf(\n\t\t\t\t'%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\t\t\t// 32 bits for \"time_low\"\n\t\t\t\tmt_rand( 0, 0xffff ),\n\t\t\t\tmt_rand( 0, 0xffff ),\n\t\t\t\t// 16 bits for \"time_mid\"\n\t\t\t\tmt_rand( 0, 0xffff ),\n\t\t\t\t// 16 bits for \"time_hi_and_version\",\n\t\t\t\t// four most significant bits holds version number 4\n\t\t\t\tmt_rand( 0, 0x0fff ) | 0x4000,\n\t\t\t\t// 16 bits, 8 bits for \"clk_seq_hi_res\",\n\t\t\t\t// 8 bits for \"clk_seq_low\",\n\t\t\t\t// two most significant bits holds zero and one for variant DCE1.1\n\t\t\t\tmt_rand( 0, 0x3fff ) | 0x8000,\n\t\t\t\t// 48 bits for \"node\"\n\t\t\t\tmt_rand( 0, 0xffff ),\n\t\t\t\tmt_rand( 0, 0xffff ),\n\t\t\t\tmt_rand( 0, 0xffff )\n\t\t\t);\n\t\t}\n\t}",
"public function testUniqueNonceSameTime() {\n $time = time();\n $values = array();\n foreach (range(1,100) as $i) {\n $val = $this->oauth->generateNonce($time);\n $this->assertFalse(in_array($val, $values), 'Generated nonce should be unique,'.\n ' even with identical timestamp');\n $values[] = $val;\n }\n }",
"public function testGenerateId()\n {\n foreach ($this->servers as $server) {\n $a = new Horde_Kolab_Server_Object_Inetorgperson($server, null, $this->objects[0]);\n $this->assertContains('Frank Mustermann',\n $a->get(Horde_Kolab_Server_Object_Person::ATTRIBUTE_UID));\n }\n }",
"public function testGenerateId()\n {\n foreach ($this->servers as $server) {\n $person = $this->assertAdd($server, $this->objects[0],\n array(Horde_Kolab_Server_Object_Kolabinetorgperson::ATTRIBUTE_SID => ''));\n $account_data = $this->objects[1];\n $account_data[Horde_Kolab_Server_Object_Kolabgermanbankarrangement::ATTRIBUTE_OWNERUID] = $person->getUid();\n $a = new Horde_Kolab_Server_Object_Kolabgermanbankarrangement($server, null, $account_data);\n $this->assertContains(Horde_Kolab_Server_Object_Kolabgermanbankarrangement::ATTRIBUTE_NUMBER . '=' . $this->objects[1][Horde_Kolab_Server_Object_Kolabgermanbankarrangement::ATTRIBUTE_NUMBER],\n $a->get(Horde_Kolab_Server_Object_Kolabgermanbankarrangement::ATTRIBUTE_UID));\n }\n }",
"public function testCanGenerateId()\n {\n $this->assertEquals(1, $this->repository->generateId()->toInt());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Public Methods ========================================================================= Returns the cached file system path for a given resource, if we have it. | public function getCachedResourcePath($path)
{
$realPath = craft()->cache->get('resourcePath:'.$path);
if ($realPath && IOHelper::fileExists($realPath))
{
return $realPath;
}
} | [
"protected function getResource($resource)\n\t{\n\t\tif (isset($this->resourceCache[$resource])) {\n\t\t\treturn $this->resourceCache[$resource];\n\t\t}\n\n\t\tforeach ($this->searchPaths as $path) {\n\t\t\t$fullPath = $path.DIRECTORY_SEPARATOR.$resource;\n\n\t\t\tif (is_file($fullPath)) {\n\t\t\t\t// Cache:\n\t\t\t\t$this->resourceCache[$resource] = $fullPath;\n\n\t\t\t\treturn $fullPath;\n\t\t\t}\n\t\t}\n\n\t\tthrow new RuntimeException( \n\t\t\t\t\"Could not find resource '{$resource}' in any resource paths.\". \n\t\t\t\t\"(searched: \".join(\", \", $this->searchPaths).\")\");\n\t}",
"public function getCachedPath()\n {\n return $this->cachedPath;\n }",
"function realpath_cache_get(){}",
"function realpath_cache_get () {}",
"public function cache_path() {\r\n e_developer::assert($this->cache_dir,\"Cache directory is blank\");\r\n\r\n return $this->cache_dir.'/'.sha1($this->url);;\r\n }",
"private static function getPath() {\n\t\t$path = Reg::get('Cache.path');\n\t\t\n\t\tif (empty($path)) {\n\t\t\t$path = Reg::get('Path.physical') . '/cache';\n\t\t}\n\t\t\n\t\treturn $path;\n\t}",
"public function get_cached_path() {\n // Set either the source or cache file as our datasource\n if ($this->serve_default)\n {\n $file_data = $this->source_file;\n }\n else\n {\n $file_data = $this->cached_file;\n }\n\n // Output the file\n return $file_data;\n }",
"public function getCacheFileLocation()\n {\n return sprintf('%s/resources.cached.php', $this->cacheDir);\n }",
"public function getCachedServicesPath();",
"function realpath_cache_get()\n{\n}",
"protected function getCachePath()\n\t{\n\t\treturn \"{$this->getRoot()}{$this->global->path->cache}\";\n\t}",
"private static function getCachePath()\n {\n return defined('CACHE_PATH') ? CACHE_PATH : sys_get_temp_dir() . '/';\n }",
"public function getCachePath()\n\t{\t\n\t\tjimport('syw.cache');\n\t\t\n\t\tif (SYWCache::isFolderReady(JPATH_CACHE, $this->extension)) {\n\t\t\treturn JPATH_CACHE.'/'.$this->extension;\n\t\t}\n\t\n\t\treturn JPATH_CACHE;\n\t}",
"protected function getFilePathForResource($resource){\n\t\tif( is_file($resource) ){\n\t\t\t$this->logDebug('file resource detected');\n\t\t\t$filePath = $resource;\n\t\t}elseif( is_dir($resource) ){\n\t\t\t$this->logDebug('dir resource detected');\n\t\t\t$tmpTarFile = $this->getTmpFilePath('.tar.bz2');\n\t\t\t$command = 'tar -cjf '.$tmpTarFile.' -C '.realpath($resource).' .'; // change to dir and backup content of dir not the upper path backup /etc/apache/ -> will back conf,sites-enabled ... not /etc/apache/conf\n\t\t\t$this->logDebug('dir as tar with bzip: '.$command);\n\t\t\texec($command, $output, $status);\n\t\t\tif( $status!=0 ){\n\t\t\t\tthrow new RuntimeException('tar dir failed: '.$command.' with: '.print_r($output, true), 500);\n\t\t\t}\n\t\t\ttouch($tmpTarFile, filemtime(rtrim($resource, '/').'/.')); // get the dir mod-date and set it to created tar\n\t\t\t$this->logDebug('set modification time of tar to '.date('Y-m-d H:i:s', filemtime($tmpTarFile)));\n\t\t\t$filePath = $tmpTarFile;\n\t\t}elseif( $resource=='STDIN' ){\n\t\t\t$filePath = $this->getTmpFilePath();\n\t\t\twhile( !feof(STDIN) ){\n\t\t\t\t$data = fread(STDIN, 1000000);\n\t\t\t\tfile_put_contents($filePath, $data, FILE_APPEND);\n\t\t\t}\n\t\t\tif( filesize($filePath)==0 ){\n\t\t\t\tthrow new RuntimeException('STDIN was empty, i stop here');\n\t\t\t}\n\t\t}elseif( preg_match('~^mysql://~', $resource) ){\n\t\t\tthrow new RuntimeException('resource type mysql not implemented');\n\t\t}elseif( preg_match('~^redis://~', $resource) ){ // redis://pass@123.234.23.23:3343/mykeys_* <- dump as msgpack (ttls?)\n\t\t\tthrow new RuntimeException('resource type mysql not implemented');\n\t\t}else{\n\t\t\tthrow new RuntimeException('resource not found or unsupported type');\n\t\t}\n\t\treturn $filePath;\n\t}",
"public function getContentCachingDataPath()\n {\n if (array_key_exists(\"contentCachingDataPath\", $this->_propDict)) {\n return $this->_propDict[\"contentCachingDataPath\"];\n } else {\n return null;\n }\n }",
"private static function cache_path() {\n\t\t$path = dirname(__DIR__) . '/cache/';\n\n\t\tif ( ! file_exists($path) ) {\n\t\t\tmkdir($path);\n\t\t}\n\n\t\treturn $path;\n\t}",
"protected function getFileCachePath()\n {\n return $this->container->getParameter('kernel.cache_dir').'/madefcms/'.md5($this->pageIdentifier.$this->version->getIdentifier()).'.'.$this->type;\n }",
"public function getCachedFile() {\n\t\treturn file_get_contents(PATH_CACHE . $this->_cacheLocation);\n\t}",
"public static function cachePath() {\n\t\t$config = Libraries::get('app');\n\t\treturn $config['resources'] . Twig::CACHE_PATH;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.