query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
sequencelengths 0
30
| negative_scores
sequencelengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
Detach permissions from the user. | public function detachPermissions($permissions); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function detachPermissions($permissions = []);",
"public function detachPermission($permission);",
"public function detachPerm($perm);",
"public function detachPermissions(int $roleId, array $permissions): void;",
"public function revoke($permissions): void\n {\n $this->permissions()->detach($permissions);\n }",
"public function detach(User $currentUser, Permission $permission)\n {\n return false;\n }",
"public function testDetachPermission()\n {\n $permissionObject = m::mock('Permission');\n $permissionArray = ['id' => 2];\n\n $user = m::mock('HasRoleUser')->makePartial();\n\n /*\n |------------------------------------------------------------\n | Expectation\n |------------------------------------------------------------\n */\n $permissionObject->shouldReceive('getKey')\n ->andReturn(1);\n\n $user->shouldReceive('permissions')\n ->andReturn($user);\n $user->shouldReceive('detach')\n ->with(1)\n ->once()->ordered();\n $user->shouldReceive('detach')\n ->with(2)\n ->once()->ordered();\n $user->shouldReceive('detach')\n ->with(3)\n ->once()->ordered();\n\n Cache::shouldReceive('forget')\n ->times(6);\n\n /*\n |------------------------------------------------------------\n | Assertion\n |------------------------------------------------------------\n */\n $result = $user->detachPermission($permissionObject);\n $this->assertInstanceOf('HasRoleUser', $result);\n $result = $user->detachPermission($permissionArray);\n $this->assertInstanceOf('HasRoleUser', $result);\n $result = $user->detachPermission(3);\n $this->assertInstanceOf('HasRoleUser', $result);\n }",
"public function detachPermissions($permissions)\n {\n foreach ($permissions as $permission) {\n $this->detachPermission($permission);\n }\n }",
"public function revokeAllPrivileges()\n {\n\n }",
"public function detachUser(Request $request) {\n $validator = Validator::make($request->all(), [\n 'user_id' => 'required|numeric|exists:users,id',\n 'role_id' => 'required|numeric|exists:roles,id'\n ]);\n if ($validator->fails()) {\n return response()->json(['response'=>'error', 'message'=>$validator->errors()->first()], 400); \n }\n $role = Role::find($request->role_id);\n $user = User::find($request->user_id);\n\n $user->roles()->detach($role->id);\n $notif = new Notification;\n $notif->text = __('notification.role_unassign', ['role'=> Role::find($request->role_id)->name]);\n $user->notifications()->save($notif);\n return response()->json(null,204); \n }",
"public function testDetachAllPermissions()\n {\n $permissionA = $this->mockRole('PermissionA');\n $permissionB = $this->mockRole('PermissionB');\n\n $user = m::mock('HasRoleUser')->makePartial();\n $user->permissions = [$permissionA, $permissionB];\n\n $relationship = m::mock('BelongsToMany');\n\n /*\n |------------------------------------------------------------\n | Expectation\n |------------------------------------------------------------\n */\n Config::shouldReceive('get')->with('laratrust.permission')->once()->andReturn('App\\Permission');\n Config::shouldReceive('get')->with('laratrust.permission_user_table')->once()->andReturn('permission_user');\n Config::shouldReceive('get')->with('laratrust.user_foreign_key')->once()->andReturn('user_id');\n Config::shouldReceive('get')->with('laratrust.permission_foreign_key')->once()->andReturn('permission_id');\n\n $relationship->shouldReceive('get')\n ->andReturn($user->permissions)->once();\n\n $user->shouldReceive('belongsToMany')\n ->andReturn($relationship)->once();\n\n $user->shouldReceive('detachPermission')->twice();\n\n /*\n |------------------------------------------------------------\n | Assertion\n |------------------------------------------------------------\n */\n $user->detachPermissions();\n }",
"public function detachPermissions($permissions = null)\n {\n if (!$permissions) $permissions = $this->permissions()->get();\n foreach ($permissions as $permission) {\n $this->detachPermission($permission);\n }\n }",
"protected static function bootHasPermissions()\n {\n static::deleting(function ($model) {\n $model->roles()->detach();\n $model->permissions()->detach();\n });\n }",
"public function disablePermissions()\n {\n $this->permissions = false;\n }",
"public function uninstall(){\n Page::dropTable();\n\n $permissions = Permission::getPluginPermissions($this->_plugin);\n foreach($permissions as $permission){\n $permission->delete();\n }\n }",
"public function permissions_reset() {\n\t\t$this->PermissionsExtras->permissions_reset($this->params);\n\t}",
"public function removeUserAdminPermissions(Request $request)\n {\n\t\t$id = $request['id'];\n \t$user = User::find($id);\n\n \tif( $user->id == \\Auth::user()->id )\n \t{\n \t\treturn back()->with(['flash_error' => 'You cant update your own admin access silly']);\n \t}\n\n \t$user->is_admin = False;\n \t$user->save();\n\n \treturn back()->with(['flash_success' => 'You have successfully Removed this users admin access']);\n }",
"public function detachPerm($perm)\n {\n $this->perms()->detach($perm);\n }",
"public function detachPermissions($permissions = null)\r\n {\r\n // null for detach all\r\n if (!$permissions) $permissions = $this->perms()->get();\r\n if (is_array($permissions)) {\r\n foreach ($permissions as $perm) {\r\n $this->detachPermission($perm);\r\n }\r\n } else {\r\n throw new \\Exception('permissions must be an array');\r\n }\r\n }",
"public function testDetachPermissions()\n {\n $user = m::mock('HasRoleUser')->makePartial();\n\n /*\n |------------------------------------------------------------\n | Expectation\n |------------------------------------------------------------\n */\n $user->shouldReceive('detachPermission')\n ->with(1)\n ->once()->ordered();\n $user->shouldReceive('detachPermission')\n ->with(2)\n ->once()->ordered();\n $user->shouldReceive('detachPermission')\n ->with(3)\n ->once()->ordered();\n\n /*\n |------------------------------------------------------------\n | Assertion\n |------------------------------------------------------------\n */\n $result = $user->detachPermissions([1, 2, 3]);\n $this->assertInstanceOf('HasRoleUser', $result);\n }",
"function deauthorize()\n {\n\t\t# delete remember me cookie if set\n\t\t$this->delete_auth_cookie();\n\n $this->sd->wipe_group('_auth');\n }",
"public function revoke_access() {\n // Nothing to do!\n }",
"public function revokeAllPermissions()\n {\n $this->permissions()->detach();\n\n return $this;\n }",
"public function revokeAllPermissions()\n {\n $this->permissions()->detach();\n\n return $this;\n }",
"public function revokeUserPermission($perm) {\n\t\treturn $this->FacebookApi->revokeUserPermission($perm);\n\t}",
"public function DelUserProfile()\n {\n $cmd = \"sudo \" . Configuration::PROJECT_ROOT . Configuration::BASH_KILLPROCESSES . \" \" . $this->strUsername;\n echo \"Running Command : \" . $cmd;\n $res = passthru($cmd);\n // Delete User\n $cmd = 'sudo deluser ' . $this->strUsername;\n echo \"Running Command : \" . $cmd;\n $res = passthru($cmd);\n // Remove Profile Directory\n $cmd = 'sudo rm -rf ' . $this->GetProfilePath();\n echo \"Running Command : \" . $cmd;\n $res = passthru($cmd);\n }",
"public function destroy(UserPermission $userPermission)\n {\n //\n }",
"public function delete()\n {\n $this->user->delete();\n }",
"abstract protected function removePermission(Permission $permission);",
"public function detachPermission($permission)\r\n {\r\n if (is_object($permission)) {\r\n $permission = $permission->getKey();\r\n } elseif (is_array($permission)) {\r\n throw new \\Exception('permission given as array,you should use detachPermissions');\r\n }\r\n $this->perms()->detach($permission);\r\n }"
] | [
"0.73977333",
"0.69117177",
"0.6625875",
"0.64025116",
"0.6292932",
"0.6230385",
"0.62243223",
"0.6129048",
"0.60054016",
"0.5989834",
"0.5989251",
"0.5988335",
"0.5976354",
"0.59492284",
"0.59396726",
"0.5897322",
"0.58946085",
"0.5885009",
"0.58681256",
"0.58484536",
"0.5838709",
"0.57967246",
"0.5747479",
"0.5747479",
"0.5720481",
"0.5718031",
"0.57132715",
"0.5676985",
"0.5671951",
"0.56664824"
] | 0.7212911 | 1 |
Determine if the permission has a role. | public function hasRole($role): bool; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasRole()\n {\n $data = $this->roles->first();\n\n if ($data === NULL) return false;\n\n return true;\n }",
"public function hasRole(string $role) : bool;",
"public function hasRole($role);",
"public function hasRole($role);",
"public function hasRole($role);",
"public function hasRole($role);",
"public function hasRole($role);",
"public function isGranted(string $role) : bool;",
"function isRole($role);",
"public function can($role)\n\t{\t\n\t\treturn in_array($role, $this->getRoles());\n\t}",
"public function hasPermission(int $roleId, $permission): bool;",
"public function isGranted($role = null) {\n\n if (!empty($this->userdata)) {\n if ($role != null) {\n if(!(is_null($this->userdata['roles'])))\n {\n return in_array($role, $this->userdata['roles']);\n }else{\n return false;\n }\n }\n return TRUE;\n } else {\n return FALSE;\n }\n }",
"public function hasRole($role){\n if($this->roles()->where('name', $role)->first()){\n return true;\n }\n else\n return false;\n }",
"public function hasRol($role);",
"public function hasRole($roleName);",
"public function hasRole($roleName);",
"private function hasRole()\n {\n return (Auth::user()->roles()->count() > 0) ? true : false;\n }",
"public function hasRole($name);",
"public function hasRole($role)\n {\n return null !== $this->roles()->where('name', $role)->first();\n }",
"public function hasRole($role) {\n return empty($role);\n }",
"public function roleExists()\n {\n if(!$this->roles()->count()) {\n return false;\n }\n\n return true;\n }",
"public function is(string $role): bool;",
"public function hasRole(string $roleName) : bool;",
"public function isGranted($role){\n\t\treturn $this->_user->hasRole($role);\n\t}",
"public function hasRole($role)\n {\n return in_array($role, $this->roles);\n }",
"public function hasRole($role)\n {\n return in_array($role, $this->roles);\n }",
"function isAuthorized(){\n if($this->Auth->user('role_id') == '1'){\n return true; \n } \n \n // roles\n $roles = array(\n 1 => 'admin',\n 2 => 'group_manager', \n 3 => 'project_manager',\n 4 => 'electrician',\n 5 => 'rundering'\n );\n\n // default permissions - everyone has access to view, index and add\n $permissions_default = array(\n 'view' => '*',\n 'index' => '*'\n ); \n\n // override default permissions\n $permissions = array_merge($permissions_default, $this->permissions); \n\n // get current role_alias eg. agent\n $role_alias = $roles[$this->Auth->user('role_id')];\n\n debug($role_alias);\n\n // convert string to array \n if(isset($permissions[$this->action])){\n $current_permission = $permissions[$this->action];\n $allowedRoles = is_string($current_permission) ? array($current_permission) : $current_permission;\n }else{\n $allowedRoles = array();\n }\n \n // give access, if role_alias has permissions to the current action. eg. agent (role_alias) can delete (action) users \n if( in_array($role_alias, $allowedRoles) || in_array('*', $allowedRoles) ){\n return true; \n } \n \n // access denied\n return false;\n }",
"public function has_role()\n {\n return $this->status;\n }",
"public function hasPermission($roleId, $permissionId);",
"public function isInRole($role);"
] | [
"0.7919343",
"0.77139384",
"0.75839597",
"0.75839597",
"0.75839597",
"0.75839597",
"0.75839597",
"0.75277716",
"0.7421961",
"0.73590577",
"0.73442787",
"0.73422116",
"0.7292122",
"0.72833294",
"0.72741437",
"0.72741437",
"0.72173643",
"0.7200029",
"0.7199279",
"0.71807986",
"0.7163578",
"0.71116656",
"0.7097744",
"0.709708",
"0.70803326",
"0.70803326",
"0.7031252",
"0.70197034",
"0.7004726",
"0.69918"
] | 0.7756369 | 1 |
ALTER TABLE `cat_square` ADD COLUMN `count_objects` INT NOT NULL DEFAULT 0 AFTER `name`; | private function _geo_count_objects() {
// ALTER TABLE `cat_district` ADD INDEX `count_objects` (`count_objects` ASC);
$tables = ['geo_area', 'populated_locality', 'district', 'square', 'metro_station', 'direction'];
foreach ($tables as $it){
$this->db->query("ALTER TABLE `" . $this->db->dbprefix . $it . "` ADD COLUMN `count_objects` INT NOT NULL DEFAULT 0 AFTER `name`;");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix . $it . "` ADD INDEX `count_objects` (`count_objects` ASC);");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function safeUp()\n\t{\n $this->addColumn('products','images_count','int NOT NULL DEFAULT 0');\n\t}",
"public function\n\tUp() {\n\n\t\t$this->Execute(\"\n\t\tALTER TABLE `BlogPosts`\n\t\tADD COLUMN `CountImages` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' AFTER `CountComments`,\n\t\tADD COLUMN `TimeToRead` SMALLINT UNSIGNED NOT NULL DEFAULT 0 AFTER `CountImages`;\n\t\t\");\n\n\t\treturn;\n\t}",
"public function safeUp()\n\t{\n $this->addColumn('robot', 'sort', 'integer DEFAULT 0');\n\t}",
"public function up()\n {\n\n $this->addColumn('users_characters', 'gold', $this->bigInteger());\n }",
"public function change()\n {\n $t = $this->table(\"matches\");\n $t->addColumn(\"catches\", \"integer\", [\"default\" => 0])\n ->addColumn(\"dropped_catches\", \"integer\", [\"default\" => 0])\n ->addColumn(\"run_outs\", \"integer\", [\"default\" => 0])\n ->addColumn(\"stumpings\", \"integer\", [\"default\" => 0])->save();\n }",
"public function addCount($conn, Jobs $obj)\n {\n }",
"public function up()\n\t{\n\t\t$this->addColumn('job_types', 'runtime_per_day', 'INT UNSIGNED NOT NULL');\n\t}",
"public function up()\r\n {\r\n $this->execute(\"ALTER TABLE title CHANGE COLUMN asking_price asking_price VARCHAR(255);\");\r\n }",
"public function safeUp()\n {\n $this->getDbConnection()->createCommand(\"\nALTER TABLE `compare_estimated_price_table` \n ADD `bathrooms_weighted` INT(11) DEFAULT '5' AFTER `house_weighted`,\n ADD `bedrooms_weighted` INT(11) DEFAULT '2' AFTER `bathrooms_weighted`,\n ADD `garages_weighted` INT(11) DEFAULT '3' AFTER `bedrooms_weighted`,\n ADD `pool_weighted` INT(11) DEFAULT '5' AFTER `garages_weighted`,\n DROP `amenties_weighted`\n \")->execute();\n }",
"public function safeUp() {\n $this->execute(\"CREATE TABLE `like` (\n `target_id` int(10) unsigned NOT NULL,\n `target_type` int(10) unsigned NOT NULL,\n `created_by` int(10) unsigned NOT NULL,\n `time_created` int(10) unsigned NOT NULL,\n `is_active` tinyint(3) unsigned NOT NULL DEFAULT '0',\n UNIQUE KEY `uni` (`target_id`,`target_type`,`created_by`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8\");\n\n $this->execute(\"ALTER TABLE `media` ADD `likes_count` INT(10) unsigned NOT NULL DEFAULT 0\");\n }",
"function addOne($catURL){\n $query = $GLOBALS['db']->prepare(\"UPDATE categories SET category_COUNT = category_COUNT+1 WHERE category_URL = '{$catURL}'\");\n $update = $query->execute(array());\n $update=null;\n}",
"public function change()\n {\n $this->execute('CREATE TABLE IF NOT EXISTS `product_categories_import` (\n `product_id` int(50) NOT NULL,\n `product_sku` varchar(150) NOT NULL,\n `category_id` int(50) NOT NULL,\n `category_name` varchar(150) NOT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\n');\n }",
"function countAll($table_name)\n {\n }",
"public function up(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE coub_banned_count (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, coub_id INT NOT NULL, channel_id INT NOT NULL, banned INT DEFAULT NULL, date_create DATETIME DEFAULT NULL, date_update DATETIME DEFAULT NULL, INDEX IDX_7FC4C0837E3C61F9 (owner_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE coub_dislikes_count (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, coub_id INT NOT NULL, channel_id INT NOT NULL, dislikes_count INT DEFAULT NULL, date_create DATETIME DEFAULT NULL, date_update DATETIME DEFAULT NULL, INDEX IDX_EAEDCEFE7E3C61F9 (owner_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE coub_featured_count (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, coub_id INT NOT NULL, channel_id INT NOT NULL, featured INT DEFAULT NULL, date_create DATETIME DEFAULT NULL, date_update DATETIME DEFAULT NULL, INDEX IDX_FAA7D2497E3C61F9 (owner_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE coub_kd_count (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, coub_id INT NOT NULL, channel_id INT NOT NULL, is_kd INT DEFAULT NULL, date_create DATETIME DEFAULT NULL, date_update DATETIME DEFAULT NULL, INDEX IDX_5D5C7A767E3C61F9 (owner_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE coub_like_count (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, coub_id INT NOT NULL, channel_id INT NOT NULL, like_count INT DEFAULT NULL, date_create DATETIME DEFAULT NULL, date_update DATETIME DEFAULT NULL, INDEX IDX_71A06B37E3C61F9 (owner_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE coub_remixes_count (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, coub_id INT NOT NULL, channel_id INT NOT NULL, remixes_count INT DEFAULT NULL, date_create DATETIME DEFAULT NULL, date_update DATETIME DEFAULT NULL, INDEX IDX_8D1171197E3C61F9 (owner_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE coub_repost_count (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, coub_id INT NOT NULL, channel_id INT NOT NULL, repost_count INT DEFAULT NULL, date_create DATETIME DEFAULT NULL, date_update DATETIME DEFAULT NULL, INDEX IDX_30135F877E3C61F9 (owner_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('CREATE TABLE coub_views_count (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, coub_id INT NOT NULL, channel_id INT NOT NULL, views_count INT DEFAULT NULL, date_create DATETIME DEFAULT NULL, date_update DATETIME DEFAULT NULL, INDEX IDX_4CAFAB9D7E3C61F9 (owner_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');\n $this->addSql('ALTER TABLE coub_banned_count ADD CONSTRAINT FK_7FC4C0837E3C61F9 FOREIGN KEY (owner_id) REFERENCES channel (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE coub_dislikes_count ADD CONSTRAINT FK_EAEDCEFE7E3C61F9 FOREIGN KEY (owner_id) REFERENCES channel (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE coub_featured_count ADD CONSTRAINT FK_FAA7D2497E3C61F9 FOREIGN KEY (owner_id) REFERENCES channel (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE coub_kd_count ADD CONSTRAINT FK_5D5C7A767E3C61F9 FOREIGN KEY (owner_id) REFERENCES channel (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE coub_like_count ADD CONSTRAINT FK_71A06B37E3C61F9 FOREIGN KEY (owner_id) REFERENCES channel (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE coub_remixes_count ADD CONSTRAINT FK_8D1171197E3C61F9 FOREIGN KEY (owner_id) REFERENCES channel (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE coub_repost_count ADD CONSTRAINT FK_30135F877E3C61F9 FOREIGN KEY (owner_id) REFERENCES channel (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE coub_views_count ADD CONSTRAINT FK_4CAFAB9D7E3C61F9 FOREIGN KEY (owner_id) REFERENCES channel (id) ON DELETE CASCADE');\n }",
"function image_poll_install_table(){\r\n//create wordpress table\r\n\r\n\tglobal $wpdb;\r\n\r\n\t$table_name = $wpdb->prefix . \"image_poll\";\r\n\tif ($wpdb->get_var(\"show tables like '$table_name'\") != $table_name ) {\r\n\t$sql = \"CREATE TABLE \" . $table_name . \" (\r\n\t id mediumint(9) NOT NULL AUTO_INCREMENT,\r\n\t\t title text NOT NULL,\r\n\t\t img1 VARCHAR(255) NOT NULL,\r\n\t\t imgdesc1 text NOT NULL,\r\n\t\t img2 VARCHAR(255) NOT NULL,\r\n\t\t imgdesc2 text NOT NULL,\r\n\t\t img1count mediumint(9) default '0' NOT NULL,\r\n\t\t img2count mediumint(9) default '0' NOT NULL,\r\n\t\t UNIQUE KEY id (id)\r\n\t);\";\r\n\t\r\n\trequire_once(ABSPATH . 'wp-admin/upgrade-functions.php');\r\n //echo \"ran sql\";\r\n\tdbDelta($sql);\r\n\t}\r\n}",
"public function newColumn($name='')\n {\n $this->colums[] = new Column($obj);\n\n }",
"private function migrate()\n {\n $this->db->query('CREATE TABLE IF NOT EXISTS scores (nick TEXT, scored_at TEXT)');\n }",
"public function up(): void\n {\n $objects = $this->table(\"objects\");\n $objects->addColumn(\"users_id\", \"integer\", [\"comment\" => \"Идентификатор владельца объекта\"])\n ->addColumn(\"name\", \"text\", [\"comment\" => \"Название объекта\"])\n ->addColumn(\"coordinates\", \"text\", [\"comment\" => \"Координаты объекта\"])\n ->addColumn(\"address\", \"text\", [\"comment\" => \"Адрес объекта\"])\n ->addColumn(\"points\", \"text\", [\"comment\" => \"Набор точек, определяющий контур объекта\"])\n ->addIndex([\"coordinates\"], [\"unique\" => true])\n ->addIndex([\"address\"])\n ->save();\n\n $objects->changeComment(\"Таблица объектов\")->update();\n }",
"public function safeUp()\n\t{\n\t\t$sql=\"ALTER TABLE `points` ADD COLUMN `old_id` int(10) NOT NULL DEFAULT 0 COMMENT '' AFTER `status`;\";\n\t\t$this->execute($sql);\n\t\t$this->refreshTableSchema('points');\n\t}",
"public function up()\n {\n $this->addColumn('log_ott_activity', 'scheme', 'char(20) not null default \"\"');\n }",
"private function _addColumnIfNotExist($table_name, $col_name) {\n $result = $this->db->query(\"SHOW COLUMNS FROM \".DB_PREFIX.$table_name.\n \" LIKE '\".$col_name.\"'\");\n if($result->num_rows==0) {\n $this->db->query(\"ALTER TABLE \".DB_PREFIX.$table_name.\" ADD \"\n . \"\".$col_name.\" DECIMAL(30,20) DEFAULT NULL\");\n } \n }",
"protected function _updateChildCount()\n {\n if (!in_array($this->getBehavior(), array(\n Mage_ImportExport_Model_Import::BEHAVIOR_REPLACE,\n Mage_ImportExport_Model_Import::BEHAVIOR_APPEND))) {\n return;\n }\n\n $categoryTable = Mage::getSingleton('core/resource')->getTableName('catalog/category');\n $categoryTableTmp = $categoryTable . '_tmp';\n $this->_connection->query(\"CREATE TEMPORARY TABLE IF NOT EXISTS {$categoryTableTmp} LIKE {$categoryTable};\n INSERT INTO {$categoryTableTmp} SELECT * FROM {$categoryTable};\n UPDATE {$categoryTable} cce\n SET children_count = (\n SELECT count(cce2.entity_id) - 1 as children_county\n FROM {$categoryTableTmp} cce2\n WHERE PATH LIKE CONCAT(cce.path,'%')\n );\n \");\n }",
"function update_posts_count( $deprecated = '' ) {\n\tglobal $wpdb;\n\tupdate_option( 'post_count', (int) $wpdb->get_var( \"SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_status = 'publish' and post_type = 'post'\" ) );\n}",
"public function up()\n {\n $users = $this->table('categories');\n $users->addColumn('material_id', 'integer', ['limit' => 3])\n ->addColumn('ih_correspond_id', 'integer')\n ->addColumn('name', 'string', ['limit' => 50])\n ->addColumn('description', 'text')\n ->addColumn('file_name1', 'text')\n ->addColumn('file_name2', 'text')\n ->addColumn('file_name3', 'text')\n ->addColumn('file_name4', 'text')\n ->addColumn('file_name5', 'text')\n ->addColumn('created_at', 'datetime')\n ->addColumn('updated_at', 'datetime', ['null' => true])\n ->save();\n }",
"public function up()\n\t{\n\t\t$this->execute(\"\n ALTER TABLE `vvoy_voyage` \n ADD COLUMN `vvoy_fuel_tank_start` SMALLINT UNSIGNED NULL COMMENT 'fuel in tank at start voyage' AFTER `vvoy_notes`,\n ADD COLUMN `vvoy_fuel_tank_end` SMALLINT UNSIGNED NULL COMMENT 'fuel in tank at end voyage' AFTER `vvoy_fuel_tank_start`,\n ADD COLUMN `vvoy_fuel_tank_start_amt` DECIMAL(10,2) NULL AFTER `vvoy_fuel_tank_end`,\n ADD COLUMN `vvoy_fuel_tank_end_amt` DECIMAL(10,2) NULL AFTER `vvoy_fuel_tank_start_amt`, \n ADD COLUMN `vvoy_odo_start` INT NULL AFTER `vvoy_fuel_tank_end_amt`,\n ADD COLUMN `vvoy_odo_end` INT NULL AFTER `vvoy_odo_start`,\n ADD COLUMN `vvoy_fuel` SMALLINT UNSIGNED NULL AFTER `vvoy_fuel_tank_end_amt`,\n ADD COLUMN `vvoy_fuel_amt` DECIMAL(10,2) NULL AFTER `vvoy_fuel`, \n ADD COLUMN `vvoy_abs_odo_start` INT NULL AFTER `vvoy_fuel_amt`,\n ADD COLUMN `vvoy_abs_odo_end` INT NULL AFTER `vvoy_abs_odo_start`,\n ADD COLUMN `vvoy_mileage` SMALLINT NULL AFTER `vvoy_abs_odo_end`;\n \");\n\t}",
"function create_a_wdl_category_table () {\r\n\r\ninclude ('tablename.php');\r\n \r\n $sql = \"CREATE TABLE $table_name4 (\r\n id mediumint(9) NOT NULL AUTO_INCREMENT,\r\n cat_number mediumint(9) NOT NULL,\r\n cat_name VARCHAR(20) NOT NULL,\r\n\r\n \r\n UNIQUE KEY id (id)\r\n );\";\r\n\t\r\n\t require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r\n dbDelta( $sql );\r\n}",
"function thirty8_object_listings_count( $query ) {\n if ( (!is_admin()) && (is_post_type_archive( 'object' )) ) {\n $query->set( 'posts_per_page', 48 );\n return;\n }\n}",
"public function up()\n\t{\n $this->alterColumn('{{user_role}}','ur_switch','VARCHAR( 54 ) NULL DEFAULT \\'1\\'');\n\t}",
"public function safeUp()\n\t{\n\t\t$this->addColumn('tutorial_categories', 'level', 'smallint');\n\t}",
"public function change()\n {\n $table = $this->table('url');\n $table->addColumn('hits', 'integer', ['default' => 0])\n ->addColumn('url', 'string')\n ->addColumn('shortUrl', 'string')\n ->addColumn('user', 'integer')\n ->addIndex(['user'])\n ->addForeignKey('user', 'user', 'id', ['constraint' => 'url_user_foreign_key'])\n ->create();\n }"
] | [
"0.5735866",
"0.55280465",
"0.5352054",
"0.5299273",
"0.52856505",
"0.52839786",
"0.52514327",
"0.52371466",
"0.52094364",
"0.51424354",
"0.51057184",
"0.5105404",
"0.50794184",
"0.50779283",
"0.50777924",
"0.5041532",
"0.5034371",
"0.50219256",
"0.4966084",
"0.49382257",
"0.49200708",
"0.49193996",
"0.48978215",
"0.48566782",
"0.48495772",
"0.4835591",
"0.48293167",
"0.48226005",
"0.48209405",
"0.48137137"
] | 0.6636975 | 0 |
Convert a value to a string and add an additional pair of quotes around it, but only if it was a string to being with. It defaults to adding single quotes but can be configured to add double quotes. | public static function quote_if_string($val, $options = ["style" => "single"]) {
if (is_string($val)) {
if ($options["style"] == "single") {
return "'$val'";
} else {
return '"' . $val . '"';
}
} else {
return "$val";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function quote($value): string {\n return $value;\n }",
"function prepare_string_value($value) {\n\t\t$new_value = (!get_magic_quotes_gpc()) ? addslashes($value) : $value;\n\t\t$new_value = ($value != \"\") ? \"'\".trim($value).\"'\" : \"''\";\n\t\treturn $new_value;\n\t}",
"protected function quote_string($value) {\n\t\treturn $this->quote($value);\n\t}",
"public function singleQuote(&$value, &$key)\n {\n if ($value)\n $value = \"'{$value}'\";\n }",
"public static function wrap($value)\n {\n $value = Str::start($value, \"'\");\n $value = Str::finish($value, \"'\");\n\n return $value;\n }",
"protected function wrapValue($value)\n {\n if ($value === '*') {\n return $value;\n }\n\n return '\"'.str_replace('\"', '\"\"', $value).'\"';\n }",
"public function quote ( $value ) {\n if (is_array($value)) {\n return array_map(array($this, 'quote'), $value);\n } else if (is_null($value)) {\n return 'NULL';\n } else if (is_int($value) || is_float($value)) {\n return strval($value);\n }\n\n return \"'\". $this->escape($value) .\"'\";\n }",
"public static function formatValue($value)\n {\n if (null === $value) {\n return 'null';\n }\n\n if (true === $value) {\n return 'true';\n }\n\n if (false === $value) {\n return 'false';\n }\n\n if (is_string($value)) {\n return '\"'.$value.'\"';\n }\n\n return (string) $value;\n }",
"protected function getValue(string $value) : string {\n\n\t\t\treturn ('\\'' . addslashes($value) . '\\'');\n\t\t}",
"public function quoteString(string $value): string\n {\n return\n static::QUOTE_STRING .\n str_replace(static::QUOTE_STRING, static::QUOTE_STRING . static::QUOTE_STRING, $value) .\n static::QUOTE_STRING;\n }",
"public static function encodeFunc($value)\n {\n $value = str_replace('\\\\\"', '\"', $value);\n //then force escape these same double quotes And Any UNESCAPED Ones.\n $value = str_replace('\"', '\\\"', $value);\n //force wrap value in quotes and return\n return '\"' . $value . '\"';\n }",
"protected function escape($value)\n {\n return ($this->needsEscaping($value)) ? '\"' . str_replace('\"', '\"\"', str_replace('\\\\', '\\\\\\\\', $value)) . '\"' : $value;\n }",
"public function quote($value) : string\n {\n if ($value === NULL)\n {\n return 'NULL';\n }\n if ($value === TRUE)\n {\n return \"'1'\";\n }\n if ($value === FALSE)\n {\n return \"'0'\";\n }\n if (is_object($value))\n {\n if ($value instanceof Query)\n {\n // Create a sub-query\n return '('.$value->compile($this).')';\n }\n if ($value instanceof Expression)\n {\n // Compile the expression\n return $value->compile($this);\n }\n if ($value instanceof stdClass)\n {\n // Convert the object to a string\n // Object of class stdClass could not be converted to string\n return $this->quote(serialize($value));\n }\n\n // Convert the object to a string\n return $this->quote((string)$value);\n }\n if (is_array($value))\n {\n return '('.implode(', ', array_map([\n $this,\n __FUNCTION__\n ], $value)).')';\n }\n if (is_int($value))\n {\n return (int)$value;\n }\n if (is_float($value))\n {\n // Convert to non-locale aware float to prevent possible commas\n return sprintf('%F', $value);\n }\n\n return $this->escape($value);\n }",
"protected function escape($value)\n {\n\treturn str_replace(\"'\", \"\\\\'\", $value);\n }",
"private static function escape($value) {\r\n\t\t// convert not scalar values\r\n\t\tif(is_array($value)) {\r\n\t\t\t$value = self::join($value);\r\n\t\t} else if(is_object($value)) {\r\n\t\t\tif(method_exists($value, 'toCsv')) {\r\n\t\t\t\t$value = $value->toCsv();\r\n\t\t\t} else if(method_exists($value, 'toArray')) {\r\n\t\t\t\t$value = self::join($value->toArray());\r\n\t\t\t} else if(method_exists($value, 'asArray')) {\r\n\t\t\t\t$value = self::join($value->asArray());\r\n\t\t\t} else {\r\n\t\t\t\t$value = self::join(Larc_Object::asArray($value));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Figure out if value will need to be quoted\r\n\t\t$quoteIt = false;\r\n\t\tif(strpos($value, '\"') !== false) {\r\n\t\t\t//if value contains double quotes, we must escape them with double-quotes (according to CSV specification)\r\n\t\t\t$value = str_replace('\"', '\"\"', $value);\r\n\t\t\t$quoteIt = true;\r\n\t\t}\r\n\t\tif(strpos($value, ',') !== false || strpos($value, \"\\n\") !== false || strpos($value, \"\\r\") !== false) {\r\n\t\t\t// values with commas or carriage returns in them need to be quoted\r\n\t\t\t$quoteIt = true;\r\n\t\t}\r\n\t\t\t\t\r\n\t\tif($quoteIt) {\r\n\t\t\t$value = '\"' . $value . '\"';\r\n\t\t}\r\n\t\t\r\n\t\treturn $value;\r\n\t}",
"protected function quoteValue(string $value): string\n {\n return ($value !== '*')\n ? '`'.str_replace('`', '``', $value).'`'\n : $value;\n }",
"public function enclose_in_quotes( ?string $string = '' ) : string {\n return strlen( $string ) > 0 ? \"'$string'\" : '';\n }",
"function escapeStr($value) {\n return $this->databaseEscapeString($value);\n }",
"protected function _quote($value)\n {\n if (is_int($value) || is_float($value)) {\n return $value;\n }\n $value = str_replace(\"'\", \"''\", $value);\n return \"'\" . addcslashes($value, \"\\000\\n\\r\\\\\\032\") . \"'\";\n }",
"protected function esc(?string $value): string\n {\n if ($value === null) {\n return '';\n }\n\n return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');\n }",
"protected function escapeString($value)\n {\n return $this->entityManager->getConnection()->quote($value);\n }",
"static public function QuoteValue($pValue)\n {\n if (is_array($pValue)) {\n foreach ($pValue AS &$lValue) {\n $lValue = self::QuoteValue($lValue);\n } \n return implode(', ', $pValue);\n } else if ($pValue instanceof FS_Db_Query) {\n $pValue = $pValue->Assemble();\n } else if ($pValue instanceof FS_Db_Expr) {\n //$pValue = $pValue->toString();\n return addcslashes($pValue, \"\\000\\n\\r\\\\'\\\"\\032\");\n } else if (!is_string($pValue)) {\n return $pValue;\n }\n return '\"' . addcslashes($pValue, \"\\000\\n\\r\\\\'\\\"\\032\") . '\"';\n }",
"public function esc(String $value) {\n // bring the global db connect object into function\n include \"config.php\";\n\n $val = trim($value); // remove empty space sorrounding string\n $val = mysqli_real_escape_string($bdd, $value);\n\n return $val;\n }",
"function esc(String $value)\n\t{\t\n\t\t// bring the global db connect object into function\n\t\tglobal $conn;\n\n\t\t$val = trim($value); // remove empty space sorrounding string\n\t\t$val = mysqli_real_escape_string($conn, $value);\n\n\t\treturn $val;\n\t}",
"final protected function asString($value)\n\t{\n\t\treturn is_null($value) ? $value : strval($value);\n\t}",
"function _CheckAndQuote($value)\n {\n if (is_int($value) || is_float($value)) {\n return $value;\n }\n\n return htmlspecialchars(addslashes($value));\n }",
"private function protectString($value)\n {\n return str_replace(\"'\", \"\\\\'\", $value);\n }",
"public function quote($value)\r\n {\r\n if (is_array($value)) {\r\n foreach ($value as &$val) {\r\n $val = $this->quote($val);\r\n }\r\n return implode(', ', $value);\r\n } elseif (is_int($value)) {\r\n return $value;\r\n } elseif (is_float($value)) {\r\n return sprintf('%F', $value);\r\n }\r\n return \"'\" . addcslashes($value, \"\\000\\n\\r\\\\'\\\"\\032\") . \"'\";\r\n }",
"private function escapeConditionString(string $value): string\r\n\t{\r\n\t\treturn $value;\r\n\t}",
"protected function _prepareValue($value) {\n if (is_integer($value) || is_float($value)) {\n return $value;\n } else\n if (is_bool($value)) {\n return ($value ? 'true' : 'false');\n } else {\n \t// HACK jakich mało\n \tif (in_array(strtolower($value), array('true','false'))) {\n \t\treturn strtolower($value);\n \t}\n return '\"' . addslashes($value) . '\"';\n }\n }"
] | [
"0.7262356",
"0.7255954",
"0.71300364",
"0.7081782",
"0.7026761",
"0.6988165",
"0.69525605",
"0.69446474",
"0.6939323",
"0.68874156",
"0.6886459",
"0.68444574",
"0.683787",
"0.68344635",
"0.68058914",
"0.67883533",
"0.6693728",
"0.66826284",
"0.6644312",
"0.66154575",
"0.6599617",
"0.65929806",
"0.65659904",
"0.6545996",
"0.6539087",
"0.6485467",
"0.6449533",
"0.64312816",
"0.64177144",
"0.6400356"
] | 0.73240834 | 0 |
Verify execute() with request containing file | public function executePostWithFile()
{
$guzzleResponse = $this->getValidResponse();
$plugin = new MockPlugin();
$plugin->addResponse($guzzleResponse);
$this->adapter->getGuzzleClient()->addSubscriber($plugin);
$request = new Request();
$request->setMethod(Request::METHOD_POST);
$request->addHeader('X-PHPUnit: request value');
$request->setFileUpload(__FILE__);
$endpoint = new Endpoint();
$endpoint->setTimeout(10);
$response = $this->adapter->execute($request, $endpoint);
$this->assertSame('OK', $response->getStatusMessage());
$this->assertSame(200, $response->getStatusCode());
$this->assertSame(
array(
'HTTP/1.1 200 OK',
'Content-Type: application/json',
'X-PHPUnit: response value',
),
$response->getHeaders()
);
$this->assertSame($guzzleResponse->getBody(true), $response->getBody());
$receivedRequests = $plugin->getReceivedRequests();
$this->assertCount(1, $receivedRequests);
$this->assertSame('POST', $receivedRequests[0]->getMethod());
$this->assertStringEqualsFile(__FILE__, (string)$receivedRequests[0]->getBody());
$this->assertSame(
'request value',
(string)$receivedRequests[0]->getHeader('X-PHPUnit')
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function exec() {\n if (!isset($this -> request)) {\n return false;\n }\n $method = $this -> request -> getMethod();\n $url = $this -> request -> getUrl();\n $header = $this -> request -> getHeader();\n $data = $this -> request -> getData();\n $files = $this -> request -> getFiles();\n return $this -> doRequest($method, $url, $header, $data, $files);\n }",
"public function testExecuteScript()\n {\n $expected = new Response();\n\n $guzzle = $this->getMock('GuzzleHttp\\ClientInterface');\n $guzzle->method('request')\n ->will($this->returnValue($expected));\n\n $vis = new VisClientService($guzzle);\n $actual = $vis->executeScript('VIS_GET_FILE:....');\n\n $this->assertEquals($expected, $actual);\n }",
"public function execute($fileName);",
"protected function execute()\n {\n // Finished\n if ($this->isFinished()) {\n $this->log(\"Verifying files finished\");\n $this->prepareResponse(true, false);\n return false;\n }\n\n // Get files and copy'em\n if (!$this->getFilesAndVerify()) {\n $this->prepareResponse(false, false);\n $this->saveOptions();\n return false;\n }\n\n // Prepare and return response\n $this->prepareResponse();\n\n // Not finished\n return true;\n }",
"public function testReadFile ()\n {\n $offset = 1;\n $length = 3;\n\n $response = $this->getWebResponse('getFile_success');\n\n $web = $this->getMock('\\\\Hdfs\\\\Web\\\\WebHdfsWrapper');\n $web->expects($this->once())\n ->method('exec')\n ->with(Method::GET, self::REMOTE_FILE, 'OPEN', array('offset' => $offset, 'length' => $length))\n ->will($this->returnValue($response));\n\n $entry = $this->getMockBuilder('\\\\Hdfs\\\\EntryStatus')->disableOriginalConstructor()->getMock();\n $entry->method('isFile')->will($this->returnValue(true));\n\n $hdfs = $this->getMock('\\\\Hdfs\\\\Web', array('stat'));\n $hdfs->method('stat')->with(self::REMOTE_FILE)->will($this->returnValue($entry));\n $hdfs->setWebHdfsWrapper($web);\n\n $read = $hdfs->readFile(self::REMOTE_FILE, $offset, $length);\n\n $expected = $response->getFileContent();\n $this->assertEquals($expected, $read);\n }",
"function testRequestViaFileGetContent() {\n\t\t$result = $this->np->setConnectionType('file_get_content')->documentsTracking('59000082032106');\n\t\t$this->assertTrue($result['success']);\n\t}",
"function execute_file ($file) {\n \n if (!file_exists($file)) {\n $this->last_error = \"The file $file does not exist.\";\n return false;\n }\n $str = file_get_contents($file);\n if (!$str) {\n $this->last_error = \"Unable to read the contents of $file.\";\n return false; \n }\n \n $this->last_query = $str; \n \n // split all the query's into an array\n $sql = explode(';', $str);\n foreach ($sql as $query) {\n if (!empty($query)) {\n $r = $this->db_link->query($query);\n \n if (!$r) {\n $this->last_error = $this->db_link->error;\n return false;\n }\n }\n }\n return true;\n \n }",
"function handleRequest($dir, $file)\n {\n debug('TestPlugin', \"Been asked to handle $dir/$file\");\n return false;\n }",
"public function testExecute(string $filename)\n {\n $filePath = $this->fullDirectoryPath . DIRECTORY_SEPARATOR . $filename;\n $fixtureDir = realpath(__DIR__ . '/../../../../../Catalog/_files');\n $this->copyFile($fixtureDir . '/' . $this->fileName, $filePath);\n\n $this->model->getRequest()->setMethod('POST')\n ->setPostValue('files', [$this->imagesHelper->idEncode($filename)]);\n $this->model->getStorage()->getSession()->setCurrentPath($this->fullDirectoryPath);\n $this->model->execute();\n\n $this->assertFalse(\n $this->mediaDirectory->isExist(\n $this->mediaDirectory->getRelativePath($this->fullDirectoryPath . '/' . $filename)\n )\n );\n }",
"public function shouldRun($path, $content);",
"public function testStatSuccess ()\n {\n $response = $this->getWebResponse('stat_file');\n $web = $this->getMock('\\\\Hdfs\\\\Web\\\\WebHdfsWrapper');\n $web->expects($this->once())\n ->method('exec')\n ->with(Method::GET, self::REMOTE_FILE, 'GETFILESTATUS')\n ->will($this->returnValue($response));\n $hdfs = new \\Hdfs\\Web($web);\n\n $entry = $hdfs->stat(self::REMOTE_FILE);\n\n $this->assertEquals(basename(self::REMOTE_FILE), $entry->getName());\n $this->assertEquals(Hdfs\\EntryType::FILE, $entry->getType());\n $this->assertEquals(octdec('755'), $entry->getMode());\n $this->assertEquals(11, $entry->getSize());\n $this->assertEquals(1427994123442, $entry->getMtime());\n $this->assertTrue((bool)$entry->getOwner());\n $this->assertEquals('hdfs', $entry->getGroup());\n $this->assertEquals(3, $entry->getRfactor());\n }",
"function validate_file() {\n return validate_post_file($this->request->getPost(\"file_name\"));\n }",
"public function test_execute()\n {\n\n $viewFactory = m::mock('Illuminate\\Contracts\\View\\Factory');\n $request = m::spy('Payum\\Core\\Request\\RenderTemplate');\n $templateName = 'foo.template';\n $parameters = [];\n $result = 'foo';\n\n /*\n |------------------------------------------------------------\n | Act\n |------------------------------------------------------------\n */\n\n $request\n ->shouldReceive('getTemplateName')->andReturn($templateName)\n ->shouldReceive('getParameters')->andReturn($parameters);\n\n $viewFactory\n ->shouldReceive('make')->with($templateName, $parameters)->andReturnSelf()\n ->shouldReceive('render')->andReturn($result);\n\n $renderTemplateAction = new RenderTemplateAction($viewFactory);\n $renderTemplateAction->execute($request);\n\n /*\n |------------------------------------------------------------\n | Assert\n |------------------------------------------------------------\n */\n\n $request->shouldHaveReceived('getTemplateName')->once();\n $request->shouldHaveReceived('getParameters')->once();\n $request->shouldHaveReceived('setResult')->with($result)->once();\n }",
"function execute_this_file_if_requested($filePath) {\n \n // get the name of the function from the file name\n $functionName = preg_replace('#\\.php$#i', '', basename($filePath));\n \n // check if this is the file that's being executed\n if (isset($_SERVER['argv']) && $_SERVER['argv'][0] && $_SERVER['argv'][0] == basename($filePath)) {\n // receive parameters\n $params = getopt('', [\n 'content:',\n 'file:'\n ]);\n \n // get the content\n $content = '';\n if (isset($params['content'])) {\n $content = $params['content'];\n } elseif (isset($params['file'])) {\n if (file_exists($params['file']) && is_readable($params['file'])) {\n $content = file_get_contents($params['file']);\n }\n }\n \n // output the result\n if (!empty($content)) {\n echo json_encode($functionName($content), JSON_PRETTY_PRINT);\n } else {\n echo \"Empty content\\n\";\n }\n \n die();\n }\n}",
"public function testExecute()\r\n {\r\n // remove testing file if already exists\r\n try {\r\n unlink('foobar.csv');\r\n } catch (\\Exception $ex) {}\r\n $service = $this->mockPaymentCalculator();\r\n $service->execute();\r\n $this->assertFileExists('foobar.csv');\r\n unlink('foobar.csv');\r\n }",
"public function testIndexActionGet()\n {\n $result = $this->controller->indexActionGet();\n $body = $result->getBody();\n\n ob_start();\n $file = include __DIR__ . \"/../../view/ip/via-php/validate.php\";\n $this->assertStringContainsString($file, $body);\n ob_end_clean();\n }",
"public function isRequestForLegacyFile()\n {\n return !empty($_GET['request_file']) && file_exists(__DIR__ . '/../' . filter_var($_GET['request_file'], FILTER_SANITIZE_STRING));\n }",
"public function testWithFileExist(): void\n {\n $pdfInfo = new PdfInfo();\n $info = $pdfInfo->exec($this->examplePdf);\n\n $this->checkTestData($info);\n }",
"public function testPutFileSuccess ()\n {\n $datanodeUrl = 'http://example.com/'. self::REMOTE_FILE;\n $response = $this->getWebResponse('putFile_success');\n\n $fs = $this->getMock('\\\\Hdfs\\\\FilesystemWrapper');\n $fs->method('isExists')->with(self::LOCAL_FILE)->will($this->returnValue(true));\n $fs->method('isReadable')->with(self::LOCAL_FILE)->will($this->returnValue(true));\n\n $web = $this->getMock('\\\\Hdfs\\\\Web\\\\WebHdfsWrapper');\n $web->expects($this->once())\n ->method('getDatanodeUrl')\n ->with(Method::PUT, self::REMOTE_FILE, 'CREATE', array('overwrite' => 'false'))\n ->will($this->returnValue($datanodeUrl));\n $web->expects($this->once())\n ->method('put')\n ->with($datanodeUrl, self::LOCAL_FILE)\n ->will($this->returnValue($response));\n\n $hdfs = $this->getMock('\\\\Hdfs\\\\Web', array('stat'));\n $hdfs->expects($this->once())\n ->method('stat')\n ->with(self::REMOTE_DIR);\n $hdfs->setFilesystemWrapper($fs);\n $hdfs->setWebHdfsWrapper($web);\n\n $hdfs->putFile(self::LOCAL_FILE, self::REMOTE_FILE);\n }",
"public function execute(): bool {\n $data = $this->getAction()->getData();\n ['method' => $method, 'uri' => $uri, 'params' => $params, 'body' => $body] = $data;\n\n $success = true;\n try {\n $client = new Client();\n $client->setMethod($method);\n $client->setUri($uri);\n $client->setParameterGet(\n array_reduce($params, function (array $acc, array $param) {\n $acc[$this->translateValue($param['key'])] = $this->translateValue($param['value']);\n return $acc;\n }, [])\n );\n $client->setOptions([\n 'timeout' => 10,\n ]);\n\n if (in_array($method, [Method::POST, Method::PUT])) {\n $client->setRawBody($body);\n }\n\n $client->send();\n } catch (Exception $e) {\n $this->getContext()->getContainer()->get('logger')->error('Error in HTTP action: '.$e->getMessage(), [$e]);\n $success = false;\n }\n\n return $success;\n }",
"function execute($args, &$request) {\n\t\t$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');\n\t\t$reviewAssignment =& $reviewAssignmentDao->getById($this->reviewId);\n\n\t\t$fileId = null;\n\t\t$monographId = $reviewAssignment->getSubmissionId();\n\t\timport('classes.file.MonographFileManager');\n\t\tif (MonographFileManager::uploadedFileExists('attachment')) {\n\t\t\tif ($reviewAssignment->getReviewerFileId() != null) {\n\t\t\t\t$fileId = MonographFileManager::uploadReviewFile($monographId, 'attachment', $reviewAssignment->getReviewerFileId(), $this->reviewId);\n\t\t\t} else {\n\t\t\t\t$fileId = MonographFileManager::uploadReviewFile($monographId, 'attachment', null, $this->reviewId);\n\t\t\t}\n\t\t}\n\n\t\treturn $fileId;\n\t}",
"public function testExecuteWithWrongFileName()\n {\n $fixtureDir = realpath(__DIR__ . '/../../../../../Catalog/_files');\n $this->mediaDirectory->create('secondDir');\n $driver = $this->mediaDirectory->getDriver();\n $driver->filePutContents(\n $this->mediaDirectory->getAbsolutePath('secondDir' . DIRECTORY_SEPARATOR . $this->fileName),\n file_get_contents($fixtureDir . '/' . $this->fileName)\n );\n $fileName = '/../secondDir/' . $this->fileName;\n $this->model->getRequest()->setMethod('POST')\n ->setPostValue('files', [$this->imagesHelper->idEncode($fileName)]);\n $this->model->getStorage()->getSession()->setCurrentPath($this->fullDirectoryPath);\n $this->model->execute();\n\n $this->assertTrue($this->mediaDirectory->isExist($this->fullDirectoryPath . $fileName));\n }",
"public function testGetFileWithoutErrors ()\n {\n $fs = $this->getMock('\\\\Hdfs\\\\FilesystemWrapper');\n $fs->method('isWritable')->will($this->returnValue(true));\n $fs->method('isExists')->will(\n $this->returnValueMap(\n array(\n array(self::LOCAL_DIR, true),\n array(self::LOCAL_FILE, false)\n )\n )\n );\n $fs->expects($this->once())\n ->method('saveFile')\n ->with(self::LOCAL_FILE, 'hello, hdfs');\n\n $response = $this->getWebResponse('getFile_success');\n\n $web = $this->getMock('\\\\Hdfs\\\\Web\\\\WebHdfsWrapper');\n $web->expects($this->once())\n ->method('exec')\n ->with(Method::GET, self::REMOTE_FILE, 'OPEN')\n ->will($this->returnValue($response));\n\n $entry = $this->getMockBuilder('\\\\Hdfs\\\\EntryStatus')->disableOriginalConstructor()->getMock();\n $entry->method('isFile')->will($this->returnValue(true));\n\n $hdfs = $this->getMock('\\\\Hdfs\\\\Web', array('stat'));\n $hdfs->method('stat')->with(self::REMOTE_FILE)->will($this->returnValue($entry));\n $hdfs->setFilesystemWrapper($fs);\n $hdfs->setWebHdfsWrapper($web);\n\n $hdfs->getFile(self::REMOTE_FILE, self::LOCAL_FILE);\n }",
"public function execute()\n {\n if ($this->prepare()) {\n $inserted = DB::table('file')\n ->insert($this->parameters)\n ->execute()\n ->isSuccessful();\n\n return $inserted;\n }\n\n return false;\n }",
"private function doExecute()\n {\n // Prepare some variables that come in handy in apps\n $request = $this->request;\n $resolver = $this->dispatcher->getResolver();\n $tpl = $template = $this->dispatcher->getTemplate();\n $config = $this->dispatcher->getConfig();\n $url = $request->url;\n\n try\n {\n $db = DB::getDefault();\n }\n catch (\\RuntimeException $e)\n {\n // Running without database\n $db = null;\n }\n\n $get = $request->get;\n $post = $request->post;\n $url_args = $this->dispatcher->getURLArgs();\n $path = $this->app;\n\n self::$logger->debug(\"Including {0}\", [$path]);\n $resp = include $path;\n\n return $resp;\n }",
"abstract public function verifyRequest(): void;",
"function tripal_remote_check_files($filesToCheck, $resource_id)\n{\n module_load_include('inc', 'tripal_remote_job', '/includes/TripalRemoteResource');\n module_load_include('inc', 'tripal_remote_job', '/includes/TripalRemoteSSH');\n \n if (!$resource_id) {\n $sql = \"SELECT resource_id FROM {tripal_remote_resource} where enabled='1' ORDER BY rank ASC LIMIT 1\";\n $sqlResult = db_query($sql);\n $resource_id = $sqlResult->fetchField();\n }\n \n $res = TripalRemoteResource::getResource($resource_id);\n if ($res) {\n // Get the resource type.\n $resource_type = $res->getType();\n }\n else {\n return NULL;\n }\n \n switch ($resource_type) {\n case 'alone' :\n $accessible = $res->checkFiles($filesToCheck);\n break;\n }\n \n return $accessible;\n}",
"public function _processFile($req) {\n\n\t\n\t\t$file = $req['file'];\n\t\tif ($file['error'] == 0) {\n\t\t\t$name = $req['file']['name'];\n\n\t\t$path = WWW_ROOT . 'files' . DS . $name;\n\t\t\tif (is_uploaded_file($req['file']['tmp_name'])\n\t\t\t\t&& move_uploaded_file($req['file']['tmp_name'], $path)\n\t\t\t) {\n\n\t\t\t\treturn true;\n\t\t\t}\n\t }\n\t\treturn false;\n\t}",
"public function test_file_route() {\n global $DB, $CFG;\n\n // Create user\n $user = $this->getDataGenerator()->create_user();\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n // enrol the user on the course\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $DB->get_field('role', 'id', array(\n 'shortname' => 'student',\n )));\n\n // login the user\n $this->setUser($user);\n\n check_dir_exists($this->_upload_path . '/' . $videoquanda->id);\n copy(__DIR__ . '/video/video.mp4', $this->_upload_path . '/' . $videoquanda->id .'/video.mp4');\n\n $client = new Client($this->_app);\n $client->request('GET', '/file/' . $videoquanda->id . '/video.mp4');\n\n $this->assertEquals('video/mp4', $client->getResponse()->headers->get('Content-Type'));\n $this->assertFileExists($this->_upload_path . '/' . $videoquanda->id . '/video.mp4');\n }",
"public function testRealRequest()\n {\n if (!is_file(__DIR__ . '/AuthCredentials.php')) {\n $this->markTestSkipped('No twitter Credentials Found');\n return ;\n }\n\n $auth = require __DIR__ . '/AuthCredentials.php';\n if (!isset($auth['twitter'])) {\n $this->markTestSkipped('No twitter Credentials Found');\n return ;\n }\n\n if (!ini_get('allow_url_fopen')) {\n $this->markTestIncomplete('Could not test twitter with file_get_contents, allow_url_fopen is closed');\n return ;\n }\n\n $data = array_merge(array('resource' => 'guiacereza'), $auth['twitter']);\n\n $stream = $this->getStream('Twitter', $data, null, array('prefer_curl' => false));\n $response = $stream->getResponse();\n\n $this->checkResponseIntegrity('Twitter', $response);\n\n $errors = $stream->getErrors();\n $this->assertTrue(empty($errors));\n }"
] | [
"0.6564796",
"0.6408043",
"0.6344115",
"0.61938554",
"0.6045606",
"0.59816384",
"0.57857937",
"0.57219577",
"0.57159007",
"0.5539641",
"0.5513131",
"0.5450659",
"0.54467076",
"0.5421934",
"0.5411856",
"0.5411299",
"0.5398914",
"0.5380846",
"0.5308218",
"0.5274732",
"0.5249788",
"0.52237535",
"0.5222228",
"0.5219059",
"0.52170485",
"0.51955026",
"0.519005",
"0.5184159",
"0.51763976",
"0.5169821"
] | 0.6466948 | 1 |
Verify execute() with request containing raw body | public function executePostWithRawBody()
{
$guzzleResponse = $this->getValidResponse();
$plugin = new MockPlugin();
$plugin->addResponse($guzzleResponse);
$this->adapter->getGuzzleClient()->addSubscriber($plugin);
$request = new Request();
$request->setMethod(Request::METHOD_POST);
$request->addHeader('X-PHPUnit: request value');
$xml = '<root><parent><child>some data</child></parent></root>';
$request->setRawData($xml);
$endpoint = new Endpoint();
$endpoint->setTimeout(10);
$response = $this->adapter->execute($request, $endpoint);
$this->assertSame('OK', $response->getStatusMessage());
$this->assertSame(200, $response->getStatusCode());
$this->assertSame(
array(
'HTTP/1.1 200 OK',
'Content-Type: application/json',
'X-PHPUnit: response value',
),
$response->getHeaders()
);
$this->assertSame($guzzleResponse->getBody(true), $response->getBody());
$receivedRequests = $plugin->getReceivedRequests();
$this->assertCount(1, $receivedRequests);
$this->assertSame('POST', $receivedRequests[0]->getMethod());
$this->assertSame($xml, (string)$receivedRequests[0]->getBody());
$this->assertSame(
'request value',
(string)$receivedRequests[0]->getHeader('X-PHPUnit')
);
$this->assertSame(
'application/xml; charset=utf-8',
(string)$receivedRequests[0]->getHeader('Content-Type')
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function httpRequestGetRawBody(UnitTester $I)\n {\n $I->wantToTest('Http\\Request - getRawBody()');\n\n // Empty\n $request = new Request();\n $I->assertEmpty($request->getRawBody());\n\n // Valid\n stream_wrapper_unregister('php');\n stream_wrapper_register('php', PhpStream::class);\n\n file_put_contents('php://input', 'fruit=orange&quantity=4');\n\n $request = new Request();\n\n $expected = [\n 'fruit' => 'orange',\n 'quantity' => '4',\n ];\n\n $data = $request->getRawBody();\n parse_str($data, $actual);\n\n $I->assertSame($expected, $actual);\n\n stream_wrapper_restore('php');\n }",
"public function sendRequest($body);",
"public function execute(): bool {\n $data = $this->getAction()->getData();\n ['method' => $method, 'uri' => $uri, 'params' => $params, 'body' => $body] = $data;\n\n $success = true;\n try {\n $client = new Client();\n $client->setMethod($method);\n $client->setUri($uri);\n $client->setParameterGet(\n array_reduce($params, function (array $acc, array $param) {\n $acc[$this->translateValue($param['key'])] = $this->translateValue($param['value']);\n return $acc;\n }, [])\n );\n $client->setOptions([\n 'timeout' => 10,\n ]);\n\n if (in_array($method, [Method::POST, Method::PUT])) {\n $client->setRawBody($body);\n }\n\n $client->send();\n } catch (Exception $e) {\n $this->getContext()->getContainer()->get('logger')->error('Error in HTTP action: '.$e->getMessage(), [$e]);\n $success = false;\n }\n\n return $success;\n }",
"public function testBodyMethod()\n {\n\n $body = [\n \"query\" => [\n \"bool\" => [\n \"must\" => [\n [\"match\" => [\"address\" => \"mill\"]],\n ]\n ]\n ]\n ];\n\n $this->assertEquals(\n $this->getExpected($body),\n $this->getActual($body)\n );\n\n\n }",
"public function testRealRequest()\n {\n $stream = $this->getStream('StackOverflow', '430087');\n $response = $stream->getResponse();\n\n $this->checkResponseIntegrity('StackOverflow', $response);\n\n $errors = $stream->getErrors();\n $this->assertTrue(empty($errors));\n }",
"public function getRawBody();",
"abstract public function verifyRequest(): void;",
"public function getRawBody()\n\t{\n\t\t$body = file_get_contents('php://input');\n\n\t\tif (strlen(trim($body)) > 0) {\n\t\t\treturn $body;\n\t\t}\n\n\t\treturn false;\n\t}",
"protected function executeRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling execute'\n );\n }\n\n $resourcePath = '/api/v1/integration/rule/execute';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // // this endpoint requires Bearer token\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function CheckJsonBody($body)\n{\n}",
"public function getRawRequest () {}",
"public function testGetParsedBody(): void\n {\n $data = ['title' => 'First', 'body' => 'Best Article!'];\n $request = new ServerRequest(['post' => $data]);\n $this->assertSame($data, $request->getParsedBody());\n\n $request = new ServerRequest();\n $this->assertSame([], $request->getParsedBody());\n }",
"public function testGoodRequestReturnsContentBody()\n {\n $obj = new Curl();\n $res = $obj->request('http://example.org');\n $this->assertTrue(strpos($res, \"<body>\") != false, \"The response should include a <body> tag, since it is a HTML document\");\n }",
"function & request_body ($decode = null, $args = array()) {\n $b = @file_get_contents('php://input');\n if(is_callable($decode)){\n array_unshift($args, $b);\n $b = call_user_func_array($decode, $args);\n }\n return $b;\n}",
"public function getRawBody(): string\n\t\t{\n\t\t\treturn file_get_contents(\"php://input\");\n\t\t}",
"public function testWithParsedBody(): void\n {\n $data = ['title' => 'First', 'body' => 'Best Article!'];\n $request = new ServerRequest([]);\n $new = $request->withParsedBody($data);\n\n $this->assertNotSame($request, $new);\n $this->assertSame([], $request->getParsedBody());\n $this->assertSame($data, $new->getParsedBody());\n }",
"public function receivePostRequest();",
"public function testValidSubmissionRequestFatory()\n {\n $data = json_decode(json_encode($this->validSubmission));\n\n $data['func'] = $this->func;\n\n $request = new Request();\n $ns = $request->process('array', $data);\n\n $this->assertTrue($ns instanceof CookieQuit);\n }",
"public function processRequest();",
"public function assertExecute()\n\t{\t\n\t\t$msgObj \t\t= &parent::getCurrentMessage();\n\t\t$http \t\t\t= $msgObj::getData('currentHttp');\n\t\t$arguments \t\t= $msgObj::getData('currentArguments');\n\t\t$outputFormat\t= $msgObj::getData('outputFormat');\n\t\t$compareTo\t\t= $arguments[0];\n\t\t\n\t\tif(!isset($arguments[1])){\n\t\t\t// If we're not given two terms, match against the body of the latest httpRequest\n\t\t\t$compareAgainst = ($http) ? $http->getBody() : '';\n\t\t}else{\n\t\t\t$compareAgainst = $arguments[1];\n\t\t}\n\n\t\t$passTest = true;\n\t\tswitch(strtolower($outputFormat)){\n\t\t\tcase 'json':\n\t\t\t\tif(json_encode($compareTo)!=json_encode($compareAgainst)){\n\t\t\t\t\t$passTest = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// match as strings\n\t\t\t\tif(trim($compareAgainst)!=trim($compareTo)){\n\t\t\t\t\t$passTest = false;\n\t\t\t\t}\n\t\t}\n\t\t\n\t\tif(!$passTest){\n\t\t\tthrow new Exception(get_class().': Values not equal!');\n\t\t}\n\t\treturn true;\n\t}",
"public function raw(int $status = 200, string $body = ''): Response;",
"abstract public function parseRequest($raw_data);",
"public function requestedResourceBody(): bool;",
"public function execute(){\n\t\t\t$requestBody = RequestHandler::getContent();\n\t\t\t$requestBody = is_array($requestBody)?$requestBody:[$requestBody];\n\n\t\t\t$password = array_key_exists(\"utilitykey\",$requestBody)?$requestBody[\"utilitykey\"]:\"\";\n\t\t\tif($password !== SettingsManager::getSetting(\"api\",\"utilitykey\")){\n\t\t\t\tResponseHandler::forbidden(\"The provided tokens do not have permission to perform this action.\");\n\t\t\t}\n\n parent::execute();\n }",
"function validatePostData($fnSuccess){\n $body = file_get_contents('php://input');\n if($body !== false) {\n $jsonParsed = json_decode($body, false);\n\n if(is_null($jsonParsed)){\n http_response_code(400);\n return new ApiResponse(null, \"Request body cant parse as JSON\");\n } else {\n return $fnSuccess($jsonParsed);\n }\n } else {\n http_response_code(400);\n return new ApiResponse(null, \"Request body is not present\");\n }\n}",
"public function test_execute()\n {\n\n $viewFactory = m::mock('Illuminate\\Contracts\\View\\Factory');\n $request = m::spy('Payum\\Core\\Request\\RenderTemplate');\n $templateName = 'foo.template';\n $parameters = [];\n $result = 'foo';\n\n /*\n |------------------------------------------------------------\n | Act\n |------------------------------------------------------------\n */\n\n $request\n ->shouldReceive('getTemplateName')->andReturn($templateName)\n ->shouldReceive('getParameters')->andReturn($parameters);\n\n $viewFactory\n ->shouldReceive('make')->with($templateName, $parameters)->andReturnSelf()\n ->shouldReceive('render')->andReturn($result);\n\n $renderTemplateAction = new RenderTemplateAction($viewFactory);\n $renderTemplateAction->execute($request);\n\n /*\n |------------------------------------------------------------\n | Assert\n |------------------------------------------------------------\n */\n\n $request->shouldHaveReceived('getTemplateName')->once();\n $request->shouldHaveReceived('getParameters')->once();\n $request->shouldHaveReceived('setResult')->with($result)->once();\n }",
"public function execute()\n {\n $data = json_decode($this->request->getContent(), false, self::JSON_DECODE_DEPTH, JSON_THROW_ON_ERROR);\n\n try {\n $this->webhook->checkChecksum($this->request);\n if ($data->data) {\n $this->webhook->dispatch($data->name, $data->data->object);\n }\n } catch (Exception $exception) {\n $this->logger->addError($exception->getMessage());\n }\n\n return $this->response->setStatusCode(self::HTTP_OK);\n }",
"static public function get_req_body() {\r\n\t\tself::$response = file_get_contents(\"php://input\");\r\n\t\treturn self::instantiate();\r\n\t}",
"public function testSingle()\n {\n $request = new DummyRequest();\n $request->setUrl('http://www.example.org/some/other/path');\n $this->assertTrue($request->send());\n $this->assertEquals(\"I am Example\", $request->getResponseBody());\n }",
"protected function executePost()\n\t{\n\t\tif (!is_string($this->requestBody)) {\n\t\t\t//$this->buildPostBody();\n\t\t}\n\n\t\tcurl_setopt($this->curlHandle, CURLOPT_POSTFIELDS, $this->requestBody);\n\t\tcurl_setopt($this->curlHandle, CURLOPT_POST, 1);\n\n\t\t$this->doExecute();\n\t}"
] | [
"0.6384133",
"0.6001246",
"0.5997012",
"0.5935252",
"0.5862973",
"0.5850662",
"0.58483636",
"0.58379257",
"0.5733646",
"0.5715159",
"0.55643004",
"0.5562531",
"0.5534351",
"0.54784125",
"0.5414002",
"0.5402475",
"0.5372432",
"0.5372156",
"0.5370525",
"0.53489596",
"0.5344806",
"0.5320307",
"0.52950704",
"0.52941954",
"0.5247658",
"0.52278113",
"0.5194552",
"0.51941526",
"0.5192846",
"0.518418"
] | 0.6473833 | 0 |
Verify execute() with GET request containing Authentication. | public function executeGetWithAuthentication()
{
$guzzleResponse = $this->getValidResponse();
$plugin = new MockPlugin();
$plugin->addResponse($guzzleResponse);
$this->adapter->getGuzzleClient()->addSubscriber($plugin);
$request = new Request();
$request->setMethod(Request::METHOD_GET);
$request->addHeader('X-PHPUnit: request value');
$request->setAuthentication('username', 's3cr3t');
$endpoint = new Endpoint();
$endpoint->setTimeout(10);
$response = $this->adapter->execute($request, $endpoint);
$this->assertSame('OK', $response->getStatusMessage());
$this->assertSame(200, $response->getStatusCode());
$this->assertSame(
array(
'HTTP/1.1 200 OK',
'Content-Type: application/json',
'X-PHPUnit: response value',
),
$response->getHeaders()
);
$this->assertSame($guzzleResponse->getBody(true), $response->getBody());
$receivedRequests = $plugin->getReceivedRequests();
$this->assertCount(1, $receivedRequests);
$this->assertSame('GET', $receivedRequests[0]->getMethod());
$this->assertSame(
'request value',
(string)$receivedRequests[0]->getHeader('X-PHPUnit')
);
$this->assertSame(
'Basic ' . base64_encode('username:s3cr3t'),
(string)$receivedRequests[0]->getHeader('Authorization')
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authOkGet(): void {\n\t\t$options = [\n\t\t\tCURLOPT_HTTPAUTH => CURLAUTH_BASIC,\n\t\t\tCURLOPT_USERPWD => 'vincent:myPassword',\n\t\t];\n\t\t$this->response = $this->_request::send(\n\t\t\t$_ENV['HOME_URL'] . '/folder1/folder2/my-class/auth',\n\t\t\t['id' => 5, 'methodUsed' => 'GET'],\n\t\t\t'GET',\n\t\t\t$options,\n\t\t\t$this->httpCode\n\t\t);\n\t}",
"abstract public function checkAuthentication ();",
"public function authKoGet(): void {\n\t\t$options = [\n\t\t\tCURLOPT_HTTPAUTH => CURLAUTH_BASIC,\n\t\t\tCURLOPT_USERPWD => 'vin:fail',\n\t\t];\n\t\t$this->response = $this->_request::send(\n\t\t\t$_ENV['HOME_URL'] . '/folder1/folder2/my-class/auth',\n\t\t\t['id' => 6, 'methodUsed' => 'GET'],\n\t\t\t'GET',\n\t\t\t$options,\n\t\t\t$this->httpCode\n\t\t);\n\t}",
"function http_authenticate() {\n if(php_sapi_name() == \"cli\")\n return true;\n\n if(isset($_SERVER['PHP_AUTH_USER']) &&\n ($this->authenticate($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) === true)) {\n return true;\n }\n else {\n header('WWW-Authenticate: Basic realm=\"My Realm\"');\n header('HTTP/1.0 401 Unauthorized');\n exit();\n }\n }",
"public function do_Auth() {\n\t\t// $auth = new Authentication($config);\n\t\t$auth = new Authentication();\n\t\t$token = '';\n\t\t$get = $this->getValueFromParameter('get');\n\t\tif (!empty($get['token'])) $token = $get['token'];\n\t\t\n\t\t// $a = new AuthData();\n\t\t// echo $a->getName();\n\t\t// $a->setName('test123');\n\t\t// $a->setEmail('ddd');\n\t\t// var_dump($a);\n\t\t// echo $a->getName();\n\t\t\n\t\t$auth->authWithToken($token);\n\t\n\t\t$cred = $auth->getCredentials();\n\t\tprint_r($cred);\n\t\tif (!empty($cred)) print_r($cred->getUserName());\n\t\t// var_dump($auth);\n\t\t// $auth->revokeAuthentication();\n\t\treturn ($auth->isAuthenticated() ? 'OK' : 'Failed');\n\n\t}",
"public function checkauth();",
"public function execute(){\n\t\t\t$requestBody = RequestHandler::getContent();\n\t\t\t$requestBody = is_array($requestBody)?$requestBody:[$requestBody];\n\n\t\t\t$password = array_key_exists(\"utilitykey\",$requestBody)?$requestBody[\"utilitykey\"]:\"\";\n\t\t\tif($password !== SettingsManager::getSetting(\"api\",\"utilitykey\")){\n\t\t\t\tResponseHandler::forbidden(\"The provided tokens do not have permission to perform this action.\");\n\t\t\t}\n\n parent::execute();\n }",
"public function GETauth()\n {\n $_GET += ['code' => '', 'state' => ''];\n // the verified token contains the original request uri\n if ($verified = Auth\\Token::verify($_GET['state'])) {\n\n $token = Auth\\Token::generate($_GET['code']);\n $keys = \\HTTP::GET('https://api.github.com/user/emails', $token->headers('json'));\n $value = join(array_column($keys->data, 'email'));\n\n if ($user = Model\\User::ID($value)) {\n $token->save($user);\n throw $this->response->state(Status::REDIRECT, $verified);\n }\n throw $this->response->state(Status::UNAUTHORIZED);\n }\n\n // Logout I s'pose\n if ($this->response->request->authorization(Auth\\Token::NAME)) {\n Auth\\Token::invalidate();\n throw new $this->response->state(Status::REDIRECT, '/');\n }\n throw $this->response->state(Status::NOT_FOUND);\n }",
"public function checkAuth() {\n\t}",
"public function testValidGetCredentials()\n {\n $request = Request::create('/api/login_check', 'POST', [],[],[],[], json_encode(['token' => 'token', 'type' => 'google']));\n $request->attributes->set('_route', 'api_login');\n\n $creds = $this->apiLoginTokenGuard->getCredentials($request);\n\n Assert::assertEquals('token', $creds['token']);\n Assert::assertEquals('google', $creds['type']);\n }",
"function check_authorization (){\n\t}",
"public function authAction()\n {\n\n if (isset($_GET['error'])) return false;\n\n $cl = $this->CreateClient();\n\n if (!isset($_GET['code'])) {\n\n $auth_url = $cl->createAuthUrl();\n header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL));\n exit;\n\n } else {\n\n $access_token = $cl->fetchAccessTokenWithAuthCode($_GET['code']);\n $this->logger->info(\"fetchAccessTokenWithAuthCode: \" . print_r($access_token, true));\n\n if (isset($access_token['error'])) return false;\n\n $_SESSION['_token'] = $access_token;\n header('Location: ' . '/');\n exit;\n }\n\n return true;\n }",
"public function check()\n {\n $apiClient = $this->_getApiClient();\n $apiClient->authenticate();\n }",
"public function call() {\r\n $req = $this->app->request();\r\n $res = $this->app->response();\r\n $authUser = $req->headers('PHP_AUTH_USER');\r\n $authPass = $req->headers('PHP_AUTH_PW');\r\n \r\n if ($this->authenticate($authUser, $authPass)) {\r\n $this->next->call();\r\n } else {\r\n $this->deny_access();\r\n }\r\n }",
"abstract public function authenticate();",
"public function authenticate();",
"public function authenticate();",
"public function authenticate();",
"public function authenticate();",
"public function Verify()\n\t\t{\n\t\t\treturn $this->PutioLogin();\n\t\t}",
"public function authUser() {\n\t\t$this->assertEquals ( - 1, $this->auth->authUser ( array ('authenticated' => FALSE ) ) );\n\t\t$this->assertEquals ( 200, $this->auth->authUser ( array ('authenticated' => TRUE ) ) );\n\t}",
"public function testHttpBasicAuthentication()\n {\n $page = Page::html(self::$page, Request::create(\n 'http://website.com/',\n 'GET', // method\n array(), // parameters\n array(), // cookies\n array(), // files\n array(\n 'HTTP_AUTHORIZATION' => 'Basic '.base64_encode('[email protected]:sekretive'),\n ) // server\n ), 'overthrow');\n $this->assertEquals('[email protected]', $page->request->getUser());\n $this->assertEquals('sekretive', $page->request->getPassword());\n $auth = new Auth();\n $this->assertNull($auth->http());\n $this->assertEquals(1, $auth->user('id'));\n $this->assertEquals('Joe Blogger', $auth->user('name'));\n $this->assertEquals('[email protected]', $auth->user('email'));\n $this->assertEquals(2, $auth->user('admin'));\n $this->assertEquals(0, $auth->user('login'));\n $this->assertEquals(1, $auth->isUser());\n $this->assertEquals(2, $auth->isAdmin(5));\n\n // Use an array and authenticate via $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW']\n $page = Page::html(self::$page, Request::create(\n 'http://website.com/',\n 'GET', // method\n array(), // parameters\n array(), // cookies\n array(), // files\n array(\n 'PHP_AUTH_USER' => 'Joe Bloggs',\n 'PHP_AUTH_PW' => 'supersekrit',\n ) // server\n ), 'overthrow');\n $this->assertEquals('Joe Bloggs', $page->request->getUser());\n $this->assertEquals('supersekrit', $page->request->getPassword());\n $auth = new Auth(array(\n 'basic' => array('Joe Bloggs' => 'supersekrit'),\n ));\n $this->assertEquals('Joe Bloggs', $auth->http());\n $this->assertNull($auth->user('id'));\n $this->assertNull($auth->user('name'));\n $this->assertNull($auth->user('email'));\n $this->assertNull($auth->user('admin'));\n $this->assertNull($auth->user('login'));\n $this->assertFalse($auth->isUser());\n $this->assertEquals(1, $auth->isAdmin(5));\n\n // Use a YAML file and authenticate via url\n $page = Page::html(self::$page, Request::create(\n 'http://Joe:[email protected]/'\n ), 'overthrow');\n $this->assertEquals('Joe', $page->request->getUser());\n $this->assertEquals('Bloggs', $page->request->getPassword());\n\n // We start out with a human readable password\n $file = self::$page['dir'].'/users.yml';\n file_put_contents($file, Yaml::dump(array('Joe' => 'Bloggs')));\n $this->assertEquals(array(\n 'Joe' => 'Bloggs',\n ), Yaml::parse(file_get_contents($file)));\n\n // Unencrypted passwords are encrypted the first time we open the file\n $auth = new Auth(array(\n 'basic' => $file,\n ));\n $first = Yaml::parse(file_get_contents($file));\n $this->assertStringStartsWith('$2y$', $first['Joe']);\n\n // Encrypted passwords stay the same\n $auth = new Auth(array(\n 'basic' => $file,\n ));\n $second = Yaml::parse(file_get_contents($file));\n $this->assertEquals($first['Joe'], $second['Joe']);\n\n // Password updated when encryption settings change\n $auth = new Auth(array(\n 'basic' => $file,\n 'password' => array('options' => array('cost' => 5)),\n ));\n $third = Yaml::parse(file_get_contents($file));\n $this->assertNotEquals($second['Joe'], $third['Joe']);\n $this->assertStringStartsWith('$2y$', $third['Joe']);\n $this->assertEquals('Joe', $auth->http());\n $this->assertNull($auth->user('id'));\n $this->assertNull($auth->user('name'));\n $this->assertNull($auth->user('email'));\n $this->assertNull($auth->user('admin'));\n $this->assertNull($auth->user('login'));\n $this->assertFalse($auth->isUser());\n $this->assertEquals(1, $auth->isAdmin(5));\n\n // Call realm() for 100% coverage\n $auth->realm('Website');\n }",
"public function authenticate_api()\n {\n $response = array( \"status\" => \"authentication falied!\" );\n if(isset($_SERVER['PHP_AUTH_USER'])||isset($_SERVER['PHP_AUTH_PW']))\n {\n $cridentails=array(\"username\"=>$_SERVER['PHP_AUTH_USER']\n ,\"password\"=>$_SERVER['PHP_AUTH_PW']);\n $value= $this->db->table('tbl_apiaauth')->where($cridentails)->countAllResults();\n if($value > 0)\n {\n return true;\n }\n else{\n $this->sendResponse($response);\n }\n }\n else{\n $this->sendResponse($response);\n \n }\n }",
"public function testAuth()\n {\n $params = [\n 'merchid' => $this->merchant_id,\n ];\n\n try {\n $res = $this->send('GET', '', $params);\n } catch (ClientException $e) {\n return false;\n }\n\n preg_match('/<h1>(.*?)<\\/h1>/', $res->getBody(), $matches);\n return strtolower($matches[1]) == strtolower(self::AUTH_TEXT);\n }",
"public function testAuthWithoutAuthData()\n {\n $req = $this->getRequest(null, false);\n $res = $req->send();\n $this->assertEquals(401, $res->getStatus());\n }",
"private function _checkAuth()\n { if(!(isset($_SERVER['HTTP_X_USERNAME']) and isset($_SERVER['HTTP_X_PASSWORD']))) {\n // Error: Unauthorized\n $this->_sendResponse(401);\n }\n $username = $_SERVER['HTTP_X_USERNAME'];\n $password = $_SERVER['HTTP_X_PASSWORD'];\n // Find the user\n $user=User::model()->find('LOWER(username)=?',array(strtolower($username)));\n if($user===null) {\n // Error: Unauthorized\n $this->_sendResponse(401, 'Error: User Name is invalid');\n } else if(!$user->validatePassword($password)) {\n // Error: Unauthorized\n $this->_sendResponse(401, 'Error: User Password is invalid');\n }\n }",
"public function executeGet(){\n $data = array(\n 'method'=>'GET',\n 'message' => 'you requested this',\n 'data' => isset($_GET['data']) ? $_GET['data'] : 'You did not pass anything in the \\'data\\' url parameter.',\n );\n $this->response->setContent($data); \n }",
"abstract protected function authenticate();",
"public function testGenericGetWithoutAuthorization() {\r\n $request = array(\r\n \"uri\" => \"/sites/MLA\",\r\n \"authenticate\" => false\r\n );\r\n\r\n $response = $this->mp->get($request);\r\n\r\n $this->assertTrue($response[\"status\"] == 200);\r\n $this->assertTrue($response[\"response\"][\"id\"] == \"MLA\");\r\n }",
"public static function requireAuth()\n {\n $arrRequestData = Base_Request::getRequest();\n if ($arrRequestData['username'] == null) {\n Base_Response::sendHttpResponse(401);\n }\n }"
] | [
"0.6705701",
"0.6589451",
"0.656014",
"0.6322828",
"0.62716174",
"0.6224418",
"0.6106891",
"0.6102641",
"0.6073354",
"0.6047491",
"0.60383075",
"0.6030612",
"0.602469",
"0.6010127",
"0.5966851",
"0.589821",
"0.589821",
"0.589821",
"0.589821",
"0.5889376",
"0.5875345",
"0.5864668",
"0.58626664",
"0.58464295",
"0.58194673",
"0.58040893",
"0.58018726",
"0.5794069",
"0.5772682",
"0.57723284"
] | 0.7052821 | 0 |
Verify execute() with GET when guzzle throws an exception. | public function executeRequestException()
{
$request = new Request();
$request->setMethod(Request::METHOD_GET);
$endpoint = new Endpoint(
array(
'scheme' => 'silly', //invalid protocol
)
);
$this->adapter->execute($request, $endpoint);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testguzzle_requestThrowsExceptionWhenServerIsDown()\n\t{\n\t\t$pp = new PP('http://this.url.does.not.exist/forsure/');\n\n\t\t$pp->guzzle_request('');\n\t}",
"public function testEndpointException()\n {\n $this->getClass()->execute();\n }",
"public function testBadRequest(){\n echo \"Test BadRequest\\n\";\n $this->expectException('Http\\Client\\Exception\\RequestException');\n $this->expectExceptionMessage('Could not resolve host: '.static::$nonExistantDomain);\n $asyncClient = ApiClient::GetAPIClientAsync();\n $asyncClient->GET('https://'.static::$nonExistantDomain);\n // will never reach this line\n }",
"public function testDispatchRequestException(): void\n {\n $testClass = new HttpClient('GET', 'wrong.server.net', [\n 'username' => 'username',\n 'password' => 'qwerasdfzxcvtyuighjkbnmop'\n ]);\n $this->expectException(RuntimeException::class);\n $testClass->dispatchRequest('fake_event', []);\n }",
"public function testBadRequestSync(){\n echo \"Test BadRequestSync\\n\";\n $this->expectException('Http\\Client\\Exception\\RequestException');\n $this->expectExceptionMessage('Could not resolve host: '.static::$nonExistantDomain);\n $syncClient = ApiClient::GetAPIClientSync();\n $syncClient->GET('https://'.static::$nonExistantDomain);\n // will never reach this line\n }",
"public function testCallError()\n {\n $req = new GetThingReq();\n $req->setId(0);\n try {\n $this->client->call($req, 'GetThing', [], [\n 'response_null' => true,\n 'response_code' => 9,\n 'response_details' => 'foo',\n ]);\n } catch (Error $e) {\n $this->assertEquals(new Config([\n 'hostname' => '0.0.0.0:9000',\n ]), $e->getConfig());\n $this->assertEquals('foo', $e->getDetails());\n $this->assertEquals(9, $e->getStatusCode());\n $this->assertNull($e->getTrailer());\n }\n }",
"public function testBadHttpResponsesCanBeExamined()\n {\n $mockHttpClient = new MockHttpClient();\n $mockHttpClient->addResponse(new Response(404));\n $heroku = new HerokuClient(['httpClient' => $mockHttpClient]);\n\n // Attempt an API call.\n try {\n $heroku->get('some/path');\n } catch (BadHttpStatusException $exception) {\n // Allow execution to continue.\n }\n\n // Assert that we can read the expected status code from the response.\n $this->assertEquals(\n 404,\n $heroku->getLastHttpResponse()->getStatusCode()\n );\n }",
"public function testNonExistentServerThrowsException()\n {\n $this->setExpectedException('Phpoaipmh\\Http\\RequestException');\n $obj = new Curl();\n $res = $obj->request('http://doesnotexist.blargasdf');\n }",
"public function test_endpoint_is_returning_error_when_no_result_was_found()\n {\n $this->assertTrue(true);\n }",
"public function testInvalidGetRequest()\n {\n $response = $this->callGet('/api/teams/-1', [], 'user');\n\n // check status code\n $this->assertEquals(404, $response->getStatusCode(), 'it has the correct status code');\n }",
"public function testDispatchResponseException(): void\n {\n $this->expectException(RuntimeException::class);\n self::$testClass->dispatchRequest('bad/request', []);\n }",
"public function testAllWithInvalidResponse() {\n\t\t$response = [];\n\n\t\t$api = $this->getApiMock();\n\t\t$api->expects( $this->once() )\n\t\t\t->method( 'get' )\n\t\t\t->with( '/invoices' )\n\t\t\t->will( $this->returnValue( $response ) );\n\n\t\t$this->expectException( \\Required\\Harvest\\Exception\\RuntimeException::class );\n\t\t$api->all();\n\t}",
"public function executeGet()\n {\n $guzzleResponse = $this->getValidResponse();\n $plugin = new MockPlugin();\n $plugin->addResponse($guzzleResponse);\n $this->adapter->getGuzzleClient()->addSubscriber($plugin);\n\n $request = new Request();\n $request->setMethod(Request::METHOD_GET);\n $request->addHeader('X-PHPUnit: request value');\n\n $endpoint = new Endpoint();\n $endpoint->setTimeout(10);\n\n $response = $this->adapter->execute($request, $endpoint);\n $this->assertSame('OK', $response->getStatusMessage());\n $this->assertSame(200, $response->getStatusCode());\n $this->assertSame(\n array(\n 'HTTP/1.1 200 OK',\n 'Content-Type: application/json',\n 'X-PHPUnit: response value',\n ),\n $response->getHeaders()\n );\n $this->assertSame($guzzleResponse->getBody(true), $response->getBody());\n\n $receivedRequests = $plugin->getReceivedRequests();\n\n $this->assertCount(1, $receivedRequests);\n\n $this->assertSame('GET', $receivedRequests[0]->getMethod());\n $this->assertSame(\n 'request value',\n (string)$receivedRequests[0]->getHeader('X-PHPUnit')\n );\n }",
"public function testCatchRequestException()\n {\n $mockDataService = $this->getMockBuilder('\\ActiveCollab\\Quickbooks\\DataService')\n ->setConstructorArgs($this->getTestArguments())\n ->setMethods([ 'createServer', 'createHttpClient' ])\n ->getMock();\n\n $mockDataService->expects($this->once())\n ->method('createServer')\n ->will($this->returnValue($mockServer = $this->getMock('stdClass', [ 'getHeaders' ])));\n\n $mockServer->expects($this->once())\n ->method('getHeaders')\n ->will($this->returnValue($this->getMockAuthorizationHeaders()));\n\n $mockDataService->expects($this->once())\n ->method('createHttpClient')\n ->will($this->returnValue($mockClient = $this->getMock('stdClass', [ 'createRequest' ])));\n\n $mockClient->expects($this->once())\n ->method('createRequest')\n ->with('GET', 'http://www.example.com', $this->getTestHeaders(), null)\n ->will($this->returnValue($request = $this->getMock('stdClass', [ 'send' ])));\n\n $request->expects($this->once())\n ->method('send')\n ->will($this->returnValue($response = $this->getMock('stdClass', [ 'json' ])));\n\n $httpResponseException = new \\Guzzle\\Http\\Exception\\BadResponseException();\n $httpResponseException->setResponse(new \\Guzzle\\Http\\Message\\Response(500));\n\n $response->expects($this->once())->method('json')->will($this->throwException($httpResponseException));\n\n $mockDataService->request('GET', 'http://www.example.com');\n }",
"public function testHandleFailure()\n {\n $this->expectException(ClientExceptionInterface::class);\n\n $client = new HttpClient([\n 'handler' => HandlerStack::create(\n new MockHandler([new ConnectException('Could not connect to service', new Request('GET', ''))])\n )\n ]);\n\n $getReport = new GetReport();\n $getReport->reportId = '';\n\n $handler = new GetReportHandler(\n new Config(['user' => 'user', 'password' => 'pass']),\n new RequestHandler($client),\n new HttpFactory()\n );\n $handler->handle($getReport);\n }",
"public function testFetchError() {\n $this->mockHandler->append(new RequestException('', new Request(200, 'http://google.com')));\n $this->fetcher->fetch($this->feed->reveal(), new State());\n }",
"public function testExceptionThrown()\n {\n $response = $this->request->send();\n $this->assertInstanceOf(ErrorResponse::class, $response);\n $this->assertEquals(false, $response->isSuccessful());\n $this->assertEquals('The access token you\\'ve used is not a valid sandbox API access token', $response->getMessage());\n }",
"public function testguzzle_requestThrowsExceptionOnUnknownCurlProblem()\n\t{\n\t\t$pp = new PP('this@not$$$URL');\n\n\t\t$pp->guzzle_request('');\n\t}",
"public function testCacheException()\n {\n $cachedRequest = $this->getTemporaryFileCachedRemoteGetRequest();\n\n $this->expectException(FailedToGetCachedResponse::class);\n\n $cachedRequest->get('http://example.com');\n }",
"private function checkRequestStatus()\n {\n $statusCode = $this->client->getResponse()->getStatus();\n\n if ($statusCode !== self::HTTP_STATUS_CODE_OK) {\n throw new Exception('Endpoint: '.$this->config['endPoint'].' is not reachable or gives error. Returns status code: '.$statusCode);\n }\n }",
"public function testBadCommunicatorRequest(){\n echo \"Test BadCommunicatorRequest\\n\";\n $this->expectException('Http\\Client\\Exception\\RequestException');\n $this->expectExceptionMessage('Could not resolve host: '.static::$nonExistantDomain);\n $asyncClient = \\Simnang\\LoanPro\\Communicator\\Communicator::GetCommunicator();\n\n $reflectionClass = new ReflectionClass('\\Simnang\\LoanPro\\Communicator\\Communicator');\n $reflectionProperty = $reflectionClass->getProperty('baseUrl');\n $reflectionProperty->setAccessible(true);\n $reflectionProperty->setValue($asyncClient, 'https://'.static::$nonExistantDomain);\n\n $asyncClient->getLoan(static::$loanId);\n // will never reach this line\n }",
"public function testNonExistentPathException()\n {\n $this->expectException(ResponseException::class);\n static::$reJsonClient->jsonStringLength(Keys::DEFAULT_KEY, '.nonexistent');\n }",
"public function testClientIsDumb(){\n $response = $this->call('GET','/full/bars/1'); \n $response->assertStatus(400);\n }",
"public function testNonExistentKeyReturnsException()\n {\n $this->expectException(ResponseException::class);\n static::$reJsonClient->jsonStringLength('nonexistent');\n }",
"public function testErrorRequest()\n {\n // Get Client with already defined response in queue for test this response\n $client = $this->getClientWithResponse($this->getErrorResponse());\n\n $this->assertIsBool($client->sendRequest('suggestions', 'GET'));\n }",
"public function testSendWithWrongServerError(): void\n {\n $this->expectException(HttpRequestException::class);\n $this->expectExceptionCode(501);\n\n $client = new ApiClientMock('foo', 'bar', [\n new Response(501, [], 'Server error'),\n ]);\n\n $client->send(new SmsPilotMessage);\n }",
"public function testAuthResponseCode()\n {\n\n $response = $this->call( 'GET', '/' );\n\n $this->assertEquals( 403, $response->status() );\n\n }",
"public function testError()\n {\n if ($this->checkVersion('5.3', '<')) {\n $this->markTestSkipped(\n 'Catching exceptions is not possible on Laravel 5.1'\n );\n }\n\n $crawler = $this->call(\n 'POST',\n 'api/error',\n [],\n [],\n [],\n [\n 'HTTP_ORIGIN' => 'localhost',\n 'HTTP_ACCESS_CONTROL_REQUEST_METHOD' => 'POST',\n ]\n );\n\n $this->assertEquals(\n 'localhost',\n $crawler->headers->get('Access-Control-Allow-Origin')\n );\n $this->assertEquals(500, $crawler->getStatusCode());\n }",
"public function testNoFallbackOnClientError() {\n\n $opts = [\n 'key' => 'fake.key:veryFake',\n 'httpClass' => 'tests\\HttpMockInitTestTimeout',\n ];\n\n $ably = new AblyRest( $opts );\n $ably->http->httpErrorCode = 401;\n $ably->http->errorCode = 40101; // auth error\n\n try {\n $ably->time(); // make a request\n $this->fail('Expected the request to fail');\n } catch(AblyRequestException $e) {\n $this->assertCount(1, $ably->http->visitedHosts);\n $this->assertEquals( [ 'rest.ably.io' ], $ably->http->visitedHosts, 'Expected to have tried only the default host' );\n }\n }",
"public function testShouldThrowInvalidRequest()\n {\n $this->expectException(\\FedaPay\\Error\\InvalidRequest::class);\n $this->expectExceptionMessage(\n 'Could not determine which URL to request: Tests\\Fixtures\\Foo instance has invalid ID: '\n );\n Fixtures\\Foo::resourcePath(null);\n }"
] | [
"0.67579067",
"0.67420065",
"0.67285645",
"0.67035913",
"0.6655841",
"0.655428",
"0.6548051",
"0.6448216",
"0.6439312",
"0.6315888",
"0.63140714",
"0.63038576",
"0.62949234",
"0.6233795",
"0.6225234",
"0.6209372",
"0.6192292",
"0.61858594",
"0.60759324",
"0.6071666",
"0.60616",
"0.6057993",
"0.6055622",
"0.60551614",
"0.60520136",
"0.60431886",
"0.6037709",
"0.60102993",
"0.59693766",
"0.5966923"
] | 0.75017434 | 0 |
Helper method to create a valid Guzzle response. | private function getValidResponse()
{
$body = json_encode(
array(
'response' => array(
'numFound' => 10,
'start' => 0,
'docs' => array(
array(
'id' => '58339e95d5200',
'author' => 'Gambardella, Matthew',
'title' => "XML Developer's Guide",
'genre' => 'Computer',
'price' => 44.95,
'published' => 970372800,
'description' => 'An in-depth look at creating applications with XML.',
),
),
),
)
);
$headers = array('Content-Type' => 'application/json', 'X-PHPUnit' => 'response value');
return new Response(200, $headers, $body);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function buildResponse()\n {\n $response = new Response();\n $headers = $this->getMock('Symfony\\Component\\HttpFoundation\\HeaderBag');\n $response->headers = $headers;\n\n return $response;\n }",
"function createResponse()\r\n\t{\r\n\t\t$response = new Art_Model_JSONRPC_Response;\r\n\t\t$response->setId($this->getId());\r\n\t\t\r\n\t\tif( !$this->isValid() )\r\n\t\t{\r\n\t\t\t$response->setError($this->_error_code);\r\n\t\t}\r\n\r\n\t\treturn $response;\r\n\t}",
"public function build() {\n $result = new \\Illuminate\\Http\\Response($this->response->jsonSerialize(), $this->status);\n return $result->withHeaders($this->headers);\n }",
"public function response() {\n $this->jsonApiGenerator->reset();\n $this->jsonApiGenerator->setEntities($this->getEntities());\n $this->jsonApiGenerator->setLinks($this->getLinks());\n $this->jsonApiGenerator->setMetadata($this->getMetadata());\n $this->jsonApiGenerator->setIncludes($this->getIncludes());\n\n // Build a return the response.\n $response = new ResourceResponse(\n $this->jsonApiGenerator->generate(FALSE),\n 200,\n $this->getHeaders()\n );\n\n // Add the response cacheability.\n $response->addCacheableDependency(\n $this->jsonApiGenerator\n );\n $response->addCacheableDependency((new CacheableMetadata())\n ->addCacheContexts($this->getCacheContexts())\n ->addCacheTags($this->getCacheTags()));\n\n return $response;\n }",
"protected function prepareResponse()\n {\n return new Response(null, Response::STATUS_OK, 'text/html;charset=UTF8');\n }",
"protected function createResponse($response)\n {\n return new Response($response);\n }",
"private function getMockResponseAsInvalidObject()\n {\n $response = $this->getBaseMockResponse();\n\n $apiRawResponse = <<<'JSON'\n{\n \"data\": {\n \"global_hash\": \"900913\",\n \"hash\": \"ze6poY\",\n \"long_url\": \"http://www.google.com/\",\n \"new_hash\": 0,\n \"url\": \"http://bit.ly/ze6poY\"\n }\n}\nJSON;\n\n $stream = $this->getBaseMockStream();\n $stream\n ->expects($this->once())\n ->method('getContents')\n ->will($this->returnValue($apiRawResponse));\n\n $response\n ->expects($this->once())\n ->method('getBody')\n ->will($this->returnValue($stream));\n\n return $response;\n }",
"private function createResponse(){\n $request = $this->serviceContainer['request'];\n $rawResponse = $this->serviceContainer['databasehelper']->getResponse($request->requestMethod, $request->requestBody,$request->requestParam);\n\n $this->response = $this->serviceContainer['response']->getResponse($rawResponse, $this->serviceContainer['request']->requestMethod);\n\n }",
"private function getMockResponseWithInvalidStatusCode()\n {\n $response = $this->getBaseMockResponse();\n\n $apiRawResponse = <<<'JSON'\n{\n \"data\": {\n \"global_hash\": \"900913\",\n \"hash\": \"ze6poY\",\n \"long_url\": \"http://www.google.com/\",\n \"new_hash\": 0,\n \"url\": \"http://bit.ly/ze6poY\"\n },\n \"status_code\": 500,\n \"status_txt\": \"KO\"\n}\nJSON;\n\n $stream = $this->getBaseMockStream();\n $stream\n ->expects($this->once())\n ->method('getContents')\n ->will($this->returnValue($apiRawResponse));\n\n $response\n ->expects($this->once())\n ->method('getBody')\n ->will($this->returnValue($stream));\n\n return $response;\n }",
"protected function createResponse(): Response\n {\n if (headers_sent()) {\n $this->cleanup();\n\n return new DummyResponse();\n }\n\n $yiiResponse = Yii::$app ? Yii::$app->get('response') : null;\n\n $this->cleanup();\n\n if ($yiiResponse instanceof \\Yii2tech\\Illuminate\\Yii\\Web\\Response) {\n return $yiiResponse->getIlluminateResponse(true);\n }\n\n return new DummyResponse();\n }",
"public function newResponse()\n {\n return new Response();\n }",
"function responseBuilder($customStatus,$message,$details){\n $response = Array();\n $response[\"status\"] = $customStatus;\n $response[\"message\"] = $message;\n $response[\"details\"] = $details;\n return $response;\n}",
"public function getNewResponse()\n {\n return new Response();\n }",
"public static function make(){\n return new ApiResponse();\n }",
"public function toApi()\n {\n $response = $this->getResponse();\n\n if (isset($response['error'])) {\n return $this->getErrorReponse($response);\n }\n\n return $response;\n }",
"protected function constructResponse() {\n\t\tglobal $response;\n\n\t\t$response->returnJSON = 1;\n\t\t\n\t\tif ($this->hasErrors) {\n\t\t\t$response->status = 'error';\n\t\t\tif ( isset($this->config['onError']) ) {\n\t\t\t\t$response->action = $this->config['onError'];\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$response->status = 'success';\n\t\t\tif ( isset($this->config['onSuccess']) ) {\n\t\t\t\t$response->action = $this->config['onSuccess'];\t\n\t\t\t}\n\t\t}\n\t}",
"function response(\n $status = 200,\n array $headers = [],\n $body = null,\n $version = '1.1',\n $reason = null\n ) {\n return new Response($status, $headers, $body, $version, $reason);\n }",
"protected function createResponse201() {\n return $this->generateResponse('Created', Response::HTTP_CREATED);\n }",
"protected function newResponse() {\n return new Response;\n\t}",
"public function createJsonResponse(): Response\n {\n return new Response($this->json, Response::HTTP_OK, array('Content-Type', 'application/json'));\n }",
"abstract protected function buildResponse(array $args);",
"public function newResponse(): Response\n {\n return $this->di()->newResponse();\n }",
"protected function respond()\n {\n $data = $this->getSerializer()->serialize($this->data, $this->format, $this->getSerializationContext());\n\n $response = new Response($data, $this->statusCode);\n\n if (array_key_exists($this->format, self::$contentTypes)) {\n $response->headers->set('Content-Type', self::$contentTypes[$this->format]);\n }\n\n return $response;\n }",
"public function newResponse()\n {\n return new \\Jaxon\\Response\\Response();\n }",
"private function makeResponse($data)\n {\n // Create response\n $response = \\Response::make($data, 200);\n\n // Set headers\n $response->header('Access-Control-Allow-Origin', '*');\n $response->header('Content-Type', 'application/json;charset=UTF-8');\n\n return $response;\n }",
"protected function createResponseMock()\n {\n return $this->getMock('Ivory\\HttpAdapter\\Message\\ResponseInterface');\n }",
"protected function createResponse($data)\n {\n return $this->response = new Response($this, $data);\n }",
"abstract protected function makeResponse(int $code, array $data): ResponseContract;",
"protected function createResponse($array, $status = Response::HTTP_OK) {\n return $this->generateResponse($array, $status);\n }",
"public static function unprocessableEntityResponse()\n {\n $response['status_code_header'] = 'HTTP/1.1 400 Bad Request';\n $response['body'] = json_encode([\n 'error' => 'Attributs invalides.'\n ]);\n return $response;\n }"
] | [
"0.6989032",
"0.6669791",
"0.65886194",
"0.6321106",
"0.63174164",
"0.6227291",
"0.6194803",
"0.61425865",
"0.6140444",
"0.6130809",
"0.6110306",
"0.6110125",
"0.6096173",
"0.59986305",
"0.59908056",
"0.5975396",
"0.5971345",
"0.59593606",
"0.5956249",
"0.5955153",
"0.5942541",
"0.5941143",
"0.5918356",
"0.5903556",
"0.5892393",
"0.5884675",
"0.58815056",
"0.5867348",
"0.58643",
"0.5828882"
] | 0.7180934 | 0 |
Create and return a new Gateway instance. | public function connect()
{
$gateway = new Gateway($this->id, $this->token, $this->environment);
if (isset($this->params['avs'])) {
$gateway->avs = boolval($this->params['avs']);
}
if (isset($this->params['cvd'])) {
$gateway->cvd = boolval($this->params['cvd']);
}
if (isset($this->params['cof'])) {
$gateway->cof = boolval($this->params['cof']);
}
return $gateway;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function oGateway(){\n\t\t$gateway = GatewayFactory::create($this->Gateway, self::$httpclient, self::$httprequest);\n\t\t$parameters = Config::inst()->forClass('Payment')->parameters;\n\t\tif(isset($parameters[$this->Gateway])) {\n\t\t\t$gateway->initialize($parameters[$this->Gateway]);\n\t\t}\n\n\t\treturn $gateway;\n\t}",
"public static function getFactory()\n {\n if (is_null(static::$factory)) {\n static::$factory = new GatewayFactory;\n }\n\n return static::$factory;\n }",
"static public function create(array $params)\n\t{\n\t\tif (! isset($params['api_key'])) throw new Moneris_Exception(\"'api_key' is required.\");\n\t\tif (! isset($params['store_id'])) throw new Moneris_Exception(\"'store_id' is required.\");\n\n\t\t$params['environment'] = isset($params['environment']) ? $params['environment'] : self::ENV_LIVE;\n\n\t\t$gateway = new Moneris_Gateway($params['api_key'], $params['store_id'], $params['environment']);\n\n\t\tif (isset($params['require_cvd']))\n\t\t\t$gateway->require_cvd((bool) $params['require_cvd']);\n\n\t\tif (isset($params['cvd_codes']))\n\t\t\t$gateway->successful_cvd_codes($params['cvd_codes']);\n\n\t\tif (isset($params['require_avs']))\n\t\t\t$gateway->require_avs((bool) $params['require_avs']);\n\n\t\tif (isset($params['avs_codes']))\n\t\t\t$gateway->successful_avs_codes($params['avs_codes']);\n\n\t\treturn $gateway;\n\t}",
"protected function createGateway($name)\n {\n if (isset($this->customCreators[$name])) {\n $gateway = $this->callCustomCreator($name);\n } else {\n $className = $this->formatGatewayClassName($name);\n $gateway = $this->makeGateway($className, $this->config);\n }\n if (!($gateway instanceof GatewayInterface)) {\n throw new InvalidArgumentException(\\sprintf('Gateway \"%s\" must implement interface %s.', $name, GatewayInterface::class));\n }\n return $gateway;\n }",
"public function getGateway() {\n if (null === $this->_gateway) {\n $class = 'Engine_Payment_Gateway_2Checkout';\n Engine_Loader::loadClass($class);\n $gateway = new $class(array(\n 'config' => (array) $this->_gatewayInfo->config,\n 'testMode' => $this->_gatewayInfo->test_mode,\n 'currency' => Engine_Api::_()->sesblogpackage()->getCurrentCurrency(),\n ));\n if (!($gateway instanceof Engine_Payment_Gateway)) {\n throw new Engine_Exception('Plugin class not instance of Engine_Payment_Gateway');\n }\n $this->_gateway = $gateway;\n }\n\n return $this->_gateway;\n }",
"public function getGateway()\r\n {\r\n if (null === $this->_gateway) {\r\n $class = 'Experts_Payment_Gateway_2Checkout';\r\n Engine_Loader::loadClass($class);\r\n $gateway = new $class(array(\r\n 'config' => (array)$this->_gatewayInfo->config,\r\n 'testMode' => $this->_gatewayInfo->test_mode,\r\n 'currency' => Engine_Api::_()->getDbTable('settings', 'core')->getSetting('payment.currency', 'USD'),\r\n ));\r\n if (!($gateway instanceof Experts_Payment_Gateway)) {\r\n throw new Engine_Exception('Plugin class not instance of Engine_Payment_Gateway');\r\n }\r\n $this->_gateway = $gateway;\r\n }\r\n\r\n return $this->_gateway;\r\n }",
"public static function create() {\r\n $instance = new self();\r\n return $instance;\r\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }",
"public static function create()\n {\n return new self();\n }"
] | [
"0.7596864",
"0.66553164",
"0.6523961",
"0.64955306",
"0.6207606",
"0.6068193",
"0.6038632",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149",
"0.6037149"
] | 0.7351112 | 1 |
Asynchronously starts a feed generation for each store | public function generateFeedsForAllStores() {
$tmppath = sys_get_temp_dir();
$tmpfile = tempnam($tmppath, 'hawkfeed_');
$parts = explode(DIRECTORY_SEPARATOR, __FILE__);
array_pop($parts);
$parts[] = 'runfeed.php';
$runfile = implode(DIRECTORY_SEPARATOR, $parts);
$root = getcwd();
$f = fopen($tmpfile, 'w');
fwrite($f, '#!/bin/sh' . "\n");
$phpbin = PHP_BINDIR . DIRECTORY_SEPARATOR . "php";
fwrite($f, "$phpbin $runfile -r $root -t $tmpfile\n");
// to debug, change '/dev/null' to some file path writable by the webserver
shell_exec("/bin/sh $tmpfile > /dev/null 2>&1 &");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function run()\n {\n Supplier::flushEventListeners();\n Product::flushEventListeners();\n Purchase::flushEventListeners();\n\n // Generate Suppliers\n factory(Supplier::class, $this->nSuppliers)\n ->create()\n ->each(function ($s) {\n // Generate Products For Suppliers\n $this->generateProducts($s, $this->nProducts);\n\n // Generate Purchases For Suppliers\n $this->generatePurchases($s, $this->nPurchases);\n\n // Generate Purchases Items For Suppliers\n $this->generatePurchaseItems($s, $this->nPurchaseItems);\n });\n }",
"public function start()\n {\n foreach ($this->collectors as $collector) {\n // Get data from storage\n $this->storage->load($collector);\n // Start collect data\n\n $collector->start();\n }\n }",
"public function run()\n {\n\n $stores = \\App\\Store::all();\n foreach ($stores as $store)\n {\n factory(App\\Product::class, 3)\n ->create(['store_id' => $store->id])\n ->each(function ($u) {\n $u->detail()->save(factory(App\\ProductDetail::class)->make());\n })\n ->each(function ($u) {\n $u->productImages()->saveMany(factory(App\\ProductImage::class,2)->make());\n })\n ;\n\n }\n\n $this->command->info('Products Seeded!');\n }",
"public function run()\n {\n Customer::flushEventListeners();\n Sale::flushEventListeners();\n\n // Generate Customers\n factory(Customer::class, $this->nCustomers)\n ->create()\n ->each(function ($c) {\n // Generate Sales For Customers\n $this->generateSales($c, $this->nSales);\n\n // Generate Sales Items For Customers\n $this->generateSaleItems($c, $this->nSaleItems);\n });\n }",
"public function run()\n {\n \tfor($i = 1; $i<=200; $i++){\n \t\tfactory('App\\Item')->create();\n \t\t$item = \\DB::table('items')->select('id','status')->orderBy('id','desc')->first();\n \t\tevent(new ItemCreate($item->status, 2 ,$item->id));\n \t}\t\n }",
"public function run()\n {\n $cate = \\App\\Category::all()->pluck('id')->toArray();\n\n\n for($i = 0; $i < 100; $i++) {\n factory(\\App\\Book::class)->create([\n 'img' => 'public/img/bookSeedImg'.$i.'.jpg',\n 'img_name' => 'bookSeedImg'.$i.'.jpg',\n ])->each(function ($b) use ($cate) {\n $b->categories()->sync(array_intersect_key( $cate, array_flip( array_rand( $cate, 3 ) ) ));\n });\n }\n }",
"public function run()\n {\n $tracks = App\\Track::all();\n $collections = App\\Artist::all();\n\n $collections->each(function($collection) use ($tracks) {\n DB::table('collection_tracks')->insert([\n 'collectionID' => $collection['id'],\n 'trackID' => $tracks->random(1)->pluck('id')[0] //TODO: Not this.\n ]);\n });\n $tracks->each(function($track) use ($collections) {\n DB::table('collection_tracks')->insert([\n 'collectionID' => $collections->random(1)->pluck('id')[0],\n 'trackID' => $track['id']\n ]);\n });\n for ($i = 0; $i < 30; $i++) {\n DB::table('collection_tracks')->insert([\n 'collectionID' => $collections->random(1)->pluck('id')[0],\n 'trackID' => $tracks->random(1)->pluck('id')[0]\n ]);\n }\n }",
"public function run()\n {\n for ($i = 0; $i < 100; $i++){\n $link = factory(App\\Link::class)->make()->toArray();\n $link['user_id'] = \\App\\User::find(rand(1,9))->id;\n \\App\\Link::create($link)->save();\n $link = [];\n }\n }",
"public function run()\n {\n for ($i=0; $i < 10; $i++) {\n factory(App\\Category::class)->create()->each(function ($u) {\n for ($x=0; $x < 5; $x++) {\n factory(App\\Song::class)->create(['category_id'=> $u->id]);\n }\n });;\n }\n }",
"public function run()\n {\n factory(App\\Client::class, 50)->create()->each(function ($client) {\n $municipalityIds = App\\Municipality::inRandomOrder()->limit(5)->get()->pluck('id');\n $client->municipalities()->sync($municipalityIds);\n });\n\n $campaigns = App\\Campaign::all();\n $campaigns->each(function ($campaign) {\n $clientIds = App\\Client::inRandomOrder()->limit(5)->get()->pluck('id');\n $campaign->clients()->sync($clientIds);\n $municipalityIds = App\\Municipality::inRandomOrder()->limit(5)->get()->pluck('id');\n $campaign->municipalities()->sync($municipalityIds);\n });\n }",
"public function run()\n {\n $faker = app(Faker\\Generator::class);\n $user_ids = ['1', '2', '3'];\n $feeds = factory(Feed::class)->times(100)->make()->each(function($feed) use($faker, $user_ids) {\n $feed->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Models\\Feed::insert($feeds->toArray());\n }",
"public function run()\n\t{\n\t\tforeach ( $this->data as $source ) {\n\t\t\tTask::create($source);\n\t }\n\t}",
"public function run()\n\t{\n\t\tfor ($i=0; $i < 100; $i++) {\n\t\t\t$provider = App\\Provider::find(App\\Provider::all()->random()->id);\n\t\t\t$customer = App\\Customer::find(App\\Customer::all()->random()->id);\n\t\t\t$interaction = App\\Interaction::find(App\\Interaction::all()->random()->id);\n\n\t\t\t$provider->customers()->save($customer, ['interaction_type' => $interaction->id]);\n\t\t}\n\t}",
"public function run()\n {\n factory(User::class, 5)->create()->each(function (User $user) {\n $userSavings = factory(Saving::class, 3)->make();\n $userCategories = factory(Category::class, 10)->make();\n\n $userCategories = $user->categories()->createMany($userCategories->toArray());\n $user->userSavings()->createMany($userSavings->toArray())->each(function (Saving $saving) use ($userCategories) {\n $transactions = new Collection();\n for ($i = 0; $i < 200; $i++) {\n $transactions->push(factory(Transaction::class)->make([\n 'category_id' => $userCategories->random()->id,\n ]));\n }\n $saving->transactions()->createMany($transactions->toArray());\n });\n });\n }",
"public function run()\n {\n $groups = [\n 'Events',\n 'Flowers',\n 'Eternity Collection',\n 'Gift',\n 'Wedding Flowers',\n ];\n\n $categories = Category::all();\n\n foreach ($groups as $g) {\n $ng = NavigationGroup::create([\n 'name' => $g\n ]);\n\n $randomCategories = $categories->where('parent_id', null)\n ->random(random_int(1, 5))\n ->pluck('id')\n ->toArray();\n\n $ng->categories()->sync($randomCategories);\n }\n }",
"public function run()\n {\n $users = User::all();\n $contacts = Contact::all();\n\n $users->each(function ($user) use ($contacts) {\n $prayerTree = factory(\\App\\PrayerTree::class)->create([\n 'user_id' => $user->id\n ]);\n\n $prayerTree->subscribers()->attach(\n $contacts->random(20)\n );\n });\n }",
"public function run()\n {\n factory(\\App\\Activity::class, 100)->create()->each(function ($staff) {\n factory(\\App\\Lead::class)->create()->activities()->save($staff);\n });\n\n factory(\\App\\Activity::class, 100)->create()->each(function ($staff) {\n factory(\\App\\Application::class)->create()->activities()->save($staff);\n });\n\n factory(\\App\\Activity::class, 100)->create()->each(function ($staff) {\n factory(\\App\\Lender::class)->create()->activities()->save($staff);\n });\n }",
"public function run()\n {\n\n factory(Account::class)->create()->each(function ($account) {\n factory(Tweet::class, 5)->make(['account_id' => $account->id])->each(\n function ($tweet) use ($account) {\n factory(Timeline::class)->make([\n 'tweet_id' => $tweet->id,\n 'account_id' => $account->id\n ]);\n }\n );\n });\n\n factory(Account::class)->states('account2')->create()->each(function ($account) {\n factory(Tweet::class, 5)->create(['account_id' => $account->id])->each(\n function ($tweet) use ($account) {\n factory(Timeline::class)->create([\n 'tweet_id' => $tweet->id,\n 'account_id' => $account->id\n ]);\n }\n );\n });\n }",
"public function run()\n {\n factory(Supplier::class, 100)->create()->each(function ($supplier) {\n $supplier->save();\n });\n }",
"public function run()\n {\n $statuses = factory(\\App\\Models\\Article::class)->times(10000)->make()->each(function ($user){\n\n });\n\n \\App\\Models\\Article::insert($statuses->toArray());\n }",
"public function run()\n {\n $stores = [\"Store 1\", \"Store 2\", \"Store 3\", \"Store 4\"];\n foreach ($stores as $store) {\n \\App\\Models\\Store::create([\n 'name' =>$store\n ]);\n }\n }",
"public function run()\n {\n // Create 80 News\n for ($i = 0; $i < 80; $i++) {\n $this->call(NewsSeeder::class);\n }\n\n }",
"public function run()\n {\n Model::unguard();\n for ($i = 0; $i < 100; $i++) {\n $merchant = factory(Merchant::class)->create();\n factory(User::class)->create([\n 'profile_id' => $merchant->id,\n 'profile_type' => Merchant::class,\n ]);\n }\n }",
"public function run()\n {\n // create 10 links\n factory(\\App\\Link::class, 10)->create()->each(function($link) {\n if(rand(0,1) == 1)\n {\n $link->statistics()->save(factory(\\App\\Statistic::class)->create());\n }\n });\n }",
"public function run()\n {\n factory(Album::class, 12)->create()->each(function ($a) {\n $a->gallery()->save(factory(Gallery::class)->create());\n });\n }",
"public function run()\n {\n Driver::factory(10)->create()->each(function ($driver) {\n $driver->bookings()->saveMany(Booking::factory(10)->create());\n });\n }",
"public function run()\n {\n $brokers = Broker::factory(4)->create();\n foreach ($brokers as $broker) {\n Agent::factory(rand(2, 4))->create(['broker_id' => $broker->id]);\n }\n foreach (Agent::all() as $agent) {\n Estate::factory(rand(6, 12))->create(['agent_id' => $agent->id]);\n Client::factory(rand(3, 9))->create(['agent_id' => $agent->id]);\n }\n }",
"public function run()\n {\n for ($i = 0; $i < 10; $i++) {\n $author = Author::factory()->create();\n\n for ($j = 0; $j < 100; $j++) {\n Book::factory()->create([\n 'author_id' => $author->id,\n ]);\n }\n }\n }",
"public function run()\n {\n Feed::create([\n 'category_id' => '1',\n 'url' => 'http://fullcontentrss.com/feed.php?url=https%3A%2F%2Fwww.techmeme.com%2Ffeed.xml&key=2&hash=345e3f27959f5d58e092203b511129531b664551&max=5&links=preserve'\n ]);\n\n Feed::create([\n 'category_id' => '1',\n 'url' => 'http://fullcontentrss.com/feed.php?url=https%3A%2F%2Ffeeds.feedburner.com%2FTechCrunch%3Fformat%3Dxml&key=2&hash=dc332a6b03eeca9cb615df08a5c30f23159b0548&max=10&links=preserve'\n ]);\n\n Feed::create([\n 'category_id' => '1',\n 'url' => 'http://fullcontentrss.com/feed.php?url=https%3A%2F%2Fwww.techmeme.com%2Ffeed.xml&key=2&hash=345e3f27959f5d58e092203b511129531b664551&max=10&links=preserve'\n ]);\n Feed::create([\n 'category_id' => '1',\n 'url' => 'http://fullcontentrss.com/feed.php?url=https%3A%2F%2Fwww.theverge.com%2Frss%2Ffrontpage&key=2&hash=956bc07abbbfa36624d97d03a0c6b944d8cc9528&max=10&links=preserve'\n ]);\n }",
"public function run()\n {\n factory(App\\gallery::class, 10)->create()->each(function($gallery){\n $gallery->save();\n });\n }"
] | [
"0.6303815",
"0.6142838",
"0.61347204",
"0.6106402",
"0.60006505",
"0.5883257",
"0.5880568",
"0.58659524",
"0.5839124",
"0.58358556",
"0.58056986",
"0.5762576",
"0.57458013",
"0.5739923",
"0.57326645",
"0.57316935",
"0.56898856",
"0.5687169",
"0.5685965",
"0.56821734",
"0.56691253",
"0.5664754",
"0.56608576",
"0.56575894",
"0.56509507",
"0.56439054",
"0.5640694",
"0.56368744",
"0.56321955",
"0.5619195"
] | 0.6371994 | 0 |
Returns the feed file path | public function getFeedFilePath() {
if ($this->_feedFilePath === null) {
$this->_feedFilePath = $this->makeVarPath(array('hawksearch', 'feeds'));
}
return $this->_feedFilePath;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFeedFile()\n {\n return $this->getId();\n }",
"public function getURL()\n {\n return Yii::app()->params->relative_document_dir . $this->file_name;\n }",
"function getFilePath() {\n\t\t$articleDao = &DAORegistry::getDAO('ArticleDAO');\n\t\t$article = &$articleDao->getArticle($this->getArticleId());\n\t\t$journalId = $article->getJournalId();\n\n\t\treturn Config::getVar('files', 'files_dir') . '/journals/' . $journalId .\n\t\t'/articles/' . $this->getArticleId() . '/' . $this->getType() . '/' . $this->getFileName();\n\t}",
"function getFilePath() {\n\t\t$articleDao =& DAORegistry::getDAO('ArticleDAO');\n\t\t$article =& $articleDao->getArticle($this->getArticleId());\n\t\t$journalId = $article->getJournalId();\n\n\t\timport('classes.file.ArticleFileManager');\n\t\t$articleFileManager = new ArticleFileManager($this->getArticleId());\n\t\treturn Config::getVar('files', 'files_dir') . '/journals/' . $journalId .\n\t\t\t'/articles/' . $this->getArticleId() . '/' . $articleFileManager->fileStageToPath($this->getFileStage()) . '/' . $this->getFileName();\n\t}",
"public function getFeedURL() {\n $url = null;\n $feedRoute = $this->feedRoute;\n if (empty($feedRoute) || $feedRoute == \"/\") {\n $url = Url::to('/rss.xml', true);\n } else {\n $url = Url::to($feedRoute . '/feed.xml', true);\n }\n return $url;\n }",
"public function path(){\n\t\treturn $this->filename;\n\t}",
"public function getFileUrl() {\n return $this->scheme . '://' . $this->url . '/' . $this->fid;\n }",
"public function getFileFullPath()\n {\n return $this->path;\n }",
"public function get_filepath() {\n $this->directory = empty($this->directory) ? DplusWire::wire('config')->documentstoragedirectory : $this->directory;\n return $this->directory.$this->name;\n }",
"static public function getFilename() {\n\t\treturn DIR_DATA . '/faq-xml.xml';\n\t}",
"public function getFilepath()\n\t{\n\t\treturn $this->filepath;\n\t}",
"public function getFilePath();",
"public function getFeedLink()\n {\n foreach($this->getParentArtworks() as $parent)\n {\n if ($parent->getId() == $this->_parentartworkid)\n {\n //return \"@show_artwork_file?id={$parent->getId()}&file={$this->getId()}&title={$parent->getTitle()}\";\n }\n }\n // Fallback to the last parent\n return \"@show_artwork_file?id={$parent->getId()}&file={$this->getId()}&title={$parent->getTitle()}\";\n }",
"protected function tempFilePath()\n {\n return stream_get_meta_data($this->tempFile)['uri'];\n }",
"public function getFilepath()\n {\n return $this->filepath;\n }",
"public function getFilepath();",
"public function path()\n {\n return $this->fileData('name');\n }",
"public function getFileWithPath()\n {\n return base_path($this->fileName);\n }",
"public function getFileBaseUrl()\n {\n return Mage::getBaseUrl('media').'worksheetdoc';\n }",
"public function getPath()\n {\n return $this->directory . $this->filename;\n }",
"public function getPreparedFilename()\n {\n return $this->getPath() . $this->getSitemapFilename();\n }",
"public function getFeedLink() {\n\t\tif (array_key_exists ( 'feedlink', $this->_data )) {\n\t\t\treturn $this->_data ['feedlink'];\n\t\t}\n\t\t\n\t\t$link = null;\n\t\t\n\t\t$link = $this->getExtension ( 'Atom' )->getFeedLink ();\n\t\t\n\t\tif ($link === null || empty ( $link )) {\n\t\t\t$link = $this->getOriginalSourceUri ();\n\t\t}\n\t\t\n\t\t$this->_data ['feedlink'] = $link;\n\t\t\n\t\treturn $this->_data ['feedlink'];\n\t}",
"protected function getXmlUrlPath() {\n $file = $this->pathwsfiles\n . \"wsnfe_\".$this->versao.\"_mod.xml\";\n \n if (! file_exists($file)) {\n return '';\n }\n\n return file_get_contents($file);\n }",
"public function getFullPath() : string\n {\n return $this->file->getFullPath();\n }",
"public function getUrl()\n {\n $attachedFileView = $this->getAttachedFileView();\n return $this->getUrlPath() . '/' . $this->getFileName($attachedFileView);\n }",
"public function getFilePath()\n {\n return $this->path;\n }",
"public function getPath()\n {\n return $this->file_path;\n }",
"public function getFeedLink() {\r\n\t\tif (array_key_exists ( 'feedlink', $this->data )) {\r\n\t\t\treturn $this->data ['feedlink'];\r\n\t\t}\r\n\t\t\r\n\t\t$link = null;\r\n\t\t\r\n\t\t$link = $this->getExtension ( 'Atom' )->getFeedLink ();\r\n\t\t\r\n\t\tif ($link === null || empty ( $link )) {\r\n\t\t\t$link = $this->getOriginalSourceUri ();\r\n\t\t}\r\n\t\t\r\n\t\t$this->data ['feedlink'] = $link;\r\n\t\t\r\n\t\treturn $this->data ['feedlink'];\r\n\t}",
"public function filePath()\n {\n return $this->baseDir. '/' . $this->fileName();\n }",
"public function getPath()\n {\n return $this->getDirectory().'/'.$this->getAttribute('file_name');\n }"
] | [
"0.75040054",
"0.71086127",
"0.6850145",
"0.67830616",
"0.6747437",
"0.67337626",
"0.66432476",
"0.663027",
"0.6620942",
"0.65899056",
"0.6583027",
"0.65819514",
"0.657466",
"0.65625006",
"0.6545256",
"0.6542806",
"0.6526589",
"0.65112776",
"0.64338416",
"0.6418114",
"0.63945085",
"0.63936883",
"0.6385533",
"0.6370122",
"0.6368845",
"0.636307",
"0.63549536",
"0.6353053",
"0.6345876",
"0.6332884"
] | 0.8638922 | 0 |
Whether or not there are feed generation locks currently in place | public function thereAreFeedLocks() {
$path = $this->getFeedFilePath();
foreach (scandir($path) as $file) {
$fullFile = $path.DS.$file;
if (is_file($fullFile) && !is_dir($fullFile) && is_numeric(strpos($file, '.lock'))) {
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isLocked(): bool\n {\n return $this->counter > 0;\n }",
"public function needsRefresh()\n {\n return (int) $this->expiresAt - time() < 1;\n }",
"public function isLocked(): bool\n\t{\n\t\treturn $this->locked_until !== null && $this->locked_until->getTimestamp() >= Time::now()->getTimestamp();\n\t}",
"public function hasBeenAccessed(): bool;",
"public function hasEatProgress(){\n return $this->_has(24);\n }",
"function hasRoomChanges(){\n\t\t\treturn count($this->sectionsThatHaveNewRooms) > 0;\t\t\t\n\t\t}",
"private function couldBeLocked()\n {\n return !$this->isLocked();\n }",
"public function isCollect()\n {\n return file_exists($this->collectLockFile);\n }",
"public function isLocked(): bool;",
"public function valid()\n {\n return $this->index < count($this->generators);\n }",
"public function hasLock()\n {\n return $this->lock ? $this->lock->isAcquired() : false;\n }",
"public function hasSnapshot()\n {\n return !is_null($this->snapshotAt);\n }",
"public function hasUnprocessedDelayedLogEntries()\n {\n return (count($this->delayedLogEntries) > 0);\n }",
"function is_locked() {\n $this->load_grade_item();\n if (!empty($this->grade_item)) {\n return $this->grade_item->is_locked();\n } else {\n return false;\n }\n }",
"public function isThereNeedToFill(): bool\n {\n return ! isset($this->fillInstance)\n || isset($this->fillInstance) && $this->fillInstance\n ;\n }",
"public function isLocked() {\n return !$this->isNew();\n }",
"public function HasNewSyncKey() {\n return (isset($this->uuid) && isset($this->uuidNewCounter));\n }",
"private function running() {\n return file_exists('analizing.lock');\n }",
"public function isLocked(): bool\n {\n return ($this->lockToken != null);\n }",
"public function isReady() {\n\t\t$this->checkAlive();\n\t\treturn ($this->countThreads() < $this->capacity);\n\t}",
"private function isUsed(): bool\n {\n\n return ($this->success\n or (($this->local_status ?? Transaction::LOCAL_STATUS_INIT) != Transaction::LOCAL_STATUS_INIT)\n or $this->cashier_id // i.e. do not reuse those created by admin, not that it matters though.\n );\n }",
"public function isLocked();",
"public function isLocked();",
"public function hasFeedUpdate()\n {\n if ($this->_feedUpdate === null) {\n return false;\n }\n return true;\n }",
"public function isInUse() {\n\t\t\n\t\t$entryCount = \\WorkplanQuery::create()\n\t\t\t\t\t\t\t->filterById($this->getId())\n\t\t\t\t\t\t\t->useDayQuery()\n\t\t\t\t\t\t\t\t->useEntryQuery()\n\t\t\t\t\t\t\t\t->endUse()\n\t\t\t\t\t\t\t->endUse()\n\t\t\t\t\t\t\t->count();\t\t\n\t\t\t\t\t\t\t\n\t\treturn $entryCount != 0 ? true : false;\n\t}",
"public function needsSyncTransaction()\n {\n if (!$this->isPending()) {\n return false;\n }\n\n // When it is pending, then has been updated at least once? or has more than 7 minutes of being updated\n if ($this->updated_at->lte($this->created_at) || now()->diffInMinutes($this->updated_at) > 7) {\n return true;\n }\n\n return false;\n }",
"public function isUsedInOperations()\n {\n return (bool) $this->operations->count();\n }",
"public function valid()\r\n {\r\n return !$this->executionQueue->isEmpty();\r\n }",
"public function isLocked() {\n $lock = $this->getLock();\n return $lock && $lock->getOwnerId() != \\Drupal::currentUser()->id();\n }",
"public function isLockable(): bool;"
] | [
"0.6710396",
"0.64718366",
"0.64236",
"0.64095557",
"0.6361338",
"0.63131785",
"0.62840736",
"0.62462693",
"0.6235677",
"0.62272274",
"0.6195009",
"0.6194931",
"0.6189879",
"0.6112998",
"0.61084014",
"0.61011434",
"0.60824996",
"0.60749847",
"0.60733515",
"0.605334",
"0.60474235",
"0.59950185",
"0.59950185",
"0.5989167",
"0.5984752",
"0.5979108",
"0.5977232",
"0.5970694",
"0.59638757",
"0.596099"
] | 0.7162695 | 0 |
load timecircles' js on the website | function timecircles_insert_head($flux){
$flux .= '<script src="'.find_in_path('js/timecircles.js').'" type="text/javascript"></script>'
.<<<EOF
<script type="text/javascript">
<!--
jQuery(document).ready(function(){
$(".DateCountdown").TimeCircles();
$(".CountDownTimer").TimeCircles({ time: { Days: { show: false }, Hours: { show: false } }});
$(".PageOpenTimer").TimeCircles();
var updateTime = function(){
var date = $("#date").val();
var time = $("#time").val();
var datetime = date + ' ' + time + ':00';
$(".DateCountdown").data('date', datetime).TimeCircles().start();
}
$("#date").change(updateTime).keyup(updateTime);
$("#time").change(updateTime).keyup(updateTime);
/* Start and stop are methods applied on the public TimeCircles instance */
$(".startTimer").click(function() {
$(".CountDownTimer").TimeCircles().start();
});
$(".stopTimer").click(function() {
$(".CountDownTimer").TimeCircles().stop();
});
/* Fade in and fade out are examples of how chaining can be done with TimeCircles */
$(".fadeIn").click(function() {
$(".PageOpenTimer").fadeIn();
});
$(".fadeOut").click(function() {
$(".PageOpenTimer").fadeOut();
});
$(window).on('resize', function(){
$('.DateCountdown').TimeCircles().rebuild();
$('.CountDownTimer').TimeCircles().rebuild();
$('.PageOpenTimer').TimeCircles().rebuild();
});
});
-->
</script>
EOF;
return $flux;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function dt_portfolio_loadCssAndJs() {\n wp_register_style( 'dt_extend_style', plugins_url('assets/droit-wbpakery-addons.css', __FILE__) );\n wp_enqueue_script('slick');\n wp_enqueue_script('droit-wpbakery-addons-script');\n }",
"function loadscripts()\n\t{\n\t\twp_enqueue_script('jquery_cycleslider.js',AWP_PLUGIN_BASEURL. '/assets/js/jquery.cycle.all.latest.js',array('jquery'));\n }",
"static function add_scripts(){\n\t\t\twp_enqueue_script('tw-weather', plugin_dir_url( __FILE__) . 'assets/tw_weather.js', array( 'jquery'), true );\n\t\t}",
"function load_assets() {\n\t\t\n\t\t// add support for visual composer animations, row stretching, parallax etc\n\t\tif ( function_exists( 'vc_asset_url' ) ) {\n\t\t\twp_enqueue_script( 'waypoints', vc_asset_url( 'lib/waypoints/waypoints.min.js' ), array( 'jquery' ), WPB_VC_VERSION, true );\n\t\t\t//wp_enqueue_script( 'wpb_composer_front_js', vc_asset_url( 'js/dist/js_composer_front.min.js' ), array( 'jquery' ), WPB_VC_VERSION, true );\n\t\t}\n\t\t\n\t\t// JS scripts\n\t\twp_enqueue_script( 'jquery' );\n\t\twp_enqueue_script( 'popper', get_template_directory_uri() . '/assets/libs/popper/popper.min.js', array( 'jquery' ), Trends()->config['cache_time'], true );\n\t\twp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/assets/libs/bootstrap/bootstrap.min.js', array( 'jquery' ), Trends()->config['cache_time'], true );\n\t\twp_enqueue_script( 'chartjs', get_template_directory_uri() . '/assets/libs/chart/Chart.bundle.js', array( 'jquery' ), Trends()->config['cache_time'], true );\n\t\twp_enqueue_script( 'charts', get_template_directory_uri() . '/assets/js/charts.js', array( 'jquery' ), Trends()->config['cache_time'], true );\n\n\t\twp_register_script( 'google-fonts', get_template_directory_uri() . '/assets/libs/google-fonts/webfont.js', false, Trends()->config['cache_time'], true );\n\t\twp_register_script( 'fruitfulblankprefix-front', get_template_directory_uri() . '/assets/js/front.js', array(\n\t\t\t'jquery',\n\t\t\t'google-fonts'\n\t\t), Trends()->config['cache_time'], true );\n\t\t\n\t\t$js_vars = array(\n\t\t\t'ajaxurl' => esc_url(admin_url( 'admin-ajax.php' )),\n\t\t\t'assetsPath' => get_template_directory_uri() . '/assets',\n\t\t);\n\t\t\n\t\twp_enqueue_script( 'fruitfulblankprefix-front' );\n\t\twp_localize_script( 'fruitfulblankprefix-front', 'themeJsVars', $js_vars );\n\t\t\n\t\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\t\twp_enqueue_script( 'comment-reply' );\n\t\t}\n\n\t\tif ( $this->antispam_enabled() === 1 ) {\n\t\t\twp_enqueue_script( 'fruitfulblankprefix-antispam', get_template_directory_uri() . '/assets/js/antispam.js', array(\n\t\t\t\t'jquery',\n\t\t\t), Trends()->config['cache_time'], true );\n\t\t}\n\t\t\n\t\t\n\t\t// CSS styles\n\t\twp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/assets/libs/font-awesome/css/font-awesome.min.css', false, Trends()->config['cache_time'] );\n\t\twp_enqueue_style( 'animate', get_template_directory_uri() . '/assets/libs/animatecss/animate.min.css', false, Trends()->config['cache_time'] );\n\t\twp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/assets/libs/bootstrap/bootstrap.min.css', false, Trends()->config['cache_time'] );\n\t\t//wp_enqueue_style( 'uikit', get_template_directory_uri() . '/assets/libs/uikit/style.css', false, Trends()->config['cache_time'] );\n\t\t//wp_enqueue_style( 'uikit-elements', get_template_directory_uri() . '/assets/libs/uikit/elements.css', false, Trends()->config['cache_time'] );\n\t\twp_enqueue_style( 'fruitfulblankprefix-style', get_template_directory_uri() . '/assets/css/front/front.css', false, Trends()->config['cache_time'] );\n\t\t\n\t}",
"function load_scripts_block_assets() {\n\twp_register_script(\n\t\t'slick_script',\n\t\tget_template_directory_uri() . '/js/plugins/slick.min.js#asyncload',\n\t\t[],\n\t\tfalse,\n\t\ttrue\n\t);\n}",
"function hourizon_scripts() {\n\n\twp_enqueue_script( 'small-menu', get_template_directory_uri() . '/js/small-menu.js', array( 'jquery' ), '20120206', true );\n\n\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\twp_enqueue_script( 'comment-reply' );\n\t}\n\n\tif ( is_singular() && wp_attachment_is_image() ) {\n\t\twp_enqueue_script( 'keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' );\n\t}\n}",
"public function scripts()\n {\n wp_enqueue_script('alpinejs', 'https://unpkg.com/[email protected]/dist/cdn.min.js', [], '', true);\n\n wp_register_script('td-main', get_stylesheet_directory_uri() . td_asset_path('js/main.js'), ['jquery', 'alpinejs'], '', true);\n if (is_single() && comments_open() && get_option('thread_comments')) {\n wp_enqueue_script('comment-reply');\n }\n\n wp_enqueue_script('td-main');\n }",
"protected function loadJavascript() {\n\n\t\t// *********************************** //\n\t\t// Load ExtCore library\n\t\t$this->pageRenderer->loadExtJS();\n\t\t$this->pageRenderer->enableExtJsDebug();\n\n\t\t// Manage State Provider\n\t\t$this->template->setExtDirectStateProvider();\n\t\t$states = $GLOBALS['BE_USER']->uc['moduleData']['Taxonomy']['States'];\n\t\t$this->pageRenderer->addInlineSetting('Taxonomy', 'States', $states);\n\n\t\t// *********************************** //\n\t\t// Defines what files should be loaded and loads them\n\t\t$files = array();\n\t\t$files[] = 'Utility.js';\n\n\t\t// Application\n\t\t$files[] = 'Application.js';\n\t\t$files[] = 'Application/MenuRegistry.js';\n\t\t$files[] = 'Application/AbstractBootstrap.js';\n\n\t\t$files[] = 'Concept/ConceptTree.js';\n\t\t$files[] = 'Concept/ConceptGrid.js';\n\n//\t\t// Override\n//\t\t$files[] = 'Override/Chart.js';\n//\n\t\t// Stores\n//\t\t$files[] = 'Stores/Bootstrap.js';\n\t\t$files[] = 'Stores/ConceptStore.js';\n//\n//\t\t// User interfaces\n\t\t$files[] = 'UserInterface/Bootstrap.js';\n\t\t$files[] = 'UserInterface/FullDoc.js';\n\t\t$files[] = 'UserInterface/TopPanel.js';\n\t\t$files[] = 'UserInterface/DocHeader.js';\n\t\t$files[] = 'UserInterface/TreeEditor.js';\n\t\t$files[] = 'UserInterface/TreeNodeUI.js';\n\t\t$files[] = 'UserInterface/RecordTypeCombo.js';\n\t\t$files[] = 'UserInterface/ConfirmWindow.js';\n\n//\t\t// Plugins\n\t\t$files[] = 'Plugins/FitToParent.js';\n\t\t$files[] = 'Plugins/StateTreePanel.js';\n\n//\t\t// Newsletter Planner\n//\t\t$files[] = 'Planner/Bootstrap.js';\n//\t\t$files[] = 'Planner/PlannerForm.js';\n//\t\t#$files[] = 'Planner/PlannerForm/PlannerTab.js';\n//\t\t#$files[] = 'Planner/PlannerForm/SettingsTab.js';\n//\t\t#$files[] = 'Planner/PlannerForm/StatusTab.js';\n//\n//\t\t// Statistics\n//\t\t$files[] = 'Statistics/Bootstrap.js';\n//\t\t$files[] = 'Statistics/ModuleContainer.js';\n//\t\t$files[] = 'Statistics/NoStatisticsPanel.js';\n//\t\t$files[] = 'Statistics/StatisticsPanel.js';\n//\t\t$files[] = 'Statistics/NewsletterListMenu.js';\n//\t\t$files[] = 'Statistics/StatisticsPanel/OverviewTab.js';\n//\t\t$files[] = 'Statistics/StatisticsPanel/LinkTab.js';\n//\t\t$files[] = 'Statistics/StatisticsPanel/LinkTab/LinkGrid.js';\n//\t\t$files[] = 'Statistics/StatisticsPanel/LinkTab/LinkGraph.js';\n//\t\t$files[] = 'Statistics/StatisticsPanel/EmailTab.js';\n//\t\t$files[] = 'Statistics/StatisticsPanel/EmailTab/EmailGrid.js';\n//\t\t$files[] = 'Statistics/StatisticsPanel/EmailTab/EmailGraph.js';\n//\t\t$files[] = 'Statistics/StatisticsPanel/OverviewTab/General.js';\n////\t\t$files[] = 'Statistics/StatisticsPanel/OverviewTab/Graph.js';\n\n\t\tforeach ($files as $file) {\n\t\t\t$this->pageRenderer->addJsFile($this->javascriptPath . $file, 'text/javascript', FALSE);\n\t\t}\n\t\t\n\t\t$this->pageRenderer->addJsFile('../t3lib/js/extjs/ExtDirect.StateProvider.js', 'text/javascript', FALSE);\n\n\t\t// ExtDirect\n//\t\t$this->pageRenderer->addExtDirectCode(array(\n//\t\t\t'TYPO3.Taxonomy'\n//\t\t));\n\t\t\n\t\t// Add ExtJS API\n\t\t#$this->pageRenderer->addJsFile('ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.Taxonomy', 'text/javascript', FALSE);\n\n\t\t#$numberOfStatistics = json_encode($this->statisticRepository->countStatistics($this->id));\n\t\t#TYPO3.Taxonomy.Data.numberOfStatistics = $numberOfStatistics;\n\n\t\t// *********************************** //\n\t\t// Defines onready Javascript\n\t\t$this->readyJavascript = array();\n\t\t$this->readyJavascript[] .= <<< EOF\n\n\t\t\tExt.ns(\"TYPO3.Taxonomy.Data\");\n\t\t\tTYPO3.Taxonomy.Data.imagePath = '$this->imagePath';\n\n\t\t\t// Enable our remote calls\n\t\t\t//for (var api in Ext.app.ExtDirectAPI) {\n\t\t\t//\tExt.Direct.addProvider(Ext.app.ExtDirectAPI[api]);\n\t\t\t//}\nEOF;\n\n\t\t$this->pageRenderer->addExtOnReadyCode(PHP_EOL . implode(\"\\n\", $this->readyJavascript) . PHP_EOL);\n\n\t\t// *********************************** //\n\t\t// Defines contextual variables\n\t\t$labels = json_encode($this->getLabels());\n\t\t$configuration = json_encode($this->getConfiguration());\n\t\t$sprites = json_encode($this->getSprites());\n\n\t\t$this->inlineJavascript[] .= <<< EOF\n\n\t\tExt.ns(\"TYPO3.Taxonomy\");\n\t\tTYPO3.Taxonomy.Language = $labels;\n\t\tTYPO3.Taxonomy.Configuration = $configuration;\n\t\tTYPO3.Taxonomy.Sprites = $sprites;\n\nEOF;\n\t\t$this->pageRenderer->addJsInlineCode('newsletter', implode(\"\\n\", $this->inlineJavascript));\n\t}",
"function load_javascript() {\n\t\techo '<script type=\"text/javascript\" src=\"'. $this->pluginurl . 'js/phpull.js\"></script>';\n\t}",
"public function dt_carousel_loadCssAndJs() {\n wp_register_style( 'dt_extend_style', plugins_url('assets/droit-wbpakery-addons.css', __FILE__) );\n wp_enqueue_style( 'slick' );\n wp_enqueue_style( 'slick-theme' );\n\n // If you need any javascript files on front end, here is how you can load them.\n //wp_enqueue_script( 'droit-wbpakery-addons_js', plugins_url('assets/droit-wbpakery-addons.js', __FILE__), array('jquery') );\n }",
"public function loadCssAndJs() {\n\t\t//wp_enqueue_style( 'owl_carousel', get_template_directory_uri() . '/assets/css/owl.carousel.css', null, ( WP_DEBUG ) ? time() : null );\n\t\twp_enqueue_script( 'owl_carousel', get_template_directory_uri() . '/assets/js/owl.carousel.min.js', array( 'jquery' ), ( WP_DEBUG ) ? time() : null, true );\n\t}",
"public function script()\n {\n\n wp_register_script('panzoom', MODULARITY_INTERACTIVE_MAP_URL . '/source/js/vendor/panzoom.js', null, '3.0.0', true);\n wp_register_script('modularity-interative-map', MODULARITY_INTERACTIVE_MAP_URL . '/dist/' . CacheBust::name('js/modularity-interactive-map.js'), null, '3.0.0', false);\n wp_enqueue_script('panzoom');\n wp_enqueue_script('modularity-interative-map');\n }",
"function harasMoradaNovaJS(){\n\t$caminho = get_template_directory_uri();\n\n\twp_enqueue_script('flexslider', $caminho . '/js/jquery.flexslider-min.js', array('jquery'), null, true);\n\twp_enqueue_script('owl.carousel', $caminho . '/js/owl.carousel.min.js', array('jquery'), null, true);\n\twp_enqueue_script('fancybox', $caminho . '/js/jquery.fancybox.pack.js', array('jquery'), null, true);\n\twp_enqueue_script('googleMaps', 'https://maps.googleapis.com/maps/api/js?v=3.exp&key=AIzaSyBizUgsytHY-hMmkgdPnzBB5r6N86qoPSs', array('jquery'), null, true);\n\twp_enqueue_script('acfMaps', $caminho . '/js/mapa.js', array('jquery', 'googleMaps'), null, true);\n\twp_enqueue_script('geral', $caminho . '/js/script.js', array('jquery', 'flexslider', 'owl.carousel' , 'fancybox'), null, true);\n}",
"public function jetpack_after_the_deadline_load() {\n\t\t\tadd_filter( 'atd_load_scripts', '__return_true' );\n\t\t}",
"function load_javascript() {\n\t\twp_enqueue_script('jquery');\n\t\twp_enqueue_script('popper', 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.5/umd/popper.min.js', false);\n\t\twp_enqueue_script('bootstrap', 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js', false);\n\t\twp_enqueue_script('fontawesome', 'https://use.fontawesome.com/releases/v5.0.6/js/all.js', false);\n\t\t// wp_enqueue_script('backstretch', get_template_directory_uri() . '/js/jquery.backstretch.min.js', false);\n\t\t// wp_enqueue_script('fancybox', get_template_directory_uri() . '/js/fancybox.1.3.22.js', false);\n\t\t// wp_enqueue_script('magnificpopup', get_template_directory_uri() . '/js/jquery.magnific-popup.min.js', false, null);\n\t\t// wp_enqueue_script('masonry', 'https://cdnjs.cloudflare.com/ajax/libs/masonry/4.2.0/masonry.pkgd.min.js', false);\n\n\t\twp_enqueue_script('scripts', get_template_directory_uri() . '/js/scripts.js', array( 'jquery' ), null, 'all');\n\t}",
"public function scripts()\n\t{\n\t\twp_enqueue_script('msc-widget-script', $this->getScriptUrl(), ['jquery'], '', true);\n\t}",
"function timeline_admin_script_loader() {\n $script_path = plugin_dir_url( __FILE__ ).'../lib/';\n wp_enqueue_script( 'plugin-js', $script_path . 'js/timeline-admin.js', array( 'jquery' ), '1.0.0', true );\n }",
"function twitter_timeline_js() {\n\tif ( is_customize_preview() ) {\n\t\twp_enqueue_script( 'jetpack-twitter-timeline' );\n\t}\n}",
"function theme_scripts()\n{\n \n wp_enqueue_script('timepicker', 'https://cdnjs.cloudflare.com/ajax/libs/timepicker/1.3.5/jquery.timepicker.min.js',['jquery'], STATIC_FILES_BUILD_VERSION, true);\n wp_enqueue_script('master-script', get_template_directory_uri() . '/js/main.js',['bootstrap'], STATIC_FILES_BUILD_VERSION, true);\n wp_enqueue_script('popper', 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js',['timepicker'], STATIC_FILES_BUILD_VERSION, true);\n wp_enqueue_script('bootstrap', 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js',['popper'], STATIC_FILES_BUILD_VERSION, true);\n\n}",
"public function loadJavaScripts(){\n //SAMPLE:wp_register_script( string $handle, string|bool $src, string[] $deps = array(), string|bool|null $ver = false, bool $in_footer = false )\n\n\n wp_register_script(\"paulScript\",get_template_directory_uri().'/js/paulScript.js','',1,true );\n\n wp_enqueue_script('paulScript');\n\n\n\n }",
"function medchatapp_script() {\n echo '<script type=\"text/javascript\" async src=\"https://medchatapp.com/widget/widget.js?api-key=1cn7ECe3sUGNQlzJgMQ8Gw\"></script>';\n }",
"function mcwbscripts() {\n\twp_register_style('mcwbcss', WP_PLUGIN_URL . \"/minecraft-workbench-tooltips/css/mcwbtooltips.css\");\n\twp_enqueue_style('mcwbcss');\n\twp_register_script('jquery', WP_PLUGIN_URL . \"/minecraft-workbench-tooltips/js/jquery.min.js\");\n\twp_enqueue_script('jquery');\n\twp_register_script('jquerysimpletip', WP_PLUGIN_URL . \"/minecraft-workbench-tooltips/js/jquery.simpletip.min.js\", null, null, true);\n\twp_enqueue_script('jquerysimpletip');\n\twp_register_script('mcwbtooltips', WP_PLUGIN_URL . \"/minecraft-workbench-tooltips/js/mcwbtooltips.js\", null, null, true);\n\twp_enqueue_script('mcwbtooltips');\n}",
"function panel_scripts() {\n\t\t//CSS\n\t\twp_register_style( $this->config['slug'], SVQ_PANEL_URI . \"assets/css/theme-panel.css\", array(), SVQ_THEME_VERSION, \"all\" );\n\t\twp_enqueue_style( $this->config['slug'] );\n\n\t\t//JS\n\t\twp_enqueue_script( 'jquery-ui-tooltip' );\n\t\twp_register_script( $this->config['slug'], SVQ_PANEL_URI . \"assets/js/theme-panel.js\", array( 'jquery' ), SVQ_THEME_VERSION, true );\n\t\twp_enqueue_script( $this->config['slug'] );\n\t}",
"function queue_timeline_assets()\n{\n $library = get_option('neatline_time_library');\n if ($library == 'knightlab') {\n queue_css_url('//cdn.knightlab.com/libs/timeline3/latest/css/timeline.css');\n queue_js_url('//cdn.knightlab.com/libs/timeline3/latest/js/timeline.js');\n return;\n }\n\n // Default simile library.\n queue_css_file('neatlinetime-timeline');\n\n queue_js_file('neatline-time-scripts');\n\n $internalAssets = get_option('neatline_time_internal_assets');\n if ($internalAssets) {\n $useInternalJs = true;\n } else {\n // Check useInternalJavascripts in config.ini.\n $config = Zend_Registry::get('bootstrap')->getResource('Config');\n $useInternalJs = isset($config->theme->useInternalJavascripts)\n ? (bool) $config->theme->useInternalJavascripts\n : false;\n $useInternalJs = isset($config->theme->useInternalAssets)\n ? (bool) $config->theme->useInternalAssets\n : $useInternalJs;\n }\n\n if ($useInternalJs) {\n $timelineVariables = 'Timeline_ajax_url=\"' . src('simile-ajax-api.js', 'javascripts/simile/ajax-api') . '\";\n Timeline_urlPrefix=\"' . dirname(src('timeline-api.js', 'javascripts/simile/timeline-api')) . '/\";\n Timeline_parameters=\"bundle=true\";';\n queue_js_string($timelineVariables);\n queue_js_file('timeline-api', 'javascripts/simile/timeline-api');\n queue_js_string('SimileAjax.History.enabled = false; // window.jQuery = SimileAjax.jQuery;');\n } else {\n queue_js_url('//api.simile-widgets.org/timeline/2.3.1/timeline-api.js?bundle=true');\n queue_js_string('SimileAjax.History.enabled = false; window.jQuery = SimileAjax.jQuery;');\n }\n}",
"function rocketScript(){\n\t//JS\n\tif(get_option('scroll_reveal') == \"true\") { \n\t\twp_enqueue_script( 'scroll-reveal', '//cdnjs.cloudflare.com/ajax/libs/scrollReveal.js/3.1.4/scrollreveal.min.js',array('jquery'));\n\t}\n\tif(get_option('owl') == \"true\") { \n\t\twp_enqueue_script( 'owl-js', '//cdnjs.cloudflare.com/ajax/libs/owl-carousel/1.3.3/owl.carousel.min.js',array('jquery'));\n\t}\t\n\tif(get_option('parallax') == \"true\") { \n\t\twp_enqueue_script( 'parallax', '//cdnjs.cloudflare.com/ajax/libs/jquery-parallax/1.1.3/jquery-parallax.js',array('jquery'));\n\t}\n\t\n\t//Pace\n\twp_enqueue_script( 'pace-js', '//cdnjs.cloudflare.com/ajax/libs/pace/1.0.2/pace.min.js',array('jquery'));\n\t\n\t//Load core file\n\twp_enqueue_script( 'rocket-tether-js', '//cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js', array('jquery'));\t\n\twp_enqueue_script( 'rocket-bootstrap-js', '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js', array('jquery'));\t\n\twp_enqueue_script( 'rocket-script', get_template_directory_uri() . '/assets/js/script.js',array('jquery'));\n\twp_enqueue_script( 'moby-js', get_template_directory_uri() . '/assets/js/moby/moby.min.js',array('jquery'));\n\t\n\t//Transfer Scripts to footer\n\tremove_action('wp_head', 'wp_print_scripts'); \n remove_action('wp_head', 'wp_print_head_scripts', 9); \n remove_action('wp_head', 'wp_enqueue_scripts', 1);\n\n add_action('wp_footer', 'wp_print_scripts', 5);\n add_action('wp_footer', 'wp_enqueue_scripts', 5);\n add_action('wp_footer', 'wp_print_head_scripts', 5); \n}",
"private function load_standard_css_js()\n\t{\n\t\t//setting the array with all needed css/js scripts as standard\n\t\t$a_standard_scripts = array(\n\t\t\t'jQuery' => MEDIA_URL.'js/libs/jquery-2.1.3.js',\n\t\t\t'synchHeight-js' => MEDIA_URL.'js/plugin/syncheight/jquery.syncHeight.min.js',\n\t\t\t'bootstrap-js' => MEDIA_URL.'js/plugin/bootstrap/bootstrap.js',\n\t\t\t'popupoverlay' => MEDIA_URL.'js/plugin/popupoverlay/jquery.popupoverlay.js',\n\n\t\t\t'bootstrap' => MEDIA_URL.'css/bootstrap/bootstrap.css',\n\t\t\t$this->s_current_template_name => MEDIA_URL.$this->s_template_dir.'/'.$this->s_current_template_name.'/'.$this->s_current_template_name.'.css',\n\t\t\t'game-js' => MEDIA_URL.'js/'.$this->s_template_dir.'/'.$this->s_current_template_name .'/game.js',\n\t\t\t'main-js' => MEDIA_URL.'js/main.js',\n\t\t);\n\n\t\tforeach($a_standard_scripts as $scripts) {\n\t\t\tswitch(pathinfo($scripts, PATHINFO_EXTENSION))\n\t\t\t{\n\t\t\t\tcase 'css':\n\t\t\t\t{ echo '<link href=\"'.$scripts.'\" rel=\"stylesheet\" type=\"text/css\">'; break; }\n\t\t\t\tcase 'js':\n\t\t\t\t{ echo '<script src=\"'.$scripts.'\"></script>'; }\n\t\t\t}\n\t\t}\n\t}",
"public function stt_scripts(){\n wp_enqueue_script('stt-ajax-request', plugins_url() . '/send_to_top/request.js', array(), '2');\n }",
"public function ks_js_and_css()\t{\n\n\t\twp_enqueue_script('jquery-cycle', 'http://malsup.github.io/min/jquery.cycle2.min.js', array('jquery'));\n\t\t// wp_enqueue_script('jquery-cycle', KS_PLUGIN_URL . '/js/jquery-cycle2.js', array('jquery'));\n\t\twp_enqueue_script('ks-main', KS_PLUGIN_URL . '/js/' . KS_PLUGIN_BASENAME . '.js', array('jquery-cycle'));\n\t\twp_enqueue_style('ks-main', KS_PLUGIN_URL . '/css/' . KS_PREFIX . 'main.css', false, '2014-10-28');\n\n\t}",
"public function assets(){\r\n\r\n\t\twp_enqueue_script( 'wsrp-bootstrap-rating-script', WSRP_PLUGIN_URL . '/js/rater.js', array( 'jquery' ) );\r\n\t\t//wp_enqueue_script( 'wsrp-rating-script', WSRP_PLUGIN_URL . '/js/rating.js', array( 'jquery' ) );\r\n\t}",
"function mts_load_footer_scripts() { \n\t$mts_options = get_option( MTS_THEME_NAME );\n\t\n\t//Lightbox\n\tif ( ! empty( $mts_options['mts_lightbox'] ) ) {\n\t\twp_enqueue_script( 'magnificPopup', get_template_directory_uri() . '/js/jquery.magnific-popup.min.js', array( 'jquery' ) );\n\t}\n\t\n\t//Sticky Nav\n\tif ( ! empty( $mts_options['mts_sticky_nav'] ) ) {\n\t\twp_enqueue_script( 'StickyNav', get_template_directory_uri() . '/js/sticky.js' );\n\t}\n\t\n\t// RTL\n\tif ( ! empty( $mts_options['mts_rtl'] ) ) {\n\t\twp_enqueue_style( 'mts_rtl', get_template_directory_uri() . '/css/rtl.css', 'ad-sense-style' );\n\t}\n\n\t// Lazy Load\n\tif ( ! empty( $mts_options['mts_lazy_load'] ) && $mts_options['mts_home_layout'] != 'isotope-width' ) {\n\t\tif ( ! empty( $mts_options['mts_lazy_load_thumbs'] ) || ( ! empty( $mts_options['mts_lazy_load_content'] ) && is_singular() ) ) {\n\t\t\twp_enqueue_script( 'layzr', get_template_directory_uri() . '/js/layzr.min.js', '', '', true );\n\t\t}\n\t}\n\t\n\t// Ajax Load More and Search Results\n\twp_register_script( 'mts_ajax', get_template_directory_uri() . '/js/ajax.js', true );\n\tif( ! empty( $mts_options['mts_pagenavigation_type'] ) && $mts_options['mts_pagenavigation_type'] >= 2 && !is_singular() ) {\n\t\twp_enqueue_script( 'mts_ajax' );\n\t\t\n\t\twp_enqueue_script( 'historyjs', get_template_directory_uri() . '/js/history.js' );\n\n\t\t// Add parameters for the JS\n\t\tglobal $wp_query;\n\t\t$max = $wp_query->max_num_pages;\n\t\t$paged = ( get_query_var( 'paged' ) > 1 ) ? get_query_var( 'paged' ) : 1;\n\t\t$autoload = ( $mts_options['mts_pagenavigation_type'] == 3 );\n\t\twp_localize_script(\n\t\t\t'mts_ajax',\n\t\t\t'mts_ajax_loadposts',\n\t\t\tarray(\n\t\t\t\t'startPage' => $paged,\n\t\t\t\t'maxPages' => $max,\n\t\t\t\t'nextLink' => next_posts( $max, false ),\n\t\t\t\t'autoLoad' => $autoload,\n\t\t\t\t'i18n_loadmore' => __( 'Load More Posts', 'ad-sense' ),\n\t\t\t\t'i18n_loading' => __('Loading...', 'ad-sense' ),\n\t\t\t\t'i18n_nomore' => __( 'No more posts.', 'ad-sense' )\n\t\t\t )\n\t\t);\n\t}\n\tif ( ! empty( $mts_options['mts_ajax_search'] ) ) {\n\t\twp_enqueue_script( 'mts_ajax' );\n\t\twp_localize_script(\n\t\t\t'mts_ajax',\n\t\t\t'mts_ajax_search',\n\t\t\tarray(\n\t\t\t\t'url' => admin_url( 'admin-ajax.php' ),\n\t\t\t\t'ajax_search' => '1'\n\t\t\t )\n\t\t);\n\t}\n\t\n}"
] | [
"0.60651463",
"0.60480195",
"0.5938711",
"0.5883235",
"0.58778924",
"0.5834886",
"0.58293754",
"0.58138186",
"0.5802754",
"0.5791631",
"0.5790626",
"0.5772595",
"0.57496005",
"0.5725088",
"0.571629",
"0.5667556",
"0.5640055",
"0.5624605",
"0.5615687",
"0.5609055",
"0.5600752",
"0.55788493",
"0.55767655",
"0.55764765",
"0.55657303",
"0.5559892",
"0.5558497",
"0.55531186",
"0.554201",
"0.55354273"
] | 0.68777597 | 0 |
/ Private Methods Find Browser Information This method populates the class variables with infomration about the browser and platform | private function findBrowserInformation(){
$browser = $version = $platform = $os = $osversion = $device = '';
$userAgent = isset($_SERVER['HTTP_USER_AGENT'])?$_SERVER['HTTP_USER_AGENT']:"";
if(!empty($userAgent)){
//Broswer Detection
preg_match_all("/(Opera|Chrome|CriOS|Version|Firefox|MSIE)[\/|\s](\d+(?:[\_|\.]\d+){1,2})\b/", $userAgent, $matches, PREG_SET_ORDER);
if(!empty($matches)){
list($browser, $version) = array($matches[0][1], str_replace(".","_",$matches[0][2]));
$browser = ($browser=="Version")?"Safari":$browser;
$browser = ($browser=="MSIE")?"IE":$browser;
$browser = ($browser=="CriOS")?"Chrome":$browser;
$browser = strtolower($browser);
}
//Platform Detection
if( stripos($userAgent, 'windows') !== false ) {
$platform = 'windows';
$os = 'windows';
//Lets Try To Refine
if(preg_match('/(Windows 95|Win95|Windows_95)/i', $userAgent)){
$osversion = '95';
}else if(preg_match('/(Windows 98|Win98)/i', $userAgent)){
$osversion = '98';
}else if(preg_match('/(Windows NT 5.0|Windows 2000)/i', $userAgent)){
$osversion = '2000';
}else if(preg_match('/(Windows NT 5.1|Windows XP)/i', $userAgent)){
$osversion = 'XP';
}else if(stripos($userAgent, 'Windows NT 5.2') !== false){
$osversion = '2003';
}else if(preg_match('/(Windows NT 6.0|Windows Vista)/i', $userAgent)){
$osversion = 'Vista';
}else if(preg_match('/(Windows NT 6.1|Windows 7)/i', $userAgent)){
$osversion = '7';
}else if(preg_match('/(Windows NT 6.2|Windows 8)/i', $userAgent)){
$osversion = '8';
}else if(preg_match('/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/i', $userAgent)){
$osversion = 'NT';
}else if(stripos($userAgent, 'Windows ME') !== false){
$osversion = 'ME';
}
} else if( stripos($userAgent, 'iPad') !== false ) {
$platform = 'iPad';
$os = "iOS";
if(preg_match('/[\bOS|\biOS] (\d+(?:\_\d+){1,2})\b/i', $userAgent, $matches)){
$osversion = $matches[1];
}
} else if( stripos($userAgent, 'iPod') !== false ) {
$platform = 'iPod';
$os = "iOS";
if(preg_match('/[\bOS|\biOS] (\d+(?:\_\d+){1,2})\b/i', $userAgent, $matches)){
$osversion = $matches[1];
}
} else if( stripos($userAgent, 'iPhone') !== false ) {
$platform = 'iPhone';
$os = "iOS";
if(preg_match('/[\bOS|\biOS] (\d+(?:\_\d+){1,2})\b/i', $userAgent, $matches)){
$osversion = $matches[1];
}
} elseif( stripos($userAgent, 'mac') !== false ) {
$platform = 'macintosh';
//Mac OS Version
if(preg_match('/\bOS X (\d+(?:[\_|\.]\d+){1,2})\b/i', $userAgent, $matches)){
$osversion = str_replace(".","_",$matches[1]);
}
//Mac OS Name
if(stripos($osversion, '10_10') !== false){
$os = 'yosemite';
} else if(stripos($osversion, '10_9') !== false){
$os = 'mavericks';
} else if(stripos($osversion, '10_8') !== false){
$os = 'mountainLion';
} else if(stripos($osversion, '10_7') !== false){
$os = 'lion';
} else if(stripos($osversion, '10_6') !== false){
$os = 'snowLeopard';
} else if(stripos($osversion, '10_5') !== false){
$os = 'leopard';
} else if(stripos($osversion, '10_4') !== false){
$os = 'tiger';
} else if(stripos($osversion, '10_3') !== false){
$os = 'panther';
}
} elseif( stripos($userAgent, 'android') !== false ) {
$platform = 'android';
$os = "android";
if(preg_match('/\bAndroid (\d+(?:\.\d+){1,2})[;)]/i', $userAgent, $matches)){
$osversion = str_replace(".","_",$matches[1]);
}
} elseif( stripos($userAgent, 'linux') !== false ) {
$platform = 'linux';
} else if( stripos($userAgent, 'Nokia') !== false ) {
$platform = 'nokia';
} else if( stripos($userAgent, 'BlackBerry') !== false ) {
$platform = 'blackBerry';
} elseif( stripos($userAgent,'FreeBSD') !== false ) {
$platform = 'freeBSD';
} elseif( stripos($userAgent,'OpenBSD') !== false ) {
$platform = 'openBSD';
} elseif( stripos($userAgent,'NetBSD') !== false ) {
$platform = 'netBSD';
} elseif( stripos($userAgent, 'OpenSolaris') !== false ) {
$platform = 'openSolaris';
} elseif( stripos($userAgent, 'SunOS') !== false ) {
$platform = 'sunOS';
} elseif( stripos($userAgent, 'OS\/2') !== false ) {
$platform = 'oS/2';
} elseif( stripos($userAgent, 'BeOS') !== false ) {
$platform = 'BeOS';
} elseif( stripos($userAgent, 'win') !== false ) {
$platform = 'windowsCE';
} elseif( stripos($userAgent, 'QNX') !== false ) {
$platform = 'QNX';
} elseif( preg_match('/(nuhk|Googlebot|Yammybot|Openbot|Slurp\/cat|msnbot|ia_archiver)/i', $userAgent) ) {
$platform = 'spider';
}
//Device Detection
$GenericPhones = array('acs-', 'alav', 'alca', 'amoi', 'audi', 'aste', 'avan', 'benq', 'bird', 'blac', 'blaz', 'brew', 'cell', 'cldc', 'cmd-', 'dang', 'doco', 'eric', 'hipt', 'inno', 'ipaq', 'java', 'jigs', 'kddi', 'keji', 'leno', 'lg-c', 'lg-d', 'lg-g', 'lge-', 'maui', 'maxo', 'midp', 'mits', 'mmef', 'mobi', 'mot-', 'moto', 'mwbp', 'nec-', 'newt', 'noki', 'opwv', 'palm', 'pana', 'pant', 'pdxg', 'phil', 'play', 'pluc', 'port', 'prox', 'qtek', 'qwap', 'sage', 'sams', 'sany', 'sch-', 'sec-', 'send', 'seri', 'sgh-', 'shar', 'sie-', 'siem', 'smal', 'smar', 'sony', 'sph-', 'symb', 't-mo', 'teli', 'tim-', 'tosh', 'tsm-', 'upg1', 'upsi', 'vk-v', 'voda', 'w3c ', 'wap-', 'wapa', 'wapi', 'wapp', 'wapr', 'webc', 'winw', 'winw', 'xda', 'xda-');
//Default Device
$device = "desktop";
if(!in_array($platform, array("apple", "windows", "iPad"))){
if(preg_match('/up.browser|up.link|windows ce|iemobile|mini|mmp|symbian|midp|wap|phone|pocket|mobile|pda|psp/i',$userAgent) ||
isset($_SERVER['HTTP_ACCEPT']) && stristr($_SERVER['HTTP_ACCEPT'],'text/vnd.wap.wml')||stristr($_SERVER['HTTP_ACCEPT'],'application/vnd.wap.xhtml+xml') ||
isset($_SERVER['HTTP_X_WAP_PROFILE'])||isset($_SERVER['HTTP_PROFILE'])||isset($_SERVER['X-OperaMini-Features'])||isset($_SERVER['UA-pixels']) ||
isset($GenericPhones[substr($userAgent,0,4)])){
$device = "mobile";
}
}
}
$this->browser = $browser;
$this->browserVersion = $version;
$this->os = $os;
$this->osVersion = $osversion;
$this->platform = $platform;
$this->device = $device;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function browser_info()\n\t{\n\t\t$info = get_browser(null, true);\n\t\t$browser = $info['browser'] . \" \" . $info['version'];\n\t\t$os = $info['platform'];\t\n\t\t$ip = $_SERVER['REMOTE_ADDR'];\t\t\n\t\treturn array(\"ip\" => $ip, \"browser\" => $browser, \"os\" => $os);\n\t}",
"public function getBrowserInfo()\n {\n return $_SERVER['HTTP_USER_AGENT'];\n }",
"function getBrowser() {\n $u_agent = $_SERVER['HTTP_USER_AGENT'];\n $bname = 'um navegador não identificado';\n $platform = 'não identificado';\n \n //First get the platform?\n if (preg_match('/macintosh|mac os x/i', $u_agent)) {\n $platform = 'Mac';\n }\n if (preg_match('/linux/i', $u_agent)) {\n $platform = 'Linux';\n }\n if (preg_match('/windows|win32|win64/i', $u_agent)) {\n $platform = 'Windows';\n }\n \n // Next get the name of the useragent - yes separately and for good reason.\n if (preg_match('/Chrome/i',$u_agent)) {\n $bname = 'Google Chrome';\n $ub = \"Chrome\";\n }\n if (preg_match('/Firefox/i',$u_agent)) {\n $bname = 'Mozilla Firefox';\n $ub = \"Firefox\";\n }\n if (preg_match('/Safari/i',$u_agent) && !preg_match('/Chrome/i',$u_agent) ) {\n $bname = 'Apple Safari';\n $ub = \"Safari\";\n }\n if (preg_match('/Opera/i',$u_agent)) {\n $bname = 'Opera';\n $ub = \"Opera\";\n }\n if (preg_match('/Netscape/i',$u_agent)) {\n $bname = 'Netscape';\n $ub = \"Netscape\";\n }\n if ( (preg_match('/MSIE/i',$u_agent) or preg_match('/Trident/i',$u_agent)) && !preg_match('/Opera/i',$u_agent) ) {\n $bname = 'Internet Explorer';\n $ub = \"Internet Explorer\";\n }\n \n return array(\n 'userAgent' => $u_agent,\n 'name' => $bname,\n 'platform' => $platform,\n );\n }",
"private function getBrowser()\n\t{\n\n\t\t$u_agent = $_SERVER['HTTP_USER_AGENT'];\n\t\t$bname = 'Unknown';\n\t\t$platform = 'Unknown';\n\t\t$version = '';\n\n\t\t//First get the platform?\n\t\tif (preg_match('/linux/i', $u_agent))\n\t\t\t$platform = 'linux';\n\t\telseif (preg_match('/macintosh|mac os x/i', $u_agent))\n\t\t\t$platform = 'mac';\n\t\telseif (preg_match('/windows|win32/i', $u_agent))\n\t\t\t$platform = 'windows';\n\n\t\t// Next get the name of the useragent yes seperately and for good reason\n\t\tif (preg_match('/MSIE/i', $u_agent) && !preg_match('/Opera/i', $u_agent))\n\t\t{\n\t\t\t$bname = 'Internet Explorer';\n\t\t\t$ub = 'MSIE';\n\t\t}\n\t\telseif (preg_match('/Firefox/i', $u_agent))\n\t\t{\n\t\t\t$bname = 'Mozilla Firefox';\n\t\t\t$ub = 'Firefox';\n\t\t}\n\t\telseif (preg_match('/Chrome/i', $u_agent))\n\t\t{\n\t\t\t$bname = 'Google Chrome';\n\t\t\t$ub = 'Chrome';\n\t\t}\n\t\telseif (preg_match('/Safari/i', $u_agent))\n\t\t{\n\t\t\t$bname = 'Apple Safari';\n\t\t\t$ub = 'Safari';\n\t\t}\n\t\telseif (preg_match('/Opera/i', $u_agent))\n\t\t{\n\t\t\t$bname = 'Opera';\n\t\t\t$ub = 'Opera';\n\t\t}\n\t\telseif (preg_match('/Netscape/i', $u_agent))\n\t\t{\n\t\t\t$bname = 'Netscape';\n\t\t\t$ub = 'Netscape';\n\t\t}\n\n\t\t// finally get the correct version number\n\t\t$known = array('Version', $ub, 'other');\n\t\t$pattern = '#(?<browser>'.join('|', $known).')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';\n\t\tpreg_match_all($pattern, $u_agent, $matches);\n\n\t\t// see how many we have\n\t\t$i = count($matches['browser']);\n\t\tif ($i != 1)\n\t\t{\n\t\t\t//we will have two since we are not using 'other' argument yet\n\t\t\t//see if version is before or after the name\n\t\t\tif (strripos($u_agent, 'Version') < strripos($u_agent, $ub))\n\t\t\t\t$version = $matches['version'][0];\n\t\t\telse\n\t\t\t\t$version = $matches['version'][1];\n\t\t}\n\t\telse\n\t\t\t$version = $matches['version'][0];\n\n\t\t// check if we have a number\n\t\tif ($version == null || $version == '')\n\t\t\t$version = '?';\n\n\t\treturn array(\n\t\t\t'userAgent' => $u_agent,\n\t\t\t'name' => $bname,\n\t\t\t'version' => $version,\n\t\t\t'platform' => $platform,\n\t\t\t'pattern' => $pattern\n\t\t);\n\t}",
"function get_browser_info($os = \"Linux\", $browserName = \"Firefox\", $browserVersion = 5) {\n\t\n\t\t$this->os = $os;\n\t\t$this->browserName = $browserName;\n\t\t$this->browserVersion = $browserVersion;\n\t\t\n\t}",
"function browser() {\n\n\t\t\t$user_agent = $_SERVER['HTTP_USER_AGENT'];\n\n\t\t\t$browsers = array('Chrome' => array('Google Chrome', 'Chrome/(.*)\\s'), 'MSIE' => array('Internet Explorer', 'MSIE\\s([0-9\\.]*)'), 'Firefox' => array('Firefox', 'Firefox/([0-9\\.]*)'), 'Safari' => array('Safari', 'Version/([0-9\\.]*)'), 'Opera' => array('Opera', 'Version/([0-9\\.]*)'));\n\n\t\t\n\n\t\t\t$browser_details = array();\n\n\t\t\n\n\t\t\tforeach ($browsers as $browser => $browser_info) {\n\n\t\t\t\tif (preg_match('@' . $browser . '@i', $user_agent)) {\n\n\t\t\t\t\t$browser_details['name'] = $browser_info[0];\n\n\t\t\t\t\tpreg_match('@' . $browser_info[1] . '@i', $user_agent, $version);\n\n\t\t\t\t\t$browser_details['version'] = $version[1];\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$browser_details['name'] = 'Unknown';\n\n\t\t\t\t\t$browser_details['version'] = 'Unknown';\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn 'Browser: ' . $browser_details['name'] . ' Version: ' . $browser_details['version'];\n\n\t}",
"function get_browser_details($in = NULL, $assign = false)\n{\n //Checking if browser is firefox\n if (!$in)\n $in = $_SERVER['HTTP_USER_AGENT'];\n\n $u_agent = $in;\n $bname = 'Unknown';\n $platform = 'Unknown';\n $version = \"\";\n\n //First get the platform?\n if (preg_match('/linux/i', $u_agent))\n {\n $platform = 'linux';\n }\n elseif (preg_match('/iPhone/i', $u_agent))\n {\n $platform = 'iphone';\n }\n elseif (preg_match('/iPad/i', $u_agent))\n {\n $platform = 'ipad';\n }\n elseif (preg_match('/macintosh|mac os x/i', $u_agent))\n {\n $platform = 'mac';\n }\n elseif (preg_match('/windows|win32/i', $u_agent))\n {\n $platform = 'windows';\n }\n\n if (preg_match('/Android/i', $u_agent))\n {\n $platform = 'android';\n }\n\n // Next get the name of the useragent yes seperately and for good reason\n if (preg_match('/MSIE/i', $u_agent) && !preg_match('/Opera/i', $u_agent))\n {\n $bname = 'Internet Explorer';\n $ub = \"MSIE\";\n }\n elseif (preg_match('/Firefox/i', $u_agent))\n {\n $bname = 'Mozilla Firefox';\n $ub = \"Firefox\";\n }\n elseif (preg_match('/Chrome/i', $u_agent))\n {\n $bname = 'Google Chrome';\n $ub = \"Chrome\";\n }\n elseif (preg_match('/Safari/i', $u_agent))\n {\n $bname = 'Apple Safari';\n $ub = \"Safari\";\n }\n elseif (preg_match('/Opera/i', $u_agent))\n {\n $bname = 'Opera';\n $ub = \"Opera\";\n }\n elseif (preg_match('/Netscape/i', $u_agent))\n {\n $bname = 'Netscape';\n $ub = \"Netscape\";\n }\n elseif (preg_match('/Googlebot/i', $u_agent))\n {\n $bname = 'Googlebot';\n $ub = \"bot\";\n }\n elseif (preg_match('/msnbot/i', $u_agent))\n {\n $bname = 'MSNBot';\n $ub = \"bot\";\n }\n elseif (preg_match('/Yahoo\\! Slurp/i', $u_agent))\n {\n $bname = 'Yahoo Slurp';\n $ub = \"bot\";\n }\n\n\n // finally get the correct version number\n $known = array('Version', $ub, 'other');\n $pattern = '#(?<browser>' . join('|', $known) .\n ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';\n if (!@preg_match_all($pattern, $u_agent, $matches))\n {\n // we have no matching number just continue\n }\n\n // see how many we have\n $i = count($matches['browser']);\n if ($i != 1)\n {\n //we will have two since we are not using 'other' argument yet\n //see if version is before or after the name\n if (strripos($u_agent, \"Version\") < strripos($u_agent, $ub))\n {\n $version = $matches['version'][0];\n }\n else\n {\n $version = $matches['version'][1];\n }\n }\n else\n {\n $version = $matches['version'][0];\n }\n\n // check if we have a number\n if ($version == null || $version == \"\")\n {\n $version = \"?\";\n }\n\n $array = array(\n 'userAgent' => $u_agent,\n 'name' => $bname,\n 'version' => $version,\n 'platform' => $platform,\n 'bname' => strtolower($ub),\n 'pattern' => $pattern\n );\n\n if ($assign)\n assign($assign, $array); else\n return $array;\n}",
"function browser_data()\n{\n $u_agent = $_SERVER['HTTP_USER_AGENT'];\n $bname = 'Unknown';\n $platform = 'Unknown';\n $version= \"\";\n //First get the platform?\n if (preg_match('/linux/i', $u_agent)) {\n $platform = 'linux';\n }\n elseif (preg_match('/macintosh|mac os x/i', $u_agent)) {\n $platform = 'mac';\n }\n elseif (preg_match('/windows|win32/i', $u_agent)) {\n $platform = 'windows';\n }\n // Next get the name of the useragent yes seperately and for good reason\n if(preg_match('/MSIE/i',$u_agent) && !preg_match('/Opera/i',$u_agent))\n {\n $bname = 'Internet Explorer';\n $ub = \"MSIE\";\n }\n elseif(preg_match('/Firefox/i',$u_agent))\n {\n $bname = 'Mozilla Firefox';\n $ub = \"Firefox\";\n }\n elseif(preg_match('/Chrome/i',$u_agent))\n {\n $bname = 'Google Chrome';\n $ub = \"Chrome\";\n }\n elseif(preg_match('/Safari/i',$u_agent))\n {\n $bname = 'Apple Safari';\n $ub = \"Safari\";\n }\n elseif(preg_match('/Opera/i',$u_agent))\n {\n $bname = 'Opera';\n $ub = \"Opera\";\n }\n elseif(preg_match('/Netscape/i',$u_agent))\n {\n $bname = 'Netscape';\n $ub = \"Netscape\";\n }\n // finally get the correct version number\n $known = array('Version', $ub, 'other');\n $pattern = '#(?<browser>' . join('|', $known) .\n ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';\n if (!preg_match_all($pattern, $u_agent, $matches)) {\n // we have no matching number just continue\n }\n // see how many we have\n $i = count($matches['browser']);\n if ($i != 1) {\n //we will have two since we are not using 'other' argument yet\n //see if version is before or after the name\n if (strripos($u_agent,\"Version\") < strripos($u_agent,$ub)){\n $version= $matches['version'][0];\n }\n else {\n $version= $matches['version'][1];\n }\n }\n else {\n $version= $matches['version'][0];\n }\n // check if we have a number\n if ($version==null || $version==\"\") {$version=\"?\";}\n return array(\n 'userAgent' => $u_agent,\n 'name' => $bname,\n 'version' => $version,\n 'platform' => $platform,\n 'pattern' => $pattern\n );\n}",
"private function detect() {\n// $browser = array(\"IE\", \"OPERA\", \"MOZILLA\", \"NETSCAPE\", \"FIREFOX\", \"SAFARI\", \"CHROME\");\n $os = array(\"WIN\", \"MAC\", \"LINUX\");\n\n # definimos unos valores por defecto para el navegador y el sistema operativo\n// $info['browser'] = \"OTHER\";\n $info['os'] = \"OTHER\";\n\n # buscamos el navegador con su sistema operativo\n// foreach ($browser as $parent) {\n// $s = strpos(strtoupper($_SERVER['HTTP_USER_AGENT']), $parent);\n// $f = $s + strlen($parent);\n// $version = substr($_SERVER['HTTP_USER_AGENT'], $f, 15);\n// $version = preg_replace('/[^0-9,.]/', '', $version);\n// if ($s) {\n// $info['browser'] = $parent;\n// $info['version'] = $version;\n// }\n// }\n # obtenemos el sistema operativo\n foreach ($os as $val) {\n if (strpos(strtoupper($_SERVER['HTTP_USER_AGENT']), $val) !== false)\n $info['os'] = $val;\n }\n\n # devolvemos el array de valores\n return $info;\n }",
"function getBrowser() \n \t{ \n\t\t$u_agent = $_SERVER['HTTP_USER_AGENT']; \n\t\t$bname = 'Unknown';\n\t\t$platform = 'Unknown';\n\t\t$version = \"\";\n\n\t \t//First get the platform?\n\t \tif (preg_match('/linux/i', $u_agent)) {\n\t $platform = 'linux';\n\t \t} elseif (preg_match('/macintosh|mac os x/i', $u_agent)) {\n\t $platform = 'mac';\n\t \t} elseif (preg_match('/windows|win32/i', $u_agent)) {\n\t $platform = 'windows';\n\t \t}\n\t\n\t \t// Next get the name of the useragent yes seperately and for good reason\n\t \tif(preg_match('/MSIE/i',$u_agent) && !preg_match('/Opera/i',$u_agent)) \n\t \t{ \n\t \t$bname = 'Internet Explorer'; \n\t \t$ub = \"MSIE\"; \n\t \t} \n\t \telseif(preg_match('/Firefox/i',$u_agent)) \n\t \t{ \n\t \t$bname = 'Mozilla Firefox'; \n\t \t$ub = \"Firefox\"; \n\t \t} \n\t \telseif(preg_match('/Chrome/i',$u_agent)) \n\t \t{ \n\t \t$bname = 'Google Chrome'; \n\t \t$ub = \"Chrome\"; \n\t \t} \n\t \telseif(preg_match('/Safari/i',$u_agent)) \n\t \t{ \n\t \t$bname = 'Apple Safari'; \n\t \t$ub = \"Safari\"; \n\t \t} \n\t \telseif(preg_match('/Opera/i',$u_agent)) \n\t \t{ \n\t \t$bname = 'Opera'; \n\t \t$ub = \"Opera\"; \n\t \t} \n\t \telseif(preg_match('/Netscape/i',$u_agent)) \n\t \t{ \n\t \t$bname = 'Netscape'; \n\t \t\t$ub = \"Netscape\"; \n\t \t} \n\n \t\t// finally get the correct version number\n \t\t$known = array('Version', $ub, 'other');\n \t\t$pattern = '#(?<browser>' . join('|', $known) .')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';\n \t\tif (!preg_match_all($pattern, $u_agent, $matches)) {\n \t\t// we have no matching number just continue\n \t\t}\n\n \t\t// see how many we have\n \t\t$i = count($matches['browser']);\n\t\tif ($i != 1) \n\t\t{\n\t\t\t//we will have two since we are not using 'other' argument yet\n\t\t\t//see if version is before or after the name\n \t\tif (strripos($u_agent,\"Version\") < strripos($u_agent,$ub))\n\t\t\t{\n \t\t\t$version= $matches['version'][0];\n \t\t}\n \t\telse \n\t\t\t{\n \t\t\t$version= $matches['version'][1];\n \t\t}\n \t\t}\n \t\telse \n\t\t{\n \t\t$version= $matches['version'][0];\n \t\t}\n\n \t\t// check if we have a number\n \t\tif ($version==null || $version==\"\") {$version=\"?\";}\n\n \t\treturn array(\n\t\t\t\t'userAgent' => $u_agent,\n\t\t\t\t'name' => $bname,\n\t\t\t\t'version' => $version,\n\t\t\t\t'platform' => $platform,\n\t\t\t\t'pattern' => $pattern\n \t\t\t );\n \t}",
"function getBrowser() \r\n\t{ \r\n\t\t$u_agent = $_SERVER['HTTP_USER_AGENT']; \r\n\t\t$bname = 'Unknown';\r\n\t\t$platform = 'Unknown';\r\n\t\t$version= \"\";\r\n\r\n\t\t//First get the platform?\r\n\t\tif (preg_match('/linux/i', $u_agent)) {\r\n\t\t\t$platform = 'linux';\r\n\t\t}\r\n\t\telseif (preg_match('/macintosh|mac os x/i', $u_agent)) {\r\n\t\t\t$platform = 'mac';\r\n\t\t}\r\n\t\telseif (preg_match('/windows|win32/i', $u_agent)) {\r\n\t\t\t$platform = 'windows';\r\n\t\t}\r\n\t\t\r\n\t\t// Next get the name of the useragent yes seperately and for good reason\r\n\t\tif(preg_match('/MSIE/i',$u_agent) && !preg_match('/Opera/i',$u_agent)) \r\n\t\t{ \r\n\t\t\t$bname = 'Internet Explorer'; \r\n\t\t\t$ub = \"MSIE\"; \r\n\t\t} \r\n\t\telseif(preg_match('/Firefox/i',$u_agent)) \r\n\t\t{ \r\n\t\t\t$bname = 'Mozilla Firefox'; \r\n\t\t\t$ub = \"Firefox\"; \r\n\t\t} \r\n\t\telseif(preg_match('/Chrome/i',$u_agent)) \r\n\t\t{ \r\n\t\t\t$bname = 'Google Chrome'; \r\n\t\t\t$ub = \"Chrome\"; \r\n\t\t} \r\n\t\telseif(preg_match('/Safari/i',$u_agent)) \r\n\t\t{ \r\n\t\t\t$bname = 'Apple Safari'; \r\n\t\t\t$ub = \"Safari\"; \r\n\t\t} \r\n\t\telseif(preg_match('/Opera/i',$u_agent)) \r\n\t\t{ \r\n\t\t\t$bname = 'Opera'; \r\n\t\t\t$ub = \"Opera\"; \r\n\t\t} \r\n\t\telseif(preg_match('/Netscape/i',$u_agent)) \r\n\t\t{ \r\n\t\t\t$bname = 'Netscape'; \r\n\t\t\t$ub = \"Netscape\"; \r\n\t\t} \r\n\t\t\r\n\t\t// finally get the correct version number\r\n\t\t$known = array('Version', $ub, 'other');\r\n\t\t$pattern = '#(?<browser>' . join('|', $known) .\r\n\t\t')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';\r\n\t\tif (!preg_match_all($pattern, $u_agent, $matches)) {\r\n\t\t\t// we have no matching number just continue\r\n\t\t}\r\n\t\t\r\n\t\t// see how many we have\r\n\t\t$i = count($matches['browser']);\r\n\t\tif ($i != 1) {\r\n\t\t\t//we will have two since we are not using 'other' argument yet\r\n\t\t\t//see if version is before or after the name\r\n\t\t\tif (strripos($u_agent,\"Version\") < strripos($u_agent,$ub)){\r\n\t\t\t\t$version= $matches['version'][0];\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$version= $matches['version'][1];\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$version= $matches['version'][0];\r\n\t\t}\r\n\t\t\r\n\t\t// check if we have a number\r\n\t\tif ($version==null || $version==\"\") {$version=\"?\";}\r\n\t\t\r\n\t\treturn array(\r\n\t\t\t'userAgent' => $u_agent,\r\n\t\t\t'name' => $bname,\r\n\t\t\t'version' => $version,\r\n\t\t\t'platform' => $platform,\r\n\t\t\t'pattern' => $pattern\r\n\t\t);\r\n\t}",
"public static function getClientBrowserInfo(){\n $browser = get_browser(null, true);\n //must match db column names for keys\n $myArray = array(\n 'BrowserName' => $browser['browser'],\n 'BrowserVersion' => $browser['version'],\n 'BrowserPlatform' => $browser['platform'],\n 'BrowserCSSVersion' => $browser['cssversion'],\n 'BrowserJSEnabled' => $browser['javascript']\n );\n\n return $myArray;\n }",
"private function acquire_browser_name(){\n $user_OSagent = $this->userAgent['HTTP_USER_AGENT'];\n if (strpos($user_OSagent, \"Maxthon\") && strpos($user_OSagent, \"MSIE\")) {\n $visitor_browser = \"Maxthon(Microsoft IE)\";\n } elseif (strpos($user_OSagent, \"Maxthon 2.0\")) {\n $visitor_browser = \"Maxthon 2.0\";\n } elseif (strpos($user_OSagent, \"Maxthon\")) {\n $visitor_browser = \"Maxthon\";\n } elseif (strpos($user_OSagent, \"Edge\")) {\n $visitor_browser = \"Edge\";\n } elseif (strpos($user_OSagent, \"Trident\")) {\n $visitor_browser = \"IE\";\n } elseif (strpos($user_OSagent, \"MSIE\")) {\n $visitor_browser = \"IE\";\n } elseif (strpos($user_OSagent, \"MSIE\")) {\n $visitor_browser = \"MSIE 较高版本\";\n } elseif (strpos($user_OSagent, \"NetCaptor\")) {\n $visitor_browser = \"NetCaptor\";\n } elseif (strpos($user_OSagent, \"Netscape\")) {\n $visitor_browser = \"Netscape\";\n } elseif (strpos($user_OSagent, \"Chrome\")) {\n $visitor_browser = \"Chrome\";\n } elseif (strpos($user_OSagent, \"Lynx\")) {\n $visitor_browser = \"Lynx\";\n } elseif (strpos($user_OSagent, \"Opera\")) {\n $visitor_browser = \"Opera\";\n } elseif (strpos($user_OSagent, \"MicroMessenger\")) {\n $visitor_browser = \"微信浏览器\";\n } elseif (strpos($user_OSagent, \"Konqueror\")) {\n $visitor_browser = \"Konqueror\";\n } elseif (strpos($user_OSagent, \"Mozilla/5.0\")) {\n $visitor_browser = \"Mozilla\";\n } elseif (strpos($user_OSagent, \"Firefox\")) {\n $visitor_browser = \"Firefox\";\n } elseif (strpos($user_OSagent, \"U\")) {\n $visitor_browser = \"Firefox\";\n } elseif (strpos($user_OSagent, \"Safari\") && !strpos($user_OSagent, \"Chrome\")) {\n $visitor_browser = \"Safari\";\n } else {\n $visitor_browser = \"unknown\";\n }\n return $visitor_browser;\n }",
"public function browscap() {\n $browser = get_browser(null, true);\n $data = array();\n\n $data['browser'] = $browser['browser'].\" \".$browser['version'];\n $data['system'] = $browser['platform'];\n $data['device'] = $browser['device_type'];\n\n if ($data['browser'] == \" \")\n $data['browser'] = null;\n\n return $data;\n }",
"public function get_browser()\n\t{\n\t\tif (preg_match ( '|MSIE ([0-9].[0-9]{1,2})|', $_SERVER ['HTTP_USER_AGENT'], $matched )) {\n\t\t\t$browser_version = $matched[1];\n\t\t\t$browser = 'Internet Explorer';\n\t\t} elseif (preg_match ( '|Opera/([0-9].[0-9]{1,2})|', $_SERVER ['HTTP_USER_AGENT'], $matched )) {\n\t\t\t$browser_version = $matched [1];\n\t\t\t$browser = 'Opera';\n\t\t} elseif (preg_match ( '|Firefox/([0-9\\.]+)|', $_SERVER ['HTTP_USER_AGENT'], $matched )) {\n\t\t\t$browser_version = $matched [1];\n\t\t\t$browser = 'Firefox';\n\t\t} elseif (preg_match ( '|Chrome/([0-9\\.]+)|', $_SERVER ['HTTP_USER_AGENT'], $matched )) {\n\t\t\t$browser_version = $matched [1];\n\t\t\t$browser = 'Chrome';\n\t\t} elseif (preg_match ( '|Safari/([0-9\\.]+)|', $_SERVER ['HTTP_USER_AGENT'], $matched )) {\n\t\t\t$browser_version = $matched [1];\n\t\t\t$browser = 'Safari';\n\t\t} else {\n\t\t\t$browser_version = '-';\n\t\t\t$browser = __('Unidentified', 'W2P');\n\t\t}\n\t\treturn array('browser'=>$browser, 'version'=>$browser_version);\n\t}",
"function browserDetect() {\r\n\r\n\t$browser=array(\"IE\",\"OPERA\",\"MOZILLA\",\"NETSCAPE\",\"FIREFOX\",\"SAFARI\",\"CHROME\");\r\n\t$os=array(\"WIN\",\"MAC\",\"LINUX\");\r\n\r\n\t# definimos unos valores por defecto para el navegador y el sistema operativo\r\n\t$info['browser'] = \"OTHER\";\r\n\r\n\t# buscamos el navegador con su sistema operativo\r\n\tforeach($browser as $parent){\r\n\t\t$userAgent='OTHER';\r\n\t\t\r\n\t\tif (isset($_SERVER['HTTP_USER_AGENT'])) {\r\n\t\t\t$userAgent=$_SERVER['HTTP_USER_AGENT'];\r\n\t\t}\r\n\r\n\t\t$s = strpos(strtoupper($userAgent), $parent);\r\n\t\t$f = $s + strlen($parent);\r\n\t\r\n\t\t$version = substr($userAgent, $f, 15);\r\n\t\t$version = preg_replace('/[^0-9,.]/','',$version);\r\n\t\r\n\t\tif ($s){\r\n\t\t\t$info['browser'] = $parent;\r\n\t\t}\r\n\t}\r\n\r\n\t# devolvemos el valor del browser\r\n\treturn $info['browser'];\r\n\r\n}",
"public function getBrowser() { return $this->_browser_name; }",
"function getBrowser() {\n $u_agent = $_SERVER['HTTP_USER_AGENT'];\n $bname = 'Unknown';\n $platform = 'Unknown';\n $version= \"\";\n\n //First get the platform?\n if (preg_match('/linux/i', $u_agent)) {\n $platform = 'linux';\n }\n else if (preg_match('/macintosh|mac os x/i', $u_agent)) {\n $platform = 'mac';\n }\n else if (preg_match('/windows|win32/i', $u_agent)) {\n $platform = 'windows';\n }\n\n // Next get the name of the useragent yes seperately and for good reason\n if(preg_match('/MSIE/i',$u_agent) && !preg_match('/Opera/i',$u_agent)) {\n $bname = 'Internet Explorer';\n $ub = \"MSIE\";\n }\n else if(preg_match('/Trident/i',$u_agent)) { \n\t\t// this condition is for IE11\n $bname = 'Internet Explorer';\n $ub = \"rv\";\n }\n else if(preg_match('/Firefox/i',$u_agent)) {\n $bname = 'Mozilla Firefox';\n $ub = \"Firefox\";\n }\n else if (preg_match('/Edge/i',$u_agent)) {\n $bname = 'Microsoft Edge';\n $ub = \"Edge\";\n }\n else if(preg_match('/Chrome/i',$u_agent)) {\n $bname = 'Google Chrome';\n $ub = \"Chrome\";\n }\n else if(preg_match('/Safari/i',$u_agent)) {\n $bname = 'Apple Safari';\n $ub = \"Safari\";\n }\n else if(preg_match('/Opera/i',$u_agent)) {\n $bname = 'Opera';\n $ub = \"Opera\";\n }\n else if(preg_match('/Netscape/i',$u_agent)) {\n $bname = 'Netscape';\n $ub = \"Netscape\";\n }\n \n // finally get the correct version number\n // Added \"|:\"\n $known = array('Version', $ub, 'other');\n\t$pattern = '#(?<browser>' . join('|', $known).')[/|: ]+(?<version>[0-9.|a-zA-Z.]*)#';\n if (!preg_match_all($pattern, $u_agent, $matches)) {\n // we have no matching number just continue\n }\n\n // see how many we have\n $i = count($matches['browser']);\n if ($i != 1) {\n //we will have two since we are not using 'other' argument yet\n //see if version is before or after the name\n if (strripos($u_agent,\"Version\") < strripos($u_agent,$ub)){\n $version= $matches['version'][0];\n }\n else {\n $version= $matches['version'][1];\n }\n }\n else {\n $version= $matches['version'][0];\n }\n\n // check if we have a number\n if ($version==null || $version==\"\") {$version=\"?\";}\n\n return array(\n 'userAgent' => $u_agent,\n 'name' => $bname,\n 'version' => $version,\n 'platform' => $platform,\n 'pattern' => $pattern\n );\n}",
"function getBrowser()\n {\n return $_SERVER['HTTP_USER_AGENT'];\n }",
"static public function detectBrowser() {\n\n // The following determines the user agent (browser) as best it can.\n $return = array(\n 'is_opera' => strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false,\n 'is_opera6' => strpos($_SERVER['HTTP_USER_AGENT'], 'Opera 6') !== false,\n 'is_opera7' => strpos($_SERVER['HTTP_USER_AGENT'], 'Opera 7') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera/7') !== false,\n 'is_opera8' => strpos($_SERVER['HTTP_USER_AGENT'], 'Opera 8') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera/8') !== false,\n 'is_opera9' => preg_match('~Opera[ /]9(?!\\\\.[89])~', $_SERVER['HTTP_USER_AGENT']) === 1,\n 'is_opera10' => preg_match('~Opera[ /]10\\\\.~', $_SERVER['HTTP_USER_AGENT']) === 1 || (preg_match('~Opera[ /]9\\\\.[89]~', $_SERVER['HTTP_USER_AGENT']) === 1 && preg_match('~Version/1[0-9]\\\\.~', $_SERVER['HTTP_USER_AGENT']) === 1),\n 'is_ie4' => strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 4') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'WebTV') === false,\n 'is_webkit' => strpos($_SERVER['HTTP_USER_AGENT'], 'AppleWebKit') !== false,\n 'is_mac_ie' => strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false,\n 'is_web_tv' => strpos($_SERVER['HTTP_USER_AGENT'], 'WebTV') !== false,\n 'is_konqueror' => strpos($_SERVER['HTTP_USER_AGENT'], 'Konqueror') !== false,\n 'is_firefox' => preg_match('~(?:Firefox|Ice[wW]easel|IceCat)/~', $_SERVER['HTTP_USER_AGENT']) === 1,\n 'is_firefox1' => preg_match('~(?:Firefox|Ice[wW]easel|IceCat)/1\\\\.~', $_SERVER['HTTP_USER_AGENT']) === 1,\n 'is_firefox2' => preg_match('~(?:Firefox|Ice[wW]easel|IceCat)/2\\\\.~', $_SERVER['HTTP_USER_AGENT']) === 1,\n 'is_firefox3' => preg_match('~(?:Firefox|Ice[wW]easel|IceCat|Shiretoko|Minefield)/3\\\\.~', $_SERVER['HTTP_USER_AGENT']) === 1,\n 'is_iphone' => strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'iPod') !== false,\n 'is_ipad' => strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') !== false,\n 'is_android' => strpos($_SERVER['HTTP_USER_AGENT'], 'Android') !== false,\n 'is_midp' => strpos($_SERVER['HTTP_USER_AGENT'], 'MIDP') !== false,\n 'is_symbian' => strpos($_SERVER['HTTP_USER_AGENT'], 'Symbian') !== false,\n );\n\n $return['is_chrome'] = $return['is_webkit'] && strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== false;\n $return['is_safari'] = !$return['is_chrome'] && strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') !== false;\n $return['is_gecko'] = strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false && !$return['is_webkit'] && !$return['is_konqueror'];\n\n // Internet Explorer 5 and 6 are often \"emulated\".\n $return['is_ie8'] = !$return['is_opera'] && !$return['is_gecko'] && !$return['is_web_tv'] && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 8') !== false;\n $return['is_ie7'] = !$return['is_opera'] && !$return['is_gecko'] && !$return['is_web_tv'] && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') !== false && !$return['is_ie8'];\n $return['is_ie6'] = !$return['is_opera'] && !$return['is_gecko'] && !$return['is_web_tv'] && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6') !== false && !$return['is_ie8'] && !$return['is_ie7'];\n $return['is_ie5.5'] = !$return['is_opera'] && !$return['is_gecko'] && !$return['is_web_tv'] && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.5') !== false;\n $return['is_ie5'] = !$return['is_opera'] && !$return['is_gecko'] && !$return['is_web_tv'] && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.0') !== false;\n\n $return['is_ie'] = $return['is_ie4'] || $return['is_ie5'] || $return['is_ie5.5'] || $return['is_ie6'] || $return['is_ie7'] || $return['is_ie8'];\n // Before IE8 we need to fix IE... lots!\n $return['ie_standards_fix'] = !$return['is_ie8'];\n\n $return['needs_size_fix'] = ($return['is_ie5'] || $return['is_ie5.5'] || $return['is_ie4'] || $return['is_opera6']) && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') === false;\n\n // This isn't meant to be reliable, it's just meant to catch most bots to prevent PHPSESSID from showing up.\n $return['possibly_robot'] = !empty($user_info['possibly_robot']);\n\n // Robots shouldn't be logging in or registering. So, they aren't a bot. Better to be wrong than sorry (or people won't be able to log in!), anyway.\n if ((isset($_REQUEST['action']) && in_array($_REQUEST['action'], array('login', 'login2', 'register'))) || !$user_info['is_guest'])\n $return['possibly_robot'] = false;\n\n\n if (strpos($_SERVER['HTTP_USER_AGENT'], 'BlackBerry') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Blackberry') !== false) {\n $return['is_blackberry'] = 1;\n if (strpos($_SERVER['HTTP_USER_AGENT'], '6.0') !== false) {\n $return['is_blackberry_os6'] = 1;\n } else if (strpos($_SERVER['HTTP_USER_AGENT'], '5.0') !== false) {\n $return['is_blackberry_os5'] = 1;\n } else {\n $return['is_blackberry_os4'] = 1;\n }\n }\n\n\n return $return;\n }",
"function getBrowser()\r\n {\r\n //Gets the name of the web browser the user is using from the web server\r\n $u_agent = $_SERVER['HTTP_USER_AGENT'];\r\n //Declares variable\r\n $ub = \"\";\r\n\r\n //Checks if the web browser name matches the name '/MSIE/i'\r\n if (preg_match('/MSIE/i',$u_agent))\r\n {\r\n //Stores the browser name\r\n $ub = \"Internet Explorer\";\r\n }\r\n\r\n //Checks if the web browser name matches the name '/Edge/i'\r\n elseif (preg_match('/Edge/i',$u_agent))\r\n {\r\n //Stores the browser name \r\n $ub = \"Microsoft Edge\";\r\n }\r\n\r\n //Checks if the web browser name matches the name '/WOW64/i'\r\n elseif (preg_match('/WOW64/i',$u_agent))\r\n {\r\n //Stores the browser name \r\n $ub = \"Internet Eplorer 11+\";\r\n }\r\n\r\n //Checks if the web browser name matches the name '/Firefox/i'\r\n elseif (preg_match('/Firefox/i',$u_agent))\r\n {\r\n //Stores the browser name \r\n $ub = \"Mozilla Firefox\";\r\n }\r\n\r\n //Checks if the web browser name matches the name '/Chrome/i'\r\n elseif (preg_match('/Chrome/i',$u_agent))\r\n {\r\n //Stores the browser name \r\n $ub = \"Google Chrome\";\r\n }\r\n\r\n //Checks if the web browser name matches the name '/Safari/i'\r\n elseif (preg_match('/Safari/i',$u_agent))\r\n {\r\n //Stores the browser name\r\n $ub = \"Safari\";\r\n }\r\n\r\n //Returns and displays the name of the browser stored in the variable $ub\r\n return $ub;\r\n }",
"public function getBrowser()\n {\n return $this->_browser_name;\n }",
"protected function checkBrowser() {\n\t\t\tforeach ($this->browsers as $regex => $value) { \n\t\t\t\tif (preg_match($regex, $this->agent ) ) {\n\t\t\t\t\t$this->browserName = $value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function getBrowserPlatform ()\n\t{\n\t return $this->platform;\n\t}",
"function getBrowser()\r\n {\r\n //Gets the name of the web browser the user is using from the web server\r\n $u_agent = $_SERVER['HTTP_USER_AGENT'];\r\n //Declares variable\r\n $ub = \"\";\r\n \r\n //Checks if the web browser name matches the name '/MSIE/i'\r\n if (preg_match('/MSIE/i',$u_agent))\r\n {\r\n //Stores the browser name\r\n $ub = \"Internet Explorer\";\r\n }\r\n \r\n //Checks if the web browser name matches the name '/Edge/i'\r\n elseif (preg_match('/Edge/i',$u_agent))\r\n {\r\n //Stores the browser name \r\n $ub = \"Microsoft Edge\";\r\n }\r\n \r\n //Checks if the web browser name matches the name '/WOW64/i'\r\n elseif (preg_match('/WOW64/i',$u_agent))\r\n {\r\n //Stores the browser name \r\n $ub = \"Internet Eplorer 11+\";\r\n }\r\n \r\n //Checks if the web browser name matches the name '/Firefox/i'\r\n elseif (preg_match('/Firefox/i',$u_agent))\r\n {\r\n //Stores the browser name \r\n $ub = \"Mozilla Firefox\";\r\n }\r\n \r\n //Checks if the web browser name matches the name '/Chrome/i'\r\n elseif (preg_match('/Chrome/i',$u_agent))\r\n {\r\n //Stores the browser name \r\n $ub = \"Google Chrome\";\r\n }\r\n \r\n //Checks if the web browser name matches the name '/Safari/i'\r\n elseif (preg_match('/Safari/i',$u_agent))\r\n {\r\n //Stores the browser name\r\n $ub = \"Safari\";\r\n }\r\n \r\n //Returns and displays the name of the browser stored in the variable $ub\r\n return $ub;\r\n }",
"public function getProperties() {\n if ($this->userAgent == 'UNKNOWN')\n return false;\n return get_browser($this->userAgent);\n }",
"public static function browser()\n {\n $user_agent = $_SERVER['HTTP_USER_AGENT'];\n $browser = \"Unknown Browser\";\n $browser_array = array(\n '/msie/i' => 'Internet Explorer',\n '/firefox/i' => 'Firefox',\n '/safari/i' => 'Safari',\n '/chrome/i' => 'Chrome',\n '/opera/i' => 'Opera',\n '/netscape/i' => 'Netscape',\n '/maxthon/i' => 'Maxthon',\n '/konqueror/i' => 'Konqueror',\n '/mobile/i' => 'Handheld Browser'\n );\n $found = false;\n $device = '';\n foreach ($browser_array as $regex => $value)\n {\n if($found)\n break;\n else if (preg_match($regex, $user_agent,$result))\n {\n $browser = $value;\n $found = true;\n }\n }\n return $browser;\n }",
"static function getBrowser() {\n global $_SERVER;\n $user_agent = $_SERVER['HTTP_USER_AGENT'];\n $browser\t\t= \"Unknown Browser\";\n $browser_array = array(\n '/msie/i'\t => 'Internet Explorer',\n '/firefox/i'\t=> 'Firefox',\n '/safari/i'\t => 'Safari',\n '/chrome/i'\t => 'Chrome',\n '/edge/i'\t => 'Edge',\n '/opera/i'\t => 'Opera',\n '/netscape/i' => 'Netscape',\n '/maxthon/i'\t=> 'Maxthon',\n '/konqueror/i' => 'Konqueror',\n '/mobile/i'\t => 'Handheld Browser'\n );\n foreach ($browser_array as $regex => $value) {\n if (preg_match($regex, $user_agent)) {\n $browser\t= $value;\n }\n }\n return $browser;\n }",
"public function getBrowser()\n {\n return $this->browser;\n }",
"function getBrowserInfo($size='short'){\n\tif($size == 'short') return $_SERVER['HTTP_USER_AGENT'];\n\telse return get_browser();\n}"
] | [
"0.7714099",
"0.7469502",
"0.73301864",
"0.7319157",
"0.7237415",
"0.7154706",
"0.71169025",
"0.70620733",
"0.7033054",
"0.701325",
"0.70056623",
"0.69584227",
"0.6945443",
"0.69325566",
"0.6929715",
"0.69151324",
"0.67649823",
"0.67424405",
"0.67181396",
"0.66952956",
"0.66833144",
"0.66761917",
"0.6665019",
"0.6661196",
"0.6646997",
"0.66023004",
"0.65779597",
"0.6572743",
"0.64808226",
"0.64548606"
] | 0.8308007 | 0 |
/ ON SELECT Puts a limit on the number of results returned from the query. Only for SELECTs, sets SELECT if not already set | public function limit(int $limit)
{
// Set operation to select
$this->operation = "SELECT";
// Set the limit value
$this->limit_value = $limit;
// Return
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function applyLimit(&$sql, $limit, $offset);",
"function limit($sql, $limit, $offset = 0);",
"protected function _applyLimitToQuery() {\n\t\t$this->query()->limit($this->_pageLimit);\n\t}",
"function limit($sql, $offset, $limit);",
"public function limit($limit) {\n $this->innerQuery->limit($limit);\n }",
"public static function set_limit($limit)\n\t{\n\t\tself::get_query()->take($limit);\n\t}",
"public function limit($limit = null) {\n\t\t$this->_queryOptions['limit'] = $limit;\n\t}",
"public function limit(int $limit) :ISelect\n {\n $this->limit = $limit;\n return $this;\n }",
"public function select()\n\t{\n\t\tif(empty($this->query->limit))\n\t\t{\n\t\t\t// No limit so we can just execute a normal query\n\n\t\t\treturn parent::select();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// There is a limit so we need to emulate the LIMIT/OFFSET clause with ANSI-SQL\n\n\t\t\t$order = trim($this->orderings($this->query->orderings));\n\n\t\t\tif(empty($order))\n\t\t\t{\n\t\t\t\t$order = 'ORDER BY (SELECT 0)';\n\t\t\t}\n\n\t\t\t$sql = $this->query->distinct ? 'SELECT DISTINCT ' : 'SELECT ';\n\t\t\t$sql .= $this->columns($this->query->columns);\n\t\t\t$sql .= ', ROW_NUMBER() OVER (' . $order . ') AS mako_rownum';\n\t\t\t$sql .= ' FROM ';\n\t\t\t$sql .= $this->wrap($this->query->table);\n\t\t\t$sql .= $this->joins($this->query->joins);\n\t\t\t$sql .= $this->wheres($this->query->wheres);\n\t\t\t$sql .= $this->groupings($this->query->groupings);\n\t\t\t$sql .= $this->havings($this->query->havings);\n\n\t\t\t$offset = empty($this->query->offset) ? 0 : $this->query->offset;\n\n\t\t\t$limit = $offset + $this->query->limit;\n\t\t\t$offset = $offset + 1;\n\n\t\t\t$sql = 'SELECT * FROM (' . $sql . ') AS m1 WHERE mako_rownum BETWEEN ' . $offset . ' AND ' . $limit;\n\n\t\t\treturn array('sql' => $sql, 'params' => $this->params);\n\t\t}\n\t}",
"protected function get_select_sql($condition, $order, $limit) {\n //Overwrite\n }",
"public function limit(int $limit = 0): Select\n {\n if (!\\is_int($limit) || $limit <= 0) {\n throw new InvalidArgumentException('$limit have to be a positive integer');\n }\n $this->limit = $limit;\n return $this;\n }",
"public function limit($limit) {\r\n $this->_SQL['limit'] = $limit;\r\n return $this;\r\n }",
"function DBselect($query, $limit = null, $offset = 0) {\n\tglobal $DB;\n\n\t$result = false;\n\n\tif (!isset($DB['DB']) || empty($DB['DB'])) {\n\t\treturn $result;\n\t}\n\n\t// add the LIMIT clause\n\tif(!$query = DBaddLimit($query, $limit, $offset)) {\n\t\treturn false;\n\t}\n\n\t$time_start = microtime(true);\n\t$DB['SELECT_COUNT']++;\n\n\tswitch ($DB['TYPE']) {\n\t\tcase ZBX_DB_MYSQL:\n\t\t\tif (!$result = mysqli_query($DB['DB'], $query)) {\n\t\t\t\terror('Error in query ['.$query.'] ['.mysqli_error($DB['DB']).']');\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ZBX_DB_POSTGRESQL:\n\t\t\tif (!$result = pg_query($DB['DB'], $query)) {\n\t\t\t\terror('Error in query ['.$query.'] ['.pg_last_error().']');\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ZBX_DB_ORACLE:\n\t\t\tif (!$result = oci_parse($DB['DB'], $query)) {\n\t\t\t\t$e = @oci_error();\n\t\t\t\terror('SQL error ['.$e['message'].'] in ['.$e['sqltext'].']');\n\t\t\t}\n\t\t\telseif (!@oci_execute($result, ($DB['TRANSACTIONS'] ? OCI_DEFAULT : OCI_COMMIT_ON_SUCCESS))) {\n\t\t\t\t$e = oci_error($result);\n\t\t\t\terror('SQL error ['.$e['message'].'] in ['.$e['sqltext'].']');\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ZBX_DB_DB2:\n\t\t\t$options = array();\n\t\t\tif ($DB['TRANSACTIONS']) {\n\t\t\t\t$options['autocommit'] = DB2_AUTOCOMMIT_OFF;\n\t\t\t}\n\n\t\t\tif (!$result = db2_prepare($DB['DB'], $query)) {\n\t\t\t\t$e = @db2_stmt_errormsg($result);\n\t\t\t\terror('SQL error ['.$query.'] in ['.$e.']');\n\t\t\t}\n\t\t\telseif (true !== @db2_execute($result, $options)) {\n\t\t\t\t$e = @db2_stmt_errormsg($result);\n\t\t\t\terror('SQL error ['.$query.'] in ['.$e.']');\n\t\t\t\t$result = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ZBX_DB_SQLITE3:\n\t\t\tif ($DB['TRANSACTIONS'] == 0) {\n\t\t\t\tlock_sqlite3_access();\n\t\t\t}\n\t\t\tif (false === ($result = $DB['DB']->query($query))) {\n\t\t\t\terror('Error in query ['.$query.'] Error code ['.$DB['DB']->lastErrorCode().'] Message ['.$DB['DB']->lastErrorMsg().']');\n\t\t\t}\n\t\t\tif ($DB['TRANSACTIONS'] == 0) {\n\t\t\t\tunlock_sqlite3_access();\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\t// $result is false only if an error occured\n\tif ($DB['TRANSACTION_NO_FAILED_SQLS'] && !$result) {\n\t\t$DB['TRANSACTION_NO_FAILED_SQLS'] = false;\n\t}\n\n\tCProfiler::getInstance()->profileSql(microtime(true) - $time_start, $query);\n\treturn $result;\n}",
"public function queryMore(SelectQueryResult $results);",
"public function limit($limit)\n {\n if ($this->containsSQLParts('limit')) {\n throw new DatabaseStatementException('DatabaseQuery can not hold more than one limit clause');\n }\n $limit = General::intval($limit);\n if ($limit === -1) {\n throw new DatabaseStatementException(\"Invalid limit value: `$limit`\");\n }\n $this->unsafeAppendSQLPart('limit', \"LIMIT $limit\");\n return $this;\n }",
"abstract function HookLimit($strSQL, $intLimit);",
"public function SELECTquery($select_fields, $from_table, $where_clause, $groupBy = '', $orderBy = '', $limit = '');",
"public function setLimit(?int $limit): QueryInterface\n {\n $this->limit = $limit;\n $this->queryBuilder->setMaxResults($limit);\n return $this;\n }",
"public function limit( $limit )\n\t{\n\t\t$this->limit = $this->selectors->limit( $limit );\n\t}",
"public function exec_SELECTquery($select_fields, $from_table, $where_clause, $groupBy = '', $orderBy = '', $limit = '');",
"public function limit($limit);",
"public function limit($limit);",
"public function limit($limit);",
"public function limit();",
"public function load(Database_Query_Builder_Select $query = NULL, $limit = 1)\n\t{\n\t\t// Load changed values as search parameters\n\t\t$changed = $this->changed();\n\n\t\tif ( ! $query AND $limit == 1 AND ! count($changed))\n\t\t{\n\t\t\treturn $this;\n\t\t}\n\t\telseif ( ! $query)\n\t\t{\n\t\t\t$query = DB::select();\n\t\t}\n\n\t\t$query->from($this->_table);\n\n\t\t$table = is_array($this->_table) ? $this->_table[1] : $this->_table;\n\n\t\tforeach ($this->_fields as $name => $field)\n\t\t{\n\t\t\tif ( ! $field->in_db)\n\t\t\t{\n\t\t\t\t// Multiple relations cannot be loaded this way\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$query->select(array($field->_database_unwrap(\"{$table}.{$field->column}\"), $name));\n\n\t\t\tif (array_key_exists($name, $changed))\n\t\t\t{\n\t\t\t\t$query->where(\n\t\t\t\t\t\"{$table}.{$field->column}\",\n\t\t\t\t\t'=',\n\t\t\t\t\t$field->_database_wrap($changed[$name]));\n\t\t\t}\n\t\t}\n\n\t\tif ($limit)\n\t\t{\n\t\t\t$query->limit($limit);\n\t\t}\n\n\t\tif ($this->_sorting)\n\t\t{\n\t\t\tforeach ($this->_sorting as $field => $direction)\n\t\t\t{\n\t\t\t\t$query->order_by($field, $direction);\n\t\t\t}\n\t\t}\n\n\t\tif ($limit === 1)\n\t\t{\n\t\t\t$result = $query\n\t\t\t\t->execute($this->_db);\n\n\t\t\tif (count($result))\n\t\t\t{\n\t\t\t\t$this->_changed = array();\n\t\t\t\t$this->state('loading')->values($result[0])->state('loaded');\n\t\t\t}\n\n\t\t\treturn $this;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $query\n\t\t\t\t->as_object(get_class($this))\n\t\t\t\t->execute($this->_db);\n\t\t}\n\t}",
"function limitquery()\n {\n $params = func_get_args();\n $query = array_shift($params);\n $offset = array_shift($params);\n $numrows = array_shift($params);\n\n return $this->_query($query, $offset, $numrows, $params);\n }",
"public function read_limited()\n {\n //Create Query\n $query =\n 'SELECT \n c.category as category_name,\n a.author as author_name,\n q.id,\n q.quote,\n q.authorId,\n q.categoryId \n FROM \n ' .\n $this->table .\n ' q\n LEFT JOIN \n categories c ON q.categoryId = c.id\n LEFT JOIN \n authors a ON q.authorId = a.id\n LIMIT 0,?';\n\n //Prepare Statement\n $stmt = $this->conn->prepare($query);\n\n //Bind ID\n $stmt->bindValue(1, $this->limit, PDO::PARAM_INT);\n\n //Execute query\n $stmt->execute();\n\n return $stmt;\n }",
"public function limit(int $limit): QueryBuilder\n {\n $this->query .= sprintf(' LIMIT %d', $limit);\n\n return $this;\n }",
"public function limit($limit)\n {\n $this->q->limit($limit);\n \n return $this;\n }",
"public function limit($limit)\r\n {\r\n $this->adapter->limit($limit);\r\n \r\n return $this;\r\n }"
] | [
"0.64533085",
"0.63590544",
"0.62776434",
"0.626878",
"0.6106758",
"0.610255",
"0.60110766",
"0.6008943",
"0.59786606",
"0.5918401",
"0.5882403",
"0.5863032",
"0.58464324",
"0.5824775",
"0.5774665",
"0.5756176",
"0.57507837",
"0.57004774",
"0.56942034",
"0.5687653",
"0.56786174",
"0.56786174",
"0.56786174",
"0.5661405",
"0.56613666",
"0.56337994",
"0.5616091",
"0.56129366",
"0.55943",
"0.5592672"
] | 0.66090655 | 0 |
Processes the current instructions and transform them to lexemes, for a INSERT INTO context | private function toLexemesInsertInto(): array
{
// Lexemes
$lexemes = ["INSERT INTO", $this->table];
// If there are no manipulate_columns, throw an exception
if (empty($this->manipulate_columns)) {
throw new \Exception("No columns to insert");
}
// Columns to insert
$lexemes[] = "(";
foreach ($this->manipulate_columns as $index => $column) {
$lexemes[] = $column;
if ($index !== count($this->manipulate_columns) - 1) {
$lexemes[] = ",";
}
}
$lexemes[] = ")";
// Values to insert
$lexemes[] = "VALUES";
$insert_count = count($this->insert_values);
foreach ($this->insert_values as $entity_index => $entity_data) {
// Prepare last column of set for future checking
$keys = array_keys($entity_data);
$last_column_name = end($keys);
$lexemes[] = "(";
foreach ($entity_data as $column_name => $value) {
// Set the key and associated data
$key = $column_name . $entity_index;
$this->data[$key] = $value;
// Write the key as lexeme
$column_attributes = $this->table_columns[$column_name] ?? [];
$to_be_inserted = ":" . $key;
// Check for special attributes
if (array_search("hex", $column_attributes) !== false) {
$lexemes[] = "UNHEX(";
$lexemes[] = $to_be_inserted;
$lexemes[] = ")";
} else if (array_search("timestamp", $column_attributes) !== false) {
$lexemes[] = "FROM_UNIXTIME(";
$lexemes[] = $to_be_inserted;
$lexemes[] = ")";
} else {
$lexemes[] = $to_be_inserted;
}
// If we're not at the end, add a coma
if ($column_name !== $last_column_name) {
$lexemes[] = ",";
}
}
$lexemes[] = ")";
// If this isn't the last set to insert, add a coma
if ($entity_index !== $insert_count - 1) {
$lexemes[] = ",";
}
}
// Finished!
return $lexemes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function processInsert() {\r\n\t\t$columnValues = $this->getPostedColumnValues();\r\n\t\t$this->model->insert($this->table, $columnValues);\r\n\t}",
"function makeInsertQuery($table, $columns, $tokens);",
"private function prepareStatements() {\n $sql = \"INSERT INTO users(username, password, email) VALUES (:user, :password, :email)\";\n $this->insertUser = $this->connection->prepare($sql);\n\n $sql = \"UPDATE users SET username=:userName, password=:password, email=:email WHERE username=:user\";\n $this->updateUser = $this->connection->prepare($sql);\n\n $sql = \"SELECT * FROM users WHERE username=:user\";\n $this->selectUser = $this->connection->prepare($sql);\n\n $sql = \"SELECT * FROM users WHERE id=:id\";\n $this->selectUserById = $this->connection->prepare($sql);\n\n $sql = \"INSERT INTO tokens(token, user_id, expires) VALUES (:token, :user_id, :expires)\";\n $this->insertToken = $this->connection->prepare($sql);\n\n $sql = \"SELECT * FROM tokens WHERE token=:token\";\n $this->selectToken = $this->connection->prepare($sql);\n }",
"public function runInstructions(): void\n {\n $instructions = $this->getInstructions();\n $addressArray = explode(\",\", $instructions);\n\n for ($i = 0; $i < count($addressArray); $i++) {\n $opCode = new OpCode(intval($addressArray[$i]));\n\n switch ($opCode->getInstructionMode()) {\n case OpCode::CODE_ADDITION:\n case OpCode::CODE_MULTIPLY:\n $parameters = [\n $addressArray[$i + 1],\n $addressArray[$i + 2],\n $addressArray[$i + 3]\n ];\n $i += 3;\n break;\n\n case OpCode::CODE_INPUT:\n case OpCode::CODE_OUTPUT:\n $parameters = [\n $addressArray[$i + 1]\n ];\n $i += 1;\n break;\n\n case OpCode::CODE_EXIT:\n $parameters = [];\n break;\n\n default:\n echo \"Undefined OpCode Instruction: \" . $opCode->getInstructionMode() . PHP_EOL;\n exit(1);\n }\n\n $instruction = new Instruction($opCode, $parameters);\n $instruction->run($addressArray);\n }\n }",
"protected function _insert()\n {\n $blRet = parent::_insert();\n\n if ($blRet) {\n //also insert to multilang tables if it is separate\n foreach ($this->_getLanguageSetTables() as $sTable) {\n $sSq = \"insert into $sTable set \" . $this->_getUpdateFieldsForTable($sTable, $this->getUseSkipSaveFields());\n $blRet = $blRet && (bool) oxDb::getDb()->execute($sSq);\n }\n }\n\n return $blRet;\n }",
"public function testInterpreter()\n {\n $expression = new Plus(\n new Variable(\"a\"),\n new Minus(\n new Variable(\"b\"),\n new Variable(\"c\")\n )\n );\n\n $context = new Context([\"a\"=>25, \"b\"=>6, \"c\"=>5]);\n $result = $expression->interpret($context);\n $this->assertEquals(26, $result);\n\n // \"d a b c - + -\";\n $expression = new Minus(\n new Variable(\"d\"),\n new Plus(\n new Variable(\"a\"),\n new Minus(\n new Variable(\"b\"),\n new Variable(\"c\")\n )\n )\n );\n\n $context = new Context([\"a\"=>25, \"b\"=>6, \"c\"=>5, \"d\"=>30]);\n $result = $expression->interpret($context);\n $this->assertEquals(4, $result);\n }",
"function v0_ul_instructions($class, $instructions_container, $undo_file, $full_xml_array, $gen_vd_id, $cc_id, $gen_pub_date, $current_time, $cc_id_load, $cb_ids, $list, $upload_to_db, &$select, &$parents_id, &$errors, &$l_errors) {\n\t// Local variables\n\t$instructions=$instructions_container['value'];\n\t$l_instructions=count($instructions);\n\t\n\t// Loop on instructions\n\tfor ($i=0; $i<$l_instructions; $i++) {\n\t\t// Initialize variables\n\t\t$instruction=$instructions[$i];\n\t\t\n\t\t// Switch case\n\t\tswitch ($instruction['tag']) {\n\t\t\tcase 'INSERT':\n\t\t\t\tif (!v0_ul_insert($instruction, $class, $undo_file, $full_xml_array, $gen_vd_id, $cc_id, $gen_pub_date, $current_time, $cc_id_load, $cb_ids, $select, $upload_to_db, $parents_id, $errors, $l_errors)) {\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'SELECT':\n\t\t\t\tif (!v0_ul_select($instruction, $class, $list, $full_xml_array, $gen_vd_id, $cc_id, $gen_pub_date, $current_time, $cc_id_load, $cb_ids, $parents_id, $select, $errors, $l_errors)) {\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'UPDATE':\n\t\t\t\tif (!v0_ul_update($instruction, $class, $undo_file, $full_xml_array, $gen_vd_id, $cc_id, $gen_pub_date, $current_time, $cc_id_load, $cb_ids, $select, $parents_id, $upload_to_db, $errors, $l_errors)) {\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'DELETE':\n\t\t\t\tif (!v0_ul_delete($instruction, $class, $undo_file, $full_xml_array, $gen_vd_id, $cc_id, $gen_pub_date, $current_time, $cc_id_load, $cb_ids, $select, $parents_id, $upload_to_db, $errors, $l_errors)) {\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$errors[$l_errors]=array();\n\t\t\t\t$errors[$l_errors]['code']=1018;\n\t\t\t\t$errors[$l_errors]['message']=\"An instruction in automaton file could not be recognized: \".$instruction['tag'];\n\t\t\t\t$l_errors++;\n\t\t\t\treturn FALSE;\n\t\t}\n\t}\n\t\n\treturn TRUE;\n}",
"public function run() {\n\t\t\\DB::statement(\" INSERT INTO sistema.tipo_entidad(id_tipo_entidad,descripcion)\n(\n\tSELECT *\n\tFROM dblink('dbname=sirge host=192.6.0.118 user=postgres password=PN2012$',\n\t 'SELECT id_tipo_identidad,descripcion\n\t\t FROM sistema.tipo_entidad')\n\t AS migracion(id_tipo_entidad integer,descripcion character varying(100))\n);\n\t\t\");\n\t}",
"protected function processInserts() {\n\n\t\t$this->insertArtists();\n\t}",
"function v0_ul_insert($instruction, $class, $undo_file, $full_xml_array, $gen_vd_id, $cc_id, $gen_pub_date, $current_time, $cc_id_load, $cb_ids, $select, $upload_to_db, &$parents_id, &$errors, &$l_errors) {\n\t// Local variables\n\t$parameters=$instruction['value'];\n\t$l_parameters=count($parameters);\n\t\n\t// Get table\n\t$table=$parameters[0];\n\tif ($table['tag']!='TABLE') {\n\t\t$errors[$l_errors]=array();\n\t\t$errors[$l_errors]['code']=1019;\n\t\t$errors[$l_errors]['message']=\"The first element of an insert instruction was not 'table' but '\".$table['tag'].\"'\";\n\t\t$l_errors++;\n\t\treturn FALSE;\n\t}\n\t$insert_table=$table['value'][0];\n\t\n\t// Get fields and values\n\t$field_name=array();\n\t$field_value=array();\n\t$cnt_field=0;\n\t// Loop on (field, value) couples\n\tfor ($i=1; $i<$l_parameters; $i+=2) {\n\t\t// Initialize variables\n\t\t$real_field_value=NULL;\n\t\t$temp_field_value=$parameters[$i+1]['value'][0];\n\t\t\n\t\t// Loop on possible values\n\t\twhile (TRUE) {\n\t\t\t// Get position of \"|\"\n\t\t\t$pos=strpos($temp_field_value, \"|\");\n\t\t\tif ($pos===FALSE) {\n\t\t\t\t// \"|\" not found\n\t\t\t\t$find_field_value=$temp_field_value;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// \"|\" found\n\t\t\t\t$find_field_value=substr($temp_field_value, 0, $pos);\n\t\t\t\t$temp_field_value=substr($temp_field_value, $pos+1);\n\t\t\t}\n\t\t\t\n\t\t\t// Depending on the first character of the value, the meaning is different\n\t\t\tswitch (substr($find_field_value, 0, 1)) {\n\t\t\t\tcase '!':\n\t\t\t\t\t// General element\n\t\t\t\t\tif (!v0_ul_get_general($find_field_value, $gen_vd_id, $cc_id, $gen_pub_date, $current_time, $cc_id_load, $cb_ids, $real_field_value, $errors, $l_errors)) {\n\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '=':\n\t\t\t\t\t// Current or parent\n\t\t\t\t\tif (!v0_ul_get_parent($find_field_value, $parents_id, $real_field_value, $errors, $l_errors)) {\n\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\t// Local element\n\t\t\t\t\tif (!v0_ul_get_element($find_field_value, $class, $real_field_value, $errors, $l_errors)) {\n\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '?':\n\t\t\t\t\t// Select value\n\t\t\t\t\tif (!v0_ul_get_select($find_field_value, $select, $real_field_value, $errors, $l_errors)) {\n\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '/':\n\t\t\t\t\t// Attribute\n\t\t\t\t\tif (!v0_ul_get_attribute($find_field_value, $class, $real_field_value, $errors, $l_errors)) {\n\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '#':\n\t\t\t\t\t// Function result\n\t\t\t\t\tif (!v0_ul_get_result($find_field_value, $class, $full_xml_array, $real_field_value, $errors, $l_errors)) {\n\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// Static value\n\t\t\t\t\t$real_field_value=$find_field_value;\n\t\t\t}\n\t\t\t\n\t\t\t// If value is found or no more \"|\", go out from loop\n\t\t\tif ($real_field_value!=NULL || $pos===FALSE) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If this element was not specified before\n\t\tif ($real_field_value==NULL) {\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\t// Enter field and value in array for calling db_insert later\n\t\t$field_name[$cnt_field]=$parameters[$i]['value'][0];\n\t\t$field_value[$cnt_field]=$real_field_value;\n\t\t$cnt_field++;\n\t}\n\t\n\t// Security check\n\tif ($cnt_field==0) {\n\t\t// Error\n\t\t$errors[$l_errors]=array();\n\t\t$errors[$l_errors]['code']=1280;\n\t\t$errors[$l_errors]['message']=\"An 'insert' instruction had no field\";\n\t\t$l_errors++;\n\t\treturn FALSE;\n\t}\n\t\n\t// Database functions\n\trequire_once(\"php/funcs/db_funcs.php\");\n\t\n\t// Send query to database\n\t$last_insert_id=0;\n\t$local_error=\"\";\n\tif (!db_insert($insert_table, $field_name, $field_value, !$upload_to_db, $last_insert_id, $local_error)) {\n\t\tswitch ($local_error) {\n\t\t\tcase \"Error in the parameters given\":\n\t\t\t\t$errors[$l_errors]=array();\n\t\t\t\t$errors[$l_errors]['code']=1020;\n\t\t\t\t$errors[$l_errors]['message']=$local_error.\" to db_insert()\";\n\t\t\t\t$l_errors++;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$errors[$l_errors]=array();\n\t\t\t\t$errors[$l_errors]['code']=4008;\n\t\t\t\t$errors[$l_errors]['message']=$local_error;\n\t\t\t\t$l_errors++;\n\t\t}\n\t\treturn FALSE;\n\t}\n\t\n\t// Store last insert ID in last row of parents_id\n\t$parents_id[count($parents_id)-1]=$last_insert_id;\n\t\n\t// Write undowovoml file (if that was not a simulation)\n\tif ($upload_to_db) {\n\t\t$undo_instruction=\n\t\t\"\\n\\t<delete>\".\n\t\t\"\\n\\t\\t<table>\".$insert_table.\"</table>\".\n\t\t\"\\n\\t\\t<where>\".\n\t\t\"\\n\\t\\t\\t<field>\".$insert_table.\"_id</field>\".\n\t\t\"\\n\\t\\t\\t<value>\".$last_insert_id.\"</value>\".\n\t\t\"\\n\\t\\t</where>\".\n\t\t\"\\n\\t</delete>\";\n\t\tif (!fwrite($undo_file, $undo_instruction)) {\n\t\t\t// Error\n\t\t\t$errors[$l_errors]=array();\n\t\t\t$errors[$l_errors]['code']=2022;\n\t\t\t$errors[$l_errors]['message']=\"An error occurred when trying to write undo file\";\n\t\t\t$l_errors++;\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\t\n\treturn TRUE;\n}",
"function SQLInsert($table, $fields, $ident = 0)\r\n{\r\n## This function check internal triggers\r\n global $L3_sql_lasterr;\r\n $L3_sql_lasterr = 0;\r\n\r\n $query = \"INSERT INTO $table \\n( \";\r\n $values = ') VALUES (';\r\n reset($fields);\r\n $delim = ' ';\r\n while (list($name, $value) = each($fields)) {\r\n if (!is_long($name)) {\r\n $query .= $delim . $name;\r\n if (is_array($value)) {\r\n $values .= $delim . $value['raw'];\r\n } else {\r\n $values .= $delim . \"'\" . mysqli_real_escape_string($GLOBALS['db_handle'], $value) . \"'\";\r\n };\r\n $delim = ',';\r\n }\r\n }\r\n\r\n // echo \"query_start=\".$query.$values.\")\".\"=query_end\";\r\n\r\n if ($ident === 0) $ident = $GLOBALS['db_handle'];\r\n $q = SQLQuery($query . $values . \")\", $ident);\r\n\r\n\r\n $err = mysqli_error($ident);\r\n if (!empty($err)) add_to_log($err, \"error_mysql\");\r\n $q1 = $query . $values;\r\n\r\n if (!$q) {\r\n return false;\r\n }\r\n\r\n $debug = debug_backtrace();\r\n// \tprint_r($debug[\"1\"]);\r\n\r\n //add_to_log($query . $values . \")\" . \";function is \" . $debug[\"1\"]['function'], \"mysqli_log\");\r\n\r\n if ($ident === 0) $ident = $GLOBALS['db_handle'];\r\n $id = mysqli_insert_id($ident);\r\n return $id;\r\n}",
"protected function compilePartInsert(): string\n {\n return 'INSERT INTO ' . $this->quoteIdentifier(identifier: $this->query['table']);\n }",
"abstract function getInstruction();",
"private function parseInstruction()\n {\n $currentTokenValue = $this->tokenStream->currentToken()->getValue();\n\n if (in_array($currentTokenValue, ['if', 'while']))\n return $this->parseStatement();\n\n $expr = $this->parseExpressionNode();\n $this->tokenStream->expectTokenType(TokenType::Terminator);\n\n return $expr;\n }",
"public function compileInsert(): string\n {\n $sql = $this->compilePartInsert();\n $sql .= $this->compilePartInsertValues();\n return $sql;\n }",
"public function compile()\n {\n $query = 'INSERT INTO '.$this->quoter->quoteTable($this->table);\n\n $query .= ' ('.implode(', ', array_map(array($this->quoter, 'quoteColumn'), $this->columns)).') ';\n\n if (is_array($this->values)) {\n $groups = array();\n \n foreach ($this->values as $group) {\n foreach ($group as $offset => $value) {\n if ((is_string($value))) {\n $group[$offset] = $this->quoter->quote($value);\n }\n }\n\n $groups[] = '('.implode(', ', $group).')';\n }\n\n $query .= 'VALUES '.implode(', ', $groups);\n } else {\n $query .= (string) $this->values;\n }\n\n $this->sql = $query;\n\n return parent::compile();\n }",
"private function insert() {\n // use prepared statements\n // save an insert id\n }",
"function insert() {\n\t\t$sql = \"INSERT INTO type_complain (tp_id, tp_complain)\n\t\t\t\tVALUES(?, ?)\";\n\t\t$this->ffm->query($sql, array($this->tp_id, $this->tp_complain));\n\t\t$this->last_insert_id = $this->db->insert_id();\n\t}",
"public function setStatements (string $ddd): void\n\t{\n\t\t$this->statements = array();\n\t\t$lines = explode (\"\\n\", rtrim ($ddd, \"\\n\"));\n\t\t# Require one instruction counter line and at least one instruction line for a \"ret\".\n\t\tif (count ($lines) < 2)\n\t\t\tthrow new InvalidArgumentException ('the input must comprise at least two lines of text');\n\n\t\t# The instruction counter.\n\t\t$line = array_shift ($lines);\n\t\tif (1 !== preg_match ('/^\\d+$/', $line, $m))\n\t\t\tthrow new InvalidArgumentException (\"malformed instruction counter line: '{$line}'\");\n\t\t$declared = (int) $m[0];\n\t\tif ($declared < 1)\n\t\t\tthrow new InvalidArgumentException (\"instruction counter {$declared} declared too low\");\n\t\tif ($declared != count ($lines))\n\t\t\tthrow new InvalidArgumentException (\"instruction counter {$declared} does not match the contents\");\n\n\t\t# The instructions.\n\t\tforeach ($lines as $line)\n\t\t{\n\t\t\tif (1 !== preg_match ('/^(?P<opcode>\\d+) (?P<jt>\\d+) (?P<jf>\\d+) (?P<k>\\d+)$/', $line, $m))\n\t\t\t\tthrow new InvalidArgumentException (\"malformed instruction line: '{$line}'\");\n\t\t\t$this->statements []= array\n\t\t\t(\n\t\t\t\t'opcode' => $m['opcode'],\n\t\t\t\t'jt' => $m['jt'],\n\t\t\t\t'jf' => $m['jf'],\n\t\t\t\t'k' => $m['k'],\n\t\t\t);\n\t\t}\n\t}",
"protected function insertUndo($strSourceSQL, $strSaveSQL, $strTable) { }",
"function check_line($line)\n{\n global $ERR_OPCODE, $ERR_OTHER, $PROGRAM_OK, $line_counter, $xml, $label_counter, $jump_counter, $labels;\n $line = remove_comment($line);\n if(strlen($line) == 0)\n {\n return $PROGRAM_OK;\n }\n $line_split = preg_split('/[\\s]+/', $line);\n $inst = $xml->addChild(\"instruction\");\n\n $opcode = strtoupper($line_split[0]); \n switch ($opcode){\n //0 args:\n case \"CREATEFRAME\":\n case \"PUSHFRAME\":\n case \"POPFRAME\":\n case \"RETURN\":\n case \"BREAK\":\n if (count($line_split) == 1){break;}\n else {return $ERR_OTHER;}\n \n //1 arg: var\n case \"DEFVAR\":\n case \"POPS\":\n if (count($line_split) == 2 && check_var($line_split[1], $inst)){break;}\n else {return $ERR_OTHER;} \n\n //1 arg: label\n case \"LABEL\":\n if (!in_array($line_split[1], $labels))\n {\n $label_counter++;\n $labels[] = $line_split[1];\n }\n case \"JUMP\":\n if ($opcode == \"JUMP\"){$jump_counter++;}\n case \"CALL\":\n if (count($line_split) == 2 && check_label($line_split[1], $inst)){break;}\n else {return $ERR_OTHER;}\n\n //1 arg: symb\n case \"PUSHS\":\n case \"WRITE\":\n case \"EXIT\":\n case \"DPRINT\":\n if (count($line_split) == 2 && check_symb($line_split[1], $inst)){break;}\n else {return $ERR_OTHER;}\n\n //2 args: var symb\n case \"MOVE\":\n case \"INT2CHAR\":\n case \"STRLEN\":\n case \"TYPE\":\n case \"NOT\":\n if (count($line_split) == 3 && check_var($line_split[1], $inst) && check_symb($line_split[2], $inst)){break;}\n else {return $ERR_OTHER;}\n\n //2 args: var type\n case \"READ\":\n if (count($line_split) == 3 && check_var($line_split[1], $inst) && check_type($line_split[2], $inst)){break;}\n else {return $ERR_OTHER;}\n\n //3 args: var symb symb\n case \"ADD\":\n case \"SUB\":\n case \"MUL\":\n case \"IDIV\":\n case \"LT\":\n case \"GT\":\n case \"EQ\":\n case \"AND\":\n case \"OR\":\n case \"STRI2INT\":\n case \"CONCAT\":\n case \"GETCHAR\":\n case \"SETCHAR\":\n if (count($line_split) == 4 && check_var($line_split[1], $inst) && check_symb($line_split[2], $inst) && check_symb($line_split[3], $inst)){break;}\n else {return $ERR_OTHER;}\n\n //3 args: label symb symb\n case \"JUMPIFEQ\":\n case \"JUMPIFNEQ\":\n $jump_counter++;\n if (count($line_split) == 4 && check_label($line_split[1], $inst) && check_symb($line_split[2], $inst) && check_symb($line_split[3], $inst)){break;}\n else {return $ERR_OTHER;}\n \n // Invalid operation code\n default:\n return $ERR_OPCODE;\n break;\n }\n \n $inst->addAttribute(\"order\", ++$line_counter);\n $inst->addAttribute(\"opcode\", strtoupper($line_split[0]));\n return $PROGRAM_OK;\n}",
"protected function process()\n {\n\n // query whether or not, we've found a new attribute code => means we've found a new attribute\n if ($this->hasBeenProcessed($this->getValue(ColumnKeys::ATTRIBUTE_CODE))) {\n return;\n }\n\n // prepare the attribue values\n $attribute = $this->initializeAttribute($this->prepareAttributes());\n\n // insert the entity and set the entity ID\n $this->setLastAttributeId($this->persistAttribute($attribute));\n }",
"private function getSyntax()\n\t{\n\t\t$fields = implode(', ', array_keys($this->data));\n\t\t$places = ':' . implode(', :', array_keys($this->data));\n\t\t$this->create = \"INSERT INTO {$this->table} ({$fields}) VALUES ({$places})\";\n\t}",
"private function process_sql($tokens, $start_at = 0, $stop_at = false)\n {\n $prev_category = '';\n $token_category = '';\n\n $skip_next = false;\n $token_count = count($tokens);\n\n if (!$stop_at) {\n $stop_at = $token_count;\n }\n\n $out = false;\n\n for ($token_number = $start_at; $token_number < $stop_at; ++$token_number) {\n $token = trim($tokens[$token_number]);\n if ($token && '(' == $token[0] && '' == $token_category) {\n $token_category = 'SELECT';\n }\n\n /* If it isn't obvious, when $skip_next is set, then we ignore the next real\n token, that is we ignore whitespace.\n */\n if ($skip_next) {\n //whitespace does not count as a next token\n if ('' == $token) {\n continue;\n }\n\n //to skip the token we replace it with whitespace\n $new_token = '';\n $skip_next = false;\n }\n\n $upper = strtoupper($token);\n switch ($upper) {\n /* Tokens that get their own sections. These keywords have subclauses. */\n case 'SELECT':\n case 'ORDER':\n case 'LIMIT':\n case 'SET':\n case 'DUPLICATE':\n case 'VALUES':\n case 'GROUP':\n case 'HAVING':\n case 'INTO':\n case 'WHERE':\n case 'RENAME':\n case 'CALL':\n case 'PROCEDURE':\n case 'FUNCTION':\n case 'DATABASE':\n case 'SERVER':\n case 'LOGFILE':\n case 'DEFINER':\n case 'RETURNS':\n case 'EVENT':\n case 'TABLESPACE':\n case 'VIEW':\n case 'TRIGGER':\n case 'DATA':\n case 'DO':\n case 'PASSWORD':\n case 'USER':\n case 'PLUGIN':\n case 'FROM':\n case 'FLUSH':\n case 'KILL':\n case 'RESET':\n case 'START':\n case 'STOP':\n case 'PURGE':\n case 'EXECUTE':\n case 'PREPARE':\n case 'DEALLOCATE':\n if ('DEALLOCATE' == $token) {\n $skip_next = true;\n }\n /* this FROM is different from FROM in other DML (not join related) */\n if ('PREPARE' == $token_category && 'FROM' == $upper) {\n continue 2;\n }\n\n $token_category = $upper;\n //$join_type = 'JOIN';\n if ('FROM' == $upper && 'FROM' == $token_category) {\n /* DO NOTHING*/\n } else {\n continue 2;\n }\n break;\n\n /* These tokens get their own section, but have no subclauses.\n These tokens identify the statement but have no specific subclauses of their own. */\n case 'DELETE':\n case 'ALTER':\n case 'INSERT':\n case 'REPLACE':\n case 'TRUNCATE':\n case 'CREATE':\n case 'OPTIMIZE':\n case 'GRANT':\n case 'REVOKE':\n case 'SHOW':\n case 'HANDLER':\n case 'LOAD':\n case 'ROLLBACK':\n case 'SAVEPOINT':\n case 'UNLOCK':\n case 'INSTALL':\n case 'UNINSTALL':\n case 'ANALZYE':\n case 'BACKUP':\n case 'CHECK':\n case 'CHECKSUM':\n case 'REPAIR':\n case 'RESTORE':\n case 'CACHE':\n case 'DESCRIBE':\n case 'EXPLAIN':\n case 'USE':\n case 'HELP':\n $token_category = $upper; /* set the category in case these get subclauses\n in a future version of MySQL */\n $out[$upper][0] = $upper;\n continue 2;\n break;\n\n /* This is either LOCK TABLES or SELECT ... LOCK IN SHARE MODE*/\n case 'LOCK':\n if ('' == $token_category) {\n $token_category = $upper;\n $out[$upper][0] = $upper;\n } else {\n $token = 'LOCK IN SHARE MODE';\n $skip_next = true;\n $out['OPTIONS'][] = $token;\n }\n continue 2;\n break;\n\n case 'USING':\n /* USING in FROM clause is different from USING w/ prepared statement*/\n if ('EXECUTE' == $token_category) {\n $token_category = $upper;\n continue 2;\n }\n if ('FROM' == $token_category && !empty($out['DELETE'])) {\n $token_category = $upper;\n continue 2;\n }\n break;\n\n /* DROP TABLE is different from ALTER TABLE DROP ... */\n case 'DROP':\n if ('ALTER' != $token_category) {\n $token_category = $upper;\n $out[$upper][0] = $upper;\n continue 2;\n }\n break;\n\n case 'FOR':\n $skip_next = true;\n $out['OPTIONS'][] = 'FOR UPDATE';\n continue 2;\n break;\n\n case 'UPDATE':\n if ('' == $token_category) {\n $token_category = $upper;\n continue 2;\n }\n if ('DUPLICATE' == $token_category) {\n continue 2;\n }\n break;\n break;\n\n case 'START':\n $token = 'BEGIN';\n $out[$upper][0] = $upper;\n $skip_next = true;\n break;\n\n /* These tokens are ignored. */\n case 'BY':\n case 'ALL':\n case 'SHARE':\n case 'MODE':\n case 'TO':\n\n case ';':\n continue 2;\n break;\n\n case 'KEY':\n if ('DUPLICATE' == $token_category) {\n continue 2;\n }\n break;\n\n /* These tokens set particular options for the statement. They never stand alone.*/\n case 'DISTINCTROW':\n $token = 'DISTINCT';\n // no break\n case 'DISTINCT':\n case 'HIGH_PRIORITY':\n case 'LOW_PRIORITY':\n case 'DELAYED':\n case 'IGNORE':\n case 'FORCE':\n case 'STRAIGHT_JOIN':\n case 'SQL_SMALL_RESULT':\n case 'SQL_BIG_RESULT':\n case 'QUICK':\n case 'SQL_BUFFER_RESULT':\n case 'SQL_CACHE':\n case 'SQL_NO_CACHE':\n case 'SQL_CALC_FOUND_ROWS':\n $out['OPTIONS'][] = $upper;\n continue 2;\n break;\n\n case 'WITH':\n if ('GROUP' == $token_category) {\n $skip_next = true;\n $out['OPTIONS'][] = 'WITH ROLLUP';\n continue 2;\n }\n break;\n\n case 'AS':\n break;\n\n case '':\n case ',':\n case ';':\n break;\n\n default:\n break;\n }\n\n if ($prev_category == $token_category) {\n $out[$token_category][] = $token;\n }\n\n $prev_category = $token_category;\n }\n\n if (!$out) {\n return false;\n }\n\n //process the SELECT clause\n if (!empty($out['SELECT'])) {\n $out['SELECT'] = $this->process_select($out['SELECT']);\n }\n\n if (!empty($out['FROM'])) {\n $out['FROM'] = $this->process_from($out['FROM']);\n }\n if (!empty($out['USING'])) {\n $out['USING'] = $this->process_from($out['USING']);\n }\n if (!empty($out['UPDATE'])) {\n $out['UPDATE'] = $this->process_from($out['UPDATE']);\n }\n\n if (!empty($out['GROUP'])) {\n $out['GROUP'] = $this->process_group($out['GROUP'], $out['SELECT']);\n }\n if (!empty($out['ORDER'])) {\n $out['ORDER'] = $this->process_group($out['ORDER'], $out['SELECT']);\n }\n\n if (!empty($out['LIMIT'])) {\n $out['LIMIT'] = $this->process_limit($out['LIMIT']);\n }\n\n if (!empty($out['WHERE'])) {\n $out['WHERE'] = $this->process_expr_list($out['WHERE']);\n }\n if (!empty($out['HAVING'])) {\n $out['HAVING'] = $this->process_expr_list($out['HAVING']);\n }\n if (!empty($out['SET'])) {\n $out['SET'] = $this->process_set_list($out['SET']);\n }\n if (!empty($out['DUPLICATE'])) {\n $out['ON DUPLICATE KEY UPDATE'] = $this->process_set_list($out['DUPLICATE']);\n unset($out['DUPLICATE']);\n }\n if (!empty($out['INSERT'])) {\n $out = $this->process_insert($out);\n }\n if (!empty($out['REPLACE'])) {\n $out = $this->process_insert($out, 'REPLACE');\n }\n if (!empty($out['DELETE'])) {\n $out = $this->process_delete($out);\n }\n\n return $out;\n }",
"public function compile_query_insert(GlueDB_Fragment_Query_Insert $fragment) {\n\t\t// Get data from fragment :\n\t\t$intosql\t= $fragment->into()->sql($this);\n\t\t$valuessql\t= $fragment->values()->sql($this);\n\t\t$columnssql\t= $fragment->columns()->sql($this);\n\n\t\t// Generate SQL :\n\t\t$sql = 'INSERT INTO ' . $intosql .\n\t\t\t\t(empty($columnssql) ? '' : ' (' . $columnssql . ')') .\n\t\t\t\t' VALUES ' . $valuessql;\n\n\t\treturn $sql;\n\t}",
"private function insertSQL() {\n\n\t\tif(empty($this->error)) {\n\n\t\t\t$this->query(\"SET NAMES utf8;\");\n\n\t\t\t$this->query(\"\n\t\t\t\tCREATE TABLE IF NOT EXISTS `login_confirm` (\n\t\t\t\t `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t `data` varchar(255) NOT NULL,\n\t\t\t\t `username` varchar(255) NOT NULL,\n\t\t\t\t `email` varchar(255) NOT NULL,\n\t\t\t\t `key` varchar(255) NOT NULL,\n\t\t\t\t `type` varchar(25) NOT NULL,\n\t\t\t\t PRIMARY KEY (`id`)\n\t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n\t\t\t\");\n\n\t\t\t$this->query(\"\n\t\t\t\tCREATE TABLE IF NOT EXISTS `login_integration` (\n\t\t\t\t `user_id` int(255) NOT NULL,\n\t\t\t\t `facebook` varchar(255) NOT NULL,\n\t\t\t\t `twitter` varchar(255) NOT NULL,\n\t\t\t\t `google` varchar(255) NOT NULL,\n\t\t\t\t `yahoo` varchar(255) NOT NULL,\n\t\t\t\t `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n\t\t\t\t PRIMARY KEY (`user_id`)\n\t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;\n\t\t\t\");\n\n\t\t\t$this->query(\"\n\t\t\t\tCREATE TABLE IF NOT EXISTS `login_levels` (\n\t\t\t\t `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t `level_name` varchar(255) NOT NULL,\n\t\t\t\t `level_level` int(1) NOT NULL,\n\t\t\t\t `level_disabled` tinyint(1) NOT NULL DEFAULT '0',\n\t\t\t\t `redirect` varchar(255) NULL,\n\t\t\t\t `welcome_email` tinyint(1) NOT NULL DEFAULT '0',\n\t\t\t\t PRIMARY KEY (`id`),\n\t\t\t\t UNIQUE KEY `level_level` (`level_level`)\n\t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n\t\t\t\");\n\n\t\t\t$this->query(\"\n\t\t\t\tINSERT IGNORE INTO `login_levels` (`id`, `level_name`, `level_level`, `level_disabled`) VALUES\n\t\t\t\t(1, 'Admin', 1, 0),\n\t\t\t\t(2, 'Special', 2, 0),\n\t\t\t\t(3, 'User', 3, 0);\n\t\t\t\");\n\n\t\t\t$this->query(\"\n\t\t\t\tCREATE TABLE IF NOT EXISTS `login_profiles` (\n\t\t\t\t `p_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t\t `pfield_id` INT(255) unsigned NOT NULL,\n\t\t\t\t `user_id` bigint(20) unsigned NOT NULL DEFAULT '0',\n\t\t\t\t `profile_value` longtext,\n\t\t\t\t PRIMARY KEY (`p_id`)\n\t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n\t\t\t\");\n\n\t\t\t$this->query(\"\n\t\t\t\tCREATE TABLE IF NOT EXISTS `login_settings` (\n\t\t\t\t `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t `option_name` varchar(255) NOT NULL,\n\t\t\t\t `option_value` longtext NOT NULL,\n\t\t\t\t PRIMARY KEY (`id`),\n\t\t\t\t UNIQUE KEY `id` (`id`),\n\t\t\t\t UNIQUE KEY `option_name` (`option_name`)\n\t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n\t\t\t\");\n\n\t\t\t$params = array(\n\t\t\t\t':site_address' => $this->options['scriptPath'],\n\t\t\t\t':admin_email' => $this->options['email'],\n\t\t\t\t':guest_redirect' => $this->options['scriptPath'] . 'login.php?e=1',\n\t\t\t\t':new_user_redirect' => $this->options['scriptPath'] . 'profile.php'\n\t\t\t);\n\t\t\t$this->query(\"\n\t\t\t\tINSERT IGNORE INTO `login_settings` (`id`, `option_name`, `option_value`) VALUES\n\t\t\t\t(1, 'site_address', :site_address),\n\t\t\t\t(2, 'default_session', '0'),\n\t\t\t\t(3, 'admin_email', :admin_email),\n\t\t\t\t(4, 'block-msg-enable', '1'),\n\t\t\t\t(5, 'block-msg', '<h1>Sorry.</h1>\\r\\n\\r\\n<p>We have detected that your user level does not entitle you to view the page requested.</p>\\r\\n\\r\\n<p>Please contact the website administrator if you feel this is in error.</p>\\r\\n\\r\\n<h5>What to do now?</h5>\\r\\n<p>To see this page you must <a href=''logout.php''>logout</a> and login with sufficiant privileges.</p>'),\n\t\t\t\t(6, 'block-msg-out', 'You need to login to do that.'),\n\t\t\t\t(7, 'block-msg-out-enable', '1'),\n\t\t\t\t(8, 'email-welcome-msg', 'Hello {{full_name}} !\\r\\n\\r\\nThanks for registering at {{site_address}}. Here are your account details:\\r\\n\\r\\nName: {{full_name}}\\r\\nUsername: {{username}}\\r\\nEmail: {{email}}\\r\\nPassword: *hidden*\\r\\n\\r\\nYou will first have to activate your account by clicking on the following link:\\r\\n\\r\\n{{activate}}'),\n\t\t\t\t(9, 'email-activate-msg', 'Hi there {{full_name}} !\\r\\n\\r\\nYour account at {{site_address}} has been successfully activated :). \\r\\n\\r\\nFor your reference, your username is <strong>{{username}}</strong>. \\r\\n\\r\\nSee you soon!'),\n\t\t\t\t(10, 'email-activate-subj', 'You''ve activated your account at Jigowatt !'),\n\t\t\t\t(11, 'email-activate-resend-subj', 'Here''s your activation link again for Jigowatt'),\n\t\t\t\t(12, 'email-activate-resend-msg', 'Why hello, {{full_name}}. \\r\\n\\r\\nI believe you requested this:\\r\\n{{activate}}\\r\\n\\r\\nClick the link above to activate your account :)'),\n\t\t\t\t(13, 'email-welcome-subj', 'Thanks for signing up with Jigowatt :)'),\n\t\t\t\t(14, 'email-forgot-success-subj', 'Your password has been reset at Jigowatt'),\n\t\t\t\t(15, 'email-forgot-success-msg', 'Welcome back, {{full_name}} !\\r\\n\\r\\nI''m just letting you know your password at {{site_address}} has been successfully changed. \\r\\n\\r\\nHopefully you were the one that requested this password reset !\\r\\n\\r\\nCheers'),\n\t\t\t\t(16, 'email-forgot-subj', 'Lost your password at Jigowatt?'),\n\t\t\t\t(17, 'email-forgot-msg', 'Hi {{full_name}},\\r\\n\\r\\nYour username is <strong>{{username}}</strong>.\\r\\n\\r\\nTo reset your password at Jigowatt, please click the following password reset link:\\r\\n{{reset}}\\r\\n\\r\\nSee you soon!'),\n\t\t\t\t(18, 'email-add-user-subj', 'You''re registered with Jigowatt !'),\n\t\t\t\t(19, 'email-add-user-msg', 'Hello {{full_name}} !\\r\\n\\r\\nYou''re now registered at {{site_address}}. Here are your account details:\\r\\n\\r\\nName: {{full_name}}\\r\\nUsername: {{username}}\\r\\nEmail: {{email}}\\r\\nPassword: {{password}}'),\n\t\t\t\t(20, 'pw-encrypt-force-enable', '0'),\n\t\t\t\t(21, 'pw-encryption', 'MD5'),\n\t\t\t\t(22, 'phplogin_db_version', '1206210'),\n\t\t\t\t(23, 'email-acct-update-subj', 'Confirm your account changes'),\n\t\t\t\t(24, 'email-acct-update-msg', 'Hi {{full_name}} !\\r\\n\\r\\nYou ( {{username}} ) requested a change to update your password or email. Click the link below to confirm this change.\\r\\n\\r\\n{{confirm}}\\r\\n\\r\\nThanks!\\r\\n{{site_address}}'),\n\t\t\t\t(25, 'email-acct-update-success-subj', 'Your account has been updated'),\n\t\t\t\t(26, 'email-acct-update-success-msg', 'Hello {{full_name}},\\r\\n\\r\\nYour account details at {{site_address}} has been updated. \\r\\n\\r\\nYour username: {{username}}\\r\\n\\r\\nSee you around!'),\n\t\t\t\t(27, 'guest-redirect', :guest_redirect),\n\t\t\t\t(28, 'signout-redirect-referrer-enable', 1),\n\t\t\t\t(29, 'signin-redirect-referrer-enable', 1),\n\t\t\t\t(30, 'default-level', 'a:1:{i:0;s:1:\\\"3\\\";}'),\n\t\t\t\t(31, 'new-user-redirect', :new_user_redirect),\n\t\t\t\t(32, 'user-activation-enable', '1'),\n\t\t\t\t(33, 'email-new-user-subj', 'A new user has registered !'),\n\t\t\t\t(34, 'email-new-user-msg', 'Hello,\\r\\n\\r\\nThere''s been a new registration at <a href="{{site_address}}">your site</a>.\\r\\n\\r\\nHere''s the user''s details:\\r\\n\\r\\nName: {{full_name}}\\r\\nUsername: {{username}}\\r\\nEmail: {{email}}');\n\t\t\t\", $params);\n\n\t\t\t$this->query(\"\n\t\t\t\tCREATE TABLE IF NOT EXISTS `login_users` (\n\t\t\t\t `user_id` int(8) NOT NULL AUTO_INCREMENT,\n\t\t\t\t `user_level` longtext NOT NULL,\n\t\t\t\t `restricted` int(1) NOT NULL DEFAULT '0',\n\t\t\t\t `username` varchar(15) NOT NULL,\n\t\t\t\t `name` varchar(255) NOT NULL,\n\t\t\t\t `email` varchar(255) NOT NULL,\n\t\t\t\t `password` varchar(128) NOT NULL,\n\t\t\t\t `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\t\t\t\t PRIMARY KEY (`user_id`),\n\t\t\t\t UNIQUE KEY `user_id` (`user_id`),\n\t\t\t\t UNIQUE KEY `username` (`username`)\n\t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n\t\t\t\");\n\n\t\t\t$this->query(\"\n\t\t\t\tCREATE TABLE IF NOT EXISTS `login_profile_fields` (\n\t\t\t\t `id` int(255) NOT NULL AUTO_INCREMENT,\n\t\t\t\t `section` varchar(255) NOT NULL,\n\t\t\t\t `type` varchar(25) NOT NULL,\n\t\t\t\t `label` varchar(255) NOT NULL,\n\t\t\t\t `public` TINYINT NOT NULL,\n\t\t\t\t `signup` varchar(255) NOT NULL,\n\t\t\t\t PRIMARY KEY (`id`)\n\t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;\n\t\t\t\");\n\n\t\t\t$this->query(\"\n\t\t\t\tCREATE TABLE IF NOT EXISTS `login_timestamps` (\n\t\t\t\t `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t `user_id` int(11) NOT NULL,\n\t\t\t\t `ip` varchar(255) NOT NULL,\n\t\t\t\t `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n\t\t\t\t PRIMARY KEY (`id`)\n\t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n\t\t\t\");\n\n\t\t\t$params = array(\n\t\t\t\t':admin_user' => $this->options['adminUser'],\n\t\t\t\t':admin_email' => $this->options['email'],\n\t\t\t\t':admin_pass' => $this->options['adminPass']\n\t\t\t);\n\t\t\t$this->query(\"\n\t\t\t\tINSERT IGNORE INTO `login_users` (`user_id`, `user_level`, `restricted`, `username`, `name`, `email`, `password`) VALUES\n\t\t\t\t(1, 'a:3:{i:0;s:1:\\\"3\\\";i:1;s:1:\\\"1\\\";i:2;s:1:\\\"2\\\";}', 0, :admin_user, 'Demo Admin', :admin_email, :admin_pass),\n\t\t\t\t(2, 'a:2:{i:0;s:1:\\\"2\\\";i:1;s:1:\\\"3\\\";}', 0, 'special', 'Demo Special', '[email protected]', '0bd6506986ec42e732ffb866d33bb14e'),\n\t\t\t\t(3, 'a:1:{i:0;s:1:\\\"3\\\";}', 0, 'user', 'Demo User', '[email protected]', 'ee11cbb19052e40b07aac0ca060c23ee');\n\t\t\t\", $params);\n\n\t\t} else $this->error = 'Your tables already exist! I won\\'t insert anything.';\n\t}",
"public function insert ($into_quotef, $values_quotef_etc);",
"function _metatag_importer_migrate(array $types = array(), &$context = array()) {\n // Process this number of {nodewords} records at a time.\n $limit = 50;\n\n if (empty($context['sandbox'])) {\n // @todo Expand this so it can handle other types of things.\n foreach ($types as $key => $val) {\n $types[$key] = str_replace('nodewords:', '', $val);\n }\n\n $context['sandbox']['progress'] = 0;\n $context['sandbox']['current'] = 0;\n $query = db_select('nodewords', 'nw')\n ->fields('nw', array('mtid'))\n ->orderBy('nw.mtid');\n if (!empty($types)) {\n $query->condition('nw.type', $types, 'IN');\n }\n $context['sandbox']['dataset'] = array_keys($query->execute()->fetchAllAssoc('mtid', PDO::FETCH_ASSOC));\n $context['sandbox']['max'] = count($context['sandbox']['dataset']);\n\n // Track all of the entities that could not be loaded.\n $context['sandbox']['skipped'] = array();\n }\n\n // Retrieve Nodewords data.\n $query = db_select('nodewords', 'nw')\n ->fields('nw', array('mtid', 'type', 'id', 'name', 'content'))\n // Continue on from the last record that was processed.\n ->condition('nw.mtid', $context['sandbox']['current'], '>')\n ->orderBy('nw.mtid');\n // @todo Finish off / test the $types handling.\n // if (!empty($types)) {\n // $query->condition('nw.type', $types, 'IN');\n // }\n $query->range(0, $limit);\n $results = $query->execute();\n\n // Records that are being converted.\n $records = array();\n\n // Track records that are converted and will be ready to be deleted.\n $to_delete = array();\n\n // Convert Nodewords data into the Metatag format.\n foreach ($results as $result) {\n // Log the progress.\n $context['sandbox']['current'] = $result->mtid;\n $context['sandbox']['progress']++;\n\n // Convert the Nodewords record 'type' into something Metatag can use.\n $type = _metatag_importer_convert_type($result->type);\n\n // Skip record types we're not handling just yet.\n if (empty($type)) {\n continue;\n }\n\n // This could be an entity ID, but also possibly just a placeholder integer.\n $record_id = $result->id;\n\n // Check if this record was skipped previously.\n if (isset($context['sandbox']['skipped'][$type][$record_id])) {\n // Delete this record anyway.\n $to_delete[] = $result->mtid;\n continue;\n }\n\n // If this record is for an entity, verify that the entity exists.\n if (in_array($type, array('node', 'taxonomy_term', 'user'))) {\n $entity = entity_load($type, array($record_id));\n if (empty($entity)) {\n $context['sandbox']['skipped'][$type][$record_id] = $record_id;\n watchdog('metatag_importer', 'Unable to load @entity_type ID @id', array('@entity_type' => $type, '@id' => $record_id), WATCHDOG_WARNING);\n\n // Delete this record anyway.\n $to_delete[] = $result->mtid;\n continue;\n }\n }\n\n // Process the meta tag value, possibly also rename the meta tag name\n // itself.\n list($meta_tag, $value) = _metatag_importer_convert_data($result->name, unserialize($result->content));\n\n // Don't import empty values.\n if (!empty($value)) {\n // Add the value to the stack.\n $records[$type][$record_id][$meta_tag] = $value;\n }\n\n // Note that this record is ready to be deleted.\n $to_delete[] = $result->mtid;\n }\n\n // Update or create Metatag records.\n foreach ($records as $type => $data) {\n foreach ($data as $record_id => $values) {\n switch ($type) {\n // Standard D7 entities are converted to {metatag} records using\n // metatag_metatags_save().\n case 'node':\n case 'taxonomy_term':\n case 'user':\n // watchdog('metatag_importer', 'Importing meta tags for @entity_type ID @id..', array('@entity_type' => $type, '@id' => $record_id), WATCHDOG_INFO);\n $entity = entity_load($type, array($record_id));\n $entity = reset($entity);\n $langcode = metatag_entity_get_language($type, $entity);\n list($entity_id, $revision_id, $bundle) = entity_extract_ids($type, $entity);\n\n // Add these meta tags to the entity, overwriting anything that's\n // already there.\n foreach ($values as $name => $value) {\n $entity->metatags[$langcode][$name] = $value;\n }\n\n metatag_metatags_save($type, $entity_id, $revision_id, $entity->metatags, $langcode);\n // watchdog('metatag_importer', 'Imported meta tags for @entity_type ID @id.', array('@entity_type' => $type, '@id' => $record_id), WATCHDOG_INFO);\n break;\n\n // Other Nodewords settings are converted to {metatag_config} records\n // using metatag_config_save().\n case 'global':\n case 'global:frontpage':\n case 'global:404':\n $config = metatag_config_load($type);\n\n // If a configuration was not found create a config object.\n if (empty($config)) {\n $config = (object) array(\n 'instance' => $type,\n );\n }\n\n // Add these meta tags to the configuration, overwriting anything\n // that's already there.\n foreach ($values as $name => $value) {\n $config->config[$name] = $value;\n }\n\n // Save the configuration.\n metatag_config_save($config);\n break;\n\n // // A 'vocabulary' setting becomes a default configuration.\n // case 'vocabulary':\n // $metatags = metatag_metatags_load($record->entity_type, $record->entity_id);\n // $metatags = array_merge($metatags, $record->data);\n // $vocabulary = taxonomy_vocabulary_load($record->entity_id);\n // metatag_metatags_save($record->entity_type, $record->entity_id, $vocabulary->vid, $metatags, $vocabulary->language);\n // break;\n }\n }\n }\n\n // Delete some records.\n if (!empty($to_delete)) {\n db_delete('nodewords')\n ->condition('mtid', $to_delete)\n ->execute();\n }\n\n $context['finished'] = (empty($context['sandbox']['max']) || $context['sandbox']['progress'] >= $context['sandbox']['max']) ? TRUE : ($context['sandbox']['progress'] / $context['sandbox']['max']);\n\n if ($context['finished'] === TRUE) {\n drupal_set_message(t('Imported @imported Nodewords records.', array('@imported' => $context['sandbox']['progress'])));\n if (!empty($context['sandbox']['skipped'])) {\n drupal_set_message(t('@skipped records were skipped because the corresponding entities were previously deleted.', array('@skipped' => count($context['sandbox']['skipped']))));\n }\n }\n}",
"function insert($sql)\r\n\t{\r\n \r\n if(stripos($sql,\"INSERT\")===false && stripos($sql,\"REPLACE\")===false)\r\n {\r\n error_log(\"Not an insert or replace query: \".$sql.\" \".$this->mysqli->error);\r\n array_walk(debug_backtrace(),create_function('$a,$b','error_log(\"{$a[\\'function\\']}()(\".basename($a[\\'file\\']).\":{$a[\\'line\\']}); \");'));\r\n }\r\n \r\n\t\t$err = $this->doQuery($sql);\r\n\t\tif(!$err)\r\n\t\t{\r\n\t\t\tthrow( new Exception(\"Query failed! $sql \".$this->_mysqli_last->error));\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->_mysqli_last->insert_id;\r\n\t}",
"private function parseInsertStatement3() {\n\t\t$startIndex = $this->index;\n\t\tif ($this->parseInsertHeader()) {\n\t\t\t$this->parseColumnList();\n\t\t\tif ($this->parseSelectStatement()) {\n\t\t\t\t$this->parseInsertSubfix();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t$this->index = $startIndex;\n\t\treturn false;\n\t}"
] | [
"0.5415405",
"0.5302321",
"0.52974415",
"0.5287548",
"0.48981062",
"0.48636377",
"0.48560566",
"0.48338175",
"0.4805712",
"0.47969374",
"0.47914174",
"0.47827554",
"0.47616246",
"0.4753496",
"0.47285402",
"0.47187766",
"0.471496",
"0.4673451",
"0.46653855",
"0.46355432",
"0.46265492",
"0.46164894",
"0.45868188",
"0.4576833",
"0.45753992",
"0.45575863",
"0.45546535",
"0.45541522",
"0.45349768",
"0.4530187"
] | 0.53093314 | 1 |
SearchRequest constructor. If no second parameter is provided then the first parameter is assumed to be a full search URL. If the second parameter is provided then the first parameter is assumed to be the amazon_domain The options parameter is an array using one or more of the keys returned by getOptionKeys() | public function __construct($site_or_url, $search_term=null, $options=[])
{
if (empty($search_term)) {
$this->url = $site_or_url;
} else {
$this->amazon_domain = $site_or_url;
$this->search_term = $search_term;
}
foreach ($this->getOptionKeys() as $key) {
if (isset($options[$key])) {
$this->$key = $options[$key];
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function __construct($domain, $options, $searchEntry)\n {\n $this->domainRootPath = $domain;\n $this->options = $options;\n $this->searchEntry = $searchEntry;\n }",
"public function __construct($formOnly = false) {\n\t\tparent::__construct();\n\t\t$options = array(\n\t\t\t'scopeOptions' => $this->__scopeSelectorArray,\n\t\t\t'formOnly' => $formOnly\n\t\t);\n\n\t\tif ( isset($_REQUEST['q']) && ! empty($_REQUEST['q'])) {\n\t\t\t$this->__q = html_entity_decode(strip_tags(trim($_REQUEST['q'])), ENT_QUOTES, 'utf-8');;\n\n\t\t\tif (empty($this->__q)) {\n\t\t\t\t$this->render($options);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tforeach ($this->__scopeSelectorArray as $value) {\n\t\t\t\t$this->__q = trim(str_replace($value, '', $this->__q));\n\t\t\t}\n\n\t\t\tif (StringTools::startsWith($this->__q, '+')) {\n\t\t\t\ttrim(str_replace('+', ' ', $this->__q));\n\t\t\t}\n\n\t\t\tif ( isset($_REQUEST['scope']) && ! empty($_REQUEST['scope']) && isset($this->__scopeSelectorArray[$_REQUEST['scope']])) {\n\t\t\t\t$this->__scope = $this->__scopeSelectorArray[$_REQUEST['scope']]['value'];\n\t\t\t\t$this->__scopeSelector = strip_tags(trim($_REQUEST['scope']));\n\t\t\t}\n\n\t\t\tif (! empty($this->__scope)) {\n\t\t\t\t$this->__qScoped = trim($this->__scope . '+' . $this->__q);\n\t\t\t} else {\n\t\t\t\t$this->__qScoped = $this->__q;\n\t\t\t}\n\n\t\t\t//Create new GoogleSiteSearch Object\n\t\t\t$this->__search = new GoogleSiteSearch();\n\n\t\t\t//Set the options.\n\t\t\t$this->__search->cx($this->__cx);\n\t\t\t$classMethods = get_class_methods('GoogleSiteSearch');\n\n\t\t\tforeach ($classMethods as $method) {\n\t\t\t\tif ( isset($_REQUEST[$method]) && ! is_null($_REQUEST[$method])) {\n\t\t\t\t\t$this->__search->$method($_REQUEST[$method]);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry {\n\t\t\t//Perform the search, unless $formOnly is true;\n\t\t\tif ($formOnly !== true) {\n\t\t\t\t$this->__results = $this->__search->search($this->__qScoped);\n\t\t\t} else {\n\t\t\t\t$this->__results = null;\n\t\t\t}\n\t\t\t} catch (Exception $e) {\n\t\t\t echo '<div class=\"error-box\"><p>Search temporarily unavailable.</p></div> ' . \"\\n\";\n\t\t\t}\n\t\t\t$options = array_merge($options, array(\n\t\t\t\t'q' => $this->__q,\n\t\t\t\t'qScoped' => $this->__qScoped,\n\t\t\t\t'results' => $this->__results,\n\t\t\t\t'scope' => $this->__scope,\n\t\t\t\t'scopeSelector' => $this->__scopeSelector,\n\t\t\t\t'scopeOptions' => $this->__scopeSelectorArray,\n\t\t\t\t'next' => $this->next(),\n\t\t\t\t'pageMenu' => $this->paginationMenu(),\n\t\t\t\t'prev' => $this->prev()\n\t\t\t));\n\t\t}\n\t\t$this->render($options);\n\t}",
"function __construct($params=array())\r\n {\r\n // Initiate a new request object with given query params.\r\n // \r\n // Each request must have at least one searchable parameter, meaning \r\n // a name (at least first and last name), email, phone or username. \r\n // Multiple query params are possible (for example querying by both email \r\n // and phone of the person).\r\n // \r\n // Args:\r\n // \r\n // api_key -- string, a valid API key (use \"samplekey\" for experimenting).\r\n // Note that you can set a default API key \r\n // (PiplApi_SearchApi::$default_api_key = '<your_key>';) instead of \r\n // passing it to each request object. \r\n // first_name -- string, minimum 2 chars.\r\n // middle_name -- string. \r\n // last_name -- string, minimum 2 chars.\r\n // raw_name -- string, an unparsed name containing at least a first name \r\n // and a last name.\r\n // email -- string.\r\n // phone -- int/long. If a string is passed instead then it'll be \r\n // striped from all non-digit characters and converted to int.\r\n // IMPORTANT: Currently only US/Canada phones can be searched by\r\n // so country code is assumed to be 1, phones with different \r\n // country codes are considered invalid and will be ignored.\r\n // username -- string, minimum 4 chars.\r\n // country -- string, a 2 letter country code from:\r\n // http://en.wikipedia.org/wiki/ISO_3166-2\r\n // state -- string, a state code from:\r\n // http://en.wikipedia.org/wiki/ISO_3166-2%3AUS\r\n // http://en.wikipedia.org/wiki/ISO_3166-2%3ACA\r\n // city -- string.\r\n // raw_address -- string, an unparsed address.\r\n // from_age -- int.\r\n // to_age -- int.\r\n // person -- A PiplApi::Person object (available at containers.php).\r\n // The person can contain every field allowed by the data-model\r\n // (fields.php) and can hold multiple fields of \r\n // the same type (for example: two emails, three addresses etc.)\r\n // query_params_mode -- string, one of \"and\"/\"or\" (default \"and\").\r\n // Advanced parameter, use only if you care about the \r\n // value of record.query_params_match in the response \r\n // records.\r\n // Each record in the response has an attribute \r\n // \"query_params_match\" which indicates whether the \r\n // record has the all fields from the query or not.\r\n // When set to \"and\" all query params are required in \r\n // order to get query_params_match=True, when set to \r\n // \"or\" it's enough that the record has at least one\r\n // of each field type (so if you search with a name \r\n // and two addresses, a record with the name and one \r\n // of the addresses will have query_params_match=true)\r\n // exact_name -- bool (default false).\r\n // If set to True the names in the query will be matched \r\n // \"as is\" without compensating for nicknames or multiple\r\n // family names. For example \"Jane Brown-Smith\" won't return \r\n // results for \"Jane Brown\" in the same way \"Alexandra Pitt\"\r\n // won't return results for \"Alex Pitt\".\r\n // \r\n // Each of the arguments that should have a string that accepts both \r\n // strings.\r\n\r\n $fparams = $params;\r\n \r\n if (!array_key_exists('query_params_mode', $fparams))\r\n {\r\n $fparams['query_params_mode'] = 'and';\r\n }\r\n \r\n if (!array_key_exists('exact_name', $fparams))\r\n {\r\n $fparams['exact_name'] = false;\r\n }\r\n\r\n $person = !empty($fparams['person']) ? $fparams['person'] : new PiplApi_Person();\r\n\r\n if (!empty($fparams['first_name']) || !empty($fparams['middle_name']) || !empty($fparams['last_name']))\r\n {\r\n $name = new PiplApi_Name(array('first' => $fparams['first_name'],\r\n 'middle' => $fparams['middle_name'],\r\n 'last' => $fparams['last_name']));\r\n $person->add_fields(array($name));\r\n }\r\n\r\n if (!empty($fparams['raw_name']))\r\n {\r\n $person->add_fields(array(new PiplApi_Name(array('raw' => $fparams['raw_name']))));\r\n }\r\n\r\n if (!empty($fparams['email']))\r\n {\r\n $person->add_fields(array(new PiplApi_Email(array('address' => $fparams['email']))));\r\n }\r\n \r\n if (!empty($fparams['phone']))\r\n {\r\n if (is_string($fparams['phone']))\r\n {\r\n $person->add_fields(array(PiplApi_Phone::from_text($fparams['phone'])));\r\n }\r\n else\r\n {\r\n $person->add_fields(array(new PiplApi_Phone(array('number' => $fparams['phone']))));\r\n }\r\n }\r\n \r\n if (!empty($fparams['username']))\r\n {\r\n $person->add_fields(array(new PiplApi_Username(array('content' => $fparams['username']))));\r\n }\r\n\r\n if (!empty($fparams['country']) || !empty($fparams['state']) || !empty($fparams['city']))\r\n {\r\n $address = new PiplApi_Address(array('country' => $fparams['country'],\r\n 'state' => $fparams['state'],\r\n 'city' => $fparams['city']));\r\n $person->add_fields(array($address));\r\n }\r\n\r\n if (!empty($fparams['raw_address']))\r\n {\r\n $person->add_fields(array(new PiplApi_Address(array('raw' => $fparams['raw_address']))));\r\n }\r\n\r\n if (!empty($fparams['from_age']) || !empty($fparams['to_age']))\r\n {\r\n $dob = PiplApi_DOB::from_age_range(!empty($fparams['from_age']) ? $fparams['from_age'] : 0,\r\n !empty($fparams['to_age']) ? $fparams['to_age'] : 1000);\r\n $person->add_fields(array($dob));\r\n }\r\n\r\n if (!empty($fparams['api_key']))\r\n {\r\n $this->api_key = $fparams['api_key'];\r\n }\r\n $this->person = $person;\r\n if (!empty($fparams['query_params_mode']))\r\n {\r\n $this->query_params_mode = $fparams['query_params_mode'];\r\n }\r\n $this->exact_name = !empty($fparams['exact_name']) && $fparams['exact_name'] ? 'true' : 'false';\r\n $this->_filter_records_by = array();\r\n $this->_prioritize_records_by = array();\r\n }",
"function __construct($domain_name=null)\n {\n // Set the prefix and filter to the default\n $this->prefix = self::$default_prefix;\n $this->SetQueryStringParameter('filter', Filter::$default_filter);\n \n // Set the API key\n $this->SetQueryStringParameter('key', API::$key);\n \n // With v2.0 of the API, Stack.PHP now requires the domain name of\n // the site to be specified in the query string - so we will add it\n // to the query string now as well as the current API key.\n if($domain_name !== null)\n $this->SetQueryStringParameter('site', $domain_name);\n }",
"public function __construct(array $options = array())\n\t{\n\t\t$this->api_version = '2010-12-01';\n\t\t$this->hostname = self::DEFAULT_URL;\n\t\t$this->auth_class = 'AuthV2Query';\n\n\t\treturn parent::__construct($options);\n\t}",
"public function __construct($sSearch = null)\r\n {\r\n $this->_index = LuceneHandler::getLuceneIndex();\r\n $this->_queryString = $sSearch;\r\n return $this;\r\n }",
"public function get_search() //Use Func Get Args. Each argument is a search string\n {\n \tif ( func_num_args() > 0 ){\n \t$args = func_get_args();\n \t$num = 0;\n \t}\n \tforeach($args as $arg)\n \t{\n \t\tif ($num == 0)\n \t\t{\n \t\t\t$url_string = $this->base_search_query_api.$arg;\n \t\t}\n \t\telse\n \t\t{\n \t\t\t$url_string = $url_string.'&'.$arg;\n \t\t}\n \t\t$num++;\n \t\t\n \t}\n \t$client = new Client();\n \t\n \t$response = $client->get($url_string);\n \t$response = $response->json();\n \treturn $response;\n }",
"public function __construct($domain, $options, $searchEntry, $relationTypeName)\n {\n parent::__construct($domain, $options, $searchEntry);\n $this->relationTypeName = $relationTypeName;\n }",
"function __construct($options = null) {\n if (is_array($options) || is_object($options)) {\n foreach ($options as $key => $value) {\n $this->$key = $value;\n }\n }\n if ($this->translationService == \"google\") {\n $this->setUrl($this::GOOGLE_URL);\n } else if ($this->translationService == \"bing\") {\n $this->setUrl($this::BING_URL);\n }\n }",
"public function searchProducts($SearchOptions = array());",
"public function searchForm(array $options = array())\n {\n $validQueryTypes = get_search_query_types();\n $validRecordTypes = get_custom_search_record_types();\n\n $filters = array(\n 'query' => apply_filters('search_form_default_query', ''),\n 'query_type' => apply_filters('search_form_default_query_type', 'keyword'),\n 'record_types' => apply_filters('search_form_default_record_types',\n array_keys($validRecordTypes))\n );\n\n if (isset($_GET['submit_search'])) {\n if (isset($_GET['query'])) {\n $filters['query'] = $_GET['query'];\n }\n if (isset($_GET['query_type'])) {\n $filters['query_type'] = $_GET['query_type'];\n }\n if (isset($_GET['record_types'])) {\n $filters['record_types'] = $_GET['record_types'];\n }\n }\n\n // Set the default flag indicating whether to show the advanced form.\n if (!isset($options['show_advanced'])) {\n $options['show_advanced'] = false;\n }\n\n // Set the default submit value.\n if (!isset($options['submit_value'])) {\n $options['submit_value'] = __('Search');\n }\n\n // Set the default form attributes.\n if (!isset($options['form_attributes'])) {\n $options['form_attributes'] = array();\n }\n if (!isset($options['form_attributes']['action'])) {\n $url = apply_filters('search_form_default_action', url('search'));\n $options['form_attributes']['action'] = $url;\n }\n if (!isset($options['form_attributes']['id'])) {\n $options['form_attributes']['id'] = 'search-form';\n }\n $options['form_attributes']['method'] = 'get';\n\n $formParams = array(\n 'options' => $options,\n 'filters' => $filters,\n 'query_types' => $validQueryTypes,\n 'record_types' => $validRecordTypes\n );\n\n $form = $this->view->partial('search/search-form.php', $formParams);\n\n return apply_filters('search_form', $form, $formParams);\n }",
"private function initializeSearch()\n {\n $this->search = $this->request->getParameter(self::SEARCH_PARAMETER_NAME);\n }",
"public function __construct($query)\n\t\t{\n\t\t\t\n\t\t\t$this->search_query = $query;\n\t\t\t\n\t\t}",
"public function search() {\n\t\tforeach (Configure::read('AccessControlAllowOrigin') as $domain) {\n\t\t\tif (strpos($this->request->referer(), $domain) === 0) {\n\t\t\t\t$this->response->header(array('Access-Control-Allow-Origin' => $domain));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$version = '2-2';\n\t\tif (!empty($this->request->query['version'])) {\n\t\t\t$version = $this->request->query['version'];\n\t\t}\n\t\tif (empty($this->request->query['lang'])) {\n\t\t\tthrow new BadRequestException();\n\t\t}\n\t\t$lang = $this->request->query['lang'];\n\n\t\t$page = 0;\n\t\tif (!empty($this->request->query['page'])) {\n\t\t\t$page = $this->request->query['page'];\n\t\t}\n\n\t\tif (count(array_filter(explode(' ', $this->request->query['q']))) === 1) {\n\t\t\t$this->request->query['q'] .= '~';\n\t\t}\n\n\t\t$query = array(\n\t\t\t'query' => array(\n\t\t\t\t'query_string' => array(\n\t\t\t\t\t'fields' => array('contents', 'title^3'),\n\t\t\t\t\t'query' => $this->request->query['q'],\n\t\t\t\t\t'phrase_slop' => 2,\n\t\t\t\t\t'default_operator' => 'AND',\n\t\t\t\t\t'fuzzy_min_sim' => 0.7\n\t\t\t\t),\n\t\t\t),\n\t\t\t'fields' => array('url', 'title'),\n\t\t\t'highlight' => array(\n\t\t\t\t'pre_tags' => array(''),\n\t\t\t\t'post_tags' => array(''),\n\t\t\t\t'fields' => array(\n\t\t\t\t\t'contents' => array(\n\t\t\t\t\t\t'fragment_size' => 100,\n\t\t\t\t\t\t'number_of_fragments' => 3\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'size' => 25,\n\t\t);\n\n\t\t// Pagination\n\t\tif ($page > 0) {\n\t\t\t$query['from'] = $query['size'] * ($page - 1);\n\t\t}\n\t\t$results = $this->Search->find($lang, $version, $query);\n\t\t$this->set('results', $results);\n\t\t$this->set('_serialize', 'results');\n\t}",
"public function fromQuerystring(){\n $doofinderReqParams = array_filter(array_keys($this->serializationArray),\n array($this, 'belongsToDoofinder'));\n\n foreach($doofinderReqParams as $dfReqParam){\n if($dfReqParam == $this->queryParameter){\n $keey = 'query';\n } else {\n $keey = substr($dfReqParam, strlen($this->paramsPrefix));\n }\n $this->search_options[$keey] = $this->serializationArray[$dfReqParam];\n }\n }",
"public function __invoke(Request $request)\n {\n abort_if(\n empty($request->type) || empty(config('global-search.type')::tryFrom($request->type)),\n 424,\n __('Unknown search type')\n );\n\n abort_if(\n empty($request->keyword),\n 404,\n __('Please provide search keyword')\n );\n\n return search(\n config('global-search.type')::tryFrom($request->type),\n $request->keyword,\n $request->query('paginate', false)\n );\n }",
"public function setSearchSearch(string $search): MainOption {\n\t\t$this->_setConfig('search.search', $search);\n\t\treturn $this->getMainOption();\n\t}",
"function SetupSearchOptions() {\n\t\tglobal $Language;\n\t\t$this->SearchOptions = new cListOptions();\n\t\t$this->SearchOptions->Tag = \"div\";\n\t\t$this->SearchOptions->TagClassName = \"ewSearchOption\";\n\n\t\t// Search button\n\t\t$item = &$this->SearchOptions->Add(\"searchtoggle\");\n\t\t$SearchToggleClass = ($this->SearchWhere <> \"\") ? \" active\" : \" active\";\n\t\t$item->Body = \"<button type=\\\"button\\\" class=\\\"btn btn-default ewSearchToggle\" . $SearchToggleClass . \"\\\" title=\\\"\" . $Language->Phrase(\"SearchPanel\") . \"\\\" data-caption=\\\"\" . $Language->Phrase(\"SearchPanel\") . \"\\\" data-toggle=\\\"button\\\" data-form=\\\"fsana_personlistsrch\\\">\" . $Language->Phrase(\"SearchBtn\") . \"</button>\";\n\t\t$item->Visible = TRUE;\n\n\t\t// Show all button\n\t\t$item = &$this->SearchOptions->Add(\"showall\");\n\t\t$item->Body = \"<a class=\\\"btn btn-default ewShowAll\\\" title=\\\"\" . $Language->Phrase(\"ShowAll\") . \"\\\" data-caption=\\\"\" . $Language->Phrase(\"ShowAll\") . \"\\\" href=\\\"\" . $this->PageUrl() . \"cmd=reset\\\">\" . $Language->Phrase(\"ShowAllBtn\") . \"</a>\";\n\t\t$item->Visible = ($this->SearchWhere <> $this->DefaultSearchWhere && $this->SearchWhere <> \"0=101\");\n\n\t\t// Advanced search button\n\t\t$item = &$this->SearchOptions->Add(\"advancedsearch\");\n\t\t$item->Body = \"<a class=\\\"btn btn-default ewAdvancedSearch\\\" title=\\\"\" . $Language->Phrase(\"AdvancedSearch\") . \"\\\" data-caption=\\\"\" . $Language->Phrase(\"AdvancedSearch\") . \"\\\" href=\\\"sana_personsrch.php\\\">\" . $Language->Phrase(\"AdvancedSearchBtn\") . \"</a>\";\n\t\t$item->Visible = TRUE;\n\n\t\t// Button group for search\n\t\t$this->SearchOptions->UseDropDownButton = FALSE;\n\t\t$this->SearchOptions->UseImageAndText = TRUE;\n\t\t$this->SearchOptions->UseButtonGroup = TRUE;\n\t\t$this->SearchOptions->DropDownButtonPhrase = $Language->Phrase(\"ButtonSearch\");\n\n\t\t// Add group option item\n\t\t$item = &$this->SearchOptions->Add($this->SearchOptions->GroupOptionName);\n\t\t$item->Body = \"\";\n\t\t$item->Visible = FALSE;\n\n\t\t// Hide search options\n\t\tif ($this->Export <> \"\" || $this->CurrentAction <> \"\")\n\t\t\t$this->SearchOptions->HideAllOptions();\n\t\tglobal $Security;\n\t\tif (!$Security->CanSearch()) {\n\t\t\t$this->SearchOptions->HideAllOptions();\n\t\t\t$this->FilterOptions->HideAllOptions();\n\t\t}\n\t}",
"public function search($query = NULL, array $params = array(), $method = 'GET');",
"public function __construct(private SearchService $searchService)\n {\n }",
"public function __construct(SearchService $searchService)\n {\n $this->searchService = $searchService;\n\n }",
"function __construct($url_or_options = null,$options = array()){\n\t\tif(is_array($url_or_options)){\n\t\t\t$options = $url_or_options;\n\t\t\t$url_or_options = null;\n\t\t}\n\n\t\t$url = $url_or_options ? $url_or_options : API_DATA_FETCHER_BASE_URL;\n\n\t\t$options += array(\n\t\t\t\"logger\" => null,\n\t\t\t\"request\" => $GLOBALS[\"HTTP_REQUEST\"],\n\t\t\t\"response\" => $GLOBALS[\"HTTP_RESPONSE\"],\n\t\t\t\"default_params\" => array(\n\t\t\t\t\"format\" => \"json\"\n\t\t\t),\n\t\t\t\"lang\" => null, // default language; \"en\", \"cs\", \"\"\n\t\t\t\"url\" => $url,\n\t\t\t\"cache_storage\" => new CacheFileStorage(),\n\t\t\t\"user_agent\" => sprintf(\"ApiDataFetcher/%s UrlFetcher/%s\",self::VERSION,UrlFetcher::VERSION),\n\t\t\t\"additional_headers\" => array(), // array(\"X-Forwarded-For: 127.0.0.1\",\"X-Logged-User-Id: 123\")\n\t\t\t\"automatically_add_leading_slash\" => true,\n\t\t\t\"automatically_add_trailing_slash\" => true,\n\n\t\t\t\"proxy\" => \"\", // e.g. \"tcp://192.168.1.1:8118\"\n\t\t\t\"communicate_via_command\" => null, // path to a command\n\n\t\t\t\"socket_timeout\" => 5.0,\n\t\t);\n\n\t\tif(is_null($options[\"logger\"])){\n\t\t\t$options[\"logger\"] = isset($GLOBALS[\"ATK14_GLOBAL\"]) ? $GLOBALS[\"ATK14_GLOBAL\"]->getLogger() : null;\n\t\t}\n\n\t\tif(is_null($options[\"lang\"])){\n\t\t\t$options[\"lang\"] = isset($GLOBALS[\"ATK14_GLOBAL\"]) ? $GLOBALS[\"ATK14_GLOBAL\"]->getLang() : \"en\";\n\t\t}\n\n\t\t$this->default_params = (array)$options[\"default_params\"];\n\n\t\t// \"X-Forwarded-For: office.snapps.eu\" -> array(\"X-Forwarded-For: office.snapps.eu\")\n\t\tif(!is_array($options[\"additional_headers\"])){\n\t\t\t$options[\"additional_headers\"] = $options[\"additional_headers\"] ? array($options[\"additional_headers\"]) : array();\n\t\t}\n\n\t\t$this->logger = $options[\"logger\"];\n\t\t$this->request = $options[\"request\"];\n\t\t$this->response = $options[\"response\"];\n\t\t$this->lang = $options[\"lang\"];\n\t\t$this->base_url = $options[\"url\"];\n\t\t$this->cache_storage = $options[\"cache_storage\"];\n\t\t$this->user_agent = $options[\"user_agent\"];\n\t\t$this->additional_headers = $options[\"additional_headers\"];\n\t\t$this->automatically_add_leading_slash = $options[\"automatically_add_leading_slash\"];\n\t\t$this->automatically_add_trailing_slash = $options[\"automatically_add_trailing_slash\"];\n\t\t$this->proxy = $options[\"proxy\"];\n\t\t$this->communicate_via_command = $options[\"communicate_via_command\"];\n\t\t$this->socket_timeout = $options[\"socket_timeout\"];\n\t}",
"public function search($search_str) {\r\n unset($this->query['similar']);\r\n unset($this->query['object_id']);\r\n $this->query['query'] = $search_str;\r\n return $this;\r\n }",
"public static function init(?string $searchTerms) : JobSearchService\n {\n return new self(\n $searchTerms,\n resolve(JobRepository::class)\n );\n }",
"function __construct(){\r\n\t\t$this->default_options['headers'] = array(\r\n\t\t\t'Accept' => '*/*',\r\n\t\t\t'Accept-Encoding' => 'gzip, deflate',\r\n\t\t\t'Connection' => 'Keep-Alive'\r\n\t\t);\r\n\t\t\r\n\t\t// let's put some timeouts in case of slow proxies\r\n\t\t$this->default_options['curl'] = array(\r\n\t\t\tCURLOPT_CONNECTTIMEOUT => 10,\r\n\t\t\tCURLOPT_TIMEOUT => 15,\r\n\t\t\t// sometimes google routes the connection through IPv6 which just makes this more difficult to deal with - force it to always use IPv4\r\n\t\t\tCURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4\r\n\t\t);\r\n\t\t\r\n\t\t// where should we store the cookies for this search client instance? get_current_user()\r\n\t\t$this->setCookieDir(sys_get_temp_dir());\r\n\t\t\r\n\t\t// this will create an empty cookie profile\r\n\t\t$this->setProfileID('default');\r\n\t\t\r\n\t\t// init guzzle client!\r\n\t\t$this->reloadClient();\r\n\t}",
"public function newSearch($attributes = array())\n\t{\n\t\t$model = new Search();\n\t\t\n\t\tif(isset($attributes['params'])) {\n\t\t\t$attributes['params'] = json_encode($attributes['params']);\n\t\t}\n\n\t\t$model->setAttributes($attributes);\n\n\t\treturn $model;\n\t}",
"abstract protected function searchRequest(string $query, int $limit, int $offset) : stdClass;",
"public function build(): SearchAvailabilityRequest\n {\n return CoreHelper::clone($this->instance);\n }",
"public function getSearchService();",
"public function __construct(array $options = array())\n\t{\n\t\t$this->api_version = '2011-02-01';\n\t\t$this->hostname = self::DEFAULT_URL;\n\t\t$this->auth_class = 'AuthV4Query';\n\n\t\treturn parent::__construct($options);\n\t}"
] | [
"0.5985048",
"0.5704089",
"0.5422162",
"0.52805024",
"0.5273268",
"0.5265902",
"0.5243058",
"0.52297354",
"0.5222785",
"0.5214378",
"0.51807696",
"0.51205707",
"0.5080947",
"0.5077337",
"0.5071482",
"0.50653553",
"0.5038903",
"0.4986091",
"0.49850184",
"0.49784335",
"0.4969021",
"0.49575943",
"0.4957397",
"0.49429122",
"0.49391228",
"0.49376187",
"0.49255458",
"0.49245542",
"0.49200335",
"0.49110308"
] | 0.6574434 | 0 |
Get list of missing items based on callable | protected function getMissing($callable, array $target, array $lock)
{
$missing = array();
foreach ($target as $key => $value) {
if (!call_user_func($callable, $key, $value, $lock)) {
$missing[$key] = $value;
}
}
return $missing;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getMissingFilters(): array;",
"function get_unasked () {\n\t\t$unasked = array();\n\t\tforeach ( $this->entries as $entry )\n\t\t\tif ( !$entry->has_been_asked() ) $unasked[] = $entry;\n\t\treturn $unasked;\n\t}",
"function missing_number($num_list) {\n $new_arr = range($num_list[0], max($num_list));\n// use array_diff to find the missing elements \n $test = array_diff($new_arr, $num_list);\n foreach ($test as $key => $value) {\n $value;\n }\n return $value;\n}",
"public function no_items();",
"function miss();",
"public function filterEmptyItems();",
"function missing_number($num_list)\n{\n$new_arr = range($num_list[0],max($num_list)); \n// use array_diff to find the missing elements \nreturn array_diff($new_arr, $num_list);\n\n}",
"protected abstract function getDisallowedItems();",
"public function getSkippedGroups(): array;",
"public function non_shippable_items()\n\t{\n\t\t$items = array();\n\t\t\n\t\tforeach ($this->items as $item)\n\t\t{\n\t\t\tif ( ! $item->is_shippable())\n\t\t\t{\n\t\t\t\t$items[$item->row_id()] = $item;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $items;\n\t}",
"public function hasUniqueEmptyProvider()\n {\n return [\n [null],\n [[]],\n [['foo']]\n ];\n }",
"public function getAllUnmappedFunctionsOfEPC1() {\r\n\t\t$unmappedFunctions = array();\r\n\t\tforeach ( $this->epc1->functions as $id => $label ) {\r\n\t\t\tif ( !$this->mappingExistsFrom($id) ) {\r\n\t\t\t\t$unmappedFunctions[$id] = $label;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $unmappedFunctions;\r\n\t}",
"protected abstract function getExpectedItems();",
"function custom_array_list_events_ignore_by_user() {\n $list_ignore = [];\n // Get result\n $ingore_result = views_get_view_result('node_functions', 'page_11');\n if (!empty($ingore_result)) {\n foreach ($ingore_result as $row) {\n $list_ignore[] = $row->nid;\n }\n }\n if (!empty($joined_result[0])) {\n foreach ($joined_result as $row) {\n $list_ignore[] = $row->nid;\n }\n }\n \n array_unique($list_ignore);\n return $list_ignore;\n}",
"public function notAvailableOptionProvider()\n {\n $falseSelection = $this->getMockBuilder(Selection::class)\n ->disableOriginalConstructor()\n ->setMethods(['isSalable'])\n ->getMock();\n $falseSelection->method('isSalable')->willReturn(false);\n return [\n [\n false,\n 'The required options you selected are not available',\n false,\n ],\n [\n $falseSelection,\n 'The required options you selected are not available',\n false\n ],\n ];\n }",
"public function getAllUnmappedFunctionsOfEPC2() {\r\n\t\t$unmappedFunctions = array();\r\n\t\tforeach ( $this->epc2->functions as $id => $label ) {\r\n\t\t\tif ( !$this->mappingExistsTo($id) ) {\r\n\t\t\t\t$unmappedFunctions[$id] = $label;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $unmappedFunctions;\r\n\t}",
"public function getUnassignedAttributeKeys();",
"public function testWithoutKeyFunc()\n {\n $valueFunc = function ($value, $key) {\n $this->assertEquals('value', $value);\n $this->assertEquals('key', $key);\n return $value;\n };\n\n $iterator = new MapIterator($valueFunc, new \\ArrayIterator(['key' => 'value']));\n $this->assertEquals(['key'], $iterator->keys());\n $this->assertEquals(['value'], $iterator->values());\n }",
"public function getUnresolved();",
"function non_empty(array $list): array\n{\n return array_values(\n array_filter($list, function ($item) {\n return !empty($item);\n })\n );\n}",
"public function provideNonIntegerAndNotFalseValues()\n\t{\n\t\treturn array(\n\t\t\tarray(true),\n\t\t\tarray(1.0),\n\t\t\tarray('foo'),\n\t\t\tarray(array()),\n\t\t\tarray(new StdClass())\n\t\t);\n\t}",
"public function findExpired() : iterable;",
"public function shouldRequestFacetValueForMissing();",
"function getUnknowns () {\r\n\t\t\treturn $this->_unknowns;\r\n\t\t}",
"public function testUnchangedValue($function)\n {\n $enumerable = $this->newInstance(array(1, 2, 3));\n\n $result = call_user_func_array(array($enumerable, $function), array_slice(func_get_args(), 1));\n\n $this->assertEquals(array(1, 2, 3), $enumerable);\n $this->assertNotSame($enumerable, $result);\n }",
"function get_missing($role_id){\n $res = array('functional'=>array(), 'organisational'=>array());\n\n $this->load->model($this->config->item('authentication_class'), 'auth');\n $recursiveRoles = $this->auth->getRolesAndActivitiesByRoleID($role_id);\n\n //missing functional roles black magic\n $this->cosi_db->select('role_id, name, role_type_id')->from('roles')->where('role_type_id', 'ROLE_FUNCTIONAL');\n if(sizeof($recursiveRoles['functional_roles']) > 0) $this->cosi_db->where_not_in('role_id', $recursiveRoles['functional_roles']);\n $result = $this->cosi_db->get();\n\n\n foreach($result->result() as $r) $res['functional'][] = $r;\n\n //missing org roles black magic\n $ownedOrgRole = $this->cosi_db\n ->select('parent_role_id')\n ->from('role_relations')\n ->join('roles', 'roles.role_id = role_relations.parent_role_id')\n ->where('role_relations.child_role_id', $role_id)\n ->where('roles.role_type_id', 'ROLE_ORGANISATIONAL')\n ->where('enabled', DB_TRUE)\n ->where('role_relations.parent_role_id !=', $role_id)\n ->get();\n $owned = array();\n foreach($ownedOrgRole->result() as $o) $owned[] = $o->parent_role_id;\n $this->cosi_db->select('role_id, name, role_type_id')->from('roles')->where('role_type_id', 'ROLE_ORGANISATIONAL');\n if(sizeof($owned)>0) $this->cosi_db->where_not_in('role_id', $owned);\n $result = $this->cosi_db->get();\n foreach($result->result() as $r) $res['organisational'][] = $r;\n\n return $res;\n }",
"public function getExistsList(){\n return $this->_get(6);\n }",
"public function non_taxable_items()\n\t{\n\t\t$items = array();\n\t\t\n\t\tforeach ($this->items as $item)\n\t\t{\n\t\t\tif ( ! $item->is_taxable())\n\t\t\t{\n\t\t\t\t$items[$item->row_id()] = $item;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $items;\n\t}",
"final protected function getWithPrependedEmpty($items)\r\n {\r\n // array_merge breaks the indexes (i.e parent ids), so in this case we'd simply sum arrays\r\n return array('0' => $this->translator->translate('— None —')) + $items;\r\n }",
"public function unique(callable $func = null)\n {\n return new Enumerator(\n function () use ($func) {\n $exists = [];\n foreach ($this->each() as $k => $v) {\n $comp = $func ? $func($v) : $v;\n if (!in_array($comp, $exists, true)) {\n $exists[] = $comp;\n yield $k => $v;\n }\n }\n }\n );\n }"
] | [
"0.591482",
"0.54954404",
"0.5430588",
"0.5389482",
"0.5266218",
"0.5265757",
"0.52232105",
"0.51667404",
"0.51563585",
"0.5145905",
"0.5131818",
"0.50906587",
"0.5063833",
"0.5031613",
"0.5014082",
"0.500902",
"0.5002436",
"0.49969107",
"0.49897635",
"0.49782875",
"0.49765822",
"0.49691752",
"0.49621665",
"0.49518088",
"0.4941943",
"0.49314925",
"0.49246672",
"0.49097183",
"0.4907361",
"0.4846032"
] | 0.6351782 | 0 |
Load target definition from new composer.json. | protected function loadTargetDefinition()
{
// Initialize target.
$this->target = array(
'generic' => array(),
'packages' => array(),
);
$new = $this->loadFromFile($this->newJsonFile);
// Parse generic settings
foreach ($this->genericSettings as $key) {
if (isset($new[$key])) {
$this->target['generic'][$key] = $new[$key];
}
}
// Parse required packages (we do not really care about dev packages).
foreach ($new['require'] as $package => $version) {
$this->target['packages'][$package] = $version;
}
return $this->target;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function updatePackageJson()\n {\n copy(__DIR__ . '/stubs/config/package.json', base_path('package.json'));\n }",
"protected function updateComposerJson()\n {\n $composerJson = getenv('COMPOSER') ?: 'composer.json';\n\n $path = base_path($composerJson);\n\n //\n $config = json_decode(file_get_contents($path), true);\n\n if (is_array($config) && isset($config['autoload'])) {\n $namespace = $this->data['namespace'] .'\\\\';\n\n $config['autoload']['psr-4'][$namespace] = 'plugins/' . $this->data['name'] . \"/src/\";\n\n $output = json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . \"\\n\";\n\n file_put_contents($path, $output);\n }\n }",
"private function configureComposer(): void\n {\n try {\n $io = $this->getIO();\n $composerJson = new JsonFile($this->getProjectRoot() . '/composer.json');\n if (!$composerJson->exists()) {\n $io->write('<comment>composer.json is not found, skipping its configuration, you need to create it later</comment>');\n\n return;\n }\n try {\n /** @var array $config */\n $config = $composerJson->read();\n } catch (RuntimeException $e) {\n $io->write('<error>composer.json is not valid, skipping its configuration, you need to create it later</error>');\n\n return;\n }\n $config['name'] = '';\n $config['description'] = '';\n $config['authors'] = [];\n unset(\n $config['version'],\n $config['type'],\n $config['keywords'],\n $config['homepage'],\n $config['time'],\n $config['license'],\n $config['support'],\n $config['require-dev']\n );\n if ($io->isInteractive()) {\n $io->write('<info>composer.json will be modified now to match your project settings</info>');\n // Get package name\n $git = $this->getGitConfig();\n $name = basename($this->getProjectRoot());\n /** @noinspection RegExpUnnecessaryNonCapturingGroup */\n $name = strtolower(preg_replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\\\1\\\\3-\\\\2\\\\4', $name));\n if (array_key_exists('github.user', $git)) {\n $name = $git['github.user'] . '/' . $name;\n } elseif (!empty($_SERVER['USERNAME'])) {\n $name = $_SERVER['USERNAME'] . '/' . $name;\n } elseif (get_current_user()) {\n $name = get_current_user() . '/' . $name;\n } else {\n // package names must be in the format foo/bar\n $name .= '/' . $name;\n }\n $name = strtolower($name);\n $name = $io->askAndValidate(\n 'Package name (<vendor>/<name>) [<comment>' . $name . '</comment>]: ',\n static function ($value) use ($name) {\n if (null === $value) {\n return $name;\n }\n\n if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}', $value)) {\n throw new InvalidArgumentException(\n 'The package name ' . $value . ' is invalid, it should be lowercase and have a vendor name, a forward slash, and a package name, matching: [a-z0-9_.-]+/[a-z0-9_.-]+'\n );\n }\n\n return $value;\n },\n null,\n $name\n );\n $config['name'] = $name;\n $this->variables['package-name'] = [\n 'type' => 'string',\n 'value' => $name,\n ];\n\n // Get package description\n $description = '';\n $description = $io->ask('Description [<comment>' . $description . '</comment>]: ', $description);\n $config['description'] = $description;\n $this->variables['package-description'] = [\n 'type' => 'string',\n 'value' => $description,\n ];\n\n // Get package author\n $author = '';\n $parseAuthor = static function ($author) {\n /** @noinspection RegExpRedundantEscape */\n if (preg_match('/^(?P<name>[- \\.,\\p{L}\\p{N}\\'’]+) <(?P<email>.+?)>$/u', $author, $match) && filter_var($match['email'],\n FILTER_VALIDATE_EMAIL) !== false) {\n return [\n 'name' => trim($match['name']),\n 'email' => $match['email'],\n ];\n }\n\n return null;\n };\n $formatAuthor = static function ($name, $email) {\n return sprintf('%s <%s>', $name, $email);\n };\n if (array_key_exists('user.name', $git) && array_key_exists('user.email', $git)) {\n $author = $formatAuthor($git['user.name'], $git['user.email']);\n if (!$parseAuthor($author)) {\n $author = '';\n }\n }\n $author = $io->askAndValidate('Author [<comment>' . $author . '</comment>, n to skip]: ',\n static function ($value) use ($parseAuthor, $formatAuthor, $author) {\n if ($value === 'n' || $value === 'no') {\n return null;\n }\n $value = $value ?: $author;\n $author = $parseAuthor($value);\n if (!is_array($author)) {\n throw new InvalidArgumentException(\n 'Invalid author string. Must be in the format: ' .\n 'John Smith <[email protected]>'\n );\n }\n\n return $formatAuthor($author['name'], $author['email']);\n }, null, $author);\n if ($author) {\n $config['authors'][] = $parseAuthor($author);\n }\n } else {\n $io->write('<comment>composer.json is cleaned up, but not configured because installation is running in non-interactive mode. You need to configure it by yourself</comment>');\n }\n\n // Setup WPackagist repository\n if (!array_key_exists('repositories', $config)) {\n $config['repositories'] = [];\n }\n $wpackagist = [\n 'type' => 'composer',\n 'url' => 'https://wpackagist.org',\n ];\n foreach ($config['repositories'] as $repository) {\n if (array_key_exists('url', $repository) &&\n array_key_exists('type', $repository) &&\n $repository['type'] === $wpackagist['type'] &&\n $repository['url'] === $wpackagist['url']\n ) {\n $wpackagist = null;\n break;\n }\n }\n if ($wpackagist !== null) {\n $config['repositories'][] = $wpackagist;\n }\n\n // Setup WordPress directories and WordPress installers paths\n if (!array_key_exists('extra', $config)) {\n $config['extra'] = [];\n }\n $extra = $this->getComposer()->getPackage()->getExtra();\n $gitIgnore = [\n '# WordPress itself and related files and directories',\n ];\n $gitIgnore[] = '/' . self::$configurationFiles['local']['file'];\n $directories = [];\n foreach (self::$wordpressDirectories as $type => $directory) {\n $key = $directory['key'];\n $dir = $directory['path'];\n if (array_key_exists($key, $extra)) {\n $dir = $extra[$key];\n }\n $directories[$type] = $dir;\n $config['extra'][$key] = $dir;\n $this->variables[$key] = [\n 'type' => 'string',\n 'value' => $dir,\n ];\n if ($type !== 'content') {\n $gitIgnore[] = '/' . $dir;\n }\n }\n // Ignore vendor and bin directories that are controlled by Composer\n $composerCfg = $this->getComposer()->getConfig();\n $vendorDir = $composerCfg->get('vendor-dir', Config::RELATIVE_PATHS);\n $gitIgnore[] = '/' . $vendorDir;\n $binDir = $composerCfg->get('bin-dir', Config::RELATIVE_PATHS);\n if ($binDir !== 'vendor/bin') {\n if (!array_key_exists('config', $config)) {\n $config['config'] = [];\n }\n $config['config']['bin-dir'] = $binDir;\n }\n if (!in_array($binDir, ['', '.'], true) && !str_starts_with($binDir, $vendorDir . '/')) {\n $gitIgnore[] = '/' . $binDir;\n }\n $gitIgnore[] = '';\n $gitIgnore[] = '# Directories for WordPress plugins and themes controlled by Composer';\n $config['extra']['installer-paths'] = [];\n foreach (self::$installerPaths as $type => $dir) {\n $path = sprintf('%s/%s/{$name}', $directories['content'], $dir);\n $config['extra']['installer-paths'][$path] = [$type];\n $gitIgnore[] = sprintf('/%s/%s', $directories['content'], $dir);\n }\n $root = $this->getProjectRoot();\n foreach (self::$wordpressModules as $type => $info) {\n $gitIgnore[] = '/' . ltrim(str_replace($root, '', $this->getWordpressModulesDirectory($type, 'project')), '/');\n }\n\n $composerJson->write($config);\n $io->write('<info>composer.json is successfully updated</info>');\n $this->configuredComponents['composer'] = $config;\n\n // Create .gitignore\n file_put_contents($this->getProjectRoot() . '/.gitignore', implode(\"\\n\", $gitIgnore));\n $this->configuredComponents['gitignore'] = $gitIgnore;\n } catch (Throwable $e) {\n $this->getIO()->writeError('composer.json configuration failed due to exception: ' . $e->getMessage());\n }\n }",
"public function generate()\n {\n $stub = $this->finder->get(__DIR__ . '/../stubs/composerJson.stub');\n\n $stub = $this->replaceContentInStub($stub);\n\n $this->finder->put($this->themePathForFile($this->options['name'], 'composer.json'), $stub);\n }",
"public function load(): void\n {\n $this->createFileIfNeeded();\n\n $this->recompileIfNeeded();\n\n $this->files->getRequire($this->config['file_path']);\n }",
"private function restoreComposerJson(string $composerJsonFile): void\n {\n $this->filesystem->dumpFile($composerJsonFile, $this->originalComposerJsonFileContent);\n\n // re-run @todo composer update on root\n }",
"private function parseComposerDefinition(Composer $composer, string $composerFile): void\n {\n $this->composerJson = new JsonFile($composerFile);\n $this->composerDefinition = $this->composerJson->read();\n\n // Get root package or root alias package\n $this->rootPackage = $composer->getPackage();\n $this->composerRequires = $this->rootPackage->getRequires();\n $this->composerDevRequires = $this->rootPackage->getDevRequires();\n $this->stabilityFlags = $this->rootPackage->getStabilityFlags();\n }",
"abstract protected function createComposer();",
"private function composer() {\n $path = app_path() . '\\\\..\\\\composer.lock';\n\n if (!file_exists($path))\n return;\n\n // Parse composer.lock\n $content = @file_get_contents($path);\n $list = @json_decode($content);\n\n if (!$list)\n return;\n\n $list = object_get($list, 'packages', []);\n\n // Determe the parent of the composer modules, most likely this will\n // resolve to laravel/laravel.\n $parent = '';\n $parent_path = realpath(app_path() . '\\\\..\\\\composer.json');\n if (file_exists($parent_path)) {\n $parent_object = @json_decode(@file_get_contents($parent_path));\n\n if ($parent_object)\n $parent = object_get($parent_object, 'name', '');\n }\n\n // Store base package, which is laravel/laravel.\n $packages = [[\n 'n' => $parent,\n 'l' => $parent_path,\n 'v' => ''\n ]];\n\n // Add each composer module to the packages list,\n // but respect the parent relation.\n foreach ($list as $package) {\n $packages[] = [\n 'n' => $package->name,\n 'v' => $package->version,\n 'p' => $parent,\n 'l' => $parent_path\n ];\n }\n\n return $packages;\n }",
"public function readOriginal()\n {\n if (! File::exists($this->path().'/composer.json.original')) {\n return $this->read();\n }\n\n return $this->read('composer.json.original');\n }",
"protected function load_dependencies() {}",
"public function loadComposer()\n {\n if ($ownVendor = $this->tryPath('vendor/', BootLoader::RELATIVE | BootLoader::VALIDATE)) {\n $this->autoLoader = require $ownVendor . 'autoload.php';\n } else {\n // when bootstrapping is inside a dependency of another project\n $this->autoLoader = require $this->getPath('../../', BootLoader::RELATIVE | BootLoader::VALIDATE) . 'autoload.php';\n }\n }",
"private static function updateComposerAutoloading(): void\n {\n $updatedStaticLoader = str_replace(\n \"__DIR__ . '/../..'\",\n sprintf(\"'%s'\", rtrim(getenv('LAMBDA_TASK_ROOT'), '/')),\n file_get_contents(self::AUTOLOAD_STATIC_PATH)\n );\n\n file_put_contents(self::AUTOLOAD_STATIC_PATH, $updatedStaticLoader);\n }",
"private function getComposerJson()\n {\n $composerFile = ($this->composerFileFactory)();\n return new JsonFile($composerFile);\n }",
"public function composer_additional_assets() {}",
"public function getComposerJson()\n {\n $json = $this->getPath('composer.json');\n\n if (!file_exists($json)) {\n return null;\n }\n\n return json_decode(file_get_contents($json));\n }",
"public static function get_dependency_info() {\n\t\t$folder = Director::baseFolder();\n\t\t$raw = file_get_contents($folder . '/composer.lock');\n\t\t$deps = json_decode($raw, true);\n\n\t\treturn $deps;\n\t}",
"public function useComposerAutoloader()\n {\n $this->bAutoloadEnabled = true;\n $this->xAutoloader = require(__DIR__ . '/../../../../../autoload.php');\n }",
"protected static function load()\n /**/\n {\n $data = json_decode(file_get_contents(\n __DIR__ . '/../../etc/depend.json'\n ), true);\n\n if (is_null($data)) {\n $code = json_last_error();\n\n switch ($code) {\n case JSON_ERROR_NONE:\n $msg = 'no errors';\n break;\n case JSON_ERROR_DEPTH:\n $msg = 'maximum stack depth exceeded';\n break;\n case JSON_ERROR_STATE_MISMATCH:\n $msg = 'underflow or the modes mismatch';\n break;\n case JSON_ERROR_CTRL_CHAR:\n $msg = 'unexpected control character found';\n break;\n case JSON_ERROR_SYNTAX:\n $msg = 'syntax error, malformed JSON';\n break;\n case JSON_ERROR_UTF8:\n $msg = 'malformed UTF-8 characters, possibly incorrectly encoded';\n break;\n default:\n $msg = 'unknown error';\n break;\n }\n\n throw new \\Exception($msg, $code);\n }\n\n return $data;\n }",
"public function getTargetDefinition();",
"private function load()\n\t{\n\t\t$this->_container = json_decode(file_get_contents($this->_file), true);\n\t}",
"public function getMergedComposerAutoload() {\n\t\treturn $this->getMergedComposerData('autoload');\n\t}",
"function load_latest_release() {\n\t\tif ( file_exists( \"{$this->releases_dir}{$this->plugin_stub}.zip\" ) ) {\n\t\t\t$this->parse_readme( \"{$this->releases_dir}{$this->plugin_stub}.zip\" );\n\t\t} else {\n\t\t\t// Loop over files looking for a version number\n\t\t\tforeach ( glob( \"{$this->releases_dir}{$this->plugin_stub}*.zip\" ) as $filename ) {\n\t\t\t\tpreg_match( \"/^{$this->plugin_stub}\\-([0-9\\.]+)\\.zip$/\", basename( $filename ), $matches );\n\t\t\t\tif ( isset( $matches[1] ) ) {\n\t\t\t\t\t$this_version = $matches[1];\n\t\t\t\t\tif ( version_compare( $this_version, $this->latest_version ) == 1 ) {\n\t\t\t\t\t\t$this->latest_version = $this_version;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $this->latest_version != '0.0.0' ) {\n\t\t\t\t$this->parse_readme( \"{$this->releases_dir}{$this->plugin_stub}-{$this->latest_version}.zip\" );\n\t\t\t} else {\n\t\t\t\t$this->abort();\n\t\t\t}\n\t\t}\n\t}",
"private function updateRootPackage(): void\n {\n $this->rootPackage->setRequires($this->composerRequires);\n $this->rootPackage->setDevRequires($this->composerDevRequires);\n $this->rootPackage->setStabilityFlags($this->stabilityFlags);\n $this->rootPackage->setAutoload($this->composerDefinition['autoload']);\n $this->rootPackage->setDevAutoload($this->composerDefinition['autoload-dev']);\n $this->rootPackage->setExtra($this->composerDefinition['extra'] ?? []);\n }",
"private function getJson()\n {\n return json_decode(file_get_contents($this->composerFile->getPathname()));\n }",
"private function readVersion()\n {\n $composer = file_get_contents(self::$dir.'/composer.json');\n $composer_json = json_decode($composer);\n $version = $composer_json->version;\n\n return $version;\n }",
"function package($name = null) {\n $composer = File::get(base_path('composer.lock'));\n\n // Get packages\n $array = json_decode($composer, true);\n $packages = array_key_exists('packages', $array) ? $array['packages'] : [];\n foreach($packages as $key=>$package) {\n $path = str_replace('https://api.github.com/repos/', '', $package['dist']['url']);\n $paths = explode('/', $path);\n $packages[$key]['path'] = $paths[0].'/'.$paths[1];\n }\n\n // Get the package if name is not null\n if($name === null) {\n return $packages;\n }\n else {\n $index = '';\n if(count($packages)>0) {\n foreach($packages as $key=>$package) {\n if($package['name'] == $name) $index = $key;\n }\n }\n return array_key_exists($index, $packages) ? $packages[$index] : null;\n }\n }",
"public function require(): Composer\n {\n $this->section = array_get($this->reader, 'require');\n\n return $this;\n }",
"public function getComposer()\n {\n return $this->composer = new Composer(\n json_decode($this->layoutJson, true),\n $this->getFormAttributes(),\n craft()->freeform_forms,\n craft()->freeform_submissions,\n craft()->freeform_mailer,\n craft()->freeform_files,\n craft()->freeform_mailingLists,\n craft()->freeform_crm,\n craft()->freeform_statuses,\n new CraftTranslator()\n );\n }",
"private function versionFromComposer()\n {\n $composerFile = $this->readJsonFile('composer.json');\n\n /*\n * Look for platform override\n *\n * \"config\": {\n * \"platform\": {\n * \"php\": \"5.6.0\"\n * }\n * }\n */\n if (isset($composerFile['config']['platform']['php'])) {\n return $composerFile['config']['platform']['php'];\n }\n\n return null;\n }"
] | [
"0.6100977",
"0.57357585",
"0.571559",
"0.5608432",
"0.5402559",
"0.5347862",
"0.5340224",
"0.5230591",
"0.5206634",
"0.51940763",
"0.5187822",
"0.5181353",
"0.51756334",
"0.51508975",
"0.5039986",
"0.5002253",
"0.49897712",
"0.49650198",
"0.4954223",
"0.49516723",
"0.49002254",
"0.48730364",
"0.48341483",
"0.47955158",
"0.47816297",
"0.4778475",
"0.47705227",
"0.47697642",
"0.4757315",
"0.47527352"
] | 0.69327396 | 0 |
To determine whether we are dealing with a stock composer file we compare the composer.json hash with the one reported in composer.lock and the one we know from our shipped releases. If they do not match up someone made a customization somewhere. | protected function isStockComposer()
{
// Load lock file into memory.
$this->loadLock();
$actualHash = $this->getActualHash($this->jsonFile);
if (!$actualHash) {
$this->log("Cannot calculate hash of {$this->jsonFile}");
return false;
}
// Fetch checksum of the stock composer.json
$stockHash = $this->getStockHash(self::COMPOSER_JSON);
if (!$stockHash) {
$this->log("Cannot find stock hash of " . self::COMPOSER_JSON);
return false;
}
if ($actualHash !== $stockHash) {
$this->log("Actual hash of " . self::COMPOSER_JSON
. " ($actualHash) does not match stock hash ($stockHash)");
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function useGitCache()\n {\n $git = $this->getGitBinary();\n $gitVersion = $this->console->run(\"$git version\");\n $regs = [];\n\n if (preg_match('/((\\d+\\.?)+)/', $gitVersion, $regs)) {\n $version = $regs[1];\n } else {\n $version = \"1.0.0\";\n }\n\n return version_compare($version, '2.3', '>=');\n }",
"public function testComposerLockExists() {\n $this->assertFileExists($this->getProjectDirectory() . '/composer.lock');\n }",
"private function versionFromComposer()\n {\n $composerFile = $this->readJsonFile('composer.json');\n\n /*\n * Look for platform override\n *\n * \"config\": {\n * \"platform\": {\n * \"php\": \"5.6.0\"\n * }\n * }\n */\n if (isset($composerFile['config']['platform']['php'])) {\n return $composerFile['config']['platform']['php'];\n }\n\n return null;\n }",
"private function tryFindVersionInComposerLock($decodedJsonObject)\n {\n if (!isset($decodedJsonObject['packages'])) {\n return false;\n }\n\n $packages = $decodedJsonObject['packages'];\n foreach ($packages as $package) {\n if (!isset($package['version']) ||\n !isset($package['name']) ||\n $package['name'] !== 'swedbank-pay/swedbank-pay-sdk-php'\n ) {\n continue;\n }\n\n return $package['version'];\n }\n\n return false;\n }",
"public static function usesComposer()\n {\n $currentTYPO3Version = VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);\n $composer = false;\n\n if ($currentTYPO3Version >= VersionNumberUtility::convertVersionNumberToInteger('7.0.0')) {\n $composer = Bootstrap::usesComposerClassLoading();\n }\n\n return $composer;\n }",
"public function canUseComposer()\n\t{\n\t\tinclude 'composer.php';\n\t\t$composer = new Composer;\n\n\t\tif (!$composer->hasPhp532()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$composer->hasCurl()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($composer->hasApc()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($composer->hasSuhosin()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$composer->hasAllowUrlFopen()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($this->filePermissions) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"private function tryGetVersionNumberFromComposerJson(&$version) : bool\n {\n $composer = null;\n\n if (!$this->tryReadComposerJson($composer)) {\n return false;\n }\n\n if (isset($composer['version'])) {\n $version = $composer['version'];\n\n if ($version !== null && !empty($version)) {\n return true;\n }\n }\n\n return false;\n }",
"public function testComposerJsonExists() {\n $this->assertFileExists($this->getProjectDirectory() . '/composer.json');\n }",
"function _setVersionMismatch(){\n global $config;\n // mismatched version only IF a setup.php file exists AND it has a different version than the one currently set\n if(isset($setup)) unset($setup);\n @include (DIR_PLUGINS.\"{$this->sName}/setup.php\");\n $this->versionMismatch = (isset($setup['version']) && $setup['version']!=$this->getVersion()) ? $setup['version'] : false;\n if($this->versionMismatch!==false && $config['bPM_versionChecking']) $this->setStatus(false);\n }",
"private function versionFromLock()\n {\n $lockFile = $this->readJsonFile('composer.lock');\n\n /*\n * Look for platform override\n * \"platform-overrides\": {\n * \"php\": \"5.6.0\"\n * }\n */\n if (isset($lockFile['platform-overrides']['php'])) {\n return $lockFile['platform-overrides']['php'];\n }\n\n return null;\n }",
"protected function skipMerge()\n {\n // In case for one reason composer.json or composer.lock have\n // dissappeared, we skip the merge as there is no reference\n // to start from..\n if ($this->areFilesMissing(array($this->jsonFile, $this->lockFile))) {\n return true;\n }\n\n // Determine if any changes have been made to composer settings\n if ($this->isStockComposer()) {\n $this->log(\"Skipping merge, stock composer settings detected\");\n return true;\n }\n\n return false;\n }",
"public function testVersion() {\n $this->assertEquals(s\\Client::VERSION, '1.0.11');\n $this->assertEquals(json_decode(file_get_contents('composer.json'))->version, \\SendGrid\\Client::VERSION);\n }",
"private function checkCurrentVersion() {\n $url = 'https://api.github.com/repos/pantheon-systems/cli/releases?per_page=1';\n $response = Request::send($url, 'GET'); \n $json = $response->getBody(true);\n $data = json_decode($json);\n $release = array_shift($data);\n $this->cache->put_data('latest_release', array('version' => $release->name, 'check_date' => time()));\n return $release->name;\n }",
"private function isBookStackDir()\n {\n $dir = getcwd();\n $composer = $dir . '/composer.json';\n $versionFile = $dir . '/version';\n\n if (!file_exists($composer) || !file_exists($versionFile)) return false;\n\n $composerData = json_decode(file_get_contents($composer));\n if (!isset($composerData->name)) return false;\n if (strpos(strtolower(explode('/', $composerData->name)[1]), 'bookstack') === false) return false;\n\n return true;\n }",
"function shaken_check_version(){\n\t\n\tglobal $shaken_theme_name, $theme_data;\n\t\n\t$version_url = \"http://versions.shakenandstirredweb.com/versions.xml\";\n\t\n\t$get_versions = wp_remote_get($version_url);\n\tif ( !is_wp_error($get_versions) && 200 == $get_versions['response']['code'] ) {\n\t\t$versions = $get_versions['body'];\n\t}\n\t\n\t// Set a future date to check\n\t$next_check = time() + (2 * 24 * 60 * 60);\n\tupdate_option('shaken_next_check', $next_check);\n\t\n\tif(isset($versions) && $versions != \"\" && $versions !== false){\n\t\t$versions = shaken_xml2array($versions);\n\t\t\n\t\tforeach($versions['versions']['_c']['version'] as $update){\n\t\t\t$latest = str_replace(\".\",\"\",trim($update['_v']));\n\t\t\tif($update['_a']['name'] == $shaken_theme_name){\n\t\t\t\tif(str_replace(\".\",\"\",$theme_data['Version']) < $latest){\n\t\t\t\t\t$shaken_update_version = trim($update['_v']);\n\t\t\t\t\t\n\t\t\t\t\tupdate_option('shaken_latest_version', $shaken_update_version);\n\t\t\t\t\t\n\t\t\t\t\treturn $shaken_update_version;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn false;\n}",
"private function readVersion()\n {\n $composer = file_get_contents(self::$dir.'/composer.json');\n $composer_json = json_decode($composer);\n $version = $composer_json->version;\n\n return $version;\n }",
"function version_check() {\n\n\t$cache = new vvv_dash_cache();\n\n\tif ( ( $version = $cache->get( 'version-cache', VVV_DASH_THEMES_TTL ) ) == false ) {\n\n\t\t$url = 'https://raw.githubusercontent.com/topdown/VVV-Dashboard/master/version.txt';\n\t\t$version = get_version( $url );\n\t\t// Don't save unless we have data\n\t\tif ( $version && ! strstr( $version, 'Error' ) ) {\n\t\t\t$status = $cache->set( 'version-cache', $version );\n\t\t}\n\t}\n\n\treturn $version;\n}",
"protected function checkComposerConfig()\n {\n if (!$this->checkComposerConfig) {\n return;\n }\n\n /** @noinspection PhpUnhandledExceptionInspection */\n // @phpstan-ignore-next-line\n if (version_compare(Codecept::VERSION, '4.0.0', '>=')) {\n checkComposerDependencies(composerFile(resolvePath('composer.json', $this->workDir)), [\n 'codeception/module-asserts' => '^1.0',\n 'codeception/module-phpbrowser' => '^1.0',\n 'codeception/module-webdriver' => '^1.0',\n 'codeception/module-db' => '^1.0',\n 'codeception/module-filesystem' => '^1.0',\n 'codeception/module-cli' => '^1.0',\n 'codeception/util-universalframework' => '^1.0'\n ], static function ($lines) {\n throw new \\RuntimeException(\n \"wp-browser requires the following packages to work with Codeception v4.0:\\n\\n\" .\n implode(\",\\n\", $lines) .\n \"\\n\\n1. Add these lines to the 'composer.json' file 'require-dev' section.\" .\n \"\\n2. Run 'composer update'.\" .\n \"\\n3. Run the 'codecept init wpbrowser' command again.\"\n );\n });\n }\n }",
"public function getModuleVersion()\n {\n $moduleDir = $this->componentRegistrar->getPath(\\Magento\\Framework\\Component\\ComponentRegistrar::MODULE, 'Adyen_Payment');\n\n $composerJson = file_get_contents($moduleDir . '/composer.json');\n $composerJson = json_decode($composerJson, true);\n\n if (empty($composerJson['version'])) {\n return \"Version is not available in composer.json\";\n }\n\n return $composerJson['version'];\n }",
"public function needsUpdate()\n {\n return $this->getOldVersion() !== config('app.version');\n }",
"public function getMergedComposerRequirements() {\n\t\treturn $this->getMergedComposerData('require');\n\t}",
"public function writeMergedComposerJson() {\n\t\t$composerJson = $this->getMergedComposerJson();\n\t\t$composerJson = json_encode($composerJson);\n\t\tif ($composerJson) {\n\t\t\t$this->makeSureTempPathExists();\n\t\t\treturn file_put_contents($this->getTempPath() . 'composer.json', $composerJson);\n\t\t}\n\t\treturn FALSE;\n\t}",
"private function tryGetVersionNumberFromComposerLock(&$version) : bool\n {\n $composerLock = null;\n if ($this->tryReadComposerLock($composerLock)) {\n $version = $this->tryFindVersionInComposerLock($composerLock);\n if ($version) {\n return true;\n }\n }\n\n return false;\n }",
"public function isValid()\n {\n return $this->directory && realpath($this->directory . '/composer.json');\n }",
"function moments_qodef_visual_composer_installed() {\n\t\t//is Visual Composer installed?\n\t\tif ( class_exists( 'WPBakeryVisualComposerAbstract' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function isCraftRequiredVersion()\n\t{\n\t\treturn version_compare(craft()->getVersion(), $this->getCraftMinimumVersion(), '>=');\n\t}",
"public static function get_dependency_info() {\n\t\t$folder = Director::baseFolder();\n\t\t$raw = file_get_contents($folder . '/composer.lock');\n\t\t$deps = json_decode($raw, true);\n\n\t\treturn $deps;\n\t}",
"private function tryReadComposerJson(&$decodedJsonObject) : bool\n {\n $path = $this->getComposerPath() . DIRECTORY_SEPARATOR . 'composer.json';\n\n // phpcs:disable\n if (!file_exists($path)) {\n return false;\n }\n\n $contents = file_get_contents($path);\n\n // phpcs:enable\n $decodedJsonObject = json_decode($contents, true);\n\n return true;\n }",
"public function isUnderGitVersionControl(): bool\n {\n return File::exists(base_path('.git'));\n }",
"public function getComposerWhitelist(array $install): array\n {\n $composerService = Craft::$app->getComposer();\n\n // If there's no composer.lock or we can't decode it, then we're done\n $lockPath = $composerService->getLockPath();\n if ($lockPath === null) {\n return array_keys($install);\n }\n $lockData = Json::decode(file_get_contents($lockPath));\n if (empty($lockData) || empty($lockData['packages'])) {\n return array_keys($install);\n }\n\n $installed = [];\n\n // Get the installed package versions\n $hashes = [];\n foreach ($lockData['packages'] as $package) {\n $installed[$package['name']] = $package['version'];\n\n // Should we be including the hash as well?\n if (strpos($package['version'], 'dev-') === 0) {\n $hash = $package['dist']['reference'] ?? $package['source']['reference'] ?? null;\n if ($hash !== null) {\n $hashes[$package['name']] = $hash;\n }\n }\n }\n\n // Check for aliases\n $aliases = [];\n if (!empty($lockData['aliases'])) {\n $versionParser = new VersionParser();\n foreach ($lockData['aliases'] as $alias) {\n // Make sure the package is installed, we haven't already assigned an alias to this package,\n // and the alias is for the same version as what's installed\n if (\n !isset($aliases[$alias['package']]) &&\n isset($installed[$alias['package']]) &&\n $alias['version'] === $versionParser->normalize($installed[$alias['package']])\n ) {\n $aliases[$alias['package']] = $alias['alias'];\n }\n }\n }\n\n // Append the hashes and aliases\n foreach ($hashes as $name => $hash) {\n $installed[$name] .= '#' . $hash;\n }\n\n foreach ($aliases as $name => $alias) {\n $installed[$name] .= ' as ' . $alias;\n }\n\n $jsonPath = Craft::$app->getComposer()->getJsonPath();\n $composerConfig = Json::decode(file_get_contents($jsonPath));\n $minStability = strtolower($composerConfig['minimum-stability'] ?? 'stable');\n if ($minStability === 'rc') {\n $minStability = 'RC';\n }\n\n $requestBody = [\n 'require' => $composerConfig['require'],\n 'installed' => $installed,\n 'platform' => ApiHelper::platformVersions(true),\n 'install' => $install,\n 'minimum-stability' => $minStability,\n 'prefer-stable' => (bool)($composerConfig['prefer-stable'] ?? false),\n ];\n\n $response = $this->request('POST', 'composer-whitelist', [\n RequestOptions::BODY => Json::encode($requestBody),\n ]);\n\n return Json::decode((string)$response->getBody());\n }"
] | [
"0.63975143",
"0.62785363",
"0.62425363",
"0.6130499",
"0.61072254",
"0.60578763",
"0.6034806",
"0.5969641",
"0.58229333",
"0.581846",
"0.57621336",
"0.57506406",
"0.5750529",
"0.5747303",
"0.57419693",
"0.5733843",
"0.5729475",
"0.57061654",
"0.56571084",
"0.55712426",
"0.5570467",
"0.5566182",
"0.55567384",
"0.55511385",
"0.5503177",
"0.5496717",
"0.54840666",
"0.5477918",
"0.5456461",
"0.54478246"
] | 0.7783678 | 0 |
Returns stock hash of the given file or NULL if hash is not found | protected function getStockHash($file)
{
$md5_string = array();
if (!file_exists($this->hashFile)) {
$this->log("{$this->hashFile} file is missing.");
return null;
}
require $this->hashFile;
$key = './' . $file;
if (!isset($md5_string[$key])) {
$this->log("Cannot find hash for {$file} in {$this->hashFile}.");
return null;
}
return $md5_string[$key];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getHash($filename) {\n if (!isset($this->data[$filename]))\n return FALSE;\n return $this->data[$filename];\n }",
"function find_url_hash_in_list($url_hash, $file) {\n if (!file_exists($file)) {\n return null;\n }\n\n $list_file = fopen($file, \"r\") or die(\"unable to read: \" . $file . \" error: \" . print_r(error_get_last(), true));\n while (($buffer = fgets($list_file)) !== false) {\n $buffer = trim($buffer);\n if (strcmp(hash(\"sha256\", $buffer), $url_hash) == 0) {\n fclose($list_file);\n return $buffer;\n }\n }\n\n fclose($list_file);\n return null;\n}",
"public static function getFileHash($path)\n {\n if(!file_exists($path))\n {\n return null;\n }\n\n return md5_file($path);\n }",
"protected function getActualHash($path)\n {\n if (!file_exists($path)) {\n $this->log(\"{$path} file doesn't exist.\");\n return null;\n }\n\n return md5_file($path);\n }",
"public function getHashSum(): ?string {\n\t\ttry {\n\t\t\treturn $this->details->getTechnicalImageDetails()[0]->getFile()[0]->getHashSum()->getHashSum();\n\t\t} catch (Throwable $ex) {\n\t\t\treturn null;\n\t\t}\n\t}",
"private function hash( Loco_fs_File $file ){\n $path = $file->normalize();\n // if file is real, we must resolve its real path\n if( $file->exists() && ( $real = realpath($path) ) ){\n $path = $real;\n }\n return $path;\n }",
"public function getHashFile(string $algorithm, string $sourceFile, bool $useCache = false): string;",
"public function getFileableHash();",
"public function getFileableEnsuredHash();",
"public function getResourceHash($resourcePath)\n {\n return $this->hasResource($this->root.$resourcePath) ? File::hash($this->root.$resourcePath) : null;\n }",
"public function get_hash()\n {\n if ( $this->file ){\n return md5_file($this->file);\n }\n return '';\n }",
"public function fileHash($path);",
"private function getDbFileHash()\n {\n if (!file_exists($this->dbpath)) {\n return null;\n }\n return hash_file('md5', $this->dbpath);\n }",
"public function getHash(): ?string\n {\n return $this->hash;\n }",
"public function getHashed($file)\n {\n return hash_file('md5', $file);\n }",
"public static function get_git_short_hash( $path = null )\n\t{\n\t\t$rev = '';\n\t\t$path = is_null( $path ) ? FILMIO_PATH . '/system' : $path;\n\t\t$ref_file = $path . '/.git/HEAD';\n\t\tif ( file_exists( $ref_file ) ) {\n\t\t\t$info = file_get_contents( $ref_file );\n\t\t\t// If the contents of this file start with \"ref: \", it means we need to look where it tells us for the hash.\n\t\t\t// CAVEAT: This is only really useful if the master branch is checked out\n\t\t\tif ( strpos( $info, 'ref: ' ) === false ) {\n\t\t\t\t$rev = substr( $info, 0, 7 );\n\t\t\t} else {\n\t\t\t\tpreg_match( '/ref: (.*)/', $info, $match );\n\t\t\t\t$rev = substr( file_get_contents( $path . '/.git/' . $match[1] ), 0, 7 );\n\t\t\t}\n\t\t}\n\t\treturn $rev;\n\t}",
"public function getHash($file = 'Manifest', $type = 'sha256') {\n\t\t\tif($file == 'Manifest') {\n\t\t\t\t\n\t\t\t\tif(!$this->hash) {\n\t\t\t\t\t$str = $this->hash = sha1($this->getManifest());\n\t\t\t\t} else {\n\t\t\t\t\t$str =& $this->hash;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$this->parse();\n\t\t\t\t\t\n\t\t\t\t$str = $this->arr_files[$file][$type];\n\t\t\t\t\n\t\t\t}\t\n\t\t\n\t\t\treturn $str;\n\t\t}",
"protected function findFileByHash($hash)\n {\n $file = null;\n\n /**\n * As of 6.2 we can use\n * $files = FileIndexRepository->findByContentHash($hash);\n * Until then a direct DB query\n */\n $files = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(\n 'storage,identifier',\n 'sys_file',\n 'sha1=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($hash, 'sys_file')\n );\n if (count($files)) {\n foreach ($files as $fileInfo) {\n if ($fileInfo['storage'] > 0) {\n $file = $this->getResourceFactory()->getFileObjectByStorageAndIdentifier($fileInfo['storage'],\n $fileInfo['identifier']);\n break;\n }\n }\n }\n return $file;\n }",
"public function getFileName($file, $hash);",
"public function getFileLocationHash($file)\n {\n if (!$this->hasConnectionSettings()) {\n return md5($file);\n }\n return md5($file . $this->getConnectionSettings()->getHash());\n }",
"function get($hash);",
"public function getHashByString($string) {\n $dbHandle = $this->getDbHandle();\n $sql = 'SELECT hash, url FROM phpss WHERE url = :url';\n $sth = $dbHandle->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n $sth->execute(array(':url' => $string));\n $entry = $sth->fetch(PDO::FETCH_ASSOC);\n \n if (count($entry) > 0 && isset($entry['hash'])) { //hash already exists\n return $entry['hash'];\n }\n \n return null;\n }",
"function sha256_file($filename, $raw_output = NULL)\n{\n}",
"public function getHash()\n\t{\n\t\tif ($this->_hash === null) {\n\t\t\t$this->_hash = $this->computeHash();\n\t\t}\n\t\treturn $this->_hash;\n\t}",
"private static function getETag($filename)\n\t{\n\t\t$options = [FF_VERSION, $filename];\n\n\t\tif(file_exists($filename)) {\n\t\t\t$options[] = filemtime($filename);\n\t\t}\n\n\t\treturn hash(\n\t\t\t'crc32b',\n\t\t\timplode('-', $options)\n\t\t);\n\t}",
"private function getHash()\n {\n return $this->hash;\n }",
"public function getHash()\n\t{\n\t\treturn $this->hash;\n\t}",
"public function getFileContentsFor($file, $hash);",
"function getImageHash($asset_id) {\n\t\t\n\t}",
"public function getHash()\n {\n return $this->hash;\n }"
] | [
"0.6895804",
"0.6884575",
"0.6819954",
"0.6572995",
"0.65444255",
"0.65367705",
"0.6486601",
"0.6431332",
"0.6430784",
"0.63320345",
"0.63186145",
"0.6268703",
"0.6266641",
"0.61443686",
"0.60718924",
"0.60535425",
"0.5991582",
"0.59805864",
"0.5956013",
"0.592943",
"0.5893515",
"0.58554727",
"0.5824287",
"0.57352555",
"0.5728217",
"0.5677612",
"0.56694216",
"0.566753",
"0.5622694",
"0.5563246"
] | 0.81709385 | 0 |
Load lock file content. | protected function loadLock()
{
$lock = $this->loadFromFile($this->lockFile);
// Parse packages.
if (isset($lock['packages']) && is_array($lock['packages'])) {
foreach ($lock['packages'] as $package) {
$this->lockPackages[$package['name']] = $package['version'];
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function load() {\r\n\t\tif(file_exists(self::$cacheFile)) {\r\n\t\t\tself::$cache = unserialize(file_get_contents(self::$cacheFile));\r\n\t\t}\r\n\t}",
"private function load()\n {\n if (!$this->is_on()) {\n return;\n }\n\n $data = persistent_cache_get(array('SELF_LEARNING_CACHE', $this->bucket_name));\n if ($data !== null) {\n $this->data = $data;\n } elseif (is_file($this->path)) {\n $_data = cms_file_get_contents_safe($this->path);\n if ($_data !== false) {\n $this->data = @unserialize($_data);\n if ($this->data === false) {\n $this->invalidate(); // Corrupt\n }\n } else {\n $dir = get_custom_file_base() . '/caches/self_learning';\n if (!is_dir($dir)) {\n require_code('files2');\n make_missing_directory($dir);\n }\n\n $this->data = null;\n }\n }\n\n $this->empty = empty($this->data);\n\n if ($this->data !== null) {\n $this->keys_initial = array_flip(array_keys($this->data));\n }\n }",
"public static function get($path, $lock = false)\n {\n }",
"protected function load() {}",
"protected function updateLock(){\n if(!isset($this->aConfig['lock'])){\n return;\n }\n // $this->aConfig['lock'] has two keys: file, period\n extract($this->aConfig['lock']);\n if(file_exists($file)){\n $processId = file_get_contents($file);\n if($processId !== $this->aState['processId']){\n trigger_error(\"Lock is rewritten by another process '\" . $processId . \"', daemon is interrupted!\", E_USER_ERROR);\n }\n if(!touch($file)){\n trigger_error(\"Lock file '\" . $file . \"' cannot be touched!\", E_USER_ERROR);\n }\n }else{\n trigger_error(\"Lock file '\" . $file . \"' is missing, daemon is interrupted!\", E_USER_ERROR);\n }\n }",
"public function loadCache() {\n\t $this->cache = json_decode(gzdecode(file_get_contents($this->getDataFolder() . \"cache.data\")), true);\n }",
"function file_lock_and_get(string $path) {\n\t$ret = '';\n\n\tclearstatcache();\n\t$fp = fopen($path, 'r');\n\n\tif ($fp === FALSE) {\n\t\tthrow new IntException('Failed to open file for reading.');\n\t}\n\tif (flock($fp, LOCK_SH)) {\n\t\t$fs = filesize($path);\n\t\tif ($fs === 0) { return ''; }\n\n\t\t$ret = fread($fp, $fs);\n\t\tflock($fp, LOCK_UN);\n\t} else {\n\t\tfclose($fp);\n\t\tthrow new IntException('Failed to lock file.');\n\t}\n\tfclose($fp);\n\treturn $ret;\n}",
"private function load()\n {\n if (! isset($this->runtime_file_content)) {\n $this->runtime_file_content = json_decode(@file_get_contents($this->getFilePath()), true);\n }\n\n return $this->runtime_file_content;\n }",
"public function load() {}",
"static function load_content() {\n\t\tob_start();\n\n\t\t//vérifie si un paramètre de module est passé, sinon : défaut\n\t\t$module = isset ($_GET['module']) ? $_GET['module'] : 'default';\t\n\t\t\n\t\t//inclue le module en question\n\t\tif ($module != 'default' and file_exists(\"modules/$module/module.php\")) {\n\t\t\trequire(\"modules/$module/module.php\");\n\t\t}\n\t\telse {\n\t\t\trequire(\"modules/default/module.php\");\n\t\t}\n\t\t\n\t\t//récupère l'affichage\n\t\tself::$_content_ = ob_get_contents();\n\n\t\t//stoppe la bufferisation, efface le buffer\n\t\tob_end_clean();\n\t}",
"public function get(string $path, bool $lock): string\n {\n return file_get_contents($path);\n }",
"protected abstract function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public static function loadCache()\n {\n if (self::$cache_loaded) {\n return;\n }\n\n self::$cache_loaded = true;\n self::$cache = unserialize(File::get(Path::tidy(BASE_PATH . \"/_cache/_app/content/content.php\")));\n\n if (!is_array(self::$cache)) {\n // something has gone wrong, log a message and set to an empty array\n self::$cache = array();\n Log::fatal('Could not find or access your cache.', 'core', 'ContentService');\n }\n }",
"private function _loadFile() {\r\n $splitFile = explode('/', $this->_file);\r\n \r\n $splitExt = explode('.', $splitFile[(count($splitFile)-1)]);\r\n $fileExt = (count($splitExt) > 2) ? $splitExt[1].'.'.$splitExt[2] : $splitExt[1];\r\n $this->_mode = Definition::resolveFileType($fileExt);\r\n return file_get_contents(constant(strtoupper($this->_type).'_DIR').'/'.$this->_item.'/'.$this->_render['editor']['file']);\r\n }",
"public static function loadQueue(){\n $orders = array();\n $handle = fopen(self::$queueFile, \"rw\");\n if (flock($handle, LOCK_EX)) {\n while (($line = fgets($handle)) !== false) {\n array_push($orders, trim($line));\n }\n ftruncate($handle, 0); // truncate file\n fflush($handle); // flush output before releasing the lock\n fclose($handle);\n } else {\n die (\"Failed to get the lock for \". self::$queueFile.\"\\n\");\n }\n return $orders;\n }",
"abstract protected function _load();",
"public abstract function load();"
] | [
"0.6449345",
"0.6276341",
"0.6021653",
"0.5978754",
"0.5948117",
"0.59339434",
"0.58388627",
"0.58053577",
"0.5744619",
"0.5715266",
"0.5697225",
"0.5694288",
"0.5691343",
"0.5691343",
"0.5691343",
"0.5691343",
"0.5691343",
"0.5691343",
"0.5691343",
"0.5691343",
"0.5691343",
"0.5691343",
"0.5691343",
"0.5691343",
"0.5691343",
"0.5691313",
"0.56466335",
"0.561214",
"0.5599401",
"0.55628043"
] | 0.74426895 | 0 |
Check if given package name is a virtual platform package. | protected function isPlatformPackage($package)
{
return (bool) !strpos($package, '/');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function hasPackage() \n\t{ \n\t\treturn (bool)(self::Package() != null && strlen(self::Package()) > 0); \n\t}",
"protected function isSupportedPackage($package)\n {\n return preg_match('/deliciousbrains\\/wp-migrate-db-pro(-media-files|-cli|-multisite-tools)?/', $package);\n }",
"static public function checkIsValidPackageName($name)\n {\n return preg_match('/^[a-z0-9._-]+$/i', $name);\n }",
"private static function packageIsInstalled(string $package): bool\n {\n if (! class_exists(InstalledVersions::class)) {\n return true;\n }\n\n return InstalledVersions::isInstalled($package);\n }",
"public static function isPackage(string $name, string $version) : bool\n {\n // check $name and $version variables is valid.\n return self::isName($name) && self::isVersion($version);\n }",
"public function isVM()\n {\n # Check if VM checks are enabled \n if ($this->conf->vm_lan_like_host) \n {\n if (stristr($this->getVendor(),\"vmware\")) \n return true; # The original\n if (stristr($this->getVendor(),\"parallels\")) \n return true; # Mac VMWare-alike\n\t if (stristr($this->getVendor(),\"microsoft\")) \n return true; # VirtualPC\n }\n else\n {\n $this->logger->logit(\"vm_lan_like_host option is not enabled\");\n return false; \n }\n }",
"public static function exists(string $package): bool\n {\n self::checkCache();\n return isset(self::$extensionPoints[$package]);\n }",
"public function providesPackage($package) {\n return FALSE;\n }",
"private function isBookStackDir()\n {\n $dir = getcwd();\n $composer = $dir . '/composer.json';\n $versionFile = $dir . '/version';\n\n if (!file_exists($composer) || !file_exists($versionFile)) return false;\n\n $composerData = json_decode(file_get_contents($composer));\n if (!isset($composerData->name)) return false;\n if (strpos(strtolower(explode('/', $composerData->name)[1]), 'bookstack') === false) return false;\n\n return true;\n }",
"public function supports(PackageWrapper $package)\n {\n return file_exists(rtrim($package->getPath(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'package.json');\n }",
"public function is_packagesupport($package_id, $type) {\n $urloption = Engine_Api::_()->getItem('package', $package_id)->urloption;\n $check_module = strstr($urloption, $type);\n if (empty($check_module)) {\n return null;\n } else {\n return 1;\n }\n }",
"public function package_available($package_name)\n {\n $this->load->model('spark');\n\n $spark = Spark::getInfo($package_name);\n\n if($spark)\n {\n if($spark->contributor_id !== UserHelper::getId())\n {\n $this->form_validation->set_message('package_available', 'Sorry! That Spark name is taken');\n return FALSE;\n }\n\n if($spark->id != $this->input->post('spark_id'))\n {\n $this->form_validation->set_message('package_available', 'You already have a Spark with that name');\n return FALSE;\n }\n }\n\n return TRUE;\n }",
"function test($name) \n {\n switch (strtolower(trim($name))) {\n case \"all\":\n return 2 == $this->count(); \n \n case \"win\":\n case \"win32\":\n case \"windows\":\n case \"microsoft\":\n return isset($this->platforms[\"win\"]);\n \n case \"unix\":\n case \"posix\":\n case \"gnu\":\n return isset($this->platforms[\"unix\"]);\n \n default:\n return false;\n }\n }",
"protected function isDrupalExtension(string $package) {\n $package_type = $this->runCommand(sprintf(\"composer show %s | grep ^type | awk '{print $3}'\", $package))->getOutput();\n return $package_type != 'drupal-library' && str_starts_with($package_type, 'drupal');\n }",
"function check_comps($package_name, $product_number) {\n $pkglist_files = array(\n \"comps/Asianux/$product_number/pkglist-released-SRPMS\",\n \"comps/Asianux/$product_number/pkglist-unreleased-SRPMS\",\n \"comps/Asianux/$product_number/pkglist-SCL-SRPMS\",\n \"comps/Asianux/$product_number/pkglist-SCLmeta-SRPMS\"\n ); \n foreach ($pkglist_files as $pkglist_file) {\n $package_names = file($pkglist_file);\n foreach($package_names as $name) {\n $name = trim($name);\n if (strcasecmp($name, $package_name) === 0) {\n return TRUE;\n }\n } \n }\n return FALSE;\n}",
"public function validatePackage(array $packageData, string $tag): bool\n {\n // if it it does not contain a version, but is tagged in git, the version will be v6.3.0.0\n return ltrim($packageData['version'], 'v') === ltrim($tag, 'v')\n && ($packageData['dist']['type'] ?? null) !== 'path';\n }",
"function suits_system(string $os) : bool\n\t{\n\t\t// Get second extension from the filename.\n\t\t// For 'main.unix.c' this will return 'unix'.\n\t\t// For 'main.c' this will return ''.\n\t\t$ext = pathinfo(pathinfo($this->path, PATHINFO_FILENAME), PATHINFO_EXTENSION);\n\n\t\treturn !$ext || $ext == $os;\n\t}",
"public function getIsPackage()\n\t{\n\t\treturn $this->is_package;\n\t}",
"public function isSystem();",
"public function isInstalled();",
"public function isInstalled();",
"private function isPortalInstalled()\n {\n $packageList = json_decode(\\File::get(base_path('vendor/composer/installed.json')));\n\n $package = array_first($packageList, function ($key, $package) {\n\n return preg_match(\"/^elms\\/[a-z0-9]+-fe$/\", $package->name);\n\n });\n\n $this->portalPackage = $package;\n\n return !is_null($package);\n }",
"public function matchesPackage(array $array) {\n\t\tif (isset($array['package']) && $array['package'] == $this->package->getName()\n\t\t\t\t&& isset($array['url']) && $array['url'] == $this->getUrl()) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function hasPackage(PackageInterface $package)\n {\n\n }",
"function moments_qodef_visual_composer_installed() {\n\t\t//is Visual Composer installed?\n\t\tif ( class_exists( 'WPBakeryVisualComposerAbstract' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public static function isSystemVersion() {\n\t\t$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]);\n\t\treturn $configuration['version'] === 'SYSTEM';\n\t}",
"public function isChildLibrary($name)\n {\n // Ensure name is valid\n if (strstr($name, '/') === false) {\n return false;\n }\n\n // Upgrade-only is considered a child library\n if ($this->isChildUpgradeOnly($name)) {\n return true;\n }\n\n // Validate vs vendors. There must be at least one matching vendor.\n $cowData = $this->getCowData();\n if (empty($cowData['vendors'])) {\n return false;\n }\n $vendors = $cowData['vendors'];\n $vendor = strtok($name, '/');\n if (!in_array($vendor, $vendors)) {\n return false;\n }\n\n // validate exclusions\n if (empty($cowData['exclude'])) {\n return true;\n }\n return !in_array($name, $cowData['exclude']);\n }",
"function mkdf_tours_visual_composer_installed() {\n\t\t//is Visual Composer installed?\n\t\tif(class_exists('WPBakeryVisualComposerAbstract')) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"private function meets_requirements() {\n\n if ( ! class_exists( 'GamiPress' ) ) {\n return false;\n }\n\n return true;\n\n }",
"public function displayIsInstalled();"
] | [
"0.6531785",
"0.63808745",
"0.60936385",
"0.592707",
"0.58149856",
"0.57183504",
"0.5714426",
"0.56754255",
"0.5620374",
"0.56093526",
"0.5530234",
"0.55083466",
"0.5505513",
"0.5485002",
"0.5467621",
"0.54255253",
"0.54092366",
"0.5353111",
"0.532132",
"0.5311222",
"0.5311222",
"0.5307237",
"0.526167",
"0.52576894",
"0.52533203",
"0.5195491",
"0.5181982",
"0.5124215",
"0.5096985",
"0.50835407"
] | 0.6586807 | 0 |
Load JSON from file into an array. | protected function loadFromFile($file)
{
$json = $this->fileGetContents($file);
if ($json === false) {
$this->log("Cannot read $file");
return array();
}
$content = json_decode($json, true);
if (json_last_error() !== JSON_ERROR_NONE) {
$this->log("JSON decode error '" . json_last_error_msg() . "' for $file");
return array();
}
return $content;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getArrayFromJsonFile($file)\n\t{\n\t\t$array = array();\n\n\t\tif (file_exists($file)) {\n\t\t\t$array = json_decode(file_get_contents($file), true);\n\t\t}\t\t\n\n\t\treturn $array;\n\t}",
"private function readJson(): array\n {\n if (!$this->files->exists($dir = dirname($this->statusesFile))) {\n $this->files->makeDirectory($dir);\n }\n if (!$this->files->exists($this->statusesFile)) {\n return [];\n }\n\n return unserialize($this->files->get($this->statusesFile));\n }",
"private function readDataFile(): array {\n return json_decode(\n file_get_contents($this->filename), true\n );\n }",
"function loadFromFile(string $filepath): ?array\n{\n $content = file_get_contents($filepath);\n $data = json_decode($content, true);\n return $data;\n}",
"private static function readJsonFile(string $filename): array\n {\n $content = json_decode(file_get_contents($filename), true);\n if (json_last_error() !== 0) {\n throw new \\Exception(sprintf(self::ERROR_PARSING_MESSAGE, 'JSON', $filename, json_last_error_msg()));\n }\n \n return $content;\n }",
"protected function loadJson( $file ) {\n\t\tif ( file_exists( $file ) ) {\n\t\t\t$data\t= file_get_contents( $file );\n\t\t} else {\n\t\t\t$this->finish( false, 'Couldn\\'t find JSON file' );\n\t\t}\n\t\t\n\t\tif ( empty( $data ) ) {\n\t\t\t$this->finish( false, 'JSON file empty' );\n\t\t}\n\t\t\n\t\t$processed = json_decode( $data, true, 10 );\n\t\tif ( empty( $processed ) ) {\n\t\t\t$this->finish( false, 'Couldn\\'t process JSON file' );\n\t\t}\n\t\t\n\t\treturn $processed;\n\t}",
"public function load()\n {\n $result = json_decode($this->file, true);\n if(json_last_error() === 0){\n return $result;\n } else {\n echo \"JSON file has invalid format!\";\n return null;\n }\n }",
"function getArrayFile() {\n $json = getJsonFile();\n return $json;\n return $json->toArray();\n}",
"public function getJsonData():array\n {\n return json_decode(file_get_contents(__DIR__ . '/../data.json'), true);\n }",
"function get_array_from_json_file($save_filename) {\n global $CFG;\n\n $target_array = [];\n $target_string = file_get_contents($CFG->dirroot.'/enrol/ukfilmnet/assets/'.$save_filename);\n if($target_string) {\n $target_array[] = json_decode($target_string, true);\n }\n return $target_array;\n}",
"private function loadFile($file_path)\n {\n return json_decode(@file_get_contents($file_path), true);\n }",
"function LoadArray(){\n// Open the file in 'read' modus\n $file = fopen('database.json','r');\n\n// Read the JSON array from the file\n $aJSONArray = file_get_contents('database.json');\n\n// Convert to JSON array back to a PHP array\n $aReadArray = json_decode($aJSONArray,TRUE);\n\n // Close the file again\n fclose($file);\n//send the loaded data to main\n return($aReadArray);\n}",
"function read_json_file(string $jsonFile): ?array{\n $array = [];\n if(is_file($jsonFile) === true){\n $array = @file_get_contents($jsonFile);\n if($array === false)\n throw new UnableToOpenStreamException('Greska - Nije moguce procitati datoteku!');\n $array = json_decode($array, true);\n }\n return (array)$array;\n}",
"function loadJSON(){\n //Load json from data.json and decode to assoc array\n $json_data = file_get_contents('data.json');\n return json_decode($json_data, true);\n\n}",
"function readJson($file){\n $fileStr = file_get_contents($file);\n $jsonData = json_decode($fileStr,true);\n return $jsonData;\n }",
"function getJsonData(string $file): array\n{\n $data = json_decode(file_get_contents('../' . $file . '.json'), true);\n\n switch (json_last_error()) {\n case JSON_ERROR_NONE:\n echo ' - Aucune erreur';\n break;\n case JSON_ERROR_DEPTH:\n echo ' - Profondeur maximale atteinte';\n break;\n case JSON_ERROR_STATE_MISMATCH:\n echo ' - Inadéquation des modes ou underflow';\n break;\n case JSON_ERROR_CTRL_CHAR:\n echo ' - Erreur lors du contrôle des caractères';\n break;\n case JSON_ERROR_SYNTAX:\n echo ' - Erreur de syntaxe ; JSON malformé';\n break;\n case JSON_ERROR_UTF8:\n echo ' - Caractères UTF-8 malformés, probablement une erreur d\\'encodage';\n break;\n default:\n echo ' - Erreur inconnue';\n break;\n }\n\n return $data;\n}",
"function load($filename = null){\n if($filename != null && file_exists($filename)){\n $this->filename = $filename;\n return $this->data = json_decode(file_get_contents($filename));\n }\n }",
"protected function loadFile($path)\n {\n $composerJson = $this->fileData($path);\n\n return (null === $composerJson) ? null : (array) \\json_decode($composerJson, true);\n }",
"function getJsonData($jsonFilename)\n {\n if (! file_exists($jsonFilename))\n {\n return FALSE;\n }\n\n $json = file_get_contents($jsonFilename);\n $dataArr = json_decode($json, TRUE);\n\n // print_r ($dataArr); // debug\n\n return $dataArr;\n }",
"function get_json_data($json_file) {\n\t// and returns an array of the data.\n\n\t\tif (file_exists($json_file) && is_readable($json_file)) {\n\t\t\t\n\t\t\t$json_data = nl2br(file_get_contents($json_file));\n\t\t\t$this->data_values = json_decode($json_data,true);\n\t\t\t\n\t\t} else {\n\t\t\n\t\t\t$this->data_values = array();\n\t\t}\n\t\t\n\t\tforeach ($this->data_names as $data_name) {\n\t\t\t$this->return_values[] = $this->ensure_json_value($data_name);\n\t\t}\n\t\t\t\n\t\treturn $this->return_values;\n\t}",
"public function generateDataArray () {\n $entries = [];\n $handle = fopen($this->jsonFile, 'r');\n\n if ($handle) {\n while (($line = fgets($handle)) !== false) {\n $thisEntry = [];\n\n $json = json_decode($line, true);\n\n if ($json) {\n $thisEntry = $this->generateEntryFromJson($json);\n\n $entries[] = $thisEntry;\n }\n }\n\n fclose($handle);\n }\n\n return $entries;\n }",
"function json_get( $file )\n{\n\treturn json_decode(file_get_contents($file), true , 12);\n}",
"protected function getRawContent(string $file): array\n {\n return json_decode(file_get_contents($file) ?: '{}', true);\n }",
"public function getAssociativeArrayFromJson(string $filePath)\n {\n if (file_exists($filePath) && is_file($filePath)) {\n $fileContent = file_get_contents($filePath);\n\n // Remove empty lines from file content string\n $fileContent = preg_replace('~[\\r\\n]+~', \"\\r\\n\", trim($fileContent));\n\n // Try to decode JSON string\n $associativeArray = json_decode($fileContent, true);\n\n if ($associativeArray !== NULL) {\n return $associativeArray;\n }\n }\n\n // Return false if file doesn't exist\n return false;\n }",
"private function load()\n\t{\n\t\t$this->_container = json_decode(file_get_contents($this->_file), true);\n\t}",
"protected static function loadJSONFileIntoArray($jsonFilepath,&$outputArray)\r\n {\r\n // TC001 => Dico file must exists!\r\n //print_r($jsonFilepath);\r\n \r\n if(!FSManager::checkFileExistance($jsonFilepath))\r\n {\r\n echo \"coucou\";\r\n $lArrExceptionParam = array(\r\n 'in' => $jsonFilepath\r\n );\r\n throw new DicoException('CORE-DICO_LOAD-SOURCE_FILE_NOT_FOUNDED',$lArrExceptionParam);\r\n }\r\n\r\n // JSON Format check!\r\n $jsonfileContent = file_get_contents($jsonFilepath); \r\n $lArrDicoEntries = json_decode($jsonfileContent,true);\r\n\r\n // TC002 => Dico content must be well formed and fully loadable!\r\n if(is_null($lArrDicoEntries))\r\n {\r\n $lArrExceptionParam = array(\r\n 'in' => $jsonFilepath,\r\n 'details' => json_last_error()\r\n );\r\n throw new DicoException('CORE-DICO_LOAD-SOURCE_FILE_JSON_ERROR',$lArrExceptionParam);\r\n }\r\n \r\n // Merging new values into outpuArray!\r\n $outputArray = array_merge($outputArray,$lArrDicoEntries);\r\n }",
"private static function JSON_getAll()\n {\n $file = file_get_contents(\"json/users.json\");\n $file = explode(PHP_EOL,$file);\n array_pop($file);\n $users=[];\n foreach ($file as $user) {\n $users[]=json_decode($user,true);\n }\n return $users;\n }",
"public function fromFile(string $filename):array;",
"function getDataFromJsonFile($nameFile) {\n return json_decode(file_get_contents($nameFile));\n }",
"public function read(): array\n {\n if (strlen($this->sSource) > 0) {\n $aReturn = json_decode($this->sSource, true, 512, \\JSON_THROW_ON_ERROR);\n } else {\n $aReturn = [];\n }\n\n return is_array($aReturn) ? $aReturn : [];\n }"
] | [
"0.7699255",
"0.73606485",
"0.7297087",
"0.7140519",
"0.7122439",
"0.69780743",
"0.68164504",
"0.6763151",
"0.6729944",
"0.6687593",
"0.6675504",
"0.66627103",
"0.6624394",
"0.6604086",
"0.65678024",
"0.65672547",
"0.65342367",
"0.6520364",
"0.65107757",
"0.6505168",
"0.64893806",
"0.6424759",
"0.63319486",
"0.6331626",
"0.6324939",
"0.62383467",
"0.6236475",
"0.6197958",
"0.61923504",
"0.61782527"
] | 0.7445864 | 1 |
Determine whether we need to merge composer.json. | protected function skipMerge()
{
// In case for one reason composer.json or composer.lock have
// dissappeared, we skip the merge as there is no reference
// to start from..
if ($this->areFilesMissing(array($this->jsonFile, $this->lockFile))) {
return true;
}
// Determine if any changes have been made to composer settings
if ($this->isStockComposer()) {
$this->log("Skipping merge, stock composer settings detected");
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function writeMergedComposerJson() {\n\t\t$composerJson = $this->getMergedComposerJson();\n\t\t$composerJson = json_encode($composerJson);\n\t\tif ($composerJson) {\n\t\t\t$this->makeSureTempPathExists();\n\t\t\treturn file_put_contents($this->getTempPath() . 'composer.json', $composerJson);\n\t\t}\n\t\treturn FALSE;\n\t}",
"protected function isStockComposer()\n {\n // Load lock file into memory.\n $this->loadLock();\n\n $actualHash = $this->getActualHash($this->jsonFile);\n if (!$actualHash) {\n $this->log(\"Cannot calculate hash of {$this->jsonFile}\");\n return false;\n }\n\n // Fetch checksum of the stock composer.json\n $stockHash = $this->getStockHash(self::COMPOSER_JSON);\n if (!$stockHash) {\n $this->log(\"Cannot find stock hash of \" . self::COMPOSER_JSON);\n return false;\n }\n\n if ($actualHash !== $stockHash) {\n $this->log(\"Actual hash of \" . self::COMPOSER_JSON\n . \" ($actualHash) does not match stock hash ($stockHash)\");\n return false;\n }\n\n return true;\n }",
"public static function usesComposer()\n {\n $currentTYPO3Version = VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);\n $composer = false;\n\n if ($currentTYPO3Version >= VersionNumberUtility::convertVersionNumberToInteger('7.0.0')) {\n $composer = Bootstrap::usesComposerClassLoading();\n }\n\n return $composer;\n }",
"public function canUseComposer()\n\t{\n\t\tinclude 'composer.php';\n\t\t$composer = new Composer;\n\n\t\tif (!$composer->hasPhp532()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$composer->hasCurl()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($composer->hasApc()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($composer->hasSuhosin()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$composer->hasAllowUrlFopen()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($this->filePermissions) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function getMergedComposerAutoload() {\n\t\treturn $this->getMergedComposerData('autoload');\n\t}",
"public function packagesExists(): bool\n {\n return file_exists($this->rootPath . '/package.json') ? true : false;\n }",
"public function getMergedComposerJson($development = FALSE) {\n\t\tif (!$this->mergedComposerJson) {\n\t\t\t$composerJson = file_get_contents($this->getPathToResource() . 'Private/Templates/composer.json');\n\t\t\tif (!$composerJson) {\n\t\t\t\tthrow new \\UnexpectedValueException('Could not load the composer.json template file', 1355952845);\n\t\t\t}\n\t\t\t$composerJson = str_replace('%EXT_PATH%', $this->getExtensionPath(), $composerJson);\n\t\t\t$composerJson = str_replace('%RESOURCE_PATH%', $this->getPathToResource(), $composerJson);\n\t\t\t$composerJson = str_replace('%MINIMUM_STABILITY%', $this->minimumStability, $composerJson);\n\n\t\t\t$composerJson = json_decode($composerJson, TRUE);\n\n\t\t\t$this->pd($composerJson);\n\t\t\t$composerJson['require'] = $this->getMergedComposerRequirements();\n\t\t\t$composerJson['autoload'] = $this->getMergedComposerAutoload();\n\t\t\t$composerJson['repositories'] = $this->getMergedComposerData('repositories');\n\n\t\t\tif ($development || $this->developmentDependencies) {\n\t\t\t\t$composerJson['require-dev'] = $this->getMergedComposerDevelopmentRequirements();\n\t\t\t}\n\t\t\tif (!isset($composerJson['require-dev']) || !$composerJson['require-dev']) {\n\t\t\t\tunset($composerJson['require-dev']);\n\t\t\t}\n\n\t\t\t$this->pd($composerJson);\n\t\t\t$this->mergedComposerJson = $composerJson;\n\t\t}\n\n\t\treturn $this->mergedComposerJson;\n\t}",
"public function getMergedComposerRequirements() {\n\t\treturn $this->getMergedComposerData('require');\n\t}",
"private function tryReadComposerJson(&$decodedJsonObject) : bool\n {\n $path = $this->getComposerPath() . DIRECTORY_SEPARATOR . 'composer.json';\n\n // phpcs:disable\n if (!file_exists($path)) {\n return false;\n }\n\n $contents = file_get_contents($path);\n\n // phpcs:enable\n $decodedJsonObject = json_decode($contents, true);\n\n return true;\n }",
"public function isValid()\n {\n return $this->directory && realpath($this->directory . '/composer.json');\n }",
"private function tryGetVersionNumberFromComposerJson(&$version) : bool\n {\n $composer = null;\n\n if (!$this->tryReadComposerJson($composer)) {\n return false;\n }\n\n if (isset($composer['version'])) {\n $version = $composer['version'];\n\n if ($version !== null && !empty($version)) {\n return true;\n }\n }\n\n return false;\n }",
"protected function checkComposerConfig()\n {\n if (!$this->checkComposerConfig) {\n return;\n }\n\n /** @noinspection PhpUnhandledExceptionInspection */\n // @phpstan-ignore-next-line\n if (version_compare(Codecept::VERSION, '4.0.0', '>=')) {\n checkComposerDependencies(composerFile(resolvePath('composer.json', $this->workDir)), [\n 'codeception/module-asserts' => '^1.0',\n 'codeception/module-phpbrowser' => '^1.0',\n 'codeception/module-webdriver' => '^1.0',\n 'codeception/module-db' => '^1.0',\n 'codeception/module-filesystem' => '^1.0',\n 'codeception/module-cli' => '^1.0',\n 'codeception/util-universalframework' => '^1.0'\n ], static function ($lines) {\n throw new \\RuntimeException(\n \"wp-browser requires the following packages to work with Codeception v4.0:\\n\\n\" .\n implode(\",\\n\", $lines) .\n \"\\n\\n1. Add these lines to the 'composer.json' file 'require-dev' section.\" .\n \"\\n2. Run 'composer update'.\" .\n \"\\n3. Run the 'codecept init wpbrowser' command again.\"\n );\n });\n }\n }",
"public function getMergedComposerDevelopmentRequirements() {\n\t\treturn $this->getMergedComposerData('require-dev');\n\t}",
"public function testComposerJsonExists() {\n $this->assertFileExists($this->getProjectDirectory() . '/composer.json');\n }",
"protected function getIsMerge($request) {\n\t\t$merge = $request->getVar('merge');\n\n\t\t// Default to false if not given\n\t\tif(!isset($merge)) {\n\t\t\tDeprecation::notice(\n\t\t\t\t\"4.0\",\n\t\t\t\t\"merge will be enabled by default in 4.0. Please use merge=false if you do not want to merge.\"\n\t\t\t);\n\t\t\treturn false;\n\t\t}\n\n\t\t// merge=0 or merge=false will disable merge\n\t\treturn !in_array($merge, array('0', 'false'));\n\t}",
"public function needsUpdate()\n {\n return $this->getOldVersion() !== config('app.version');\n }",
"protected function updateComposerJson()\n {\n $composerJson = getenv('COMPOSER') ?: 'composer.json';\n\n $path = base_path($composerJson);\n\n //\n $config = json_decode(file_get_contents($path), true);\n\n if (is_array($config) && isset($config['autoload'])) {\n $namespace = $this->data['namespace'] .'\\\\';\n\n $config['autoload']['psr-4'][$namespace] = 'plugins/' . $this->data['name'] . \"/src/\";\n\n $output = json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . \"\\n\";\n\n file_put_contents($path, $output);\n }\n }",
"public function isMerged() : bool\n {\n\n return $this->merged;\n }",
"public function requiresGroupFile()\n {\n return !empty($this->hooks);\n }",
"protected function requireRepoToken()\n {\n return $this->serviceName === 'travis-pro'\n && $this->repoToken !== null;\n }",
"protected function _getAutocompleteJsonExists()\n {\n $autocompleteJsonExists = true;\n\n if (!file_exists($this->directoryList->getRoot().'/app/etc/autocomplete.json')) {\n $autocompleteJsonExists = false;\n }\n\n return $autocompleteJsonExists;\n }",
"private function configureComposer(): void\n {\n try {\n $io = $this->getIO();\n $composerJson = new JsonFile($this->getProjectRoot() . '/composer.json');\n if (!$composerJson->exists()) {\n $io->write('<comment>composer.json is not found, skipping its configuration, you need to create it later</comment>');\n\n return;\n }\n try {\n /** @var array $config */\n $config = $composerJson->read();\n } catch (RuntimeException $e) {\n $io->write('<error>composer.json is not valid, skipping its configuration, you need to create it later</error>');\n\n return;\n }\n $config['name'] = '';\n $config['description'] = '';\n $config['authors'] = [];\n unset(\n $config['version'],\n $config['type'],\n $config['keywords'],\n $config['homepage'],\n $config['time'],\n $config['license'],\n $config['support'],\n $config['require-dev']\n );\n if ($io->isInteractive()) {\n $io->write('<info>composer.json will be modified now to match your project settings</info>');\n // Get package name\n $git = $this->getGitConfig();\n $name = basename($this->getProjectRoot());\n /** @noinspection RegExpUnnecessaryNonCapturingGroup */\n $name = strtolower(preg_replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\\\1\\\\3-\\\\2\\\\4', $name));\n if (array_key_exists('github.user', $git)) {\n $name = $git['github.user'] . '/' . $name;\n } elseif (!empty($_SERVER['USERNAME'])) {\n $name = $_SERVER['USERNAME'] . '/' . $name;\n } elseif (get_current_user()) {\n $name = get_current_user() . '/' . $name;\n } else {\n // package names must be in the format foo/bar\n $name .= '/' . $name;\n }\n $name = strtolower($name);\n $name = $io->askAndValidate(\n 'Package name (<vendor>/<name>) [<comment>' . $name . '</comment>]: ',\n static function ($value) use ($name) {\n if (null === $value) {\n return $name;\n }\n\n if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}', $value)) {\n throw new InvalidArgumentException(\n 'The package name ' . $value . ' is invalid, it should be lowercase and have a vendor name, a forward slash, and a package name, matching: [a-z0-9_.-]+/[a-z0-9_.-]+'\n );\n }\n\n return $value;\n },\n null,\n $name\n );\n $config['name'] = $name;\n $this->variables['package-name'] = [\n 'type' => 'string',\n 'value' => $name,\n ];\n\n // Get package description\n $description = '';\n $description = $io->ask('Description [<comment>' . $description . '</comment>]: ', $description);\n $config['description'] = $description;\n $this->variables['package-description'] = [\n 'type' => 'string',\n 'value' => $description,\n ];\n\n // Get package author\n $author = '';\n $parseAuthor = static function ($author) {\n /** @noinspection RegExpRedundantEscape */\n if (preg_match('/^(?P<name>[- \\.,\\p{L}\\p{N}\\'’]+) <(?P<email>.+?)>$/u', $author, $match) && filter_var($match['email'],\n FILTER_VALIDATE_EMAIL) !== false) {\n return [\n 'name' => trim($match['name']),\n 'email' => $match['email'],\n ];\n }\n\n return null;\n };\n $formatAuthor = static function ($name, $email) {\n return sprintf('%s <%s>', $name, $email);\n };\n if (array_key_exists('user.name', $git) && array_key_exists('user.email', $git)) {\n $author = $formatAuthor($git['user.name'], $git['user.email']);\n if (!$parseAuthor($author)) {\n $author = '';\n }\n }\n $author = $io->askAndValidate('Author [<comment>' . $author . '</comment>, n to skip]: ',\n static function ($value) use ($parseAuthor, $formatAuthor, $author) {\n if ($value === 'n' || $value === 'no') {\n return null;\n }\n $value = $value ?: $author;\n $author = $parseAuthor($value);\n if (!is_array($author)) {\n throw new InvalidArgumentException(\n 'Invalid author string. Must be in the format: ' .\n 'John Smith <[email protected]>'\n );\n }\n\n return $formatAuthor($author['name'], $author['email']);\n }, null, $author);\n if ($author) {\n $config['authors'][] = $parseAuthor($author);\n }\n } else {\n $io->write('<comment>composer.json is cleaned up, but not configured because installation is running in non-interactive mode. You need to configure it by yourself</comment>');\n }\n\n // Setup WPackagist repository\n if (!array_key_exists('repositories', $config)) {\n $config['repositories'] = [];\n }\n $wpackagist = [\n 'type' => 'composer',\n 'url' => 'https://wpackagist.org',\n ];\n foreach ($config['repositories'] as $repository) {\n if (array_key_exists('url', $repository) &&\n array_key_exists('type', $repository) &&\n $repository['type'] === $wpackagist['type'] &&\n $repository['url'] === $wpackagist['url']\n ) {\n $wpackagist = null;\n break;\n }\n }\n if ($wpackagist !== null) {\n $config['repositories'][] = $wpackagist;\n }\n\n // Setup WordPress directories and WordPress installers paths\n if (!array_key_exists('extra', $config)) {\n $config['extra'] = [];\n }\n $extra = $this->getComposer()->getPackage()->getExtra();\n $gitIgnore = [\n '# WordPress itself and related files and directories',\n ];\n $gitIgnore[] = '/' . self::$configurationFiles['local']['file'];\n $directories = [];\n foreach (self::$wordpressDirectories as $type => $directory) {\n $key = $directory['key'];\n $dir = $directory['path'];\n if (array_key_exists($key, $extra)) {\n $dir = $extra[$key];\n }\n $directories[$type] = $dir;\n $config['extra'][$key] = $dir;\n $this->variables[$key] = [\n 'type' => 'string',\n 'value' => $dir,\n ];\n if ($type !== 'content') {\n $gitIgnore[] = '/' . $dir;\n }\n }\n // Ignore vendor and bin directories that are controlled by Composer\n $composerCfg = $this->getComposer()->getConfig();\n $vendorDir = $composerCfg->get('vendor-dir', Config::RELATIVE_PATHS);\n $gitIgnore[] = '/' . $vendorDir;\n $binDir = $composerCfg->get('bin-dir', Config::RELATIVE_PATHS);\n if ($binDir !== 'vendor/bin') {\n if (!array_key_exists('config', $config)) {\n $config['config'] = [];\n }\n $config['config']['bin-dir'] = $binDir;\n }\n if (!in_array($binDir, ['', '.'], true) && !str_starts_with($binDir, $vendorDir . '/')) {\n $gitIgnore[] = '/' . $binDir;\n }\n $gitIgnore[] = '';\n $gitIgnore[] = '# Directories for WordPress plugins and themes controlled by Composer';\n $config['extra']['installer-paths'] = [];\n foreach (self::$installerPaths as $type => $dir) {\n $path = sprintf('%s/%s/{$name}', $directories['content'], $dir);\n $config['extra']['installer-paths'][$path] = [$type];\n $gitIgnore[] = sprintf('/%s/%s', $directories['content'], $dir);\n }\n $root = $this->getProjectRoot();\n foreach (self::$wordpressModules as $type => $info) {\n $gitIgnore[] = '/' . ltrim(str_replace($root, '', $this->getWordpressModulesDirectory($type, 'project')), '/');\n }\n\n $composerJson->write($config);\n $io->write('<info>composer.json is successfully updated</info>');\n $this->configuredComponents['composer'] = $config;\n\n // Create .gitignore\n file_put_contents($this->getProjectRoot() . '/.gitignore', implode(\"\\n\", $gitIgnore));\n $this->configuredComponents['gitignore'] = $gitIgnore;\n } catch (Throwable $e) {\n $this->getIO()->writeError('composer.json configuration failed due to exception: ' . $e->getMessage());\n }\n }",
"private function isOwnProject(): bool\n {\n return $this->getComposer()->getPackage()->getPrettyName() === 'flying/wordpress-composer';\n }",
"public function mayUpdateLibraries()\n {\n // TODO: Proper implementation\n return true;\n }",
"protected function useGitCache()\n {\n $git = $this->getGitBinary();\n $gitVersion = $this->console->run(\"$git version\");\n $regs = [];\n\n if (preg_match('/((\\d+\\.?)+)/', $gitVersion, $regs)) {\n $version = $regs[1];\n } else {\n $version = \"1.0.0\";\n }\n\n return version_compare($version, '2.3', '>=');\n }",
"public function needsUpdate()\n {\n return !$this->hasScript(ScriptEvents::POST_UPDATE_CMD, ScriptHandler::class . '::updateProject');\n }",
"private function versionFromComposer()\n {\n $composerFile = $this->readJsonFile('composer.json');\n\n /*\n * Look for platform override\n *\n * \"config\": {\n * \"platform\": {\n * \"php\": \"5.6.0\"\n * }\n * }\n */\n if (isset($composerFile['config']['platform']['php'])) {\n return $composerFile['config']['platform']['php'];\n }\n\n return null;\n }",
"private function isBookStackDir()\n {\n $dir = getcwd();\n $composer = $dir . '/composer.json';\n $versionFile = $dir . '/version';\n\n if (!file_exists($composer) || !file_exists($versionFile)) return false;\n\n $composerData = json_decode(file_get_contents($composer));\n if (!isset($composerData->name)) return false;\n if (strpos(strtolower(explode('/', $composerData->name)[1]), 'bookstack') === false) return false;\n\n return true;\n }",
"private function tryFindVersionInComposerLock($decodedJsonObject)\n {\n if (!isset($decodedJsonObject['packages'])) {\n return false;\n }\n\n $packages = $decodedJsonObject['packages'];\n foreach ($packages as $package) {\n if (!isset($package['version']) ||\n !isset($package['name']) ||\n $package['name'] !== 'swedbank-pay/swedbank-pay-sdk-php'\n ) {\n continue;\n }\n\n return $package['version'];\n }\n\n return false;\n }",
"protected function requireGithubActions()\n {\n return $this->serviceName === 'github' && $this->serviceJobId !== null && $this->repoToken !== null;\n }"
] | [
"0.66317505",
"0.61778486",
"0.5972543",
"0.590372",
"0.5757549",
"0.57360315",
"0.5701302",
"0.56925416",
"0.5659614",
"0.5609323",
"0.55977225",
"0.5535115",
"0.5514682",
"0.5505475",
"0.54920894",
"0.5483165",
"0.5475786",
"0.54707974",
"0.54259557",
"0.5419802",
"0.54071796",
"0.54039824",
"0.5398579",
"0.53803843",
"0.5374987",
"0.53744566",
"0.5358164",
"0.53228563",
"0.5294116",
"0.5274181"
] | 0.72806096 | 0 |
This will reallocate the bookings when order status changed from failed to processing,completed and onhold. | public static function bkap_reallocate_booking_when_order_status_failed_to_processing( $args = array() ) {
global $woocommerce;
$order = wc_get_order( $args );
$details = array();
foreach ( $order->get_items() as $order_item_id => $item ) {
$booking = array();
$product_bookable = "";
$parent_id = ( version_compare( WOOCOMMERCE_VERSION, "3.0.0" ) < 0 ) ? $_product->get_parent() : bkap_common::bkap_get_parent_id( $item[ 'product_id' ] );
$post_id = bkap_common::bkap_get_product_id( $item['product_id'] );
$quantity = $item['qty'];
$product_bookable = bkap_common::bkap_get_bookable_status( $post_id );
if( $product_bookable ){
$booking = array( 'date' => $item['_wapbk_booking_date'],
'hidden_date' => date("d-m-Y", strtotime($item['_wapbk_booking_date'] ) ),
'date_checkout' => $item['wapbk_checkout_date'],
'hidden_date_checkout' => date("d-m-Y", strtotime($item['_wapbk_checkout_date'] ) ),
'price' => $item['cost'],
'time_slot' => $item['_wapbk_time_slot']
);
$details = bkap_checkout::bkap_update_lockout( $order_id, $post_id, $parent_id, $quantity, $booking );
// update the global time slot lockout
if( isset( $booking['time_slot'] ) && $booking['time_slot'] != "" ) {
bkap_checkout::bkap_update_global_lockout( $post_id, $quantity, $details, $booking);
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function clearBookings()\n {\n $this->collBookings = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function resetOrders();",
"private function reservePendingOrders()\n { \n // 1\n $pending_order_products = \\App\\Models\\OrderProduct::with('order')->pending()->get()\n ->sortByDesc(function($pending_order_product){\n return $pending_order_product->order->created;\n });\n\n $order_reservations = collect([]);\n\n foreach ($pending_order_products as $pending_order_product) {\n $order_reservations->push(Order::reserveProduct($pending_order_product));\n }\n\n return $order_reservations;\n }",
"public function clear_booking(){\n\t\t$this->loadModel('BookingOrder');\n\t\t$this->loadModel('Booking');\n\t\t$end_time=date('Y-m-d H:i:s',strtotime(Configure::read('Booking.clearEndTime')));\n\t\t\n\t\t$start_time=date('Y-m-d H:i:s',strtotime(Configure::read('Booking.clearStartTime')));\n\t\t$this->BookingOrder->updateAll(\n\t\t\tarray('BookingOrder.status' => 0),\n\t\t\tarray('BookingOrder.status' => 4,'BookingOrder.time_stamp BETWEEN ? AND ?'=>array($start_time,$end_time))\n\t\t);\n\t\t$this->Booking->updateAll(\n\t\t\tarray('Booking.status' => 0),\n\t\t\tarray('Booking.status' => 4,'Booking.time_stamp BETWEEN ? AND ?'=>array($start_time,$end_time))\n\t\t);\n\t\t \n\t\treturn;\n\t}",
"public function deleteOldBookingsFromDb(): void\n {\n /** @var Config $configAdapter */\n $configAdapter = $this->framework->getAdapter(Config::class);\n\n /** @var Date $dateAdapter */\n $dateAdapter = $this->framework->getAdapter(Date::class);\n\n /** @var Database $databaseAdapter */\n $databaseAdapter = $this->framework->getAdapter(Database::class);\n\n /** @var System $systemAdapter */\n $systemAdapter = $this->framework->getAdapter(System::class);\n\n if (($intWeeks = (int) $configAdapter->get('rbb_intBackWeeks')) < 0) {\n $intWeeks = abs($intWeeks);\n $dateMonThisWeek = $dateAdapter->parse('d-m-Y', strtotime('monday this week'));\n\n if (false !== ($tstampLimit = strtotime($dateMonThisWeek.' -'.$intWeeks.' weeks'))) {\n $objStmt = $databaseAdapter->getInstance()->prepare('DELETE FROM tl_resource_booking WHERE endTime<?')->execute($tstampLimit);\n\n if (($intRows = $objStmt->affectedRows) > 0) {\n $systemAdapter->log(sprintf('CRON: tl_resource_booking has been cleaned from %s old entries.', $intRows), __METHOD__, TL_CRON);\n }\n }\n }\n }",
"function updateBedcounts() {\n // get last succcessful bedcount job id\n $allocJobRec = LilHotelierDBO::getLastCompletedBedCountJob($this->selectionDate);\n if( $allocJobRec == null ) {\n $this->bedcountData = array();\n $this->lastCompletedAllocScraperJob = null;\n }\n else {\n $this->bedcountData = LilHotelierDBO::getBedcountReport($this->selectionDate, $allocJobRec->job_id);\n $this->lastCompletedAllocScraperJob = $allocJobRec->end_date;\n }\n $this->isRefreshJobInProgress = LilHotelierDBO::isExistsIncompleteJobOfType( self::JOB_TYPE );\n $this->lastJob = LilHotelierDBO::getDetailsOfLastJob( self::JOB_TYPE );\n }",
"function em_bookings_get_pending_spaces($count, $EM_Bookings, $force_refresh = false){\n\t\tglobal $wpdb;\n\t\tif( !array_key_exists($EM_Bookings->event_id, $this->event_pending_spaces) || $force_refresh ){\n\t\t\t$sql = 'SELECT SUM(booking_spaces) FROM '.EM_BOOKINGS_TABLE. ' WHERE booking_status=%d AND event_id=%d AND booking_meta LIKE %s';\n\t\t\t$gateway_filter = '%s:7:\"gateway\";s:'.strlen($this->gateway).':\"'.$this->gateway.'\";%';\n\t\t\t$pending_spaces = $wpdb->get_var( $wpdb->prepare($sql, array($this->status, $EM_Bookings->event_id, $gateway_filter)) );\n\t\t\t$this->event_pending_spaces[$EM_Bookings->event_id] = $pending_spaces > 0 ? $pending_spaces : 0;\n\t\t}\n\t\treturn $count + $this->event_pending_spaces[$EM_Bookings->event_id];\n\t}",
"function updateOrderBook()\n{\n if (is_a($this->phases_info,'msg_info')) \t\t//check Sec Phase\n {\n\t $cp = $this->phases_info->get_currphase();\n\t $mf = $this->phases_info->phases[$cp];\n\n//\tprint \"updateOrderBook=\".$this->data_io->ordersScript.\"\\n\";\n\t//if ($mf[_PHASE_OPEN_COMMENT]==_CONTINUOUS_OPEN)\n\t//\t{\n\t$rows=$this->secInfo->lastOrders; \n \tif (!$rows) {\n\t \tprint (\"updateOrderBook - \".'no order rows'.'\\n');\n\t \treturn 0;\n\t \t}\n $orders = count($rows);\n \n foreach($rows as $row)\n \t\t{\n\t\t $this->data_io->packOrder($this->tableIT, $row, &$orders);\t\n\t\t \t \n\t\t $ret = $this->data_io->setOrderBook ($row->ORDER_ID,$row->OASIS_TIME,$row->ORDER_NUMBER,$row->SIDE,$row->PRICE,$row->VOLUME,$row->DISCLOSED_VOLUME,$row->ORDER_STATUS);\n\t\t if ( ($ret & _OBOOK_RET_ERROR)==_OBOOK_RET_ERROR )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t print \"setOrderBook error:\".$ret.\"==\".$row->OASIS_TIME.\" - \".$row->ORDER_NUMBER.\" - \".$row->ORDER_ID.\"\\r\\n\";\n\t\t\t\t\t\t\t\t die(\"Cannot continue... bye bye! \\n\");\n\t\t\t\t\t\t\t\t }\n\t\t\t \t\t\t\t if (($ret & _OBOOK_RET_NO_ORDER)==_OBOOK_RET_NO_ORDER )\t \n\t\t\t\t \t\t\t\t{\n\t\t\t\t \t\t\t\t print \"setOrderBook Cancel Order: \".$ret.\"==\".$row->OASIS_TIME.\" - \".$row->ORDER_NUMBER.\" - \".$row->ORDER_ID.\"\\r\\n\";\n\t\t\t\t\t\t\t\t return -1;\n\t\t\t\t\t\t\t\t }\n\t\t }\n return $ret;\t\t \n/*\t\t \n\t $dat=$this->json_decode2($this->data_io->ordersScript, true);\n\t foreach($dat as $rows=>$row)\n\t\t\tforeach($row as $sub=>$data)\n\t\t\t\tforeach($data as $col=>$val)\n\t\t\t\t\t\tif ($col=='data')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t $oasisTime=$this->strTimeToOasis_time($val[0]);\n\n\t\t\t\t\t\t\t $ret = $this->data_io->setOrderBook ($oasisTime,$val[3],$val[2],$val[5],$val[4],$val[7]);\n\t\t\t\t\t\t\t if ( ($ret & _OBOOK_RET_ERROR)==_OBOOK_RET_ERROR )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t print \"setOrderBook error:\".$ret.\"==\".$val[0].\" - \".$val[3].\"\\r\\n\";\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t }\n\t\t\t \t\t\t\t if (($ret & _OBOOK_RET_NO_ORDER)==_OBOOK_RET_NO_ORDER )\t \n\t\t\t\t \t\t\t\t{\n\t\t\t\t \t\t\t\t print \"setOrderBook Cancel Order: \".$ret.\"==\".$val[0].\" - \".$val[3].\"\\r\\n\";\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t return $ret;\n\t\t\t\t\t\t\t }\n\t\t//}\t*/\t\t\t\t\t \n\t }\n}",
"public function unsetAvailableForBooking(): void\n {\n $this->availableForBooking = [];\n }",
"function em_bookings_get_pending_spaces($count, $EM_Bookings) {\n\t\tforeach ($EM_Bookings->bookings as $EM_Booking) {\n\t\t\tif ($EM_Booking->booking_status == $this->status && $this->uses_gateway($EM_Booking)) {\n\t\t\t\t$count += $EM_Booking->get_spaces();\n\t\t\t}\n\t\t}\n\t\treturn $count;\n\t}",
"public function cronBookingStatus(){\n //get pending bookings whose date has been passed\n $bookings = Booking::select('bookings.*','bd.start_time','bd.end_time')\n ->join('bookings_details as bd','bookings.id','=','bd.booking_id')\n ->where('status','pending')\n ->where(DB::raw(\"date(start_time)\"),'<=',date(\"Y-m-d\"))->groupBy('bookings.id')->get();\n foreach ($bookings as $key => $booking){\n $booking->status = 'cancel';\n $booking->save();\n $user = User::find($booking->user_id);\n $user->credit = $user->credit + $booking->amount;\n $user->save();\n \n $userEmail = $user>email;\n //send booking mail to user and bcc to admin\n Mail::to($userEmail)->send(new BookingStatusMail($booking));\n }\n }",
"public function populate_bookings() {\n $this->all_events = $this->get_bookings_json();\n\n $wp_bookings = $this->all_events;\n\n\n }",
"public function reset()\r\n {\r\n if (self::hasItems()) {\r\n self::resetItems();\r\n }\r\n self::changeStatus(self::STATUS_PENDING);\r\n self::resetDateTimes();\r\n }",
"public function resetOrder(){\r\n $this->items = array();\r\n $this->item_quantities = array();\r\n $this->payments = array();\r\n $total_paid = 0;\r\n $order_total = 0;\r\n $this->setSalesTax(CONFIG[\"sales_tax\"]);\r\n }",
"protected function _checkFreeOrder()\n {\n }",
"public function processBooking()\n {\n try {\n Agent::upateBookings();\n } catch (Exception $e) {\n echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n }\n\n }",
"public function updateWaitingList($per_id){\n $waiting = $this->db->select(\"SELECT book_id,user_id,COALESCE(SUM(booking_list.book_list_qty)) AS qty FROM booking LEFT JOIN booking_list ON booking.book_code=booking_list.book_code WHERE per_id={$per_id} AND status=5 ORDER BY booking.create_date ASC\");\n if( !empty($waiting) ){\n /* จำนวนทีนั่งทั้งหมด */\n $seats = $this->db->select(\"SELECT per_qty_seats FROM period WHERE per_id={$per_id} LIMIT 1\");\n\n /* จำนวนคนจองทั้งหมด (ตัด Waiting กับ ยกเลิกแล้ว) */\n $book = $this->db->select(\"SELECT COALESCE(SUM(booking_list.book_list_qty),0) as qty FROM booking_list\n LEFT JOIN booking ON booking_list.book_code=booking.book_code\n WHERE booking.per_id={$per_id} AND booking.status!=5 AND booking.status!=40\");\n $BalanceSeats = $seats[0][\"per_qty_seats\"] - $book[0][\"qty\"];\n if( $BalanceSeats > 0 ){\n foreach ($waiting as $key => $value) {\n if( !empty($BalanceSeats) ){\n if( $value[\"qty\"] <= $BalanceSeats ){\n /* SET STATUS BOOKING */\n $this->db->update(\"booking\", array(\"status\"=>\"00\"), \"book_id={$value[\"book_id\"]}\");\n $BalanceSeats -= $value[\"qty\"];\n }\n }\n else{\n if( $BalanceSeats > 0 ){\n /* SET STATUS BOOKING */\n $this->db->update(\"booking\", array(\"status\"=>\"00\"), \"book_id={$value[\"book_id\"]}\");\n\n /* SET ALERT FOR SALE */\n $alert = array(\n \"user_id\"=>$value[\"user_id\"],\n \"book_id\"=>$value[\"book_id\"],\n \"detail\"=>\"ที่นั่งไม่เพียงพอ\",\n \"source\"=>\"150booking\",\n \"log_date\"=>date(\"c\")\n );\n $this->db->insert(\"alert_msg\", $alert);\n\n /* EXIT LOOP */\n $BalanceSeats = 0;\n break;\n }\n }\n }\n }\n }\n }",
"public function processPendingBalances()\n {\n $sales = SaleModel::applyPendingBalances()\n ->orderBy('checked_at', 'asc')\n ->limit(10)\n ;\n\n $sales = $sales->get();\n\n /*\n * If already checked in the last 5 mins, don't check again\n */\n $checkThreshold = Carbon::now()->subMinutes(5);\n\n $sales = $sales->filter(function($sale) use ($checkThreshold) {\n $tooSoon = $sale->checked_at > $checkThreshold;\n return !$tooSoon;\n });\n\n /*\n * Check for something to do\n */\n $countAbandoned = 0;\n if (!$countChecked = $sales->count()) {\n return;\n }\n\n /*\n * Immediately mark as checked to prevent multiple threads\n */\n SaleModel::whereIn('id', $sales->lists('id'))\n ->update(['checked_at' => Carbon::now()])\n ;\n\n foreach ($sales as $sale) {\n if ($sale->isAbandoned()) {\n $sale->markAbandoned();\n $countAbandoned++;\n }\n else {\n try {\n $sale->checkBalance();\n }\n catch (Exception $ex) {\n traceLog('Check balance failed for sale #'.$sale->id);\n traceLog($ex);\n }\n }\n }\n\n $this->logActivity(sprintf(\n 'Checked %s sales, abandoned %s sales.',\n $countChecked,\n $countAbandoned\n ));\n }",
"public function adjustAllocationsToMatchQtyRemaining()\n {\n $toAdjust = $this->getQtyUnallocated();\n foreach ( $this->allocations as $alloc ) {\n if ( $toAdjust >= 0 ) {\n return;\n }\n $toAdjust -= $alloc->adjustQuantity($toAdjust);\n }\n assertion($toAdjust >= 0, \"alloc qty left to adjust: $toAdjust\");\n }",
"function bkap_bookings_activate() {\n\t\t\t\t\n\t\t\t if ( ! self::bkap_check_woo_installed() ) {\n\t\t\t return;\n\t\t\t }\n\t\t\t \n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\t$table_name = $wpdb->prefix . \"booking_history\";\n\t\t\t\t\n\t\t\t\t$sql = \"CREATE TABLE IF NOT EXISTS $table_name (\n \t\t\t\t\t\t`id` int(11) NOT NULL AUTO_INCREMENT,\n \t\t\t\t\t\t`post_id` int(11) NOT NULL,\n \t\t\t\t\t\t`weekday` varchar(50) NOT NULL,\n \t\t\t\t\t\t`start_date` date NOT NULL,\n \t\t\t\t\t\t`end_date` date NOT NULL,\n \t\t\t\t\t\t`from_time` varchar(50) NOT NULL,\n \t\t\t\t\t\t`to_time` varchar(50) NOT NULL,\n \t\t\t\t\t\t`total_booking` int(11) NOT NULL,\n \t\t\t\t\t\t`available_booking` int(11) NOT NULL,\n \t\t\t\t\t\t`status` varchar(20) NOT NULL,\n \t\t\t\t\t\tPRIMARY KEY (`id`)\n \t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1\" ;\n\t\t\t\t\n\t\t\t\t$order_table_name = $wpdb->prefix . \"booking_order_history\";\n\t\t\t\t$order_sql = \"CREATE TABLE IF NOT EXISTS $order_table_name (\n \t\t\t\t\t\t\t`id` int(11) NOT NULL AUTO_INCREMENT,\n \t\t\t\t\t\t\t`order_id` int(11) NOT NULL,\n \t\t\t\t\t\t\t`booking_id` int(11) NOT NULL,\n \t\t\t\t\t\t\tPRIMARY KEY (`id`)\n \t\t\t\t)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1\" ;\n\n\t\t\t\t$table_name_price = $wpdb->prefix . \"booking_block_price_meta\";\n\n\t\t\t\t$sql_price = \"CREATE TABLE IF NOT EXISTS \".$table_name_price.\" (\n \t\t\t\t`id` int(11) NOT NULL AUTO_INCREMENT,\n \t\t\t\t`post_id` int(11) NOT NULL,\n `minimum_number_of_days` int(11) NOT NULL,\n \t\t\t\t`maximum_number_of_days` int(11) NOT NULL,\n `price_per_day` double NOT NULL,\n \t\t\t\t`fixed_price` double NOT NULL,\n \t\t\t\t PRIMARY KEY (`id`)\n \t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 \" ;\n\t\t\t\t\n\t\t\t\t$table_name_meta = $wpdb->prefix . \"booking_block_price_attribute_meta\";\n\t\t\t\t\n\t\t\t\t$sql_meta = \"CREATE TABLE IF NOT EXISTS \".$table_name_meta.\" (\n \t\t\t\t\t`id` int(11) NOT NULL AUTO_INCREMENT,\n \t\t\t\t\t`post_id` int(11) NOT NULL,\n \t\t\t\t\t`block_id` int(11) NOT NULL,\n \t\t\t\t\t`attribute_id` varchar(50) NOT NULL,\n \t\t\t\t\t`meta_value` varchar(500) NOT NULL,\n \t\t\t\t\t PRIMARY KEY (`id`)\n \t\t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 \" ;\n\n\t\t\t\t$block_table_name = $wpdb->prefix . \"booking_fixed_blocks\";\n\t\t\t\t\n\t\t\t\t$blocks_sql = \"CREATE TABLE IF NOT EXISTS \".$block_table_name.\" (\n \t\t\t\t`id` int(11) NOT NULL AUTO_INCREMENT,\n \t\t\t\t`global_id` int(11) NOT NULL,\n \t\t\t\t`post_id` int(11) NOT NULL,\n \t\t\t\t`block_name` varchar(50) NOT NULL,\n \t\t\t\t`number_of_days` int(11) NOT NULL,\n \t\t\t\t`start_day` varchar(50) NOT NULL,\n \t\t\t\t`end_day` varchar(50) NOT NULL,\n \t\t\t\t`price` double NOT NULL,\n \t\t\t\t`block_type` varchar(25) NOT NULL,\n \t\t\t\tPRIMARY KEY (`id`)\n \t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 \" ;\n\t\t\t\t\n\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\t\t\n\t\t\t\tdbDelta( $sql );\n\t\t\t\tdbDelta( $order_sql );\n\t\t\t\tdbDelta( $sql_price );\n\t\t\t\tdbDelta( $sql_meta );\n\t\t\t\tdbDelta( $blocks_sql );\n\t\t\t\tupdate_option( 'woocommerce_booking_alter_queries', 'yes' );\n\t\t\t\tupdate_option( 'woocommerce_booking_db_version', '4.7.0' );\n\t\t\t\tupdate_option( 'woocommerce_booking_abp_hrs', 'HOURS' );\n\t\t\t\t$check_table_query = \"SHOW COLUMNS FROM $table_name LIKE 'end_date'\";\n\t\t\t\t\n\t\t\t\t$results = $wpdb->get_results ( $check_table_query );\n\t\t\t\t\n\t\t\t\tif ( count( $results ) == 0 ) {\n\t\t\t\t\t$alter_table_query = \"ALTER TABLE $table_name\n\t\t\t\t\t\t\t\t\t\t\t ADD `end_date` date AFTER `start_date`\";\n\t\t\t\t\t$wpdb->get_results ( $alter_table_query );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$alter_block_table_query = \"ALTER TABLE `$block_table_name` CHANGE `price` `price` DECIMAL(10,2) NOT NULL;\";\n\t\t\t\t$wpdb->get_results ( $alter_block_table_query );\n\t\t\t\t\n\n\t\t\t\tif( ( get_option( 'book_date-label' ) == false || get_option( 'book_date-label' ) == \"\" ) ) {\n\t\t\t\t\tadd_option( 'bkap_add_to_cart',\t\t\t'Book Now!' );\n\t\t\t\t\tadd_option( 'bkap_check_availability',\t'Check Availability' );\n\t\t\t\t}\n\n\t\t\t\t//Set default labels\n\t\t\t\tadd_option( 'book_date-label', 'Start Date' );\n\t\t\t\tadd_option( 'checkout_date-label', '<br>End Date' );\n\t\t\t\tadd_option( 'bkap_calendar_icon_file', 'calendar1.gif' );\n\t\t\t\tadd_option( 'book_time-label', 'Booking Time' );\n\t\t\t\tadd_option( 'book_time-select-option', 'Choose a Time' );\n\t\t\t\tadd_option( 'book_fixed-block-label', 'Select Period' );\n\t\t\t\tadd_option( 'book_price-label', 'Total:' );\n\t\t\t\t\n\t\t\t\tadd_option( 'book_item-meta-date', 'Start Date' );\n\t\t\t\tadd_option( 'checkout_item-meta-date', 'End Date' );\n\t\t\t\tadd_option( 'book_item-meta-time', 'Booking Time' );\n\t\t\t\tadd_option( 'book_ics-file-name', 'Mycal' );\n\t\t\t\t\n\t\t\t\tadd_option( 'book_item-cart-date', 'Start Date' );\n\t\t\t\tadd_option( 'checkout_item-cart-date', 'End Date' );\n\t\t\t\tadd_option( 'book_item-cart-time', 'Booking Time' );\n\t\t\t\t\n\t\t\t\t// add this option to ensure the labels above are retained in the future updates\n\t\t\t\tadd_option( 'bkap_update_booking_labels_settings', 'yes' );\n\t\t\t\t\n\t\t\t\t// add the new messages in the options table\n\t\t\t\tadd_option( 'book_stock-total', 'AVAILABLE_SPOTS stock total' );\n\t\t\t\tadd_option( 'book_available-stock-date', 'AVAILABLE_SPOTS bookings are available on DATE' );\n\t\t\t\tadd_option( 'book_available-stock-time', 'AVAILABLE_SPOTS bookings are available for TIME on DATE' );\n\t\t\t\tadd_option( 'book_available-stock-date-attr', 'AVAILABLE_SPOTS ATTRIBUTE_NAME bookings are available on DATE' );\n\t\t\t\tadd_option( 'book_available-stock-time-attr', 'AVAILABLE_SPOTS ATTRIBUTE_NAME bookings are available for TIME on DATE' );\n\t\t\t\t\t\n\t\t\t\tadd_option( 'book_limited-booking-msg-date', 'PRODUCT_NAME has only AVAILABLE_SPOTS tickets available for the date DATE.' );\n\t\t\t\tadd_option( 'book_no-booking-msg-date', 'For PRODUCT_NAME, the date DATE has been fully booked. Please try another date.' );\n\t\t\t\tadd_option( 'book_limited-booking-msg-time', 'PRODUCT_NAME has only AVAILABLE_SPOTS tickets available for TIME on DATE.' );\n\t\t\t\tadd_option( 'book_no-booking-msg-time', 'For PRODUCT_NAME, the time TIME on DATE has been fully booked. Please try another timeslot.' );\n\t\t\t\tadd_option( 'book_limited-booking-msg-date-attr', 'PRODUCT_NAME has only AVAILABLE_SPOTS ATTRIBUTE_NAME tickets available for the date DATE.' );\n\t\t\t\tadd_option( 'book_limited-booking-msg-time-attr', 'PRODUCT_NAME has only AVAILABLE_SPOTS ATTRIBUTE_NAME tickets available for TIME on DATE.' );\n\t\t\t\t\n\t\t\t\tadd_option( 'book_real-time-error-msg', 'That date just got booked. Please reload the page.' );\n\t\t\t\t\n\t\t\t\t//Set default global booking settings\n\t\t\t\t$booking_settings = new stdClass();\n\t\t\t\t$booking_settings->booking_language = 'en-GB';\n\t\t\t\t$booking_settings->booking_date_format = 'mm/dd/y';\n\t\t\t\t$booking_settings->booking_time_format = '12';\n\t\t\t\t$booking_settings->booking_months = $booking_settings->booking_calendar_day = '1';\n\t\t\t\t$booking_settings->global_booking_minimum_number_days = '0';\n\t\t\t\t$booking_settings->booking_availability_display = $booking_settings->minimum_day_booking = $booking_settings->booking_global_selection = $booking_settings->booking_global_timeslot = '';\n\t\t\t\t$booking_settings->booking_export = $booking_settings->enable_rounding = $booking_settings->woo_product_addon_price = $booking_settings->booking_global_holidays = '';\n\t\t\t\t$booking_settings->resource_price_per_day \t\t\t\t= '';\n\t\t\t\t$booking_settings->booking_themes = 'smoothness';\n\t\t\t\t$booking_settings->hide_variation_price = 'on';\n\t\t\t\t$booking_settings->display_disabled_buttons = 'on';\n\t\t\t\t$booking_settings->hide_booking_price = '';\n\t\t\t\t\n\t\t\t\t$booking_global_settings = json_encode( $booking_settings );\n\t\t\t\tadd_option( 'woocommerce_booking_global_settings', $booking_global_settings );\n\t\t\t\t\n\t\t\t\t// add GCal event summary & description\n\t\t\t\tadd_option( 'bkap_calendar_event_summary', 'SITE_NAME, ORDER_NUMBER' );\n\t\t\t\tadd_option( 'bkap_calendar_event_description', 'PRODUCT_WITH_QTY, Name: CLIENT, Contact: EMAIL, PHONE' );\n\t\t\t\t// add GCal event city\n\t\t\t\tadd_option( 'bkap_calendar_event_location', 'CITY' );\n\t\t\t}",
"public function backfill( $args, $assoc_args ) {\n\t\tglobal $wpdb;\n\n\t\t$orders_batch = isset( $assoc_args['batch'] ) ? absint( $assoc_args['batch'] ) : 1000;\n\t\t$orders_page = isset( $assoc_args['page'] ) ? absint( $assoc_args['page'] ) : 1;\n\t\t$order_table = wc_custom_order_table()->get_table_name();\n\t\t$order_count = $wpdb->get_var( \"SELECT COUNT(1) FROM {$order_table} o\" );\n\t\t$total_pages = ceil( $order_count / $orders_batch );\n\t\t$progress = \\WP_CLI\\Utils\\make_progress_bar( 'Order Data Migration', $order_count );\n\t\t$batches_processed = 0;\n\n\t\tWP_CLI::log( sprintf( __( '%d orders to be backfilled.', 'wc-custom-order-table' ), $order_count ) );\n\n\t\tfor ( $page = $orders_page; $page <= $total_pages; $page++ ) {\n\t\t\t$offset = ( $page * $orders_batch ) - $orders_batch;\n\t\t\t$orders = $wpdb->get_col( $wpdb->prepare(\n\t\t\t\t\"SELECT order_id FROM {$order_table} o LIMIT %d OFFSET %d\",\n\t\t\t\t$orders_batch,\n\t\t\t\tmax( $offset, 0 )\n\t\t\t) );\n\n\t\t\tforeach ( $orders as $order ) {\n\t\t\t\t// Accessing the order via wc_get_order will automatically migrate the order to the custom table.\n\t\t\t\t$order = wc_get_order( $order );\n\t\t\t\t$order->get_data_store()->backfill_postmeta( $order );\n\n\t\t\t\t$progress->tick();\n\t\t\t}\n\n\t\t\t$batches_processed++;\n\t\t}\n\n\t\t$progress->finish();\n\n\t\tWP_CLI::log( sprintf(\n\t\t\t/* Translators: %1$d is the number of total orders, %2$d is the number of batches. */\n\t\t\t__( '%1$d orders processed in %2$d batches.', 'wc-custom-order-table' ),\n\t\t\t$order_count,\n\t\t\t$batches_processed\n\t\t) );\n\t}",
"public function storeNeedsRebuilding();",
"public function resetPartialBookings($v = true)\n {\n $this->collBookingsPartial = $v;\n }",
"protected function resetStatus()\n\t\t{\n\t\t\t$this->status =\n\t\t\t[\n\t\t\t\t'state' => interfaces\\Process::READY,\n\t\t\t\t'process' => [],\n\t\t\t\t'times' =>\n\t\t\t\t[\n\t\t\t\t\t'start' => null,\n\t\t\t\t\t'stop' => null\n\t\t\t\t]\n\t\t\t];\n\t\t}",
"function bkap_bookings_update_db_check() {\n\t\t\t \n\t\t\t global $booking_plugin_version, $BookUpdateChecker;\n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\t$booking_plugin_version = get_option( 'woocommerce_booking_db_version' );\n\t\t\t\tif ( $booking_plugin_version != $this->get_booking_version() ) {\n\t\t\t\t \n\t\t\t\t // Introducing the ability enable/disable the charging of GF options on a per day basis above 2.4.4\n\t\t\t\t // Set it to 'ON' by default\n\t\t\t\t if ( $booking_plugin_version <= '2.4.4' ) {\n\t\t\t\t \n\t\t\t\t $global_settings = json_decode( get_option( 'woocommerce_booking_global_settings' ) );\n\t\t\t\t if ( isset( $global_settings ) && ! isset( $global_settings->woo_gf_product_addon_option_price ) ) {\n\t\t\t\t $global_settings->woo_gf_product_addon_option_price = 'on';\n\t\t\t\t update_option( 'woocommerce_booking_global_settings', json_encode( $global_settings ) );\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t\t$table_name = $wpdb->prefix . \"booking_history\";\n\t\t\t\t\t$check_table_query = \"SHOW COLUMNS FROM $table_name LIKE 'status'\";\n\t\t\t\t\t\n\t\t\t\t\t$results = $wpdb->get_results ( $check_table_query );\n\t\t\t\t\t\n\t\t\t\t\tif ( count( $results ) == 0 ) {\n\t\t\t\t\t\t$alter_table_query = \"ALTER TABLE $table_name\n\t\t\t\t\t\t ADD `status` varchar(20) NOT NULL AFTER `available_booking`\";\n\t\t\t\t\t\t$wpdb->get_results ( $alter_table_query );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tupdate_option( 'woocommerce_booking_db_version', '4.7.0' );\n\t\t\t\t\t// Add an option to change the \"Choose a Time\" text in the time slot dropdown\n\t\t\t\t\tadd_option( 'book_time-select-option', 'Choose a Time' );\n\t\t\t\t\t// Add an option to change ICS file name\n\t\t\t\t\tadd_option( 'book_ics-file-name', 'Mycal' );\n\t\t\t\t\t// add an option to set the label for fixed block drop down\n\t\t\t\t\tadd_option( 'book_fixed-block-label', 'Select Period' );\n\t\t\t\t\t\n\t\t\t\t\t// add an option to add a label for the front end price display\n\t\t\t\t\tadd_option( 'book_price-label', '' );\n\t\t\t\t\t// add setting to set WooCommerce Price to be displayed\n\t\t\t\t\tif ( $booking_plugin_version <= '2.6.2' ) {\n\t\t\t\t\t\n\t\t\t\t\t $global_settings = json_decode( get_option( 'woocommerce_booking_global_settings' ) );\n\t\t\t\t\t if ( ! isset( $global_settings->hide_variation_price ) ) {\n\t\t\t\t $global_settings->hide_variation_price = '';\n\t\t\t\t\t update_option( 'woocommerce_booking_global_settings', json_encode( $global_settings ) );\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// add setting to set WooCommerce Price to be displayed\n\t\t\t\t\tif ( $booking_plugin_version <= '2.9' ) {\n\t\t\t\t\t\n\t\t\t\t\t $global_settings = json_decode( get_option( 'woocommerce_booking_global_settings' ) );\n\t\t\t\t\t if ( ! isset( $global_settings->display_disabled_buttons ) ) {\n\t\t\t\t\t $global_settings->display_disabled_buttons = '';\n\t\t\t\t\t update_option( 'woocommerce_booking_global_settings', json_encode( $global_settings ) );\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t\t// add setting to set WooCommerce Price to be displayed\n\t\t\t\t\tif ( $booking_plugin_version <= '3.1' ) {\n\t\t\t\t\t \t\n\t\t\t\t\t $global_settings = json_decode( get_option( 'woocommerce_booking_global_settings' ) );\n\t\t\t\t\t if ( ! isset( $global_settings->hide_booking_price ) ) {\n\t\t\t\t\t $global_settings->hide_booking_price = '';\n\t\t\t\t\t update_option( 'woocommerce_booking_global_settings', json_encode( $global_settings ) );\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t // update the booking history table\n\t\t\t\t\t // 1. delete all inactive base records for recurring weekdays (with & without time slots)\n\t\t\t\t\t $delete_base_query = \"DELETE FROM `\" . $wpdb->prefix . \"booking_history`\n\t\t\t\t\t WHERE status = 'inactive'\n\t\t\t\t\t AND weekday <> ''\n\t\t\t\t\t AND start_date = '0000-00-00'\";\n\t\t\t\t\t $wpdb->query( $delete_base_query );\n\t\t\t\t\t \t\n\t\t\t\t\t // 2. delete all inactive specific date records (with & without time slots)\n\t\t\t\t\t \t\n\t\t\t\t\t // get a past date 3 months from today\n\t\t\t\t\t $date = date( 'Y-m-d', strtotime( '-3 months' ) );\n\t\t\t\t\t // fetch all inactive specific date records starting from 3 months past today\t\n\t\t\t\t\t $select_specific = \"SELECT id, post_id, start_date, from_time, to_time FROM `\" . $wpdb->prefix . \"booking_history`\n\t\t\t\t\t WHERE status = 'inactive'\n\t\t\t\t\t AND weekday = ''\n\t\t\t\t\t AND start_date <> '0000-00-00'\n\t\t\t\t\t AND end_date = '0000-00-00'\n\t\t\t\t\t AND start_date >= %d\";\n\t\t\t\t\t \t\n\t\t\t\t\t $result_specific = $wpdb->get_results( $wpdb->prepare( $select_specific, $date ) );\n\t\t\t\t\t \t\n\t\t\t\t\t foreach ( $result_specific as $key => $value ) {\n\t\t\t\t\t $select_active_specific = \"SELECT id FROM `\" . $wpdb->prefix .\"booking_history`\n\t\t\t\t\t WHERE status <> 'inactive'\n\t\t\t\t\t AND post_id = %d\n\t\t\t\t\t AND start_date = %s\n\t\t\t\t\t AND end_date = '0000-00-00'\n\t\t\t\t\t AND from_time = %s\n\t\t\t\t\t AND to_time = %s\";\n\t\t\t\t\t $results_active = $wpdb->get_results( $wpdb->prepare( $select_active_specific, $value->post_id, $value->start_date, $value->from_time, $value->to_time ) );\n\t\t\t\t\t \n\t\t\t\t\t if ( isset( $results_active ) && 1 == count( $results_active ) ) {\n\t\t\t\t\t \n\t\t\t\t\t // delete the inactive record if a corresponding active record is found\n\t\t\t\t\t $delete_inactive_specific = \"DELETE FROM `\" . $wpdb->prefix . \"booking_history`\n\t\t\t\t\t WHERE ID = '\" . $value->id . \"'\";\n\t\t\t\t\t $wpdb->query( $delete_inactive_specific );\n\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t // delete all inactive specific date records older than 3 months from today\t\n\t\t\t\t\t $delete_specific = \"DELETE FROM `\" . $wpdb->prefix . \"booking_history`\n\t\t\t\t\t WHERE status = 'inactive'\n\t\t\t\t\t AND weekday = ''\n\t\t\t\t\t AND start_date <> '0000-00-00'\n\t\t\t\t\t AND start_date < '\" . $date . \"'\n\t\t\t\t AND end_date = '0000-00-00'\";\n\t\t\t\t\t $wpdb->query( $delete_specific );\n\t\t\t\t\t \t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Get the option setting to check if adbp has been updated to hrs for existing users\n\t\t\t\t\t$booking_abp_hrs = get_option( 'woocommerce_booking_abp_hrs' );\n\t\t\t\t\t\t\n\t\t\t\t\tif ( $booking_abp_hrs != 'HOURS' ) {\n\t\t\t\t\t\t// For all the existing bookable products, modify the ABP to hours instead of days\n\t\t\t\t\t\t$args = array( 'post_type' => 'product', 'posts_per_page' => -1 );\n\t\t\t\t\t\t$product = query_posts( $args );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$product_ids = array();\n\t\t\t\t\t\tforeach( $product as $k => $v ){\n\t\t\t\t\t\t\t$product_ids[] = $v->ID;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( is_array( $product_ids ) && count( $product_ids ) > 0 ) {\n \t\t\t\t\t\tforeach( $product_ids as $k => $v ){\n \t\t\t\t\t\t\t$booking_settings = get_post_meta( $v, 'woocommerce_booking_settings' , true );\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\tif ( isset( $booking_settings ) && isset( $booking_settings['booking_enable_date'] ) && $booking_settings['booking_enable_date'] == 'on' ) {\n \t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t if ( isset( $booking_settings['booking_minimum_number_days'] ) && $booking_settings['booking_minimum_number_days'] > 0 ) {\n \t\t\t\t\t\t\t\t\t$advance_period_hrs = $booking_settings['booking_minimum_number_days'] * 24;\n \t\t\t\t\t\t\t\t\t$booking_settings['booking_minimum_number_days'] = $advance_period_hrs;\n \t\t\t\t\t\t\t\t\tupdate_post_meta( $v, 'woocommerce_booking_settings', $booking_settings );\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t\tupdate_option( 'woocommerce_booking_abp_hrs', 'HOURS' );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Get the option setting to check if tables are set to utf8 charset\n\t\t\t\t\t$alter_queries = get_option( 'woocommerce_booking_alter_queries' );\n\t\t\t\t\t\t\n\t\t\t\t\tif ( $alter_queries != 'yes' ) {\n\t\t\t\t\t\t// For all the existing bookable products, modify the ABP to hours instead of days\n\t\t\t\t\t\t$table_name = $wpdb->prefix . \"booking_history\";\n\t\t\t\t\t\t$sql_alter = \"ALTER TABLE $table_name CONVERT TO CHARACTER SET utf8\" ;\n\t\t\t\t\t\t$wpdb->get_results ( $sql_alter );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$order_table_name = $wpdb->prefix . \"booking_order_history\";\n\t\t\t\t\t\t$order_alter_sql = \"ALTER TABLE $order_table_name CONVERT TO CHARACTER SET utf8\" ;\n\t\t\t\t\t\t$wpdb->get_results ( $order_alter_sql );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$table_name_price = $wpdb->prefix . \"booking_block_price_meta\";\n\t\t\t\t\t\t$sql_alter_price = \"ALTER TABLE $table_name_price CONVERT TO CHARACTER SET utf8\" ;\n\t\t\t\t\t\t$wpdb->get_results ( $sql_alter_price );\n\t\t\t\t\n\t\t\t\t\t\t$table_name_meta = $wpdb->prefix . \"booking_block_price_attribute_meta\";\n\t\t\t\t\t\t$sql_alter_meta = \"ALTER TABLE $table_name_meta CONVERT TO CHARACTER SET utf8\" ;\n\t\t\t\t\t\t$wpdb->get_results ( $sql_alter_meta );\n\n\t\t\t\t\t\t$block_table_name = $wpdb->prefix . \"booking_fixed_blocks\";\n\t\t\t\t\t\t$blocks_alter_sql = \"ALTER TABLE $block_table_name CONVERT TO CHARACTER SET utf8\" ;\n\t\t\t\t\t\t$wpdb->get_results ( $blocks_alter_sql );\n\t\t\t\t\t\t\n\t\t\t\t\t\tupdate_option( 'woocommerce_booking_alter_queries', 'yes' );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif( get_option( 'bkap_update_booking_labels_settings' ) != 'yes' && $booking_plugin_version < '2.8' ) {\n\t\t\t\t\t $booking_date_label = get_option( 'book.date-label' );\n\t\t\t\t\t update_option( 'book_date-label', $booking_date_label );\n\t\t\t\t\t\n\t\t\t\t\t $booking_checkout_label = get_option( 'checkout.date-label' );\n\t\t\t\t\t update_option( 'checkout_date-label', $booking_checkout_label );\n\t\t\t\t\t\n\t\t\t\t\t $bkap_calendar_icon_label = get_option( 'bkap_calendar_icon_file' );\n\t\t\t\t\t update_option( 'bkap_calendar_icon_file', $bkap_calendar_icon_label );\n\t\t\t\t\t \t\t\t\t\t\n\t\t\t\t\t $booking_time_label = get_option( 'book.time-label' );\n\t\t\t\t\t update_option( 'book_time-label', $booking_time_label );\n\t\t\t\t\t\n\t\t\t\t\t $booking_time_select_option = get_option( 'book.time-select-option' );\n\t\t\t\t\t update_option( 'book_time-select-option', $booking_time_select_option );\n\t\t\t\t\t\n\t\t\t\t\t $booking_fixed_block_label = get_option( 'book.fixed-block-label' );\n\t\t\t\t\t update_option( 'book_fixed-block-label', $booking_fixed_block_label );\n\t\t\t\t\t\n\t\t\t\t\t $booking_price = get_option( 'book.price-label' );\n\t\t\t\t\t update_option( 'book_price-label', $booking_price );\n\t\t\t\t\t\n\t\t\t\t\t $booking_item_meta_date = get_option( 'book.item-meta-date' );\n\t\t\t\t\t update_option( 'book_item-meta-date', $booking_item_meta_date );\n\t\t\t\t\t\n\t\t\t\t\t $booking_item_meta_checkout_date = get_option( 'checkout.item-meta-date' );\n\t\t\t\t\t update_option( 'checkout_item-meta-date', $booking_item_meta_checkout_date );\n\t\t\t\t\t \n\t\t\t\t\t $booking_item_meta_time = get_option( 'book.item-meta-time' );\n\t\t\t\t\t update_option( 'book_item-meta-time', $booking_item_meta_time );\n\t\t\t\t\t \n\t\t\t\t\t $booking_ics_file = get_option( 'book.ics-file-name' );\n\t\t\t\t\t update_option( 'book_ics-file-name', $booking_ics_file );\n\t\t\t\t\t \n\t\t\t\t\t $booking_cart_date = get_option( 'book.item-cart-date' );\n\t\t\t\t\t update_option( 'book_item-cart-date', $booking_cart_date );\n\t\t\t\t\t \n\t\t\t\t\t $booking_cart_checkout_date = get_option( 'checkout.item-cart-date' );\n\t\t\t\t\t update_option( 'checkout_item-cart-date', $booking_cart_checkout_date );\n\t\t\t\t\t \n\t\t\t\t\t $booking_cart_time = get_option( 'book.item-cart-time' );\n\t\t\t\t\t update_option( 'book_item-cart-time', $booking_cart_time );\n\t\t\t\t\t\n\t\t\t\t\t // delete the labels from wp_options\n\t\t\t\t\t delete_option( 'book.date-label' );\n\t\t\t\t\t delete_option( 'checkout.date-label' );\n\t\t\t\t\t delete_option( 'book.time-label' );\n\t\t\t\t\t delete_option( 'book.time-select-option' );\n\t\t\t\t\t delete_option( 'book.fixed-block-label' );\n\t\t\t\t\t delete_option( 'book.price-label' );\n\t\t\t\t\t delete_option( 'book.item-meta-date' );\n\t\t\t\t\t delete_option( 'checkout.item-meta-date' );\n\t\t\t\t\t delete_option( 'book.item-meta-time' );\n\t\t\t\t\t delete_option( 'book.ics-file-name' );\n\t\t\t\t\t delete_option( 'book.item-cart-date' );\n\t\t\t\t\t delete_option( 'checkout.item-cart-date' );\n\t\t\t\t\t delete_option( 'book.item-cart-time' );\n\t\t\t\t\t \n\t\t\t\t\t update_option( 'bkap_update_booking_labels_settings', 'yes' );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// add the new messages in the options table\n\t\t\t\t\tadd_option( 'book_stock-total', 'AVAILABLE_SPOTS stock total' );\n\t\t\t\t\tadd_option( 'book_available-stock-date', 'AVAILABLE_SPOTS bookings are available on DATE' );\n\t\t\t\t\tadd_option( 'book_available-stock-time', 'AVAILABLE_SPOTS bookings are available for TIME on DATE' );\n\t\t\t\t\tadd_option( 'book_available-stock-date-attr', 'AVAILABLE_SPOTS ATTRIBUTE_NAME bookings are available on DATE' );\n\t\t\t\t\tadd_option( 'book_available-stock-time-attr', 'AVAILABLE_SPOTS ATTRIBUTE_NAME bookings are available for TIME on DATE' );\n\t\t\t\t\t\n\t\t\t\t\tadd_option( 'book_limited-booking-msg-date', 'PRODUCT_NAME has only AVAILABLE_SPOTS tickets available for the date DATE.' );\n\t\t\t\t\tadd_option( 'book_no-booking-msg-date', 'For PRODUCT_NAME, the date DATE has been fully booked. Please try another date.' );\n\t\t\t\t\tadd_option( 'book_limited-booking-msg-time', 'PRODUCT_NAME has only AVAILABLE_SPOTS tickets available for TIME on DATE.' );\n\t\t\t\t\tadd_option( 'book_no-booking-msg-time', 'For PRODUCT_NAME, the time TIME on DATE has been fully booked. Please try another timeslot.' );\n\t\t\t\t\tadd_option( 'book_limited-booking-msg-date-attr', 'PRODUCT_NAME has only AVAILABLE_SPOTS ATTRIBUTE_NAME tickets available for the date DATE.' );\n\t\t\t\t\tadd_option( 'book_limited-booking-msg-time-attr', 'PRODUCT_NAME has only AVAILABLE_SPOTS ATTRIBUTE_NAME tickets available for TIME on DATE.' );\n\t\t\t\t\t\n\t\t\t\t\tadd_option( 'book_real-time-error-msg', 'That date just got booked. Please reload the page.' );\n\t\t\t\t\t\n\t\t\t\t\t// from 4.0.0, we're going to save the booking settings as individual meta fields. So update the post meta for all bookable products\n\t\t\t\t if ( $booking_plugin_version < '4.0.0' ) {\n\t\t\t\t\t \n\t\t\t\t\t // call the function which will individualize settings for all the bookable products\n\t\t\t\t\t bkap_400_update_settings( $booking_plugin_version );\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// from 4.1.0, we're going to save the fixed blocks and price by range as individual meta fields. So update the post meta for tables of fixed booking block and price by range\n\t\t\t\t\tif ( $booking_plugin_version < '4.1.0' ) {\n\t\t\t\t\t \t\n\t\t\t\t\t // call the function which will individualize settings for all the bookable products\n\t\t\t\t\t bkap_410_update_settings( $booking_plugin_version );\n\t\t\t\t\t \t\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}",
"public function saveManualOrders()\n {\n $this->orders_manual = $this->getPlannedOrders()\n ->groupBy('product_id')->reduce(function ($result, $group) {\n $reduced = $group->first();\n\n $reduced->required_quantity = $group->sum('required_quantity');\n $reduced->planned_quantity = $group->sum('planned_quantity');\n\n return $result->put($reduced->product_id, $reduced);\n\n }, collect());\n \n // abi_r('Man>');abi_r($this->orders_manual);\n\n // Empty\n $this->orders_planned = collect([]);\n // abi_r('Plan>');abi_r($this->orders_planned, true);\n }",
"public function status_change(Request $request)\n { \n $order_id = $request->order_id;\n $status_id = $request->status_id;\n $driver_id = $request->driver_id;\n $scheduling = $request->scheduling;\n $due_date = $request->payment_due_date;\n $arr = array();\n $flag = false;\n $stock_status = false;\n\n if($driver_id){\n\n $items = Order_item::where(['order_id'=>$order_id])->get();\n foreach($items as $item){ \n $stock = Stock::where(['product_id'=> $item->product_id])->get();\n if(!empty($stock[0])){\n if($stock[0]->stock<$item->product_quantity || $stock[0]->stock == 0){\n $msg = \"Stock of this product has id:\".$item->product_id.\" is less than your ordered quantity or equal to 0\";\n $stock_status = true;\n break;\n }\n \n }\n else{\n $msg = \"Stock for this product has id:\".$item->product_id.\" is not available\";\n $stock_status = true;\n break;\n }\n }\n if($stock_status){ \n return response(['response_status'=>false, 'message'=>$msg]);\n }\n else{\n $ord_status = Order::find($order_id);\n if($ord_status->order_status_id == 1){\n foreach($items as $order_item){ \n $stock2 = Stock::where(['product_id'=> $order_item->product_id])->get();\n $cal = ($stock2[0]->stock-$order_item->product_quantity);\n $update2 = Stock::where('id', $stock2[0]->id)->update(['stock'=>$cal]);\n }\n }\n }\n\n $ord_assign = new Assign;\n $driver = Assign::where('order_id',$order_id)->get();\n \n if(empty($driver[0])){\n $assign = Assign::create(['driver_id'=>$driver_id, 'order_id'=>$order_id]);\n if($assign){\n $status_id = 2;\n $flag = true;\n }\n \n }\n else{\n $update = Assign::where('id', $driver[0]->id)->update(['driver_id'=>$driver_id, 'order_id'=>$order_id]);\n if($update){\n $status_id = 2;\n $flag = true;\n }\n }\n\n $cs = User::where(['role_id'=>2])->first();\n $get_inv = Invoice::orderby('id', 'desc')->first();\n if($get_inv){\n $inv_nmbr = $get_inv->invoice_number+1;\n }\n else{\n $inv_nmbr ='1000000';\n }\n\n $data = array();\n $order_info = new Order;\n $get_order = $order_info->fetch_orders_by_id($order_id);\n foreach($get_order as $ord){\n $customer_email = $ord->email;\n $ord->invoice_number = $inv_nmbr;\n $ord->delivery_date = $scheduling;\n $ord->payment_due_date = $due_date;\n $ord->products = $order_info->fetch_orderitems_with_quantity($order_id);\n $data = $ord;\n\n $invoice = Invoice::create(['invoice_number'=>$inv_nmbr, 'order_id'=>$order_id, 'customer_id'=>$ord->user_id, 'invoice_status'=>1]);\n $get = Invoice::find($invoice->id);\n $ord->prefix = $get->prefix;\n }\n \n if(empty($driver[0])){\n // $pdf_data = array('order'=>$data);\n // $pdf = PDF::loadView('myPDF', $pdf_data);\n $inv_name = $data->prefix.''.$data->invoice_number;\n\n\n $params=['data'=>json_encode($data), 'inv_name'=>$inv_name, 'customer_email'=>$customer_email, 'cs'=>$cs->email];\n $defaults = array(\n CURLOPT_URL => 'https://orangeroomdigital.com/email_sender/public/api/send_email',\n CURLOPT_POST => true,\n CURLOPT_POSTFIELDS => $params,\n );\n $ch = curl_init();\n curl_setopt_array($ch, ($defaults));\n $output = curl_exec($ch);\n curl_close($ch); \n // print_r($output);\n // die;\n //$mail = Mail::to($customer_email)->bcc([$cs->email, '[email protected]'])->send(new Emailsend($data, $pdf, $inv_name));\n //$mail = Mail::to(\"[email protected]\")->bcc(\"\")->bcc(\"[email protected]\")->send(new Emailsend($data, $pdf, $inv_name));\n\t\t }\n }\n\n $date = date(\"d-m-Y\", strtotime(NOW()));\n if($status_id == 2){\n $update = Order::where('id', $order_id)->update(['order_status_id'=>$status_id, 'order_confirmed_date'=>$date, 'delivery_date'=>$scheduling, 'payment_due_date'=>$due_date]);\n \n $get_order2 = $order_info->fetch_orders_by_id($order_id);\n foreach($get_order2 as $get_ord){\n $get_ord->driver = $order_info->fetch_assigned_driver_to_order($order_id);\n $get_ord->products = $order_info->fetch_orderitems_with_quantity($order_id);\n foreach($get_ord->products as $ord_items){\n $stock = Stock::where(['product_id'=>$ord_items->id])->first();\n if($stock){\n $ord_items->stock = $stock->stock;\n }\n else{\n $ord_items->stock = 'Stock does not exist';\n }\n }\n $data2 = $get_ord;\n }\n }\n else if($status_id == 3){\n $update = Order::where('id', $order_id)->update(['order_status_id'=>$status_id, 'order_shipped_date'=>$date]);\n }\n else if($status_id == 5){\n $update = Order::where('id', $order_id)->update(['order_status_id'=>$status_id, 'order_delivered_date'=>$date]);\n }\n else{\n $update = Order::where('id', $order_id)->update(['order_status_id'=>$status_id]);\n }\n \n if($update){\n $status = Status::find($status_id);\n $arr['id'] = $status->id;\n $arr['status'] = $status->status;\n $arr['keyword'] = $status->keyword;\n $res = true;\n if($flag){\n $msg = \"Order Assigned Successfully\";\n }\n else{\n $msg = \"Status Changed Successfully\";\n }\n }\n else{\n $res = false;\n $msg = \"Status not Changed. Try Again\";\n }\n if($status_id == 2){\n return response(['response_status'=>$res, 'message'=>$msg, 'updated_record'=>$data2]);\n }\n else{\n return response(['response_status'=>$res, 'message'=>$msg, 'updated_record'=>$arr]);\n }\n \n }",
"public function resetOrder()\n {\n $this->order = [];\n }",
"public function run()\n {\n foreach ($this->data as $key => $value) {\n BookingStatus::create($value);\n }\n }",
"private function reserve(): void\n {\n// $this->busy->lock();\n }"
] | [
"0.5931351",
"0.5865437",
"0.5650538",
"0.56434864",
"0.5572481",
"0.554035",
"0.5442242",
"0.5440432",
"0.54398024",
"0.5408133",
"0.5391911",
"0.5378976",
"0.53712237",
"0.52696663",
"0.5264072",
"0.5208272",
"0.5194768",
"0.5176717",
"0.51609933",
"0.5159658",
"0.51515895",
"0.5131605",
"0.5122623",
"0.5107231",
"0.5086647",
"0.5083004",
"0.5058541",
"0.5056762",
"0.5045043",
"0.5041"
] | 0.72775716 | 0 |
Tell the service to encode an asset it's source | abstract public function encode($source, $preset); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function sourceable();",
"public function source()\n {\n return $this->belongsTo(AssetSource::class, 'asset_source_id');\n }",
"final function source(): string { return $this->source; }",
"private function source($src = '')\n {\n return '<source src=\"'.$src.'\" />';\n }",
"public function asset($symbol){\n\n $response = Http::withHeaders(self::headers())\n ->get(self::endpoint() . config('alpaca.assets_uri') . '/' . $symbol)\n ->collect();\n\n return $response;\n }",
"public function assetTarget();",
"public function getAsset()\n {\n return $this->asset;\n }",
"public function getAsset()\n {\n return $this->asset;\n }",
"public function encode()\n {\n }",
"public function setSource($source);",
"public function setSource($source);",
"public function setSource($source);",
"protected function storeAsset()\n {\n if (!$this->visitor instanceof Discover)\n {\n return;\n }\n\n $assets = $this->getAssetManager();\n $project_root = $assets->getProjectRoot();\n $asset_path = trim($this->node->parameters);\n $file_path = $this->visitor->getDocument()->getFile()->getRealPath();\n\n // get source path\n if ($asset_path[0] !== '/') {\n $source = dirname($file_path) . '/' . $asset_path;\n } else {\n $source = $project_root . $asset_path;\n }\n\n // get destination path\n if ($asset_path[0] !== '/') {\n $destination = substr(\n dirname($file_path).'/'.$asset_path, strlen($project_root)\n );\n } else {\n $destination = substr($asset_path, 1);\n }\n\n // set asset\n $assets->set($source, $destination);\n }",
"public function getSrcAttribute()\n {\n return asset(env('IMAGE_PATH') . $this->attributes['brand_image']);\n }",
"abstract public function assets();",
"public function setSource()\n {\n }",
"public function url()\n\t{\n\t\treturn asset($this->src);\n\t}",
"function createAsset($clientAsset) {\n // Build our request to create the new asset.\n $asset = new stdClass();\n $properties = array(\n 'name',\n 'description',\n 'file_name',\n 'file_size',\n 'chunk_size',\n 'asset_type',\n );\n foreach ($properties as $property) {\n if (!isset($clientAsset->$property)) {\n http500(\"The $property is missing from from the asset.\");\n }\n $asset->{$property} = $clientAsset->{$property};\n }\n\n try {\n $api = new OoyalaApi(OOYALA_API_KEY, OOYALA_API_SECRET);\n\n $asset = $api->post(\"assets\", $asset);\n $uploading_urls = $api->get(\"assets/\" . $asset->embed_code . \"/uploading_urls\");\n\n $response = new stdClass();\n $response->embed_code = $asset->embed_code;\n $response->uploading_urls = $uploading_urls;\n return $response;\n }\n catch(Exception $e){\n http500($e->getMessage());\n }\n}",
"public function encode()\n {\n return serialize($this->resource);\n }",
"public function get_asset_source($asset_id)\n\t{\n\t\t$uri = 'assets/source/' . $asset_id;\n\t\treturn $this->get_response($uri);\n\t}",
"public function getSource()\n {\n return 'aam';\n }",
"abstract public function getSource();",
"public function SafeSource($source){\n\t\t\t//The user will have a source file that doesn't match his string representation.\n\t\t\t//I'm creating this ONLY so that returned Image objects match as closely as possible\n\t\t\t//\twith the input Object.\n\t\t\t//If this proves to be a mistake, I'll leave it out.\n\t\t\t//After all, the new object coming back ISN'T the original, so maintaining that\n\t\t\t//\tubiquity is not very important.\n\n\t\t\t$this->source = $source;\n\t\t}",
"public function init() {\n\t\t$this->_assetUrl = Yii::app()->assetManager->publish(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets', false, -1, YII_DEBUG);\n\t\t\n parent::init();\n }",
"function getSource($media, array $options);",
"public function get_asset($asset_name, $mime_type=null){\r\n\t\tif(!isset($mime_type))\r\n\t\t\t$mime_type = AssetManager::_get_mime_type($asset_name);\r\n\t\t$file = \"\";\r\n\t\tif( !file_exists($file) ) \r\n\t\t\tthrow new Exception(\"Asset '\" . $asset_name . \"' not found.\");\r\n\t\t$content['type'] = $mime_type;\r\n\t\t$content['length'] = filesize($file);\r\n\t\t$content['disposition'] = 'attachment; filename=\"' . $asset_name .'\"';\r\n\t\t\r\n\t\treturn $content;\r\n\t\t/*\r\n\t\theader('Content-Type:' . $mime_type);\r\n\t\theader('Content-Length: ' . filesize($file));\r\n\t\theader('Content-Disposition: attachment; filename=\"' . $asset_name .'\"');\r\n\t\treadfile($file);*/\r\n\t}",
"public function set($src) {\n $src = str_replace('+','%27',urldecode($this->modx->getOption('src',$this->config,'')));\n if (empty($src)) return '';\n return $this->setSourceFilename($src);\n }",
"function hewa_player_print_source_tag( $source, $type ) {\n\n $source_e = esc_attr( $source );\n $type_e = esc_attr( $type );\n echo \"<source src='$source_e' type='$type_e'>\";\n}",
"public function getSource()\n {\n return 'arquivo';\n }",
"public function source($url);"
] | [
"0.5640432",
"0.557274",
"0.54678214",
"0.5437675",
"0.5428049",
"0.54258364",
"0.5371424",
"0.5371424",
"0.53620565",
"0.5330295",
"0.5330295",
"0.5330295",
"0.53299445",
"0.5324458",
"0.5261842",
"0.5245128",
"0.5225985",
"0.5174163",
"0.51692367",
"0.51598716",
"0.5113871",
"0.51138675",
"0.5095074",
"0.5079502",
"0.5074765",
"0.50675035",
"0.5053486",
"0.5037896",
"0.5033701",
"0.50181437"
] | 0.603904 | 0 |
Number of consecutive successful checks required before receiving traffic. Generated from protobuf field uint32 success_threshold = 4; | public function getSuccessThreshold()
{
return $this->success_threshold;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function successCount();",
"public function getSuccessCount()\n {\n return $this->countSuccess;\n }",
"public function getSuccessCount()\r\n\t{\r\n\t\t$count = 0;\r\n\t\t\r\n\t\tforeach ($this->_caseResult as $result) {\r\n\t\t\tif($result->getStatus()) {\r\n\t\t\t\t$count++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $count;\r\n\t}",
"public function successCount() {\n\t\treturn isset($this->_messages[self::TYPE_SUCCESS])\n\t\t? count($this->_messages[self::TYPE_SUCCESS]) : null;\n\t}",
"function failureCount() {\r\n return sizeof($this->_failures);\r\n }",
"public function getFailureCount()\n {\n return $this->failure;\n }",
"public function getFailureCount()\n {\n return $this->countFailure;\n }",
"public function failedCount();",
"public function attempts()\n {\n return (int) $this->sportevent['Attributes']['ApproximateReceiveCount'];\n }",
"public function getTotalRequests()\n {\n return count($this->data['success']) + count($this->data['failure']);\n }",
"public function countPending(): int;",
"public function hasSuccess(){\n return $this->_has(8);\n }",
"public function getNumItemsSuccess()\n {\n return $this->tracker->getNumProcessedItems(Tick::SUCCESS);\n }",
"public function setSuccessThreshold($var)\n {\n GPBUtil::checkUint32($var);\n $this->success_threshold = $var;\n\n return $this;\n }",
"public function getSuccessfulTestsCount(): int;",
"protected function success()\n {\n\n ++self::$anzTests;\n }",
"public function getMaxAttemptsBeforeAlarm(): int;",
"public function countSuccessfulServices(): int\n {\n return count($this->getSuccessfulServices());\n }",
"public function getAttempts(): int;",
"public function getFloodProtectionTries() {\n return 20;\n }",
"public function success()\n {\n return $this->failures === 0;\n }",
"public function getSuccess()\n {\n return $this->statusCode < 400;\n }",
"public function getSucessfulRequests()\n {\n return $this->data['success'];\n }",
"function is_success ($sc)\n{\n\treturn $sc >= 200 && $sc < 300;\n}",
"protected function getSuccesses($path) {\n\t\treturn (empty($this->redis->get($path . ':passes'))) ? 0 : $this->redis->get($path . ':passes');\n\t}",
"public function getFailedTestsCount(): int;",
"public function attempts()\n {\n return 1;\n }",
"public function getStatus()\n\t{\n\t\treturn $this->_passFail;\n\t}",
"public function getFailureThreshold()\n {\n return $this->failure_threshold;\n }",
"public function numFailed():Int {\n\n\t\treturn $this->numFailed;\n\n\t}"
] | [
"0.64251304",
"0.6307896",
"0.6154059",
"0.613631",
"0.61024034",
"0.5894339",
"0.5865296",
"0.5813579",
"0.56767446",
"0.566176",
"0.56525147",
"0.5598681",
"0.55443776",
"0.55406266",
"0.5523164",
"0.54206836",
"0.5368255",
"0.5349244",
"0.5348259",
"0.5343392",
"0.53275657",
"0.5298816",
"0.5297485",
"0.52965796",
"0.52619815",
"0.5230217",
"0.52260864",
"0.52126175",
"0.51687795",
"0.5166054"
] | 0.6412907 | 1 |
Interval between health checks. Generated from protobuf field .google.protobuf.Duration check_interval = 5; | public function setCheckInterval($var)
{
GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
$this->check_interval = $var;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCheckInterval(): int;",
"public function getCheckInterval()\n {\n return $this->check_interval;\n }",
"public function setCheckInterval($checkInterval)\n {\n $this->checkInterval = $checkInterval;\n }",
"private function slow_heartbeat()\n {\n add_filter(\"heartbeat_settings\", function ($settings) {\n $settings[\"interval\"] = 60;\n return $settings;\n });\n }",
"public function __construct($interval = 5000) {\n\t\t$this->interval = $interval;\n\t}",
"public function setHealthChecks($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->health_checks = $arr;\n\n return $this;\n }",
"public function checkServiceHealth(array $configOptions): void;",
"public function runTimedChecks()\n {\n $this->checkAutomated();\n $this->checkDebt();\n }",
"public function compareDuration(Interval $interval): int;",
"public function getHealthChecks()\n {\n return $this->health_checks;\n }",
"public function run(callable $checkTime);",
"public function backoff()\n {\n return [60, 120];\n }",
"public static function handle_sleep()\n{\n if (!is_array(self::$events)) {\n return false;\n }\n\n $msg = array();\n $host_info = self::get_host_info();\n /*\n\nif (!array_key_exists('seconds', self::$events))\n{\n return false;\n}\n\n foreach (self::$events['seconds'] as $second=>$runmodes)\n {\n foreach ($runmodes as $runmode=>$classes)\n {\n foreach ($classes as $class=>$types)\n {\n foreach ($types as $type=>$stat)\n {\n // Only doing Requests per Second\n if ($type = 'requests')\n {\n foreach (self::$downsamplers as $downsample)\n {\n $value = $stat->{$downsample}();\n $format = \"webapp2.%s.%s.%s %s %s type=%s\\n\";\n $msg[] = sprintf($format, $runmode, $class, $downsample, $second, $value, $type);\n }\n }\n }\n }\n }\n }\n */\n\n if (!array_key_exists('minutes', self::$events)) {\n return false;\n }\n\n foreach (self::$events['minutes'] as $minute => $runmodes) {\n foreach ($runmodes as $runmode => $classes) {\n foreach ($classes as $class => $types) {\n foreach ($types as $type => $stat) {\n\n foreach (self::$downsamplers as $downsample) {\n $value = $stat->{$downsample}();\n $format = \"webapp2.%s.%s.1m.%s %s %s type=%s\\n\";\n $msg[] = sprintf($format, $runmode, $class, $downsample, $minute, $value, $type);\n }\n }\n }\n }\n }\n\n $sender = new Sender();\n $sender->send_metrics($msg);\n\n unset($msg);\n self::$events = array();\n}",
"public function onTick() {\r\n $check = true;\r\n foreach ($this->keys as $keyOwner => $api) {\r\n try {\r\n if ($check == false)\r\n continue;\r\n\r\n $keyID = $api[\"keyID\"];\r\n $vCode = $api[\"vCode\"];\r\n if(@$api[\"corpKey\"] == true)\r\n continue;\r\n \r\n $characterID = $api[\"characterID\"];\r\n $lastChecked = $this->storage->get(\"notificationCheck{$keyID}{$keyOwner}{$characterID}\");\r\n\r\n if ($lastChecked <= time()) {\r\n $this->log->info(\"Checking API Key {$keyID} belonging to {$keyOwner} for new notifications\");\r\n $this->getNotifications($keyID, $vCode, $characterID);\r\n $this->storage->set(\"notificationCheck{$keyID}{$keyOwner}{$characterID}\", time() + 1805); // Reschedule it's check for 30minutes from now (Plus 5s, ~CCP~)\r\n $check = false;\r\n }\r\n } catch (\\Exception $e) {\r\n $this->log->err(\"Error with eve notification checker: \" . $e->getMessage());\r\n }\r\n }\r\n }",
"public function interval($value)\n {\n $this->_interval = ACIS_validInterval($value);\n return;\n }",
"public function everyFiveMinutes(): self;",
"public function schedule_cron_healthcheck( $schedules ) {\n\t\t/**\n\t\t * Filters the number of minutes to schedule the cron health-check.\n\t\t *\n\t\t * @since 4.9.5\n\t\t *\n\t\t * @param int $interval The number of minutes to schedule the cron health-check; defaults to 5.\n\t\t * @param static $this This process instance.\n\t\t */\n\t\t$interval = apply_filters( $this->identifier . '_cron_interval', $this->healthcheck_cron_interval, $this );\n\n\t\t// Adds every 5 minutes to the existing schedules.\n\t\t$schedules[ $this->identifier . '_cron_interval' ] = [\n\t\t\t'interval' => MINUTE_IN_SECONDS * $interval,\n\t\t\t'display' => sprintf( __( 'Every %d Minutes', 'tribe-common' ), $interval ),\n\t\t];\n\n\t\treturn $schedules;\n\t}",
"public function test_min_data_age_with_Checkperiod(){\n\t\t// EXPECTED RESULT : The first 100 keys get persisted after 120 seconds and the remaining 400 keys get persisted after 180 seconds.\n\t\t// Setting chk_period\n\t\tzbase_setup::reset_zbase_vbucketmigrator(TEST_HOST_1, TEST_HOST_2);\n\t\t$instance = Connection::getMaster();\n\t\tflushctl_commands::set_flushctl_parameters(TEST_HOST_1, \"chk_period\" ,60);\n\t\t//Setting chk_max_items\n\t\tflushctl_commands::set_flushctl_parameters(TEST_HOST_1, \"chk_max_items\",500);\n\t\t//Setting min_data_age\n\t\tflushctl_commands::set_flushctl_parameters(TEST_HOST_1, \"min_data_age\", 120);\n\t\tflushctl_commands::set_flushctl_parameters(TEST_HOST_2, \"min_data_age\", 120);\n\t\tflushctl_commands::set_flushctl_parameters(TEST_HOST_2, \"queue_age_cap\", 180);\n\t\t//Get stats before any key is set\n\t\t$items_persisted_master_before_set = Utility::Get_ep_total_persisted(TEST_HOST_1);\n\t\t$items_persisted_slave_before_set = Utility::Get_ep_total_persisted(TEST_HOST_2);\n\t\t$checkpoint_before_set = stats_functions::get_checkpoint_stats(TEST_HOST_1,\"open_checkpoint_id\");\n\t\t$this->assertTrue(Data_generation::add_keys(100,500,1,20) ,\"Failed adding keys\");\n\t\tsleep(60);\n\t\t$checkpoint_after_set = stats_functions::get_checkpoint_stats(TEST_HOST_1,\"open_checkpoint_id\");\n\t\t$this->assertEquals($checkpoint_after_set-$checkpoint_before_set ,1 ,\"Checkpoint not closed\");\n\t\t$this->assertFalse(Utility::Get_ep_total_persisted(TEST_HOST_1, $items_persisted_master_before_set),\"min_data_age not respected on master\");\n\t\t$this->assertFalse(Utility::Get_ep_total_persisted(TEST_HOST_2, $items_persisted_slave_before_set) ,\"min_data_age not respected on slave\");\n\t\t$this->assertTrue(Data_generation::add_keys(400,500,101,20) ,\"Failed adding keys\");\n\t\tsleep(80);\n\t\t$items_persisted_master_after_min_data_age = stats_functions::get_all_stats(TEST_HOST_1, \"ep_total_persisted\");\n\t\t$items_persisted_slave_after_min_data_age = stats_functions::get_all_stats(TEST_HOST_2, \"ep_total_persisted\");\n\t\t$this->assertEquals($items_persisted_master_after_min_data_age-$items_persisted_master_before_set, 100, \"Item not persisted after min_data_age period on master\");\n\t\t//This won't be applicable\n#$this->assertEquals($items_persisted_slave_after_min_data_age-$items_persisted_slave_before_set, 100, \"Item not persisted after min_data_age period on slave\");\n\t\t$this->assertFalse(Utility::Get_ep_total_persisted(TEST_HOST_1,$items_persisted_master_after_min_data_age),\"min_data_age not respected for new keys on master\");\n\t\t$this->assertFalse(Utility::Get_ep_total_persisted(TEST_HOST_2,$items_persisted_slave_after_min_data_age) ,\"min_data_age not respected for new keys on slave\");\n\t\tsleep(110);\n\t\t$new_items_persisted_master_after_min_data_age = stats_functions::get_all_stats(TEST_HOST_1, \"ep_total_persisted\");\n\t\t$new_items_persisted_slave_after_min_data_age = stats_functions::get_all_stats(TEST_HOST_2, \"ep_total_persisted\");\n\t\t$this->assertEquals($new_items_persisted_master_after_min_data_age-$items_persisted_master_after_min_data_age , 400 , \"Item not persisted after min_data_age period on master\");\n\t\t$this->assertEquals($new_items_persisted_slave_after_min_data_age - $items_persisted_slave_before_set , 500 , \"Item not persisted after min_data_age period on slave\");\n\n\t}",
"public function actionScheduled($forcedCheckInterval = null)\n {\n $lastCheck = $this->cache->exists(self::LAST_CHECK_CACHE_KEY)\n ? $this->cache->get(self::LAST_CHECK_CACHE_KEY)\n : Db::prepareDateForDb((new \\DateTime())->modify(self::LAST_CHECK_DEFAULT_INTERVAL));\n\n if ($forcedCheckInterval) {\n $lastCheck = Db::prepareDateForDb((new \\DateTime())->modify($forcedCheckInterval));\n }\n\n $now = Db::prepareDateForDb(new \\DateTime());\n $published = $this->getPublishedEntries($lastCheck, $now);\n $expired = $this->getExpiredEntries($lastCheck, $now);\n $entries = array_merge($published, $expired);\n\n // Remember this check\n $this->cache->set(self::LAST_CHECK_CACHE_KEY, $now);\n\n // Print info\n ConsoleHelper::output(sprintf(\"> Expired Entries: %d\", count($expired)));\n ConsoleHelper::output(sprintf(\"> Published Entries: %d\", count($published)));\n ConsoleHelper::output(sprintf(\"> Range: %s to %s\", $lastCheck, $now));\n\n if (!count($entries)) {\n return ExitCode::OK;\n }\n\n $this->fireEvent($published, Entry::STATUS_PENDING);\n $this->fireEvent($expired, Entry::STATUS_LIVE);\n\n $this->drawTable($entries);\n\n return ExitCode::OK;\n }",
"function check_sla_threshold($threshold, $value)\n{\n $inside = ((substr($threshold, 0, 1) == '@') ? true : false);\n $range = str_replace('@','', $threshold);\n $parts = explode(':', $range);\n\n if (count($parts) > 1) {\n $start = $parts[0];\n $end = $parts[1];\n } else {\n $start = 0;\n $end = $range;\n }\n\n if (substr($start, 0, 1) == \"~\") {\n $start = -999999999;\n }\n if (!is_numeric($end)) {\n $end = 999999999;\n }\n if ($start > $end) {\n throw new Exception(\"In range threshold START:END, START must be less than or equal to END\");\n }\n\n if ($inside > 0) {\n if ($start <= $value && $value <= $end) {\n return 1;\n }\n } else {\n if ($value < $start || $end < $value) {\n return 1;\n }\n }\n\n return 0;\n}",
"function checkQueueGrowthCountAndEmailAlert() {\n $queueStatusFilename = './QueueStatus.ini';\n $queueStatus = parse_ini_file($queueStatusFilename, true);\n// $message = \"\";\n $configTable = Doctrine_Core::getTable('WPTMonitorConfig');\n $config = $configTable->find(1);\n $siteContactEmailAddress = $config['SiteContactEmailAddress'];\n foreach ($queueStatus as $key => $status) {\n if($status['QueueGrowthCount']>4) {\n logOutput('[INFO] [checkQueueGrowthCountAndEmailAlert] QueueGrowthCheck has grown over 4 times for: ' . $key);\n // Growth rate has exceeded threshold, but only send an alert once per hour.\n // Check time stamp\n if(!array_key_exists(\"LastQueueGrowthAlertTime\",\n $status) || ( current_seconds()>$status[\"LastQueueGrowthAlertTime\"]+3600 )\n ) {\n logOutput('[INFO] [checkQueueGrowthCountAndEmailAlert] QueueGrowthCheck for: ' . $key . ' has not alerted since: ' . $status[\"LastQueueGrowthAlertTime\"]);\n $message = \"\\n--------------------------------------------\\n\";\n $message .= \"Queue Growth alert for location: \" . $status['id'] . \"\\n\";\n $message .= \"In Queue: \" . $status['PendingTests'] . \"\\n\";\n $message .= \"Testers: \" . $status['AgentCount'] . \"\\n\";\n $message .= \"Timestamp: \" . timestamp() . \"\\n\";\n $message .= \"\\n--------------------------------------------\\n\";\n $message .= \"Queue count continues to grow. Please provision more testers or decrease the runrate for this location.\";\n // Update alert time stamp\n $queueStatus[$key]['LastQueueGrowthAlertTime'] = current_seconds();\n writeIniFile($queueStatus, $queueStatusFilename, true);\n }else {\n// logOutput('[INFO] [checkQueueGrowthCountAndEmailAlert] QueueGrowthCheck for: '.$key.' alert interval has not passed. Last Alert: '.$status[\"LastQueueGrowthAlertTime\"]);\n }\n }\n }\n if(isset( $message )) {\n sendEmailAlert($siteContactEmailAddress, $message);\n logOutput(\"[INFO] [checkQueueGrowthCountAndEmailAlert] Alert message sent:\\n\" . $message);\n }\n}",
"public function backoff()\n {\n // 30s, 5min, 30min\n return [30, 5*60, 30*60];\n }",
"public function getInterval();",
"function test_check($res,$httpstatus){\r\n\t\r\n\t$sec=date('s');\r\n\tif ($sec<30) return array(0,'test fail at the first half of a second');\r\n\t\r\n\treturn array(1,'');\r\n\t\r\n}",
"public function getRunLoopInterval(): int;",
"public function checkIntervalLimit()\n {\n if (strtotime('- '.$this->config->getIntervalLimit(). ' second') >= $this->data['period']['lastDate']) {\n return true;\n }\n if ($this->data['intervalMaxRequest'] < 1) {\n $this->execBan('Interval');\n return false;\n }\n return true;\n }",
"public function setEnemyAttackInterval($var)\n {\n GPBUtil::checkFloat($var);\n $this->enemy_attack_interval = $var;\n }",
"public function getAttackServerInterval()\n {\n return $this->attack_server_interval;\n }",
"public function abuts(Interval $interval): bool;",
"public function setInterval($interval);"
] | [
"0.68942946",
"0.67957866",
"0.67941177",
"0.5490738",
"0.50448453",
"0.49610445",
"0.4956894",
"0.49429443",
"0.48916683",
"0.4867635",
"0.4865461",
"0.48123252",
"0.47568354",
"0.47524267",
"0.472033",
"0.46860608",
"0.46396828",
"0.46317503",
"0.46092448",
"0.45784622",
"0.45775983",
"0.4574268",
"0.45576608",
"0.45295972",
"0.452202",
"0.45038936",
"0.4464023",
"0.44305086",
"0.44152573",
"0.4401848"
] | 0.69407564 | 0 |
A maximum time limit on application initialization, measured from moment the application successfully replies to a healthcheck until it is ready to serve traffic. Generated from protobuf field .google.protobuf.Duration app_start_timeout = 7; | public function getAppStartTimeout()
{
return $this->app_start_timeout;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setAppStartTimeout($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Duration::class);\n $this->app_start_timeout = $var;\n\n return $this;\n }",
"public function http_request_timeout() {\n\t\t// @todo: Add wrapper to only set this time when going through publishing flow process.\n\t\treturn 120;\n\t}",
"public function timeout()\n {\n return 1200;\n }",
"public function initialize() {\n $this->startTimer('GlobalApp', 'Global Application loading time');\n $this->_pausedTime = 0;\n _log('PERF', '____________________________________________________________________');\n _log('PERF', 'WeeReporting class initialized at ' . date('Y/m/d H:i:s', time()));\n $initialRequest = $this->markers['GlobalApp']['startTime'] - $_SERVER[\"REQUEST_TIME_FLOAT\"];\n _log('PERF', 'Server request ' . $initialRequest . ' seconds ago.');\n _log('PERF', '--------------------------------------------------------------------');\n }",
"public function __construct(Application $application, array $options = []) {\n\t\tparent::__construct($application, $options);\n\t\t$this->timer = new Timer();\n\t\t$this->quit_after = $this->optionInt('quit_after', 60); // 60 seconds should be good, right?\n\t\t$this->done = false;\n\t}",
"public function timeout()\n {\n return 10;\n }",
"public function __construct()\n {\n parent::__construct();\n set_time_limit(self::PROBLEM_TIMEOUT_OVERRIDE);\n }",
"public function getTimeout()\n {\n return 0;\n }",
"function set_time_limit(int $seconds): bool\n{\n // Disable set_time_limit to not stop the worker\n // by default CLI sapi use 0 (unlimited)\n return true;\n}",
"public function run()\n {\n\n Platform::create([\n 'time_limit'=>'11:00:00'\n ]);\n }",
"public function increase_timeout() { \n $timeout = 6000;\n if( !ini_get( 'safe_mode' ) )\n @set_time_limit( $timeout );\n\n @ini_set( 'memory_limit', WP_MAX_MEMORY_LIMIT );\n @ini_set( 'max_execution_time', (int)$timeout );\n }",
"public function getTimeout() {}",
"public function getTimeout(): int;",
"public function getTimeout(): int;",
"public function getTimeout(): int;",
"private static function sessionTimeLimit()\r\n\t{\r\n\t\tif (is_null(self::$session_time_limit)) {\r\n\t\t\t$tmp = intval(ServerParam::getVal('session_time_limit')) * 60;\r\n\t\t\tif ($tmp <= 0) $tmp = self::DEFAULT_SESSION_TIME_LIMIT;\r\n\t\t\tself::$session_time_limit = $tmp;\r\n\t\t}\r\n\t\treturn self::$session_time_limit;\r\n\t}",
"public function __construct(Application $app)\n {\n $this->time = $this->now();\n $this->app = $app;\n $this->manager = new HttpLogManager();\n }",
"public function setAppActionIfMaximumPinRetriesExceeded($val)\n {\n $this->_propDict[\"appActionIfMaximumPinRetriesExceeded\"] = $val;\n return $this;\n }",
"public function getMaxAttemptsBeforeAlarm(): int;",
"public function getAppCrashCount()\n {\n if (array_key_exists(\"appCrashCount\", $this->_propDict)) {\n return $this->_propDict[\"appCrashCount\"];\n } else {\n return null;\n }\n }",
"function default_time_limit( $value ) {\n\t\t// Example increases the limit to 25 seconds.\n\t\treturn 25;\n\t}",
"public function testMaxRetryCount() {\n $opts = [\n 'key' => 'fake.key:veryFake',\n 'httpClass' => 'tests\\HttpMockInitTestTimeout',\n 'httpMaxRetryCount' => 2,\n ];\n\n $ably = new AblyRest( $opts );\n try {\n $ably->time(); // make a request\n $this->fail('Expected the request to fail');\n } catch(AblyRequestException $e) {\n $this->assertCount(3, $ably->http->visitedHosts, 'Expected to have tried 1 main host and 2 fallback hosts');\n }\n }",
"public function getWarmupSeconds()\n {\n return $this->warmup_seconds;\n }",
"function bump_request_timeout($imp) {\n\t\treturn 60;\n\t}",
"public function getLongTimeouts()\n {\n return ['connect_timeout' => 10, 'timeout' => 10];\n }",
"protected function initialize(Application $app)\n {\n parent::initialize($app);\n\n $cms = $this->app['request']->get('usage');\n self::$usage = is_null($cms) ? 'framework' : $cms;\n self::$usage_param = (self::$usage != 'framework') ? '?usage='.self::$usage : '';\n // set the locale from the CMS locale\n if (self::$usage != 'framework') {\n $app['translator']->setLocale($this->app['session']->get('CMS_LOCALE', 'en'));\n }\n self::$config = $this->app['utils']->readJSON(THIRDPARTY_PATH.'/%extname%/config.%foldername%.json');\n }",
"public function getTimeout()\n {\n }",
"protected function maxLoginAttempts()\n {\n return settings('throttle_attempts', 5);\n }",
"public function __construct(Application $app)\n {\n $this->app = $app;\n $this->processes = [];\n $this->waitingProcesses = [];\n }",
"private static function getTimeout()\n {\n return static::$sessionTimeOut;\n }"
] | [
"0.68548596",
"0.5712125",
"0.5357564",
"0.5229903",
"0.51355344",
"0.49936017",
"0.4975322",
"0.49345118",
"0.49155822",
"0.48051128",
"0.4766204",
"0.474649",
"0.4737301",
"0.4737301",
"0.4737301",
"0.47052416",
"0.46905792",
"0.46759674",
"0.4632287",
"0.46194625",
"0.4602993",
"0.46017492",
"0.45924753",
"0.45731065",
"0.45722747",
"0.45705643",
"0.45689246",
"0.4567795",
"0.45676044",
"0.45659512"
] | 0.7372189 | 0 |
A maximum time limit on application initialization, measured from moment the application successfully replies to a healthcheck until it is ready to serve traffic. Generated from protobuf field .google.protobuf.Duration app_start_timeout = 7; | public function setAppStartTimeout($var)
{
GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
$this->app_start_timeout = $var;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAppStartTimeout()\n {\n return $this->app_start_timeout;\n }",
"public function http_request_timeout() {\n\t\t// @todo: Add wrapper to only set this time when going through publishing flow process.\n\t\treturn 120;\n\t}",
"public function timeout()\n {\n return 1200;\n }",
"public function initialize() {\n $this->startTimer('GlobalApp', 'Global Application loading time');\n $this->_pausedTime = 0;\n _log('PERF', '____________________________________________________________________');\n _log('PERF', 'WeeReporting class initialized at ' . date('Y/m/d H:i:s', time()));\n $initialRequest = $this->markers['GlobalApp']['startTime'] - $_SERVER[\"REQUEST_TIME_FLOAT\"];\n _log('PERF', 'Server request ' . $initialRequest . ' seconds ago.');\n _log('PERF', '--------------------------------------------------------------------');\n }",
"public function __construct(Application $application, array $options = []) {\n\t\tparent::__construct($application, $options);\n\t\t$this->timer = new Timer();\n\t\t$this->quit_after = $this->optionInt('quit_after', 60); // 60 seconds should be good, right?\n\t\t$this->done = false;\n\t}",
"public function timeout()\n {\n return 10;\n }",
"public function __construct()\n {\n parent::__construct();\n set_time_limit(self::PROBLEM_TIMEOUT_OVERRIDE);\n }",
"public function getTimeout()\n {\n return 0;\n }",
"function set_time_limit(int $seconds): bool\n{\n // Disable set_time_limit to not stop the worker\n // by default CLI sapi use 0 (unlimited)\n return true;\n}",
"public function run()\n {\n\n Platform::create([\n 'time_limit'=>'11:00:00'\n ]);\n }",
"public function increase_timeout() { \n $timeout = 6000;\n if( !ini_get( 'safe_mode' ) )\n @set_time_limit( $timeout );\n\n @ini_set( 'memory_limit', WP_MAX_MEMORY_LIMIT );\n @ini_set( 'max_execution_time', (int)$timeout );\n }",
"public function getTimeout() {}",
"public function getTimeout(): int;",
"public function getTimeout(): int;",
"public function getTimeout(): int;",
"private static function sessionTimeLimit()\r\n\t{\r\n\t\tif (is_null(self::$session_time_limit)) {\r\n\t\t\t$tmp = intval(ServerParam::getVal('session_time_limit')) * 60;\r\n\t\t\tif ($tmp <= 0) $tmp = self::DEFAULT_SESSION_TIME_LIMIT;\r\n\t\t\tself::$session_time_limit = $tmp;\r\n\t\t}\r\n\t\treturn self::$session_time_limit;\r\n\t}",
"public function __construct(Application $app)\n {\n $this->time = $this->now();\n $this->app = $app;\n $this->manager = new HttpLogManager();\n }",
"public function setAppActionIfMaximumPinRetriesExceeded($val)\n {\n $this->_propDict[\"appActionIfMaximumPinRetriesExceeded\"] = $val;\n return $this;\n }",
"public function getMaxAttemptsBeforeAlarm(): int;",
"public function getAppCrashCount()\n {\n if (array_key_exists(\"appCrashCount\", $this->_propDict)) {\n return $this->_propDict[\"appCrashCount\"];\n } else {\n return null;\n }\n }",
"function default_time_limit( $value ) {\n\t\t// Example increases the limit to 25 seconds.\n\t\treturn 25;\n\t}",
"public function testMaxRetryCount() {\n $opts = [\n 'key' => 'fake.key:veryFake',\n 'httpClass' => 'tests\\HttpMockInitTestTimeout',\n 'httpMaxRetryCount' => 2,\n ];\n\n $ably = new AblyRest( $opts );\n try {\n $ably->time(); // make a request\n $this->fail('Expected the request to fail');\n } catch(AblyRequestException $e) {\n $this->assertCount(3, $ably->http->visitedHosts, 'Expected to have tried 1 main host and 2 fallback hosts');\n }\n }",
"public function getWarmupSeconds()\n {\n return $this->warmup_seconds;\n }",
"public function getLongTimeouts()\n {\n return ['connect_timeout' => 10, 'timeout' => 10];\n }",
"function bump_request_timeout($imp) {\n\t\treturn 60;\n\t}",
"protected function initialize(Application $app)\n {\n parent::initialize($app);\n\n $cms = $this->app['request']->get('usage');\n self::$usage = is_null($cms) ? 'framework' : $cms;\n self::$usage_param = (self::$usage != 'framework') ? '?usage='.self::$usage : '';\n // set the locale from the CMS locale\n if (self::$usage != 'framework') {\n $app['translator']->setLocale($this->app['session']->get('CMS_LOCALE', 'en'));\n }\n self::$config = $this->app['utils']->readJSON(THIRDPARTY_PATH.'/%extname%/config.%foldername%.json');\n }",
"public function getTimeout()\n {\n }",
"protected function maxLoginAttempts()\n {\n return settings('throttle_attempts', 5);\n }",
"public function __construct(Application $app)\n {\n $this->app = $app;\n $this->processes = [];\n $this->waitingProcesses = [];\n }",
"private static function getTimeout()\n {\n return static::$sessionTimeOut;\n }"
] | [
"0.7372699",
"0.5712132",
"0.53580743",
"0.5229358",
"0.51347524",
"0.49937382",
"0.4974578",
"0.4934939",
"0.49157578",
"0.48055506",
"0.47656178",
"0.47467673",
"0.47375396",
"0.47375396",
"0.47375396",
"0.47055137",
"0.46900448",
"0.46752292",
"0.46328482",
"0.46199635",
"0.460322",
"0.46023393",
"0.45935953",
"0.457326",
"0.45727542",
"0.4570043",
"0.45692828",
"0.45689133",
"0.45673093",
"0.45667708"
] | 0.6854317 | 1 |
Since Symfony's Http Response object is full of... public properties we need to make a real one instead of a mock | private function buildResponse()
{
$response = new Response();
$headers = $this->getMock('Symfony\Component\HttpFoundation\HeaderBag');
$response->headers = $headers;
return $response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testResponse() {\n $builder = new Builder();\n $this->assertInstanceOf(Response::class, $builder->response($this->createMock(Response::class)));\n }",
"private function getBaseMockResponse()\n {\n return $this->getMock('Psr\\Http\\Message\\ResponseInterface');\n }",
"function __construct() {\n $this->response = new Response();\n }",
"private function getMockResponseAsInvalidObject()\n {\n $response = $this->getBaseMockResponse();\n\n $apiRawResponse = <<<'JSON'\n{\n \"data\": {\n \"global_hash\": \"900913\",\n \"hash\": \"ze6poY\",\n \"long_url\": \"http://www.google.com/\",\n \"new_hash\": 0,\n \"url\": \"http://bit.ly/ze6poY\"\n }\n}\nJSON;\n\n $stream = $this->getBaseMockStream();\n $stream\n ->expects($this->once())\n ->method('getContents')\n ->will($this->returnValue($apiRawResponse));\n\n $response\n ->expects($this->once())\n ->method('getBody')\n ->will($this->returnValue($stream));\n\n return $response;\n }",
"public function testGetResponse()\n {\n $this->assertInstanceOf('\\Psr\\Http\\Message\\ResponseInterface', $this->container->get('response'));\n }",
"public function __construct()\n {\n $this->response = new Response();\n }",
"protected function createResponseMock()\n {\n return $this->getMock('Ivory\\HttpAdapter\\Message\\ResponseInterface');\n }",
"public function getInternalResponse(): HttpResponseInterface;",
"public function testGetResponse()\n {\n $this->assertInstanceOf(ResponseInterface::class, $this->container['response']);\n }",
"public function testGetResponse()\n {\n $this->assertInstanceOf(Response::class, $this->getResponse());\n }",
"protected function mockResponse()\n {\n return $this->createMock(ResponseInterface::class);\n }",
"public function __construct()\n {\n $this->response = new StdClass;\n }",
"public function testModelResponseFailure()\n {\n // fake a response with missing required property and extra invalid one\n $response = new Response(200, [], '{\"baz\":1}');\n $handlerStack = MockHandler::createWithMiddleware([$response]);\n $client = $this->createClient(['handler' => $handlerStack]);\n\n $client->test();\n }",
"function set_response(ResponseInterface $response): void\n{\n Container::set('response', $response, true);\n}",
"protected function setUp()\n {\n $this->object = new Response;\n }",
"protected function setUp(): void\n {\n parent::setUp();\n\n $this->response = new Response(200, [], '{\n \"symbol\": \"AAPL\",\n \"companyName\": \"Apple Inc.\",\n \"calculationPrice\": \"tops\",\n \"open\": 154,\n \"openTime\": 1506605400394,\n \"close\": 153.28,\n \"closeTime\": 1506605400394,\n \"high\": 154.80,\n \"low\": 153.25,\n \"latestPrice\": 158.73,\n \"latestSource\": \"Previous close\",\n \"latestTime\": \"September 19, 2017\",\n \"latestUpdate\": 1505779200000,\n \"latestVolume\": 20567140,\n \"volume\": 20567140,\n \"iexRealtimePrice\": 158.71,\n \"iexRealtimeSize\": 100,\n \"iexLastUpdated\": 1505851198059,\n \"delayedPrice\": 158.71,\n \"delayedPriceTime\": 1505854782437,\n \"oddLotDelayedPrice\": 158.70,\n \"oddLotDelayedPriceTime\": 1505854782436,\n \"extendedPrice\": 159.21,\n \"extendedChange\": -1.68,\n \"extendedChangePercent\": -0.0125,\n \"extendedPriceTime\": 1527082200361,\n \"previousClose\": 158.73,\n \"previousVolume\": 22268140,\n \"change\": -1.67,\n \"changePercent\": -0.01158,\n \"iexMarketPercent\": 0.00948,\n \"iexVolume\": 82451,\n \"avgTotalVolume\": 29623234,\n \"iexBidPrice\": 153.01,\n \"iexBidSize\": 100,\n \"iexAskPrice\": 158.66,\n \"iexAskSize\": 100,\n \"marketCap\": 751627174400,\n \"week52High\": 159.65,\n \"week52Low\": 93.63,\n \"ytdChange\": 0.3665,\n \"peRatio\": 17.18,\n \"lastTradeTime\": 1505779200000,\n \"isUSMarketOpen\": false}');\n\n $this->client = $this->setupMockedClient($this->response);\n }",
"public function testGetResponse()\n {\n $c = new Container;\n $this->assertInstanceOf('\\Psr\\Http\\Message\\ResponseInterface', $c['response']);\n }",
"public function testResponse() {\n $builder = new Builder();\n $response = $this->createMock(Response::class);\n\n $this->expectException(Exception::class);\n $builder->response($response);\n }",
"public function httpResponse(): Response;",
"public function setResponse(Response $response);",
"public function testModelResponseValidates()\n {\n // fake a response with valid \"foo\" and legally missing \"bar\" property\n $response = new Response(200, [], '{\"foo\":1}');\n $handlerStack = MockHandler::createWithMiddleware([$response]);\n $client = $this->createClient(['handler' => $handlerStack]);\n\n /** @var Result $response */\n $response = $client->test();\n // test value of \"foo\" key, which will exist\n $this->assertEquals(1, $response->offsetGet('foo'));\n // test value of \"bar\" key which isn't in response\n $this->assertEquals(null, $response->offsetGet('bar'));\n }",
"protected function setUp(): void\n {\n parent::setUp();\n\n $this->response = new Response(200, [], '[{\n \"date\" : \"2020-07-30\",\n \"symbol\" : \"AAPL\",\n \"eps\" : 0.650000000000000022,\n \"epsEstimated\" : 0.510000000000000009,\n \"time\" : \"amc\",\n \"revenue\" : 59685000000,\n \"revenueEstimated\" : 46829769230.7692337\n }, {\n \"date\" : \"2020-04-30\",\n \"symbol\" : \"AAPL\",\n \"eps\" : 0.640000000000000013,\n \"epsEstimated\" : 0.560000000000000053,\n \"time\" : \"amc\",\n \"revenue\" : 58313000000,\n \"revenueEstimated\" : 51023875000.0000076\n }, {\n \"date\" : \"2020-01-28\",\n \"symbol\" : \"AAPL\",\n \"eps\" : 1.25,\n \"epsEstimated\" : 1.1399999999999999,\n \"time\" : \"amc\",\n \"revenue\" : 91819000000,\n \"revenueEstimated\" : 83738928000\n }]');\n\n $this->client = $this->setupMockedClient($this->response);\n }",
"protected function setUp(): void\n {\n parent::setUp();\n\n $this->_response = new Response();\n }",
"public function __construct(TestResponse $response)\n {\n $this->response = new Response($response);\n }",
"public function getResponse(): Response;",
"abstract protected function getResponse(): ResponseInterface;",
"public function __construct($response);",
"public function response(): ResponseInterface;",
"public function __construct(Response $response)\n {\n $this->response = $response;\n $this->responseObject = json_decode($this->response->getContent());\n $this->accessor = PropertyAccess::getPropertyAccessor();\n }",
"public function __construct()\n {\n parent::__construct();\n $this->response->type('application/json; charset=UTF-8');\n }"
] | [
"0.6894981",
"0.67779636",
"0.67739135",
"0.67590564",
"0.6681143",
"0.65585226",
"0.65124446",
"0.6491523",
"0.6470365",
"0.64670694",
"0.6462795",
"0.64601773",
"0.6453054",
"0.6371712",
"0.6363034",
"0.63588625",
"0.6321671",
"0.6278008",
"0.62676156",
"0.6265114",
"0.62356323",
"0.6224769",
"0.6163553",
"0.61616015",
"0.615535",
"0.6140291",
"0.613691",
"0.613364",
"0.6125501",
"0.61217535"
] | 0.68366647 | 1 |
TODO: Implement enter() method. | public function enter(): void
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function onEnter($event) {}",
"public function onEntered($event) {}",
"public function onEnter()\n {\n $this->frameBuffer->setBackgroundFrame($this->pressStartFrame);\n $this->previousTime = 0;\n $this->enterTime = time();\n }",
"function entering()\n\t{\n\t\t$this->render();\n\t\tif( $this->open_count != $this->close_count )\n\t\t\tthrow new RuntimeException(\"unbalanced open()/close()\");\n\t}",
"static public function enter(){\n\t\t$log=LogManager::singleton();\n\t\tdebug::debug(\"LogManager enter\");\n\t\t$log->logEnter();\n\t}",
"public function entered(): bool;",
"public function afterEnter(AState $from) {\n \n parent::afterEnter($from);\n }",
"public function enteringAction() {\n\t\t$this->forward('index', array('type'=>2));\n\t\treturn FALSE;\n\t}",
"public function enter() {\n\t\t// check permissions\n\t\t$this->checkPermission(array('canViewLibrary', 'canEnterLibrary'));\n\n\t\t// refresh session\n\t\tWCF::getSession()->setLibraryID($this->libraryID);\n\n\t\t// change style if necessary\n\t\trequire_once(WCF_DIR . 'lib/system/style/StyleManager.class.php');\n\t\tif ($this->styleID && (!WCF::getSession()->getStyleID() || $this->enforceStyle) && StyleManager::getStyle()->styleID != $this->styleID) {\n\t\t\tStyleManager::changeStyle($this->styleID, true);\n\t\t}\n\t}",
"function startCase() {\n\t}",
"abstract public function activate();",
"public function action($stdin) {\n $key = trim(fgets($stdin));\n if ($key) {\n $key = $this->translateKeypress($key);\n echo chr(27).chr(91).'H'.chr(27).chr(91).'J'; //^[H^[J\n switch ($key) {\n case \"UP\":\n if ($this->positionX < 5 && $this->positionX > 1) {\n $this->positionX--;\n if($this->checkBonus($this->positionX,$this->positionY)){\n echo 'You win';die();\n };\n $this->render($this->positionX,$this->positionY);\n }else {\n echo 'Out of range';\n }\n break;\n case \"RIGHT\":\n if ($this->positionY < 6) {\n $this->positionY++;\n if($this->checkBonus($this->positionX,$this->positionY)){\n echo 'You win';die();\n };\n $this->render($this->positionX,$this->positionY);\n }else {\n echo 'Out of range';\n }\n break;\n case \"DOWN\":\n if ($this->positionX > 1 && $this->positionX < 5) {\n $this->positionX++;\n if($this->checkBonus($this->positionX,$this->positionY)){\n echo 'You win';die();\n };\n $this->render($this->positionX,$this->positionY);\n }else {\n echo 'Out of range';\n }\n break;\n default:\n die();\n }\n }\n }",
"public function run()\n\t{\n\t}",
"protected function enter($node)\n {\n // don't enter nodes inside a trait-decl\n if ($this->trait) return;\n \n parent::enter($node);\n }",
"public function current () {}",
"public function allowSubmitOnEnter(){\n $this->allowSubmitOnEnter = true;\n }",
"public function insert_entry()\n {\n }",
"public function eat()\n\t{\n\t}",
"public function eat()\n\t{\n\t}",
"public function begin(){}",
"function activate()\n\t{\n\t}",
"public function return() {\n\n\t}",
"private function Visit()\n\t{\n\t}",
"public function run()\n {\n parent::run();\n }",
"public function handle()\n {\n parent::handle();\n }",
"function GetEnterKeyCodeAction()\n {\n return \"EnterKeyCode\";\n }",
"abstract public function launching();",
"public function doHead(){ \n }",
"function in(/* $init */){\n $this->stack[] = $this->current(TRUE);\n if(func_num_args()>0) $this->_init(func_get_arg(0));\n return(TRUE);\n }",
"public function activate() {\n\t\t\t\n\t\t}"
] | [
"0.6767808",
"0.638355",
"0.62540007",
"0.61088306",
"0.59974134",
"0.58837295",
"0.5871814",
"0.5590976",
"0.54058814",
"0.5293653",
"0.5257176",
"0.5254618",
"0.52375746",
"0.5209087",
"0.52087945",
"0.51997393",
"0.51604164",
"0.5146805",
"0.5146805",
"0.5140345",
"0.51120424",
"0.50973797",
"0.5066758",
"0.5059141",
"0.50448686",
"0.5037208",
"0.5036775",
"0.50265443",
"0.502522",
"0.5014442"
] | 0.79292315 | 0 |
/ Retrieve a TripalRemoteResource object item for viewing details. Does not initiate connection to the remote resource | function tripal_remote_job_get_resource_details($resource_ID)
{
module_load_include('inc', 'tripal_remote_job', '/includes/TripalRemoteResource');
module_load_include('inc', 'tripal_remote_job', '/includes/TripalRemoteSSH');
#$resource = TripalRemoteResource::byID($resource_ID);
$resourceForType = TripalRemoteResource::byID($resource_ID);
$resource = TripalRemoteResource::getResource($resource_ID);
if ($resource->getType() == "alone") {
echo "Hostname: ".$resource->getHostname()."\n";
echo "Port: ".$resource->getSSHPort()."\n";
echo "Type: ".$resource->getType()."\n";
}
else {
"Resource specified is not an SSH/standalone server. Not sure how to proceed";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function object()\n {\n // Lazy-load the remote object if necessary\n if (!$this->object instanceof ObjectInterface) {\n // Instantiate the local object repository, load and return the object\n $this->object =\n Kernel::create(Service::class)->get($this->getUrl())->loadObject($this->getUrl()->getLocator());\n }\n\n return $this->object;\n }",
"public function retrieve()\n {\n $this->setApiController(self::PLAN_URL . $this->lookupPlanId);\n\n return $this->sendGetRequest();\n }",
"function item_get()\n {\n $key = $this->get('id');\n $result = $this->Receiving->get($key);\n if ($result != null)\n $this->response($result, 200);\n else\n $this->response(array('error' => 'Receiving item not found!'), 404);\n }",
"public function getRestOrderItem()\n {\n $restOrderItem = Mage::getModel('marketingsoftware/rest_order_item');\n $restOrderItem->setOrderItemEntity($this);\n \n return $restOrderItem; \n }",
"public static function byID($resource_id) {\n $sql = \"SELECT * FROM {tripal_remote_resource} WHERE resource_id = :resource_id\";\n $resource = db_query($sql, array(':resource_id' => $resource_id))->fetch(PDO::FETCH_ASSOC);\n if ($resource) {\n return new self($resource);\n }\n else {\n return NULL;\n }\n }",
"public function detail()\r\n {\r\n return $this->fetch();\r\n }",
"public static function getResource($resource_id) {\n $resource = NULL;\n\n module_load_include('inc', 'tripal_remote_job', '/includes/TripalRemoteResource');\n module_load_include('inc', 'tripal_remote_job', '/includes/TripalRemoteSSH');\n\n $res = TripalRemoteResource::byID($resource_id);\n if ($res) {\n // Get the resource type.\n $resource_type = $res->getType();\n\n // Get the resource.\n switch ($resource_type) {\n case 'alone' :\n $resource = TripalRemoteSSH::byID($resource_id);\n break;\n case 'pbs' :\n module_load_include('inc', 'tripal_remote_job', '/includes/TripalRemotePBS');\n $resource = TripalRemotePBS::byID($resource_id);\n break;\n case 'ge' :\n module_load_include('inc', 'tripal_remote_job', '/includes/TripalRemoteGE');\n $resource = TripalRemoteGE::byID($resource_id);\n break;\n case 'slurm' :\n module_load_include('inc', 'tripal_remote_job', '/includes/TripalRemoteSLURM');\n $resource = TripalRemoteSLURM::byID($resource_id);\n break;\n default :\n throw new Exception(\"Unsupported computational resource type: $resource_type.\");\n break;\n }\n }\n return $resource;\n }",
"public function getResource()\n {\n return $this->_resource;\n }",
"public function getResource()\n {\n return $this->grid->resource();\n }",
"public function resource()\n {\n return $this->resource;\n }",
"public function getResource()\n {\n return $this->resource;\n }",
"public function getResource()\n {\n return $this->resource;\n }",
"public function getResource()\n {\n return $this->resource;\n }",
"public function getResource()\n {\n return $this->resource;\n }",
"public function getResource()\n {\n return $this->resource;\n }",
"public function getResource()\n {\n return $this->resource;\n }",
"public function getResource()\n {\n return $this->resource;\n }",
"public function getResource()\n {\n return $this->resource;\n }",
"public function getResource()\n {\n return $this->resource;\n }",
"public function getResource() {\n return $this->resource;\n }",
"public function getResource() {\n return $this->resource;\n }",
"public function getResource() {\n return $this->resource;\n }",
"public function getResource() {\n return $this->resource;\n }",
"public function getResource() {\n return $this->resource;\n }",
"public function getResource() {\n return $this->resource;\n }",
"public function getResource() {\n return $this->resource;\n }",
"public function getResource() {\n return $this->resource;\n }",
"public function getResource() {\n return $this->resource;\n }",
"public function getItem()\n {\n return $this->get(self::ITEM);\n }",
"protected function getObject()\n\t{\n\t\treturn $this->object;\n\t}"
] | [
"0.57632655",
"0.57621384",
"0.56600463",
"0.5635439",
"0.5592705",
"0.5581688",
"0.5553275",
"0.5518323",
"0.54858196",
"0.54778767",
"0.54257894",
"0.54257894",
"0.54257894",
"0.54257894",
"0.54257894",
"0.54257894",
"0.54257894",
"0.54257894",
"0.54257894",
"0.53890556",
"0.53890556",
"0.53890556",
"0.5372262",
"0.5372262",
"0.5372262",
"0.5372262",
"0.5372262",
"0.5372262",
"0.5363948",
"0.5339093"
] | 0.59385836 | 0 |
sqlinc.php stores all of the SQL calls for the site limits redundancy as all SQL calls can be reviewed and managed in one place. | function maxDoc_inc_sql_inc(){
/**
* Place your custom functions below so you can upgrade common_inc.php without trashing
* your custom functions.
*
* An example function is commented out below as a documentation example
*
* View common_inc.php for many more examples of documentation and starting
* points for building your own functions!
*/
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sqlQueryLog($query) {\nglobal $CMS;\nglobal $database_CMS;\n$urlstring = addslashes($_SERVER['PHP_SELF']);\nif (!empty($_SERVER['QUERY_STRING'])) {\n$urlstring .= \"?\".addslashes($_SERVER['QUERY_STRING']);\n}\n\n#ipAddress tracking\n$systemDate = date (\"Y-m-d G:i:s\");\n$ipaddress = addslashes($_SERVER['REMOTE_ADDR']);\n$trackingSQL = sprintf(\"INSERT INTO sys_queries (userid, username, ipaddress, urlstring, mysqlquery, accesstime) VALUES (%s, %s, %s, %s, %s, %s)\",\n GetSQLValueString($_SESSION['userID'], \"text\"),\n GetSQLValueString($_SESSION['display_name'], \"text\"),\n GetSQLValueString($_SERVER['REMOTE_ADDR'], \"text\"),\n GetSQLValueString($_SERVER['PHP_SELF'], \"text\"),\n GetSQLValueString($query, \"text\"),\n GetSQLValueString($systemDate, \"text\"));\n\nmysql_select_db($database_CMS, $CMS);\n$Result6 = mysql_query($trackingSQL, $CMS) or die(mysql_error());\n}",
"function sqlexp(){\nglobal $log;\nif(!empty($_REQUEST['sqsrv']) && !empty($_REQUEST['sqlog']) && isset($_REQUEST['sqpwd']) && !empty($_REQUEST['sqquery']))\n{$sqlserv=$_REQUEST['sqsrv'];$sqlty=$_REQUEST['sqlty'];$pass=$_REQUEST['sqpwd'];$user=$_REQUEST['sqlog'];$query=$_REQUEST['sqquery'];\n$db=(empty($_REQUEST['sqdbn']))?'':$_REQUEST['sqdbn'];\n$_SESSION[sqlserv]=$_REQUEST['sqsrv'];$_SESSION[sqlty]=$_REQUEST['sqlty'];$_SESSION[qpwd]=$_REQUEST['sqpwd'];$_SESSION[userr]=$user;}\n\nif (isset ($_GET['select_db'])){$getdb=$_GET['select_db'];$_SESSION[db]=$getdb;$query=\"SHOW TABLES\";$res=sqlqu($_SESSION[sqlty],$_SESSION[sqlserv],$_SESSION[userr],$_SESSION[qpwd],$_SESSION[db],$query);}\nelseif (isset ($_GET[select_tbl])){$tbl=$_GET[select_tbl];$_SESSION[tbl]=$tbl;\n$query=\"SELECT * FROM `$tbl`\";$res=sqlqu($_SESSION[sqlty],$_SESSION[sqlserv],$_SESSION[userr],$_SESSION[qpwd],$_SESSION[db],$query);}\nelseif (isset ($_GET[drop_db])){\n$getdb=$_GET[drop_db];$_SESSION[db]=$getdb;$query=\"DROP DATABASE `$getdb`\";\nsqlqu($_SESSION[sqlty],$_SESSION[sqlserv],$_SESSION[userr],$_SESSION[qpwd],'',$query);\n$res=sqlqu($_SESSION[sqlty],$_SESSION[sqlserv],$_SESSION[userr],$_SESSION[qpwd],'','SHOW DATABASES');}\nelseif (isset ($_GET[drop_tbl])){$getbl=$_GET[drop_tbl];$query=\"DROP TABLE `$getbl`\";\nsqlqu($_SESSION[sqlty],$_SESSION[sqlserv],$_SESSION[userr],$_SESSION[qpwd],$_SESSION[db],$query);\n$res=sqlqu($_SESSION[sqlty],$_SESSION[sqlserv],$_SESSION[userr],$_SESSION[qpwd],$_SESSION[db],'SHOW TABLES');}\nelseif (isset ($_GET[drop_row])){$getrow=$_GET[drop_row];$getclm=$_GET[clm];$query=\"DELETE FROM `$_SESSION[tbl]` WHERE $getclm='$getrow'\";$tbl=$_SESSION[tbl];\nsqlqu($_SESSION[sqlty],$_SESSION[sqlserv],$_SESSION[userr],$_SESSION[qpwd],$_SESSION[db],$query);\n$res=sqlqu($_SESSION[sqlty],$_SESSION[sqlserv],$_SESSION[userr],$_SESSION[qpwd],$_SESSION[db],\"SELECT * FROM `$tbl`\");}\nelse$res=sqlqu($sqlty,$sqlserv,$user,$pass,$db,$query);\nif($res){$res=htmlspecialchars($res);$row=array ();$title=explode('*',$res);$trow=explode('-',$title[1]);$row=explode('-+',$title[0]);$data=array();$field=$trow[count($trow)-2];\nif (strstr($trow[0],'Database')!='')$obj='db';\nelseif (substr($trow[0],0,6)=='Tables')\n$obj='tbl';else$obj='row';$i=0;foreach ($row as $a){if($a!='')$data[$i++]=explode('+',$a);}\n\necho \"<table border=1 bordercolor='brown' cellpadding='2' bgcolor='silver' width='100%' style='border-collapse: collapse'><tr>\";\nforeach ($trow as $ti)echo \"<td bgcolor='brown'>$ti</td>\";echo \"</tr>\";$j=0;\nwhile ($data[$j]){echo \"<tr>\";foreach ($data[$j++] as $dr){echo \"<td>\";if($obj!='row') echo \"<a href='$php?do=db&select_$obj=$dr'>\";echo $dr;if($obj!='row') echo \"</a>\";echo \"</td>\";}echo \"<td><a href='$php?do=db&drop_$obj=$dr\";\nif($obj=='row')echo \"&clm=$field\";echo \"'>Drop</a></td></tr>\";}echo \"</table><br>\";}}",
"function do_query_resource($sql, $db='', $server=''){\n//\t$_SESSION['request']=$_SESSION['request']+1;\n\t$conx = mysql_con($server);\n\tif($db == '') { $db = MySql_Database;}\n\tmysql_select_db($db, $conx);\n\t$result = mysql_query($sql, $conx) or push_my_error(mysql_error());\n\tif($result){\n\t\t$out= $result; \n\t} else {\n\t\tglobal $MS_settings;\n\t\tif($MS_settings['debug_mode'] == 1){echo 'Error: '.$sql;}\n\t\t$out= false;\n\t}\n\treturn $out;\n}",
"public function load_all_sql() {\n\n $settings = $this->settings_lib->find_all();\n $latest_load = $this->sql_model->get_latest_load_time();\n if (!function_exists('loadSQLFiles'))\n {\n $this->load->helper('sql');\n }\n if (!function_exists('return_bytes'))\n {\n $this->load->helper('open_sports_toolkit/general');\n }\n if (isset($settings['osp.limit_load']) && $settings['osp.limit_load'] == 1) {\n\t\t\t$fileList = $this->sql_model->get_required_tables();\n\t\t} else {\n\t\t\t$fileList = getSQLFileList($settings['osp.sql_path'],$latest_load);\n\t\t}\n\t\t\n\t\t$files_loaded = array();\n $mess = loadSQLFiles($settings['osp.sql_path'],$latest_load, $fileList);\n\t\tif (!is_array($mess) || (is_array($mess) && sizeof($mess) == 0)) {\n\t\t\tif (is_array($mess)) {\n\t\t\t\t$status = \"An error occured processing the SQL files.\";\n\t\t\t} else {\n\t\t\t\t$status = \"error: \".$mess;\n\t\t\t}\n\t\t\tTemplate::set_message($status, 'error');\n\t\t} else {\n\t\t\tif (is_array($mess)) {\n\t\t\t\t$files_loaded = $mess;\n\t\t\t}\n\t\t\tTemplate::set_message('All tables were updated sucessfully.', 'success');\n\t\t\t$this->sql_model->set_tables_loaded($files_loaded);\n\t\t}\n\t\t$this->index();\n\t\t\n\t}",
"static function read_selectors(&$sql)\n {\n if (isset ($_REQUEST['doc_class']))\n {\n $sql .= 'doc_class = '.$_REQUEST['doc_class'][0].',';\n }\n if (isset ($_REQUEST['gpo']))\n {\n $sql .= 'gpo = '.$_REQUEST['gpo'][0].', ';\n }\n if (isset ($_REQUEST['security']))\n {\n $sql .= 'security = '.$_REQUEST['security'][0].', ';\n }\n if (isset ($_REQUEST['system']))\n {\n\t\t\t$sysnum = 0;\n foreach ($_REQUEST['system'] as $sys)\n {\n $sql .= 'syscode0'.$sysnum.' = '.$sys.', ';\n $sysnum++;\n\t\t\t}\n }\n if (isset ($_REQUEST['stand']))\n {\n\t\t\t$standnum = 0;\n foreach ($_REQUEST['stand'] as $stand)\n {\n $sql .= 'stand0'.$standnum.' = '.$stand.', ';\n $standnum++;\n\t\t\t}\n }\n if (isset ($_REQUEST['subjt']))\n {\n\t\t\t$subjtnum = 0;\n foreach ($_REQUEST['subjt'] as $subjt)\n {\n $sql .= 'subjt0'.$subjtnum.' = '.$subjt.', ';\n $subjtnum++;\n\t\t\t}\n }\n if (isset ($_REQUEST['topic']))\n {\n\t\t\t$topicnum = 0;\n foreach ($_REQUEST['topic'] as $topic)\n {\n $sql .= 'topic_code0'.$topicnum.' = '.$topic.', ';\n $topicnum++;\n\t\t\t}\n }\n\t}",
"function getSQL();",
"function debug_sql() {\n global $c_debug_sql;\n global $c_debug_sql_analyze;\n global $debuginfo;\n if ($c_debug_sql == 1) {\n echo \"<div class='centerbig'>\\n\";\n echo \"<div class='block'>\\n\";\n echo \"<div class='dataBlock'>\\n\";\n echo \"<div class='blockHeader'>SQL Debugging</div>\\n\";\n echo \"<div class='blockContent'>\\n\";\n echo \"<textarea rows=20 class='debugsql'>\";\n if (is_array($debuginfo)) {\n foreach ($debuginfo as $val) {\n echo \"$val\\n\";\n if ($c_debug_sql_analyze == 1) {\n $pattern = '/^SELECT.*$/';\n if (preg_match($pattern, $val)) {\n echo str_repeat(\"-\", 80) .\"\\n\";\n $sql = \"EXPLAIN ANALYZE $val\";\n $result = pg_query($sql);\n while ($row = pg_fetch_assoc($result)) {\n $stuff = $row[\"QUERY PLAN\"];\n echo \"$stuff\\n\";\n }\n echo str_repeat(\"-\", 80) .\"\\n\";\n }\n }\n echo \"\\n\";\n }\n }\n echo \"</textarea>\\n\";\n echo \"</div>\\n\"; #</blockContent>\n echo \"<div class='blockFooter'></div>\\n\";\n echo \"</div>\\n\"; #</dataBlock>\n echo \"</div>\\n\"; #</block>\n echo \"</div>\\n\"; #</centerbig>\n }\n}",
"public function get_sql();",
"function prepareSQL() {\n\t\t$sql = $this->sql;\n\n// was a separate method call once\n\t\tif (!$sql) { \n\t\t\t$sql = \"select $this->column from $this->table $this->joins $this->where\";\n\t\t}\n\t\tif ($this->orderby) \n\t\t{\n\t\t\t$sql .= \" order by \".$this->orderby. ' '. $this->sort_order;\n\t\t}\n\t\t\n\t\t$sql .= \" limit \".( ($this->startPage) * $this->rowsPerPage).\",\".$this->rowsPerPage;\n\n\t\treturn $sql;\n\t}",
"function _doQuery($sql)\n\t{\n\t\tglobal $sql_query;\n\t\t$sql_query = $sql;\n \t\treturn mysql_query($sql, db::getinstance('../../config.php'));\n\t}",
"public function sqlRef()\n {\n echo '<br/><pre>';\n echo \"SELECT:\\nSELECT `column1`, `column2` FROM `table` WHERE `column1` = 'value' GROUP BY `column1` ORDER BY `column2` LIMIT 2\\n\\n\";\n echo \"INSERT:\\nINSERT INTO `table` (`column1`, `column2`) VALUES (`value1`, `value2`) ON DUPLICATE KEY UPDATE `column1` = 'value'\\n\\n\";\n echo \"REPLACE:\\nREPLACE INTO `table` (`column1`, `column2`) VALUES ('value1', 'value2')\\n\\n\";\n echo \"DELETE:\\nDELETE FROM `table` WHERE `column` = 'value' ORDER BY `column` LIMIT 2\\n\\n\";\n echo \"UPDATE:\\nUPDATE `table` SET `column1` = 'value1', `column2` = 'value2' WHERE `column1` = 'value1' ORDER BY `column2` LIMIT 2\\n\\n\";\n echo \"LEFT JOINT:\\nSELECT `column` FROM `table1` LEFT JOIN (`table2`, `table3`) ON (`table2`.`column` = `table1`.`column` AND `table3`.`column` = `table1`.`column`)\";\n echo '</pre><br/>';\n }",
"function parse_exec_free($conn, $query, &$error_str)\n{\n global $firephp,$config,$guard_groups,$debug,$guard_username;\n\n //echo $query;\n\n if (substr_count($guard_groups, 'Administrators')==\"1\" && $config['debug']==true){\n //echo $query;\n $trace=debugPrintCallingFunction();\n $query_out = preg_replace(\"/[\\\\n\\\\r]+/\", \" \", $query);\n $query_out = preg_replace('/\\s+/', ' ', $query_out);\n // echo $query_out.\"<hr>\";\n ?>\n <script language=\"javascript\">\n console.log(<? echo json_encode($trace.\": \".$query_out); ?>)\n </script>\n <?php\n //ChromePhp::log($trace.\":\\r\\n\".$query_out);\n\n\n }\n $stmt = OCIParse($conn, $query);\n OCIExecute($stmt, OCI_DEFAULT);\n $err_array = OCIError($stmt);\n if ($err_array) {\n $err_message = $err_array['message'];\n $$error_str = $err_message;\n OCIFreeStatement($stmt);\n $stmt = FALSE;\n } else {\n OCIFreeStatement($stmt);\n $stmt = TRUE;\n }\n\n if ($_POST['rafid']!=''){\n $trace=debugPrintCallingFunction();\n $query2=\"INSERT INTO BSDS_RAF_LOG VALUES ('','\".$guard_username.\"',SYSDATE,'\".escape_sq($query).\"','\".$trace['file'].\"','\".substr($query,0,6).\"','\".$_POST['rafid'].\"')\";\n $stmt2 = OCIParse($conn, $query2);\n OCIExecute($stmt2, OCI_DEFAULT);\n $err_array2 = OCIError($stmt2);\n if ($err_array2) {\n OCIFreeStatement($stmt2);\n } else {\n OCIFreeStatement($stmt2);\n }\n }\n /*\n if ($guard_username==\"debon_l\"){\n $file = fopen(\"/var/www/html/queries_select.txt\",\"a\");\n fwrite($file,$query.\"\\r\\n------------ \".date(\"d-M-Y H:m:s\").\"\\r\\n\");\n fclose($file);\n }*/\n\n return $stmt;\n}",
"function parse_exec_fetch($conn, $query, &$error_str, &$res, $nulls=0)\n{\n global $firephp,$config,$guard_groups,$debug,$guard_username;\n if (substr_count($guard_groups, 'Administrators')==\"1\"){\n //echo $query.\"<br>\";\n }\n if (substr_count($guard_groups, 'Administrators')==\"1\" && $config['debug']==true){\n //echo $query;\n $trace=debugPrintCallingFunction();\n $query_out = preg_replace(\"/[\\\\n\\\\r]+/\", \" \", $query);\n $query_out = preg_replace('/\\s+/', ' ', $query_out);\n //echo $query_out.\"<hr>\";\n ?>\n <script language=\"javascript\">\n console.log(<? echo json_encode($trace.\": \".$query_out); ?>);\n </script>\n <?php\n \n //ChromePhp::log($trace.\":\\r\\n\".$query_out); \n }\n $stmt = OCIParse($conn, $query);\n OCIExecute($stmt, OCI_DEFAULT);\n $err_array = OCIError($stmt);\n if ($err_array) {\n $err_message = $err_array['message'];\n $$error_str = $err_message;\n\n OCIFreeStatement($stmt);\n $stmt = FALSE;\n } else {\n if ($nulls == 1) {\n OCIFetchStatement($stmt, $res, OCI_RETURN_NULLS);\n } else {\n OCIFetchStatement($stmt, $res);\n }\n }\n/*\n if ($guard_username==\"debon_l\"){\n $file = fopen(\"/var/www/html/queries_update.txt\",\"a\");\n fwrite($file,$query.\"\\r\\n------------ \".date(\"d-M-Y H:m:s\").\"\\r\\n\");\n fclose($file);\n }*/\n\n return $stmt;\n}",
"protected function sqlInit(){ }",
"function checkforSQLinjections() { \r\n if (is_array($_GET)) { foreach ($_GET as $key => $value) { $_GET[$key] = im_safe($value); } } \r\n if (is_array($_POST)) { foreach ($_POST as $key => $value) { $_POST[$key] = im_safe($value); } } \r\n // if (is_array($_SESSION)) { foreach ($_SESSION as $key => $value) { $_SESSION[$key] = im_safe($value); } } \r\n }",
"function DB_Maintenance($Conn)\n{\n\n #$TablesResult = DB_query('SHOW TABLES',$Conn);\n #while ($myrow = DB_fetch_row($TablesResult)){\n # $Result = DB_query('OPTIMIZE TABLE ' . $myrow[0],$Conn);\n #}\n\n #$Result = DB_query(\"UPDATE config\n # SET confvalue='\" . Date('Y-m-d') . \"'\n # WHERE confname='DB_Maintenance_LastRun'\",\n # $Conn);\n}",
"function load_sql() \n\t{\n\t\t//$this->getURIData();\n $this->auth->restrict('League_Manager.SQL.Manage');\n\n if (!function_exists('loadSQLFiles')) \n\t\t{\n $this->load->helper('sql');\n }\n if (!function_exists('return_bytes')) \n\t\t{\n $this->load->helper('open_sports_toolkit/general');\n }\n $settings = $this->settings_lib->find_all();\n Template::set('settings', $settings);\n\n $files_loaded = array();\n\t\t$required_tables = $this->sql_model->get_required_tables();\n\t\t\n $file = $this->uri->segment(5);\n\t\tif ($this->filename == null && isset($file) && !empty($file))\n\t\t{\n\t\t\t$this->filename = $file;\n\t\t\t//print (\"Filename: \".$this->filename.\"<br />\");\n\t\t}\n $latest_load = $this->sql_model->get_latest_load_time();\n $fileList = false;\n if ($this->input->post('submit'))\n\t\t{\n\t\t\tif (isset($_POST['loadList']) && sizeof($_POST['loadList']) > 0)\n\t\t\t{\n\t\t\t\t$fileList = $_POST['loadList'];\n\t\t\t}\n else if (isset($settings['osp.limit_load']) && $settings['osp.limit_load'] == 1)\n {\n $fileList = $required_tables;\n }\n else\n {\n $fileList = getSQLFileList($settings['osp.sql_path'],$latest_load);\n }\n }\n else if (isset($this->filename) && !empty($this->filename))\n {\n $fileList = array($this->filename);\n }\n if ($fileList !== false && is_array($fileList) && sizeof($fileList) > 0) {\n\t\t\t$mess = loadSQLFiles($settings['osp.sql_path'],$latest_load, $fileList, $settings['osp.sql_timeout']);\n\t\t\tif (!is_array($mess) || (is_array($mess) && sizeof($mess) == 0))\n\t\t\t{\n\t\t\t\tif (is_array($mess))\n\t\t\t\t{\n\t\t\t\t\t$status = \"Errors occured processing the SQL files:<br />\";\n foreach ($mess as $error) {\n $status .= $mess.\"<br />\";\n }\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$status = \"error: \".$mess;\n\t\t\t\t}\n Template::set_message('$mess', 'error');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (is_array($mess))\n\t\t\t\t{;\n $files_loaded = $mess;\n\t\t\t\t}\n\t\t\t\tTemplate::set_message(\"All tables were updated sucessfully.\", 'success');\n\t\t\t\t$this->sql_model->set_tables_loaded($files_loaded);\n\t\t\t}\n\t\t}\n\n\t\t$file_list = getSQLFileList($settings['osp.sql_path']);\n\n\t\tAssets::add_module_css('league_manager','style.css');\n\t\t//Assets::add_js(module_path('league_manager').'/views/custom/file_list_js.js','external');\n\t\t//Assets::add_js($this->load->view('custom/file_list_js',null,true),'inline');\n\t\tTemplate::set('file_list', $file_list);\n\t\tTemplate::set('missing_files', $this->sql_model->validate_loaded_files($file_list));\n\t\tTemplate::set('load_times', $this->sql_model->get_tables_loaded());\n\t\tTemplate::set('files_loaded', $files_loaded);\n\t\tTemplate::set('required_tables', $required_tables);\n\t\tTemplate::set('toolbar_title', lang('sql_settings_title'));\n Template::set_view('league_manager/custom/file_list');\n Template::render();\n\t}",
"function db_query($sql)\n{\n\tglobal $db_var;\n\tglobal $tiddlyCfg;\n\t//make query\n\t\tdebug($sql, \"mysql\");\n\t\t\n\t//print $sql;\n\t$SQLR=mysql_query($sql);\n\t\n\tif($SQLR===FALSE)\n\t{\n\t\t\n\t\tdb_logerror($db_var['error']['queryErr'], $db_var['settings']['defaultStop'],\n\t\t\t$db_var['error']['queryErr'].\"(\".$db_var['error']['query'].$sql.$db_var['error']['error'].mysql_error().\")\");\n\t\treturn FALSE;\n\t}\n\t\n\treturn $SQLR;\t\t\t\t\t//return data in array\n}",
"function fDefineSql($pTabla){\n\tglobal $db, $appStatus;\n\t$slSql = \"\";\n\t$slAction = fGetParam('pAction', false);\n \t$olFields = $db->MetaColumns($pTabla);\n \t$slDefs= $_SESSION[$pTabla . '_defs'];\n//\tprint_r($olFields);\n//\tprint_r($_GET);\n\t//print_r($_POST);\n\t//$slTipo = $db->MetaType($olField->type);\n\tswitch ($slAction){\n\t case \"REP\":\n\t\tcase \"ADD\":\n\t\t\t$slValues = \"\";\n\t\t\t$slFields = \"\";\n\t\t\t$il = 0;\n\t\t\t$id =0;\n\t\t\tforeach ($olFields as $k => $olField) {\n\t\t\t\t$slTxt = \" : \" . $olField->type . \" / \" . $slValue . \"\\n\\r\";\n\t\t\t\tfSetAppStat(10, 'I', $slTxt);\n\t\t\t\tif ($slAction == \"ADD\" && ($olField->auto_increment || (($olField->type == 'datestamp' || $olField->type == 'timestamp' ) ))) { /* && !isset($slDefs[$olField->name])*/ \n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\t//echo \"\\n\\r tipo: \" . $olField->name . \" / \" . $olField->type . \" -- \" . $slTipo .\"\\n\\r\"; print_r($slTipo);\n\t\t\t\t\t//echo $slDefs[$olField->name];\n\t\t\t\t\tif (isset($slDefs[$olField->name])) {\n\t\t\t\t\t\tif (substr($slDefs[$olField->name],0,1) == \"@\") {\n\t\t\t\t\t\t\t$slValue =eval(substr($slDefs[$olField->name],1));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$slValue =$slDefs[$olField->name];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else $slValue = fGetParam($olField->name, '@@noDef@');\n\t\t\t\t\t$slTxt = \" : \" . $olField->type . \" / \" . $slValue . \"\\n\\r\";\n\t\t\t\t\tfSetAppStat(10, 'I', $slTxt);\n\t\t\t\t\tif ($slValue !='@@noDef@' ) {\n\t\t\t\t\t $slValue = fParseValue($olField->type, $slValue);\n\t\t\t\t\t $slFields .= ((strlen ($slFields) >0) ? \",\" : \"\") . \" \" . $olField->name;\n\t\t\t\t\t $slValues .= ((strlen ($slValues)>0) ? \",\" : \"\") . $slValue;\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t\t\t//\t\t\t echo $slSql .\"\\n\";\n\t\t\t$il ++;\n\t\t\t}\n\t\t\tif ($il > 0) {\n\t\t\t $slSql = (($slAction ==\"ADD\") ? \" INSERT \" : \" REPLACE \" ) . \" INTO $pTabla (\" . $slFields . \") VALUES (\" . $slValues . \")\" ;\n\t\t\t}\n//echo $slSql .\"\\n\";\n\t\t\tbreak;\n case \"UPD\":\n\t\t\t\t$slValues = \"\";\n\t\t\t\t$il = 0;\n\t\t\t\tforeach ($olFields as $olField){\n\t\t\t\t\t$slValue = fGetParam($olField->name, '@@noDef@');\n\t\t\t\t\tif ($slValue !='@@noDef@' ) {\n\t\t\t\t\t\t\t$slValue = fParseValue($olField->type, $slValue);\n\t\t\t\t\t\t\t$slSql \t .= ((strlen ($slSql) >0) ? \",\" : \"\") . \" \" .\n\t\t\t\t\t\t\t\t\t $olField->name . \" = \" . $slValue ;\n\t\t\t\t\t\t$il ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$slCond = fPrimaryKeyString($olFields,$pTabla);\n\t\t\t\t$slSql = \"UPDATE $pTabla SET \" . $slSql . \" WHERE \" . $slCond ;\n\t\t\t\tbreak;\n case \"DEL\":\n\t\t\t\t$slValues = \"\";\n\t\t\t\t$slCond = fPrimaryKeyString($olFields,$pTabla);\n\t\t\t\t$slSql .= \"DELETE FROM $pTabla WHERE \". $slCond;\n\t\t\t\tbreak;\n\t}\n//echo $slSql. \" :::\";\n\treturn $slSql;\n}",
"function update_332012() { \n\n\t\t/* Clean Up Indexes */\n\n\t\t// Prevent the script from timing out\n\t\tset_time_limit(0);\n\n\t\t// Access List\n\t\t$sql = \"ALTER TABLE `access_list` DROP INDEX `ip`\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t$sql = \"ALTER TABLE `access_list` ADD INDEX `start` (`start`)\";\n\t\t$db_results = mysql_query($sql, dbh());\n\t\t\n\t\t$sql = \"ALTER TABLE `access_list` ADD INDEX `end` (`end`)\"; \n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t$sql = \"ALTER TABLE `access_list` ADD INDEX `level` (`level`)\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t$sql = \"ALTER TABLE `access_list` ADD `type` VARCHAR( 64 ) NOT NULL DEFAULT 'interface' AFTER `level`\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t// Album Table\n\t\t$sql = \"ALTER TABLE `album` DROP INDEX `id`\";\n\t\t$db_results = mysql_query($sql, dbh());\n\t\n\t\t$sql = \"ALTER TABLE `album` ADD INDEX `year` (`year`)\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t// Artist Table\n\t\t$sql = \"ALTER TABLE `artist` DROP INDEX `id`\";\n\t\t$db_results = mysql_query($sql, dbh()); \n\n\t\t// Flagged\n\t\t$sql = \"ALTER TABLE `flagged` ADD INDEX `object_id` (`object_id`)\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t$sql = \"ALTER TABLE `flagged` ADD INDEX `object_type` (`object_type`)\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t$sql = \"ALTER TABLE `flagged` ADD INDEX `user` (`user`)\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t// Genre\n\t\t$sql = \"ALTER TABLE `genre` ADD INDEX `name` (`name`)\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t// IP Tracking\n\t\t$sql = \"ALTER TABLE `ip_history` ADD INDEX `ip` (`ip`)\";\n\t\t$db_results = mysql_query($sql,dbh());\n\n\t\t$sql = \"ALTER TABLE `ip_history` CHANGE `username` `user` VARCHAR( 128 ) NULL DEFAULT NULL\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t$sql = \"ALTER TABLE `ip_history` ADD `id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t$sql = \"ALTER TABLE `ip_history` DROP `connections`\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\n\t\t// Live Stream\n\t\t$sql = \"ALTER TABLE `live_stream` ADD INDEX `name` (`name`)\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t$sql = \"ALTER TABLE `live_stream` ADD INDEX `genre` (`genre`)\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t$sql = \"ALTER TABLE `live_stream` ADD INDEX `catalog` (`catalog`)\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t// Object_count\n\t\t$sql = \"ALTER TABLE `object_count` CHANGE `object_type` `object_type` ENUM( 'album', 'artist', 'song', 'playlist', 'genre', 'catalog', 'live_stream', 'video' ) NOT NULL DEFAULT 'song'\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t// Playlist\n\t\t$sql = \"ALTER TABLE `playlist` DROP INDEX `id`\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t$sql = \"ALTER TABLE `playlist` ADD INDEX `type` (`type`)\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t// Preferences\n\t\t$sql = \"ALTER TABLE `preferences` ADD INDEX `catagory` (`catagory`)\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t$sql = \"ALTER TABLE `preferences` ADD INDEX `name` (`name`)\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t// Session\n\t\t$sql = \"ALTER TABLE `session` ADD INDEX `expire` (`expire`)\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t// Song\n\t\t$sql = \"ALTER TABLE `song` DROP INDEX `id`\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t// User_catalog\n\t\t$sql = \"ALTER TABLE `user_catalog` ADD `id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t$sql = \"ALTER TABLE `user_catalog` ADD INDEX `user` (`user`)\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t$sql = \"ALTER TABLE `user_catalog` ADD INDEX `catalog` (`catalog`)\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t// User_preference\n\t\t$sql = \"ALTER TABLE `user_preference` DROP INDEX `user_2`\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t$sql = \"ALTER TABLE `user_preference` DROP INDEX `preference_2`\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t// Preferences, remove colors,font,font-size\n\t\t$sql = \"DELETE FROM preferences WHERE `catagory`='theme' AND `name` !='theme_name'\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\t$sql = \"UPDATE preferences SET `catagory`='interface' WHERE `catagory`='theme'\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n /* Fix every users preferences */\n $sql = \"SELECT * FROM user\";\n $db_results = mysql_query($sql, dbh());\n\n $user = new User();\n $user->fix_preferences('-1');\n\n while ($r = mysql_fetch_assoc($db_results)) {\n $user->username_fix_preferences($r['username']);\n } // while results\n\n\t\t$this->set_version('db_version','332012');\n\n\t}",
"function reset_sql() {\n global $select, $table, $where, $group, $order;\n global $sql_select, $sql_from, $sql_where, $sql_group, $sql_order;\n $select = array();\n $sql_select = \"\";\n $table = array();\n $sql_from = \"\";\n $where = array();\n $sql_where = \"\";\n $group = array();\n $sql_group = \"\";\n $order = array();\n $sql_order = \"\";\n}",
"function excuteSQL($sql) {\n\trequire dirname(__FILE__) . '/config/config_db.php';\n\tmysql_connect($config_db['server'], $config_db['username'], $config_db['password']);\n\tmysql_select_db($config_db['database']);\n\tmysql_query('set names utf8');\n\tmysql_query($sql);\n\t$idInserted = 0;\n\tif (strpos($sql, 'insert') >= 0) {\n\t\t$idInserted = mysql_insert_id();\n\t}\n\tmysql_close();\n\treturn $idInserted;\n}",
"function portal_debug_query() {\n\n\tmystery_debug_query('portal_dbh');\n\n}",
"function sec_log($sql)\n{\n $sql = strip_tags(trim(preg_replace(\"/(from|select|insert|delete|where|drop table|show tables|,|'|#|\\*|--|\\\\\\\\)/i\",\"\",$sql)));\n if(!get_magic_quotes_gpc())\n $sql = addslashes($sql);\n return $sql;\n}",
"function doNoSQL($sql) {\n\t\t\t\ttry {\n\t\t\t\t\t\t$this->dbConnect();\n\t\t\t\t\t\tif(DEBUG_MODE)$affect=mysql_query($sql) or die(mysql_error().\": \".$sql);\n\t\t\t\t\t\telse $affect=mysql_query($sql) or die(\"Query has error\");\n\n\t\t\t\t\t\treturn $affect;\n\t\t\t\t}catch (Exception $ex) {\n\n\t\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}",
"function sql() {\n\n global $sqlaction,$sv_s,$sv_d,$drp_tbl,$g_fp,$file_type,$dbbase,$f_nm;\n\n $secu_config=\"xtdump_conf.inc.php\";\n\n $dbhost=$_POST['dbhost'];\n\n $dbuser=$_POST['dbuser'];\n\n $dbpass=$_POST['dbpass'];\n\n $dbbase=$_POST['dbbase'];\n\n $tbls =$_POST['tbls'];\n\n $sqlaction =$_POST['sqlaction'];\n\n $secu =$_POST['secu'];\n\n $f_cut =$_POST['f_cut'];\n\n $fz_max =$_POST['fz_max'];\n\n $opt =$_POST['opt'];\n\n $savmode =$_POST['savmode'];\n\n $file_type =$_POST['file_type'];\n\n $ecraz =$_POST['ecraz'];\n\n $f_tbl =$_POST['f_tbl'];\n\n $drp_tbl=$_POST['drp_tbl'];\n\n\n\n $header=\"<center><table width=620 cellpadding=0 cellspacing=0 align=center><col width=1><col width=600><col width=1><tr><td></td><td align=left class=texte><br>\";\n\n $footer=\"<center><a href='javascript:history.go(-1)' target='_self' class=link>-go back-</a><br></center><br></td><td></td></tr><tr><td height=1 colspan=3></td></tr></table></center>\".nfm_copyright();\n\n\n\n // SQL actions STARTS\n\n\n\n if ($sqlaction=='save') {\n\n if ($secu==1) {\n\n $fp=fopen($secu_config,\"w\");\n\n fputs($fp,\"<?php\\n\");\n\n fputs($fp,\"\\$dbhost='$dbhost';\\n\");\n\n fputs($fp,\"\\$dbbase='$dbbase';\\n\");\n\n fputs($fp,\"\\$dbuser='$dbuser';\\n\");\n\n fputs($fp,\"\\$dbpass='$dbpass';\\n\");\n\n fputs($fp,\"?>\");\n\n fclose($fp);\n\n }\n\n if (!is_array($tbls)) {\n\n echo $header.\"<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=windows-1251\\\">\n\n<br><center><font color=red>You forgot to check tables, which you need to dump =)</b></font></center>\\n$footer\";\n\n exit;\n\n }\n\n if($f_cut==1) {\n\n if (!is_numeric($fz_max)) {\n\n echo $header.\"<br><center><font color=red><b>Veuillez choisir une valeur numÊrique Á la taille du fichier Á scinder.</b></font></center>\\n$footer\";\n\n exit;\n\n }\n\n if ($fz_max < 200000) {\n\n echo $header.\"<br><center><font color=red><b>Veuillez choisir une taille de fichier a scinder sup\n\n rieure Á 200 000 Octets.</b></font></center>\\n$footer\";\n\n exit;\n\n }\n\n }\n\n\n\n $tbl=array();\n\n $tbl[]=reset($tbls);\n\n if (count($tbls) > 1) {\n\n $a=true;\n\n while ($a !=false) {\n\n $a=next($tbls);\n\n if ($a !=false) { $tbl[]=$a; }\n\n }\n\n }\n\n\n\n if ($opt==1) { $sv_s=true; $sv_d=true; }\n\n else if ($opt==2) { $sv_s=true;$sv_d=false;$fc =\"_struct\"; }\n\n else if ($opt==3) { $sv_s=false;$sv_d=true;$fc =\"_data\"; }\n\n else { exit; }\n\n\n\n $fext=\".\".$savmode;\n\n $fich=$dbbase.$fc.$fext;\n\n $dte=\"\";\n\n if ($ecraz !=1) { $dte=date(\"dMy_Hi\").\"_\"; } $gz=\"\";\n\n if ($file_type=='1') { $gz.=\".gz\"; }\n\n $fcut=false;\n\n $ftbl=false;\n\n $f_nm=array();\n\n if($f_cut==1) { $fcut=true;$fz_max=$fz_max;$nbf=1;$f_size=170;}\n\n if($f_tbl==1) { $ftbl=true; }\n\n else {\n\n if(!$fcut) { open_file(\"dump_\".$dte.$dbbase.$fc.$fext.$gz); }\n\n else { open_file(\"dump_\".$dte.$dbbase.$fc.\"_1\".$fext.$gz); }\n\n }\n\n\n\n $nbf=1;\n\n mysql_connect($dbhost,$dbuser,$dbpass);\n\n mysql_select_db($dbbase);\n\n if ($fext==\".sql\") {\n\n if ($ftbl) {\n\n while (list($i)=each($tbl)) {\n\n $temp=sqldumptable($tbl[$i]);\n\n $sz_t=strlen($temp);\n\n if ($fcut) {\n\n open_file(\"dump_\".$dte.$tbl[$i].$fc.\".sql\".$gz);\n\n $nbf=0;\n\n $p_sql=split_sql_file($temp);\n\n while(list($j,$val)=each($p_sql)) {\n\n if ((file_pos()+6+strlen($val)) < $fz_max) { write_file($val.\";\"); }\n\n else { close_file(); $nbf++; open_file(\"dump_\".$dte.$tbl[$i].$fc.\"_\".$nbf.\".sql\".$gz); write_file($val.\";\"); }\n\n }\n\n close_file();\n\n }\n\n else { open_file(\"dump_\".$dte.$tbl[$i].$fc.\".sql\".$gz);write_file($temp.\"\\n\\n\");close_file();$nbf=1; }\n\n $tblsv=$tblsv.\"<b>\".$tbl[$i].\"</b>,<br>\";\n\n }\n\n } else {\n\n $tblsv=\"\";\n\n while (list($i)=each($tbl)) {\n\n $temp=sqldumptable($tbl[$i]);\n\n $sz_t=strlen($temp);\n\n if ($fcut && ((file_pos()+$sz_t) > $fz_max)) {\n\n $p_sql=split_sql_file($temp);\n\n while(list($j,$val)=each($p_sql)) {\n\n if ((file_pos()+6+strlen($val)) < $fz_max) { write_file($val.\";\"); }\n\n else {\n\n close_file();\n\n $nbf++;\n\n open_file(\"dump_\".$dte.$dbbase.$fc.\"_\".$nbf.\".sql\".$gz);\n\n write_file($val.\";\");\n\n }\n\n }\n\n } else { write_file($temp); }\n\n $tblsv=$tblsv.\"<b>\".$tbl[$i].\"</b>,<br>\";\n\n }\n\n }\n\n }\n\n else if ($fext==\".csv\") {\n\n if ($ftbl) {\n\n while (list($i)=each($tbl)) {\n\n $temp=csvdumptable($tbl[$i]);\n\n $sz_t=strlen($temp);\n\n if ($fcut) {\n\n open_file(\"dump_\".$dte.$tbl[$i].$fc.\".csv\".$gz);\n\n $nbf=0;\n\n $p_csv=split_csv_file($temp);\n\n while(list($j,$val)=each($p_csv)) {\n\n if ((file_pos()+6+strlen($val)) < $fz_max) { write_file($val.\"\\n\"); }\n\n else {\n\n close_file();\n\n $nbf++;\n\n open_file(\"dump_\".$dte.$tbl[$i].$fc.\"_\".$nbf.\".csv\".$gz);\n\n write_file($val.\"\\n\");\n\n }\n\n }\n\n close_file();\n\n } else {\n\n open_file(\"dump_\".$dte.$tbl[$i].$fc.\".csv\".$gz);\n\n write_file($temp.\"\\n\\n\");\n\n close_file();\n\n $nbf=1;\n\n }\n\n $tblsv=$tblsv.\"<b>\".$tbl[$i].\"</b>,<br>\";\n\n }\n\n } else {\n\n while (list($i)=each($tbl)) {\n\n $temp=csvdumptable($tbl[$i]);\n\n $sz_t=strlen($temp);\n\n if ($fcut && ((file_pos()+$sz_t) > $fz_max)) {\n\n $p_csv=split_sql_file($temp);\n\n while(list($j,$val)=each($p_csv)) {\n\n if ((file_pos()+6+strlen($val)) < $fz_max) { write_file($val.\"\\n\"); }\n\n else {\n\n close_file();\n\n $nbf++;\n\n open_file(\"dump_\".$dte.$dbbase.$fc.\"_\".$nbf.\".csv\".$gz);\n\n write_file($val.\"\\n\");\n\n }\n\n }\n\n } else { write_file($temp); }\n\n $tblsv=$tblsv.\"<b>\".$tbl[$i].\"</b>,<br>\";\n\n }\n\n }\n\n }\n\n\n\n mysql_close();\n\n if (!$ftbl) { close_file(); }\n\n\n\n echo $header;\n\n echo \"<br><center>All the data in these tables:<br> \".$tblsv.\" were putted to this file:<br><br></center><table border='0' align='center' cellpadding='0' cellspacing='0'><col width=1 bgcolor='#2D7DA7'><col valign=center><col width=1 bgcolor='#2D7DA7'><col valign=center align=right><col width=1 bgcolor='#2D7DA7'><tr><td bgcolor='#2D7DA7' colspan=5></td></tr><tr><td></td><td bgcolor='#338CBD' align=center class=texte><font size=1><b>File</b></font></td><td></td><td bgcolor='#338CBD' align=center class=texte><font size=1><b>Size</b></font></td><td></td></tr><tr><td bgcolor='#2D7DA7' colspan=5></td></tr>\";\n\n reset($f_nm);\n\n while (list($i,$val)=each($f_nm)) {\n\n $coul='#99CCCC';\n\n if ($i % 2) { $coul='#CFE3E3'; }\n\n echo \"<tr><td></td><td bgcolor=\".$coul.\" class=texte> <a href='\".$val.\"' class=link target='_blank'>\".$val.\" </a></td><td></td>\";\n\n $fz_tmp=filesize($val);\n\n if ($fcut && ($fz_tmp > $fz_max)) {\n\n echo \"<td bgcolor=\".$coul.\" class=texte> <font size=1 color=red>\".$fz_tmp.\" Octets</font> </td><td></td></tr>\";\n\n } else {\n\n echo \"<td bgcolor=\".$coul.\" class=texte> <font size=1>\".$fz_tmp.\" bites</font> </td><td></td></tr>\";\n\n }\n\n echo \"<tr><td bgcolor='#2D7DA7' colspan=5></td></tr>\";\n\n }\n\n echo \"</table><br>\";\n\n echo $footer;exit;\n\n }\n\n\n\n if ($sqlaction=='connect') {\n\n if(!@mysql_connect($dbhost,$dbuser,$dbpass)) {\n\n echo $header.\"<br><center><font color=red><b>Unable to connect! Check your data input!</b></font></center>\\n$footer\";\n\n exit;\n\n }\n\n\n\n if(!@mysql_select_db($dbbase)) {\n\n echo $header.\"<br><center><font color=red><<b>Unable to connect! Check your data input!</b></font></center>\\n$footer\";\n\n exit;\n\n }\n\n\n\n if ($secu==1) {\n\n if (!file_exists($secu_config)) {\n\n $fp=fopen($secu_config,\"w\");\n\n fputs($fp,\"<?php\\n\");\n\n fputs($fp,\"\\$dbhost='$dbhost';\\n\");\n\n fputs($fp,\"\\$dbbase='$dbbase';\\n\");\n\n fputs($fp,\"\\$dbuser='$dbuser';\\n\");\n\n fputs($fp,\"\\$dbpass='$dbpass';\\n\");\n\n fputs($fp,\"?>\");\n\n fclose($fp);\n\n }\n\n include($secu_config);\n\n } else {\n\n if (file_exists($secu_config)) { unlink($secu_config); }\n\n }\n\n\n\n mysql_connect($dbhost,$dbuser,$dbpass);\n\n $tables=mysql_list_tables($dbbase);\n\n $nb_tbl=mysql_num_rows($tables);\n\n\n\n echo $header.\"<script language='javascript'> function checkall() { var i=0;while (i < $nb_tbl) { a='tbls['+i+']';document.formu.elements[a].checked=true;i=i+1;} } function decheckall() { var i=0;while (i < $nb_tbl) { a='tbls['+i+']';document.formu.elements[a].checked=false;i=i+1;} } </script><center><br><b>Choose tables you need to dump!</b><form action='' method='post' name=formu><input type='hidden' name='sqlaction' value='save'><input type='hidden' name='dbhost' value='$dbhost'><input type='hidden' name='dbbase' value='$dbbase'><input type='hidden' name='dbuser' value='$dbuser'><input type='hidden' name='dbpass' value='$dbpass'><DIV ID='infobull'></DIV><table border='0' width='400' align='center' cellpadding='0' cellspacing='0' class=texte><col width=1 bgcolor='#2D7DA7'><col width=30 align=center valign=center><col width=1 bgcolor='#2D7DA7'><col width=350> <col width=1 bgcolor='#2D7DA7'><tr><td bgcolor='#2D7DA7' colspan=5></td></tr><tr><td></td><td bgcolor='#336699'><input type='checkbox' name='selc' alt='Check all' onclick='if (document.formu.selc.checked==true){checkall();}else{decheckall();}')\\\"></td><td></td><td bgcolor='#338CBD' align=center><B>Table names</b></td><td></td></tr><tr><td bgcolor='#2D7DA7' colspan=5></td></tr>\";\n\n\n\n $i=0;\n\n while ($i < mysql_num_rows ($tables)) {\n\n $coul='#99CCCC';\n\n if ($i % 2) { $coul='#CFE3E3';}\n\n $tb_nom=mysql_tablename ($tables,$i);\n\n echo \"<tr><td></td><td bgcolor='\".$coul.\"'><input type='checkbox' name='tbls[\".$i.\"]' value='\".$tb_nom.\"'></td><td></td><td bgcolor='\".$coul.\"'> \".$tb_nom.\"</td><td></td></tr><tr><td bgcolor='#2D7DA7' colspan=5></td></tr>\";\n\n $i++;\n\n }\n\n\n\n mysql_close();\n\n echo \"</table><br><br><table align=center border=0><tr><td align=left class=texte> <hr> <input type='radio' name='savmode' value='csv'>\n\n Save to csv (*.<i>csv</i>)<br> <input type='radio' name='savmode' value='sql' checked>\n\n Save to Sql (*.<i>sql</i>)<br> <hr> <input type='radio' name='opt' value='1' checked>\n\n Save structure and data<br> <input type='radio' name='opt' value='2'>\n\n Save structure only<br> <input type='radio' name='opt' value='3'>\n\n Save data only<br> <hr> <input type='Checkbox' name='drp_tbl' value='1' checked>\n\n Rewrite file if exists<br> <input type='Checkbox' name='ecraz' value='1' checked>\n\n Clear database after dump<br> <input type='Checkbox' name='f_tbl' value='1'>\n\n Put each table to a separate file<br> <input type='Checkbox' name='f_cut' value='1'>\n\n Maximum dump-file size: <input type='text' name='fz_max' value='200000' class=form>\n\n Octets<br> <input type='Checkbox' name='file_type' value='1'>\n\n Gzip.<br>\n\n </td></tr></table><br><br><input type='submit' value=' Dump:) ' class=form></form></center>$footer\";\n\n exit;\n\n }\n\n\n\n// SQL actions END\n\n\n\n if(file_exists($secu_config)) {\n\n include ($secu_config);\n\n $ck=\"checked\";\n\n } else {\n\n $dbhost=\"localhost\";\n\n $dbbase=\"\";\n\n $dbuser=\"root\";\n\n $dbpass=\"\";\n\n $ck=\"\";\n\n }\n\n\n\n echo $header.\"\n\n<center><br><br>\n\n<table width=620 cellpadding=0 cellspacing=0 align=center>\n\n <col width=1>\n\n <col width=600>\n\n <col width=1>\n\n <tr>\n\n <td></td>\n\n <td align=left class=texte>\n\n <br>\n\n <form action='' method='post'>\n\n <input type='hidden' name='sqlaction' value='connect'>\n\n <table border=0 align=center>\n\n <col>\n\n <col align=left>\n\n <tr>\n\n <td colspan=2 align=center style='font:bold 9pt;font-family:verdana;'>Enter data to connect to MySQL server!<br><br></td>\n\n </tr>\n\n <tr>\n\n <td class=texte>Server address:</td>\n\n <td><INPUT TYPE='TEXT' NAME='dbhost' SIZE='30' VALUE='localhost' class=form></td>\n\n </tr>\n\n <tr>\n\n <td class=texte>Base name:</td>\n\n <td><INPUT TYPE='TEXT' NAME='dbbase' SIZE='30' VALUE='' class=form></td>\n\n </tr>\n\n <tr>\n\n <td class=texte>Login:</td>\n\n <td><INPUT TYPE='TEXT' NAME='dbuser' SIZE='30' VALUE='root' class=form></td>\n\n </tr>\n\n <tr>\n\n <td class=texte>Password</td>\n\n <td><INPUT TYPE='Password' NAME='dbpass' SIZE='30' VALUE='' class=form></td>\n\n </tr>\n\n </table>\n\n <br> <center> <br><br>\n\n <input type='submit' value=' Connect ' class=form></center> </form> <br><br>\n\n </td>\n\n <td></td>\n\n </tr>\n\n <tr>\n\n <td height=1 colspan=3></td>\n\n </tr>\n\n</table>\n\n</center>\";\n\n\n\n}",
"private function varifysql($sql = \"\")\n {\n if (DEBUG_MODE == 2) {\n App::$__appData['dbQuries'][] = array($sql);\n }\n return $sql;\n }",
"function ei8_xmlrpc_admin_query($sql, $errCt=0) {\n global $wpdb, $ei8_xmlrpc_debug;\n\n //conditionally turn on error reporting\n //NOTE: there has got to be a better way to catch and display sql errors...but I ran out of time...\n //if (isset($ei8_xmlrpc_debug)) $wpdb->show_errors();\n ei8_xmlrpc_admin_log(\"<p><b>Running Query:</b> <pre>\".$sql.\"</pre></p>\");\n //if ($wpdb->query($sql) === FALSE && strlen(trim($wpdb->last_error))>=1) {\n if ($wpdb->query($sql) === FALSE) {\n ei8_xmlrpc_admin_log(\"<p style='color:red'><b>SQL ERROR: </b>\\\"\".$wpdb->last_error.\"\\\"</p>\");\n $errCt++;\n }\n return $errCt ;\n}",
"function &fDefineQry(&$db, $pQry=false)\n{\n $pQry=\"ID = 1\";\n echo \"viene: \".$pQry;\n $ilNumProceso= fGetParam('pro_ID', 0);\n $alSql = Array();\n $alSql[] = \"SELECT \tID as ID, idProvFact COD, concat(pro.per_Apellidos, ' ', pro.per_Nombres) NOM,\n\t\t\t\t\t\tdate_format(fechaRegistro,'%M %d %y') FEC, year(fechaRegistro) PER,\n\t\t\t\t\t\tifNULL(pro.per_Ruc,'********') as RUC,\n\t\t\t\t\t\tconcat(ifNULL(pro.per_Direccion,' '), ' / Telf:', ifNULL(pro.per_Telefono1,' ')) as DIR,\n\t\t\t\t\t\tconcat(establecimiento, ' ', puntoEmision, ' ', secuencial) as FAC,\n\t\t\t\t\t\tUPPER(tco.tab_Descripcion) as TIP,\n\t\t\t\t\t\tbaseImpGrav as BIV, civ.tab_porcentaje as PIV, montoIva as MIV,\n\t\t\t\t\t\tmontoIvaBienes as BIB, porRetBienes TIB, prb.tab_porcentaje as PIB, prb.tab_Descripcion AS DIB, valorRetBienes as MIB,\n\t\t\t\t\t\tmontoIvaServicios as BIS, porRetServicios TIS, prs.tab_porcentaje as PIS, prs.tab_Descripcion AS DIS, valorRetServicios as MIS,\n\t\t\t\t\t\tBaseImpAir as BIR, cra.tab_txtData AS TIR, cra.tab_porcentaje as PIR, cra.tab_Descripcion AS DIR_, valRetAir as MIR,\n\t\t\t\t\t\tBaseImpAir2 as BIR2, cr2.tab_txtData AS TIR2, cr2.tab_porcentaje as PIR2, cr2.tab_Descripcion AS DIR2, valRetAir2 as MIR2,\n\t\t\t\t\t\tBaseImpAir3 as BIR3, cr3.tab_txtData AS TIR3, cr3.tab_porcentaje as PIR3, cr3.tab_Descripcion AS DIR3, valRetAir3 as MIR3,\n\t\t\t\t\t\tvalRetAir + valRetAir2+ valRetAir3+ valorRetBienes + valorRetServicios as TOT\n\t\t\t\tFROM fiscompras fco\n\t\t\t\t\t\tLEFT JOIN fistablassri sus ON sus.tab_CodTabla = '3' AND fco.codSustento +0 = sus.tab_Codigo +0\n\t\t\t\t\t\tLEFT JOIN fistablassri tco ON tco.tab_CodTabla = '2' AND fco.tipoComprobante +0 = tco.tab_Codigo\n\t\t\t\t\t\tLEFT JOIN fistablassri civ ON civ.tab_CodTabla = '4' AND fco.porcentajeIva = civ.tab_Codigo\n\t\t\t\t\t\tLEFT JOIN fistablassri pic ON pic.tab_CodTabla = '6' AND fco.porcentajeIce = pic.tab_Codigo\n\t\t\t\t\t\tLEFT JOIN fistablassri prb ON prb.tab_CodTabla = '5a' AND fco.porRetBienes = prb.tab_Codigo\n\t\t\t\t\t\tLEFT JOIN fistablassri prs ON prs.tab_CodTabla = '5' AND fco.porRetServicios = prs.tab_Codigo\n\t\t\t\t\t\tLEFT JOIN fistablassri cra ON cra.tab_CodTabla = '10' AND fco.codRetAir = cra.tab_Codigo\n\t\t\t\t\t\tLEFT JOIN fistablassri cr2 ON cr2.tab_CodTabla = '10' AND fco.codRetAir2 = cr2.tab_Codigo\n\t\t\t\t\t\tLEFT JOIN fistablassri cr3 ON cr3.tab_CodTabla = '10' AND fco.codRetAir3 = cr3.tab_Codigo\n\t\t\t\t\t\tLEFT JOIN fistablassri ccm ON civ.tab_CodTabla = '2' AND fco.docModificado = ccm.tab_Codigo\n\t\t\t\t\t\tLEFT JOIN fistablassri tra ON tra.tab_CodTabla = 'A' AND fco.tipoTransac = tra.tab_Codigo\n\t\t\t\t\t\tLEFT JOIN conpersonas pro ON pro.per_CodAuxiliar = fco.codProv\n\t\t\t\t\t\tLEFT JOIN genparametros par ON par.par_clave= 'TIPID' AND par.par_secuencia = pro.per_tipoID\n\t\t\t\t\t\tLEFT JOIN conpersonas pv2 ON pv2.per_CodAuxiliar = fco.idProvFact\n\t\t\t\t\t\tLEFT JOIN genparametros pm2 ON pm2.par_clave= 'TIPID' AND pm2.par_secuencia = pv2.per_tipoID\n WHERE \" . $pQry . \" AND valRetAir + valorRetBienes + valorRetServicios > 0\";\n\t\t \n\t\t \n $rs= fSQL($db, $alSql);\n //echo $alSql;\n return $rs;\n}",
"function executeSQL( $sql='' ) {\r\n if(is_object($GLOBALS['sysdb'])){\r\n if ($result = @mysql_query($sql, $GLOBALS['sysdb']->connect_id)) {\r\n @mysql_free_result($result);\r\n\t\tif ( _DEBUG_SQL ) {\r\n\t\t\tif (isset($GLOBALS['fire'])) {\r\n\t\t\t\tif ( eregi('^select',$sql) ) {\r\n\t\t\t\t\t$GLOBALS['fire']->info($sql);\r\n\t\t\t\t} elseif ( eregi('^insert',$sql) ) {\r\n\t\t\t\t\t$GLOBALS['fire']->warn($sql);\r\n\t\t\t\t} elseif ( eregi('^delete',$sql) ) {\r\n\t\t\t\t\t$GLOBALS['fire']->error($sql);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$GLOBALS['fire']->warn($sql);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\techo '<pre style=\"padding:4px;';\r\n\t\t\t\tif ( eregi('^select',$sql) ) {\r\n\t\t\t\t\techo 'border:1px solid blue;background-color:#ccccff;';\r\n\t\t\t\t} elseif ( eregi('^insert',$sql) ) {\r\n\t\t\t\t\techo 'border:1px solid green;background-color:#ccffff;';\r\n\t\t\t\t} elseif ( eregi('^delete',$sql) ) {\r\n\t\t\t\t\techo 'border:1px solid red;background-color:#ffcccc;';\r\n\t\t\t\t} else {\r\n\t\t\t\t\techo 'border:1px solid black;background-color:#cccccc;';\r\n\t\t\t\t}\r\n\t\t\t\techo \"\\\">$sql</pre>\";\r\n\t\t\t}\r\n\t\t}\r\n return TRUE;\r\n }\r\n }\r\n return FALSE;\r\n }"
] | [
"0.6187644",
"0.6185657",
"0.60083747",
"0.58817834",
"0.58575803",
"0.5823055",
"0.57400197",
"0.56587565",
"0.56507564",
"0.564826",
"0.56369245",
"0.5621304",
"0.56147426",
"0.56146544",
"0.5611626",
"0.5610809",
"0.5588658",
"0.5569002",
"0.5558479",
"0.554441",
"0.5519551",
"0.55142546",
"0.5503664",
"0.5500299",
"0.54717606",
"0.5439931",
"0.54308736",
"0.5422121",
"0.5409355",
"0.53766686"
] | 0.6989716 | 0 |
/ Gets the stats for all servers in a group so we minimize the number of external calls. | function get_stats($group, $vdbs, $login) {
$i=0;
foreach($vdbs as $vdb) {
$ps_status = call_agent("STATUS", $vdb);
$status_secs = get_secs($vdb, $login);
$stats[$i]['vdb'] = $vdb;
$stats[$i]['ps_status'] = $ps_status;
$stats[$i]['secs_behind'] = $status_secs;
$i++;
}
return $stats;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function loadGroups() {\n $indexes = $this->storage->loadMultiple();\n /** @var \\Drupal\\search_api\\ServerInterface[] $servers */\n $servers = $this->serverStorage->loadMultiple();\n\n $this->sortByStatusThenAlphabetically($indexes);\n $this->sortByStatusThenAlphabetically($servers);\n\n $server_groups = [];\n foreach ($servers as $server) {\n $server_group = [\n 'server.' . $server->id() => $server,\n ];\n\n foreach ($server->getIndexes() as $index) {\n $server_group['index.' . $index->id()] = $index;\n // Remove this index from $index so it will finally only contain those\n // indexes not belonging to any server.\n unset($indexes[$index->id()]);\n }\n\n $server_groups['server.' . $server->id()] = $server_group;\n }\n\n return [\n 'servers' => $server_groups,\n 'lone_indexes' => $indexes,\n ];\n }",
"public function statsServer();",
"public function getStats() {}",
"public function getStats() {\n $data = [\n 'active_lists' => $this->_getActiveLists(),\n 'active_users' => $this->_getActiveUsers(),\n 'active_users_by_day' => $this->_getActiveUsersPerDay(),\n 'user_syncs_by_day' => $this->_getUserSyncsPerDay(),\n 'activities_by_day' => $this->_getActiviesPerDay(),\n 'items_by_day' => $this->_getItemUpdatesPerDay(),\n 'list_item_counts' => $this->_getItemCountsPerList(),\n 'user_alerts_by_day' => $this->_getUserAlertsPerDay()\n ];\n $this->set('data', $data);\n }",
"function getStats() {\r\n\t\t$response = $this->sendCommand('stats');\r\n\t\t$stats = new stats($response);\r\n\r\n\t\treturn $stats;\r\n\t}",
"public function getStats();",
"public function getStats() {\n\t\t$this->result_array = array();\n\n\t\t$xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t<packet version =\"1.6.3.5\">\n\t\t\t<webspace>\n\t\t\t\t<get>\n\t\t\t\t<filter/>\n\t\t\t\t<dataset>\n\t\t\t\t\t<stat/>\n\t\t\t\t</dataset>\n\t\t\t\t</get>\n\t\t\t\t<get_traffic>\n\t\t\t\t\t<filter/>\n\t\t\t\t\t<since_date>'. date('Y-m-01') .'</since_date>\n\t\t\t\t</get_traffic>\n\t\t\t</webspace>\n\t\t</packet>';\n\n\t\t$response = $this->curlRequest($xml);\n\t\t$plesk_response = json_decode(json_encode(simplexml_load_string($response)), true); // https://stackoverflow.com/a/19391553\n\n\t\tif(isset($plesk_response[\"system\"][\"status\"]) && $plesk_response[\"system\"][\"status\"] == \"error\") {\n\t\t\t$this->result_array = array(\n\t\t\t\t'status' => 'error',\n\t\t\t\t'message' => $plesk_response[\"system\"][\"errtext\"]\n\t\t\t);\n\t\t\treturn $this->result_array;\n\t\t}\n\t\telse {\n\t\t\t$this->result_array[\"status\"] = 'ok';\n\n\t\t\t// Result with a single row, create array\n\t\t\tif(isset($plesk_response[\"webspace\"][\"get\"][\"result\"]['status'])) {\n\t\t\t\t$plesk_response[\"webspace\"][\"get\"][\"result\"] = array($plesk_response[\"webspace\"][\"get\"][\"result\"]);\n\t\t\t}\n\n\t\t\tforeach($plesk_response[\"webspace\"][\"get\"][\"result\"] as $site) {\n\t\t\t\t$this->result_array[\"result\"][$site[\"id\"]] = array(\n\t\t\t\t\t\"id\" => $site[\"id\"],\n\t\t\t\t\t\"domain\" => $site[\"data\"][\"gen_info\"][\"name\"],\n\t\t\t\t\t\"traffic\" => $site[\"data\"][\"stat\"][\"traffic\"],\n\t\t\t\t\t\"traffic_prevday\" => $site[\"data\"][\"stat\"][\"traffic_prevday\"],\n\t\t\t\t\t\"subdomains\" => $site[\"data\"][\"stat\"][\"subdom\"],\n\t\t\t\t\t\"emailboxes\" => $site[\"data\"][\"stat\"][\"box\"],\n\t\t\t\t\t\"redirect\" => $site[\"data\"][\"stat\"][\"redir\"],\n\t\t\t\t\t\"webusers\" => $site[\"data\"][\"stat\"][\"wu\"],\n\t\t\t\t\t\"mailgroups\" => $site[\"data\"][\"stat\"][\"mg\"],\n\t\t\t\t\t\"responders\" => $site[\"data\"][\"stat\"][\"resp\"],\n\t\t\t\t\t\"maillists\" => $site[\"data\"][\"stat\"][\"maillists\"],\n\t\t\t\t\t\"databases\" => $site[\"data\"][\"stat\"][\"db\"],\n\t\t\t\t\t\"mssyl_databases\" => $site[\"data\"][\"stat\"][\"mssql_db\"],\n\t\t\t\t\t\"webapps\" => $site[\"data\"][\"stat\"][\"webapps\"],\n\t\t\t\t\t\"domains\" => $site[\"data\"][\"stat\"][\"domains\"],\n\t\t\t\t\t\"sites\" => $site[\"data\"][\"stat\"][\"sites\"],\n\t\t\t\t\t\"disk_usage\" => $site[\"data\"][\"gen_info\"][\"real_size\"],\n\t\t\t\t\t\"log_usage\" => '',\n\t\t\t\t\t\"quota\" => '',\n\t\t\t\t\t\"ssl\" => '',\n\t\t\t\t\t\"cgi\" => '',\n\t\t\t\t\t\"php\" => ''\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Result with a single row, create array\n\t\t\tif(isset($plesk_response[\"webspace\"][\"get_traffic\"][\"result\"]['status'])) {\n\t\t\t\t$plesk_response[\"webspace\"][\"get_traffic\"][\"result\"] = array($plesk_response[\"webspace\"][\"get_traffic\"][\"result\"]);\n\t\t\t}\n\t\t\tforeach($plesk_response[\"webspace\"][\"get_traffic\"][\"result\"] as $site_traffic) {\n\t\t\t\tif(isset($this->result_array[\"result\"][$site_traffic['id']]) && isset($site_traffic[\"status\"]) && $site_traffic[\"status\"] == 'ok') {\n\n\t\t\t\t\t// Result with a single row\n\t\t\t\t\tif(isset($site_traffic['traffic']['date'])) {\n\t\t\t\t\t\t//Update it to multiple rows for the foreach-loop\n\t\t\t\t\t\t$site_traffic['traffic'] = array($site_traffic['traffic']);\n\t\t\t\t\t}\n\n\t\t\t\t\t//We update the traffic to 0. We switched from daily -> month. v1.3 and above now use traffic_month + traffic_day\n\t\t\t\t\t$traffic = 0;\n\t\t\t\t\t$this->result_array[\"result\"][ $site_traffic[\"id\"] ][\"traffic_month\"] = $this->result_array[\"result\"][ $site_traffic[\"id\"] ][\"traffic\"];\n\t\t\t\t\t$this->result_array[\"result\"][ $site_traffic[\"id\"] ]['traffic'] = 0;\n\n\t\t\t\t\tif(isset($site_traffic['traffic'])) {\n\t\t\t\t\t\tforeach($site_traffic['traffic'] AS $site_traffic_data) {\n\t\t\t\t\t\t\tif($site_traffic_data['date'] == date('Y-m-d')) {\n\t\t\t\t\t\t\t\t// today\n\t\t\t\t\t\t\t\tunset($site_traffic_data['date']);\n\t\t\t\t\t\t\t\t$traffic = array_sum($site_traffic_data);\n\t\t\t\t\t\t\t\t// We found 'today', so we set the traffic for only today:\n\t\t\t\t\t\t\t\t$this->result_array[\"result\"][ $site_traffic[\"id\"] ]['traffic'] = $traffic;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tunset($site_traffic_data['date']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->result_array[\"result\"][ $site_traffic[\"id\"] ][\"traffic_day\"] = $traffic;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->result_array[\"plugin\"] = 'Plesk';\n\t\t\t$this->result_array[\"date\"] = date(\"Y-m-d H:i:s\");\n\t\t\t//We reset the keys to 0 -> 100 for a better json\n\t\t\t$this->result_array[\"result\"] = array_values($this->result_array[\"result\"]);\n\t\t\t$this->result_array[\"version\"] = 'v1.3'; // v1.2 and lower did not have any \"version\"\n\n\t\t\treturn $this->result_array;\n\t\t}\n\t}",
"public static function getservers() {\n $product_id = OnAppCDN::get_value(\"id\");\n \n $sql = \"SELECT\n tblservers.*, \n tblservergroupsrel.groupid,\n tblproducts.servergroup\nFROM \n tblservers \n LEFT JOIN tblservergroupsrel ON \n tblservers.id = tblservergroupsrel.serverid\n LEFT JOIN tblproducts ON\n tblproducts.id = $product_id \nWHERE\n tblservers.disabled = 0\n AND tblservers.type = 'onappcdn'\";\n\n $sql_servers_result = full_query($sql); \n\n $servers = array();\n while ( $server = mysql_fetch_assoc($sql_servers_result)) {\n if ( is_null($server['groupid']) ) \n $server['groupid'] = 0;\n $server['password'] = decrypt($server['password']);\n\n $servers[$server['id']] = $server;\n }\n\n return $servers;\n }",
"public function getFunctionData()\n {\n $i = 0;\n $data = $groupDataTmp = [];\n\n foreach ($this->servers as $index => $server) {\n if ($this->filterServers && !in_array($index, $this->filterServers)) {\n continue;\n }\n\n try {\n $gmd = new TelnetGmdServer($server['address']);\n $status = $gmd->statusInfo();\n $gmd->close();\n unset($gmd);\n\n foreach ((array)$status as $row) {\n if (strlen($this->filterName) == 0 || stripos($row['job_name'], $this->filterName) !== false) {\n $row['name'] = $this->groupBy === self::GROUP_SERVER ? '+' : $row['job_name'];\n $row['server'] = $this->groupBy === self::GROUP_NAME ? '+' : $server['name'];\n\n if ($this->groupBy !== self::GROUP_NONE) {\n if (isset($groupDataTmp[$row[$this->groupBy]])) {\n $k = $groupDataTmp[$row[$this->groupBy]];\n foreach (['in_queue', 'in_running', 'capable_workers'] as $key) {\n $data[$k][$key] += $row[$key];\n }\n } else {\n $groupDataTmp[$row[$this->groupBy]] = $i;\n $data[] = $row;\n $i++;\n }\n } else {\n $data[] = $row;\n $i++;\n }\n }\n }\n } catch (Exception $e) {\n $this->_addError($e->getMessage());\n }\n }\n\n $data = $this->_sortData($data, $this->_getSortAvailableFunctions());\n\n return $data;\n }",
"public static function getGroupData() {\n $result = lC_Administrators_Admin::getGroupData($_GET['gid']);\n if (!isset($result['rpcStatus'])) {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }",
"public function list()\n {\n try {\n if ($this->shouldCache()) {\n if ($this->checkCache($this->getCacheKey())) {\n $groups = $this->getCache($this->getCacheKey());\n } else {\n $groups = $this->client->listGroups(['domain' => config('gsuite.domain')])->groups;\n\n $this->putCache($this->getCacheKey(), $groups);\n }\n } else {\n $groups = $this->client->listGroups(['domain' => config('gsuite.domain')])->groups;\n }\n } catch (\\Exception $e) {\n throw $e;\n }\n\n return $groups;\n }",
"public static function getAllGroups() {\n $result = lC_Administrators_Admin::getAllGroups();\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n\n echo json_encode($result);\n }",
"public static function getServers($id) {\r\n try {\r\n \t$servers = array();\r\n $records = Doctrine_Query::create ()\r\n ->select('server_id')\r\n ->from ( 'ServersGroupsIndexes p' )\r\n ->where ( 'p.group_id = ?', $id )\r\n ->execute ( array (), Doctrine_Core::HYDRATE_ARRAY );\r\n \r\n \r\n\t foreach ( $records as $c ) {\r\n\t\t\t\t$servers [] = $c ['server_id'];\r\n\t\t\t}\r\n\t\t\t\r\n return $servers;\r\n \r\n } catch ( Exception $e ) {\r\n die ( $e->getMessage () );\r\n }\r\n }",
"public function statsAllTubes();",
"public function getServers();",
"public function stats()\n\t{\n\t\t$stats = $this->util_model->getStats();\n\t\t\n\t\t$this->output\n\t\t\t->set_content_type('application/json')\n\t\t\t->set_output($stats);\n\t}",
"function get_info( )\n\t/* ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */ \n {\n \n $info = [];\n foreach( $this->servers as $key => $server ) {\n\n if( $server->type == SERVER_TYPE_SOLDAT ) {\n\n $info[] = $server->get_info();\n }\n }\n\n if( count($info) ) return $info;\n\n return array(\"No servers found\");\n }",
"public function getStats() {\n\t\t//$options = [\n\t\t//\t'fields' => function ($query) {\n\t\t//\t\treturn [\n\t\t//\t\t\t'job_type',\n\t\t//\t\t\t'num' => $query->func()->count('*'),\n\t\t//\t\t\t'alltime' => $query->func()->avg('UNIX_TIMESTAMP(completed) - UNIX_TIMESTAMP(created)'),\n\t\t//\t\t\t'runtime' => $query->func()->avg('UNIX_TIMESTAMP(completed) - UNIX_TIMESTAMP(fetched)'),\n\t\t//\t\t\t'fetchdelay' => $query->func()->avg('UNIX_TIMESTAMP(fetched) - IF(notbefore is NULL, UNIX_TIMESTAMP(created), UNIX_TIMESTAMP(notbefore))'),\n\t\t//\t\t];\n\t\t//\t},\n\t\t//\t'conditions' => [\n\t\t//\t\t'completed IS NOT' => null,\n\t\t//\t],\n\t\t//\t'group' => [\n\t\t//\t\t'job_type',\n\t\t//\t],\n\t\t//];\n\t\t//return $this->find('all', $options);\n\t}",
"public function getStatusServers(): array{\n\t\tif(!$this->update()){\n\t\t\t$this->plugin->getLogger()->critical(\"Unexpected error: Trying to get SignServerStats plugin instance failed!\");\n\t\t\t$this->plugin->getServer()->getPluginManager()->disablePlugin($this->plugin);\n\t\t}\n\t\treturn $this->listServers;\n\t}",
"public function getStats()\n {\n // Making the stats if it's the first time\n if ($this->_stats === null) {\n $this->_stats = array();\n\n // Making the array of the stats\n foreach ($this->_data as $data) {\n $this->_stats[$data[0]] = array(\n 'time_idle' => $data[2],\n 'timeout_active' => $data[3],\n 'timeout_idle' => $data[4],\n 'time_average' => $data[5]\n );\n }\n }\n\n return $this->_stats;\n }",
"function drush_search_api_server_list() {\n /** @var \\Drupal\\search_api\\ServerInterface[] $servers */\n $servers = Server::loadMultiple();\n if (empty($servers)) {\n drush_print(dt('There are no servers present.'));\n return;\n }\n $rows[] = [\n dt('ID'),\n dt('Name'),\n dt('Status'),\n ];\n\n foreach ($servers as $server) {\n $rows[] = [\n $server->id(),\n $server->label(),\n $server->status() ? dt('enabled') : dt('disabled'),\n ];\n }\n\n drush_print_table($rows);\n}",
"public function getStats_InstanceData($date) {\n\t$myIds = array();\n\tif(SERVER_GROUP) {\n\t $allowedGroup = str_replace(\"|X|\",\"','\",SERVER_GROUP);\n\t $sql = \"SELECT mysql_id FROM `mytrend_mysql_instances` where group_name in('$allowedGroup')\";\n\t //$params = array('group_name'=>SERVER_GROUP);\n\t $result = $this->objDBConnection->queryPDO($sql,array(),$params);\n\t foreach($result as $res) {\n\t\t$myIds[] = $res['mysql_id'];\n\t } \n\t}\n\t$params = array('date'=>$date);\n\t$res = $this->getData('mytrend_data_instance',\"`date`=:date\",$params);\n\t$data = array();\n\tforeach($res as $row) {\n\t if(SERVER_GROUP) {\n\t\tif(in_array($row['mysql_id'],$myIds))\t\n\t\t $data[$row['mysql_id']] = array('date'=>$date,'data_size'=>$row['data_length']+$row['index_length'],'mysql_id'=>$row['mysql_id']);\n\t } \n\t else {\n\t\t$data[$row['mysql_id']] = array('date'=>$date,'data_size'=>$row['data_length']+$row['index_length'],'mysql_id'=>$row['mysql_id']);\n\t }\n\t}\n\treturn $data;\n }",
"public function stats()\n {\n $blockchainResponse = $this->callBlockchain('stats', 'GET', ['format' => 'json']);\n\n if( ! $response = json_decode($blockchainResponse))\n return $blockchainResponse;\n\n return $response;\n }",
"public static function getall_server() { return is_array(self::$server) ? self::$server : array(); }",
"public function stats()\n\t{\n\t\treturn array();\n\t}",
"public function statistics()\n {\n $this->load->library('installer_lib');\n $db = $this->load->database('default', true);\n\n $data = array(\n 'bonfire_version' => BONFIRE_VERSION,\n 'php_version' => phpversion(),\n 'server' => $this->input->server('SERVER_SOFTWARE'),\n 'dbdriver' => $db->dbdriver,\n 'dbserver' => @mysql_get_server_info($db->conn_id),\n 'dbclient' => preg_replace('/[^0-9\\.]/','', mysql_get_client_info()),\n 'curl' => $this->installer_lib->cURL_enabled(),\n 'server_hash' => md5($this->input->server('SERVER_NAME').$this->input->server('SERVER_ADDR').$this->input->server('SERVER_SIGNATURE'))\n );\n\n $data_string = '';\n\n foreach($data as $key=>$value)\n {\n $data_string .= $key.'='.$value.'&';\n }\n rtrim($data_string, '&');\n\n $url = 'http://cibonfire.com/stats/collect';\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST, count($data));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\n $result = curl_exec($ch);\n\n curl_close($ch);\n\n //die(var_dump($result));\n }",
"public function stats($metricGroups, $params = [])\n {\n return $this->all_stats($this->getAccount(), [$this->getId()], $metricGroups, $params);\n }",
"public function getStats() {\r\n\t\tglobal $SITE_DIR;\r\n\t\t$files = array();\r\n\t\t$directoryHandle = opendir($SITE_DIR . 'data/cache');\r\n\t\twhile (false !== ($filename = readdir($directoryHandle))) {\r\n\t\t\tif (substr($filename, 0, strlen($this->prefix)) == $this->prefix) {\r\n\t\t\t\t$files[] = $SITE_DIR . 'data/cache/' . $filename;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn array('files' => count($files));\r\n\t}",
"public function getClusterStats()\n {\n return $this->client->cluster()->stats();\n }",
"function xstats_collectAndStore( $sid, $battleCountArray,$battleCountWonArray,$coloniesTakenCountArray,$ljArray ) {\n $statsGameId = xstats_gameSID2ID( $sid );\n $statsTurn = xstats_getActualTurn( $statsGameId );\n $statsAvailablePlayerIndicies = xstats_getAvailablePlayerIndicies( $statsGameId );\n $statsAvailablePlayerIds = xstats_getAvailablePlayerIds( $statsGameId );\n for ( $i = 0; $i<count($statsAvailablePlayerIds); $i++) {\n $statsPlayerIndex = $statsAvailablePlayerIndicies[$i];\n $statsPlayerId = $statsAvailablePlayerIds[$i];\n $statsShipCount = xstats_getShipCount( $statsGameId, $statsPlayerIndex );\n $statsFreighterCount = xstats_getFreighterCount( $statsGameId, $statsPlayerIndex );\n $statsAccumulatedMass = xstats_getShipMassAccumulated($statsGameId, $statsPlayerIndex);\n $statsPlanetCount = xstats_getPlanetCount($statsGameId, $statsPlayerIndex);\n $statsColonistsCount = xstats_getColonistsAccumulated($statsGameId, $statsPlayerIndex);\n $statsStarbaseCount = xstats_getStarbaseCount($statsGameId, $statsPlayerIndex);\n $statsStarbaseCountStandard = xstats_getStarbaseCountOfType($statsGameId, $statsPlayerIndex, 0);\n $statsStarbaseCountRepair = xstats_getStarbaseCountOfType($statsGameId, $statsPlayerIndex, 1);\n $statsStarbaseCountDefense = xstats_getStarbaseCountOfType($statsGameId, $statsPlayerIndex, 2);\n $statsStarbaseCountStandardWithExtra = xstats_getStarbaseCountOfType($statsGameId, $statsPlayerIndex, 3);\n $statsLeminCount = xstats_getLeminAccumulated($statsGameId, $statsPlayerIndex);\n $statsMin1Count = xstats_getMineralAccumulated($statsGameId, $statsPlayerIndex, 1);\n $statsMin2Count = xstats_getMineralAccumulated($statsGameId, $statsPlayerIndex, 2);\n $statsMin3Count = xstats_getMineralAccumulated($statsGameId, $statsPlayerIndex, 3);\n $statsCantoxCount = xstats_getCantoxAccumulated($statsGameId, $statsPlayerIndex);\n $statsMinesCount = xstats_getMinesAccumulated($statsGameId, $statsPlayerIndex);\n $statsFactoryCount = xstats_getFactoriesAccumulated($statsGameId, $statsPlayerIndex);\n $statsCargoHold = xstats_getSumCargoHold($statsGameId, $statsPlayerIndex);\n $statsUsedCargoHold = xstats_getUsedCargoHold($statsGameId, $statsPlayerIndex);\n $statsBoxCount = xstats_getBoxesAccumulated($statsGameId, $statsPlayerIndex);\n $statsRank = xstats_getRank($statsGameId, $statsPlayerIndex);\n $statsAllPlanetCount = xstats_getAllPlanetCount($statsGameId);\n $statsBattleCount = 0;\n if($battleCountArray != NULL ) {\n //passed arrays are 1-based!\n $statsBattleCount = $battleCountArray[\"$statsPlayerIndex\"];\n }\n $statsBattleWonCount = 0;\n if($battleCountWonArray != NULL ) {\n //passed arrays are 1-based!\n $statsBattleWonCount = $battleCountWonArray[\"$statsPlayerIndex\"];\n }\n $statsColoniesTakenCount = 0;\n if($coloniesTakenCountArray != NULL ) {\n //passed arrays are 1-based!\n $statsColoniesTakenCount = $coloniesTakenCountArray[\"$statsPlayerIndex\"];\n }\n $lj = 0;\n if($ljArray != NULL ) {\n //passed arrays are 1-based!\n $lj = $ljArray[\"$statsPlayerIndex\"];\n }\n $query = \"INSERT INTO skrupel_xstats (gameid,playerindex,playerid,turn,shipcount,freightercount,shipmasscount,planetcount,colonistcount,stationcount,stationcountstd,stationcountrep,stationcountdef,stationcountstdextra,lemincount,min1count,min2count,min3count,cantoxcount,minescount,factorycount,sumcargohold,usedcargohold,boxcount,rank,allplanetcount,battlecount,battlewoncount,coloniestakencount,lj) VALUES\".\n \"($statsGameId,$statsPlayerIndex,$statsPlayerId,$statsTurn,$statsShipCount,$statsFreighterCount,$statsAccumulatedMass,$statsPlanetCount,$statsColonistsCount,$statsStarbaseCount,$statsStarbaseCountStandard,$statsStarbaseCountRepair,$statsStarbaseCountDefense,$statsStarbaseCountStandardWithExtra,$statsLeminCount,$statsMin1Count,$statsMin2Count,$statsMin3Count,$statsCantoxCount,$statsMinesCount,$statsFactoryCount,$statsCargoHold,$statsUsedCargoHold,$statsBoxCount,$statsRank,$statsAllPlanetCount,$statsBattleCount,$statsBattleWonCount,$statsColoniesTakenCount,$lj)\";\n @mysql_query($query) or die(mysql_error());\n }\n //check if the stats_ships table is empty\n $query = \"SELECT COUNT(1) FROM skrupel_xstats_ships WHERE gameid=\".$statsGameId;\n $result = @mysql_query($query) or die(mysql_error());\n $result = @mysql_fetch_row($result);\n $statsShipCount = $result[0];\n xstats_handleShipsStats($statsGameId, $statsTurn);\n //ignore the fights if the table skrupel_xstats_ships has no entries for this game so far. In this case\n //the stats extension is installed in the middle of a game and the skrupel fight table could contain\n //references to non-existing ships which would result in a violation of the db integrity\n // (the shipid is defined as secondary key in the table stats_shipvsship)\n if( $statsShipCount != 0 ) {\n xstats_handleShipVsShipStats( $statsGameId, $statsTurn);\n }\n xstats_insertTurnTime( $statsGameId, $statsTurn);\n}"
] | [
"0.63239884",
"0.62190604",
"0.6218544",
"0.6153689",
"0.6115667",
"0.6092616",
"0.6082633",
"0.6054049",
"0.599566",
"0.5977941",
"0.59055585",
"0.59032094",
"0.5873278",
"0.5824709",
"0.57922524",
"0.5787816",
"0.5780508",
"0.5770606",
"0.57576525",
"0.5702759",
"0.5684717",
"0.56727827",
"0.5631137",
"0.5622574",
"0.55952805",
"0.5576312",
"0.55660444",
"0.5563538",
"0.5562838",
"0.5548361"
] | 0.6913989 | 0 |
Get the user address | private function address()
{
return $this->user->profile->profile_address ?? null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAddress();",
"public function getAddress();",
"public function getAddress();",
"public function getAddress();",
"public function getAddress();",
"public function getAddress() : string;",
"public function getAddress() : string;",
"public function getUserAddressAttribute()\n {\n return $this->attributes['UserAddress'] = $this->user->address;\n }",
"public function get_address(){\n\t \tprint \"address: \" . implode(\", \", $this->address) . \"\\n\";\n\t }",
"public abstract function getAddress();",
"public function getFromAddress();",
"public function getAddress(){\n\t\t\treturn $this->address;\n\t\t}",
"public function getAddress() {\n\t\t\treturn $this->address; \n\t\t}",
"function getAddress()\n {\n return $this->address ;\n }",
"public function getAdminAddress();",
"public function get_address() {\n $address = $this->config_array['address'];\n return $address;\n }",
"public function getAddress()\n {\n return $this->address;\n }",
"public function getAddress()\n {\n return $this->address;\n }",
"public function getAddress()\n {\n return $this->address;\n }",
"public function getAddress()\n {\n return $this->address;\n }",
"public function getAddress()\n {\n return $this->address;\n }",
"public function getAddress()\n {\n return $this->address;\n }",
"public function getAddress()\n {\n return $this->address;\n }",
"public function getAddress()\n {\n return $this->address;\n }",
"public function getAddress()\n {\n return $this->address;\n }",
"public function getAddress()\n {\n return $this->address;\n }",
"public function getAddress()\n {\n return $this->address;\n }",
"public function getAddress()\n {\n return $this->address;\n }",
"public function getAddress()\n {\n return $this->address;\n }",
"public function getAddress()\n {\n return $this->address;\n }"
] | [
"0.7761801",
"0.7761801",
"0.7761801",
"0.7761801",
"0.7761801",
"0.73647803",
"0.73647803",
"0.735962",
"0.73333436",
"0.73314714",
"0.73298186",
"0.72568506",
"0.7237738",
"0.722684",
"0.722391",
"0.72176975",
"0.7202108",
"0.7202108",
"0.7202108",
"0.7202108",
"0.7202108",
"0.7202108",
"0.7202108",
"0.7202108",
"0.7202108",
"0.7202108",
"0.7202108",
"0.7202108",
"0.7202108",
"0.7202108"
] | 0.80988675 | 0 |
Get the plant id | private function plant()
{
return $this->user->plant_id ?? null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getIdPlantilla()\n {\n return $this->idPlantilla;\n }",
"public function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}",
"public function get_id(){ return intval($this->get_info('robot_id')); }",
"public function get_id();",
"public function get_id() {\r\n\t\treturn ($this->id);\r\n\t}",
"public function get_id() {\r\n\t\treturn ($this->id);\r\n\t}",
"public function get_id() {\r\n\t\treturn ($this->id);\r\n\t}",
"public function getID()\n {\n return $this->extractData('id');\n }",
"public function get_id() {\n\t\treturn $this->id;\n\t}",
"public function get_id() {\n\t\treturn $this->id;\n\t}",
"public function id() {\n\t\treturn $this->getValue(static::$ID_FIELD);\n\t}",
"public function get_id()\n {\n return $this->id;\n }",
"public function get_id() {\n\n return $this->id;\n\n }",
"function get_id() {\r\n\t\treturn $this->id;\r\n\t}",
"public function get_id() {\n return $this->id;\n }",
"public function getId()\n {\n return $this->uuid;\n }",
"public function get_id()\n {\n return $this->id;\n }",
"public function get_id()\n {\n return $this->id;\n }",
"public function get_id()\n\t{\n\t\treturn $this->id;\n\t}",
"public function get_id()\n\t{\n\t\treturn $this->id;\n\t}",
"public function get_id()\n\t{\n\t\treturn $this->id;\n\t}",
"public function get_id()\n\t{\n\t\treturn $this->id;\n\t}",
"public function get_id() {\n return $this->id;\n }",
"function get_id() {\n return $this->id;\n }",
"function get_id()\n\t{\n\t\treturn $this->id;\n\t}",
"public function id(): string\n {\n return $this->id;\n }",
"function get_id()\n {\n return $this->id;\n }",
"public function getId()\n {\n return $this->usercode.\"@@\".$this->unitname;\n }",
"public function id(): string {\n\t\treturn $this->_id;\n\t}",
"public function id()\n\t{\n\t\treturn $this->id;\n\t}"
] | [
"0.7395654",
"0.7032301",
"0.7018563",
"0.6860153",
"0.6827482",
"0.6827482",
"0.6827482",
"0.6805041",
"0.67781216",
"0.67781216",
"0.6777728",
"0.67437816",
"0.6728571",
"0.67285556",
"0.6722372",
"0.67016804",
"0.6700533",
"0.6690781",
"0.6690238",
"0.6690238",
"0.6690238",
"0.6690238",
"0.6669784",
"0.66671807",
"0.66594",
"0.6652843",
"0.6630007",
"0.66290224",
"0.6628671",
"0.6627435"
] | 0.8293113 | 0 |
This array is used only by blocks that have loops + title (it is merged with the array from get_map_filter_array) | static function get_map_block_general_array() {
return array(
// title settings
array(
"param_name" => "custom_title",
"type" => "textfield",
"value" => "Block title",
"heading" => 'Custom title for this block:',
"description" => "Optional - a title for this block, if you leave it blank the block will not have a title",
"holder" => "div",
"class" => ""
),
array(
"param_name" => "custom_url",
"type" => "textfield",
"value" => "",
"heading" => 'Title url:',
"description" => "Optional - a custom url when the block title is clicked",
"holder" => "div",
"class" => ""
),
array(
"type" => "colorpicker",
"holder" => "div",
"class" => "",
"heading" => 'Title text color',
"param_name" => "header_text_color",
"value" => '',
"description" => 'Optional - Choose a custom title text color for this block'
),
array(
"type" => "colorpicker",
"holder" => "div",
"class" => "",
"heading" => 'Title background color',
"param_name" => "header_color",
"value" => '',
"description" => 'Optional - Choose a custom title background color for this block'
)
);//end generic array
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function get_map_filter_array ($group = 'Filter') {\r\n\t\treturn array(\r\n array(\r\n \"param_name\" => \"post_ids\",\r\n \"type\" => \"textfield\",\r\n \"value\" => '',\r\n \"heading\" => 'Post ID filter:',\r\n \"description\" => \"Filter multiple posts by ID. Enter here the post IDs separated by commas (ex: 10,27,233). To exclude posts from this block add them with '-' (ex: -7, -16)\",\r\n \"holder\" => \"div\",\r\n \"class\" => \"\",\r\n 'group' => $group\r\n ),\r\n\t\t\tarray(\r\n\t\t\t\t\"param_name\" => \"category_id\",\r\n\t\t\t\t\"type\" => \"dropdown\",\r\n\t\t\t\t\"value\" => td_util::get_category2id_array(),\r\n\t\t\t\t\"heading\" => 'Category filter:',\r\n\t\t\t\t\"description\" => \"A single category filter. If you want to filter multiple categories, use the 'Multiple categories filter' and leave this to default\",\r\n\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\"class\" => \"\",\r\n 'group' => $group\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t\"param_name\" => \"category_ids\",\r\n\t\t\t\t\"type\" => \"textfield\",\r\n\t\t\t\t\"value\" => '',\r\n\t\t\t\t\"heading\" => 'Multiple categories filter:',\r\n\t\t\t\t\"description\" => \"Filter multiple categories by ID. Enter here the category IDs separated by commas (ex: 13,23,18). To exclude categories from this block add them with '-' (ex: -9, -10)\",\r\n\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\"class\" => \"\",\r\n 'group' => $group\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t\"param_name\" => \"tag_slug\",\r\n\t\t\t\t\"type\" => \"textfield\",\r\n\t\t\t\t\"value\" => '',\r\n\t\t\t\t\"heading\" => 'Filter by tag slug:',\r\n\t\t\t\t\"description\" => \"To filter multiple tag slugs, enter here the tag slugs separated by commas (ex: tag1,tag2,tag3)\",\r\n\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\"class\" => \"\",\r\n 'group' => $group\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t\"param_name\" => \"autors_id\",\r\n\t\t\t\t\"type\" => \"textfield\",\r\n\t\t\t\t\"value\" => '',\r\n\t\t\t\t\"heading\" => \"Multiple authors filter:\",\r\n\t\t\t\t\"description\" => \"Filter multiple authors by ID. Enter here the author IDs separated by commas (ex: 13,23,18).\",\r\n\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\"class\" => \"\",\r\n 'group' => $group\r\n\t\t\t),\r\n array(\r\n \"param_name\" => \"installed_post_types\",\r\n \"type\" => \"textfield\",\r\n \"value\" => '',//tdUtil::create_array_installed_post_types(),\r\n \"heading\" => 'Post Type:',\r\n \"description\" => \"Filter by post types. Usage: post, page, event - Write 1 or more post types delimited by commas\",\r\n \"holder\" => \"div\",\r\n \"class\" => \"\",\r\n 'group' => $group\r\n ),\r\n\t\t\tarray(\r\n\t\t\t\t\"param_name\" => \"sort\",\r\n\t\t\t\t\"type\" => \"dropdown\",\r\n\t\t\t\t\"value\" => array (\r\n\t\t\t\t\t'- Latest -' => '',\r\n 'Oldest posts' => 'oldest_posts',\r\n\t\t\t\t\t'Alphabetical A -> Z' => 'alphabetical_order',\r\n\t\t\t\t\t'Popular (all time)' => 'popular',\r\n\t\t\t\t\t'Popular (jetpack + stats module requiered) Does not work with other settings/pagination' => 'jetpack_popular_2',\r\n\t\t\t\t\t'Popular (last 7 days) - theme counter (enable from panel)' => 'popular7',\r\n\t\t\t\t\t'Featured' => 'featured',\r\n\t\t\t\t\t'Highest rated (reviews)' => 'review_high',\r\n\t\t\t\t\t'Random Posts' => 'random_posts',\r\n 'Random posts Today' => 'random_today' ,\r\n 'Random posts from last 7 Day' => 'random_7_day' ,\r\n\t\t\t\t\t'Most Commented' => 'comment_count'\r\n\t\t\t\t),\r\n\t\t\t\t\"heading\" => 'Sort order:',\r\n\t\t\t\t\"description\" => \"How to sort the posts. Notice that Popular (last 7 days) option is affected by caching plugins and CDNs. For popular posts we recommend the jetpack (24-48hrs) method\",\r\n\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\"class\" => \"\",\r\n 'group' => $group\r\n\t\t\t),\r\n array(\r\n\t\t\t\t\"param_name\" => \"limit\",\r\n\t\t\t\t\"type\" => \"textfield\",\r\n\t\t\t\t\"value\" => '5',\r\n\t\t\t\t\"heading\" => 'Limit post number:',\r\n\t\t\t\t\"description\" => \"If the field is empty the limit post number will be the number from Wordpress settings -> Reading\",\r\n\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\"class\" => \"\"\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t\"param_name\" => \"offset\",\r\n\t\t\t\t\"type\" => \"textfield\",\r\n\t\t\t\t\"value\" => '',\r\n\t\t\t\t\"heading\" => 'Offset posts:',\r\n\t\t\t\t\"description\" => \"Start the count with an offset. If you have a block that shows 5 posts before this one, you can make this one start from the 6'th post (by using offset 5)\",\r\n\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\"class\" => \"\"\r\n\t\t\t)\r\n\t\t);//end generic array\r\n\t}",
"private static function td_block_trending_now_params() {\r\n $map_block_array = self::get_map_filter_array();\r\n\r\n //move on the first position the new filter array - array_unshift is used to keep the 0 1 2 index. array_marge does not do that\r\n array_unshift(\r\n $map_block_array,\r\n array(\r\n \"param_name\" => \"navigation\",\r\n \"type\" => \"dropdown\",\r\n \"value\" => array('Auto' => '', 'Manual' => 'manual'),\r\n \"heading\" => 'Navigation:',\r\n \"description\" => \"If set on `Auto` will set the `Trending Now` block to auto start rotating posts\",\r\n \"holder\" => \"div\",\r\n \"class\" => \"\"\r\n ),\r\n\r\n array(\r\n \"param_name\" => \"style\",\r\n \"type\" => \"dropdown\",\r\n \"value\" => array('Default' => '', 'Style 2' => 'style2'),\r\n \"heading\" => 'Style:',\r\n \"description\" => \"Style of the `Trending Now` box\",\r\n \"holder\" => \"div\",\r\n \"class\" => \"\"\r\n ),\r\n\r\n\t array(\r\n\t\t \"type\" => \"colorpicker\",\r\n\t\t \"holder\" => \"div\",\r\n\t\t \"class\" => \"\",\r\n\t\t \"heading\" => 'Title text color',\r\n\t\t \"param_name\" => \"header_text_color\",\r\n\t\t \"value\" => '',\r\n\t\t \"description\" => 'Optional - Choose a custom title text color for this block'\r\n\t ),\r\n\r\n\t array(\r\n\t\t \"type\" => \"colorpicker\",\r\n\t\t \"holder\" => \"div\",\r\n\t\t \"class\" => \"\",\r\n\t\t \"heading\" => 'Title background color',\r\n\t\t \"param_name\" => \"header_color\",\r\n\t\t \"value\" => '',\r\n\t\t \"description\" => 'Optional - Choose a custom title background color for this block'\r\n\t )\r\n );\r\n\r\n return $map_block_array;\r\n }",
"function filterMap(): array\n {\n return [\n 'state' => ['state']\n ];\n }",
"function jordifuite_preprocess_block(&$variables) {\n // In the header region visually hide block titles.\n if ($variables['block']->region == 'header') {\n $variables['title_attributes_array']['class'][] = 'element-invisible';\n }\n if (isset($_GET['embed']) && $_GET['embed'] == 1) {\n $variables['theme_hook_suggestions'][] = 'block__embed';\n }\n}",
"function blocks1(){\n\t foreach($this->vars as $key=>$value){\n\t $pos=0;\n\t while(($pos=strpos($this->source, \"{block \".$key.\"}\", $pos))!==false&&($endPos=strpos($this->source, \"{-block \".$key.\"}\", $pos))!==false){\n\t $endPos+= strlen(\"{-block \".$key.\"}\");\n\t if(isset($value)&&$value==0)\n\t $this->source = substr_replace($this->source, '', $pos, $endPos-$pos);\n\t elseif(isset($value)){\n\t $temp = substr($this->source, $pos, $endPos-$pos);\n\t $temp = str_replace(\"{block \".$key.\"}\", '', $temp);\n\t $temp = str_replace(\"{-block \".$key.\"}\", '', $temp);\n\t $this->source = substr_replace($this->source, $temp, $pos, $endPos-$pos);\n\t }\n\t }\n\t \n\t $pos=0; \n\t while(($pos=strpos($this->source, \"{\".$key.\"}\", $pos))!==false){\n\t $endPos=$pos + strlen(\"{\".$key.\"}\");\n\t $this->source = substr_replace($this->source, $value, $pos, $endPos-$pos);\n\t }\n\t }\n\t}",
"function dlp_preprocess_block(&$vars) {\n $vars['title_attributes_array']['class'][] = 'title';\n $vars['classes_array'][] = 'clearfix';\n\n}",
"function brafton_block_info()\t{\n\n\t$blocks = array();\n\t\tif( variable_get( 'brafton_blog_headlines' ) == 1 )\t{\n\t\t\t$blocks['headlines'] = array(\n\t\t\t\t'info' => t( 'Brafton Blog Headlines' ),\n\t\t\t\t'cache' => DRUPAL_NO_CACHE,\n\t\t\t);\n\t\t}\n\t\tif( variable_get( 'brafton_video_headlines' ) == 1 )\t{\n\t\t\t$blocks['headlines'] = array(\n\t\t\t\t'info' => t( 'Brafton Video Headlines' ),\n\t\t\t\t'cache' => DRUPAL_NO_CACHE,\n\t\t\t);\n\t\t}\n\t\tif( variable_get( 'brafton_blog_categories' ) == 1 )\t{\n\t\t\t$blocks['categories'] = array(\n\t\t\t\t'info' => t( 'Brafton Blog Categories' ),\n\t\t\t\t'cache' => DRUPAL_NO_CACHE,\n\t\t\t);\n\t\t}\n\t\tif( variable_get( 'brafton_video_categories' ) == 1 )\t{\n\t\t\t$blocks['video_categories'] = array(\n\t\t\t\t'info' => t( 'Brafton Video Categories' ),\n\t\t\t\t'cache' => DRUPAL_NO_CACHE,\n\t\t\t);\n\t\t}\n\t\tif( variable_get( 'brafton_blog_archives' ) == 1 )\t{\n\t\t\t$blocks['archives'] = array(\n\t\t\t\t'info' => t( 'Brafton Blog Archives' ),\n\t\t\t\t'cache' => DRUPAL_NO_CACHE,\n\t\t\t);\n\t\t}\n\t\tif( variable_get( 'brafton_video_archives' ) == 1 )\t{\n\t\t\t$blocks['video_archives'] = array(\n\t\t\t\t'info' => t( 'Brafton Video Archives' ),\n\t\t\t\t'cache' => DRUPAL_NO_CACHE,\n\t\t\t);\n\t\t}\n\treturn $blocks;\n}",
"function gmap_filter_ausgabe_inhalt()\n\t{\n\t\t//Ausgabe rausholen\n\t\t$ausgabe = $this->content->template['table_data'];\n\n\t\t$i = 0;\n\t\t//Ausgabe durchgehen\n\t\tif (is_array($ausgabe)) {\n\t\t\tforeach ($ausgabe as $data) {\n\t\t\t\t//Inhalte �bergeben\n\t\t\t\t$this->inhalt = $inhalt = $data['text'];\n\t\t\t\t//Link rausholen\n\t\t\t\t$link = $this->gmap_get_link_data($inhalt);\n\n\t\t\t\tif (!empty($link)) {\n\t\t\t\t\t//Link aufsplitten\n\t\t\t\t\t$check_ar = $this->gmap_get_link_content($link);\n\t\t\t\t\t//An checked Objekt �bergeben\n\t\t\t\t\tforeach ($check_ar as $check) {\n\t\t\t\t\t\t$this->gmap_make_map($check);\n\t\t\t\t\t\t//Ergebnis eintragen\n\t\t\t\t\t\t$this->gmap_make_text();\n\t\t\t\t\t}\n\t\t\t\t\t//An Template �bergeben\n\t\t\t\t\t$this->content->template['table_data'][$i]['text'] = \"\" . $this->inhalt;\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function blocs_CS_pre_charger($flux) {\r\n\t$r = array(array(\r\n\t\t\"id\" => 'blocs_bloc',\r\n\t\t\"name\" => _T('couteau:pp_blocs_bloc'),\r\n\t\t\"className\" => 'blocs_bloc',\r\n\t\t\"replaceWith\" => \"\\n<bloc>\"._T('couteau:pp_un_titre').\"\\n\\n\"._T('couteau:pp_votre_texte').\"\\n</bloc>\\n\",\r\n\t\t\"display\" => true), array(\r\n\t\t\"id\" => 'blocs_visible',\r\n\t\t\"name\" => _T('couteau:pp_blocs_visible'),\r\n\t\t\"className\" => 'blocs_visible',\r\n\t\t\"replaceWith\" => \"\\n<visible>\"._T('couteau:pp_un_titre').\"\\n\\n\"._T('couteau:pp_votre_texte').\"\\n</visible>\\n\",\r\n\t\t\"display\" => true));\r\n\tforeach(cs_pp_liste_barres('blocs') as $b)\r\n\t\t$flux[$b] = isset($flux[$b])?array_merge($flux[$b], $r):$r;\r\n\treturn $flux;\r\n}",
"function filterMap(): array\n {\n return [];\n }",
"private static function td_homepage_full_1_params() {\r\n $temp_array_filter = self::get_map_filter_array('');\r\n $temp_array_filter = td_util::vc_array_remove_params($temp_array_filter, array(\r\n 'limit',\r\n 'offset'\r\n ));\r\n\r\n return $temp_array_filter;\r\n }",
"private function decide_which_get_captions()\n {\n # We will split the tile (along with its margins) into 12x12 squares.\n # A single geocache placed in square (x, y) gets the caption only\n # when there are no other geocaches in any of the adjacent squares.\n # This is efficient and yields acceptable results.\n\n $matrix = array();\n for ($i=0; $i<12; $i++)\n $matrix[] = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n\n foreach ($this->rows_ref as &$row_ref)\n {\n $mx = ($row_ref[1] + 64) >> 5;\n $my = ($row_ref[2] + 64) >> 5;\n if (($mx >= 12) || ($my >= 12)) continue;\n if (($matrix[$mx][$my] === 0) && ($row_ref[8] == 1)) # 8 is count\n $matrix[$mx][$my] = $row_ref[0]; # 0 is cache_id\n else\n $matrix[$mx][$my] = -1;\n }\n $selected_cache_ids = array();\n for ($mx=1; $mx<11; $mx++)\n {\n for ($my=1; $my<11; $my++)\n {\n if ($matrix[$mx][$my] > 0) # cache_id\n {\n # Check all adjacent squares.\n\n if ( ($matrix[$mx-1][$my-1] === 0)\n && ($matrix[$mx-1][$my ] === 0)\n && ($matrix[$mx-1][$my+1] === 0)\n && ($matrix[$mx ][$my-1] === 0)\n && ($matrix[$mx ][$my+1] === 0)\n && ($matrix[$mx+1][$my-1] === 0)\n && ($matrix[$mx+1][$my ] === 0)\n && ($matrix[$mx+1][$my+1] === 0)\n )\n $selected_cache_ids[] = $matrix[$mx][$my];\n }\n }\n }\n\n foreach ($this->rows_ref as &$row_ref)\n if (in_array($row_ref[0], $selected_cache_ids))\n $row_ref[6] |= TileTree::$FLAG_DRAW_CAPTION;\n }",
"function collabco_theme_preprocess_block(&$vars) {\n\n // var_dump($vars);\n\n $block = $vars['block'];\n\n if ($block->delta == 'likes') {\n $vars['title_attributes_array']['class'][] = 'like-this-collaboration';\n }\n\n}",
"public function filter_block_list( $block_list )\n\t{\n\t\t$block_list[ 'instant_search' ] = _t( 'Instant Search', 'instant_search' );\n\t\treturn $block_list;\n\t}",
"private function labels($block) {\n\t\t$result = array();\n\t\tforeach ($block['labels'] as $i => $v) {\n\t\t\t$result[str_replace(' ', '', $block['labels'][$i])] = $block['data'][$i];\n\t\t}\n\t\treturn $result;\n\t}",
"function bootstraporama_preprocess_block(&$variables, $hook) {\n $black_list = array('block-system-powered-by', 'block-system-main');\n $variables['title_attributes_array']['class'][] = 'block-title';\n if(!in_array($variables['block_html_id'], $black_list)) {\n $variables['classes_array'][] = 'well';\n }\n}",
"function gdstheme_preprocess_block(&$vars) {\n if ($vars['block']->module == 'superfish' || $vars['block']->module == 'nice_menu') {\n $vars['content_attributes_array']['class'][] = 'clearfix';\n }\n if (!$vars['block']->subject) {\n $vars['content_attributes_array']['class'][] = 'no-title';\n }\n if ($vars['block']->region == 'menu_bar' || $vars['block']->region == 'menu_bar_top') {\n $vars['title_attributes_array']['class'][] = 'element-invisible';\n\n $vars['content'] = preg_replace_callback('/>(.*?)</i', 'replace_spaces' , $vars['content']);\n }\n\n $track_progress_blocks = array(\n 'block-views-workbench-moderation-block-1',\n 'block-views-my-comments-block',\n 'block-views-my-challenges-block',\n 'block-views-my-challenges-block-1',\n 'block-views-my-proposals-block',\n 'block-views-my-proposals-block-1',\n 'block-views-my-bookmarks-block-1',\n 'block-views-comments-recent-block',\n 'block-views-meeting-minutes-block',\n 'block-views-surveys-block-1',\n );\n if(in_array($vars['block_html_id'], $track_progress_blocks)){\n $vars['classes_array'][] = 'region';\n }\n\n $track_progress_dividers = array(\n 'block-block-5',\n 'block-block-6',\n );\n if(in_array($vars['block_html_id'], $track_progress_dividers)){\n $vars['classes_array'][] = 'clear';\n }\n\n // Force an empty <h2> to make the columns line up.\n // Done here because the title gets escaped.\n if ($vars['block_html_id'] == 'block-menu-menu-footer-menu-second-column' || $vars['block_html_id'] == 'block-menu-menu-footer-menu-third-column') {\n $vars['block']->subject = ' ';\n }\n}",
"function origins_preprocess_block(&$variables) {\n\t// Output a class on the block title\n\t$variables['title_attributes_array']['class'][] = 'block-title';\n}",
"protected function _blocks_wrapper($block_array = array(), $load_area_name) {\r\n $html = \"\";\r\n if (is_array($block_array))\r\n foreach ($block_array as $block)\r\n $html .= $block[\"html\"];\r\n return $html;\r\n }",
"function gmap_filter_output()\n\t{\n\t\t//Ausgabe rausholen\n\t\tglobal $output;\n\n\t\t$ausgabe = $output;\n\n\t\t//Inhalte �bergeben\n\t\t$this->inhalt = $inhalt = $ausgabe;\n\t\t//Link rausholen\n\t\t$link = $this->gmap_get_link_data($inhalt);\n\n\t\tif (!empty($link)) {\n\t\t\t//Link aufsplitten\n\t\t\t$check_ar = $this->gmap_get_link_content($link);\n\t\t\t$this->content->template['plugin_header'] ='nodecode:\n \t\t\t\t\t<link href=\"https://code.google.com/apis/maps/documentation/javascript/examples/default.css\" rel=\"stylesheet\" type=\"text/css\" />';\n\n\t\t\t$i = 1;\n\n\t\t\t//An checked Objekt �bergeben\n\t\t\tforeach ($check_ar as $check) {\n\t\t\t\tif(count($check_ar) == 1){\n\t\t\t\t\t$this->gmap_make_map($check, 'no');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->gmap_make_map($check, $i);\n\t\t\t\t}\n\t\t\t\t//Ergebnis eintragen\n\t\t\t\t$this->gmap_make_text();\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t//An Template �bergeben\n\t\t\t$ausgabe = \"\" . $this->inhalt;\n\n\t\t\t$ausgabe=str_ireplace(\"</head>\",$this->js_skript_ausgabe.\"</head>\",$ausgabe);\n\t\t\t//$this->content->template['pluginload']\n\t\t\t//$ausgabe=str_ireplace(\"onload=\\\"\",\"onload=\\\" initialize();\",$ausgabe);\n\t\t\t//$ausgabe=str_ireplace(\"visilexit(visi_text);\",\" \",$ausgabe);\n\t\t}\n\n\t\t$output = $ausgabe;\n\t}",
"function hello_world_block_info() {\n $blocks = array();\n $blocks['hello_world_block'] = array(\n 'info' => t('Hello World Block'),\n 'status' => TRUE,\n 'region' => 'sidebar_second',\n );\n return $blocks;\n}",
"private function get_map_data() {\n\t\t\n\t\t//Init vars\n\t\tglobal $prso_google_maps_main;\n\t\t$map_data = array();\n\t\t\n\t\t//Setup dummy test data\n\t\t$map_data = array(\n\t\t\tarray(\n\t\t\t\t'lat'\t\t=>\t'40.756',\n\t\t\t\t'lng'\t\t=>\t'-73.986',\n\t\t\t\t'title'\t\t=> 'example title',\n\t\t\t\t'content'\t=>\tarray(\n\t\t\t\t\t\t\t\t\t'title'\t=> 'example_1'\n\t\t\t\t\t\t\t\t)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'lat'\t\t=>\t'37.775',\n\t\t\t\t'lng'\t\t=>\t'-122.419',\n\t\t\t\t'title'\t\t=> 'example title',\n\t\t\t\t'content'\t=>\tarray(\n\t\t\t\t\t\t\t\t\t'title'\t=> 'example_2'\n\t\t\t\t\t\t\t\t)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'lat'\t\t=>\t'47.620',\n\t\t\t\t'lng'\t\t=>\t'-122.347',\n\t\t\t\t'title'\t\t=> 'example title',\n\t\t\t\t'content'\t=>\tarray(\n\t\t\t\t\t\t\t\t\t'title'\t=> 'example_3'\n\t\t\t\t\t\t\t\t)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'lat'\t\t=>\t'-22.933',\n\t\t\t\t'lng'\t\t=>\t'-43.184',\n\t\t\t\t'title'\t\t=> 'example title',\n\t\t\t\t'content'\t=>\tarray(\n\t\t\t\t\t\t\t\t\t'title'\t=> 'example_4'\n\t\t\t\t\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t\n\t\t\n\t\t//Cache data in global var\n\t\t$this->map_data_cache = $map_data;\n\t\t\n\t\t//Cache data array for use within main viwe template\n\t\t$prso_google_maps_main = $map_data;\n\t\t\n\t}",
"public function _filter(&$map){\n\t\t if ($_SESSION[\"a\"] != 1)$map['status']=array(\"gt\",-1);\n }",
"protected function buildFilters() {\n\t\t// filter to be displayed as link\n\t\t$filterLabels = [];\n\t\tforeach ( [ 'featured', 'unreviewed' ] as $filter ) {\n\t\t\t$count = ArticleFeedbackv5Model::getCount( $filter, $this->pageId );\n\n\t\t\t// Give grep a chance to find the usages:\n\t\t\t// articlefeedbackv5-special-filter-featured, articlefeedbackv5-special-filter-unreviewed\n\t\t\t$filterLabels[$filter] =\n\t\t\t\tHtml::rawElement(\n\t\t\t\t\t'a',\n\t\t\t\t\t[\n\t\t\t\t\t\t'href' => '#',\n\t\t\t\t\t\t'id' => \"articleFeedbackv5-special-filter-$filter\",\n\t\t\t\t\t\t'class' => 'articleFeedbackv5-filter-link' . ( $this->startingFilter == $filter ? ' filter-active' : '' )\n\t\t\t\t\t],\n\t\t\t\t\t$this->msg( \"articlefeedbackv5-special-filter-$filter\" )\n\t\t\t\t\t\t->numParams( $count )\n\t\t\t\t\t\t->escaped()\n\t\t\t\t);\n\t\t}\n\n\t\t// filters to be displayed in dropdown (only for editors)\n\t\t$filterSelectHtml = '';\n\t\tif ( $this->isAllowed( 'aft-editor' ) ) {\n\t\t\t$opts = [];\n\n\t\t\t// Give grep a chance to find the usages:\n\t\t\t// articlefeedbackv5-special-filter-featured, rticlefeedbackv5-special-filter-unreviewed,\n\t\t\t// articlefeedbackv5-special-filter-helpful, articlefeedbackv5-special-filter-unhelpful,\n\t\t\t// articlefeedbackv5-special-filter-flagged, articlefeedbackv5-special-filter-useful,\n\t\t\t// articlefeedbackv5-special-filter-resolved, articlefeedbackv5-special-filter-noaction,\n\t\t\t// articlefeedbackv5-special-filter-inappropriate, articlefeedbackv5-special-filter-archived,\n\t\t\t// articlefeedbackv5-special-filter-allcomment, articlefeedbackv5-special-filter-hidden,\n\t\t\t// articlefeedbackv5-special-filter-requested, articlefeedbackv5-special-filter-declined,\n\t\t\t// articlefeedbackv5-special-filter-oversighted,\n\t\t\t// articlefeedbackv5-special-filter-all\n\t\t\tforeach ( $this->filters as $filter ) {\n\t\t\t\tif ( isset( $filterLabels[$filter] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$count = ArticleFeedbackv5Model::getCount( $filter, $this->pageId );\n\n\t\t\t\t$key = $this->msg( \"articlefeedbackv5-special-filter-$filter\" )\n\t\t\t\t\t\t->numParams( $count )\n\t\t\t\t\t\t->text();\n\t\t\t\t$opts[(string)$key] = $filter;\n\t\t\t}\n\n\t\t\tif ( count( $opts ) > 0 ) {\n\t\t\t\t// Put the \"more filters\" option at the beginning of the opts array\n\t\t\t\t$opts = [ $this->msg( 'articlefeedbackv5-special-filter-select-more' )->text() => '' ] + $opts;\n\n\t\t\t\t$filterSelect = new XmlSelect( false, 'articleFeedbackv5-filter-select' );\n\t\t\t\t$filterSelect->setDefault( $this->startingFilter );\n\t\t\t\t$filterSelect->addOptions( $opts );\n\t\t\t\t$filterSelectHtml = $filterSelect->getHTML();\n\t\t\t}\n\t\t}\n\n\t\treturn Html::rawElement(\n\t\t\t\t'div',\n\t\t\t\t[ 'id' => 'articleFeedbackv5-filter' ],\n\t\t\t\timplode( ' ', $filterLabels ) .\n\t\t\t\tHtml::rawElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t[ 'id' => 'articleFeedbackv5-select-wrapper' ],\n\t\t\t\t\t$filterSelectHtml\n\t\t\t\t)\n\t\t\t);\n\t}",
"public function default_map_short_list() : array {\n $list = [];\n $default_map_settings = $this->default_map_settings();\n\n if ( $default_map_settings['type'] === 'world' ) {\n $list = [ 'world' => 'World' ];\n }\n else if ( $default_map_settings['type'] !== 'world' && empty( $default_map_settings['children'] ) ) {\n $list = [ 'world' => 'World' ];\n }\n else {\n $children = Disciple_Tools_Mapping_Queries::get_by_grid_id_list( $default_map_settings['children'] );\n if ( ! empty( $children ) ) {\n foreach ( $children as $child ) {\n $list[$child['grid_id']] = $child['name'];\n }\n }\n }\n return $list;\n }",
"public function blocks()\n {\n $regions = $this->Block->Regions->find('active')->cache('regions', 'layoutData')->combine('id', 'alias')->toArray();\n \n foreach ($regions as $regionId => $regionAlias) {\n $this->blocksForLayout[$regionAlias] = array();\n\n $blocks = Cache::read('blocks_' . $regionAlias, 'layoutData');\n if ($blocks === false) {\n $blocks = $this->Block->find('active', array(\n 'regionId' => $regionId\n ))->toArray();\n Cache::write('blocks_' . $regionAlias, $blocks, 'layoutData');\n }\n $this->processBlocksData($blocks);\n $this->blocksForLayout[$regionAlias] = $blocks;\n }\n }",
"function getEmptyCategoryMarkers() {\n\t\t$markerArray['CATEGORY_TITLE']=\" \";\n\t\t$markerArray['CATEGORY_DESCRIPTION']=\" \";\n\t\t$markerArray['CATEGORY_TITLE_HEADER_1']=\" \";\n\t\t$markerArray['CATEGORY_TITLE_HEADER_2']=\" \";\n\t\t$markerArray['CATEGORY_TITLE_HEADER']=\" \";\n\t\treturn $markerArray;\n\t}",
"public function filters()\n {\n return CMap::mergeArray(array(\n 'postOnly + copy',\n ), parent::filters());\n }",
"function clubrob_preprocess_block(&$vars) {\r\n if ($vars['block']->region === 'footer' || $vars['block']->region === 'bottom') {\r\n // Get the count of blocks\r\n $blocks = block_list($vars['block']->region);\r\n\r\n $count = count($blocks);\r\n\r\n // Add the class if necessary\r\n switch ($count) {\r\n case 1:\r\n $vars['classes_array'][] = 'col-xs-12';\r\n break;\r\n case 2:\r\n $vars['classes_array'][] = 'col-xs-12 col-md-6';\r\n break;\r\n case 3:\r\n $vars['classes_array'][] = 'col-xs-12 col-md-4';\r\n break;\r\n case 4:\r\n $vars['classes_array'][] = 'col-xs-12 col-md-3';\r\n break;\r\n }\r\n }\r\n\r\n if ($vars['block']->region === 'highlighted') {\r\n $vars['classes_array'][] = 'item';\r\n }\r\n}",
"function b_sitemap_album() {\n\t$block = sitemap_get_categoires_map( icms::$xoopsDB -> prefix( 'album_album' ), 'album_id', 'album_pid', 'album_title', 'index.php?album_id=', 'album_id');\n\treturn $block;\n}"
] | [
"0.5989907",
"0.57505774",
"0.5426072",
"0.54035956",
"0.53915244",
"0.5323195",
"0.52270687",
"0.51559216",
"0.51412207",
"0.5119605",
"0.50966907",
"0.50888854",
"0.50647205",
"0.5059401",
"0.5049463",
"0.50456375",
"0.5044651",
"0.50093454",
"0.49920323",
"0.49832192",
"0.49813098",
"0.49764988",
"0.49665105",
"0.49552232",
"0.4951286",
"0.4946136",
"0.49235007",
"0.49090552",
"0.49013487",
"0.49011022"
] | 0.6349719 | 0 |
modify the blocks params for big grids | public static function td_block_big_grid_params() {
$map_filter_array = self::get_map_filter_array();
// make the grid styles drop down
$td_grid_style_drop_down = array(
"param_name" => "td_grid_style",
"type" => "dropdown",
"value" => array(),
"heading" => "Big grid style:",
"description" => "Each big grid comes in different styles. This option will change the appearance of the grid (including the hover effect).",
"holder" => "div",
"class" => ""
);
foreach (td_global::$big_grid_styles_list as $big_grid_id => $params) {
$td_grid_style_drop_down['value'][$big_grid_id] = $params['text'];
}
// add the grid styles drop down at the top
array_unshift($map_filter_array, array(
"param_name" => "td_grid_style",
"type" => "dropdown",
"value" => array(
'Grid style 1 - Default' => 'td-grid-style-1',
'Grid style 2 - Colours' => 'td-grid-style-2',
'Grid style 3 - Flat colours' => 'td-grid-style-3',
'Grid style 4 - Bottom box' => 'td-grid-style-4',
'Grid style 5 - Black middle' => 'td-grid-style-5',
'Grid style 6 - Lightsky' => 'td-grid-style-6',
'Grid style 7 - Rainbow' => 'td-grid-style-7'
),
"heading" => "Big grid style:",
"description" => "Each big grid comes in different styles. This option will change the appearance of the grid (including the hover effect).",
"holder" => "div",
"class" => ""
));
$map_filter_array = td_util::vc_array_remove_params($map_filter_array, array(
'limit'
));
return $map_filter_array;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function setRowsColsBlocks()\r\n {\r\n $squares = $this->_squares;\r\n $rows = array();\r\n $cols = array();\r\n $blocks = array();\r\n\r\n foreach ($squares as $id => $value)\r\n {\r\n // Assign square value to correct spot in the rows and cols array.\r\n\r\n $row = $this->getRow($id);\r\n $col = $this->getCol($id);\r\n $rows[$row][$col] = $value;\r\n $cols[$col][$row] = $value;\r\n\r\n // Assign square value to correct spot in the blocks array\r\n\r\n\r\n $block = $this->getBlock($id);\r\n $blocks[$block][$id] = $value;\r\n\r\n }\r\n $this->_rows = $rows;\r\n $this->_cols = $cols;\r\n $this->_blocks = $blocks;\r\n }",
"public function setBlocks($newVal) {\n $this->blocks=$newVal;\n }",
"public function setBlocks(array $blocks);",
"protected function set_params() {}",
"function load_blocks() {\r\n\r\n require_once LIBRARY_DIR . \"Module.php\";\r\n require_once LIBRARY_DIR . \"Block.php\";\r\n\r\n // load blocks\r\n $this->block_list = Content::get_block_list($this->layout_id, $this->type_id, $this->content_id);\r\n if ( $this->block_list ) {\r\n foreach ( $this->block_list as $block) {\r\n // if selected is true the block can read the parameters\r\n $this->block( $block );\r\n }\r\n }\r\n \r\n }",
"function _{PROFILE_CODE}_setup_blocks() {\n $admin_theme = variable_get('admin_theme', 'seven');\n $default_theme = variable_get('theme_default', 'bartik');\n\n $blocks = array(\n array(\n 'module' => 'system',\n 'delta' => 'help',\n 'theme' => $admin_theme,\n 'status' => 1,\n 'weight' => 0,\n 'region' => 'help',\n 'pages' => '',\n 'cache' => DRUPAL_NO_CACHE,\n ),\n array(\n 'module' => 'system',\n 'delta' => 'help',\n 'theme' => $default_theme,\n 'status' => 1,\n 'weight' => 0,\n 'region' => 'preface_first',\n 'pages' => '',\n 'cache' => DRUPAL_NO_CACHE,\n ),\n array(\n 'module' => 'system',\n 'delta' => 'main',\n 'theme' => $default_theme,\n 'status' => 1,\n 'weight' => 0,\n 'region' => 'content',\n 'pages' => '<front>', // Do not show the block on front.\n 'visibility' => 0,\n 'cache' => DRUPAL_NO_CACHE,\n ),\n // Connector.\n array(\n 'module' => 'connector',\n 'delta' => 'one_click_block',\n 'theme' => $default_theme,\n 'status' => 1,\n 'weight' => 1,\n 'region' => 'content',\n 'pages' => \"user\\r\\nuser/login\",\n 'visibility' => BLOCK_VISIBILITY_LISTED,\n 'cache' => DRUPAL_NO_CACHE,\n ),\n // Search sorting.\n array(\n 'module' => 'search_api_sorts',\n 'delta' => 'search-sorts',\n 'theme' => $default_theme,\n 'status' => 1,\n 'weight' => -30,\n 'region' => 'content',\n 'pages' => 'products',\n 'visibility' => BLOCK_VISIBILITY_LISTED,\n 'cache' => DRUPAL_NO_CACHE,\n ),\n );\n\n drupal_static_reset();\n _block_rehash($admin_theme);\n _block_rehash($default_theme);\n foreach ($blocks as $record) {\n $module = array_shift($record);\n $delta = array_shift($record);\n $theme = array_shift($record);\n db_update('block')\n ->fields($record)\n ->condition('module', $module)\n ->condition('delta', $delta)\n ->condition('theme', $theme)\n ->execute();\n }\n}",
"public static function initBlocks () {\n \n $blocks = conf::getMainIni('blocks_all');\n if (!isset($blocks)) { \n return;\n }\n \n $blocks = explode(',', $blocks);\n foreach ($blocks as $val) {\n self::$blocksContent[$val] = self::parseBlock($val);\n } \n }",
"function load_all_block(){\n\t\t\tglobal $econfig;\n\t\t\t$estore_id = $econfig ->id;\n\t\t\t$table = 'fs_eblocks';\n\t\t\t$Itemid = FSInput::get('Itemid',1);\n\t\t\t$sql = \" SELECT id,title,content, ordering, module, position, showTitle, params\n\t\t\t\t\t\tFROM \".$table .\" AS a \n\t\t\t\t\t\tWHERE published = 1 \n\t\t\t\t\t\t\tAND estore_id = $estore_id\n\t\t\t\t\t\t\tAND ( is_buy = 1 OR buy_expired_time >= NOW() )\n\t\t\t\t\t\t\tAND (listItemid = 'all'\n\t\t\t\t\t\t\tOR listItemid = $Itemid\n\t\t\t\t\t\t\tOR listItemid like '%,$Itemid'\n\t\t\t\t\t\t\tOR listItemid like '$Itemid,%'\n\t\t\t\t\t\t\tOR listItemid like '%,$Itemid,%')\n\t\t\t\t\t\t\tORDER by ordering\";\n\t\t\tglobal $db;\n\t\t\t$db->query($sql);\n\t\t\t$list = $db->getObjectList();\n\t\t\t$arr_blocks = array();\n\t\t\tforeach ($list as $item) {\n\t\t\t\t$arr_blocks[$item -> position ][$item->id] = $item;\n\t\t\t}\n\t\t\t$this -> arr_blocks = $arr_blocks;\n\t\t}",
"private function _update() {\n $this->db->replace(XCMS_Tables::TABLE_ARTICLES_BLOCKS, $this->getArray());\n }",
"public function setDefaultParams()\n\t{\n\t\t$this->position = 'wrap';\n\t\t\n\t\t$this->render_time = 'normal';\n\t}",
"function custom_panes_gridblock_render($subtype, $conf, $panel_args, $context = NULL) {\n // You can get the node entity from the $context via $context->data.\n $block = new stdClass();\n $block->content = '';\n $image_url = NULL;\n $style_attributes = NULL;\n $image = array();\n $button_text = '';\n $button_style = '';\n $title = '';\n $subtitle = '';\n $classes = array();\n\n\n if (!empty($conf['pane_classes'])) {\n $classes['class'] = explode(',', $conf['pane_classes']);\n }\n // General styling class\n $classes['class'][] = 'gridblock-item';\n\n if (!empty($conf['pane_style_options'])) {\n\n switch ($conf['pane_style_options']) {\n case 'style_1':\n $classes['class'][] = 'gridblock-style__default';\n break;\n case 'style_2':\n $classes['class'][] = 'gridblock-style__long';\n break;\n case 'style_3':\n $classes['class'][] = 'gridblock-style__short';\n break;\n default:\n $classes['class'][] = 'gridblock-style__default';\n break;\n }\n\n } else {\n $classes['class'][] = 'gridblock-style__default';\n }\n\n if (!empty($conf['pane_image'])) {\n // Capture the image file path and form into HTML with attributes\n $image_file = file_load($conf['pane_image'], '');\n $image_path = '';\n\n if (isset($image_file->uri)) {\n $image_uri = $image_file->uri;\n $image_style = $conf['image_style'];\n\n if ($image_style == '') {\n // If no image style is selected, use the original image.\n $image_url = file_create_url($image_uri);\n // $image_info = getimagesize($image_url); // If we want to add height in style attribute.\n } else {\n // Image style is provided in the settings form.\n $image_style_url = image_style_url($image_style, $image_uri);\n $image_url = $image_style_url;\n // $image_info = image_get_info($image_uri);\n }\n\n $style_attributes = 'style=\"background-image: url(' . $image_url . ')\";';\n // $style_attributes['style'] = 'background-image: url(' . $image_url . ');height:' . $image_info[1] .'px;';\n $classes['class'][] = 'has-background-image';\n }\n }\n\n if (!empty($conf['url'])) {\n $path = trim($conf['url']);\n }\n\n $block->content = '<div ' . drupal_attributes($classes) . '><div class=\"gridblock--inner\"' . $style_attributes . '>';\n\n // $inline_css .= '.pane-hero {height:' . $image_info2['height'] . 'px' . ';background-image: url('. file_create_url($image_uri2) .');}';\n // drupal_add_css(\n // $inline_css,\n // array(\n // 'group' => CSS_THEME,\n // 'type' => 'inline',\n // )\n // );\n\n $block->content .= '<div class=\"gridblock--text\">';\n\n if (!empty($conf['title'])) {\n $title = t($conf['title']);\n $block->content .= '<h2 class=\"gridblock--title\">' . $title . '</h2>';\n }\n\n if (!empty($conf['subtitle'])) {\n $subtitle = t($conf['subtitle']);\n $block->content .= '<h3 class=\"gridblock--subtitle\">' . $subtitle . '</h3>';\n }\n\n if (!empty($conf['pane_description']['value'])) {\n $title = t($conf['title']);\n $block->content .= '<div class=\"gridblock--description\">' . $conf['pane_description']['value'] . '</div>';\n }\n\n $block->content .= '</div>';\n\n if (isset($conf['show_button']) && $conf['show_button'] && !empty($conf['url'])) {\n $button_style= $conf['button_style'];\n $button_text = t($conf['button_text']);\n\n switch ($button_style) {\n case 'style2':\n $btn_class = 'btn__outline';\n break;\n case 'style3':\n $btn_class = 'btn__arrow';\n break;\n default:\n $btn_class = 'btn__default';\n break;\n }\n\n $block->content .= l($button_text, $path , array('attributes' => array('class' => array($btn_class))));\n\n }\n\n $block->content .= '</div></div>';\n\n return $block;\n}",
"public function setPageBlock($pageId, $blockInfo)\n {\n global $My_Sql;\n global $My_Kernel;\n // var_dump(__LINE__, $pageId, $blockInfo);\n\n $My_Block = $My_Kernel->getClass('block', $this->_db);\n // add new blocks into page\n if(isset($blockInfo['block'], $blockInfo['position'])) {\n /*\n * First, check if the block with the position is already existing in this page.\n * if exists, and page is excluded to show by this block, remove data from excluding pages;\n * if the block only excludes this page, reset block show type in every page.\n */\n $blocks = $My_Block->getPageBlocks($pageId);\n // var_dump(__LINE__, $blocks);\n foreach($blocks as $block) {\n $positionKey = array_search($block['position_id'], $blockInfo['position']);\n $blockKey = array_search($block['block_id'], $blockInfo['block']);\n $isExcludePage = MY_EXCLUDE_PAGE==$block['show_in_type'];\n if($blockKey===$positionKey && false!==$blockKey && $isExcludePage) {\n $pages = $My_Block->getExcludePageByBlockId($block['block_id']);\n // var_dump(__LINE__, $pages);\n $pagesCount = count($pages);\n foreach($pages as $page) {\n if($page['page_id']==$pageId) {\n $My_Block->removeBlockPage($page['using_page_id']);\n $pagesCount--;\n }\n }\n /* the existing block only excludes this page,\n * reset the block is shown in every page\n */\n if($pagesCount==0){\n $My_Block->setUsingBlock($block['using_block_id'], array('showInType'=> MY_ALL_PAGE));\n unset($blockInfo['block'][$blockKey]);\n unset($blockInfo['position'][$blockKey]);\n }\n }\n }\n /*\n * add new using block\n */\n // var_dump(__LINE__, $blockInfo['block']);\n foreach($blockInfo['block'] as $key=>$blockId) {\n if(!isset($blockInfo['position'][$key])) {\n continue;\n }\n $blockName = isset($blockInfo['name'][$key]) ? $blockInfo['name'][$key] : '';\n $visibleBlock = array('position_id' => $blockInfo['position'][$key],\n 'block_id' => $blockId,\n 'page_id' => $pageId,\n 'block_name' => $blockName,\n 'show_in_type'=> MY_INCLUDE_PAGE\n );\n // var_dump(__LINE__, $visibleBlock);\n $usingBlockId = $My_Block->addVisibleBlock($visibleBlock);;\n // var_dump(__LINE__, $usingBlockId);\n }\n }\n\n if (isset($blockInfo['remove'])) {\n $blocks = $My_Block->getUsingBlockByIds($blockInfo['remove']);\n // var_dump(__LINE__, $blocks);\n $_tmpBlocks = array();\n foreach($blocks as $block) {\n $_tmpBlocks[$block['using_block_id']] = $block;\n }\n // var_dump(__LINE__, $blockInfo['remove']);\n foreach($blockInfo['remove'] as $key=>$usingBlockId) {\n if(isset($_tmpBlocks[$usingBlockId])) {\n switch($_tmpBlocks[$usingBlockId]['show_in_type']) {\n case MY_ALL_PAGE:\n $My_Block->setUsingBlock($block['using_block_id'], array('showInType', MY_EXCLUDE_PAGE));\n case MY_EXCLUDE_PAGE:// add this page into exclude page list\n $My_Block->addBlockPage($usingBlockId, $pageId);\n break;\n\n case MY_INCLUDE_PAGE: // check if page id in the include page list, if yes, remove it\n if(!empty($blockInfo['removePage'][$key])) {\n $My_Block->removeBlockPage($blockInfo['removePage'][$key]);\n }\n if(count($My_Block->getIncludePageByUsingBlockId($usingBlockId))==0){\n $My_Block->removeUsingBlock($usingBlockId);\n }\n break;\n\n default:\n break;\n }\n }\n }\n }\n }",
"private function distributeBlocks() {\n $plugin = SJTTournamentTools::getInstance();\n\t\t$level = Server::getInstance()->getDefaultLevel();\n\t\t$locations = $plugin->getLocationManager()->getLocations();\n\n\t\tforeach ($locations as $k => $v) {\n\t\t\tif (rand(0, 10) < 5) {\n $plugin->getLogger()->info('Treasure at ' . $k . ' ' . $v['x'] . ',' . $v['y'] . ',' . $v['z']);\n\t\t\t\t$level->setBlock(new Vector3($v['x'], $v['y'], $v['z']), new Gold(), false, false);\n\t\t\t} else {\n $plugin->getLogger()->info('Air at ' . $k . ' ' . $v['x'] . ',' . $v['y'] . ',' . $v['z']);\n\t\t\t\t$level->setBlock(new Vector3($v['x'], $v['y'], $v['z']), new Air(), false, false);\n }\n\t\t}\n\t}",
"public function get_block_config() {\n\n\t\t$config = parent::get_block_config();\n\n\t\t$config['title'] = esc_html__( 'Pods - List Items', 'pods-gutenberg-blocks' );\n\t\t$config['description'] = esc_html__( 'List multiple Pod items', 'pods-gutenberg-blocks' );\n\n\t\treturn $config;\n\n\t}",
"public function setParams()\n {\n // section 10-10--91-60-7f09995f:12e75e0bc39:-8000:000000000000093A begin\n // section 10-10--91-60-7f09995f:12e75e0bc39:-8000:000000000000093A end\n }",
"public function set_grid_defaults() {\n\t\t// Get the global settings, using the global defaults if no custom\n\t\t// globals are set\n\t\t$global_settings = Settings\\get_global_settings( true );\n\n\t\t// Set the grid's defaults to the global settings\n\t\tself::$grid_defaults = array(\n\t\t\t'ids' => '',\n\t\t\t'item_total' => $global_settings['item_total'],\n\t\t\t'image_width' => $global_settings['image_width'],\n\t\t\t'image_height' => $global_settings['image_height'],\n\t\t\t'before_label' => $global_settings['before_label'],\n\t\t\t'after_label' => $global_settings['after_label'],\n\t\t);\n\t}",
"private static function td_block_trending_now_params() {\r\n $map_block_array = self::get_map_filter_array();\r\n\r\n //move on the first position the new filter array - array_unshift is used to keep the 0 1 2 index. array_marge does not do that\r\n array_unshift(\r\n $map_block_array,\r\n array(\r\n \"param_name\" => \"navigation\",\r\n \"type\" => \"dropdown\",\r\n \"value\" => array('Auto' => '', 'Manual' => 'manual'),\r\n \"heading\" => 'Navigation:',\r\n \"description\" => \"If set on `Auto` will set the `Trending Now` block to auto start rotating posts\",\r\n \"holder\" => \"div\",\r\n \"class\" => \"\"\r\n ),\r\n\r\n array(\r\n \"param_name\" => \"style\",\r\n \"type\" => \"dropdown\",\r\n \"value\" => array('Default' => '', 'Style 2' => 'style2'),\r\n \"heading\" => 'Style:',\r\n \"description\" => \"Style of the `Trending Now` box\",\r\n \"holder\" => \"div\",\r\n \"class\" => \"\"\r\n ),\r\n\r\n\t array(\r\n\t\t \"type\" => \"colorpicker\",\r\n\t\t \"holder\" => \"div\",\r\n\t\t \"class\" => \"\",\r\n\t\t \"heading\" => 'Title text color',\r\n\t\t \"param_name\" => \"header_text_color\",\r\n\t\t \"value\" => '',\r\n\t\t \"description\" => 'Optional - Choose a custom title text color for this block'\r\n\t ),\r\n\r\n\t array(\r\n\t\t \"type\" => \"colorpicker\",\r\n\t\t \"holder\" => \"div\",\r\n\t\t \"class\" => \"\",\r\n\t\t \"heading\" => 'Title background color',\r\n\t\t \"param_name\" => \"header_color\",\r\n\t\t \"value\" => '',\r\n\t\t \"description\" => 'Optional - Choose a custom title background color for this block'\r\n\t )\r\n );\r\n\r\n return $map_block_array;\r\n }",
"public function setBlockinfo($blockinfo) {\n\t\t$this->blockinfo = $blockinfo;\n\t}",
"function blocks1(){\n\t foreach($this->vars as $key=>$value){\n\t $pos=0;\n\t while(($pos=strpos($this->source, \"{block \".$key.\"}\", $pos))!==false&&($endPos=strpos($this->source, \"{-block \".$key.\"}\", $pos))!==false){\n\t $endPos+= strlen(\"{-block \".$key.\"}\");\n\t if(isset($value)&&$value==0)\n\t $this->source = substr_replace($this->source, '', $pos, $endPos-$pos);\n\t elseif(isset($value)){\n\t $temp = substr($this->source, $pos, $endPos-$pos);\n\t $temp = str_replace(\"{block \".$key.\"}\", '', $temp);\n\t $temp = str_replace(\"{-block \".$key.\"}\", '', $temp);\n\t $this->source = substr_replace($this->source, $temp, $pos, $endPos-$pos);\n\t }\n\t }\n\t \n\t $pos=0; \n\t while(($pos=strpos($this->source, \"{\".$key.\"}\", $pos))!==false){\n\t $endPos=$pos + strlen(\"{\".$key.\"}\");\n\t $this->source = substr_replace($this->source, $value, $pos, $endPos-$pos);\n\t }\n\t }\n\t}",
"private function clearBlocks() {\n $plugin = SJTTournamentTools::getInstance();\n\t\t$level = Server::getInstance()->getDefaultLevel();\n\t\t$locations = $plugin->getLocationManager()->getLocations();\n\n\t\tforeach ($locations as $k => $v) {\n $level->setBlock(new Vector3($v['x'], $v['y'], $v['z']), new Air(), true, true);\n \t\t}\n }",
"private static function td_slide_params() {\r\n $map_block_array = self::get_map_block_general_array();\r\n\r\n // remove some of the params that are not needed for the slide\r\n $map_block_array = td_util::vc_array_remove_params($map_block_array, array(\r\n 'border_top',\r\n 'ajax_pagination',\r\n 'ajax_pagination_infinite_stop'\r\n ));\r\n\r\n // add some more\r\n $temp_array_merge = array_merge(\r\n array(\r\n array(\r\n \"param_name\" => \"autoplay\",\r\n \"type\" => \"textfield\",\r\n \"value\" => '',\r\n \"heading\" => 'Autoplay slider (at x seconds)',\r\n \"description\" => \"Leave empty do disable autoplay\",\r\n \"holder\" => \"div\",\r\n \"class\" => \"\"\r\n )\r\n ),\r\n self::get_map_filter_array(),\r\n $map_block_array\r\n );\r\n return $temp_array_merge;\r\n }",
"public static function initBlocks() \n\t{\n\t\t\n\t\t$block_paths = apply_filters('mb-block-paths', array(MB()->get_plugin_path() . \"blocks/\") );\n\t\t \n\t\t//global $blockClass; // load requires only onc\n\n\t\t$newBlocks = array();\n\t\t$templates = array(); \n\t\t\n\t\t\n\t\tforeach($block_paths as $block_path)\n\t\t{\n\t\t\t$dir_iterator = new RecursiveDirectoryIterator($block_path, FilesystemIterator::SKIP_DOTS);\n\t\t\t$iterator = new RecursiveIteratorIterator($dir_iterator, RecursiveIteratorIterator::SELF_FIRST);\n\n\t\t\tforeach ($iterator as $fileinfo)\n\t\t\t{\n\n\t\t\t\t$path = $fileinfo->getRealPath(); \n\t\t\t\t// THIS IS PHP > 5.3.6\n\t\t\t\t//$extension = $fileinfo->getExtension(); \n\t\t\t\t$extension = pathinfo($path, PATHINFO_EXTENSION);\n\t\t\t\n\t\t\t\tif ($fileinfo->isFile() )\n\t\t\t\t{\n\t\t\t\t\tif ($extension == 'php') \n\t\t\t\t\t{\n\t\t\t\t\t \trequire_once($path);\n\t\t\t\t\t}\n\t\t\t\t\telseif($extension == 'tpl') \n\t\t\t\t\t{\t\n\t\t\t\t\t\t$filename = $fileinfo->getBasename('.tpl');\n\t\t\t\t\t\t$templates[$filename] = array('path' => $path); \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t\tksort($blockOrder);\n\t\t\tforeach($blockOrder as $prio => $blockArray)\n\t\t\t{\n\t\t\t\tforeach($blockArray as $block)\n\t\t\t\t{\n\t\t\t\t\tif (isset($blockClass[$block]))\n\t\t\t\t\t\t$newBlocks[$block] = $blockClass[$block]; \n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t$blockClass = $newBlocks;\n\t\t\tif (is_admin())\n\t\t\t{\n\t\t\t\t// possible issue with some hosters faking is_admin flag. \n\t\t\t\tif (class_exists( maxUtils::namespaceit('maxBlocks') ) && class_exists( maxUtils::namespaceit('maxBlocks') ) )\n\t\t\t\t{\n\t\t\t\t\tmaxField::setTemplates($templates); \n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\terror_log('[MaxButtons] - MaxField class is not set within admin context. This can cause issues when using button editor'); \n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t//$this->loadBlockClasses($blockClass); \n\t\t\n\t\tstatic::$block_classes = array_values($blockClass);\n\t}",
"private function initiallize(){\n $this->grid = array();\n\n for($pos_x = 0; $pos_x < $this->grid_size; $pos_x++){\n\n for($pos_y = 0; $pos_y < $this->grid_size; $pos_y++) {\n $this->grid[ $pos_x ][ $pos_y ] = 'W';\n }\n }\n }",
"protected function setupGrid() \n\t{\n\t\t$adjustment = 0;\n\t\tif ($this->bool_user_data_range && $this->data_min >= 0) {\n\t\t\t$adjustment = $this->data_min * $this->unit_scale;\n\t\t}\n\n\t\t$this->calculateGridHoriz($adjustment);\n\t\t$this->calculateGridVert();\n\t\t$this->generateGrids();\n\t\t$this->generateGoalLines($adjustment);\n\t}",
"public function blocks()\n {\n $regions = $this->Block->Regions->find('active')->cache('regions', 'layoutData')->combine('id', 'alias')->toArray();\n \n foreach ($regions as $regionId => $regionAlias) {\n $this->blocksForLayout[$regionAlias] = array();\n\n $blocks = Cache::read('blocks_' . $regionAlias, 'layoutData');\n if ($blocks === false) {\n $blocks = $this->Block->find('active', array(\n 'regionId' => $regionId\n ))->toArray();\n Cache::write('blocks_' . $regionAlias, $blocks, 'layoutData');\n }\n $this->processBlocksData($blocks);\n $this->blocksForLayout[$regionAlias] = $blocks;\n }\n }",
"private function modifyBlockData()\n {\n add_filter('render_block_data', function ($block, $source_block) {\n $block['attrs']['source'] = $source_block;\n return $block;\n }, 10, 2);\n }",
"function execute() {\n\t\t// Save the block plugin layout settings.\n\t\t$blockVars = array('blockSelectLeft', 'blockUnselected', 'blockSelectRight');\n\t\tforeach ($blockVars as $varName) {\n\t\t\t$$varName = split(' ', Request::getUserVar($varName));\n\t\t}\n\n\t\t$plugins =& PluginRegistry::loadCategory('blocks');\n\t\tforeach ($plugins as $key => $junk) {\n\t\t\t$plugin =& $plugins[$key]; // Ref hack\n\t\t\t$plugin->setEnabled(!in_array($plugin->getName(), $blockUnselected));\n\t\t\tif (in_array($plugin->getName(), $blockSelectLeft)) {\n\t\t\t\t$plugin->setBlockContext(BLOCK_CONTEXT_LEFT_SIDEBAR);\n\t\t\t\t$plugin->setSeq(array_search($key, $blockSelectLeft));\n\t\t\t} else if (in_array($plugin->getName(), $blockSelectRight)) {\n\t\t\t\t$plugin->setBlockContext(BLOCK_CONTEXT_RIGHT_SIDEBAR);\n\t\t\t\t$plugin->setSeq(array_search($key, $blockSelectRight));\n\t\t\t}\n\t\t\tunset($plugin);\n\t\t}\n\n\t\t$site =& Request::getSite();\n\t\t$siteSettingsDao =& DAORegistry::getDAO('SiteSettingsDAO');\n\n\t\t$settings = array('theme');\n\n\t\tforeach ($this->_data as $name => $value) {\n\t\t\tif (isset($settings[$name])) {\n\t\t\t\t$isLocalized = in_array($name, $this->getLocaleFieldNames());\n\t\t\t\t$siteSettingsDao->updateSetting(\n\t\t\t\t\t$name,\n\t\t\t\t\t$value,\n\t\t\t\t\t$this->settings[$name],\n\t\t\t\t\t$isLocalized\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}",
"public function blocks()\n {\n $regions = $this->controller->Block->Region->find('list', array(\n 'conditions' => array(\n 'Region.block_count >' => '0',\n ),\n 'fields' => array(\n 'Region.id',\n 'Region.alias',\n ),\n 'cache' => array(\n 'name' => 'croogo_regions',\n 'config' => 'croogo_blocks',\n ),\n ));\n \n //Visibility paths\n $visibility = array();\n $visibility[] = array('Block.visibility_paths'=>'');\n $visibility[] = array('Block.visibility_paths LIKE'=>'%\"'.$this->controller->params['url']['url'].'\"%');\n $visibility[] = array('Block.visibility_paths LIKE'=>'%\"' . 'controller:' . $this->controller->params['controller'] . '/' . 'action:' . $this->controller->params['action'] . '\"%');\n \n if(isset($this->controller->params['type']))\n {\n $visibility[] = array('Block.visibility_paths LIKE'=>'%\"' . 'controller:' . $this->controller->params['controller'] . '/' . 'action:' . $this->controller->params['action'] . '/' . 'type:' . $this->controller->params['type'] . '\"%');\n }\n \n if(isset($this->controller->params['slug']))\n {\n $visibility[] = array('Block.visibility_paths LIKE'=>'%\"' . 'controller:' . $this->controller->params['controller'] . '/' . 'action:' . $this->controller->params['action'] . '/' . 'slug:' . $this->controller->params['slug'] . '\"%');\n }\n \n foreach ($regions AS $regionId => $regionAlias) {\n $this->blocks_for_layout[$regionAlias] = array();\n $findOptions = array(\n 'conditions' => array(\n 'Block.status' => 1,\n 'Block.region_id' => $regionId,\n 'AND' => array(\n array(\n 'OR' => array(\n 'Block.visibility_roles' => '',\n 'Block.visibility_roles LIKE' => '%\"' . $this->Croogo->roleId . '\"%',\n ),\n ),\n array(\n 'OR' => $visibility,\n )\n ),\n ),\n 'order' => array(\n 'Block.weight' => 'ASC'\n ),\n 'cache' => array(\n 'prefix' => 'croogo_blocks_'.$regionAlias.'_'.$this->Croogo->roleId.'_blockanywhere_',\n 'config' => 'croogo_blocks',\n ),\n 'recursive' => '-1',\n );\n $blocks = $this->controller->Block->find('all', $findOptions);\n $this->Croogo->processBlocksData($blocks);\n $this->blocks_for_layout[$regionAlias] = $blocks;\n }\n \n $this->Croogo->blocks_for_layout = $this->blocks_for_layout;\n }",
"public function __construct($blocks)\n {\n $this->blocks = $blocks;\n }",
"public function setBlockCount($count);"
] | [
"0.61788195",
"0.587543",
"0.5824478",
"0.58032703",
"0.55486935",
"0.5439366",
"0.54235667",
"0.53665537",
"0.5364568",
"0.536127",
"0.53597903",
"0.5357934",
"0.5353046",
"0.5351481",
"0.5344624",
"0.5309224",
"0.5309024",
"0.5292631",
"0.5290397",
"0.52864903",
"0.52782464",
"0.5261942",
"0.5238016",
"0.52212226",
"0.5211662",
"0.5193112",
"0.51897895",
"0.51783484",
"0.5162736",
"0.5157049"
] | 0.70725083 | 0 |
Map array for td_homepage_full_1_params | private static function td_homepage_full_1_params() {
$temp_array_filter = self::get_map_filter_array('');
$temp_array_filter = td_util::vc_array_remove_params($temp_array_filter, array(
'limit',
'offset'
));
return $temp_array_filter;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function get_params_mapping()\n\t{\n\t\treturn [];\n\t}",
"public function getParameterMap();",
"public function getParameterMap();",
"private function createParams(){\n\n //filters from the map...\n $filters =[];\n $mainmenu = $this->getMenu();//Session::get('mainmenu');\n //we can make the aggregates...\n $params = [];\n for($i=0;$i<count($mainmenu['filters']);$i++){\n $filter = $mainmenu['filters'][$i];\n if (!array_key_exists ($filter, $params)) $params[$filter] = ['terms' => ['field' => $filter]];\n }\n\n return $params;\n }",
"public function get_params_map() {\r\n $result = array();\r\n foreach ($this->groups as $group) {\r\n $items = array();\r\n foreach ($group['items'] as $item => $type) {\r\n if ($type) {\r\n $items[] = $item;\r\n }\r\n }\r\n $result[$group['name']] = $items;\r\n }\r\n return $result;\r\n }",
"function iform_map_get_map_parameters() {\n $r = array(\n array(\n 'name' => 'map_centroid_lat',\n 'caption' => 'Centre of Map Latitude',\n 'description' => 'WGS84 Latitude of the initial map centre point, in decimal form. Set to \"default\" to use the settings '.\n 'defined in the IForm Settings page.',\n 'type' => 'text_input',\n 'group' => 'Initial Map View',\n 'default' => 'default'\n ),\n array(\n 'name' => 'map_centroid_long',\n 'caption' => 'Centre of Map Longitude',\n 'description' => 'WGS84 Longitude of the initial map centre point, in decimal form. Set to \"default\" to use the settings defined in the IForm Settings page.',\n 'type' => 'text_input',\n 'group' => 'Initial Map View',\n 'default' => 'default'\n ),\n array(\n 'name' => 'map_zoom',\n 'caption' => 'Map Zoom Level',\n 'description' => 'Zoom level of the initially displayed map. Set to \"default\" to use the settings defined in the IForm Settings page.',\n 'type' => 'text_input',\n 'group' => 'Initial Map View',\n 'default' => 'default'\n ),\n array(\n 'name' => 'map_width',\n 'caption' => 'Map Width',\n 'description' => 'Width in pixels of the map, or a css specification for the width, e.g. 75%.',\n 'type' => 'text_input',\n 'group' => 'Initial Map View',\n 'default' => '100%'\n ),\n array(\n 'name' => 'map_height',\n 'caption' => 'Map Height (px)',\n 'description' => 'Height in pixels of the map.',\n 'type' => 'int',\n 'group' => 'Initial Map View',\n 'default'=>600\n ),\n array(\n 'name' => 'remember_pos',\n 'caption' => 'Remember Position',\n 'description' => 'Tick this box to get the map to remember it\\'s last position when reloading the page. This uses cookies so cookies must be enabled for it to work and '.\n 'you must notify your users to ensure you comply with European cookie law.',\n 'type' => 'checkbox',\n 'required' => FALSE,\n 'group' => 'Initial Map View'\n ),\n array(\n 'name' => 'location_boundary_id',\n 'caption' => 'Location boundary to draw',\n 'description' => 'ID of a location whose boundary should be shown on the map (e.g. to define the perimeter of a survey area).',\n 'type' => 'textfield',\n 'group' => 'Initial Map View',\n 'required' => FALSE,\n ),\n array(\n 'name' => 'preset_layers',\n 'caption' => 'Preset Base Layers',\n 'description' => 'Select the preset base layers that are available for the map. When using Google map layers, please ensure you adhere to the '.\n '<a href=\"http://code.google.com/apis/maps/terms.html\">Google Maps/Google Earth APIs Terms of Service</a>. When using the Bing map layers, '.\n 'please ensure that you read and adhere to the <a href=\"http://www.microsoft.com/maps/product/terms.html\">Bing Maps terms of use</a>. '.\n 'The Microsoft Virtual Earth layer is now mapped to the Bing Aerial layer so is provided for backwards compatibility only. You can '.\n 'sort the layers into the order you require by dragging and dropping the layer labels.',\n 'type' => 'list',\n 'options' => array(\n 'google_physical' => 'Google Physical',\n 'google_streets' => 'Google Streets',\n 'google_hybrid' => 'Google Hybrid',\n 'google_satellite' => 'Google Satellite',\n 'bing_aerial' => 'Bing Aerial',\n 'bing_hybrid' => 'Bing Hybrid',\n 'bing_shaded' => 'Bing Shaded',\n 'bing_os' => 'Bing Ordnance Survey',\n 'dynamicOSGoogleSat' => 'Dynamic (OpenStreetMap > Ordnance Survey Leisure > Google Satellite)',\n 'dynamicOSMGoogleSat' => 'Dynamic (OpenStreetMap > Google Satellite)',\n 'osm' => 'OpenStreetMap',\n 'otm' => 'OpenTopoMap',\n 'os_leisure' => 'OS Leisure',\n 'os_outdoor' => 'OS Outdoor',\n 'os_road' => 'OS Road',\n 'os_light' => 'OS Light',\n ),\n 'sortable' => TRUE,\n 'group' => 'Base Map Layers',\n 'required' => FALSE\n ),\n array(\n 'name' => 'wms_base_title',\n 'caption' => 'Additional WMS Base Layer Caption',\n 'description' => 'Caption to display for the optional WMS base map layer',\n 'type' => 'textfield',\n 'group' => 'Base Map Layers',\n 'required' => FALSE\n ),\n array(\n 'name' => 'wms_base_url',\n 'caption' => 'Additional WMS Base Layer Service URL',\n 'description' => 'URL of the WMS service to display for the optional WMS base map layer',\n 'type' => 'textfield',\n 'group' => 'Base Map Layers',\n 'required' => FALSE\n ),\n array(\n 'name' => 'wms_base_layer',\n 'caption' => 'Additional WMS Base Layer Name',\n 'description' => 'Layername of the WMS service layer for the optional WMS base map layer',\n 'type' => 'textfield',\n 'group' => 'Base Map Layers',\n 'required' => FALSE\n ),\n array(\n 'name' => 'tile_cache_layers',\n 'caption' => 'Tile cache JSON (deprecated)',\n 'description' => 'JSON describing the tile cache layers to make available. For advanced users only. ' .\n 'Deprecated - use Other base layer config instead.',\n 'type' => 'textarea',\n 'group' => 'Advanced Base Map Layers',\n 'required' => FALSE\n ),\n array(\n 'name' => 'other_base_layer_config',\n 'caption' => 'Other base layer config',\n 'description' => 'JSON describing the custom base layers to make available. For advanced users only.',\n 'type' => 'textarea',\n 'group' => 'Advanced Base Map Layers',\n 'required' => FALSE\n ),\n array(\n 'name' => 'openlayers_options',\n 'caption' => 'OpenLayers Options JSON',\n 'description' => 'JSON describing the options to pass through to OpenLayers. For advanced users only, leave blank\n for default behaviour.',\n 'type' => 'textarea',\n 'group' => 'Advanced Base Map Layers',\n 'required' => FALSE\n ),\n array(\n 'name' => 'indicia_wms_layers',\n 'caption' => 'WMS layers from GeoServer',\n 'description' => 'List of WMS feature type names, one per line, which are installed on the GeoServer and are to be added to the map as overlays. ' .\n 'Optionally, prefix the feature type name with a title to appear in the layer switcher using the form title = feature-name.',\n 'type' => 'textarea',\n 'group' => 'Other Map Settings',\n 'required' => FALSE\n ),\n array(\n 'name' => 'standard_controls',\n 'caption' => 'Controls to add to map',\n 'description' => 'List of map controls, one per line. Select from layerSwitcher, zoomBox, panZoom, panZoomBar, drawPolygon, drawPoint, drawLine, '.\n 'hoverFeatureHighlight, clearEditLayer, modifyFeature, graticule, fullscreen. If using a data entry form and you add drawPolygon or drawLine controls then your '.\n 'form will support recording against polygons and lines as well as grid references and points.',\n 'type' => 'textarea',\n 'group' => 'Other Map Settings',\n 'required' => FALSE,\n 'default'=>\"layerSwitcher\\npanZoomBar\"\n )\n );\n // Check for easy login module to allow integration into profile locations.\n if (!function_exists('hostsite_module_exists') || hostsite_module_exists('easy_login')) {\n $r[] = array(\n 'name' => 'display_user_profile_location',\n 'caption' => 'Display location from user profile',\n 'description' => 'Tick this box to display the outline of the user\\'s preferred recording location from the user '.\n 'account on the map. The map will be centred and zoomed to this location on first usage. This option has no effect if '.\n '\"Location boundary to draw\" is ticked.',\n 'type' => 'checkbox',\n 'required' => FALSE,\n 'group' => 'Initial Map View'\n );\n }\n return $r;\n}",
"public function map() {\n\t\treturn array(\n\t\t\t'name' => esc_html__( 'Testimonials Grid', 'total-theme-core' ),\n\t\t\t'description' => esc_html__( 'Recent testimonials post grid', 'total-theme-core' ),\n\t\t\t'base' => 'vcex_testimonials_grid',\n\t\t\t'category' => vcex_shortcodes_branding(),\n\t\t\t'icon' => 'vcex_element-icon vcex_element-icon--testimonial',\n\t\t\t'params' => VCEX_Testimonials_Grid_Shortcode::get_params(),\n\t\t);\n\t}",
"function getMultiParams()\n{\n $rtn = array();\n\n $rtn['backend'] = array('backend_hostname', 'backend_port', 'backend_weight', 'backend_data_directory');\n if (paramExists('backend_flag')) {\n $rtn['backend'][] = 'backend_flag';\n }\n if (paramExists('other_pgpool_hostname')) {\n $rtn['other_pgpool'] = array('other_pgpool_hostname', 'other_pgpool_port', 'other_wd_port');\n }\n\n if (paramExists('heartbeat_destination')) {\n $rtn['heartbeat'] = array('heartbeat_destination', 'heartbeat_destination_port', 'heartbeat_device');\n }\n\n if (paramExists('hostname')) {\n $rtn['watchdog_node'] = array('hostname', 'wd_port', 'pgpool_port');\n }\n\n if (paramExists('heartbeat_hostname')){\n $rtn['watchdog_heartbeat'] = array('heartbeat_hostname', 'heartbeat_port', 'heartbeat_device');\n }\n\n return $rtn;\n}",
"private function _get_params($ref){\n switch($ref){\n default:\n return array(\n 'title' => TITLE_INDEX,\n 'meta_description' => META_DESCRIPTION_INDEX,\n 'meta_keywords' => META_KEYWORDS_INDEX,\n 'reference' => 'home'\n );\n break;\n case 'empresa':\n return array(\n 'title' => TITLE_EMPRESA,\n 'meta_description' => META_DESCRIPTION_EMPRESA,\n 'meta_keywords' => META_KEYWORDS_EMPRESA,\n 'reference' => 'empresa'\n );\n break;\n case 'productos':\n return array(\n 'title' => TITLE_PRODUCTOS,\n 'meta_description' => META_DESCRIPTION_PRODUCTOS,\n 'meta_keywords' => META_KEYWORDS_PRODUCTOS,\n 'reference' => 'productos'\n );\n break;\n case 'energia-renovable':\n return array(\n 'title' => TITLE_ENERGIARENOVABLE,\n 'meta_description' => META_DESCRIPTION_ENERGIARENOVABLE,\n 'meta_keywords' => META_KEYWORDS_ENERGIARENOVABLE,\n 'reference' => 'energia-renovable'\n );\n break;\n case 'servicios':\n return array(\n 'title' => TITLE_SERVICIOS,\n 'meta_description' => META_DESCRIPTION_SERVICIOS,\n 'meta_keywords' => META_KEYWORDS_SERVICIOS,\n 'reference' => 'servicios'\n );\n break;\n case 'representaciones':\n return array(\n 'title' => TITLE_REPRESENTACIONES,\n 'meta_description' => META_DESCRIPTION_REPRESENTACIONES,\n 'meta_keywords' => META_KEYWORDS_REPRESENTACIONES,\n 'reference' => 'representaciones'\n );\n break;\n case 'obras':\n return array(\n 'title' => TITLE_OBRAS,\n 'meta_description' => META_DESCRIPTION_OBRAS,\n 'meta_keywords' => META_KEYWORDS_OBRAS,\n 'reference' => 'obras'\n );\n break;\n case 'testimoniales':\n return array(\n 'title' => TITLE_TESTIMONIALES,\n 'meta_description' => META_DESCRIPTION_TESTIMONIALES,\n 'meta_keywords' => META_KEYWORDS_TESTIMONIALES,\n 'reference' => 'testimoniales'\n );\n break;\n }\n }",
"public function get_arr_maps() {\r\n $router = app::get('site')->router();\r\n $tmp = array();\r\n \r\n \r\n //货品\r\n $arr = $this->app->model('products')->getList('*');\r\n foreach( (array)$arr as $row ) {\r\n $tmp[] = array(\r\n 'url' => $router->gen_url(array('app'=>'b2c', 'ctl'=>'site_product', 'act'=>'index', 'arg0'=>$row['product_id'], 'full'=>true) ),\r\n );\r\n }\r\n \r\n //品牌\r\n $arr = $this->app->model('brand')->getList( '*' );\r\n foreach( (array)$arr as $row ) {\r\n $tmp[] = array(\r\n 'url' => $router->gen_url(array('app'=>'b2c', 'ctl'=>'site_brand', 'act'=>'index', 'arg0'=>$row['brand_id'], 'full'=>true) ),\r\n );\r\n }\r\n \r\n //分类\r\n $arr = $this->app->model('goods_cat')->getList( '*' );\r\n foreach( (array)$arr as $row ) {\r\n $tmp[] = array(\r\n 'url' => $router->gen_url(array('app'=>'b2c', 'ctl'=>'site_gallery', 'act'=>'index', 'arg0'=>$row['cat_id'], 'full'=>true) ),\r\n );\r\n }\r\n \r\n return $tmp;\r\n }",
"protected function getArgumentMap()\n {\n $argMap = parent::getArgumentMap();\n\n //common paramters for all getXXXRecommendation style queries...\n $argMap[\"nbRec\"] = $this->parameter->getNbRecommendation() ;\n $argMap[\"showAds\"] = $this->parameter->getShowAds() ? \"true\" : \"false\" ;\n $argMap[\"userID\"] = $this->parameter->getUserId();\n $argMap[\"classID\"] = $this->parameter->getProfileMapId();\n $argMap[\"languageCode\"] = $this->parameter->getLanguageCode();\n $argMap[\"referURL\"] = $this->parameter->getRefererUrl();\n \n $bufferKeys = \"\";\n $bufferValues = \"\";\n\n //implode the key values pairs into separate strings\n Utils::implodeKeyValuePairsToSeparatedString( $this->parameter->getConditions(), \"_/_\", $bufferKeys, $bufferValues);\n\n //add parameters\n $argMap[\"attributeNames\"] = $bufferKeys;\n $argMap[\"attributeValues\"] = $bufferValues;\n\n return $argMap;\n }",
"public function provider_parameter()\n\t{\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'www', array(\n\t\t\t\t\t'babysitters/il/chicago/jobs.html' => array(\n\t\t\t\t\t\t'caretype_key' => 'babysitters', 'statecode' => 'il'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t);\n\t}",
"public static function settings_to_params() {\n\t\t\t\treturn [\n\t\t\t\t\t'social_links_boxed' => [\n\t\t\t\t\t\t'param' => 'icons_boxed',\n\t\t\t\t\t\t'callback' => 'toYes',\n\t\t\t\t\t],\n\t\t\t\t\t'social_links_boxed_radius' => 'icons_boxed_radius',\n\t\t\t\t\t'social_links_color_type' => 'color_type',\n\t\t\t\t\t'social_links_icon_color' => 'icon_colors',\n\t\t\t\t\t'social_links_box_color' => 'box_colors',\n\t\t\t\t\t'social_links_tooltip_placement' => [\n\t\t\t\t\t\t'param' => 'tooltip_placement',\n\t\t\t\t\t\t'callback' => 'toLowerCase',\n\t\t\t\t\t],\n\t\t\t\t];\n\t\t\t}",
"public function get_params();",
"public function get_params();",
"function _def_params()\n {\n return array();\n }",
"function params($label)\n\t{\n\t\t$data = array();\n\n\t\tif ($label == 'id')\n\t\t{\n\t\t\t$data['id'] = $GLOBALS['map']->id;\n\t\t}\n\t\telseif ($label == 'action')\n\t\t{\n\t\t\t$data['action'] = $GLOBALS['map']->action;\n\t\t}\n\t\telseif ($label == 'controller')\n\t\t{\n\t\t\t$data['controller'] = $GLOBALS['map']->controller;\n\t\t}\n\t\telseif ($label == 'resource')\n\t\t{\n\t\t\t$data['resource'] = $GLOBALS['map']->resource;\n\t\t}\n\t\telseif (array_key_exists($label, $_POST))\n\t\t{\n\t\t\tif (is_array($_POST[$label]))\n\t\t\t\t$data = $_POST[$label];\n\t\t\telse\n\t\t\t\t$data[$label] = $_POST[$label];\n\t\t}\n\t\telseif (array_key_exists($label, $_GET))\n\t\t{\n\t\t\tif (is_array($_GET[$label]))\n\t\t\t\t$data = $_GET[$label];\n\t\t\telse\n\t\t\t\t$data[$label] = $_GET[$label];\n\t\t}\n\t\t\n\t\treturn build_params($data);\n\t}",
"private static function td_slide_params() {\r\n $map_block_array = self::get_map_block_general_array();\r\n\r\n // remove some of the params that are not needed for the slide\r\n $map_block_array = td_util::vc_array_remove_params($map_block_array, array(\r\n 'border_top',\r\n 'ajax_pagination',\r\n 'ajax_pagination_infinite_stop'\r\n ));\r\n\r\n // add some more\r\n $temp_array_merge = array_merge(\r\n array(\r\n array(\r\n \"param_name\" => \"autoplay\",\r\n \"type\" => \"textfield\",\r\n \"value\" => '',\r\n \"heading\" => 'Autoplay slider (at x seconds)',\r\n \"description\" => \"Leave empty do disable autoplay\",\r\n \"holder\" => \"div\",\r\n \"class\" => \"\"\r\n )\r\n ),\r\n self::get_map_filter_array(),\r\n $map_block_array\r\n );\r\n return $temp_array_merge;\r\n }",
"protected function EditParams()\n {\n $params = array();\n $params['page'] = $this->page->GetID();\n $params['area'] = $this->area->GetID();\n return $params;\n }",
"function _getDisplayData($params = array()) {\r\n\t\t$data = parent::_getDisplayData();\r\n \r\n\t\t$data['params'] = $params;\r\n $data['pageTitle'] = $this->lang->line('${appspec.id}_${page.id}_title');\r\n\t\t\r\n#foreach ($linkset in $appspec.globalLinkSets)\r\n\t\t$data['navigations'][] = $this->load->view('navigation/${linkset.id}', '', true);\r\n#end\r\n\r\n### OUTPUTS (MAPPED TO PARAMS)\r\n#foreach($pageParameter in $page.parameters) \r\n#if (${pageParameter.entityProperty} && ${pageParameter.entityProperty.primaryKey})\r\n\t\t$data['outputs']['${pageParameter.entityProperty.entity.id}'] = $this->_load${pageParameter.entityProperty.entity.name}();\r\n#end\r\n#end\r\n\r\n## TODO: what about outputs not mapped to params?\r\n\r\n### OUTPUT LISTS\r\n#foreach($outputList in $page.outputLists)\r\n\t\t$data['outputLists']['${outputList.id}'] = $this->_load${outputList.name}($params);\r\n#end\r\n\r\n\t\treturn $data;\r\n\t}",
"public function map() {\n\t\treturn array(\n\t\t\t'name' => esc_html__( 'Staff Carousel', 'total-theme-core' ),\n\t\t\t'description' => esc_html__( 'Recent staff posts carousel', 'total-theme-core' ),\n\t\t\t'base' => 'vcex_staff_carousel',\n\t\t\t'category' => vcex_shortcodes_branding(),\n\t\t\t'icon' => 'vcex_element-icon vcex_element-icon--staff',\n\t\t\t'params' => VCEX_Staff_Carousel_Shortcode::get_params(),\n\t\t);\n\t}",
"private function getDefaultParams(): array\n {\n return [\n 'lamg' => $this->lang,\n 'limit' => 1,\n 'hours' => false,\n 'extra' => false,\n ];\n }",
"public function default_map_short_list() : array {\n $list = [];\n $default_map_settings = $this->default_map_settings();\n\n if ( $default_map_settings['type'] === 'world' ) {\n $list = [ 'world' => 'World' ];\n }\n else if ( $default_map_settings['type'] !== 'world' && empty( $default_map_settings['children'] ) ) {\n $list = [ 'world' => 'World' ];\n }\n else {\n $children = Disciple_Tools_Mapping_Queries::get_by_grid_id_list( $default_map_settings['children'] );\n if ( ! empty( $children ) ) {\n foreach ( $children as $child ) {\n $list[$child['grid_id']] = $child['name'];\n }\n }\n }\n return $list;\n }",
"function get_params() {\n $value = NULL;\n $value_cuit = NULL;\n $value_razon = NULL;\n\n if(isset($this->values['searchBy']) && $this->values['searchBy'] == 'cuit') {\n $value_cuit = $this->values['cuit'];\n }\n else {\n $value_razon = isset($this->values['razon']) ? $this->values['razon'] : null ;\n }\n\n $params = array();\n\n $params['cuit'] = str_replace(' ','+', $value_cuit);\n $params['razon'] = str_replace(' ','+', $value_razon);\n return $params;\n }",
"public function getParamsListToInject() : array\n {\n return [\n 'sectionTitle',\n 'sectionSubtitle',\n 'layout',\n 'isFlat',\n 'panels',\n 'button'\n ];\n }",
"function getUrlParams($pmconfigs){\n return array();\n }",
"public static function get_parameters() {\n $paramArray = array_merge(\n iform_map_get_map_parameters(),\n iform_report_get_minimal_report_parameters(),\n array(array(\n 'name' => 'first_year',\n 'caption' => 'First Year of Data',\n 'description' => 'Used to determine first year displayed in the year control. Final Year will be current year.',\n 'type' => 'int',\n \t\t'group' => 'Controls'\n ),\n array(\n 'name' => 'twinMaps',\n 'caption' => 'Twin Maps',\n 'description' => 'Display a second map, for data comparison.',\n 'type' => 'boolean',\n 'required'=>false,\n 'default'=>false,\n 'group' => 'Controls'\n ),\n array(\n 'name' => 'advancedUI',\n 'caption' => 'Advanced UI',\n 'description' => 'Advanced User Interface: use a slider for date and dot size controls, and a graphical button. Relies on jQuery_ui.',\n 'type' => 'boolean',\n 'required'=>false,\n 'default'=>false,\n 'group' => 'Controls'\n ),\n array(\n 'name' => 'dotSize',\n 'caption' => 'Dot Size',\n 'description' => 'Initial size in pixels of observation dots on map. Can be overriden by a control.',\n 'type' => 'select',\n 'options' => array(\n '2' => '2',\n '3' => '3',\n '4' => '4',\n '5' => '5'\n ),\n 'default' => '3',\n 'group' => 'Controls'\n ),\n array(\n 'name' => 'numberOfDates',\n 'caption' => 'Number of Dates',\n 'description' => 'The maximum number of dates displayed on the X-axis. Used to prevent crowding. The minimum spacing is one date displayed per week. Date range is determined by the data.',\n 'type' => 'int',\n 'default'=>11,\n 'group' => 'Controls'\n ),\n\t\t array(\n \t\t'name' => 'frameRate',\n \t\t'caption' => 'Animation Frame Rate',\n \t\t'description' => 'Number of frames displayed per second.',\n \t\t'type' => 'int',\n 'default'=>4,\n \t\t'group' => 'Controls'\n \t ),\n \t array(\n \t\t'name' => 'triggerEvents',\n \t\t'caption' => 'Event Definition',\n \t\t'description' => 'JSON encode event definition: an array, one per event type, each with a \"name\" element, a \"type\" (either...), an \"attr\", and a \"values\"',\n \t\t'type' => 'textarea',\n \t\t'group' => 'Events'\n \t )\n )\n );\n $retVal = [];\n foreach($paramArray as $param){\n \tif(!in_array($param['name'],\n \t\t\tarray('map_width', 'remember_pos', 'location_boundary_id', 'items_per_page', 'param_ignores', 'param_defaults'/*, 'message_after_save', 'redirect_on_success' */)))\n \t\t$retVal[] = $param;\n }\n return $retVal;\n }",
"function loadDefaults() {\n $params = array(\n\t\t\t\t\"page-status\"=>array(\"id\"=>\"page-status\",\"group\"=>\"General\",\"order\"=>\"5\",\"default\"=>\"No\",\"label\"=>\"Enable effect\",\"type\"=>\"array\",\"subType\"=>\"select\",\"values\"=>array(\"Yes\",\"No\"),\"scope\"=>\"module\"),\n\t\t\t\t\"template\"=>array(\"id\"=>\"template\",\"group\"=>\"General\",\"order\"=>\"20\",\"default\"=>\"bottom\",\"label\"=>\"Which template to use\",\"type\"=>\"array\",\"subType\"=>\"select\",\"values\"=>array(\"bottom\",\"left\",\"right\",\"top\"),\"scope\"=>\"module\"),\n\t\t\t\t\"magicscroll\"=>array(\"id\"=>\"magicscroll\",\"group\"=>\"General\",\"order\"=>\"22\",\"default\"=>\"No\",\"label\"=>\"Scroll thumbnails\",\"description\"=>\"(Does not work with keep-selectors-position:yes) Powered by the versatile <a href=\\\"http://www.magictoolbox.com/magicscroll/examples/\\\">Magic Scroll</a>™. Normally £29, yours is discounted to £19. <a href=\\\"https://www.magictoolbox.com/buy/magicscroll/\\\">Buy a license</a> and upload magicscroll.js to your server. <a href=\\\"http://www.magictoolbox.com/contact/\\\">Contact us</a> for help.\",\"type\"=>\"array\",\"subType\"=>\"select\",\"values\"=>array(\"Yes\",\"No\"),\"scope\"=>\"module\"),\n\t\t\t\t\"thumb-max-width\"=>array(\"id\"=>\"thumb-max-width\",\"group\"=>\"Positioning and Geometry\",\"order\"=>\"10\",\"default\"=>\"300\",\"label\"=>\"Maximum width of thumbnail (in pixels)\",\"type\"=>\"num\",\"scope\"=>\"module\"),\n\t\t\t\t\"thumb-max-height\"=>array(\"id\"=>\"thumb-max-height\",\"group\"=>\"Positioning and Geometry\",\"order\"=>\"11\",\"default\"=>\"300\",\"label\"=>\"Maximum height of thumbnail (in pixels)\",\"type\"=>\"num\",\"scope\"=>\"module\"),\n\t\t\t\t\"zoomWidth\"=>array(\"id\"=>\"zoomWidth\",\"group\"=>\"Positioning and Geometry\",\"order\"=>\"20\",\"default\"=>\"auto\",\"label\"=>\"Width of zoom window\",\"description\"=>\"pixels or percentage, e.g. 400 or 100%.\",\"type\"=>\"text\",\"scope\"=>\"magiczoomplus\"),\n\t\t\t\t\"zoomHeight\"=>array(\"id\"=>\"zoomHeight\",\"group\"=>\"Positioning and Geometry\",\"order\"=>\"30\",\"default\"=>\"auto\",\"label\"=>\"Height of zoom window\",\"description\"=>\"pixels or percentage, e.g. 400 or 100%.\",\"type\"=>\"text\",\"scope\"=>\"magiczoomplus\"),\n\t\t\t\t\"right-thumb-max-width\"=>array(\"id\"=>\"right-thumb-max-width\",\"group\"=>\"Positioning and Geometry\",\"order\"=>\"30\",\"default\"=>\"75\",\"label\"=>\"Maximum width of right column boxes thumbnail (in pixels)\",\"type\"=>\"num\",\"scope\"=>\"module\"),\n\t\t\t\t\"right-thumb-max-height\"=>array(\"id\"=>\"right-thumb-max-height\",\"group\"=>\"Positioning and Geometry\",\"order\"=>\"31\",\"default\"=>\"75\",\"label\"=>\"Maximum height of right column boxes thumbnail (in pixels)\",\"type\"=>\"num\",\"scope\"=>\"module\"),\n\t\t\t\t\"zoomPosition\"=>array(\"id\"=>\"zoomPosition\",\"group\"=>\"Positioning and Geometry\",\"order\"=>\"40\",\"default\"=>\"right\",\"label\"=>\"Position of zoom window\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"top\",\"right\",\"bottom\",\"left\",\"inner\"),\"scope\"=>\"magiczoomplus\"),\n\t\t\t\t\"left-thumb-max-width\"=>array(\"id\"=>\"left-thumb-max-width\",\"group\"=>\"Positioning and Geometry\",\"order\"=>\"40\",\"default\"=>\"75\",\"label\"=>\"Maximum width of left column boxes thumbnail (in pixels)\",\"type\"=>\"num\",\"scope\"=>\"module\"),\n\t\t\t\t\"left-thumb-max-height\"=>array(\"id\"=>\"left-thumb-max-height\",\"group\"=>\"Positioning and Geometry\",\"order\"=>\"41\",\"default\"=>\"75\",\"label\"=>\"Maximum height of left column boxes thumbnail (in pixels)\",\"type\"=>\"num\",\"scope\"=>\"module\"),\n\t\t\t\t\"zoomDistance\"=>array(\"id\"=>\"zoomDistance\",\"group\"=>\"Positioning and Geometry\",\"order\"=>\"50\",\"default\"=>\"15\",\"label\"=>\"Zoom distance\",\"description\"=>\"Distance between small image and zoom window (in pixels).\",\"type\"=>\"num\",\"scope\"=>\"magiczoomplus\"),\n\t\t\t\t\"square-images\"=>array(\"id\"=>\"square-images\",\"group\"=>\"Positioning and Geometry\",\"order\"=>\"310\",\"default\"=>\"disable\",\"label\"=>\"Create square images\",\"description\"=>\"The white/transparent padding will be added around the image or the image will be cropped.\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"extend\",\"crop\",\"disable\"),\"scope\"=>\"module\"),\n\t\t\t\t\"selectorTrigger\"=>array(\"id\"=>\"selectorTrigger\",\"advanced\"=>\"1\",\"group\"=>\"Multiple images\",\"order\"=>\"10\",\"default\"=>\"click\",\"label\"=>\"Swap trigger\",\"description\"=>\"Mouse event used to switch between multiple images.\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"click\",\"hover\"),\"scope\"=>\"magiczoomplus\",\"desktop-only\"=>\"\"),\n\t\t\t\t\"selector-max-width\"=>array(\"id\"=>\"selector-max-width\",\"group\"=>\"Multiple images\",\"order\"=>\"10\",\"default\"=>\"70\",\"label\"=>\"Maximum width of additional thumbnails (in pixels)\",\"type\"=>\"num\",\"scope\"=>\"module\"),\n\t\t\t\t\"selector-max-height\"=>array(\"id\"=>\"selector-max-height\",\"group\"=>\"Multiple images\",\"order\"=>\"11\",\"default\"=>\"70\",\"label\"=>\"Maximum height of additional thumbnails (in pixels)\",\"type\"=>\"num\",\"scope\"=>\"module\"),\n\t\t\t\t\"transitionEffect\"=>array(\"id\"=>\"transitionEffect\",\"advanced\"=>\"1\",\"group\"=>\"Multiple images\",\"order\"=>\"20\",\"default\"=>\"Yes\",\"label\"=>\"Transition effect on swap\",\"description\"=>\"Whether to enable dissolve effect when switching between images.\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"Yes\",\"No\"),\"scope\"=>\"magiczoomplus\"),\n\t\t\t\t\"selectors-margin\"=>array(\"id\"=>\"selectors-margin\",\"group\"=>\"Multiple images\",\"order\"=>\"40\",\"default\"=>\"5\",\"label\"=>\"Margin between selectors and main image (in pixels)\",\"type\"=>\"num\",\"scope\"=>\"module\"),\n\t\t\t\t\"headers-on-every-page\"=>array(\"id\"=>\"headers-on-every-page\",\"group\"=>\"Miscellaneous\",\"order\"=>\"6\",\"default\"=>\"No\",\"label\"=>\"Include headers on all pages\",\"type\"=>\"array\",\"subType\"=>\"select\",\"values\"=>array(\"Yes\",\"No\"),\"scope\"=>\"module\"),\n\t\t\t\t\"lazyZoom\"=>array(\"id\"=>\"lazyZoom\",\"group\"=>\"Miscellaneous\",\"order\"=>\"10\",\"default\"=>\"No\",\"label\"=>\"Lazy load of zoom image\",\"description\"=>\"Whether to load large image on demand (on first activation).\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"Yes\",\"No\"),\"scope\"=>\"magiczoomplus\"),\n\t\t\t\t\"rightClick\"=>array(\"id\"=>\"rightClick\",\"group\"=>\"Miscellaneous\",\"order\"=>\"20\",\"default\"=>\"No\",\"label\"=>\"Right-click menu on image\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"Yes\",\"No\"),\"scope\"=>\"magiczoomplus\",\"desktop-only\"=>\"\"),\n\t\t\t\t\"link-to-product-page\"=>array(\"id\"=>\"link-to-product-page\",\"group\"=>\"Miscellaneous\",\"order\"=>\"70\",\"default\"=>\"Yes\",\"label\"=>\"Link enlarged image to the product page\",\"type\"=>\"array\",\"subType\"=>\"select\",\"values\"=>array(\"Yes\",\"No\"),\"scope\"=>\"module\"),\n\t\t\t\t\"z-index\"=>array(\"id\"=>\"z-index\",\"group\"=>\"Miscellaneous\",\"order\"=>\"80\",\"default\"=>\"100\",\"label\"=>\"Starting z-Index\",\"description\"=>\"Adjust the stack position above/below other elements\",\"type\"=>\"num\",\"scope\"=>\"module\"),\n\t\t\t\t\"imagemagick\"=>array(\"id\"=>\"imagemagick\",\"group\"=>\"Miscellaneous\",\"order\"=>\"550\",\"default\"=>\"off\",\"label\"=>\"Path to Imagemagick binaries (convert tool)\",\"description\"=>\"You can set 'auto' to automatically detect imagemagick location or 'off' to disable imagemagick and use php GD lib instead\",\"type\"=>\"text\",\"scope\"=>\"module\"),\n\t\t\t\t\"image-quality\"=>array(\"id\"=>\"image-quality\",\"group\"=>\"Miscellaneous\",\"order\"=>\"560\",\"default\"=>\"75\",\"label\"=>\"Quality of thumbnails and watermarked images (1-100)\",\"description\"=>\"1 = worst quality / 100 = best quality\",\"type\"=>\"num\",\"scope\"=>\"module\"),\n\t\t\t\t\"zoomMode\"=>array(\"id\"=>\"zoomMode\",\"group\"=>\"Zoom mode\",\"order\"=>\"10\",\"default\"=>\"zoom\",\"label\"=>\"Zoom mode\",\"description\"=>\"How to zoom image. off - disable zoom.\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"zoom\",\"magnifier\",\"preview\",\"off\"),\"scope\"=>\"magiczoomplus\",\"desktop-only\"=>\"preview\"),\n\t\t\t\t\"zoomOn\"=>array(\"id\"=>\"zoomOn\",\"group\"=>\"Zoom mode\",\"order\"=>\"20\",\"default\"=>\"hover\",\"label\"=>\"Zoom on\",\"description\"=>\"When to activate zoom.\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"hover\",\"click\"),\"scope\"=>\"magiczoomplus\",\"desktop-only\"=>\"\"),\n\t\t\t\t\"upscale\"=>array(\"id\"=>\"upscale\",\"advanced\"=>\"1\",\"group\"=>\"Zoom mode\",\"order\"=>\"30\",\"default\"=>\"Yes\",\"label\"=>\"Upscale image\",\"description\"=>\"Whether to scale up the large image if its original size is not enough for a zoom effect.\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"Yes\",\"No\"),\"scope\"=>\"magiczoomplus\"),\n\t\t\t\t\"smoothing\"=>array(\"id\"=>\"smoothing\",\"advanced\"=>\"1\",\"group\"=>\"Zoom mode\",\"order\"=>\"35\",\"default\"=>\"Yes\",\"label\"=>\"Smooth zoom movement\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"Yes\",\"No\"),\"scope\"=>\"magiczoomplus\"),\n\t\t\t\t\"variableZoom\"=>array(\"id\"=>\"variableZoom\",\"advanced\"=>\"1\",\"group\"=>\"Zoom mode\",\"order\"=>\"40\",\"default\"=>\"No\",\"label\"=>\"Variable zoom\",\"description\"=>\"Whether to allow changing zoom ratio with mouse wheel.\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"Yes\",\"No\"),\"scope\"=>\"magiczoomplus\",\"desktop-only\"=>\"\"),\n\t\t\t\t\"zoomCaption\"=>array(\"id\"=>\"zoomCaption\",\"group\"=>\"Zoom mode\",\"order\"=>\"50\",\"default\"=>\"off\",\"label\"=>\"Caption in zoom window\",\"description\"=>\"Position of caption on zoomed image. off - disable caption on zoom window.\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"top\",\"bottom\",\"off\"),\"scope\"=>\"magiczoomplus\"),\n\t\t\t\t\"expand\"=>array(\"id\"=>\"expand\",\"group\"=>\"Expand mode\",\"order\"=>\"10\",\"default\"=>\"window\",\"label\"=>\"Expand mode\",\"description\"=>\"How to show expanded view. off - disable expanded view.\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"window\",\"fullscreen\",\"off\"),\"scope\"=>\"magiczoomplus\"),\n\t\t\t\t\"expandZoomMode\"=>array(\"id\"=>\"expandZoomMode\",\"group\"=>\"Expand mode\",\"order\"=>\"20\",\"default\"=>\"zoom\",\"label\"=>\"Expand zoom mode\",\"description\"=>\"How to zoom image in expanded view. off - disable zoom in expanded view.\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"zoom\",\"magnifier\",\"off\"),\"scope\"=>\"magiczoomplus\"),\n\t\t\t\t\"expandZoomOn\"=>array(\"id\"=>\"expandZoomOn\",\"group\"=>\"Expand mode\",\"order\"=>\"21\",\"default\"=>\"click\",\"label\"=>\"Expand zoom on\",\"description\"=>\"When and how activate zoom in expanded view. ‘always’ - zoom automatically activates upon entering the expanded view and remains active.\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"click\",\"always\"),\"scope\"=>\"magiczoomplus\"),\n\t\t\t\t\"expandCaption\"=>array(\"id\"=>\"expandCaption\",\"group\"=>\"Expand mode\",\"order\"=>\"30\",\"default\"=>\"Yes\",\"label\"=>\"Show caption in expand window\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"Yes\",\"No\"),\"scope\"=>\"magiczoomplus\",\"desktop-only\"=>\"\"),\n\t\t\t\t\"closeOnClickOutside\"=>array(\"id\"=>\"closeOnClickOutside\",\"group\"=>\"Expand mode\",\"order\"=>\"40\",\"default\"=>\"Yes\",\"label\"=>\"Close expanded image on click outside\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"Yes\",\"No\"),\"scope\"=>\"magiczoomplus\"),\n\t\t\t\t\"cssClass\"=>array(\"id\"=>\"cssClass\",\"group\"=>\"Expand mode\",\"order\"=>\"50\",\"default\"=>\"blurred\",\"label\"=>\"Background behind the enlarged image\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"blurred\",\"dark\",\"white\"),\"scope\"=>\"magiczoomplus\"),\n\t\t\t\t\"watermark\"=>array(\"id\"=>\"watermark\",\"group\"=>\"Watermark\",\"order\"=>\"10\",\"default\"=>\"\",\"label\"=>\"Watermark image path\",\"description\"=>\"Enter location of watermark image on your server. Leave field empty to disable watermark\",\"type\"=>\"text\",\"scope\"=>\"module\"),\n\t\t\t\t\"watermark-max-width\"=>array(\"id\"=>\"watermark-max-width\",\"group\"=>\"Watermark\",\"order\"=>\"20\",\"default\"=>\"30%\",\"label\"=>\"Maximum width of watermark image\",\"description\"=>\"pixels = fixed size (e.g. 50) / percent = relative for image size (e.g. 50%)\",\"type\"=>\"text\",\"scope\"=>\"module\"),\n\t\t\t\t\"watermark-max-height\"=>array(\"id\"=>\"watermark-max-height\",\"group\"=>\"Watermark\",\"order\"=>\"21\",\"default\"=>\"30%\",\"label\"=>\"Maximum height of watermark image\",\"description\"=>\"pixels = fixed size (e.g. 50) / percent = relative for image size (e.g. 50%)\",\"type\"=>\"text\",\"scope\"=>\"module\"),\n\t\t\t\t\"watermark-opacity\"=>array(\"id\"=>\"watermark-opacity\",\"group\"=>\"Watermark\",\"order\"=>\"40\",\"default\"=>\"50\",\"label\"=>\"Watermark image opacity (1-100)\",\"description\"=>\"0 = transparent, 100 = solid color\",\"type\"=>\"num\",\"scope\"=>\"module\"),\n\t\t\t\t\"watermark-position\"=>array(\"id\"=>\"watermark-position\",\"group\"=>\"Watermark\",\"order\"=>\"50\",\"default\"=>\"center\",\"label\"=>\"Watermark position\",\"description\"=>\"Watermark size settings will be ignored when watermark position is set to 'stretch'\",\"type\"=>\"array\",\"subType\"=>\"select\",\"values\"=>array(\"top\",\"right\",\"bottom\",\"left\",\"top-left\",\"bottom-left\",\"top-right\",\"bottom-right\",\"center\",\"stretch\"),\"scope\"=>\"module\"),\n\t\t\t\t\"watermark-offset-x\"=>array(\"id\"=>\"watermark-offset-x\",\"advanced\"=>\"1\",\"group\"=>\"Watermark\",\"order\"=>\"60\",\"default\"=>\"0\",\"label\"=>\"Watermark horizontal offset\",\"description\"=>\"Offset from left and/or right image borders. Pixels = fixed size (e.g. 20) / percent = relative for image size (e.g. 20%). Offset will disable if 'watermark position' set to 'center'\",\"type\"=>\"text\",\"scope\"=>\"module\"),\n\t\t\t\t\"watermark-offset-y\"=>array(\"id\"=>\"watermark-offset-y\",\"advanced\"=>\"1\",\"group\"=>\"Watermark\",\"order\"=>\"70\",\"default\"=>\"0\",\"label\"=>\"Watermark vertical offset\",\"description\"=>\"Offset from top and/or bottom image borders. Pixels = fixed size (e.g. 20) / percent = relative for image size (e.g. 20%). Offset will disable if 'watermark position' set to 'center'\",\"type\"=>\"text\",\"scope\"=>\"module\"),\n\t\t\t\t\"hint\"=>array(\"id\"=>\"hint\",\"group\"=>\"Hint\",\"order\"=>\"10\",\"default\"=>\"once\",\"label\"=>\"Display hint to suggest image is zoomable\",\"description\"=>\"How to show hint. off - disable hint.\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"once\",\"always\",\"off\"),\"scope\"=>\"magiczoomplus\"),\n\t\t\t\t\"textHoverZoomHint\"=>array(\"id\"=>\"textHoverZoomHint\",\"advanced\"=>\"1\",\"group\"=>\"Hint\",\"order\"=>\"20\",\"default\"=>\"Hover to zoom\",\"label\"=>\"Hint to suggest image is zoomable (on hover)\",\"description\"=>\"Hint that shows when zoom mode is enabled, but inactive, and zoom activates on hover (Zoom on: hover).\",\"type\"=>\"text\",\"scope\"=>\"magiczoomplus\"),\n\t\t\t\t\"textClickZoomHint\"=>array(\"id\"=>\"textClickZoomHint\",\"advanced\"=>\"1\",\"group\"=>\"Hint\",\"order\"=>\"21\",\"default\"=>\"Click to zoom\",\"label\"=>\"Hint to suggest image is zoomable (on click)\",\"description\"=>\"Hint that shows when zoom mode is enabled, but inactive, and zoom activates on click (Zoom on: click).\",\"type\"=>\"text\",\"scope\"=>\"magiczoomplus\"),\n\t\t\t\t\"textExpandHint\"=>array(\"id\"=>\"textExpandHint\",\"advanced\"=>\"1\",\"group\"=>\"Hint\",\"order\"=>\"30\",\"default\"=>\"Click to expand\",\"label\"=>\"Hint to suggest image is expandable\",\"description\"=>\"Hint that shows when zoom mode activated, or in inactive state if zoom mode is disabled.\",\"type\"=>\"text\",\"scope\"=>\"magiczoomplus\"),\n\t\t\t\t\"textBtnClose\"=>array(\"id\"=>\"textBtnClose\",\"group\"=>\"Hint\",\"order\"=>\"40\",\"default\"=>\"Close\",\"label\"=>\"Hint for “close” button\",\"description\"=>\"Text label that appears on mouse over the “close” button in expanded view.\",\"type\"=>\"text\",\"scope\"=>\"magiczoomplus\",\"desktop-only\"=>\"\"),\n\t\t\t\t\"textBtnNext\"=>array(\"id\"=>\"textBtnNext\",\"group\"=>\"Hint\",\"order\"=>\"50\",\"default\"=>\"Next\",\"label\"=>\"Hint for “next” button\",\"description\"=>\"Text label that appears on mouse over the “next” button arrow in expanded view.\",\"type\"=>\"text\",\"scope\"=>\"magiczoomplus\",\"desktop-only\"=>\"\"),\n\t\t\t\t\"textBtnPrev\"=>array(\"id\"=>\"textBtnPrev\",\"group\"=>\"Hint\",\"order\"=>\"60\",\"default\"=>\"Previous\",\"label\"=>\"Hint for “previous” button\",\"description\"=>\"Text label that appears on mouse over the “previous” button arrow in expanded view.\",\"type\"=>\"text\",\"scope\"=>\"magiczoomplus\",\"desktop-only\"=>\"\"),\n\t\t\t\t\"zoomModeForMobile\"=>array(\"id\"=>\"zoomModeForMobile\",\"group\"=>\"Mobile\",\"order\"=>\"10\",\"default\"=>\"zoom\",\"label\"=>\"Zoom mode\",\"description\"=>\"How to zoom image. off - disable zoom.\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"zoom\",\"magnifier\",\"off\"),\"scope\"=>\"magiczoomplus-mobile\"),\n\t\t\t\t\"textHoverZoomHintForMobile\"=>array(\"id\"=>\"textHoverZoomHintForMobile\",\"advanced\"=>\"1\",\"group\"=>\"Mobile\",\"order\"=>\"20\",\"default\"=>\"Touch to zoom\",\"label\"=>\"Hint to suggest image is zoomable (on hover)\",\"description\"=>\"Hint that shows when zoom mode is enabled, but inactive, and zoom activates on hover (Zoom on: hover).\",\"type\"=>\"text\",\"scope\"=>\"magiczoomplus-mobile\"),\n\t\t\t\t\"textClickZoomHintForMobile\"=>array(\"id\"=>\"textClickZoomHintForMobile\",\"advanced\"=>\"1\",\"group\"=>\"Mobile\",\"order\"=>\"21\",\"default\"=>\"Double tap to zoom\",\"label\"=>\"Hint to suggest image is zoomable (on click)\",\"description\"=>\"Hint that shows when zoom mode is enabled, but inactive, and zoom activates on click (Zoom on: click).\",\"type\"=>\"text\",\"scope\"=>\"magiczoomplus-mobile\"),\n\t\t\t\t\"textExpandHintForMobile\"=>array(\"id\"=>\"textExpandHintForMobile\",\"advanced\"=>\"1\",\"group\"=>\"Mobile\",\"order\"=>\"30\",\"default\"=>\"Tap to expand\",\"label\"=>\"Hint to suggest image is expandable\",\"description\"=>\"Hint that shows when zoom mode activated, or in inactive state if zoom mode is disabled.\",\"type\"=>\"text\",\"scope\"=>\"magiczoomplus-mobile\"),\n\t\t\t\t\"width\"=>array(\"id\"=>\"width\",\"group\"=>\"Scroll\",\"order\"=>\"10\",\"default\"=>\"auto\",\"label\"=>\"Scroll width\",\"description\"=>\"auto | pixels | percetage\",\"type\"=>\"text\",\"scope\"=>\"magicscroll\"),\n\t\t\t\t\"height\"=>array(\"id\"=>\"height\",\"group\"=>\"Scroll\",\"order\"=>\"20\",\"default\"=>\"auto\",\"label\"=>\"Scroll height\",\"description\"=>\"auto | pixels | percetage\",\"type\"=>\"text\",\"scope\"=>\"magicscroll\"),\n\t\t\t\t\"orientation\"=>array(\"id\"=>\"orientation\",\"group\"=>\"Scroll\",\"order\"=>\"30\",\"default\"=>\"horizontal\",\"label\"=>\"Orientation of scroll\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"horizontal\",\"vertical\"),\"scope\"=>\"magicscroll\"),\n\t\t\t\t\"mode\"=>array(\"id\"=>\"mode\",\"group\"=>\"Scroll\",\"order\"=>\"40\",\"default\"=>\"scroll\",\"label\"=>\"Scroll mode\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"scroll\",\"animation\",\"carousel\",\"cover-flow\"),\"scope\"=>\"magicscroll\"),\n\t\t\t\t\"items\"=>array(\"id\"=>\"items\",\"group\"=>\"Scroll\",\"order\"=>\"50\",\"default\"=>\"3\",\"label\"=>\"Items to show\",\"description\"=>\"auto | fit | integer | array\",\"type\"=>\"text\",\"scope\"=>\"magicscroll\"),\n\t\t\t\t\"speed\"=>array(\"id\"=>\"speed\",\"group\"=>\"Scroll\",\"order\"=>\"60\",\"default\"=>\"600\",\"label\"=>\"Scroll speed (in milliseconds)\",\"description\"=>\"e.g. 5000 = 5 seconds\",\"type\"=>\"num\",\"scope\"=>\"magicscroll\"),\n\t\t\t\t\"autoplay\"=>array(\"id\"=>\"autoplay\",\"group\"=>\"Scroll\",\"order\"=>\"70\",\"default\"=>\"0\",\"label\"=>\"Autoplay speed (in milliseconds)\",\"description\"=>\"e.g. 0 = disable autoplay; 600 = 0.6 seconds\",\"type\"=>\"num\",\"scope\"=>\"magicscroll\"),\n\t\t\t\t\"loop\"=>array(\"id\"=>\"loop\",\"group\"=>\"Scroll\",\"order\"=>\"80\",\"advanced\"=>\"1\",\"default\"=>\"infinite\",\"label\"=>\"Continue scroll after the last(first) image\",\"description\"=>\"infinite - scroll in loop; rewind - rewind to the first image; off - stop on the last image\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"infinite\",\"rewind\",\"off\"),\"scope\"=>\"magicscroll\"),\n\t\t\t\t\"step\"=>array(\"id\"=>\"step\",\"group\"=>\"Scroll\",\"order\"=>\"90\",\"default\"=>\"auto\",\"label\"=>\"Number of items to scroll\",\"description\"=>\"auto | integer\",\"type\"=>\"text\",\"scope\"=>\"magicscroll\"),\n\t\t\t\t\"arrows\"=>array(\"id\"=>\"arrows\",\"group\"=>\"Scroll\",\"order\"=>\"100\",\"default\"=>\"inside\",\"label\"=>\"Prev/Next arrows\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"inside\",\"outside\",\"off\"),\"scope\"=>\"magicscroll\"),\n\t\t\t\t\"pagination\"=>array(\"id\"=>\"pagination\",\"group\"=>\"Scroll\",\"order\"=>\"110\",\"advanced\"=>\"1\",\"default\"=>\"No\",\"label\"=>\"Show pagination (bullets)\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"Yes\",\"No\"),\"scope\"=>\"magicscroll\"),\n\t\t\t\t\"easing\"=>array(\"id\"=>\"easing\",\"group\"=>\"Scroll\",\"order\"=>\"120\",\"advanced\"=>\"1\",\"default\"=>\"cubic-bezier(.8, 0, .5, 1)\",\"label\"=>\"CSS3 Animation Easing\",\"description\"=>\"see cubic-bezier.com\",\"type\"=>\"text\",\"scope\"=>\"magicscroll\"),\n\t\t\t\t\"scrollOnWheel\"=>array(\"id\"=>\"scrollOnWheel\",\"group\"=>\"Scroll\",\"order\"=>\"130\",\"advanced\"=>\"1\",\"default\"=>\"auto\",\"label\"=>\"Scroll On Wheel mode\",\"description\"=>\"auto - automatically turn off scrolling on mouse wheel in the 'scroll' and 'animation' modes, and enable it in 'carousel' and 'cover-flow' modes\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"auto\",\"turn on\",\"turn off\"),\"scope\"=>\"magicscroll\"),\n\t\t\t\t\"lazy-load\"=>array(\"id\"=>\"lazy-load\",\"group\"=>\"Scroll\",\"order\"=>\"140\",\"advanced\"=>\"1\",\"default\"=>\"No\",\"label\"=>\"Lazy load\",\"description\"=>\"Delay image loading. Images outside of view will be loaded on demand.\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"Yes\",\"No\"),\"scope\"=>\"magicscroll\"),\n\t\t\t\t\"scroll-extra-styles\"=>array(\"id\"=>\"scroll-extra-styles\",\"group\"=>\"Scroll\",\"order\"=>\"150\",\"advanced\"=>\"1\",\"default\"=>\"\",\"label\"=>\"Scroll extra styles\",\"description\"=>\"mcs-rounded | mcs-shadows | bg-arrows | mcs-border\",\"type\"=>\"text\",\"scope\"=>\"module\"),\n\t\t\t\t\"show-image-title\"=>array(\"id\"=>\"show-image-title\",\"group\"=>\"Scroll\",\"order\"=>\"160\",\"default\"=>\"No\",\"label\"=>\"Show image title\",\"type\"=>\"array\",\"subType\"=>\"radio\",\"values\"=>array(\"Yes\",\"No\"),\"scope\"=>\"module\")\n\t\t\t);\n $this->params->appendParams($params);\n }",
"public function map()\n {\n return [\n 'id' => ['key' => 'provider_id'],\n 'logo' => ['key' => 'logo_uri'],\n 'name' => ['key' => 'display_name'],\n ];\n }",
"private function params_with_defaults() {\n $pars = ['console', 'city', 'last-7-days', 'type', 'game', 'accessory', 'max-price'];\n\n return [\n 'console' => isset($this->params['console']) ? $this->params['console'] : '',\n 'city' => isset($this->params['city']) ? $this->params['city'] : '',\n 'last-7-days' => isset($this->params['last-7-days']) ? $this->params['last-7-days'] : '',\n 'type' => isset($this->params['type']) ? $this->params['type'] : '',\n 'game' => isset($this->params['game']) ? $this->params['game'] : '',\n 'accessory' => isset($this->params['accessory']) ? $this->params['accessory'] : '',\n 'max-price' => isset($this->params['max-price']) ? $this->params['max-price'] : '0'\n ];\n }"
] | [
"0.66918504",
"0.6603489",
"0.6603489",
"0.64404446",
"0.6050598",
"0.5932693",
"0.5773402",
"0.5754576",
"0.57483613",
"0.5696038",
"0.5671172",
"0.56497306",
"0.56479895",
"0.56467557",
"0.56467557",
"0.56067955",
"0.56060416",
"0.55768245",
"0.5562889",
"0.55448616",
"0.55284464",
"0.55028373",
"0.5490649",
"0.54793936",
"0.54681635",
"0.54678667",
"0.5455282",
"0.54360247",
"0.5432839",
"0.5396857"
] | 0.72948575 | 0 |
Replaces commas with dots | public static function changeCommaToDot($value)
{
return str_replace(',', '.', $value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function fromComaToDot( $ar){\n return str_replace( \",\", \".\", $ar);\n }",
"function kReplace($string)\r\n\t{\r\n\t\treturn str_replace(',','.', $string);\r\n\t}",
"public function trataValor($value)\n {\n $value = str_replace(\",\",\".\",$value);\n return $value;\n\n }",
"public function commaToDot($attr)\n {\n $this->$attr = str_replace(',', '.', $this->$attr);\n }",
"function formata($y){\n $a = str_replace('.','',$y); // 1.000,00 => 1000,00\n $b = str_replace(',','.',$a); // 1000,00 => 1000.00 || 140,00 => 140.00\n return $b;\n }",
"function joinNum2($num){\n $num = str_replace(\".\", \"\", $num);\n $num = str_replace(\",\", \".\", $num);\n return $num;\n }",
"function setDecimalEsp($numero){\n\t\t$numero = str_replace(\".\", \",\", $numero);\n\t\treturn $numero;\n\t}",
"private function punctuate(& $sentence)\n\t{\n\t\t$count = count($sentence);\n\t\t$sentence[$count - 1] = $sentence[$count - 1] . '.';\n\t\t\n\t\tif($count < 4)\n\t\t\treturn $sentence;\n\t\t\n\t\t$commas = $this->numberOfCommas($count);\n\t\t\n\t\tfor($i = 1; $i <= $commas; $i++)\n\t\t{\n\t\t\t$index = (int) round($i * $count / ($commas + 1));\n\t\t\t\n\t\t\tif($index < ($count - 1) && $index > 0)\n\t\t\t{\n\t\t\t\t$sentence[$index] = $sentence[$index] . ',';\n\t\t\t}\n\t\t}\n\t}",
"function setPro_peso($pro_peso) {\n $this->pro_peso = str_replace(',', '.', $pro_peso);\n \n }",
"function correctCommas($csv) {\n\t\t$inpt= array(\"\\r\",\"\\n\",' ',';',':','\"','.',\"'\",'`','\\t','(',')','<','>','{','}','#',\"\\r\\n\",'-','_','?','+');\n\t\t$oupt= array(',',',',',',',',',',',',',',',',',',',',',',',',',',',',',',',',',',',',',',',',',',',');\n\t\t$csv = str_replace($inpt,$oupt,$csv);\n\t\twhile(strpos($csv,',,') !== false){\n\t\t\t$csv = str_replace(',,',',',$csv);\n\t\t}\n\t\treturn trim($csv,\",\");\n\t}",
"public function converte($dado){\t\t\t\n\t\tif ($dado != \"\"){\t\n\t\t\treturn number_format($dado, 2, \",\", \".\");\t\n\t\t} \n\t\telse {\t\n\t\t\treturn \"0,00\";\t\n\t\t}\t\n\t}",
"public function converte($dado){\t\t\t\n\t\tif ($dado != \"\"){\t\n\t\t\treturn number_format($dado, 2, \",\", \".\");\t\n\t\t} \n\t\telse {\t\n\t\t\treturn \"0,00\";\t\n\t\t}\t\n\t}",
"function FILTER_SANITIZE_IT_CURRENCY($value)\r\n{\r\n $dotPos = strrpos($value, '.');\r\n $commaPos = strrpos($value, ',');\r\n $separatorIsComma = (($commaPos > $dotPos) && $commaPos);\r\n \r\n // format like 1.121.345,200 moved to 1121345.200 \r\n if($separatorIsComma) {\r\n $value = preg_replace('/\\./', '', $value); // remove dots\r\n $value = preg_replace('/,/', '.', $value); // substitute ',' with '.'\r\n }\r\n \r\n $value = preg_replace('/[^\\d\\.]/', '', $value); // remove anything except digits and dot\r\n \r\n assert( preg_match('/^\\d*\\.?\\d*$/', $value), \"expected a float or empty value, found: <$value>\" );\r\n \r\n return floatval($value);\r\n}",
"function setPro_peso($pro_peso) {\n $this->pro_peso = str_replace(',', '.', $pro_peso);\n\n }",
"function timesheets_reformat_currency_asset($value)\n{\n return str_replace(',','', $value);\n}",
"function clean_format($number, $decimals) {\n return clean_num(number_format(str_replace(',', '', $number), $decimals, '.', ''));\n}",
"public function comma() {\r\n\t\t$this->_string .= ',';\r\n\t}",
"function format_no_decimal_comma($inputval){\n\n$inputval = round($inputval,0);\n$lenval = strlen($inputval);\n\n\tif ($lenval > 3){\n\t\n\t\tif ($lenval == 4) { return substr($inputval,0,1).\",\".substr($inputval,1,3); }\n\t\telseif ($lenval == 5) { return substr($inputval,0,2).\",\".substr($inputval,2,3); }\n\t\telseif ($lenval == 6) { return substr($inputval,0,3).\",\".substr($inputval,3,3); }\n\t\telseif ($lenval == 7) { return substr($inputval,0,1).\",\".substr($inputval,1,3).\",\".substr($inputval,4,3); }\n\t\telseif ($lenval == 8) { return substr($inputval,0,2).\",\".substr($inputval,2,3).\",\".substr($inputval,5,3); }\n\t\telseif ($lenval == 9) { return substr($inputval,0,3).\",\".substr($inputval,3,3).\",\".substr($inputval,6,3); }\n\t\telse { return $inputval;}\t\t\n\t\n\t} else {\n\treturn $inputval; \n\t}\n\n}",
"function formateFloat(array $donnees){\n\tforeach ($donnees as $key => $value) {\n\t \tif (is_numeric($value) && intval($value) == floatval($value)){\n\t \t\t$donnees[$key] = intval($value);\n\t \t}\n\t \tif (is_numeric($value)){\n\t \t\t$donnees[$key] = str_replace('.',',',$donnees[$key]);\n\t \t} \n\t}\n\treturn $donnees; \n}",
"protected static function num($value) {\n return strtr($value, ',', '.');\n }",
"function comma_format($number, $override_decimal_count = false)\n{\n\tglobal $txt;\n\tstatic $thousands_separator = null, $decimal_separator = null, $decimal_count = null;\n\n\t// Cache these values...\n\tif ($decimal_separator === null)\n\t{\n\t\t// Not set for whatever reason?\n\t\tif (empty($txt['number_format']) || preg_match('~^1([^\\d]*)?234([^\\d]*)(0*?)$~', $txt['number_format'], $matches) != 1)\n\t\t{\n\t\t\treturn $number;\n\t\t}\n\n\t\t// Cache these each load...\n\t\t$thousands_separator = $matches[1];\n\t\t$decimal_separator = $matches[2];\n\t\t$decimal_count = strlen($matches[3]);\n\t}\n\n\t// Format the string with our friend, number_format.\n\t$decimals = ((float) $number === $number) ? ($override_decimal_count === false ? $decimal_count : $override_decimal_count) : 0;\n\treturn number_format((float) $number, (int) $decimals, $decimal_separator, $thousands_separator);\n}",
"function format_no($number)\n{\n return number_format($number, 0, ',', '.');\n}",
"public function replaceLineBreaksWithCommas($s)\n\t\t{\n\t\treturn preg_replace(array(\"/\\r/\",\"/\\n/\",'/ /','/ /','/[%,]+/','/,[, ]+/'),',',$s);\n\t\t}",
"function c_float($vlw, $op=FALSE)\r\n{\r\n\tif ($op)\r\n\t{\r\n\t\treturn number_format($vlw, 2, ',', '.');\r\n\t}\r\n\telse if (strstr($vlw, \",\"))\r\n\t{\r\n\t\t$vlw = str_replace('.', '', $vlw);\r\n\t\treturn str_replace(',','.', $vlw);\r\n\t}\r\n\telse if ($op && strstr($vlw, \".\"))\r\n\t{\r\n\t\treturn str_replace('.',',', $vlw);\r\n\t}\r\n\treturn $vlw;\r\n}",
"function convertNumber($number)\n {\n $number = str_replace(',', '.', $number);\n return $number;\n }",
"function formataValor($valor, $tipo = 1){\n // 2 - real para americano\n if ($tipo == 1){\n return number_format($valor, 2, ',', '.');\n }else if($tipo == 2){\n return str_replace(',','.', str_replace('.','', $valor));\n }\n }",
"public function testPriceComma() {\n $input = '1,23';\n $expected = array('1.23');\n $this->validator->validate($input);\n $this->assertEquals($this->validator->getTokens(), $expected);\n }",
"function strip_comma($string){\n\t//return preg_replace('#.*?([0-9]*(\\.[0-9]*)?).*?#', '$1', $string);\n\t//return str_replace(',', '', $string);\n\t $v1 = explode (',', $string) ;\n $string = \"\" ;\n foreach($v1 as $t) {\n\t\t\tif($t != ',' && ord($t) < 128)\n \t$string .= $t;\n\t\t\t}\n\treturn $string;\n\t}",
"function moedaSql($ValorSql) {\r\n $origem = array('.', ','); \r\n $destino = array('', '.');\r\n $ValorSql = str_replace($origem, $destino, $ValorSql); //remove os pontos e substitui a virgula pelo ponto\r\n\t\r\n return $ValorSql; //retorna o valor formatado para gravar no banco\r\n}",
"function formatPrice($value){\n if(!$value==null){\n return number_format($value,2,\",\",\".\");\n }else{\n return 0;\n }\n}"
] | [
"0.6766795",
"0.6762829",
"0.6541759",
"0.6504552",
"0.64471996",
"0.6373965",
"0.6292662",
"0.62456876",
"0.62198514",
"0.6097693",
"0.6008135",
"0.6008135",
"0.6003709",
"0.5852213",
"0.58350796",
"0.578061",
"0.57733226",
"0.5747549",
"0.57104963",
"0.5670153",
"0.5585643",
"0.55673695",
"0.5548705",
"0.55283296",
"0.5518302",
"0.5508208",
"0.5485068",
"0.5460262",
"0.5443682",
"0.53986543"
] | 0.75265193 | 0 |
Returns an array of values flattened to dot notation | public static function flattenArrayToDotNotation(array $data)
{
$nodes = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($data));
$result = [];
foreach ($nodes as $leafValue) {
$keys = [];
foreach (range(0, $nodes->getDepth()) as $depth) {
$keys[] = $nodes->getSubIterator($depth)->key();
}
$result[join('.', $keys)] = $leafValue;
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFlat(){\n\t\treturn Tools::arrayFlatten($this->get());\n\t}",
"public function toArrayValues()\n {\n $result = [];\n foreach ($this->each() as $v) {\n $this->_toArrayValues($result, $v);\n }\n return $result;\n }",
"public function toArray(): array\n {\n $entity = [$this->name];\n\n foreach ($this->values as $value) {\n /** @var Value $value */\n $entity[] = $value->toArray();\n }\n\n return $entity;\n }",
"public function toArray()\n {\n $arr = [];\n foreach ($this as $k => $v) {\n if ($v instanceof Enumerable) {\n $arr[] = $v->toArray();\n } else {\n $arr[] = $v;\n }\n }\n\n return $arr;\n }",
"public function attributesToArray()\n {\n $attributes = parent::attributesToArray();\n\n // Convert dot-notation dates.\n foreach ($this->getDates() as $key) {\n if (str_contains($key, '.') and array_has($attributes, $key)) {\n array_set($attributes, $key, (string) $this->asDateTime(array_get($attributes, $key)));\n }\n }\n return $attributes;\n }",
"function array_undot(array $dotNotationArray)\n {\n $array = [];\n foreach ($dotNotationArray as $key => $value) {\n // if there is a space after the dot, this could legitimately be\n // a single key and not nested.\n if (count(explode('. ', $key)) > 1) {\n $array[$key] = $value;\n } else {\n Arr::set($array, $key, $value);\n }\n }\n\n return $array;\n }",
"function array_undot(array $dotNotationArray)\n {\n $array = [];\n foreach ($dotNotationArray as $key => $value) {\n // if there is a space after the dot, this could legitimately be\n // a single key and not nested.\n if (count(explode('. ', $key)) > 1) {\n $array[$key] = $value;\n } else {\n Arr::set($array, $key, $value);\n }\n }\n return $array;\n }",
"function array_dot($array, $prepend = '')\n {\n $results = array();\n\n foreach ($array as $key => $value) {\n if (is_array($value)) {\n $results = array_merge($results, dot($value, $prepend . $key . '.'));\n } else {\n $results[$prepend . $key] = $value;\n }\n }\n\n return $results;\n }",
"function toArray() {\r\n return $this->parseValue($this->root);\r\n }",
"function array_dot($array, $prepend = '')\n{\n\t$results = array();\n\n\tforeach ($array as $key => $value) {\n\t\tif (is_array($value)) {\n\t\t\t$results = array_merge($results, array_dot($value, $prepend.$key.'.'));\n\t\t} else {\n\t\t\t$results[$prepend.$key] = $value;\n\t\t}\n\t}\n\n\treturn $results;\n}",
"public function toArray()\n {\n return \\array_map(function ($value) {\n if (\\is_scalar($value)) {\n return $value;\n }\n\n return $this->asArray($value, false);\n }, $this->getData());\n }",
"public function toArray()\n {\n $output = [];\n\n foreach ($this->data as $k => $v) {\n $output[$k] = (is_object($v) && method_exists($v, 'toArray')) ? $v->toArray() : $v;\n }\n\n return $output;\n }",
"public function dot($array, $prepend = '')\n {\n $results = [];\n foreach ($array as $key => $value) {\n\n if (is_array($this->should_dot) && in_array($key, $this->should_dot)) {\n $results[$key] = $value;\n continue;\n }\n\n if (is_array($value) && !empty($value)) {\n $results = array_merge($results, $this->dot($value, $prepend . $key . '.'));\n } else {\n $results[$prepend . $key] = $value;\n }\n }\n\n return $results;\n }",
"public function toArray() {\n $a = array();\n foreach ($this->items as $v) {\n $a[] = $v->toArray();\n }\n return $a;\n }",
"public function values(): array\n {\n return Arrays::values($this->array);\n }",
"public function toPlainArray()\n {\n return $this->map(function (Claim $claim) {\n return $claim->getValue();\n })->toArray();\n }",
"public function toArray() :array\n\t{\n\t\t$val = $this->value();\n\n\t\treturn (is_array($val) ? $val : explode(',', $val));\n\t}",
"public function getFlattenedFields(): array\n {\n return $this->queryHandler->fetchAllAndFlatten([\n 'fields' => $this->fields,\n 'repositories' => $this->repositories,\n 'tables' => $this->connections,\n 'where' => $this->where,\n 'order' => $this->orderBy,\n 'group' => $this->groupBy,\n 'limit' => $this->limitTo,\n 'offset' => $this->startAt,\n 'lock' => $this->blocking,\n ]);\n }",
"function dot($array, $prepend = '')\n {\n $results = array();\n\n foreach ($array as $key => $value) {\n if (is_array($value)) {\n $results = array_merge($results, dot($value, $prepend . $key . '.'));\n } else {\n $results[$prepend . $key] = $value;\n }\n }\n\n return $results;\n }",
"public function asArray()\n {\n $return = array();\n $entries = $this->entries();\n foreach ($entries as $entry) {\n $attrs = array();\n $entry_attributes = $entry->attributes();\n foreach ($entry_attributes as $attr_name) {\n $attr_values = $entry->getValue($attr_name, 'all');\n if (!is_array($attr_values)) {\n $attr_values = array($attr_values);\n }\n $attrs[$attr_name] = $attr_values;\n }\n $return[$entry->dn()] = $attrs;\n }\n return $return;\n }",
"public function toArray()\n {\n $data = array();\n foreach ($this->_data as $key => $val) {\n $data[$key] = $this->_toArray($val);\n }\n return $data;\n }",
"public function toArray(): array\n {\n $result = [];\n foreach($this as $val) {\n $result[] = $val;\n }\n\n return $result;\n }",
"public function toArray()\n {\n $array = [];\n\n foreach (self::$properties[get_class($this)] as $name => $info) {\n if (!array_key_exists($name, $this->values)) {\n continue;\n }\n\n $value = $this->values[$name];\n\n if ($info['repeatable']) {\n if (count($value)) {\n $array[$name] = [];\n foreach ($value as $property) {\n $array[$name][] = self::propertyToArrayValue($property);\n }\n }\n } else {\n $array[$name] = self::propertyToArrayValue($value);\n }\n }\n\n return $array;\n }",
"function array_dot($array, $prepend = '')\n {\n $results = array();\n\n foreach ($array as $key => $value)\n {\n if (is_array($value))\n {\n $results = array_merge($results, dot($value, $prepend.$key.'.'));\n }\n else\n {\n $results[$prepend.$key] = $value;\n }\n }\n\n return $results;\n }",
"public function toArray(){\n\t\t$array = array();\n\t\tforeach($this as $key => $value){\n\t\t\tif(strpos($key,'_')===0) continue;\n\t\t\tif($value instanceof ContextStdClass){\n\t\t\t\t$array[$key] = $value->toArray();\n\t\t\t}else{\n\t\t\t\t$array[$key] = $value;\n\t\t\t}\n\t\t}\n\t\treturn $array;\n\t}",
"public function getDataArray(){\n return self::toArrayRecursive($this);\n }",
"public function toData(): array\n {\n return Pipeline::with($this->entities)\n ->map(function(Entity $entity, string $key) {\n return ['key' => $key] + $entity->toData();\n })\n ->values()\n ->toArray();\n }",
"public static function dot($array, $prepend = '')\n {\n $results = [];\n\n foreach ($array as $key => $value) {\n if (is_array($value) && !empty($value)) {\n $results = array_merge($results, static::dot($value, $prepend . $key . '.'));\n } else {\n $results[$prepend . $key] = $value;\n }\n }\n\n return $results;\n }",
"public function toArray()\n {\n $data = $this->data;\n foreach ($data as $key => $value) {\n $data[$key] = $value->toArray();\n }\n return $data;\n }",
"public function convertArrayToDotNotation(array $array)\n {\n $recursiveIterator = new \\RecursiveIteratorIterator(new \\RecursiveArrayIterator($array));\n\n $newArray = [];\n\n foreach ($recursiveIterator as $leafValue) {\n $keys = [];\n\n foreach (range(0, $recursiveIterator->getDepth()) as $depth) {\n $keys[] = $recursiveIterator->getSubIterator($depth)->key();\n }\n\n $newArray[implode('.', $keys)] = $leafValue;\n }\n\n return $newArray;\n }"
] | [
"0.70000803",
"0.634473",
"0.6333974",
"0.6196427",
"0.61793655",
"0.61468714",
"0.613248",
"0.60722345",
"0.60717356",
"0.6066795",
"0.60662186",
"0.6062336",
"0.6048337",
"0.6012752",
"0.6006577",
"0.59903365",
"0.5981611",
"0.59681034",
"0.59676206",
"0.59647065",
"0.59628737",
"0.5959202",
"0.59462345",
"0.59339374",
"0.59279335",
"0.5922993",
"0.59180665",
"0.5895962",
"0.5894613",
"0.58809394"
] | 0.65263826 | 1 |
Retrieve content from backup | public function getBackupContent()
{
$itemIdentifier = $this->request->getParam('bc_identifier');
$itemName = $this->request->getParam('item');
$itemType = $this->request->getParam('bc_type');
$storeId = $this->request->getParam('store_id');
if (!is_null($storeId)) {
$path = $this->backupManager->getBackupPathByStoreId($itemType, $itemIdentifier, (int)$storeId)
. DIRECTORY_SEPARATOR . $itemName;
} else {
$path = $this->backupManager->getBackupPath($itemType, $itemIdentifier)
. DIRECTORY_SEPARATOR . $itemName;
}
return $this->file->readData($path);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionShow()\r\n\t{\r\n\t\t$filename = Yii::app()->request->getParam('filename');\r\n\t\t\r\n\t\t$dir = dirname(Yii::app()->basePath).'/backup/';\r\n\t\t\r\n\t\t$myfile = Yii::app()->file->set($dir.$filename, true);\r\n\r\n\t\t$content = $myfile->getContents();\r\n\t\t$this->render('show',array('content'=>$content));\r\n\t}",
"public function getAllBackups();",
"public function getBackups()\r\n {\r\n check_ajax_referer('kb-read');\r\n $request = Utilities::getRequest();\r\n $postId = $request->request->get('post_id', null);\r\n\r\n if (is_null($postId)) {\r\n return new AjaxErrorResponse('No post id provided', []);\r\n }\r\n\r\n $environment = Utilities::getPostEnvironment($postId);\r\n $backupManager = new BackupDataStorage2($environment);\r\n $items = array_map(function ($row) {\r\n unset($row->value);\r\n return $row;\r\n }, $backupManager->getAll());\r\n return new AjaxSuccessResponse('Backups retrieved', $items);\r\n\r\n }",
"public function get()\n {\n return $this->storedFile->get_content();\n }",
"public function backup_content () {\n\t\tif ( isset( $_POST['anva_import'] ) && ( $_POST['anva_import'] == '1' ) ) {\n\t\t\t$this->import();\n\t\t}\n\n\t\tif ( isset( $_POST['anva_export'] ) && ( $_POST['anva_export'] == '1' ) ) {\n\t\t\t$this->export();\n\t\t}\n\t}",
"public function getContents() {\n //echo \"TRACE=\".$this->getClass().\"-\".$this->id;\n return bizobject::getBizobjects('content', 'referentClass=\"'.$this->getClass().'\" AND referentId='.$this->id, 'format');\n }",
"public function getContents();",
"public function getContents();",
"public function listdbsbackup(){\n $this->cpanel_api_ver = 'api2';\n return $this->_check_result($this->api2_query($this->user, 'MysqlFE', __FUNCTION__));\n }",
"protected function getContents()\n {\n return $this->engine->get($this->path, $this->gatherData());\n }",
"public function get_backup() {\n\n\t\t\tif ( ! isset( $_REQUEST['nonce'] ) ) {\n\t\t\t\twp_die(\n\t\t\t\t\t__( 'Nonce key not provided', 'monstroid-dashboard' ),\n\t\t\t\t\t__( 'Downloading Error', 'monstroid-dashboard' )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( ! wp_verify_nonce( esc_attr( $_REQUEST['nonce'] ), 'monstroid-dashboard' ) ) {\n\t\t\t\twp_die(\n\t\t\t\t\t__( 'Incorrect nonce key', 'monstroid-dashboard' ),\n\t\t\t\t\t__( 'Downloading Error', 'monstroid-dashboard' )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\t\twp_die(\n\t\t\t\t\t__( 'Permission denied', 'monstroid-dashboard' ),\n\t\t\t\t\t__( 'Downloading Error', 'monstroid-dashboard' )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$file = isset( $_REQUEST['file'] ) ? esc_attr( $_REQUEST['file'] ) : '';\n\n\t\t\tif ( ! $file ) {\n\t\t\t\twp_die(\n\t\t\t\t\t__( 'Backup file not provided', 'monstroid-dashboard' ),\n\t\t\t\t\t__( 'Downloading Error', 'monstroid-dashboard' )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tinclude_once( monstroid_dashboard()->plugin_dir( 'admin/includes/class-monstroid-dashboard-backup-manager.php' ) );\n\n\t\t\t$backup_manager = Monstroid_Dashboard_Backup_Manager::get_instance();\n\t\t\t$backups = $backup_manager->download_backup( $file );\n\n\t\t\tif ( false == $backups ) {\n\t\t\t\twp_die(\n\t\t\t\t\t$backup_manager->get_message(),\n\t\t\t\t\t__( 'Downloading Error', 'monstroid-dashboard' )\n\t\t\t\t);\n\t\t\t}\n\n\t\t}",
"public function getContents()\n {\n }",
"abstract public function backupData(): string;",
"public function backupList()\n {\n return $this->getService()->resourceList('Backup', $this->getUrl('backups'), $this);\n }",
"public function get_contents()\r\n {\r\n return $this->_contents;\r\n }",
"function getContent(){ $this->fetchContent(); return $this->_Content; }",
"function get_content(){}",
"public function indexAction() {\n\t\t$this->view->assign('backups', $this->backupRepository->findAll());\n\t}",
"private function outputFuncBackupMgr() {\n\t\t// get vars\n\t\t$filename = t3lib_div::_POST('file');\n\t\t$origDiff = t3lib_div::_POST('origDiff');\n\t\t$extPath = $this->MOD_SETTINGS['extList'];\n\n\t\t// get output\n\t\t$metaArray = $this->backupObj->getMetaInfos(2);\n\t\tif (!count($metaArray)) {\n\t\t\tthrow new LFException('failure.backup.noFiles', 1);\n\t\t}\n\t\t$content = tx_lfeditor_mod1_template::outputManageBackups($metaArray, $extPath);\n\n\t\t$diff = $metaDiff = NULL;\n\t\tif ($origDiff) {\n\t\t\t// set backup file\n\t\t\t$metaArray = $this->backupObj->getMetaInfos(3);\n\t\t\t$informations = array(\n\t\t\t\t'absPath' => typo3Lib::fixFilePath(\n\t\t\t\t\tPATH_site . '/' .\n\t\t\t\t\t$metaArray[$filename]['pathBackup']\n\t\t\t\t),\n\t\t\t\t'relFile' => $filename,\n\t\t\t);\n\t\t\t$this->backupObj->setVar($informations);\n\n\t\t\t// exec diff\n\t\t\ttry {\n\t\t\t\t// read original file\n\t\t\t\t$this->initFileObject(\n\t\t\t\t\t$this->backupObj->getVar('langFile'),\n\t\t\t\t\tPATH_site . '/' . $this->backupObj->getVar('extPath'),\n\t\t\t\t\t$this->MOD_SETTINGS['wsList']\n\t\t\t\t);\n\n\t\t\t\t// read backup file\n\t\t\t\t$this->backupObj->readFile();\n\n\t\t\t\t// get language data\n\t\t\t\t$origLang = $this->fileObj->getLocalLangData();\n\t\t\t\t$backupLocalLang = $this->backupObj->getLocalLangData();\n\n\t\t\t\t// get meta data\n\t\t\t\t$origMeta = $this->fileObj->getMetaData();\n\t\t\t\t$backupMeta = $this->backupObj->getMetaData();\n\n\t\t\t\t$diff = tx_lfeditor_mod1_functions::getBackupDiff(0, $origLang, $backupLocalLang);\n\t\t\t\t$metaDiff = tx_lfeditor_mod1_functions::getMetaDiff(0, $origMeta, $backupMeta);\n\t\t\t} catch (LFException $e) {\n\t\t\t\treturn $e->getMessage() . $content;\n\t\t\t}\n\t\t}\n\n\t\t// generate diff\n\t\tif (count($diff)) {\n\t\t\t$content .= tx_lfeditor_mod1_template::outputManageBackupsDiff(\n\t\t\t\t$diff, $metaDiff,\n\t\t\t\t$this->fileObj->getLocalLangData(), $this->backupObj->getLocalLangData(),\n\t\t\t\t$this->fileObj->getOriginLangData(), $this->backupObj->getOriginLangData(),\n\t\t\t\t$this->fileObj->getMetaData(), $this->backupObj->getMetaData()\n\t\t\t);\n\t\t}\n\n\t\treturn $content;\n\t}",
"public function getContents() { return $this->contents; }",
"public function getBackupURL()\n {\n }",
"public function backup_list()\n {\n $path = $this->path;\n $backups = [];\n\n $list_files = glob($path . '*.sql');\n\n if ($list_files) {\n $list = array_map('basename', $list_files);\n sort($list);\n foreach ($list as $id => $filename) {\n $columns = [];\n $columns['id'] = $id;\n $columns['name'] = basename($filename);\n $columns['size'] = filesize($path . $filename);\n\n $columns['create_time'] = date('Y-m-d H:i:s', filectime($path . $filename));\n $columns['modified_time'] = date('Y-m-d H:i:s', filemtime($path . $filename));\n\n $backups[] = $columns;\n }\n }\n\n $type = 'load';\n\n return view('backup.list',compact('backups','type'));\n }",
"public function getContent()\n {\n return Mol_Util_MemoryStreamWrapper::readBucket($this->id);\n }",
"public function getContent()\n {\n return $this->filesystem->get($this->path);\n }",
"public function getContents()\n {\n return $this->contents;\n }",
"public function getContents()\n {\n return $this->contents;\n }",
"public function getContents()\n {\n return $this->contents;\n }",
"public function getContents()\n {\n return $this->contents;\n }",
"public function getContents()\n {\n return $this->contents;\n }",
"public function getContents()\n\t{\n\t\treturn $this->contents;\n\t}"
] | [
"0.6411548",
"0.64101547",
"0.62216824",
"0.62115633",
"0.6208717",
"0.6144674",
"0.6123936",
"0.6123936",
"0.6086216",
"0.60545623",
"0.60348165",
"0.5990607",
"0.5964411",
"0.5954636",
"0.5932572",
"0.5898334",
"0.58856004",
"0.5829841",
"0.5826226",
"0.57708895",
"0.57642776",
"0.5762829",
"0.5745336",
"0.57273877",
"0.5708414",
"0.5708414",
"0.5708414",
"0.5708414",
"0.5708414",
"0.57052153"
] | 0.7449779 | 0 |
Sets the additional data. | public function setAdditionalData($data) {
$this->set('additional_data', $data);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setExtraData($data);",
"public function setAdditionalData($data)\n {\n $this->data = $data;\n return $this;\n }",
"public function setAdditionalData(array $data)\n {\n $this->data = $data;\n return $this;\n }",
"function setData( $data ) {\n $this->data = $data;\n }",
"function setData($data) {\n\t\t$this->_data = $data;\n\t}",
"protected function setData()\n {\n }",
"function setData($data){\r\n $this->data = $data;\r\n }",
"public static function setData()\n\t{\n\t\tswitch (func_num_args()) {\n\t\t\tcase 1:\n\t\t\t\tself::$data = array_merge(self::$data, func_get_arg(0));\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tself::$data[func_get_arg(0)] = func_get_arg(1);\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function setData( $data );",
"protected function initAdditionalInformation()\n {\n $additionalInfo = $this->getData('additional_information');\n if (empty($this->additionalInformation) && $additionalInfo) {\n $this->additionalInformation = $additionalInfo;\n }\n }",
"public function setData($data) {\r\n\t\t$this->data = $data;\r\n\t}",
"public function setData($data) {\n $this->data = $data;\n }",
"public function set_data( $data ) {\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n {\n $this->data = $data;\n }",
"public function setData($data) {\n\t\t$this->data = $data;\n\t}",
"public function setData($data) {\n\t\t$this->data = $data;\n\t}",
"public function setData($data)\n {\n $this->_data = $data;\n }",
"public function setData($data)\n {\n $this->_data = $data;\n }",
"public function setData($data)\n {\n $this->_data = $data;\n }",
"public function setData($data)\n\t{\n\t}",
"protected function setData()\n\t{\n\t\t// Dummy values\n\t\t$data['momentum'] = 25;\n\t\t\n\t\t$this->data = $data;\n\t}",
"public function setData($data){\n $this->data = $data;\n $this->debug .= \"Data set\\n\";\n }"
] | [
"0.78458947",
"0.72023267",
"0.71932554",
"0.70855457",
"0.70621043",
"0.70443267",
"0.7038718",
"0.70346886",
"0.7024836",
"0.6943178",
"0.69239223",
"0.6918945",
"0.691646",
"0.6912437",
"0.6912437",
"0.6912437",
"0.6912437",
"0.6912437",
"0.6912437",
"0.6912437",
"0.6912437",
"0.6886878",
"0.68818843",
"0.68818843",
"0.685585",
"0.685585",
"0.685585",
"0.68546003",
"0.68527925",
"0.68292797"
] | 0.7462548 | 1 |
Gets the changed time field. | public function getChangedTime() {
return $this->get('changed')->value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getModifiedTime() {\r\n return $this->vtigerFormat($this->data['entity']->updated->text);\r\n }",
"function getChangeTime()\n {\n return time();\n }",
"public function getModifiedTime()\n {\n return $this->modifiedTime;\n }",
"public function getModifiedTime()\n\t{\n\t\treturn $this->modifiedTime; \n\n\t}",
"public function getTime_updated()\n {\n return $this->time_updated;\n }",
"public function getTimeUpdated()\n {\n return $this->time_updated;\n }",
"public function getUpdatedTime()\n {\n return $this->updated_time;\n }",
"public function getTimeUpdated() {\n\t\treturn $this->time_updated;\n\t}",
"public function getChangedDate() {\n return $this->changed;\n }",
"public function getDisputeModifiedTime()\n {\n return $this->disputeModifiedTime;\n }",
"public function getUpdateTime() {\n return $this->get(self::UPDATE_TIME);\n }",
"public function getUpdateTime() {\n return $this->get(self::UPDATE_TIME);\n }",
"public function updateTime()\r\n {\r\n return Arr::get($this->info, 'updateTime');\r\n }",
"public function getUpdateTime()\n {\n return $this->getData(self::UPDATE_TIME);\n }",
"public function getUpdateTime()\n {\n return $this->getData(self::UPDATE_TIME);\n }",
"public function get_mtime() {\n\t\n\t\treturn $this->mtime;\n\t}",
"public function getUpdate_time()\r\n {\r\n return $this->update_time;\r\n }",
"public function getModifiedTimestamp()\n {\n return $this->_modified ? $this->_modified->format('U') : null;\n }",
"public function getChanged()\n {\n return $this->changed;\n }",
"public function getModifyTime()\n {\n return $this->modify_time;\n }",
"public function getModifyTime()\n {\n return $this->modify_time;\n }",
"public function getModifyTime()\n {\n return $this->modifyTime;\n }",
"public function getModificationTime()\n {\n return $this->modification_time;\n }",
"public function getChanged()\r\n {\r\n return $this->changed;\r\n }",
"public function getLastModifiedTime()\n {\n return $this->_lastModifiedTime;\n }",
"public function getUpdateTime()\r\n {\r\n return $this->update_time;\r\n }",
"public function getModTime()\n {\n return $this->modTime;\n }",
"public function getUpdateTime()\n {\n return $this->update_time;\n }",
"public function getUpdateTime()\n {\n return $this->update_time;\n }",
"public function getUpdateTime()\n {\n return $this->update_time;\n }"
] | [
"0.78227013",
"0.7622062",
"0.7618766",
"0.74288523",
"0.7390849",
"0.73371166",
"0.73052615",
"0.72524035",
"0.7229339",
"0.70899856",
"0.69953686",
"0.69953686",
"0.69693285",
"0.69473386",
"0.69473386",
"0.6905732",
"0.6904177",
"0.6880835",
"0.6864949",
"0.6860906",
"0.6860906",
"0.6854881",
"0.68546796",
"0.68295807",
"0.681582",
"0.68132114",
"0.68065697",
"0.6801597",
"0.6801597",
"0.6801597"
] | 0.90635085 | 0 |
metodo para modificar los datos principales del formato | public function modificarDatosFormato($formato,$clave,$valor){
$rename=true;
if($clave=='cod_formato'){
$rename=$this->info->cambiarNombreTablaInfo($formato,$valor);
if(!$rename){
return 'Error actualizando la tabla de información del formato';
}
}
if($rename){
$exec= $this->formato->modificarDatosFormato($formato,$clave,$valor);
if($exec){
return 'Dato actualizado correctamente';
}
}
return 'El dato no ha podido ser actualizado';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function modificar()\n\t{\n\t\t$personasModelo = new PersonasModelo();\t\n\t\t$personasModelo->ModificarPersona($this->personaID, $this->nombre, $this->apellido, $this->usuario,$this->password, $this->telefono, $this->email, $this->direccion, $this->direccionCoordenadas, $this->direccionDefault, $this->direccionTipo, $this->estado, $this->rolID, $this->documento, $this->agenciaID);\n\t\techo \" La persona con ID: \", $this->personaID . \" es la persona actualizada\";\t\t\n\t}",
"function modificarDepositos(){\n\t\t$this->procedimiento='vef.ft_depositos_ime';\n\t\t$this->transaccion='VF_CDO_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_apertura_cierre_caja','id_apertura_cierre_caja','int4');\n\t\t$this->setParametro('nro_deposito','nro_deposito','varchar');\n\t\t$this->setParametro('id_punto_venta','id_punto_venta','int4');\n\t\t$this->setParametro('codigo','codigo','varchar');\n\t\t$this->setParametro('nombre_sucursal','nombre_sucursal','varchar');\n\t\t$this->setParametro('id_usuario_cajero','id_usuario_cajero','int4');\n\t\t$this->setParametro('fecha_hora_cierre','fecha_hora_cierre','timestamp');\n\t\t$this->setParametro('cajero','cajero','text');\n\t\t$this->setParametro('nombre_punto_venta','nombre_punto_venta','varchar');\n\t\t$this->setParametro('id_entrega_brinks','id_entrega_brinks','int4');\n\t\t$this->setParametro('fecha_apertura_cierre','fecha_apertura_cierre','date');\n\t\t$this->setParametro('id_moneda','id_moneda','int4');\n\t\t$this->setParametro('monto_inicial_moneda_extranjera','monto_inicial_moneda_extranjera','numeric');\n\t\t$this->setParametro('arqueo_moneda_local','arqueo_moneda_local','numeric');\n\t\t$this->setParametro('fecha_venta','fecha_venta','date');\n\t\t$this->setParametro('id_sucursal','id_sucursal','int4');\n\t\t$this->setParametro('codigo_lugar','codigo_lugar','varchar');\n\t\t$this->setParametro('monto_inicial','monto_inicial','numeric');\n\t\t$this->setParametro('arqueo_moneda_extranjera','arqueo_moneda_extranjera','numeric');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function atualizar(){\n // $Usuario = new UsuarioModel;\n //\n //\n // $migracao = $Migracao->listar();\n //\n // foreach($migracao as $r):\n // $usuario = $Usuario->buscar_nome($r->nome);\n // if($usuario):\n // $dados = array(\n // 'cpf' => $usuario->documento\n // );\n // $update = $Migracao->update($dados, \"`nome` = '{$r->nome}'\");\n // endif;\n // endforeach;\n // exit();\n }",
"function modificar() {\n\t\tglobal $mdb2;\n\t\t$sql = \"SELECT * FROM public.cliente_usuario_grupo_modifica(\".\n\t\t\t\tpg_escape_string($this->__usuario_id).\",\".\n\t\t\t\tpg_escape_string($this->grupo_id).\", '\".\n\t\t\t\tpg_escape_string($this->nombre).\"','\".\n\t\t\t\tpg_escape_string($this->descripcion).\"')\";\n\t\t$res =& $mdb2->query($sql);\n\t\tif (MDB2::isError($res)) {\n\t\t\tdie($sql);\n\t\t}\n\t}",
"function evt__form_cc__modificacion($datos)\r\n\t{\r\n $categ=$this->dep('datos')->tabla('categoria')->get();\r\n $datos['codigo_categ']=$categ['codigo_categ'];\r\n $cost=$this->dep('datos')->tabla('costo_categoria')->get();\r\n $this->dep('datos')->tabla('costo_categoria')->set($datos);\r\n $this->dep('datos')->tabla('costo_categoria')->sincronizar();\r\n\r\n $this->dep('datos')->tabla('costo_categoria')->modificar_fecha_desde($categ['codigo_categ'],$cost['desde'],$datos['desde']);\r\n toba::notificacion()->agregar('Se ha modificado el costo correctamente', 'info');\r\n $this->s__mostrar_p=0;\r\n\t}",
"function bbiLab_retornarCajasDelLaboratorio_modificarCamposDelVial($nid) { \n //Cogemos los campos a modificar\n $campos = array(\n 'field_vial_sincronizado' => 1,\n 'field_vial_localizacion' => 1,\n 'field_vial_pistoleteado' => 0,\n 'field_ayuntamiento' => NULL,\n 'field_veterinario' => NULL,\n 'field_vial_fecha_de_extracci_n' => NULL,\n 'field_vial_fecha_fin_analisis' => NULL,\n 'field_vial_estado' => NULL,\n );\n\n foreach ($campos as $campo => $value) {\n //Si tiene dato es que hay que hacer update, si no lo tiene es que \n //hay que eliminar.\n if($value !== NULL) {\n db_update('field_data_' . $campo)\n ->fields(array($campo . '_value' => $value,))\n ->condition('entity_id', $nid, '=')\n ->execute(); \n } else {\n db_delete('field_data_' . $campo)\n ->condition('entity_id', $nid, '=')\n ->execute();\n }\n } \n}",
"function modificarCasaOracion(){\n\t\t$this->procedimiento='ccb.f_casa_oracion_ime';\n\t\t$this->transaccion='CCB_CAOR_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_casa_oracion','id_casa_oracion','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('fecha_cierre','fecha_cierre','date');\n\t\t$this->setParametro('codigo','codigo','varchar');\n\t\t$this->setParametro('id_region','id_region','int4');\n\t\t$this->setParametro('id_lugar','id_lugar','int4');\n\t\t$this->setParametro('direccion','direccion','text');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('fecha_apertura','fecha_apertura','date');\n\t\t$this->setParametro('latitud','latitud','varchar');\n\t\t$this->setParametro('longitud','longitud','varchar');\n\t\t$this->setParametro('zoom','zoom','varchar');\n\t\t$this->setParametro('id_uo','id_uo','int4');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function modificar() {\n $objDatos = new clsDatos();\n $sql = \"UPDATE asigna_caso\n SET id_aca = '$this->id_aca',\n id_pac = '$this->id_pac',\n id_usu = '$this->id_usu',\n tip_aca = '$this->tip_aca',\n est_aca = '$this->est_aca';\";\n $objDatos->ejecutar($sql);\n $objDatos->crerrarconexion();\n }",
"function validar_datos(){\r\n\t\t// validar nombre, version, creacion ...\r\n\t}",
"function modificarDosificacionRO(){\n $this->procedimiento='vef.ft_dosificacion_ro_ime';\n $this->transaccion='VF_DOS_RO_MOD';\n $this->tipo_procedimiento='IME';\n\n\n //Define los parametros para la funcion\n\t\t\t\t$this->setParametro('id_dosificacion_ro','id_dosificacion_ro','int4');\n $this->setParametro('id_sucursal','id_sucursal','int4');\n\t\t\t\t$this->setParametro('final','final','integer');\n\t\t\t\t$this->setParametro('tipo','tipo','varchar');\n\t\t\t\t$this->setParametro('fecha_dosificacion','fecha_dosificacion','date');\n\t\t\t\t$this->setParametro('nro_siguiente','nro_siguiente','int4');\n\t\t\t\t$this->setParametro('fecha_inicio_emi','fecha_inicio_emi','date');\n\t\t\t\t$this->setParametro('fecha_limite','fecha_limite','date');\n\t\t\t\t$this->setParametro('tipo_generacion','tipo_generacion','varchar');\n\t\t\t\t$this->setParametro('inicial','inicial','integer');\n\t\t\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }",
"function set_representante( $codigo_solicitud, $estudiante_per_codi, $user_data, $repr, $relacion)\r\n{\r\n\t$direccion_igual = $user_data[ 'ckb_'.$repr.'_per_dir_igual' ];\r\n\t$dir = $telf = \"\";\r\n\tif( ( $direccion_igual == 1 ) || ( $direccion_igual == 'true' ) ) //Valida si la dirección del repr. es igual a la del estudiante, para no tipearla dos veces.\r\n\t{ $dir = $user_data['per_dir'];\r\n\t\t$telf = $user_data['per_telf'];\r\n\t}\r\n\telse\r\n\t{ $dir = $user_data[ $repr.'_dir' ];\r\n\t\t$telf = $user_data[ $repr.'_telf' ];\r\n\t}\r\n\t$solicitud = new Solicitud();\r\n\t$solicitud->set_solicitud_representante(\r\n\t\t$codigo_solicitud,\r\n\t\t$estudiante_per_codi,\r\n\t\t$user_data[ $repr.'_codi'], //vacío si es insert, lleno si es update.\r\n\t\t$user_data[ 'cmb_'.$repr.'_tipo_identificacion' ],\r\n\t\t$user_data[ $repr.'_numero_identificacion' ],\r\n\t\t$user_data[ $repr.'_nomb' ],\r\n\t\t$user_data[ $repr.'_nomb_seg' ],\r\n\t\t$user_data[ $repr.'_apel' ],\r\n\t\t$user_data[ $repr.'_apel_mat' ],\r\n\t\t$dir,\r\n\t\t$telf,\r\n\t\t$user_data[ $repr.'_email_personal' ],\r\n\t\t$user_data[ $repr.'_fecha_nac' ],\r\n\t\t$user_data[ 'cmb_pais_'.$repr.'_lugar_nac' ],\r\n\t\t$user_data[ 'cmb_provincia_'.$repr.'_lugar_nac' ],\r\n\t\t$user_data[ 'cmb_ciudad_'.$repr.'_lugar_nac' ],\r\n\t\t$user_data[ 'cmb_estado_civil_'.$repr ],\r\n\t\t$user_data[ 'cmb_profesion_'.$repr ],\r\n\t\t$user_data[ $repr.'_empr_codi' ],\r\n\t\t$user_data[ $repr.'_per_empr_codi' ],\r\n\t\t$user_data[ $repr.'_empr_nomb' ],\r\n\t\t$user_data[ $repr.'_empr_ruc' ],\r\n\t\t$user_data[ $repr.'_empr_dir' ],\r\n\t\t$user_data[ $repr.'_empr_cargo' ],\r\n\t\t$user_data[ $repr.'_empr_ingreso_mensual' ],\r\n\t\t$user_data[ $repr.'_empr_telf' ],\r\n\t\t$user_data[ $repr.'_empr_mail' ],\r\n\t\t$user_data[ 'ckb_'. $repr.'_es_exalumno' ],\r\n\t\t$user_data[ $repr.'_cmb_es_exalumno' ],\r\n\t\t$user_data[ 'ckb_'.$repr.'_es_extrabajador' ],\r\n\t\t$user_data[ $repr.'_es_extrabajador_fecha_ini' ],\r\n\t\t$user_data[ $repr.'_es_extrabajador_fecha_fin' ],\r\n\t\t$relacion,\r\n\t\t$_SESSION['peri_codi'],\r\n\t\t$_SERVER['HTTP_X_FORWARDED_FOR'], //éste último es IP.\r\n\t\t$_SERVER['REMOTE_ADDR']);\r\n\treturn $solicitud;\r\n}",
"function modificarDosificacion(){\n\t\t$this->procedimiento='vef.ft_dosificacion_ime';\n\t\t$this->transaccion='VF_DOS_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\n\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_dosificacion','id_dosificacion','int4');\n\t\t$this->setParametro('id_sucursal','id_sucursal','int4');\n\t\t$this->setParametro('final','final','integer');\n\t\t$this->setParametro('tipo','tipo','varchar');\n\t\t$this->setParametro('fecha_dosificacion','fecha_dosificacion','date');\n\t\t$this->setParametro('nro_siguiente','nro_siguiente','int4');\n\t\t$this->setParametro('nroaut','nroaut','varchar');\n\t\t$this->setParametro('fecha_inicio_emi','fecha_inicio_emi','date');\n\t\t$this->setParametro('fecha_limite','fecha_limite','date');\n\t\t$this->setParametro('tipo_generacion','tipo_generacion','varchar');\n\t\t$this->setParametro('glosa_impuestos','glosa_impuestos','varchar');\n\t\t$this->setParametro('id_activida_economica','id_activida_economica','varchar');\n\t\t$this->setParametro('llave','llave','codigo_html');\n\t\t$this->setParametro('inicial','inicial','integer');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('glosa_empresa','glosa_empresa','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"function modificarContacto(){\n\t\t$this->procedimiento='prov.ft_contacto_ime';\n\t\t$this->transaccion='PROV_CONTAC_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('idContacto','idContacto','int4');\n\t\t$this->setParametro('id_proveedor','id_proveedor','int4');\n\t\t$this->setParametro('emailContacto','emailContacto','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('nombreContacto','nombreContacto','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function modificar()\n\t{\n\t\t$agenciaModelo = new AgenciaModelo();\n\t\t$agenciaModelo->ModificarAgencia($this->agenciaID, $this->nombre, $this->direccion, $this->direccionCoordenadas, $this->telefono, $this->email, $this->estado);\n\t\techo \" La agencia con ID: \", $this->agenciaID . \" ha sido actualizada. \";\n\t}",
"function modificarDocumentoAnexo(){\n\t\t$this->procedimiento='saj.ft_documento_anexo_ime';\n\t\t$this->transaccion='SA_DOCANEX_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_documento_anexo','id_documento_anexo','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('id_proceso_contrato','id_proceso_contrato','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function modificar(){\n\t\t\treturn $this->ejecutar(\"UPDATE tmecanico SET nombre1='$this->nombre1',nombre2='$this->nombre2',apellido1='$this->apellido1',apellido2='$this->apellido2',sexo='$this->sexo',fecha_naci='$this->fecha_naci',estado_civil=$this->estado_civil,direccion='$this->direccion',telefono='$this->telefono',correo='$this->correo' WHERE idmecanico='$this->idmecanico' \");\n\t\t}",
"public function modifyBruchidData()\n\t{\n\t\tif('A' != $this->Session->read('UserType'))\n\t\t{\n\t\t\t$this->Session->setFlash(__('You do not have permissions to access this page !'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->BruchidSample->recursive = 0;\n\t\t\t$startDate = $this->request->params['pass']['0'];\n\t\t\t$endDate = $this->request->params['pass']['1'];\n\t\t\t$this->set('BruchidSample', $this->BruchidSample->getBruchidData($startDate,$endDate));\n\t\t\t$this->set('startDate', $startDate);\n\t\t\t$this->set('endDate',$endDate);\n\t\t}\n\t}",
"function modificarComisionistas(){\n\t\t$this->procedimiento='conta.ft_comisionistas_ime';\n\t\t$this->transaccion='CONTA_CMS_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_comisionista','id_comisionista','int4');\n $this->setParametro('nit_comisionista','nit_comisionista','varchar');\n $this->setParametro('nro_contrato','nro_contrato','varchar');\n $this->setParametro('codigo_producto','codigo_producto','varchar');\n $this->setParametro('descripcion_producto','descripcion_producto','varchar');\n $this->setParametro('cantidad_total_entregado','cantidad_total_entregado','numeric');\n $this->setParametro('cantidad_total_vendido','cantidad_total_vendido','numeric');\n $this->setParametro('precio_unitario','precio_unitario','numeric');\n $this->setParametro('monto_total','monto_total','numeric');\n $this->setParametro('monto_total_comision','monto_total_comision','numeric');\n $this->setParametro('id_periodo','id_periodo','int4');\n $this->setParametro('id_depto_conta','id_depto_conta','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"function modificarUnidadconstructivalt(){\n\t\t$this->procedimiento='snx.ft_unidadconstructivalt_ime';\n\t\t$this->transaccion='SNX_UCLT_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_unidadconstructivalt','id_unidadconstructivalt','int4');\n\t\t$this->setParametro('estructurapasocantidad','estructurapasocantidad','numeric');\n\t\t$this->setParametro('id_clasificacionaltura','id_clasificacionaltura','int4');\n\t\t$this->setParametro('porcmterrenosumer','porcmterrenosumer','numeric');\n\t\t$this->setParametro('id_tensionservicio','id_tensionservicio','int4');\n\t\t$this->setParametro('descripcion','descripcion','varchar');\n\t\t$this->setParametro('id_tipolinea','id_tipolinea','int4');\n\t\t$this->setParametro('porcterrenoplano','porcterrenoplano','numeric');\n\t\t$this->setParametro('porcmterrenofirme','porcmterrenofirme','numeric');\n\t\t$this->setParametro('id_hilosguarda','id_hilosguarda','int4');\t\t\n\t\t$this->setParametro('porcmterrenoterrenoblando','porcmterrenoterrenoblando','numeric');\n\t\t$this->setParametro('id_tipoestructura','id_tipoestructura','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('porcterrenoondulado','porcterrenoondulado','numeric');\n\t\t$this->setParametro('conductorfase','conductorfase','int4');\n\t\t$this->setParametro('distanciatransporte','distanciatransporte','numeric');\n\t\t$this->setParametro('distanciatransporteext','distanciatransporteext','numeric');\n\t\t$this->setParametro('porcmterrenointerme','porcmterrenointerme','numeric');\n\t\t$this->setParametro('porcvegetabosque','porcvegetabosque','numeric');\n\t\t$this->setParametro('porcvegetaforestacion','porcvegetaforestacion','numeric');\n\t\t$this->setParametro('estructurapasopeso','estructurapasopeso','numeric');\n\t\t$this->setParametro('estructuraamarrepeso','estructuraamarrepeso','numeric');\n\t\t$this->setParametro('estructuraamarrecantidad','estructuraamarrecantidad','numeric');\n\t\t$this->setParametro('porcterrenocerros','porcterrenocerros','numeric');\n\t\t$this->setParametro('id_pararrayolinea','id_pararrayolinea','int4');\n\t\t$this->setParametro('id_configuracionlt','id_configuracionlt','int4');\n\t\t$this->setParametro('porcvegetamatorral','porcvegetamatorral','numeric');\n\t\t$this->setParametro('codigo','codigo','varchar');\n\t\t$this->setParametro('porcvegetamaleza','porcvegetamaleza','numeric');\n\t\t$this->setParametro('id_tipoconductor','id_tipoconductor','int4');\n\t\t$this->setParametro('longitud','longitud','numeric');\n\t\t$this->setParametro('id_nivelcontaminacionlt','id_nivelcontaminacionlt','int4');\n\t\t$this->setParametro('id_areaprotegida','id_areaprotegida','int4');\n\t\t$this->setParametro('id_revista','id_revista','int4');\n\t\t$this->setParametro('id_bancoductos','id_bancoductos','int4');\n\t\t$this->setParametro('id_cajaempalme','id_cajaempalme','int4');\n\t\t$this->setParametro('numaccesos','numaccesos','numeric');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"function modificarAsegurado(){\r\n\t\t$this->procedimiento='res.ft_asegurado_ime';\r\n\t\t$this->transaccion='RES_ASE_MOD';\r\n\t\t$this->tipo_procedimiento='IME';\r\n\t\t\t\t\r\n\t\t//Define los parametros para la funcion\r\n\t\t$this->setParametro('id_asegurado','id_asegurado','int4');\r\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\r\n\t\t$this->setParametro('codigo_asegurado','codigo_asegurado','varchar');\r\n\t\t$this->setParametro('id_persona','id_persona','int4');\r\n\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}",
"public function modificar() {\n $objDatos = new clsDatos();\n $sql = \"UPDATE paciente\n\t\t\tSET id_geo = '$this->id_geo',\n\t\t\t id_per = '$this->id_per',\n\t\t\t oex_pac = '$this->oex_pac',\n\t\t\t fre_pac = '$this->fre_pac',\n\t\t\t cas_pac = '$this->cas_pac',\n\t\t\t dir_pac = '$this->dir_pac',\n\t\t\t ref_pac = '$this->ref_pac',\n\t\t\t ofi_pac = '$this->ofi_pac',\n\t\t\t dof_pac = '$this->dof_pac',\n\t\t\t emi_pac = '$this->emi_pac',\n\t\t\t fat_pac = '$this->fat_pac',\n\t\t\t fis_pac = '$this->fis_pac',\n\t\t\t est_pac = '$this->est_pac';\";\n $objDatos->ejecutar($sql);\n $objDatos->crerrarconexion();\n }",
"function modificar() {\n\t\tglobal $mdb2;\n\t\tglobal $log;\n\t\tglobal $current_usuario_id;\n\t\t\n\t\tif ($mdb2->only_read) {\n\t\t\tthrow new Exception('Por el momento esta trabajando solo en modo lectura.');\n\t\t}\n\n\t\tValidador::campoNumerico($this->escalabilidad_desde, \"Escalabilidad Desde\", 1, 20000);\n\t\tif ($this->escalabilidad_hasta != \"\") {\n\t\t\tValidador::campoNumerico($this->escalabilidad_hasta, \"Escalabilidad Hasta\", $this->escalabilidad_desde, 20000);\n\t\t}\n\n\t\tif (!$this->downtime_parcial and !$this->downtime_grupal and !$this->downtime_global) {\n\t\t\t$this->uptime_parcial = false;\n\t\t}\n\t\t\n\t\t$sql = \"SELECT * FROM public.notificacion_modifica(\".\n\t\t\t\tpg_escape_string($current_usuario_id).\",\".\n\t\t\t\tpg_escape_string($this->notificacion_id).\",\".\n\t\t\t\tpg_escape_string($this->__destinatario->destinatario_id).\",\".\n//\t\t\t\tpg_escape_string($this->intervalo_id).\",\".\n\t\t\t\t\"NULL, \".\n\t\t\t\tpg_escape_string($this->__horario->horario_id).\",\".\n\t\t\t\t(($this->uptime_parcial)?\"'t'\":\"'f'\").\",\".\n\t\t\t\t(($this->downtime_parcial)?\"'t'\":\"'f'\").\",\".\n\t\t\t\t(($this->downtime_grupal)?\"'t'\":\"'f'\").\",\".\n\t\t\t\t(($this->downtime_global)?\"'t'\":\"'f'\").\",\".\n\t\t\t\t(($this->sla)?\"'t'\":\"'f'\").\",\".\n\t\t\t\t(($this->patron_inverso)?\"'t'\":\"'f'\").\",\".\n//\t\t\t\t((!$this->sensibilidad)?\"NULL\":\"'\".$this->sensibilidad.\"'\").\",\".\n\t\t\t\t\"NULL, '\".\n\t\t\t\tpg_escape_string($this->escalabilidad_desde).\"', \".\n\t\t\t\t(($this->escalabilidad_hasta==\"\")?\"NULL\":\"'\".pg_escape_string($this->escalabilidad_hasta).\"'\").\")\";\t\t\t\t\n\t\t//print($sql.\"<br>\");\n\t\t$res =& $mdb2->query($sql);\n\t\tif (MDB2::isError($res)) {\n\t\t\t$log->setError($sql,$res->userinfo);\n\t\t\t//SE ELIMINÓ EL EXIT() CAMBIANDOSE POR UN RETURN FALSE POE QUE SE NECESITA SABER SI SE PUDO O NO REALIZAR LA OPERACIÓN\n\t\t\treturn false;\t\t\t\n\n\t\t}\n\t\t$log->setChange(\"MODIFICO NOTIFICACION\", $this->toString());\n\t\treturn true;\n\t}",
"public function modificar()\n\t{\n\t}",
"function actualizar_cliente($datos){\n\t\tif(array_key_exists('password', $datos)){\n\t\t\t$datos['password'] = md5($datos['email'].\"|\".$datos['password']);\t\n\t\t}\n\t\t\t\t\n\t\t\n\t\t$this->query = \"UPDATE CMS_IntCliente SET salutation = '\".$datos['salutation'].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t fname = '\".$datos['fname'].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t lname = '\".$datos['lname'].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t email = '\".$datos['email'].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t password ='\".$datos['password'].\"'\t \n\t\t WHERE id_clienteIn = '\" . $datos['id_clienteIn'] . \"'\";\n\t\t$res = $this->execute_single_query();\n\t\treturn $res;\t\t\n\t}",
"function ModificarRevisarComisionistas(){\n $this->procedimiento='conta.ft_comisionistas_ime';\n $this->transaccion='CONTA_REM_IME';\n $this->tipo_procedimiento='IME';\n\n //Define los parametros para la funcion\n $this->setParametro('id_comisionista_rev','id_comisionista_rev','int4');\n $this->setParametro('nit_comisionista','nit_comisionista','varchar');\n $this->setParametro('nro_contrato','nro_contrato','varchar');\n $this->setParametro('id_periodo','id_periodo','int4');\n $this->setParametro('id_depto_conta','id_depto_conta','int4');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }",
"public function AlterarDados(){\n \n $id = $_SESSION['id_filiado'];\n \n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n $data_hoje = date('d/m/Y');\n $dt_hoje = explode('/', $data_hoje);\n\n $dia_hoje = $dt_hoje[0];\n $mes_hoje = $dt_hoje[1];\n $ano_hoje = $dt_hoje[2];\n\n $dia = $_POST['slc_dia'];\n $mes = $_POST['slc_mes'];\n $ano = $_POST['slc_ano'];\n\n $filiado = new Acompanhante();\n\n $ddd1 = $_POST['txtDDD1'];\n $numero1 = $_POST['txtCel1'];\n $ddd2 = $_POST['txtDDD2'];\n $numero2 = $_POST['txtCel2'];\n\n $filiado->id = $id;\n $filiado->celular1 = '('.$ddd1.')'.$numero1;\n $filiado->celular2 = '('.$ddd2.')'.$numero2;\n $filiado->nome = $_POST['txtNome'];\n $filiado->apelido = $_POST['txtApelido'];\n $filiado->email = $_POST['txtEmail'];\n $filiado->sexo = $_POST['slc_sexo'];\n \n $alt = explode(',', $_POST['txtAltura']);\n $filiado->altura = $alt[0].'.'.$alt[1];\n \n if(!empty($_POST['txtConfirm'])){\n $senhaDigit = $_POST['txtSenha'];\n $senhaReal = $_POST['txtSenhaReal'];\n $novaSenha = $_POST['txtNovaSenha'];\n $ConfirmSenha = $_POST['txtConfirm'];\n\n if($senhaDigit == $senhaReal){\n if($novaSenha == $ConfirmSenha){\n $filiado->senha = $_POST['txtNovaSenha'];\n }else{\n $filiado->senha = 1;\n }\n \n }else{\n $filiado->senha = 1;\n }\n }else{\n $filiado->senha = 1;\n }\n \n //echo $senhaDigit.' '.$senhaReal.' '.$novaSenha.' '.$ConfirmSenha;\n \n $filiado->peso = $_POST['txtPeso'];\n $filiado->estado = $_POST['txtUf'];\n $filiado->cidade = $_POST['txtCidade'];\n $filiado->acompanha = $_POST['slc_acompanha'];\n $filiado->cobrar = $_POST['txtCobrar'];\n $filiado->apresentacao = $_POST['txtApresentacao'];\n $filiado->cor_cabelo = $_POST['slc_cor_cabelo'];\n $filiado->nasc = $ano.\"-\".$mes.\"-\".$dia;\n \n $anos = $ano_hoje - $ano;\n \n \n if($anos > 18){\n $filiado->UpdateDados($filiado);\n\n }elseif($anos == 18){\n\n if ($mes < $mes_hoje) {\n \n $filiado->UpdateDados($filiado);\n\n } elseif ($mes == $mes_hoje) {\n\n if ($dia <= $dia_hoje) {\n \n $cliente->UpdateDados($filiado);\n\n } else {\n header('location:filiado-dados.php?erro=idade');\n }\n\n }else{\n header('location:filiado-dados.php?erro=idade');\n }\n\n }else{\n header('location:filiado-dados.php?erro=idade');\n\n }\n \n }\n \n \n }",
"function editar_presentacion($datos_presentacion){\n\t\t$conexión = new Conexion();\n\n\t\t//Se usa el metodo conectar de la clase conexion\n\t\t$cadena_conexion = $conexión->Conectar();\n\n\t\t//Realizamos ek script para insertar un usuario\n\t\t$stmt = $cadena_conexion->prepare(\"UPDATE presentacion_producto SET nombre=:nombre,descripcion=:descripcion WHERE idpresentacion_producto=:idpresentacion_producto\");\n\n\t\t$stmt->bindParam(':idpresentacion_producto',$datos_presentacion[0]);\n\t\t$stmt->bindParam(':nombre',$datos_presentacion[1]);\n\t\t$stmt->bindParam(':descripcion',$datos_presentacion[2]);\n\n\t\t//si la insercion del usuario se ejecuto entonces...\n\t\tif($stmt->execute()){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\n\t}",
"function modificarSucursalUsuario(){\n\t\t$this->procedimiento='vef.ft_sucursal_usuario_ime';\n\t\t$this->transaccion='VF_SUCUSU_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_sucursal_usuario','id_sucursal_usuario','int4');\n\t\t$this->setParametro('id_sucursal','id_sucursal','int4');\n\t\t$this->setParametro('id_punto_venta','id_punto_venta','int4');\n\t\t$this->setParametro('id_usuario','id_usuario','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('tipo_usuario','tipo_usuario','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function atualizar(){\n $dal = new \\App\\Models\\DAL\\Cadastropermissoes; \n $dal->atualizar($this->getCod_permissao(), $this->getCod_perfil(), $this->getAdcionar_projeto(), \n $this->getEditar_projeto(), $this->getExcluir_projeto(), $this->getGerenciar_usuario(), \n $this->getAprovar_trabalho()); \n }",
"function modificarPcu335313335313(){\n\t\t$this->procedimiento='snx.ft_pcu335313335313_ime';\n\t\t$this->transaccion='SNX_PCU5313_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_pcu335313335313','id_pcu335313335313','int4');\n\t\t$this->setParametro('ano','ano','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('valor','valor','numeric');\n\t\t$this->setParametro('id_mes','id_mes','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}"
] | [
"0.62247586",
"0.5999004",
"0.5990914",
"0.5973774",
"0.5922753",
"0.5904988",
"0.590277",
"0.59017694",
"0.5860159",
"0.58496547",
"0.58387345",
"0.5790837",
"0.5776343",
"0.5755738",
"0.5737685",
"0.57300633",
"0.57160217",
"0.5706988",
"0.5690701",
"0.5686426",
"0.5668637",
"0.5656306",
"0.56494045",
"0.5614367",
"0.5580076",
"0.5578358",
"0.55758435",
"0.5574676",
"0.5572022",
"0.5571584"
] | 0.62391603 | 0 |
end function recursivePrintCashFlow() / | function printCashFlow($reportType, $reportMonth, $reportYear){
$inflows = new CashFlowCategory("1", $reportType, $reportMonth, $reportYear);
$outflows = new CashFlowCategory("2", $reportType, $reportMonth, $reportYear);
$strToReturn = "<DIV id=\"cash-flow-report\">";
$strToReturn = $strToReturn . "CASH FLOW:<BR>";
$strToReturn = $strToReturn . recursivePrintCashFlow($inflows);
$strToReturn = $strToReturn . recursivePrintCashFlow($outflows);
//NET CASH FLOW
$netCashFlow = $inflows->getTotal() - $outflows->getTotal();
$strToReturn = $strToReturn . "<DIV class=\"cf-super-node\">";
$strToReturn = $strToReturn . "<DIV class=\"category-name\"> NET CASH FLOW: </DIV>";
$strToReturn = $strToReturn . "<DIV class=\"category-total\">";
$strToReturn = $strToReturn . "<LABEL class=\"currency-symbol\">" . $_SESSION['currencySymbol'] . " </LABEL>";
$strToReturn = $strToReturn . "<LABEL class=\"report-amount\">" . $netCashFlow . "</LABEL>";
$strToReturn = $strToReturn . "</DIV></DIV>";
$strToReturn = $strToReturn . "</DIV>";
return $strToReturn;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function printAccountBalances($reportType, $reportMonth, $reportYear){\n\n $balances = new AccountBalanceReport($reportType, $reportMonth, $reportYear);\n $cashOnHand = \"0\";\n $strTemp = \"\";\n\n $strToReturn = \"<DIV id=\\\"account-balances\\\">\";\n $strToReturn = $strToReturn . \"ACCOUNT BALANCES:\";\n\n //print cash accounts (if negative color red?)\n $strToReturn = $strToReturn . \"<DIV id=\\\"cash-accounts\\\"><label class=\\\"section-header\\\">Cash Accounts:</label>\";\n foreach($balances->cashAccounts as $a){\n $strTemp = format2dp($a->accountBalance);\n $strToReturn = $strToReturn . \"<DIV class=\\\"account-name\\\">\" . $a->accountName . \"</DIV>\";\n $strToReturn = $strToReturn . \"<DIV class=\\\"account-balance\\\">\";\n $strToReturn = $strToReturn . \"<LABEL class=\\\"currency-symbol\\\">\" . $_SESSION['currencySymbol'] . \" </LABEL>\";\n $strToReturn = $strToReturn . \"<LABEL class=\\\"report-amount\\\">\" . $strTemp . \"</LABEL></DIV>\";\n $cashOnHand += $a->accountBalance;\n }\n $strToReturn = $strToReturn . \"</DIV>\";\n\n //print bank accounts\n $strToReturn = $strToReturn . \"<DIV id=\\\"bank-accounts\\\"><label class=\\\"section-header\\\">Bank Accounts:</label>\";\n foreach($balances->bankAccounts as $a){\n $strTemp = format2dp($a->accountBalance);\n $strToReturn = $strToReturn . \"<DIV class=\\\"account-name\\\">\" . $a->accountName . \"</DIV>\";\n $strToReturn = $strToReturn . \"<DIV class=\\\"account-balance\\\">\";\n $strToReturn = $strToReturn . \"<LABEL class=\\\"currency-symbol\\\">\" . $_SESSION['currencySymbol'] . \" </LABEL>\";\n $strToReturn = $strToReturn . \"<LABEL class=\\\"report-amount\\\">\" . $strTemp . \"</LABEL></DIV>\";\n $cashOnHand += $a->accountBalance;\n }\n $strToReturn = $strToReturn . \"</DIV>\";\n\n $strTemp = format2dp($cashOnHand);\n $strToReturn = $strToReturn . \"<DIV id=\\\"total-cash\\\">\";\n $strToReturn = $strToReturn . \"<DIV class=\\\"account-name\\\">Total Cash On Hand: </DIV>\";\n $strToReturn = $strToReturn . \"<DIV class=\\\"account-balance\\\">\";\n $strToReturn = $strToReturn . \"<LABEL class=\\\"currency-symbol\\\">\" . $_SESSION['currencySymbol'] . \" </LABEL>\";\n $strToReturn = $strToReturn . \"<LABEL class=\\\"report-amount\\\">\" . $strTemp . \"</LABEL></DIV>\";\n $strToReturn = $strToReturn . \"</DIV>\"; //total-cash\n\n $strToReturn = $strToReturn . \"</DIV>\";\n return $strToReturn;\n}",
"public function self_print();",
"function xrfb_disp_cash($amt)\n{\n$cash = $amt / 100;\n$cash = sprintf(\"%.2f\", $cash);\n$cash = \"$\" . $cash;\nreturn ($cash);\n}",
"public function tprint_print();",
"abstract public function print();",
"public function cashbook() \n\t{\n\t\t\t$Model = new Model($this->config);\n\t\t\t$rows = $Model->getCashbook($days = 15);\n\t\t\t$output = '';\n\t\t\t$sum = 0;\n\t\t\t\n\t\t\tforeach ($rows as $data)\n\t\t\t{\n\t\t\t\t$sum = ($data->debit == 0 ) ? $sum - $data->amount : $sum + $data->amount ;\n\t\t\t\t$debit = ($data->debit == 0 ) ? 'Cr' : 'Dt';\n\t\t\t\t$output .= '<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td>' . $data->strokes . '</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>' . date(\"d-m-Y\", $data->date) . '</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>' . $data->description . '</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>' . $debit . '</td>\n\t\t\t\t\t\t\t\t\t\t\t<td align=\"right\">' . $data->amount . '</td>\n\t\t\t\t\t\t\t\t\t\t\t<td align=\"right\">' . $sum . '</td>';\n\t\t\t\t$output .= '</tr>';\n\t\t\t}\n\t\t\treturn $output;\n\t}",
"function Mark87($AccountNo) {\n $Tab1[0] = 0;\n $Tab1[1] = 4;\n $Tab1[2] = 3;\n $Tab1[3] = 2;\n $Tab1[4] = 6;\n\n $Tab2[0] = 7;\n $Tab2[1] = 1;\n $Tab2[2] = 5;\n $Tab2[3] = 9;\n $Tab2[4] = 8;\n\n $Result = 1;\n $AccountNo = $this->ExpandAccount($AccountNo);\n if (substr($AccountNo,2,1) == '9') {\n $Result = $this->Mark10($AccountNo);\n } else {\n for ($Run = 0; $Run < strlen($AccountNo); $Run++) {\n// $AccountNoTemp[$Run + 1] = (int) substr($AccountNo,$Run,1);\n $AccountNoTemp[$Run] = (int) substr($AccountNo,$Run,1);\n }\n// print_r($AccountNoTemp); echo \"<br>\";\n $i = 4;\n while ($AccountNoTemp[$i] == 0) {\n $i++;\n }\n// echo\"$i <br>\";\n $C2 = $i % 2;\n $D2 = 0;\n $A5 = 0;\n while ($i < 10) {\n switch ($AccountNoTemp[$i]) {\n case 0 :\n $AccountNoTemp[$i] = 5;\n break;\n case 1 :\n $AccountNoTemp[$i] = 6;\n break;\n case 5:\n $AccountNoTemp[$i] = 10;\n break;\n case 6:\n $AccountNoTemp[$i] = 1;\n break;\n }\n if ($C2 == $D2) {\n if ($AccountNoTemp[$i] > 5) {\n if(($C2 == 0) AND ($D2 == 0)) {\n $C2 = 1;\n $D2 = 1;\n $A5 = $A5 + 6 - ($AccountNoTemp[$i] - 6);\n } else {\n $C2 = 0;\n $D2 = 0;\n $A5 = $A5 + $AccountNoTemp[$i];\n } //end if(($C2 == 0) AND ($D2 == 0))\n } else {\n if (($C2 == 0) AND ($D2 == 0)) {\n $C2 = 1;\n $A5 = $A5 + $AccountNoTemp[$i];\n } else {\n $C2 = 0;\n $A5 = $A5 + $AccountNoTemp[$i];\n }\n }\n } else {\n if ($AccountNoTemp[$i] > 5) {\n if ($C2 == 0) {\n $C2 = 1;\n $D2 = 0;\n $A5 = $A5 - 6 + ($AccountNoTemp[$i] - 6);\n } else {\n $C2 = 0;\n $D2 = 1;\n $A5 = $A5 - $AccountNoTemp[$i];\n }\n } else {\n if ($C2 == 0) {\n $C2 = 1;\n $A5 = $A5 - $AccountNoTemp[$i];\n } else {\n $C2 = 0;\n $A5 = $A5 - $AccountNoTemp[$i];\n }\n }\n }\n $i++;\n }\n while (($A5 < 0) OR ($A5 > 4)) {\n if ($A5 > 4) {\n $A5 = $A5 - 5;\n } else {\n $A5 = $A5 + 5;\n }\n }\n if ($D2 == 0) {\n $P = $TAB1[$A5];\n } else {\n $P = $TAB2[$A5];\n }\n if ($P == $AccountNoTemp[10]) {\n $Result = 0;\n } else {\n if ($AccountNoTemp[4] == 0) {\n if ($P > 4) {\n $P = $P - 5;\n } else {\n $P = $P + 5;\n }\n if ($P == $AccountNoTemp[10] ) {\n $Result = 0;\n }\n }\n }\n if ($Result <> 0 ) {\n// echo \"Fehler in Berechnung A <br>\";\n $Result = $this->Mark33($AccountNo);\n if ($Result <> 0 ) {\n// echo \"Fehler in Berechnung B <br>\";\n $Result = $this->Method06($AccountNo,'000065432',FALSE,10,7);\n }\n }\n }\n return $Result;\n }",
"function factorial($number, $print=false) {\t\n\t$factor = $number;\n\t$ret = 0;\n\t\n\twhile($factor != 1) {\n\t\tif($ret == 0)\n\t\t\t$ret = $factor;\n\t\t\t\n\t\t$ret *= ($factor - 1);\n\t\t--$factor;\n\t}\n\t\n\tif($print)\n\t\techo \"{$number}! is {$ret}\\n\\n\";\n\t\t\n\treturn $ret;\n}",
"function print_casc($cascade){\n\t\tif(!empty($cascade)){\nprint(\"<ul>\\n\");\n foreach($cascade as $cat_id => $nb){ //print(\" The Category IS \".$nb[0].\"\\n\");\n\t\t\n\t\t\tprint(\"<li>\");\n\t\t\tprint(\"<div>\");\n\t\t\tprint(\"<a href='index.php?cid=\".$cat_id.\"'\\\">\".$nb[0].\"</a>\");\n\t\t\tprint(\"</div>\\n\");\n\t\t\t\t\tif(!empty($nb[2])){ //loop through\n\t\t\tprint_casc($nb[2]);\n\t\t}\n\t\t\tprint(\"</li>\\n\");\n\t\t\n\n\t\t\n\t} //end of foreach cascade\n\t\nprint(\"</ul>\\n\");\n\t\t}\n\t\t\t\t}",
"function show_principal($balance, $payment, $interest_rate) {\n $interest = $interest_rate * $balance;\n $principal = $payment - $interest;\n $principal = number_format($principal, 2);\n echo $principal;\n $balance = $balance - $principal; \n return $balance; \n }",
"function pr() {\n $this->pr_aux(0);\n }",
"function amount_to_print($amount)\n{\n\n if(strval($amount)==='')\n {\n $amount='00.00';\n }\n else\n {\n $amount = round(floatval($amount),2);\n $amount_part=explode('.',strval($amount));\n\n if( isset($amount_part[0]) )\n {\n $amount_f=strval($amount_part[0]);\n }\n else\n {\n $amount_f = '0';\n }\n\n if( isset($amount_part[1]) )\n {\n $amount_s=strval($amount_part[1]);\n }\n else\n {\n $amount_s = '0';\n }\n\n\n if(strlen($amount_s)==1 and intval($amount_s)>0 and intval($amount_s)<10)\n {\n $amount_s=intval($amount_s).'0';\n }\n elseif(strlen($amount_s)==2 and intval($amount_s)>0 and intval($amount_s)<10)\n {\n $amount_s='0'.intval($amount_s);\n }\n\n\n if(intval($amount_s)==0)\n {\n $amount_s='00';\n }\n\n $amount=intval($amount_f).\".\".$amount_s;\n }\n\n return strval($amount);\n}",
"public function printChange(): void\n {\n if ($this->change < 0) {\n $this->output->print('Not enough money.');\n } else {\n $this->output->print($this->getFormattedPrice($this->change));\n }\n }",
"public function printFee()\n {\n $decimals = log10(1 / Converter::getDenomination($this->currency));\n echo number_format($this->getFee(), $decimals, '.', '') . \"\\n\";\n }",
"function fprint($param = NULL) {\n static $count;\n if(!isset($count))\n $count = 1;\n else\n $count++;\n echo '<br />';\n echo '<div style=\"background-color:#fff;\"><b><i><u>********* formated output '.$count.' *********</u></i></b>';\n echo '<pre>';\n var_dump($param);\n echo '</pre>';\n echo '<b><i>********* formated output *********</i></b></div>';\n echo '<br />';\n}",
"public function _print(){\n }",
"function ordr_pz($pizzatype, $fw) {\n\n$type = $pizzatype;\necho 'Creating new order... <br>';\n$toPrint = 'A ';\n $toPrint .= $pizzatype;\n$p = calc_cts($type);\n\n $address = 'unknown';\n if($fw == 'koen')\n {\n $address = 'a yacht in Antwerp';\n } elseif ($fw == 'manuele')\n {\n $address = 'somewhere in Belgium';\n } elseif ($fw == 'students') {\n $address = 'BeCode office';\n }\n\n $toPrint .= ' pizza should be sent to ' . $fw . \". <br>The address: {$address}.\";\n echo $toPrint; echo '<br>';\n echo'The bill is €'.$p.'.<br>';\n\n\n\n\n echo \"Order finished.<br><br>\";\n}",
"function print_graph($tree,$node)\n{\n $children=array();\n $children=@$tree[$node]['children'];\n echo $node;\n if(!$children) return;\n echo \"(\";\n $len=count($children);\n $i=0;\n foreach($children as $child)\n {\n\n print_graph($tree,$child);\n if($i!=$len-1) echo \",\";\n $i++;\n }\n echo \")\";\n}",
"function outputSchedules($debitSchedules, $delimiter, $mongoDB) {\n for ($i = 0; $i < count($debitSchedules); $i++) {\n $debitSchedule = $debitSchedules[$i];\n //echo(\"Processing Schedule \" . json_encode($debitSchedule, JSON_PRETTY_PRINT));\n $child = $mongoDB->Person->findOne(array(\"_id\" => new MongoId($debitSchedule[\"ChildId\"])));\n\n $ownerId = $debitSchedule[\"OwnerId\"];\n if($ownerId && strpos($ownerId, \"David\") === false) {\n echo($i . $delimiter);\n //echo(\"<br/>Owner ID: $ownerId\");\n $parent = $mongoDB->Person->findOne(array(\"_id\" => new MongoId($ownerId)));\n echo($child[\"Person\"][\"FirstName\"] . $delimiter);\n echo($child[\"Person\"][\"LastName\"] . $delimiter);\n echo($parent[\"Person\"][\"FirstName\"] . $delimiter);\n echo($parent[\"Person\"][\"LastName\"] . $delimiter);\n echo($parent[\"Person\"][\"Email\"] . $delimiter);\n echo(\"\\\"\" . $debitSchedule[\"description\"] . \"\\\"\" . $delimiter);\n $debitScheduleEntries = $debitSchedule['debitScheduleEntries'];\n\n $today = time();\n $totalCalculated = array_key_exists(\"downPaymentAmount\", $debitSchedule) ? $debitSchedule[\"downPaymentAmount\"] : 0;\n $totalPaid = 0;\n $fees = $debitSchedule['fees'];\n for ($j = 0; $j < count($fees); $j++) {\n $feeModel = $fees[$j];\n if (array_key_exists(\"amount\", $feeModel) && $feeModel['amount'] > 0) {\n $amount = $feeModel['amount'];\n $totalCalculated += $amount;\n }\n }\n\n $totalToBeCurrent = $totalCalculated;\n for ($k = 0; $k < count($debitScheduleEntries); $k++) {\n $entryModel = $debitScheduleEntries[$k];\n $debitAmount = array_key_exists(\"debitAmount\", $entryModel) ? $entryModel[\"debitAmount\"] : 0;\n //echo(\"\\nProcessing entry amount $debitAmount\\n\");\n $executedDate = array_key_exists(\"executedDate\", $entryModel) ? $entryModel[\"executedDate\"] : null;\n $dateToExecute = array_key_exists(\"dateToExecute\", $entryModel) ? $entryModel[\"dateToExecute\"] : null;\n\n if ($dateToExecute) {\n $totalCalculated += $debitAmount;\n }\n\n if ($executedDate) {\n $totalPaid += $debitAmount;\n $totalToBeCurrent = $totalToBeCurrent - $debitAmount;\n }\n\n if ($dateToExecute && $dateToExecute < $today) {\n $totalToBeCurrent += $debitAmount;\n }\n }\n ;\n $balanceDue = $totalCalculated - $totalPaid;\n $quickmitFee = $totalPaid * .03;\n\n echo($totalCalculated . $delimiter);\n echo(\",\");\n echo($totalPaid . $delimiter);\n echo($quickmitFee . $delimiter);\n echo($totalPaid - $quickmitFee . $delimiter);\n echo($delimiter);\n echo($balanceDue . $delimiter);\n //if($totalToBeCurrent > 0) {\n // echo($totalToBeCurrent . $delimiter);\n //}\n\n echo(\"\\n\");\n }\n }\n}",
"public function cash_breakdown()\n\t{\n\t\t$ci =& get_instance();\n\t\t$ci->load->helper( 'inflector' );\n\t\t$ci->load->library( 'shift_turnover' );\n\t\t$Shift_Turnover = new Shift_turnover();\n\n\t\t$shift = $this->get_shift();\n\n\t\t// Change Fund\n\t\t$items = $this->get_items();\n\t\t$change_fund = array();\n\t\t$sales_fund = 0.00;\n\t\t$cash_on_hand = 0.00;\n\t\tforeach( $items as $item )\n\t\t{\n\t\t\tif( ( $item->get( 'item_class' ) == 'cash' ) && ( $item->get( 'parent_item_name' ) == 'Change Fund' ) )\n\t\t\t{\n\t\t\t\t$change_fund[$item->get( 'item_name' )] = array(\n\t\t\t\t\t'group' => $item->get( 'item_group' ),\n\t\t\t\t\t'unit' => abs( $item->get( 'sti_beginning_balance' ) + $item->get( 'movement' ) ) == 1 ? $item->get( 'item_unit' ) : plural( $item->get( 'item_unit' ) ),\n\t\t\t\t\t'quantity' => $item->get( 'sti_beginning_balance' ) + $item->get( 'movement' ),\n\t\t\t\t\t'amount' => ( $item->get( 'sti_beginning_balance' ) + $item->get( 'movement' ) ) * $item->get( 'iprice_unit_price' )\n\t\t\t\t);\n\t\t\t\t$cash_on_hand += ( $item->get( 'sti_ending_balance' ) ) * $item->get( 'iprice_unit_price' );\n\t\t\t}\n\n\t\t\tif( ( $item->get( 'item_class' ) == 'cash' ) && ( $item->get( 'parent_item_name' ) == 'Sales' ) )\n\t\t\t{\n\t\t\t\t$sales_fund += ( $item->get( 'sti_beginning_balance' ) + $item->get( 'movement' ) ) * $item->get( 'iprice_unit_price' );\n\t\t\t\t$cash_on_hand += ( $item->get( 'sti_ending_balance' ) ) * $item->get( 'iprice_unit_price' );\n\t\t\t}\n\t\t}\n\n\t\t// Undeposited Sales Collection\n\t\t/*\n\t\t$remaining_sales_fund = $sales_fund;\n\n\t\t// Get previous shifts of the day\n\t\t$shift_counter = $shift->get( 'shift_order' );\n\t\t$c_shift = $shift;\n\t\t$c_turnover = $this;\n\t\t$for_deposit = array();\n\t\tfor( $i = 0; $i < $shift_counter; $i++ )\n\t\t{\n\t\t\t$data = $c_turnover->for_deposit_to_bank();\n\t\t\t$c_shift = $c_turnover->get_shift();\n\t\t\tif( $c_turnover->get( 'st_from_date' ) == $this->get( 'st_from_date' ) )\n\t\t\t{\n\t\t\t\t$for_deposit[$c_shift->get( 'shift_num' )] = $data[$c_shift->get( 'shift_num' )]['for_deposit'];\n\t\t\t}\n\t\t\tif( $c_turnover == $this )\n\t\t\t{\n\t\t\t\t$remaining_sales_fund -= $data[$c_shift->get( 'shift_num' )]['sales_collection'];\n\t\t\t}\n\t\t\t$c_turnover = $c_turnover->get_previous_turnover();\n\t\t}\n\n\t\t$for_deposit = array_reverse( $for_deposit );\n\n\t\tif( $remaining_sales_fund <> 0 )\n\t\t{\n\t\t\t$for_deposit['Others'] = $remaining_sales_fund;\n\t\t}\n\t\t*/\n\t\t$for_deposit['Sales Collection'] = $sales_fund;\n\n\t\treturn array(\n\t\t\t\t'change_fund' => $change_fund,\n\t\t\t\t'for_deposit' => $for_deposit,\n\t\t\t\t'cash_on_hand' => $cash_on_hand\n\t\t\t);\n\t}",
"public function pr($val='',$return=0){\r\n //recursive array display buffered and returned\r\n $retstr='';\r\n if(is_array($val)){\r\n ob_start();\r\n $this->prep_display_array($val,1);\r\n $retstr= ob_get_clean();\r\n\r\n }else{\r\n if(!empty($val))$retstr= '<div style=\"margin:5px 0;\">'.$val.' </div>';\r\n }\r\n\r\n if(empty($return)){\r\n echo $retstr;\r\n }else{\r\n return $retstr; \r\n }\r\n }",
"function tier($tier,$balance='',$check){\n\techo $check.'<br />';\n\techo $balance.'<br />';\n\tforeach($tier as $n=>$v){\n\t\t$i++;\n\t\tif(!is_array($amounts)) $amounts=array();\n\t\t/*skips the first because it assigns it in a more meaningful manner*/\n\t\tif($i==1){\n\t\t\t$previousN=$n;\n\t\t\t$previousV=$v;\n\t\t\t$checkSubtotal=$check;\n\t\t\tcontinue;\n\t\t}\n\t\t/*all the balance stuff*/\n\t\tif($balance){\n\t\t\tif($balance>$n){\n\t\t\t\t$amountApplicable[$previousV]='0';\n\t\t\t\t$previousN=$n;\n\t\t\t\t$previousV=$v;\n\t\t\t\tif($i==count($tier)){\n\t\t\t\t\t$amountApplicable[$v]=$check-array_sum($amountApplicable);\n\t\t\t\t}\n\t\t\t\t$balance=$balance-$n;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$previousN=$previousN+$balance;\n\t\t\t$balance=0;\n\t\t}\n\t\t/*gets the amount of money applicable to that bracket*/\n\t\t$amountApplicable[$previousV]=$n-$previousN;\n\t\t/*checks if the check is less than the amount applicable, if it is it applies the check amount to the final amount*/\n\t\tif($check<$amountApplicable[$previousV] && $check!=0){\n\t\t\t$amount[$previousV]=$check;\n\t\t\t$check=$check-$amount[$preciousV];\n\t\t}\n\t\t/*checks if the amount applicable is less than the check amount, if it is, it caps the amount applicable*/\n\t\tif((($amount[$previousV]=($check-array_sum($amountApplicable)))==0) || ($checkSubtotal>$n)){\n\t\t\t$amount[$previousV]=$amountApplicable[$previousV];\n\t\t\t$checkSubtotal=$check-$amountApplicable[$previousV];\n\t\t} else {\n\t\t\t$amount[$previousV]=$checkSubtotal;\n\t\t\t$checkSubtotal=0;\n\t\t}\n\t\tif($amount[$previousV]<0)$amount[$previousV]=0;\n\t\t$previousN=$n;\n\t\t$previousV=$v;\n\t\tif($i==count($tier)){\n\t\t\tif(($check-array_sum($amountApplicable))<0){ \n\t\t\t\t\t$amount[$v]=0;\n\t\t\t\t}else{\n\t\t\t\t\t$amount[$v]=$check-array_sum($amountApplicable);\n\t\t\t\t}\n\t\t}\n\t\t/*\n\t\t$check=$check-$previousN;\n\t\tif($check<0){\n\t\t\treturn($amounts);\n\t\t\texit;\n\t\t}\n\t\t$amounts[$v]=$check;\n\t\tif($amounts[$previousV]>$n && $i!=count($tier)) $amounts[$previousV]=$n;\n\t\techo $check.'<br />';\n\t\techo $n.'=>'.$v.'<br />';\n\t\t$previousN=$n;\n\t\t$previousV=$v;\n\t\techo $previousN.'=>'.$previousV.'<br>';*/\n\t}\n\treturn($amount);\n}",
"function to_console($data, $crypto_currency) {\n\tfor ($i = 0, $m = sizeof($data['transactions']); $i < $m; $i++) {\n\t\t$row = $data['transactions'][$i];\n\t\t$warn = $row['is_mining'] ? '' : '\tNO MINING';\n\t\t\n\t\tprint $row['day'] .\"\tAVG: \" . $row['avg'] . \"\tValue (\" . $crypto_currency . \"): \" . $row['value_crypto'] . \"\t\" . FIAT . \": \" . $row['win_loss'] . \"\" . $row['value_fiat'] . $warn . \"\\n\";\n\t}\n\t\n\tprint \"TOTAL MINING: \t\" . FIAT . \" \" . $data['balance_mining_fiat'] . \"\t$crypto_currency \" . $data['balance_mining_crypto'] . \"\\n\";\n\tprint \"TOTAL TRANSACTIONS:\t\" . FIAT . \" \" . $data['balance_fiat'] . \"\t$crypto_currency \" . $data['balance_mining_fiat'] . \"\\n\\n\";\n}",
"private function payWithCash(): void\n {\n $receipt = Route::goTo('pay');\n if ($receipt) {\n echo $receipt->toString();\n }\n }",
"public function display(){\n\t\t\t\n\t\t\t//$show = $this->load_stripe();\n\t\t\t\n\t\t\t//$show = print_r( $_POST, true );\n\t\t\t$show = '';\n\t\t\t//if no errors, display output. \n\t\t\tif( !empty( $this->errors ) ){\n\t\t\t\t\n\t\t\t\tforeach( $this->errors as $err_msg )\n\t\t\t\t\t$show .= \"<p class='error'>$err_msg</p>\";\t\t\t\t\n\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t//if no errors, let's show the cashier page. \n\t\t\t\n\t\t\t\t$show .= $this->prepare();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $show;\n\t\t}",
"function recur($a){\n if($a <= 10){\n echo \"$a <br>\";\n recur($a+ 1); // function calling it self\n }\n }",
"public function print():string{\n try{\n $result = \"\";\n if(iterator_count($this->getData())){\n $iteration = 0;\n foreach ($this->getData() as $key => $boarding) {\n $result .= ++$key . ' - ' . $boarding->__toString() . \"\\n\";\n ++$iteration ;\n }\n $result .= ++$iteration . \" - You have arrived at your final destination\\n\";\n }\n return $result;\n }catch(\\Exeption $e){\n return $e->getMessage();\n }\n }",
"public function processQuickCredit();",
"function ts_print($str = '', $balanceTags = false)\n{\n\treturn ($balanceTags) ? balanceTags($str) : $str;\n}",
"public function cashflowTerminal()\n {\n $this->builder->textFont('C');\n $this->builder->textAlign('RIGHT');\n $this->builder->textDouble();\n $this->builder->textStyle();\n $this->builder->text($this->labels->terminal . ': ' . $this->terminal['name']);\n $this->linebreak();\n $this->builder->text($this->labels->operator . ': ' . $this->cashflow['lastmodifiedby']);\n $this->linebreak();\n }"
] | [
"0.6454793",
"0.6016307",
"0.589306",
"0.5682933",
"0.5669143",
"0.5573386",
"0.55045277",
"0.5467303",
"0.54663694",
"0.54520696",
"0.5434554",
"0.5418756",
"0.53509545",
"0.5342171",
"0.5329055",
"0.53023076",
"0.52664834",
"0.5258793",
"0.52527046",
"0.52382094",
"0.52357006",
"0.52095383",
"0.5196397",
"0.5170901",
"0.5152255",
"0.51502126",
"0.5143066",
"0.51378286",
"0.51239157",
"0.5117989"
] | 0.76505923 | 0 |
Add a new work experience to the database. | public static function addWorkExp($workExp)
{
global $db;
$eCompany = $db->real_escape_string($workExp->getCompany());
$eLocation = $db->real_escape_string($workExp->getLocation());
$eJobTitle = $db->real_escape_string($workExp->getJobTitle());
$eStartDate = $db->real_escape_string($workExp->getStartDate());
$eEndDate = $db->real_escape_string($workExp->getEndDate());
$eUserId = $db->real_escape_string($workExp->getUserId());
$sql = "INSERT INTO work_experience ";
$sql .= "(company, location, job_title, start_date, end_date, user_id) ";
$sql .= "VALUES (?, ?, ?, ?, ?, ?)";
$stmt = $db->stmt_init();
if(!$stmt->prepare($sql))
{
echo "Failed to prepare statement";
return;
}
else
{
$stmt->bind_param("ssssss", $eCompany, $eLocation, $eJobTitle, $eStartDate, $eEndDate, $eUserId);
if($stmt->execute())
return true;
else
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function AddExperience($data)\n\t\t{\n\t\t\t$this->db->insert('pl.pl_experience', $data);\n\t\t}",
"public function run()\n {\n \tDB::table('work_experiences')->insert([\n \t\t'company' => 'Gauss d.o.o.',\n \t\t'sector' => 'IT',\n \t\t'address' => 'Svetog L.B.Mandića 111o',\n \t\t'position' => 'PHP Backend Developer',\n \t\t'work_from' => '23.7.2017.',\n \t\t'work_to' => '31.1.2018.',\n \t\t'desc' => 'PHP5/7 with Laravel/Symfony Frameworks. Experience with MySQL, MAMP/LAMP stack, API, JSON, AJAX, MCV, OOP and also UI - HTML5/CSS3, jQuery, Bootstrap, Responsive design.',\n \t\t'currently_employed' => true\n \t]);\n }",
"public function workadd(Request $request)\n {\n $request->validate([\n 'job_title' => 'required',\n 'company' => 'required',\n 'industri_id' => 'required',\n 'position' => 'required',\n 'jenis_gaji' => 'required',\n 'salary' => 'required',\n 'des_pos' => 'required',\n 'work_from' => 'required',\n 'work_till' => 'required',\n 'user_id' => 'required',\n\n ]);\n\n Experience::create([\n 'job_title' => $request->job_title,\n 'company' => $request->company,\n 'industri_id' => $request->industri_id,\n 'position' => $request->position,\n 'salary' => $request->salary,\n 'jenis_gaji' => $request->jenis_gaji,\n 'des_pos' => $request->des_pos,\n 'email' => $request->email,\n 'work_from' => $request->work_from,\n 'work_till' => $request->work_till,\n 'user_id' => $request->user_id,\n ]);\n\n $emp = Employee::where('user_id', $request->user_id)->first();\n $exp = Experience::where('user_id', $request->user_id)->get();\n $totalExp = 0;\n\n foreach ($exp as $row) {\n $start = $row->work_till;\n $end = $row->work_from;\n $totalExp += ($end - $start)*-1;\n }\n\n $emp->update([\n 'exp_total' => $totalExp\n ]);\n\n return redirect('/emp/resume')->with([\n 'success' => 'Data Diri Berhasil Diubah!'\n ]);\n }",
"public function insertIndividualExperience($em, $repoWF, $repoWE, $worker, $experience){\n $firmName = $experience['firm']['name'];\n $firmSuffix = $experience['firm']['urlSuffix'];\n $startDate = new \\DateTime($experience['SD']);\n $endDate = new \\DateTime($experience['ED']);\n\n if($firmSuffix != null){\n $firm = $repoWF->findOneBy(['url' => $firmSuffix]);\n } else {\n $firm = $repoWF->findOneBy(['name' => $firmName]);\n }\n\n if($firm == null){\n $firm = new WorkerFirm;\n $firm\n ->setName($firmName)\n ->setUrl($firmSuffix)\n ->setCreated(0);\n }\n\n if($experience['ED'] == null){\n if($firm->isActive() == false){\n $firm->setActive(true);\n }\n $nbActiveExperiences = $firm->getNbActiveExperiences();\n if($nbActiveExperiences == null){\n $firm->setNbActiveExperiences(1);\n } else {\n $firm->setNbActiveExperiences($nbActiveExperiences+1);\n }\n } else {\n $nbOldExperiences = $firm->getNbOldExperiences();\n if($nbOldExperiences == null){\n $firm->setNbOldExperiences(1);\n } else {\n $firm->setNbOldExperiences($nbOldExperiences+1);\n }\n }\n\n //$workerExp = $repoWE->findOneBy(['startDate' => $startDate, 'firm' => $firm, 'individual' => $worker]);\n\n //if($workerExp == null){\n $workerExp = new WorkerExperience;\n $workerExp->setStartDate($startDate)\n ->setEndDate($endDate)\n ->setPosition($experience['pos'])\n ->setActive($experience['ED'] == null);\n if(isset($experience['location'])){\n $workerExp->setLocation($experience['location']);\n }\n $firm->addExperience($workerExp);\n $worker->addExperience($workerExp);\n /*} else {\n if($experience['ED'] != null && $workerExp->getEndDate() == null){\n $workerExp->setActive(false);\n }\n\n if(isset($experience['location']) && $experience['location'] != null && $workerExp->getLocation() == null){\n $workerExp->setLocation($experience['location']);\n }\n }*/\n\n $em->persist($firm);\n $em->persist($worker);\n $em->flush();\n }",
"public function add_user_experience() {\r\n\t\t// get and format input\r\n\t\t$user_id = $this->session->userdata('user_id');\r\n\t\t$skills = $this->input->post('skills');\r\n\t\t\r\n\t\t$additional_data = array(\r\n\t\t\t'start_date' \t=> $this->input->post('start_date'),\r\n\t\t\t'end_date'\t\t=> $this->input->post('end_date'),\r\n\t\t\t'institution'\t=> $this->parse_input($this->input->post('title')),\r\n\t\t\t'description' \t=> $this->parse_input($this->input->post('description')),\r\n\t\t\t'role'\t\t\t=> $this->parse_input($this->input->post('role'))\r\n\t\t);\r\n\r\n\t\tif($this->System_model->check_skills_format($skills)) {\r\n\t\t\t$additional_data['skills'] = $skills;\r\n\t\t}\r\n\r\n\t\tif($this->User_model->add_user_experiences($user_id, $additional_data)) {\r\n\t\t\treturn $this->display_user_experiences($user_id);\r\n\t\t} else {\r\n\t\t\techo 'Error adding experience';\r\n\t\t}\r\n\t}",
"function addWorkexp($work_exp){\n\t if ($this->db->insert('candidate_work_experiance',$work_exp))\n\t\t\t{ \n\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\treturn FALSE;\n\t\t\t}\n }",
"protected function add_experience(){\n\t\t$input=Input::all();\n\t\t//input\n\t\t$user_id=$input['user_id'];\n\t\t\n\t\tif(isset($input['experience_tags']))\n\t\t\t$experience_tags=explode(',', $input['experience_tags']);\n\t\telse\n\t\t\t$experience_tags=array();\n\n\t\t$user_description=$input['user_description'];\n\t\t$pdo=DB::connection()->getPdo();\n\n\n\t\t$query = $pdo->prepare(\"SELECT * FROM experience WHERE user_id=:user_id ORDER BY created_at DESC\");\n\t\t$query->bindParam(':user_id', $user_id);\n\t\t$query->execute();\n\t\t$experience=$query->fetch();\n\n\t\tif(!$experience){\n\t\t\t$sql=$pdo->prepare(\"INSERT INTO experience (user_id,description,created_at) VALUES (:user_id,:user_description,NOW())\");\n\t\t\t$sql->bindParam(':user_id',$user_id);\n\t\t\t$sql->bindParam(':user_description',$user_description);\n\t\t\t$sql->execute();\n\t\t\t$experience_id=$pdo->lastInsertId();\n\n\t\t\tforeach ($experience_tags as $tag) {\n\t\t\t\t$tag=substr($tag, 1);\n\t\t\t\t$query = $pdo->prepare(\"SELECT tag_id FROM tag WHERE tag_name = :tag\");\n\t\t\t\t$query->bindParam(':tag', $tag);\n\t\t\t\t$query->execute();\n\t\t\t\t$row=$query->fetchAll();\n\t\t\t\t$tag_id=-1;\n\t\t\t\tif(!$row){\n\t\t\t\t\t$sql=$pdo->prepare(\"INSERT INTO tag (tag_name,tag_description) VALUES (:tag,'')\");\n\t\t\t\t\t$sql->bindParam(':tag', $tag);\n\t\t\t\t\t$sql->execute();\n\t\t\t\t\t$tag_id=$pdo->lastInsertId();\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$tag_id=$row[0]['tag_id'];\n\t\t\t\t}\n\t\t\t\t$sql=$pdo->prepare(\"INSERT INTO experience_tag (experience_id,tag_id) VALUES (:experience_id,:tag_id)\");\n\t\t\t\t$sql->bindParam(':experience_id', $experience_id);\n\t\t\t\t$sql->bindParam(':tag_id', $tag_id);\n\t\t\t\t$sql->execute();\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$query=$pdo->prepare(\"UPDATE experience SET description=:user_description WHERE user_id=:user_id\");\n\n\t\t\t$query->bindParam(':user_id', $user_id);\n\t\t\t$query->bindParam(':user_description', $user_description);\n\t\t\t$query->execute();\n\n\t\t\t$experience_id=$experience['experience_id'];\n\t\t\t$sql=\"DELETE FROM experience_tag WHERE experience_id=\".$experience_id;\n\t\t\t$pdo->exec( $sql );\n\t\t\tforeach ($experience_tags as $tag) {\n\t\t\t\t$tag=substr($tag, 1);\n\t\t\t\t$query = $pdo->prepare(\"SELECT tag_id FROM tag WHERE tag_name = :tag\");\n\t\t\t\t$query->bindParam(':tag', $tag);\n\t\t\t\t$query->execute();\n\t\t\t\t$row=$query->fetch();\n\t\t\t\t$tag_id=-1;\n\t\t\t\tif(!$row){\n\t\t\t\t\t$sql=$pdo->prepare(\"INSERT INTO tag (tag_name,tag_description) VALUES (:tag,'')\");\n\t\t\t\t\t$sql->bindParam(':tag', $tag);\n\t\t\t\t\t$sql->execute();\n\t\t\t\t\t$tag_id=$pdo->lastInsertId();\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$tag_id=$row['tag_id'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t \n\t\t\t\t$sql=$pdo->prepare(\"INSERT INTO experience_tag (experience_id,tag_id) VALUES (:experience_id,:tag_id)\");\n\t\t\t\t$sql->bindParam(':experience_id', $experience_id);\n\t\t\t\t$sql->bindParam(':tag_id', $tag_id);\n\t\t\t\t$sql->execute();\n\n\n\t\t\t}\t\t\t\n\t\t}\n\t\treturn 'ok';\n\n\t}",
"public function saveMyExperienceAction()\n {\n\t\t$params = $this->getRequest()->getParams();\n\t\t$zend_filter_obj = Zend_Registry::get('Zend_Filter_StripTags');\n\t\t$comp_id = \\Extended\\company_ref::checkCompany( $params[\"company\"] );\n\t\tif( !$comp_id )\n\t\t{\n\t\t\t$comp_id = \\Extended\\company_ref::addCompany($params[\"company\"], Auth_UserAdapter::getIdentity()->getId() );\n\t\t}\n\t\t\n\t\t$curt_wrk_yes = \\Extended\\experience::CURRENTLY_WORK_YES;\n\t\t$curt_wrk_no = \\Extended\\experience::CURRENTLY_WORK_NO;\n\t\t$temp = array();\n\t\t\n\t\t// get data where user is currently working previous\n\t\t$get_previous_currently_working = \\Extended\\experience::getCurrentlyWorkingUserData(Auth_UserAdapter::getIdentity()->getId());\n\t\t\n\t\t$temp[\"emp_company_id\"] = $comp_id;\n\t\t$temp[\"company_name\"] = $params[\"company\"];\n\t\t$temp[\"emp_job_title\"] = $zend_filter_obj->filter($params[\"title\"]);\n\t\t$temp[\"user_id\"] = Auth_UserAdapter::getIdentity()->getId();\n\t\t$temp[\"description\"] = $zend_filter_obj->filter($params[\"additional_notes\"]);\n\t\t$temp[\"currently_work\"] = @$params[\"currunt_company\"]?$curt_wrk_yes:$curt_wrk_no;\n\t\t$temp[\"experience_from\"] = @$params[\"from_date\"];\n\t\t$temp[\"experience_to\"] = @$params[\"to_date\"];\n\t\t\n\t\t$diff = \"\";\n\t\tif( @$params[\"from_date\"] && @$params[\"to_date\"] )\n\t\t{\n\t\t\t$days = intVal( DateTime::createFromFormat( \"d-m-Y H:i:s\", $params ['from_date'].\" 00:00:00\" )->diff( DateTime::createFromFormat(\"d-m-Y H:i:s\", $params['to_date'].\" 00:00:00\" ) )->d );\n\t\t\t$months = intVal( DateTime::createFromFormat( \"d-m-Y H:i:s\", $params['from_date'].\" 00:00:00\" )->diff( DateTime::createFromFormat(\"d-m-Y H:i:s\", $params['to_date'].\" 00:00:00\" ) )->m );\n\t\t\t$years = intVal( DateTime::createFromFormat( \"d-m-Y H:i:s\", $params['from_date'].\" 00:00:00\" )->diff( DateTime::createFromFormat(\"d-m-Y H:i:s\", $params['to_date'].\" 00:00:00\" ) )->y );\n\t\t\t// for years, months and days\n\t\t\tif($months == 0 && $years == 0 && $days >= 1) \n\t\t\t\t$diff = $days. ' day(s)';\n\t\t\telseif($months == 0 && $years >= 1 && $days == 0) \n\t\t\t\t$diff = $years.' year(s)';\n\t\t\telseif($months == 0 && $years >= 1 && $days >= 1)\n\t\t\t\t$diff = $years.' year(s) '. $days.' day(s)';\n\t\t\telseif($months >= 1 && $years == 0 && $days == 0)\n\t\t\t\t$diff = $months.' month(s)';\n\t\t\telseif($months >= 1 && $years == 0 && $days >= 1)\n\t\t\t\t$diff = $months.' month(s) '.$days.' day(s)';\n\t\t\telseif($months >= 1 && $years >= 1 && $days == 0)\n\t\t\t\t$diff = $years. ' year(s) '.$months.' month(s) ';\n\t\t\telseif($months >= 1 && $years >= 1 && $days >= 1)\n\t\t\t\t$diff = $years.' year(s) '.$months.' month(s) '.$days.' day(s)';\n\t\t\telse\n\t\t\t{\t\n\t\t\t\t$diff = $years.' year(s) '.$months.' month(s) ';\n\t\t\t}\n\t\t}\n\t\t$temp[\"date_diff\"] = $diff;\n\t\t\n\t\t$temp[\"location\"] = $zend_filter_obj->filter($params[\"location\"]);\n\t\t\n\t\t$id = 0;\n\t\tif( !$params['identity'] )\n\t\t{\n\t\t\t$temp[\"new_record\"] = 1;\n\t\t\t$id = Extended\\experience::addOrEditExperience($temp);\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\t$temp[\"new_record\"] = 0;\n\t\t\t$id = Extended\\experience::addOrEditExperience($temp, $params['identity']);\n\t\t}\n\n\t\t$exp_arr = array();\n\t\t$exp_arr['current_exp_id'] \t\t\t\t\t= $id;\n\t\t$exp_arr['previous_current_exp_id']\t\t\t= isset($get_previous_currently_working[0]['id'])?$get_previous_currently_working[0]['id']:0;\n\t\t$exp_arr['previous_current_exp_job_endate'] = isset($get_previous_currently_working[0]['job_enddate'])?$get_previous_currently_working[0]['job_enddate']->format('d-m-Y'):NULL;\n\t\t$exp_arr['current_exp_data'] \t\t\t\t= $temp;\n\t\t\n\t\tif( $exp_arr )\n\t\t{\n\t\t\techo Zend_Json::encode( $exp_arr );\t\t\n\t\t}\n\t\telse\n\t\t{\t\t\t\n\t\t\techo Zend_Json::encode( 0 );\t\t\n\t\t}\t\n\t\tdie;\n }",
"public function addExperience_post()\n {\n $data=$this->post('data');\n $experience_id=$data['experience_id'];\n if($experience_id){\n $ret=$this->admin_model->update_emp_experience($data);\n if($ret) { $response['msg']='updated successfully';}\n else{ $response['msg']='Something went Wrong';}\n }else{\n $data['employee_key']=$this->post('employee_key');\n $ret=$this->admin_model->add_emp_experience($data);\n if($ret) { $response['msg']='added successfully';}\n else{ $response['msg']='Something went Wrong';}\n }\n $this->response( $response,200);\n }",
"public function addWork(\\N1coode\\NjPortfolio\\Domain\\Model\\Work $newWork) \n\t{\n\t\t$this->work->attach($newWork);\n\t}",
"public function run()\n {\n $skills = [\n ['id' => 1, 'skill_name' => 'Teamwork'],\n ['id' => 2, 'skill_name' => 'Problem-Solving'],\n ['id' => 3, 'skill_name' => 'Communication'],\n ['id' => 4, 'skill_name' => 'Professionalism/Work-ethic'], \n ];\n \n DB::table('skill')->insert($skills);\n }",
"public function create_interview($data)\n {\n $this->db->insert('interview', $data);\n return;\n }",
"function addelifeImprov()\n\t{\n\t\t$this->load->model('Surveymodel');\n\t\t$this->Surveymodel->insert_lifeImprovement();\n\t\t\n\t}",
"public function addPost() {\n // $q = 'INSERT INTO suni_portfolio.work\n $q = 'INSERT INTO susanneni_portfolio.work\n SET\n employer = :employer,\n workTitle = :workTitle,\n description = :description,\n workStart_date = :workStart_date,\n workEnd_date = :workEnd_date';\n\n $stmt = $this->connect()->prepare($q);\n\n //strip data of tags\n $this->employer = htmlspecialchars(strip_tags($this->employer));\n $this->workTitle = htmlspecialchars(strip_tags($this->workTitle));\n $this->description = htmlspecialchars(strip_tags($this->description));\n $this->workStart_date = htmlspecialchars(strip_tags($this->workStart_date));\n $this->workEnd_date = htmlspecialchars(strip_tags($this->workEnd_date));\n\n //bind data\n $stmt->bindParam(':employer', $this->employer);\n $stmt->bindParam(':workTitle', $this->workTitle);\n $stmt->bindParam(':description', $this->description);\n $stmt->bindParam(':workStart_date', $this->workStart_date);\n $stmt->bindParam(':workEnd_date', $this->workEnd_date);\n\n if($stmt->execute()) {\n return true;\n } else {\n printif('Error: %s.\\n', $stmt->error);\n return false;\n }\n }",
"function save()\n\t\t{\n\t\t\t$GLOBALS['DB']->exec(\"INSERT INTO leagues (league_name, sport_id, price, skill_level, description, location, website, email, org_id) VALUES ('{$this->getLeagueName()}', {$this->getSportId()}, {$this->getPrice()}, '{$this->getSkillLevel()}', '{$this->getDescription()}', '{$this->getLocation()}', '{$this->getWebsite()}', '{$this->getEmail()}', {$this->getOrgId()});\");\n\t\t\t$this->id = $GLOBALS['DB']->lastInsertId();\n\t\t}",
"public function save_experience_view($id){ \n\t\t$this->remove_experience($id);\n\t\t// save school details\n\t\t$this->request->data['HrExperience']['created_by'] = $this->Session->read('USER.Login.id');\t\t\n\t\t$this->request->data['HrExperience']['created_date'] = $this->Functions->get_current_date();\n\t\t$this->request->data['HrExperience']['app_users_id'] = $id;\n\t\t\n\t\tfor($i = 1; $i <= 2; $i++){\n\t\t \t$this->request->data['HrExperience']['company'] = $this->request->data['HrExperience']['company'.$i];\t\t\n\t\t\tif($this->request->data['HrExperience']['company'] != ''){\n\t\t\t\t$this->request->data['HrExperience']['designation'] = $this->request->data['HrExperience']['designation'.$i];\t\t\t\n\t\t\t\t$this->request->data['HrExperience']['address'] = $this->request->data['HrExperience']['address'.$i];\n\t\t\t\t$this->request->data['HrExperience']['total_exp'] = $this->request->data['HrExperience']['total_exp'.$i];\n\t\t\t\t$this->request->data['HrExperience']['doj'] = $this->Functions->format_date_save($this->request->data['HrExperience']['doj'.$i]);\n\t\t\t\t$this->request->data['HrExperience']['dor'] = $this->Functions->format_date_save($this->request->data['HrExperience']['dor'.$i]);\n\t\t\t\t$this->HrEmployee->HrExperience->create();\n\t\t\t\tif($this->HrEmployee->HrExperience->save($this->request->data['HrExperience'], array('validate' => false))){\n\t\t\t\t\t\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\t\t\n\t\treturn true;\n\t\t\n\t}",
"public function run()\n {\n $skills = array (\n array(\n \t'tsTechId' => 'TECH0001',\n \t'tsSkillId' => 'SERV0001',\n \t'tsIsActive' => 1,\n ),\n array(\n \t'tsTechId' => 'TECH0001',\n \t'tsSkillId' => 'SERV0002',\n \t'tsIsActive' => 1,\n ),\n );\n DB::table('tech_skill')->insert($skills);\n }",
"public function edit(Experience $experience)\n {\n //\n }",
"public function edit(Experience $experience)\n {\n //\n }",
"public function experience(): Experience;",
"public function save_experience($id){\n\t\t$this->request->data['HrExperience']['created_by'] = $this->Session->read('USER.Login.id');\t\t\n\t\t$this->request->data['HrExperience']['created_date'] = $this->Functions->get_current_date();\n\t\t$this->request->data['HrExperience']['app_users_id'] = $id;\n\t\t\n\t\t// save degree details\n\t\tfor($i = 1; $i <= 2; $i++){ \n\t\t \t$this->request->data['HrExperience']['company'] = $this->Session->read('experience.company'.$i);\t\t\n\t\t\tif($this->request->data['HrExperience']['company'] != ''){\n\t\t\t\t// format the dates to save\n\t\t\t\t$this->request->data['HrExperience']['doj'] = $this->Functions->format_date_save($this->Session->read('experience.doj'.$i));\t\t\t\n\t\t\t\t$this->request->data['HrExperience']['dor'] = $this->Functions->format_date_save($this->Session->read('experience.dor'.$i));\t\n\t\t\t\t$this->request->data['HrExperience']['company'] = $this->Session->read('experience.company'.$i);\t\n\t\t\t\t$this->request->data['HrExperience']['designation'] = $this->Session->read('experience.designation'.$i);\t\t\t\n\t\t\t\t$this->request->data['HrExperience']['address'] = $this->Session->read('experience.address'.$i);\n\t\t\t\t$this->request->data['HrExperience']['total_exp'] = $this->Session->read('experience.total_exp'.$i);\n\t\t\t\t\t\t\n\t\t\t\t$this->HrEmployee->HrExperience->create();\n\t\t\t\tif($this->HrEmployee->HrExperience->save($this->request->data['HrExperience'], array('validate' => false))){\n\t\t\t\t\t\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t}",
"public function can_add_expense()\n {\n $expense=new IncomeExpense;\n $newexpense=$expense->newExpense(1,\"dashboard printer\",4000,\"very costful printer\");\n\n $this->assertDatabaseHas(\"income\", [\n \"expense_category\" => 1,\n \"expense_title\" => \"dashboard printer\",\n \"amount\"=>4000,\n \"notes\"=>\"very costful printer\"\n ]);\n }",
"public function store(Request $request)\n {\n $experience = new Experience();\n $experience->stadium_visited = $request['stadium_visited'];\n $experience->day_visited = $request['day_visited'];\n $experience->ticket = $request['ticket'];\n $experience->beer = $request['beer'];\n $experience->soda = $request['soda'];\n $experience->hot_dog = $request['hot_dog'];\n $experience->profile_id = Auth::user()->id;\n $experience->save();\n \n\n return redirect('/home');\n }",
"public function __construct(Experience $experience)\n {\n $this->experience = $experience;\n }",
"function addExcessWorkflowNew($employee_id, $employer_id, $refund, $date) {\r\n\t$title = \"Refund \". $refund.\", On \".$date;\r\n\t$requestor_type = 'Employee';\r\n\t$action_type = 'Employer';\r\n\t$status = 'Pending';\r\n\t$sql = \"select id from workflow where name = 'Excess Contribution' ORDER BY id ASC LIMIT 1\";\r\n\t$rs = mysql_query($sql) or die('error');\r\n\tif(mysql_num_rows($rs)) {\r\n\t\t$rec = mysql_fetch_array($rs);\r\n\t\t$wf_id = $rec['id'];\r\n\t} else {\r\n\t\t$wf_id = 2;\r\n\t}\r\n\t$insertSQL = \"INSERT INTO actions (title, id, requestor_id, requestor_type, action_type, wf_id, status) VALUES ('\".$title.\"', '\".$employer_id.\"', '\".$employee_id.\"', '\".$requestor_type.\"', '\".$action_type.\"', '\".$wf_id.\"', '\".$status.\"')\";\r\n\r\n $Result1 = mysql_query($insertSQL) or die(mysql_error());\r\n}",
"public function addExp($experience) {\n\t\tif($this->hasBoost(3)) {\n\t\t\t$experience = $boosted_experience = $experience + ($experience / 2);\n\n\t\t\t$this->experience += $experience;\n\t\t} else {\n\t\t\t$this->experience += $experience;\n\t\t}\n\n\t\treturn $experience;\n\t}",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'organization_name' => 'required|string|max:255',\n 'organization_website' => 'nullable|url',\n 'title' => 'required|string|max:255',\n // 'technologies_used' => 'required|string',\n 'responsibilities' => 'required|string',\n 'start_date' => 'required|date',\n 'end_date' => 'nullable|date',\n 'current' => 'required|boolean',\n 'picture' => 'nullable|image|max:2048',\n 'document' => 'nullable|file|mimes:pdf'\n ]);\n\n $user = Auth::user();\n\n if ($user->can('create', WorkExperience::class)) {\n $work = new WorkExperience;\n\n $work->organization_name = $request->organization_name;\n $work->organization_website = $request->organization_website;\n $work->title = $request->title;\n $work->technologies_used = '';\n $work->responsibilities = $request->responsibilities;\n $work->start_date = $request->start_date; // d-m-Y\n $work->end_date = $request->end_date;\n $work->current = $request->current;\n\n $user->workExperience()->save($work);\n\n if ($request->picture) {\n $this->addPicture($user, $work, $request->picture);\n }\n if ($request->document) {\n $this->addDocument($user, $work, $request->document);\n }\n\n $work->thumbnail = $work->thumbnail();\n $work->file_url = $work->file_url();\n return $work;\n }\n\n return response('Not authorized', 403);\n }",
"public function addRecord();",
"public function create()\n {\n return view('admin.experience_add');\n }",
"public function store(Request $request)\n {\n $user = Auth::user();\n\n $exp = new Experience;\n $exp->organisation = $request->input('organisation');\n $exp->role = $request->input('role');\n $exp->user_id = $user->id;\n\n $exp->save();\n\n $ex = $user->experiences;\n\n return view('experience.create',compact('ex'));\n }"
] | [
"0.7105458",
"0.6500657",
"0.6316764",
"0.62735456",
"0.6220129",
"0.6091207",
"0.60684067",
"0.58517927",
"0.5795954",
"0.5794928",
"0.56741124",
"0.5610432",
"0.5562685",
"0.55431485",
"0.5541422",
"0.5531461",
"0.5529755",
"0.55270225",
"0.55270225",
"0.5508401",
"0.54825807",
"0.5468576",
"0.54421335",
"0.5409976",
"0.53816587",
"0.53686965",
"0.5355647",
"0.5346671",
"0.5346398",
"0.5339201"
] | 0.6764051 | 1 |
Get all work experience for the given userId from the database. | public static function getWorkExp($userId)
{
global $db;
$eUserId = $db->real_escape_string($userId);
$sql = "SELECT * ";
$sql .= "FROM work_experience ";
$sql .= "WHERE user_id = ?";
$stmt = $db->stmt_init();
if(!$stmt->prepare($sql))
{
echo "Failed to prepare statement";
return;
}
else
{
$stmt->bind_param("s", $eUserId);
$stmt->execute();
$stmt->bind_result($workExpId, $company, $location, $jobTitle, $startDate, $endDate, $userId);
$workExpList = [];
while($stmt->fetch())
{
$workExp = new WorkExperience($workExpId, $company, $location, $jobTitle, $startDate,
$endDate, $userId);
$workExpList[] = $workExp;
}
return $workExpList;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllChallengesForUser($userId) {\n return BIM_Model_Volley::getAllForUser( $userId );\n }",
"public function getInterestsByUserId($userId) {\n return $interest = DB::table('interest')->where('user_id', $userId)->get();\n }",
"public function allForUser($userId);",
"function GetAllcompletedGames($userId)\n\t{\n\t\t$sql = sprintf(\"SELECT GameId FROM game_players WHERE PlayerId = %d\", $userId);\n\t\t$games = RunSql($sql);\n\t\t\n\t\t$rows = array();\n\t\twhile($r = $games->fetch_assoc()) \n\t\t{\n\t\t\t$sql = sprintf(\"SELECT id ,GameName FROM games WHERE id = %d and active = 0\", $r[\"GameId\"]);\n\t\t\t$result = RunSql($sql);\n\t\t\tif (mysqli_num_rows($result)!=0)\n\t\t\t{\n\t\t\t\t$row = $result->fetch_assoc();\n\t\t\t\t$row[\"Rank\"] = getUserRankInGame($userId,$r[\"GameId\"]);\n\t\t\t\t$rows[] = $row;\n\t\t\t}\n\t\t}\t\t\t\n\t\treturn $rows;\t\n\t}",
"public function allForUser($userId)\n {\n return $this->model->where('user_id', $userId)->get();\n }",
"public function findProjectsByUser(int $userId);",
"function _get_record_all_workshops($UserId = null){\n\t\tget_instance()->db_training->select('*');\n\t\tget_instance()->db_training->from('Workshops');\n\t\tif($UserId){\n\t\t\tget_instance()->db_training->where('WorkshopRevenueAuthorityContactFkId',$UserId);\t\n\t\t}\n\t\t\t$query = get_instance()->db_training->get();\n if ($query->num_rows()){\n\t\t\treturn $query ->result_array();\t\n\t\t}\n return false;\n\t}",
"public function findEmployerInfoByUserId($userId)\n {\n $query = Employer::join('user', 'employer.user_id', '=', 'user.id')\n ->where('user.id', '=', $userId)\n ->select('employer.*')\n ->first();\n\n return $query;\n }",
"public function allByUserId($userId) {\n\t}",
"public static function getUsersPracticeLocation($userId){\r\n $sql = Doctrine_Query::create()\r\n //->select('upal.CountyId,upal.Id, c.Name as CountyName')\r\n ->from('UserPracticeAreaLocation upal')\r\n ->leftJoin('upal.UserPracticeAreaLocationCounties c')\r\n ->leftJoin('upal.UserPracticeAreaLocationState s')\r\n ->where('upal.UserId = ? ', $userId)\r\n ->andWhere('upal.StateId != ? ', '-1')\r\n ->orderBy('s.Name ASC, c.Name ASC');\r\n \r\n $result = array();\r\n $result = $sql->fetchArray() ;\r\n #clsCommon::pr($result);\r\n return $result ;\r\n }",
"public function findByUserId(int $userId): array;",
"public function getByUserId(int $userId): array;",
"public static function FetchAll()\n {\n global $mysqli;\n global $user_id;\n\n $toReturn = [];\n\n $query = \"SELECT * FROM `experiment` WHERE `user_id` = $user_id ORDER BY `best_result_test` ASC\";\n\n // Validate results\n if ($result = $mysqli->query($query)) \n {\n // Retreive results.\n while ($data = $result->fetch_object()) \n {\n $experiment = new Experiment($data);\n\n if($experiment->IsStarted() && $experiment->current_epocs > 0)\n $experiment->Render();\n \n }\n }\n\n return $toReturn;\n }",
"public function fetchEntireByUserId($userId = 0)\n {\n $select = $this->getSql()\n ->select()\n ->where(array('user_id' => $userId))\n ->order('updated_on DESC');\n $rowset = $this->selectWith($select);\n $collections = array();\n foreach($rowset as $row) {\n $collections[] = array(\n 'id' => (int) $row['id'],\n 'name' => $row['name']\n );\n }\n return $collections;\n }",
"public static function FetchAllRunning()\n {\n global $mysqli;\n global $user_id;\n\n $toReturn = [];\n\n $query = \"SELECT * FROM `experiment` WHERE `user_id` = $user_id\";\n\n // Validate results\n if ($result = $mysqli->query($query)) \n {\n // Retreive results.\n while ($data = $result->fetch_object()) \n {\n $experiment = new Experiment($data);\n\n if($experiment->IsRunning())\n $experiment->Render();\n \n }\n }\n\n return $toReturn;\n }",
"public function getPI($userId)\n {\n $sort = new CSort();\n return new CActiveDataProvider('Intention',\n array(\n 'criteria' => array(\n 'with'=> array(\n 'users' => array(\n 'joinType' => 'INNER JOIN',\n 'select'=>false,\n 'condition'=>'user_id='.$userId.' AND 9=9'\n )\n ),\n 'together'=>true,\n\n ),\n 'sort' => $sort,\n 'pagination' => array(\n 'pageSize' => 4,\n ),\n )\n );\n\n }",
"public function getMeetings($userId = NULL) {\n\t\tif (isset($userId)) {\n\t\t\t$query = \"SELECT * FROM meetings WHERE meetings.mentor = :id AND meetings.deleted = false\";\n\t\t\t$types = array('integer');\n\t\t\t$params = array('id' => $userId);\n\t\t} else {\n\t\t\t// query for retrieving active status of mentor user\n\t\t\t$query = \"SELECT meetings.*, users.active FROM meetings LEFT JOIN users ON meetings.mentor = users.id WHERE meetings.deleted = false\";\n\t\t\t$types = array();\n\t\t\t$params = array();\n\t\t}\n\t\t\n\t\t// limit to 2013 only\n\t\t$query .= \" AND meetings.date > :date\";\n\t\tarray_push($types,'string');\n\t\t$params['date'] = $this->date_limit;\n\n\t\t$sth = $this -> mdb2 -> prepare($query, $types);\n\t\t$result = $sth -> execute($params);\n\n\t\tif (PEAR::isError($result)) {\n\t\t\treturn $result;\n\t\t}\n\n\t\t$rows = $result -> fetchAll(MDB2_FETCHMODE_ASSOC);\n\t\t$result -> free();\n\n\t\treturn $rows;\n\t}",
"function specific_users_skills_get()\n {\n $user_id=(int) $this->get('user_id');\n $limit=(int) $this->get('limit');\n $offset=(int) $this->get('offset');\n $return_row=$this->get('return_row');\n \n $users_skills=$this->skill_model->read_users_skills($user_id,$limit,$offset,$return_row);\n\n if($users_skills)\n {\n $this->response($users_skills, REST_Controller::HTTP_OK); // 200 being the HTTP response code\n }\n else\n {\n $this->response(NULL, REST_Controller::HTTP_NOT_FOUND);//Errors to be handled application side\n }\n }",
"function GetRecordByUserId($userId)\n {\n require 'Model/Credentials.php';\n \n //Open connection and Select database\n $connection = mysqli_connect($host, $user, $passwd, $database);\n $result = mysqli_query($connection,\" SELECT * FROM recommender WHERE userId=$userId ORDER BY qty DESC LIMIT 4\") or die(mysql_error());\n \n $numrows = mysqli_num_rows($result);\n $recommenderArray = array();\n if($numrows != 0)\n {\n while ($row = mysqli_fetch_assoc($result))\n {\n $dbId= $row['id'];\n $dbcatId= $row['catId'];\n $dbuserId= $row['userId'];\n $dbqty= $row['qty'];\n $dbdate= $row['date'];\n \n $recommenderEntities = new RecommenderEntities($dbId,$dbcatId,$dbuserId,$dbqty,$dbdate); \n array_push($recommenderArray, $recommenderEntities);\n }\n \n return $recommenderArray;\n }else\n {\n return 0;\n }\n }",
"public function getGamesOwned($userId): GameList;",
"public function getAllForUser(string $userId): array\n {\n // Returns an array of all the LPAs Ids (plus other metadata) in the user's account.\n $lpaActorMaps = $this->userLpaActorMapRepository->getByUserId($userId);\n\n $lpaActorMaps = array_filter($lpaActorMaps, function ($item) {\n return !array_key_exists('ActivateBy', $item);\n });\n\n return $this->lookupAndFormatLpas($lpaActorMaps);\n }",
"public function getForUser(int $userId): array\n\t{\n\t\treturn $this->whereUser($userId)->findAll();\n\t}",
"public function getByUserId(string $userId): array;",
"public function getAll($user_id);",
"public function findByUser($userId) {\n\n\t\treturn $this->model->whereUserId($userId)->get();\n\t}",
"public function getAllByAttempt(\n $attemptId,\n $userId\n );",
"public function allForUser($userId)\n {\n return $this->model->whereUserId($userId)->orderBy('created_at', 'desc')->get();\n }",
"public function getReviewableExams(int $userId): array\n {\n $examReviews = $this->iteratorToArray(ExamReview::findAll(['reviewer_id' => $userId]));\n $result = [];\n $examIds = $this->mapArray($examReviews, 'exam_id');\n if (!empty($examIds)) {\n $exams = Exam::findAll(['id' => ['in' => new Parameter($examIds)]]);\n foreach ($exams as $exam) {\n $examData = $exam->getFields();\n if (!empty($examData['group_id'])) {\n $groupUsers = $this->groupService->getGroupUsers($examData['group_id']);\n // $examData['members'] = $groupUsers;\n $examData['qas'] = $this->groupService->getQAsByGroupId($examData['group_id']);\n } else {\n $examData['uploads'] = $exam->getUploads();\n }\n array_push($result, $examData);\n }\n }\n return $result;\n }",
"public function getRolesByUserId($userId);",
"public function findByUser(UserId $userId) : array\n {\n }"
] | [
"0.640619",
"0.6256567",
"0.61660725",
"0.6160192",
"0.61363524",
"0.61326945",
"0.6123208",
"0.6121398",
"0.60971606",
"0.6088016",
"0.60509866",
"0.6015946",
"0.60082847",
"0.59670854",
"0.5939344",
"0.5864457",
"0.5859702",
"0.5841708",
"0.5787592",
"0.57764316",
"0.57713944",
"0.5768778",
"0.5768722",
"0.5752241",
"0.57456803",
"0.5736147",
"0.5729925",
"0.57194954",
"0.5711699",
"0.5689244"
] | 0.7997646 | 0 |
Update the record for the given work experience in the database. | public static function updateWorkExp($workExp)
{
global $db;
$eWorkExpId = $db->real_escape_string($workExp->getWorkExpId());
$eCompany = $db->real_escape_string($workExp->getCompany());
$eLocation = $db->real_escape_string($workExp->getLocation());
$eJobTitle = $db->real_escape_string($workExp->getJobTitle());
$eStartDate = $db->real_escape_string($workExp->getStartDate());
$eEndDate = $db->real_escape_string($workExp->getEndDate());
$sql = "UPDATE work_experience ";
$sql .= "SET company = ?, location = ?, job_title = ?, start_date = ?, end_date = ? ";
$sql .= "WHERE work_exp_id = ?";
$stmt = $db->stmt_init();
if(!$stmt->prepare($sql))
{
echo "Failed to prepare statement";
return;
}
else
{
$stmt->bind_param("ssssss", $eCompany, $eLocation, $eJobTitle, $eStartDate, $eEndDate, $eWorkExpId);
if($stmt->execute())
return true;
else
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function update_record(){\n\t\t\t\n\t\t}",
"public function workupdate(Request $request)\n {\n $exp = Experience::find($request->id);\n\n $exp->update([\n 'job_title' => $request->job_title,\n 'company' => $request->company,\n 'industri_id' => $request->industri_id,\n 'position' => $request->position,\n 'salary' => $request->salary,\n 'jenis_gaji' => $request->jenis_gaji,\n 'des_pos' => $request->des_pos,\n 'email' => $request->email,\n 'work_from' => $request->work_from,\n 'work_till' => $request->work_till,\n 'user_id' => $request->user_id,\n ]);\n\n $emp = Employee::where('user_id', $request->user_id)->first();\n $expe = Experience::where('user_id', $request->user_id)->get();\n $totalExp = 0;\n\n foreach ($expe as $row) {\n $end = $row->work_till;\n $start = $row->work_from;\n $totalExp += $end - $start;\n }\n\n $emp->update([\n 'exp_total' => $totalExp\n ]);\n\n return redirect('/emp/resume')->with([\n 'success' => 'Data Diri Berhasil Diubah!'\n ]);\n\n }",
"public function update(Request $request, Experience $experience)\n {\n //\n }",
"public function testUpdateRecord()\n {\n\n $record = $this->_record();\n\n $record->setArray(array(\n 'field4' => 1,\n 'field5' => 2,\n 'field6' => 3\n ));\n\n $record->save();\n\n $this->_setPut(array(\n 'field4' => '4',\n 'field5' => '5',\n 'field6' => '6'\n ));\n\n $this->dispatch('neatline/records/'.$record->id);\n $record = $this->_reload($record);\n\n $this->assertEquals(4, $record->field4);\n $this->assertEquals(5, $record->field5);\n $this->assertEquals(6, $record->field6);\n\n }",
"public function edit(Experience $experience)\n {\n //\n }",
"public function edit(Experience $experience)\n {\n //\n }",
"public function update(ExperienceRequest $request, Experience $experience)\n {\n $data = $this->deleteCampNull($request);\n\n $checks = \"\";\n\n foreach ($data as $key => $item)\n {\n if ($item == \"on\")\n {\n $check = explode(\"_\",$key)[1];\n\n $checks = $checks.\"_\".$check;\n }\n }\n\n if ($checks != \"\")\n $data[\"evidencia_camps\"] = $checks;\n\n $experience->update($data);\n\n return redirect()->route($this->pathRoute.\"show\",$experience->id)->with(\"success\",\"Experiencia editada correctamente\");\n }",
"public function UpdateInDB()\n {\n global $user_id;\n\n $query = \"UPDATE `experiment` SET \n `name` = '$this->name',\n `const_threads` = $this->const_threads,\n `const_batch` = $this->const_batch,\n `const_log_filename` = '$this->const_log_filename',\n `const_seed` = $this->const_seed,\n `network_raw` = '$this->network_raw',\n `script_raw` = '$this->script_raw',\n `best_result_test` = $this->best_result_test,\n `best_result_train` = $this->best_result_train,\n `epoc_best_result_test` = $this->epoc_best_result_test,\n `epoc_best_result_train` = $this->epoc_best_result_train,\n `dataset_id` = $this->dataset_id,\n `process_id` = $this->process_id \n WHERE `id` = $this->id AND `user_id` = $user_id\";\n\n $result = $this->conn->query($query);\n\n }",
"function updateCapacitacion_work($capacitacion_work_id, $data)\n\t{\n\t\t$this->db->where('capacitacion_work_id', $capacitacion_work_id);\n\t\t$this->db->update('capacitacion_work', $data);\t\n\t}",
"public function updateRecord()\n {\n #$response = $request->execute();\n }",
"public function ajaxUpdateWorkExperience(Request $request){\n //ajax goes here to insert into DB for profile stuff\n try {\n $user = Auth::user();\n $guide = $user->guide;\n\n //$job_title = $request->work_title; //TODO Need to add worktitle to the database as a job... need a table for work experience\n $work_experience = $request->work_experience;\n\n $this->dao->updateWorkExperience($guide->id, $work_experience);\n }\n catch (Execption $e) {\n echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n }\n }",
"public function update()\n {\n \n $educationId = Helper::getIdFromUrl('education');\n $education = $_POST;\n $education['updated_by'] = Helper::getUserIdFromSession();\n $education['updated'] = date('Y-m-d H:i:s');\n EducationModel::load()->update($education, $educationId);\n \n view::redirect('education');\n \n }",
"public function updateRecord($formData)\n {\n }",
"public function update($cardSkill);",
"public function update(CvWorkExperienceRequest $request, $cv_id, $cv_work_experience_id)\n {\n $cv = Cv::findOrFail($cv_id);\n $cvWorkExperience = CvWorkExperience::findOrFail($cv_work_experience_id);\n if ($cv->id != $cvWorkExperience->cv_id) {\n return response()->json([\n 'status' => false, \n 'message' => \"Unrelated request.\",\n ], 400);\n }\n\n // Authorization was declared in the Form Request\n\n // Retrieve the validated input data....\n $validatedData = $request->validated();\n $cvWorkExperience->update($validatedData);\n return response()->json([\n 'status' => true, \n 'message' => \"Work experience updated successfully.\",\n 'data' => CvWorkExperience::findOrFail($cvWorkExperience->id)\n ], 200);\n }",
"function livewebteaching_update_instance($livewebteaching) {\n\n $livewebteaching->timemodified = time();\n $livewebteaching->id = $livewebteaching->instance;\n\n\tif (! isset($livewebteaching->wait)) {\n\t\t$livewebteaching->wait = 1;\n\t}\n\n\n # You may have to add extra stuff in here #\n\n return update_record('livewebteaching', $livewebteaching);\n}",
"public function update($participation) { ; }",
"function editEmpHistory() {\r\n global $dbh;\r\n\r\n $applicant_id = $_SESSION['applicant_id'];\r\n $e_id = $_REQUEST['id'];\r\n $e_name = $_REQUEST['e-name'];\r\n $e_phone = $_REQUEST['e-phone'];\r\n $e_city = $_REQUEST['e-city'];\r\n $e_state = $_REQUEST['e-state'];\r\n $e_start_date = $_REQUEST['e-start-date'];\r\n $e_end_date = $_REQUEST['e-end-date'];\r\n $e_position = $_REQUEST['e-position'];\r\n $e_description = $_REQUEST['e-description'];\r\n\r\n $edit_emp_history_sql = <<<SQL\r\n UPDATE employment\r\n SET e_name = \"$e_name\",\r\n e_phone = \"$e_phone\",\r\n e_city = \"$e_city\",\r\n e_state = \"$e_state\",\r\n e_start_date = \"$e_start_date\",\r\n e_end_date = \"$e_end_date\",\r\n e_position = \"$e_position\",\r\n e_description = \"$e_description\"\r\n WHERE id = $e_id AND applicant_id = $applicant_id;\r\n\r\nSQL;\r\n\r\n $edit_emp_history_result = $dbh->query($edit_emp_history_sql);\r\n\r\n if ($edit_emp_history_result) {\r\n header(\"Location: /job_app/view_employment_records.php\");\r\n } else {\r\n echo \"There was an error. Please try again.\";\r\n mysqli_error($dbh);\r\n }\r\n\r\n}",
"public function update()\n {\n $jobId = Helper::getIdFromUrl('job');\n if(!(int)$_POST['end_year']){\n $_POST['end_year'] = NULL;\n }\n $job = $_POST;\n\n // Set updated_by ID and set the date of updating\n $job['user_id'] = Helper::getUserIdFromSession();\n $job['updated_by'] = Helper::getUserIdFromSession();\n $job['updated'] = date('Y-m-d H:i:s');\n\n // Update the record in the database\n JobModel::load()->update($job, $jobId);\n\n // Return to the job-overview\n header(\"Location: /job\");\n\n }",
"public function saveAction(){\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"experience\",\"action\" => \"index\"));\n }\n $idexperience = $this->request->getPost(\"idexperience\");\n $experience = Experience::findFirstByidexperience($idexperience);\n $experiencelog = serialize($_POST);\n if (!$experience) {\n DataLogger::experience('error', \"\\n\\n experience not exist \\n {$experiencelog} \\n\\n\");\n $this->flash->error(\"experience does not exist \" . $idexperience);\n return $this->dispatcher->forward(array(\n \"controller\" => \"experience\",\"action\" => \"index\"));\n }\n $experience->iduser = $this->request->getPost(\"iduser\");\n $experience->title = $this->request->getPost(\"title\");\n $experience->description = $this->request->getPost(\"description\");\n $experience->from_date = $this->request->getPost(\"from_date\");\n $experience->to_date = $this->request->getPost(\"to_date\");\n $experience->company = $this->request->getPost(\"company\");\n $experience->company_address = $this->request->getPost(\"company_address\");\n $experience->company_ctc = $this->request->getPost(\"company_ctc\");\n $experience->updated_on = $this->request->getPost(\"updated_on\");\n $experience->created_by = $this->request->getPost(\"created_by\");\n $experience->updated_by = $this->request->getPost(\"updated_by\"); \n if (!$experience->save()) {\n DataLogger::experience('error', \"\\n\\n experience not update \\n {$experiencelog} \\n\\n\");\n foreach ($experience->getMessages() as $message) {\n $this->flash->error($message);\n } \n return $this->response->redirect(\"experience/edit/\".$idexperience); \n }else{\n $this->flash->success(\"Experience was updated successfully\");\n return $this->response->redirect(\"experience/index\"); \n } \n }",
"public function update(PassiveRecord &$Model);",
"public function update() {\n\t\t\n\t\t$mods = $this->_data_modified[$this->_data_position];\n\t\tif (count($mods) < 1) return true; // no changes.\n\t\t\t\n\t\t// Build data\n\t\t$changes = [];\n\t\tforeach ($mods as $mod) $changes[$mod] = $this->__get($mod);\n\t\t\n\t\t// Build URL\n\t\t$url = \"table/\".$this->_table_name.\"/\".$this->__get(\"sys_id\");\n\t\t\n\t\t// Use GlideAccess to run the PUT command \n\t\t// Throw a GlideAccessException or a GlideAuthenticationException on error \n\t\t$result = $this->_access->put($url, json_encode($changes));\n\t\t\t\n\t\t// Clear out the pending updates for this record\n\t\t$this->_data_modified[$this->_data_position] = [];\n\t}",
"public function update_coach($email, $self_introduction, $experience)\n {\n $this->email = $email;\n $this->self_introduction = $self_introduction;\n $this->experience = $experience;\n\n $this->db->where('email', $email);\n $this->db->update('coach', $this);\n\n }",
"public function update()\n\t\t{\n\t\t\t$post \t\t\t\t\t\t= $this->input->post();\n\t\t\t$this->id \t\t\t\t\t= $post['id'];\n\t\t\t$this->employee_code\t\t= $post['employee_code'];\n\t\t\t$this->employee_entry_date\t= $post['employee_entry_date'];\n\t\t\t$this->leave_period \t\t= $post['leave_period'];\n\t\t\t$this->effective_date \t\t= $post['effective_date'];\n\t\t\t$this->valid_until \t\t\t= $post['valid_until'];\n\t\t\t$this->total \t\t\t\t= $post['total'];\n\t\t\t// $this->leave_taken \t\t\t= $post['leave_taken'];\n\t\t\t// $this->mass_leave \t\t\t= $post['mass_leave'];\n\t\t\t// $this->remaining_days_off \t= $post['remaining_days_off'];\n\n\t\t\t$this->db->update('ms_leave_rights', $this, array('id'=>$post['id']));\n\t\t}",
"public function updateRecord() {\n\n // Update the database record\n $sql = \"UPDATE apnews SET title=\\\"\" . $this->story[TITLE] . \"\\\", content=\\\"\" . $this->story[CONTENT] . \"\\\", priority=\\\"\" . $this->story[PRIORITY] . \"\\\", byline=\\\"\" . $this->story[BYLINE] . \"\\\", byline2=\\\"\" . $this->story[BYLINE2] .\"\\\", breaking_story=\\\"\" . $this->story[BREAKING] . \"\\\" WHERE id = \\\"\" . $this->story[ID]. \"\\\"\";\n\n\n $result = $this->_db->query($sql); \n\n // Error check \n if (! DB::isError($result)) {\n\t$this->_buildMarquee();\n\n\t// Build all of the news pages\n\tsystem('/data/stage/utils/go2/build_newsnow_ap.sh > /dev/null');\n\treturn 0;\n\t\n }\n\n return 1;\n \n }",
"public function update_qualification_skill() {\n\t\n\t\tif($this->input->post('type')=='edit_record') {\n\t\t\t\n\t\t$id = $this->uri->segment(3);\n\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'');\n\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = \"The qualification skill field is required.\";\n\t\t}\n\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\n\t\t$data = array(\n\t\t'name' => $this->input->post('name')\n\t\t);\n\t\t\n\t\t$result = $this->Graphene_model->update_qualification_skill_record($data,$id);\t\t\n\t\t\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = 'Qualification Skill updated.';\n\t\t} else {\n\t\t\t$Return['error'] = 'Bug. Something went wrong, please try again.';\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}",
"public function updateWorksDB() { \n $newValues = array();\n $d = new DateTime($this->paypalIPNDataValue['payment_date']);\n $formatted_date = $d->format('Y-m-d');\n $newValues[DatumProperties::getItemKeyFor('works', 'howPaid')] = 'paypal';\n $newValues[DatumProperties::getItemKeyFor('works', 'datePaid')] = $formatted_date; \n $newValues[DatumProperties::getItemKeyFor('works', 'amtPaid')] = $this->paypalIPNDataValue['payment_gross'];\n $newValues[DatumProperties::getItemKeyFor('works', 'checkOrPaypalNumber')] = $this->paypalIPNDataValue['txn_id'];\n $newValues[DatumProperties::getItemKeyFor('works', 'lastModifiedBy')] = 1807; // The automated PayPal IPN Listener \n // updateDBFor($tableName, $currentValueArray, $newValueArray, $whereKeyName, $whereKeyValue, $handleSetsAsStrings=false)\n// SSFQuery::debugNextQuery();\n $this->updateCount = SSFQuery::updateDBFor('works', $this->dbWorkDataValue, $newValues, 'workId', $this->matchingWorkId);\n return $this->updateCount;\n }",
"public function updateEss(Request $request)\n {\n $this->checkPersonAddressRequest($request);\n $this->validate($request, [\n 'companyId' => 'required|exists:companies,id',\n 'employeeId' => 'required|exists:assignments,employee_id'\n ]);\n\n $workflow = $this->workflowDao->getOne(\"PROF\", $request->companyId);\n $data = array();\n\n $req = [\n \"tenant_id\" => $this->requester->getTenantId(),\n \"company_id\" => $this->requester->getCompanyId(),\n \"employee_id\" => $request->employeeId,\n \"crud_type\" => 'U',\n \"person_address_id\" => $request->id,\n \"lov_rsty\" => $request->lovRsty,\n \"lov_rsow\" => $request->lovRsow,\n \"city_code\" => $request->cityCode,\n \"address\" => $request->address,\n \"postal_code\" => $request->postalCode,\n \"phone\" => $request->phone,\n \"fax\" => $request->fax,\n ];\n\n if(!$workflow->isActive) {\n $this->validate($request, ['id' => 'required']);\n\n\t\t\t$req['status'] = 'A';\n\n DB::transaction(function () use (&$request, &$req, &$data) {\n $personAddress = $this->constructPersonAddress($request);\n $this->personAddressDao->update(\n $request->personId,\n $request->id,\n $personAddress\n );\n \n $data['personAddressId'] = $request->id;\n $data['id'] = $this->requestAddressesDao->save($req); \n });\n }\n else {\n\t\t\t$req['status'] = 'P';\n\n DB::transaction(function () use (&$request, &$req, &$data) {\n $data['id'] = $this->requestAddressesDao->save($req); \n });\n }\n\t\t\t \n $resp = new AppResponse(null, trans('messages.dataUpdated'));\n return $this->renderResponse($resp);\n }",
"public function updateBibRecord(Bib $record)\r\n {\r\n }",
"public function update($person);"
] | [
"0.6466247",
"0.6461087",
"0.6430596",
"0.62558746",
"0.62342787",
"0.62342787",
"0.6210514",
"0.61744106",
"0.60954595",
"0.60357964",
"0.60182184",
"0.6017878",
"0.5969467",
"0.59633195",
"0.5953395",
"0.5937396",
"0.59345895",
"0.59291625",
"0.59036225",
"0.58927697",
"0.5891329",
"0.5886674",
"0.5883798",
"0.58835435",
"0.5840542",
"0.58364165",
"0.58342403",
"0.5834024",
"0.5825946",
"0.582286"
] | 0.6861809 | 0 |
Expect view not found | function assertViewNotFound()
{
$this->response->assertStatus(404);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testMissingView() {\n $request = new Request();\n $request->request->set('view_name', 'test_view');\n $request->request->set('view_display_id', 'page_1');\n\n $this->viewStorage->expects($this->once())\n ->method('load')\n ->with('test_view')\n ->will($this->returnValue(FALSE));\n\n $this->expectException(NotFoundHttpException::class);\n $this->viewAjaxController->ajaxView($request);\n }",
"public function testMissingViewName() {\n $request = new Request();\n $this->expectException(NotFoundHttpException::class);\n $this->viewAjaxController->ajaxView($request);\n }",
"public function testFakeViewDoesNotExist() {\n $view = uniqid('view_', TRUE);\n $this->assertArrayNotHasKey(\n $view,\n $this->views['system'],\n \"Failed asserting that view '{$view}' does not exist.\"\n );\n }",
"public function testViewHasContent()\n {\n $this->get('/example/controller/bar')->assertSee('bar');\n }",
"public function testControllerIndexActionWithoutDiceInSession()\n {\n $exp = \"\\Illuminate\\View\\View\";\n $res = $this->controller->index();\n $this->assertInstanceOf($exp, $res);\n }",
"public function testView() {\n\t\t$result = $this->Estimation->view('estimation-1');\n\t\t$this->assertTrue(isset($result['Estimation']));\n\t\t$this->assertEqual($result['Estimation']['id'], 'estimation-1');\n\n\t\ttry {\n\t\t\t$result = $this->Estimation->view('wrong_id');\n\t\t\t$this->fail('No exception on wrong id');\n\t\t} catch (OutOfBoundsException $e) {\n\t\t\t$this->pass('Correct exception thrown');\n\t\t}\n\t}",
"public function testViewNonExistedSeatmap()\n {\n $response = $this->get('/seat-map/4526');\n $response->assertStatus(404);\n }",
"public function testControllerIndexAction()\n {\n $this->withSession(['adventure' => new TreasureAdventure()]);\n $exp = \"\\Illuminate\\View\\View\";\n $res = $this->controller->index();\n $this->assertInstanceOf($exp, $res);\n }",
"function missingView()\n {\n //We are simulating action call below, this is not a filename!\n $this->autoLayout = true;\n $this->missingView = $this->name;\n $this->pageTitle = 'Missing View';\n $this->render('../errors/missingView');\n }",
"public function testLoadView()\n {\n $this->visit('auth/login')\n ->see('BIENVENIDO')\n ->see('2015. TODOS LOS DERECHOS RESERVADOS');\n\n $this->assertResponseOk();\n }",
"public function test_index_returns_a_view()\n {\n $user = factory(User::class)->create();\n\n $response = $this->actingAs($user)->get(route('movies.index'));\n\n $response->assertStatus(200);\n\n $response->assertViewIs('movies.index');\n }",
"function founderror404ifnotfound()\n {\n $response = $this->get('/usuario/9999');\n $response->assertStatus(404);\n $response->assertSee(\"Pagina no encontrada\");\n }",
"public function viewNotFound() {\n HttpHeader::set(404, false);\n\n throw new View\\Exception\\ViewNotFoundException(\n 'The view \"' . $this->getPath() . '\" was not found.'\n );\n }",
"public function testIndexActionFail()\n {\n $res = $this->controller->indexActionGet();\n $res = $res->getBody();\n $this->assertNull($res);\n }",
"public function testNotFound() {\n\n\t\tob_start();\n\t\t$this->controller->notFound();\n\t\t$output = ob_get_clean();\n\n\t\t$this->assertTrue($this->didFindString($output, 'amt-notfound'));\n\n\t}",
"public function test_view_route_not_logged_in(){\n // create a course\n $course = $this->getDataGenerator()->create_course();\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n $client = new Client($this->_app);\n $client->request('GET', \"/\" . $videoquanda->id);\n $this->assertEquals(500, $client->getResponse()->getStatusCode());\n\n }",
"public function testGetView()\n {\n $this->assertInstanceOf(Twig::class, $this->getView());\n }",
"public function testAccessDeniedView() {\n $request = new Request();\n $request->request->set('view_name', 'test_view');\n $request->request->set('view_display_id', 'page_1');\n\n $view = $this->getMockBuilder('Drupal\\views\\Entity\\View')\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->viewStorage->expects($this->once())\n ->method('load')\n ->with('test_view')\n ->will($this->returnValue($view));\n\n $executable = $this->getMockBuilder('Drupal\\views\\ViewExecutable')\n ->disableOriginalConstructor()\n ->getMock();\n $executable->expects($this->once())\n ->method('access')\n ->will($this->returnValue(FALSE));\n\n $this->executableFactory->expects($this->once())\n ->method('get')\n ->with($view)\n ->will($this->returnValue($executable));\n\n $this->expectException(AccessDeniedHttpException::class);\n $this->viewAjaxController->ajaxView($request);\n }",
"public function testGetJsonView() {\n\t\t$result = $this->testAction(Router::url(array('controller' => 'Scribbles', 'action' => 'view', '1234567.json')), array('method' => 'get', 'return' => 'contents'));\n\t\t$this->assertFalse(strpos($result, 'I am a Scribble!'), 'JSON response should not contain the Scribble requested.');\n\t}",
"public function test_404_page_does_not_show_login()\n {\n // if our custom, middleware-loaded handler fails but this is here\n // as a reminder and as a general check in the event of other issues.\n $editor = $this->users->editor();\n $editor->name = 'tester';\n $editor->save();\n\n $this->actingAs($editor);\n $notFound = $this->get('/fgfdngldfnotfound');\n $notFound->assertStatus(404);\n $notFound->assertDontSeeText('Log in');\n $notFound->assertSeeText('tester');\n }",
"private function testDisplayRequestedPage(){\n $this->url = 'homeadmin';\n $this->dispatcher->displayRequestedPage($this->url);\n if(!assert($this->dispatcher->getHtml() === file_get_contents('../../view/src/admin/home.template.html'))){\n parent::addError(\"testDisplayRequestedPage failed!\");\n }\n }",
"public function testAllViewsExists() {\n $views = $this->views['test'];\n foreach ($views as $view => $config) {\n try {\n $this->assertArrayHasKey(\n $view,\n $this->views['system'],\n \"Failed asserting that {$view} view is in the system.\"\n );\n }\n catch (Exception $e) {\n $this->handleAssertException($e);\n }\n }\n // Verify if all views passed the test.\n $this->checkAllAssertionsPassedWholeTest();\n }",
"public function test_non_existent_route() {\n $client = new Client($this->_app);\n $client->request('GET', '/addvideo/does_not_exist');\n\n $this->assertEquals(404, $client->getResponse()->getStatusCode());\n $this->assertContains('No route found for "GET /addvideo/does_not_exist"', $client->getResponse()->getContent());\n }",
"public function page_missing()\n {\n $this->loadView('errors/html/error_404');\n }",
"public function testIndexNoUser()\n {\n $response = $this->get('/welcome');\n\n $response->assertStatus(200)\n ->assertSee(\"Welcome to this ToDo application!\");\n }",
"public function testit_visit_page_of_login()\n {\n $this->get('/')\n ->assertStatus(500)\n ->assertSee('Login');\n }",
"function Usuario_no_encontrado()\n\n{ \n \n $this->get('/usuarios/1000')\n ->assertStatus(404)\n ->assertSee('USUARIO NO ENCONTRADO');\n}",
"public function testView()\n\t{\n\t\t$alert = $this->em->getRepository('WsEventsBundle:Alert')->findOneByEmail('[email protected]');\n\t\t$id = $alert->getId();\n\n\t\t$crawler = $this->client->request('GET',$this->router->generate('ws_alerts_view',array('alert'=>$id)));\t\t\t\t\t\n\t\t$this->assertTrue($crawler->filter('.list-table tr')->count() > 0);\n\t}",
"public function testWelcome()\n {\n $response = $this->get('/');\n $response->assertStatus(200);\n $response->assertViewIs('welcome');\n }",
"public function testViewAccess()\n\t{\n\t\tforeach ($this->views as $key => $name)\n\t\t{\n\t\t\t$this->assertSame( $name, $this->definition->view( $key ) );\n\t\t}\n\t}"
] | [
"0.7687115",
"0.76016563",
"0.7327316",
"0.72523636",
"0.71873933",
"0.70716673",
"0.7023967",
"0.6984003",
"0.698083",
"0.69104517",
"0.6788702",
"0.6753853",
"0.67515224",
"0.67408216",
"0.6648884",
"0.6636498",
"0.6605663",
"0.6603895",
"0.65972257",
"0.652549",
"0.6523186",
"0.6514707",
"0.6481636",
"0.64788073",
"0.6474941",
"0.6465363",
"0.6464556",
"0.64513844",
"0.6436335",
"0.64331913"
] | 0.8229229 | 0 |
Expect not having permission | function assertAccessDeny()
{
$this->response->assertStatus(403);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testCheckPermission()\n {\n // test no exception has occured\n $flag = false;\n try {\n $this->sharedFixture['session']->checkPermission('/tests_general_base', 'read');\n } catch (\\PHPCR\\Security\\AccessControlException $ex) {\n $flag = true;\n }\n $this->assertFalse($flag);\n\n $flag = false;\n try {\n $this->sharedFixture['session']->checkPermission('/tests_general_base/numberPropertyNode/jcr:content/foo', 'read');\n } catch (\\PHPCR\\Security\\AccessControlException $ex) {\n $flag = true;\n }\n $this->assertFalse($flag);\n }",
"private function _check_permissions() {\n \n }",
"public function test_it_cant_access_if_not_authorized() {\n $response = $this->actingAs(factory(User::class)->create())->get('/events');\n $response->assertStatus(403);\n }",
"public function testPermissionsUnauthorised()\n {\n $mock = new HTTP_Request2_Adapter_Mock();\n $mock->addResponse(fopen(__DIR__ . '/responses/capabilities.xml', 'rb'));\n $mock->addResponse(\n fopen(__DIR__ . '/responses/permissionsUnauthorised.xml', 'rb')\n );\n $config = [\n 'adapter' => $mock,\n 'server' => 'http://api.openstreetmap.org/',\n 'user' => '[email protected]',\n 'password' => 'wilmaAevah'\n ];\n\n $osm = new Services_OpenStreetMap($config);\n $permissions = $osm->getPermissions();\n $expected = [];\n $this->assertEquals($permissions, $expected);\n }",
"public function testAccessDeleteNoPermission()\n {\n $user = \\App\\User::where('permission', 0)->first();\n $response = $this->actingAs($user)->post('/users/edit', [\n 'username' => 'New name',\n ]);\n $response->assertStatus(403);\n }",
"public function withoutRequiredPermissions();",
"function check_permissions() {\n\n\n\n }",
"private function check_access()\n {\n }",
"private function checkForbidden(){\n\n }",
"public function test_deny_access()\n {\n //$sessionManager = new \\Styde\\SessionManager($sessionFileDriver);\n //$auth = new \\Styde\\Authenticator($sessionManager);\n $authStub = new \\Styde\\Stubs\\AuthenticatorStub();\n $access = new Access($authStub);\n $this->assertFalse($access->check('sub-admin'));\n }",
"abstract public function deny();",
"public function test_deny_access()\n {\n $auth = new AuthStub();\n \n //composer require mockery/mockery --dev\n \n \n //$access =new Access($auth);\n $access =new Access($this->getAuthMock());\n \n $this->assertFalse(\n //Access::check('editor') \n $access->check('editor')\n );\n }",
"public function test_acl_not_logged_in_with_access_rule_is_false()\n\t{\n\t\t$this->assertFalse(Bouncer::acl($this->acl, 'edit'));\n\t}",
"public function assertAccessDenied() {\n $this->assertSession()->statusCodeEquals(403);\n }",
"public function noPerm(){\n \n }",
"public function checkAccess() { return true; }",
"protected function assertAllowed() {}",
"public function testAccessListOfBuildingWithAuthenticatedUserNonAccess()\n {\n $notAuthenticatedUser = \\App\\Models\\User::where('email', '[email protected]')->first();\n\n $response = $this->actingAs($notAuthenticatedUser, 'api')\n ->getJson('/building', ['Content-Type' => 'application/json']);\n\n $response->assertStatus(403)\n ->assertJson(['success' => false, 'desc' => 'User does not have the right permissions.']);\n }",
"public function testIfNoAccess() {\n CakeSession::delete('Auth');\n $group_id = '1';\n $group_name = 'testgroup';\n CakeSession::write('Auth.User.id', '1'); \n CakeSession::write('Auth.User.username', 'testuser'); \n CakeSession::write('Auth.User.email', '[email protected]'); \n CakeSession::write('Auth.User.Group.0', \n array(\n 'id' => $group_id,\n 'name' => $group_name,\n ));\n\n $result = $this->testAction('/pwede/dummy',\n array('method' => 'get', 'return' => 'contents')\n );\n\n $this->assertContains('You are not authorized to access that location',CakeSession::read('Message.auth.message'));\n $this->assertNull($result);\n }",
"public function test_acl_no_access_rule_is_true()\n\t{\n\t\t$this->assertTrue(Bouncer::acl($this->acl, 'index'));\n\t}",
"public function checkPermission()\n\t{\n\t\t$this->checkIaoModulePermission('tl_iao_reminder');\n\t}",
"public function test403Peek()\n {\n $user = $this->randomEntrant();\n\n $other = $this->createFactoryUser();\n\n $response = $this->requestToApi(\n $user, 'GET', '/users/'. $other->id .'/alerts'\n );\n\n $response->assertStatus(403);\n }",
"public function deniesPermission()\n {\n return ($this->getPermission() < 0);\n }",
"function sendUnauthorizedAccess() {\n Tools::sendUnauthorizedAccess();\n}",
"public function providerTestAllowedIfHasPermissions() {\n $access_result = AccessResult::allowedIf(FALSE);\n $data[] = [[], 'AND', $access_result];\n $data[] = [[], 'OR', $access_result];\n\n $access_result = AccessResult::allowedIf(TRUE);\n $data[] = [['allowed'], 'OR', $access_result];\n $data[] = [['allowed'], 'AND', $access_result];\n\n $access_result = AccessResult::allowedIf(FALSE);\n $access_result->setReason(\"The 'denied' permission is required.\");\n $data[] = [['denied'], 'OR', $access_result];\n $data[] = [['denied'], 'AND', $access_result];\n\n $access_result = AccessResult::allowedIf(TRUE);\n $data[] = [['allowed', 'denied'], 'OR', $access_result];\n $data[] = [['denied', 'allowed'], 'OR', $access_result];\n\n $access_result = AccessResult::allowedIf(TRUE);\n $data[] = [['allowed', 'denied', 'other'], 'OR', $access_result];\n\n $access_result = AccessResult::allowedIf(FALSE);\n $access_result->setReason(\"The following permissions are required: 'allowed' AND 'denied'.\");\n $data[] = [['allowed', 'denied'], 'AND', $access_result];\n\n return $data;\n }",
"public function hasAccess();",
"public function has_any_rights_in_module();",
"public function isAllowed();",
"public function checkPermission()\n {\n $this->checkIaoModulePermission('tl_iao_reminder');\n }",
"public function havesPermission();"
] | [
"0.72012794",
"0.7149804",
"0.70616674",
"0.70318496",
"0.69813955",
"0.69742167",
"0.6804893",
"0.67416847",
"0.6725242",
"0.6723853",
"0.66118413",
"0.660708",
"0.6591735",
"0.65456295",
"0.6545575",
"0.6529024",
"0.6516958",
"0.65161675",
"0.64426965",
"0.640044",
"0.63837105",
"0.63815546",
"0.63749635",
"0.6354875",
"0.6353641",
"0.6347288",
"0.6329019",
"0.6323136",
"0.63155574",
"0.63016397"
] | 0.7188035 | 1 |
Check if MySQL based database supports utf8mb4 character set. | protected function databaseSupportsUtf8Mb4(string $databaseVersion): bool
{
if (strpos($databaseVersion, '-MariaDb') !== false &&
version_compare($databaseVersion, self::MINIMUM_MARIA_DB_VERSION) === -1
) {
return false;
}
if (preg_match('([a-zA-Z])', $databaseVersion) === 0 &&
version_compare($databaseVersion, self::MINIMUM_MYSQL_VERSION) === -1
) {
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function shouldSetCharset(): bool\n {\n if (DB::getDriverName() !== Driver::MYSQL()->getValue()) {\n return false;\n }\n\n return $this->setting->isUseDBCollation();\n }",
"public function getSchemaCharset();",
"function is_utf8_mb($string) {\n return preg_match('%^(?:\n [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\n | \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\n | [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\n | \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\n | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\n | [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\n | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\n )*$%xs', $string);\n\n}",
"public function setConnectionCollationUnicode()\n {\n list($v_upper, $v_major, $v_minor) = explode('.', $this->getVersion());\n if ( ($v_upper >= 5) || ($v_upper >= 4 && $v_major >= 1) ) {\n $this->query(\"SET character_set_client = utf8\");\n $this->query(\"SET character_set_results = utf8\");\n $this->query(\"SET character_set_connection = utf8\");\n #$this->query(\"SET names = utf8\");\n }\n return true;\n }",
"public function isUtf8();",
"public function isUtf8()\n\t{\n\t\treturn strtoupper($this->getMail()->getCharset())=='UTF-8';\n\t}",
"function is_mb_string($string) {\n return mb_strlen($string,'utf-8') !== strlen($string);\n }",
"public function getMysqlEncoding()\r\n {\r\n return $this->mysqlEncoding;\r\n }",
"protected function getMySqlCharacterSets() {\n\t\t$characterSets = '';\n\n\t\t$res = $GLOBALS['TYPO3_DB']->sql_query('SHOW VARIABLES LIKE \"character_set_%\";');\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t$characterSets[$row['Variable_name']] = $row['Value'];\n\t\t}\n\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res);\n\n\t\treturn $characterSets;\n\t}",
"public function isUtf8()\n\t{\n\t\treturn strtolower($this->getMail()->getCharset())=='utf-8';\n\t}",
"function get_charset(){ \n return mysqli_character_set_name($this->connection); \n }",
"public function setEncoding()\r\n {\r\n $driver = $this->pdo->getAttribute(\\PDO::ATTR_DRIVER_NAME );\r\n $version = floatval( $this->pdo->getAttribute(\\PDO::ATTR_SERVER_VERSION ) );\r\n\r\n if ( $driver === 'mysql' ) {\r\n $encoding = ($version >= 5.5) ? 'utf8mb4' : 'utf8';\r\n $this->pdo->setAttribute(\\PDO::MYSQL_ATTR_INIT_COMMAND, 'SET NAMES '.$encoding ); //on every re-connect\r\n $this->pdo->exec(' SET NAMES '. $encoding); //also for current connection\r\n $this->mysqlEncoding = $encoding;\r\n }\r\n }",
"static function seems_utf8($str) {\n return mb_check_encoding($str, \"UTF-8\");\n }",
"public function getDbCharset()\n {\n return $this->dbCharset;\n }",
"public static function isUtf8($string)\n {\n return mb_detect_encoding($string, 'UTF-8', true); \n\t/*\n\t$flag = false;\n // From http://w3.org/International/questions/qa-forms-utf-8.html\n if (!empty($string) and gettype($string) == 'string') {\n $flag = (preg_match('%^(?: \n\t\t [\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII \n\t\t | [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte \n\t\t | \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs \n\t\t | [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte \n\t\t | \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates \n\t\t | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3 \n\t\t | [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15 \n\t\t | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16 \n\t\t )*$%xs', $string) == 1) ? true : false;\n \n \n } \n return $flag;\n\t*/\n }",
"public static function is_utf8($str)\r\n\t{\r\n\t\treturn preg_match('%^(?:[\\x09\\x0A\\x0D\\x20-\\x7E]'.\t// ASCII\r\n\t\t\t'| [\\xC2-\\xDF][\\x80-\\xBF]'.\t\t\t\t//non-overlong 2-byte\r\n\t\t\t'| \\xE0[\\xA0-\\xBF][\\x80-\\xBF]'.\t\t\t//excluding overlongs\r\n\t\t\t'| [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}'.\t//straight 3-byte\r\n\t\t\t'| \\xED[\\x80-\\x9F][\\x80-\\xBF]'.\t\t\t//excluding surrogates\r\n\t\t\t'| \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2}'.\t\t//planes 1-3\r\n\t\t\t'| [\\xF1-\\xF3][\\x80-\\xBF]{3}'.\t\t\t//planes 4-15\r\n\t\t\t'| \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2}'.\t\t//plane 16\r\n\t\t\t')*$%xs', $str);\r\n\t}",
"private function _getCharset()\n {\n $charsetCollate = '';\n \n if (version_compare(mysql_get_server_info(), '4.1.0', '>=')) {\n if (!empty($wpdb->charset)) {\n $charsetCollate = \"DEFAULT CHARACTER SET $wpdb->charset\";\n }\n \n if (!empty($wpdb->collate)) {\n $charsetCollate.= \" COLLATE $wpdb->collate\";\n }\n }\n \n return $charsetCollate;\n }",
"function CharacterSet($table, $db) {\n\t$sql=\"SELECT TABLE_COLLATION\n\t\tFROM information_schema.tables\n\t\tWHERE TABLE_SCHEMA='\".$_SESSION['DatabaseName'].\"'\n\t\t\tAND TABLE_NAME='\".$table.\"'\";\n\t$result=DB_query($sql, $db);\n\t$myrow=DB_fetch_array($result);\n\treturn $myrow['TABLE_COLLATION'];\n}",
"public static function detect_encoding($string) {\r\n if( preg_match(\"/^\\xEF\\xBB\\xBF/\",$string)) return 'UTF-8 BOM';\r\n if( preg_match(\"//u\", $string)) { \r\n //valid UTF-8\r\n if( preg_match(\"/[\\xf0-\\xf7][\\x80-\\xbf][\\x80-\\xbf][\\x80-\\xbf]/\",$string)) return 'UTF-8mb4';\r\n if( preg_match(\"/[\\xe0-\\xef][\\x80-\\xbf][\\x80-\\xbf]/\",$string)) return 'UTF-8mb3';\r\n if( preg_match(\"/[\\x80-\\xff]/\",$string)) return 'UTF-8';\r\n return 'ASCII';\r\n } else {\r\n if(preg_match(\"/[\\x7f-\\x9f]/\",$string)) {\r\n //kein ISO/IEC 8859-1\r\n if(preg_match(\"/[\\x81\\x8d\\x90\\x9d]/\",$string)) {\r\n //kein CP1252\r\n return \"\";\r\n }\r\n return 'CP1252';\r\n }\r\n return 'ISO-8859-1';\r\n }\r\n //return false;\r\n }",
"public function getTableCharset();",
"protected function detect_encoding($str) {\r\n return mb_detect_encoding($str, 'UTF-8,ISO-8859-15,ISO-8859-1,cp1251,KOI8-R');\r\n }",
"static function support_multibyte() {\r\n \t$options = self::get_options();\r\n \tif ($options['support_multibyte']=='1' && function_exists('mb_strtolower')) {\r\n \t\treturn TRUE;\r\n \t}\r\n \telse {\r\n \t\treturn FALSE;\r\n \t}\r\n }",
"public function _test_detect_cp1552()\n {\n $this->assertCharsetIs('Windows-1252', 'Bübeli auf dem Schoß für ~3 €', 'Windows-1252');\n }",
"public static function detect_utf_encoding($string)\n {\n define('UTF32_BIG_ENDIAN_BOM', chr(0x00) . chr(0x00) . chr(0xFE) . chr(0xFF));\n define('UTF32_LITTLE_ENDIAN_BOM', chr(0xFF) . chr(0xFE) . chr(0x00) . chr(0x00));\n define('UTF16_BIG_ENDIAN_BOM', chr(0xFE) . chr(0xFF));\n define('UTF16_LITTLE_ENDIAN_BOM', chr(0xFF) . chr(0xFE));\n define('UTF8_BOM', chr(0xEF) . chr(0xBB) . chr(0xBF));\n \n $text = $string;\n $first2 = substr($text, 0, 2);\n $first3 = substr($text, 0, 3);\n $first4 = substr($text, 0, 3);\n \n if ($first3 == UTF8_BOM) {\n return 'UTF-8';\n } elseif ($first4 == UTF32_BIG_ENDIAN_BOM) {\n return 'UTF-32BE';\n } elseif ($first4 == UTF32_LITTLE_ENDIAN_BOM) {\n return 'UTF-32LE';\n } elseif ($first2 == UTF16_BIG_ENDIAN_BOM) {\n return 'UTF-16BE';\n } elseif ($first2 == UTF16_LITTLE_ENDIAN_BOM) {\n return 'UTF-16LE';\n }\n }",
"public static function detectUtf8($string)\n {\n return (mb_detect_encoding($string, 'UTF-8', true) === 'UTF-8') ? true : false;\n }",
"protected function is_utf8($string)\n {\n if (mb_detect_encoding($string, \"UTF-8\", true) == \"UTF-8\") {\n return 1;\n }\n return 0;\n }",
"function is_utf8($string) {\n // From http://w3.org/International/questions/qa-forms-utf-8.html\n return preg_match('%^(?:\n [\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII\n | [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\n | \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\n | [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\n | \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\n | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\n | [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\n | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\n )*$%xs', $string);\n\n}",
"private static function isConfigCharsetValid($type)\n {\n if (!in_array($type, ['utf8'])) {\n return FALSE;\n }\n\n return TRUE;\n }",
"public function hasUTFSupport()\n\t{\n\t\treturn $this->utf;\n\t}",
"public function hasUTF()\n\t{\n\t\treturn $this->utf;\n\t}"
] | [
"0.69857866",
"0.61442995",
"0.5977253",
"0.58720994",
"0.5847986",
"0.5800206",
"0.5736183",
"0.5733929",
"0.57320523",
"0.5709753",
"0.56962895",
"0.5695837",
"0.56760705",
"0.5629213",
"0.5613073",
"0.56112003",
"0.56031275",
"0.5597726",
"0.5586581",
"0.5540811",
"0.55368626",
"0.55250996",
"0.55046403",
"0.54829574",
"0.54805934",
"0.5465873",
"0.5465579",
"0.5439116",
"0.54303527",
"0.54152536"
] | 0.6178385 | 1 |
Assigns pending product changes to a specified product publish set. Use the code field to specify the product publish set. | public function assignProductsToPublishSet($publishSet, $responseFields = null)
{
$mozuClient = PublishingScopeClient::assignProductsToPublishSetClient($publishSet, $responseFields);
$mozuClient = $mozuClient->withContext($this->apiContext);
$mozuClient->execute();
return $mozuClient->getResult();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function assignProductsToPublishSetAsync($publishSet, $responseFields = null)\r\n\t{\r\n\t\t$mozuClient = PublishingScopeClient::assignProductsToPublishSetClient($publishSet, $responseFields);\r\n\t\t$mozuClient = $mozuClient->withContext($this->apiContext);\r\n\t\treturn $mozuClient->executeAsync();\r\n\r\n\t}",
"private function updateProductSetQty() {\n $productsets = Product::where('is_set', '=', 1)->get();\n\n foreach ($productsets as $set) {\n $i = 1;\n $set_qty = 0;\n foreach ($set->sets($set->id) as $product) {\n $qty = $product->product->qty;\n if ($i == 1)\n $set_qty = $qty;\n\n if ($set_qty > $qty) {\n $set_qty = $qty;\n }\n $i++;\n }\n\n $set->qty = $set_qty;\n $set->save();\n }\n }",
"public function assignProducts($id, array $products);",
"public function actionBulkSetAsPending()\n\t{\n\t\tif ( Yii::$app->request->post('selection') )\n\t\t{\n\t\t\t$modelClass = $this->modelClass;\n\n\t\t\t$modelClass::updateAll(\n\t\t\t\t['status'=>Feedback::STATUS_PENDING],\n\t\t\t\t['id'=>Yii::$app->request->post('selection', [])]\n\t\t\t);\n\t\t}\n\t}",
"public function set_pending(){\r\n\t\t\r\n\t\t/* Get arguments */\r\n\t\t$args = $this->_args;\r\n\t\tif (empty($args)){\r\n\t\t\treturn $this->_redirect('/'.strtolower($this->_getType('plural')));\r\n\t\t}\r\n\t\t\r\n\t\t/* Set status */\r\n\t\t$itemId = array_shift($args);\r\n\t\t$itemsModel = $this->getModel('newitems');\r\n\t\t$success = $itemsModel->setStatus($itemId, false);\r\n\t\t\r\n\t\t/* Message */\r\n\t\tif ($success){\r\n\t\t\tMessages::addMessage($this->_getType('singular').' #'.$itemId.' set to \"<code>pending</code>\"');\r\n\t\t} else {\r\n\t\t\tMessages::addMessage($this->_getType('singular').' #'.$itemId.' was not changed.', 'error');\r\n\t\t}\r\n\t\t\r\n\t\t/* Redirect to details page */\r\n\t\treturn $this->_redirect('/'.strtolower($this->_getType('plural')).'/details/'.$itemId);\r\n\t\t\r\n\t}",
"public function publish() {\n if (!$this->active) {\n $this->apply(\n new ProductPublishedEvent($this->productId)\n );\n }\n }",
"private function publish()\n {\n $product = dispatch_now(new GetProductTask($this->data['slug']));\n if(!$product) return false;\n\n if($product->status != Product::STATUS['approve']){\n $product->status = Product::STATUS['publish'];\n $product->save();\n }\n return true;\n }",
"function saveAssignmentBasedOnChangeSet($change_set_id, $posts) {\n\t\n\tif (0) deb(\"change_sets_utils:saveAssignmentBasedOnChangeSet() posts = \", $posts);\n\n\t// Get ids of confirmed changes from $posts into a query string\n\t$ok_changes_array = array();\n\t$ok_change_value = $posts['ok_change_value'];\n\tunset($posts['ok_change_value']);\n\tif (0) deb(\"change_sets_utils:saveAssignmentBasedOnChangeSet() posts = \", $posts);\n\tforeach($posts as $i=>$post) {\n\t\tif ($post == $ok_change_value) {\n\t\t\t$ok_changes_array[] = $i;\n\t\t}\n\t}\n\t$ok_changes_string = implode(\", \", $ok_changes_array);\n\tif (0) deb(\"change_sets_utils:saveAssignmentBasedOnChangeSet() ok_changes_string = \", $ok_changes_string);\n\t\n\t// If there are ok changes in the change set, save them in the database\n\tif ($ok_changes_string) {\n\t\t\n\t\t// Delete the not-ok changes from this change set\n\t\tsqlDelete(CHANGES_TABLE, \"change_set_id = {$change_set_id} and not id in ({$ok_changes_string})\");\n\n\t\t// Set the change timestamp for this change set to now\n\t\t$when_saved = date(\"Y/m/d H:i:s\");\n\t\tsqlUpdate(CHANGE_SETS_TABLE, \"when_saved = '{$when_saved}'\", \"id = {$change_set_id}\");\n\n\t\t// Store the confirmed changes in the assignments table\n\t\t$select = \"c.*, s.scheduler_run_id\";\n\t\t$from = CHANGES_TABLE . \" as c, \" . CHANGE_SETS_TABLE . \" as s\"; \n\t\t$where = \"s.id = {$change_set_id} \n\t\t\tand c.change_set_id = s.id\n\t\t\tand c.id in ({$ok_changes_string})\";\n\t\t$changes = sqlSelect($select, $from, $where, \"\", (0), \"changed assignments to save\");\n\t\tforeach ($changes as $i=>$change) {\n\t\t\tif (0) deb(\"change_sets_utils:saveAssignmentBasedOnChangeSet() change = \", $change);\t\t\t\n\t\t\tsaveAssignmentBasedOnChange($change);\n\t\t}\t\n\t} \n\t// If the change set contains no ok changes, delete it \n\telse \n\t{\n\t\tsqlDelete(CHANGE_SETS_TABLE, \"id = {$change_set_id}\", (0));\n\t}\n}",
"function testChangeProductAmount() {\n\t \n\t $this->loginAs('admin');\n\t $productA = $this->objFromFixture('Product', 'productA');\n\t $productID = $productA->ID; \n\t \n\t //Publish\n\t $productA->doPublish();\n\t $this->assertTrue($productA->isPublished());\n\n\t $versions = DB::query('SELECT * FROM \"Product_versions\" WHERE \"RecordID\" = ' . $productID);\n\t $versionsAfterPublished = array();\n\t foreach ($versions as $versionRow) $versionsAfterPublished[] = $versionRow;\n\n\t $originalAmount = $productA->Amount;\n\t \n\t $newAmount = new Money();\n\t $newAmount->setAmount($originalAmount->getAmount() + 50);\n\t $newAmount->setCurrency($originalAmount->getCurrency());\n\t \n\t $this->assertTrue($newAmount->Amount != $originalAmount->Amount);\n\t \n //Update price and publish\n\t $productA->Amount = $newAmount;\n\t $productA->doPublish();\n\n\t $versions = DB::query('SELECT * FROM \"Product_versions\" WHERE \"RecordID\" = ' . $productID);\n\t $versionsAfterPriceChange = array();\n\t foreach ($versions as $versionRow) $versionsAfterPriceChange[] = $versionRow;\n\n\t $this->assertTrue(count($versionsAfterPublished) + 1 == count($versionsAfterPriceChange));\n\t $this->assertEquals($versionsAfterPriceChange[2]['AmountAmount'], $newAmount->getAmount());\n\t}",
"public function set_product() {\n\t\t$this->product->set_props(\n\t\t\t[\n\t\t\t\t// Default WooCommerce props\n\t\t\t\t'name' => $this->plato_project->get_name(),\n\t\t\t\t'slug' => $this->get_slug(),\n\t\t\t\t'category_ids' => $this->get_category_ids(),\n\t\t\t\t'attributes' => $this->get_attributes(),\n\t\t\t\t'sku' => $this->plato_project->get_code(),\n\t\t\t\t'status' => $this->get_status(),\n\t\t\t\t'image_id' => $this->get_image_id(),\n\n\t\t\t\t// Extra props\n\t\t\t\t'checksum' => $this->plato_project->get_checksum(),\n\t\t\t\t'project_id' => $this->plato_project->get_project_id(),\n\t\t\t\t'latitude' => $this->plato_project->get_lat_project(),\n\t\t\t\t'longitude' => $this->plato_project->get_lng_project(),\n\t\t\t\t'start_date' => $this->plato_project->get_start_date(),\n\t\t\t\t'end_date' => $this->plato_project->get_end_date(),\n\t\t\t\t'min_age' => $this->plato_project->get_min_age(),\n\t\t\t\t'max_age' => $this->plato_project->get_max_age(),\n\t\t\t\t'participation_fee_currency' => $this->plato_project->get_participation_fee_currency(),\n\t\t\t\t'participation_fee' => $this->plato_project->get_participation_fee(),\n\t\t\t\t'project_description' => $this->get_project_description(),\n\t\t\t]\n\t\t);\n\t\t$this->product->save();\n\t}",
"public function assignupprdAction()\n {\n \n $this->loadLayout();\n $this->renderLayout();\n\n $productIds = $this->getRequest()->getParam('product');\n $storeId = Mage::app()->getStore()->getId();\n\n if(!is_array($productIds)) \n {\n Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select product(s).'));\n }\n\n else\n {\n\n foreach ($productIds as $productId) \n {\n\n $product = Mage::getModel('catalog/product')->load($productId);\n $targetprodid = $this->getRequest()->getPost('assignupprd');\n $targetproduct = Mage::getModel('catalog/product')->load($targetprodid);\n $param = array();\n $upsells = $targetproduct->getUpSellProducts();\n foreach ($upsells as $item) \n {\n $param[$item->getId()] = array('position' => $item->getPosition());\n }\n\n if (!isset($param[$productId]))\n { \n $param[$productId]= array(\n 'position'=>$productId\n );\n }\n\n try\n { \n\n $targetproduct->setUpSellLinkData($param);\n $targetproduct->save();\n }\n catch(Exception $e)\n {\n \n Mage::getSingleton('core/session')->addError($e->getMessage());\n $this->_redirect('*/catalog_product/index');\n return false;\n } \n \n } \n\n $this->_redirect('*/catalog_product/index');\n Mage::getSingleton('core/session')->addSuccess('The Action have been completed successfully.'); \n Mage::app()->cleanCache(); \n\n }\n\n }",
"public function assignProduct(...$products)\n {\n if ($this->isComposite()) {\n $products = collect($products)->flatten()->map(function ($product) {\n return $this->getStoredProduct($product);\n })->all();\n\n $this->products()->saveMany($products);\n }\n\n return $this;\n }",
"public function addProductSyncData(&$products);",
"private function bulkUpdateProductLanguage(){\n $this->aq = new ArchiveQuery($this->entityQuery);\n $all_products = $this->aq->getProducts();\n $products = $this->entityTypeManager->getStorage('node')->loadMultiple($all_products);\n $count = 0;\n foreach ($products as $key => $product) {\n $lang_code = $product->get('langcode')->value;\n if ($lang_code !== 'zxx'){\n $count++;\n $product->set('langcode', 'zxx');\n if ($count < 50){\n //$product->save();\n }\n }\n }\n if ($count){\n kint($count, 'Prodotti modificati'); \n } else {\n kint('Tutti a posto');\n }\n \n\n // Test su un prodotto\n // $test = $this->entityTypeManager->getStorage('node')->load(1538);\n // $lang_code = $test->get('langcode')->value;\n // if ($lang_code !== 'zxx'){\n // $test->set('langcode', 'zxx');\n // $test->save();\n // }\n // kint($test->get('langcode')->value,'update');\n }",
"public function save_product_post_data( $product ) {\n if ( 'yes' === get_user_meta( dokan_get_current_user_id(), 'dokan_publishing', true ) ) {\n return $product;\n }\n //update product status to pending-review if set by admin\n if ( 'on' === dokan_get_option( 'edited_product_status', 'dokan_selling' ) ) {\n $product['post_status'] = 'pending';\n\n return $product;\n }\n\n return $product;\n }",
"function assignAvailableProduct($product) {\n\t\t\t$helper = $this->getWarehouseHelper( );\n\t\t\t$productPriceHelper = $helper->getProductPriceHelper( );\n\t\t\t$stockStatus = $this->getCatalogInventoryHelper( )->getStockStatusSingleton( );\n\n\t\t\tif (( !$this->getId( ) || !$this->getProductId( ) )) {\n\t\t\t\t$this->loadAvailableByProduct( $product );\n\n\t\t\t\tif (!$this->getId( )) {\n\t\t\t\t\t$this->addData( $this->getDefaultData( ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->setProduct( $product );\n\t\t\t$product->setStockItem( $this );\n\t\t\t$product->setIsInStock( $this->getIsInStock( ) );\n\t\t\t$stockStatus->assignProduct( $product, $this->getStockId( ), $this->getStockStatus( ) );\n\t\t\t$productPriceHelper->applyPrice( $product );\n\t\t\treturn $this;\n\t\t}",
"public function assignProductList()\n {\n }",
"public function setProductNotification($params)\r\n\t{\r\n\t\t$this->oRecoParam = new NotifyPrediggoParam();\r\n\t\t$this->oRecoParam->setNotificationId($params['notificationId']);\r\n\r\n\t\t$this->setNotification($params, 'notifyPrediggo');\r\n\t}",
"protected function latestPostProcessing($products) \r\n\t{\r\n\t\t// get the prices seperately but maintain order to combine the results\r\n\t\t$prices = $this->services->getCrawler()->filter('#product-list .description')->each(function ($node, $i) {\r\n\r\n\t\t\t// create a new crawler for the product html and create a new entity for it\r\n\t\t\t$description = new Crawler($node);\r\n\r\n\t\t\t$price = explode('£', $description->filter('span.price')->text());\r\n\t\t\t$price = str_replace(',', '', end($price));\r\n\r\n\t\t\treturn $price;\r\n\t\t});\r\n\r\n\t\t// combine prices and products\r\n\t\tfor ($i=0; $i < count($prices); $i++) { \r\n\t\t\t$products[$i]->setNow($prices[$i]);\r\n\t\t}\r\n\t}",
"function amenities_change_publish($option,$cid,$state){\n\t\tglobal $jinput, $mainframe;\n\t\t$db = JFactory::getDBO();\n\t\tif(count($cid)>0)\t{\n\t\t\t$cids = implode(\",\",$cid);\n\t\t\t$db->setQuery(\"Update #__osrs_amenities SET `published` = '$state' WHERE id IN ($cids)\");\n\t\t\t$db->execute();\n\t\t}\n\t\t$msg = JText::_(\"OS_ITEM_STATUS_HAS_BEEN_CHANGED\");\n\t\t$mainframe->enqueueMessage($msg);\n\t\t$mainframe->redirect(\"index.php?option=$option&task=amenities_list\");\n\t}",
"private function makeOnePendingEntry($pending, $product) {\n\t\t$this->pending['Pending'][] = array(\n\t\t\t\"-I{$product['item_id']}-C{$product['id']}-\",\n\t\t\t$pending / $product['sell_quantity'],\n\t\t\t$product['sell_quantity'],\n\t\t\t$product['sell_unit'],\n\t\t\t$product['name']\n\t\t);\n\t}",
"public function syncPacksPriority()\n {\n $stamp = mktime(0, 0, 0);\n $bod = date(DATE_ATOM,$stamp);\n $url_addition = 'LOGPART?$select=PARTNAME&$filter=ITAI_INKATALOG eq \\'Y\\'&$expand=PARTPACK_SUBFORM';\n $response = $this->makeRequest('GET', $url_addition, [], true);\n // check response status\n if ($response['status']) {\n $data = json_decode($response['body_raw'], true);\n foreach($data['value'] as $item) {\n // if product exsits, update\n $args = array(\n 'post_type'\t\t=>\t'product',\n 'meta_query'\t=>\tarray(\n array(\n 'key' => '_sku',\n 'value'\t=>\t$item['PARTNAME']\n )\n )\n );\n $my_query = new \\WP_Query( $args );\n if ( $my_query->have_posts() ) {\n while ( $my_query->have_posts() ) {\n $my_query->the_post();\n $product_id = get_the_ID();\n }\n }else{\n $product_id = 0;\n }\n\n //if ($id = wc_get_product_id_by_sku($item['PARTNAME'])) {\n if(!$product_id == 0){\n update_post_meta($product_id, 'pri_packs', $item['PARTPACK_SUBFORM']);\n }\n }\n }\n }",
"public function setProductValues($products) {\n $productObj = new Crm_Product();\n $productFeaturesModel = new Frontend_Model_ProductFeatures();\n $product_reviews_model = new Frontend_Model_ProductReviews();\n $identity = Zend_Auth::getInstance()->getStorage()->read();\n $contact_id = $identity ? $identity['id'] : null;\n $personalPricesModel = new Crm_PersonalPrice($contact_id);\n $newProducts = [];\n foreach ($products as $key => $product) {\n $newProducts[$key] = $product;\n\n $img = $productObj->getImgSrc($product['id'], $product['image_id']) . $product['image_id'] . '.96x96.' . $product['ext'];\n $img_200 = $productObj->getImgSrc($product['id'], $product['image_id']) . $product['image_id'] . '.200x0.' . $product['ext'];\n $dumy_Image = \"/img/empty.jpg\";\n\n $newProducts[$key]['img'] = ($product['image_id'] && file_exists(PUBLIC_PATH . $img)) ? $img : $dumy_Image;\n $newProducts[$key]['img_200'] = ($product['image_id'] && file_exists(PUBLIC_PATH . $img_200)) ? $img_200 : $dumy_Image;\n $newProducts[$key]['features'] = $productFeaturesModel->getFeaturesValuesByParams(['product_id' => $product['id']]);\n $newProducts[$key]['review_count'] = $product_reviews_model->getCountReviews($product['id']);\n if ($contact_id) {\n $productOne = $personalPricesModel->add_personal_price(array($newProducts[$key]));\n $productOne = reset($productOne);\n $newProducts[$key]['personal_price'] = Frontend_Utils::priceUA($productOne['skus'][$productOne['sku_id']]['personal_price'], $productOne['currency']);\n }\n }\n return $newProducts;\n }",
"public function setPending($buy) {\n\n $p = $this->pending;\n $value = 0;\n\n switch ($p) {\n case 0: // no buys or sells pending\n if ( $buy === \"Buy\" ) $value = 1;\n if ( $buy === \"Sell\" ) $value = 2;\n break;\n case 1: // a buy\n if ( $buy === \"Buy\" ) $value = 98;\n if ( $buy === \"Sell\" ) $value = 3;\n break;\n case 2: // a sell\n if ( $buy === \"Buy\" ) $value = 3;\n if ( $buy === \"Sell\" ) $value = 99;\n break;\n case 3: // a buy and a sell\n if ( $buy === \"Buy\" ) $value = 98;\n if ( $buy === \"Sell\" ) $value = 99;\n break;\n case 9: // reallocation\n if ( $buy === \"Buy\" ) $value = 98;\n if ( $buy === \"Sell\" ) $value = 99;\n break;\n }\n $this->pending = $value;\n }",
"public function setPending()\n {\n $this->status = self::STATUS_PENDING;\n $this->save();\n }",
"public function setProducts($products)\n {\n $required_keys = [\n 'product-code',\n 'description',\n 'commodity-code',\n 'unit-of-measure',\n 'unit-cost',\n 'quantity',\n 'total-amount',\n 'tax-amount',\n 'tax-rate'\n ];\n\n foreach ($products as $product) {\n foreach ($required_keys as $rk) {\n if (!isset($product[$rk])) {\n throw new \\Exception(\"product key error: \".$rk);\n }\n }\n }\n $this->setParameter('products', $products);\n return $this;\n }",
"public function setPublishOriginal($publishOriginal)\n {\n $this->_publishOriginal = $publishOriginal;\n }",
"public function push() {\n\t\theader(\"Access-Control-Allow-Origin: *\");\n\t\theader('Content-Type: application/json');\n\t\theader('Content-Type application/json; charset=utf-8');\n\t\ttry {\n\t\t\t$application_id = $_POST['application_id'];\n\t\t\t$mpid = $_POST['mpid'];\n\t\t\t$contry_to_publish = array(\"publish_to_MX\" => 1);\n\t\t\t$application = pg_fetch_object(pg_query(\"SELECT * FROM cbt.shop WHERE id = '\".$application_id.\"'\"));\n\t\t\t$url_products_publish_put = \"https://api-cbt.mercadolibre.com/api/SKUs/\".$mpid.\"/?access_token=\".$application->access_token;\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $url_products_publish_put);\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($contry_to_publish));\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\t$response = curl_exec($ch);\n\t\t\tcurl_close($ch);\n\t\t\tif ($response == null) {\n\t\t\t\tpg_query($this->conn->conn, \"UPDATE cbt.items SET status='publish', update_date='\".date('y-m-d H:i:s').\"' WHERE mpid = '\".$mpid.\"'\");\n\t\t\t\t$this->conn->close();\n\t\t\t\techo json_encode(array('msg' => \"Success mpid \".$mpid, 'status' => 1), JSON_UNESCAPED_UNICODE);\n\t\t\t}\n\n\t\t} catch (Exception $e) {\n\t\t\t$this->conn->close();\n\t\t\techo json_encode(array('msg' => \"Wrong Data base Connection\", 'error' => $e->getMessage(), 'status' => 0), JSON_UNESCAPED_UNICODE);\n\t\t}\n\t}",
"function updateProduct() {\n\n $params = [\n 'name' => $this->product\n ];\n \n $response = getResponse(getConfigVar(\"api_url\"), \"products\", $params, [],'body');\n \n $this->qty = $response[\"results\"][0][\"qty\"];\n $this->price = $response[\"results\"][0][\"price\"];\n \n $product = get_page_by_title( $this->product, OBJECT, 'product' );\n \n $productID = $product->ID;\n \n update_post_meta( $productID, \"_stock\", $this->qty );\n update_post_meta( $productID, \"_price\", $this->price );\n }",
"public function assignrelprdAction()\n {\n \n $this->loadLayout();\n $this->renderLayout();\n\n $productIds = $this->getRequest()->getParam('product');\n $storeId = Mage::app()->getStore()->getId();\n\n if(!is_array($productIds)) \n {\n Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select product(s).'));\n }\n\n else\n {\n\n foreach ($productIds as $productId) \n {\n\n $product = Mage::getModel('catalog/product')->load($productId);\n $targetprodid = $this->getRequest()->getPost('assignrelprd');\n $targetproduct = Mage::getModel('catalog/product')->load($targetprodid);\n $param = array();\n $crosssells = $targetproduct->getRelatedProducts();\n \n foreach ($crosssells as $item) \n {\n $param[$item->getId()] = array('position' => $item->getPosition());\n }\n\n if (!isset($param[$productId]))\n { \n $param[$productId]= array(\n 'position'=>$productId\n );\n }\n\n try\n { \n\n $targetproduct->setRelatedLinkData($param);\n $targetproduct->save();\n }\n catch(Exception $e)\n {\n \n Mage::getSingleton('core/session')->addError($e->getMessage());\n $this->_redirect('*/catalog_product/index');\n return false;\n } \n \n } \n\n $this->_redirect('*/catalog_product/index');\n Mage::getSingleton('core/session')->addSuccess('The Action have been completed successfully.'); \n Mage::app()->cleanCache(); \n\n }\n\n }"
] | [
"0.5555657",
"0.5499944",
"0.5470886",
"0.5373455",
"0.5283463",
"0.52064127",
"0.5153691",
"0.5134676",
"0.5067908",
"0.4946394",
"0.4897541",
"0.48828658",
"0.4834746",
"0.48302707",
"0.48266107",
"0.48131454",
"0.48057738",
"0.4765054",
"0.4754475",
"0.47499934",
"0.47442728",
"0.4735584",
"0.4711695",
"0.46808326",
"0.46668065",
"0.46411195",
"0.46269017",
"0.46242747",
"0.46195135",
"0.46085295"
] | 0.5779789 | 0 |
Assigns pending product changes to a specified product publish set. Use the code field to specify the product publish set. | public function assignProductsToPublishSetAsync($publishSet, $responseFields = null)
{
$mozuClient = PublishingScopeClient::assignProductsToPublishSetClient($publishSet, $responseFields);
$mozuClient = $mozuClient->withContext($this->apiContext);
return $mozuClient->executeAsync();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function assignProductsToPublishSet($publishSet, $responseFields = null)\r\n\t{\r\n\t\t$mozuClient = PublishingScopeClient::assignProductsToPublishSetClient($publishSet, $responseFields);\r\n\t\t$mozuClient = $mozuClient->withContext($this->apiContext);\r\n\t\t$mozuClient->execute();\r\n\t\treturn $mozuClient->getResult();\r\n\r\n\t}",
"private function updateProductSetQty() {\n $productsets = Product::where('is_set', '=', 1)->get();\n\n foreach ($productsets as $set) {\n $i = 1;\n $set_qty = 0;\n foreach ($set->sets($set->id) as $product) {\n $qty = $product->product->qty;\n if ($i == 1)\n $set_qty = $qty;\n\n if ($set_qty > $qty) {\n $set_qty = $qty;\n }\n $i++;\n }\n\n $set->qty = $set_qty;\n $set->save();\n }\n }",
"public function assignProducts($id, array $products);",
"public function actionBulkSetAsPending()\n\t{\n\t\tif ( Yii::$app->request->post('selection') )\n\t\t{\n\t\t\t$modelClass = $this->modelClass;\n\n\t\t\t$modelClass::updateAll(\n\t\t\t\t['status'=>Feedback::STATUS_PENDING],\n\t\t\t\t['id'=>Yii::$app->request->post('selection', [])]\n\t\t\t);\n\t\t}\n\t}",
"public function set_pending(){\r\n\t\t\r\n\t\t/* Get arguments */\r\n\t\t$args = $this->_args;\r\n\t\tif (empty($args)){\r\n\t\t\treturn $this->_redirect('/'.strtolower($this->_getType('plural')));\r\n\t\t}\r\n\t\t\r\n\t\t/* Set status */\r\n\t\t$itemId = array_shift($args);\r\n\t\t$itemsModel = $this->getModel('newitems');\r\n\t\t$success = $itemsModel->setStatus($itemId, false);\r\n\t\t\r\n\t\t/* Message */\r\n\t\tif ($success){\r\n\t\t\tMessages::addMessage($this->_getType('singular').' #'.$itemId.' set to \"<code>pending</code>\"');\r\n\t\t} else {\r\n\t\t\tMessages::addMessage($this->_getType('singular').' #'.$itemId.' was not changed.', 'error');\r\n\t\t}\r\n\t\t\r\n\t\t/* Redirect to details page */\r\n\t\treturn $this->_redirect('/'.strtolower($this->_getType('plural')).'/details/'.$itemId);\r\n\t\t\r\n\t}",
"public function publish() {\n if (!$this->active) {\n $this->apply(\n new ProductPublishedEvent($this->productId)\n );\n }\n }",
"private function publish()\n {\n $product = dispatch_now(new GetProductTask($this->data['slug']));\n if(!$product) return false;\n\n if($product->status != Product::STATUS['approve']){\n $product->status = Product::STATUS['publish'];\n $product->save();\n }\n return true;\n }",
"function saveAssignmentBasedOnChangeSet($change_set_id, $posts) {\n\t\n\tif (0) deb(\"change_sets_utils:saveAssignmentBasedOnChangeSet() posts = \", $posts);\n\n\t// Get ids of confirmed changes from $posts into a query string\n\t$ok_changes_array = array();\n\t$ok_change_value = $posts['ok_change_value'];\n\tunset($posts['ok_change_value']);\n\tif (0) deb(\"change_sets_utils:saveAssignmentBasedOnChangeSet() posts = \", $posts);\n\tforeach($posts as $i=>$post) {\n\t\tif ($post == $ok_change_value) {\n\t\t\t$ok_changes_array[] = $i;\n\t\t}\n\t}\n\t$ok_changes_string = implode(\", \", $ok_changes_array);\n\tif (0) deb(\"change_sets_utils:saveAssignmentBasedOnChangeSet() ok_changes_string = \", $ok_changes_string);\n\t\n\t// If there are ok changes in the change set, save them in the database\n\tif ($ok_changes_string) {\n\t\t\n\t\t// Delete the not-ok changes from this change set\n\t\tsqlDelete(CHANGES_TABLE, \"change_set_id = {$change_set_id} and not id in ({$ok_changes_string})\");\n\n\t\t// Set the change timestamp for this change set to now\n\t\t$when_saved = date(\"Y/m/d H:i:s\");\n\t\tsqlUpdate(CHANGE_SETS_TABLE, \"when_saved = '{$when_saved}'\", \"id = {$change_set_id}\");\n\n\t\t// Store the confirmed changes in the assignments table\n\t\t$select = \"c.*, s.scheduler_run_id\";\n\t\t$from = CHANGES_TABLE . \" as c, \" . CHANGE_SETS_TABLE . \" as s\"; \n\t\t$where = \"s.id = {$change_set_id} \n\t\t\tand c.change_set_id = s.id\n\t\t\tand c.id in ({$ok_changes_string})\";\n\t\t$changes = sqlSelect($select, $from, $where, \"\", (0), \"changed assignments to save\");\n\t\tforeach ($changes as $i=>$change) {\n\t\t\tif (0) deb(\"change_sets_utils:saveAssignmentBasedOnChangeSet() change = \", $change);\t\t\t\n\t\t\tsaveAssignmentBasedOnChange($change);\n\t\t}\t\n\t} \n\t// If the change set contains no ok changes, delete it \n\telse \n\t{\n\t\tsqlDelete(CHANGE_SETS_TABLE, \"id = {$change_set_id}\", (0));\n\t}\n}",
"function testChangeProductAmount() {\n\t \n\t $this->loginAs('admin');\n\t $productA = $this->objFromFixture('Product', 'productA');\n\t $productID = $productA->ID; \n\t \n\t //Publish\n\t $productA->doPublish();\n\t $this->assertTrue($productA->isPublished());\n\n\t $versions = DB::query('SELECT * FROM \"Product_versions\" WHERE \"RecordID\" = ' . $productID);\n\t $versionsAfterPublished = array();\n\t foreach ($versions as $versionRow) $versionsAfterPublished[] = $versionRow;\n\n\t $originalAmount = $productA->Amount;\n\t \n\t $newAmount = new Money();\n\t $newAmount->setAmount($originalAmount->getAmount() + 50);\n\t $newAmount->setCurrency($originalAmount->getCurrency());\n\t \n\t $this->assertTrue($newAmount->Amount != $originalAmount->Amount);\n\t \n //Update price and publish\n\t $productA->Amount = $newAmount;\n\t $productA->doPublish();\n\n\t $versions = DB::query('SELECT * FROM \"Product_versions\" WHERE \"RecordID\" = ' . $productID);\n\t $versionsAfterPriceChange = array();\n\t foreach ($versions as $versionRow) $versionsAfterPriceChange[] = $versionRow;\n\n\t $this->assertTrue(count($versionsAfterPublished) + 1 == count($versionsAfterPriceChange));\n\t $this->assertEquals($versionsAfterPriceChange[2]['AmountAmount'], $newAmount->getAmount());\n\t}",
"public function set_product() {\n\t\t$this->product->set_props(\n\t\t\t[\n\t\t\t\t// Default WooCommerce props\n\t\t\t\t'name' => $this->plato_project->get_name(),\n\t\t\t\t'slug' => $this->get_slug(),\n\t\t\t\t'category_ids' => $this->get_category_ids(),\n\t\t\t\t'attributes' => $this->get_attributes(),\n\t\t\t\t'sku' => $this->plato_project->get_code(),\n\t\t\t\t'status' => $this->get_status(),\n\t\t\t\t'image_id' => $this->get_image_id(),\n\n\t\t\t\t// Extra props\n\t\t\t\t'checksum' => $this->plato_project->get_checksum(),\n\t\t\t\t'project_id' => $this->plato_project->get_project_id(),\n\t\t\t\t'latitude' => $this->plato_project->get_lat_project(),\n\t\t\t\t'longitude' => $this->plato_project->get_lng_project(),\n\t\t\t\t'start_date' => $this->plato_project->get_start_date(),\n\t\t\t\t'end_date' => $this->plato_project->get_end_date(),\n\t\t\t\t'min_age' => $this->plato_project->get_min_age(),\n\t\t\t\t'max_age' => $this->plato_project->get_max_age(),\n\t\t\t\t'participation_fee_currency' => $this->plato_project->get_participation_fee_currency(),\n\t\t\t\t'participation_fee' => $this->plato_project->get_participation_fee(),\n\t\t\t\t'project_description' => $this->get_project_description(),\n\t\t\t]\n\t\t);\n\t\t$this->product->save();\n\t}",
"public function assignupprdAction()\n {\n \n $this->loadLayout();\n $this->renderLayout();\n\n $productIds = $this->getRequest()->getParam('product');\n $storeId = Mage::app()->getStore()->getId();\n\n if(!is_array($productIds)) \n {\n Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select product(s).'));\n }\n\n else\n {\n\n foreach ($productIds as $productId) \n {\n\n $product = Mage::getModel('catalog/product')->load($productId);\n $targetprodid = $this->getRequest()->getPost('assignupprd');\n $targetproduct = Mage::getModel('catalog/product')->load($targetprodid);\n $param = array();\n $upsells = $targetproduct->getUpSellProducts();\n foreach ($upsells as $item) \n {\n $param[$item->getId()] = array('position' => $item->getPosition());\n }\n\n if (!isset($param[$productId]))\n { \n $param[$productId]= array(\n 'position'=>$productId\n );\n }\n\n try\n { \n\n $targetproduct->setUpSellLinkData($param);\n $targetproduct->save();\n }\n catch(Exception $e)\n {\n \n Mage::getSingleton('core/session')->addError($e->getMessage());\n $this->_redirect('*/catalog_product/index');\n return false;\n } \n \n } \n\n $this->_redirect('*/catalog_product/index');\n Mage::getSingleton('core/session')->addSuccess('The Action have been completed successfully.'); \n Mage::app()->cleanCache(); \n\n }\n\n }",
"public function assignProduct(...$products)\n {\n if ($this->isComposite()) {\n $products = collect($products)->flatten()->map(function ($product) {\n return $this->getStoredProduct($product);\n })->all();\n\n $this->products()->saveMany($products);\n }\n\n return $this;\n }",
"public function addProductSyncData(&$products);",
"private function bulkUpdateProductLanguage(){\n $this->aq = new ArchiveQuery($this->entityQuery);\n $all_products = $this->aq->getProducts();\n $products = $this->entityTypeManager->getStorage('node')->loadMultiple($all_products);\n $count = 0;\n foreach ($products as $key => $product) {\n $lang_code = $product->get('langcode')->value;\n if ($lang_code !== 'zxx'){\n $count++;\n $product->set('langcode', 'zxx');\n if ($count < 50){\n //$product->save();\n }\n }\n }\n if ($count){\n kint($count, 'Prodotti modificati'); \n } else {\n kint('Tutti a posto');\n }\n \n\n // Test su un prodotto\n // $test = $this->entityTypeManager->getStorage('node')->load(1538);\n // $lang_code = $test->get('langcode')->value;\n // if ($lang_code !== 'zxx'){\n // $test->set('langcode', 'zxx');\n // $test->save();\n // }\n // kint($test->get('langcode')->value,'update');\n }",
"public function save_product_post_data( $product ) {\n if ( 'yes' === get_user_meta( dokan_get_current_user_id(), 'dokan_publishing', true ) ) {\n return $product;\n }\n //update product status to pending-review if set by admin\n if ( 'on' === dokan_get_option( 'edited_product_status', 'dokan_selling' ) ) {\n $product['post_status'] = 'pending';\n\n return $product;\n }\n\n return $product;\n }",
"function assignAvailableProduct($product) {\n\t\t\t$helper = $this->getWarehouseHelper( );\n\t\t\t$productPriceHelper = $helper->getProductPriceHelper( );\n\t\t\t$stockStatus = $this->getCatalogInventoryHelper( )->getStockStatusSingleton( );\n\n\t\t\tif (( !$this->getId( ) || !$this->getProductId( ) )) {\n\t\t\t\t$this->loadAvailableByProduct( $product );\n\n\t\t\t\tif (!$this->getId( )) {\n\t\t\t\t\t$this->addData( $this->getDefaultData( ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->setProduct( $product );\n\t\t\t$product->setStockItem( $this );\n\t\t\t$product->setIsInStock( $this->getIsInStock( ) );\n\t\t\t$stockStatus->assignProduct( $product, $this->getStockId( ), $this->getStockStatus( ) );\n\t\t\t$productPriceHelper->applyPrice( $product );\n\t\t\treturn $this;\n\t\t}",
"public function assignProductList()\n {\n }",
"public function setProductNotification($params)\r\n\t{\r\n\t\t$this->oRecoParam = new NotifyPrediggoParam();\r\n\t\t$this->oRecoParam->setNotificationId($params['notificationId']);\r\n\r\n\t\t$this->setNotification($params, 'notifyPrediggo');\r\n\t}",
"protected function latestPostProcessing($products) \r\n\t{\r\n\t\t// get the prices seperately but maintain order to combine the results\r\n\t\t$prices = $this->services->getCrawler()->filter('#product-list .description')->each(function ($node, $i) {\r\n\r\n\t\t\t// create a new crawler for the product html and create a new entity for it\r\n\t\t\t$description = new Crawler($node);\r\n\r\n\t\t\t$price = explode('£', $description->filter('span.price')->text());\r\n\t\t\t$price = str_replace(',', '', end($price));\r\n\r\n\t\t\treturn $price;\r\n\t\t});\r\n\r\n\t\t// combine prices and products\r\n\t\tfor ($i=0; $i < count($prices); $i++) { \r\n\t\t\t$products[$i]->setNow($prices[$i]);\r\n\t\t}\r\n\t}",
"function amenities_change_publish($option,$cid,$state){\n\t\tglobal $jinput, $mainframe;\n\t\t$db = JFactory::getDBO();\n\t\tif(count($cid)>0)\t{\n\t\t\t$cids = implode(\",\",$cid);\n\t\t\t$db->setQuery(\"Update #__osrs_amenities SET `published` = '$state' WHERE id IN ($cids)\");\n\t\t\t$db->execute();\n\t\t}\n\t\t$msg = JText::_(\"OS_ITEM_STATUS_HAS_BEEN_CHANGED\");\n\t\t$mainframe->enqueueMessage($msg);\n\t\t$mainframe->redirect(\"index.php?option=$option&task=amenities_list\");\n\t}",
"private function makeOnePendingEntry($pending, $product) {\n\t\t$this->pending['Pending'][] = array(\n\t\t\t\"-I{$product['item_id']}-C{$product['id']}-\",\n\t\t\t$pending / $product['sell_quantity'],\n\t\t\t$product['sell_quantity'],\n\t\t\t$product['sell_unit'],\n\t\t\t$product['name']\n\t\t);\n\t}",
"public function syncPacksPriority()\n {\n $stamp = mktime(0, 0, 0);\n $bod = date(DATE_ATOM,$stamp);\n $url_addition = 'LOGPART?$select=PARTNAME&$filter=ITAI_INKATALOG eq \\'Y\\'&$expand=PARTPACK_SUBFORM';\n $response = $this->makeRequest('GET', $url_addition, [], true);\n // check response status\n if ($response['status']) {\n $data = json_decode($response['body_raw'], true);\n foreach($data['value'] as $item) {\n // if product exsits, update\n $args = array(\n 'post_type'\t\t=>\t'product',\n 'meta_query'\t=>\tarray(\n array(\n 'key' => '_sku',\n 'value'\t=>\t$item['PARTNAME']\n )\n )\n );\n $my_query = new \\WP_Query( $args );\n if ( $my_query->have_posts() ) {\n while ( $my_query->have_posts() ) {\n $my_query->the_post();\n $product_id = get_the_ID();\n }\n }else{\n $product_id = 0;\n }\n\n //if ($id = wc_get_product_id_by_sku($item['PARTNAME'])) {\n if(!$product_id == 0){\n update_post_meta($product_id, 'pri_packs', $item['PARTPACK_SUBFORM']);\n }\n }\n }\n }",
"public function setProductValues($products) {\n $productObj = new Crm_Product();\n $productFeaturesModel = new Frontend_Model_ProductFeatures();\n $product_reviews_model = new Frontend_Model_ProductReviews();\n $identity = Zend_Auth::getInstance()->getStorage()->read();\n $contact_id = $identity ? $identity['id'] : null;\n $personalPricesModel = new Crm_PersonalPrice($contact_id);\n $newProducts = [];\n foreach ($products as $key => $product) {\n $newProducts[$key] = $product;\n\n $img = $productObj->getImgSrc($product['id'], $product['image_id']) . $product['image_id'] . '.96x96.' . $product['ext'];\n $img_200 = $productObj->getImgSrc($product['id'], $product['image_id']) . $product['image_id'] . '.200x0.' . $product['ext'];\n $dumy_Image = \"/img/empty.jpg\";\n\n $newProducts[$key]['img'] = ($product['image_id'] && file_exists(PUBLIC_PATH . $img)) ? $img : $dumy_Image;\n $newProducts[$key]['img_200'] = ($product['image_id'] && file_exists(PUBLIC_PATH . $img_200)) ? $img_200 : $dumy_Image;\n $newProducts[$key]['features'] = $productFeaturesModel->getFeaturesValuesByParams(['product_id' => $product['id']]);\n $newProducts[$key]['review_count'] = $product_reviews_model->getCountReviews($product['id']);\n if ($contact_id) {\n $productOne = $personalPricesModel->add_personal_price(array($newProducts[$key]));\n $productOne = reset($productOne);\n $newProducts[$key]['personal_price'] = Frontend_Utils::priceUA($productOne['skus'][$productOne['sku_id']]['personal_price'], $productOne['currency']);\n }\n }\n return $newProducts;\n }",
"public function setPending($buy) {\n\n $p = $this->pending;\n $value = 0;\n\n switch ($p) {\n case 0: // no buys or sells pending\n if ( $buy === \"Buy\" ) $value = 1;\n if ( $buy === \"Sell\" ) $value = 2;\n break;\n case 1: // a buy\n if ( $buy === \"Buy\" ) $value = 98;\n if ( $buy === \"Sell\" ) $value = 3;\n break;\n case 2: // a sell\n if ( $buy === \"Buy\" ) $value = 3;\n if ( $buy === \"Sell\" ) $value = 99;\n break;\n case 3: // a buy and a sell\n if ( $buy === \"Buy\" ) $value = 98;\n if ( $buy === \"Sell\" ) $value = 99;\n break;\n case 9: // reallocation\n if ( $buy === \"Buy\" ) $value = 98;\n if ( $buy === \"Sell\" ) $value = 99;\n break;\n }\n $this->pending = $value;\n }",
"public function setPending()\n {\n $this->status = self::STATUS_PENDING;\n $this->save();\n }",
"public function setProducts($products)\n {\n $required_keys = [\n 'product-code',\n 'description',\n 'commodity-code',\n 'unit-of-measure',\n 'unit-cost',\n 'quantity',\n 'total-amount',\n 'tax-amount',\n 'tax-rate'\n ];\n\n foreach ($products as $product) {\n foreach ($required_keys as $rk) {\n if (!isset($product[$rk])) {\n throw new \\Exception(\"product key error: \".$rk);\n }\n }\n }\n $this->setParameter('products', $products);\n return $this;\n }",
"public function setPublishOriginal($publishOriginal)\n {\n $this->_publishOriginal = $publishOriginal;\n }",
"public function push() {\n\t\theader(\"Access-Control-Allow-Origin: *\");\n\t\theader('Content-Type: application/json');\n\t\theader('Content-Type application/json; charset=utf-8');\n\t\ttry {\n\t\t\t$application_id = $_POST['application_id'];\n\t\t\t$mpid = $_POST['mpid'];\n\t\t\t$contry_to_publish = array(\"publish_to_MX\" => 1);\n\t\t\t$application = pg_fetch_object(pg_query(\"SELECT * FROM cbt.shop WHERE id = '\".$application_id.\"'\"));\n\t\t\t$url_products_publish_put = \"https://api-cbt.mercadolibre.com/api/SKUs/\".$mpid.\"/?access_token=\".$application->access_token;\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $url_products_publish_put);\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($contry_to_publish));\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\t$response = curl_exec($ch);\n\t\t\tcurl_close($ch);\n\t\t\tif ($response == null) {\n\t\t\t\tpg_query($this->conn->conn, \"UPDATE cbt.items SET status='publish', update_date='\".date('y-m-d H:i:s').\"' WHERE mpid = '\".$mpid.\"'\");\n\t\t\t\t$this->conn->close();\n\t\t\t\techo json_encode(array('msg' => \"Success mpid \".$mpid, 'status' => 1), JSON_UNESCAPED_UNICODE);\n\t\t\t}\n\n\t\t} catch (Exception $e) {\n\t\t\t$this->conn->close();\n\t\t\techo json_encode(array('msg' => \"Wrong Data base Connection\", 'error' => $e->getMessage(), 'status' => 0), JSON_UNESCAPED_UNICODE);\n\t\t}\n\t}",
"function updateProduct() {\n\n $params = [\n 'name' => $this->product\n ];\n \n $response = getResponse(getConfigVar(\"api_url\"), \"products\", $params, [],'body');\n \n $this->qty = $response[\"results\"][0][\"qty\"];\n $this->price = $response[\"results\"][0][\"price\"];\n \n $product = get_page_by_title( $this->product, OBJECT, 'product' );\n \n $productID = $product->ID;\n \n update_post_meta( $productID, \"_stock\", $this->qty );\n update_post_meta( $productID, \"_price\", $this->price );\n }",
"public function assignrelprdAction()\n {\n \n $this->loadLayout();\n $this->renderLayout();\n\n $productIds = $this->getRequest()->getParam('product');\n $storeId = Mage::app()->getStore()->getId();\n\n if(!is_array($productIds)) \n {\n Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select product(s).'));\n }\n\n else\n {\n\n foreach ($productIds as $productId) \n {\n\n $product = Mage::getModel('catalog/product')->load($productId);\n $targetprodid = $this->getRequest()->getPost('assignrelprd');\n $targetproduct = Mage::getModel('catalog/product')->load($targetprodid);\n $param = array();\n $crosssells = $targetproduct->getRelatedProducts();\n \n foreach ($crosssells as $item) \n {\n $param[$item->getId()] = array('position' => $item->getPosition());\n }\n\n if (!isset($param[$productId]))\n { \n $param[$productId]= array(\n 'position'=>$productId\n );\n }\n\n try\n { \n\n $targetproduct->setRelatedLinkData($param);\n $targetproduct->save();\n }\n catch(Exception $e)\n {\n \n Mage::getSingleton('core/session')->addError($e->getMessage());\n $this->_redirect('*/catalog_product/index');\n return false;\n } \n \n } \n\n $this->_redirect('*/catalog_product/index');\n Mage::getSingleton('core/session')->addSuccess('The Action have been completed successfully.'); \n Mage::app()->cleanCache(); \n\n }\n\n }"
] | [
"0.5778239",
"0.54987025",
"0.54696727",
"0.537187",
"0.52823925",
"0.5205658",
"0.5153125",
"0.5135321",
"0.5066303",
"0.4944996",
"0.48953483",
"0.48816794",
"0.48328295",
"0.4828713",
"0.48252374",
"0.48115084",
"0.4802893",
"0.4764235",
"0.47533977",
"0.47504005",
"0.47426063",
"0.47346684",
"0.47099918",
"0.46794322",
"0.46656328",
"0.46401966",
"0.46266162",
"0.4623844",
"0.4617802",
"0.46063182"
] | 0.5554337 | 1 |
Deletes the specified product publish set. If you set the discardDrafts parameter to true, this operation also deletes the product drafts assigned to the publish set. | public function deletePublishSet($publishSetCode, $discardDrafts = null)
{
$mozuClient = PublishingScopeClient::deletePublishSetClient($publishSetCode, $discardDrafts);
$mozuClient = $mozuClient->withContext($this->apiContext);
$mozuClient->execute();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deletePublishSetAsync($publishSetCode, $discardDrafts = null)\r\n\t{\r\n\t\t$mozuClient = PublishingScopeClient::deletePublishSetClient($publishSetCode, $discardDrafts);\r\n\t\t$mozuClient = $mozuClient->withContext($this->apiContext);\r\n\t\treturn $mozuClient->executeAsync();\r\n\r\n\t}",
"public function hookActionProductDelete($params)\n {\n\n $sets = $this->getSets($params['id_product']);\n\n foreach ($sets as $set) {\n Ajaxzoom::deleteSet($set['id_360set']);\n }\n\n $id_product = (int)$params['id_product'];\n\n Ajaxzoom::clearProductImagesAXCache($params['id_product']);\n\n Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'ajaxzoomproducts`\n WHERE id_product = '.$id_product);\n\n Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'ajaxzoomproductsimages`\n WHERE id_product = '.$id_product);\n\n Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'ajaxzoomvideo`\n WHERE id_product = '.$id_product);\n\n Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'ajaxzoomimagehotspots`\n WHERE id_product = '.$id_product);\n }",
"public function destroy(Publish $publish)\n {\n //\n }",
"public function destroy(Products $products)\n {\n //\n }",
"public function destroy(Products $products)\n {\n //\n }",
"function deleteAllProducts()\n{\n $args = array('posts_per_page' => -1, 'post_type' => 'grahams_product',);\n $allposts = get_posts($args);\n foreach ($allposts as $post) :\n wp_delete_post($post->ID, true);\n endforeach;\n}",
"public function destroy(pms_produk_mst $produk)\n {\n //\n $produk->delete();\n // $hasil = $produk->delete();\n // return response($hasil);\n // $delete = pms_produk_mst::find($id);\n // return $delete->delete();\n }",
"public function destroy($id)\n\t{\n\t\t$set = Sets::find($id);\n\t\tif(count($set->products) == 0)\n\t\t{\n\t\t\t$set->delete();\n\t\t\treturn redirect('/backend/sets')\n\t\t\t\t->withMessage('200');\n\t\t}\n\t\treturn redirect('/backend/sets')\n\t\t\t->withErrors('403');\n\n\t}",
"public function destroy(dateSetToSendReport $dateSetToSendReport)\n {\n //\n }",
"public function destroy(Request $request, Set $set)\n {\n if ($set->delete()) {\n $request->session()->flash('alert-success', trans('sets.deleted_successfully')); \n } else {\n $request->session()->flash('alert-failure', trans('sets.delete_failed')); \n }\n\n return redirect()->route('sets.index');\n }",
"public function undeleteToPublish(Post $post): bool\n {\n if (!$this->blogPublishStateMachine->can($post, 'undeletetopublish')) {\n $this->addError('publish');\n return false;\n }\n $update = $this->blogPublishStateMachine->apply($post, 'undeletetopublish');\n if ($update) {\n $post->setPublishedAt(new DateTime());\n $this->entityManager->flush();\n $this->addSuccess('publish');\n return true;\n } else {\n $this->addError('publish');\n return false;\n }\n }",
"public function destroy(SincronazedProducts $sincronazeProducts)\n {\n //\n }",
"public function DeleteAllFormProducts() {\n\t\t\tif ((is_null($this->intId)))\n\t\t\t\tthrow new QUndefinedPrimaryKeyException('Unable to call UnassociateFormProduct on this unsaved SignupForm.');\n\n\t\t\t// Get the Database Object for this Class\n\t\t\t$objDatabase = SignupForm::GetDatabase();\n\n\t\t\t// Journaling\n\t\t\tif ($objDatabase->JournalingDatabase) {\n\t\t\t\tforeach (FormProduct::LoadArrayBySignupFormId($this->intId) as $objFormProduct) {\n\t\t\t\t\t$objFormProduct->Journal('DELETE');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Perform the SQL Query\n\t\t\t$objDatabase->NonQuery('\n\t\t\t\tDELETE FROM\n\t\t\t\t\t`form_product`\n\t\t\t\tWHERE\n\t\t\t\t\t`signup_form_id` = ' . $objDatabase->SqlVariable($this->intId) . '\n\t\t\t');\n\t\t}",
"public function DeleteAllSignupProducts() {\n\t\t\tif ((is_null($this->intId)))\n\t\t\t\tthrow new QUndefinedPrimaryKeyException('Unable to call UnassociateSignupProduct on this unsaved FormProduct.');\n\n\t\t\t// Get the Database Object for this Class\n\t\t\t$objDatabase = FormProduct::GetDatabase();\n\n\t\t\t// Journaling\n\t\t\tif ($objDatabase->JournalingDatabase) {\n\t\t\t\tforeach (SignupProduct::LoadArrayByFormProductId($this->intId) as $objSignupProduct) {\n\t\t\t\t\t$objSignupProduct->Journal('DELETE');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Perform the SQL Query\n\t\t\t$objDatabase->NonQuery('\n\t\t\t\tDELETE FROM\n\t\t\t\t\t`signup_product`\n\t\t\t\tWHERE\n\t\t\t\t\t`form_product_id` = ' . $objDatabase->SqlVariable($this->intId) . '\n\t\t\t');\n\t\t}",
"public function bulkDeletePropertySetRequest($cloud_pk, $ifc_pk, $project_pk)\n {\n // verify the required parameter 'cloud_pk' is set\n if ($cloud_pk === null || (is_array($cloud_pk) && count($cloud_pk) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_pk when calling bulkDeletePropertySet'\n );\n }\n // verify the required parameter 'ifc_pk' is set\n if ($ifc_pk === null || (is_array($ifc_pk) && count($ifc_pk) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $ifc_pk when calling bulkDeletePropertySet'\n );\n }\n // verify the required parameter 'project_pk' is set\n if ($project_pk === null || (is_array($project_pk) && count($project_pk) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $project_pk when calling bulkDeletePropertySet'\n );\n }\n\n $resourcePath = '/cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/propertyset/bulk_destroy';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_pk !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_pk' . '}',\n ObjectSerializer::toPathValue($cloud_pk),\n $resourcePath\n );\n }\n // path params\n if ($ifc_pk !== null) {\n $resourcePath = str_replace(\n '{' . 'ifc_pk' . '}',\n ObjectSerializer::toPathValue($ifc_pk),\n $resourcePath\n );\n }\n // path params\n if ($project_pk !== null) {\n $resourcePath = str_replace(\n '{' . 'project_pk' . '}',\n ObjectSerializer::toPathValue($project_pk),\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\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\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\\Query::build($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function actionDelete() {\r\n $this->checkIfCartExists();\r\n $params = $this->getParams();\r\n if (!array_key_exists('product_id', $params)) {\r\n throw new NotFoundHttpException(Yii::t('app', 'Unable to find \"product_id\" param in request.'));\r\n }\r\n $cp = $this->getUser()->getCartsProducts()->where(['products_id' => $params['product_id']])->one();\r\n\r\n if (!isset($cp))\r\n throw new NotFoundHttpException(Yii::t('app', 'Unable to find product with product_id: {id}.', ['id' => $params['product_id']]));\r\n\r\n if ($cp->delete() === false) {\r\n throw new ServerErrorHttpException('Failed to delete the object for unknown reason.');\r\n }\r\n\r\n Yii::$app->getResponse()->setStatusCode(204);\r\n }",
"public function bulkDeletePropertySet($cloud_pk, $ifc_pk, $project_pk)\n {\n $this->bulkDeletePropertySetWithHttpInfo($cloud_pk, $ifc_pk, $project_pk);\n }",
"public function deleteJsonWebKeySet($set)\n {\n list($response) = $this->deleteJsonWebKeySetWithHttpInfo($set);\n return $response;\n }",
"public function assignProductsToPublishSet($publishSet, $responseFields = null)\r\n\t{\r\n\t\t$mozuClient = PublishingScopeClient::assignProductsToPublishSetClient($publishSet, $responseFields);\r\n\t\t$mozuClient = $mozuClient->withContext($this->apiContext);\r\n\t\t$mozuClient->execute();\r\n\t\treturn $mozuClient->getResult();\r\n\r\n\t}",
"public static function delete($product): void\n {\n $product->delete();\n }",
"public function delete($publicacion);",
"public function actionDeleteProduct()\n\t{\n\t\t$post = Yii::$app->request->post();\n\n\t\t$product = Product::findOne(['id' => $post['id']]);\n\t\t$product->deleteProduct();\n\n\t\treturn $product;\n\t}",
"public function\n\t\tdelete()\n\t{\n\t\t\n\t\t$product_id = $this->get_product_id();\n\t\t\n\t\t#echo \"\\$product_id: $product_id\\n\";\n\t\t\n\t\t$affected_rows = Database_ModifyingStatementHelper\n\t\t\t::apply_statement(\n\t\t\t\tnew Database_SQLUpdateStatement(\n<<<SQL\nUPDATE\n\thpi_trackit_stock_management_products\nSET\n\tdeleted = 'Yes'\nWHERE\n\tproduct_id = '$product_id'\nSQL\n\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t#echo \"\\$affected_rows: $affected_rows\\n\";\n\t}",
"public function deleteJsonWebKeySetWithHttpInfo($set)\n {\n // verify the required parameter 'set' is set\n if ($set === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $set when calling deleteJsonWebKeySet');\n }\n // parse inputs\n $resourcePath = \"/keys/{set}\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // path params\n if ($set !== null) {\n $resourcePath = str_replace(\n \"{\" . \"set\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($set),\n $resourcePath\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'DELETE',\n $queryParams,\n $httpBody,\n $headerParams,\n null,\n '/keys/{set}'\n );\n\n return [null, $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 401:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\HydraSDK\\Model\\GenericError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 403:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\HydraSDK\\Model\\GenericError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 500:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\HydraSDK\\Model\\GenericError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function deletePropertySet($cloud_pk, $id, $ifc_pk, $project_pk)\n {\n $this->deletePropertySetWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk);\n }",
"public function destroy(Product $products)\n\t{\n\t\t$products->delete();\n\t\t$this->deletePhoto($products);\n\t\tflash()->success('Success', 'Product has been removed');\n\n\t\treturn back();\n\t}",
"public function destroy(PropuestaMateriaPrima $propuestaMateriaPrima)\n {\n //\n }",
"public function teamBuilderConfigsIdProductSizesNkProductsDelete($id, $nk)\n {\n list($response) = $this->teamBuilderConfigsIdProductSizesNkProductsDeleteWithHttpInfo($id, $nk);\n return $response;\n }",
"public function destroy(Productos $productos)\n {\n //\n }",
"public function destroy(Productos $productos)\n {\n //\n }"
] | [
"0.5971554",
"0.5022804",
"0.49265453",
"0.47624907",
"0.47624907",
"0.4715716",
"0.46486983",
"0.46297804",
"0.4619706",
"0.46192795",
"0.45789278",
"0.4561536",
"0.45362395",
"0.45247236",
"0.45146683",
"0.44976217",
"0.44734272",
"0.4471886",
"0.44718558",
"0.44629392",
"0.44601858",
"0.4384526",
"0.43818069",
"0.435965",
"0.43438476",
"0.4333768",
"0.4321982",
"0.43058085",
"0.430443",
"0.430443"
] | 0.69113725 | 0 |
Deletes the specified product publish set. If you set the discardDrafts parameter to true, this operation also deletes the product drafts assigned to the publish set. | public function deletePublishSetAsync($publishSetCode, $discardDrafts = null)
{
$mozuClient = PublishingScopeClient::deletePublishSetClient($publishSetCode, $discardDrafts);
$mozuClient = $mozuClient->withContext($this->apiContext);
return $mozuClient->executeAsync();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deletePublishSet($publishSetCode, $discardDrafts = null)\r\n\t{\r\n\t\t$mozuClient = PublishingScopeClient::deletePublishSetClient($publishSetCode, $discardDrafts);\r\n\t\t$mozuClient = $mozuClient->withContext($this->apiContext);\r\n\t\t$mozuClient->execute();\r\n\r\n\t}",
"public function hookActionProductDelete($params)\n {\n\n $sets = $this->getSets($params['id_product']);\n\n foreach ($sets as $set) {\n Ajaxzoom::deleteSet($set['id_360set']);\n }\n\n $id_product = (int)$params['id_product'];\n\n Ajaxzoom::clearProductImagesAXCache($params['id_product']);\n\n Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'ajaxzoomproducts`\n WHERE id_product = '.$id_product);\n\n Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'ajaxzoomproductsimages`\n WHERE id_product = '.$id_product);\n\n Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'ajaxzoomvideo`\n WHERE id_product = '.$id_product);\n\n Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'ajaxzoomimagehotspots`\n WHERE id_product = '.$id_product);\n }",
"public function destroy(Publish $publish)\n {\n //\n }",
"public function destroy(Products $products)\n {\n //\n }",
"public function destroy(Products $products)\n {\n //\n }",
"function deleteAllProducts()\n{\n $args = array('posts_per_page' => -1, 'post_type' => 'grahams_product',);\n $allposts = get_posts($args);\n foreach ($allposts as $post) :\n wp_delete_post($post->ID, true);\n endforeach;\n}",
"public function destroy(pms_produk_mst $produk)\n {\n //\n $produk->delete();\n // $hasil = $produk->delete();\n // return response($hasil);\n // $delete = pms_produk_mst::find($id);\n // return $delete->delete();\n }",
"public function destroy($id)\n\t{\n\t\t$set = Sets::find($id);\n\t\tif(count($set->products) == 0)\n\t\t{\n\t\t\t$set->delete();\n\t\t\treturn redirect('/backend/sets')\n\t\t\t\t->withMessage('200');\n\t\t}\n\t\treturn redirect('/backend/sets')\n\t\t\t->withErrors('403');\n\n\t}",
"public function destroy(dateSetToSendReport $dateSetToSendReport)\n {\n //\n }",
"public function destroy(Request $request, Set $set)\n {\n if ($set->delete()) {\n $request->session()->flash('alert-success', trans('sets.deleted_successfully')); \n } else {\n $request->session()->flash('alert-failure', trans('sets.delete_failed')); \n }\n\n return redirect()->route('sets.index');\n }",
"public function undeleteToPublish(Post $post): bool\n {\n if (!$this->blogPublishStateMachine->can($post, 'undeletetopublish')) {\n $this->addError('publish');\n return false;\n }\n $update = $this->blogPublishStateMachine->apply($post, 'undeletetopublish');\n if ($update) {\n $post->setPublishedAt(new DateTime());\n $this->entityManager->flush();\n $this->addSuccess('publish');\n return true;\n } else {\n $this->addError('publish');\n return false;\n }\n }",
"public function destroy(SincronazedProducts $sincronazeProducts)\n {\n //\n }",
"public function DeleteAllFormProducts() {\n\t\t\tif ((is_null($this->intId)))\n\t\t\t\tthrow new QUndefinedPrimaryKeyException('Unable to call UnassociateFormProduct on this unsaved SignupForm.');\n\n\t\t\t// Get the Database Object for this Class\n\t\t\t$objDatabase = SignupForm::GetDatabase();\n\n\t\t\t// Journaling\n\t\t\tif ($objDatabase->JournalingDatabase) {\n\t\t\t\tforeach (FormProduct::LoadArrayBySignupFormId($this->intId) as $objFormProduct) {\n\t\t\t\t\t$objFormProduct->Journal('DELETE');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Perform the SQL Query\n\t\t\t$objDatabase->NonQuery('\n\t\t\t\tDELETE FROM\n\t\t\t\t\t`form_product`\n\t\t\t\tWHERE\n\t\t\t\t\t`signup_form_id` = ' . $objDatabase->SqlVariable($this->intId) . '\n\t\t\t');\n\t\t}",
"public function DeleteAllSignupProducts() {\n\t\t\tif ((is_null($this->intId)))\n\t\t\t\tthrow new QUndefinedPrimaryKeyException('Unable to call UnassociateSignupProduct on this unsaved FormProduct.');\n\n\t\t\t// Get the Database Object for this Class\n\t\t\t$objDatabase = FormProduct::GetDatabase();\n\n\t\t\t// Journaling\n\t\t\tif ($objDatabase->JournalingDatabase) {\n\t\t\t\tforeach (SignupProduct::LoadArrayByFormProductId($this->intId) as $objSignupProduct) {\n\t\t\t\t\t$objSignupProduct->Journal('DELETE');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Perform the SQL Query\n\t\t\t$objDatabase->NonQuery('\n\t\t\t\tDELETE FROM\n\t\t\t\t\t`signup_product`\n\t\t\t\tWHERE\n\t\t\t\t\t`form_product_id` = ' . $objDatabase->SqlVariable($this->intId) . '\n\t\t\t');\n\t\t}",
"public function bulkDeletePropertySetRequest($cloud_pk, $ifc_pk, $project_pk)\n {\n // verify the required parameter 'cloud_pk' is set\n if ($cloud_pk === null || (is_array($cloud_pk) && count($cloud_pk) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_pk when calling bulkDeletePropertySet'\n );\n }\n // verify the required parameter 'ifc_pk' is set\n if ($ifc_pk === null || (is_array($ifc_pk) && count($ifc_pk) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $ifc_pk when calling bulkDeletePropertySet'\n );\n }\n // verify the required parameter 'project_pk' is set\n if ($project_pk === null || (is_array($project_pk) && count($project_pk) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $project_pk when calling bulkDeletePropertySet'\n );\n }\n\n $resourcePath = '/cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/propertyset/bulk_destroy';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_pk !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_pk' . '}',\n ObjectSerializer::toPathValue($cloud_pk),\n $resourcePath\n );\n }\n // path params\n if ($ifc_pk !== null) {\n $resourcePath = str_replace(\n '{' . 'ifc_pk' . '}',\n ObjectSerializer::toPathValue($ifc_pk),\n $resourcePath\n );\n }\n // path params\n if ($project_pk !== null) {\n $resourcePath = str_replace(\n '{' . 'project_pk' . '}',\n ObjectSerializer::toPathValue($project_pk),\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\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\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\\Query::build($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function actionDelete() {\r\n $this->checkIfCartExists();\r\n $params = $this->getParams();\r\n if (!array_key_exists('product_id', $params)) {\r\n throw new NotFoundHttpException(Yii::t('app', 'Unable to find \"product_id\" param in request.'));\r\n }\r\n $cp = $this->getUser()->getCartsProducts()->where(['products_id' => $params['product_id']])->one();\r\n\r\n if (!isset($cp))\r\n throw new NotFoundHttpException(Yii::t('app', 'Unable to find product with product_id: {id}.', ['id' => $params['product_id']]));\r\n\r\n if ($cp->delete() === false) {\r\n throw new ServerErrorHttpException('Failed to delete the object for unknown reason.');\r\n }\r\n\r\n Yii::$app->getResponse()->setStatusCode(204);\r\n }",
"public function bulkDeletePropertySet($cloud_pk, $ifc_pk, $project_pk)\n {\n $this->bulkDeletePropertySetWithHttpInfo($cloud_pk, $ifc_pk, $project_pk);\n }",
"public function deleteJsonWebKeySet($set)\n {\n list($response) = $this->deleteJsonWebKeySetWithHttpInfo($set);\n return $response;\n }",
"public function assignProductsToPublishSet($publishSet, $responseFields = null)\r\n\t{\r\n\t\t$mozuClient = PublishingScopeClient::assignProductsToPublishSetClient($publishSet, $responseFields);\r\n\t\t$mozuClient = $mozuClient->withContext($this->apiContext);\r\n\t\t$mozuClient->execute();\r\n\t\treturn $mozuClient->getResult();\r\n\r\n\t}",
"public static function delete($product): void\n {\n $product->delete();\n }",
"public function delete($publicacion);",
"public function actionDeleteProduct()\n\t{\n\t\t$post = Yii::$app->request->post();\n\n\t\t$product = Product::findOne(['id' => $post['id']]);\n\t\t$product->deleteProduct();\n\n\t\treturn $product;\n\t}",
"public function\n\t\tdelete()\n\t{\n\t\t\n\t\t$product_id = $this->get_product_id();\n\t\t\n\t\t#echo \"\\$product_id: $product_id\\n\";\n\t\t\n\t\t$affected_rows = Database_ModifyingStatementHelper\n\t\t\t::apply_statement(\n\t\t\t\tnew Database_SQLUpdateStatement(\n<<<SQL\nUPDATE\n\thpi_trackit_stock_management_products\nSET\n\tdeleted = 'Yes'\nWHERE\n\tproduct_id = '$product_id'\nSQL\n\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t#echo \"\\$affected_rows: $affected_rows\\n\";\n\t}",
"public function deleteJsonWebKeySetWithHttpInfo($set)\n {\n // verify the required parameter 'set' is set\n if ($set === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $set when calling deleteJsonWebKeySet');\n }\n // parse inputs\n $resourcePath = \"/keys/{set}\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // path params\n if ($set !== null) {\n $resourcePath = str_replace(\n \"{\" . \"set\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($set),\n $resourcePath\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'DELETE',\n $queryParams,\n $httpBody,\n $headerParams,\n null,\n '/keys/{set}'\n );\n\n return [null, $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 401:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\HydraSDK\\Model\\GenericError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 403:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\HydraSDK\\Model\\GenericError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 500:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\HydraSDK\\Model\\GenericError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function deletePropertySet($cloud_pk, $id, $ifc_pk, $project_pk)\n {\n $this->deletePropertySetWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk);\n }",
"public function destroy(Product $products)\n\t{\n\t\t$products->delete();\n\t\t$this->deletePhoto($products);\n\t\tflash()->success('Success', 'Product has been removed');\n\n\t\treturn back();\n\t}",
"public function destroy(PropuestaMateriaPrima $propuestaMateriaPrima)\n {\n //\n }",
"public function teamBuilderConfigsIdProductSizesNkProductsDelete($id, $nk)\n {\n list($response) = $this->teamBuilderConfigsIdProductSizesNkProductsDeleteWithHttpInfo($id, $nk);\n return $response;\n }",
"public function destroy(Productos $productos)\n {\n //\n }",
"public function destroy(Productos $productos)\n {\n //\n }"
] | [
"0.69112617",
"0.5023493",
"0.49296474",
"0.47648236",
"0.47648236",
"0.4717515",
"0.46506593",
"0.4628754",
"0.46166727",
"0.46151614",
"0.45788297",
"0.45634305",
"0.45399484",
"0.45289057",
"0.45145953",
"0.45004728",
"0.44744366",
"0.44683743",
"0.44665486",
"0.44652689",
"0.4461957",
"0.43873563",
"0.4384525",
"0.43554324",
"0.4345547",
"0.43364826",
"0.43228632",
"0.43071163",
"0.43065757",
"0.43065757"
] | 0.59706885 | 1 |
Gets the steps content. | protected function get_steps_content( Steps\Steps $steps ): string {
try {
/**
* Steps walker.
*
* @var Steps\Walker $steps_walker Steps walker.
*/
$steps_walker = App::container()->get( Steps\Walker::class );
} catch ( ContainerException $e ) {
return '';
}
return Template::get_template(
'components/steps',
[
'content' => $steps_walker->walk( $steps->all(), $this->steps_walker_max_depth, $this->build_steps_context() ),
'pagination_items' => $this->get_steps_pagination_items(),
]
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get() {\n\t\t$step =& $this->_steps[$this->_current_step];\n\t\t$content = $step->get();\n\t\tif($this->_error) {\n\t\t\t$content = \"<div class='error_message_block'>\" . $this->_error . \"</div><br><br>\"\n\t\t\t\t\t . $content;\n\t\t}\n\t\t\n\t\treturn $content;\n\t}",
"public function getSteps()\n {\n }",
"public function getSteps()\n {\n return $this->model\n ->get();\n }",
"public function getContent()\n {\n return $this->evaluatePath($this->path, $this->gatherData());\n }",
"public function steps() {\n\t\treturn $this->steps;\n\t}",
"protected final function getSteps()\n {\n if (!$this->steps) {\n $this->steps = $this->createSteps();\n }\n\n return $this->steps;\n }",
"public function getSteps()\n {\n return $this->steps;\n }",
"public function getContent(){\n return $this->getPage();\n }",
"public function index()\n {\n $Steps = Step::latest()->get();\n\n return $Steps;\n }",
"public function getContent()\n {\n return $this->filesystem->get($this->path);\n }",
"public function getContents() {\n\t\treturn $this->content;\n\t}",
"static function getBody(){\n\t\t$step = 'getStep' . we_base_request::_(we_base_request::INT, \"step\", \"0\");\n\t\treturn self::getPage(self::$step());\n\t}",
"public function getContent() {\n return file_get_contents($this->path);\n }",
"public function getSteps()\n {\n $payload = '';\n\n $data = $this->sendRequest(self::FUNCTION_GET_STEPS, $payload);\n\n $payload = unpack('V1steps', $data);\n\n return IPConnection::fixUnpackedInt32($payload['steps']);\n }",
"protected function getContents()\n {\n return $this->engine->get($this->path, $this->gatherData());\n }",
"public function getContents()\n {\n return $this->contents;\n }",
"public function getContents()\n {\n return $this->contents;\n }",
"public function getContents()\n {\n return $this->contents;\n }",
"public function getContents()\n {\n return $this->contents;\n }",
"public function getContents()\n {\n return $this->contents;\n }",
"public function getContents() {\n return $this->contents;\n }",
"public function getSteps()\n {\n if (!$this->running) return $this->steps;\n return $this->preloadedSteps;\n }",
"public function getContents() {\n\t\treturn $this->contents;\n\t}",
"public function getContents() { return $this->contents; }",
"public function getContent() {\n return $this->content;\n }",
"public function getContent() {\n return $this->content;\n }",
"public function getContent() {\n return $this->content;\n }",
"public function getContent() {\n return $this->content;\n }",
"public function getContent()\n {\n return $this->content;\n }",
"public function getContent()\n {\n return $this->get(self::CONTENT);\n }"
] | [
"0.7476887",
"0.67499965",
"0.66861975",
"0.66755056",
"0.6629175",
"0.6609556",
"0.654312",
"0.65227956",
"0.63803774",
"0.6304101",
"0.62084526",
"0.62078273",
"0.6183584",
"0.61793387",
"0.6176945",
"0.61517686",
"0.61517686",
"0.61517686",
"0.61517686",
"0.61517686",
"0.614751",
"0.61197144",
"0.6085187",
"0.60681796",
"0.60589164",
"0.60589164",
"0.60589164",
"0.60586405",
"0.60577047",
"0.6052989"
] | 0.69081646 | 1 |
Builds the context for the steps. | protected function build_steps_context(): array {
return self::build_steps_context_from_trait( $this->model );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function buildSteps()\n {\n foreach ($this->steps as $name => $parameters) {\n $step = $this->stepBuilder->build(\n $name,\n $parameters['type'],\n $this->merge($parameters['options'])\n );\n\n if (null !== $step) {\n $this->map->addStep($name, $step);\n }\n\n if (null === $this->map->getFirstStepName() || $step->isFirst()) {\n $this->map->setFirstStepName($name);\n }\n }\n }",
"protected function defineSteps() {\n\n\t}",
"public function build() {\n\n // If we have decided not to backup activities, prevent anything to be built\n if (!$this->get_setting_value('activities')) {\n $this->built = true;\n return;\n }\n\n // Add some extra settings that related processors are going to need\n $this->add_setting(new backup_activity_generic_setting(backup::VAR_MODID, base_setting::IS_INTEGER, $this->moduleid));\n $this->add_setting(new backup_activity_generic_setting(backup::VAR_COURSEID, base_setting::IS_INTEGER, $this->get_courseid()));\n $this->add_setting(new backup_activity_generic_setting(backup::VAR_SECTIONID, base_setting::IS_INTEGER, $this->sectionid));\n $this->add_setting(new backup_activity_generic_setting(backup::VAR_MODNAME, base_setting::IS_FILENAME, $this->modulename));\n $this->add_setting(new backup_activity_generic_setting(backup::VAR_ACTIVITYID, base_setting::IS_INTEGER, $this->activityid));\n $this->add_setting(new backup_activity_generic_setting(backup::VAR_CONTEXTID, base_setting::IS_INTEGER, $this->contextid));\n\n // Create the activity directory\n $this->add_step(new create_taskbasepath_directory('create_activity_directory'));\n\n // Generate the module.xml file, containing general information for the\n // activity and from its related course_modules record and availability\n $this->add_step(new backup_module_structure_step('module_info', 'module.xml'));\n\n // Annotate the groups used in already annotated groupings\n $this->add_step(new backup_annotate_groups_from_groupings('annotate_groups'));\n\n // Here we add all the common steps for any activity and, in the point of interest\n // we call to define_my_steps() is order to get the particular ones inserted in place.\n $this->define_my_steps();\n\n // Generate the roles file (optionally role assignments and always role overrides)\n $this->add_step(new backup_roles_structure_step('activity_roles', 'roles.xml'));\n\n // Generate the filter file (conditionally)\n if ($this->get_setting_value('filters')) {\n $this->add_step(new backup_filters_structure_step('activity_filters', 'filters.xml'));\n }\n\n // Generate the comments file (conditionally)\n if ($this->get_setting_value('comments')) {\n $this->add_step(new backup_comments_structure_step('activity_comments', 'comments.xml'));\n }\n\n // Generate the userscompletion file (conditionally)\n if ($this->get_setting_value('userscompletion')) {\n $this->add_step(new backup_userscompletion_structure_step('activity_userscompletion', 'completion.xml'));\n }\n\n // Generate the logs file (conditionally)\n if ($this->get_setting_value('logs')) {\n $this->add_step(new backup_activity_logs_structure_step('activity_logs', 'logs.xml'));\n }\n\n // Fetch all the activity grade items and put them to backup_ids\n $this->add_step(new backup_activity_grade_items_to_ids('fetch_activity_grade_items'));\n\n // Generate the grades file\n $this->add_step(new backup_activity_grades_structure_step('activity_grades', 'grades.xml'));\n\n // Annotate the scales used in already annotated outcomes\n $this->add_step(new backup_annotate_scales_from_outcomes('annotate_scales'));\n\n // NOTE: Historical grade information is saved completely at course level only (see 1.9)\n // not per activity nor per selected activities (all or nothing).\n\n // Generate the inforef file (must be after ALL steps gathering annotations of ANY type)\n $this->add_step(new backup_inforef_structure_step('activity_inforef', 'inforef.xml'));\n\n // Migrate the already exported inforef entries to final ones\n $this->add_step(new move_inforef_annotations_to_final('migrate_inforef'));\n\n // At the end, mark it as built\n $this->built = true;\n }",
"function _get_context(){\n return end($this->_build_context);\n }",
"function _set_context($context){\n $default = array(\n 'object' => NULL,\n 'child_object' => NULL,\n 'field' => NULL,\n 'delta' => NULL,\n 'raw_value' => NULL,\n 'value_to_insert' => NULL,\n 'schema' => NULL\n );\n $this->_build_context[] = (object)array_merge($default, $context);\n }",
"protected abstract function initSteps();",
"public function build() {\n\t\tif (($this->_current_step == 0) && $this->_persistent_state && ($this->_wizard_state->id != NULL) && ($this->_wizard_state->wizard == $this->_name)) {\n\t\t\t$this->_ask_resume();\n\t\t} else {\n\t\t\t$this->_build_wizard();\n\t\t}\n\t}",
"abstract protected function getContext();",
"public function context();",
"public function context();",
"function add_to_context( $context ) {\n\n\t\t// Our menu occurs on every page, so we add it to the global context.\n\t\t$context['menu'] = new Timber\\Menu(\"Header Menu\");\n\t\t// $context['footer_menu'] = new Timber\\Menu(\"Footer Menu\");\n\n\t\t// Footer navs - split into 4 columns\n\t\t$context['footer_nav_i'] = new TimberMenu('Footer Nav 1');\n\t\t$context['footer_nav_ii'] = new TimberMenu('Footer Nav 2');\n\t\t$context['footer_nav_iii'] = new TimberMenu('Footer Nav 3');\n\t\t$context['footer_nav_iv'] = new TimberMenu('Footer Nav 4');\n\t\t$context['footer_nav_v'] = new TimberMenu('Footer Nav 5');\n\n\t\t// Add SVG revision hash to context\n\t\tif(file_exists(get_stylesheet_directory().'/assets/images/icons.svg')) {\n\t\t\t$context['svg_sprite_version'] = hash_file('crc32', (get_stylesheet_directory().'/assets/images/icons.svg'));\n\t\t}\n\n\t\t$context['options'] = get_fields('option');\n\n\t\t// Latest News\n\t\t\t$args = array(\n\t\t\t\t'post_type' \t\t=> 'post',\n\t\t\t\t'posts_per_page'\t=> 4,\n\t\t\t);\n\t\t\t$context['latest_news'] = Timber::get_posts($args);\n\n\t\t// This 'site' context below allows you to access main site information like the site title or description.\n\t\t$context['site'] = $this;\n\t\treturn $context;\n\t}",
"public function gatherContexts(BeforeScenarioScope $scope)\n {\n\n $environment = $scope->getEnvironment();\n $this->minkContext = $environment->getContext(MinkContext::class);\n }",
"public function assemble(ContextInterface $context);",
"public function gatherContexts(BeforeScenarioScope $scope)\n {\n $environment = $scope->getEnvironment();\n $this->minkContext = $environment->getContext(MinkContext::class);\n }",
"private function do_steps()\n {\n }",
"public function exec(AContext $ctx): AContext {\n if ($ctx->state == AContext::DEF_STATE_ACTIVE) {\n\n /* get step's local data from the context */\n $customerId = $ctx->getCustomerId();\n\n /* step's activity */\n /* TODO: add authorization */\n $request = new \\Praxigento\\Core\\Api\\App\\Web\\Request();\n $dev = new \\Praxigento\\Core\\Api\\App\\Web\\Request\\Dev();\n $dev->setCustId($customerId);\n $request->setDev($dev);\n $customerId = $this->authenticator->getCurrentUserId($request);\n\n /* put step's result data back into the context */\n $ctx->setCustomerId($customerId);\n }\n return $ctx;\n }",
"public function process( BootstrapState $state ) {\n\t\t$context_manager = new ContextManager();\n\n\t\t$contexts = [\n\t\t\tContext::CLI => new Context\\Cli(),\n\t\t\tContext::ADMIN => new Context\\Admin(),\n\t\t\tContext::FRONTEND => new Context\\Frontend(),\n\t\t\tContext::AUTO => new Context\\Auto( $context_manager ),\n\t\t];\n\n\t\t$contexts = WP_CLI::do_hook( 'before_registering_contexts', $contexts );\n\n\t\tforeach ( $contexts as $name => $implementation ) {\n\t\t\t$context_manager->register_context( $name, $implementation );\n\t\t}\n\n\t\t$state->setValue( 'context_manager', $context_manager );\n\n\t\treturn $state;\n\t}",
"public function &context();",
"public function getContext();",
"public function getContext();",
"public function getContext();",
"public function getContext();",
"public function getContext();",
"public function getContext();",
"abstract protected function define_my_steps();",
"protected function _loadSteps()\r\n {\r\n $this\r\n ->addStep('Rootd_Installer_Step1')\r\n ->addStep('Rootd_Installer_Step2')\r\n ->addStep('Rootd_Installer_Step3')\r\n ;\r\n\r\n return $this;\r\n }",
"public function before(BeforeScenarioScope $scope): void {\n\t\t// Get the environment\n\t\t$environment = $scope->getEnvironment();\n\t\t// Get all the contexts you need in this context\n\t\t$this->webUIGeneralContext = $environment->getContext('WebUIGeneralContext');\n\t\t$this->featureContext = $environment->getContext('FeatureContext');\n\t}",
"private function build()\n {\n $this->user = User::create([\n 'name' => 'John Lennon',\n 'email' => '[email protected]',\n 'password' => 'secret',\n ]);\n\n $this->school = School::create([\n 'name' => 'Standard Academy',\n 'user_id' => $this->user->id,\n ]);\n\n $this->department = Department::create([\n 'name' => 'Physics',\n 'user_id' => $this->user->id,\n ]);\n }",
"protected function processSteps()\n {\n return [\n Steps\\CheckConditionsAndSetup::class,\n Steps\\StubReplaceSimple::class,\n //Steps\\StubReplaceDocBlock::class,\n Steps\\StubReplaceImportsAndTraits::class,\n\n Steps\\WriteFile::class,\n ];\n }",
"private static function buildUserContext()\n {\n $dateSegment = date('Y-m-d') . \" 00:00:00\"; // modules will decide, ekom provide one segment per day by default\n $userId = null;\n $connexionData = [];\n\n if (E::userIsConnected()) {\n $userId = E::getUserId();\n// az($_SESSION);\n $connexionData = ConnexionLayer::getConnexionData();\n $userContext = [\n \"time_segment\" => $dateSegment,\n \"user_group_id\" => $connexionData['user_group_id'],\n \"user_group_name\" => $connexionData['user_group_name'],\n \"shipping_country\" => $connexionData['default_shipping_country'],\n \"billing_country\" => $connexionData['default_billing_country'],\n ];\n\n\n } else {\n $userContext = [\n \"time_segment\" => $dateSegment,\n \"user_group_id\" => null,\n \"user_group_name\" => null,\n \"shipping_country\" => null,\n \"billing_country\" => null,\n ];\n }\n\n /**\n * userId=null means the user is not connected and the connexionData is empty.\n * Note: it is recommended that you don't create new data with this hook,\n * but rather just use the data that you create in the\n * Ekom_Connexion_decorateUserConnexionData hook, which is called\n * only when the user connects or the data changes, whereas the hooks\n * below gets called on every page (i.e. you don't want to create an\n * unnecessary sql query on every request...).\n */\n Hooks::call(\"Ekom_UserContext_decorateUserContext\", $userContext, $connexionData, $userId);\n self::$userContext = $userContext;\n }"
] | [
"0.5744939",
"0.56169945",
"0.55137247",
"0.5496072",
"0.54951644",
"0.54620254",
"0.5301138",
"0.52849257",
"0.5203783",
"0.5203783",
"0.51891196",
"0.5168225",
"0.51642233",
"0.5151316",
"0.5105621",
"0.5098564",
"0.5074131",
"0.506381",
"0.5050931",
"0.5050931",
"0.5050931",
"0.5050931",
"0.5050931",
"0.5050931",
"0.5023236",
"0.4979531",
"0.4973332",
"0.49631545",
"0.49381575",
"0.49310088"
] | 0.69957674 | 0 |
Gets the current steps page number. | protected function get_current_steps_page(): int {
if ( 0 === $this->steps_current_page ) {
$this->steps_current_page = min(
max( 1, intval( $_GET['steps_page'] ?? 1 ) ),
$this->get_total_steps_pages()
);
}
return $this->steps_current_page;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCurrentPageNumber();",
"protected function getCurrentPage()\n {\n return (int)$this->start_page_number;\n }",
"public function getCurrentPageNumber()\n {\n return $this->currentPage;\n }",
"public function getCurrentPageNumber()\n\t{\n\t\treturn $this->currentPage;\n\t}",
"public function currentPage()\n\t{\n\t\treturn $this->number;\n\t}",
"public function getCurrentPage(): int\n {\n return $this->page;\n }",
"public function getCurrentPage(): int\n {\n return $this->currentPage;\n }",
"public function getCurrentPage(): int\n {\n return $this->currentPage;\n }",
"public function getPage() : int\n {\n return $this->page;\n }",
"public function currentPageNumber() {\n // if there is no page number available, return the default page number\n if (is_null($this->pagination) || !isset($this->pagination->page)) {\n return 1;\n }\n\n // return the page number\n return $this->pagination->page;\n }",
"public function get_current_page() {\r\n\t\t\treturn (int) us_arr_path( $this->data, 'paged', 0 );\r\n\t\t}",
"public function getCurrentStepIndex()\r\n {\r\n $currentStep = $this->getCurrentStep();\r\n $index = 1;\r\n\r\n foreach (self::$_steps as $key => $value) {\r\n if ($key == $currentStep) {\r\n return $index;\r\n }\r\n\r\n $index++;\r\n }\r\n\r\n return 1;\r\n }",
"function getCurrentStep(){\n return isset( $this->aSteps[$this->currentstep] ) ? $this->currentstep : 1;\n }",
"public function getCurrentPage()\n {\n return (int)$this->pageInputOption->getValue();\n }",
"public function getCurrentPage(): int {\n\n\t\treturn $this->page;\n\t}",
"public function getPage(): int\n {\n return $this->page;\n }",
"public function getPage(): int\n {\n return $this->page;\n }",
"public function getPage(): int\n {\n return $this->page;\n }",
"public function get_steps_number(): int {\n\t\t/**\n\t\t * Filters the steps numbers.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param int $steps_number Step steps number.\n\t\t * @param Step $step Step object.\n\t\t *\n\t\t * @ignore\n\t\t */\n\t\treturn (int) apply_filters( 'learndash_template_step_steps_number', $this->steps_number, $this );\n\t}",
"public function getCurrentPageIndex(): int;",
"public function getCurrentPage()\n {\n // Calculate current page\n if ($this->getLimit() > 0) {\n return (int) (ceil($this->getLimitstart()/$this->getLimit())+1);\n } else {\n return 0;\n }\n }",
"public function getCurrentStep()\r\n {\r\n $stepData = $this->getStepData();\r\n\r\n return $stepData['current_step'];\r\n }",
"public function getPageNumber()\n {\n return $this->pageNumber;\n }",
"public function getCurrentPage()\n {\n return $this->getData('current_page') ? $this->getData('current_page') : 1;\n }",
"public function getCurrentPage()\n {\n return $this->getData('current_page') ? $this->getData('current_page') : 1;\n }",
"public function getCurrentPage()\n {\n return $this->getData('current_page') ? $this->getData('current_page') : 1;\n }",
"public function getCurrentPage()\n {\n return $this->getData('current_page') ? $this->getData('current_page') : 1;\n }",
"public function getCurrentPage()\n {\n return ($this->currentRequest->getStart() / $this->numRecordsPerPage) + 1;\n }",
"function page_num () {\n\t\treturn ($this->_page_num);\n\t}",
"public function getNextPageNo() {\n\t\treturn $this->next_page_no;\n\t}"
] | [
"0.7734464",
"0.77138865",
"0.767466",
"0.76217824",
"0.7540286",
"0.7436276",
"0.73983717",
"0.73983717",
"0.73703784",
"0.7367272",
"0.73625094",
"0.73593104",
"0.73418033",
"0.73403937",
"0.7320025",
"0.7317775",
"0.7317775",
"0.7317775",
"0.7288335",
"0.7243883",
"0.72205365",
"0.7217665",
"0.72078615",
"0.7200448",
"0.7200448",
"0.7200448",
"0.7200448",
"0.7142118",
"0.7104908",
"0.7090627"
] | 0.8679471 | 0 |
Gets the steps total pages. | protected function get_total_steps_pages(): int {
if ( $this->get_steps_page_size() <= 0 ) {
return 1;
}
$result = ceil( $this->get_total_steps() / $this->get_steps_page_size() );
return (int) $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTotalPages()\n {\n return $this->totalPages;\n }",
"public function getTotalPages()\n {\n return $this->totalPages;\n }",
"public function getTotalPages()\n {\n return count($this->pages);\n }",
"public function getTotalSteps()\n {\n return $this->getTotal(UtilsDatatype::STEP_NUMBER);\n }",
"private function get_total_pages() {\n\n\t\treturn ceil( $this->total_records / $this->records_per_page );\n\t}",
"function getTotalPages () {\r\n return $this->totalPages;\r\n }",
"public function getTotalPages()\n {\n return (int)$this->totalPages;\n }",
"public function getPages()\n {\n if ($this->getLimit() > 0 && $this->getTotal() > 0) {\n // Calculate number of pages\n return (int) ceil($this->getTotal()/$this->getLimit());\n } else {\n return 0;\n }\n }",
"public function getTotalSteps()\r\n {\r\n return count(self::$_steps);\r\n }",
"public function pages()\n\t{\n\t\treturn ceil($this->total/$this->max);\n\t}",
"public function getTotalPages()\n {\n return $this->getNbPages();\n }",
"public function getTotalPages()\n\t{\n\t\tif( isset($this->total_entries) && isset($this->per_page) )\n\t\t{\n\t\t\treturn ceil($this->total_entries / $this->per_page);\n\t\t}\n\t\t\n\t\treturn 0;\n\t}",
"public function GetTotalPages()\n\t{\n\t\treturn ($this->totalResults / $this->pageSize + 1);\n\t}",
"public function getTotalPages()\n {\n return (int) ceil($this->totalItems / $this->itemsPerPage);\n }",
"public function getTotalSteps()\n {\n if (! isset($this->_totalSteps)) {\n // Default\n $this->_totalSteps = 0;\n\n // Get export\n $export = craft()->amForms_exports->getExportById($this->getSettings()->exportId);\n if ($export) {\n $this->_export = $export;\n $this->_totalSteps = ceil($export->total / $this->getSettings()->batchSize);\n\n // No records, so it's already finished\n if ($this->_totalSteps == 0) {\n $this->_export->finished = true;\n craft()->amForms_exports->saveExport($this->_export);\n }\n }\n }\n\n return $this->_totalSteps;\n }",
"public function get_total_pages(){\n $count = $this->get_total_items();\n if (!$count) return 0;\n $count = ($count / $this->itemsforpage);\n return (int) ceil($count);\n }",
"public function getTotalPage()\n\t{\n\t\treturn $this->totalPage;\n\t}",
"public function totalPages() {\n return ceil($this->totalCount/$this->perPage);\n }",
"public function totalPage()\n {\n return $this->total_page;\n }",
"public function getTotalPageList()\n {\n global $My_Sql;\n\n return $this->getTotal($My_Sql['countPageList']);\n }",
"public function get_total_pages_saved(){\n $count = $this->get_total_items_saved();\n if (!$count) return 0;\n $count = ($count / $this->itemsforpage);\n return (int) ceil($count);\n }",
"function getTotalSteps(){\n return sizeof( $this->aSteps );\n }",
"public function getTotalPages() : int\n {\n if ($this->resultsCount < 1) {\n return 0;\n }\n\n return ceil($this->resultsCount / $this->itemsPerPage);\n }",
"public function getNumberOfPages() {\n return $this->pages;\n }",
"public function getNumPages() {\n //display all in one page\n $this->numpages = 1;\n if (($this->limit < 1) || ($this->limit > $this->count())) {\n $this->numpages = 1;\n } else {\n\n //Calculate rest numbers from dividing operation so we can add one\n //more page for this items\n $restItemsNum = $this->count() % $this->limit;\n //if rest items > 0 then add one more page else just divide items\n //by limit\n\n $restItemsNum > 0 ? $this->numpages = intval($this->count() / $this->limit) + 1 : $this->numpages = intval($this->count() / $this->limit);\n }\n return $this->numpages;\n }",
"protected function numberOfPages()\r\n {\r\n $this->prepare();\r\n return ceil($this->items_total / $this->items_per_page);\r\n }",
"public function getTotalPages() {\n return $this->isPaginated() ? $this->constraints->getRecordPage($this->getTotalRecords()) : null;\n }",
"function getPageTotal() {\n return self::$pageTotal = count(self::$parsedResults);\n }",
"public function getNumPages() {\n return $this->numPages;\n }",
"public function getStepsCount() {\n return $this->count(self::STEPS);\n }"
] | [
"0.77492344",
"0.77492344",
"0.7731565",
"0.7700411",
"0.76912487",
"0.7664149",
"0.7636047",
"0.7570215",
"0.7561603",
"0.75565463",
"0.7536455",
"0.75311476",
"0.751863",
"0.7500064",
"0.7472996",
"0.7448598",
"0.73866445",
"0.7310893",
"0.72305304",
"0.7205647",
"0.7167261",
"0.70999706",
"0.7040238",
"0.698559",
"0.693756",
"0.69024134",
"0.6893431",
"0.6874718",
"0.6829502",
"0.67924166"
] | 0.8439463 | 0 |
Tests that a curator list can be created with default parameters. The created list is deleted at the end of the test. | public function testCreateDefaultList(): void
{
try {
// Create list.
$response = self::fetchOneSync(new PutCuratorList(self::$session, self::CURATOR_ID, new CuratorList));
self::assertArrayHasKey('clanid', $response);
self::assertSame(self::CURATOR_ID, $response['clanid']);
self::assertArrayHasKey('listid', $response);
self::assertIsString($listId = $response['listid']);
self::assertNotEmpty($listId);
} finally {
self::deleteList($listId);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testGetCuratorLists(): void\n {\n $list = new CuratorList;\n $list->setTitle($title = 'foo');\n $list->setDescription($desc = 'bar');\n\n try {\n // Create list.\n $response = self::fetchOneSync(new PutCuratorList(self::$session, self::CURATOR_ID, $list));\n\n self::assertArrayHasKey('listid', $response);\n self::assertNotEmpty($listId = $response['listid']);\n\n // Fetch list.\n $list = self::fetchList($listId);\n self::assertSame($list['title'], $title);\n self::assertSame($list['blurb'], $desc);\n } finally {\n self::deleteList($listId);\n }\n }",
"public function testReorderCuratorList(): void\n {\n self::createReview($appId1 = 20);\n self::createReview($appId2 = 30);\n\n try {\n // Create list.\n $curatorList = new CuratorList;\n $curatorList->setTitle('foo');\n\n $response = self::fetchOneSync(new PutCuratorList(self::$session, self::CURATOR_ID, $curatorList));\n self::assertArrayHasKey('listid', $response);\n self::assertNotEmpty($listId = $response['listid']);\n\n // Add reviews to list.\n self::fetchOneSync(new PutCuratorListApp(self::$session, self::CURATOR_ID, $listId, $appId1));\n self::fetchOneSync(new PutCuratorListApp(self::$session, self::CURATOR_ID, $listId, $appId2));\n\n // Fetch first app from list.\n $list = self::fetchList($listId);\n usort($list['apps'], static function (array $a, array $b) {\n return $a['sort_order'] <=> $b['sort_order'];\n });\n $firstApp = reset($list['apps']);\n\n self::assertSame(\n $appId1,\n $firstApp['recommended_app']['appid'],\n 'App first added listed first.'\n );\n\n // Update list order.\n self::fetchOneSync(\n new PatchCuratorListAppOrder(self::$session, self::CURATOR_ID, $listId, [$appId2, $appId1])\n );\n\n // Fetch first app from list.\n $list = self::fetchList($listId);\n usort($list['apps'], static function (array $a, array $b) {\n return $a['sort_order'] <=> $b['sort_order'];\n });\n $firstApp = reset($list['apps']);\n\n self::assertSame(\n $appId2,\n $firstApp['recommended_app']['appid'],\n 'Second app listed first due to reordering.'\n );\n } finally {\n self::deleteList($listId);\n }\n }",
"public function testListReplies()\n {\n }",
"public function test_creation_defaults_respected() {\n\n\t\twp_set_current_user( $this->user_allowed );\n\n\t\t$course = $this->factory->course->create_and_get();\n\t\t$sample_args = array_merge(\n\t\t\t$this->sample_access_plan_args,\n\t\t\tarray(\n\t\t\t\t'post_id' => $course->get( 'id' ),\n\t\t\t)\n\t\t);\n\n\t\t$response = $this->perform_mock_request(\n\t\t\t'POST',\n\t\t\t$this->route,\n\t\t\t$sample_args\n\t\t);\n\n\t\t/**\n\t\t * see LLMS_REST_Access_Plans_Controller::unset_subordinate_props()\n\t\t */\n\t\t$deps = array(\n\t\t\t'access_length' => 0, // This is not set if 'access_expiration' is not 'limited-period' (default is 'lifetime').\n\t\t\t'access_period' => '', // This is not set if 'access_expiration' is not 'limited-period' (default is 'lifetime').\n\t\t\t'access_expires' => '', // This is not set if 'access_expiration' is not 'limited-period' (default is 'lifetime').\n\n\t\t\t'period' => '' , // This is not set if 'frequency' is 0 (default).\n\n\t\t\t'trial_length' => 0, // This is not set if 'trial_offer' is 'no' (default).\n\t\t\t'trial_period' => '', // This is not set if 'trial_offer' is 'no' (default).\n\t\t);\n\n\t\tforeach ( array_merge( $this->defaults, $deps ) as $prop => $val ) {\n\t\t\t$this->assertEquals( $val, $response->get_data()[$prop], $prop );\n\t\t}\n\n\t}",
"public function testDeleteList()\n\t{\n\t\t$this->markTestIncomplete();\n\t}",
"public function testOptOutListings()\n {\n\n }",
"public function testMakeDefaultChained()\n {\n $params = [\n 'id' => 1122,\n 'userId' => 2341,\n ];\n\n $this->assertEndpointCalled(function () use ($params) {\n $this->client->users($params['userId'])->organizationMemberships($params['id'])->makeDefault();\n }, \"users/{$params['userId']}/organization_memberships/{$params['id']}/make_default.json\", 'PUT');\n }",
"public function testPutCuratorListApp(): void\n {\n self::createReview($appId = 10);\n\n try {\n // Create list.\n $response = self::fetchOneSync(new PutCuratorList(self::$session, self::CURATOR_ID, new CuratorList));\n\n self::assertArrayHasKey('listid', $response);\n self::assertNotEmpty($listId = $response['listid']);\n\n // Add review to list.\n self::fetchOneSync(new PutCuratorListApp(self::$session, self::CURATOR_ID, $listId, $appId));\n\n // Delete review from list.\n self::fetchOneSync(new DeleteCuratorListApp(self::$session, self::CURATOR_ID, $listId, $appId));\n } finally {\n self::deleteList($listId);\n }\n }",
"public function testListListings()\n {\n\n }",
"function testCaseList() {\n\n\t}",
"function test_construct_placeholder() {\n\t\tdo_action( 'customize_register', $this->wp_customize );\n\t\t$default = array(\n\t\t\t'title' => 'Lorem',\n\t\t\t'description' => 'ipsum',\n\t\t\t'menu_item_parent' => 123,\n\t\t);\n\t\t$setting = new WP_Customize_Nav_Menu_Item_Setting( $this->wp_customize, 'nav_menu_item[-5]', compact( 'default' ) );\n\t\t$this->assertSame( -5, $setting->post_id );\n\t\t$this->assertNull( $setting->previous_post_id );\n\t\t$this->assertSame( $default, $setting->default );\n\t}",
"public function testGetOwnerList()\n {\n $this->assertTrue(true);\n }",
"public function testList(){\n $this->browse(function (Browser $browser) {\n $customFieldGroup = factory(CustomFieldGroup::class)->create();\n\n $browser->loginAs($this->getAnAdmin()->userID, 'admin')\n ->visit('admin/'.\\App::getLocale().'/custom-fields/list')\n ->waitUntilMissing('@spinner')\n ->assertVisible('@customFieldsListComponent');\n\n CustomFieldGroup::destroy($customFieldGroup->customFieldGroupID);\n });\n }",
"public function testConstructorWorks() {\n $this->assertInstanceOf('NYPL\\Bibliophpile\\ItemLists', $this->lists);\n }",
"public function testConstructTWeakList()\n\t{\n\t\t$this->list = new $this->_baseClass();\n\t\tself::assertTrue($this->list->getDiscardInvalid());\n\t\t\t\n\t\t$this->list = new $this->_baseClass(null, false);\n\t\tself::assertTrue($this->list->getDiscardInvalid());\n\t\t\n\t\t$this->list = new $this->_baseClass(null, false, true);\n\t\tself::assertTrue($this->list->getDiscardInvalid());\n\t\t\n\t\t$this->list = new $this->_baseClass(null, false, false);\n\t\tself::assertFalse($this->list->getDiscardInvalid());\n\t\t\n\t\t$this->list = new $this->_baseClass(null, true);\n\t\tself::assertFalse($this->list->getDiscardInvalid());\n\t\t\n\t\t$this->list = new $this->_baseClass(null, true, true);\n\t\tself::assertTrue($this->list->getDiscardInvalid());\n\t\t\n\t\t$this->list = new $this->_baseClass(null, true, false);\n\t\tself::assertFalse($this->list->getDiscardInvalid());\n\t\t\n\t\t$eventHandler1 = new TEventHandler([$this->item3, 'myHandler'], 77);\n\t\t$eventHandler2 = new TEventHandler($eventHandler1, 88);\n\t\t$list = new $this->_baseClass([$this->item1, $this->item2, $this->item3, $this->item4, $eventHandler1, $eventHandler2], true);\n\t\t$this->item2 = null;\n\t\t$this->item3 = null;\n\t\tself::assertEquals(6, $list->getCount());\n\t\tself::assertEquals($this->item1, $list[0]);\n\t\tself::assertNull($list[1]);\n\t\tself::assertNull($list[2]);\n\t\tself::assertEquals($this->item4, $list[3]);\n\t\tself::assertNull($list[4]);\n\t\tself::assertNull($list[5]);\n\t\t\n\t\t$this->item2 = new $this->_baseItemClass(2);\n\t\t$this->item3 = new $this->_baseItemClass(3);\n\t\t$eventHandler1 = new TEventHandler([$this->item3, 'myHandler'], 70);\n\t\t$eventHandler2 = new TEventHandler($eventHandler1, 71);\n\t\t$list = new $this->_baseClass([$this->item1, $this->item2, $this->item3, $this->item4, $eventHandler1, $eventHandler2], false);\n\t\t$this->item2 = null;\n\t\t$this->item3 = null;\n\t\tself::assertEquals(2, $list->getCount());\n\t\tself::assertEquals($this->item1, $list[0]);\n\t\tself::assertEquals($this->item4, $list[1]);\n\t\t\n\t\t$this->item2 = new $this->_baseItemClass(2);\n\t\t$this->item3 = new $this->_baseItemClass(3);\n\t\t$list = new $this->_baseClass([$this->item1, $this->item2, $this->item3, $this->item4], null);\n\t\t$this->item2 = null;\n\t\t$this->item3 = null;\n\t\tself::assertEquals(2, $list->getCount());\n\t\tself::assertEquals($this->item1, $list[0]);\n\t\tself::assertEquals($this->item4, $list[1]);\n\t}",
"public function testAddListWithWrongBoardName()\n {\n $burndownGenerator = new BurndownGenerator($this->getTrelloClientMock());\n $bordName = 'test';\n $listName = 'abc';\n $burndownGenerator->addWipList($listName, $bordName);\n }",
"public function testNewSelect()\n {\n $this->todo('stub');\n }",
"protected function _createOptionList()\n {\n $this->optionList = array();\n $this->optionGroups = array();\n $this->_createOptionMappings();\n }",
"public function testAddListWithWrongName()\n {\n $burndownGenerator = new BurndownGenerator($this->getTrelloClientMock());\n $bordName = $this->getBoardsData()[0]['name'];\n $listName = 'abc';\n $burndownGenerator->addBoard($bordName);\n $burndownGenerator->addWipList($listName);\n }",
"public function createList(){\n global $vues;\n require_once($vues['newList']);\n }",
"private function createDefaultParameters()\n {\n $default = array(\n 'id' => null,\n 'acronym' => null,\n 'name' => null,\n 'hits' => null,\n 'page' => null,\n 'orderby' => 'id',\n 'order' => null\n );\n\n return $default;\n }",
"protected function setListActionTestData(){}",
"public function testMakeDefault()\n {\n $params = [\n 'id' => 1122,\n 'userId' => 2341,\n ];\n\n $this->assertEndpointCalled(\n function () use ($params) {\n $this->client->organizationMemberships()->makeDefault($params);\n },\n \"users/{$params['userId']}/organization_memberships/{$params['id']}/make_default.json\",\n 'PUT'\n );\n }",
"public function testPredefinedProfilesGetNew()\n {\n }",
"public function testGETMetaListsPartners()\n {\n }",
"public function testMenusList()\n {\n }",
"public function testAddTodoListWithoutBoard()\n {\n $burndownGenerator = new BurndownGenerator($this->getTrelloClientMock());\n $bordName = $this->getBoardsData()[0]['name'];\n $listName = $this->getBoardsData()[0]['lists'][0]['name'];\n $burndownGenerator->addBoard($bordName);\n $burndownGenerator->addTodoList($listName);\n\n $this->assertInstanceOf(Cardlist::class, $burndownGenerator->getTodoLists()[0]);\n $this->assertEquals($listName, $burndownGenerator->getTodoLists()[0]->getName());\n $this->assertCount(1, $burndownGenerator->getTodoLists());\n\n $listName = $this->getBoardsData()[0]['lists'][1]['name'];\n $burndownGenerator->addTodoList($listName);\n\n $this->assertInstanceOf(Cardlist::class, $burndownGenerator->getTodoLists()[1]);\n $this->assertCount(2, $burndownGenerator->getTodoLists());\n }",
"public function testGetApiPath() {\n\t\t$jsonpad = parent::_getJsonpadInstance();\n\t\t\n\t\t// Create a list\n\t\t$listData = parent::_createTestListData(false, false);\n\t\t$list = $jsonpad->createList($listData[\"name\"]);\n\t\t$this->assertSame($list->getApiPath(), \"lists/{$listData['name']}\");\n\t\t\n\t\t// Delete the list\n\t\t$list->delete();\n\t}",
"public function testGetRecommendationWithCustomDefaultParameters() {\n\t\t$this->User->Behaviors->load('PredictionIO.Predictionable', array('engine' => 'engine4', 'count' => 52));\n\t\t$this->User->setupClient($this->PredictionIOClient);\n\t\t$this->User->id = 1;\n\n\t\t$expected = array('itemrec_get_top_n', array('pio_engine' => 'engine4', 'pio_n' => 52));\n\t\t$expectedRecommendation = array(\n\t\t\t'piids' => array('Article:1', 'Article:2'),\n\t\t\t'title' => array('first Article', 'second Article'),\n\t\t\t'author' => array('john', 'arthur')\n\t\t);\n\n\t\t$this->PredictionIOClient->expects($this->once())->method('identify')->with($this->equalTo('User:1'));\n\t\t$this->PredictionIOClient->expects($this->once())->method('getCommand')->with(\n\t\t\t$this->equalTo($expected[0]),\n\t\t\t$this->equalTo($expected[1])\n\t\t);\n\t\t$this->PredictionIOClient->expects($this->once())->method('execute')->will($this->returnValue($expectedRecommendation));\n\n\t\t$this->User->getRecommendation();\n\t}",
"function DoList($bbcode, $action, $name, $default, $params, $content) {\n // Allowed list styles, striaght from the CSS 2.1 spec. The only prohibited\n // list style is that with image-based markers, which often slows down web sites.\n $list_styles = Array('1' => 'decimal', '01' => 'decimal-leading-zero', 'i' => 'lower-roman', 'I' => 'upper-roman', 'a' => 'lower-alpha', 'A' => 'upper-alpha');\n $ci_list_styles = Array('circle' => 'circle', 'disc' => 'disc', 'square' => 'square', 'greek' => 'lower-greek', 'armenian' => 'armenian', 'georgian' => 'georgian');\n $ul_types = Array('circle' => 'circle', 'disc' => 'disc', 'square' => 'square');\n $default = trim($default);\n if (!$default)\n $default = $bbcode->tag_rules [$name] ['default'] ['_default'];\n\n if ($action == BBCODE_CHECK) {\n if (!is_string($default) || strlen($default) == \"\")\n return true;\n else if (isset($list_styles [$default]))\n return true;\n else if (isset($ci_list_styles [strtolower($default)]))\n return true;\n else\n return false;\n }\n\n // Choose a list element (<ul> or <ol>) and a style.\n $type = '';\n $elem = 'ul';\n if (!is_string($default) || strlen($default) == \"\") {\n $elem = 'ul';\n } else if ($default == '1') {\n $elem = 'ol';\n } else if (isset($list_styles [$default])) {\n $elem = 'ol';\n $type = $list_styles [$default];\n } else {\n $default = strtolower($default);\n if (isset($ul_types [$default])) {\n $elem = 'ul';\n $type = $ul_types [$default];\n } else if (isset($ci_list_styles [$default])) {\n $elem = 'ol';\n $type = $ci_list_styles [$default];\n }\n }\n\n // Generate the HTML for it.\n if (strlen($type))\n return \"\\n<$elem class=\\\"bbcode_list\\\" style=\\\"list-style-type:$type\\\">\\n$content</$elem>\\n\";\n else\n return \"\\n<$elem class=\\\"bbcode_list\\\">\\n$content</$elem>\\n\";\n }"
] | [
"0.6919307",
"0.58366895",
"0.5689445",
"0.5670093",
"0.5539966",
"0.5483008",
"0.54604304",
"0.5452269",
"0.54206383",
"0.5420069",
"0.5405983",
"0.5370246",
"0.53594744",
"0.524472",
"0.52386105",
"0.52366817",
"0.5235497",
"0.5234514",
"0.5224838",
"0.5201943",
"0.51982075",
"0.51966286",
"0.5184244",
"0.515062",
"0.51340026",
"0.5114478",
"0.5112246",
"0.5109225",
"0.50899136",
"0.5076059"
] | 0.800124 | 0 |
Tests that a curator list can be created with specific parameters and subsequently found in the list of curator lists with those parameters. The created list is deleted at the end of the test. | public function testGetCuratorLists(): void
{
$list = new CuratorList;
$list->setTitle($title = 'foo');
$list->setDescription($desc = 'bar');
try {
// Create list.
$response = self::fetchOneSync(new PutCuratorList(self::$session, self::CURATOR_ID, $list));
self::assertArrayHasKey('listid', $response);
self::assertNotEmpty($listId = $response['listid']);
// Fetch list.
$list = self::fetchList($listId);
self::assertSame($list['title'], $title);
self::assertSame($list['blurb'], $desc);
} finally {
self::deleteList($listId);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testCreateDefaultList(): void\n {\n try {\n // Create list.\n $response = self::fetchOneSync(new PutCuratorList(self::$session, self::CURATOR_ID, new CuratorList));\n\n self::assertArrayHasKey('clanid', $response);\n self::assertSame(self::CURATOR_ID, $response['clanid']);\n\n self::assertArrayHasKey('listid', $response);\n self::assertIsString($listId = $response['listid']);\n self::assertNotEmpty($listId);\n } finally {\n self::deleteList($listId);\n }\n }",
"public function testReorderCuratorList(): void\n {\n self::createReview($appId1 = 20);\n self::createReview($appId2 = 30);\n\n try {\n // Create list.\n $curatorList = new CuratorList;\n $curatorList->setTitle('foo');\n\n $response = self::fetchOneSync(new PutCuratorList(self::$session, self::CURATOR_ID, $curatorList));\n self::assertArrayHasKey('listid', $response);\n self::assertNotEmpty($listId = $response['listid']);\n\n // Add reviews to list.\n self::fetchOneSync(new PutCuratorListApp(self::$session, self::CURATOR_ID, $listId, $appId1));\n self::fetchOneSync(new PutCuratorListApp(self::$session, self::CURATOR_ID, $listId, $appId2));\n\n // Fetch first app from list.\n $list = self::fetchList($listId);\n usort($list['apps'], static function (array $a, array $b) {\n return $a['sort_order'] <=> $b['sort_order'];\n });\n $firstApp = reset($list['apps']);\n\n self::assertSame(\n $appId1,\n $firstApp['recommended_app']['appid'],\n 'App first added listed first.'\n );\n\n // Update list order.\n self::fetchOneSync(\n new PatchCuratorListAppOrder(self::$session, self::CURATOR_ID, $listId, [$appId2, $appId1])\n );\n\n // Fetch first app from list.\n $list = self::fetchList($listId);\n usort($list['apps'], static function (array $a, array $b) {\n return $a['sort_order'] <=> $b['sort_order'];\n });\n $firstApp = reset($list['apps']);\n\n self::assertSame(\n $appId2,\n $firstApp['recommended_app']['appid'],\n 'Second app listed first due to reordering.'\n );\n } finally {\n self::deleteList($listId);\n }\n }",
"public function testPutCuratorListApp(): void\n {\n self::createReview($appId = 10);\n\n try {\n // Create list.\n $response = self::fetchOneSync(new PutCuratorList(self::$session, self::CURATOR_ID, new CuratorList));\n\n self::assertArrayHasKey('listid', $response);\n self::assertNotEmpty($listId = $response['listid']);\n\n // Add review to list.\n self::fetchOneSync(new PutCuratorListApp(self::$session, self::CURATOR_ID, $listId, $appId));\n\n // Delete review from list.\n self::fetchOneSync(new DeleteCuratorListApp(self::$session, self::CURATOR_ID, $listId, $appId));\n } finally {\n self::deleteList($listId);\n }\n }",
"public function testListReplies()\n {\n }",
"public function testDeleteList()\n\t{\n\t\t$this->markTestIncomplete();\n\t}",
"public function testDeleteList(): void\n {\n $event = $this->setupEvent();\n $participation = $this->setupParticipation($event);\n $participationId = $participation->getId();\n $participantIds = $participation->getParticipantsIdList();\n sort($participantIds);\n $column = $this->setupListColumn();\n $list = $this->setupList($event, $column);\n\n $container = self::$kernel->getContainer();\n\n /** @var Registry $doctrine */\n $doctrine = $container->get('doctrine');\n\n /** @var EntityManager $em */\n $em = $doctrine->getManager();\n\n $em->remove($list);\n $em->flush();\n\n $this->assertParticipantsUnaffected($event->getEid(), $participationId, $participantIds);\n }",
"public function testConstructTWeakList()\n\t{\n\t\t$this->list = new $this->_baseClass();\n\t\tself::assertTrue($this->list->getDiscardInvalid());\n\t\t\t\n\t\t$this->list = new $this->_baseClass(null, false);\n\t\tself::assertTrue($this->list->getDiscardInvalid());\n\t\t\n\t\t$this->list = new $this->_baseClass(null, false, true);\n\t\tself::assertTrue($this->list->getDiscardInvalid());\n\t\t\n\t\t$this->list = new $this->_baseClass(null, false, false);\n\t\tself::assertFalse($this->list->getDiscardInvalid());\n\t\t\n\t\t$this->list = new $this->_baseClass(null, true);\n\t\tself::assertFalse($this->list->getDiscardInvalid());\n\t\t\n\t\t$this->list = new $this->_baseClass(null, true, true);\n\t\tself::assertTrue($this->list->getDiscardInvalid());\n\t\t\n\t\t$this->list = new $this->_baseClass(null, true, false);\n\t\tself::assertFalse($this->list->getDiscardInvalid());\n\t\t\n\t\t$eventHandler1 = new TEventHandler([$this->item3, 'myHandler'], 77);\n\t\t$eventHandler2 = new TEventHandler($eventHandler1, 88);\n\t\t$list = new $this->_baseClass([$this->item1, $this->item2, $this->item3, $this->item4, $eventHandler1, $eventHandler2], true);\n\t\t$this->item2 = null;\n\t\t$this->item3 = null;\n\t\tself::assertEquals(6, $list->getCount());\n\t\tself::assertEquals($this->item1, $list[0]);\n\t\tself::assertNull($list[1]);\n\t\tself::assertNull($list[2]);\n\t\tself::assertEquals($this->item4, $list[3]);\n\t\tself::assertNull($list[4]);\n\t\tself::assertNull($list[5]);\n\t\t\n\t\t$this->item2 = new $this->_baseItemClass(2);\n\t\t$this->item3 = new $this->_baseItemClass(3);\n\t\t$eventHandler1 = new TEventHandler([$this->item3, 'myHandler'], 70);\n\t\t$eventHandler2 = new TEventHandler($eventHandler1, 71);\n\t\t$list = new $this->_baseClass([$this->item1, $this->item2, $this->item3, $this->item4, $eventHandler1, $eventHandler2], false);\n\t\t$this->item2 = null;\n\t\t$this->item3 = null;\n\t\tself::assertEquals(2, $list->getCount());\n\t\tself::assertEquals($this->item1, $list[0]);\n\t\tself::assertEquals($this->item4, $list[1]);\n\t\t\n\t\t$this->item2 = new $this->_baseItemClass(2);\n\t\t$this->item3 = new $this->_baseItemClass(3);\n\t\t$list = new $this->_baseClass([$this->item1, $this->item2, $this->item3, $this->item4], null);\n\t\t$this->item2 = null;\n\t\t$this->item3 = null;\n\t\tself::assertEquals(2, $list->getCount());\n\t\tself::assertEquals($this->item1, $list[0]);\n\t\tself::assertEquals($this->item4, $list[1]);\n\t}",
"public function testGetOwnerList()\n {\n $this->assertTrue(true);\n }",
"public function testGetList($params)\n {\n $this->paramTest('lists/show', 'getList', $params);\n }",
"public function testCurrentListIdList($data, $expected) {\n\t\t$this->setupSession($data);\n\n\t\t$results = $this->{$this->modelClass}->currentListId($data['create']);\n\t\tif ($data['create'] && $data['user_id'] != 'bob') {\n\t\t\t$this->assertTrue(strlen($results) == 36, 'Failed to create the list');\n\t\t} else {\n\t\t\t$this->assertEquals($expected, $results);\n\t\t}\n\t}",
"function testCaseList() {\n\n\t}",
"public function testListListings()\n {\n\n }",
"public function testOnListCondition () {\n $contact = $this->contacts ('testUser');\n $list = $this->lists ('testUser');\n $this->assertTrue ($list->hasRecord ($contact));\n\n $params = array (\n 'model' => $contact,\n 'modelClass' => 'Contacts',\n );\n $retVal = $this->executeFlow ($this->x2flow ('flowOnListCondition'), $params);\n\n X2_TEST_DEBUG_LEVEL > 1 && print_r ($retVal['trace']);\n\n // assert flow executed without errors since contact is on list\n $this->assertTrue ($this->checkTrace ($retVal['trace']));\n\n\n $contact = $this->contacts ('testAnyone');\n $this->assertFalse ($list->hasRecord ($contact));\n\n $params = array (\n 'model' => $contact,\n 'modelClass' => 'Contacts',\n );\n $retVal = $this->executeFlow ($this->x2flow ('flowOnListCondition'), $params);\n\n X2_TEST_DEBUG_LEVEL > 1 && print_r ($retVal['trace']);\n\n // assert flow executed with errors since contact is not on list\n $this->assertFalse ($this->checkTrace ($retVal['trace']));\n }",
"public function testList(){\n $this->browse(function (Browser $browser) {\n $customFieldGroup = factory(CustomFieldGroup::class)->create();\n\n $browser->loginAs($this->getAnAdmin()->userID, 'admin')\n ->visit('admin/'.\\App::getLocale().'/custom-fields/list')\n ->waitUntilMissing('@spinner')\n ->assertVisible('@customFieldsListComponent');\n\n CustomFieldGroup::destroy($customFieldGroup->customFieldGroupID);\n });\n }",
"function testCanBuildANestedList() {\n //atleast we know that the recursion is working\n $this->assertPattern(\"/T1.*T2.*T3.*T4/\", $this->strip($this->output)); \n }",
"public function test_getValidCards()\n {\n $cardList = [[\"desc\"=>\"Bus pick up from Bur Dubai to Dubai Airport\",\n \"fromPoint\"=>\"Bur Dubai\",\n \"toPoint\"=>\"Dubai Airport\",\n \"mode\"=>\"Bus\",\n \"seatNo\"=>\"3W332\"\n ],\n [\"desc\"=>\"Flight from Dubai Airport to Dabolim Airport Goa \",\n \"fromPoint\"=>\"Dubai\",\n \"toPoint\"=>\"Goa\",\n \"mode\"=>\"Plane\",\n \"seatNo\"=>\"F43434\"\n ]];\n\n $factoryCard = new \\classes\\FactoryCard();\n $cardReturn = $factoryCard->getCards($cardList);\n\n $this->assertEquals(2, count($cardReturn));\n\n }",
"public function testListParents()\n {\n }",
"public function deleteSelection($list)\n {\n }",
"public function testRefresh() {\n\t\t$jsonpad = parent::_getJsonpadInstance();\n\t\t\n\t\t// Create a list\n\t\t$listData = parent::_createTestListData(false, false);\n\t\t$list = $jsonpad->createList($listData[\"name\"]);\n\t\t\n\t\t// Rename the list\n\t\t$originalListName = $list->getName();\n\t\t$newListName = \"monkey123\";\n\t\t$list->setName($newListName);\n\t\t$this->assertSame($list->getName(), $newListName);\n\t\t\n\t\t// At this point, the list API path should still be using the original list name\n\t\t$this->assertSame($list->getApiPath(), \"lists/$originalListName\");\n\t\t\n\t\t// Refresh the list\n\t\t$list->refresh();\n\t\t$this->assertSame($list->getName(), $originalListName);\n\t\t\n\t\t// Delete the list\n\t\t$list->delete();\n\t}",
"public function testListUniqueness()\n {\n $obj = new RecentlyUsedList();\n $obj->add('First');\n $obj->add('Middle');\n $obj->add('Last');\n $unique_length = $obj->length();\n $obj->add('Middle');\n $this->assertEquals($unique_length, $obj->length(), 'Error: all list items should be unique!');\n $this->assertEquals(array('Middle', 'Last', 'First'), $obj->all(), 'Error: all list items should be unique!');\n }",
"private function _doListsJob($parameters) {\n\t\trequire(wgPaths::getModulePath().'actions/class.lists.php');\n\t\t$class = new subscriptionsActionsLists();\n\t\tif ((bool) $class->init()) { wgError::add('actionok', 2);\n\t\t\treturn true;\n\t\t}\n\t\telse { wgError::add('actionfailed');\n\t\t\treturn false;\n\t\t}\n\t}",
"protected function setListActionTestData(){}",
"public function testBuildListUrl()\n {\n\n $measurement = $this->getMockBuilder('Choccybiccy\\HumanApi\\Endpoint\\MeasurementEndpoint')\n ->setMethods(array(\"buildUrlParts\"))\n ->disableOriginalConstructor()\n ->getMock();\n $type = $this->getProtectedProperty($measurement, \"type\");\n $plural = $this->getProtectedProperty($measurement, \"plural\");\n\n $measurement->expects($this->once())\n ->method(\"buildUrlParts\")\n ->with(array($type, $plural));\n\n $this->runProtectedMethod($measurement, \"buildListUrl\");\n\n }",
"private function _checkList(&$list)\r\n {\r\n \tif ( !($list instanceof Warecorp_List_Item ) ) {\r\n \t\t$list = new Warecorp_List_Item($list);\r\n \t}\r\n }",
"public function testOptOutListings()\n {\n\n }",
"public function testCloudPosCheckAddItemsToCourse()\n {\n }",
"public function testList()\n {\n $response = $this->get('/api/todoLists');\n\n $response->assertStatus(200,'TodoList list failed');\n }",
"public function testNewListSaves()\n\t{\n\t\t// $list = new Mlist;\n\t\t// $list->name = 'Test list';\n\t\t// $list->description = \"Description for test list\";\n\t\t//\n\t\t// $this->assertTrue($list->save());\n\t}",
"public function testGetApiPath() {\n\t\t$jsonpad = parent::_getJsonpadInstance();\n\t\t\n\t\t// Create a list\n\t\t$listData = parent::_createTestListData(false, false);\n\t\t$list = $jsonpad->createList($listData[\"name\"]);\n\t\t$this->assertSame($list->getApiPath(), \"lists/{$listData['name']}\");\n\t\t\n\t\t// Delete the list\n\t\t$list->delete();\n\t}",
"public function testGETMetaListsPartners()\n {\n }"
] | [
"0.62935317",
"0.62769663",
"0.60202396",
"0.58860576",
"0.5880831",
"0.5801634",
"0.56845385",
"0.559999",
"0.5584051",
"0.5569804",
"0.55316615",
"0.5462448",
"0.54018617",
"0.53266805",
"0.52621895",
"0.5250529",
"0.523962",
"0.5204672",
"0.52039355",
"0.5106175",
"0.5068884",
"0.5063868",
"0.503925",
"0.5037883",
"0.50201833",
"0.5016797",
"0.50147253",
"0.5002518",
"0.50014156",
"0.4992623"
] | 0.752743 | 0 |
Tests that a curator list can have its apps reordered after creation and having apps added to it. | public function testReorderCuratorList(): void
{
self::createReview($appId1 = 20);
self::createReview($appId2 = 30);
try {
// Create list.
$curatorList = new CuratorList;
$curatorList->setTitle('foo');
$response = self::fetchOneSync(new PutCuratorList(self::$session, self::CURATOR_ID, $curatorList));
self::assertArrayHasKey('listid', $response);
self::assertNotEmpty($listId = $response['listid']);
// Add reviews to list.
self::fetchOneSync(new PutCuratorListApp(self::$session, self::CURATOR_ID, $listId, $appId1));
self::fetchOneSync(new PutCuratorListApp(self::$session, self::CURATOR_ID, $listId, $appId2));
// Fetch first app from list.
$list = self::fetchList($listId);
usort($list['apps'], static function (array $a, array $b) {
return $a['sort_order'] <=> $b['sort_order'];
});
$firstApp = reset($list['apps']);
self::assertSame(
$appId1,
$firstApp['recommended_app']['appid'],
'App first added listed first.'
);
// Update list order.
self::fetchOneSync(
new PatchCuratorListAppOrder(self::$session, self::CURATOR_ID, $listId, [$appId2, $appId1])
);
// Fetch first app from list.
$list = self::fetchList($listId);
usort($list['apps'], static function (array $a, array $b) {
return $a['sort_order'] <=> $b['sort_order'];
});
$firstApp = reset($list['apps']);
self::assertSame(
$appId2,
$firstApp['recommended_app']['appid'],
'Second app listed first due to reordering.'
);
} finally {
self::deleteList($listId);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testPutCuratorListApp(): void\n {\n self::createReview($appId = 10);\n\n try {\n // Create list.\n $response = self::fetchOneSync(new PutCuratorList(self::$session, self::CURATOR_ID, new CuratorList));\n\n self::assertArrayHasKey('listid', $response);\n self::assertNotEmpty($listId = $response['listid']);\n\n // Add review to list.\n self::fetchOneSync(new PutCuratorListApp(self::$session, self::CURATOR_ID, $listId, $appId));\n\n // Delete review from list.\n self::fetchOneSync(new DeleteCuratorListApp(self::$session, self::CURATOR_ID, $listId, $appId));\n } finally {\n self::deleteList($listId);\n }\n }",
"public function testGetCuratorLists(): void\n {\n $list = new CuratorList;\n $list->setTitle($title = 'foo');\n $list->setDescription($desc = 'bar');\n\n try {\n // Create list.\n $response = self::fetchOneSync(new PutCuratorList(self::$session, self::CURATOR_ID, $list));\n\n self::assertArrayHasKey('listid', $response);\n self::assertNotEmpty($listId = $response['listid']);\n\n // Fetch list.\n $list = self::fetchList($listId);\n self::assertSame($list['title'], $title);\n self::assertSame($list['blurb'], $desc);\n } finally {\n self::deleteList($listId);\n }\n }",
"public function test_loan_application_has_2_borrowers()\n {\n $applications = Application::all();\n foreach ($applications as $application) {\n $this->assertCount(2, $application->borrowers);\n }\n }",
"public function testListOrdering()\n {\n $obj = new RecentlyUsedList();\n $obj->add('First');\n $obj->add('Last');\n $this->assertEquals('Last', $obj->indexAt(0), 'Error: first item in list should be last added!');\n $this->assertEquals('First', $obj->indexAt($obj->length() - 1), 'Error: last-in should be first-out!');\n }",
"public function testMainListAvailable()\n {\n $this->exec('bake controller');\n\n $this->assertExitCode(Shell::CODE_SUCCESS);\n $this->assertOutputContains('- BakeArticles');\n $this->assertOutputContains('- BakeArticlesBakeTags');\n $this->assertOutputContains('- BakeComments');\n $this->assertOutputContains('- BakeTags');\n }",
"public function testListUniqueness()\n {\n $obj = new RecentlyUsedList();\n $obj->add('First');\n $obj->add('Middle');\n $obj->add('Last');\n $unique_length = $obj->length();\n $obj->add('Middle');\n $this->assertEquals($unique_length, $obj->length(), 'Error: all list items should be unique!');\n $this->assertEquals(array('Middle', 'Last', 'First'), $obj->all(), 'Error: all list items should be unique!');\n }",
"public function testListReplies()\n {\n }",
"public function testGetOwnerList()\n {\n $this->assertTrue(true);\n }",
"private function Update_Synced_Apps()\n\t{\n\t\t$synced_id = $this->Get_Synced_Status();\n\t\t$unsynced_id = $this->Get_Un_Synced_Status();\n\n\t\tforeach($this->unsynced_apps as $app)\n\t\t{\n\t\t\t$query = \"UPDATE status_history\n\t\t\t\t\t SET application_status_id = {$synced_id}\n\t\t\t\t\t WHERE application_status_id = {$unsynced_id}\n\t\t\t\t\t\tAND application_id = {$app['application_id']}\";\n\t\t\t\t\n\t\t\t$result = $this->QueryOLP($query);\n\t\t}\n\t\treturn true;\n\t}",
"public function test_organizers_list_is_showing()\n {\n $this->browse(function (Browser $browser) {\n $browser->on(new LoginPage)\n ->loginUser()\n ->visit('/organizers')\n ->assertSee('Organizers management') // The list is empty because the new user didn't create an event yet\n ->logoutUser();\n });\n }",
"public function testGetApp()\n {\n $client = static::createRestClient();\n $client->request('GET', '/core/app/admin');\n $response = $client->getResponse();\n $results = $client->getResults();\n\n $this->assertResponseContentType(self::CONTENT_TYPE, $response);\n $this->assertResponseSchemaRel(self::SCHEMA_URL_ITEM, $response);\n\n $this->assertEquals('admin', $results->id);\n $this->assertEquals('Administration', $results->name->en);\n $this->assertEquals(true, $results->showInMenu);\n\n // we also expect record count headers here\n $this->assertEquals('1', $response->headers->get('x-record-count'));\n\n $this->assertStringContainsString(\n '<http://localhost/core/app/admin>; rel=\"self\"',\n $response->headers->get('Link')\n );\n }",
"public function it_can_create_an_item_in_my_lists_app()\n {\n $this->markTestSkipped('Skipping lists app test');\n DB::beginTransaction();\n $this->logInUser();\n\n $item = [\n 'title' => 'numbat',\n 'body' => 'koala',\n 'priority' => 2,\n 'urgency' => 1,\n 'favourite' => 1,\n 'pinned' => 1,\n 'parent_id' => 468,\n 'category_id' => 1,\n 'not_before' => '2050-02-03 13:30:05'\n ];\n\n// $response = $this->call('POST', 'http://lists.jennyswiftcreations.com/api/items', $item);\n $response = $this->call('POST', 'http://lists.dev:8000/api/items', $item);\n $content = json_decode($response->getContent(), true);\n// dd($content);\n\n $this->checkItemKeysExist($content);\n\n $this->assertEquals('numbat', $content['title']);\n $this->assertEquals('koala', $content['body']);\n $this->assertEquals(2, $content['priority']);\n $this->assertEquals(1, $content['urgency']);\n $this->assertEquals(1, $content['favourite']);\n $this->assertEquals(1, $content['pinned']);\n $this->assertEquals(468, $content['parent_id']);\n $this->assertEquals(1, $content['category_id']);\n $this->assertEquals('2050-02-03 13:30:05', $content['notBefore']);\n\n $this->assertEquals(Response::HTTP_CREATED, $response->getStatusCode());\n\n DB::rollBack();\n }",
"public function testRefresh() {\n\t\t$jsonpad = parent::_getJsonpadInstance();\n\t\t\n\t\t// Create a list\n\t\t$listData = parent::_createTestListData(false, false);\n\t\t$list = $jsonpad->createList($listData[\"name\"]);\n\t\t\n\t\t// Rename the list\n\t\t$originalListName = $list->getName();\n\t\t$newListName = \"monkey123\";\n\t\t$list->setName($newListName);\n\t\t$this->assertSame($list->getName(), $newListName);\n\t\t\n\t\t// At this point, the list API path should still be using the original list name\n\t\t$this->assertSame($list->getApiPath(), \"lists/$originalListName\");\n\t\t\n\t\t// Refresh the list\n\t\t$list->refresh();\n\t\t$this->assertSame($list->getName(), $originalListName);\n\t\t\n\t\t// Delete the list\n\t\t$list->delete();\n\t}",
"public static function groupApps($list)\n {\n // Clear previous errors list\n self::cleanErrors();\n\n $items = self::getAppsData($list);\n $count = count($items);\n\n $result = array();\n\n for ($i = 0; $i < $count; $i++)\n {\n if (!empty($items[$i]->sorted)) {\n continue;\n }\n\n $title1 = $items[$i]->getTitle();\n\n // Create new URL group (by application name)\n $result[$title1] = array(\n 'commonTitle' => $title1,\n 'urls' => array($items[$i]->getUrl()),\n );\n\n for ($j = 0; $j < $count; $j++)\n {\n if (($i == $j) || !self::isSimilar($items[$i], $items[$j])) {\n continue;\n }\n\n $items[$j]->sorted = true;\n $title2 = $items[$j]->getTitle();\n\n $result[$title1]['commonTitle'] = longest_common_substring($title1, $title2);\n $result[$title1]['urls'][] = $items[$j]->getUrl();\n }\n }\n\n return $result;\n }",
"public function testGetRegistrationInstanceLaunchHistory()\n {\n }",
"public function testOrder() {\n\t\t$this->Users->truncate();\n\t\t$rows = [\n\t\t\t['role_id' => 1, 'name' => 'Gandalf'],\n\t\t\t['role_id' => 2, 'name' => 'Asterix'],\n\t\t\t['role_id' => 1, 'name' => 'Obelix'],\n\t\t\t['role_id' => 3, 'name' => 'Harry Potter']];\n\t\tforeach ($rows as $row) {\n\t\t\t$entity = $this->Users->newEntity($row);\n\t\t\t$this->Users->save($entity);\n\t\t}\n\n\t\t$result = $this->Users->find('list')->toArray();\n\t\t$expected = [\n\t\t\t'Asterix',\n\t\t\t'Gandalf',\n\t\t\t'Harry Potter',\n\t\t\t'Obelix',\n\t\t];\n\t\t$this->assertSame($expected, array_values($result));\n\t}",
"public function test_question_categorylist_parents() {\n $this->resetAfterTest();\n $generator = $this->getDataGenerator();\n $questiongenerator = $generator->get_plugin_generator('core_question');\n $category = $generator->create_category();\n $context = context_coursecat::instance($category->id);\n // Create a top category.\n $cat0 = question_get_top_category($context->id, true);\n // Add sub-categories.\n $cat1 = $questiongenerator->create_question_category(['parent' => $cat0->id]);\n $cat2 = $questiongenerator->create_question_category(['parent' => $cat1->id]);\n // Test the 'get parents' function.\n $parentcategories = question_categorylist_parents($cat2->id);\n $this->assertEquals($cat0->id, $parentcategories[0]);\n $this->assertEquals($cat1->id, $parentcategories[1]);\n $this->assertCount(2, $parentcategories);\n }",
"public function mock_apps() {\n\n\t\t$this->backup_app = WordPoints_App::$main;\n\n\t\tWordPoints_App::$main = new WordPoints_PHPUnit_Mock_App_Silent(\n\t\t\t'apps'\n\t\t);\n\n\t\treturn WordPoints_App::$main;\n\t}",
"protected function initApplicationsList()\n {\n $appDirHandler = opendir(SRC_DIR);\n while ($appDir = readdir($appDirHandler)) {\n if ($appDir !== '.' && $appDir !== '..' && is_dir(SRC_DIR . DIRECTORY_SEPARATOR . $appDir)) {\n $appFile = SRC_DIR . DIRECTORY_SEPARATOR . $appDir . DIRECTORY_SEPARATOR . 'Application.php';\n if (file_exists($appFile)) {\n require_once $appFile;\n $appClass = $appDir . '\\\\Application';\n if (class_exists($appClass)) {\n /** @var ApplicationInterface $app */\n $app = new $appClass;\n $this->bunApplications[$app->getApplicationName()] = $app;\n $this->loadOtherApplicationConfig($app, SRC_DIR . DIRECTORY_SEPARATOR . $appDir);\n }\n }\n }\n }\n }",
"public function testGetForPreviouslyInitiatedSession()\n {\n FakeSession::setPreviousSession(['Foo' => 'Bar']);\n\n $sessionItemCollection = new SessionItemCollection();\n\n self::assertSame('Bar', $sessionItemCollection->get('Foo'));\n self::assertSame(PHP_SESSION_ACTIVE, FakeSession::getStatus());\n self::assertSame(['Foo' => 'Bar'], $_SESSION);\n }",
"public function testCreateDefaultList(): void\n {\n try {\n // Create list.\n $response = self::fetchOneSync(new PutCuratorList(self::$session, self::CURATOR_ID, new CuratorList));\n\n self::assertArrayHasKey('clanid', $response);\n self::assertSame(self::CURATOR_ID, $response['clanid']);\n\n self::assertArrayHasKey('listid', $response);\n self::assertIsString($listId = $response['listid']);\n self::assertNotEmpty($listId);\n } finally {\n self::deleteList($listId);\n }\n }",
"public function testGetRegistrationLaunchHistory()\n {\n }",
"public function testCountForPreviouslyInitiatedSession()\n {\n FakeSession::setPreviousSession(['Foo' => 'Bar']);\n\n $sessionItemCollection = new SessionItemCollection();\n\n self::assertSame(1, count($sessionItemCollection));\n self::assertSame(PHP_SESSION_ACTIVE, FakeSession::getStatus());\n self::assertSame(['Foo' => 'Bar'], $_SESSION);\n }",
"public function testAppAdminAccess()\n {\n \t$user = factory(User::class, 'appadmin')->make();\n \t$user->save();\n \t\n \t$this->actingAs($user);\n\n \t$this->get(URL::route('lists-index'))\n ->assertStatus(200);\n\n $this->get(URL::route('user.index'))\n ->assertStatus(200);\n\n $this->get(URL::route('organization.index'))\n ->assertStatus(200);\n\n $this->get(URL::route('region.index'))\n ->assertStatus(200);\n\n $this->get(URL::route('transport.index'))\n ->assertStatus(200);\n\n $this->get(URL::route('purpose.index'))\n ->assertStatus(200);\n\n $this->get(URL::route('product_type.index'))\n ->assertStatus(200);\n\n $this->get(URL::route('storage.index'))\n ->assertStatus(200);\n\n $this->get(URL::route('institution.index'))\n ->assertStatus(200);\n\n }",
"public function testGetAllKeepOriginalOrder()\n {\n $permission = new Permission;\n $permission->add(new PermissionRule('b'));\n $permission->add(new PermissionRule('b.a'));\n $permission->add(new PermissionRule('a'));\n $permission->add(new PermissionRule('b.b'));\n $permission->add(new PermissionRule('b.c'));\n $permission->add(new PermissionRule('b.b.a'));\n $permission->add(new PermissionRule('b.b.b'));\n $permission->add(new PermissionRule('b.b.c'));\n\n static::assertEquals([\n 'b',\n 'b.a',\n 'b.b',\n 'b.b.a',\n 'b.b.b',\n 'b.b.c',\n 'b.c',\n 'a',\n ], $permission->getAllNames());\n }",
"public function testOnListCondition () {\n $contact = $this->contacts ('testUser');\n $list = $this->lists ('testUser');\n $this->assertTrue ($list->hasRecord ($contact));\n\n $params = array (\n 'model' => $contact,\n 'modelClass' => 'Contacts',\n );\n $retVal = $this->executeFlow ($this->x2flow ('flowOnListCondition'), $params);\n\n X2_TEST_DEBUG_LEVEL > 1 && print_r ($retVal['trace']);\n\n // assert flow executed without errors since contact is on list\n $this->assertTrue ($this->checkTrace ($retVal['trace']));\n\n\n $contact = $this->contacts ('testAnyone');\n $this->assertFalse ($list->hasRecord ($contact));\n\n $params = array (\n 'model' => $contact,\n 'modelClass' => 'Contacts',\n );\n $retVal = $this->executeFlow ($this->x2flow ('flowOnListCondition'), $params);\n\n X2_TEST_DEBUG_LEVEL > 1 && print_r ($retVal['trace']);\n\n // assert flow executed with errors since contact is not on list\n $this->assertFalse ($this->checkTrace ($retVal['trace']));\n }",
"public function testPostAndUpdateApp()\n {\n $testApp = new \\stdClass;\n $testApp->name = new \\stdClass;\n $testApp->name->en = 'new Test App';\n $testApp->showInMenu = true;\n\n $client = static::createRestClient();\n $client->post('/core/app/', $testApp, server: ['HTTP_X-GRAVITON-USER' => 'user1']);\n $response = $client->getResponse();\n $results = $client->getResults();\n\n // we sent a location header so we don't want a body\n $this->assertNull($results);\n $this->assertStringContainsString('/core/app/', $response->headers->get('Location'));\n\n $recordLocation = $response->headers->get('Location');\n\n $client = static::createRestClient();\n $client->request('GET', $recordLocation);\n\n $response = $client->getResponse();\n $results = $client->getResults();\n\n $this->assertResponseContentType(self::CONTENT_TYPE, $response);\n $this->assertResponseSchemaRel(self::SCHEMA_URL_ITEM, $response);\n $this->assertEquals('new Test App', $results->name->en);\n $this->assertTrue($results->showInMenu);\n $this->assertContains(\n '<http://localhost/core/app/'.$results->id.'>; rel=\"self\"',\n explode(',', $response->headers->get('Link'))\n );\n\n // keep this\n $recordId = $results->id;\n\n // PATCH IT\n\n $client = static::createRestClient();\n $patchJson = json_encode(\n [\n [\n 'op' => 'replace',\n 'path' => '/name/de',\n 'value' => 'Mein neuer Name'\n ]\n ]\n );\n $client->request('PATCH', $recordLocation, [], [], ['HTTP_X-GRAVITON-USER' => 'user2'], $patchJson);\n\n /**\n * CHECK METADATA FIELDS (_createdBy/_lastModifiedBy)\n */\n\n /**\n * @var $dm DocumentManager\n */\n $dm = self::getContainer()->get('doctrine_mongodb.odm.default_document_manager');\n\n $collection = $dm->getDocumentCollection(App::class);\n $dbRecord = $collection->findOne(['_id' => $recordId]);\n $this->assertEquals('user1', $dbRecord['_createdBy']);\n $this->assertTrue($dbRecord['_createdAt'] instanceof UTCDateTime);\n $this->assertEquals('user2', $dbRecord['_lastModifiedBy']);\n $this->assertTrue($dbRecord['_lastModifiedAt'] instanceof UTCDateTime);\n }",
"public function testGetRefundApplications()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function add_test_applications($conn, $d_format) {\n $extra = get_extra_application_vals($conn, $d_format);\n $extra_job = get_extra_job_applied_for_vals($conn);\n// $positive_shortl_id = $extra_job[\"status_shortlisting\"][\"Telephone Interview\"];\n $len_app_sources = count($extra[\"application_sources\"]);\n \n for ($i = 0; $i < count($extra[\"applicant_ids\"]); $i++) {\n $f = array(\n \"applicant_id\"=> $extra[\"applicant_ids\"][$i][\"id\"], \n \"application_source_id\"=> rand(0, $len_app_sources - 1), \n \"application_date\"=> $extra[\"application_dates\"][$i],\n );\n // Create 3 records where the applicant hasn't applied for a position.\n if ($i < 3) {\n $f[\"position_applied_for_id\"] = $extra[\"position_app_no_id\"];\n } // All others have applied for a specific job.\n else {\n $f[\"position_applied_for_id\"] = $extra[\"position_app_yes_id\"];\n $random_job_ind = rand(0, count($extra[\"job_ids\"]) - 1);\n $f[\"job_id\"] = (int)$extra[\"job_ids\"][$random_job_ind][\"id\"];\n \n// set_position_applied_on_applicant($conn, $f[\"applicant_id\"],\n// $extra[\"position_app_yes_id\"]);\n }\n \n // User has applied for job, but not decided to phone interview yet.\n // $i == 3\n \n /* User has applied for job, rejected, not phone interview shortlisted.\n * Reject notification not sent. */ \n if ($i == 4) {\n $f[\"status_shortlisting_id\"] = $extra_job[\"status_shortlisting\"][\"Reject\"];\n $f[\"reject_notification_sent_id\"] = $extra_job[\"reject_notification_sent\"][\"no\"];\n set_flag_future_on_applicant($conn, $f[\"applicant_id\"],\n $extra_job[\"flag_future\"]);\n }\n \n /* User has applied for job, rejected, not phone interview shortlisted.\n * Reject notification sent. */\n if ($i == 5) {\n $f[\"status_shortlisting_id\"] = $extra_job[\"status_shortlisting\"][\"Reject\"];\n $f[\"reject_notification_sent_id\"] = $extra_job[\"reject_notification_sent\"][\"yes\"];\n set_flag_future_on_applicant($conn, $f[\"applicant_id\"],\n $extra_job[\"flag_future\"]);\n }\n \n // All users after this have applied for job, and been phone interview shortlisted.\n if ($i > 5) {\n $f[\"status_shortlisting_id\"] = $extra_job[\"status_shortlisting\"][\"Telephone Interview\"];\n }\n \n // Not decided on screening after phone interview.\n // $i = 6\n \n // User rejected after phone interview. Notification not sent.\n if ($i == 7) {\n $id = $extra_job[\"status_screening\"][\"Reject\"];\n $f[\"status_screening_id\"] = $id;\n $f[\"reject_notification_sent_id\"] = $extra_job[\n \"reject_notification_sent\"][\"no\"];\n set_flag_future_on_applicant($conn, $f[\"applicant_id\"], \n $extra_job[\"flag_future\"]);\n }\n \n // User rejected after phone interview. Notification sent.\n if ($i == 8) {\n $id = $extra_job[\"status_screening\"][\"Reject\"];\n $f[\"status_screening_id\"] = $id;\n $f[\"reject_notification_sent_id\"] = $extra_job[\n \"reject_notification_sent\"][\"yes\"];\n }\n \n // All users after this have been screened & invited to physical interview.\n if ($i > 8) {\n $id = $extra_job[\"status_screening\"][\"Invite to Interview\"];\n $f[\"status_screening_id\"] = $id;\n }\n \n // After physical interview, undecided\n// $i = 9;\n \n // After physical interview, rejected. Notification not sent.\n if ($i == 10) {\n $status_interview_id = $extra_job[\"status_interview\"][\"Reject\"];\n add_test_interview($conn, $f[\"application_date\"], $d_format,\n $status_interview_id, $f[\"applicant_id\"]);\n // Get id of last inserted interview record.\n $f[\"interview_id\"] = $conn->insert_id;\n $f[\"reject_notification_sent_id\"] = $extra_job[\n \"reject_notification_sent\"][\"no\"];\n set_flag_future_on_applicant($conn, $f[\"applicant_id\"], $extra_job[\"flag_future\"]);\n }\n \n // After physical interview, rejected. Notification sent.\n if ($i == 11) {\n $status_interview_id = $extra_job[\"status_interview\"][\"Reject\"];\n add_test_interview($conn, $f[\"application_date\"], $d_format,\n $status_interview_id, $f[\"applicant_id\"]);\n // Get id of last inserted interview record.\n $f[\"interview_id\"] = $conn->insert_id;\n $f[\"reject_notification_sent_id\"] = $extra_job[\n \"reject_notification_sent\"][\"yes\"];\n set_flag_future_on_applicant($conn, $f[\"applicant_id\"], $extra_job[\"flag_future\"]);\n }\n \n // After physical interview, offered job. Job filled.\n if ($i == 12) {\n $status_interview_id = $extra_job[\"status_interview\"][\"Offer\"];\n add_test_interview($conn, $f[\"application_date\"], $d_format,\n $status_interview_id, $f[\"applicant_id\"]);\n // Get id of last inserted interview record.\n $f[\"interview_id\"] = $conn->insert_id;\n $date_filled = new DateTime();\n update_filled_job($conn, $f[\"applicant_id\"], $date_filled, $d_format, \n $f[\"job_id\"]);\n }\n\n $sql = build_insert_application_sql($f);\n $res_arr = run_modify_query($conn, $sql);\n if (strlen($res_arr[0]) > 0) {\n echo \"Errors: \" . $res_arr[0];\n }\n else {\n echo \"Your application record was successfully added. \\n\";\n }\n }\n}",
"public function testListAction1()\n\t{\n\t\t$test1 = $this->createTest('baseEntry', 'listAction', array(), 'validateTestListAction1');\n\t\t$test1->runTest();\n\t}"
] | [
"0.70203114",
"0.5698315",
"0.56711185",
"0.5194633",
"0.49787846",
"0.49677125",
"0.49387056",
"0.49222022",
"0.48982748",
"0.4878272",
"0.4875513",
"0.48646012",
"0.4860868",
"0.47623563",
"0.4741452",
"0.472336",
"0.47131455",
"0.46853113",
"0.46662438",
"0.46650127",
"0.46549556",
"0.46534386",
"0.46490103",
"0.46486866",
"0.46450225",
"0.46332553",
"0.4628294",
"0.4615344",
"0.4613181",
"0.4610398"
] | 0.7872546 | 0 |
Returns a person's name with title prefix and suffix applied. | function get_person_name( $post ) {
if ( !$post->post_type == 'person' ) { return; }
$prefix = get_field( 'person_title_prefix', $post->ID ) ?: '';
$suffix = get_field( 'person_title_suffix', $post->ID ) ?: '';
if ( $prefix ) {
$prefix = trim( $prefix ) . ' ';
}
if ( $suffix && substr( $suffix, 0, 1 ) !== ',' ) {
$suffix = ' ' . trim( $suffix );
}
return wptexturize( $prefix . $post->post_title . $suffix );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNameAndTitle()\n {\n return $this->getTitle() . ' ' . $this->surname;\n }",
"public function getNameAndTitle()\n {\n return $this->getTitle(). ' ' . $this->surname;\n }",
"function getName() {\n\t\treturn $this->getFirstName().\" \".$this->getLastName();\n\t}",
"public function getName()\r\n {\r\n return $this->getFirstname() . ' ' . $this->getLastname();\r\n }",
"public function getName()\n\t{\n\t\treturn $this->firstname . \" \" . $this->lastname;\n\t}",
"public function __get_name()\n {\n if (!isset($this->first_name)) {\n return \"Anonymous\";\n } else if (!isset($this->last_name)) {\n return $this->first_name;\n } else {\n if (isset($this->middle_name)) {\n return $this->first_name . ' ' . $this->middle_name . ' ' . $this->last_name;\n } else {\n return $this->first_name . ' ' . $this->last_name;\n }\n }\n }",
"public function getName() : string {\n return $this->getFirstname() . \" \" . $this->getLastname();\n }",
"public function __get_short_name()\n {\n if (!isset($this->first_name)) {\n return \"Anonymous\";\n } else if (!isset($this->last_name)) {\n return $this->first_name;\n } else {\n return $this->first_name . ' ' . substr(strtoupper($this->last_name), 0, 1) . '.';\n }\n }",
"public function getName() {\n return implode(' ', array($this->first_name, $this->middle_name, $this->last_name));\n }",
"public function getName()\n {\n return ucwords($this->first_name . ' ' . $this->last_name);\n }",
"public function title(): string\n {\n return $this->entity->first_name . ' ' . $this->entity->last_name;\n }",
"private function get_name() {\n\t\t\t$full_name = $this->firstname . \" \" . $this->lastname;\n\t\t\treturn $full_name;\n\t\t}",
"public function getName()\n\t\t{\n\t\t\t$name = $this->firstName . \" \" . $this->lastName;\n\t\t\treturn $name;\n\t\t}",
"public function getName() {\n return $this->firstName . ' ' . $this->lastName;\n }",
"public function getName() {\n return trim($this->first_name . \" \" . $this->last_name);\n }",
"public function name()\n {\n return $this->wrappedObject->first_name.' '.$this->wrappedObject->last_name;\n }",
"public function _get__fullname() {\n return $this->title .' '.$this->firstname.' '.$this->lastname;\n }",
"public function getName(){\n\t\treturn $this->firstName .\" \". $this->lastName;\n\t}",
"public function full_name()\n {\n return $this->first_name.($this->name_prefix ? ' '.$this->name_prefix : '').' '.$this->last_name;\n }",
"public function getNameAttribute()\n {\n return mb_convert_case(\n //\n str_replace(' ', ' ', $this->first_name . ' ' . $this->middle_name . ' ' . $this->last_name),\n //\n MB_CASE_TITLE\n );\n }",
"public function getTitleFromDisplayPattern()\n {\n $serviceManager = ServiceUtil::getManager();\n $listHelper = $serviceManager->get('rk_team_module.listentries_helper');\n \n $formattedTitle = ''\n . $this->getLastName()\n . ', '\n . $this->getFirstName();\n \n return $formattedTitle;\n }",
"public function getNameAttribute(): string\n {\n return $this->attributes['first_name'] . ' ' . $this->attributes['last_name'];\n }",
"public function getName() {\n\t\t$name = count($this->album) ? end($this->album) : $this->lonely->title;\n\t\t$name = str_replace('_', ' ', $name);\n\t\treturn $name;\n\t}",
"protected function get_name() {\n\t\treturn 'Person';\n\t}",
"private function generateNameStr($firstname, $prefix, $lastname){\n if (isset($prefix)){\n return sprintf(\"%s %s %s\", $firstname, $prefix, $lastname);\n } else {\n return sprintf(\"%s %s\", $firstname, $lastname);\n }\n }",
"function realName($username, $first = null, $last = null) { \n\t\tif($first && $last) {\n\t\t\t$name = ucfirst($first).' '.ucfirst($last);\n\t\t} elseif($first) {\n\t\t\t$name = ucfirst($first);\n\t\t} elseif($last) {\n\t\t\t$name = ucfirst($last);\n\t\t} else {\n\t\t\t$name = ucfirst($username);\n\t\t}\n\t\treturn $name;\n\t}",
"abstract public function getHumanName();",
"static function getHumanName();",
"public static function name(): string\n {\n return self::firstname() . \" \" . self::lastname();\n }",
"public function getDisplayNameAttribute(): string\n {\n $cleaned = strtolower(Str::replace('_', ' ', $this->name));\n\n preg_match(\n '/((left|right|tail|top|bottom|front|mid_|lower|upper|back|rear)_?)+/',\n strtolower($this->name),\n $matches\n );\n\n if (isset($matches[0]) && $matches[0] !== strtolower($this->name)) {\n $name = trim(str_replace('_', ' ', str_replace($matches[0], '', strtolower($this->name))));\n $position = trim(str_replace('_', ' ', $matches[0]));\n\n return Str::ucfirst(sprintf('%s (%s)', $name, $position));\n }\n\n return Str::ucfirst($cleaned);\n }"
] | [
"0.7510887",
"0.740141",
"0.7184577",
"0.71479756",
"0.7121571",
"0.71125823",
"0.7103781",
"0.70659995",
"0.70606923",
"0.70573395",
"0.69932485",
"0.6977129",
"0.6974085",
"0.6973714",
"0.69446856",
"0.69078475",
"0.6881075",
"0.68313813",
"0.6814605",
"0.6758424",
"0.6750517",
"0.66823375",
"0.6677159",
"0.66650844",
"0.6662753",
"0.66506994",
"0.6648912",
"0.6624338",
"0.66181874",
"0.6607179"
] | 0.78564835 | 0 |
Displays contact buttons for a person. For use on singleperson.php | function get_person_contact_btns_markup( $post ) {
if ( $post->post_type !== 'person' ) { return; }
$email = get_field( 'person_email', $post->ID );
$has_phones = have_rows( 'person_phone_numbers', $post->ID );
$phones = get_field( 'person_phone_numbers', $post->ID );
ob_start();
if ( $email || $phones ):
?>
<div class="row mt-3 mb-5">
<?php if ( $email ): ?>
<div class="col-md offset-md-0 col-8 offset-2 my-1">
<a href="mailto:<?php echo $email; ?>" class="btn btn-primary btn-block">Email</a>
</div>
<?php endif; ?>
<?php if ( $has_phones ): ?>
<div class="col-md offset-md-0 col-8 offset-2 my-1">
<a href="tel:<?php echo preg_replace( "/\D/", '', $phones[0]['number'] ); ?>" class="btn btn-primary btn-block">Phone</a>
</div>
<?php endif; ?>
</div>
<?php
endif;
return ob_get_clean();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionContact()\n\t{\n\n\t\t$this->render('contact');\n\t}",
"public function actionContact()\n {\n\n return $this->render('contact');\n }",
"public function contactAction()\n {\n return $this->render('EGAssignmentBundle:Assignment:contact.html.twig');\n }",
"function displayCreateButton() {\r\n\t\t\r\n\t\techo \"<a href='create.php' class='btn btn-success'>Create a New Person!!</a><br />\";\r\n\t\t\r\n\t}",
"public function contact()\n {\n // $this->render kan aangeroepen worden omdat deze templating-engine beschikbaar wordt gesteld door 'extends Controller'\n return $this->render('contact.html.twig');\n\n }",
"public function contactsForm()\n {\n $this->checkPermissions();\n\n $id = $_GET['id'];\n\n $user = $this->db->getOne('users_data', $id);\n echo $this->engine->render('edit_contacts', ['user' => $user]);\n }",
"public function contact(){\n\t\t$data['title']='contact';\n\t\t$this->loadView('contact',$data);\n\t}",
"public function contact() {\n\t\t$data['page'] = 'contact';\n $data['global_setting'] = $this->global_setting;\n $this->load->view('towing/contact', $data);\n }",
"function GetContactAction()\n {\n return \"Contact\";\n }",
"function contact(){\n\t\t$this->columns = 12;\n\t\t$this->id = $this->encrypt->decode(base64_decode($this->uri->segment('3')));\n $this->content_data['get_dropdown_all_languages'] = _get_dropdown_all_languages();\n $this->content_data['get_dropdown_all_titles'] = _get_dropdown_all_titles();\t\t\n $this->content_data['get_dropdown_all_region'] = _get_dropdown_all_region();\n\t\t$this->content_data['get_dropdown_all_roles'] = _get_dropdown_all_roles(array(6));\n\t\tif($this->id){\n\t\t\t# Tell the crud function what to do.\n\t\t\t$this->panel_title = lang('add_a_').lang('revenue_authority_contact');\n\t\t\t$this->content_data['submit_button'] = lang('add_this_').lang('revenue_authority_contact');\t\t\t\n\t\t $this->content_data['uri'] = \"https://e-tadat.org/authorities/add_contact/?id=\" . base64_encode($this->encrypt->encode($this->id));\n\t\t\t$this->data['content'] = $this->load->view('authorities/create_step_3', $this->content_data, true);\n\t\t}\n\t\t# Loads the template (view) and populates with $this->data\n $this->load->view($this->template, $this->data);\n\t}",
"function contacts() {\n\t\n\t\t// Get the data\n\t\t$contacts = array_filter( $this->contacts );\n\n\t\t// Display the list\n\t\techo '<ul class=\"user-contact-list\">' ;\n\t\tif ( empty( $contacts ) ) {\n\t\t\techo '<li><i class=\"icon-eye-close icon-fixed-width\"></i>No contact information shared</li>';\n\t\t\treturn;\n\t\t}\n\t\tif ( isset( $contacts['user_url'] ) )\n\t\t\techo '<li><i class=\"icon-globe icon-fixed-width\"></i><span>Website:</span><a href=\"' . $contacts['user_url'] . '\" target=\"_blank\">' . $contacts['user_url'] . '</a></li>' ;\n\t\tif ( isset( $contacts['twitter'] ) )\n\t\t\techo '<li><i class=\"icon-twitter icon-fixed-width\"></i><span>Twitter:</span><a href=\"http://twitter.com/' . $contacts['twitter'] . '\" target=\"_blank\">' . $contacts['twitter'] . '</a></li>' ;\n\t\tif ( isset( $contacts['facebook'] ) )\n\t\t\techo '<li><i class=\"icon-facebook icon-fixed-width\"></i><span>Facebook:</span><a href=\"http://facebook.com/' . $contacts['facebook'] . '\" target=\"_blank\">' . $contacts['facebook'] . '</a></li>' ;\t\t\n\t\tif ( isset( $contacts['gplus'] ) )\n\t\t\techo '<li><i class=\"icon-google-plus icon-fixed-width\"></i><span>Google+:</span><a href=\"http://plus.google.com/' . $contacts['gplus'] . '\" target=\"_blank\">' . $contacts['gplus'] . '</a></li>' ;\n\t\tif ( isset( $contacts['steam'] ) )\n\t\t\techo '<li><i class=\"icon-wrench icon-fixed-width\"></i><span>Steam ID:</span><a href=\"http://steamcommunity.com/id/' . $contacts['steam'] . '\" target=\"_blank\">' . $contacts['steam'] . '</a></li>' ;\n\t\tif ( isset( $contacts['youtube'] ) )\n\t\t\techo '<li><i class=\"icon-youtube icon-fixed-width\"></i><span>YouTube:</span><a href=\"http://www.youtube.com/user/' . $contacts['youtube'] . '\" target=\"_blank\">' . $contacts['youtube'] . '</a></li>' ;\n\t\tif ( isset( $contacts['twitch'] ) )\n\t\t\techo '<li><i class=\"icon-desktop icon-fixed-width\"></i><span>TwitchTV:</span><a href=\"http://www.twitch.tv/' . $contacts['twitch'] . '\" target=\"_blank\">' . $contacts['twitch'] . '</a></li>' ;\n\t\tif ( isset( $contacts['bethforums'] ) ) {\n\t\t\t$bethforums_name = preg_replace( '#(.*)[0-9]+(-{1})#' , '' , $contacts['bethforums'] );\n\t\t\t$bethforums_name = preg_replace( '#-{1}|/{1}#' , ' ' , $bethforums_name );\n\t\t\techo '<li><i class=\"icon-sign-blank icon-fixed-width\"></i><span>Bethesda:</span><a href=\"http://forums.bethsoft.com/user/' . $contacts['bethforums'] . '\" target=\"_blank\">' . ucwords( $bethforums_name ) . '</a></li>' ;\n\t\t\t}\n\t\techo '</ul>' ;\n\t}",
"public function contact() {\n \n #Set up the view\n $this->template->content = View::instance('v_users_contact');\n $this->template->title = \"Sign Up\";\n \n # Render the view (localhost/users/signup)\n echo $this->template;\n \t}",
"public function contacts()\n {\n $view = new View();\n $view->render('index_index_contacts.php', 'default_view.php');\n }",
"function contacto(){\n\t\t\t$this->navegacionView->showContacto();\n\t\t}",
"public function contactusAction() {\n // Si le visiteur est déjà identifié, on le redirige vers l'accueil\n $contact = new Contact();\n $form = $this->createForm(new ContactType(), $contact);\n \n return $this->render('AcmeDemoBundle:Contact:contactus.html.twig', array('form' => $form->createView()));\n }",
"public function actionContact()\n\t{\n\t\t$model=new ContactForm;\n\n\t\t$this->render('contact',array('model'=>$model));\n\t}",
"public function contacto(){\n $this->smarty->display('contacto.tpl');\n }",
"public function contact()\n\t{\n\t\t$this->include_template('blog.single');\n\t}",
"public function show(){\n\t\t$co = new Contact();\n\t\t$options = $co->show();\n\n\t\t// Twig\n\t\t$en = new TemplateEngine('contact', 'show.twig');\n\t\t$en->render($options);\n\t}",
"function contactMe($contactManager)\n{\n ContactMeView::render($contactManager);\n}",
"private function contact()\n {\n $this->_view = new View('Contact');\n $this->_view->generate(array(\n 'error' => $this->error,\n 'msg' => $this->msg\n ));\n }",
"public function contact()\n\t{\n\t\treturn view('pages.contact');\n\t}",
"function sms_gateway_contact_edit_page() {\n return 'Contact edit page.';\n}",
"public function displayContacts() { \n foreach ($this->contacts as $name=>$number) {\n echo $name . ' - ' . $number . '<br />'; \n }\n }",
"public function contact()\n {\n\t\treturn view('pages.contact');\n }",
"public function vc_contact()\n\t{\n\t\t$this->load->view('visitor_view/visitor_contact');\n\t}",
"function contact_sent()\n\t{\n\t\t$this->render_view(\"info/contact_sent.php\", null, \"info_layout.php\");\n\t}",
"public function contact()\n {\n return view(\"public.contact\")->with(['active'=>'users', 'subactive'=>'user']);\n }",
"protected function button($button){\n\t\tswitch($button){\n\t\t\tcase 'addfriend':\n\t\t\t\t$url = '?task=add_friend';\n\t\t\t\t$text = 'Add to friends';\n\t\t\t\tbreak;\n\n\t\t\tcase 'removefriend':\n\t\t\t\t$url = '/account/friends?task=remove_friend&id='.$this->_person->userid;\n\t\t\t\t$text = 'Remove from friends';\n\t\t\t\tbreak;\n\n\t\t\tcase 'comment':\n\t\t\t\t$url = '#comment';\n\t\t\t\t$text = 'Leave a comment';\n\t\t\t\tbreak;\n\n\t\t\tcase 'message':\n\t\t\t\t$url = '/account/write_message?recipient=' . $this->_person->userid;\n\t\t\t\t$text = 'Private message';\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t}\n\t\techo '<a href=\"' . $url . '\" class=\"button_dark scroll\"><span>' . $text . '</span></a>';\n\t\treturn true;\n\t}",
"public function contact()\r\n\t{\r\n\t\t$data['layout'] \t= 'contact';\r\n\t\t$data['page_title'] = 'Contact opnemen met vuurwerk-vergelijken.nl';\r\n\t\t$data['page_descr'] = 'Contact opnemen met vuurwerk-vergelijken.nl';\r\n\t\t$data['noindex']\t= true;\r\n\r\n\t\t// Load the view\r\n\t\t$this->load->view('layout',$data);\r\n\t}"
] | [
"0.67014754",
"0.6410425",
"0.6388705",
"0.6313531",
"0.6131631",
"0.609557",
"0.60903996",
"0.6085617",
"0.60771835",
"0.6054916",
"0.6052975",
"0.6014084",
"0.5998652",
"0.5985105",
"0.59595394",
"0.594447",
"0.59372586",
"0.5934204",
"0.5928039",
"0.59029657",
"0.58976793",
"0.5877113",
"0.5876342",
"0.58637947",
"0.5832002",
"0.58172375",
"0.57904917",
"0.5777522",
"0.577733",
"0.5764573"
] | 0.6890042 | 0 |
Displays a person's department(s) in a condensed tablelike format. For use on singleperson.php | function get_person_dept_markup( $post ) {
if ( $post->post_type !== 'person' ) { return; }
$depts = wp_get_post_terms( $post->ID, 'departments' );
$depts = !is_wp_error( $depts ) && !empty( $depts ) && class_exists( 'UCF_Departments_Common' ) ? $depts : false;
ob_start();
if ( $depts ) :
?>
<div class="row">
<div class="col-xl-4 col-md-12 col-sm-4 person-label">
Department<?php if ( count( $depts ) > 1 ) { echo 's'; } ?>
</div>
<div class="col-xl-8 col-md-12 col-sm-8 person-attr">
<ul class="list-unstyled mb-0">
<?php foreach ( $depts as $dept ): ?>
<li><?php echo UCF_Departments_Common::get_website_link( $dept ); ?></li>
<?php endforeach; ?>
</ul>
</div>
</div>
<hr class="my-2">
<?php
endif;
return ob_get_clean();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function Departamentos()\n {\n $oDbl = $this->getoDbl();\n $tabla = $this->getNomTabla();\n\n $oGesDirectores = new profesores\\GestorProfesorDirector();\n $cDirectores = $oGesDirectores->getProfesoresDirectores(array('f_cese' => 1), array('f_cese' => 'IS NULL'));\n\n $rta['num'] = count($cDirectores);\n if ($this->blista == true && $rta['num'] > 0) {\n $html = '<table>';\n foreach ($cDirectores as $oDirector) {\n $id_departamento = $oDirector->getId_departamento();\n $id_nom = $oDirector->getId_nom();\n $oDepartamento = new Departamento($id_departamento);\n $nom_dep = $oDepartamento->getDepartamento();\n $oPersonaDl = new personas\\PersonaDl($id_nom);\n $nom_persona = $oPersonaDl->getPrefApellidosNombre();\n $html .= \"<tr><td>$nom_dep</td><td>$nom_persona</td></tr>\";\n }\n $html .= '</table>';\n $rta['lista'] = $html;\n } else {\n $rta['lista'] = '';\n }\n return $rta;\n }",
"public function getDepartment();",
"public function show(Department $department)\n {\n //\n }",
"public function show(Department $department)\n {\n //\n }",
"public function show(Department $department)\n {\n //\n }",
"public function get_department() {\n\t\treturn $this->db->get('department');\n\t\t\n\t}",
"public function deptors_table()\n\t{\n\t\t$counter = 1;\n\t\t$empty_row_to_show = 0;\n\t\t\n\t\t$html_empty_cell = '<td> </td>';\n\t\t\n\t\t$up = new UsrPermission();\n\t\t$action_a = $up->isPageActionAllowed(PermissionType::DEPTORS, PermissionType::DEPTOR_A);\n\t\t$action_d = $up->isPageActionAllowed(PermissionType::DEPTORS, PermissionType::DEPTOR_D);\n\t\t\n\t\t$html_table = \n\t\t'<h2>Deudores</h2>\n\t\t\n\t\t<table id=\"deptorsTable\" name=\"deptorsTable\" width=\"100%\" border=\"0\" align=\"center\" class=\"tablesorter\">\n\t\t\t<thead><tr>\n\t\t\t\t<th width=\"4%\" align=\"center\" >#</th>\n\t\t\t\t<th width=\"30%\" >NOMBRE</th>\n\t\t\t\t<th width=\"60%\" >INFORMACION</th>';\n\t\t\t\tif( $action_a == true || $action_d == true )\n\t\t\t\t\t$html_table .= '<th width=\"6%\" > </th>';\n\t\t\t\t\n\t\t$html_table .= '</tr></thead><tbody>';\n\t\t\n\t\t// Showing data into the table\n\t\t$qp = new QueryProcessor();\n\t\t$data_array = $qp->query_deptors();\n\t\t\n\t\tforeach($data_array as $id => $deptor_object)\n\t\t{\n\t\t\t$id = $deptor_object->get_id();\n\t\t\t\n\t\t\t$html_table .= \"<tr>\n\t\t\t\t\t\t\t\t<td align='center' >$counter</td>\n\t\t\t\t\t\t\t\t<td id='tdName$id' >$deptor_object->name</td>\n\t\t\t\t\t\t\t\t<td id='tdInfo$id' >$deptor_object->info</td>\";\n\t\t\t\t\t\t\t\tif( $action_a == true || $action_d == true ){\n\t\t\t\t\t\t\t\t\t$html_table .= \"<td align='center' >\";\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif( $action_a )\n\t\t\t\t\t\t\t\t\t\t$html_table .= \n\t\t\t\t\t\t\t\t\t\t\"<a href='javascript:void(0)' class='bModifyDeptor' id='bModifyDeptor' title='Modificar' deptor='$id' ><img src='../icons/modify.png'></a>\";\n\t\t\t\t\t\t\t\t\tif( $action_d )\t\n\t\t\t\t\t\t\t\t\t\t$html_table .=\n\t\t\t\t\t\t\t\t\t\t\"<a href='javascript:void(0)' class='bDeleteDeptor' id='bDeleteDeptor' title='Eliminar' deptor='$id' ><img src='../icons/delete.png'></a>\";\n\t\t\t\t\t\t\t\t\t$html_table .= '</td>';\n\t\t\t\t\t\t\t\t}\n\t\t\t$html_table .= '</tr>';\n\t\t\t\n\t\t\t$counter ++;\n\t\t\t$empty_row_to_show --;\n\t\t}\n\t\t\n\t\t// Fill the table with empty rows if is needed\n\t\twhile($empty_row_to_show > 0)\n\t\t{\n\t\t\t$html_table .= \"<tr>\n\t\t\t\t\t\t\t\t$html_empty_cell\n\t\t\t\t\t\t\t\t$html_empty_cell\n\t\t\t\t\t\t\t\t$html_empty_cell\";\n\t\t\t\t\t\t\t\tif( $action_a == true || $action_d == true )\n\t\t\t\t\t\t\t\t\t$html_table .= $html_empty_cell;\n\t\t\t$html_table .= \t'</tr>';\n\t\t\t$empty_row_to_show --;\n\t\t}\n\t\t\t\n\t\t$html_table .= '</tbody></table>'; // Closing table tag\n\t\t\n\t\techo $html_table;\n\t}",
"public function listDepartmentByName() {\n\t\treturn Department::orderBy('department_name')->lists('department_name', 'department_id');\n\t}",
"public function getDeptList () {\n $department_list = $this->Common_model->getAllResultWhereOrderBy('m_department',array('deleted'=>0,'office_id'=>$this->input->post('officeCommonId')),'id');\n if($department_list) {\n echo json_encode($department_list);\n } else {\n \t $department_list = array();\n }\n\t\t\n\t}",
"function printdeptemployee($deptid)\n{\n\n // Query to get parent/child relationship of depts\n $query = \"select * from employee where deptid='$deptid'\";\n $result = MYSQL_QUERY($query) or die(\"SQL Error Occured : \".mysql_error().':'.$query); \n\n // Getting number of rows from Query\n $number = MYSQL_NUMROWS($result); \n\t\n if ($number==0) \n {\n \t\n \t echo \"No Employees in this department\";\n \t \n }\n elseif ($number>0)\n {\n\n echo \"<table width=480 border=0 cellspacing=0 cellpadding=0>\";\n $i = 0; \n // For each result row, get data values \n WHILE ($i < $number)\n {\n \n $j=$i+1;\ndefine(APP,'ty');\n // Retreiving data from each row of the sql query result \n // and putting them in local variables \n $empid=mysql_result($result,$i,\"empid\");\n $lastname=mysql_result($result,$i,\"lastname\");\n $firstname=mysql_result($result,$i,\"firstname\");\n $minit=mysql_result($result,$i,\"minit\");\n $jobid=mysql_result($result,$i,\"jobid\");\n $jobtitle=genericget($jobid,'jobid','jobtitle','jobtitle');\n $email=mysql_result($result,$i,\"email\");\n \n \n // making every other alternate row\n // of a different color\n $k=$i/2;\n $k=substr($k,-1,1);\n \n // if row is odd, then make row background grey\n if ($k==\"5\")\n {\n \n echo \"<tr bgcolor=\\\"#EBEBEB\\\">\"; \t\n \t\n }\n else\n {\n echo \"<tr>\";\n }\n\n echo \"<td height=25 width=150><a href=\\\"viewempinfo.php?empid=$empid\\\">$lastname</a></td>\";\n echo \"<td height=25 width=150>$firstname</td>\";\n echo \"<td height=25>$jobtitle</td>\";\n echo \"</tr>\";\n \n \n \n \n $i++;\n } // end of while i < number\n \n \n echo \"</table>\";\n \n \n\n \n }\n\nreturn 1;\n\n}",
"public function department() {\n setUserContext($this);\n $this->lang->load('calendar', $this->language);\n $this->auth->checkIfOperationIsAllowed('department_calendar');\n $data = getUserContext($this);\n $data['title'] = lang('calendar_department_title');\n $data['help'] = $this->help->create_help_link('global_link_doc_page_calendar_department');\n $this->load->model('organization_model');\n $department = $this->organization_model->getDepartment($this->user_id);\n if (empty($department)) {\n $this->session->set_flashdata('msg', lang('calendar_department_msg_error'));\n redirect('leaves');\n } else {\n $data['department'] = $department[0]['name'];\n $this->load->view('templates/header', $data);\n $this->load->view('menu/index', $data);\n $this->load->view('calendar/department', $data);\n $this->load->view('templates/footer');\n }\n }",
"function getUserDepartment($user_name){\n\t\t$justthese = array('memberof');\n\t\t$filter = \"(samaccountname=$user_name)\";\n\n\t\t$result = ldap_search($this->ldapconn, $this->dn, $filter, $justthese)\n\t\t\t\t\t\tor die(\"ERROR: Failed to search the AD Tree|\\n\");\n\t\t$entries = ldap_get_entries($this->ldapconn, $result);\n\n\t\t$iDepts = array();\n\t\t//groups to get the iDepartment\n\t\tif (count($entries) > 0){\n\t\t\tif (isset($entries[0]['memberof'])){\n\t\t\t\t$groups = $entries[0]['memberof'];\n\t\t\t\tunset($groups[\"count\"]);\n\t\t\t\tfor ($i = 0; $i < count($groups); $i++){\n\t\t\t\t\t$tmp = ldap_explode_dn($groups[$i], 1);\n\t\t\t\t\tif (substr($tmp[0], 0, 1) == '_'){\n\t\t\t\t\t\t$iDepts[] = str_replace('\\2C', ',', substr($tmp[0], 1));\n\t\t\t\t\t\t//Check if there is a parent department\n\t\t\t\t\t\t$result = ldap_search($this->ldapconn, $groups[$i], \"(objectCategory=group)\", array('memberof'))\n\t\t\t\t\t\t\t\tor die(\"ERROR: Searching Active Directory\\n\");\n\t\t\t\t\t\t$entries = ldap_get_entries($this->ldapconn, $result);\n\t\t\t\t\t\tif ($entries['count'] > 0){//there is a posibility of a parent department\n\t\t\t\t\t\t\t$parents = isset($entries[0]['memberof']) ? $entries[0]['memberof'] : array('count' => 0);\n\t\t\t\t\t\t\tunset($parents[\"count\"]);\n\t\t\t\t\t\t\tfor ($j = 0; $j < count($parents); $j++){\n\t\t\t\t\t\t\t\t$tmp = ldap_explode_dn($parents[$j], 1);\n\t\t\t\t\t\t\t\tif (substr($tmp[0], 0, 1) == '_'){\n\t\t\t\t\t\t\t\t\t$iDepts[count($iDepts) - 1] .= ' > '.str_replace('\\2C', ',', substr($tmp[0], 1));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $iDepts;\n\t}",
"public function getDepartment()\n {\n return $this->getEmployeeData('departamento');\n }",
"function getDepartmentName($dept)\r\n{\r\n // What if we moved this into the DepartmentsHandler class?\r\n global $depts;\r\n if(isset($depts[$dept])){ // Make sure that ticket has a department\r\n $department = $depts[$dept]->getVar('department');\r\n } else { // Else, fill it with 0\r\n $department = _XHELP_TEXT_NO_DEPT;\r\n }\r\n return $department;\r\n}",
"public function get_department_name($id){\n\t\t$data = $this->HrEmployee->HrDepartment->findById($id, array('fields' => 'dept_name'));\t\t\n\t\t$this->set('dept_data', $data);\n\t}",
"public function display_json_tree_okrs_department($department = ''){\n $this->db->where('department', $department);\n $okrs = $this->db->get(db_prefix().'okrs')->result_array();\n\n $json = [];\n $html = '';\n if(count($okrs) > 0){\n foreach ($okrs as $key => $okr) {\n $html .= $this->dq_html_category('', $okr);\n }\n }\n return $html;\n\n }",
"public function getDepartment()\n {\n return $this->department;\n }",
"public function getDepartment()\n {\n return $this->department;\n }",
"public function teacher_dept(int $dept_id)\n {\n global $wpdb;\n $this->table = $wpdb->prefix . 'department';\n $dept_data = $wpdb->get_results(\"SELECT dept_name, dept_id FROM \" . $this->table . \" WHERE dept_id=\" . $dept_id . \"\");\n\n if ($dept_data) {\n\n ?>\n <option value=\"<?php echo $dept_data[0]->dept_id ?>\" selected >\n <?php echo $dept_data[0]->dept_name ?>\n </option>\n <?php\n\n } else {\n\n ?>\n <option value=\"\" selected disabled hidden>No Department</option>\n <?php\n\n }\n }",
"public function departments()\n {\n $departments = Department::all();\n //return view('departments')->with('departments', $departments);\n /*return view('departments', [\n 'departments' => $departments\n ]);*/\n return view('departments', compact('departments'));\n }",
"public static function liOfDept(){\n $list = \"\";\n foreach (Dept::showAllDept() as $dept){\n $list .= \"<a href='index.php?p=bd&&deptId=\".$dept['id'].\"'><li>\".ucfirst($dept['name']).\"</li></a> \";\n }\n return $list;\n }",
"public function getDepartments()\n {\n $api = sprintf('department/list?access_token=%s', $this->accessToken);\n\n return $this->output($this->guzzleClient->get($api), true);\n }",
"public function _settings_field_department()\n\t{\n\t\tif (!empty($this->settings) && array_key_exists('department', $this->settings) && !empty($this->settings['department']) && $this->settings['department'] <> '0') {\n\t\t\t$department = $this->settings['department'];\n\t\t} else {\n\t\t\t$department = $this->default['department'];\n\t\t}\n\t\t?>\n\t\t<input type=\"text\" size=\"40\" name=\"kayako-settings[department]\" value=\"<?php echo $department; ?>\" placeholder=\"Select Department\"/>\n\t<?php\n\t}",
"public function get_department_name($id){\n\t\tglobal $con;\n\t\t$department_name=\"\";\n\t\t$query=\"SELECT name FROM system_departments\n\t\t\t\tWHERE id=\\\"$id\\\"\n\t\t\t\tLIMIT 1\";\n\t\t$result=array();\n\t\t$result=$this->select($con,$query);\n\t\tforeach ($result as $key => $value) {\n\t\t\t$department_name=$value['name'];\n\t\t}\n\n\t\treturn $department_name;\n\t}",
"public function displayManagerDepartmentEditJournalSelect() {\t\n\t\t// select all if manager department equals all\n\t\tif ($this->managerDepartment == 'All') {\n\t\t\t$result = $this->db->query(\"SELECT DISTINCT departmentName FROM department_category WHERE accountId='$this->accountId'\");\n\t\t} // end if\n\t\telse {\n\t\t\t// query will select managers that have same managerId, and a role equal or less than the logged in manager\n\t\t\t$result = $this->db->query(\"SELECT DISTINCT departmentName FROM department_category WHERE accountId = '$this->accountId' AND departmentName = '$this->managerDepartment'\");\n\t\t} // end else\n\t\t\n\t\t\n\t\t\techo \"\n\t\t\t\t<select name='journalDepartment'>\n\t\t\t\";\n\t\t\t// get all manager departments\n\t\t\twhile ($row = $result->fetch_assoc()) {\n\t\t\t\t\n\t\t\t\t$result2 = $this->db->query(\"SELECT * FROM journal WHERE accountId='$this->accountId'\");\n\t\t\t\t$row2=$result2->fetch_assoc();\n\t\t\t\t\n\t\t\t// display select form for available department selection\n\t\t\t\techo \" \n\t\t\t\t<option value='\" . $row['departmentName'] . \"'\"; \n\t\t\t\t// if the property journalDepartment is equal the department name from loop make default selection\n\t\t\t\tif ($this->journalDepartment == $row['departmentName']) echo \"selected\"; \n\t\t\t\t\n\t\t\t\techo \">\". $row['departmentName'] . \"</option>\n\t\t\t\t\";\n\t\t\t\t\n\t\t\t} // end while\n\t\t\techo \"\n\t\t\t\t</select>\n\t\t\t\";\n\t}",
"public static function unFrmtDeptList(){\n $list = \"\";\n foreach (Database::genDeptsLst() as $row){\n $list[] = $row['dept'];\n }\n return $list;\n }",
"function list_department_dropdown()\n\t{\n\t\t$return = \"\";\n\t\t$query=\"select * from tbl_department\";\n\t\t$result=$this->con->query($query);\n\t\tif(mysqli_num_rows($result) > 0)\n\t\t{\n\t\t\twhile($r = mysqli_fetch_assoc($result))\n\t\t\t{\n\t\t\t\t$return .= \"<option value='\".$r['dep_title'].\"'>\".$r['dep_title'].\"</option>\";\n\t\t\t}\n\t\t}\n\t\treturn $return;\n\t}",
"public function department_list()\n { \n $this->checkuserRole(['admin','super-admin','branch-manager'],'');\n $departments_list = DB::table('tb_departments')->orderBy('id', 'desc')\n ->leftJoin('users','tb_departments.created_by','=','users.id')\n ->select('tb_departments.id','tb_departments.department_name','tb_departments.status','users.name')\n ->orderBy('tb_departments.department_name', 'ASC')\n ->get();\n if(request()->ajax())\n {\n return datatables()->of($departments_list)\n ->addColumn('action', function($data){\n $button = '<button type=\"button\" name=\"edit\" id=\"'.$data->id.'\" class=\"edit btn btn-blue btn-xs\" data-toggle=\"modal\" data-target=\"#editDepartment\" data-placement=\"top\" title=\"Edit\"><i class=\"fa fa-edit\"></i></button>';\n $button .= ' ';\n \n return $button;\n })\n ->rawColumns(['action'])\n ->addIndexColumn()\n ->make(true);\n }\n\n return view('backend.department.department_list');\n }",
"function getDepartmentName($DeptID){\n\tglobal $conn;\n\t\n\t$sqlGet = sprintf(\"SELECT `DeptID`,`DName` FROM `\".DB_PREFIX.\"departments` WHERE `DeptID` = '%s' AND `deletedFlag` = 0\", $DeptID);\n\t//Execute the query\n\t$resultGet = db_query($sqlGet,DB_NAME,$conn);\n\t\n\tif(db_num_rows($resultGet)>0){\n\t\t$rowGet = db_fetch_array($resultGet);\n\t\treturn $rowGet['DName'];\n\t}\n\telse{\n\t\treturn \"N/A\";\n\t}\n}",
"public function getCountryDepartmentAttribute() {\n return $this->description .'/'.$this->country->description;\n }"
] | [
"0.6285864",
"0.6261843",
"0.62585884",
"0.62585884",
"0.62553644",
"0.6047626",
"0.60317564",
"0.60094094",
"0.59839034",
"0.5976146",
"0.5962703",
"0.5930593",
"0.5926292",
"0.5879639",
"0.58742285",
"0.58699715",
"0.5815569",
"0.5815569",
"0.5813793",
"0.58088297",
"0.578173",
"0.5781084",
"0.5767124",
"0.57426035",
"0.568421",
"0.56702816",
"0.5664057",
"0.56640494",
"0.562529",
"0.56243455"
] | 0.6811059 | 0 |
Display's a person's office location in a condensed tablelike format. For use on singleperson.php | function get_person_office_markup( $post ) {
if ( $post->post_type !== 'person' ) { return; }
ob_start();
if ( $room = get_field( 'person_room', $post->ID ) ):
?>
<div class="row">
<div class="col-xl-4 col-md-12 col-sm-4 person-label">
Office
</div>
<div class="col-xl-8 col-md-12 col-sm-8 person-attr">
<?php if ( $room_url = get_field( 'person_room_url', $post->ID ) ): ?>
<a href="<?php echo $room_url; ?>">
<?php echo $room; ?>
</a>
<?php else: ?>
<span>
<?php echo $room; ?>
</span>
<?php endif; ?>
</div>
</div>
<hr class="my-2">
<?php
endif;
return ob_get_clean();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function formatTrailLocationsInfo() {\n $allTrailObjectsInfo = $this -> getAllTrailLocationInfo();\n $formattedTrailLocationInfo = \"\";\n\n foreach ($allTrailObjectsInfo as $trailObjectInfo) {\n $formattedTrailLocationInfo .= '<div style=\"margin-top: 4%;\" class=\"locationContainer col-xs-12 col-sm-6 col-md-6 col-lg-6\"><div id=\"\"><div class=\"locationInfo\"><p class=\"locationDescription\">'\n . $trailObjectInfo -> getLineColor() . '</p><p style=\"text-align: left;\" class=\"locationName\">'\n . $trailObjectInfo -> getName()\n . '</p><img src=\"' . $trailObjectInfo -> getImageLocation() . '\" alt=\"' . $trailObjectInfo -> getImageDescription() . '\">'\n . '</p><p style=\"text-align: left;\" class=\"locationDescription\">Address: '\n . $trailObjectInfo -> getAddress() . \",\"\n . $trailObjectInfo -> getCity() . \" \"\n . $trailObjectInfo -> getState() . \" \"\n . $trailObjectInfo -> getZipcode() . '</p><p style=\"text-align: left;\" class=\"locationDescription\">'\n . $trailObjectInfo -> getDescription() . '</p><a href=\"'\n . $trailObjectInfo -> getUrl() . '\" class=\"btn locationURL\" role=\"button\">Visit Site</a><hr class=\"style17\"></div></div></div>';\n };\n\n\n return $formattedTrailLocationInfo;\n }",
"function macs_print_person_link( $person_id ) {\r\n $name = get_the_title( $person_id );\r\n\t$url = esc_url( rwmb_meta( 'staffDirURL', array(), $person_id ) );\r\n\t$location = implode(', ', wp_get_post_terms( $person_id, \r\n\t\t\t\t\t\t\t\t\t\t\t\t'location', \r\n\t\t\t\t\t\t\t\t\t\t\t\tarray('fields' => 'names' ) \r\n\t\t\t\t\t\t\t\t\t\t\t\t) );\r\n\techo sprintf( '<a href=\"%s\">%s</a> (%s)', $url, $name, $location);\r\n\r\n}",
"public function PrintLocation(){\r\n\t\techo \"id: $this->id<br>\\n\";\r\n\t\techo \"name: $this->name<br>\\n\";\r\n\t\techo \"country: $this->country<br>\\n\";\r\n\t\techo \"information: $this->information<br>\\n\";\r\n\t\techo \"showme: $this->show<br>\\n\";\r\n\t\techo \"cadmin: $this->cadmin<br>\\n\";\r\n\t\techo \"changeday: $this->changeday<br>\\n\";\t\r\n\t\techo \"cadmin_name: $this->cadmin_name<br>\\n\";\r\n\t}",
"function customersWithLocation() {\n $this->layout = false;\n $this->autoRender = false;\n $listingCustomers = $this->_getCustomerList();\n $customerWithLoc = array();\n foreach ($listingCustomers as $key => $customer) {\n\n $customerArr = $this->Customer->find('first', array('conditions' => array('id' => $key)));\n $locationAddress = '';\n $locationName = '';\n if (!empty($customerArr)) {\n $mapLoc = '';\n //if branch name is not empty\n if (!empty($customerArr['Customer']['company_name'])) {\n $mapLoc.='<b>' . $customerArr['Customer']['company_name'] . '</b><br/>';\n }\n\n //get lat lng\n //province\n $province = !empty($customerArr['Customer']['province_id']) ? $this->_getProvinceName($customerArr['Customer']['province_id']) : '';\n //country\n $country = !empty($customerArr['Customer']['country_id']) ? $this->_getCountryName($customerArr['Customer']['country_id']) : '';\n\n if (!empty($customerArr['Customer']['mail_address'])) {\n $locationAddress = $customerArr['Customer']['mail_address'];\n } elseif (!empty($customerArr['Customer']['mail_address_second'])) {\n $locationAddress = $customerArr['Customer']['mail_address_second'];\n }\n if (!empty($locationAddress)) {\n $mapLoc.=$locationAddress . '<br/>';\n }\n\n //if city is not empty\n if (!empty($customerArr['Customer']['city'])) {\n $locationAddress = !empty($locationAddress) ? $locationAddress . ',' . $customerArr['Customer']['city'] : $customerArr['Customer']['city'];\n $mapLoc = !empty($mapLoc) ? $mapLoc . ' ' . $customerArr['Customer']['city'] : $customerArr['Customer']['city'];\n }\n\n $locationAddress = !empty($province) ? $locationAddress . ',' . $province : $locationAddress;\n $locationAddress = !empty($country) ? $locationAddress . ',' . $country : $locationAddress;\n $mapLoc = !empty($mapLoc) ? $mapLoc . ', ' . $province : $province;\n $mapLoc = !empty($mapLoc) ? $mapLoc . ', ' . $country : $country;\n\n //if postal code is not empty\n if (!empty($customerArr['Customer']['postal_code'])) {\n $locationAddress = !empty($locationAddress) ? $locationAddress . ',' . $customerArr['Customer']['postal_code'] : $customerArr['Customer']['postal_code'];\n $mapLoc = !empty($mapLoc) ? $mapLoc . ', ' . $customerArr['Customer']['postal_code'] : $customerArr['Customer']['postal_code'];\n }\n //if phone is not empty\n if (!empty($customerArr['Customer']['phone_number'])) {\n\n $mapLoc = !empty($mapLoc) ? $mapLoc . '<br/>' . $customerArr['Customer']['phone_number'] : $customerArr['Customer']['phone_number'];\n }\n $mapLoc = !empty($mapLoc) ? $mapLoc . '<br/>' . 'Customer' : 'Customer';\n\n $latitude = $longitude = '';\n if (!empty($locationAddress)) {\n // We get the JSON results from this request\n $geo = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address=' . urlencode($locationAddress) . '&sensor=false');\n // We convert the JSON to an array\n $geo = json_decode($geo, true);\n // If everything is cool\n if ($geo['status'] = 'OK' && !empty($geo['results'])) {\n\n // We set our values\n $latitude = @$geo['results'][0]['geometry']['location']['lat'];\n $longitude = @$geo['results'][0]['geometry']['location']['lng'];\n }\n }\n\n\n\n if (!empty($latitude) && !empty($longitude)) {\n $dataArr['Lat'] = $latitude;\n $dataArr['Lng'] = $longitude;\n $dataArr['city'] = $mapLoc;\n $branchWithLoc[] = $dataArr;\n }\n }\n }\n echo json_encode($branchWithLoc);\n }",
"function TopoLoc($reg=\"\",$cty=\"\",$bld=\"\"){\n\n\tglobal $locsep;\n\t$l = \"\";\n\tif($reg or $cty or $bld){\t\t\t\t\t\t\t\t# Any sub locations?\n\t\t$l .= \"^$reg$locsep\";\t\t\t\t\t\t\t\t# Start at region level\n\t\t$l .= ($cty)?\"$cty$locsep\":\"\";\t\t\t\t\t\t\t# Append city if set\n\t\t$l .= ($bld)?\"$bld$locsep\":\"\";\t\t\t\t\t\t\t# Append building if set\n\t}\n\treturn $l;\n}",
"public function getLocationName() {\r\n\r\n $stateId = $this->request->getData('stateId');\r\n $cityName = $this->request->getData('cityName');\r\n $getCityId = $this->Cities->find('all', [\r\n 'fields' => [\r\n 'Cities.id'\r\n ],\r\n 'conditions' => [\r\n 'Cities.state_id' => $stateId,\r\n 'Cities.city_name' => $cityName\r\n ]\r\n ])->hydrate(false)->first();\r\n\r\n $getLocation = '';\r\n $locationList = $this->Locations->find('all', [\r\n 'fields' => [\r\n 'Locations.zip_code',\r\n 'Locations.area_name'\r\n ],\r\n 'conditions' => [\r\n 'Locations.state_id' => $stateId,\r\n 'Locations.city_id' => $getCityId['id'],\r\n 'Locations.status' => 1\r\n ]\r\n ])->hydrate(false)->toArray();\r\n\r\n foreach ($locationList as $key => $val) {\r\n $getLocation .= (SEARCHBY == 'zip') ? $val['zip_code'].',' : $val['area_name'].',';\r\n }\r\n\r\n echo trim($getLocation,',');\r\n exit();\r\n }",
"function get_visitor_location_string()\n{\n\t$geo = get_visitor_geodata() ?? NULL;\n\t$city = $geo['city'] ?? 'Unknown city';\n\t$country = $geo['country'] ?? 'Unknown country';\n\n\n\treturn $city.', '.$country;\n}",
"public function toString()\n {\n return 'Location is mapped respect warehouse';\n }",
"function displayFriendLocator($floor = null)\n\t{\n\t\t$currentLoc = $this->getMyLocation();\n\t\tif(!isset($currentLoc['floor']))\n\t\t\t$currentLoc['floor'] = -1;\n\t\t\t\n\t\tif(!isset($floor['f']) && $currentLoc['floor'] == -1)\n\t\t\t$floor = $GLOBALS['DEFAULT_FLOOR'];\n\t\telse if(!isset($floor['f']))\n\t\t\t$floor = $currentLoc['floor'];\n\t\telse\n\t\t\t$floor = $floor['f'];\n\t\t\t\n\t\t$this->tpl->assign('shortName', $GLOBALS['SHORT_NAME']);\n\t\t$this->tpl->assign('imageURL', $GLOBALS['Small_Logo']);\n\t\t$this->tpl->assign('myLoc', $currentLoc);\n\t\t$this->tpl->assign('floor', $floor);\n\t\t$this->tpl->assign('maps', $GLOBALS['Floor_Map']);\n\t\t$this->requireFacebook();\n\t\t$this->tpl->assign('friend', $this->getLocations($this->facebook->api_client->friends_getAppUsers(), $floor));\n\t\t$this->tpl->assign('resetTime', $GLOBALS['LOCATION_VALID_TIME']);\n\t\t$this->tpl->display('FriendLocator.tpl');\n\t}",
"public static function formatLocation( $locArr, $html = true ) {\n\t\t$output = $locArr[ 'name' ];\n\t\t$html ? $output .= '<br/>' : $output .= \"\\n\";\n\t\t$output .= $locArr[ 'address1' ];\n\t\t$html ? $output .= '<br/>' : $output .= \"\\n\";\n\t\tif( !empty( $locArr[ 'address2' ] ) ) {\n\t\t\t$output .= $locArr[ 'address2' ];\n\t\t\t$html ? $output .= '<br/>' : $output .= \"\\n\";\n\t\t}\n\t\t$output .= $locArr[ 'city' ] . ', ' . $locArr[ 'state' ] . ' ' . $locArr[ 'zip' ];\n\t\t\n\t\treturn $output;\n\t}",
"public function getNiceLocation() {\n\t\treturn ($this->Location) ? Geoip::countryCode2name($this->Location) : \"Anywhere\";\n\t}",
"function colabs_output_nearbysearch($latitude, $longitude) {\n\n $neighborhoods = colabs_get_nearby_places( $latitude, $longitude );\n\n if(!empty($neighborhoods)):\n echo '<div class=\"column col5\">';\n echo '<h4 class=\"property-row-title\">'.__('Neighborhood Info','colabsthemes').'</h4>';\n echo '<ul class=\"neighborhood-info\">';\n foreach ( $neighborhoods['facility_found'] as $facility_found ){\n echo '<li>';\n \techo $facility_found['label'] . ' ';\n \techo '<a href=\"#map-neighborhood-modal\" data-toggle=\"modal\">';\n \t\techo '( '.__('Found','colabsthemes').' '.$facility_found['count'].' )';\n \techo '</a>';\n echo '</li>';\n }\n echo '</ul>';\n echo '</div>';\n endif;\n}",
"function printCoords($words, $legend)\n{\n $html = '';\n foreach ($words as $key => $word) {\n $coord = strtr($word, $legend);\n $x = explode('-', $coord)[0].'0';\n $y = explode('-', $coord)[1].'0';\n $html .= '<a class=\"openMap\" href=\"/2013/fullscreen_map.php?team='.ucfirst($key).'&marker_x='.$x.'&marker_y='.$y.'\">';\n $html .= strtoupper(substr($key, 0, 1)) . \":\" . $x.'-'.$y;\n $html .= '</a>';\n $html .= ', ';\n }\n return substr($html, 0, -2);\n}",
"public function view_by_location()\r\n\t{\r\n\t\t$select_jobs_by_locale = \"SELECT location FROM jobs \";\r\n\t\t$prepare_select_jobs = $this->pdo_connect->prepare($select_jobs_by_locale);\r\n\r\n\t\t$result_set = $prepare_select_jobs->rowCount();\r\n\t\tif ($result_set > 0) {\r\n\t\t\twhile ($rows = $prepare_select_jobs->fetch(PDO::FETCH_ASSOC)) {\r\n\t\t\t\t$location_url = \"location_jobs.php?location=\" . $rows['location'];\r\n\r\n\t\t\t\t?>\r\n\t\t\t\t<li><a class=\"justify-content-between d-flex\" href=\"<?php echo $location_url; ?>\"><p><?php echo $rows['location']; ?></p><span><?php echo $rows['row_count']; ?></span></a></li>\r\n\t\t\t\t<?php\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$msg = \"There are no Jobs posted by Locations so far!\";\r\n\t\t\t#show error message\r\n\t\t\t?>\r\n\t\t\t<li><a class=\"justify-content-between d-flex\" href=\"\"><p><?php echo $msg; ?></p><span></span></a></li>\r\n\t\t\t<?php\r\n\t\t}\r\n\t}",
"function makeLocationList() {\n\t\n\t\t$res = $this->query(\n\t\t\t\"SELECT \n\t\t\t\t$this->table_locations_field_id as id,\n\t\t\t\t$this->table_locations_field_caption as caption\n\t\t\tFROM \n\t\t\t\t$this->table_locations\"\n\t\t);\n\t\t\n\t\t$r = \"<ul id='location_list_ul'>\\n\";\n\t\twhile ($row = $res->fetch_assoc()) {\n\t\t\t$id = $row['id'];\t\t\t\n\t\t\t$r .= \"\n\t\t\t<li>\n\t\t\t\t<div id='location_$id'>\n\t\t\t\t\t\".$this->makeLocation($row).\"\n\t\t\t\t</div>\n\t\t\t</li>\\n\";\n\t\t\t\n\t\t}\n\t\t$r .= \"</ul>\\n\";\n\t\treturn $r;\n\t}",
"function branchesWithLocation() {\n $this->layout = false;\n $this->autoRender = false;\n $listingBranches = $this->_getBranchesList();\n $branchWithLoc = array();\n foreach ($listingBranches as $key => $branch) {\n\n $branchArr = $this->Branch->find('first', array('conditions' => array('id' => $key)));\n $locationAddress = '';\n $locationName = '';\n if (!empty($branchArr)) {\n $mapLoc = '';\n //if branch name is not empty\n if (!empty($branchArr['Branch']['branch_name'])) {\n $mapLoc.='<b>' . $branchArr['Branch']['branch_name'] . '</b><br/>';\n }\n\n //get lat lng\n //province\n $province = !empty($branchArr['Branch']['province_id']) ? $this->_getProvinceName($branchArr['Branch']['province_id']) : '';\n //country\n $country = !empty($branchArr['Branch']['country_id']) ? $this->_getCountryName($branchArr['Branch']['country_id']) : '';\n\n if (!empty($branchArr['Branch']['branch_address'])) {\n $locationAddress = $branchArr['Branch']['branch_address'];\n } elseif (!empty($branchArr['Branch']['branch_address2'])) {\n $locationAddress = $branchArr['Branch']['branch_address2'];\n }\n\n if (!empty($locationAddress)) {\n $mapLoc.=$locationAddress . '<br/>';\n }\n\n //if city is not empty\n if (!empty($branchArr['Branch']['city'])) {\n $locationAddress = !empty($locationAddress) ? $locationAddress . ',' . $branchArr['Branch']['city'] : $branchArr['Branch']['city'];\n $mapLoc = !empty($mapLoc) ? $mapLoc . ' ' . $branchArr['Branch']['city'] : $branchArr['Branch']['city'];\n }\n\n $locationAddress = !empty($province) ? $locationAddress . ',' . $province : $locationAddress;\n $locationAddress = !empty($country) ? $locationAddress . ',' . $country : $locationAddress;\n $mapLoc = !empty($mapLoc) ? $mapLoc . ', ' . $province : $province;\n $mapLoc = !empty($mapLoc) ? $mapLoc . ', ' . $country : $country;\n\n //if postal code is not empty\n if (!empty($branchArr['Branch']['branch_postalcode'])) {\n $locationAddress = !empty($locationAddress) ? $locationAddress . ',' . $branchArr['Branch']['branch_postalcode'] : $branchArr['Branch']['branch_postalcode'];\n $mapLoc = !empty($mapLoc) ? $mapLoc . ', ' . $branchArr['Branch']['branch_postalcode'] : $branchArr['Branch']['branch_postalcode'];\n }\n //if phone is not empty\n if (!empty($branchArr['Branch']['branch_phone'])) {\n\n $mapLoc = !empty($mapLoc) ? $mapLoc . '<br/>' . $branchArr['Branch']['branch_phone'] : $branchArr['Branch']['branch_phone'];\n }\n $mapLoc = !empty($mapLoc) ? $mapLoc . '<br/>' . 'Branch' : 'Branch';\n\n $latitude = $longitude = '';\n if (!empty($locationAddress)) {\n // We get the JSON results from this request\n $geo = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address=' . urlencode($locationAddress) . '&sensor=false');\n // We convert the JSON to an array\n $geo = json_decode($geo, true);\n // If everything is cool\n if ($geo['status'] = 'OK' && !empty($geo['results'])) {\n\n // We set our values\n $latitude = @$geo['results'][0]['geometry']['location']['lat'];\n $longitude = @$geo['results'][0]['geometry']['location']['lng'];\n }\n }\n\n\n\n if (!empty($latitude) && !empty($longitude)) {\n $dataArr['Lat'] = $latitude;\n $dataArr['Lng'] = $longitude;\n $dataArr['city'] = $mapLoc;\n $branchWithLoc[] = $dataArr;\n }\n }\n }\n echo json_encode($branchWithLoc);\n }",
"public function action_personnel_address_book() {\n $personnel = ORM::factory('Personnel')->find_all();\n $this->_template->set('personnel', $personnel);\n $this->_set_content('reports/personnel_address_book');\n }",
"public function getFormattedAddress()\n {\n return implode(', ', array_filter([\n $this->owner->Address,\n $this->owner->Postcode,\n $this->owner->Suburb\n ]));\n }",
"public function dispaly(){\n\n\n return \"Name: {$this->name} - {$this->street} - {$this->ssn}\";\n }",
"function wp_imovel_add_display_address( $property ) {\n\t\tglobal $wp_imovel;\n\t\t$display_address = $wp_imovel['configuration']['display_address_format'];\n\t\tif ( empty( $display_address) ) {\n\t\t\t$display_address = \"[street_number] [street_name],\\n[city], [state]\";\n\t\t}\n\t\t$display_address_code = $display_address;\n\t\t\n\t\t// Check if property is supposed to inehrit the address\t\t\n\t\tif ( isset( $property['parent_id'] ) \n\t\t\t&& is_array( $wp_imovel['property_inheritance'][$property['property_type']]) \n\t\t\t&& in_array( $wp_imovel['configuration']['address_attribute'], $wp_imovel['property_inheritance'][$property['property_type']] ) ) {\n\t\t\n\t\t\tif ( get_post_meta($property['parent_id'], 'address_is_formatted', true) ) {\n\t\t\t\t$street_number = get_post_meta($property['parent_id'],'street_number', true);\n\t\t\t\t$route = get_post_meta($property['parent_id'],'route', true);\n\t\t\t\t$city = get_post_meta($property['parent_id'],'city', true);\n\t\t\t\t$state = get_post_meta($property['parent_id'],'state', true);\n\t\t\t\t$state_code = get_post_meta($property['parent_id'],'state_code', true);\n\t\t\t\t$postal_code = get_post_meta($property['parent_id'],'postal_code', true);\n\t\t\t\t$county = get_post_meta($property['parent_id'],'county', true);\n\t\t\t\t$country = get_post_meta($property['parent_id'],'country', true);\n\t\t\t\t\t\n\t\t\t\t$display_address = str_replace(\"[street_number]\", $street_number,$display_address);\n\t\t\t\t$display_address = str_replace(\"[street_name]\", $route, $display_address);\n\t\t\t\t$display_address = str_replace(\"[city]\", \"$city\",$display_address);\n\t\t\t\t$display_address = str_replace(\"[state]\", \"$state\",$display_address);\n\t\t\t\t$display_address = str_replace(\"[state_code]\", \"$state_code\",$display_address);\n\t\t\t\t$display_address = str_replace(\"[country]\", \"$country\",$display_address);\n\t\t\t\t$display_address = str_replace(\"[county]\", \"$county\",$display_address);\n\t\t\t\t$display_address = str_replace(\"[zip_code]\", \"$postal_code\",$display_address);\n\t\t\t\t$display_address = str_replace(\"[zip]\", \"$postal_code\",$display_address);\n\t\t\t\t$display_address = str_replace(\"[postal_code]\", \"$postal_code\",$display_address);\n\t\t\t\t$display_address =\tpreg_replace( '/^\\n+|^[\\t\\s]*\\n+/m', \"\", $display_address);\n\t\t\t\t$display_address = nl2br($display_address);\n\t\t\t}\n\t\t} else {\n\t\t\t// Verify that address has been converted via Google Maps API\n\t\t\tif ( $property['address_is_formatted'] ) {\n\t\t\t\t\t$street_number = $property['street_number'];\n\t\t\t\t\t$route = $property['route'];\n\t\t\t\t\t$city = $property['city'];\n\t\t\t\t\t$state = $property['state'];\n\t\t\t\t\t$state_code = $property['state_code'];\n\t\t\t\t\t$country = $property['country'];\n\t\t\t\t\t$postal_code = $property['postal_code'];\t\t\t\t\n\t\t\t\t\t$county = $property['county'];\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$display_address = str_replace(\"[street_number]\", $street_number,$display_address);\n\t\t\t\t\t$display_address = str_replace(\"[street_name]\", $route, $display_address);\n\t\t\t\t\t$display_address = str_replace(\"[city]\", \"$city\",$display_address);\n\t\t\t\t\t$display_address = str_replace(\"[state]\", \"$state\",$display_address);\n\t\t\t\t\t$display_address = str_replace(\"[state_code]\", \"$state_code\",$display_address);\n\t\t\t\t\t$display_address = str_replace(\"[country]\", \"$country\",$display_address);\n\t\t\t\t\t$display_address = str_replace(\"[county]\", \"$county\",$display_address);\n\t\t\t\t\t$display_address = str_replace(\"[zip_code]\", \"$postal_code\",$display_address);\n\t\t\t\t\t$display_address = str_replace(\"[zip]\", \"$postal_code\",$display_address);\n\t\t\t\t\t$display_address = str_replace(\"[postal_code]\", \"$postal_code\",$display_address);\n\t\t\t\t\t$display_address =\tpreg_replace( '/^\\n+|^[\\t\\s]*\\n+/m', \"\", $display_address);\n\t\t\t\t\t$display_address = nl2br($display_address);\n\t\t\t}\n\t\t}\n\t\t\n \n\t\t// If somebody is smart enough to do the following with regular expressions, let us know!\n\t\t\n\t\t$comma_killer = explode(\",\", $display_address);\n\t\t\n\t\tif ( is_array( $comma_killer))\n\t\t\tforeach($comma_killer as $key => $addy_line)\n\t\t\t\tif ( isset($addy_line))\n\t\t\t\t\tif ( trim( $addy_line) == \"\")\n\t\t\t\t\t\tunset($comma_killer[$key]);\n\t\t\t\t\t\n\t\t$display_address = implode(\", \", $comma_killer);\n\t\t\t\t\t\n\t\t$empty_line_killer = explode(\"<br />\", $display_address);\t\t\n\t\t\n\t\tif ( is_array( $empty_line_killer))\n\t\t\tforeach($empty_line_killer as $key => $addy_line)\n\t\t\t\tif ( isset($addy_line))\n\t\t\t\t\tif ( trim( $addy_line) == \"\")\n\t\t\t\t\t\tunset($empty_line_killer[$key]);\n\t\t\t\t\t\n\n\t\tif ( is_array( $empty_line_killer ) ) {\n\t\t\t$display_address = implode( '<br />', $empty_line_killer );\n\t\t}\n\n\t\n\t\t$property['display_address'] = $display_address;\t\n\t\t\n\t\t// Don't return if result matches the \n\t\tif ( str_replace( array( \" \", \",\", \"\\n\" ), '', $display_address_code ) == str_replace( array( \" \", \",\", \"\\n\" ), '', $display_address ) ) {\n\t\t\t$property['display_address'] = '';\n\t\t}\n\t\t\t\n\t\treturn $property;\n\t}",
"private static function render_location( $query ) { ?>\n <Location>\n <?php self::echo_meta( 'street-address', 'StreetAddress'); ?>\n <?php self::echo_meta( 'unit-number', 'UnitNumber' ); ?>\n <?php self::echo_meta( 'city', 'City' ); ?>\n <?php self::echo_meta( 'state', 'State' ); ?>\n <?php self::echo_meta( 'zip', 'Zip' ); ?>\n <?php self::echo_meta( 'latitude', 'Lat' ); ?>\n <?php self::echo_meta( 'longitude', 'Long' ); ?>\n <?php self::echo_meta( 'display-address', 'DisplayAddress' ); ?>\n </Location>\n <?php }",
"public function getLocationString(): string {\n return \"$this->locationName ($this->latitude, $this->longitude)\";\n }",
"public function getDisplayName()\n {\n $lines = [];\n if ($this->street1) {\n $lines[] = $this->street1;\n }\n if ($this->street2) {\n $lines[] = $this->street2;\n }\n if ($this->city || $this->state || $this->postcode) {\n $lines[] = trim($this->city . ' ' . $this->state . ' ' . $this->postcode);\n }\n return implode(', ', $lines);\n }",
"function PrintWordSearch($wordsearch, $highlitecells) {\n $max_row = count($wordsearch) - 1;\n $max_col = strlen($wordsearch[0]) - 1;\n\n\t#print \"max_row = \" . $max_row . \"\\n\";\n\t#print \"max_col = \" . $max_col . \"\\n\";\n\n\tprint '<table cellpadding=\"0\" cellspacing=\"0\" style=\"font-size:60%;font-family:courier;background-color:red;color:white\">' . \"\\n\";\n\n\tfor ($row = 0; $row <= $max_row; $row++) {\n\t\tprint \"<tr>\";\n\t\tfor ($col = 0; $col < $max_col; $col++) {\n\n\t\t\t# if current location is in list to be highlighted, then highlight it!\n\t\t\tif ( in_array( array($row,$col), $highlitecells) ) {\n\t\t\t\tprint '<td style=\"background-color:black;font-weight:bold\">';\n\t\t\t} else {\n\t\t\t\tprint '<td>';\n\t\t\t}\n\n\t\t\tprint $wordsearch[$row][$col] . '</td>';\n \t\t}\n\t\tprint \"</tr>\\n\";\n \t}\n\n\tprint \"</table>\\n\";\n\treturn 0;\n}",
"private static function getTaxOfficeName($office)\n {\n $name = $office->code.' - ';\n $name .= $office->municipality->name;\n\n if ($office->number) {\n $name .= ' ('.$office->number.')';\n }\n\n return $name;\n }",
"function vendorsWithLocation() {\n $this->layout = false;\n $this->autoRender = false;\n $listingVendors = $this->listingVendors();\n $vendorWithLoc = array();\n foreach ($listingVendors as $key => $vendor) {\n\n $vendorArr = $this->Vendor->find('first', array('conditions' => array('id' => $key)));\n $locationAddress = '';\n $locationName = '';\n if (!empty($vendorArr)) {\n $mapLoc = '';\n //if branch name is not empty\n if (!empty($vendorArr['Vendor']['vendor_name'])) {\n $mapLoc.='<b>' . $vendorArr['Vendor']['vendor_name'] . '</b><br/>';\n }\n\n //get lat lng\n //province\n $province = !empty($vendorArr['Vendor']['state_id']) ? $this->_getProvinceName($vendorArr['Vendor']['state_id']) : '';\n //country\n $country = !empty($vendorArr['Vendor']['country_id']) ? $this->_getCountryName($vendorArr['Vendor']['country_id']) : '';\n\n if (!empty($vendorArr['Vendor']['mail_address'])) {\n $locationAddress = $vendorArr['Vendor']['mail_address'];\n } elseif (!empty($vendorArr['Vendor']['mail_address2'])) {\n $locationAddress = $vendorArr['Vendor']['mail_address2'];\n }\n if (!empty($locationAddress)) {\n $mapLoc.=$locationAddress . '<br/>';\n }\n //if city is not empty\n if (!empty($vendorArr['Vendor']['city'])) {\n $locationAddress = !empty($locationAddress) ? $locationAddress . ',' . $vendorArr['Vendor']['city'] : $vendorArr['Vendor']['city'];\n $mapLoc = !empty($mapLoc) ? $mapLoc . ' ' . $vendorArr['Vendor']['city'] : $vendorArr['Vendor']['city'];\n }\n\n $locationAddress = !empty($province) ? $locationAddress . ',' . $province : $locationAddress;\n $locationAddress = !empty($country) ? $locationAddress . ',' . $country : $locationAddress;\n $mapLoc = !empty($mapLoc) ? $mapLoc . ', ' . $province : $province;\n $mapLoc = !empty($mapLoc) ? $mapLoc . ', ' . $country : $country;\n\n //if postal code is not empty\n if (!empty($vendorArr['Vendor']['postal_code'])) {\n $locationAddress = !empty($locationAddress) ? $locationAddress . ',' . $vendorArr['Vendor']['postal_code'] : $vendorArr['Vendor']['postal_code'];\n $mapLoc = !empty($mapLoc) ? $mapLoc . ', ' . $vendorArr['Vendor']['postal_code'] : $vendorArr['Vendor']['postal_code'];\n }\n //if phone is not empty\n if (!empty($vendorArr['Vendor']['contact_phoneno'])) {\n\n $mapLoc = !empty($mapLoc) ? $mapLoc . '<br/>' . $vendorArr['Vendor']['contact_phoneno'] : $vendorArr['Vendor']['contact_phoneno'];\n }\n $mapLoc = !empty($mapLoc) ? $mapLoc . '<br/>' . 'Vendor' : 'Vendor';\n $latitude = $longitude = '';\n if (!empty($locationAddress)) {\n // We get the JSON results from this request\n $geo = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address=' . urlencode($locationAddress) . '&sensor=false');\n // We convert the JSON to an array\n $geo = json_decode($geo, true);\n // If everything is cool\n if ($geo['status'] = 'OK' && !empty($geo['results'])) {\n\n // We set our values\n $latitude = @$geo['results'][0]['geometry']['location']['lat'];\n $longitude = @$geo['results'][0]['geometry']['location']['lng'];\n }\n }\n if (!empty($latitude) && !empty($longitude)) {\n $dataArr['Lat'] = $latitude;\n $dataArr['Lng'] = $longitude;\n $dataArr['city'] = $mapLoc;\n $vendorWithLoc[] = $dataArr;\n }\n }\n }\n echo json_encode($vendorWithLoc);\n }",
"public function shippingLocationCreater(Order $order) : string{\n return \"{$order->shippingAddr->add1}, {$order->shippingAddr->city}, {$order->shippingAddr->state} {$order->shippingAddr->zip}\";\n }",
"public function pickupLocationCreater(Order $order) : string{\n return \"{$order->pickupAddr->add1}, {$order->pickupAddr->city}, {$order->pickupAddr->state} {$order->pickupAddr->zip}\";\n }",
"function displayHospital($poi) {\n \techo '<div data-name=\"Hospital\" class=\"Poi';\n \t\n \t//if this place has been visited before, make it gray\n \tif ($poi->is_visited()) {\n \t\techo ' visited';\n \t}\n \t\n \techo '\" id=\"';\n echo ($poi->what_name());\n echo '\">';\n echo '<a onclick=\"addToPath(\\'hp\\')\" href=\"hospital.php\"></a></div>';\n}",
"function EmployerDetails()\n\t\t{\n\t\t\tif(isset($_REQUEST['id']))\n\t\t\t{\n\t\t\t\t$emp_id = $_REQUEST['id'];\n\t\t\t\t$oEmployer = $this->oModel->getEmployerDetails($emp_id);\n\t\t\t\t\n\t\t\t\t$oEmployer = $oEmployer[0];\n\t\t\t\t$oReferrer=$this->oModel->GetReferrerName($oEmployer->referred_id);\n\t\t\t\t\n\t\t\t\t$oEmployer->referrer=$oReferrer[0]->first_name.\" \".$oReferrer[0]->last_name;\n\t\t\t}\n\t\t\t \n\t\t\t$oProvince = $this->oModel->getProvince();\n\t\t\t$oEmployer->location = $oLocation[$oEmployer->location];\n\t\t\t$this->oView->oLocation = $oLocation;\n\t\t\t$this->oView->oEmployer = $oEmployer;\n\t\t\t$this->oView->search_field \t= $_REQUEST['search_field'];\n\t\t\t$this->oView->search_text \t= $_REQUEST['search_text'];\n\t\t\t$this->oView->EmployerDetails();\t\t\n\t\t}"
] | [
"0.6143955",
"0.59250957",
"0.59221363",
"0.58970964",
"0.5710093",
"0.5672395",
"0.5661076",
"0.5634856",
"0.5633833",
"0.55802524",
"0.5519067",
"0.54710793",
"0.54625523",
"0.5448672",
"0.54442656",
"0.54387355",
"0.54172754",
"0.5332053",
"0.53317547",
"0.5284186",
"0.5278895",
"0.5252679",
"0.5244982",
"0.5222726",
"0.52163935",
"0.521221",
"0.5208546",
"0.51994497",
"0.5191188",
"0.51858026"
] | 0.5950872 | 1 |
Display's a person's email in a condensed tablelike format. For use on singleperson.php | function get_person_email_markup( $post ) {
if ( $post->post_type !== 'person' ) { return; }
ob_start();
if ( $email = get_field( 'person_email', $post->ID ) ):
?>
<div class="row">
<div class="col-xl-4 col-md-12 col-sm-4 person-label">
E-mail
</div>
<div class="col-xl-8 col-md-12 col-sm-8 person-attr">
<a href="mailto:<?php echo $email; ?>" class="person-email">
<?php echo $email; ?>
</a>
</div>
</div>
<hr class="my-2">
<?php
endif;
return ob_get_clean();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayMail($mail){\n\n return sprintf(\"\n <tr class='tr-data text-center'>\n <td data-label='Titre' class='text-center w-50 td-title'>%s</td>\n <td data-label='Mail' class='text-center'><a class='text-decoration-none text-reset' href='mail.php?u=%d'><i class='far fa-eye'></i></td>\n <td data-label='Modifier' class='text-center'><a class='text-decoration-none text-reset' href='updateMail.php?u=%d'><i class='fas fa-edit'></i></a></td>\n </tr>\", \n html_entity_decode($mail->body, ENT_HTML5),\n $mail->id,\n $mail->id\n );\n}",
"public function renderEmail() {\n $content = '';\n foreach($this->object->info->attributes->attribute as $item) {\n $label = (string)$item->label;\n $name = (string)$item->name;\n $type = (string)$item->type;\n switch (Db_ObjectType::baseType($type)) {\n case 'text':\n $content .= '<strong>'.__($label).'</strong>: '.$this->object->get($name).'<br/>';\n break;\n case 'textarea':\n $content .= '<strong>'.__($label).'</strong>: '.nl2br($this->object->get($name)).'<br/>';\n break;\n case 'select':\n case 'radio':\n $content .= '<strong>'.__($label).'</strong>: '.$this->object->label($name).'<br/>';\n break;\n case 'date':\n case 'selectDate':\n $content .= '<strong>'.__($label).'</strong>: '.Date::sqlText($this->object->get($name), true).'<br/>';\n break;\n case 'checkbox':\n $value = ($this->object->get($name)==1) ? __('yes') : __('no');\n $content .= '<strong>'.__($label).'</strong>: '.$value.'<br/>';\n break;\n }\n }\n return '<p>'.$content.'</p>';\n }",
"function format_email($email_info){\n\t\t\t\n\t\t\t\t//grab correct template content\n\t\t\t\tif ($email_info['type'] == \"contributor\"){\n\t\t\t\t\t$template = file_get_contents('php/emails/contributor_template.html');\n\t\t\t\t} else {\n\t\t\t\t\t$template = file_get_contents('php/emails/project_template.html');\n\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t//replace all the tags\n\t\t\t\t$template = preg_replace('/{FNAME}/', $email_info['fname'], $template);\n\n\t\t\t\t//return the html of the template\n\t\t\t\treturn $template;\n\t\t\n\t\t\t}",
"public function fetchEmail(): string\n {\n return parent::fetchPersonEmail(self::TABLE_NAME);\n }",
"function ds_generate_email( $email, $class = '', $text = '', $is_link = true ) {\n $exploded_email = explode('@', $email);\n $username = $exploded_email[0];\n $domain = $exploded_email[1];\n return '<span class=\"masked_email ' . $class . '\" data-masked-lined=\"' . $is_link . '\" data-masked-name=\"' . $username . '\" data-masked-domain=\"' . $domain . '\">' . $text . '</span>';\n }",
"function toString() {\r\n $result = $this->first_name . ' ' . $this->surname;\r\n $result .= ' (' . $this->average() . \")\\n\";\r\n foreach ($this->emails as $which => $what)\r\n $result .= $which . ': ' . $what . \"\\n\";\r\n $result .= \"\\n\";\r\n return '<pre>' . $result . '</pre>';\r\n }",
"public function get_email(){\n\t\tprint $this->email . \"\\n\";\t\n\t}",
"function toString() {\n $result = $this->first_name . ' ' . $this->surname;\n $result .= ' (' . $this->average() . \")\\n\";\n foreach($this->emails as $which => $what) {\n $result .= $which . ': '. $what . \"\\n\";\n $result .= \"\\n\";\n }\n return '<pre>' . $result .'</pre>';\n }",
"function getEmail() {\n\t?>\n\t\n\t<?php\n}",
"public function composed()\n {\n if (!empty($this->RealName)) {\n return \"{$this->RealName} <{$this->EmailAddress}>\";\n } else {\n return \"{$this->EmailAddress}\";\n }\n }",
"function toString() {\n $result = $this->first_name . ' ' . $this->surname;\n $result .= ' (' . $this->average() . \")\\n\";\n foreach ($this->emails as $which=>$what) {\n $result .= $which . \": $what\\n\";\n }\n $result .= \"\\n\";\n return \"<pre>$result</pre>\";\n }",
"function user_render($user)\n{\n\th3(\"Name : \" .$user['firstname'].\" \".$user['lastname']);\n\techo '<h3>Email : '.$user['email'].'</h3>';\n\t}",
"function invite_anyone_email_fields( $returned_emails = false ) {\n\tif ( is_array( $returned_emails ) )\n\t\t$returned_emails = implode( \"\\n\", $returned_emails );\n?>\n\t<textarea name=\"invite_anyone_email_addresses\" class=\"invite-anyone-email-addresses\" id=\"invite-anyone-email-addresses\"><?php echo $returned_emails ?></textarea>\n<?php\n}",
"function gmt_courses_get_email () {\n\t\treturn '<a href=\"mailto:chris@gomakethings.com\">chris@gomakethings.com</a>';\n\t}",
"function getPersonsEmail($personId){\n $globalFunctionsConn = openDBConnection();\n $results = $globalFunctionsConn->query(\"SELECT `email` FROM `people` WHERE `personId` = \".$personId . \" LIMIT 1\");\n if($results ->num_rows > 0){\n return $results->fetch_assoc()['email'];\n \t}\n \t\n \treturn \"\";\n \n }",
"function tpl_email($email, $subject = null) {\n\treturn preg_replace_callback(\n\t\t'/[\\w\\-\\+\\._]+@[\\w\\-\\.]+/', \n\t\tarray(new EmailReplaceFunctor($subject), 'replace'), \n\t\tsynd_htmlspecialchars($email));\n}",
"function GetAuthorEmail()\r\n\t{\r\n\t\treturn \"\";\r\n\t}",
"function get_email_address() {\r\n\tglobal $basis;\r\n\r\n\t$emailat = $basis['auemail'];\r\n\tif ($basis['showemail'] != 'asis')\r\n\t\t$emailat = str_replace(array(\"@\", \".\"), array(\"[at]\", \"[dot]\"), $basis['auemail']);\r\n\treturn $emailat;\r\n}",
"public function emailFormat()\n {\n $front_url = env('BASE_LINK', 24). \"complete-registration/\" . $this->invited_user->id;\n return [\n 'companies' => 'Brans',\n 'recipient' => $this->invited_user->email,\n 'mail_subject' => \"Invitation to join SWiN\",\n 'inviter' => $this->inviter_name,\n 'valid_duration' => \"24 hours\",\n 'link' => $front_url\n ];\n }",
"public function getInviteeDisplayText()\n {\n $emailAddress = $this->getInviteeEmailAddress();\n if ($this->invitedUser !== null) {\n return sprintf(\n '%s (%s)',\n $emailAddress,\n $this->invitedUser->getDisplayName()\n );\n } else {\n return $emailAddress;\n }\n }",
"function getEmailAddr() {\n\t$emails = \"\";\n\tif(isLoggedIn()) {\n\t\tglobal $db;\n\t\t$query = \"SELECT c_email FROM contacts;\";\n\t\t$result = mysqli_query($db, $query);\n\t\twhile($email = mysqli_fetch_array($result))\n\t\t\t$emails .= \"$email[0]; \";\t\n\t\treturn $emails;\n\t}\n}",
"public function __toString() {\n\t\treturn $this->email;\n\t}",
"private function show()\n\t{\n\n\t\t$emails = array();\n\t\t//Abfrage aller E-Mailadressen die in einer Gruppe sind\n\t\t$query = 'SELECT id, email, nickname FROM modnewsletter n, modnewsletteremailingroup ng WHERE n.id = ng.mailId ORDER BY nickname';\n\t\t$insert = mysql_query($query) OR functions::Output_fehler('Mysql-Error: ajhs9990');\n\t\twhile($daten = mysql_fetch_assoc($insert))\n\t\t{\n\t\t\t\n\t\t}\n\t\t\n\t\tfunctions::Output_var('emails', $outData);\n\n\t\t//Anzeige der Gruppen für das Hinzufügen-Formular\n\t\tfunctions::Output_var('groups', functions::Selector('modnewslettergruppe', 'name'));\n\t}",
"function highlight_emails($text) {\n if(strpos($text,'@') === false) { return $text; } // quick test for emails\n\n $email_reg = \"%([_a-z0-9-]+)(\\.[_a-z0-9-]+)*@([a-z0-9-]+)(\\.[a-z0-9-]+)*(\\.[a-z]{2,4})(?!\\S)%\";\n preg_match_all($email_reg,' '.$text.' ',$find);\n foreach($find[0] as $email) {\n list($username,$domaintld) = split(\"@\",$email);\n if(getmxrr($domaintld,$mxrecords)) { // check its from a valid email domain\n $encoded = email_encode($email);\n $ahref = \"<a href='mailto:$encoded'>$encoded</a>\";\n $text = str_replace($email,$ahref,$text);\n }\n }\n return $text;\n}",
"public function body()\n\t{\n\t\t$limit = 12;\n\t\t$users = array();\n\t\t\n\t\t$where = array( array( 'email<>?', '' ) );\n\t\tif ( $cutoff = $this->cutoff() )\n\t\t{\n\t\t\t$where[] = array( 'joined>?', $cutoff->getTimestamp() );\n\t\t}\t\n\t\t$more = \\IPS\\Db::i()->select( 'COUNT(*)', 'core_members', $where )->first() - $limit + 1;\t\n\t\t\n\t\tforeach (\n\t\t\t\\IPS\\Db::i()->select(\n\t\t\t\t'*',\n\t\t\t\t'core_members',\n\t\t\t\t$where,\n\t\t\t\t'joined desc',\n\t\t\t\tarray( 0, ( $more === 1 ) ? $limit : ( $limit - 1 ) )\n\t\t\t) as $user\n\t\t)\n\t\t{\n\t\t\t$users[ $user['member_id'] ] = \\IPS\\Member::constructFromData( $user );\n\t\t}\n\t\t\t\t\n\t\tif ( \\count( $users ) )\n\t\t{\n\t\t\treturn \\IPS\\Theme::i()->getTemplate( 'notifications', 'core', 'admin' )->newMember( $users, $this, $more );\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t}",
"public function __toString(){\n return $this->email;\n }",
"public function getFullEmailAddress() {\n return $this->name ? $this->name . \" <\" . $this->emailAddress . \">\" : $this->emailAddress;\n }",
"function emailHelper() {\n\t\t$roleDao =& DAORegistry::getDAO('RoleDAO');\n\t\t$signoffDao =& DAORegistry::getDAO('SignoffDAO');\n\t\t$userDao =& DAORegistry::getDAO('UserDAO');\n\t\t$journal =& Request::getJournal();\n\n\t\t$recipients = array();\n\n\t\t// Get editors for article\n\t\t$editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO');\n\t\t$editAssignments =& $editAssignmentDao->getEditAssignmentsByArticleId($this->article->getId());\n\t\t$editAssignments =& $editAssignments->toArray();\n\t\t$editorAddresses = array();\n\t\tforeach ($editAssignments as $editAssignment) {\n\t\t\t$editorAddresses[$editAssignment->getEditorEmail()] = $editAssignment->getEditorFullName();\n\t\t}\n\n\t\t// If no editors are currently assigned, send this message to\n\t\t// all of the journal's editors.\n\t\tif (empty($editorAddresses)) {\n\t\t\t$editors =& $roleDao->getUsersByRoleId(ROLE_ID_EDITOR, $journal->getId());\n\t\t\twhile (!$editors->eof()) {\n\t\t\t\t$editor =& $editors->next();\n\t\t\t\t$editorAddresses[$editor->getEmail()] = $editor->getFullName();\n\t\t\t}\n\t\t}\n\n\t\t// Get proofreader\n\t\t$proofSignoff = $signoffDao->getBySymbolic('SIGNOFF_PROOFREADING_PROOFREADER', ASSOC_TYPE_ARTICLE, $this->article->getId());\n\t\tif ($proofSignoff != null && $proofSignoff->getUserId() > 0) {\n\t\t\t$proofreader =& $userDao->getUser($proofSignoff->getUserId());\n\t\t} else {\n\t\t\t$proofreader = null;\n\t\t}\n\n\t\t// Get layout editor\n\t\t$layoutSignoff = $signoffDao->getBySymbolic('SIGNOFF_LAYOUT', ASSOC_TYPE_ARTICLE, $this->article->getId());\n\t\tif ($layoutSignoff != null && $layoutSignoff->getUserId() > 0) {\n\t\t\t$layoutEditor =& $userDao->getUser($layoutSignoff->getUserId());\n\t\t} else {\n\t\t\t$layoutEditor = null;\n\t\t}\n\n\t\t// Get copyeditor\n\t\t$copySignoff = $signoffDao->getBySymbolic('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $this->article->getId());\n\t\tif ($copySignoff != null && $copySignoff->getUserId() > 0) {\n\t\t\t$copyeditor =& $userDao->getUser($copySignoff->getUserId());\n\t\t} else {\n\t\t\t$copyeditor = null;\n\t\t}\n\n\t\t// Get reviewer\n\t\t$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');\n\t\t$reviewAssignment =& $reviewAssignmentDao->getById($this->comment->getAssocId());\n\t\tif ($reviewAssignment != null && $reviewAssignment->getReviewerId() != null) {\n\t\t\t$reviewer =& $userDao->getUser($reviewAssignment->getReviewerId());\n\t\t} else {\n\t\t\t$reviewer = null;\n\t\t}\n\n\t\t// Get author\n\t\t$author =& $userDao->getUser($this->article->getUserId());\n\n\t\tswitch ($this->comment->getCommentType()) {\n\t\tcase COMMENT_TYPE_PEER_REVIEW:\n\t\t\tif ($this->roleId == ROLE_ID_EDITOR || $this->roleId == ROLE_ID_SECTION_EDITOR) {\n\t\t\t\t// Then add reviewer\n\t\t\t\tif ($reviewer != null) {\n\t\t\t\t\t$recipients = array_merge($recipients, array($reviewer->getEmail() => $reviewer->getFullName()));\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase COMMENT_TYPE_EDITOR_DECISION:\n\t\t\tif ($this->roleId == ROLE_ID_EDITOR || $this->roleId == ROLE_ID_SECTION_EDITOR) {\n\t\t\t\t// Then add author\n\t\t\t\tif (isset($author)) $recipients = array_merge($recipients, array($author->getEmail() => $author->getFullName()));\n\t\t\t} else {\n\t\t\t\t// Then add editors\n\t\t\t\t$recipients = array_merge($recipients, $editorAddresses);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase COMMENT_TYPE_COPYEDIT:\n\t\t\tif ($this->roleId == ROLE_ID_EDITOR || $this->roleId == ROLE_ID_SECTION_EDITOR) {\n\t\t\t\t// Then add copyeditor and author\n\t\t\t\tif ($copyeditor != null) {\n\t\t\t\t\t$recipients = array_merge($recipients, array($copyeditor->getEmail() => $copyeditor->getFullName()));\n\t\t\t\t}\n\n\t\t\t\t$recipients = array_merge($recipients, array($author->getEmail() => $author->getFullName()));\n\n\t\t\t} else if ($this->roleId == ROLE_ID_COPYEDITOR) {\n\t\t\t\t// Then add editors and author\n\t\t\t\t$recipients = array_merge($recipients, $editorAddresses);\n\n\t\t\t\tif (isset($author)) $recipients = array_merge($recipients, array($author->getEmail() => $author->getFullName()));\n\n\t\t\t} else {\n\t\t\t\t// Then add editors and copyeditor\n\t\t\t\t$recipients = array_merge($recipients, $editorAddresses);\n\n\t\t\t\tif ($copyeditor != null) {\n\t\t\t\t\t$recipients = array_merge($recipients, array($copyeditor->getEmail() => $copyeditor->getFullName()));\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase COMMENT_TYPE_LAYOUT:\n\t\t\tif ($this->roleId == ROLE_ID_EDITOR || $this->roleId == ROLE_ID_SECTION_EDITOR) {\n\t\t\t\t// Then add layout editor\n\n\t\t\t\t// Check to ensure that there is a layout editor assigned to this article.\n\t\t\t\tif ($layoutEditor != null) {\n\t\t\t\t\t$recipients = array_merge($recipients, array($layoutEditor->getEmail() => $layoutEditor->getFullName()));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Then add editors\n\t\t\t\t$recipients = array_merge($recipients, $editorAddresses);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase COMMENT_TYPE_PROOFREAD:\n\t\t\tif ($this->roleId == ROLE_ID_EDITOR || $this->roleId == ROLE_ID_SECTION_EDITOR) {\n\t\t\t\t// Then add layout editor, proofreader and author\n\t\t\t\tif ($layoutEditor != null) {\n\t\t\t\t\t$recipients = array_merge($recipients, array($layoutEditor->getEmail() => $layoutEditor->getFullName()));\n\t\t\t\t}\n\n\t\t\t\tif ($proofreader != null) {\n\t\t\t\t\t$recipients = array_merge($recipients, array($proofreader->getEmail() => $proofreader->getFullName()));\n\t\t\t\t}\n\n\t\t\t\tif (isset($author)) $recipients = array_merge($recipients, array($author->getEmail() => $author->getFullName()));\n\n\t\t\t} else if ($this->roleId == ROLE_ID_LAYOUT_EDITOR) {\n\t\t\t\t// Then add editors, proofreader and author\n\t\t\t\t$recipients = array_merge($recipients, $editorAddresses);\n\n\t\t\t\tif ($proofreader != null) {\n\t\t\t\t\t$recipients = array_merge($recipients, array($proofreader->getEmail() => $proofreader->getFullName()));\n\t\t\t\t}\n\n\t\t\t\tif (isset($author)) $recipients = array_merge($recipients, array($author->getEmail() => $author->getFullName()));\n\n\t\t\t} else if ($this->roleId == ROLE_ID_PROOFREADER) {\n\t\t\t\t// Then add editors, layout editor, and author\n\t\t\t\t$recipients = array_merge($recipients, $editorAddresses);\n\n\t\t\t\tif ($layoutEditor != null) {\n\t\t\t\t\t$recipients = array_merge($recipients, array($layoutEditor->getEmail() => $layoutEditor->getFullName()));\n\t\t\t\t}\n\n\t\t\t\tif (isset($author)) $recipients = array_merge($recipients, array($author->getEmail() => $author->getFullName()));\n\n\t\t\t} else {\n\t\t\t\t// Then add editors, layout editor, and proofreader\n\t\t\t\t$recipients = array_merge($recipients, $editorAddresses);\n\n\t\t\t\tif ($layoutEditor != null) {\n\t\t\t\t\t$recipients = array_merge($recipients, array($layoutEditor->getEmail() => $layoutEditor->getFullName()));\n\t\t\t\t}\n\n\t\t\t\tif ($proofreader != null) {\n\t\t\t\t\t$recipients = array_merge($recipients, array($proofreader->getEmail() => $proofreader->getFullName()));\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\treturn $recipients;\n\t}",
"function column_attendees($item) {\n return sprintf(\n '%1$s',\n $item['attendees']\n );\n }",
"public function __toString()\n {\n if ($this->firstName !== null && $this->lastName !== null) {\n return $this->firstName . ' ' . $this->lastName;\n }\n\n if ($this->firstName !== null) {\n return $this->firstName;\n }\n\n if ($this->lastName !== null) {\n return $this->lastName;\n }\n\n return $this->email;\n }"
] | [
"0.67953783",
"0.66364807",
"0.6342721",
"0.62997955",
"0.6263161",
"0.62240684",
"0.62200266",
"0.6217673",
"0.6175484",
"0.6160153",
"0.61238325",
"0.6087461",
"0.6046434",
"0.59388494",
"0.59263635",
"0.59183496",
"0.5910168",
"0.5866127",
"0.5862742",
"0.58461386",
"0.58444244",
"0.5844275",
"0.5818699",
"0.58182937",
"0.58156353",
"0.5786586",
"0.5767432",
"0.57647574",
"0.5749732",
"0.5717073"
] | 0.7056709 | 0 |
Display's a person's phone numbers in a condensed tablelike format. For use on singleperson.php | function get_person_phones_markup( $post ) {
if ( $post->post_type !== 'person' ) { return; }
ob_start();
if ( have_rows( 'person_phone_numbers', $post->ID ) ):
?>
<div class="row">
<div class="col-xl-4 col-md-12 col-sm-4 person-label">
Phone
</div>
<div class="col-xl-8 col-md-12 col-sm-8 person-attr">
<ul class="list-unstyled mb-0">
<?php
while ( have_rows( 'person_phone_numbers', $post->ID ) ): the_row();
$phone = get_sub_field( 'number' );
if ( $phone ):
?>
<li>
<a href="tel:<?php echo preg_replace( "/\D/", '', $phone ); ?>" class="person-tel">
<?php echo $phone; ?>
</a>
</li>
<?php
endif;
endwhile;
?>
</ul>
</div>
</div>
<hr class="my-2">
<?php
endif;
return ob_get_clean();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function show_phone_nums(&$row) {\n msg(\n '[' .\n $row->recordId\n . ']['\n . $row->memberId\n . ']['\n . $row->phone\n . ']['\n . $row->phone1\n . ']['\n . $row->phone2\n . ']['\n . $row->phone3\n . ']'\n );\n}",
"function format_phone_number($phone) {\n // get length of the number and pass to a switch\n $length = strlen($phone);\n switch($length) {\n case 7:\n // apply regex to seperate number into groups, which we alter to look differently\n return preg_replace(\"/(\\d{3})(\\d{4})/\", \"$1-$2\", $phone);\n break;\n case 11:\n return preg_replace(\"/(\\d{3})(\\d{3})(\\d{4})/\", \"($1) $2-$3\", $phone);\n break;\n default:\n return $phone;\n break;\n }\n }",
"function sal_phone_numbers($phone_number, $schema_layout){\n\t$phone_link = str_replace(array('(', ')', '-', ' '), '', $phone_number);\n\n\t$schema_open = ($schema_layout == true ? '<span itemprop=\"addressLocality\">' : '' );\n\t$schema_close = ($schema_layout == true ? '</span>' : '' );\n\n\t$output = '';\n\n\t$output.= '<div class=\"phone-number\">';\n\t$output.= $schema_open;\n\t$output.= '<a href=\"tel:' . $phone_link . '\">' . $phone_number . '</a>';\n\t$output.= $schema_close;\n\t$output.= '</div>';\n\n\treturn $output;\n}",
"private static function format_phone_nld($phone) {\n if(!isset($phone{3})) { return ''; }\n // note: strip out everything but numbers\n $phone = preg_replace(\"/[^0-9]/\", \"\", $phone);\n $length = strlen($phone);\n switch($length) {\n case 9:\n return \"+31\".$phone;\n break;\n case 10:\n return \"+31\".substr($phone, 1);\n break;\n case 11:\n case 12:\n return \"+\".$phone;\n break;\n default:\n return $phone;\n break;\n }\n }",
"function displayPhone($phone) {\n if (strlen($phone) == 10) {\n return '(' . substr($phone, 0, 3) . ') ' . substr($phone, 3, 3) . '-' . substr($phone, 6);\n } else {\n return $phone;\n }\n}",
"function show_phone_number_formatted($phone_number)\n{\n\tglobal $phone_number_link_template,$phone_number_link_target;\n\n\tif(isset($phone_number_link_template) && !empty($phone_number_link_template))\n\t{\n\t\t$phone_number_link_url = str_replace(\"___phone_number___\",\n\t\t\turlencode($phone_number),$phone_number_link_template);\n\n\t\tif(isset($phone_number_link_target) && !empty($phone_number_link_target))\n\t\t\t$target = \" target=\\\"\" . $phone_number_link_target . \"\\\"\";\n\t\telse\n\t\t\t$target = \"\";\n\n\t\techo \"<a href=\\\"\" . $phone_number_link_url . \"\\\"\"\n\t\t\t. $target . \">\"\n\t\t\t. htmlentities($phone_number,ENT_COMPAT,\"UTF-8\")\n\t\t\t. \"</a>\";\n\t}\n\telse\n\t\techo htmlentities($phone_number,ENT_COMPAT,\"UTF-8\");\n}",
"function sp_footer_phone_number_html() {\n\n\t$output = '';\n\n\t$phone = sp_get_option( 'footer_phone' );\n\n\tif ( sp_get_option( 'show_footer_phone', 'is', 'on' ) && ! empty( $phone ) ) {\n\n\t\t// prep the phone number\n\t\t$phone_raw = apply_filters( 'sp_phone_number_format', str_replace( array( ' ', '-', '(', ')', '.' ), '', $phone ), $phone );\n\n\t\t$output .= '<p class=\"footer-phone-number\"><span class=\"divider\">|</span>' . apply_filters( 'sp_footer_phone_label', __( 'Tel:', 'sp-theme' ) ) . ' <a href=\"tel:' . esc_attr( $phone_raw ) . '\" class=\"phone\">' . $phone . '</a></p>' . PHP_EOL;\n\t}\n\n\treturn $output;\n}",
"function show_phone_number()\n\t{\n\t\tif($this->edit)\n\t\t{\n\t\t\tif($this->required)\n\t\t\t\t$style = \"width:98%;border-color:red;border-style:solid\";\n\t\t\telse\n\t\t\t\t$style = \"width:98%;\";\n\n\t\t\techo \"<input style=\\\"\" . $style . \"\\\" type=\\\"text\\\" name=\\\"ldap_attribute_\"\n\t\t\t\t. $this->attribute . \"\\\" value=\\\"\"\n\t\t\t\t. htmlentities($this->value,ENT_COMPAT,\"UTF-8\")\n\t\t\t\t. \"\\\" title=\\\"\" . $this->display_name . \"\\\" placeholder=\\\"\"\n\t\t\t\t. $this->display_name . \"\\\">\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($this->show_embedded_links)\n\t\t\t\tshow_phone_number_formatted($this->value);\n\t\t\telse\n\t\t\t\techo htmlentities($this->value,ENT_COMPAT,\"UTF-8\");;\n\t\t}\n\t}",
"public function get_phone(){\n\t\tprint $this->phone . \"\\n\";\t\n\t}",
"function format_phone_link($phone) {\n if(!isset($phone{3})) { return ''; }\n // note: strip out everything but numbers \n $phone = preg_replace(\"/[^0-9]/\", \"\", $phone);\n $length = strlen($phone);\n switch($length) {\n case 7:\n return preg_replace(\"/([0-9]{3})([0-9]{4})/\", \"$1-$2\", $phone);\n break;\n case 10:\n return preg_replace(\"/([0-9]{3})([0-9]{3})([0-9]{4})/\", \"$1-$2-$3\", $phone);\n break;\n case 11:\n return preg_replace(\"/([0-9]{1})([0-9]{3})([0-9]{3})([0-9]{4})/\", \"$1-$2-$3-$4\", $phone);\n break;\n default:\n return $phone;\n break;\n }\n}",
"public static function getFormattedPhone()\n {\n return str_replace('-', '', setting('phone', '+20-101-620-05-99'));\n }",
"function displayContacts ($contactsArray) {\n\tclearstatcache();\n\techo str_pad('Name', 16);\n\techo \" | \";\n\techo \" Phone Number\";\n\techo \"\\n\";\n\techo \"----------------------------------\" . PHP_EOL;\n\t\tforeach ($contactsArray as $key => $contact) {\n\t\t \techo str_pad($contact['name'], 16) . \" | \" . $contact['number'] . PHP_EOL;\n\t\t }\n}",
"function formatPhone($rawPhone) {\n $phone = preg_replace(\"/[^[:alnum:][:space:]]/u\", '', $rawPhone);\n if (strlen($phone)==10) {\n $phone = \"(\" . substr($phone,0,3) . \") \" . substr($phone,3,3) . \"-\" . substr($phone,6);\n } else {\n $phone = $rawPhone;\n }\n return $phone;\n }",
"function format_phone($phone)\n{\n if (strlen($phone) > 10) {\n return '(' . substr($phone, 0, 2) . ') ' . substr($phone, 2, 5) . '-'\n . substr($phone, 7);\n } else {\n return '(' . substr($phone, 0, 2) . ') ' . substr($phone, 2, 4) . '-'\n . substr($phone, 6);\n }\n}",
"private static function format_phone_bel($phone) {\n if(!isset($phone{3})) { return ''; }\n // note: strip out everything but numbers\n $phone = preg_replace(\"/[^0-9]/\", \"\", $phone);\n $length = strlen($phone);\n switch($length) {\n case 9:\n return \"+32\".$phone;\n break;\n case 10:\n return \"+32\".substr($phone, 1);\n break;\n case 11:\n case 12:\n return \"+\".$phone;\n break;\n default:\n return $phone;\n break;\n }\n }",
"public function phone_number(string $spacer='-') {\n // create phone number\n $phoneNumber = '';\n for ($i=0; $i < 10; $i++) { \n // make sure the first digit of each section is not a zero\n if ($i === 0 || $i === 3 || $i === 6) {\n $phoneNumber .= $this->numbers1[rand(0, count($this->numbers1) - 1)];\n } else {\n $phoneNumber .= $this->numbers2[rand(0, count($this->numbers2) - 1)];\n // add spacer at the correct time\n if ($i === 2 || $i === 5) {\n $phoneNumber .= $spacer;\n }\n }\n }\n // return data\n return $phoneNumber; \n }",
"function formatPhoneNumber($phone) {\n if(!isset($phone)) { return ''; }\n \n // note: strip out everything but numbers \n $phone = preg_replace(\"/[^0-9]/\", \"\", $phone);\n $length = strlen($phone);\n \n switch($length) {\n case 7:\n return preg_replace(\"/([0-9]{3})([0-9]{4})/\", \"$1-$2\", $phone);\n break;\n \n case 10:\n return preg_replace(\"/([0-9]{3})([0-9]{3})([0-9]{4})/\", \"($1) $2-$3\", $phone);\n break;\n \n case 11:\n return preg_replace(\"/([0-9]{1})([0-9]{3})([0-9]{3})([0-9]{4})/\", \"$1($2) $3-$4\", $phone);\n break;\n \n default:\n return $phone;\n break;\n }\n}",
"public function displayContacts() { \n foreach ($this->contacts as $name=>$number) {\n echo $name . ' - ' . $number . '<br />'; \n }\n }",
"function format_phone_us($phone) {\n if(!isset($phone{3})) { return ''; }\n // note: strip out everything but numbers \n $phone = preg_replace(\"/[^0-9]/\", \"\", $phone);\n $length = strlen($phone);\n switch($length) {\n case 7:\n return preg_replace(\"/([0-9]{3})([0-9]{4})/\", \"$1-$2\", $phone);\n break;\n case 10:\n return preg_replace(\"/([0-9]{3})([0-9]{3})([0-9]{4})/\", \"($1) $2-$3\", $phone);\n break;\n case 11:\n return preg_replace(\"/([0-9]{1})([0-9]{3})([0-9]{3})([0-9]{4})/\", \"$1($2) $3-$4\", $phone);\n break;\n default:\n return $phone;\n break;\n }\n}",
"function formatPhone($number) {\n\t\t//Remove anything that is not a number\n\t $number = preg_replace('/[^\\d]/', '', $number); \n\t if(strlen($number) < 10) {\n\t return false;\n\t }\n\t return substr($number, 0, 3) . '-' . substr($number, 3, 3) . '-' . substr($number, 6);\n\t }",
"function format_phone($phone) {\n\t$phone = preg_replace('/[^0-9]/', '', $phone);\n\n\tif (strlen($phone) === 7) {\n\t\treturn preg_replace('/([0-9]{3})([0-9]{4})/', '$1-$2', $phone);\n\t}\n\telseif (strlen($phone) === 10) {\n\t\treturn preg_replace('/([0-9]{3})([0-9]{3})([0-9]{4})/',\n\t\t\t'($1) $2-$3', $phone);\n\t}\n\n\telse return $phone;\n}",
"public static function formatPhoneNumber($phoneNumber)\n {\n $numbers_only = preg_replace('/[^0-9]/', '', $phoneNumber);\n\n if (strlen($numbers_only) > 10) {\n $countryCode = substr($numbers_only, 0, strlen($numbers_only) - 10);\n $areaCode = substr($numbers_only, -10, 3);\n $nextThree = substr($numbers_only, -7, 3);\n $lastFour = substr($numbers_only, -4, 4);\n\n $numbers_only = '+'.$countryCode.' ('.$areaCode.') '.$nextThree.'-'.$lastFour;\n } elseif (strlen($numbers_only) == 10) {\n $areaCode = substr($numbers_only, 0, 3);\n $nextThree = substr($numbers_only, 3, 3);\n $lastFour = substr($numbers_only, 6, 4);\n\n $numbers_only = '('.$areaCode.') '.$nextThree.'-'.$lastFour;\n } elseif (strlen($numbers_only) == 7) {\n $nextThree = substr($numbers_only, 0, 3);\n $lastFour = substr($numbers_only, 3, 4);\n\n $numbers_only = $nextThree.'-'.$lastFour;\n }\n\n return $numbers_only;\n }",
"public static function phone_number (Environment $twig) : void\n {\n $twig->addFunction(new TwigFunction(\"phone_number\", function (string $phone) {\n $phone_number = str_replace(' ', '', $phone);\n $number = str_split($phone_number);\n\n unset($number[0]);\n\n $prefix = \"(+\" . str_replace(\"code-\", \"\", get_option(ClubSettings::REGIONAL_CODE)) . \")\";\n $part_one = implode('', array_slice($number, 0, 1));\n $part_two = implode('', array_slice($number, 1, 2));\n $part_three = implode('', array_slice($number, 3, 2));\n $part_four = implode('', array_slice($number, 5, 2));\n $part_five = implode('', array_slice($number, 7, 2));\n\n return \"$prefix $part_one $part_two $part_three $part_four $part_five\";\n }));\n }",
"protected function format_phone( $p_value ) {\n\t\t$value = '';\n\t\t$i_len = strlen($p_value);\n\t\tfor ( $i=0; $i < $i_len; $i++ ) {\n\t\t\tif ( is_numeric(substr($p_value,$i,1)) ) {\n\t\t\t\t$value .= substr($p_value,$i,1);\n\t\t\t}\n\t\t}\n\n\t\t// if there are not 10 numbers, return empty\n\t\tif ( strlen($value) != 10 ) {\n\t\t\treturn $this->return_handler->results(400,$this->database_name . \":\" . $this->table_name . \" Invalid phone '\" . $p_value . \"'\",null);\n\t\t}\n\n\t\treturn $this->return_handler->results(200,\"\",$value);\n\t}",
"function formatPhoneForDisplay($phoneString)\n{\n\tif (!$phoneString || strlen($phoneString) < 4)\n\t\treturn '';\n\n\tif (strlen($phoneString) == 11)\n\t{\n\t\t$phoneString = substr_replace($phoneString, '-', 1, 0);\n\t\t$phoneString = substr_replace($phoneString, '-', 5, 0);\n\t\treturn substr_replace($phoneString, '-', 9, 0);\n\t}\n\telse if (strlen($phoneString) <= 7)\n\t\treturn substr_replace($phoneString, '-', 3, 0);\n\telse\n\t{\n\t\t$phoneString = substr_replace($phoneString, '-', 3, 0);\n\t\treturn substr_replace($phoneString, '-', 7, 0);\n\t}\n}",
"function phoneNumber($phone) {\n $numbersOnly = preg_replace(\"/[^\\d]/\", \"\", $phone);\n return preg_replace(\"/^1?(\\d{1})(\\d{3})(\\d{3})(\\d{4})$/\", \"$1$2$3$4\", $numbersOnly);\n// Sources: http://stackoverflow.com/questions/5872096/function-to-add-dashes-to-us-phone-number-in-php\n }",
"public function getPhone();",
"function formatPhone($sPhone)\n{\n\t$sPhone = preg_replace(\"[^0-9]\",'',$sPhone);\n\tif(strlen($sPhone) != 10) return(False);\n\t$sArea = substr($sPhone,0,3);\n\t$sPrefix = substr($sPhone,3,3);\n\t$sNumber = substr($sPhone,6,4);\n\t$sPhone = \"(\".$sArea.\")\".$sPrefix.\"-\".$sNumber;\n\treturn($sPhone);\n}",
"function format_phone_en( $number )\n{\n\treturn format_telfax2 ( $number , $fax = FALSE ) ;\n}",
"function socialprofiledata_loginradius_phone_numbers() {\n return array(\n 'description' => 'Stores Compenies of user',\n 'fields' => array(\n 'user_id' => array(\n 'type' => 'int',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'description' => 'User ID of the user table.',\n ),\n 'number_type' => array(\n 'type' => 'varchar',\n 'length' => 20,\n 'not null' => FALSE,\n 'description' => 'number_type of user',\n ),\n 'phone_number' => array(\n 'type' => 'varchar',\n 'length' => 20,\n 'not null' => FALSE,\n 'description' => 'phone_number of user',\n ),\n ),\n );\n}"
] | [
"0.6985694",
"0.6702305",
"0.6676132",
"0.6609623",
"0.66095686",
"0.6604098",
"0.660242",
"0.6592058",
"0.6482686",
"0.6469648",
"0.6464671",
"0.636614",
"0.63037145",
"0.6288557",
"0.62780404",
"0.62462145",
"0.6243648",
"0.62342083",
"0.62258905",
"0.62080485",
"0.6143581",
"0.6128115",
"0.6082463",
"0.6075851",
"0.60728925",
"0.6056893",
"0.60366416",
"0.60335153",
"0.6009644",
"0.5987477"
] | 0.7171242 | 0 |
Display's a person's description/biography heading. | function get_person_desc_heading( $post ) {
if ( $post->post_type !== 'person' ) { return; }
$show_heading = get_field( 'person_display_desc_heading', $post->ID );
$heading_text = trim( get_field( 'person_desc_heading', $post->ID ) );
// Account for existing Person posts created before v1.0.2 field updates
if ( $show_heading === null ) {
$show_heading = true;
$heading_text = 'Biography';
}
ob_start();
if ( $show_heading && ! empty( $heading_text ) ):
?>
<h2 class="person-subheading"><?php echo wptexturize( $heading_text ); ?></h2>
<?php
endif;
return ob_get_clean();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBiography()\n {\n return 'Reyaan is a PHP Developer, currently working for Tencent Africa Services. Based in Cape Town. Has worked in PHP development for over 8 years.';\n }",
"function inkpro_author_info_blox() {\r\n\r\n\tif (\r\n\t\tis_single()\r\n\t\t&& get_the_author_meta( 'description' )\r\n\t\t&& ! wolf_get_theme_mod( 'blog_hide_author' )\r\n\t\t&& 'post' == get_post_type() || 'review' == get_post_type()\r\n\t)\r\n\t{\r\n\t\tget_template_part( 'partials/author-bio' );\r\n\t}\r\n}",
"public function biography()\n {\n $chapterManager = new ChapterManager;\n $chapters = $chapterManager->getList();\n\n require_once 'views/frontend/biography.php';\n }",
"public function describe()\n {\n return \"<p>This animal has {$this->getLegs()} legs and {$this->getWings()} wings and makes a {$this->sound()} sound</p>\";\n }",
"public function title_section_product_recommendations_ai() {\n\t\t\tprint 'Show Description Page';\n\t\t}",
"public function intro()\n {\n echo ($this->get_role() . \" \" . $this->get_name() . \" \" .\n $this->get_age());\n }",
"public function getNameAndTitle()\n {\n return $this->getTitle(). ' ' . $this->surname;\n }",
"public function getNameAndTitle()\n {\n return $this->getTitle() . ' ' . $this->surname;\n }",
"function authorDescription($page, $username) {\n \n $description = \"\";\n \n $authors = yaml($page->meta())['authors'];\n \n foreach ($authors as $author) {\n if ($author['username'] == $username) {\n $description = $author['description'];\n }\n }\n \n return $description;\n \n}",
"function e_MemberDescription($id_member) {\n\t\t\t\n\t\t\tif (!$this->is_select()) return;\n\t\t\t\n\t\t\t$data['view'] = $this->DBProc->O(array('extC' => true, 'extR' => true))->view($id_member);\n\t\t\t$data[\"id_person\"] = $id_member;\n\t\t\t$this->loadView('member_description',$data);\n\t\t}",
"public function displayTitle()\n {\n echo $this->title;\n }",
"public function description();",
"public function description();",
"public function description();",
"public function ogDescription();",
"public function displayAbout()\n {\n\n $this->connect();\n $sql = \"SELECT * FROM content WHERE section = 'about'\";\n $result = $this->select($sql);\n\n if ($result->num_rows > 0) {\n echo \"<h1>Biography</h1>\";\n while ($row = $result->fetch_assoc()) {\n\n echo \"<p>\" . $row['content'] . \"</p>\";\n }\n }\n echo '</div>';\n $sql = \"SELECT * FROM members\";\n $result = $this->select($sql);\n if ($result->num_rows > 0) {\n echo \"<div class=member-container><h1>Band Members</h1>\";\n while ($row = $result->fetch_assoc()) {\n echo \"<div class='member'>\";\n echo \"<img width= 300px src='uploads/\" . $row['imagename'] . \"'/><br>\";\n echo \"<h2>\" . $row[\"name\"] . \"</h2>\";\n\n echo \"<h3> \" . $row[\"position\"], \"</h3>\";\n echo \"</div>\";\n }\n echo '</div><br>';\n }\n\n $this->disconnect();\n }",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();",
"public function getDescription();"
] | [
"0.67865366",
"0.6573898",
"0.65344584",
"0.64766425",
"0.64495975",
"0.6448274",
"0.6393406",
"0.63611424",
"0.6315547",
"0.6300023",
"0.62710655",
"0.6245013",
"0.6245013",
"0.6245013",
"0.62438136",
"0.6240734",
"0.61956453",
"0.61956453",
"0.61956453",
"0.61956453",
"0.61956453",
"0.61956453",
"0.61956453",
"0.61956453",
"0.61956453",
"0.61956453",
"0.61956453",
"0.61956453",
"0.61956453",
"0.61956453"
] | 0.7339777 | 0 |
Returns research publications related to a person. | function get_person_publications( $post, $limit=4, $start=0 ) {
return get_posts( array(
'post_type' => 'post',
'posts_per_page' => $limit,
'offset' => $start,
'category_name' => 'publication',
'meta_query' => array(
array(
'key' => 'post_associated_people',
'value' => '"' . $post->ID . '"',
'compare' => 'LIKE'
)
)
) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function publicationsGuest(){\n $publications = $this->publicationsVigent();\n return $publications;\n }",
"public function publications()\n {\n return $this->hasMany(Publication::class);\n }",
"public function getPresentationPeople()\n {\n return $this->hasMany(PresentationPerson::className(), ['presentation_id' => 'id']);\n }",
"function loadPeopleFor($religion) {\n $rel = $this->getRelation('_people');\n return $rel->loadDest($religion); \n }",
"public function show(Person $person)\n {\n return $person->load(['moviesAsActorActress', 'moviesAsDirector', 'moviesAsProducer']);\n }",
"function getOfPeople($people) {\n $rel = $this->getRelation('_people');\n $res = $rel->getSrc($people); \n return $res;\n }",
"function getOfPeople($people) {\n $rel = $this->getRelation('_people');\n $res = $rel->getSrc($people); \n return $res;\n }",
"public function publications()\n {\n return $this->hasMany('App\\Models\\Applications\\Publication');\n }",
"public function persons()\n {\n return $this->morphedByMany(\\Illuminate\\Support\\Facades\\Config::get('sitec.core.models.person', \\Telefonica\\Models\\Actors\\Person::class), 'skillable');\n }",
"function getPublications() {\n\t\t$jAp=& JFactory::getApplication();\r\n\t\t$db =& JFactory::getDBO();\n\t\t\r\n\t\t$query = \"SELECT guid, autor_name autorName, autor_vorname autorVorname, titel, institut, nummer, year(jahr) jahr FROM #__ipub_publications;\";\r\n\t\t$db->setQuery($query);\r\n\t\n\t\t$result = $db->loadObjectList();\n\t\t\n\t\t//display and convert to HTML when SQL error\r\n\t\tif (is_null($result)) {\r\n\t\t\tthrow new Exception($db->getErrorMsg(),\"error\");\r\n\t\t}\n\t\t\t\r\n\t\treturn $result;\r\n\t}",
"public function getPeople(){\n \n $persons = person::all();\n\n return PersonResource::collection($persons);\n }",
"public function getPeople(){\n return $this->film['people'];\n }",
"public function get_publications_details($pubication_ids){\n\t\t\t$data[\"queryParams\"] = array(\"id\"=>$pubication_ids);\n\t\t\t$data[\"queryType\"] = \"ByID\";\n\t\t\t$result = $this->api_request(\"svc/Publications\",\"POST\",$data);\n\t\t\t$return_data = array();\n\t\t\tif($result->result==\"ok\" && !empty($result->results) && !empty($result->references)){\n\t\t\t\t$return_data[\"references\"] = $result->references;\n\t\t\t\t$return_data[\"ids\"] = $result->results;\n\t\t\t}\n\t\t\treturn $return_data;\n\t}",
"public function findAll()\n {\n $publications = DB::table('publications')\n ->join('blogueurs', function ($join) {\n $join->on('publications.blogueur_id', '=', 'blogueurs.id');\n })\n ->select('publications.id as pubid', 'blogueurs.id', 'publications.title', 'publications.image as pic', 'publications.latitude', 'publications.longitude', 'blogueurs.name', 'blogueurs.image')\n ->orderBy('publications.created_at', 'desc')\n ->get();\n return response()->json($publications);\n }",
"public function getPersons() {\n return $this->persons;\n }",
"public function show(Person $person)\n {\n\n $jobs = Job::with('people')->get();\n $address = Address::with('people')->get();\n $companies = Company::with('people')->get();\n $role = Role::with('people')->get();\n return view('people.show', compact('person', 'jobs', 'address', 'companies', 'role'));\n }",
"public function persons()\n {\n return $this->hasMany(Person::class);\n }",
"public static function getListOfPublicRepresentatives($search = null)\n {\n $client = new Client();\n $response = $client->get(self::getBaseUrl() . '/reps?json=true');\n $reps = collect(json_decode($response->getBody()->getContents(), true)['representatives'] ?? []);\n\n if (!$search) {\n return $reps;\n } else {\n return $reps->filter(function ($rep) use ($search) {\n return (\n stripos($rep['username'], $search) !== false\n || stripos($rep['rep_address'], $search) !== false\n || stripos($rep['website'], $search) !== false\n );\n });\n }\n }",
"public function getAllPersoner() {\n return $this->getAll();\n }",
"public function getPublication()\n {\n return $this->publication;\n }",
"function get_public_search_results($newSearch, $search_param) {\n $findview = \"peopleA_public\";\n $newSearch = trim($newSearch);\n\n @list($name_f, $name_l, $mi, $fourth) = explode(' ', $newSearch);\n\n if ($search_param == \"person\") {\n $_SESSION[\"query_type\"] = 'person';\n if (strlen($newSearch) == 1) {\n $query = \"SELECT * FROM all_tables_public WHERE SUBSTRING(person,1,1) = '$newSearch'\";\n } elseif ($newSearch == '') {\n $query = 'SELECT * FROM ' . $findview . ' ORDER BY person';\n } else {\n if (strpbrk($newSearch, ' ') == false || strstr($newSearch, ',')) {\n $query = \"SELECT * FROM all_tables_public WHERE person like '%$newSearch%' ORDER BY person\";\n } elseif ($fourth) {\n $fourth = $name_f . ' ' . $name_l . ' ' . $mi . ' ' . $fourth;\n $query = \"SELECT id, \" . parent::concat_fullname('none') . \" as Person, Email, Mailbox, Phone, Location, \" . parent::wrap() . \"Div/Dep/Program\" . parent::wrap() . \", Position, perm FROM all_tables_person_public WHERE \" . parent::get_concat_person() . \" like '%$fourth%'\";\n } elseif (!empty($mi)) {\n $query = \"SELECT id, \" . parent::concat_fullname('none') . \" as Person, Email, Mailbox, Phone, Location, \" . parent::wrap() . \"Div/Dep/Program\" . parent::wrap() . \", Position, perm FROM all_tables_person_public WHERE first_name like '%$name_l%' and last_name like '%$mi%' ORDER By last_name\";\n } else {\n if (empty($name_l)) {\n $query = \"SELECT id, \" . parent::concat_fullname('none') . \" as Person, Email, Mailbox, Phone, Location, \" . parent::wrap() . \"Div/Dep/Program\" . parent::wrap() . \", Position, perm FROM all_tables_person_public WHERE first_name like '%$name_f%' ORDER BY last_name\";\n } else {\n $query = \"SELECT id, \" . parent::concat_fullname('none') . \" as Person, Email, Mailbox, Phone, Location, \" . parent::wrap() . \"Div/Dep/Program\" . parent::wrap() . \", Position, perm FROM all_tables_person_public WHERE first_name like '%$name_f%' and last_name like '%$name_l%' ORDER By last_name\";\n }\n }\n }\n } elseif ($search_param == \"department\") {\n if (strlen($newSearch) == 1) {\n $query = \"SELECT * FROM all_tables_public WHERE substring(\" . parent::wrap() . \"Div/Dep/Program\" . parent::wrap() . \",(\" . parent::get_strindex() . \"('-',\" . parent::wrap() . \"Div/Dep/Program\" . parent::wrap() . \") +2), 1) = '$newSearch' ORDER BY person\";\n } elseif ($newSearch == '') {\n $query = 'SELECT * FROM ' . $findview . ' ORDER BY person';\n } else {\n $query = \"SELECT * FROM all_tables_public WHERE \" . parent::wrap() . \"Div/Dep/Program\" . parent::wrap() . \" like '%$newSearch%' ORDER BY person\";\n }\n } elseif ($search_param == \"location\") {\n if (strlen($newSearch) == 1) {\n $query = \"SELECT * FROM all_tables_public WHERE SUBSTRING(location,1,1) = '$newSearch' ORDER BY person\";\n } elseif ($newSearch == '') {\n $query = \"SELECT * FROM \" . $findview . \" ORDER BY person ORDER BY person\";\n } else {\n $query = \"SELECT * FROM all_tables_public WHERE location like '%$newSearch%' order by person\";\n }\n } elseif ($search_param == \"phone\") {\n if (strlen($newSearch) == 1) {\n $query = \"SELECT * FROM all_tables_public WHERE phone like '%$newSearch' ORDER BY person\";\n } elseif ($newSearch == '') {\n $query = 'SELECT * FROM ' . $findview . ' ORDER BY person';\n } else {\n $query = \"SELECT * FROM all_tables_public WHERE phone like '%$newSearch%' ORDER by person\";\n }\n } elseif ($search_param == \"email\") {\n if (strlen($newSearch) == 1) {\n $query = \"SELECT * FROM all_tables_public WHERE email like '%$newSearch' ORDER BY person\";\n } elseif ($newSearch == '') {\n $query = 'SELECT * FROM ' . $findview . ' ORDER BY person';\n } else {\n $query = \"SELECT * FROM all_tables_public WHERE email like '%$newSearch%' ORDER BY person\";\n }\n } else {\n if (strlen($newSearch) == 1) {\n $query = \"SELECT * FROM all_tables_public WHERE SUBSTRING(person,1,1) = '$newSearch' ORDER BY person\";\n } elseif ($newSearch == '') {\n $query = 'SELECT * FROM ' . $findview . ' ORDER BY person';\n } else {\n $query = \"SELECT * FROM all_tables_public WHERE person like '%$newSearch%' or \" . parent::wrap() . \"Div/Dep/Program\" . parent::wrap() . \" like '%$newSearch%' or location like '%$newSearch%' ORDER BY person\";\n }\n }\n return $query;\n }",
"function get( $person ) {\n\n\treturn utils\\get_node( $person, '\\wpmoly\\nodes\\posts\\Person' );\n}",
"public function people()\n {\n return $this->hasMany(Person::class);\n }",
"public function get_professions(object $organization = null)\n\t{\n\t\treturn crm_person_work_relation_obj::find_professions($this->ref(), $organization);\n\t}",
"function get_person_news_publications_markup( $post ) {\n\tif ( $post->post_type !== 'person' ) { return; }\n\n\t$news = get_person_news( $post );\n\t$pubs = get_person_publications( $post );\n\n\tob_start();\n\n\tif ( $news || $pubs ):\n?>\n\t<div class=\"row\">\n\t\t<?php if ( $news ): ?>\n\t\t<div class=\"col-lg\">\n\t\t\t<h2 class=\"person-subheading mt-5\">In The News</h2>\n\t\t\t<?php echo get_person_post_list_markup( $news ); ?>\n\t\t</div>\n\t\t<?php endif; ?>\n\n\t\t<?php if ( $pubs ): ?>\n\t\t<div class=\"col-lg\">\n\t\t\t<h2 class=\"person-subheading mt-5\">Research and Publications</h2>\n\t\t\t<?php echo get_person_post_list_markup( $pubs ); ?>\n\t\t</div>\n\t\t<?php endif; ?>\n\t</div>\n<?php\n\tendif;\n\treturn ob_get_clean();\n}",
"public function publicationsAction()\n {\n // action body\n \t$this->view->mypublications = Extended\\publication::getAllPublications( Auth_UserAdapter::getIdentity()->getId() );\n }",
"public function getMyPublicationAction()\n {\n \t$rowObj = Extended\\publication::getRowObject( $this->getRequest()->getParam(\"pub_id\") );\n \t$myExpsArray = array();\n \t$myExpsArray[\"id\"] = $rowObj->getId();\n \t$myExpsArray[\"title\"] = $rowObj->getTitle();\n \t$myExpsArray[\"publisher\"] = $rowObj->getPublisher();\n \t$myExpsArray[\"datee\"] = $rowObj->getPublish_date()->format('d-m-Y');\n \t$myExpsArray[\"url\"] = $rowObj->getUrl();\n \t$myExpsArray[\"author\"] = $rowObj->getAuthor();\n \t$myExpsArray[\"activities\"] = $rowObj->getActivites_and_socities();\n \techo Zend_Json::encode($myExpsArray);\n \tdie;\n }",
"static function GetByProblemAndAugmentLinkedPublications(&$Problem, $Publication)\n\t{\n\t\t// (do not perform a complete search on the graph: pick a direction and stick to it)\n\t\t// However, if Publication is a review, the search needs to start from the reviewed publication, else the right hand side of the graph is lost\n\t\t\n\t\t$SearchRootPublicationId = $Publication->Id;\n\t\tif ($Publication->IsReview)\n\t\t{\n\t\t\t$Query = pg_query_params(\n\t\t\t\t'SELECT publication_before FROM publication_links WHERE publication_after = $1',\n\t\t\t\tarray($Publication->Id)\n\t\t\t);\n\t\t\t\n\t\t\t// Assume that all reviews are linked to a publication in the DB\n\t\t\t$SearchRootPublicationId = pg_fetch_row($Query)[0];\n\t\t}\n\t\t\n\t\tPublications::GetByProblemAndAugmentWith(\n\t\t\t\t\t\t'WITH RECURSIVE publication_tree_after(id, stage, title, summary, created_at, review)\nAS (\nSELECT id, stage, title, summary, created_at, review\nFROM publications\nWHERE id = $1\nUNION\nSELECT publications.id, publications.stage, publications.title, publications.summary, publications.created_at, publications.review\nFROM publications, publication_links, publication_tree_after\nWHERE publications.id = publication_after AND publication_before = publication_tree_after.id\n),\n\npublication_tree_before(id, stage, title, summary, created_at, review) AS (\nSELECT id, stage, title, summary, created_at, review\nFROM publications\nWHERE id = $1\nUNION\nSELECT publications.id, publications.stage, publications.title, publications.summary, publications.created_at, publications.review\nFROM publications, publication_links, publication_tree_before\nWHERE publications.id = publication_before AND publication_after = publication_tree_before.id\n)\n\nSELECT *\nFROM (SELECT * FROM publication_tree_before UNION SELECT * FROM publication_tree_after) AS publication_tree',\n\t\t\tarray($SearchRootPublicationId),\n\t\t\t$Problem\n\t\t);\n\t}",
"function personInfo($person, $publishedNotices)\r\n {\r\n $view = $this->_view;\r\n $personModel = $this->_personModel;\r\n $personId = $person['id'];\r\n $firstNames = $person['firstNames'];\r\n $surname = strtoupper($person['surname']);\r\n $akaName = $personModel->showaka($person['alsoKnownAs']);\r\n $neeAndFormerName = $personModel->showneeandformer($person['neeName'], $person['formerName']);\r\n $formattedDate = $personModel->formatdatetime($person['deathDate']);\r\n $deathDate = $personModel->showdeathdate($formattedDate);\r\n $age = $personModel->showage($person['age'],$person['ageMeasure']);\r\n $country = $person['country'];\r\n $personInfo = array(\r\n 'header' => $view->personHeader($surname, $firstNames),\r\n 'details' => $view->personInfo($personId, $surname, $firstNames, $akaName, $neeAndFormerName, $deathDate, $age, $publishedNotices, $country)\r\n );\r\n return $personInfo;\r\n }",
"public function getPublications(): PersistentCollection\n {\n return $this->publications;\n }"
] | [
"0.5950177",
"0.59071094",
"0.58133256",
"0.580769",
"0.57892907",
"0.5705716",
"0.5705716",
"0.56529987",
"0.563869",
"0.5619416",
"0.5579513",
"0.5496075",
"0.5489102",
"0.54442495",
"0.5411183",
"0.5407963",
"0.53748745",
"0.53468734",
"0.53181016",
"0.53146124",
"0.5275405",
"0.5230481",
"0.5210472",
"0.5194353",
"0.5172231",
"0.5169311",
"0.51660866",
"0.5159067",
"0.5149839",
"0.5137155"
] | 0.6391788 | 0 |
Returns a styled unordered list of posts associated with a person. For use in singleperson.php | function get_person_post_list_markup( $posts ) {
ob_start();
if ( $posts ):
?>
<ul class="list-unstyled">
<?php foreach ( $posts as $post ): ?>
<li class="mb-md-4">
<h3 class="h5">
<?php if ( get_post_meta( $post->ID, '_links_to', true ) || $post->post_content ): ?>
<a href="<?php echo get_permalink( $post ); ?>">
<?php echo wptexturize( $post->post_title ); ?>
</a>
<?php else: ?>
<?php echo wptexturize( $post->post_title ); ?>
<?php endif; ?>
</h3>
<?php if ( has_excerpt( $post ) ): ?>
<div>
<?php echo apply_filters( 'the_content', get_the_excerpt( $post ) ); ?>
</div>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php
endif;
return ob_get_clean();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function colleges_post_list_display_people_before( $content, $items, $atts ) {\n\tob_start();\n?>\n<div class=\"ucf-post-list colleges-post-list-people\">\n<?php\n\treturn ob_get_clean();\n}",
"public static function display_post_listings(){\n\t\t\n\t\t$instance = self::getInstance();\n\t\t$html = '';\n\t\t\n\t\t$post_args = array(\n\t\t\t'post_type'\t\t=> 'post',\n\t\t\t'post_status'\t=> 'publish',\n\t\t\t'orderby'\t\t=> 'date',\n\t\t\t'order'\t\t\t=> 'DESC',\n\t\t\t'posts_per_page'=> 10\n\t\t);\n\t\t$posts = get_posts($post_args);\n\n\t\tif($posts){\n\t\t\t$html .= '<div class=\"el-row inner blog-listing small-margin-top-bottom-large\">';\n\n\t\t\t\t//blog listing\n\t\t\t\t$html .= '<div class=\"masonry-elements\">';\n\t\t\t\tforeach($posts as $post){\n\t\t\t\t\t$html .= $instance::get_post_card_html($post->ID, 'blog');\n\t\t\t\t}\n\t\t\t\t$html .= '</div>';\n\t\t\t$html .= '</div>';\n\t\t}\n\t\t\n\t\techo $html;\n\t}",
"function spartan_related_posts() {\n\techo '<ul id=\"spartan-related-posts\">';\n\tglobal $post;\n\t$tags = wp_get_post_tags($post->ID);\n\tif($tags) {\n\t\tforeach($tags as $tag) { $tag_arr .= $tag->slug . ','; }\n $args = array(\n \t'tag' => $tag_arr,\n \t'numberposts' => 5, /* you can change this to show more */\n \t'post__not_in' => array($post->ID)\n \t);\n $related_posts = get_posts($args);\n if($related_posts) {\n \tforeach ($related_posts as $post) : setup_postdata($post); ?>\n\t \t<li class=\"related_post\"><a class=\"entry-unrelated\" href=\"<?php the_permalink() ?>\" title=\"<?php the_title_attribute(); ?>\"><?php the_title(); ?></a></li>\n\t <?php endforeach; }\n\t else { ?>\n <?php echo '<li class=\"no_related_post\">' . __( 'No Related Posts Yet!', 'spartantheme' ) . '</li>'; ?>\n\t\t<?php }\n\t}\n\twp_reset_query();\n\techo '</ul>';\n}",
"public function getPosts(){\n $this->dbObject->query('SELECT id, title, content, date FROM posts ORDER BY id DESC');\n $rows = $this->dbObject->fetchAll();\n $posts = null;\n foreach($rows as $row){\n $posts .= '<div id=\"post\">';\n $posts .= '<h3>[' . $row['id'] . '] '. $row['title'] . '</h3>';\n $posts .= $row['content'];\n $posts .= '<div id=\"time\">Posted on: ' . $row['date'] . '</div>';\n $posts .= '<div id=\"divider\"/></div>';\n $posts .= '</div>';\n }\n return $posts;\n }",
"function bones_related_posts() {\n\techo '<ul id=\"bones-related-posts\">';\n\tglobal $post;\n\t$tags = wp_get_post_tags($post->ID);\n\tif($tags) {\n\t\tforeach($tags as $tag) { $tag_arr .= $tag->slug . ','; }\n\t\t$args = array(\n\t\t\t'tag' => $tag_arr,\n\t\t\t'numberposts' => 5, /* you can change this to show more */\n\t\t\t'post__not_in' => array($post->ID)\n\t\t);\n\t\t$related_posts = get_posts($args);\n\t\tif($related_posts) {\n\t\t\tforeach ($related_posts as $post) : setup_postdata($post); ?>\n\t\t\t\t<li class=\"related_post\"><a href=\"<?php the_permalink() ?>\" title=\"<?php the_title_attribute(); ?>\"><?php the_title(); ?></a></li>\n\t\t\t\t<?php endforeach; }\n\t\telse { ?>\n\t\t\t<li class=\"no_related_post\">No Related Posts Yet!</li>\n\t\t<?php }\n\t}\n\twp_reset_query();\n\techo '</ul>';\n}",
"private function getAllPosts(){\n $ret = \"\";\n //Loopar igenom $Posts och skapar HTML för varje post. \n foreach ($this -> Posts as $post){\n $ret .= \"<p><b>\" . strtoupper($post -> getTitle()) . \"</b><br/>Written by: \". $post -> getCreator(). \" At date: \" . $post -> getDateCreated() . \"<br/><b>Story:</b> \" . $post -> getStory() . \"<br/></p>\";\n }\n return $ret;\n }",
"function get_person_news_publications_markup( $post ) {\n\tif ( $post->post_type !== 'person' ) { return; }\n\n\t$news = get_person_news( $post );\n\t$pubs = get_person_publications( $post );\n\n\tob_start();\n\n\tif ( $news || $pubs ):\n?>\n\t<div class=\"row\">\n\t\t<?php if ( $news ): ?>\n\t\t<div class=\"col-lg\">\n\t\t\t<h2 class=\"person-subheading mt-5\">In The News</h2>\n\t\t\t<?php echo get_person_post_list_markup( $news ); ?>\n\t\t</div>\n\t\t<?php endif; ?>\n\n\t\t<?php if ( $pubs ): ?>\n\t\t<div class=\"col-lg\">\n\t\t\t<h2 class=\"person-subheading mt-5\">Research and Publications</h2>\n\t\t\t<?php echo get_person_post_list_markup( $pubs ); ?>\n\t\t</div>\n\t\t<?php endif; ?>\n\t</div>\n<?php\n\tendif;\n\treturn ob_get_clean();\n}",
"private function construct_posts() {\n $html = \"\\n<h3>Seznam příspěvků</h3><br>\\n\";\n $posts = $this->model->get_all_published_posts();\n\n if (empty($posts)) {\n $html = \"Vypadá to, že zatím nebyly zveřejněny žádné příspěvky.\";\n }\n\n $html .= \"\\n<table class='table table-striped'>\\n<tbody>\\n\";\n foreach ($posts as $item){\n $html .= \"<tr>\n <td scope='row'><a href='read_post/\".$item['title'].\"'>\".$item['title'].\"</a></td>\n <td scope='row'>by: \".$item['username'].\"</td>\n </tr>\\n\";\n }\n $html .= \"</tbody>\\n</table>\\n\";\n\n return $html;\n }",
"function get_person_news( $post, $limit=4, $start=0 ) {\n\treturn get_posts( array(\n\t\t'post_type' => 'post',\n\t\t'posts_per_page' => $limit,\n\t\t'offset' => $start,\n\t\t'category_name' => 'faculty-news',\n\t\t'meta_query' => array(\n\t\t\tarray(\n\t\t\t\t'key' => 'post_associated_people',\n\t\t\t\t'value' => '\"' . $post->ID . '\"',\n\t\t\t\t'compare' => 'LIKE'\n\t\t\t)\n\t\t)\n\t) );\n}",
"function make_one_article_list($my_articlelist) {\n echo \"<ul>\";\n echo \"<li><a href='\" . $my_articlelist[linkTo] . \"'> <h2>$my_articlelist[title]</h2> </a></li>\";\n echo \"<li><img src='\" . $my_articlelist[img] . \"' alt='\" . $my_articlelist[title] . \" Poster'></li>\";\n echo \"<li>$my_articlelist[previewText]</li>\"; \n echo \"</ul\";\n }",
"function return_posts($user_name)\n\t{\n\t\t$user_id = get_user_info($user_name, 2);\n\t\t$user_id = $user_id['user_id'];\n\t\t\n\t\t\n\t\tglobal $connection;\n\t\t//Fetch all posts that are published (1) from the database\n\t\t$query = \"SELECT * FROM posts \";\n\t\t\t$query .= \"WHERE blog_id = (\";\n\t\t\t$query .= \"SELECT blog_id FROM blog WHERE user_id = {$user_id}) AND published=1\";\n\t\t\n\t\t$result = mysql_query($query, $connection);\n\t\tconfirm_query($result);\n\t\t\t\n\t\tif(mysql_num_rows($result) == 0){\n\t\t\tif(get_blog_info($user_id,1)){\n\t\t\t\techo \"<h3> The blog is here, but empty :( </h3>\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t/// !!! Need to implement 404\n\t\t\t\techo \"<h3> Sorry, this blog does not exists :( </h3>\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Print all posts in a list\n\t\techo \"<div id=\\\"post_list\\\">\";\n\t\twhile ($post = mysql_fetch_assoc($result)) {\n\t\t\techo \"<span class=\\\"single_post\\\"><h3> <a href=\\\"blog.php?user={$user_name}&post={$post['post_id']}\\\"> {$post['title']} </a> </h3>\";\n\t\t\techo $post['date_created'] . \"<BR>\";\n\t\t\techo \"<p class=\\\"post_content\\\">\" . $post['content'] . \"</p>\";\n\t\t\techo \"</span>\";\n\t\t}\n\t\techo \"</div>\";\n\t}",
"function getPeoplestories()\n\t\t\t{\n\t\t\t\t$sql = 'SELECT p.article_text,p.created_on,CONCAT(u.first_name, \" \", u.last_name) AS \"user_name\" ,u.profile_pic \n\t\t\t\t\t\t\t\tFROM '.USER.' as u ,'.PEOPLE_STORIES.' p \n\t\t\t\t\t\t\t\tWHERE u.user_id = p.user_id \n\t\t\t\t\t\t\t\torder by RAND() \n\t\t\t\t\t\t\t\tLIMIT 3';\n\t\t\t\t$query = $this->db->query($sql);\n\t\t\t\treturn $query->result();\n\t\t\t}",
"public function get_list_user(){\n $this->set_list(true);\n $initialfetch = (($this->page - 1) * $this->itemsforpage);\n $posts = $this->fetch(\"SELECT id, title, picture, category,url, meta date FROM posts WHERE user = $this->user ORDER BY id DESC LIMIT $initialfetch, $this->itemsforpage \");\n return $posts;\n }",
"function get_person_dept_markup( $post ) {\n\tif ( $post->post_type !== 'person' ) { return; }\n\n\t$depts = wp_get_post_terms( $post->ID, 'departments' );\n\t$depts = !is_wp_error( $depts ) && !empty( $depts ) && class_exists( 'UCF_Departments_Common' ) ? $depts : false;\n\n\tob_start();\n\tif ( $depts ) :\n?>\n\t<div class=\"row\">\n\t\t<div class=\"col-xl-4 col-md-12 col-sm-4 person-label\">\n\t\t\tDepartment<?php if ( count( $depts ) > 1 ) { echo 's'; } ?>\n\t\t</div>\n\t\t<div class=\"col-xl-8 col-md-12 col-sm-8 person-attr\">\n\t\t\t<ul class=\"list-unstyled mb-0\">\n\t\t\t\t<?php foreach ( $depts as $dept ): ?>\n\t\t\t\t<li><?php echo UCF_Departments_Common::get_website_link( $dept ); ?></li>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</ul>\n\t\t</div>\n\t</div>\n\t<hr class=\"my-2\">\n<?php\n\tendif;\n\treturn ob_get_clean();\n}",
"function makeResponsibleList() {\n\t\n\t\t$res = $this->query(\"SELECT id,caption FROM $this->table_responsible WHERE page=\".$this->page_id);\n\t\t\n\t\t$r = \"<ul id='responsible_list_ul'>\\n\";\n\t\twhile ($row = $res->fetch_assoc()) {\n\t\t\t$id = $row['id'];\t\t\t\n\t\t\t$r .= \"\n\t\t\t<li>\n\t\t\t\t<div id='responsible_$id'>\n\t\t\t\t\t\".$this->makeResponsible($row).\"\n\t\t\t\t</div>\n\t\t\t</li>\\n\";\n\t\t\t\n\t\t}\n\t\t$r .= \"</ul>\\n\";\n\t\treturn $r;\n\t}",
"function listPosts(PostManager $postManager) \n{\n PostsListView::render($postManager);\n}",
"public function get_list_tag(){\n $this->set_list(true);\n $initialfetch = (($this->page - 1) * $this->itemsforpage);\n $posts = $this->fetch(\"SELECT posts.id, posts.title, posts.picture, posts.category, posts.url, posts.meta FROM relation_tag INNER JOIN posts ON relation_tag.post = posts.id WHERE relation_tag.tag = $this->tag ORDER BY posts.id DESC LIMIT $initialfetch, $this->itemsforpage \");\n return $posts;\n }",
"function display_posts_nav( $paged_posts ) {\n $output = '';\n \n if ( is_array( $paged_posts ) ) {\n $output = '<ul class=\"posts-list\">';\n $delete_bt = 'trash';\n $action_bt = 'edit';\n if ( isset( $_GET['action'] ) ) {\n if ( $_GET['action'] === 'trashedposts' || $_GET['action'] === 'deletefromlist' ) {\n $delete_bt = 'delete';\n $action_bt = 'activate';\n }\n }\n\n\t $list_header = '<li class=\"list-header\"><div class=\"column-1\">Select</div><div class=\"column-2\">ID</div><div class=\"column-3\">Title</div><div class=\"column-4\">Created</div><div class=\"column-5\">Status</div><div class=\"column-6\">Actions</div></li>';\n\n\t $markup = '<li class=\"posts-list-row\">';\n $markup .= '<div class=\"column-1\">';\n $markup .= '<input class=\"ugly-checkbox to-select\" id=\"%9$s\" value=\"%1$s\" name=\"selected-post[]\" type=\"checkbox\">';\n $markup .= '<label for=\"%9$s\">';\n $markup .= '<div class=\"pretty-radio\"></div>';\n $markup .= '</label>';\n $markup .= '</div>';\n $markup .= '<div class=\"column-2\">%1$s</div>';\n $markup .= '<div class=\"column-3\">';\n $markup .= '<a id=\"post-link-%1$s\" href=\"%10$s\" target=\"_blank\">%3$s</a>';\n $markup .= '</div>';\n $markup .= '<div class=\"column-4\">%5$s</div>';\n $markup .= '<div class=\"column-5\">%6$s</div>';\n $markup .= '<div class=\"column-6\">';\n $markup .= '<a href=\"%2$s\" class=\"button mat-button\">%8$s</a>';\n $markup .= '<a href=\"%4$s\" class=\"button red-button mat-button\">%7$s</a>';\n $markup .= '</div>';\n\t $markup .= '</li>';\n $output .= $list_header;\n\t foreach ( $paged_posts as $post ) {\n\t\t $output .= sprintf( \n $markup, \n $post['id'], //1\n ADMINURL . '?action=' . $action_bt . 'post&postid=' . $post['id'], //2\n $post['title'], //3\n ADMINURL . '?action=' . $delete_bt . 'fromlist&postid=' . $post['id'], //4\n $post['date'], //5\n $post['status'], //6\n ucfirst( $delete_bt ), //7\n ucfirst( $action_bt ), //8\n 'post-' . $post['id'], //9\n get_site_url() . '/blog/' . $post['url'] //10\n );\n\t }\n\n $output .= $list_header;\n }\n\n\techo $output;\n}",
"function get_person_publications( $post, $limit=4, $start=0 ) {\n\treturn get_posts( array(\n\t\t'post_type' => 'post',\n\t\t'posts_per_page' => $limit,\n\t\t'offset' => $start,\n\t\t'category_name' => 'publication',\n\t\t'meta_query' => array(\n\t\t\tarray(\n\t\t\t\t'key' => 'post_associated_people',\n\t\t\t\t'value' => '\"' . $post->ID . '\"',\n\t\t\t\t'compare' => 'LIKE'\n\t\t\t)\n\t\t)\n\t) );\n}",
"function drawArticleList($blog);",
"function get_some_post_titles() {\n\t$args = array(\n\t\t'posts_per_page' => 3,\n\t);\n\n\t// Let other people modify the arguments.\n\t$posts = get_posts( apply_filters( 'myplugin_get_posts_args', $args ) );\n\n\t// Let other people modify the post array which will be used for display.\n\t$posts = apply_filters( 'myplugin_get_posts', $posts, $args );\n\n\t$output = '<ul>';\n\tforeach ( $posts as $post ) {\n\n\t\t// Let other people modify the list entry.\n\t\t$output .= '<li>' . apply_filters( 'myplugin_list_item', $post->post_title, $post ) . '</li>';\n\t}\n\t$output .= '</ul>';\n\n\t// Let other people modify our output list.\n\treturn apply_filters( 'myplugin_get_some_post_titles', $output, $args );\n}",
"function my_the_content_filter($content) {\n \n //Get from post_meta table\n $meta = get_post_meta( get_the_ID() );\n if(!empty($meta['contributer'][0])){\n $uid=explode(\",\",$meta['contributer'][0]);\n \n $content.='<div><h3>Contributers</h3></div>';\n $content.='<ul style=\"list-style:none;\">';\n \n foreach($uid as $auth){\n\t $user_data=get_userdata( $auth );\n\t//get_avatar use for get user image from gravatar\n $getu=get_the_author_meta( $user_data->ID );\n $content.='<li><a href=\"'.get_author_posts_url( $user_data->ID ).'\"><span>'.get_avatar($user_data->ID).\"</span><p>\".$user_data->user_nicename.'</p></a></li>';\n }\n $content.='</ul>';\n }\n return $content;\n}",
"public function posts()\n {\n $posts = get_posts([\n 'post_type' => 'Post',\n 'posts_per_page'=> get_option( 'posts_per_page' )\n ]);\n\n return array_map(function ($post) {\n $post->excerpt = get_the_excerpt($post->ID);\n $post->thumbnail = get_the_post_thumbnail($post->ID, 'wide_s');\n $post->link = get_the_permalink($post->ID);\n $post->category = get_the_terms($post->ID, 'category')[0];\n $post->date = get_the_date(null, $post->ID);\n\n $post->author = get_userdata($post->post_author);\n $post->author_image = wp_get_attachment_image( get_field('image', 'user_' . $post->post_author), 'thumbnail');\n\n return $post;\n }, $posts);\n\n }",
"public function displayPosts()\n {\n if (!empty($this->getPosts())) // if there is any data\n {\n foreach ($this->getPosts() as $post)\n {\n // Format the date from SQL table so that it can look like 26/12/2020 08:40 PM\n $date = new DateTime($post[\"Post_Date\"]);\n\n\n echo \"<div class='col-lg-4'>\"\n .\"<div class='card mb-3'>\\n\"\n .\"<img class='card-img-top' src='img/poggy.jfif' alt='Card image cap'>\\n\"\n .\"<div class='card-body'>\\n\"\n .\"<a href='post.php?post_id=\" . $post[\"ID\"]. \"'>\\n\"\n .\"<h2 class='post-title'>\". $post['Post_Title'].\"</h2></a>\\n\"\n .\"<p class='post-subtitle'>\".$post[\"Post_Subtitle\"] . \"</p>\\n\"\n .\"<p class='card-text'><small class='text-muted'>Posted by \" . $post[\"Post_Author\"] .\" on \" . $date->format('d/m/Y h:i A') .\" AEST</small></p>\\n\"\n .\"</div>\\n\"\n .\"</div>\\n\"\n .\"</div>\\n\"\n .\"<hr>\";\n \n }\n\n }\n\n else\n {\n echo \"No new Posts\";\n }\n\n }",
"function my_custom_popular_posts_html_list( $mostpopular, $instance ){\n $output = '<ul class=\"wpp-list\">';\n\n // loop the array of popular posts objects\n foreach( $mostpopular as $popular ) {\n\n $stats = array(); // placeholder for the stats tag\n\n // Comment count option active, display comments\n if ( $instance['stats_tag']['comment_count'] ) {\n // display text in singular or plural, according to comments count\n $stats[] = '<span class=\"wpp-comments\">' . sprintf(\n _n('1 comment', '%s comments', $popular->comment_count, 'wordpress-popular-posts'),\n number_format_i18n($popular->comment_count)\n ) . '</span>';\n }\n\n // Pageviews option checked, display views\n if ( $instance['stats_tag']['views'] ) {\n\n // If sorting posts by average views\n if ($instance['order_by'] == 'avg') {\n // display text in singular or plural, according to views count\n $stats[] = '<span class=\"wpp-views num\">' . sprintf(\n _n('1 view per day', '%s views per day', intval($popular->pageviews), 'wordpress-popular-posts'),\n number_format_i18n($popular->pageviews, 2)\n ) . '</span>';\n } else { // Sorting posts by views\n // display text in singular or plural, according to views count\n $stats[] = '<span class=\"wpp-views num\">' . sprintf(\n _n('1', '%s', intval($popular->pageviews), 'wordpress-popular-posts'),\n number_format_i18n($popular->pageviews)\n ) . '</span>';\n }\n }\n\n // Author option checked\n if ($instance['stats_tag']['author']) {\n $author = get_the_author_meta('display_name', $popular->uid);\n $display_name = '<a href=\"' . get_author_posts_url($popular->uid) . '\">' . $author . '</a>';\n $stats[] = '<span class=\"wpp-author\">' . sprintf(__('by %s', 'wordpress-popular-posts'), $display_name). '</span>';\n }\n\n // Date option checked\n if ($instance['stats_tag']['date']['active']) {\n $date = date_i18n($instance['stats_tag']['date']['format'], strtotime($popular->date));\n $stats[] = '<span class=\"wpp-date\">' . sprintf(__('posted on %s', 'wordpress-popular-posts'), $date) . '</span>';\n }\n\n // Category option checked\n if ($instance['stats_tag']['category']) {\n $post_cat = get_the_category($popular->id);\n $post_cat = (isset($post_cat[0]))\n ? '<a href=\"' . get_category_link($post_cat[0]->term_id) . '\">' . $post_cat[0]->cat_name . '</a>'\n : '';\n\n if ($post_cat != '') {\n $stats[] = '<span class=\"wpp-category\">' . sprintf(__('under %s', 'wordpress-popular-posts'), $post_cat) . '</span>';\n }\n }\n\n // Build stats tag\n if ( !empty($stats) ) {\n //$stats = '<div class=\"wpp-stats\">' . join( ' | ', $stats ) . '</div>';\n $stats = join( ' | ', $stats );\n }\n\n $excerpt = ''; // Excerpt placeholder\n\n // Excerpt option checked, build excerpt tag\n if ($instance['post-excerpt']['active']) {\n\n $excerpt = get_excerpt_by_id( $popular->id );\n if ( !empty($excerpt) ) {\n $excerpt = '<div class=\"wpp-excerpt\">' . $excerpt . '</div>';\n }\n\n }\n\n // Excerpt option checked, build excerpt tag\n if ($instance['thumbnail']['active']) {\n\n $thumb = get_the_post_thumbnail($popular->id, ['36','36']);\n if ( !empty($thumb) ) {\n $thumb = $thumb;\n }\n\n }\n\n\n $output .= \"<li>\";\n $output .= \"<a href=\\\"\" . get_the_permalink( $popular->id ) . \"\\\" title=\\\"\" . esc_attr( $popular->title ) . \"\\\">\" . $stats . $thumb . \"<span class=\\\"post-title\\\">\" . $popular->title . \"</span></a>\";\n //$output .= $stats;\n //$output .= $excerpt;\n $output .= \"</li>\" . \"\\n\";\n\n }\n\n $output .= '</ul>';\n\n return $output;\n}",
"public function postList(){\n $post = $this->adminInterface->getTotalPost();\n return view('admin.postlist', ['posts'=> $post]);\n }",
"public static function make_list_container( ) {\n global $post;\n\n if ( isset( $post ) ) {\n $html = \"<div id='gallery-{$post->post_name}' class='gallery-list'>\";\n }\n\n return $html;\n }",
"function get_related_posts($postdata='',$number='5',$title)\n{\n\t\tglobal $wpdb;\n\t\t$postCatArr = wp_get_post_categories($postdata->ID);\n\t\t$postCatArr_ = implode(',',$postCatArr);\n\t\t$number = $number;\n\t\t$category_posts = get_posts(array('category'=>$postCatArr_,'numberposts'=>$number+1));\n\t\tif($title && $category_posts){ ?><h3><?php echo sprintf(__('%s','templatic'), $title); ?></h3><?php }\n\n\t\techo \"<ul>\";\n\t\t\tforeach($category_posts as $post) \n\t\t\t{\n\t\t\t\tif($post->ID != $postdata->ID)\n\t\t\t\t{\n\t\t\t\t\t$posthtml .= '<td align=\"left\" style=\"vertical-align: top;\">';\n\t\t\t\t\t$d = 'comment' == $type ? 'get_comment_time' : 'get_post_time';\n\n\t\t\t\t\t$du = strtotime($post->post_date);\n\n\t\t\t\t\t$fv = human_time_diff($du, current_time('timestamp')) . \" \" . __('ago','templatic');\n\t\t\t\t\techo \"<li>\";\n\t\t\t\t\techo \"<span class='date'><i class='fa fa-clock-o'></i>\".$fv.\"</span>\";\n\t\t\t\t\techo \"<a href='\".get_permalink($post->ID).\"'>\".$post->post_title.\"</a>\";\n\t\t\t\t\techo \"</li>\";\n\t\t\t\t}\n\t\t\t}\n\t\techo \"</ul>\";\n}",
"function twentyfourteen_list_authors() {\n\t$contributor_ids = get_users( array(\n\t\t'fields' => 'ID',\n\t\t'orderby' => 'post_count',\n\t\t'order' => 'DESC',\n\t\t'who' => 'authors',\n\t) );\n\n\tforeach ( $contributor_ids as $contributor_id ) :\n\t\t$post_count = count_user_posts( $contributor_id );\n\n\t\t// Move on if user has not published a post (yet).\n\t\tif ( ! $post_count ) {\n\t\t\tcontinue;\n\t\t}\n\t?>\n\n\t<div class=\"contributor\">\n\t\t<div class=\"contributor-info\">\n\t\t\t<div class=\"contributor-avatar\"><?php echo get_avatar( $contributor_id, 132 ); ?></div>\n\t\t\t<div class=\"contributor-summary\">\n\t\t\t\t<h2 class=\"contributor-name\"><?php echo get_the_author_meta( 'display_name', $contributor_id ); ?></h2>\n\t\t\t\t<p class=\"contributor-bio\">\n\t\t\t\t\t<?php echo get_the_author_meta( 'description', $contributor_id ); ?>\n\t\t\t\t</p>\n\t\t\t\t<a class=\"contributor-posts-link\" href=\"<?php echo esc_url( get_author_posts_url( $contributor_id ) ); ?>\">\n\t\t\t\t\t<?php printf( _n( '%d Article', '%d Articles', $post_count, 'twentyfourteen' ), $post_count ); ?>\n\t\t\t\t</a>\n\t\t\t</div><!-- .contributor-summary -->\n\t\t</div><!-- .contributor-info -->\n\t</div><!-- .contributor -->\n\n\t<?php\n\tendforeach;\n}",
"function twentyfourteen_list_authors() {\n\t$contributor_ids = get_users( array(\n\t\t'fields' => 'ID',\n\t\t'orderby' => 'post_count',\n\t\t'order' => 'DESC',\n\t\t'who' => 'authors',\n\t) );\n\n\tforeach ( $contributor_ids as $contributor_id ) :\n\t\t$post_count = count_user_posts( $contributor_id );\n\n\t\t// Move on if user has not published a post (yet).\n\t\tif ( ! $post_count ) {\n\t\t\tcontinue;\n\t\t}\n\t?>\n\n\t<div class=\"contributor\">\n\t\t<div class=\"contributor-info\">\n\t\t\t<div class=\"contributor-avatar\"><?php echo get_avatar( $contributor_id, 132 ); ?></div>\n\t\t\t<div class=\"contributor-summary\">\n\t\t\t\t<h2 class=\"contributor-name\"><?php echo get_the_author_meta( 'display_name', $contributor_id ); ?></h2>\n\t\t\t\t<p class=\"contributor-bio\">\n\t\t\t\t\t<?php echo get_the_author_meta( 'description', $contributor_id ); ?>\n\t\t\t\t</p>\n\t\t\t\t<a class=\"contributor-posts-link\" href=\"<?php echo esc_url( get_author_posts_url( $contributor_id ) ); ?>\">\n\t\t\t\t\t<?php printf( _n( '%d Article', '%d Articles', $post_count, 'twentyfourteen' ), $post_count ); ?>\n\t\t\t\t</a>\n\t\t\t</div><!-- .contributor-summary -->\n\t\t</div><!-- .contributor-info -->\n\t</div><!-- .contributor -->\n\n\t<?php\n\tendforeach;\n}"
] | [
"0.6901885",
"0.63079065",
"0.62964755",
"0.6251454",
"0.62246764",
"0.61855125",
"0.6168651",
"0.60833585",
"0.6070849",
"0.59983206",
"0.59628576",
"0.5951466",
"0.5927494",
"0.5897258",
"0.5896114",
"0.58926594",
"0.58897126",
"0.5871412",
"0.58609885",
"0.5860243",
"0.58531046",
"0.58328134",
"0.5823881",
"0.5816872",
"0.5812555",
"0.57568324",
"0.57567805",
"0.575284",
"0.57525057",
"0.57525057"
] | 0.8045899 | 0 |
Displays News and Research/Publications for a person. For use in singleperson.php | function get_person_news_publications_markup( $post ) {
if ( $post->post_type !== 'person' ) { return; }
$news = get_person_news( $post );
$pubs = get_person_publications( $post );
ob_start();
if ( $news || $pubs ):
?>
<div class="row">
<?php if ( $news ): ?>
<div class="col-lg">
<h2 class="person-subheading mt-5">In The News</h2>
<?php echo get_person_post_list_markup( $news ); ?>
</div>
<?php endif; ?>
<?php if ( $pubs ): ?>
<div class="col-lg">
<h2 class="person-subheading mt-5">Research and Publications</h2>
<?php echo get_person_post_list_markup( $pubs ); ?>
</div>
<?php endif; ?>
</div>
<?php
endif;
return ob_get_clean();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function view() {\r\n\r\n // Prepare the data for the page\r\n $this->data['title'] = 'view a Personal Profile';\r\n $this->data['view'] = 'persons/view';\r\n\r\n $this->data['result'] = $this->persons_model->get('id = ' . $this->uri->segment(3), 1);\r\n // Load the view\r\n $this->load->view('main_template', $this->data);\r\n }",
"public function publicationsAction()\n {\n // action body\n \t$this->view->mypublications = Extended\\publication::getAllPublications( Auth_UserAdapter::getIdentity()->getId() );\n }",
"function display()\n {\n $plargs = array(\n 'tid' => $this->tid,\n 'noOfItems' => $this->numpubs,\n 'offsetItems' => $this->offset,\n 'language' => ZLanguage::getLanguageCode(),\n 'orderByStr' => $this->order);\n\n $filters = preg_split(\"/\\s*&\\s*/\", $this->filter);\n if (is_array($filters) && strlen(trim($filters[0]))) {\n $plargs['filterSet'] = $filters;\n }\n\n $publist = ModUtil::apiFunc('pagesetter', 'user', 'getPubList', $plargs);\n\n // retrieve formatted publications\n $publications = array();\n if ($publist !== false) {\n foreach ($publist['publications'] as $pub) {\n $pub = ModUtil::apiFunc('pagesetter', 'user', 'getPubFormatted', array(\n 'tid' => $this->tid,\n 'pid' => $pub['pid'],\n 'format' => $this->tpl,\n 'updateHitCount' => false));\n if ($pub !== false)\n $publications[] = $pub;\n }\n }\n\n $this->view->assign('publications', $publications);\n\n return $this->view->fetch($this->getTemplate());\n }",
"public function show(Person $person)\n {\n //\n }",
"public function show(Person $person)\n {\n //\n }",
"public function show(Person $person)\n {\n //\n }",
"public function show(Person $person)\n {\n //\n }",
"public function displayAbout()\n {\n\n $this->connect();\n $sql = \"SELECT * FROM content WHERE section = 'about'\";\n $result = $this->select($sql);\n\n if ($result->num_rows > 0) {\n echo \"<h1>Biography</h1>\";\n while ($row = $result->fetch_assoc()) {\n\n echo \"<p>\" . $row['content'] . \"</p>\";\n }\n }\n echo '</div>';\n $sql = \"SELECT * FROM members\";\n $result = $this->select($sql);\n if ($result->num_rows > 0) {\n echo \"<div class=member-container><h1>Band Members</h1>\";\n while ($row = $result->fetch_assoc()) {\n echo \"<div class='member'>\";\n echo \"<img width= 300px src='uploads/\" . $row['imagename'] . \"'/><br>\";\n echo \"<h2>\" . $row[\"name\"] . \"</h2>\";\n\n echo \"<h3> \" . $row[\"position\"], \"</h3>\";\n echo \"</div>\";\n }\n echo '</div><br>';\n }\n\n $this->disconnect();\n }",
"function index()\n {\n $data['people'] = $this->Person_model->get_all_people();\n \n $data['_view'] = 'person/index';\n $this->load->view('layouts/main',$data);\n }",
"public function pers_list()\n {\n $this->templates->display('pers_list');\n }",
"function ShowArticlesByPages()\n {\n $this->PageUser->h1 = $this->multi['TXT_ARTICLE_TITLE'];\n $this->PageUser->breadcrumb = '';\n\n $articles = $this->GetArticlesRows('limit');\n\n $pages = '';\n if (count($articles) > 0) {\n $n_rows = $this->GetArticlesRows('nolimit');\n $link = $this->Link($this->category, NULL);\n $pages = $this->Form->WriteLinkPagesStatic($link, $n_rows, $this->display, $this->start, $this->sort, $this->page);\n }\n\n echo View::factory('/modules/mod_article/templates/tpl_article_by_pages.php')\n ->bind('articles', $articles)\n ->bind('multi', $this->multi)\n ->bind('pages', $pages);\n }",
"function show_authors()\r\n{\r\n\t$tpl =& get_tpl();\r\n\t$db = get_db();\r\n\t$user = $db->query(\r\n\t'SELECT user_id AS id, user_name AS name, user_email AS email, user_website AS website, '\r\n\t\t.'author_name AS author, author_id AS authorid '\r\n\t\t.'FROM user LEFT JOIN author ON user_id=user_id_fk WHERE user_id='.$_GET['id'].' AND user_valid=1 LIMIT 1');\r\n\tif(!$user)\r\n\t{\r\n\t\tprintf('Errormessage: %s', $db->error);\r\n\t}\r\n\tif($user->num_rows < 1)\r\n\t{\r\n\t\theader('Location: index.php');\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$tpl['userinfo'] = $user->fetch_assoc();\r\n\t}\r\n\t$user->close();\r\n\t//now we grab authorage\r\n\t$authors = $db->query('SELECT usertoauthor_comment AS comment, author_id AS id, author_name AS name, author_count AS books, author_date AS date '\r\n\t\t.'FROM author LEFT JOIN usertoauthor ON author_id_fk=author_id WHERE usertoauthor.user_id_fk='.$_GET['id'].' and author_valid=1 ORDER BY author_name ASC');\r\n\tif(!$authors )\r\n\t{\r\n\t\tprintf('Errormessage: %s', $db->error);\r\n\t}\r\n\t$tpl['authors'] =& $authors;\r\n\t//page assignments\r\n\t$tpl['title'] = $tpl['userinfo']['name'].'\\'s Profile';\r\n\t$tpl['nest'] = '';\r\n\t$tpl['keywords'] = 'user profile information contact links book favorites';\r\n\t$tpl['description'] = 'Profile information for a user, show user favorite authors';\r\n\t//assign sub \"template\"\r\n\t$files['page'] = 'userauthor.html';\r\n\t//create sidebar\r\n\tinclude('../lib/sidebar.php');\r\n\t//show the \"template\"\r\n\tshow_tpl($tpl, $files);\r\n\treturn;\r\n}",
"function show_profile()\r\n{\r\n\t$tpl =& get_tpl();\r\n\t$db = get_db();\r\n\t$profile = $db->query(\r\n\t'SELECT author_id AS id, author_name AS name, author_contact AS email, author_date AS date, '\r\n\t\t.'author_text AS text, user_name AS user, user_id AS userid '\r\n\t\t.'FROM author LEFT JOIN user ON user_id=user_id_fk WHERE author_id='.$_GET['id'].' AND author_valid=1 LIMIT 1');\r\n\tif(!$profile )\r\n\t{\r\n\t\tprintf('Errormessage: %s', $db->error);\r\n\t}\r\n\tif($profile ->num_rows < 1)\r\n\t{\r\n\t\theader('Location: index.php');\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$tpl['profile'] = $profile ->fetch_assoc();\r\n\t}\r\n\t$profile ->close();\r\n\t//page assignments\r\n\t$tpl['title'] = $tpl['profile']['name'].'\\'s Profile';\r\n\t$tpl['nest'] = '';\r\n\t$tpl['keywords'] = 'author profile information contact links';\r\n\t$tpl['description'] = 'Profile information for an author';\r\n\t//assign sub \"template\"\r\n\t$files['page'] = 'author.html';\r\n\t//create sidebar\r\n\tinclude('../lib/sidebar.php');\r\n\t//show the \"template\"\r\n\tshow_tpl($tpl, $files);\r\n\treturn;\r\n}",
"public static function display(int $id)\n {\n $director = new Director($id);\n\n $data['personne'] = $director->getBaseInformation();\n\n return parent::loadTemplate('person', $data);\n }",
"public function actionView()\n {\n $purifier = new HtmlPurifier;\n $param = $purifier->process( Yii::$app->request->get('id') );\n $personal = Personal::find()->where(['idpers'=>$param])->one();\n\n return $this->render('view', [\n 'personal' => $personal,\n ]);\n }",
"function display( $tpl = null )\n {\n // Assign data to the view\n list( $this->institutes, $this->experts, $this->projects, $this->publications ) = $this->get( 'Data' );\n \n // Check for errors.\n if ( count( $errors = $this->get( 'Errors' ) ) )\n {\n JError::raiseError( 500, implode( '<br />', $errors ) );\n return false;\n }\n \n // Display the view\n parent::display( $tpl );\n }",
"public function show(Person $person)\n {\n\n $jobs = Job::with('people')->get();\n $address = Address::with('people')->get();\n $companies = Company::with('people')->get();\n $role = Role::with('people')->get();\n return view('people.show', compact('person', 'jobs', 'address', 'companies', 'role'));\n }",
"public function index()\n\t{\n\t\t$user_id = Auth::id();\n\n\t\t$people = PersonalPeople::select('personal_peoples.id', 'personal_peoples.name', 'personal_relationships.display_name AS relationship', 'personal_peoples.mobile', 'personal_peoples.email', 'personal_peoples.aadhar', 'personal_peoples.pan', 'personal_peoples.status')\n\t\t->leftjoin('personal_relationships', 'personal_relationships.id', '=', 'personal_peoples.relationship_id')\n\t\t->where('personal_peoples.user_id', $user_id)->get();\n\n\t\treturn view('personal.people', compact('people'));\n\t}",
"public function viewAction() {\n\t\t$uid = $this->_request->getParam('uid');\n\t\t$ds = Zend_Registry::get('ds');\n\t\t\n\t\tif($uid==null || $uid==\"\")\n\t\t\t$uid=UserAcl::getUid();\n\t\t//$person = $ds->getUser($uid);\n\t\t$person = LdapCache::getUserDetails($uid);\n\t\t$this->view->person = $person;\n\t\t\n\t\t$persontype = null;\n\t\t$config = Zend_Registry::get('config');\n\t\tif(in_array(trim($config->ldapdirectory->studentgroup), $person[\"groups\"]))\n\t\t\t$persontype=\"Student\";\n\t\t$this->view->persontype=$persontype;\n\t\t\n\t\t$fromemail = Compass::getConfig(\"studentemaildomain.from\");\n\t\t$toemail = Compass::getConfig(\"studentemaildomain.to\");\n\t\t$this->view->email = $person[\"mail\"][0];\n\t\tif (in_array(trim($config->allstudentgroup), $person[\"groups\"])) {\n\t\t\t$this->view->email = str_replace($fromemail, $toemail, $person[\"mail\"][0]);\n\t\t}\n\t\t\n\t\t// Get Image URLs\n\t\t$mids = PeopleService::getPhotoList($uid);\n\t\t$bigurls = array();\n\t\t$lilurls = array();\n\t\t\n\t\tforeach($mids as $ind => $mid) {\n\t\t\t$bigurls[$ind] = MediabankResourceConstants::createCompassImageUrl($mid, null, 320, 320);\n\t\t\t$lilurls[$ind] = MediabankResourceConstants::createCompassImageUrl($mid, null, 64, 64);\n\t\t}\n\t\t$this->view->hideOfficialPhoto = true;\n\t\tif (UserAcl::isStaffOrAbove() || UserAcl::getUid() == $uid) {\n\t\t\t$this->view->hideOfficialPhoto = false;\n\t\t}\n\t\t\n\t\t$this->view->uid = $uid;\n\t\t$this->view->mids = $mids;\n\t\t$this->view->largePhotoURLs = $bigurls;\n\t\t$this->view->smallPhotoURLs = $lilurls;\n\t\t\n\t\t$this->view->officialPhotoMID = PeopleService::getOfficialPhoto($uid);\n\t\t$this->view->officialPhoto = MediabankResourceConstants::createCompassImageUrl($this->view->officialPhotoMID, null, 320, 320);\n\t\t$this->view->defaultPhotoMID = PeopleService::getDefaultPhoto($uid);\n\t\t$this->view->defaultPhoto = MediabankResourceConstants::createCompassImageUrl($this->view->defaultPhotoMID, null, 320, 320);\n\t\t$this->view->isMyProfile = $this->isMpauAdmin(UserAcl::getUid()) || (UserAcl::getUid() == $uid);\n\t\t\n\t\t//sort out groups\n\t\t$groups = array();\n\t\t//print_r($person['groups']);\n\t\t$sn = $person['sn'][0];\n\t\t$groups['Students'] = Compass::baseUrl().'/people/students/ref/'.substr($sn,0,1);\n\t\tforeach($person['groups'] as $group) {\n\t\t\t$groupname = $this->getGroupName($group);\n\t\t\tif($groupname !==FALSE)\n\t\t\t\t$groups[$groupname]=Compass::baseUrl().'/people/group/gid/'.$group;\n\t\t}\n\t\t$this->view->groups = $groups;\n\t\t//prep stuff for student resources uploader\n\t\t$srcFinder = new StudentResourceCategories();\n\t\t$srcnames = $srcFinder->getAllNames();\n\t\tksort($srcnames);\n\t\t$this->view->studentResourceCategories = $srcnames;\n\n\t\tif(StudentResourceService::showSocialTools()) {\n\t\t\tStudentResourceService::prepStudentResourceView($this, $this->_request, null, $uid);\t\t\n\t\t\t$this->view->socialtools = true;\n\t\t} else {\n\t\t\t$this->view->socialtools = false;\n\t\t}\n\t\t//get metadata about student\n\t\t$studentInfoFinder = new StudentInfo();\n\t\t$this->view->studentInfo = $studentInfoFinder->getInfo($uid);\n\t}",
"public function index()\n {\n /*\n\t\t\tShow data for permission publication news \n\t\t*/\n }",
"public function pagePerso(){\n\n\t\t$experiences = $this->User->showExperiences();\n\t\t$this->render('user.pagePerso', compact('experiences'));\n\t}",
"function view_by_name () {\n\t\tif (empty($_GET[\"id\"])) {\n\t\t\treturn _e(\"Missing article name\");\n\t\t}\n\t\t// Get article info\n\t\t$article_info = db()->query_fetch(\"SELECT * FROM \".db('articles_texts').\" WHERE short_url='\"._es($_GET[\"id\"]).\"'\");\n\t\tif (empty($article_info)) {\n\t\t\treturn _e(\"No such article!\");\n\t\t}\n\t\t// Re-map id\n\t\t$_GET[\"id\"] = $article_info[\"id\"];\n\t\t// Display article\n\t\treturn $this->view($article_info);\n\t}",
"function displaySingle()\n{\n\t$article = new ArticleDAO();\n\t$articles = $article->getArticle($_GET['articleId']);\n\t// On récupérer tous les commentaires associés à l'article\n\t$comment = new CommentDAO();\n\t$comments = $comment->getCommentsFromArticle($_GET['articleId']);\n\trequire '../views/single.php';\n}",
"function Display($name=\"\")\n {\n $this->ShowBlog($name);\n }",
"function showassign_mentorschool(project_render $renderobj){\n\tglobal $CFG,$USER;\n\t$userrole = get_atalrolenamebyid($USER->msn);\n\t$content = html_writer::start_tag('div', array('class' => 'assignmentor'));\n\t$content.= \"<div class='heading'><h3>Assign</h3></div>\";\n\t$content.= \"<div class='abar'></div>\";\n\t$content.=$renderobj->filterform('school');\n\t$content.=showassign_mentorschooldata(1,$renderobj);\n\t//get users assign to this school.\n\t$mentor = getusers_byrole('mentor');\n\t$content.=$renderobj->mentorpopupbox($mentor);\n\t$content.= html_writer::end_tag('div');\n\treturn $content;\n}",
"public function indexAction() {\n\t\tPageTitle::setTitle($this->view, $this->_request);\n\t\t$this->view->title = 'People';\n\t\t$this->view->test='Testing...';\n\t\t$staffpageFinder = new StaffPage();\n\t\t$staffpages = $staffpageFinder->getAllNames();\n\t\t$this->view->staffpages = $staffpages;\n\t\t$config = Zend_Registry::get('config');\n\t\t$this->view->externallinks = $config->people->externallinks;\n\t}",
"public function listsAllPublications() {\n\t\t$publications = Publication::where('is_active', '=', '1')->get();\n\t\t$this->layout->content = View::make('frontend.publications', compact('publications'));\n\t}",
"function render_about_group_field($data) {\n if (!$data) {\n return;\n }\n\n foreach($data as $person) {\n?>\n <div class=\"margin-bottom-small\">\n <h6 class=\"font-small-caps\"><?php echo $person['title']; ?></h6>\n<?php\n foreach($person['name'] as $name) {\n?>\n <div class=\"about-page__person\"><?php echo $name; ?></div>\n<?php\n }\n ?>\n </div>\n<?php\n }\n}",
"public function personAction() {\n if($this->_getParam('as',0)){\n $this->view->accountdata = $this->_users->getUserAccountData($this->_getParam('as'));\n $this->view->totals = $this->_users->getCountFinds($this->getIdentityForForms());\n } else {\n throw new Pas_Exception_Param($this->_missingParameter, 500);\n }\n }",
"function doDisplay ()\n\t{\n\t\tglobal $LANG;\n\n\t\t$members\t\t\t\t= $this->getParticipantData();\n\n\t\techo cbArr2Html( $members, $LANG->getLL( 'title' )\n\t\t\t, ! t3lib_div::_GP( 'tx_newseventregister_modfunc1_survey' )\n\t\t);\n\t}"
] | [
"0.6571443",
"0.64736944",
"0.6445584",
"0.64333886",
"0.64333886",
"0.64333886",
"0.64333886",
"0.6240992",
"0.61998135",
"0.6177284",
"0.61613363",
"0.61468065",
"0.61405617",
"0.6114803",
"0.6101184",
"0.6068246",
"0.6058038",
"0.60438186",
"0.60324985",
"0.60212696",
"0.6012702",
"0.6009922",
"0.5996849",
"0.5981444",
"0.5971052",
"0.5970889",
"0.5947258",
"0.5937404",
"0.59370816",
"0.5930017"
] | 0.67141473 | 0 |
Add custom people list layout for UCF Post List shortcode | function colleges_post_list_display_people_before( $content, $items, $atts ) {
ob_start();
?>
<div class="ucf-post-list colleges-post-list-people">
<?php
return ob_get_clean();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function custom_list_func( $atts, $content = null ) {\n extract(shortcode_atts(array(\n\t 'style' => 'list-1',\n ), $atts));\n $content = str_replace('<ul>', '<ul class=\"'.$style.'\">', do_shortcode($content));\n return $content;\n}",
"function get_person_post_list_markup( $posts ) {\n\tob_start();\n\tif ( $posts ):\n?>\n\t<ul class=\"list-unstyled\">\n\t\t<?php foreach ( $posts as $post ): ?>\n\t\t<li class=\"mb-md-4\">\n\t\t\t<h3 class=\"h5\">\n\t\t\t\t<?php if ( get_post_meta( $post->ID, '_links_to', true ) || $post->post_content ): ?>\n\t\t\t\t<a href=\"<?php echo get_permalink( $post ); ?>\">\n\t\t\t\t\t<?php echo wptexturize( $post->post_title ); ?>\n\t\t\t\t</a>\n\t\t\t\t<?php else: ?>\n\t\t\t\t<?php echo wptexturize( $post->post_title ); ?>\n\t\t\t\t<?php endif; ?>\n\t\t\t</h3>\n\t\t\t<?php if ( has_excerpt( $post ) ): ?>\n\t\t\t<div>\n\t\t\t\t<?php echo apply_filters( 'the_content', get_the_excerpt( $post ) ); ?>\n\t\t\t</div>\n\t\t\t<?php endif; ?>\n\t\t</li>\n\t\t<?php endforeach; ?>\n\t</ul>\n<?php\n\tendif;\n\treturn ob_get_clean();\n}",
"function ucf_post_list_display_itn_before($content, $posts, $atts)\n{\n ob_start();\n ?>\n <div class=\"ucf-post-list ucfwp-post-list-news\" id=\"post-list-<?php echo $atts['list_id']; ?>\">\n <?php\n return ob_get_clean();\n}",
"function colleges_post_list_display_degree_block_before( $content, $posts, $atts ) {\n\tob_start();\n?>\n<div class=\"ucf-post-list colleges-post-list-degree-block\">\n<?php\n\treturn ob_get_clean();\n}",
"function post_list_shortcode($atts){\n\t\t extract( shortcode_atts( array(\n\t\t 'count' => '',\n\t\t ), $atts) );\n\t\t \n\t\t $q = new WP_Query(\n\t\t array('posts_per_page' => $count, 'post_type' => 'posttype', 'orderby' => 'menu_order','order' => 'ASC')\n\t\t ); \n\t\t \n\t\t $list = '<div class=\"custom_post_list\">';\n\t\t while($q->have_posts()) : $q->the_post();\n\t\t $idd = get_the_ID();\n\t\t $custom_field = get_post_meta($idd, 'custom_field', true);\n\t\t $post_content = get_the_content();\n\t\t $list .= '\n\t\t <div class=\"single_post_item\">\n\t\t <h2>' .do_shortcode( get_the_title() ). '</h2> \n\t\t '.wpautop( $post_content ).'\n\t\t <p>'.$custom_field.'</p>\n\t\t </div>\n\t\t '; // buji na \n\t\t endwhile;\n\t\t $list.= '</div>';\n\t\t wp_reset_query();\n\t\t return $list;\n\t\t}",
"public static function make_list_container( ) {\n global $post;\n\n if ( isset( $post ) ) {\n $html = \"<div id='gallery-{$post->post_name}' class='gallery-list'>\";\n }\n\n return $html;\n }",
"abstract function buildListLayout(): void;",
"function mediacommons_field__field_contributors($vars) {\n $output ='';\n $output .= '<div class=\"peoplelist contributors\">' ;\n if ( isset( $vars['items'][0]['#title'] ) ) {\n $output .= $vars['label'] . ' ';\n foreach ( element_children( $vars['items'] ) as $key ) {\n\n $output .= '<span class=\"h-card\">' . drupal_render( $vars['items'][$key] ) . '</span> ';\n }\n }\n $output .= '</div>';\n return $output;\n}",
"function ldc_list_shortcode($atts = array()) {\n //// See /sc/sc-ldc_list.php:ldc_list_register_deps()\n wp_enqueue_script('ldc_list_script');\n wp_enqueue_style( 'ldc_list_style');\n\n //// Define valid shortcode attributes. \n $valid_type = array( // @todo add all current post types\n 'ldc_chatter' , // Chatter\n 'ldc_creation', // Creation\n 'ldc_event' , // Event\n );\n $valid_status = array(\n 'publish' , // (default) a published post or page\n 'pending', // pending review\n 'draft', // in draft status\n 'auto-draft', // a newly created post, with no content\n 'future', // a post to publish in the future\n 'private', // not visible to users who are not logged in\n 'inherit', // a revision. see https://codex.wordpress.org/Function_Reference/get_children\n 'trash', // post is in trashbin\n 'any', // any status except those from post statuses with 'exclude_from_search' set to true (i.e. trash and auto-draft)\n );\n $valid_orderby = array(\n 'date' , // (default) order by date\n 'none' , // no order\n 'ID' , // order by post id. Note the capitalization\n 'author' , // order by author\n 'title' , // order by title\n 'name' , // order by post slug\n 'modified', // order by last modified date\n 'rand' , // random order\n );\n $valid_order = array(\n 'ASC' , // (default) ascending order from lowest to highest values (1, 2, 3; a, b, c)\n 'DESC', // descending order from highest to lowest values (3, 2, 1; c, b, a)\n );\n\n //// Set defaults for missing attributes. \n $atts = shortcode_atts( array(\n 'type' => $valid_type[0],\n 'status' => $valid_status[0],\n 'orderby' => $valid_orderby[0],\n 'order' => $valid_order[0],\n 'number' => '-1', // show all by default\n 'offset' => '0', // no offset\n 'category' => '',\n 'class' => false,\n 'linkkey' => '',\n 'truncate' => 140,\n ), $atts );\n\n //// Prepare an array which will contain warnings (that is, not-quite-errors). \n $warnings = array();\n\n //// Validate attributes. \n if (! ldc_list_validate($atts['type'], $valid_type ) ) { ldc_list_defaultize($warnings, $atts, 'type' , $valid_type[0]); }\n if (! ldc_list_validate($atts['status'], $valid_status ) ) { ldc_list_defaultize($warnings, $atts, 'status' , $valid_status[0]); }\n if (! in_array($atts['orderby'], $valid_orderby) ) { ldc_list_defaultize($warnings, $atts, 'orderby' , $valid_orderby[0]); }\n if (! in_array($atts['order'] , $valid_order ) ) { ldc_list_defaultize($warnings, $atts, 'order' , $valid_order[0]); }\n if ('-1' !== $atts['number'] && ! ctype_digit($atts['number'])) { ldc_list_defaultize($warnings, $atts, 'number' , '-1'); }\n if (! ctype_digit($atts['offset']) ) { ldc_list_defaultize($warnings, $atts, 'offset' , '0'); }\n if (! ctype_digit('' . $atts['truncate']) ) { ldc_list_defaultize($warnings, $atts, 'truncate', 140); }\n\n //// Derive the link key from the type, if not explicitly set. \n if ('' == $atts['linkkey']) { $atts['linkkey'] = $atts['type'] . '_link'; }\n\n //// Begin the container <DIV>. \n $out = array('<!-- BEGIN ' . rp_dev('List', 'ldc_list shortcode') . ' -->');\n $out[] = '<div class=\"ldc-list-wrap ldc-preload' . ($atts['class'] ? ' ' . $atts['class'] : '') . '\">';\n $out[] = ' <ul>';\n\n //// Configure the query. \n $query_args = array(\n 'post_type' => $atts['type'],\n 'post_status' => $atts['status'],\n 'orderby' => $atts['orderby'],\n 'order' => $atts['order'],\n 'posts_per_page' => $atts['number'],\n 'offset' => $atts['offset'],\n );\n if ($atts['category']) {\n $query_args['tax_query'] = array(array(\n 'taxonomy' => $atts['type'] . '_category',\n 'field' => 'slug',\n 'terms' => $atts['category'],\n ));\n }\n\n //// Retrieve matching posts. \n $posts = new WP_Query($query_args);\n\n //// Show any warnings. \n if (count($warnings)) {\n $out[] =\n ' <!-- '\n . rp_dev(\n count($warnings) . ' Shortcode Attribute Warning' . (1 == count($warnings) ? '' : 's'),\n implode(\" ... \", $warnings))\n . ' -->'\n ;\n }\n\n //// Get the URL path to the media directory. \n $upload_dir = wp_upload_dir();\n $upload_base = $upload_dir['baseurl'];\n\n //// Add each post to the output-array... \n if ($posts->have_posts()) {\n\n while ($posts->have_posts()) {\n\n //// Switch WP's focus to the current post, and get various data from it. \n $posts->the_post();\n $post_id = get_the_id();\n $post_link = get_post_meta($post_id, $atts['linkkey'], true);\n $link_type = ldc_link_to_type($post_link);\n $image_id = get_post_thumbnail_id($post_id);\n\n //// Get the post's featured-image, if it has one. \n if ($image_id) {\n $image_meta = wp_get_attachment_metadata($image_id, false);\n $image_post = get_post($image_id);\n // echo rp_dump($image_meta);\n } else {\n $image_meta = null;\n }\n\n //// Begin the opening <LI> tag. \n $out[] = ' <li id=\"ldc-list-id-' . $post_id . '\" class=\"ldc-list-post '\n . 'ldc-link-type-' . str_replace('.', '-', strtolower($link_type) )\n . '\"';\n\n //// If the post has a featured-image, show that as the background, and \n //// add a data-attribute so that JavaScript can assign the proper height. \n if ($image_meta) {\n if ( 'ldc-carousel' == $atts['class'] && ! is_front_page() ) {\n $image_filename = $image_meta['sizes']['bones-thumb-600']['file'];\n $aspect_ratio = 600 / 150;\n } else {\n $image_filename = $image_meta['sizes']['medium']['file'];\n $aspect_ratio = $image_meta['height'] / $image_meta['width'];\n }\n $out[count($out)-1] .=\n ' style=\"background-image:url(\\'' . $upload_base . '/' . dirname($image_meta['file']) . '/' . $image_filename . '\\'); \"'\n . ' data-ldc-aspect-ratio=\"' . $aspect_ratio . '\"'\n ;\n }\n\n //// End the opening <LI> tag. \n $out[count($out)-1] .= '>';\n\n $out[] = ' <div class=\"ldc-list-title\">'; // CSS table-row\n $out[] = ' <div>'; // table-cell\n $out[] = ' <h4>' . get_the_title() . '</h4>';\n $out[] = ' </div>';\n $out[] = ' </div>';\n $out[] = ' <div class=\"ldc-list-excerpt\">'; // CSS table-row\n $out[] = ' ' . ($post_link ? '<a href=\"' . $post_link . '\" target=\"_blank\">' : '<span>'); // table-cell\n $out[] = ' <div>'; // CSS table\n $out[] = ' <div>'; // CSS table-row\n $out[] = ' <p><span>' . the_excerpt_max_charlength($atts['truncate']) . '</span></p>'; // CSS table-cell\n $out[] = ' <p class=\"ldc-arrow\"><span class=\"dashicons dashicons-controls-play\"></span></p>';\n $out[] = ' </div>';\n $out[] = ' </div>';\n $out[] = ' ' . ($post_link ? '</a>' : '</span>');\n $out[] = ' </div>';\n $out[] = ' </li>';\n };\n\n //// ...or show an HTML comment. \n } else {\n\n $out[] = ' <!-- ';\n $out[] = rp_dev('No posts found', 'Nothing matches'\n . ' type:' . $atts['type']\n . ' status:' . $atts['status']\n . ' number:' . $atts['number']\n . ' offset:' . $atts['offset']\n . ($atts['category'] ? ' category:' . $atts['category'] : '')\n );\n $out[] = ' -->';\n }\n \n //// Restore the $wp_query and global post data to the original main query. \n wp_reset_query();\n\n //// End the container <DIV>. \n $out[] = ' </ul>';\n $out[] = '</div>';\n $out[] = '<!-- END ' . rp_dev('List', 'ldc_list shortcode') . ' -->';\n \n //// Convert the output-array to a string. \n $out = \"\\n\" . implode(\"\\n\", $out) . \"\\n\";\n\n //// Prevent gaps appearing between <LI> elements, and return. \n $out = str_replace(\" </li>\\n <li\", \" </li><li\", $out);\n return $out;\n}",
"function list_check($attr,$content){\r\n return '<ul class=\"adtheme_list adtheme-icon\">'.do_shortcode($content).'</ul>';\r\n}",
"function make_one_article_list($my_articlelist) {\n echo \"<ul>\";\n echo \"<li><a href='\" . $my_articlelist[linkTo] . \"'> <h2>$my_articlelist[title]</h2> </a></li>\";\n echo \"<li><img src='\" . $my_articlelist[img] . \"' alt='\" . $my_articlelist[title] . \" Poster'></li>\";\n echo \"<li>$my_articlelist[previewText]</li>\"; \n echo \"</ul\";\n }",
"function team_item_shortcode ($atts, $content=null) {\n extract(shortcode_atts(array(\n 'name' => 'John Due',\n 'position' => 'CEO',\n 'link_1' => '#',\n 'link_2' => '#',\n 'link_3' => '#',\n 'link_4' => '#',\n 'link_5' => '#',\n 'link_6' => '#',\n 'link_7' => '#',\n 'text' => 'text'\n ), $atts));\n \n $output = '<li class=\"text-center\">';\n $output .= '<div class=\"author-post-photo-wrap\">';\n $output .= do_shortcode($content);\n $output .= '<a href=\"#\" class=\"mask\"></a>';\n $output .= '<div class=\"holder-author-photo\"></div>';\n $output .= '</div>';\n $output .= '<div class=\"author-info border-triangle\">';\n $output .= '<h4 class=\"simple-text-16 bold\"><a href=\"#\" class=\"link\">'.$name.'</a></h4>';\n $output .= '<h5 class=\"simple-text-12 light-grey-text\">'.$position.'</h5>';\n $output .= '<p class=\"simple-text-12\">';\n $output .= $text;\n $output .= '</p>';\n $output .= '<ul class=\"social clearfix\">';\n $output .= '<li><a href=\"'.$link_1.'\" class=\"pinterest-icon\"></a></li>';\n $output .= '<li><a href=\"'.$link_2.'\" class=\"google-icon\"></a></li>';\n $output .= '<li><a href=\"'.$link_3.'\" class=\"linkedin-icon\"></a></li>';\n $output .= '<li><a href=\"'.$link_4.'\" class=\"twitter-icon\"></a></li>';\n $output .= '<li><a href=\"'.$link_5.'\" class=\"facebook-icon\"></a></li>';\n $output .= '</ul>';\n $output .= '</div>';\n $output .= '</li>';\n \n return $output;\n}",
"function aps_content_entry_meta() {\n if ( get_post_type() == 'aps_project' )\n {\n $sep = ' | ';\n $list_categories = get_the_term_list(get_the_ID(), 'project_category', '', $sep, '');\n $list_tags = get_the_term_list(get_the_ID(), 'project_tag', '', $sep, '');\n $list_skills = get_the_term_list(get_the_ID(), 'project_skill', '', $sep, '');\n $list = $list_skills;\n if ($list_categories != '') {\n $list = ($list = !'' ? $list . $sep . $list_categories : $list_categories);\n }\n if ($list_tags != '') {\n $list = ($list = !'' ? $list . $sep . $list_tags : $list_tags);\n }\n\n ?>\n <div class=\"post_meta\">\n <div class=\"meta_holder\">\n <?php echo $list; ?>\n </div>\n </div>\n <?php\n return;\n }\n\n\n \tglobal $aps_config;\n \t\n \t$separator = ' | ';\n \n \t//Autor\n \tif ( isset($aps_config['aps_op_blog']['blog_show_author']) && $aps_config['aps_op_blog']['blog_show_author']=='no' ) {\n \t\t$author = '';\n \t} else {\n\t \t$author_href = get_author_posts_url( get_the_author_meta( 'ID' ) );\n\t \t$author_name = get_the_author();\n\t \t$author_title = esc_attr( sprintf( __('All posts by: '%s'',LANGUAGE_THEME), $author_name ) );\n\t \t$author = sprintf( '<span class=\"post_author_by\">%1$s</span><a class=\"post_author\" href=\"%2$s\" title=\"%3$s\">%4$s</a>', __('By ',LANGUAGE_THEME),$author_href, $author_title, $author_name);\n\t \t$author .= $separator;\t\n \t} \n \t\n \n \n \t//Categories\n \tif ( isset($aps_config['aps_op_blog']['blog_show_cats']) && $aps_config['aps_op_blog']['blog_show_cats']=='no' ) {\n \t\t$list_categories = '';\n \t} else {\n\t \t$list_categories = '';\n\t\t$cats = get_the_category();\n\t foreach ($cats as $cat) {\n\t \t$c_href = get_category_link($cat->term_id);\n\t \t$c_title = esc_attr( sprintf( __(\"View all posts in: '%s'\",LANGUAGE_THEME), $cat->name ));\n\t \t$c_name = $cat->name;\n\t\t $list_categories .= '<a class=\"post_cat\" href=\"'.$c_href.'\" title=\"'.$c_title.'\">'.$c_name.'</a>'.$separator;\n\t }\n\t $list_categories = sprintf('%s', trim($list_categories, $separator));\n\t $list_categories .= $separator;\n \t}\n\t\n \n \n //Comments\n if ( isset($aps_config['aps_op_blog']['blog_show_comments']) && $aps_config['aps_op_blog']['blog_show_comments']=='no' ) {\n \t\t$comments = '';\n \t} else {\n\t $comments_number = get_comments_number();\n\t $comments_link = esc_url(get_comments_link());\n\t \n\t if ($comments_number==0) {\n\t\t $comments_title = __('Leave a comment on: '%s'', LANGUAGE_THEME);\n\t\t $comments_msg = 'Leave a comment';\n\t\t \n\t } else if ($comments_number==1) {\n\t\t $comments_title = __('Leave a comment on: '%s'', LANGUAGE_THEME);\n\t\t $comments_msg = '1 Comment';\n\t\t \n\t } else {\n\t\t $comments_title = __('View all comments on: '%s'', LANGUAGE_THEME);\n\t\t $comments_msg = $comments_number . ' Comments';\n\t }\n\n //En vez del mensaje pongo un icono\n $comments_msg = ($comments_number>0 ? $comments_number.' ' : '') . '<i class=\"fa fa-comment\"></i>';\n\n\t $comments = sprintf('<a href=\"%1$s\" title=\"%2$s\" class=\"post_comments\">%3$s</a>',\n\t \t\t$comments_link,\n\t \t\tesc_attr( sprintf( $comments_title, get_the_title() ) ),\n\t \t\t$comments_msg);\n\n }\t\n \t\t\t\t\t\t\n \n \t?>\n\t<div class=\"post_meta\">\n\t\t<div class=\"meta_holder\">\n\t\t\t<?php echo $author; ?>\n\t\t\t<?php echo $list_categories; ?>\n\t\t\t<?php echo $comments; ?>\n\t\t</div>\n\t</div>\n\t<?php\n \n }",
"function cptui_listings() {\n\t\t?>\n\t\t<div class=\"wrap cptui-listings\">\n\t\t\t<?php\n\t\t\t/**\n\t\t\t * Fires right inside the wrap div for the listings screen.\n\t\t\t *\n\t\t\t * @since 1.3.0\n\t\t\t */\n\t\t\tdo_action( 'cptui_inside_listings_wrap' );\n\t\t\t?>\n\n\t\t\t<h1><?php esc_html_e( 'Post Types and Taxonomies registered by Custom Post Type UI.', 'custom-post-type-ui' ); ?></h1>\n\t\t\t<?php\n\t\t\t$post_types = cptui_get_post_type_data();\n\t\t\techo '<h2 id=\"post-types\">' . esc_html__( 'Post Types', 'custom-post-type-ui' ) . '</h2>';\n\t\t\tif ( ! empty( $post_types ) ) {\n\t\t\t?>\n\t\t\t<p><?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s: Total count of registered CPTUI post types */\n\t\t\t\tesc_html__( 'Custom Post Type UI registered post types count total: %d', 'custom-post-type-ui' ),\n\t\t\t\tcount( $post_types )\n\t\t\t);\n\t\t\t?>\n\t\t\t</p>\n\n\t\t\t<?php\n\n\t\t\t$post_type_table_heads = array(\n\t\t\t\t__( 'Post Type', 'custom-post-type-ui' ),\n\t\t\t\t__( 'Settings', 'custom-post-type-ui' ),\n\t\t\t\t__( 'Supports', 'custom-post-type-ui' ),\n\t\t\t\t__( 'Taxonomies', 'custom-post-type-ui' ),\n\t\t\t\t__( 'Labels', 'custom-post-type-ui' ),\n\t\t\t\t__( 'Template Hierarchy', 'custom-post-type-ui' ),\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Fires before the listing of registered post type data.\n\t\t\t *\n\t\t\t * @since 1.1.0\n\t\t\t */\n\t\t\tdo_action( 'cptui_before_post_type_listing' );\n\t\t\t?>\n\t\t\t<table class=\"wp-list-table widefat post-type-listing\">\n\t\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $post_type_table_heads as $head ) {\n\t\t\t\t\t\techo '<th>' . esc_html( $head ) . '</th>';\n\t\t\t\t\t} ?>\n\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t<?php\n\t\t\t\t$counter = 1;\n\t\t\t\tforeach ( $post_types as $post_type => $post_type_settings ) {\n\n\t\t\t\t\t$rowclass = ( 0 === $counter % 2 ) ? '' : 'alternate';\n\n\t\t\t\t\t$strings = array();\n\t\t\t\t\t$supports = array();\n\t\t\t\t\t$taxonomies = array();\n\t\t\t\t\t$archive = '';\n\t\t\t\t\tforeach ( $post_type_settings as $settings_key => $settings_value ) {\n\t\t\t\t\t\tif ( 'labels' === $settings_key ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( is_string( $settings_value ) ) {\n\t\t\t\t\t\t\t$strings[ $settings_key ] = $settings_value;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ( 'supports' === $settings_key ) {\n\t\t\t\t\t\t\t\t$supports[ $settings_key ] = $settings_value;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( 'taxonomies' === $settings_key ) {\n\t\t\t\t\t\t\t\t$taxonomies[ $settings_key ] = $settings_value;\n\n\t\t\t\t\t\t\t\t// In case they are not associated from the post type settings.\n\t\t\t\t\t\t\t\tif ( empty( $taxonomies['taxonomies'] ) ) {\n\t\t\t\t\t\t\t\t\t$taxonomies['taxonomies'] = get_object_taxonomies( $post_type );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$archive = get_post_type_archive_link( $post_type );\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t\t<tr class=\"<?php echo esc_attr( $rowclass ); ?>\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$edit_path = 'admin.php?page=cptui_manage_post_types&action=edit&cptui_post_type=' . $post_type;\n\t\t\t\t\t\t\t$post_type_link_url = ( is_network_admin() ) ? network_admin_url( $edit_path ) : admin_url( $edit_path ); ?>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t'<a href=\"%s\">%s</a><br/>\n\t\t\t\t\t\t\t\t\t<a href=\"%s\">%s</a><br/>',\n\t\t\t\t\t\t\t\t\tesc_attr( $post_type_link_url ),\n\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: Post type slug */\n\t\t\t\t\t\t\t\t\t\tesc_html__( 'Edit %s', 'custom-post-type-ui' ),\n\t\t\t\t\t\t\t\t\t\tesc_html( $post_type )\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tesc_attr( admin_url( 'admin.php?page=cptui_tools&action=get_code#' . $post_type ) ),\n\t\t\t\t\t\t\t\t\tesc_html__( 'Get code', 'custom-post-type-ui' )\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tif ( $archive ) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<a href=\"<?php echo esc_attr( get_post_type_archive_link( $post_type ) ); ?>\"><?php esc_html_e( 'View frontend archive', 'custom-post-type-ui' ); ?></a>\n\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tforeach ( $strings as $key => $value ) {\n\t\t\t\t\t\t\t\t\tprintf( '<strong>%s:</strong> ', esc_html( $key ) );\n\t\t\t\t\t\t\t\t\tif ( in_array( $value, array( '1', '0' ), true ) ) {\n\t\t\t\t\t\t\t\t\t\techo esc_html( disp_boolean( $value ) );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\techo ( ! empty( $value ) ) ? esc_html( $value ) : '\"\"';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\techo '<br/>';\n\t\t\t\t\t\t\t\t} ?>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tforeach ( $supports['supports'] as $support ) {\n\t\t\t\t\t\t\t\t\techo esc_html( $support ) . '<br/>';\n\t\t\t\t\t\t\t\t} ?>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( ! empty( $taxonomies['taxonomies'] ) ) {\n\t\t\t\t\t\t\t\t\tforeach ( $taxonomies['taxonomies'] as $taxonomy ) {\n\t\t\t\t\t\t\t\t\t\techo esc_html( $taxonomy ) . '<br/>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t'<span aria-hidden=\"true\">—</span><span class=\"screen-reader-text\">%s</span>',\n\t\t\t\t\t\t\t\t\t\tesc_html__( 'No associated taxonomies', 'custom-post-type-ui' )\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$maybe_empty = array_filter( $post_type_settings['labels'] );\n\t\t\t\t\t\t\t\tif ( ! empty( $maybe_empty ) ) {\n\t\t\t\t\t\t\t\t\tforeach ( $post_type_settings['labels'] as $key => $value ) {\n\t\t\t\t\t\t\t\t\t\tif ( 'parent' === $key && array_key_exists( 'parent_item_colon', $post_type_settings['labels'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t'%s: %s<br/>',\n\t\t\t\t\t\t\t\t\t\t\tesc_html( $key ),\n\t\t\t\t\t\t\t\t\t\t\tesc_html( $value )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t'<span aria-hidden=\"true\">—</span><span class=\"screen-reader-text\">%s</span>',\n\t\t\t\t\t\t\t\t\t\tesc_html__( 'No custom labels to display', 'custom-post-type-ui' )\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<p><strong><?php esc_html_e( 'Archives file name examples.', 'custom-post-type-ui' ); ?></strong><br/>\n\t\t\t\t\t\t\t\tarchive-<?php echo esc_html( $post_type ); ?>.php<br/>\n\t\t\t\t\t\t\t\tarchive.php<br/>\n\t\t\t\t\t\t\t\tindex.php\n\t\t\t\t\t\t\t\t</p>\n\n\t\t\t\t\t\t\t\t<p><strong><?php esc_html_e( 'Single Posts file name examples.', 'custom-post-type-ui' ); ?></strong><br/>\n\t\t\t\t\t\t\t\tsingle-<?php echo esc_html( $post_type ); ?>-post_slug.php *<br/>\n\t\t\t\t\t\t\t\tsingle-<?php echo esc_html( $post_type ); ?>.php<br/>\n\t\t\t\t\t\t\t\tsingle.php<br/>\n\t\t\t\t\t\t\t\tsingular.php<br/>\n\t\t\t\t\t\t\t\tindex.php\n\t\t\t\t\t\t\t\t</p>\n\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( '*Replace \"post_slug\" with the slug of the actual post slug.', 'custom-post-type-ui' ); ?>\n\t\t\t\t\t\t\t\t</p>\n\n\t\t\t\t\t\t\t\t<p><?php\n\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t'<a href=\"https://developer.wordpress.org/themes/basics/template-hierarchy/\">%s</a>',\n\t\t\t\t\t\t\t\t\t\tesc_html__( 'Template hierarchy Theme Handbook', 'custom-post-type-ui' )\n\t\t\t\t\t\t\t\t\t); ?>\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\n\t\t\t\t\t<?php\n\t\t\t\t\t$counter++;\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t</tbody>\n\t\t\t\t<tfoot>\n\t\t\t\t<tr>\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $post_type_table_heads as $head ) {\n\t\t\t\t\t\techo '<th>' . esc_html( $head ) . '</th>';\n\t\t\t\t\t} ?>\n\t\t\t\t</tr>\n\t\t\t\t</tfoot>\n\t\t\t</table>\n\t\t\t<?php\n\t\t\t\t/**\n\t\t\t\t * Fires after the listing of registered post type data.\n\t\t\t\t *\n\t\t\t\t * @since 1.3.0\n\t\t\t\t */\n\t\t\t\tdo_action( 'cptui_after_post_type_listing' );\n\t\t\t} else {\n\n\t\t\t\t/**\n\t\t\t\t * Fires when there are no registered post types to list.\n\t\t\t\t *\n\t\t\t\t * @since 1.3.0\n\t\t\t\t */\n\t\t\t\tdo_action( 'cptui_no_post_types_listing' );\n\t\t\t}\n\n\t\t\t$taxonomies = cptui_get_taxonomy_data();\n\t\t\techo '<h2 id=\"taxonomies\">' . esc_html__( 'Taxonomies', 'custom-post-type-ui' ) . '</h2>';\n\t\t\tif ( ! empty( $taxonomies ) ) {\n\t\t\t\t?>\n\t\t\t\t<p>\n\t\t\t\t<?php\n\t\t\t\tprintf(\n\t\t\t\t\t/* translators: %s: Total count of CPTUI registered taxonomies */\n\t\t\t\t\tesc_html__( 'Custom Post Type UI registered taxonomies count total: %d', 'custom-post-type-ui' ),\n\t\t\t\t\tcount( $taxonomies )\n\t\t\t\t);\n\t\t\t\t?>\n\t\t\t\t</p>\n\n\t\t\t\t<?php\n\n\t\t\t\t$taxonomy_table_heads = array(\n\t\t\t\t\t__( 'Taxonomy', 'custom-post-type-ui' ),\n\t\t\t\t\t__( 'Settings', 'custom-post-type-ui' ),\n\t\t\t\t\t__( 'Post Types', 'custom-post-type-ui' ),\n\t\t\t\t\t__( 'Labels', 'custom-post-type-ui' ),\n\t\t\t\t\t__( 'Template Hierarchy', 'custom-post-type-ui' ),\n\t\t\t\t);\n\n\t\t\t\t/**\n\t\t\t\t * Fires before the listing of registered taxonomy data.\n\t\t\t\t *\n\t\t\t\t * @since 1.1.0\n\t\t\t\t */\n\t\t\t\tdo_action( 'cptui_before_taxonomy_listing' );\n\t\t\t\t?>\n\t\t\t\t<table class=\"wp-list-table widefat taxonomy-listing\">\n\t\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tforeach ( $taxonomy_table_heads as $head ) {\n\t\t\t\t\t\t\techo '<th>' . esc_html( $head ) . '</th>';\n\t\t\t\t\t\t} ?>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t<?php\n\t\t\t\t\t$counter = 1;\n\t\t\t\t\tforeach ( $taxonomies as $taxonomy => $taxonomy_settings ) {\n\n\t\t\t\t\t\t$rowclass = ( 0 === $counter % 2 ) ? '' : 'alternate';\n\n\t\t\t\t\t\t$strings = array();\n\t\t\t\t\t\t$object_types = array();\n\t\t\t\t\t\tforeach ( $taxonomy_settings as $settings_key => $settings_value ) {\n\t\t\t\t\t\t\tif ( 'labels' === $settings_key ) {\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\tif ( is_string( $settings_value ) ) {\n\t\t\t\t\t\t\t\t$strings[ $settings_key ] = $settings_value;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif ( 'object_types' === $settings_key ) {\n\t\t\t\t\t\t\t\t\t$object_types[ $settings_key ] = $settings_value;\n\n\t\t\t\t\t\t\t\t\t// In case they are not associated from the post type settings.\n\t\t\t\t\t\t\t\t\tif ( empty( $object_types['object_types'] ) ) {\n\t\t\t\t\t\t\t\t\t\t$types = get_taxonomy( $taxonomy );\n\t\t\t\t\t\t\t\t\t\t$object_types['object_types'] = $types->object_type;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<tr class=\"<?php echo esc_attr( $rowclass ); ?>\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$edit_path = 'admin.php?page=cptui_manage_taxonomies&action=edit&cptui_taxonomy=' . $taxonomy;\n\t\t\t\t\t\t\t\t$taxonomy_link_url = ( is_network_admin() ) ? network_admin_url( $edit_path ) : admin_url( $edit_path ); ?>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<?php printf(\n\t\t\t\t\t\t\t\t\t\t'<a href=\"%s\">%s</a><br/>\n\t\t\t\t\t\t\t\t\t\t<a href=\"%s\">%s</a>',\n\t\t\t\t\t\t\t\t\t\tesc_attr( $taxonomy_link_url ),\n\t\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: Taxonomy slug */\n\t\t\t\t\t\t\t\t\t\t\tesc_html__( 'Edit %s', 'custom-post-type-ui' ),\n\t\t\t\t\t\t\t\t\t\t\tesc_html( $taxonomy )\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tesc_attr( admin_url( 'admin.php?page=cptui_tools&action=get_code#' . $taxonomy ) ),\n\t\t\t\t\t\t\t\t\t\tesc_html__( 'Get code', 'custom-post-type-ui' )\n\t\t\t\t\t\t\t\t\t); ?>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tforeach ( $strings as $key => $value ) {\n\t\t\t\t\t\t\t\t\t\tprintf( '<strong>%s:</strong> ', esc_html( $key ) );\n\t\t\t\t\t\t\t\t\t\tif ( in_array( $value, array( '1', '0' ), true ) ) {\n\t\t\t\t\t\t\t\t\t\t\techo esc_html( disp_boolean( $value ) );\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\techo ( ! empty( $value ) ) ? esc_html( $value ) : '\"\"';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\techo '<br/>';\n\t\t\t\t\t\t\t\t\t} ?>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ( ! empty( $object_types['object_types'] ) ) {\n\t\t\t\t\t\t\t\t\t\tforeach ( $object_types['object_types'] as $type ) {\n\t\t\t\t\t\t\t\t\t\t\techo esc_html( $type ) . '<br/>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} ?>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t$maybe_empty = array_filter( $taxonomy_settings['labels'] );\n\t\t\t\t\t\t\t\t\tif ( ! empty( $maybe_empty ) ) {\n\t\t\t\t\t\t\t\t\t\tforeach ( $taxonomy_settings['labels'] as $key => $value ) {\n\t\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t'%s: %s<br/>',\n\t\t\t\t\t\t\t\t\t\t\t\tesc_html( $key ),\n\t\t\t\t\t\t\t\t\t\t\t\tesc_html( $value )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t'<span aria-hidden=\"true\">—</span><span class=\"screen-reader-text\">%s</span>',\n\t\t\t\t\t\t\t\t\t\t\tesc_html__( 'No custom labels to display', 'custom-post-type-ui' )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<p><strong><?php esc_html_e( 'Archives file name examples.', 'custom-post-type-ui' ); ?></strong><br />\n\t\t\t\t\t\t\t\t\t\ttaxonomy-<?php echo esc_html( $taxonomy ); ?>-term_slug.php *<br />\n\t\t\t\t\t\t\t\t\t\ttaxonomy-<?php echo esc_html( $taxonomy ); ?>.php<br />\n\t\t\t\t\t\t\t\t\t\ttaxonomy.php<br />\n\t\t\t\t\t\t\t\t\t\tarchive.php<br />\n\t\t\t\t\t\t\t\t\t\tindex.php\n\t\t\t\t\t\t\t\t\t</p>\n\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t<?php esc_html_e( '*Replace \"term_slug\" with the slug of the actual taxonomy term.', 'custom-post-type-ui' ); ?>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<p><?php\n\t\t\t\t\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t\t\t\t\t'<a href=\"https://developer.wordpress.org/themes/basics/template-hierarchy/\">%s</a>',\n\t\t\t\t\t\t\t\t\t\t\tesc_html__( 'Template hierarchy Theme Handbook', 'custom-post-type-ui' )\n\t\t\t\t\t\t\t\t\t\t); ?></p>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$counter++;\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t</tbody>\n\t\t\t\t\t<tfoot>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tforeach ( $taxonomy_table_heads as $head ) {\n\t\t\t\t\t\t\techo '<th>' . esc_html( $head ) . '</th>';\n\t\t\t\t\t\t} ?>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</tfoot>\n\t\t\t\t</table>\n\t\t\t<?php\n\t\t\t\t/**\n\t\t\t\t * Fires after the listing of registered taxonomy data.\n\t\t\t\t *\n\t\t\t\t * @since 1.3.0\n\t\t\t\t */\n\t\t\t\tdo_action( 'cptui_after_taxonomy_listing' );\n\n\t\t\t} else {\n\n\t\t\t\t/**\n\t\t\t\t * Fires when there are no registered taxonomies to list.\n\t\t\t\t *\n\t\t\t\t * @since 1.3.0\n\t\t\t\t */\n\t\t\t\tdo_action( 'cptui_no_taxonomies_listing' );\n\t\t\t}\n\t\t\t?>\n\n\t\t</div>\n\t<?php\n}",
"function list_render()\n{\n global $scrollList, $page, $scrollList_post;\n print $scrollList->toHtml();\n print $scrollList_post;\n print $page->toFooterHtml();\n}",
"function mpcth_list_shortcode($atts, $content = null) {\r\n\t$GLOBALS['item_count'] = 0;\r\n\t$GLOBALS['items'] = '';\r\n\r\n\tdo_shortcode($content);\r\n\t\r\n\textract(shortcode_atts(array(), $atts,$content));\r\n\r\n\t$return = '<ul class=\"mpcth-sc-list\">';\r\n\r\n\tif(is_array($GLOBALS['items'])) {\r\n\t\tforeach($GLOBALS['items'] as $item) {\r\n\t\t\t$return .= '<li class=\"mpcth-sc-list-item\" style=\"color: ' . $item['color'] . '\"><span class=\"mpcth-sc-icon-' . $item['type'] . '\" style=\"color: ' . $item['icon_color'] . '\"></span>' . $item['content'] . '</li>';\r\n\t\t}\t\r\n\t}\r\n\t\r\n\t$return .= '</ul>';\r\n\r\n\t$return = parse_shortcode_content($return);\r\n\treturn $return;\r\n}",
"function my_the_content_filter($content) {\n \n //Get from post_meta table\n $meta = get_post_meta( get_the_ID() );\n if(!empty($meta['contributer'][0])){\n $uid=explode(\",\",$meta['contributer'][0]);\n \n $content.='<div><h3>Contributers</h3></div>';\n $content.='<ul style=\"list-style:none;\">';\n \n foreach($uid as $auth){\n\t $user_data=get_userdata( $auth );\n\t//get_avatar use for get user image from gravatar\n $getu=get_the_author_meta( $user_data->ID );\n $content.='<li><a href=\"'.get_author_posts_url( $user_data->ID ).'\"><span>'.get_avatar($user_data->ID).\"</span><p>\".$user_data->user_nicename.'</p></a></li>';\n }\n $content.='</ul>';\n }\n return $content;\n}",
"function getElementListTemplate();",
"function expandList($atts, $content=null) {\n extract(shortcode_atts(array(\n 'title' => ''\n ), $atts));\n\n return do_shortcode(' <div class=\"row\">\n <div class=\"one_whole\">\n <div class=\"faqunit collapser\">\n <div class=\"triangle triangle\">\n <div class=\"img\"></div>\n </div>\n <div class=\"text\">\n <h4>'.$title.'</h4>\n <div class=\"collapsee\" style=\"display: none;\">'.$content.'</div>\n </div>\n </div>\n </div>\n </div>');\n }",
"function widget_bp_popular_members($args) {\r\n extract($args);\r\n?>\r\n <?php echo $before_widget; ?>\r\n <?php echo $before_title\r\n . 'Popular Members'\r\n . $after_title; ?>\r\n\t\t\t<?php \r\n\t\t\t\t/* look for the popular members and display a maximum of 6 \r\n\t\t\t\t change the number if you like */\r\n\t\t\t\tif ( bp_has_members( 'type=popular&max=8' ) ) : ?>\r\n\t\t\t\t\t<?php while ( bp_members() ) : bp_the_member(); ?>\r\n <ul id=\"members-list\" class=\"item-list\">\r\n <li>\r\n <div class=\"item-avatar\">\r\n <a href=\"<?php bp_member_permalink() ?>\"><?php bp_member_avatar('type=full&width=50&height=50') ?></a>\r\n </div>\r\n \r\n <div class=\"item\">\r\n <div class=\"item-title\">\r\n <a href=\"<?php bp_member_permalink() ?>\"><?php bp_member_name() ?></a>\r\n <?php if ( bp_get_member_latest_update() ) : ?>\r\n <span class=\"update\"> - <?php bp_member_latest_update( 'length=10' ) ?></span>\r\n <?php endif; ?>\r\n </div>\r\n <div class=\"item-meta\"><span class=\"activity\"><?php bp_member_last_active() ?></span></div>\r\n \r\n <?php do_action( 'bp_directory_members_item' ) ?>\r\n </div> \r\n </li>\r\n </ul>\r\n\t\t\t\t\t<?php endwhile; ?>\r\n\t\t\t<?php endif; ?>\r\n\t\t\t<div class=\"clear\"></div>\r\n <?php echo $after_widget; ?>\r\n<?php\r\n}",
"function bp_groups_list($atts, $content = \"\")\r\n\t{\r\n\t\treturn $this->get_template_file($atts, 'bp-groups-list.php');\r\n\t}",
"function shortcode( $atts , $content=null ) {\n\t\t// email\n\t\t// fields\n\t\t$atts = extract(wp_parse_args( $atts, array(\n\t\t\t'capability' => '',\n\t\t\t'class' => 'memberlist',\n\t\t)));\n\n\t\tif ( is_array($class) )\n\t\t\t$class = implode(' ',$class);\n\t\t$fields = $this->get_fields();\n\t\t$users = get_users( );\n\t\tif ( ! get_option('memberlist_require_login') || is_user_logged_in() ) {\n\t\t\tob_start();\n\t\t\t?><table class=\"<?php echo $class ?>\"><?php\n\t\t\t\t?><thead><?php\n\t\t\t\t\t?><tr><?php\n\t\t\t\t\t\t// before\n\t\t\t\t\t\tforeach ( $fields as $key => $field ) {\n\t\t\t\t\t\t\t$this->print_field_head( $key , $field , 'before' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?><th><?php \n\t\t\t\t\t\t_e( 'Name' ) ;\n\t\t\t\t\t\t?>, <?php\n\t\t\t\t\t\t _e( 'Email' ); ?></th><?php\n\t\t\t\t\t\tforeach ( $fields as $key => $field ) {\n\t\t\t\t\t\t\t$this->print_field_head( $key , $field , 'after' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// after\n\t\t\t\t\t?></tr><?php\n\t\t\t\t?></thead><?php\n\t\t\t\t?><tbody><?php\n\t\t\t\tforeach ( $users as $user ) {\n\t\t\t\t\t?><tr><?php\n\t\t\t\t\t\tif ( $capability && ! $user->has_cap( $capability ) )\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tforeach ( $fields as $key => $field ) {\n\t\t\t\t\t\t\t$this->print_field( $key , $field , $user , 'before' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t?><td><?php\n\t\t\t\t\t\t\tprintf( '%s %s' , $user->first_name , $user->last_name );\n\t\t\t\t\t\t\tprintf( '<br /><a href=\"mailto:%s\">%s</a>' , $user->user_email, $user->user_email );\n\t\t\t\t\t\t?></td><?php\n\t\t\t\t\t\tforeach ( $fields as $key => $field ) {\n\t\t\t\t\t\t\t$this->print_field( $key , $field , $user , 'after' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t?></tr><?php\n\t\t\t\t}\n\t\t\t\t?></tbody><?php\n\t\t\t?></table><?php\n\t\t\t$ret = ob_get_clean();\n\t\t} else {\n\t\t\tif ( ! is_user_logged_in() ) \n\t\t\t\t$ret = sprintf(__('Please <a href=\"%s\">login</a>','wp-memberlist'),wp_login_url());\n\t\t\telse \n\t\t\t\t$ret = __('Insufficient Privileges');\n\t\t}\n\t\treturn $ret;\n\t}",
"function pyis_dpd_helpscout_do_field_list( $args = array() ) {\n\tpyis_dpd_helpscout_fieldhelpers()->fields->do_field_list( $args['name'], $args );\n}",
"function tfuse_list($atts, $content = null)\n{\n extract( shortcode_atts(array('type' => ''), $atts) );\n \n switch($type)\n {\n case 'arrows': $class = 'list-caret-right'; break;\n case 'checklist': $class = 'list-check'; break;\n case 'remove': $class = 'list-remove'; break;\n case 'links': $class = 'list-external-link'; break;\n case 'chevron': $class = 'list-chevron-sign-right'; break;\n case 'thumbs': $class = 'list-thumbs-up'; break;\n case 'music': $class = 'list-music'; break;\n case 'questions': $class = 'list-question-sign'; break;\n case 'download': $class = 'list-download'; break;\n case 'text': $class = 'list-file-text-alt'; break;\n case 'hand': $class = 'list-hand-right'; break;\n default: $class = 'list-ok';break;\n }\n \n \n return '<div class=\"'.$class.'\">' . do_shortcode($content) . '</div>';\n}",
"function imic_list($atts, $content = null) {\n extract(shortcode_atts(array(\n \"type\" => '',\n \"extra\" => '',\n \"icon\" => ''\n ), $atts));\n if ($type == 'ordered') {\n $output = '<ol>' . do_shortcode($content) . '</ol>';\n } else if ($type == 'desc') {\n $output = '<dl>' . do_shortcode($content) . '</dl>';\n } else {\n $output = '<ul class=\"chevrons ' . $type . ' ' . $extra . '\">' . do_shortcode($content) . '</ul>';\n }\n return $output;\n}",
"function imic_staff($atts, $content = null) {\n extract(shortcode_atts(array(\n \"number\" => \"\",\n \"order\" => \"\",\n \"category\" => \"\",\n \"column\" => \"\",\n \"excerpt_length\" => \"\"\n ), $atts));\n $output = '';\n if ($order == \"no\") {\n $orderby = \"ID\";\n $sort_order = \"DESC\";\n } else {\n $orderby = \"menu_order\";\n $sort_order = \"ASC\";\n }\n\tif($excerpt_length == ''){\n\t\t$excerpt_length = 30;\n\t}\n\tif($column == 3){\n\t\t $column = 4;\t\n\t }elseif($column == 4){\n\t\t $column = 3;\t\n\t }elseif($column == 2){\n\t\t $column = 6;\t\n\t }elseif($column == 1){\n\t\t $column = 12;\t\n\t }else{\n\t\t $column = 4;\n\t }\n query_posts(array(\n 'post_type' => 'staff',\n 'staff-category' => $category,\n 'posts_per_page' => $number,\n 'orderby' => $orderby,\n 'order' => $sort_order,\n ));\n if (have_posts()):\n\t$output .='<div class=\"row\">';\n while (have_posts()):the_post();\n $custom = get_post_custom(get_the_ID());\n $output .='<div class=\"col-md-' . $column . ' col-sm-' . $column . '\">\n <div class=\"grid-item staff-item\"> \n <div class=\"grid-item-inner\">';\n if (has_post_thumbnail()):\n $output .='<div class=\"media-box\"><a href=\"' . get_permalink(get_the_ID()) . '\">';\n $output .= get_the_post_thumbnail(get_the_ID(), 'full');\n $output .= '</a></div>';\n endif;\n $job_title = get_post_meta(get_the_ID(), 'imic_staff_job_title', true);\n $job = '';\n if (!empty($job_title)) {\n $job = '<div class=\"meta-data\">' . $job_title . '</div>';\n }\n $output .= '<div class=\"grid-content\">\n <h3> <a href=\"' . get_permalink(get_the_ID()) . '\">' . get_the_title() . '</a></h3>';\n $output .= $job;\n $output .= imic_social_staff_icon(); $excerpt_length;\n $description = imic_excerpt($excerpt_length);\n\t\t\tif($excerpt_length != 0){\n\t\t\t\tif (!empty($description)) {\n\t\t\t\t\t$output .= $description;\n\t\t\t\t}\n\t\t\t}\n\t\t\tglobal $imic_options;\n\t\t\tif($excerpt_length != 0){\n\t\t\t\t$staff_read_more_text = $imic_options['staff_read_more_text'];\n\t\t\t\tif ($imic_options['switch_staff_read_more'] == 1 && $imic_options['staff_read_more'] == '0') {\n\t\t\t\t\t$output .='<p><a href=\"' . get_permalink() . '\" class=\"btn btn-default\">' . $staff_read_more_text . '</a></p>';\n\t\t\t\t} elseif ($imic_options['switch_staff_read_more'] == 1 && $imic_options['staff_read_more'] == '1') {\n\t\t\t\t\t$output .='<p><a href=\"' . get_permalink() . '\">' . $staff_read_more_text . '</a></p>';\n\t\t\t\t}\n\t\t\t}\n $output .='</div></div>\n </div>\n </div>';\n endwhile;\n\t$output .='</div>';\n endif;\n wp_reset_query();\n return $output;\n}",
"function colleges_search_people_localdata( $localdata, $posts, $atts ) {\n\t$data = json_decode( $localdata, true ) ?: array();\n\n\tif ( !empty( $data ) && $atts['layout'] === 'people' ) {\n\t\tforeach ( $data as $index => $item ) {\n\t\t\tif ( isset( $item['id'] ) && get_post_type( $item['id'] ) === 'person' ) {\n\t\t\t\t$person = get_post( $item['id'] );\n\t\t\t\t$name = get_person_name( $person );\n\t\t\t\t$job_title = get_field( 'person_jobtitle', $person->ID );\n\t\t\t\t$job_title = $job_title ? strip_tags( $job_title ) : false; // Fix stupid job title hackery\n\n\t\t\t\t// Update person datum matches\n\t\t\t\t$matches = array( $name );\n\t\t\t\tif ( $job_title ) {\n\t\t\t\t\t$matches[] = $job_title;\n\t\t\t\t}\n\n\t\t\t\t$data[$index]['matches'] = array_merge( $item['matches'], $matches );\n\n\t\t\t\t// Update displayKey for each person\n\t\t\t\t$display = $name;\n\t\t\t\tif ( $job_title ) {\n\t\t\t\t\t$display .= ' ' . $job_title;\n\t\t\t\t}\n\n\t\t\t\t$data[$index]['display'] = $display;\n\n\t\t\t\t// Add extra template data\n\t\t\t\tob_start();\n\t?>\n\t\t\t\t<div class=\"media\">\n\t\t\t\t\t<?php echo get_person_thumbnail( $person ); ?>\n\t\t\t\t\t<div class=\"media-body ml-4\">\n\t\t\t\t\t\t<?php echo $name; ?>\n\t\t\t\t\t\t<?php if ( $job_title ): ?>\n\t\t\t\t\t\t<div class=\"small font-italic\">\n\t\t\t\t\t\t\t<?php echo $job_title; ?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t<?php\n\t\t\t\t$tmpl_suggestion = ob_get_clean();\n\t\t\t\t$data[$index]['template']['suggestion'] = $tmpl_suggestion;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn json_encode( $data );\n}",
"function theme_redhen_org_add_list($variables) {\n $content = $variables['content'];\n $output = '';\n\n if ($content) {\n $output = '<dl class=\"node-type-list\">';\n foreach ($content as $item) {\n $output .= '<dt>' . l($item['title'], $item['href'], $item['localized_options']) . '</dt>';\n $output .= '<dd>' . filter_xss_admin($item['description']) . '</dd>';\n }\n $output .= '</dl>';\n }\n else {\n $output = '<p>' . t('You have not created any organization types yet. Go to the <a href=\"@create-org-types\">organization type creation page</a> to add a new content type.', array('@create-org-types' => url('admin/structure/redhen/org-types'))) . '</p>';\n }\n return $output;\n}",
"function get2columnsList() {\n $return = '';\n\n $return .= '<section class=\"content-panel two-column ' . get_sub_field('custom_class') . '\">';\n\t if(get_sub_field('column_header_text')){\n $return .= '<div class=\"two-column-header text-center\">\n\t\t\t\t\t\t <h2>' . get_sub_field('column_header_text') . '</h2>\n\t\t\t\t\t </div>';\n\t\t\t\t\t }\n $return .= '<div class=\"container-fluid\">\n\t\t\t\t\t <div class=\"row\">';\n\t\n if (have_rows('column_contents')) {\n // loop through the rows of data\n while (have_rows('column_contents')) {\n the_row();\n\t\t\t$return .= '<div class=\"column col-sm-6 col-xs-12\" ';\n\t\t\t\tif(get_sub_field('column_background')) { \n\t\t\t\t\t$return .= 'style=\"background-image: url(' . get_sub_field('column_background')['url'] . ');\"';\n\t\t\t\t} \n\t\t\t$return .= '\">\n\t\t\t\t\t\t\t <div class=\"column-info\">\n\t\t\t\t\t\t\t\t <div class=\"column-title\">' . get_sub_field('column_title') . '</div>';\n\t\t\t\t\t\t\t\t\tif (have_rows('column_list')) {\n\t\t\t\t\t\t\t\t\t\t$return .= '<ul class=\"column-list\">';\n\t\t\t\t\t\t\t\t\t\t\twhile (have_rows('column_list')) {\n\t\t\t\t\t\t\t\t\t\t\t the_row();\n\t\t\t\t\t\t\t\t\t\t\t\t$return .= '<li class=\"column-list-item\">' . get_sub_field('column_list_item') . '</li>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$return .= '</ul>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t$return .= '</div>\n\t\t\t\t\t\t\t</div>\t \n\t\t\t';\n\t\t} \n }\n $return .= '</div>\n\t </div>';\n\t\n\tif(get_sub_field('column_footer_text')) {\n\t\t$return .= '<a class=\"btn universal-btn-red\" href=\"' . get_sub_field('column_footer_link') . '\">' . get_sub_field('column_footer_text') . '</a>';\n\t}\n\t\n\t$return .= '</section>'; \n return $return;\n}",
"function dashboard_widget_blorm_followerlist() {\n require_once PLUGIN_BLORM_PLUGIN_DIR . '/templates/blorm_followerlist.php';\n}"
] | [
"0.67481154",
"0.66771805",
"0.6250306",
"0.6230015",
"0.6218155",
"0.610664",
"0.6073643",
"0.5841345",
"0.57871443",
"0.5747331",
"0.5738836",
"0.5713164",
"0.57022274",
"0.56707156",
"0.56547374",
"0.561805",
"0.5601475",
"0.5584345",
"0.55815816",
"0.557498",
"0.5543205",
"0.55354196",
"0.552031",
"0.55106825",
"0.5509757",
"0.550776",
"0.54848313",
"0.5470724",
"0.54700106",
"0.54649645"
] | 0.72402084 | 0 |
Modifies searchable values for each person in a 'people' post list search. | function colleges_search_people_localdata( $localdata, $posts, $atts ) {
$data = json_decode( $localdata, true ) ?: array();
if ( !empty( $data ) && $atts['layout'] === 'people' ) {
foreach ( $data as $index => $item ) {
if ( isset( $item['id'] ) && get_post_type( $item['id'] ) === 'person' ) {
$person = get_post( $item['id'] );
$name = get_person_name( $person );
$job_title = get_field( 'person_jobtitle', $person->ID );
$job_title = $job_title ? strip_tags( $job_title ) : false; // Fix stupid job title hackery
// Update person datum matches
$matches = array( $name );
if ( $job_title ) {
$matches[] = $job_title;
}
$data[$index]['matches'] = array_merge( $item['matches'], $matches );
// Update displayKey for each person
$display = $name;
if ( $job_title ) {
$display .= ' ' . $job_title;
}
$data[$index]['display'] = $display;
// Add extra template data
ob_start();
?>
<div class="media">
<?php echo get_person_thumbnail( $person ); ?>
<div class="media-body ml-4">
<?php echo $name; ?>
<?php if ( $job_title ): ?>
<div class="small font-italic">
<?php echo $job_title; ?>
</div>
<?php endif; ?>
</div>
</div>
<?php
$tmpl_suggestion = ob_get_clean();
$data[$index]['template']['suggestion'] = $tmpl_suggestion;
}
}
}
return json_encode( $data );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function person_select_field(array $field)\n{\n $id = isset($field['id']) ? $field['id'] : ('person-select-' . mt_rand(1E5, 1E6 - 1));\n\n $multiple = !empty($field['multiple']);\n $sortable = $multiple && !empty($field['sortable']);\n\n $name = $field['name'] . ($multiple ? '[]' : '');\n $value = array();\n\n if (isset($field['value'])) {\n $value = array_filter(array_map('intval', (array) $field['value']), 'intval');\n }\n\n /** @var WP_Post[] $people */\n if (count($value)) {\n $people = get_posts(array(\n 'post_type' => array('person'),\n 'post_status' => 'publish',\n 'nopaging' => true,\n 'post__in' => $value,\n ));\n } else {\n $people = array();\n }\n\n $settings = array(\n 'multiple' => $multiple,\n 'sortable' => $sortable,\n\n )\n?>\n<div class=\"person-select\" id=\"<?php esc_attr_e($id) ?>\">\n <div class=\"person-select__value-inputs\">\n <?php foreach ($value as $val): ?>\n <input type=\"hidden\" name=\"<?php esc_attr_e($name) ?>\" value=\"<?php esc_attr_e($val) ?>\" />\n <?php endforeach ?>\n </div>\n <div class=\"person-select__selected-items\">\n <?php foreach ($people as $person): ?>\n <?php echo get_post_meta($person->ID, 'person__first_name', true) ?>\n <?php echo get_post_meta($person->ID, 'person__last_name', true) ?>\n <?php echo ____wp_get_post_thumbnail_url($person->ID) ?>\n <?php endforeach ?>\n </div>\n <div class=\"person-select__search\">\n <input type=\"text\" class=\"person-select__search-input\" />\n <button class=\"person-select__search-button button button-large button-primary\" type=\"button\" disabled><?php esc_html_e('Add') ?></button>\n </div>\n</div>\n<script>\njQuery(function ($) {\n var closeTime;\n var selected = [];\n var field = $('.person-select#<?php esc_attr_e($id) ?>');\n var sortable = <?php echo json_encode($sortable) ?>;\n var multiple = <?php echo json_encode($multiple) ?>;\n\n var searchInput = field.find('.person-select__search-input');\n var searchButton = field.find('.person-select__search-button');\n\n if (sortable) {\n field.addClass('is-sortable');\n field.find('.person-select__selected-items').sortable({items: '.xxx'});\n }\n\n if (multiple) {\n field.addClass('is-multiple');\n }\n\n var autocomplete = searchInput.autocomplete({\n source: function (request, response) {\n $.ajax({\n url: '<?php echo admin_url('admin-ajax.php') ?>',\n dataType: 'json',\n data: {\n action: 'person_search',\n s: request.term\n },\n success: function (data) {\n response(data);\n }\n });\n },\n open: function (event, ui) {\n closeTime = null;\n },\n close: function (event, ui) {\n closeTime = event.timeStamp;\n },\n focus: function (event, ui) {\n event.preventDefault();\n searchInput.val(ui.item.full_name);\n },\n select: function(event, ui) {\n event.preventDefault();\n\n if (!multiple && selected.length) {\n return;\n }\n\n for (var i = 0; i < selected.length; ++i) {\n if (selected[i] === ui.item.ID) {\n searchInput.val('');\n searchButton.prop('disabled', true);\n return;\n }\n }\n selected.push(ui.item.ID);\n\n if (!multiple) {\n field.find('.person-select__value-inputs').empty();\n }\n\n var valueInput = $('<input type=\"hidden\" />').attr('name', '<?php echo esc_js($name) ?>').val(ui.item.ID);\n field.find('.person-select__value-inputs').append(valueInput);\n field.find('.person-select__selected-items').append(\n $('<div class=\"xxx\" />').attr('data-id', ui.item.ID)\n .append($('<img/>').attr('src', ui.item.thumbnail_url))\n .append($('<div/>').text(ui.item.full_name))\n .append($('<button type=\"button\" />').text('DELETE').on('click', function (e) {\n e.preventDefault();\n selected.splice(selected.indexOf(ui.item.ID), 1);\n valueInput.remove();\n valueInput = null;\n $(this).closest('.xxx').remove();\n }))\n );\n searchInput.val('');\n searchButton.prop('disabled', true);\n\n if (!multiple) {\n field.find('person-select__search').hide();\n }\n return false;\n },\n }).autocomplete('instance');\n\n searchInput.attr('autocomplete', Math.random().toFixed(16));\n searchInput.on('keydown keyup keypress', function (e) {\n console.log(e.type, e.key, e.which);\n if (e.which === 13) {\n e.preventDefault();\n return false;\n }\n });\n\n autocomplete._renderItem = function (ul, item) {\n return $('<li>')\n .append('<div>' + item.full_name + '<br><img src=\"' + (item.thumbnail_url || '') + '\" alt=\"\" /></div>')\n .appendTo(ul);\n };\n});\n</script>\n<?php\n}",
"protected function lstPeople_Update() {\n\t\t\tif ($this->lstPeople) {\n\t\t\t\t$this->objCheckingAccountLookup->UnassociateAllPeople();\n\t\t\t\t$objSelectedListItems = $this->lstPeople->SelectedItems;\n\t\t\t\tif ($objSelectedListItems) foreach ($objSelectedListItems as $objListItem) {\n\t\t\t\t\t$this->objCheckingAccountLookup->AssociatePerson(Person::Load($objListItem->Value));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function filter_posts( $params ) {\n global $wpdb;\n\n $eboy = $params['eboy'];\n $selected_values = $params['selected_values'];\n $selected_values = is_array( $selected_values ) ? $selected_values[0] : $selected_values;\n $selected_values = stripslashes( $selected_values );\n\n if ( empty( $selected_values ) ) {\n return 'continue';\n }\n\n $sql = \"\n SELECT DISTINCT post_id FROM {$wpdb->prefix}eboywp_index\n WHERE eboy_name = %s AND eboy_display_value LIKE %s\";\n\n $sql = $wpdb->prepare( $sql, $eboy['name'], '%' . $selected_values . '%' );\n return eboywp_sql( $sql, $eboy );\n }",
"function setValuesByPost()\n\t{\n\t foreach($this->items as $item)\n\t\t{\n\t\t\t$item->setValueByArray($_POST);\n\t\t}\n\t}",
"function update_search($data)\n\t{\n\t\tforeach($data as $key => $data)\n\t\t{\n\t\t\t$this->EE->db->query($this->EE->db->update_string($this->addon_short_name.'_saved_searches', $data, \"rule_id = \" . $this->EE->db->escape_str($data['rule_id'])));\n\t\t}\n\t}",
"protected function populate_editable_post_types() {\n\t\t$post_types = get_post_types(\n\t\t\tarray(\n\t\t\t\t'public' => true,\n\t\t\t\t'exclude_from_search' => false,\n\t\t\t),\n\t\t\t'object'\n\t\t);\n\n\t\t$this->all_posts = array();\n\t\t$this->own_posts = array();\n\n\t\tif ( is_array( $post_types ) && $post_types !== array() ) {\n\t\t\tforeach ( $post_types as $post_type ) {\n\t\t\t\tif ( ! current_user_can( $post_type->cap->edit_posts ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( current_user_can( $post_type->cap->edit_others_posts ) ) {\n\t\t\t\t\t$this->all_posts[] = esc_sql( $post_type->name );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->own_posts[] = esc_sql( $post_type->name );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function applySearch();",
"function RestoreFilterList() {\n\n\t\t// Return if not reset filter\n\t\tif (@$_POST[\"cmd\"] <> \"resetfilter\")\n\t\t\treturn FALSE;\n\t\t$filter = json_decode(ew_StripSlashes(@$_POST[\"filter\"]), TRUE);\n\t\t$this->Command = \"search\";\n\n\t\t// Field personID\n\t\t$this->personID->AdvancedSearch->SearchValue = @$filter[\"x_personID\"];\n\t\t$this->personID->AdvancedSearch->SearchOperator = @$filter[\"z_personID\"];\n\t\t$this->personID->AdvancedSearch->SearchCondition = @$filter[\"v_personID\"];\n\t\t$this->personID->AdvancedSearch->SearchValue2 = @$filter[\"y_personID\"];\n\t\t$this->personID->AdvancedSearch->SearchOperator2 = @$filter[\"w_personID\"];\n\t\t$this->personID->AdvancedSearch->Save();\n\n\t\t// Field personName\n\t\t$this->personName->AdvancedSearch->SearchValue = @$filter[\"x_personName\"];\n\t\t$this->personName->AdvancedSearch->SearchOperator = @$filter[\"z_personName\"];\n\t\t$this->personName->AdvancedSearch->SearchCondition = @$filter[\"v_personName\"];\n\t\t$this->personName->AdvancedSearch->SearchValue2 = @$filter[\"y_personName\"];\n\t\t$this->personName->AdvancedSearch->SearchOperator2 = @$filter[\"w_personName\"];\n\t\t$this->personName->AdvancedSearch->Save();\n\n\t\t// Field lastName\n\t\t$this->lastName->AdvancedSearch->SearchValue = @$filter[\"x_lastName\"];\n\t\t$this->lastName->AdvancedSearch->SearchOperator = @$filter[\"z_lastName\"];\n\t\t$this->lastName->AdvancedSearch->SearchCondition = @$filter[\"v_lastName\"];\n\t\t$this->lastName->AdvancedSearch->SearchValue2 = @$filter[\"y_lastName\"];\n\t\t$this->lastName->AdvancedSearch->SearchOperator2 = @$filter[\"w_lastName\"];\n\t\t$this->lastName->AdvancedSearch->Save();\n\n\t\t// Field nationalID\n\t\t$this->nationalID->AdvancedSearch->SearchValue = @$filter[\"x_nationalID\"];\n\t\t$this->nationalID->AdvancedSearch->SearchOperator = @$filter[\"z_nationalID\"];\n\t\t$this->nationalID->AdvancedSearch->SearchCondition = @$filter[\"v_nationalID\"];\n\t\t$this->nationalID->AdvancedSearch->SearchValue2 = @$filter[\"y_nationalID\"];\n\t\t$this->nationalID->AdvancedSearch->SearchOperator2 = @$filter[\"w_nationalID\"];\n\t\t$this->nationalID->AdvancedSearch->Save();\n\n\t\t// Field mobilePhone\n\t\t$this->mobilePhone->AdvancedSearch->SearchValue = @$filter[\"x_mobilePhone\"];\n\t\t$this->mobilePhone->AdvancedSearch->SearchOperator = @$filter[\"z_mobilePhone\"];\n\t\t$this->mobilePhone->AdvancedSearch->SearchCondition = @$filter[\"v_mobilePhone\"];\n\t\t$this->mobilePhone->AdvancedSearch->SearchValue2 = @$filter[\"y_mobilePhone\"];\n\t\t$this->mobilePhone->AdvancedSearch->SearchOperator2 = @$filter[\"w_mobilePhone\"];\n\t\t$this->mobilePhone->AdvancedSearch->Save();\n\n\t\t// Field nationalNumber\n\t\t$this->nationalNumber->AdvancedSearch->SearchValue = @$filter[\"x_nationalNumber\"];\n\t\t$this->nationalNumber->AdvancedSearch->SearchOperator = @$filter[\"z_nationalNumber\"];\n\t\t$this->nationalNumber->AdvancedSearch->SearchCondition = @$filter[\"v_nationalNumber\"];\n\t\t$this->nationalNumber->AdvancedSearch->SearchValue2 = @$filter[\"y_nationalNumber\"];\n\t\t$this->nationalNumber->AdvancedSearch->SearchOperator2 = @$filter[\"w_nationalNumber\"];\n\t\t$this->nationalNumber->AdvancedSearch->Save();\n\n\t\t// Field passportNumber\n\t\t$this->passportNumber->AdvancedSearch->SearchValue = @$filter[\"x_passportNumber\"];\n\t\t$this->passportNumber->AdvancedSearch->SearchOperator = @$filter[\"z_passportNumber\"];\n\t\t$this->passportNumber->AdvancedSearch->SearchCondition = @$filter[\"v_passportNumber\"];\n\t\t$this->passportNumber->AdvancedSearch->SearchValue2 = @$filter[\"y_passportNumber\"];\n\t\t$this->passportNumber->AdvancedSearch->SearchOperator2 = @$filter[\"w_passportNumber\"];\n\t\t$this->passportNumber->AdvancedSearch->Save();\n\n\t\t// Field fatherName\n\t\t$this->fatherName->AdvancedSearch->SearchValue = @$filter[\"x_fatherName\"];\n\t\t$this->fatherName->AdvancedSearch->SearchOperator = @$filter[\"z_fatherName\"];\n\t\t$this->fatherName->AdvancedSearch->SearchCondition = @$filter[\"v_fatherName\"];\n\t\t$this->fatherName->AdvancedSearch->SearchValue2 = @$filter[\"y_fatherName\"];\n\t\t$this->fatherName->AdvancedSearch->SearchOperator2 = @$filter[\"w_fatherName\"];\n\t\t$this->fatherName->AdvancedSearch->Save();\n\n\t\t// Field gender\n\t\t$this->gender->AdvancedSearch->SearchValue = @$filter[\"x_gender\"];\n\t\t$this->gender->AdvancedSearch->SearchOperator = @$filter[\"z_gender\"];\n\t\t$this->gender->AdvancedSearch->SearchCondition = @$filter[\"v_gender\"];\n\t\t$this->gender->AdvancedSearch->SearchValue2 = @$filter[\"y_gender\"];\n\t\t$this->gender->AdvancedSearch->SearchOperator2 = @$filter[\"w_gender\"];\n\t\t$this->gender->AdvancedSearch->Save();\n\n\t\t// Field locationLevel1\n\t\t$this->locationLevel1->AdvancedSearch->SearchValue = @$filter[\"x_locationLevel1\"];\n\t\t$this->locationLevel1->AdvancedSearch->SearchOperator = @$filter[\"z_locationLevel1\"];\n\t\t$this->locationLevel1->AdvancedSearch->SearchCondition = @$filter[\"v_locationLevel1\"];\n\t\t$this->locationLevel1->AdvancedSearch->SearchValue2 = @$filter[\"y_locationLevel1\"];\n\t\t$this->locationLevel1->AdvancedSearch->SearchOperator2 = @$filter[\"w_locationLevel1\"];\n\t\t$this->locationLevel1->AdvancedSearch->Save();\n\n\t\t// Field locationLevel2\n\t\t$this->locationLevel2->AdvancedSearch->SearchValue = @$filter[\"x_locationLevel2\"];\n\t\t$this->locationLevel2->AdvancedSearch->SearchOperator = @$filter[\"z_locationLevel2\"];\n\t\t$this->locationLevel2->AdvancedSearch->SearchCondition = @$filter[\"v_locationLevel2\"];\n\t\t$this->locationLevel2->AdvancedSearch->SearchValue2 = @$filter[\"y_locationLevel2\"];\n\t\t$this->locationLevel2->AdvancedSearch->SearchOperator2 = @$filter[\"w_locationLevel2\"];\n\t\t$this->locationLevel2->AdvancedSearch->Save();\n\n\t\t// Field locationLevel3\n\t\t$this->locationLevel3->AdvancedSearch->SearchValue = @$filter[\"x_locationLevel3\"];\n\t\t$this->locationLevel3->AdvancedSearch->SearchOperator = @$filter[\"z_locationLevel3\"];\n\t\t$this->locationLevel3->AdvancedSearch->SearchCondition = @$filter[\"v_locationLevel3\"];\n\t\t$this->locationLevel3->AdvancedSearch->SearchValue2 = @$filter[\"y_locationLevel3\"];\n\t\t$this->locationLevel3->AdvancedSearch->SearchOperator2 = @$filter[\"w_locationLevel3\"];\n\t\t$this->locationLevel3->AdvancedSearch->Save();\n\n\t\t// Field locationLevel4\n\t\t$this->locationLevel4->AdvancedSearch->SearchValue = @$filter[\"x_locationLevel4\"];\n\t\t$this->locationLevel4->AdvancedSearch->SearchOperator = @$filter[\"z_locationLevel4\"];\n\t\t$this->locationLevel4->AdvancedSearch->SearchCondition = @$filter[\"v_locationLevel4\"];\n\t\t$this->locationLevel4->AdvancedSearch->SearchValue2 = @$filter[\"y_locationLevel4\"];\n\t\t$this->locationLevel4->AdvancedSearch->SearchOperator2 = @$filter[\"w_locationLevel4\"];\n\t\t$this->locationLevel4->AdvancedSearch->Save();\n\n\t\t// Field locationLevel5\n\t\t$this->locationLevel5->AdvancedSearch->SearchValue = @$filter[\"x_locationLevel5\"];\n\t\t$this->locationLevel5->AdvancedSearch->SearchOperator = @$filter[\"z_locationLevel5\"];\n\t\t$this->locationLevel5->AdvancedSearch->SearchCondition = @$filter[\"v_locationLevel5\"];\n\t\t$this->locationLevel5->AdvancedSearch->SearchValue2 = @$filter[\"y_locationLevel5\"];\n\t\t$this->locationLevel5->AdvancedSearch->SearchOperator2 = @$filter[\"w_locationLevel5\"];\n\t\t$this->locationLevel5->AdvancedSearch->Save();\n\n\t\t// Field locationLevel6\n\t\t$this->locationLevel6->AdvancedSearch->SearchValue = @$filter[\"x_locationLevel6\"];\n\t\t$this->locationLevel6->AdvancedSearch->SearchOperator = @$filter[\"z_locationLevel6\"];\n\t\t$this->locationLevel6->AdvancedSearch->SearchCondition = @$filter[\"v_locationLevel6\"];\n\t\t$this->locationLevel6->AdvancedSearch->SearchValue2 = @$filter[\"y_locationLevel6\"];\n\t\t$this->locationLevel6->AdvancedSearch->SearchOperator2 = @$filter[\"w_locationLevel6\"];\n\t\t$this->locationLevel6->AdvancedSearch->Save();\n\n\t\t// Field address\n\t\t$this->address->AdvancedSearch->SearchValue = @$filter[\"x_address\"];\n\t\t$this->address->AdvancedSearch->SearchOperator = @$filter[\"z_address\"];\n\t\t$this->address->AdvancedSearch->SearchCondition = @$filter[\"v_address\"];\n\t\t$this->address->AdvancedSearch->SearchValue2 = @$filter[\"y_address\"];\n\t\t$this->address->AdvancedSearch->SearchOperator2 = @$filter[\"w_address\"];\n\t\t$this->address->AdvancedSearch->Save();\n\n\t\t// Field convoy\n\t\t$this->convoy->AdvancedSearch->SearchValue = @$filter[\"x_convoy\"];\n\t\t$this->convoy->AdvancedSearch->SearchOperator = @$filter[\"z_convoy\"];\n\t\t$this->convoy->AdvancedSearch->SearchCondition = @$filter[\"v_convoy\"];\n\t\t$this->convoy->AdvancedSearch->SearchValue2 = @$filter[\"y_convoy\"];\n\t\t$this->convoy->AdvancedSearch->SearchOperator2 = @$filter[\"w_convoy\"];\n\t\t$this->convoy->AdvancedSearch->Save();\n\n\t\t// Field convoyManager\n\t\t$this->convoyManager->AdvancedSearch->SearchValue = @$filter[\"x_convoyManager\"];\n\t\t$this->convoyManager->AdvancedSearch->SearchOperator = @$filter[\"z_convoyManager\"];\n\t\t$this->convoyManager->AdvancedSearch->SearchCondition = @$filter[\"v_convoyManager\"];\n\t\t$this->convoyManager->AdvancedSearch->SearchValue2 = @$filter[\"y_convoyManager\"];\n\t\t$this->convoyManager->AdvancedSearch->SearchOperator2 = @$filter[\"w_convoyManager\"];\n\t\t$this->convoyManager->AdvancedSearch->Save();\n\n\t\t// Field followersName\n\t\t$this->followersName->AdvancedSearch->SearchValue = @$filter[\"x_followersName\"];\n\t\t$this->followersName->AdvancedSearch->SearchOperator = @$filter[\"z_followersName\"];\n\t\t$this->followersName->AdvancedSearch->SearchCondition = @$filter[\"v_followersName\"];\n\t\t$this->followersName->AdvancedSearch->SearchValue2 = @$filter[\"y_followersName\"];\n\t\t$this->followersName->AdvancedSearch->SearchOperator2 = @$filter[\"w_followersName\"];\n\t\t$this->followersName->AdvancedSearch->Save();\n\n\t\t// Field status\n\t\t$this->status->AdvancedSearch->SearchValue = @$filter[\"x_status\"];\n\t\t$this->status->AdvancedSearch->SearchOperator = @$filter[\"z_status\"];\n\t\t$this->status->AdvancedSearch->SearchCondition = @$filter[\"v_status\"];\n\t\t$this->status->AdvancedSearch->SearchValue2 = @$filter[\"y_status\"];\n\t\t$this->status->AdvancedSearch->SearchOperator2 = @$filter[\"w_status\"];\n\t\t$this->status->AdvancedSearch->Save();\n\n\t\t// Field isolatedLocation\n\t\t$this->isolatedLocation->AdvancedSearch->SearchValue = @$filter[\"x_isolatedLocation\"];\n\t\t$this->isolatedLocation->AdvancedSearch->SearchOperator = @$filter[\"z_isolatedLocation\"];\n\t\t$this->isolatedLocation->AdvancedSearch->SearchCondition = @$filter[\"v_isolatedLocation\"];\n\t\t$this->isolatedLocation->AdvancedSearch->SearchValue2 = @$filter[\"y_isolatedLocation\"];\n\t\t$this->isolatedLocation->AdvancedSearch->SearchOperator2 = @$filter[\"w_isolatedLocation\"];\n\t\t$this->isolatedLocation->AdvancedSearch->Save();\n\n\t\t// Field birthDate\n\t\t$this->birthDate->AdvancedSearch->SearchValue = @$filter[\"x_birthDate\"];\n\t\t$this->birthDate->AdvancedSearch->SearchOperator = @$filter[\"z_birthDate\"];\n\t\t$this->birthDate->AdvancedSearch->SearchCondition = @$filter[\"v_birthDate\"];\n\t\t$this->birthDate->AdvancedSearch->SearchValue2 = @$filter[\"y_birthDate\"];\n\t\t$this->birthDate->AdvancedSearch->SearchOperator2 = @$filter[\"w_birthDate\"];\n\t\t$this->birthDate->AdvancedSearch->Save();\n\n\t\t// Field ageRange\n\t\t$this->ageRange->AdvancedSearch->SearchValue = @$filter[\"x_ageRange\"];\n\t\t$this->ageRange->AdvancedSearch->SearchOperator = @$filter[\"z_ageRange\"];\n\t\t$this->ageRange->AdvancedSearch->SearchCondition = @$filter[\"v_ageRange\"];\n\t\t$this->ageRange->AdvancedSearch->SearchValue2 = @$filter[\"y_ageRange\"];\n\t\t$this->ageRange->AdvancedSearch->SearchOperator2 = @$filter[\"w_ageRange\"];\n\t\t$this->ageRange->AdvancedSearch->Save();\n\n\t\t// Field dress1\n\t\t$this->dress1->AdvancedSearch->SearchValue = @$filter[\"x_dress1\"];\n\t\t$this->dress1->AdvancedSearch->SearchOperator = @$filter[\"z_dress1\"];\n\t\t$this->dress1->AdvancedSearch->SearchCondition = @$filter[\"v_dress1\"];\n\t\t$this->dress1->AdvancedSearch->SearchValue2 = @$filter[\"y_dress1\"];\n\t\t$this->dress1->AdvancedSearch->SearchOperator2 = @$filter[\"w_dress1\"];\n\t\t$this->dress1->AdvancedSearch->Save();\n\n\t\t// Field dress2\n\t\t$this->dress2->AdvancedSearch->SearchValue = @$filter[\"x_dress2\"];\n\t\t$this->dress2->AdvancedSearch->SearchOperator = @$filter[\"z_dress2\"];\n\t\t$this->dress2->AdvancedSearch->SearchCondition = @$filter[\"v_dress2\"];\n\t\t$this->dress2->AdvancedSearch->SearchValue2 = @$filter[\"y_dress2\"];\n\t\t$this->dress2->AdvancedSearch->SearchOperator2 = @$filter[\"w_dress2\"];\n\t\t$this->dress2->AdvancedSearch->Save();\n\n\t\t// Field signTags\n\t\t$this->signTags->AdvancedSearch->SearchValue = @$filter[\"x_signTags\"];\n\t\t$this->signTags->AdvancedSearch->SearchOperator = @$filter[\"z_signTags\"];\n\t\t$this->signTags->AdvancedSearch->SearchCondition = @$filter[\"v_signTags\"];\n\t\t$this->signTags->AdvancedSearch->SearchValue2 = @$filter[\"y_signTags\"];\n\t\t$this->signTags->AdvancedSearch->SearchOperator2 = @$filter[\"w_signTags\"];\n\t\t$this->signTags->AdvancedSearch->Save();\n\n\t\t// Field phone\n\t\t$this->phone->AdvancedSearch->SearchValue = @$filter[\"x_phone\"];\n\t\t$this->phone->AdvancedSearch->SearchOperator = @$filter[\"z_phone\"];\n\t\t$this->phone->AdvancedSearch->SearchCondition = @$filter[\"v_phone\"];\n\t\t$this->phone->AdvancedSearch->SearchValue2 = @$filter[\"y_phone\"];\n\t\t$this->phone->AdvancedSearch->SearchOperator2 = @$filter[\"w_phone\"];\n\t\t$this->phone->AdvancedSearch->Save();\n\n\t\t// Field email\n\t\t$this->_email->AdvancedSearch->SearchValue = @$filter[\"x__email\"];\n\t\t$this->_email->AdvancedSearch->SearchOperator = @$filter[\"z__email\"];\n\t\t$this->_email->AdvancedSearch->SearchCondition = @$filter[\"v__email\"];\n\t\t$this->_email->AdvancedSearch->SearchValue2 = @$filter[\"y__email\"];\n\t\t$this->_email->AdvancedSearch->SearchOperator2 = @$filter[\"w__email\"];\n\t\t$this->_email->AdvancedSearch->Save();\n\n\t\t// Field temporaryResidence\n\t\t$this->temporaryResidence->AdvancedSearch->SearchValue = @$filter[\"x_temporaryResidence\"];\n\t\t$this->temporaryResidence->AdvancedSearch->SearchOperator = @$filter[\"z_temporaryResidence\"];\n\t\t$this->temporaryResidence->AdvancedSearch->SearchCondition = @$filter[\"v_temporaryResidence\"];\n\t\t$this->temporaryResidence->AdvancedSearch->SearchValue2 = @$filter[\"y_temporaryResidence\"];\n\t\t$this->temporaryResidence->AdvancedSearch->SearchOperator2 = @$filter[\"w_temporaryResidence\"];\n\t\t$this->temporaryResidence->AdvancedSearch->Save();\n\n\t\t// Field visitsCount\n\t\t$this->visitsCount->AdvancedSearch->SearchValue = @$filter[\"x_visitsCount\"];\n\t\t$this->visitsCount->AdvancedSearch->SearchOperator = @$filter[\"z_visitsCount\"];\n\t\t$this->visitsCount->AdvancedSearch->SearchCondition = @$filter[\"v_visitsCount\"];\n\t\t$this->visitsCount->AdvancedSearch->SearchValue2 = @$filter[\"y_visitsCount\"];\n\t\t$this->visitsCount->AdvancedSearch->SearchOperator2 = @$filter[\"w_visitsCount\"];\n\t\t$this->visitsCount->AdvancedSearch->Save();\n\n\t\t// Field picture\n\t\t$this->picture->AdvancedSearch->SearchValue = @$filter[\"x_picture\"];\n\t\t$this->picture->AdvancedSearch->SearchOperator = @$filter[\"z_picture\"];\n\t\t$this->picture->AdvancedSearch->SearchCondition = @$filter[\"v_picture\"];\n\t\t$this->picture->AdvancedSearch->SearchValue2 = @$filter[\"y_picture\"];\n\t\t$this->picture->AdvancedSearch->SearchOperator2 = @$filter[\"w_picture\"];\n\t\t$this->picture->AdvancedSearch->Save();\n\n\t\t// Field registrationUser\n\t\t$this->registrationUser->AdvancedSearch->SearchValue = @$filter[\"x_registrationUser\"];\n\t\t$this->registrationUser->AdvancedSearch->SearchOperator = @$filter[\"z_registrationUser\"];\n\t\t$this->registrationUser->AdvancedSearch->SearchCondition = @$filter[\"v_registrationUser\"];\n\t\t$this->registrationUser->AdvancedSearch->SearchValue2 = @$filter[\"y_registrationUser\"];\n\t\t$this->registrationUser->AdvancedSearch->SearchOperator2 = @$filter[\"w_registrationUser\"];\n\t\t$this->registrationUser->AdvancedSearch->Save();\n\n\t\t// Field registrationDateTime\n\t\t$this->registrationDateTime->AdvancedSearch->SearchValue = @$filter[\"x_registrationDateTime\"];\n\t\t$this->registrationDateTime->AdvancedSearch->SearchOperator = @$filter[\"z_registrationDateTime\"];\n\t\t$this->registrationDateTime->AdvancedSearch->SearchCondition = @$filter[\"v_registrationDateTime\"];\n\t\t$this->registrationDateTime->AdvancedSearch->SearchValue2 = @$filter[\"y_registrationDateTime\"];\n\t\t$this->registrationDateTime->AdvancedSearch->SearchOperator2 = @$filter[\"w_registrationDateTime\"];\n\t\t$this->registrationDateTime->AdvancedSearch->Save();\n\n\t\t// Field registrationStation\n\t\t$this->registrationStation->AdvancedSearch->SearchValue = @$filter[\"x_registrationStation\"];\n\t\t$this->registrationStation->AdvancedSearch->SearchOperator = @$filter[\"z_registrationStation\"];\n\t\t$this->registrationStation->AdvancedSearch->SearchCondition = @$filter[\"v_registrationStation\"];\n\t\t$this->registrationStation->AdvancedSearch->SearchValue2 = @$filter[\"y_registrationStation\"];\n\t\t$this->registrationStation->AdvancedSearch->SearchOperator2 = @$filter[\"w_registrationStation\"];\n\t\t$this->registrationStation->AdvancedSearch->Save();\n\n\t\t// Field isolatedDateTime\n\t\t$this->isolatedDateTime->AdvancedSearch->SearchValue = @$filter[\"x_isolatedDateTime\"];\n\t\t$this->isolatedDateTime->AdvancedSearch->SearchOperator = @$filter[\"z_isolatedDateTime\"];\n\t\t$this->isolatedDateTime->AdvancedSearch->SearchCondition = @$filter[\"v_isolatedDateTime\"];\n\t\t$this->isolatedDateTime->AdvancedSearch->SearchValue2 = @$filter[\"y_isolatedDateTime\"];\n\t\t$this->isolatedDateTime->AdvancedSearch->SearchOperator2 = @$filter[\"w_isolatedDateTime\"];\n\t\t$this->isolatedDateTime->AdvancedSearch->Save();\n\n\t\t// Field description\n\t\t$this->description->AdvancedSearch->SearchValue = @$filter[\"x_description\"];\n\t\t$this->description->AdvancedSearch->SearchOperator = @$filter[\"z_description\"];\n\t\t$this->description->AdvancedSearch->SearchCondition = @$filter[\"v_description\"];\n\t\t$this->description->AdvancedSearch->SearchValue2 = @$filter[\"y_description\"];\n\t\t$this->description->AdvancedSearch->SearchOperator2 = @$filter[\"w_description\"];\n\t\t$this->description->AdvancedSearch->Save();\n\t\t$this->BasicSearch->setKeyword(@$filter[EW_TABLE_BASIC_SEARCH]);\n\t\t$this->BasicSearch->setType(@$filter[EW_TABLE_BASIC_SEARCH_TYPE]);\n\t}",
"function mm_simple_search_database_for_candidates($query_array, $query_operand, $limit)\n{\n $options = array();\n\n $filtered_array = array_filter($query_array);\n if (empty($filtered_array)) {\n register_error(elgg_echo('missions:error:no_search_values'));\n return false;\n }\n \n $value_array = array();\n foreach($filtered_array as $key => $array) {\n \t$value_array[$key] = str_replace('%', '', $array['value']);\n }\n\n // Setting options with which the query will be built.\n $options['type'] = 'object';\n $options['subtypes'] = array('education', 'experience', 'MySkill', 'portfolio');\n $options['attribute_name_value_pairs'] = $filtered_array;\n $options['attribute_name_value_pairs_operator'] = $query_operand;\n $entities = elgg_get_entities_from_attributes($options);\n\n $entity_owners = array();\n $search_feedback = array();\n $count = 0;\n foreach($entities as $entity) {\n $entity_owners[$count] = $entity->owner_guid;\n // Section for generating feedback which tells the user which search criteria the returned users met.\n if($entity->getSubtype() == 'education') {\n $identifier_string = elgg_echo('missions:school_name');\n }\n if($entity->getSubtype() == 'experience') {\n $identifier_string = elgg_echo('missions:job_title');\n }\n if($entity->getSubtype() == 'MySkill') {\n $identifier_string = elgg_echo('missions:skill');\n }\n if($entity->getSubtype() == 'portfolio') {\n $identifier_string = elgg_echo('missions:portfolio');\n }\n $search_feedback[$entity->owner_guid] .= $identifier_string . ': ' . $entity->title . ',';\n $count++;\n }\n\n $filtered_array_name = $filtered_array;\n $filtered_array_email = $filtered_array;\n foreach($filtered_array as $key => $value) {\n \t$filtered_array_name[$key]['name'] = 'name';\n \t$filtered_array_email[$key]['name'] = 'email';\n }\n $filtered_array_total = array_merge($filtered_array_name, $filtered_array_email);\n \n // Searches user names for the given string. \n $options_second['type'] = 'user';\n $options_second['limit'] = $limit;\n $options_second['attribute_name_value_pairs'] = $filtered_array_total;\n $options_second['attribute_name_value_pairs_operator'] = $query_operand;\n $users = elgg_get_entities_from_attributes($options_second);\n \n // Turns the user list into a list of GUIDs and sets the search feedback for search by name.\n foreach($users as $key => $user) {\n \t$users[$key] = $user->guid;\n \tforeach($value_array as $value) {\n \t\tif(strpos(strtolower($user->name), $value) !== false) {\n \t\t\t$search_feedback[$user->guid] .= elgg_echo('missions:name') . ': ' . $user->name . ',';\n \t\t}\n \t\tif(strpos(strtolower($user->email), $value) !== false) {\n \t\t\t$search_feedback[$user->guid] .= elgg_echo('missions:email') . ': ' . $user->email . ',';\n \t\t}\n \t}\n \t$count++;\n }\n \n $entity_owners = array_merge($entity_owners, $users);\n \n $unique_owners_entity = mm_guids_to_entities_with_opt(array_unique($entity_owners));\n $candidate_count = count($unique_owners_entity);\n\n if ($candidate_count == 0) {\n register_error(elgg_echo('missions:error:candidate_does_not_exist'));\n return false;\n } else {\n $_SESSION['candidate_count'] = $candidate_count;\n $_SESSION['candidate_search_set'] = $unique_owners_entity;\n $_SESSION['candidate_search_set_timestamp'] = time();\n $_SESSION['candidate_search_feedback'] = $search_feedback;\n $_SESSION['candidate_search_feedback_timestamp'] = time();\n\n return true;\n }\n}",
"function my_theme_listings_filter( $query ) {\n\n\tglobal $pagenow;\n\tif( is_admin() && $pagenow == 'edit.php' ) {\n\n\t\tif( isset($_GET['prop_listing_id']) && trim($_GET['prop_listing_id']) != '') {\n\n\t\t\t$value \t= sanitize_text_field( $_GET['prop_listing_id'] );\n\t\t\t$value \t= array_map( 'trim', explode( ',', $value ) );\n\n\t\t\t$query->set( 'post__in', $value );\n\t\t}\n\n\t}\n}",
"public function searchInterventionsByPost();",
"protected function processListings()\n {\n //$fields = $this->entity_info['parameters'];\n $new_results = [];\n\n if (!empty($this->list_results))\n {\n foreach ($this->list_results as $result)\n {\n $new_result = [\n 'Handle' => $result->getHandle()\n ];\n\n $new_results[] = $new_result;\n }\n\n $this->list_results = $new_results;\n }\n }",
"function modify_person($fiel, $value,$condicion)\r\n {\r\n $campo =\"\";\r\n foreach ($fiel as $i ) \r\n {\r\n $campo = $fiel[$i].\" = \".$value[$i].\",\";\r\n }\r\n $campo = substr($campo, 0,-1); \r\n $query = $this->db->query(\"UPDATE \".$this->table_name.\" SET \".$campo.\"WHERE \".$condicion.\";\" );\r\n return $query;\r\n }",
"public function process_fields($fields) {\n foreach ($fields as $key => $value) {\n if ($value['type'] == 'datalist' || $value['type'] == 'dataSelect') {\n switch ($value['search']) {\n case 'users':\n $users = User::whereNull('play_id')->\n orderby('name', 'ASC')->pluck('name', 'id');\n $result = $users;\n break;\n }\n if ($value['type'] == 'dataSelect') {\n $value['arraykeyval'] = $result;\n } else {\n $value = $result;\n }\n }\n $list[$key] = $value;\n }\n return $list;\n }",
"function mm_advanced_search_database_for_candidates($query_array, $query_operand, $limit) {\n $users_returned_by_attribute = array();\n $users_returned_by_metadata = array();\n $is_attribute_searched = false;\n $is_metadata_searched = false;\n $candidates = array();\n\n $filtered_array = array_filter($query_array);\n if (empty($filtered_array)) {\n register_error(elgg_echo('missions:error:no_search_values'));\n return false;\n }\n\n // Handles each query individually.\n foreach($filtered_array as $array) {\n // Sets up an education and experience array search for title (not metadata).\n if($array['name'] == 'title') {\n $options_attribute['type'] = 'object';\n $options_attribute['subtypes'] = $array['extra_option'];\n $options_attribute['joins'] = array('INNER JOIN ' . elgg_get_config('dbprefix') . 'objects_entity g ON (g.guid = e.guid)');\n $options_attribute['wheres'] = array(\"g.\" . $array['name'] . \" \" . $array['operand'] . \" '\" . $array['value'] . \"'\");\n $options_attribute['limit'] = $limit;\n $entities = elgg_get_entities($options_attribute);\n\n $entity_owners = array();\n $count = 0;\n foreach($entities as $entity) {\n $entity_owners[$count] = $entity->owner_guid;\n $count++;\n }\n\n // Adds the results of the query to a pool of results.\n if(empty($users_returned_by_attribute)) {\n $users_returned_by_attribute = array_unique($entity_owners);\n }\n else {\n $users_returned_by_attribute = array_unique(array_intersect($users_returned_by_attribute, $entity_owners));\n }\n // Notes that attributes have been searched during this function call.\n $is_attribute_searched = true;\n }\n \n else if(strpos($array['name'], 'opt_in') !== false || strpos($array['name'], 'department') !== false) {\n \t$options_attribute['type'] = 'user';\n \t$options_metadata['metadata_name_value_pairs'] = array(array('name' => $array['name'], 'operand' => $array['operand'], 'value' => $array['value']));\n \t$options_metadata['limit'] = $limit;\n \t$options_metadata['metadata_case_sensitive'] = false;\n \t$entities = elgg_get_entities_from_metadata($options_metadata);\n \t\n \t$entity_owners = array();\n \t$count = 0;\n \tforeach($entities as $entity) {\n \t\t$entity_owners[$count] = $entity->guid;\n \t\t$count++;\n \t}\n \t\n \t// Adds the results of the query to a pool of results.\n \tif(empty($users_returned_by_metadata)) {\n \t\t$users_returned_by_metadata = array_unique($entity_owners);\n \t}\n \telse {\n \t\t$users_returned_by_metadata = array_unique(array_intersect($users_returned_by_metadata, $entity_owners));\n \t}\n \t// Notes that metadata have been searched during this function call.\n \t$is_metadata_searched = true;\n }\n\n // Sets up metadata serach.\n else {\n $operand_temp = htmlspecialchars_decode($array['operand']);\n \n $options_metadata['type'] = 'object';\n $options_metadata['subtypes'] = $array['extra_option'];\n $options_metadata['metadata_name_value_pairs'] = array(array('name' => $array['name'], 'operand' => $operand_temp, 'value' => $array['value']));\n $options_metadata['limit'] = $limit;\n $options_metadata['metadata_case_sensitive'] = false;\n $entities = elgg_get_entities_from_metadata($options_metadata);\n\n $entity_owners = array();\n $count = 0;\n foreach($entities as $entity) {\n $entity_owners[$count] = $entity->owner_guid;\n $count++;\n }\n\n // Adds the results of the query to a pool of results.\n if(empty($users_returned_by_metadata)) {\n $users_returned_by_metadata = array_unique($entity_owners);\n }\n else {\n $users_returned_by_metadata = array_unique(array_intersect($users_returned_by_metadata, $entity_owners));\n }\n // Notes that metadata have been searched during this function call.\n $is_metadata_searched = true;\n }\n }\n\n // Intersects the results into a single pool.\n if($is_attribute_searched && $is_metadata_searched) {\n $candidates = array_intersect($users_returned_by_attribute, $users_returned_by_metadata);\n }\n // If only metadata or only attributes have been searched then intersection is unecessary.\n if($is_attribute_searched && !$is_metadata_searched) {\n $candidates = $users_returned_by_attribute;\n }\n if(!$is_attribute_searched && $is_metadata_searched) {\n $candidates = $users_returned_by_metadata;\n }\n \n $final_users = mm_guids_to_entities_with_opt(array_slice($candidates, 0, $limit));\n $final_count = count($final_users);\n\n if ($final_count == 0) {\n register_error(elgg_echo('missions:error:candidate_does_not_exist'));\n return false;\n } else {\n $_SESSION['candidate_count'] = $final_count;\n $_SESSION['candidate_search_set'] = $final_users;\n $_SESSION['candidate_search_set_timestamp'] = time();\n unset($_SESSION['candidate_search_feedback']);\n\n return true;\n }\n}",
"public function query_person_matched_records()\r\n {\r\n // \r\n // Note that the meaning of \"match the person from the query\" means \"Pipl \r\n // is convinced that these records hold data about the person you're \r\n // looking for\". \r\n // Remember that when Pipl is convinced about which person you're looking \r\n // for, the response also contains a Person object. This person is \r\n // created by merging all the fields and sources of these records. \r\n $this->records = array_filter($this->records, create_function('$rec', 'return $rec->query_params_match == 1.0;'));\r\n }",
"function get_search_suggestions($search, $limit = 25) {\n $suggestions = array();\n $pawns = $this->db->dbprefix('pawn');\n $customers = $this->db->dbprefix('customers');\n $people = $this->db->dbprefix('people');\n $this->db->from('customers');\n $this->db->join('people', 'customers.person_id=people.person_id');\n $this->db->join('pawn', 'pawn.person_id = people.person_id');\n\n $this->db->where(\"(first_name LIKE '%\" . $this->db->escape_like_str($search) . \"%' or \n\t\tlast_name LIKE '%\" . $this->db->escape_like_str($search) . \"%' or \n\t\tCONCAT(`first_name`,' ',`last_name`) LIKE '%\" . $this->db->escape_like_str($search) . \"%' or \n\t\tCONCAT(`last_name`,', ',`first_name`) LIKE '%\" . $this->db->escape_like_str($search) . \"%') and \".$pawns.\".deleted=0\");\n\n $this->db->limit($limit);\n $by_name = $this->db->get();\n\n $temp_suggestions = array();\n foreach ($by_name->result() as $row) {\n $temp_suggestions[] = $row->last_name . ', ' . $row->first_name;\n }\n\n sort($temp_suggestions);\n foreach ($temp_suggestions as $temp_suggestion) {\n $suggestions[] = array('label' => $temp_suggestion);\n }\n\n $this->db->from('customers');\n $this->db->join('people', 'customers.person_id=people.person_id');\n $this->db->join('pawn', 'pawn.person_id = people.person_id');\n $this->db->where('pawn.deleted', 0);\n $this->db->like(\"start_date\", $search);\n $this->db->limit($limit);\n $by_email = $this->db->get();\n\n $temp_suggestions = array();\n foreach ($by_email->result() as $row) {\n $temp_suggestions[] = date('d-m-Y',strtotime($row->start_date));\n }\n\n sort($temp_suggestions);\n foreach ($temp_suggestions as $temp_suggestion) {\n $suggestions[] = array('label' => $temp_suggestion);\n }\n\n $this->db->from('customers');\n $this->db->join('people', 'customers.person_id=people.person_id');\n $this->db->join('pawn', 'pawn.person_id = people.person_id');\n $this->db->where('pawn.deleted', 0);\n $this->db->like(\"phone_number\", $search);\n $this->db->limit($limit);\n $by_phone = $this->db->get();\n\n $temp_suggestions = array();\n foreach ($by_phone->result() as $row) {\n $temp_suggestions[] = $row->phone_number;\n }\n\n sort($temp_suggestions);\n foreach ($temp_suggestions as $temp_suggestion) {\n $suggestions[] = array('label' => $temp_suggestion);\n }\n\n\n $this->db->from('customers');\n $this->db->join('people', 'customers.person_id=people.person_id');\n $this->db->join('pawn', 'pawn.person_id = people.person_id');\n $this->db->where('pawn.deleted', 0);\n $this->db->like(\"amount\", $search);\n $this->db->limit($limit);\n $amount = $this->db->get();\n\n $temp_suggestions = array();\n foreach ($amount->result() as $row) {\n $temp_suggestions[] = $row->amount;\n }\n\n sort($temp_suggestions);\n foreach ($temp_suggestions as $temp_suggestion) {\n $suggestions[] = array('label' => $temp_suggestion);\n }\n\n $this->db->from('customers');\n $this->db->join('people', 'customers.person_id=people.person_id');\n $this->db->join('pawn', 'pawn.person_id = people.person_id');\n $this->db->where('pawn.deleted', 0);\n $this->db->like(\"product_name\", $search);\n $this->db->limit($limit);\n $product_name = $this->db->get();\n\n $temp_suggestions = array();\n foreach ($product_name->result() as $row) {\n $temp_suggestions[] = $row->product_name;\n }\n\n sort($temp_suggestions);\n foreach ($temp_suggestions as $temp_suggestion) {\n $suggestions[] = array('label' => $temp_suggestion);\n }\n\n //only return $limit suggestions\n if (count($suggestions > $limit)) {\n $suggestions = array_slice($suggestions, 0, $limit);\n }\n return $suggestions;\n }",
"function filter_display($data)\r\n{\r\n\t/*\r\n\tThese comments are just to show the input param format\r\n\tArray\r\n\t(\r\n\t [params] => Array\r\n\t (\r\n\t [0] => Array\r\n\t (\r\n\t [client_id] => 1\r\n\t [name] => Client 1\r\n\t [gender] => My custom malea\r\n\t [company] => My custom Client 1 Company 1\r\n\t )\r\n\r\n\t [1] => Array\r\n\t (\r\n\t [client_id] => 2\r\n\t [name] => Client 2\r\n\t [gender] => male\r\n\t [company] => Client 2 Com2pany 11\r\n\t )\r\n\t\t\t\t\r\n\t\t\t\t.......\r\n\t*/\r\n\tforeach($data[\"params\"] as &$d)\r\n\t{\r\n\t\t$d[\"gender\"] = strtoupper($d[\"gender\"]);\r\n\t}\r\n}",
"function change_search_activity_arg( $query )\n {\n /**\n * Global Search Args used in Element list and map display\n * @since 1.2.4\n */\n global $st_search_args;\n if ( !$st_search_args ) $st_search_args = $_REQUEST;\n\n if (is_admin() and empty( $_REQUEST[ 'is_search_map' ] ) and empty( $_REQUEST[ 'is_search_page' ] )) return $query;\n\n $post_type = get_query_var( 'post_type' );\n $posts_per_page = st()->get_option( 'activity_posts_per_page', 12 );\n\n $tax_query = [];\n if ( $post_type == 'st_activity' ) {\n $query->set( 'author', '' );\n if ( !empty( $st_search_args[ 'item_name' ] ) ) {\n $query->set( 's', $st_search_args[ 'item_name' ] );\n }\n\n $query->set( 'posts_per_page', $posts_per_page );\n\n $has_tax_in_element = [];\n if ( is_array( $st_search_args ) ) {\n foreach ( $st_search_args as $key => $val ) {\n if ( strpos( $key, 'taxonomies--' ) === 0 && !empty( $val ) ) {\n $has_tax_in_element[ $key ] = $val;\n }\n }\n }\n if ( !empty( $has_tax_in_element ) ) {\n $tax_query = [];\n foreach ( $has_tax_in_element as $tax => $value ) {\n $tax_name = str_replace( 'taxonomies--', '', $tax );\n if ( !empty( $value ) ) {\n $value = explode( ',', $value );\n $tax_query[] = [\n 'taxonomy' => $tax_name,\n 'terms' => $value,\n 'operator' => 'IN',\n ];\n }\n }\n if ( !empty( $tax_query ) ) {\n $query->set( 'tax_query', $tax_query );\n }\n }\n if ( !empty( $st_search_args[ 'taxonomy' ] ) and $tax = $st_search_args[ 'taxonomy' ] and is_array( $tax ) ) {\n foreach ( $tax as $key => $value ) {\n if ( $value ) {\n $value = explode( ',', $value );\n if ( !empty( $value ) and is_array( $value ) ) {\n foreach ( $value as $k => $v ) {\n if ( !empty( $v ) ) {\n $ids[] = $v;\n }\n }\n }\n if ( !empty( $ids ) ) {\n $tax_query[] = [\n 'taxonomy' => $key,\n 'terms' => $ids,\n //'COMPARE'=>\"IN\",\n 'operator' => 'AND',\n 'include_children' => false\n ];\n }\n $ids = [];\n }\n }\n }\n $is_featured = st()->get_option( 'is_featured_search_activity', 'off' );\n if ( !empty( $is_featured ) and $is_featured == 'on' and empty( $st_search_args[ 'st_orderby' ] ) ) {\n $query->set( 'meta_key', 'is_featured' );\n $query->set( 'orderby', 'meta_value' );\n $query->set( 'order', 'DESC' );\n }\n if ( $is_featured == 'off' and !empty( $st_search_args[ 'orderby' ] ) and empty( $st_search_args[ 'st_orderby' ] ) ) {\n //Default Sorting\n $query->set( 'orderby', 'modified' );\n $query->set( 'order', 'desc' );\n }\n /**\n * Post In and Post Order By from Element\n * @since 1.2.4\n * @author dungdt\n */\n if ( !empty( $st_search_args[ 'st_ids' ] ) ) {\n $query->set( 'post__in', explode( ',', $st_search_args[ 'st_ids' ] ) );\n $query->set( 'orderby', 'post__in' );\n }\n if ( !empty( $st_search_args[ 'st_orderby' ] ) and $st_orderby = $st_search_args[ 'st_orderby' ] ) {\n if ( $st_orderby == 'sale' ) {\n $query->set( 'meta_key', 'adult_price' );// from 1.2.0\n $query->set( 'orderby', 'meta_value_num' ); // from 1.2.0\n }\n if ( $st_orderby == 'rate' ) {\n $query->set( 'meta_key', 'rate_review' );\n $query->set( 'orderby', 'meta_value_num' );\n }\n if ( $st_orderby == 'discount' ) {\n $query->set( 'meta_key', 'discount' );\n $query->set( 'orderby', 'meta_value_num' );\n }\n if ( $st_orderby == 'featured' ) {\n $query->set( 'meta_key', 'is_featured' );\n $query->set( 'orderby', 'meta_value' );\n $query->set( 'order', 'DESC' );\n }\n }\n if ( !empty( $st_search_args[ 'sort_taxonomy' ] ) and $sort_taxonomy = $st_search_args[ 'sort_taxonomy' ] ) {\n if ( isset( $st_search_args[ \"id_term_\" . $sort_taxonomy ] ) ) {\n $id_term = $st_search_args[ \"id_term_\" . $sort_taxonomy ];\n $tax_query[] = [\n [\n 'taxonomy' => $sort_taxonomy,\n 'field' => 'id',\n 'terms' => explode( ',', $id_term ),\n 'include_children' => false\n ],\n ];\n }\n }\n if ( !empty( $meta_query ) ) {\n $query->set( 'meta_query', $meta_query );\n }\n if ( !empty( $tax_query ) ) {\n $query->set( 'tax_query', $tax_query );\n }\n }\n }",
"public function updatedSearch($value)\n {\n $this->users = User::where(\"name\", \"like\", \"%{$value}%\")->get();\n $this->showList = true;\n }",
"function findPostsBy(array $criteria);",
"function PostProcess_Friend_Data(&$item,&$updatedatas)\n {\n $this->MakeSureWeHaveRead(\"\",$item,array(\"Friend\",\"Name\",\"SortName\",\"Email\"));\n $friend=\n $this->FriendsObj()->Sql_Select_Hash\n (\n array(\"ID\" => $item[ \"Friend\" ]),\n array(\"ID\",\"Name\",\"School\",\"SortName\",\"Email\")\n );\n \n\n if (empty($item[ \"Name\" ]) || $item[ \"Name\" ]!=$friend[ \"Name\" ])\n {\n $item[ \"Name\" ]=$friend[ \"Name\" ];\n array_push($updatedatas,\"Name\");\n }\n \n if (empty($item[ \"Email\" ]) || $item[ \"Email\" ]!=$friend[ \"Email\" ])\n {\n $item[ \"Email\" ]=$friend[ \"Email\" ];\n array_push($updatedatas,\"Email\");\n }\n\n $friend[ \"SortName\" ]=$this->Html2Sort($friend[ \"School\" ].\" \".$friend[ \"Name\" ]);\n if (empty($item[ \"SortName\" ]) || $item[ \"SortName\" ]!=$friend[ \"SortName\" ])\n {\n $item[ \"SortName\" ]=$friend[ \"SortName\" ];\n array_push($updatedatas,\"SortName\");\n }\n }",
"function fn_settings_actions_general_search_objects(&$new_value, $old_value)\n{\n if ($new_value == 'N') {\n $new_value = '';\n }\n}",
"function sal_get_assistants_for_physician($post_id){\n\n $assistants_args = array( \n 'posts_per_page' => -1, \n 'offset'=> 0, \n 'post_type' => 'assistants', \n 'post_status' => 'publish',\n 'orderby' => 'date',\n 'order' => 'DESC',\n 'meta_query' => array(\n array(\n 'key' => 'physicians_assisting',\n 'value' => $post_id,\n 'compare' => 'LIKE'\n )\n )\n );\n\n $assitants = get_posts( $assistants_args );\n $assistants_query = new WP_Query($assistants_args);\n\n if( $assitants ): ?>\n <ul class=\"assistants-list\">\n <?php // loop through the rows of data\n while ($assistants_query->have_posts()) : $assistants_query->the_post(); ?>\n <li class=\"assitant-item\"><a href=\"<?php echo get_the_permalink(); ?>\" target=\"_blank\"><?php the_title(); ?></a></li>\n <?php endwhile; ?>\n </ul>\n <?php endif;?>\n\n <?php wp_reset_postdata(); \n}",
"abstract protected function filterEmployment($data);",
"function church_admin_ajax_people()\n{\n global $wpdb;\n $names=explode(\", \", $_GET['term']);//put passed var into array\n $name=esc_sql(stripslashes(end($names)));//grabs final value for search\n\n $sql='SELECT CONCAT_WS(\" \",first_name,last_name) AS name FROM '.CA_PEO_TBL.' WHERE CONCAT_WS(\" \",first_name,last_name) REGEXP \"^'.$name.'\"';\n \n $result=$wpdb->get_results($sql);\n if($result)\n {\n $people=array();\n foreach($result AS $row)\n {\n $people[]=array('name'=>$row->name);\n }\n \n //echo JSON to page \n $response = $_GET[\"callback\"] . \"(\" . json_encode($people) . \")\"; \n echo $response; \n }\n exit();\n}",
"function ff_update_results(){\t\t\n\t$halal = $_POST[\"halal\"];\n\t$kosher = $_POST[\"kosher\"];\n\t$natural = $_POST[\"natural\"];\n\t$organic = $_POST[\"organic\"];\n\t$vegetarian = $_POST[\"vegetarian\"];\n\t$meaty = ($_POST[\"meaty\"] == \"%\") ? \" between 0 and 6\" : \" between \" . ($_POST[\"meaty\"] - 1) . \" and \" . ($_POST[\"meaty\"] + 1);\n\t$salty = ($_POST[\"salty\"] == \"%\") ? \" between 0 and 6\" : \" between \" . ($_POST[\"salty\"] - 1) . \" and \" . ($_POST[\"salty\"] + 1);\n\t$umami = ($_POST[\"umami\"] == \"%\") ? \" between 0 and 6\" : \" between \" . ($_POST[\"umami\"] - 1) . \" and \" . ($_POST[\"umami\"] + 1);\n\t$roasted = ($_POST[\"roasted\"] == \"%\") ? \" between 0 and 6\" : \" between \" . ($_POST[\"roasted\"] - 1) . \" and \" . ($_POST[\"roasted\"] + 1);\n\t$brothy = ($_POST[\"brothy\"] == \"%\") ? \" between 0 and 6\" : \" between \" . ($_POST[\"brothy\"] - 1) . \" and \" . ($_POST[\"brothy\"] + 1);\n\n\tglobal $wpdb;\n\t$sql = \"select productID, productName from ff_flavors where vegan like '$vegetarian' and kosher like '$kosher' and halal like '$halal' and `natural` like '$natural' and organic like '$organic' and meaty $meaty and salty $salty and umami $umami and roasted $roasted and brothy $brothy\";\n\n\t$flavors = $wpdb->get_results($sql);\n\tif(count($flavors) > 0){\n\t\tforeach($flavors as $flavor){\n\t\t\t$args = array(\n\t\t\t\t'hierarchical' => 0,\n\t\t\t\t'meta_key' => 'productID',\n\t\t\t\t'meta_value' => $flavor->productID\n\t\t\t);\n\t\t\t$pages = get_pages($args);\n\t\t\tforeach($pages as $pagg){\n\t\t\t\t$link = get_permalink($pagg->ID);\n\t\t\t}\n\t\t\techo \"<p><a href='$link'><strong>#$flavor->productID</strong> $flavor->productName</a></p>\";\n\t\t}\n\t}\n\telse {\n\t\techo \"<p>We're sorry. We can't seem to find an exact match for your request. Please adjust your flavor settings and try again.</p>\";\n\t}\n\texit();\n}",
"function wpse45436_posts_filter( $query ){\n global $pagenow;\n $type = 'post';\n if (isset($_GET['post_type'])) {\n $type = $_GET['post_type'];\n }\n if ( 'POST_TYPE' == $type && is_admin() && $pagenow=='edit.php' && isset($_GET['ADMIN_FILTER_FIELD_VALUE']) && $_GET['ADMIN_FILTER_FIELD_VALUE'] != '') {\n $query->query_vars['meta_key'] = 'META_KEY';\n $query->query_vars['meta_value'] = $_GET['ADMIN_FILTER_FIELD_VALUE'];\n }\n}",
"function searchAll( $query ) {\n if ( $query->is_search ) {\n $query->set( 'post_type', array( 'post', 'page', 'feed', 'products', 'people'));\n }\n return $query;\n}",
"function get_search_suggestions($search,$deleted = 0,$limit=5)\n\t{\n\t\tif (!trim($search))\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\tif (!$deleted)\n\t\t{\n\t\t\t$deleted = 0;\n\t\t}\n\t\t\n\t\t$suggestions = array();\n\t\t\n\t\t\t$this->db->select(\"first_name, last_name, email,image_id,employees.person_id\", FALSE);\n\t\t\t$this->db->from('employees');\n\t\t\t$this->db->join('people','employees.person_id=people.person_id');\n\t\t\n\t\t\t$this->db->where(\"(first_name LIKE '\".$this->db->escape_like_str($search).\"%' or \n\t\t\tlast_name LIKE '\".$this->db->escape_like_str($search).\"%' or \n\t\t\tfull_name LIKE '\".$this->db->escape_like_str($search).\"%') and deleted=$deleted\");\t\t\t\n\t\t\n\t\t\t$this->db->limit($limit);\t\n\n\t\t\t$by_name = $this->db->get();\n\t\t\t$temp_suggestions = array();\n\t\t\tforeach($by_name->result() as $row)\n\t\t\t{\n\t\t\t\t$data = array(\n\t\t\t\t\t'name' => $row->first_name.' '.$row->last_name,\n\t\t\t\t\t'email' => $row->email,\n\t\t\t\t\t'avatar' => $row->image_id ? app_file_url($row->image_id) : base_url().\"assets/img/user.png\" \n\t\t\t\t\t );\n\t\t\t\t$temp_suggestions[$row->person_id] = $data;\n\t\t\t}\n\t\t\n\t\t\n\t\t\t$this->load->helper('array');\n\t\t\tuasort($temp_suggestions, 'sort_assoc_array_by_name');\n\t\t\t\n\t\t\tforeach($temp_suggestions as $key => $value)\n\t\t\t{\n\t\t\t\t$suggestions[]=array('value'=> $key, 'label' => $value['name'],'avatar'=>$value['avatar'],'subtitle'=>$value['email']);\t\t\n\t\t\t}\n\t\t\n\t\t\t$this->db->select(\"first_name, last_name, email,image_id,employees.person_id\", FALSE);\n\t\t\t$this->db->from('employees');\n\t\t\t$this->db->join('people','employees.person_id=people.person_id');\n\t\t\t$this->db->where('deleted', $deleted);\n\t\t\t$this->db->like('email', $search,'after');\t\t\t\n\t\t\t$this->db->limit($limit);\n\t\t\n\t\t\t$by_email = $this->db->get();\n\t\t\t$temp_suggestions = array();\n\t\t\tforeach($by_email->result() as $row)\n\t\t\t{\n\t\t\t\t$data = array(\n\t\t\t\t\t\t'name' => $row->first_name.' '.$row->last_name,\n\t\t\t\t\t\t'email' => $row->email,\n\t\t\t\t\t\t'avatar' => $row->image_id ? app_file_url($row->image_id) : base_url().\"assets/img/user.png\" \n\t\t\t\t\t\t);\n\n\t\t\t\t$temp_suggestions[$row->person_id] = $data;\n\t\t\t}\n\t\t\n\t\t\n\t\t\tuasort($temp_suggestions, 'sort_assoc_array_by_name');\n\t\t\n\t\t\tforeach($temp_suggestions as $key => $value)\n\t\t\t{\n\t\t\t\t$suggestions[]=array('value'=> $key, 'label' => $value['name'],'avatar'=>$value['avatar'],'subtitle'=>$value['email']);\t\t\n\t\t\t}\n\t\t\n\t\t\t$this->db->select(\"username, email,image_id,employees.person_id\", FALSE);\n\t\t\t$this->db->from('employees');\n\t\t\t$this->db->join('people','employees.person_id=people.person_id');\t\n\t\t\t$this->db->where('deleted', $deleted);\n\t\t\t$this->db->like('username', $search,'after');\t\t\t\n\t\t\t$this->db->limit($limit);\n\t\t\n\t\t\t$by_username = $this->db->get();\n\t\t\t$temp_suggestions = array();\n\t\t\tforeach($by_username->result() as $row)\n\t\t\t{\n\t\t\t\t$data = array(\n\t\t\t\t\t\t'name' => $row->username,\n\t\t\t\t\t\t'email' => $row->email,\n\t\t\t\t\t\t'avatar' => $row->image_id ? app_file_url($row->image_id) : base_url().\"assets/img/user.png\" \n\t\t\t\t\t\t);\n\n\t\t\t\t$temp_suggestions[$row->person_id] = $data;\t\n\t\t\t}\n\n\t\t\tuasort($temp_suggestions, 'sort_assoc_array_by_name');\n\t\t\n\t\t\tforeach($temp_suggestions as $key => $value)\n\t\t\t{\n\t\t\t\t$suggestions[]=array('value'=> $key, 'label' => $value['name'],'avatar'=>$value['avatar'],'subtitle'=>$value['email']);\t\t\n\t\t\t}\n\n\n\t\t\t$this->db->select(\"phone_number, email,image_id,employees.person_id\", FALSE);\n\t\t\t$this->db->from('employees');\n\t\t\t$this->db->join('people','employees.person_id=people.person_id');\t\n\t\t\t$this->db->where('deleted', $deleted);\n\t\t\t$this->db->like('phone_number', $search,'after');\n\t\t\t$this->db->limit($limit);\n\t\t\n\t\t\t$by_phone = $this->db->get();\n\t\t\t$temp_suggestions = array();\n\t\t\tforeach($by_phone->result() as $row)\n\t\t\t{\n\t\t\t\t$data = array(\n\t\t\t\t\t\t'name' => $row->phone_number,\n\t\t\t\t\t\t'email' => $row->email,\n\t\t\t\t\t\t'avatar' => $row->image_id ? app_file_url($row->image_id) : base_url().\"assets/img/user.png\" \n\t\t\t\t\t\t);\n\n\t\t\t\t$temp_suggestions[$row->person_id] = $data;\n\t\t\t}\n\t\t\n\t\t\n\t\t\tuasort($temp_suggestions, 'sort_assoc_array_by_name');\n\t\t\n\t\t\tfor($k=1;$k<=NUMBER_OF_PEOPLE_CUSTOM_FIELDS;$k++)\n\t\t\t{\n\t\t\t\tif ($this->get_custom_field($k)) \n\t\t\t\t{\n\t\t\t\t\t$this->load->helper('date');\n\t\t\t\t\tif ($this->get_custom_field($k,'type') != 'date')\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->db->select('custom_field_'.$k.'_value as custom_field, email,image_id, employees.person_id', false);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->db->select('FROM_UNIXTIME(custom_field_'.$k.'_value, \"'.get_mysql_date_format().'\") as custom_field, email,image_id, employees.person_id', false);\n\t\t\t\t\t}\n\t\t\t\t\t$this->db->from('employees');\n\t\t\t\t\t$this->db->join('people','employees.person_id=people.person_id');\t\n\t\t\t\t\t$this->db->where('deleted',$deleted);\n\t\t\t\t\n\t\t\t\t\tif ($this->get_custom_field($k,'type') != 'date')\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->db->like(\"custom_field_${k}_value\",$search,'after');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->db->where(\"custom_field_${k}_value IS NOT NULL and custom_field_${k}_value != 0 and FROM_UNIXTIME(custom_field_${k}_value, '%Y-%m-%d') = \".$this->db->escape(date('Y-m-d', strtotime($search))), NULL, false);\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$this->db->limit($limit);\n\t\t\t\t\t$by_custom_field = $this->db->get();\n\t\t\n\t\t\t\t\t$temp_suggestions = array();\n\t\t\n\t\t\t\t\tforeach($by_custom_field->result() as $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t\t'name' => $row->custom_field,\n\t\t\t\t\t\t\t\t'email' => $row->email,\n\t\t\t\t\t\t\t\t'avatar' => $row->image_id ? app_file_url($row->image_id) : base_url().\"assets/img/user.png\" \n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$temp_suggestions[$row->person_id] = $data;\n\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\tuasort($temp_suggestions, 'sort_assoc_array_by_name');\n\t\t\t\n\t\t\t\t\tforeach($temp_suggestions as $key => $value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$suggestions[]=array('value'=> $key, 'label' => $value['name'],'avatar'=>$value['avatar'],'subtitle'=>$value['email']);\t\t\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\n\t\t\n\t\t\tforeach($temp_suggestions as $key => $value)\n\t\t\t{\n\t\t\t\t$suggestions[]=array('value'=> $key, 'label' => $value['name'],'avatar'=>$value['avatar'],'subtitle'=>$value['email']);\t\t\n\t\t\t}\n\t\t\n\t\t//only return $limit suggestions\n\t\t$suggestions = array_map(\"unserialize\", array_unique(array_map(\"serialize\", $suggestions)));\n\t\tif(count($suggestions) > $limit)\n\t\t{\n\t\t\t$suggestions = array_slice($suggestions, 0,$limit);\n\t\t}\n\t\t\n\t\t$suggestions = array_map(\"unserialize\", array_unique(array_map(\"serialize\", $suggestions)));\n\t\t\n\t\treturn $suggestions;\n\t}"
] | [
"0.5899019",
"0.5756103",
"0.5349425",
"0.51587874",
"0.515596",
"0.51354027",
"0.5090846",
"0.5039752",
"0.50351244",
"0.5002048",
"0.49245515",
"0.49059114",
"0.4887139",
"0.4840726",
"0.48233727",
"0.48113626",
"0.48106575",
"0.4809928",
"0.48093712",
"0.48090544",
"0.48013046",
"0.47898126",
"0.4776727",
"0.4767261",
"0.4763603",
"0.4754609",
"0.47523895",
"0.47443953",
"0.47382438",
"0.47371802"
] | 0.59597045 | 0 |
Modifies templates for the 'people' post list layout typeahead results. | function colleges_search_people_templates( $templates, $posts, $atts ) {
if ( $atts['layout'] !== 'people' ) { return $templates; }
ob_start();
?>
{
suggestion: Handlebars.compile('<div>{{{template.suggestion}}}</div>')
}
<?php
return ob_get_clean();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function colleges_search_people_localdata( $localdata, $posts, $atts ) {\n\t$data = json_decode( $localdata, true ) ?: array();\n\n\tif ( !empty( $data ) && $atts['layout'] === 'people' ) {\n\t\tforeach ( $data as $index => $item ) {\n\t\t\tif ( isset( $item['id'] ) && get_post_type( $item['id'] ) === 'person' ) {\n\t\t\t\t$person = get_post( $item['id'] );\n\t\t\t\t$name = get_person_name( $person );\n\t\t\t\t$job_title = get_field( 'person_jobtitle', $person->ID );\n\t\t\t\t$job_title = $job_title ? strip_tags( $job_title ) : false; // Fix stupid job title hackery\n\n\t\t\t\t// Update person datum matches\n\t\t\t\t$matches = array( $name );\n\t\t\t\tif ( $job_title ) {\n\t\t\t\t\t$matches[] = $job_title;\n\t\t\t\t}\n\n\t\t\t\t$data[$index]['matches'] = array_merge( $item['matches'], $matches );\n\n\t\t\t\t// Update displayKey for each person\n\t\t\t\t$display = $name;\n\t\t\t\tif ( $job_title ) {\n\t\t\t\t\t$display .= ' ' . $job_title;\n\t\t\t\t}\n\n\t\t\t\t$data[$index]['display'] = $display;\n\n\t\t\t\t// Add extra template data\n\t\t\t\tob_start();\n\t?>\n\t\t\t\t<div class=\"media\">\n\t\t\t\t\t<?php echo get_person_thumbnail( $person ); ?>\n\t\t\t\t\t<div class=\"media-body ml-4\">\n\t\t\t\t\t\t<?php echo $name; ?>\n\t\t\t\t\t\t<?php if ( $job_title ): ?>\n\t\t\t\t\t\t<div class=\"small font-italic\">\n\t\t\t\t\t\t\t<?php echo $job_title; ?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t<?php\n\t\t\t\t$tmpl_suggestion = ob_get_clean();\n\t\t\t\t$data[$index]['template']['suggestion'] = $tmpl_suggestion;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn json_encode( $data );\n}",
"public function add_template_vars()\n {\n if( !$this->template_engine->assigned( 'pages' ) ) {\n $this->assign('pages', Posts::get( array( 'content_type' => 'page', 'status' => Post::status('published'), 'nolimit' => 1 ) ) );\n }\n if( !$this->template_engine->assigned( 'user' ) ) {\n $this->assign('user', User::identify() );\n }\n if( !$this->template_engine->assigned( 'tags' ) ) {\n $this->assign('tags', Tags::get() );\n }\n if( !$this->template_engine->assigned( 'page' ) ) {\n $this->assign('page', isset( $page ) ? $page : 1 );\n }\n if( !$this->template_engine->assigned( 'feed_alternate' ) ) {\n $matched_rule= URL::get_matched_rule();\n switch ( $matched_rule->name ) {\n case 'display_entry':\n case 'display_page':\n $feed_alternate= URL::get( 'atom_entry', array( 'slug' => Controller::get_var('slug') ) );\n break;\n case 'display_entries_by_tag':\n $feed_alternate= URL::get( 'atom_feed_tag', array( 'tag' => Controller::get_var('tag') ) );\n break;\n case 'display_home':\n default:\n $feed_alternate= URL::get( 'atom_feed', array( 'index' => '1' ) );\n }\n $this->assign('feed_alternate', $feed_alternate);\n }\n // Specify pages you want in your navigation here\n $this->assign('nav_pages', Posts::get( array( 'content_type' => 'page', 'status' => 'published', 'nolimit' => 1 ) ) );\n parent::add_template_vars();\n }",
"function colleges_post_list_display_people_before( $content, $items, $atts ) {\n\tob_start();\n?>\n<div class=\"ucf-post-list colleges-post-list-people\">\n<?php\n\treturn ob_get_clean();\n}",
"function get_person_post_list_markup( $posts ) {\n\tob_start();\n\tif ( $posts ):\n?>\n\t<ul class=\"list-unstyled\">\n\t\t<?php foreach ( $posts as $post ): ?>\n\t\t<li class=\"mb-md-4\">\n\t\t\t<h3 class=\"h5\">\n\t\t\t\t<?php if ( get_post_meta( $post->ID, '_links_to', true ) || $post->post_content ): ?>\n\t\t\t\t<a href=\"<?php echo get_permalink( $post ); ?>\">\n\t\t\t\t\t<?php echo wptexturize( $post->post_title ); ?>\n\t\t\t\t</a>\n\t\t\t\t<?php else: ?>\n\t\t\t\t<?php echo wptexturize( $post->post_title ); ?>\n\t\t\t\t<?php endif; ?>\n\t\t\t</h3>\n\t\t\t<?php if ( has_excerpt( $post ) ): ?>\n\t\t\t<div>\n\t\t\t\t<?php echo apply_filters( 'the_content', get_the_excerpt( $post ) ); ?>\n\t\t\t</div>\n\t\t\t<?php endif; ?>\n\t\t</li>\n\t\t<?php endforeach; ?>\n\t</ul>\n<?php\n\tendif;\n\treturn ob_get_clean();\n}",
"function tbcf_query_people( $args = array() ) {\n\n\treturn apply_filters( 'tbcf_query_people', new WP_Query( array_merge( array(\n\t\t'post_type' => 'ctc_person',\n\t\t'paged' => tbcf_page_num(),\n\t\t'order' => 'ASC',\n\t\t'orderby' => 'menu_order'\n\t), $args ) ) );\n\n}",
"function create_people_cpt() {\n \n $labels = array(\n\t\t'name' => _x( 'Profile Categorys', 'taxonomy general name', 'textdomain' ),\n\t\t'singular_name' => _x( 'Profile Category', 'taxonomy singular name', 'textdomain' ),\n\t\t'search_items' => __( 'Search Custom Taxonomies', 'textdomain' ),\n\t\t'all_items' => __( 'All Custom Taxonomies', 'textdomain' ),\n\t\t'parent_item' => __( 'Parent peoplerole', 'textdomain' ),\n\t\t'parent_item_colon' => __( 'Parent peoplerole:', 'textdomain' ),\n\t\t'edit_item' => __( 'Edit ', 'textdomain' ),\n\t\t'update_item' => __( 'Update ', 'textdomain' ),\n\t\t'add_new_item' => __( 'Add New ', 'textdomain' ),\n\t\t'new_item_name' => __( 'New', 'textdomain' ),\n\t\t'menu_name' => __( 'Profile Categories', 'textdomain' ),\n\t);\n\t$args = array(\n\t\t'labels' => $labels,\n\t\t'description' => __( '', 'textdomain' ),\n\t\t'hierarchical' => true,\n\t\t'public' => true,\n\t\t'publicly_queryable' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_rest' => false,\n\t\t'show_tagcloud' => false,\n\t\t'show_in_quick_edit' => true,\n\t\t'show_admin_column' => true,\n\t);\n\tregister_taxonomy( 'profilerole', array('profile', ), $args );\n\n\n\t$labels = array(\n\t\t'name' => __( 'Profile', 'Post Type General Name', 'textdomain' ),\n\t\t'singular_name' => __( 'Profile', 'Post Type Singular Name', 'textdomain' ),\n\t\t'menu_name' => __( 'Profiles', 'textdomain' ),\n\t\t'name_admin_bar' => __( 'Profiles', 'textdomain' ),\n\t\t'archives' => __( 'Profiles Archives', 'textdomain' ),\n\t\t'attributes' => __( 'Profiles Attributes', 'textdomain' ),\n\t\t'parent_item_colon' => __( 'Parent People:', 'textdomain' ),\n\t\t'all_items' => __( 'All', 'textdomain' ),\n\t\t'add_new_item' => __( 'Add New Profile', 'textdomain' ),\n\t\t'add_new' => __( 'Add New', 'textdomain' ),\n\t\t'new_item' => __( 'New Profile', 'textdomain' ),\n\t\t'edit_item' => __( 'Edit Profile', 'textdomain' ),\n\t\t'update_item' => __( 'Update Profile', 'textdomain' ),\n\t\t'view_item' => __( 'View Profile', 'textdomain' ),\n\t\t'view_items' => __( 'View Profiles', 'textdomain' ),\n\t\t'search_items' => __( 'Search Profile', 'textdomain' ),\n\t\t'not_found' => __( 'Not found', 'textdomain' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'textdomain' ),\n\t\t'featured_image' => __( 'Profile Image', 'textdomain' ),\n\t\t'set_featured_image' => __( 'Set profile image', 'textdomain' ),\n\t\t'remove_featured_image' => __( 'Remove profile image', 'textdomain' ),\n\t\t'use_featured_image' => __( 'Use as profile image', 'textdomain' ),\n\t\t'insert_into_item' => __( 'Insert into Profiles', 'textdomain' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this Profile', 'textdomain' ),\n\t\t'items_list' => __( 'Custom Posts list', 'textdomain' ),\n\t\t'items_list_navigation' => __( 'Custom Posts list navigation', 'textdomain' ),\n\t\t'filter_items_list' => __( 'Filter Custom Posts list', 'textdomain' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'Profiles', 'textdomain' ),\n\t\t'description' => __( '', 'textdomain' ),\n\t\t'labels' => $labels,\n\t\t'menu_icon' => 'dashicons-admin-users',\n\t\t'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'author', 'page-attributes', 'post-formats', ),\n\t\t'taxonomies' => array('profilerole', ),\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'hierarchical' => false,\n\t\t'exclude_from_search' => false,\n\t\t'show_in_rest' => true,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n\t);\n register_post_type( 'profile', $args );\n \n add_post_type_support( 'profile', 'wps_subtitle' );\n\n}",
"function advancedResults() {\n\t\t$this->validate();\n\t\t$this->setupTemplate(true);\n\n\t\t$query = Request::getUserVar('query');\n\t\t$fromDate = Request::getUserDateVar('dateFrom', 1, 1);\n\t\tif ($fromDate !== null) $fromDate = date('Y-m-d H:i:s', $fromDate);\n\t\t$toDate = Request::getUserDateVar('dateTo', 32, 12, null, 23, 59, 59);\n\t\tif ($toDate !== null) $toDate = date('Y-m-d H:i:s', $toDate);\n\t\t$articleDao =& DAORegistry::getDAO('ArticleDAO');\n\n\t\t$results =& $articleDao->searchProposalsPublic($query, $fromDate, $toDate);\n\n\t\t$templateMgr =& TemplateManager::getManager();\n\t\t$templateMgr->assign_by_ref('results', $results);\n\t\t$templateMgr->assign('query', Request::getUserVar('query'));\n\t\t\n\t\t$templateMgr->assign('dateFrom', $fromDate);\n\t\t$templateMgr->assign('dateTo', $toDate);\n\t\t$templateMgr->assign('count', count($results));\n\n\t\t$templateMgr->display('search/searchResults.tpl');\n\t}",
"protected function populate_editable_post_types() {\n\t\t$post_types = get_post_types(\n\t\t\tarray(\n\t\t\t\t'public' => true,\n\t\t\t\t'exclude_from_search' => false,\n\t\t\t),\n\t\t\t'object'\n\t\t);\n\n\t\t$this->all_posts = array();\n\t\t$this->own_posts = array();\n\n\t\tif ( is_array( $post_types ) && $post_types !== array() ) {\n\t\t\tforeach ( $post_types as $post_type ) {\n\t\t\t\tif ( ! current_user_can( $post_type->cap->edit_posts ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( current_user_can( $post_type->cap->edit_others_posts ) ) {\n\t\t\t\t\t$this->all_posts[] = esc_sql( $post_type->name );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->own_posts[] = esc_sql( $post_type->name );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function render_callback() {\n\n\t\twhile ( have_posts() ) {\n\n\t\t\tthe_post();\n\n\t\t\tif ( is_search() ) {\n\n\t\t\t\tget_template_part( 'template-parts/content', 'search' );\n\n\t\t\t} else {\n\n\t\t\t\tget_template_part( 'template-parts/content', get_post_format() );\n\n\t\t\t}\n\t\t}\n\n\t}",
"public function pers_list()\n {\n $this->templates->display('pers_list');\n }",
"public function add_template_vars()\n\t{\n\t\tif ( !$this->template_engine->assigned( 'pages' ) ) {\n\t\t\t$this->assign( 'pages', Posts::get( 'page_list' ) );\n\t\t}\n\t\t\n\t\t// add a recent comments variable, to remove need for plugin\n\t\tif (!$this->template_engine->assign( 'recent_comments' ) )\n\t\t{\n\t\t\t// this limits the list of recent comments to five items\n\t\t\t$this->assign( 'recent_comments', Comments::get( array('limit' => 5, 'status' => Comment::STATUS_APPROVED, 'type' => Comment::COMMENT, 'orderby' => 'date DESC' ) ) );\n\t\t}\n\t\t\n\t\tparent::add_template_vars();\n\t\t\n\t\t// assign variables to use with options\n\t\t\n\t}",
"function _template_whisperer_theme_suggestions_page(array &$suggestions, array $variables, $hook) {\n if ($hook !== 'page') {\n return;\n }\n\n // Get the entity from the Route parameters.\n $entity = NULL;\n foreach (\\Drupal::routeMatch()->getParameters() as $param) {\n if ($param instanceof ContentEntityInterface) {\n $entity = $param;\n break;\n }\n }\n\n if (!$entity) {\n return;\n }\n\n $twManager = \\Drupal::service('plugin.manager.template_whisperer');\n $suggestionsEntity = $twManager->suggestionsFromEntity($entity);\n\n if (empty($suggestionsEntity)) {\n return;\n }\n\n // Expose one suggestion by fields.\n foreach ($suggestionsEntity as $suggestion) {\n // Collect every suggestions variants that will be injected.\n $base_suggestions = [];\n\n // Will suggest page--node--1--suggestion.html.twig.\n $base_suggestions[] = [\n $hook,\n $entity->getEntityTypeId(),\n $entity->id(),\n ];\n\n // Will suggest page--node--suggestion.html.twig.\n $base_suggestions[] = [\n $hook,\n $entity->getEntityTypeId(),\n ];\n\n // Generate suggestions for every variations.\n foreach ($base_suggestions as $base_suggestion) {\n $suggestions[] = implode('__', $base_suggestion) . '__' . $suggestion;\n }\n }\n}",
"public function restrict_manage_posts() {\n\t\t\tglobal $typenow, $wp_query;\n\t\t\tif ($typenow != $this->post_type) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$value = 0;\n\t\t\tif (isset($wp_query->query['template-type'])) {\n\t\t\t\t$value = $wp_query->query['template-type'];\n\t\t\t}\n\t\t\t//echo '<pre>'; print_r($wp_query); echo '</pre>';\n\t\t\t$args = array(\n\t\t\t\t'show_option_all' => 'Show All Template Types',\n\t\t\t\t'taxonomy' => $this->taxonomy,\n\t\t\t\t'name' => 'template-type',\n\t\t\t\t'orderby' => 'id',\n\t\t\t\t'selected' => $value,\n\t\t\t\t'hierarchical' => false,\n\t\t\t\t'show_count' => true,\n\t\t\t\t'hide_empty' => false\n\t\t\t);\n\t\t\twp_dropdown_categories($args);\n\t\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $people_types = $em->getRepository('BackendBundle:People_type')->findAll();\n\n return $this->render('people_type/index.html.twig', array(\n 'people_types' => $people_types,\n ));\n }",
"public function allSuggestion() {\n $data['suggestion'] = $this->common->getAllData('suggestion');\n $this->load->view('temp/header');\n $this->load->view('allSuggestion', $data);\n $this->load->view('temp/footer');\n }",
"function axiom_add_posttypes_2_rightnow() { \n $post_types = get_post_types( array( '_builtin' => false ), 'objects' ); \n \n if (count($post_types) > 0)\n foreach( $post_types as $pt => $args ) {\n if($pt == \"staff\" || $pt == \"service\" || $pt == \"slider\" || $pt == \"pricetable\" ) continue;\n $url = 'edit.php?post_type='.$pt;\n echo '<tr><td class=\"b\"><a href=\"'. $url .'\">'. wp_count_posts( $pt )->publish .'</a></td><td class=\"t\"><a href=\"'. $url .'\">'. $args->labels->name .'</a></td></tr>';\n }\n}",
"function render_about_group_field($data) {\n if (!$data) {\n return;\n }\n\n foreach($data as $person) {\n?>\n <div class=\"margin-bottom-small\">\n <h6 class=\"font-small-caps\"><?php echo $person['title']; ?></h6>\n<?php\n foreach($person['name'] as $name) {\n?>\n <div class=\"about-page__person\"><?php echo $name; ?></div>\n<?php\n }\n ?>\n </div>\n<?php\n }\n}",
"public function replace_related_post_types() {\n\n\t\t\t$filters = apply_filters(\n\t\t\t\t'monstroid_dashboard_custom_post_types_args',\n\t\t\t\tarray(\n\t\t\t\t\t'cherry_testimonials_post_type_args',\n\t\t\t\t\t'cherry_portfolio_post_type_args',\n\t\t\t\t\t'cherry_services_post_type_args',\n\t\t\t\t\t'cherry_team_post_type_args',\n\t\t\t\t\t'cherry_slider_post_type_args',\n\t\t\t\t\t'cherry_chart_post_type_args',\n\t\t\t\t\t'cherry_clients_post_type_args',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->iter++;\n\n\t\t\tforeach ( $filters as $filter ) {\n\t\t\t\tadd_filter( $filter, array( $this, 'change_position' ) );\n\t\t\t}\n\n\t\t}",
"function dp_template_init() {\r\n\t$labels = array(\r\n\t\t'name' => __( 'Display Product Template Editor', DP_TEXTDOMAN ),\r\n\t\t'singular_name' => __( 'List Templates Editor', DP_TEXTDOMAN ),\r\n\t\t'menu_name' => __( 'Display Product', DP_TEXTDOMAN ),\r\n\t\t'name_admin_bar' => __( 'List Templates Editor', DP_TEXTDOMAN ),\r\n\t\t'add_new' => __( 'Add New', DP_TEXTDOMAN ),\r\n\t\t'add_new_item' => __( 'Add New List Template', DP_TEXTDOMAN ),\r\n\t\t'new_item' => __( 'New List Template', DP_TEXTDOMAN ),\r\n\t\t'edit_item' => __( 'Edit List Template', DP_TEXTDOMAN ),\r\n\t\t'view_item' => __( 'View List Template', DP_TEXTDOMAN ),\r\n\t\t'all_items' => __( 'All List Template', DP_TEXTDOMAN ),\r\n\t\t'search_items' => __( 'Search List Template', DP_TEXTDOMAN ),\r\n\t\t'parent_item_colon' => __( 'Parent List Template:', DP_TEXTDOMAN ),\r\n\t\t'not_found' => __( 'No books found.', DP_TEXTDOMAN ),\r\n\t\t'not_found_in_trash' => __( 'No books found in Trash.', DP_TEXTDOMAN )\r\n\t);\r\n\r\n\t$args = array(\r\n\t\t'labels' => $labels,\r\n\t\t'public' => false,\r\n\t\t'publicly_queryable' => false,\r\n\t\t'show_ui' => true,\r\n\t\t'show_in_menu' => true,\r\n\t\t'query_var' => false,\r\n\t\t'rewrite' => array( 'slug' => 'dp_template' ),\r\n\t\t'capability_type' => 'post',\r\n\t\t'has_archive' => false,\r\n\t\t'hierarchical' => false,\r\n\t\t'menu_position' => 110,\r\n 'menu_icon' => DP_URL.'/assets/images/logo-16x16.png',\r\n\t\t'supports' => array( 'title' )\r\n\t);\r\n\r\n\tregister_post_type( 'dp_template', $args );\r\n}",
"function project_manage_persons_list_callback($path){\n $project = prepare_project_manage_page($path);\n \n $breadcrumb = drupal_get_breadcrumb();\n $breadcrumb[] = l($project->name, generate_project_url($path));\n $breadcrumb[] = l(t('Manage'), generate_project_url($path).'/manage');\n drupal_set_breadcrumb($breadcrumb);\n \n $project->path_category = 'manage';\n $project->path_category_subitem = 'persons'; \n \n //add css\n drupal_add_css(drupal_get_path('module','reProjectUser').'/css/user_manage.css');\n drupal_add_css(drupal_get_path('module','reProjectUserProfile').'/personalInfo.css');\n //add js\n drupal_add_js(drupal_get_path('module','reProjectUserProfile').'/personalInfo.js');\n //add jQuery ui\n load_jquery_ui();\n drupal_add_js(drupal_get_path('module','reProjectUser').'/js/edit_tags_window.js');\n \n //add ajax link Drupal.settings.reProjectUser.base_path\n drupal_add_js(array('reProjectUser'=>array('base_path'=>url('project/'.$path.'/manage/persons/'))),'setting');\n //get right part info\n \n //get researchers\n $content.= '<h2>Researchers list</h2>';\n $content.= '<p><a href=\"'.url('project/'.$path.'/manage/persons/researcher/add').'\" class=\"add_link\">Add researcher</a></p>';\n $rows = array();\n $header = array(\n //array('data'=>'Photo'),\n array('data'=>'Name'),\n array('data'=>'Email'),\n );\n $owner = user_load($project->creator);\n $rows[] = array(\n l($owner->name, 'user/'.$owner->uid, array('attributes'=>array('class'=>'show_person_card'))).' (creator)',\n $owner->mail,\n );\n \n $sql = \"SELECT name, mail FROM {research_projects_persons_list} AS p, {users} AS u WHERE p.project=%d AND p.user=u.uid AND p.role='researcher' AND p.active=1\";\n $res = db_query($sql, $project->id);\n while($row=db_fetch_object($res)){\n $rows[] = array(\n l($row->name, 'user/'.$row->uid),\n $row->mail,\n );\n }\n $content.= theme_table($header, $rows);\n \n $content.= '<p> </p>'; \n //get normal user\n $content.= '<h2>Participants list</h2>';\n $content.= '<p><a href=\"'.url(\"project/$path/manage/persons/participant/new\").'\" class=\"add_link\">Add new participant</a>'; \n $content.= '<a href=\"'.url(\"project/$path/manage/persons/tags/manage\").'\" class=\"manage_link\">Manage tags</a></p>';\n \n $rows = array();\n $header = array(\n array('data'=>'Name'),\n array('data'=>'Profile'),\n array('data'=>'Operations'),\n );\n \n $sql2 = \"SELECT id, user, name, email, phone, tags, notes FROM {research_projects_participants_cards} WHERE project={$project->id} ORDER BY created DESC\";\n $res = pager_query($sql2, 30);\n while($row=db_fetch_object($res)){\n $tags = get_tags_as_array($row->tags);\n $row->tags_array = $tags;\n \n $name_div = '<div class=\"participant-card-name-div\">'.$row->name.'<br/><strong>(Unauthorized)</strong></div>';\n if($row->user!=null && $row->user >0 ){\n //check if user is active in the project\n $check = 'SELECT active FROM {research_projects_persons_list} WHERE project=%d AND user=%d AND role=\"participant\"';\n if(db_result(db_query($check, $project->id, $row->user))==1){\n $name_div = '<div class=\"participant-card-name-div\">'.l($row->name, 'user/'.$row->user).'</div>';\n }\n }\n \n $p_card = module_invoke_all('project_participant_card_info', $project->id, $row->user);\n $p_card['email'] = array(\n 'name' => t('Email'),\n 'value'=> $row->email,\n 'weight'=> 0,\n );\n $p_card['phone'] = array(\n 'name' => t('Phone'),\n 'value'=> $row->phone,\n 'weight'=> 0,\n );\n \n $p_card['tags'] = array(\n 'name' => t('Tags'),\n 'value'=> $row->tags_array,\n 'weight'=> 9,\n );\n $p_card['notes'] = array(\n 'name' => t('Notes'),\n 'value'=> $row->notes,\n 'weight'=> 10,\n );\n \n \n $rows[] = array(\n $name_div,\n array(\n 'data' => theme('participants_card_div', $p_card, $project->path),\n ),\n '<p class=\"operation-p\"><a class=\"delete_link\" href=\"'.url(\"project/$path/manage/persons/participant/remove/{$row->id}\").'\">Remove</a></p>'\n .'<p class=\"operation-p\"><a class=\"edit_link\" href=\"'.url(\"project/$path/manage/persons/participant/edit/{$row->id}\").'\">Edit</a></p>'\n .'<p class=\"operation-p\"><a class=\"tags_link window_tab\" href=\"javascript:void(0);\" onclick=\"onclick_edit_tags('.\"'\".$row->id.\"'\".');\" >Tags</a></p>',\n );\n }\n $content.= theme('participants_tags_div',$project);\n $content.= '<div class=\"project-manage-page-table-div\">'.theme_table($header, $rows).'</div>';\n $content.= theme('pager');\n $project->right_part = $content; \n return theme('project_manage_page',$project);\n}",
"private function template_to_index()\n {\n Hooks::add([\n \"404_template_hierarchy\", \"archive_template_hierarchy\", \"attachment_template_hierarchy\", \"author_template_hierarchy\", \"category_template_hierarchy\",\n \"date_template_hierarchy\", \"embed_template_hierarchy\", \"frontpage_template_hierarchy\", \"home_template_hierarchy\", \"index_template_hierarchy\", \"page_template_hierarchy\",\n \"paged_template_hierarchy\", \"privacypolicy_template_hierarchy\", \"search_template_hierarchy\", \"single_template_hierarchy\", \"singular_template_hierarchy\", \"tag_template_hierarchy\", \"taxonomy_template_hierarchy\",\n ], function ($templates) {\n return [\"index.php\"];\n });\n }",
"protected function loadTemplates()\n\t{\n\t\t$response = $this->adfox->callApi(AdFox::OBJECT_BANNER_TYPE, AdFox::ACTION_LIST, AdFox::OBJECT_BANNER_TEMPLATE, ['objectID' => $this->id]);\n\t\tforeach ($response->data->children() as $templatetData)\n\t\t{\n\t\t\t$template = new Template($this->adfox, (array) $templatetData);\n\t\t\t$this->templates[] = $template;\n\t\t}\n\n\t\treturn $this;\n\t}",
"function render_templateList($page_data, $no_title = null) {\n include('_templates/template-list.tpl.php');\n}",
"public function load_template( $template ) {\n\n\t\t\tif ( is_singular( 'people' ) ) {\n\t\t\t\treturn $this->choose_template( $template );\n\t\t\t}\n\t\t\treturn $template;\n\t\t}",
"public function index($query = null) {\n \t$user = \\Auth::user();\n\n\t\t$templates = $this->repository->allOrSearch();\n\t\t\n\t\t\n\t\tif(option('site.template')!=''){\n\t\t\tforeach ($templates as $template){\n\t\t\t\tif($template->zip_name == option('site.template')){\n// \t\t\t\t\t$template->name = $template->name.\" (Currently Applied)\";\n\t\t\t\t\t$template->applied = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n \t$no = $templates->firstItem();\n \treturn $this->view('templates.index', compact('templates', 'no'));\n }",
"function my_p2p_template_handling( $html, $connected, $ctype, $mode ) {\n\n $template = locate_template( \"p2p-{$mode}-{$ctype->name}.php\" );\n\n if ( !$template )\n return $html;\n\n ob_start();\n\n $_post = $GLOBALS['post'];\n\n echo '<div class=\"related\">';\n echo '<div class=\"icon\"></div>';\n echo '<h3>Additional Insights</h3>';\n\n// Limit Additional Insights to 5 results\n \t$i = 1;\n foreach ( $connected->items as $item ) {\n \tif ($i==6) break;\n $GLOBALS['post'] = $item;\n load_template( $template, false );\n $i++;\n }\n echo '</div>';\n\n $GLOBALS['post'] = $_post;\n\n return ob_get_clean();\n\n}",
"function templateRedirect() {\n\t\tglobal $wp_query;\n\t\t\n\t\t// init var\n\t\t$templates = array();\n\t\t\n\t\t// Get post_type and language\n\t\t$els = explode( '_t_', $wp_query->query_vars['post_type'] );\n\t\t\n\t\t// Basically single\n\t\t$slug = 'single';\n\t\t\n\t\t// Make archive if needed\n\t\tif( is_archive() )\n\t\t\t$slug = 'archive';\n\n\t\t// Make the templates\n\t\t$templates[] = $slug.'-'.$els[0].'-'.$els[1].'.php' ;\n\t\t$templates[] = $slug.'-'.$els[0].'.php' ;\n\t\t$templates[] = $slug.'.php';\n\t\t\n\t\t// Add the templates for the view\n\t\tlocate_template( $templates, true );\n\t\texit();\n\t}",
"function project_manage_persons_filter_callback($path, $tag){\n $project = prepare_project_manage_page($path); \n \n $breadcrumb = drupal_get_breadcrumb();\n $breadcrumb[] = l($project->name, generate_project_url($path));\n $breadcrumb[] = l(t('Manage'), generate_project_url($path).'/manage');\n drupal_set_breadcrumb($breadcrumb);\n \n $project->path_category = 'manage';\n $project->path_category_subitem = 'persons'; \n \n //add css\n drupal_add_css(drupal_get_path('module','reProjectUser').'/css/user_manage.css');\n drupal_add_css(drupal_get_path('module','reProjectUserProfile').'/personalInfo.css');\n //add js\n drupal_add_js(drupal_get_path('module','reProjectUserProfile').'/personalInfo.js');\n //add jQuery ui\n load_jquery_ui();\n drupal_add_js(drupal_get_path('module','reProjectUser').'/js/edit_tags_window.js');\n \n //add ajax link Drupal.settings.reProjectUser.base_path\n drupal_add_js(array('reProjectUser'=>array('base_path'=>url('project/'.$path.'/manage/persons/'))),'setting');\n //get right part info\n \n //get researchers\n $content.= '<h2>Researchers list</h2>';\n $content.= '<p><a href=\"'.url('project/'.$path.'/manage/persons/researcher/add').'\" class=\"add_link\">Add researcher</a></p>';\n $rows = array();\n $header = array(\n //array('data'=>'Photo'),\n array('data'=>'Name'),\n array('data'=>'Email'),\n );\n $owner = user_load($project->creator);\n $rows[] = array(\n l($owner->name, 'user/'.$owner->uid, array('attributes'=>array('class'=>'show_person_card'))).' (creator)',\n $owner->mail,\n );\n \n $sql = \"SELECT name, mail FROM {research_projects_persons_list} AS p, {users} AS u WHERE p.project=%d AND p.user=u.uid AND p.role='researcher' AND p.active=1\";\n $res = db_query($sql, $project->id);\n while($row=db_fetch_object($res)){\n $rows[] = array(\n l($row->name, 'user/'.$row->uid),\n $row->mail,\n );\n }\n $content.= theme_table($header, $rows);\n \n $content.= '<p> </p>'; \n\n //get normal user\n $content.= '<h2>Participants list</h2>';\n $content.= '<p><a href=\"'.url(\"project/$path/manage/persons/participant/new\").'\" class=\"add_link\">Add new participant</a>'; \n $content.= '<a href=\"'.url(\"project/$path/manage/persons/tags/manage\").'\" class=\"manage_link\">Manage tags</a>';\n $content.= '<a href=\"'.url(\"project/$path/manage/persons\").'\" class=\"reload_link\">Reload all</a></p>'; \n \n\n $rows = array();\n $header = array(\n array('data'=>'Name'),\n array('data'=>'Profile'),\n array('data'=>'Operations'),\n );\n \n $sql2 = \"SELECT id, name, email, phone, tags, notes FROM {research_projects_participants_cards} WHERE project=%d AND tags LIKE '%;$tag;%' ORDER BY created DESC\";\n $res = db_query($sql2, $project->id, $tag);\n while($row=db_fetch_object($res)){\n $tags = get_tags_as_array($row->tags);\n $row->tags_array = $tags;\n \n $name_div = '<div class=\"participant-card-name-div\">'.$row->name.'<br/><strong>(Unauthorized)</strong></div>';\n if($row->user!=null && $row->user >0 ){\n //check if user is active in the project\n $check = 'SELECT active FROM {research_projects_persons_list} WHERE project=%d AND user=%d AND role=\"participant\"';\n if(db_result(db_query($check, $project->id, $row->user))==1){\n $name_div = '<div class=\"participant-card-name-div\">'.l($row->name, 'user/'.$row->user).'</div>';\n }\n }\n \n $p_card = module_invoke_all('project_participant_card_info', $project->id, $row->user);\n $p_card['email'] = array(\n 'name' => t('Email'),\n 'value'=> $row->email,\n 'weight'=> 0,\n );\n $p_card['phone'] = array(\n 'name' => t('Phone'),\n 'value'=> $row->phone,\n 'weight'=> 0,\n );\n \n $p_card['tags'] = array(\n 'name' => t('Tags'),\n 'value'=> $row->tags_array,\n 'weight'=> 9,\n );\n $p_card['notes'] = array(\n 'name' => t('Notes'),\n 'value'=> $row->notes,\n 'weight'=> 10,\n );\n \n \n $rows[] = array(\n $name_div,\n array(\n 'data' => theme('participants_card_div', $p_card, $project->path, $tag),\n ),\n '<p class=\"operation-p\"><a class=\"delete_link\" href=\"'.url(\"project/$path/manage/persons/participant/remove/{$row->id}\").'\">Remove</a></p>'\n .'<p class=\"operation-p\"><a class=\"edit_link\" href=\"'.url(\"project/$path/manage/persons/participant/edit/{$row->id}\").'\">Edit</a></p>'\n .'<p class=\"operation-p\"><a class=\"tags_link window_tab\" href=\"javascript:void(0);\" onclick=\"onclick_edit_tags('.\"'\".$row->id.\"'\".');\" >Tags</a></p>',\n );\n }\n $content.= theme('participants_tags_div',$project);\n $content.= '<div class=\"project-manage-page-table-div\">'.theme_table($header, $rows).'</div>';\n $project->right_part = $content; \n return theme('project_manage_page',$project);\n}",
"public function index() {\n\t\t$this->set('title_for_layout', __('List of Templates'));\n\t\t$this->loadModel('Sheet');\n\t\t$this->Sheet->unbindModel(array('hasMany' => array('SheetPage'), 'hasOne' => array('TeacherPage')));\n\t\t$this->Sheet->bindModel(\n\t array(\n\t 'belongsTo'=>array(\n\t 'User'=>array(\n\t 'className'=>'User',\n\t 'foreignKey'=>'user_id'\n\t )\n\t )\n\t )\n\t );\n\t\t$sheets = $this->Sheet->find('all', array(\n\t\t\t'conditions' => array('Sheet.type' => 'admin'),\n\t\t\t'fields' => array('Sheet.*', 'User.first_name', 'User.last_name')\n\t\t));\n\t\t$this->set(compact('sheets'));\n\t}",
"public function render()\n {\n $lists_of_posts = Post::categoryFilter(request('category'))\n ->tagFilter(request('tags'))\n ->popularFilter(request('blogs'))\n ->featuredFilter(request('blogs'))\n ->authorFilter(request('author'))\n ->search(request('searchItem'))\n ->orderBy('id', 'desc')->activeArticle()->paginate(15);\n \n return view('components.themes.theme2.internal-list-post', compact('lists_of_posts'));\n }"
] | [
"0.6151076",
"0.5751077",
"0.57034063",
"0.5496401",
"0.5318088",
"0.53052044",
"0.5298443",
"0.5288909",
"0.5270204",
"0.51655036",
"0.51643413",
"0.51419973",
"0.51396495",
"0.51341593",
"0.51098907",
"0.5082901",
"0.5075728",
"0.5058331",
"0.5032546",
"0.5023649",
"0.5009137",
"0.5008769",
"0.49954435",
"0.49877128",
"0.4987347",
"0.4978037",
"0.49730447",
"0.49669757",
"0.49568605",
"0.49181902"
] | 0.7261672 | 0 |
Get transfer method choices. | public static function getTransferMethodChoices()
{
if (null === self::$_transferMethods) {
self::$_transferMethods = [];
$oClass = new \ReflectionClass('\App\Entity\Distribution');
$classConstants = $oClass->getConstants();
$constantPrefix = 'TRANSFER_METHOD_';
foreach ($classConstants as $key => $val) {
if (substr($key, 0, strlen($constantPrefix)) === $constantPrefix) {
self::$_transferMethods[$val] = $val;
}
}
}
return self::$_transferMethods;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getChoices()\n {\n return $this->choices;\n }",
"public function getChoices()\n {\n return $this->choices;\n }",
"public function getTransferOptions()\n {\n return $this->transfer_options;\n }",
"public function getDeliveryMethodAllowableValues()\n {\n return [\n self::DELIVERY_METHOD_EMAIL,\n self::DELIVERY_METHOD_FAX,\n self::DELIVERY_METHOD_DOWNLOAD,\n ];\n }",
"public static function getPossibleMethods() {\n if (!isset(self::$possibleMethods)) {\n self::setRequestMethods($_SERVER['REQUEST_METHOD']);\n }\n return self::$possibleMethods;\n }",
"public static function choices();",
"public function getAcceptedPaymentMethod();",
"public function getGatherMethods()\n {\n return $this->getOptionValue(self::GATHER_METHODS);\n }",
"public function getAllowedMethods()\n {\n return $this->allowed_methods;\n }",
"public function getAllowedMethods()\n {\n return $this->allowed_methods;\n }",
"private function get_methods() {\n $methods = get_field('recipe__methods', $this->recipe_id);\n\n if (!$methods) {\n return;\n }\n\n return array_column($methods, 'method');\n }",
"public function toOptionArray()\n { \n $methods = [\n ['value' => 'ups', 'label' => 'UPS'],\n ['value' => 'usps', 'label' => 'United States Postal Service'],\n ['value' => 'fedex', 'label' => 'Federal Express'],\n ['value' => 'dhl', 'label' => 'DHL']\n ];\n \n return $methods;\n }",
"public function getAllowedPaymentMethods()\n {\n $methods = [];\n\n if ($this->_conektaHelper->isCreditCardEnabled()) {\n $methods[] = 'card';\n }\n\n $total = $this->getQuote()->getSubtotal();\n if ($this->_conektaHelper->isCashEnabled() &&\n $total <= 10000\n ) {\n $methods[] = 'cash';\n }\n if ($this->_conektaHelper->isBankTransferEnabled()) {\n $methods[] = 'bank_transfer';\n }\n return $methods;\n }",
"public static function getSupportedMethods()\n {\n return [\n Remote\\Request::METHOD_GET\n ];\n }",
"private function get_upgrade_choices() {\r\n\t\t$choices = [];\r\n\t\t$license = $this->user->get_license_type();\r\n\t\t$plus_websites = $this->pricing->get_plus_websites_count();\r\n\r\n\t\tif ( $license === $plus_websites ) {\r\n\t\t\t$choices['infinite'] = $this->get_upgrade_from_plus_to_infinite_data();\r\n\t\t} elseif (\r\n\t\t\t$license >= $this->pricing->get_single_websites_count()\r\n\t\t\t&&\r\n\t\t\t$license < $plus_websites\r\n\t\t\t) {\r\n\t\t\t$choices['plus'] = $this->get_upgrade_from_single_to_plus_data();\r\n\t\t\t$choices['infinite'] = $this->get_upgrade_from_single_to_infinite_data();\r\n\t\t}\r\n\r\n\t\treturn $choices;\r\n\t}",
"public static function getSupportedMethods()\n {\n return [\n Remote\\Request::METHOD_POST,\n Remote\\Request::METHOD_GET,\n ];\n }",
"public function getAllowedMethods()\n {\n return [self::TIG_ROUTIGO_SHIPPING_METHOD => $this->getConfigData('name')];\n }",
"public function getAllowedMethods()\n\t{\n\t\treturn $this->allowedMethods;\n\t}",
"public function getAllowedMethods()\n {\n return $this->_allowedMethods;\n }",
"public static function getSupportedMethods()\n {\n return [\n Remote\\Request::METHOD_GET,\n Remote\\Request::METHOD_PUT,\n Remote\\Request::METHOD_POST,\n Remote\\Request::METHOD_DELETE,\n ];\n }",
"public function option_choices() {\n\t\treturn array();\n\t}",
"public static function getMethodsAvailable()\n {\n return [\n self::METHOD_FGC,\n self::METHOD_CURL,\n ];\n }",
"public static function getSupportedMethods()\n {\n return [\n Remote\\Request::METHOD_GET,\n Remote\\Request::METHOD_POST,\n Remote\\Request::METHOD_PUT,\n ];\n }",
"protected function verbs()\n {\n return [\n 'support' => ['POST'],\n 'comment' => ['GET', 'POST'],\n 'collection' => ['GET', 'POST', 'DELETE'],\n ];\n }",
"public function getAllowedMethods()\n {\n return [$this->_code => $this->getConfigData('name')];\n }",
"public function getAllowedMethods()\n {\n \tMage::log('Gareth_RoyalMail_Model_Carrier::getAllowedMethods called', Zend_Log::INFO, 'gareth.log');\n \t\n \t/** @var Gareth_RoyalMail_Helper_Rates $shippingRates */\n \t$shippingRates = Mage::helper('gareth_royalmail/rates');\n \t\n \treturn $shippingRates->getAllMethodNames();\n }",
"public function toOptionArray(): array\n {\n return [\n [\n 'value' => MethodInterface::ACTION_AUTHORIZE,\n 'label' => __('Authorize only')\n ],\n [\n 'value' => MethodInterface::ACTION_AUTHORIZE_CAPTURE,\n 'label' => __('Immediate capture')\n ],\n [\n 'value' => MethodInterface::ACTION_ORDER,\n 'label' => __('Order')\n ]\n ];\n }",
"public function getAvailableDeliveryMethod();",
"public function getEnumValues()\n {\n return array(\n 'PUT' => self::PUT,\n 'DELETE' => self::DELETE,\n );\n }",
"public function getShippingChoices()\n {\n return array(self::CLASSIC_SHIPPING => $this->isFreeShipping() ? 'Free: $0.00' : 'Classic: $' . $this->getClassicShippingCost(),\n self::EXPRESS_SHIPPING => 'Express: $' . $this->_expressShippingCost);\n }"
] | [
"0.6349772",
"0.6349772",
"0.62693185",
"0.5900038",
"0.58882576",
"0.5862559",
"0.58584505",
"0.5829599",
"0.57618654",
"0.57618654",
"0.5715268",
"0.5711071",
"0.56972873",
"0.56624883",
"0.5655338",
"0.5641831",
"0.55981404",
"0.5588905",
"0.5574912",
"0.5572308",
"0.55712676",
"0.5571",
"0.5570042",
"0.5555249",
"0.5552228",
"0.55491817",
"0.5546798",
"0.5527217",
"0.5524221",
"0.5524132"
] | 0.8434323 | 0 |
Get distribution_method as string. | public function getDistributionMethodAsString()
{
if (null === $this->distributionMethod) {
return '';
}
return self::$_distributionMethods[$this->distributionMethod];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_signature_method() {\n\n\t\t$method = strtoupper( $this->settings->signature_method );\n\t\tif ( '' != $this->settings->hash_algorythm )\n\t\t\t$method .= '-' . strtoupper( $this->settings->hash_algorythm );\n\n\t\treturn $method;\n\t}",
"public static function get_method():string { return self::$method; }",
"public function __toString() {\n\t\treturn $this->_method;\n\t}",
"public function getDistribution()\n {\n return $this->distribution;\n }",
"public function getDistribution()\n {\n return $this->distribution;\n }",
"public function getPredictiveMethod()\n {\n return isset($this->predictive_method) ? $this->predictive_method : '';\n }",
"abstract public function getCollectorMethodName();",
"public function get_distribution() {\n\t\treturn $this->distribution;\n\t}",
"public function getDistribType()\n {\n return $this->distribType;\n }",
"public function getDistribType()\n {\n return $this->distribType;\n }",
"public function method()\n {\n return $this->instance->getRealMethod();\n }",
"public function getStringPaymentMethodType(){\n\n $payment_method_type = PaymentMethodType::where('id',$this->payment_method_type_id)->first();\n $return = null;\n if(!empty($payment_method_type)){\n $return = $payment_method_type->getDescription();\n }\n return $return;\n }",
"public function __toString()\n\t{\n\t\treturn $this->getMethodName();\n\t}",
"public function getMethod(): string\n {\n return $this->_method;\n }",
"public function getMethod(): string\n {\n return $this->method;\n }",
"public function getMethod(): string\n {\n return $this->method;\n }",
"public function getMethod(): string\n {\n return $this->method;\n }",
"public function getMethod(): string\n {\n return $this->method;\n }",
"public function getDistributionChannelType()\n {\n return $this->distributionChannelType;\n }",
"public function getMethod(): string {\n return $this->method;\n }",
"public function getConfirmationMethod()\n {\n list($confirmation) = $this->xPath(\"//saml:ConfirmationMethod\");\n return (string)$confirmation;\n }",
"protected function _get_method() {\n\t\treturn $this->getData( 'method', 'GET' );\n\t}",
"public function getMethod(): string {\n return $this->method;\n }",
"public function getOrderMethod()\n {\n return $this->_orderModel->getPayment()->getMethod();\n }",
"protected function getPayloadMethod()\n {\n $status = $this->payload->getStatus();\n $method = strtolower($status);\n $method = ucwords($method, '_');\n $method = str_replace('_', '', $method);\n $method = lcfirst($method);\n\n return $method;\n }",
"public function method()\n {\n return $this->_method;\n }",
"public function method(): string\n {\n return !empty($_SERVER['REQUEST_METHOD']) ?\n preg_replace('/[^A-Z]/', '', $_SERVER['REQUEST_METHOD']) : 'cli';\n }",
"public function getDistributor();",
"public function get_method()\n\t{\n\t\treturn $this->_email_method;\n\t}",
"public function toString() : string\n {\n return str_replace('{id}', $this->getId(), $this->getMethod());\n }"
] | [
"0.6671181",
"0.6164747",
"0.59548426",
"0.5918176",
"0.5918176",
"0.5834258",
"0.5762006",
"0.5732898",
"0.5703184",
"0.5703184",
"0.56200755",
"0.56107265",
"0.5605949",
"0.55937743",
"0.55738914",
"0.55738914",
"0.55738914",
"0.55738914",
"0.55547374",
"0.5533179",
"0.5528915",
"0.54965466",
"0.54946375",
"0.54934174",
"0.54787797",
"0.54705995",
"0.5468812",
"0.5449705",
"0.5427481",
"0.5390758"
] | 0.90744716 | 0 |
Get type of document signature. | public function getDocumentSignatureType()
{
if (self::TYPE_SCHEDULED === $this->type) {
$signatureType = DocumentSignature::TYPE_AUTO_DISTRIBUTION;
} else {
$signatureType = DocumentSignature::TYPE_ONE_TIME_DISTRIBUTION;
}
return $signatureType;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDocumentSignatureType()\n {\n return DocumentSignature::TYPE_ONE_TIME_CONTRIBUTION;\n }",
"public function getDocType()\n {\n return $this->docType;\n }",
"public function signature(): Signature;",
"public function type() {\n return eventsign_type_load($this->type);\n }",
"public function getSignature()\n {\n $value = $this->get(self::SIGNATURE);\n return $value === null ? (string)$value : $value;\n }",
"public function getSignature()\n\t{\n\t\treturn $this->getKeyValue('signature'); \n\n\t}",
"public function getSignature()\n {\n return (string)$this->signature;\n }",
"protected function getSignature()\n\t{\n\t\t$this->parseLicenseFile();\n\t\treturn $this->signature;\n\t}",
"public function getSignature() {\n return $this->__call('getSignature', array());\n }",
"public function getSignature()\n {\n if (null === $this->_signature) {\n $this->_signature = $this->createSignature();\n }\n\n return $this->_signature;\n }",
"public function type()\n {\n return $this->memoize('type', function () {\n return new PublicationType($this->type);\n });\n }",
"public function getSignType(): string {\n\t\treturn ($this->signType);\n\t}",
"protected function get_signature() {\n\n\t\t$sign = oAuth_Signature::factory( $this->settings->signature_method, $this->settings->hash_algorythm );\n\t\treturn $sign->sign_request( $this );\n\t}",
"public function signatureAlgorithm(): AlgorithmIdentifierType\n {\n return $this->_signatureAlgorithm;\n }",
"public function getType()\n\t{\n\t\treturn $this->getField('type');\n\t}",
"public function type()\n {\n return $this->metadata['type'] ?? null;\n }",
"public function getDocType()\n {\n $propertyType = $this->gProperty->getType();\n if ($propertyType instanceof InterfacedType) {\n $type = '\\\\' . ltrim($propertyType->getDocType(), '\\\\');\n } elseif($propertyType->getDocType() === 'array') {\n $type = 'array<int|string, mixed>';\n } elseif($propertyType->getDocType() === 'object') {\n $type = '\\\\stdClass';\n } else {\n $type = $propertyType->getDocType() ?: 'mixed';\n }\n\n if ($this->isNullable()) {\n $type .= '|null';\n }\n\n return $type;\n }",
"public function getSignature() {\r\n\t\treturn $this->signature;\r\n\t}",
"public function get_type();",
"public function get_type();",
"function getPaperType() {\n\t\tif (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');\n\t\treturn $this->getLocalizedType();\n\t}",
"public function getSignature()\n {\n return $this->signature;\n }",
"public function getSignature()\n {\n return $this->signature;\n }",
"public function getSignature()\n {\n return $this->signature;\n }",
"public function getSignature()\n {\n return $this->signature;\n }",
"public function getType()\n {\n return $this->sdkSpace->getType();\n }",
"public function getSignature() {\n return $this->_signature;\n }",
"public static function getType();",
"function getFiletype()\n {\r\n if (isset($this->_identifier))\n {\n $identifier = $this->_identifier;\n }\n else\n {\n $identifier = $this->_reaktorfile->getIdentifier();\n }\n return $identifier;\n }",
"public function getSignature()\n {\n return $this->Signature;\n }"
] | [
"0.7395318",
"0.67868114",
"0.6606076",
"0.63897985",
"0.6335064",
"0.63254094",
"0.6271561",
"0.6181535",
"0.6138089",
"0.61212826",
"0.6101458",
"0.6097946",
"0.60935134",
"0.60496926",
"0.6045395",
"0.6044803",
"0.6031518",
"0.60232264",
"0.60012764",
"0.60012764",
"0.599214",
"0.5990917",
"0.5990917",
"0.5990917",
"0.5990917",
"0.5975193",
"0.596948",
"0.5967774",
"0.59611464",
"0.59453255"
] | 0.8004014 | 0 |
Create completely fresh Access + Refresh tokens. | protected function createNewTokens()
{
$logger = $this->getLogger();
$logger->debug('Starting request to create fresh access & refresh tokens');
$response = $this->httpClient->post('auth/login', [
'json' => [
'username' => $this->credentials->getUsername(),
'password' => $this->credentials->getPassword(),
],
'headers' => [
'accept: application/json',
'cache-control: no-cache',
'content-type: application/json',
],
]);
$data = \json_decode($response->getBody(), true);
$logger->debug('Successfully retrieved new access & refresh tokens', $data);
return [
'accessToken' => new Token(
$data['accessToken'],
$this->tokenExtractor->extract($data['accessToken']),
$data['validForVideoManager']
),
'refreshToken' => new Token(
$data['refreshToken'],
$this->tokenExtractor->extract($data['refreshToken']),
null
),
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _tokens()\n {\n try {\n // Create a new GuzzleHTTP Client and define scopes\n $client = new Client();\n\n // Use the authorization code to fetch an access token\n $tokenQuery = array(\n \"grant_type\" => \"authorization_code\",\n \"code\" => $this->authorization_code,\n \"client_id\" => $this->client_id\n );\n\n $tokenUrl = $this->token_url.\"?\".http_build_query($tokenQuery);\n $response = $client->post(\n $tokenUrl, \n [\n 'auth' => [$this->client_id, $this->client_secret],\n 'curl' => array(CURLOPT_SSL_VERIFYPEER => false),\n 'verify' => false\n ]\n );\n\n // Insert in DB the new access token of Aweber\n $body = $response->getBody();\n $creds = json_decode($body, true);\n\n $qry = \"INSERT INTO tokens (access_token, refresh_token, token_type) VALUES (?, ?, ?);\";\n $this->_execQuery($qry, array($creds['access_token'], $creds['refresh_token'], $creds['token_type']));\n } catch (ClientException $e) {\n $response = $e->getResponse();\n error_log($response->getBody()->getContents());\n\n // If we have any error, try to refresh token\n $this->refreshToken();\n }\n }",
"private function refreshToken()\n {\n try {\n $tokens = $this->getLastToken();\n\n // Create a new GuzzleHTTP Client and define scopes\n $client = new Client();\n\n // Use the authorization code to fetch an access token\n $tokenQuery = array(\n \"grant_type\" => \"refresh_token\",\n \"refresh_token\" => $tokens[\"refresh_token\"]\n );\n\n $tokenUrl = $this->token_url.\"?\".http_build_query($tokenQuery);\n $response = $client->post(\n $tokenUrl, \n [\n 'auth' => [$this->client_id, $this->client_secret],\n 'curl' => array(CURLOPT_SSL_VERIFYPEER => false),\n 'verify' => false\n ]\n );\n\n // Insert in DB the new access token of Aweber\n $body = $response->getBody();\n $creds = json_decode($body, true);\n\n $qry = \"INSERT INTO tokens (access_token, refresh_token, token_type) VALUES (?, ?, ?);\";\n $this->_execQuery($qry, array($creds['access_token'], $creds['refresh_token'], $creds['token_type']));\n } catch (ClientException $e) {\n $response = $e->getResponse();\n error_log($response->getBody()->getContents());\n }\n }",
"public function refresh()\n {\n $token = null;\n $res = $this->api->accessToken()->create([\n 'grant_type' => 'client_credentials',\n 'client_id' => RetsRabbit::$plugin->getSettings()->clientId,\n 'client_secret' => RetsRabbit::$plugin->getSettings()->clientSecret\n ]);\n\n if ($res->wasSuccessful()) {\n $token = $res->token();\n RetsRabbit::$plugin->getCache()->set('access_token', $token->access_token, $token->expires_in);\n } else {\n Craft::warning('Could not fetch the access token.', __METHOD__);\n }\n\n return $token;\n }",
"protected function refreshToken()\n {\n $payload = [\n ['name' => 'client_id', 'contents' => $this->client_id],\n ['name' => 'client_secret', 'contents' => $this->client_secret],\n ['name' => 'refresh_token', 'contents' => $this->refresh_token],\n ['name' => 'grant_type', 'contents' => 'refresh_token'],\n ];\n $response = $this->post('https://cloud.merchantos.com/oauth/access_token.php', [\n 'multipart' => $payload\n ]);\n $token = json_decode($response->getBody(), true)['access_token'];\n if ($token) {\n $this->access_token = $token;\n error_log('New Access Token: '. substr($token, 0, 8) . '************', 0);\n }\n }",
"public function generateAccessTokenFromRefreshToken()\n {\n\n $parameter_array = array(\n 'grant_type' => 'refresh_token',\n 'client_id' => $this->credentials[ NF_ZohoCRM()->constants->client_id ],\n 'client_secret' => $this->credentials[ NF_ZohoCRM()->constants->client_secret ],\n 'refresh_token' => $this->credentials[ NF_ZohoCRM()->constants->refresh_token ]\n );\n\n $post_args = $this->returnDefaultPostArgs();\n\n $query_string = http_build_query($parameter_array);\n\n $response = wp_remote_post($this->token_url . '?' . $query_string, $post_args);\n\n self::handleTokenResponse($response);\n }",
"public function generateAccessToken()\n {\n $this->access_token = Yii::$app->security->generateRandomString() . '_' . time();\n }",
"public function run(): void\n {\n UserAccessToken::factory()->times(4)->create();\n }",
"public function generateAccessToken()\n {\n\n if (0 < strlen($this->credentials[ NF_ZohoCRM()->constants->authorization_code ])) {\n\n $this->generateTokensFromAuthCode();\n } else {\n\n $this->generateAccessTokenFromRefreshToken();\n }\n }",
"function reset_access_tokens($user_id){\n\t\t////reset all refresh tokens\n\t\t//reset all access tokens\n\t}",
"private function init() {\n if ($savedtokens = $this->btdbsett->getBTDBSettingByName('googledrive_tokens')) {\n $savedtokens = unserialize(array_shift($savedtokens));\n }\n \n //Get Access Token usin refresh token\n if(isset($savedtokens['refresh_token'])){\n $this->tokens['access_token'] = $this->access_token($savedtokens['refresh_token']);\n }\n }",
"public function generateAccessToken()\n {\n $this->access_token = Yii::$app->security->generateRandomString($length = 16);\n }",
"private function clearTokens()\n {\n //Delete all tokens expirateds or revoked\n DB::table('oauth_access_tokens')->where('expires_at', '<=', now())\n ->orWhere('revoked', 1)\n ->delete();\n }",
"private function clearTokens()\n {\n //Delete all tokens expirateds or revoked\n DB::table('oauth_access_tokens')->where('expires_at', '<=', now())\n ->orWhere('revoked', 1)\n ->delete();\n }",
"public function refresh_token(){\n\t\t$this->server->addGrantType(new OAuth2\\GrantType\\RefreshToken($this->storage, array(\n\t\t\t\"always_issue_new_refresh_token\" => true,\n\t\t\t\"unset_refresh_token_after_use\" => true,\n\t\t\t\"refresh_token_lifetime\" => 2419200,\n\t\t)));\n\t\t$this->server->handleTokenRequest($this->request)->send();\n\t}",
"public function generateRefreshToken(): string;",
"public function refreshToken(): void\n {\n $rest = new RestClient($this->endpoint, $this->clientkey);\n $results = $rest->oauth2Principal();\n $this->access_token = $results->access_token;\n $this->expires_in = $results->expires_in;\n $this->token_type = $results->token_type;\n }",
"public function run()\n {\n RefreshToken::create([\n 'name' => 'admin sbs',\n 'zoho_token' => env('REFRESH_TOKEN_TBL_ZOHO_TOKEN' ,'1000.d6cce481be4a0f53d7d42a58c9e96e01.68f4955e10a863d8f6768551c9f04f94'),\n 'refresh_token' => env('REFRESH_TOKEN_TBL_REFRESH_TOKEN' ,'1000.dc6dfc0808919a52caf7d57a85af7635.109170f8b4fc9bf4ec89670e4a15790a'),\n 'client_id' => env('REFRESH_TOKEN_TBL_CLIENT_ID' ,'1000.LV997840YI28NLJUYEKWEASEC754AE'),\n 'client_secret' => env('REFRESH_TOKEN_TBL_CLIENT_SECRET' ,'aa2af218bc4789d1045fb6957a1a61cf2df8a472ac'),\n 'grant_type' => 'refresh_token',\n 'status' => 1,\n ]);\n }",
"public function getNewRefreshToken(){\n return new RefreshTokenEntity();\n }",
"public function run()\n {\n // create permanent API token\n Api::create([\"key\" => Str::random(60)]);\n }",
"public function getNewRefreshToken()\n {\n $refreshToken = new RefreshTokenEntity;\n $refreshToken->setRevoked(false);\n\n return $refreshToken;\n }",
"public function getNewAccessTokenTest() {\n\n $client = new Client([\n $this->getApiConfig()->getBaseUrl()\n ]);\n\n $mockSubscriptionResponse = new ApiMockResponse();\n $mock = new Mock([$mockSubscriptionResponse->getSuccessfulRefreshTokenResponse()]);\n $client->getEmitter()->attach($mock);\n\n $authorizationRequest = new RefreshTokenRequest();\n\n\n $bazaarApi = new BazaarApi();\n $bazaarApi->setClient($client);\n $bazaarApi->setApiConfig($this->getApiConfig());\n $bazaarApi->setAccountConfig($this->getAccountConfig());\n\n $fetchRefreshToken = $bazaarApi->refreshToken($authorizationRequest);\n\n $this->assertEquals('uX5qC82EGWjkjjeyvTzTufHOM9HZfM', $fetchRefreshToken->getAccessToken());\n $this->assertEquals(3600, $fetchRefreshToken->getExpireIn());\n $this->assertEquals(\"androidpublisher\", $fetchRefreshToken->getScope());\n $this->assertEquals(\"Bearer\", $fetchRefreshToken->getTokenType());\n\n }",
"public function get_fresh_token() {\n\t\tif ( $this->is_token_expired() && $this->refresh_token ) {\n\t\t\t$this->refresh_token();\n\t\t}\n\n\t\tif ( empty( $this->access_token ) ) {\n\n\t\t\t$result = wp_remote_post( self::TOKEN_URI,\n\t\t\t\t[\n\t\t\t\t\t'body' => [\n\t\t\t\t\t\t'grant_type' => 'authorization_code',\n\t\t\t\t\t\t'client_id' => $this->client_id,\n\t\t\t\t\t\t'redirect_uri' => $this->redirect_uri,\n\t\t\t\t\t\t'code' => $this->auth_code,\n\t\t\t\t\t],\n\t\t\t\t\t'headers' => [\n\t\t\t\t\t\t'Authorization' => 'Basic ' . base64_encode( $this->client_id . ':' . $this->client_secret ),\n\t\t\t\t\t\t'Content-Type' => 'application/x-www-form-urlencoded',\n\t\t\t\t\t]\n\t\t\t\t]\n\t\t\t);\n\n\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\t$error = sprintf(\n\t\t\t\t\t__( 'WordPress error: %s', 'fitbit-api' ),\n\t\t\t\t\t$result->get_error_message()\n\t\t\t\t);\n\n\t\t\t\t$this->add_error( $error );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$response = json_decode( wp_remote_retrieve_body( $result ) );\n\t\t\tif ( 200 !== wp_remote_retrieve_response_code( $result ) ) {\n\t\t\t\tif ( $response->error_description ) {\n\t\t\t\t\t$error = sprintf(\n\t\t\t\t\t\t__( 'Authentication error: %s', 'fitbit-api' ),\n\t\t\t\t\t\t$response->error_description\n\t\t\t\t\t);\n\t\t\t\t\t$this->add_error( $error );\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$this->set_access_token( $response );\n\t\t\t$this->set_refresh_token( $response );\n\t\t\t#$this->get_data();\n\t\t}\n\t}",
"public function createRefreshToken(AccessToken &$access_token, $refresh_cache = false)\n {\n $refresh_token = $this->refresh_token_generator->generate(\n RefreshToken::create(\n $access_token,\n $this->configuration_service->getConfigValue('OAuth2.RefreshToken.Lifetime')\n )\n );\n\n return $this->tx_service->transaction(function () use (\n $refresh_token,\n $access_token,\n $refresh_cache\n ) {\n $value = $refresh_token->getValue();\n //hash the given value, bc tokens values are stored hashed on DB\n $hashed_value = Hash::compute('sha256', $value);\n $client_id = $refresh_token->getClientId();\n $user_id = $refresh_token->getUserId();\n $client = $this->client_repository->getClientById($client_id);\n $user = $this->auth_service->getUserById($user_id);\n\n // todo: move to a factory\n $refresh_token_db = new RefreshTokenDB;\n $refresh_token_db->setValue($hashed_value);\n $refresh_token_db->setLifetime($refresh_token->getLifetime());\n $refresh_token_db->setScope($refresh_token->getScope());\n $refresh_token_db->setAudience($access_token->getAudience());\n $refresh_token_db->setFromIp($this->ip_helper->getCurrentUserIpAddress());\n\n $access_token_db = $this->access_token_repository->getByValue(Hash::compute('sha256', $access_token->getValue()));\n $refresh_token_db->setClient($client);\n $refresh_token_db->setOwner($user);\n $refresh_token_db->addAccessToken($access_token_db);\n\n $this->refresh_token_repository->add($refresh_token_db);\n\n $access_token->setRefreshToken($refresh_token);\n // bc refresh token could change\n if($refresh_cache) {\n if($this->clearAccessTokenOnCache($access_token))\n $this->storesAccessTokenOnCache($access_token);\n if($this->clearAccessTokenDBOnCache($access_token_db))\n $this->storeAccessTokenDBOnCache($access_token_db);\n }\n\n $this->cache_service->incCounter\n (\n $client_id . TokenService::ClientRefreshTokensQty,\n TokenService::ClientRefreshTokensQtyLifetime\n );\n\n return $refresh_token;\n });\n\n }",
"private function ensureAccessToken()\n {\n if ($this->allowRefresh) {\n if (empty($this->accessToken)) {\n $this->retrieveAccessToken();\n } else {\n if (time() > $this->tokenExpires) {\n $this->refreshAccessToken();\n }\n }\n }\n }",
"public function test(){\n if ($savedtokens = PhpFox::getService('backuprestore.backuprestore')->getBTDBSettingByName('googledrive_tokens')) {\n $savedtokens = json_encode(unserialize(array_shift($savedtokens)));\n }\n $savedtokens = json_decode($savedtokens,true);\n \n $params = array(\n 'refresh_token' => $savedtokens['refresh_token'], \n 'client_id' => $this->ClientId, \n 'client_secret' => $this->ClientSecret, \n 'grant_type' => 'refresh_token'\n );\n $mReturn = Phpfox::getLib('request')->send('https://accounts.google.com/o/oauth2/token',$params);\n \n $result = json_decode($mReturn,true);\n $result['created'] = Phpfox::getTime();\n //var_dump($result);\n if (isset($result['access_token'])) {\n $this->client->setAccessToken($mReturn);\n try{\n if($newtokens = $this->client->getAccessToken()){\n $tekens = json_decode($newtokens,true);\n $tekens['created']= Phpfox::getTime();\n $newtokens = json_encode($tekens);\n $userinfo = $this->getUserInfo($newtokens);\n \n $emailAddress = $userinfo->getEmail();\n $userId = $userinfo->getId();\n echo $emailAddress.\"<br>\".$userId;\n $service = $this->buildService($newtokens);\n $abc = $this->getAcountInfo($service);\n }\n }catch(Exception $abc){\n $abc->getMessage();\n }\n \n } \n }",
"public function refreshOauthToken() {\n $this->log->debug('Refreshing API token...');\n\n $headers = ['Content-Type' => 'application/x-www-form-urlencoded'];\n $data = [\n 'grant_type' => $this->defaultGrantType,\n 'client_id' => 'admin-cli',\n 'username' => $this->username,\n 'password' => $this->password,\n ];\n\n try {\n\n $response = Requests::post($this->tokenBaseUrl, $headers, $data); // raw json string for json in body. no form.\n\n if ($response->status_code == 200) {\n\n $tokenData = json_decode($response->body, true);\n $token = $tokenData['access_token'];\n $expiresIn = $tokenData['expires_in'];\n\n $this->log->debug('Got a new token: ' . substr($token, 0, 20) . '...');\n\n $now = new DateTime();\n $expiresAt = $now->add(new DateInterval('PT' . $expiresIn . 'S'))->format('Y-m-d H:i:s');\n $this->log->debug('This new token expires at ' . $expiresAt);\n\n // save API key into apcu cache\n apcu_store('token__' . $this->username, $token, 60 * 60 * 72);\n apcu_store('token_expires__' . $this->username, $expiresAt, 60 * 60 * 72);\n\n\n } else {\n $this->log->warn('Token API call failed: ' . $response->status_code);\n if ($response->body) $this->log->warn($response->body);\n }\n\n } catch (Requests_Exception $e) { // timeouts, etc.\n $this->log->error($e->getMessage());\n }\n }",
"private function refreshToken() {\n\n $body = array(\"refresh\" => $this->authtokens[\"refresh\"]); \n $ch = curl_init($this->endpoints[\"refresh\"]);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Otherwise reponse=1\n curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 7); //Timeout after 7 seconds\n curl_setopt($ch, CURLINFO_HEADER_OUT, false);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));\n curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers);\n\n $result = curl_exec($ch);\n $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n if ($statusCode != 200) {\n $this->logError(sprintf(\"Unable to refresh auth token %s:\\n%s\\n\", $statusCode, $result));\n } else {\n $respObj = json_decode($result);\n if ($respObj->access != null) {\n $this->authtokens[\"access\"] = $respObj->access;\n }\n }\n }",
"public function run()\n {\n DB::table('access_tokens')->insert([\n 'user_id' => 1,\n 'api_token' => str_random(28),\n 'api_client_id' => 1,\n 'expires_at' => \\Carbon\\Carbon::now(),\n 'refresh_token' => str_random(28),\n 'refresh_expires_at' => \\Carbon\\Carbon::now(),\n 'created_at' => \\Carbon\\Carbon::now(),\n 'updated_at' => \\Carbon\\Carbon::now()\n ]);\n }",
"protected function renewAccessToken()\n {\n // set some params\n $formParams = [\n 'grant_type' => 'refresh_token',\n 'client_id' => $this->apiClientId,\n 'client_secret' => $this->apiSecret,\n 'refresh_token' => $this->credentials->refresh_token,\n ];\n\n // run the query\n $auth = $this->oauthRequest($formParams);\n\n // set refreshed flag to true, we can't refresh again...\n $auth->created_at = time();\n $auth->refreshed = true;\n\n // use the response vars as the new creds\n $this->credentials = $auth;\n\n return $this;\n }",
"public function refreshToken();"
] | [
"0.6788735",
"0.67214763",
"0.6599867",
"0.65389454",
"0.6497169",
"0.6466057",
"0.639896",
"0.63586766",
"0.6347339",
"0.6343042",
"0.62539315",
"0.62095755",
"0.62095755",
"0.61916435",
"0.61663926",
"0.6166116",
"0.6143416",
"0.6095642",
"0.60904723",
"0.6089914",
"0.6077518",
"0.6071597",
"0.60345876",
"0.60344476",
"0.6024262",
"0.6020496",
"0.60173225",
"0.598283",
"0.5974115",
"0.59715956"
] | 0.7608575 | 0 |
Create a new access token for a video manager using a refresh token. | protected function createAccessTokenFromRefreshToken(Token $refreshToken, $videoManagerId)
{
$logger = $this->getLogger();
$logger->debug('Starting request to create fresh access token from refresh token');
$response = $this->httpClient->post(sprintf('auth/refresh/%d', $videoManagerId), [
'json' => [
'refreshToken' => $refreshToken->getTokenString(),
],
'headers' => [
'accept: application/json',
'cache-control: no-cache',
'content-type: application/json',
],
]);
$data = \json_decode($response->getBody(), true);
$logger->debug('Successfully retrieved new access token', $data);
return new Token(
$data['accessToken'],
$this->tokenExtractor->extract($data['accessToken']),
$videoManagerId
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function generateAccessTokenFromRefreshToken()\n {\n\n $parameter_array = array(\n 'grant_type' => 'refresh_token',\n 'client_id' => $this->credentials[ NF_ZohoCRM()->constants->client_id ],\n 'client_secret' => $this->credentials[ NF_ZohoCRM()->constants->client_secret ],\n 'refresh_token' => $this->credentials[ NF_ZohoCRM()->constants->refresh_token ]\n );\n\n $post_args = $this->returnDefaultPostArgs();\n\n $query_string = http_build_query($parameter_array);\n\n $response = wp_remote_post($this->token_url . '?' . $query_string, $post_args);\n\n self::handleTokenResponse($response);\n }",
"public function getToken($videoManagerId = null)\n {\n $logger = $this->getLogger();\n $this->logTokenData();\n\n // Access token has expired, but expiration token has not expired.\n // Issue ourselves a new access token for the same video manager.\n if (!is_null($this->accessToken)\n && $this->accessToken->expired()\n && !$this->refreshToken->expired()) {\n $logger->info('Access token has expired - getting new one for same video manager with refresh token');\n $tokenData = $this->createAccessTokenFromRefreshToken(\n $this->refreshToken,\n $this->accessToken->getVideoManagerId()\n );\n\n $this->accessToken = $tokenData['accessToken'];\n } elseif (is_null($this->accessToken)\n || (!is_null($this->refreshToken) && $this->refreshToken->expired())) {\n // Either we have no token, or the refresh token has expired\n // so we will need to generate completely new tokens\n $logger->info('No access token, or refresh token has expired - generate completely new ones');\n $tokenData = $this->createNewTokens();\n\n $this->accessToken = $tokenData['accessToken'];\n $this->refreshToken = $tokenData['refreshToken'];\n }\n\n // Video manager is not matching with the one that our token\n // was generated with - issue ourselves a token for the video manager\n // we need.\n if (!is_null($videoManagerId)\n && isset($this->accessToken)\n && $this->accessToken->getVideoManagerId() != $videoManagerId) {\n $logger->info('Attempting to use token for different video manager - generate valid access token');\n $this->accessToken = $this->createAccessTokenFromRefreshToken($this->refreshToken, $videoManagerId);\n }\n\n return $this->accessToken->getTokenString();\n }",
"public function refresh()\n {\n $token = null;\n $res = $this->api->accessToken()->create([\n 'grant_type' => 'client_credentials',\n 'client_id' => RetsRabbit::$plugin->getSettings()->clientId,\n 'client_secret' => RetsRabbit::$plugin->getSettings()->clientSecret\n ]);\n\n if ($res->wasSuccessful()) {\n $token = $res->token();\n RetsRabbit::$plugin->getCache()->set('access_token', $token->access_token, $token->expires_in);\n } else {\n Craft::warning('Could not fetch the access token.', __METHOD__);\n }\n\n return $token;\n }",
"protected function createNewTokens()\n {\n $logger = $this->getLogger();\n $logger->debug('Starting request to create fresh access & refresh tokens');\n\n $response = $this->httpClient->post('auth/login', [\n 'json' => [\n 'username' => $this->credentials->getUsername(),\n 'password' => $this->credentials->getPassword(),\n ],\n 'headers' => [\n 'accept: application/json',\n 'cache-control: no-cache',\n 'content-type: application/json',\n ],\n ]);\n\n $data = \\json_decode($response->getBody(), true);\n $logger->debug('Successfully retrieved new access & refresh tokens', $data);\n\n return [\n 'accessToken' => new Token(\n $data['accessToken'],\n $this->tokenExtractor->extract($data['accessToken']),\n $data['validForVideoManager']\n ),\n 'refreshToken' => new Token(\n $data['refreshToken'],\n $this->tokenExtractor->extract($data['refreshToken']),\n null\n ),\n ];\n }",
"protected function refreshToken()\n {\n $payload = [\n ['name' => 'client_id', 'contents' => $this->client_id],\n ['name' => 'client_secret', 'contents' => $this->client_secret],\n ['name' => 'refresh_token', 'contents' => $this->refresh_token],\n ['name' => 'grant_type', 'contents' => 'refresh_token'],\n ];\n $response = $this->post('https://cloud.merchantos.com/oauth/access_token.php', [\n 'multipart' => $payload\n ]);\n $token = json_decode($response->getBody(), true)['access_token'];\n if ($token) {\n $this->access_token = $token;\n error_log('New Access Token: '. substr($token, 0, 8) . '************', 0);\n }\n }",
"public function generateAccessToken()\n {\n\n if (0 < strlen($this->credentials[ NF_ZohoCRM()->constants->authorization_code ])) {\n\n $this->generateTokensFromAuthCode();\n } else {\n\n $this->generateAccessTokenFromRefreshToken();\n }\n }",
"private function UpdateAccessToken()\n {\n $accessToken = $this->GetBuffer('Token');\n if ($accessToken == '' || time() >= intval($this->GetBuffer('Expires'))) {\n $this->SendDebug('UpdateAccessToken', '', 0);\n\n $options = [\n 'http' => [\n 'header' => \"Content-Type: application/x-www-form-urlencoded;charset=utf-8\\r\\n\",\n 'method' => 'POST',\n 'content' => http_build_query([\n 'client_id' => $this->ReadPropertyString('ClientID'),\n 'grant_type' => 'refresh_token',\n 'refresh_token' => $this->ReadAttributeString('Token')\n ]),\n 'ignore_errors' => true\n ]\n ];\n $context = stream_context_create($options);\n $result = file_get_contents($this->token_url, false, $context);\n\n $this->SendDebug('RESULT', $result, 0);\n\n $data = json_decode($result);\n\n if ($data === null) {\n die('Invalid response while fetching access token!');\n }\n\n if (isset($data->error)) {\n die($data->error);\n }\n\n if (!isset($data->token_type) || $data->token_type != 'Bearer') {\n die('Bearer Token expected');\n }\n\n $this->WriteAttributeString('Token', $data->refresh_token);\n $this->SetBuffer('Token', $data->access_token);\n $this->SetBuffer('Expires', $data->expires_in);\n\n $accessToken = $data->access_token;\n }\n\n return $accessToken;\n }",
"private function refreshToken()\n {\n try {\n $tokens = $this->getLastToken();\n\n // Create a new GuzzleHTTP Client and define scopes\n $client = new Client();\n\n // Use the authorization code to fetch an access token\n $tokenQuery = array(\n \"grant_type\" => \"refresh_token\",\n \"refresh_token\" => $tokens[\"refresh_token\"]\n );\n\n $tokenUrl = $this->token_url.\"?\".http_build_query($tokenQuery);\n $response = $client->post(\n $tokenUrl, \n [\n 'auth' => [$this->client_id, $this->client_secret],\n 'curl' => array(CURLOPT_SSL_VERIFYPEER => false),\n 'verify' => false\n ]\n );\n\n // Insert in DB the new access token of Aweber\n $body = $response->getBody();\n $creds = json_decode($body, true);\n\n $qry = \"INSERT INTO tokens (access_token, refresh_token, token_type) VALUES (?, ?, ?);\";\n $this->_execQuery($qry, array($creds['access_token'], $creds['refresh_token'], $creds['token_type']));\n } catch (ClientException $e) {\n $response = $e->getResponse();\n error_log($response->getBody()->getContents());\n }\n }",
"protected function createAccessToken():AccessToken{\n\t\treturn new AccessToken(['provider' => $this->serviceName]);\n\t}",
"public function grantAccessToken() {\n $filters = array(\n \"grant_type\" => array(\"filter\" => FILTER_VALIDATE_REGEXP, \"options\" => array(\"regexp\" => OAUTH2_GRANT_TYPE_REGEXP), \"flags\" => FILTER_REQUIRE_SCALAR),\n \"scope\" => array(\"flags\" => FILTER_REQUIRE_SCALAR),\n \"code\" => array(\"flags\" => FILTER_REQUIRE_SCALAR),\n \"redirect_uri\" => array(\"filter\" => FILTER_SANITIZE_URL),\n \"username\" => array(\"flags\" => FILTER_REQUIRE_SCALAR),\n \"password\" => array(\"flags\" => FILTER_REQUIRE_SCALAR),\n \"assertion_type\" => array(\"flags\" => FILTER_REQUIRE_SCALAR),\n \"assertion\" => array(\"flags\" => FILTER_REQUIRE_SCALAR),\n \"refresh_token\" => array(\"flags\" => FILTER_REQUIRE_SCALAR),\n );\n\n $input = filter_input_array(INPUT_POST, $filters);\n\n // Grant Type must be specified.\n if (!$input[\"grant_type\"])\n $this->errorJsonResponse(OAUTH2_HTTP_BAD_REQUEST, OAUTH2_ERROR_INVALID_REQUEST, 'Invalid grant_type parameter or parameter missing');\n\n // Make sure we've implemented the requested grant type\n if (!in_array($input[\"grant_type\"], $this->getSupportedGrantTypes()))\n $this->errorJsonResponse(OAUTH2_HTTP_BAD_REQUEST, OAUTH2_ERROR_UNSUPPORTED_GRANT_TYPE);\n\n // Authorize the client\n $client = $this->getClientCredentials();\n\n if ($this->checkClientCredentials($client[0], $client[1]) === FALSE)\n $this->errorJsonResponse(OAUTH2_HTTP_BAD_REQUEST, OAUTH2_ERROR_INVALID_CLIENT);\n\n if (!$this->checkRestrictedGrantType($client[0], $input[\"grant_type\"]))\n $this->errorJsonResponse(OAUTH2_HTTP_BAD_REQUEST, OAUTH2_ERROR_UNAUTHORIZED_CLIENT);\n\n // Do the granting\n switch ($input[\"grant_type\"]) {\n case OAUTH2_GRANT_TYPE_AUTH_CODE:\n if (!$input[\"code\"] || !$input[\"redirect_uri\"])\n $this->errorJsonResponse(OAUTH2_HTTP_BAD_REQUEST, OAUTH2_ERROR_INVALID_REQUEST);\n\n $stored = $this->getAuthCode($input[\"code\"]);\n\n // Ensure that the input uri starts with the stored uri\n if ($stored === NULL || (strcasecmp(substr($input[\"redirect_uri\"], 0, strlen($stored[\"redirect_uri\"])), $stored[\"redirect_uri\"]) !== 0) || $client[0] != $stored[\"client_id\"])\n $this->errorJsonResponse(OAUTH2_HTTP_BAD_REQUEST, OAUTH2_ERROR_INVALID_GRANT);\n\n if ($stored[\"expires\"] < time())\n $this->errorJsonResponse(OAUTH2_HTTP_BAD_REQUEST, OAUTH2_ERROR_EXPIRED_TOKEN);\n\n break;\n case OAUTH2_GRANT_TYPE_USER_CREDENTIALS:\n if (!$input[\"username\"] || !$input[\"password\"])\n $this->errorJsonResponse(OAUTH2_HTTP_BAD_REQUEST, OAUTH2_ERROR_INVALID_REQUEST, 'Missing parameters. \"username\" and \"password\" required');\n\n $stored = $this->checkUserCredentials($client[0], $input[\"username\"], $input[\"password\"]);\n\n if ($stored === FALSE)\n $this->errorJsonResponse(OAUTH2_HTTP_BAD_REQUEST, OAUTH2_ERROR_INVALID_GRANT);\n\n break;\n case OAUTH2_GRANT_TYPE_ASSERTION:\n if (!$input[\"assertion_type\"] || !$input[\"assertion\"])\n $this->errorJsonResponse(OAUTH2_HTTP_BAD_REQUEST, OAUTH2_ERROR_INVALID_REQUEST);\n\n $stored = $this->checkAssertion($client[0], $input[\"assertion_type\"], $input[\"assertion\"]);\n\n if ($stored === FALSE)\n $this->errorJsonResponse(OAUTH2_HTTP_BAD_REQUEST, OAUTH2_ERROR_INVALID_GRANT);\n\n break;\n case OAUTH2_GRANT_TYPE_REFRESH_TOKEN:\n if (!$input[\"refresh_token\"])\n $this->errorJsonResponse(OAUTH2_HTTP_BAD_REQUEST, OAUTH2_ERROR_INVALID_REQUEST, 'No \"refresh_token\" parameter found');\n\n $stored = $this->getRefreshToken($input[\"refresh_token\"]);\n\n if ($stored === NULL || $client[0] != $stored[\"client_id\"])\n $this->errorJsonResponse(OAUTH2_HTTP_BAD_REQUEST, OAUTH2_ERROR_INVALID_GRANT);\n\n if ($stored[\"expires\"] < time())\n $this->errorJsonResponse(OAUTH2_HTTP_BAD_REQUEST, OAUTH2_ERROR_EXPIRED_TOKEN);\n\n // store the refresh token locally so we can delete it when a new refresh token is generated\n $this->setVariable('_old_refresh_token', $stored[\"token\"]);\n\n break;\n case OAUTH2_GRANT_TYPE_NONE:\n $stored = $this->checkNoneAccess($client[0]);\n\n if ($stored === FALSE)\n $this->errorJsonResponse(OAUTH2_HTTP_BAD_REQUEST, OAUTH2_ERROR_INVALID_REQUEST);\n }\n\n // Check scope, if provided\n if ($input[\"scope\"] && (!is_array($stored) || !isset($stored[\"scope\"]) || !$this->checkScope($input[\"scope\"], $stored[\"scope\"])))\n $this->errorJsonResponse(OAUTH2_HTTP_BAD_REQUEST, OAUTH2_ERROR_INVALID_SCOPE);\n\n if (!$input[\"scope\"])\n $input[\"scope\"] = NULL;\n\n $token = $this->createAccessToken($client[0], $input[\"scope\"]);\n\n $this->sendJsonHeaders();\n echo json_encode($token);\n }",
"public function refresh_token($refresh_token) {\r\n $response = $this->ecobee(\r\n 'POST',\r\n 'token',\r\n array(\r\n 'grant_type' => 'refresh_token',\r\n 'refresh_token' => $refresh_token\r\n )\r\n );\r\n\r\n if(isset($response['access_token']) === false || isset($response['refresh_token']) === false) {\r\n throw new \\Exception('Could not grant token');\r\n }\r\n\r\n $access_token_escaped = $this->mysqli->real_escape_string($response['access_token']);\r\n $refresh_token_escaped = $this->mysqli->real_escape_string($response['refresh_token']);\r\n $query = 'insert into token(`access_token`, `refresh_token`) values(\"' . $access_token_escaped . '\", \"' . $refresh_token_escaped . '\")';\r\n $this->mysqli->query($query) or die($this->mysqli->error);\r\n\r\n return $response;\r\n }",
"public function generateAccessToken()\n {\n $this->access_token = Yii::$app->security->generateRandomString() . '_' . time();\n }",
"public function testCreateAccessTokenFromRefreshTokenResponse()\n {\n $jwsToken = $this->createSimpleJwsToken();\n $tokenManager = $this->createTokenManager($jwsToken);\n $tokenExtractor = new TokenExtractor();\n $refreshToken = new Token($jwsToken->getTokenString(), $tokenExtractor->extract($jwsToken->getTokenString()));\n\n /** @var Token $accessToken */\n $accessToken = $this->callMethod($tokenManager, 'createAccessTokenFromRefreshToken', [$refreshToken]);\n $this->assertInstanceOf(Token::class, $accessToken);\n $this->assertNotEmpty($accessToken->getTokenString());\n }",
"function refreshToken()\n {\n if (empty($this->refreshToken)) {\n throw new OAuth2InvalidRefreshTokenException();\n }\n\n $grant = new RefreshTokenGrant();\n $token = $this->provider->getAccessToken($grant, ['refresh_token' => $this->refreshToken]);\n\n $this->accessToken = $token->getToken();\n $this->refreshToken = $token->getRefreshToken();\n $this->expires = $token->getExpires();\n }",
"public function grantNewAccessToken()\n {\n if (empty($_GET['code'])\n || empty($_GET['state'])\n || $_GET['state'] !== $this->apiConfiguration->ourSecretState()\n ) {\n throw new ThirdPartyConnectionFailedException('Invalid request!');\n }\n\n $headers = array(\n 'Authorization' => sprintf(\n 'Basic %s',\n base64_encode(\n sprintf('%s:%s', $this->apiConfiguration->clientId(), $this->apiConfiguration->clientSecret())\n )\n ),\n );\n\n $accessTokenJsonInfo = $this->curlClient->postUrlEncoded(\n sprintf(\"%s/oauth/token\", self::API_BASE),\n sprintf(\n 'client_id=%s&client_secret=%s&grant_type=authorization_code&redirect_uri=%s&code=%s',\n $this->apiConfiguration->clientId(),\n $this->apiConfiguration->clientSecret(),\n urlencode($this->apiConfiguration->redirectUrl()),\n $_GET['code']\n ),\n $headers\n );\n\n $accessTokenInfo = json_decode($accessTokenJsonInfo, true);\n if (empty($accessTokenInfo['access_token'])) {\n throw new ThirdPartyConnectionFailedException(\n 'An error occurred while getting the access.'\n );\n }\n\n $accessToken = new CommonAccessToken($accessTokenInfo['access_token'], ThirdParty::ZOOM);\n if (!empty($accessTokenInfo['refresh_token'])) {\n $accessToken->setRefreshToken($accessTokenInfo['refresh_token']);\n }\n\n /*\n $refreshTokenJsonInfo = $this->curlClient->post(\n sprintf(\"%s/oauth/token?grant_type=refresh_token&refresh_token=%s\", self::API_BASE, $accessTokenInfo['refresh_token']),\n array(),\n $headers\n );\n\n // if refresh token found, return that or return the access token\n $refreshTokenInfo = json_decode($refreshTokenJsonInfo, true);\n if (!empty($refreshTokenInfo['access_token']) && !empty($refreshTokenInfo['refresh_token'])) {\n $accessToken = new CommonAccessToken($refreshTokenInfo['access_token'], ThirdParty::ZOOM);\n $accessToken->setRefreshToken($refreshTokenInfo['refresh_token']);\n }//*/\n\n return $accessToken;\n }",
"public function getNewAccessTokenTest() {\n\n $client = new Client([\n $this->getApiConfig()->getBaseUrl()\n ]);\n\n $mockSubscriptionResponse = new ApiMockResponse();\n $mock = new Mock([$mockSubscriptionResponse->getSuccessfulRefreshTokenResponse()]);\n $client->getEmitter()->attach($mock);\n\n $authorizationRequest = new RefreshTokenRequest();\n\n\n $bazaarApi = new BazaarApi();\n $bazaarApi->setClient($client);\n $bazaarApi->setApiConfig($this->getApiConfig());\n $bazaarApi->setAccountConfig($this->getAccountConfig());\n\n $fetchRefreshToken = $bazaarApi->refreshToken($authorizationRequest);\n\n $this->assertEquals('uX5qC82EGWjkjjeyvTzTufHOM9HZfM', $fetchRefreshToken->getAccessToken());\n $this->assertEquals(3600, $fetchRefreshToken->getExpireIn());\n $this->assertEquals(\"androidpublisher\", $fetchRefreshToken->getScope());\n $this->assertEquals(\"Bearer\", $fetchRefreshToken->getTokenType());\n\n }",
"public function getAccessToken()\n {\n // Check if we are authenticated\n if ($this->isAuthenticated()) {\n // Try to refresh the token if required and possible\n return $this->refreshTokenIfPossible();\n }\n\n // Retrieve the Google authenticator\n $authenticator = $this->authenticator();\n\n // Retrieve the access token by refresh token\n $accessToken = $authenticator->loginByRefreshToken($this->token);\n\n // Add the refresh token to the access token\n $accessToken->setRefreshToken($this->token);\n\n // Dispatch event to listeners\n $this->dispatchEvent(static::EVENT_ACCESS_TOKEN, $accessToken);\n\n // Add the access token to the manager\n $this->setAccessToken($accessToken);\n\n return $accessToken;\n }",
"public function setAccessToken($token);",
"public function setAccessToken($token);",
"public function refresh_token() {\n\t\t$args = [\n\t\t\t'body' => [\n\t\t\t\t'grant_type' => 'refresh_token',\n\t\t\t\t'refresh_token' => $this->refresh_token,\n\t\t\t\t'client_id' => $this->client_id,\n\t\t\t\t'client_secret' => $this->client_secret,\n\t\t\t]\n\t\t];\n\t\t$result = wp_remote_post( self::TOKEN_URI, $args );\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$response = json_decode( wp_remote_retrieve_body( $result ) );\n\t\tif ( 200 === wp_remote_retrieve_response_code( $result ) ) {\n\t\t\t$this->set_access_token( $response );\n\t\t\t$this->set_refresh_token( $response );\n\t\t}\n\t}",
"public function refreshOauthToken() {\n $this->log->debug('Refreshing API token...');\n\n $headers = ['Content-Type' => 'application/x-www-form-urlencoded'];\n $data = [\n 'grant_type' => $this->defaultGrantType,\n 'client_id' => 'admin-cli',\n 'username' => $this->username,\n 'password' => $this->password,\n ];\n\n try {\n\n $response = Requests::post($this->tokenBaseUrl, $headers, $data); // raw json string for json in body. no form.\n\n if ($response->status_code == 200) {\n\n $tokenData = json_decode($response->body, true);\n $token = $tokenData['access_token'];\n $expiresIn = $tokenData['expires_in'];\n\n $this->log->debug('Got a new token: ' . substr($token, 0, 20) . '...');\n\n $now = new DateTime();\n $expiresAt = $now->add(new DateInterval('PT' . $expiresIn . 'S'))->format('Y-m-d H:i:s');\n $this->log->debug('This new token expires at ' . $expiresAt);\n\n // save API key into apcu cache\n apcu_store('token__' . $this->username, $token, 60 * 60 * 72);\n apcu_store('token_expires__' . $this->username, $expiresAt, 60 * 60 * 72);\n\n\n } else {\n $this->log->warn('Token API call failed: ' . $response->status_code);\n if ($response->body) $this->log->warn($response->body);\n }\n\n } catch (Requests_Exception $e) { // timeouts, etc.\n $this->log->error($e->getMessage());\n }\n }",
"public function generateAccessToken()\n {\n $this->access_token = Yii::$app->security->generateRandomString($length = 16);\n }",
"public function setAccessToken($accessToken);",
"public function setAccessToken($accessToken);",
"private function getAccessToken() {\n \n $authUrl = $this->driveClient->createAuthUrl();\n $authCode = $_GET['auth'];\n\n /**\n * Exchange authCode for accessToken\n **/\n $accessToken = $this->driveClient->authenticate($authCode);\n $accessTokenObj = json_decode($accessToken);\n\n if ($accessTokenObj->refresh_token) {\n file_put_contents($this->tokenFile, serialize($accessToken));\n } else {\n die(\"No refresh token in response.\");\n }\n return $accessToken;\n }",
"public function refresh_token(){\n\t\t$this->server->addGrantType(new OAuth2\\GrantType\\RefreshToken($this->storage, array(\n\t\t\t\"always_issue_new_refresh_token\" => true,\n\t\t\t\"unset_refresh_token_after_use\" => true,\n\t\t\t\"refresh_token_lifetime\" => 2419200,\n\t\t)));\n\t\t$this->server->handleTokenRequest($this->request)->send();\n\t}",
"public function createRefreshToken(AccessToken &$access_token, $refresh_cache = false)\n {\n $refresh_token = $this->refresh_token_generator->generate(\n RefreshToken::create(\n $access_token,\n $this->configuration_service->getConfigValue('OAuth2.RefreshToken.Lifetime')\n )\n );\n\n return $this->tx_service->transaction(function () use (\n $refresh_token,\n $access_token,\n $refresh_cache\n ) {\n $value = $refresh_token->getValue();\n //hash the given value, bc tokens values are stored hashed on DB\n $hashed_value = Hash::compute('sha256', $value);\n $client_id = $refresh_token->getClientId();\n $user_id = $refresh_token->getUserId();\n $client = $this->client_repository->getClientById($client_id);\n $user = $this->auth_service->getUserById($user_id);\n\n // todo: move to a factory\n $refresh_token_db = new RefreshTokenDB;\n $refresh_token_db->setValue($hashed_value);\n $refresh_token_db->setLifetime($refresh_token->getLifetime());\n $refresh_token_db->setScope($refresh_token->getScope());\n $refresh_token_db->setAudience($access_token->getAudience());\n $refresh_token_db->setFromIp($this->ip_helper->getCurrentUserIpAddress());\n\n $access_token_db = $this->access_token_repository->getByValue(Hash::compute('sha256', $access_token->getValue()));\n $refresh_token_db->setClient($client);\n $refresh_token_db->setOwner($user);\n $refresh_token_db->addAccessToken($access_token_db);\n\n $this->refresh_token_repository->add($refresh_token_db);\n\n $access_token->setRefreshToken($refresh_token);\n // bc refresh token could change\n if($refresh_cache) {\n if($this->clearAccessTokenOnCache($access_token))\n $this->storesAccessTokenOnCache($access_token);\n if($this->clearAccessTokenDBOnCache($access_token_db))\n $this->storeAccessTokenDBOnCache($access_token_db);\n }\n\n $this->cache_service->incCounter\n (\n $client_id . TokenService::ClientRefreshTokensQty,\n TokenService::ClientRefreshTokensQtyLifetime\n );\n\n return $refresh_token;\n });\n\n }",
"public function refreshToken(): void\n {\n $rest = new RestClient($this->endpoint, $this->clientkey);\n $results = $rest->oauth2Principal();\n $this->access_token = $results->access_token;\n $this->expires_in = $results->expires_in;\n $this->token_type = $results->token_type;\n }",
"public function refreshToken();",
"protected function refreshToken() {\n $refresh_token = $this->getRefreshToken();\n if (empty($refresh_token)) {\n throw new SalesforceException(t('There is no refresh token.'));\n }\n\n $data = drupal_http_build_query(array(\n 'grant_type' => 'refresh_token',\n 'refresh_token' => $refresh_token,\n 'client_id' => $this->consumer_key,\n 'client_secret' => $this->consumer_secret,\n ));\n\n $url = $this->login_url . '/services/oauth2/token';\n $headers = array(\n // This is an undocumented requirement on Salesforce's end.\n 'Content-Type' => 'application/x-www-form-urlencoded',\n );\n $response = $this->httpRequest($url, $data, $headers, 'POST');\n\n if ($response->code != 200) {\n // @TODO: Deal with error better.\n throw new SalesforceException(t('Unable to get a Salesforce access token.'), $response->code);\n }\n\n $data = drupal_json_decode($response->data);\n\n if (isset($data['error'])) {\n throw new SalesforceException($data['error_description'], $data['error']);\n }\n\n $this->setAccessToken($data['access_token']);\n $this->setIdentity($data['id']);\n $this->setInstanceUrl($data['instance_url']);\n }"
] | [
"0.68411833",
"0.6765968",
"0.6667055",
"0.65345675",
"0.64238054",
"0.64059895",
"0.6301262",
"0.62515444",
"0.6183198",
"0.61403096",
"0.60716087",
"0.603835",
"0.6031659",
"0.6003754",
"0.5996464",
"0.5970626",
"0.59670055",
"0.595907",
"0.595907",
"0.59255075",
"0.5920498",
"0.5918006",
"0.5910709",
"0.5910709",
"0.5890128",
"0.58748317",
"0.5850709",
"0.5844495",
"0.5793687",
"0.579317"
] | 0.68357533 | 1 |
Log information about which tokens we have. | protected function logTokenData()
{
$this->getLogger()->debug('Token information', [
'accessTokenExists' => isset($this->accessToken),
'accessTokenExpiration' => isset($this->accessToken) ? $this->accessToken->getTokenData()['exp'] : null,
'accessTokenHasExpired' => isset($this->accessToken) ? $this->accessToken->expired() : null,
'refreshTokenExists' => isset($this->refreshToken),
'refreshTokenExpiration' => isset($this->refreshToken) ? $this->refreshToken->getTokenData()['exp'] : null,
'refreshTokenHasExpired' => isset($this->refreshToken) ? $this->refreshToken->expired() : null,
'localTime' => time(),
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hook_token_info() {\n $type = array(\n 'name' => t('Nodes'),\n 'description' => t('Tokens related to individual nodes.'),\n 'needs-data' => 'node',\n );\n\n // Core tokens for nodes.\n $node['nid'] = array(\n 'name' => t(\"Node ID\"),\n 'description' => t(\"The unique ID of the node.\"),\n );\n $node['title'] = array(\n 'name' => t(\"Title\"),\n 'description' => t(\"The title of the node.\"),\n );\n $node['edit-url'] = array(\n 'name' => t(\"Edit URL\"),\n 'description' => t(\"The URL of the node's edit page.\"),\n );\n\n // Chained tokens for nodes.\n $node['created'] = array(\n 'name' => t(\"Date created\"),\n 'description' => t(\"The date the node was posted.\"),\n 'type' => 'date',\n );\n $node['author'] = array(\n 'name' => t(\"Author\"),\n 'description' => t(\"The author of the node.\"),\n 'type' => 'user',\n );\n\n return array(\n 'types' => array('node' => $type),\n 'tokens' => array('node' => $node),\n );\n}",
"public function getLogToken() {\n\t\treturn $this->logToken;\n\t}",
"public function getTokens();",
"public function getTokens();",
"function hook_hook_info_alter(&$hooks) {\n // Our module wants to completely override the core tokens, so make\n // sure the core token hooks are not found.\n $hooks['token_info']['group'] = 'mytokens';\n $hooks['tokens']['group'] = 'mytokens';\n}",
"protected function checkToken() {\n\t\t$content = array();\n\t\t$ok = true;\n\t\tif (!touch($this->config->getSetting('tokensfile'))){ // can't read tokensfile\n\t\t\treturn $this->throwError(\"usedtokens_missingfile\");\n\t\t}\n\t\t$lines = file($this->config->getSetting('tokensfile'), FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n\t\t$file = @fopen($this->config->getSetting('tokensfile'), \"w\");\n\t\tif (!$file){ // can't read tokensfile\n\t\t\treturn $this->throwError(\"usedtokens_missingfile\");\n\t\t}\n\t\tforeach($lines as $line) {\n\t\t\t$tmp = explode(\":\", $line);\n\t\t\tif (($tmp[0] == $this->expires) && ($tmp[1] == $this->user) && ($tmp[2] == $this->tpa)) {\n\t\t\t\t$ok = false;\n\t\t\t}\n\t\t\tif ($tmp[0] > time()){\n\t\t\t\t$content[] = $line;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tif ($ok) {\n\t\t\t$content[] = $this->expires.':'.$this->user.':'.$this->tpa;\n\t\t}\n\t\tif (fwrite($file, implode(\"\\n\", $content)) === false) {\n\t\t\tfclose ($file);\n\t\t\treturn $this->throwError(\"usedtokens_missingfile\");\n\t\t}\n\t\tfclose ($file);\t\t\n\t\tif (!$ok) {\n\t\t\treturn $this->throwError(\"usedtokens_allreadyused\");\n\t\t}\n\t\treturn true;\n\t}",
"public static function test_tokens_stuff() {\n\t\t// self::drop_tokens_table();\n\n\t\tglobal $wpdb;\n\t\techo \"<br>\";\n\t\tif (IFLPMDBManager::does_table_exist_in_database(USER_TOKENS_TABLE_NAME)) {\n\t\t\techo \"Tokens table exists<br>\";\n\t\t} else {\n\t\t\techo \"Tokens table does not exist, creating Tokens table<br>\";\n\t\t\tUserTokens::create_tokens_table();\n\t\t}\n\n\t\t//self::delete_all_tokens_from_tokens_table();\n\n\t\tif (IFLPMDBManager::is_table_empty(USER_TOKENS_TABLE_NAME)) {\n\t\t\techo \"Tokens table is empty<br>\";\n\t\t} else {\n\t\t\t//echo \"Tokens table is not empty<br>\";\n\t\t\t$rows = $wpdb->get_results(\"SELECT COUNT(*) as num_rows FROM \" . USER_TOKENS_TABLE_NAME);\n\t\t\techo \"Tokens table contains \" . $rows[0]->num_rows . \" records.<br>\";\n\t\t}\n\n\t\tpr(UserTokens::get_token_ids_by_user_id(\"0\"));\n\t\techo UserTokens::get_user_id_from_token_id(\"5\") . \"<br>\";\n\t\techo UserTokens::add_token_id_and_user_id_to_tokens_table(\"7\", \"0\") . \"<br>\";\n\t}",
"public function print_token(){ return '<span class=\"robot_token\">'.$this->robot_token.'</span>'; }",
"protected function count_token(){ \n return count(self::$tokens); \n }",
"public static function print_robot_info_token($robot_info){ return '<span class=\"robot_token\">'.$robot_info['robot_token'].'</span>'; }",
"public function token() {\n }",
"function logs(){\n\n\t\t}",
"public function token_fields() {\n\t\t// TODO - Move markup into something - perhaps a renderable interface?\n\t\t$token_name = $this->alias . '_token';\n\t\techo $nonce_field = wp_nonce_field( $this->alias, $token_name, false, false );\n\t\techo $action_field = '<input type=\"hidden\" name=\"action\" value=\"'. $this->alias .'\">';\n\t}",
"public function pt() {\n echo \"<pre>\".print_r($this->tokens,1).\"</pre>\";\n }",
"public function logged();",
"function hook_token_info_alter(&$data) {\n // Modify description of node tokens for our site.\n $data['tokens']['node']['nid'] = array(\n 'name' => t(\"Node ID\"),\n 'description' => t(\"The unique ID of the article.\"),\n );\n $data['tokens']['node']['title'] = array(\n 'name' => t(\"Title\"),\n 'description' => t(\"The title of the article.\"),\n );\n\n // Chained tokens for nodes.\n $data['tokens']['node']['created'] = array(\n 'name' => t(\"Date created\"),\n 'description' => t(\"The date the article was posted.\"),\n 'type' => 'date',\n );\n}",
"public function rememberTokens();",
"public function dumpAccessToken()\n {\n echo \"\\n\" . (!empty($this->_getAccessToken()) ? 'Current token: ' . $this->_getAccessToken() : 'No access token!') . \"\\n\" . \"\\n\";\n }",
"public function tokensForDeletion()\n {\n return $this->stats[self::SHOULD_BE_DELETED];\n }",
"private function fetchTokenLogger(int $count)\n {\n /** @var LoggerInterface|\\PHPUnit_Framework_MockObject_MockObject $logger */\n $logger = $this->getMockBuilder(LoggerInterface::class)\n ->getMock();\n\n for ($tokens = 0; $tokens < $count; ++$tokens) {\n // Since our class instantiates the Lock and passes in the logger, we have to expect these method calls\n // if we want to assert the last method call in this loop.\n $logger->expects($this->any())->method('info')\n ->withConsecutive(['Successfully acquired the \"{resource}\" lock.'],\n ['Expiration defined for \"{resource}\" lock for \"{ttl}\" seconds.'],\n [$this->callback(function ($message) {\n try {\n $this->assertEquals(\n 'Retrieved a new mpx token {token} for user {username} that expires on {date}.',\n $message\n );\n } catch (ExpectationFailedException) {\n return false;\n }\n\n return true;\n }), $this->callback(function ($context) {\n try {\n $this->assertArraySubset([\n 'token' => 'TOKEN-VALUE',\n 'username' => 'mpx/USER-NAME',\n ], $context);\n $this->assertMatchesRegularExpression(\n '!\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}!',\n $context['date']\n );\n } catch (ExpectationFailedException) {\n return false;\n }\n\n return true;\n })]);\n }\n\n return $logger;\n }",
"public function getLog();",
"public function getTokens()\n\t{\n\t\treturn $this->tokens;\n\t}",
"public function get_token_data($event)\n\t{\n\t\t$tokens =& $event['token_data'];\n\n\t\tif (false !== strpos($event['title'], '{DATE}'))\n\t\t{\n\t\t\t$tokens['DATE'] = $this->container->get('user')->format_date(microtime(true));\n\t\t}\n\n\t\tif (false !== strpos($event['title'], '{USERNAME}'))\n\t\t{\n\t\t\t$tokens['USERNAME'] = $this->container->get('user')->data['username'];\n\t\t}\n\t}",
"public function getTokens()\n {\n return $this->tokens;\n }",
"public function getTokens()\n {\n return $this->tokens;\n }",
"public function getTokens()\n {\n return $this->tokens;\n }",
"public function getTokenLifetime(): int;",
"public function getTokenLifetime(): int;",
"public function addToken($info);",
"public function getTokens() {\n\t\treturn $this->tokens;\n\t}"
] | [
"0.59495384",
"0.59135175",
"0.57964456",
"0.57964456",
"0.575971",
"0.57080626",
"0.5653929",
"0.56367695",
"0.5613614",
"0.549529",
"0.5490982",
"0.5456485",
"0.53700686",
"0.53477293",
"0.52602065",
"0.5182986",
"0.512839",
"0.5098037",
"0.5092602",
"0.50870925",
"0.507305",
"0.5038877",
"0.50383145",
"0.502688",
"0.502688",
"0.502688",
"0.50251323",
"0.50251323",
"0.5021456",
"0.5014812"
] | 0.72086954 | 0 |
Method to set the value of field dependencia_nombre | public function setDependenciaNombre($dependencia_nombre)
{
$this->dependencia_nombre = $dependencia_nombre;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDependenciaNombre()\n {\n return $this->dependencia_nombre;\n }",
"function setNombre($val)\n\t { $this->nombre=$val;}",
"function set_nombre($nombre)\n {\n $this->nombre = $nombre;\n }",
"public function setNombre($nombre){\n $this->nombre = $nombre;\n }",
"public function setNombre($nombre){\n $this->nombre = $nombre;\n }",
"public function setNombre($nombre){\n $this->nombre = $nombre;\n }",
"public function setnombreActividad($value){\n\n\t\t$this->_nombreActividad = $value;\n\t}",
"public function setnombre($nombre)\n {\n $this->nombre = $nombre;\n\n }",
"public function setNombre($nom){\n $this->nombre=$nom; \n }",
"public function setNombre($p_nombre){\r\n\t$this->nombre=$p_nombre;\r\n}",
"public function setNombre( $_nombre ) {\n if( strcmp($this->nombre, $_nombre) != 0 ){\n $this->nombre = $_nombre;\n try {\n $this->actualizar();\n }\n catch (MySQLException $e) {\n throw $e;\n }\n }\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n }",
"function cambiarNombre($objeto,$nombre) {\r\n\t$objeto->setNombre($nombre);\r\n}",
"public function SetNombre($nombre);",
"public function setNombres($valor){\n $this->nombres=$valor;\n\n }",
"public function setNameAttribute($valor)\n {\n /*Antes de montar en la db caracteres en minuscula */\n $this->attributes['name'] = strtolower($valor);\n }",
"public function setNombre($nombreApellido){\n\t\t$this->nombreApellido=$nombreApellido;\n\t}",
"public function setUsuario_nombre($usuario_nombre){\n $this->usuario_nombre = $usuario_nombre;\n }",
"public function setNombreAttribute( $value = \"\"){\n \n //sacamos los espacios en el valor recibido\n $value = trim( $value );\n //reemplazamos los espacios en guiones del valor recibido\n $value = str_replace( ' ','_', $value);\n //convertimos el valor recibido a minusculas\n $value = strtolower( $value );\n //asignamos el valor al atributo del Modelo\n $this->attributes['nombre'] = $value;\n\n }",
"public function setNombreTrabajoGrado( $nombre ){\n\t\t$this->nombre = $nombre;\n\t}",
"public function setNombre($n)\n {\n $this->e_nombre = $n;\n }",
"public function getDependenciaId()\n {\n return $this->dependencia_id;\n }",
"public function SetNomeBanco($valor){\n\t\t $this->nomeBanco= $valor;\n\t }",
"public function setNombreAttribute($value){\n $this->attributes['nombre']=strtolower($value);\n }",
"public function SetNome($value)\r\n\t{\r\n\t\t$this->nome = $value;\r\n\t}",
"public function setNombreAttribute($value)\n {\n $this->attributes['nombre'] = mb_strtoupper($value);\n }",
"public function __set($nombre, $valor)\n {\n if ( strpos($nombre,'_') === 0) {\n \n $this->$nombre = $valor; \n } else {\n $this->_datos->$nombre = $valor;\n } \n }",
"public function setNombreProducto($nombreProducto){\n $this->nombreProducto = $nombreProducto;\n }",
"public function setIdnombre($p_idnombre){\r\n\t$this->idnombre=$p_idnombre;\r\n}",
"public function set_nombre_concurso($nombre_concurso){\n\t\t$this->nombre_concurso=$nombre_concurso;\n\t}"
] | [
"0.68823403",
"0.66995054",
"0.6668331",
"0.6518881",
"0.6518881",
"0.6518881",
"0.65096456",
"0.64570594",
"0.64441663",
"0.6395019",
"0.6310658",
"0.6169321",
"0.61625195",
"0.61051446",
"0.60645735",
"0.59644246",
"0.5960418",
"0.59543604",
"0.5951196",
"0.5934447",
"0.5920627",
"0.59152645",
"0.5907692",
"0.5899816",
"0.58508956",
"0.5826705",
"0.5808842",
"0.57948035",
"0.57349706",
"0.5701466"
] | 0.704399 | 0 |
Method to set the value of field dependencia_habilitado | public function setDependenciaHabilitado($dependencia_habilitado)
{
$this->dependencia_habilitado = $dependencia_habilitado;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDependenciaHabilitado()\n {\n return $this->dependencia_habilitado;\n }",
"protected function configurar_dep($dep)\n\t{\n\t\tif ($this->dependencia_esta_configurada($dep)) {\n\t\t\ttoba_logger::instancia()->error(\"La dependencia '$dep' ya ha sido configurada anteriormente\");\n\t\t\tthrow new toba_error_def(\"La dependencia solicitada ya ha sido configurada anteriormente\");\n\t\t}\n\t\t$this->_dependencias_configuradas[] = $dep;\t\t\n\t\t//--- Config. por defecto\n\t\t$this->_dependencias[$dep]->pre_configurar();\n\t\t//--- Config. personalizada\n\t\t//ei_arbol($this->_dependencias, $dep);return;\n\t\t$rpta = $this->invocar_callback('conf__'.$dep, $this->_dependencias[$dep]);\n\t\t//--- Por comodidad y compat.hacia atras, si se responde con algo se asume que es para cargarle datos\n\t\tif (isset($rpta) && $rpta !== apex_callback_sin_rpta) {\n\t\t\t$this->_dependencias[$dep]->set_datos($rpta);\n\t\t}\t\t\n\t\t\n\t\t//--- Config. por defecto\n\t\t$this->_dependencias[$dep]->post_configurar();\n\t}",
"public function setDependency($var) {}",
"function dependencia($id, $carga_en_demanda = true)\n\t{\n\t\t$dependencia = parent::dependencia( $id, $carga_en_demanda );\n\t\tif (! in_array( $id, $this->_dependencias_inicializadas ) ) {\n\t\t\t$parametro['id'] = $id;\n\t\t\t$parametro['nombre_formulario'] = $this->_nombre_formulario;\n\t\t\t$this->inicializar_dependencia( $id, $parametro );\n\t\t}\n\t\t//--- A los eis se les debe configurar cuando estan en servicio\n\t\tif (\t$this->_en_servicio\n\t\t\t\t&& $this->_dependencias[$id] instanceof toba_ei \n\t\t\t\t&& ! $this->dependencia_esta_configurada($id) ) {\n\t\t\t$this->configurar_dep($id);\n\t\t}\n\t\treturn $dependencia;\n\t}",
"public function setIdDependencia($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->id_dependencia !== $v) {\n\t\t\t$this->id_dependencia = $v;\n\t\t\t$this->modifiedColumns[] = SfGuardUserProfilePeer::ID_DEPENDENCIA;\n\t\t}\n\n\t\tif ($this->aTsurDependencias !== null && $this->aTsurDependencias->getIdDependencia() !== $v) {\n\t\t\t$this->aTsurDependencias = null;\n\t\t}\n\n\t\treturn $this;\n\t}",
"function setValorAprobadoBanco(Request $request) {\r\n try {\r\n $result = Estudio::where(\"id\", $request->pk)->update([\"ValorAprobadoBanco\" => str_replace(\".\", \"\", $request->value)]);\r\n if ($result) {\r\n echo json_encode([\"STATUS\" => true, \"MENSAJE\" => \"Información almacenada con éxito\"]);\r\n } else {\r\n echo json_encode([\"STATUS\" => false, \"MENSAJE\" => \"Ocurrio un problema al intentar guardar. Intente de nuevo\"]);\r\n }\r\n } catch (\\Illuminate\\Database\\QueryException $exc) {\r\n $mensaje = (isset($exc->errorInfo[2])) ? $exc->errorInfo[2] : $exc->getMessage();\r\n echo json_encode([\"STATUS\" => false, \"MENSAJE\" => \"Ocurrio un problema al intentar guardar [\" . $mensaje . \"]\"]);\r\n }\r\n }",
"public function setExperienciaHabilitado($experiencia_habilitado)\n {\n $this->experiencia_habilitado = $experiencia_habilitado;\n\n return $this;\n }",
"function setEntregado(){\n\t\t$this->entregado=1;\n\t}",
"public function setDependentOn($val)\n {\n $this->_propDict[\"dependentOn\"] = $val;\n return $this;\n }",
"public function atualizarValor($valorRecebido){\n $this->valor = $valorRecebido;\n }",
"public function dependencia_academico()\n {\n return $this->belongsto(Dependencia::class,'dependencia_academico_id','id');\n }",
"function setBombe(){\r\n\t\t\t$this->estBombe = 1;\r\n\t\t}",
"public function setEncabezado($folio, $fechaEmision, $bIsAfecta, $indiceServicio = null)\n {\n parent::setEncabezado($folio, $fechaEmision, $bIsAfecta, $indiceServicio);\n $this->oEncabezado->setTypeDte(self::CODE_NOTA_CREDITO);\n }",
"public function setnombreActividad($value){\n\n\t\t$this->_nombreActividad = $value;\n\t}",
"public function tbl_setAutoCierre($valor)\n\t{\n\t\t$this->_tbl_autocierre = $valor;\n\t\t$this->autotblx = $this->autotrx = $this->autotdx = $this->autothx = $valor;\n\t}",
"public function setValorHistorico($fValorHistorico) {\n $this->valor_historico = $fValorHistorico;\n }",
"function definirValorBoleto(){\n\t\t\t$valorTotal = $this->getvalor_boleto() * $this->gettotal_empresas();\n\t\t\t\n\t\t\t$this->setvalor_boleto($valorTotal);\t\t\n\t\t}",
"public function edit(Habilidad $habilidad)\n {\n //\n }",
"public function setValor($valor) {\n\t\t$this->valor = $valor;\n\t}",
"public function setDessenha($value){\n\n\t\t$this->dessenha = $value;\n\n\t}",
"function setDeducao ($nValorDeducao) {\n $this->oObjCalculo->setDeducao($nValorDeducao);\n }",
"public function getDependenciaId()\n {\n return $this->dependencia_id;\n }",
"public function testSetResponsableChantier() {\n\n $obj = new Affaires();\n\n $obj->setResponsableChantier(\"responsableChantier\");\n $this->assertEquals(\"responsableChantier\", $obj->getResponsableChantier());\n }",
"public function setDescricaoAttribute($value)\n {\n $this->attributes['descricao'] = $value ;\n }",
"public function getExperienciaHabilitado()\n {\n return $this->experiencia_habilitado;\n }",
"public function setFkUsuario( $value ){\n\n $this->fkUsuario = $value;\n\n }",
"function setBombeProche($nb){\r\n\t\t\t$this->bombeP = $nb;\r\n\t\t}",
"public function setDataVencimento ($oDataVencimento) {\n $this->oDataVencimento = $oDataVencimento;\n }",
"function setDueOn($value) {\n return $this->setFieldValue('due_on', $value);\n }",
"public function setDependenciaId($dependencia_id)\n {\n $this->dependencia_id = $dependencia_id;\n\n return $this;\n }"
] | [
"0.6689955",
"0.5521338",
"0.5444778",
"0.53948784",
"0.534177",
"0.52955735",
"0.5188945",
"0.51869655",
"0.51288533",
"0.51245445",
"0.51220065",
"0.5114741",
"0.51086104",
"0.5064449",
"0.50261",
"0.502556",
"0.49854094",
"0.4984242",
"0.49810466",
"0.49807778",
"0.49579993",
"0.49383283",
"0.4930095",
"0.4925971",
"0.49111068",
"0.48721278",
"0.4870768",
"0.48498663",
"0.48478386",
"0.48449036"
] | 0.71019715 | 0 |
Returns the value of field dependencia_id | public function getDependenciaId()
{
return $this->dependencia_id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getIdDependencia()\n\t{\n\t\treturn $this->id_dependencia;\n\t}",
"public function getDependentId()\n {\n return $this->dependentId;\n }",
"public function sel_dependencia_act($id_dependencia){\n\t\t$resultado1 = NULL;\n\t\t$modelo = new conexion();\n\t\t$conexion = $modelo->get_conexion();\n\t\t$sql = \"SELECT id_dependencia, nom, correo, activi, nove,emp_nit FROM dependencia WHERE id_dependencia=:id_dependencia;\";\n\t\t$result = $conexion->prepare($sql);\n\t\t$result->bindParam(':id_dependencia',$id_dependencia);\n\t\t$result->execute();\n\t\twhile ($f1=$result->fetch()){\n\t\t\t$resultado1[]=$f1;\n\t\t}\n\t\treturn $resultado1;\n\t}",
"public function dependencia_academico()\n {\n return $this->belongsto(Dependencia::class,'dependencia_academico_id','id');\n }",
"function dependencias(){\t \t\t\t\t\t\t\n\t\t$query = $this->db->query(\"select id_dependencia, dependencia from tp_dependencia\"); \t\t\t\n\t\treturn $query;\t\t\t\t\t\t\t\n}",
"public function getId_producto(){\n\t\treturn $this->id_producto;\n\t}",
"public function getDependenciaNombre()\n {\n return $this->dependencia_nombre;\n }",
"public function obtDatosDependencia($id)\n {\n $this->db->where('id', $id);\n return $this->db->get('b_dependencias')->row();\n }",
"public function consultarDependenciaRefrigerio(){\r\n $conexion=new conexion();\r\n \r\n $query = \"SELECT r.idr, d.fechad, d.cedulad, r.dependencia, r.cursoevento, d.iddoc, e.nombree, t.nombretipo\r\n FROM refrigerio as r, documento as d, estatus as e, tipodocumento as t\r\n where r.iddoc = d.iddoc and d.estatus = e.idestatus and d.tipodoc = t.idtipo and r.dependencia=\".\"'\".$this->getdepensol().\"'\";\r\n\r\n \r\n \r\n $result=pg_query($conexion->getStrcnx(),$query);\r\n pg_close($conexion->getStrcnx()); //cerramos la conexion a la db\r\n \r\n return $result;\r\n }",
"public function getIdComunidad()\n {\n return $this->idComunidad;\n }",
"public function getIdEscalaValor( ){\n\t\t\treturn $this->idEscalaValor;\n\t\t}",
"public function GetIdPaiDispositivo()\n\t{\n\t\treturn $this->_phreezer->GetManyToOne($this, \"rel_id_dipositivopai_dispositivofilho\");\n\t}",
"public function getFkDividaModalidadeVigencia()\n {\n return $this->fkDividaModalidadeVigencia;\n }",
"function obtenirReqIdFicheFrais() {\r\n\t\t\t$req = \"select visiteur.nom as nom, visiteur.id as id, visiteur.prenom as prenom from visiteur\";\r\n\t\t\t$res = PdoGsb::$monPdo->query($req);\r\n\t\t\t$visiteur = $res->fetchAll();\r\n\t\t\treturn $visiteur;\r\n\t}",
"public function getIdproducto(){\n return $this->idproducto;\n }",
"public function getIdCompetencia()\n {\n return $this->idCompetencia;\n }",
"protected function get_id_pantalla()\n\t{\n\t\treturn $this->_pantalla_id_servicio;\t\n\t}",
"public function getProducto_idproducto(){\n return $this->producto_idproducto;\n }",
"public function setIdDependencia($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->id_dependencia !== $v) {\n\t\t\t$this->id_dependencia = $v;\n\t\t\t$this->modifiedColumns[] = SfGuardUserProfilePeer::ID_DEPENDENCIA;\n\t\t}\n\n\t\tif ($this->aTsurDependencias !== null && $this->aTsurDependencias->getIdDependencia() !== $v) {\n\t\t\t$this->aTsurDependencias = null;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function facturadoPorDependencia( $ejercicio_id = '', $dependencia_id = '' ){\n\n $ejercicio_id = ( $ejercicio_id ? $ejercicio_id : Session :: get_data( 'eje.id' ) );\n\n if( !isset( $_cached[ __FUNCTION__ ] ) ){\n $dependencia = new Dependencia();\n $dependencia = $dependencia->find_all_by_sql(\n \"SELECT \" .\n \"SUM( impacto.preciof ) AS facturado \" .\n \"FROM \" .\n \"dependencia \" .\n \"Inner Join factura ON factura.dependencia_id = dependencia.id \" .\n \"Inner Join concepto ON concepto.factura_id = factura.id \" .\n \"Inner Join impacto ON impacto.concepto_id = concepto.id \" .\n \"Inner Join estado ON impacto.estado_id = estado.id \" .\n \"WHERE \" .\n ( $ejercicio_id == 'ALL' ? '' : \"AND dependencia.ejercicio_id = '\" . $ejercicio_id . \"' \" ).\n \"AND ( \" .\n \"estado.clave = 'FCT-INI' \" .\n \"OR estado.clave = 'FCT-LST' \" .\n \"OR estado.clave = 'FCT-ENV' \" .\n \"OR estado.clave = 'FCT-PAG' \" .\n \") \"\n );\n\n $dependencia = $dependencia[ 0 ];\n\n $_cached[ __FUNCTION__ ] = $dependencia->facturado;\n\n }\n\n return\n $_cached[ __FUNCTION__ ];\n\n\n }",
"function getIdDepartamento() {\n return $this->idDepartamento;\n }",
"public function getId()\n {\n return $this->registros['empresa_id'];\n }",
"function getIdValue()\n {\n }",
"public function getIdfechamento()\n {\n return $this->idfechamento;\n }",
"public function getIdfechamento()\n {\n return $this->idfechamento;\n }",
"public function consultarIdRefrigerio($depid){\r\n $conexion=new conexion();\r\n\r\n\r\n $query = \"SELECT r.idr, d.fechad, d.cedulad, dep.nombred, r.cursoevento, d.idimg\r\n FROM refrigerio as r, documento as d, departamento as dep\r\n where r.iddoc = d.iddoc and r.dependencia = dep.idd and r.idr=\".\"'\".$this->getidr().\"' and r.dependencia =\".$depid;\r\n\r\n $result=pg_query($conexion->getStrcnx(),$query);\r\n pg_close($conexion->getStrcnx()); //cerramos la conexion a la db\r\n\r\n return $result;\r\n \r\n }",
"public function del_dependencia($id_dependencia){\n\t\t$modelo = new conexion();\n\t\t$conexion = $modelo->get_conexion(); \n\t\t$sql = \"DELETE FROM dependencia WHERE id_dependencia=:id_dependencia;\";\n\t\t$result = $conexion->prepare($sql);\n\t\t$result->bindParam(':id_dependencia',$id_dependencia);\n\n\t\tif(!$result)\n\t\t\techo \"<script>alert('Error al ELIMINAR');</script>\";\n\t\telse\n\t\t\t$result->execute();\n\t}",
"public function getFkTcmgoElementoDePara()\n {\n return $this->fkTcmgoElementoDePara;\n }",
"public function getFechadoId() {\n return $this->fechadoId;\n }",
"public function getFkDividaParcelamento()\n {\n return $this->fkDividaParcelamento;\n }"
] | [
"0.8126983",
"0.6732601",
"0.66900575",
"0.62627804",
"0.6225589",
"0.62223357",
"0.6199781",
"0.61067724",
"0.60965496",
"0.6039034",
"0.603548",
"0.5987359",
"0.5979393",
"0.59341455",
"0.5931363",
"0.59062994",
"0.5904381",
"0.58879846",
"0.5883956",
"0.58213586",
"0.57739586",
"0.57545024",
"0.57532233",
"0.5741318",
"0.5741318",
"0.57350606",
"0.56855977",
"0.56630915",
"0.56623435",
"0.5650589"
] | 0.85155565 | 0 |
Returns the value of field dependencia_nombre | public function getDependenciaNombre()
{
return $this->dependencia_nombre;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDependenciaId()\n {\n return $this->dependencia_id;\n }",
"public function getIdDependencia()\n\t{\n\t\treturn $this->id_dependencia;\n\t}",
"public function setDependenciaNombre($dependencia_nombre)\n {\n $this->dependencia_nombre = $dependencia_nombre;\n\n return $this;\n }",
"public function getNomenclatura()\n {\n return $this->nomenclatura;\n }",
"public function getNombreComunidad()\n {\n return $this->nombreComunidad;\n }",
"public function getnombre()\n {\n return $this->nombre;\n }",
"function consultarNombreCarrera($codProyecto) {\n $cadena_sql = $this->sql->cadena_sql(\"nombre_carrera\", $codProyecto);\n $resultado_carrera = $this->ejecutarSQL($this->configuracion, $this->accesoMyOracle, $cadena_sql, \"busqueda\");\n return $resultado_carrera[0]['NOMBRE'];\n }",
"function busquedaDeNombreEmpresa($dato){\n \t$db = obtenerBaseDeDatos();\n \t$sentencia = $db->prepare(\"SELECT * FROM proveedores WHERE id = ?\");\n \t$sentencia->execute([$dato]);\n \treturn $sentencia->fetchObject()->nombre;\n }",
"function regresa_nombre($db,$unidad_id)\n{\n $name='';\n $sql=\"SELECT nombre FROM crm_unidades WHERE unidad_id=\".$unidad_id.\";\";\n $res=$db->sql_query($sql);\n if ( $db->sql_numrows($res) > 0 )\n {\n $name=$db->sql_fetchfield(0,0,$res);\n }\n return $name;\n}",
"public function GetNombre()\n {\n return $this->_legajo;\n }",
"public function getnombre()\r\n\t{\r\n\t\treturn $this->nombre;\r\n\t}",
"function nombrecampo($numcampo) {\r\nreturn mysql_field_name($this->Consulta_ID, $numcampo);\r\n}",
"public function obtenerNombre() {\n return $this->nombre;\n }",
"public function obtenerNombre() {\n return $this->nombre;\n }",
"function dame_nombre($oferta_id){\r\n\t\t$this->Oferta->recursive = -1;\r\n\t\t$oferta = $this->Oferta->read(null,$oferta_id);\r\n\t\treturn $oferta['Oferta']['name'];\t\t\r\n\t}",
"public function getRelacionamentoNome()\n {\n return $this->RelacionamentoNome;\n }",
"public function getNom_cliente()\n {\n return $this->nom_cliente;\n }",
"public function getNombre(): string\n {\n return $this->e_nombre;\n }",
"public function getNombre()\n {\n return $this->registros['empresa_nombre'];\n }",
"function getDatosNom()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'nom'));\n $oDatosCampo->setEtiqueta(_(\"nombre\"));\n return $oDatosCampo;\n }",
"public function dependencia_academico()\n {\n return $this->belongsto(Dependencia::class,'dependencia_academico_id','id');\n }",
"function nombrecampo($numcampo){\n\t\treturn mysql_field_name($this->consulta_ID, $numcampo);\n\t}",
"function nombrecampo($numcampo){\n\t\treturn mysql_field_name($this->consulta_ID, $numcampo);\n\t}",
"public function nombre()\n {\n return $this->nombre;\n }",
"public function getNom();",
"public function consultarDependenciaRefrigerio(){\r\n $conexion=new conexion();\r\n \r\n $query = \"SELECT r.idr, d.fechad, d.cedulad, r.dependencia, r.cursoevento, d.iddoc, e.nombree, t.nombretipo\r\n FROM refrigerio as r, documento as d, estatus as e, tipodocumento as t\r\n where r.iddoc = d.iddoc and d.estatus = e.idestatus and d.tipodoc = t.idtipo and r.dependencia=\".\"'\".$this->getdepensol().\"'\";\r\n\r\n \r\n \r\n $result=pg_query($conexion->getStrcnx(),$query);\r\n pg_close($conexion->getStrcnx()); //cerramos la conexion a la db\r\n \r\n return $result;\r\n }",
"public function getNombre(){\n\t\t\treturn $this->nombre;\n\t\t}",
"function getDepotName($depot_id)\n\t{\n\t\treturn $this->newQuery()->where('depot_id','=',$depot_id)\n\t\t\t\t\t\t->getVal('name');\n\n\t}",
"public function obtener_nombre($id)\n\t\t{\n\t\t\t$this->load->database();\n\t\t\t$sql = 'select nombre_proveedor from proveedores where id='.$id;\n\t\t\t$consulta=$this->db->query($sql);\n\t\t\t$estado=$consulta->row();\n\t\t\treturn $estado->nombre_proveedor;\n\t\t}",
"public function getNombreDocumento()\n {\n return $this->nombre_documento;\n }"
] | [
"0.70426726",
"0.6685704",
"0.6324483",
"0.6265694",
"0.61799276",
"0.6176998",
"0.61702114",
"0.6118984",
"0.61011666",
"0.6070315",
"0.60674614",
"0.6031206",
"0.60133827",
"0.60133827",
"0.60128784",
"0.60120296",
"0.5994305",
"0.5979244",
"0.5969635",
"0.5951246",
"0.59435457",
"0.5921507",
"0.5921507",
"0.5917591",
"0.591073",
"0.5884477",
"0.58671427",
"0.58621347",
"0.5855536",
"0.5854244"
] | 0.84505975 | 0 |
Returns the value of field dependencia_habilitado | public function getDependenciaHabilitado()
{
return $this->dependencia_habilitado;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDependenciaId()\n {\n return $this->dependencia_id;\n }",
"public function getExperienciaHabilitado()\n {\n return $this->experiencia_habilitado;\n }",
"public function setDependenciaHabilitado($dependencia_habilitado)\n {\n $this->dependencia_habilitado = $dependencia_habilitado;\n\n return $this;\n }",
"public function getIdDependencia()\n\t{\n\t\treturn $this->id_dependencia;\n\t}",
"public function getDependenciaNombre()\n {\n return $this->dependencia_nombre;\n }",
"public function dependencia_academico()\n {\n return $this->belongsto(Dependencia::class,'dependencia_academico_id','id');\n }",
"public function getDeficiencia()\n {\n return $this->deficiencia;\n }",
"public function getHabilidades()\n {\n return $this->habilidades;\n }",
"public function getFkFrotaCombustivel()\n {\n return $this->fkFrotaCombustivel;\n }",
"public function getFkFolhapagamentoEventoFeriasCalculadoDependentes()\n {\n return $this->fkFolhapagamentoEventoFeriasCalculadoDependentes;\n }",
"public function getDependentOn()\n {\n if (array_key_exists(\"dependentOn\", $this->_propDict)) {\n return $this->_propDict[\"dependentOn\"];\n } else {\n return null;\n }\n }",
"function get_datos_habilitacion()\r\n\t{\r\n\t\treturn $this->tabla('habilitacion')->get();\r\n\t}",
"function get_datos_habilitacion($filtro=null)\r\n\t{\r\n\t\t$where = '';\r\n\t\tif (isset($filtro)) {\r\n\t\t\t$where = 'WHERE eh.habilitacion = '.kolla_db::quote($filtro);\r\n\t\t}\r\n\t\t$sql = \"SELECT\r\n\t\t\t\t\teh.habilitacion,\r\n\t\t\t\t\teh.fecha_desde,\r\n\t\t\t\t\teh.fecha_hasta,\r\n\t\t\t\t\teh.paginado,\r\n\t\t\t\t\teh.externa,\r\n\t\t\t\t\teh.anonima,\r\n\t\t\t\t\teh.sistema\r\n\t\t\t\tFROM \r\n\t\t\t\t\tsge_habilitacion eh \r\n\t\t\t\t\t$where\r\n\t\t\t\t\";\r\n\t\treturn consultar_fuente($sql);\r\n\t}",
"public function getAccion($valor_depende)\n {\n if (isset($this->accion)) {\n if ($this->accion == 'desc_teleco') {\n $oDepende = new ubis\\GestorDescTeleco();\n $aOpciones = $oDepende->getListaDescTelecoPersonas($valor_depende);\n $oDesplegable = new web\\Desplegable('', $aOpciones, '', true);\n $despl_depende = $oDesplegable->options();\n }\n }\n\n return $despl_depende;\n }",
"public function sel_dependencia_act($id_dependencia){\n\t\t$resultado1 = NULL;\n\t\t$modelo = new conexion();\n\t\t$conexion = $modelo->get_conexion();\n\t\t$sql = \"SELECT id_dependencia, nom, correo, activi, nove,emp_nit FROM dependencia WHERE id_dependencia=:id_dependencia;\";\n\t\t$result = $conexion->prepare($sql);\n\t\t$result->bindParam(':id_dependencia',$id_dependencia);\n\t\t$result->execute();\n\t\twhile ($f1=$result->fetch()){\n\t\t\t$resultado1[]=$f1;\n\t\t}\n\t\treturn $resultado1;\n\t}",
"public function getContenidoExtraHabilitado()\n {\n return $this->contenidoExtra_habilitado;\n }",
"public function getFkFolhapagamentoUltimoRegistroEventoComplementar()\n {\n return $this->fkFolhapagamentoUltimoRegistroEventoComplementar;\n }",
"public function getFkBeneficioModalidadeConvenioMedico()\n {\n return $this->fkBeneficioModalidadeConvenioMedico;\n }",
"public function getAccepteDepuisQBureau() {\n return $this->accepteDepuisQBureau;\n }",
"public function get_dependency_current_value(): string;",
"public function get_stored_dependency_value(): string;",
"function dependencias(){\t \t\t\t\t\t\t\n\t\t$query = $this->db->query(\"select id_dependencia, dependencia from tp_dependencia\"); \t\t\t\n\t\treturn $query;\t\t\t\t\t\t\t\n}",
"function dependencia($id, $carga_en_demanda = true)\n\t{\n\t\t$dependencia = parent::dependencia( $id, $carga_en_demanda );\n\t\tif (! in_array( $id, $this->_dependencias_inicializadas ) ) {\n\t\t\t$parametro['id'] = $id;\n\t\t\t$parametro['nombre_formulario'] = $this->_nombre_formulario;\n\t\t\t$this->inicializar_dependencia( $id, $parametro );\n\t\t}\n\t\t//--- A los eis se les debe configurar cuando estan en servicio\n\t\tif (\t$this->_en_servicio\n\t\t\t\t&& $this->_dependencias[$id] instanceof toba_ei \n\t\t\t\t&& ! $this->dependencia_esta_configurada($id) ) {\n\t\t\t$this->configurar_dep($id);\n\t\t}\n\t\treturn $dependencia;\n\t}",
"public function getValue($dependency);",
"public function facturadoPorDependencia( $ejercicio_id = '', $dependencia_id = '' ){\n\n $ejercicio_id = ( $ejercicio_id ? $ejercicio_id : Session :: get_data( 'eje.id' ) );\n\n if( !isset( $_cached[ __FUNCTION__ ] ) ){\n $dependencia = new Dependencia();\n $dependencia = $dependencia->find_all_by_sql(\n \"SELECT \" .\n \"SUM( impacto.preciof ) AS facturado \" .\n \"FROM \" .\n \"dependencia \" .\n \"Inner Join factura ON factura.dependencia_id = dependencia.id \" .\n \"Inner Join concepto ON concepto.factura_id = factura.id \" .\n \"Inner Join impacto ON impacto.concepto_id = concepto.id \" .\n \"Inner Join estado ON impacto.estado_id = estado.id \" .\n \"WHERE \" .\n ( $ejercicio_id == 'ALL' ? '' : \"AND dependencia.ejercicio_id = '\" . $ejercicio_id . \"' \" ).\n \"AND ( \" .\n \"estado.clave = 'FCT-INI' \" .\n \"OR estado.clave = 'FCT-LST' \" .\n \"OR estado.clave = 'FCT-ENV' \" .\n \"OR estado.clave = 'FCT-PAG' \" .\n \") \"\n );\n\n $dependencia = $dependencia[ 0 ];\n\n $_cached[ __FUNCTION__ ] = $dependencia->facturado;\n\n }\n\n return\n $_cached[ __FUNCTION__ ];\n\n\n }",
"public function getFkTesourariaBoletimFechados()\n {\n return $this->fkTesourariaBoletimFechados;\n }",
"public function obtenerForeignField($nombrecampo){\n $arreglo=$this->fillRelations();\n $nombrecampoforaneo=null;\n $claseforanea=$this->fieldsLink(false)[$nombrecampo];\n foreach($arreglo[$claseforanea][0] as $campoforaneo=>$campolocal){\n if($nombrecampo===$campolocal){\n $nombrecampoforaneo=$campoforaneo;\n }\n }\n return $nombrecampoforaneo; \n }",
"function get_habilitaciones($where=null)\r\n\t{\r\n\t\t$where = isset($where) ? \" AND \".$where : '';\r\n\t\t$sql = \"SELECT\r\n\t\t\t\t\teh.habilitacion\t\t\t\t\t\t\tAS habilitacion,\r\n\t\t\t\t\teh.encuesta \t\t\t\t\t\t\tAS encuesta,\r\n\t\t\t\t\tea.nombre\t\t\t\t\t\t\t\tAS nombre,\r\n\t\t\t\t\teh.fecha_desde\t\t\t\t\t\t\tAS fecha_desde,\r\n\t\t\t\t\teh.fecha_hasta\t\t\t\t\t\t\tAS fecha_hasta,\r\n\t\t\t\t\t(substr(fecha_desde::text,9,2)||'/'||substr(fecha_desde::text,6,2)||'/'||\r\n\t\t\t\t\t\tsubstr(fecha_desde::text,1,4)||' - '|| substr(fecha_hasta::text,9,2)||'/'||\r\n\t\t\t\t\t\tsubstr(fecha_hasta::text,6,2)||'/'||substr(fecha_hasta::text,1,4)) \tAS fechas\r\n\t\t\t\tFROM \r\n\t\t\t\t\tsge_encuesta_atributo ea, \r\n\t\t\t\t\tsge_habilitacion eh\r\n\t\t\t\tWHERE \r\n\t\t\t\t\tea.encuesta = eh.encuesta\r\n\t\t\t\t\t$where\r\n\t\t\t\tORDER BY nombre\r\n\t\t\";\t\t\r\n\t\treturn consultar_fuente($sql);\r\n\t}",
"public function getFlagConfirmada()\n {\n return $this->getModel()->getValor(\"flagConfirmada\");\n }",
"public function obtDatosDependencia($id)\n {\n $this->db->where('id', $id);\n return $this->db->get('b_dependencias')->row();\n }"
] | [
"0.6382586",
"0.6329227",
"0.6242692",
"0.6221248",
"0.6165731",
"0.6080359",
"0.5783879",
"0.5749696",
"0.56813955",
"0.5602178",
"0.5566274",
"0.55635846",
"0.55629635",
"0.55094194",
"0.5506105",
"0.5501853",
"0.54667646",
"0.5430868",
"0.53958786",
"0.53949183",
"0.5349357",
"0.5344721",
"0.53157467",
"0.52810985",
"0.52660596",
"0.5237767",
"0.523725",
"0.5218009",
"0.52175057",
"0.5198998"
] | 0.8228036 | 0 |
Returns the current prompt string | public function prompt() {
return $this->prompt;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPromptString()\n {\n return $this->_prompt;\n }",
"public function getPrompt(){\n\t\t\t\tif(!$this->prompt){\n\n\t\t\t\t\t$this->prompt\t=\tnew Prompt();\n\n\t\t\t\t}\n\n\t\t\t\treturn $this->prompt;\n\n\t\t\t}",
"public function getAutoDetectPromptString()\n {\n return $this->_autoDetectPrompt;\n }",
"public function getPrompt()\n {\n return null;\n }",
"public function prompt(string $msg)\n {\n return $msg;\n }",
"public function needsPrompt()\n {\n return $this->prompt;\n }",
"public function input()\n {\n return call_user_func_array('Zend\\Console\\Prompt\\Line::prompt', func_get_args());\n }",
"public function key()\n {\n return call_user_func_array('Zend\\Console\\Prompt\\Char::prompt', func_get_args());\n }",
"protected function prompt() {\n return\n '<form action=\"' . t3lib_div::getIndpEnv('REQUEST_URI') . '\" method=\"POST\">' .\n '<p>This script will do the following:</p>' .\n '<ul>' .\n '<li>Import the backend layouts to your template root pid.</li>' .\n '<li></li>' .\n '</ul>' .\n '<p><b>Warning!</b> All current backend layouts will be removed!</p>' .\n '<br />' .\n 'PID of your template root: <input name=\"templatepid\" type=\"text\" size=\"30\" maxlength=\"40\">' .\n '<br /><br />' .\n '<input type=\"submit\" name=\"nssubmit\" value=\"Update\" /></form>';\n }",
"function displayPrompt() {\n echo '(N)ew item, (R)emove item, (S)ave, (Q)uit : ';\n}",
"public function promptCurrIP()\n {\n $prompt = null;\n\n $prompt = $prompt . '\n<div class=\"typo3-message message-information\">\n <div class=\"message-body\">\n ' . $GLOBALS[ 'LANG' ]->sL( 'LLL:EXT:radialsearch/lib/userfunc/locallang.xml:promptCurrIPBody' ) . ': ' . t3lib_div :: getIndpEnv( 'REMOTE_ADDR' ) . '\n </div>\n</div>';\n\n return $prompt;\n }",
"private function serverPrompt()\n {\n\n $server_prompt = null;\n\n if ( empty( $this->prompts ) )\n {\n return;\n }\n\n foreach ( $this->prompts as $prompt )\n {\n list( $subpartMarker, $marker[ '###TYPE###' ], $marker[ '###PROMPT###' ] ) = explode( '|', $prompt );\n//var_dump( __METHOD__, __LINE__, $prompt );\n $subpart = $this->template( '###' . $subpartMarker . '###' );\n $subpart = $this->pObj->cObj->substituteMarkerArray( $subpart, $marker );\n $server_prompt = $server_prompt\n . $subpart;\n }\n\n $marker = array(\n '###SERVER_PROMPT###' => $server_prompt\n );\n\n $this->content = $this->pObj->cObj->substituteMarkerArray( $this->content, $marker );\n }",
"function getUserAnswer(string $message): string\n{\n return \\cli\\prompt($message);\n}",
"public function getInput(): string\r\n {\r\n return $this->terminal->read();\r\n }",
"public function confirm()\n {\n return call_user_func_array('Zend\\Console\\Prompt\\Confirm::prompt', func_get_args());\n }",
"private static function prompt(array $info): string\n {\n $prompt = $info['prompt'] ?? 'QUESTION?';\n $options = $info['options'] ?? [];\n\n if ($options) {\n if (($info['displayType'] ?? '') == 'list' &&\n self::isAssocArray($options)\n ) {\n $prompt .= \"\\n\";\n\n foreach ($options as $value) {\n $label = $value['label'] ?? $value;\n\n $prompt .= $label . \"\\n\";\n }\n\n $options = array_keys($options);\n } else {\n if (self::isAssocArray($options)) {\n $options = array_keys($options);\n }\n\n $prompt .= ' [' . implode('|', $options) . ']';\n }\n }\n\n do {\n self::echoMsg(\"\\n$prompt - \", ['newline' => false]);\n\n $stdin = fopen('php://stdin', 'r');\n $response = trim(fgets($stdin));\n\n //select value by a number instead of the real value.\n $selectByIndex = $info['selectByIndex'] ?? null;\n\n if ($selectByIndex && is_numeric($response)) {\n //index is started by 1.\n $response = $options[$response - 1] ?? $response;\n }\n\n if ($response && $options && !in_array($response, $options)) {\n self::echoMsg(\"Invalid option\");\n $valid = false;\n } else {\n $valid = true;\n }\n } while (!$valid);\n\n return $response;\n }",
"public function isPrompt()\n {\n if ($this->prompt_or_answer === 'prompt') {\n return true;\n }\n else {\n return false;\n }\n }",
"public function ask(string $prompt, string $default = null): ?string\n {\n $input = '';\n if ($default) {\n $prompt .= \" [{$default}]\";\n }\n\n $this->stdout->write(\"\\033[32;49m\".$prompt);\n $this->stdout->write(\"\\033[97;49m> \", false);\n $input = $this->stdin->read();\n if ($input === '' && $default) {\n $input = $default;\n }\n\n $this->stdout->write(\"\\033[0m\"); // reset + line break\n\n return $input;\n }",
"public function askSecret(string $prompt): ? string\n {\n $this->stdout->write(\"\\033[32;49m\".$prompt);\n $this->stdout->write(\"\\033[97;49m> \", false);\n\n $stty = $this->sttyInstalled();\n\n if ($stty) {\n $mode = shell_exec('stty -g');\n shell_exec('stty -echo');\n }\n\n $input = $this->stdin->read();\n\n if ($stty) {\n shell_exec(\"stty {$mode}\");\n }\n \n $this->stdout->write(\"\\033[0m\\n\"); // reset + line break\n\n return $input;\n }",
"function ask(string $question, string $default = ''): string\n{\n $answer = readline($question . ($default ? \" ({$default})\" : null) . ': ');\n\n if (!$answer) {\n return $default;\n }\n\n return $answer;\n}",
"public function prompt()\n {\n return 'Run database migrations?';\n }",
"public function setPromptString($prompt)\n {\n $this->_prompt = strval($prompt);\n return $this;\n }",
"public static function getTxtIntroConfirm()\n\t{ \n\t\treturn (string)self::get('txt_intro_confirm');\n\t}",
"public static function prompt($msg, $password = null)\n {\n // output message\n echo PHP_EOL . \"$msg \";\n // if password then disable text output\n if ($password != null) {\n system(\"stty -echo\");\n }\n\n $input = trim(fgets(STDIN));\n\n if ($password != null) {\n system(\"stty echo\");\n echo PHP_EOL; // output end of line because the user's CR won't have been outputted\n }\n return $input;\n }",
"public function getInput() {\n\t\t\t$this->redrawInput();\n\t\t\treturn ncurses_getch();\n\t\t}",
"public function input()\n\t{\n\t\t$name = $this->cli->input('Enter your name');\n\t\t$like = $this->cli->confirm('Do you like beer?');\n\n\t\t$this->cli->wait(5);\n\n\t\t$this->cli->stdout($name . ($like ? ' likes beer' : ' doesn\\'t like beer'));\n\t}",
"public function providePromptArgs()\n {\n return [\n [\n '', '', // token, default\n '<info></info>: ', // formatted\n 'Empty string should produce \"empty\" output.', // message\n ],\n\n [\n 'TOKEN_NAME', '',\n '<info>Token Name</info>: ',\n 'Token name with no default should display [].',\n ],\n\n [\n 'AM_I_AWESOME', 'yes',\n '<info>Am I Awesome</info> [yes]: ',\n 'Token name with default should display fully formatted string.',\n ],\n ];\n }",
"public function promptCredits()\n {\n//.message-notice\n//.message-information\n//.message-ok\n//.message-warning\n//.message-error\n\n $prompt = null;\n\n $prompt = $prompt . '\n<div class=\"message-body\" style=\"max-width:600px;\">\n ' . $GLOBALS[ 'LANG' ]->sL( 'LLL:EXT:radialsearch/lib/userfunc/locallang.xml:promptCredits' ) . '\n</div>';\n\n return $prompt;\n }",
"function getStationName($prompt, $options) {\n\t$station = ask($prompt, $options);\n\t\n\tif($station->value == 'NO_MATCH') {\n\t\tsay(\"Sorry, I dont recognize that station.\", array(\"voice\" => $options[\"voice\"]));\n\t\treturn getStationName($prompt, $options);\n\t}\n\t\n\t// Attempts over.\n\tif($station->value == '') {\n\t\tsay(\"Sorry, I did not get your response. Please try again later. Goodbye\", array(\"voice\" => $options[\"voice\"]));\n\t\thangup();\n\t}\n\t\n\tif($station->choice->confidence < CONFIDENCE_LEVEL) {\n\t\tsay(\"I think you said, \" . $station->value . \".\", array(\"voice\" => $options[\"voice\"]));\n\t\tif(confirmEntry($options[\"voice\"])) {\n\t\t\treturn $station->value;\n\t\t}\n\t\telse {\n\t\t\t_log(\"*** Caller rejected recognized input. ***\");\n\t\t\treturn getStationName($prompt, $options);\n\t\t}\n\t}\n\telse {\n\t\treturn $station->value;\n\t}\n}",
"public function askCommand()\n {\n $a = Interact::ask('you name is: ', null, function ($val, &$err) {\n if (!preg_match('/^\\w{2,}$/', $val)) {\n $err = 'Your input must match /^\\w{2,}$/';\n\n return false;\n }\n\n return true;\n });\n\n $this->write('Your answer is: ' . $a);\n }"
] | [
"0.8981148",
"0.7701859",
"0.7680852",
"0.7565146",
"0.69208187",
"0.6843578",
"0.6733962",
"0.6725774",
"0.65460396",
"0.6476106",
"0.6440198",
"0.6426336",
"0.6411783",
"0.6300017",
"0.6152748",
"0.6076344",
"0.6045291",
"0.59516627",
"0.59499407",
"0.59369624",
"0.58527225",
"0.5841679",
"0.57819396",
"0.57614964",
"0.573765",
"0.5733588",
"0.57300895",
"0.57247406",
"0.5695946",
"0.5680705"
] | 0.8484248 | 1 |
Returns the history file | public function historyFile() {
return getenv('HOME') . '/.iphpHistory';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_search_history()\n {\n clearos_profile(__METHOD__, __LINE__);\n try {\n $file = new File(self::FOLDER_MARKETPLACE . '/' . self::FILE_SEARCH_HISTORY . '.' . $this->CI->session->userdata['username']);\n $history = array();\n\n // If we haven't yet initialized, set default\n if (!$file->exists())\n $this->reset_search_criteria();\n\n $contents = $file->get_contents_as_array();\n\n foreach ($contents as $search) {\n $info = (array)json_decode($search);\n array_push($history, $info);\n }\n return $history;\n\n } catch (Exception $e) {\n throw new Engine_Exception(clearos_exception_message($e), CLEAROS_ERROR);\n }\n }",
"public function getHistory()\n {\n return $this->_history;\n }",
"public function history() {\n return $this->history;\n }",
"function get_history($file_id) {\n if ($file_id === false) {\n return false;\n }\n $stmt = $this->db_lib->prepared_execute(\n $this->DB->jugaad,\n \"SELECT `id`, `action`, `timestamp`, `created_by` FROM `file_versions` WHERE `file_id`=? ORDER BY `id` DESC\",\n \"i\",\n [$file_id]\n );\n if (!$stmt) {\n return false;\n }\n $history_list = $stmt->get_result()->fetch_all(MYSQLI_ASSOC);\n return $history_list;\n }",
"public function get_all_history()\n {\n $sentence = new SentenceUtil();\n $sentence->fromCommand(\"/system/history/getall\");\n $this->talker->send($sentence);\n $rs = $this->talker->getResult();\n $i = 0;\n if ($i < $rs->size()) {\n return $rs->getResultArray();\n } else {\n return \"No History\";\n }\n }",
"function history() {\n\t\tglobal $wgUser, $wgOut, $wgLang, $wgShowUpdatedMarker, $wgRequest,\n\t\t\t$wgTitle, $wgUseValidation;\n\n\t\t/*\n\t\t * Allow client caching.\n\t\t */\n\n\t\tif( $wgOut->checkLastModified( $this->mArticle->getTimestamp() ) )\n\t\t\t/* Client cache fresh and headers sent, nothing more to do. */\n\t\t\treturn;\n\n\t\t$fname = 'PageHistory::history';\n\t\twfProfileIn( $fname );\n\n\t\t/*\n\t\t * Setup page variables.\n\t\t */\n\t\t$wgOut->setPageTitle( $this->mTitle->getPrefixedText() );\n\t\t$wgOut->setSubtitle( wfMsg( 'revhistory' ) );\n\t\t$wgOut->setArticleFlag( false );\n\t\t$wgOut->setArticleRelated( true );\n\t\t$wgOut->setRobotpolicy( 'noindex,nofollow' );\n\n\t\t/*\n\t\t * Fail if article doesn't exist.\n\t\t */\n\t\t$id = $this->mTitle->getArticleID();\n\t\tif( $id == 0 ) {\n\t\t\t$wgOut->addWikiText( wfMsg( 'nohistory' ) );\n\t\t\twfProfileOut( $fname );\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * Extract limit, the number of revisions to show, and\n\t\t * offset, the timestamp to begin at, from the URL.\n\t\t */\n\t\t$limit = $wgRequest->getInt('limit', 50);\n\t\t$offset = $wgRequest->getText('offset');\n\n\t\t/* Offset must be an integral. */\n\t\tif (!strlen($offset) || !preg_match(\"/^[0-9]+$/\", $offset))\n\t\t\t$offset = 0;\n\n\t\t/*\n\t\t * \"go=last\" means to jump to the last history page.\n\t\t */\n\t\tif (($gowhere = $wgRequest->getText(\"go\")) !== NULL) {\n\t\t\tswitch ($gowhere) {\n\t\t\tcase \"first\":\n\t\t\t\tif (($lastid = $this->getLastOffsetForPaging($id, $limit)) === NULL)\n\t\t\t\t\tbreak;\n\t\t\t\t$gourl = $wgTitle->getLocalURL(\"action=history&limit={$limit}&offset={$lastid}\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$gourl = NULL;\n\t\t\t}\n\n\t\t\tif (!is_null($gourl)) {\n\t\t\t\t$wgOut->redirect($gourl);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Fetch revisions.\n\t\t *\n\t\t * If the user clicked \"previous\", we retrieve the revisions backwards,\n\t\t * then reverse them. This is to avoid needing to know the timestamp of\n\t\t * previous revisions when generating the URL.\n\t\t */\n\t\t$direction = $this->getDirection();\n\t\t$revisions = $this->fetchRevisions($limit, $offset, $direction);\n\t\t$navbar = $this->makeNavbar($revisions, $offset, $limit, $direction);\n\n\t\t/*\n\t\t * We fetch one more revision than needed to get the timestamp of the\n\t\t * one after this page (and to know if it exists).\n\t\t *\n\t\t * linesonpage stores the actual number of lines.\n\t\t */\n\t\tif (count($revisions) < $limit + 1)\n\t\t\t$this->linesonpage = count($revisions);\n\t\telse\n\t\t\t$this->linesonpage = count($revisions) - 1;\n\n\t\t/* Un-reverse revisions */\n\t\tif ($direction == DIR_PREV)\n\t\t\t$revisions = array_reverse($revisions);\n\n\t\t/*\n\t\t * Print the top navbar.\n\t\t */\n\t\t$s = $navbar;\n\t\t$s .= $this->beginHistoryList();\n\t\t$counter = 1;\n\n\t\t/*\n\t\t * Print each revision, excluding the one-past-the-end, if any.\n\t\t */\n\t\tforeach (array_slice($revisions, 0, $limit) as $i => $line) {\n\t\t\t$first = !$i && $offset == 0;\n\t\t\t$next = isset( $revisions[$i + 1] ) ? $revisions[$i + 1 ] : null;\n\t\t\t$s .= $this->historyLine($line, $next, $counter, $this->getNotificationTimestamp(), $first);\n\t\t\t$counter++;\n\t\t}\n\n\t\t/*\n\t\t * End navbar.\n\t\t*/\n\t\t$s .= $this->endHistoryList();\n\t\t$s .= $navbar;\n\n\t\t/*\n\t\t * Article validation line.\n\t\t */\n\t\tif ($wgUseValidation)\n\t\t\t$s .= '<p>' . Validation::getStatisticsLink( $this->mArticle ) . '</p>' ;\n\n\t\t$wgOut->addHTML( $s );\n\t\twfProfileOut( $fname );\n\t}",
"public function saveHistory()\n {\n if ($this->_sourceFilename == $this->getFileName(\n $this->_view,\n $this->_moduleName,\n MB_HISTORYMETADATALOCATION\n )\n ) {\n foreach (array(MB_WORKINGMETADATALOCATION, MB_CUSTOMMETADATALOCATION, MB_BASEMETADATALOCATION) as $type) {\n if (file_exists($this->getFileName($this->_view, $this->_moduleName, $type))) {\n $this->_history->append($this->getFileName($this->_view, $this->_moduleName, $type));\n break;\n }\n }\n } else {\n $this->_history->append($this->_sourceFilename);\n }\n }",
"public function getHistory() {\n return $this->history->getValues();\n }",
"public function getHistoryContent()\n {\n $history = $this->_wiki->historyLatest;\n return $history ? $history->content : '';\n }",
"public static function getName()\n {\n return 'history';\n }",
"function history() {\n\t}",
"function getCallHistory()\n\t{\n\t\treturn $this->call_hist;\n\t}",
"function getHistory() {\n\t\treturn $this->query_history;\n\t}",
"public function getHistory($username=\"this\") {\r\n\t\tif ($username==\"this\") return $this->UserDBHelper->getHistory(\"*\");\r\n\t\telse return $this->UserDBHelper->getHistory($username);\r\n\t}",
"public function history($name) {\n return $this->get('/images/' . $name . '/history');\n }",
"protected function filename()\n {\n return 'workorderHistories';\n }",
"public function getRelevantHistory()\n {\n return $this->relevantHistory;\n }",
"public function getHistoryData() {\n return \"No History Data\"; \n }",
"public function testPathHistory()\n {\n $history = $this->repository->getHistory(2, 0, $this->variables['pathHistory']);\n $this->assertNotEmpty($history);\n $this->assertContainsOnlyInstancesOf(Commit::class, $history);\n $this->assertCount(2, $history);\n\n foreach ($history as $commit) {\n /* @var $commit Commit */\n $commit = $this->repository->getCommit($commit->getId());\n $this->assertNotEmpty($commit->getChangedFiles());\n $hasCurrentFile = false;\n foreach ($commit->getChangedFiles() as $file) {\n /* @var $file File */\n $this->assertInstanceOf(File::class, $file);\n if ($this->variables['pathHistory'] === $file->getPathname()) {\n $hasCurrentFile = true;\n }\n }\n $this->assertTrue($hasCurrentFile);\n }\n\n return $history;\n }",
"public function getRecordHistory()\n {\n return $this->_recordHistory;\n }",
"public function getRevisionLog();",
"public function getHistory() {\n\n\t\tglobal $db;\n\n\t\tif ( $this->history == null ) {\n\n\t\t\t$this->history = array();\n\t\t\t$dateActioned = $db->getUnixTimeStamp( 'h.date_actioned' );\n\t\t\t$sql = \" select t.id,\n\t\t\t\t\th.id as historyID, h.name, $dateActioned as dateCreated, h.description,\n\t\t\t\t\ts.id as statusID, s.name as statusName, s.closed as statusClosed,\n\t\t\t\t\tsi.id as statusIconID, si.name as statusIconName, si.filename as statusIconFile,\n\t\t\t\t\ttt.id as typeID, tt.name as typeName,\n\t\t\t\t\ttti.id as typeIconID, tti.name as typeIconName, tti.filename as typeIconFile,\n\t\t\t\t\tp.id as priorityID, p.name as priorityName,\n\t\t\t\t\tpi.id as priorityIconID, pi.name as priorityIconName, pi.filename as priorityIconFile,\n\t\t\t\t\tu.id as creatorID, u.name as creatorName, u.email as creatorEmail,\n\t\t\t\t\tpr.id as projectID, pr.name as projectName, pr.parent_id as projectParentID,\n\t\t\t\t\tgr.id as projectGroupID, gr.name as projectGroupName\n\t\t\t\tfrom tasks t\n\t\t\t\t\tright outer join task_history h\n\t\t\t\t\ton h.task_id = t.id\n\t\t\t\t\tinner join task_status s\n\t\t\t\t\ton s.id = h.status_id\n\t\t\t\t\tinner join task_priorities p\n\t\t\t\t\ton p.id = h.priority_id\n\t\t\t\t\tinner join task_types tt\n\t\t\t\t\ton tt.id = h.type_id\n\t\t\t\t\tinner join users u\n\t\t\t\t\ton u.id = h.user_id\n\t\t\t\t\tleft outer join icons tti\n\t\t\t\t\ton tti.id = tt.icon\n\t\t\t\t\tleft outer join icons si\n\t\t\t\t\ton si.id = s.icon\n\t\t\t\t\tleft outer join icons pi\n\t\t\t\t\ton pi.id = p.icon\n\t\t\t\t\tinner join projects pr\n\t\t\t\t\ton pr.id = h.project_id\n\t\t\t\t\tinner join groups gr\n\t\t\t\t\ton gr.id = pr.group_id\n\t\t\t\twhere t.id = '$this->id'\n\t\t\t\torder by h.date_actioned asc \";\n\t\t\tif ( !$res = $db->query($sql) )\n\t\t\t\tError::fatal( $db->getError(), Error::SYS );\n\n\t\t\twhile ( $row = $res->fetch() ) {\n\t\t\t\t$task = Task::getTaskFromRow($row);\n\t\t\t\tarray_unshift( $this->history, $task );\n\t\t\t\tif ( sizeof($this->history) > 0 )\n\t\t\t\t\t$task->previous = $this->history[1];\n\t\t\t}\n\n\t\t\t// now we have ths histories, we can\n\t\t\t// query for any attached documents\n\t\t\t// and then add them to the histories\n\t\t\t$dateCreated = $db->getUnixTimeStamp( 'd.date_created' );\n\t\t\t$sql = \" select h.id as historyID,\n\t\t\t\t\td.id as id, d.name, $dateCreated as dateCreated, d.bin_size, d.bin_type,\n\t\t\t\t\tu.id as userID, u.name as userName, u.email as userEmail\n\t\t\t\tfrom task_history h\n\t\t\t\t\tleft outer join task_docs td\t\t\t\t\t\t\n\t\t\t\t\ton td.task_history_id = h.id\n\t\t\t\t\tinner join docs d\n\t\t\t\t\ton d.id = td.doc_id\n\t\t\t\t\tinner join users u\n\t\t\t\t\ton u.id = d.user_id\n\t\t\t\twhere h.task_id = '$this->id' \";\n\t\t\tif ( !$res = $db->query($sql) )\n\t\t\t\tError::fatal( $db->getError(), Error::SYS );\n\n\t\t\twhile ( $row = $res->fetch() )\n\t\t\t\tforeach ( $this->history as $history )\n\t\t\t\t\tif ( $history->historyID == $row->historyID )\n\t\t\t\t\t\t$history->addDocument( new Document(\n\t\t\t\t\t\t\t$row->id, $row->name,\n\t\t\t\t\t\t\tnew User($row->userID,$row->userName,$row->userEmail),\n\t\t\t\t\t\t\t$row->dateCreated, $row->bin_size, $row->bin_type\n\t\t\t\t\t\t));\n\n\t\t}\n\n\t\treturn $this->history;\n\n\t}",
"private function getHistory()\n {\n $action = $this->getGET('action', null);\n if ($action == \"delete\") {\n /* @var User $user */\n $user = $this->data['user'];\n $history = $user->history;\n if (key_exists($_GET['key'], $history)) {\n unset($history[$_GET['key']]);\n $user->history = $history;\n $user->save();\n FlashMessage::add(FlashMessage::TYPE_SUCCESS, 'Datensatz erfolgreich gelöscht.');\n Helpers::redirect(str_replace('&edit=1', '', $_SERVER['REQUEST_URI']));\n }\n }\n }",
"public function history(): mixed\n {\n $payload = Payload::list('fx');\n\n return $this->transporter->get($payload->uri)->throw()->json('data');\n }",
"public function getHistory(): GetHistory\n {\n return new GetHistory($this->_provider);\n }",
"public function getWeatherHistory()\n {\n return $this->myHistory;\n }",
"function getFileHistoryUrl($revision, $path, $peg_revision) {\n $params = array('repository_id'=>$this->getId(), 'project_id'=>$this->getProjectId());\n \n if($revision !== null) {\n if (instance_of($revision, 'Commit')) {\n $params['r'] = $revision->getRevision();\n } else {\n $params['r'] = $revision;\n } // if\n } // if\n \n if ($peg_revision !== null) {\n $params['peg'] = $peg_revision;\n } // if\n \n if($path !== null) {\n $params['path'] = $path;\n } // if\n \n return assemble_url('repository_file_history',$params);\n }",
"public function getHistory(): string\n {\n $scrollback = '';\n $last_attr = $this->base_attr_cell;\n for ($i = 0; $i < count($this->history); $i++) {\n for ($j = 0; $j <= $this->max_x + 1; $j++) {\n $cur_attr = $this->history_attrs[$i][$j];\n $scrollback .= $this->processCoordinate($last_attr, $cur_attr, $this->history[$i][$j] ?? '');\n $last_attr = $this->history_attrs[$i][$j];\n }\n $scrollback .= \"\\r\\n\";\n }\n $base_attr_cell = $this->base_attr_cell;\n $this->base_attr_cell = $last_attr;\n $scrollback .= $this->getScreen();\n $this->base_attr_cell = $base_attr_cell;\n\n return '<pre width=\"' . ($this->max_x + 1) . '\" style=\"color: white; background: black\">' . $scrollback . '</span></pre>';\n }",
"function get_history($start=0, $limit=0){\r\n\t\t$url = \"http://{$this->host}:{$this->port}/sabnzbd/api?mode=history&output=xml\";\r\n\t\tif ($start)\r\n\t\t\t$url .= \"&start=\".$start;\r\n\t\tif ($limit)\r\n\t\t\t$url .= \"&limit=\".$limit;\r\n\t\tif ($this->useapi)\r\n\t\t\t$url .= \"&apikey=\".$this->apikey;\r\n\t\t$response = http_get($url, array(\"timeout\"=>20));\r\n\t\treturn simplexml_load_string(trim(http_parse_message($response)->body));\r\n\t}",
"function history()\n {\n return app('history');\n }"
] | [
"0.6921804",
"0.68912274",
"0.6734774",
"0.66819656",
"0.6645958",
"0.6553507",
"0.65498257",
"0.6519735",
"0.6422187",
"0.633894",
"0.63174796",
"0.63042665",
"0.629864",
"0.62646484",
"0.62603223",
"0.61402637",
"0.6110182",
"0.61065465",
"0.609847",
"0.6094084",
"0.6067994",
"0.6063826",
"0.6049142",
"0.60454285",
"0.6037053",
"0.6017637",
"0.5999058",
"0.59978294",
"0.59950286",
"0.59861726"
] | 0.8068822 | 0 |
Get function for specialCommands variable | public function specialCommands() {
return $this->specialCommands;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function getCommands();",
"public function getCmd() { }",
"public function getCommand() : string;",
"abstract protected function getSupportedCommands();",
"public function getCommand();",
"public function getCommand();",
"public function getCommand();",
"public function getCommand();",
"public function getCommands();",
"public function getCommands();",
"public function getCommands();",
"function _getCommands()\n\t{\n\t\t$commands = array\n\t\t(\n array(\"permission\" => \"write\", \"cmd\" => \"questionsTabGateway\", \"lang_var\" => \"tst_edit_questions\"),\n\t\t\tarray(\"permission\" => \"write\", \"cmd\" => \"ilObjTestSettingsGeneralGUI::showForm\", \"lang_var\" => \"settings\"),\n\t\t\tarray(\"permission\" => \"read\", \"cmd\" => \"infoScreen\", \"lang_var\" => \"tst_run\",\n\t\t\t\t\"default\" => true),\n\t\t\t//array(\"permission\" => \"write\", \"cmd\" => \"\", \"lang_var\" => \"edit\"),\n\t\t\tarray(\"permission\" => \"tst_statistics\", \"cmd\" => \"outEvaluation\", \"lang_var\" => \"tst_statistical_evaluation\"),\n\t\t);\n\t\t\n\t\treturn $commands;\n\t}",
"public function _getCommands() {\n\t\t$commands = array();\n\t\t$commands [] = array(\n\t\t\t\"permission\" => \"read\",\n\t\t\t\"cmd\" => \"render\",\n\t\t\t\"lang_var\" => \"show\",\n\t\t\t\"default\" => true\n\t\t);\n\t\t$commands [] = array(\n\t\t\t\"permission\" => \"write\",\n\t\t\t\"cmd\" => \"render\",\n\t\t\t\"lang_var\" => \"edit_content\"\n\t\t);\n\t\t$commands [] = array(\n\t\t\t\"permission\" => \"write\",\n\t\t\t\"cmd\" => \"edit\",\n\t\t\t\"lang_var\" => \"settings\"\n\t\t);\n\n\t\treturn $commands;\n\t}",
"function getCommand($cmd)\n\t{\n\t\treturn $cmd;\n\t}",
"abstract function commands();",
"abstract public function getCmd($vname,$default = false, $method = 'any');",
"public function getCommandText();",
"function _getCommands()\n\t{\n\t\t$commands = array\n\t\t(\n\t\t\tarray(\"permission\" => \"read\", \"cmd\" => \"showOverview\", \"lang_var\" => \"show\",\n\t\t\t\t\"default\" => true),\n\t\t\tarray(\"permission\" => \"write\", \"cmd\" => \"listAssignments\", \"lang_var\" => \"edit_assignments\"),\n\t\t\tarray(\"permission\" => \"write\", \"cmd\" => \"edit\", \"lang_var\" => \"settings\")\n\t\t);\n\t\t\n\t\treturn $commands;\n\t}",
"static function get_commands()\n {\n return Processor::get_commands();\n }",
"abstract public function commands(): array;",
"protected function getAddtionalCommands()\n {\n return [\n 'Codeception\\\\Command\\\\GenerateWPUnit',\n 'Codeception\\\\Command\\\\GenerateWPRestApi',\n 'Codeception\\\\Command\\\\GenerateWPRestController',\n 'Codeception\\\\Command\\\\GenerateWPRestPostTypeController',\n 'Codeception\\\\Command\\\\GenerateWPAjax',\n 'Codeception\\\\Command\\\\GenerateWPCanonical',\n 'Codeception\\\\Command\\\\GenerateWPXMLRPC',\n ];\n }",
"public function getCommandName();",
"protected function getDefaultCommands()\n {\n $getKeyFromFirstArgument = array($this, 'getKeyFromFirstArgument');\n $getKeyFromAllArguments = array($this, 'getKeyFromAllArguments');\n\n return array(\n /* commands operating on the key space */\n 'EXISTS' => $getKeyFromFirstArgument,\n 'DEL' => $getKeyFromAllArguments,\n 'TYPE' => $getKeyFromFirstArgument,\n 'EXPIRE' => $getKeyFromFirstArgument,\n 'EXPIREAT' => $getKeyFromFirstArgument,\n 'PERSIST' => $getKeyFromFirstArgument,\n 'PEXPIRE' => $getKeyFromFirstArgument,\n 'PEXPIREAT' => $getKeyFromFirstArgument,\n 'TTL' => $getKeyFromFirstArgument,\n 'PTTL' => $getKeyFromFirstArgument,\n 'SORT' => $getKeyFromFirstArgument, // TODO\n 'DUMP' => $getKeyFromFirstArgument,\n 'RESTORE' => $getKeyFromFirstArgument,\n\n /* commands operating on string values */\n 'APPEND' => $getKeyFromFirstArgument,\n 'DECR' => $getKeyFromFirstArgument,\n 'DECRBY' => $getKeyFromFirstArgument,\n 'GET' => $getKeyFromFirstArgument,\n 'GETBIT' => $getKeyFromFirstArgument,\n 'MGET' => $getKeyFromAllArguments,\n 'SET' => $getKeyFromFirstArgument,\n 'GETRANGE' => $getKeyFromFirstArgument,\n 'GETSET' => $getKeyFromFirstArgument,\n 'INCR' => $getKeyFromFirstArgument,\n 'INCRBY' => $getKeyFromFirstArgument,\n 'INCRBYFLOAT' => $getKeyFromFirstArgument,\n 'SETBIT' => $getKeyFromFirstArgument,\n 'SETEX' => $getKeyFromFirstArgument,\n 'MSET' => array($this, 'getKeyFromInterleavedArguments'),\n 'MSETNX' => array($this, 'getKeyFromInterleavedArguments'),\n 'SETNX' => $getKeyFromFirstArgument,\n 'SETRANGE' => $getKeyFromFirstArgument,\n 'STRLEN' => $getKeyFromFirstArgument,\n 'SUBSTR' => $getKeyFromFirstArgument,\n 'BITOP' => array($this, 'getKeyFromBitOp'),\n 'BITCOUNT' => $getKeyFromFirstArgument,\n\n /* commands operating on lists */\n 'LINSERT' => $getKeyFromFirstArgument,\n 'LINDEX' => $getKeyFromFirstArgument,\n 'LLEN' => $getKeyFromFirstArgument,\n 'LPOP' => $getKeyFromFirstArgument,\n 'RPOP' => $getKeyFromFirstArgument,\n 'RPOPLPUSH' => $getKeyFromAllArguments,\n 'BLPOP' => array($this, 'getKeyFromBlockingListCommands'),\n 'BRPOP' => array($this, 'getKeyFromBlockingListCommands'),\n 'BRPOPLPUSH' => array($this, 'getKeyFromBlockingListCommands'),\n 'LPUSH' => $getKeyFromFirstArgument,\n 'LPUSHX' => $getKeyFromFirstArgument,\n 'RPUSH' => $getKeyFromFirstArgument,\n 'RPUSHX' => $getKeyFromFirstArgument,\n 'LRANGE' => $getKeyFromFirstArgument,\n 'LREM' => $getKeyFromFirstArgument,\n 'LSET' => $getKeyFromFirstArgument,\n 'LTRIM' => $getKeyFromFirstArgument,\n\n /* commands operating on sets */\n 'SADD' => $getKeyFromFirstArgument,\n 'SCARD' => $getKeyFromFirstArgument,\n 'SDIFF' => $getKeyFromAllArguments,\n 'SDIFFSTORE' => $getKeyFromAllArguments,\n 'SINTER' => $getKeyFromAllArguments,\n 'SINTERSTORE' => $getKeyFromAllArguments,\n 'SUNION' => $getKeyFromAllArguments,\n 'SUNIONSTORE' => $getKeyFromAllArguments,\n 'SISMEMBER' => $getKeyFromFirstArgument,\n 'SMEMBERS' => $getKeyFromFirstArgument,\n 'SSCAN' => $getKeyFromFirstArgument,\n 'SPOP' => $getKeyFromFirstArgument,\n 'SRANDMEMBER' => $getKeyFromFirstArgument,\n 'SREM' => $getKeyFromFirstArgument,\n\n /* commands operating on sorted sets */\n 'ZADD' => $getKeyFromFirstArgument,\n 'ZCARD' => $getKeyFromFirstArgument,\n 'ZCOUNT' => $getKeyFromFirstArgument,\n 'ZINCRBY' => $getKeyFromFirstArgument,\n 'ZINTERSTORE' => array($this, 'getKeyFromZsetAggregationCommands'),\n 'ZRANGE' => $getKeyFromFirstArgument,\n 'ZRANGEBYSCORE' => $getKeyFromFirstArgument,\n 'ZRANK' => $getKeyFromFirstArgument,\n 'ZREM' => $getKeyFromFirstArgument,\n 'ZREMRANGEBYRANK' => $getKeyFromFirstArgument,\n 'ZREMRANGEBYSCORE' => $getKeyFromFirstArgument,\n 'ZREVRANGE' => $getKeyFromFirstArgument,\n 'ZREVRANGEBYSCORE' => $getKeyFromFirstArgument,\n 'ZREVRANK' => $getKeyFromFirstArgument,\n 'ZSCORE' => $getKeyFromFirstArgument,\n 'ZUNIONSTORE' => array($this, 'getKeyFromZsetAggregationCommands'),\n 'ZSCAN' => $getKeyFromFirstArgument,\n 'ZLEXCOUNT' => $getKeyFromFirstArgument,\n 'ZRANGEBYLEX' => $getKeyFromFirstArgument,\n 'ZREMRANGEBYLEX' => $getKeyFromFirstArgument,\n\n /* commands operating on hashes */\n 'HDEL' => $getKeyFromFirstArgument,\n 'HEXISTS' => $getKeyFromFirstArgument,\n 'HGET' => $getKeyFromFirstArgument,\n 'HGETALL' => $getKeyFromFirstArgument,\n 'HMGET' => $getKeyFromFirstArgument,\n 'HMSET' => $getKeyFromFirstArgument,\n 'HINCRBY' => $getKeyFromFirstArgument,\n 'HINCRBYFLOAT' => $getKeyFromFirstArgument,\n 'HKEYS' => $getKeyFromFirstArgument,\n 'HLEN' => $getKeyFromFirstArgument,\n 'HSET' => $getKeyFromFirstArgument,\n 'HSETNX' => $getKeyFromFirstArgument,\n 'HVALS' => $getKeyFromFirstArgument,\n 'HSCAN' => $getKeyFromFirstArgument,\n\n /* commands operating on HyperLogLog */\n 'PFADD' => $getKeyFromFirstArgument,\n 'PFCOUNT' => $getKeyFromAllArguments,\n 'PFMERGE' => $getKeyFromAllArguments,\n\n /* scripting */\n 'EVAL' => array($this, 'getKeyFromScriptingCommands'),\n 'EVALSHA' => array($this, 'getKeyFromScriptingCommands'),\n );\n }",
"public function getCommands()\n {\n return $this->invalidCommands;\n }",
"public function get_function():string;",
"static function getCmd(){\n\t\treturn self::getPage(array('', ''));\n\t}",
"public function getShortcut();",
"public function getShortcut();",
"public function getCommands()\n {\n return [\n new RequireRecipeCommand(),\n new UpdateRecipeCommand(),\n ];\n }",
"public static function getCommands()\n {\n return [\n new LoadCommand(),\n new RegisterCommand(),\n new RemoveCommand(),\n new UnregisterCommand(),\n new UpdateCommand(),\n ];\n }"
] | [
"0.7343184",
"0.71893865",
"0.71246105",
"0.70981985",
"0.7018275",
"0.7018275",
"0.7018275",
"0.7018275",
"0.7015534",
"0.7015534",
"0.7015534",
"0.68006706",
"0.67737",
"0.66548175",
"0.66149884",
"0.6545439",
"0.6545438",
"0.6538784",
"0.651114",
"0.63448",
"0.63443434",
"0.62361616",
"0.6183884",
"0.6163434",
"0.6148806",
"0.61449766",
"0.61268824",
"0.61268824",
"0.61135125",
"0.6092904"
] | 0.74842113 | 0 |
Finds the location of the PHP executable based off the PHP_BINDIR constant | public static function PHPExecutableLocation() {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$phpExecutableName = 'php.exe';
} else {
$phpExecutableName = 'php';
}
return PHP_BINDIR . DIRECTORY_SEPARATOR . $phpExecutableName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPHPExecutableFromPath() {\n\t\tif (defined('PHP_BINDIR') && file_exists(PHP_BINDIR . '/php') && is_executable(PHP_BINDIR . '/php')) {\n\t\t\treturn PHP_BINDIR . '/php';\n\t\t}\n\t\t$paths = explode(PATH_SEPARATOR, getenv('PATH'));\n\t\tforeach ($paths as $path) {\n\t\t\t// we need this for XAMPP (Windows)\n\t\t\tif (strstr($path, 'php.exe') && isset($_SERVER['WINDIR']) && file_exists($path) && is_file($path)) {\n\t\t\t\treturn $path;\n\t\t\t} else {\n\t\t\t\t$php_executable = $path . DIRECTORY_SEPARATOR . 'php' . (isset($_SERVER['WINDIR']) ? '.exe' : '');\n\t\t\t\tif (file_exists($php_executable) && is_file($php_executable)) {\n\t\t\t\t\treturn $php_executable;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn FALSE; // not found\n\t}",
"private function getBinPath()\n {\n $grepBinPath = trim(shell_exec('which grep'));\n $envBinPath = trim(shell_exec('which env'));\n $cmdGetPhpEnv = trim(shell_exec(\"$envBinPath | $grepBinPath PHP\"));\n\n if (!empty($cmdGetPhpEnv)) {\n $phpEnvArray = explode(\"=\", $cmdGetPhpEnv);\n $phpBinPath = $phpEnvArray[1];\n\n return $phpBinPath;\n }\n return false;\n }",
"protected function getExecutable()\n {\n return realpath(__DIR__ . '/../../bin/phptea');\n }",
"protected function phpExecutable()\n {\n return (new PhpExecutableFinder())->find() ?? 'php';\n }",
"public function getPHPExecutable() {\n\t\tif (!$this->phpExecutable) {\n\t\t\t$this->phpExecutable = $this->getConfiguration('phpExecutable');\n\t\t\tif (!$this->phpExecutable) {\n\t\t\t\tif (isset($this->settings['phpExecutable'])) {\n\t\t\t\t\t$this->phpExecutable = $this->settings['phpExecutable'];\n\t\t\t\t} else {\n\t\t\t\t\t$this->phpExecutable = $this->getPHPExecutableFromPath();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->phpExecutable = trim($this->phpExecutable);\n\t\t}\n\t\treturn $this->phpExecutable;\n\t}",
"function php_path()\n{\n if (PHP_PATH != '')\n return PHP_PATH;\n else\n return \"/usr/bin/php\";\n}",
"public static function findPhp(bool $includeArgs = true): string\n {\n $phpFinder = new PhpExecutableFinder();\n if (!$phpPath = $phpFinder->find($includeArgs)) {\n throw new RuntimeException('The php executable could not be found in PATH');\n }\n return $phpPath;\n }",
"protected function phpBinary()\n {\n return ( new PhpExecutableFinder() )->find( false ) ?: 'php';\n }",
"public function getPhpExecutablePath(string $phpVersion = null): string\n {\n if (! $phpVersion) {\n return BREW_PREFIX.'/bin/php';\n }\n\n $phpVersion = PhpFpm::normalizePhpVersion($phpVersion);\n\n // Check the default `/opt/homebrew/opt/[email protected]/bin/php` location first\n if ($this->files->exists(BREW_PREFIX.\"/opt/{$phpVersion}/bin/php\")) {\n return BREW_PREFIX.\"/opt/{$phpVersion}/bin/php\";\n }\n\n // Check the `/opt/homebrew/opt/php71/bin/php` location for older installations\n $phpVersion = str_replace(['@', '.'], '', $phpVersion); // [email protected] to php81\n if ($this->files->exists(BREW_PREFIX.\"/opt/{$phpVersion}/bin/php\")) {\n return BREW_PREFIX.\"/opt/{$phpVersion}/bin/php\";\n }\n\n // Check if the default PHP is the version we are looking for\n if ($this->files->isLink(BREW_PREFIX.'/opt/php')) {\n $resolvedPath = $this->files->readLink(BREW_PREFIX.'/opt/php');\n $matches = $this->parsePhpPath($resolvedPath);\n $resolvedPhpVersion = $matches[3] ?: $matches[2];\n\n if ($this->arePhpVersionsEqual($resolvedPhpVersion, $phpVersion)) {\n return BREW_PREFIX.'/opt/php/bin/php';\n }\n }\n\n return BREW_PREFIX.'/bin/php';\n }",
"function get_php_binary() {\n\t// Phar installs always use PHP_BINARY.\n\tif ( inside_phar() ) {\n\t\treturn PHP_BINARY;\n\t}\n\n\t$wp_cli_php_used = getenv( 'WP_CLI_PHP_USED' );\n\tif ( false !== $wp_cli_php_used ) {\n\t\treturn $wp_cli_php_used;\n\t}\n\n\t$wp_cli_php = getenv( 'WP_CLI_PHP' );\n\tif ( false !== $wp_cli_php ) {\n\t\treturn $wp_cli_php;\n\t}\n\n\treturn PHP_BINARY;\n}",
"public function getExecutablePath();",
"public static function phpBinary()\n {\n return ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false));\n }",
"protected function findComposerBinary()\n {\n if (file_exists(getcwd().'/composer.phar')) {\n return '\"'.PHP_BINARY.'\" composer.phar';\n }\n\n return 'composer';\n }",
"protected function findCommand()\n {\n if (file_exists(getcwd() . DIRECTORY_SEPARATOR . $this->commandPhar)) {\n $command = '\"' . PHP_BINARY . '\" ' . $this->commandPhar;\n }\n\n $commandName = $this->getCommandName();\n\n if (file_exists('/usr/local/bin/' . $commandName)) {\n $command = $commandName;\n }\n\n $command = getcwd() . '/vendor/bin/' . $commandName;\n\n return $command;\n }",
"private function findComposer()\n {\n if (file_exists(getcwd().'/composer.phar')) {\n return '\"'.PHP_BINARY.'\" '.getcwd().'/composer.phar';\n }\n\n return 'composer';\n }",
"protected function findComposer()\n {\n if (file_exists(getcwd().'/composer.phar')) {\n return '\"'.PHP_BINARY.'\" '.getcwd().'/composer.phar';\n }\n\n return 'composer';\n }",
"protected function findComposer()\n {\n if (file_exists(getcwd().'/composer.phar')) {\n return '\"'.PHP_BINARY.'\" '.getcwd().'/composer.phar';\n }\n\n return 'composer';\n }",
"public function getPhpBinPath($version)\n {\n return '/usr/bin/php'.$version;\n }",
"protected function phpBinary()\n {\n return ProcessUtils::escapeArgument(\n (new PhpExecutableFinder)->find(false)\n );\n }",
"function get_mysql_binary_path() {\n\tstatic $path = null;\n\n\tif ( null === $path ) {\n\t\t$result = Process::create( '/usr/bin/env which mysql', null, null )->run();\n\n\t\tif ( 0 !== $result->return_code ) {\n\t\t\t$path = '';\n\t\t} else {\n\t\t\t$path = trim( $result->stdout );\n\t\t}\n\t}\n\n\treturn $path;\n}",
"protected function get_wp_binary_path(): ?string {\n\t\tif ( \\defined( 'TRADUTTORE_WP_BIN' ) && TRADUTTORE_WP_BIN ) {\n\t\t\treturn TRADUTTORE_WP_BIN;\n\t\t}\n\n\t\texec(\n\t\t\tescapeshellcmd( 'which wp' ),\n\t\t\t$output,\n\t\t\t$status\n\t\t);\n\n\t\treturn 0 === $status ? $output[0] : null;\n\t}",
"public function getBinary(): string\n {\n if (self::$initialized) {\n return self::$binary;\n }\n\n if (PHP_BINARY !== '') {\n self::$binary = escapeshellarg(PHP_BINARY);\n self::$initialized = true;\n\n return self::$binary;\n }\n\n // @codeCoverageIgnoreStart\n $possibleBinaryLocations = [\n PHP_BINDIR . '/php',\n PHP_BINDIR . '/php-cli.exe',\n PHP_BINDIR . '/php.exe',\n ];\n\n foreach ($possibleBinaryLocations as $binary) {\n if (is_readable($binary)) {\n self::$binary = escapeshellarg($binary);\n self::$initialized = true;\n\n return self::$binary;\n }\n }\n\n // @codeCoverageIgnoreStart\n self::$binary = 'php';\n self::$initialized = true;\n // @codeCoverageIgnoreEnd\n\n return self::$binary;\n }",
"protected function findComposer()\n {\n $composerPath = getcwd().'/composer.phar';\n\n if (file_exists($composerPath)) {\n return '\"'.PHP_BINARY.'\" '.$composerPath;\n }\n\n return 'composer';\n }",
"protected function findComposer()\n {\n $composerPath = getcwd().'/composer.phar';\n\n if (file_exists($composerPath)) {\n return '\"'.PHP_BINARY.'\" '.$composerPath;\n }\n\n return 'composer';\n }",
"public function findComposer(): string\n {\n $composerPath = getcwd().'/composer.phar';\n\n return file_exists($composerPath) ? '\"'.PHP_BINARY.'\" '.$composerPath : 'composer';\n }",
"public function getPhpCsExecutable() {\n return getcwd() . '/vendor/bin/phpcs';\n }",
"protected function getPhpExecCommand()\n {\n $finder = new PhpExecutableFinder();\n\n $phpPath = $finder->find(false);\n\n if ($phpPath === false) {\n throw new \\RuntimeException('Failed to locate PHP binary to execute ' . $phpPath);\n }\n\n $phpArgs = $finder->findArguments();\n $phpArgs = $phpArgs\n ? ' ' . implode(' ', $phpArgs)\n : ''\n ;\n\n $command = ProcessExecutor::escape($phpPath) .\n $phpArgs .\n ' -d allow_url_fopen=' . ProcessExecutor::escape(ini_get('allow_url_fopen')) .\n ' -d disable_functions=' . ProcessExecutor::escape(ini_get('disable_functions')) .\n ' -d memory_limit=' . ProcessExecutor::escape(ini_get('memory_limit'))\n ;\n\n return $command;\n }",
"protected function findComposer($dir = null)\n {\n if (file_exists(getcwd() . ($dir ? ('/' . $dir) : '') . '/composer.phar')) {\n return '\"' . PHP_BINARY . '\" composer.phar';\n }\n\n return 'composer';\n }",
"public function findExecutable(string $name): string;",
"protected function get_git_binary_path(): ?string {\n\t\texec(\n\t\t\tescapeshellcmd( 'which git' ),\n\t\t\t$output,\n\t\t\t$status\n\t\t);\n\n\t\treturn 0 === $status ? $output[0] : null;\n\t}"
] | [
"0.76913416",
"0.73086786",
"0.7187218",
"0.70625335",
"0.70221406",
"0.6900051",
"0.6829062",
"0.67786825",
"0.6708969",
"0.65772957",
"0.6552524",
"0.65321165",
"0.652399",
"0.646793",
"0.6455781",
"0.63400596",
"0.63400596",
"0.63283867",
"0.6325852",
"0.61859596",
"0.61501694",
"0.61362904",
"0.6130393",
"0.6130393",
"0.6011128",
"0.5983714",
"0.5863672",
"0.5836251",
"0.57877713",
"0.5775196"
] | 0.85183686 | 0 |
CreateConfigFile Erzeugt das tmpHighcharts ConfigFile mit der $id als Dateinamen IN: $stringForCfgFile = String welcher in das File geschrieben wird | function CreateConfigFile($stringForCfgFile, $id, $charttype = 'Highcharts')
{
$path = "webfront\user\IPSHighcharts\\" . $charttype;
$filename = $charttype . "Cfg$id.tmp";
return $this->CreateConfigFileByPathAndFilename($stringForCfgFile, $path, $filename);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CreateConfigFileByPathAndFilename($stringForCfgFile, $path, $filename)\n {\n // Standard-Dateiname .....\n $tmpFilename = IPS_GetKernelDir() . $path . \"\\\\\" . $filename;\n\n // schreiben der Config Daten\n $handle = fopen($tmpFilename,\"w\");\n fwrite($handle, $stringForCfgFile);\n fclose($handle);\n\n return $tmpFilename;\n }",
"private function CreateConfigFile()\n {\n $f = @fopen(dirname(__FILE__) . '/' . $this->configFile, 'wb');\n fclose($f);\n }",
"private function createConfigFile(): void\n {\n if (!file_exists($this->getModulePath() . '/config.php')) {\n $configFile = fopen($this->getModulePath() . '/config.php', 'a+');\n $content = require __DIR__ . '/templates/config.php';\n fputs($configFile, $content);\n fclose($configFile);\n }\n }",
"function createConfigFile() {\n\t\t$templateFilename = 'config.template.php';\n\t\t$templateHandle = fopen($templateFilename, \"r\");\n\t\tif($templateHandle) {\n\t\t\t/* open include configuration file write only */\n\t\t\t$includeFilename = 'config.inc.php';\n\t \t$includeHandle = fopen($includeFilename, \"w\");\n\t\t\tif($includeHandle) {\n\t\t\t \twhile (!feof($templateHandle)) {\n\t \t\t\t\t$buffer = fgets($templateHandle);\n\n\t\t \t\t\t/* replace _DBC_ variable */\n\t\t \t\t\t$buffer = str_replace( \"_DBC_SERVER_\", $this->dbHostname, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_PORT_\", $this->dbPort, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_USER_\", $this->dbUsername, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_PASS_\", $this->dbPassword, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_NAME_\", $this->dbName, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_TYPE_\", $this->dbType, $buffer);\n\n\t\t \t\t\t$buffer = str_replace( \"_SITE_URL_\", $this->siteUrl, $buffer);\n\n\t\t \t\t\t/* replace dir variable */\n\t\t \t\t\t$buffer = str_replace( \"_VT_ROOTDIR_\", $this->rootDirectory, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_VT_CACHEDIR_\", $this->cacheDir, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_VT_TMPDIR_\", $this->cacheDir.\"images/\", $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_VT_UPLOADDIR_\", $this->cacheDir.\"upload/\", $buffer);\n\t\t\t \t$buffer = str_replace( \"_DB_STAT_\", \"true\", $buffer);\n\n\t\t\t\t\t/* replace charset variable */\n\t\t\t\t\t$buffer = str_replace( \"_VT_CHARSET_\", $this->vtCharset, $buffer);\n\n\t\t\t\t\t/* replace default lanugage variable */\n\t\t\t\t\t$buffer = str_replace( \"_VT_DEFAULT_LANGUAGE_\", $this->vtDefaultLanguage, $buffer);\n\n\t\t\t \t/* replace master currency variable */\n\t\t \t\t\t$buffer = str_replace( \"_MASTER_CURRENCY_\", $this->currencyName, $buffer);\n\n\t\t\t \t/* replace the application unique key variable */\n\t\t \t\t$buffer = str_replace( \"_VT_APP_UNIQKEY_\", md5(time() . rand(1,9999999) . md5($this->rootDirectory)) , $buffer);\n\n\t\t\t\t\t/* replace support email variable */\n\t\t\t\t\t$buffer = str_replace( \"_USER_SUPPORT_EMAIL_\", $this->adminEmail, $buffer);\n\n\t\t \t\tfwrite($includeHandle, $buffer);\n\t \t\t}\n\t \t\t\tfclose($includeHandle);\n\t \t\t}\n\t \t\tfclose($templateHandle);\n\t \t}\n\n\t \tif ($templateHandle && $includeHandle) {\n\t \t\treturn true;\n\t \t}\n\t \treturn false;\n\t}",
"function createConfigFile()\n{\n\t$path = dirname(WP_CONTENT_DIR);\n\t$serverPath = $_SERVER['DOCUMENT_ROOT'];\n\t$content = '<?php define(\"projectPath\",\\''.$path.'\\'); define(\"serverPath\", \\''.$serverPath.'\\'); ?>';\n\t\n\tfile_put_contents(WP_PLUGIN_DIR.\"\\\\vanarts-project-crawler\\\\config.php\",$content,LOCK_EX);\n}",
"public function generateConfigFile() {\n $date = date('d-m-Y', time());\n if (!file_exists(INSTALLFILE)) {\n mkdir(INSTALLFILE, 0777);\n }\n $post = functions::get_post();\n\n $dbname = trim(strtolower($post['db_name']));\n $dbname = str_replace(' ', '_', $dbname);\n\n $data = ['host' => $post['host'], 'user' => $post['user'], 'pass' => $post['pass'],\n 'db_name' => $dbname, 'installed' => true, 'created' => $date];\n $output = \"<?php\\n\";\n foreach ($data as $key => $value) {\n if ($key === 'user' || $key === 'pass') {\n $value = $this->crypto($value);\n }\n $output .= \"\\$GLOBALS['config']['$key']='\" . $value . \"';\\n\";\n }\n $output .= \"?>\\n\";\n\n $write = @file_put_contents(CONFIG_FILE_PATH, $output);\n\n if ($write) {\n return true;\n }\n\n return false;\n }",
"private static function createConfigFile() {\n $args = array();\n $args[\"dbname\"] = self::$config->getDbName();\n $args[\"dbuser\"] = self::$config->getDbUser();\n if (self::$config->getDbPassword()) $args[\"dbpass\"] = self::$config->getDbPassword();\n if (self::$config->getDbHost()) $args[\"dbhost\"] = self::$config->getDbHost();\n\n self::runWpCliCommand(\"core\", \"config\", $args);\n }",
"public function serializeConfigFile(ConfigFile $configFile);",
"public function createFromNameAndData($config_name, array $config_data);",
"protected function _createTempFilePath()\n {\n $tempFilePath = tempnam('', '') . '.' . $this->_options['format'];\n\n $this->_tempFilePath = $tempFilePath;\n }",
"public function setConfigFilePath($configFilePath);",
"function _createConfiguration($file, $type = 'PHP')\n\t{\n\t\tjimport( 'joomla.registry.registry' );\n\n\t\trequire_once( $file );\n\n\t\t// Create the registry with a default namespace of config which is read only\n\t\t$this->_registry = new JRegistry( 'config', true );\n\t}",
"private function _write_config_file($config)\n\t{\n\t\t$this->load->helper('file');\n\t\t$this->load->helper('string');\n\t\t\n\t\t// Open the template file\n\t\t$template = read_file(ROOTPATH.'setup/sample_data/config.php');\n\t\t\n\t\t$replace = array(\n\t\t\t'__ENCRYPTION__' \t=> random_string('alnum', 16),\n\t\t\t'__URL__'\t\t\t=> $config['url']\n\t\t);\n\t\t\n\t\t// Replace the __ variables with the data specified by the user\n\t\t$new_file \t= str_replace(array_keys($replace), $replace, $template);\n\t\t$config_file = APPPATH.'config/config.php';\n\t\tif ( ! write_file($config_file, $new_file, 'w+'))\n\t\t{\n\t\t\t// This shouldn't happen. But just to be safe.\n\t\t\tshow_error('Unable to write to the config file');\n\t\t}\n\t\t\n\t\t@chmod($config_file, FILE_READ_MODE);\n\t\t\n\t\treturn TRUE;\n\t}",
"protected function createTestFile($sCode){\r\n\t\t\t\r\n\t\t\t$sTestFile = tempnam($this->aConfig[self::OPT_TEMP_DIR], $this->aConfig[self::OPT_TEMP_PREFIX]);\r\n\t\t\t\r\n\t\t\t$this->aFiles[$sTestFile] = $sTestFile;\r\n\t\t\t\r\n\t\t\tfile_put_contents($sTestFile, $sCode);\r\n\t\t\t\r\n\t\t\treturn $sTestFile;\r\n\t\t\t\r\n\t\t}",
"public function createConfigFile(array $data) {\n $all = 'all:' . \"\\n\";\n $doctrine = ' doctrine:' . \"\\n\";\n $class = ' class: sfDoctrineDatabase' . \"\\n\";\n $param = ' param:' . \"\\n\";\n $dsn = ' dsn: '.$data['productive_database'].':host='.$data['productive_host'].';dbname='.$data['productive_databasename'] . \"\\n\";\n $username = ' username: '.$data['productive_username'].'' . \"\\n\";\n $password = ' password: '.$data['productive_password'].'' . \"\\n\";\n\n $string = $all . $doctrine . $class . $param . $dsn . $username . $password;\n $file = sfConfig::get('sf_root_dir') . '/config/databases.yml';\n $fileHanlder = fopen($file,\"w+\");\n fwrite($fileHanlder, $string);\n fclose($fileHanlder);\n\n $file = sfConfig::get('sf_root_dir') . '/config/installed';\n $fileHanlder = fopen($file,\"w+\");\n fclose($fileHanlder);\n return true;\n }",
"public function makeConfigFile()\n\t{\n\t\t// Make sure we are called by an expected caller\n\t\tServerTechnology::checkCaller($this->allowedCallersForMake);\n\n\t\tJLoader::import('joomla.utilities.date');\n\n\t\t$date = new Date();\n\t\t$tz = new DateTimeZone($this->container->platform->getUser()->getParam('timezone', $this->container->platform->getConfig()->get('offset', 'UTC')));\n\t\t$date->setTimezone($tz);\n\t\t$d = $date->format('Y-m-d H:i:s T', true);\n\t\t$version = ADMINTOOLS_VERSION;\n\n\t\t$config = $this->loadConfiguration();\n\n\t\t// Load the fastcgi_pass setting\n\t\t$fastcgi_pass_block = $config->fastcgi_pass_block;\n\n\t\tif (empty($fastcgi_pass_block))\n\t\t{\n\t\t\t$fastcgi_pass_block = 'fastcgi_pass 127.0.0.1:9000;';\n\t\t}\n\n\t\t$fastcgi_pass_block = trim($fastcgi_pass_block);\n\n\t\t// Get the directory to the site's root\n\t\t$rewritebase = $config->rewritebase;\n\t\t$rewritebaseSlash = '/' . trim($rewritebase, '/ ');\n\t\t$rewritebaseSlash = ($rewritebaseSlash == '/') ? '' : $rewritebaseSlash;\n\t\t$rewritebase = '/' . trim($rewritebase, '/ ');\n\n\t\t$nginxConf = <<<END\n### ===========================================================================\n### Security Enhanced & Highly Optimized NginX Configuration File for Joomla!\n### automatically generated by Admin Tools $version on $d\n### ===========================================================================\n###\n### Admin Tools is Free Software, distributed under the terms of the GNU\n### General Public License version 3 or, at your option, any later version\n### published by the Free Software Foundation.\n###\n### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n### !! !!\n### !! If you get an Internal Server Error 500 or a blank page when trying !!\n### !! to access your site, remove this file and try tweaking its settings !!\n### !! in the back-end of the Admin Tools component. !!\n### !! !!\n### !! Remember to include this file in your site's configuration file. !!\n### !! Also remember to reload or restart NginX after making any change to !!\n### !! this file. !!\n### !! !!\n### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n###\n\n### Prevent access to this file\nlocation = $rewritebaseSlash/nginx.conf {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/nginx.conf.admintools {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nEND;\n\n\t\t// Protect against common file injection attacks?\n\t\tif ($config->fileinj == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< CONFDATA\n######################################################################\n## Protect against common file injection attacks\n######################################################################\nset \\$file_injection 0;\nif (\\$query_string ~ \"[a-zA-Z0-9_]=http://\") {\n\tset \\$file_injection 1;\n}\nif (\\$query_string ~ \"[a-zA-Z0-9_]=(\\.\\.//?)+\") {\n\tset \\$file_injection 1;\n}\nif (\\$query_string ~ \"[a-zA-Z0-9_]=/([a-z0-9_.]//?)+\") {\n\tset \\$file_injection 1;\n}\nif (\\$file_injection = 1) {\n\treturn 403;\n\tbreak;\n}\n\nCONFDATA;\n\t\t}\n\n\t\tif ($config->phpeaster == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n######################################################################\n## Disable PHP Easter Eggs\n######################################################################\nif (\\$query_string ~ \"\\=PHP[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\") {\n\treturn 403;\n\tbreak;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->leftovers == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n######################################################################\n## Block access to configuration.php-dist and htaccess.txt\n######################################################################\nlocation = $rewritebaseSlash/configuration.php-dist {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/htaccess.txt {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/web.config {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/configuration.php {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/CONTRIBUTING.md {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/joomla.xml {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/LICENSE.txt {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/phpunit.xml {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/README.txt {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nlocation = $rewritebaseSlash/web.config.txt {\n\tlog_not_found off;\n\taccess_log off;\n\treturn 404;\n\tbreak;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->clickjacking == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n## Protect against clickjacking\nadd_header X-Frame-Options SAMEORIGIN;\n\nENDCONF;\n\t\t}\n\n\t\tif (!empty($config->hoggeragents) && ($config->nohoggers == 1))\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n######################################################################\n## Block access from specific user agents\n######################################################################\nset \\$bad_ua 0;\n\nENDCONF;\n\n\t\t\tforeach ($config->hoggeragents as $agent)\n\t\t\t{\n\t\t\t\t$nginxConf .= <<< ENDCONF\nif (\\$http_user_agent ~ \"$agent\") {\n\tset \\$bad_ua 1;\n}\n\nENDCONF;\n\t\t\t}\n\n\t\t\t$nginxConf .= <<< ENDCONF\nif (\\$bad_ua = 1) {\n\treturn 403;\n}\n\nENDCONF;\n\t\t}\n\n\t\tif (($config->fileorder == 1) || ($config->nodirlists == 1))\n\t\t{\n\t\t\t$nginxConf .= <<<ENDCONF\n######################################################################\n## Directory indices and no automatic directory listings\n## Forces index.php to be read before the index.htm(l) files\n## Also disables showing files in a directory automatically\n######################################################################\nindex index.php index.html index.htm;\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->symlinks != 0)\n\t\t{\n\t\t\t$nginxConf .= <<<ENDCONF\n######################################################################\n## Disable following symlinks\n######################################################################\n\nENDCONF;\n\t\t\tswitch ($config->symlinks)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\t$nginxConf .= \"disable_symlinks on;\\n\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\t$nginxConf .= \"disable_symlinks if_not_owner;\\n\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ($config->exptime == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<ENDCONF\n######################################################################\n## Set default expiration time\n######################################################################\n # CSS and JavaScript : 1 week\nlocation ~* \\.(css|js)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1w;\n}\n\n# Image files : 1 month\nlocation ~* \\.(bmp|gif|jpg|jpeg|jp2|png|svg|tif|tiff|ico|wbmp|wbxml|smil|webp)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\n# Font files : 1 week\nlocation ~* \\.(woff|woff2|ttf|otf|eot)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\n# Document files : 1 month\nlocation ~* \\.(pdf|txt|xml)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\n# Audio files : 1 month\nlocation ~* \\.(mid|midi|mp3|m4a|m4r|aif|aiff|ra|wav|voc|ogg)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\n# Video files : 1 month\nlocation ~* \\.(swf|vrml|avi|mkv|mpg|mpeg|mp4|m4v|mov|asf)$ {\n\t\taccess_log off; log_not_found off;\n\t\texpires 1M;\n}\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->autocompress == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<ENDCONF\n######################################################################\n## Automatic compression of static resources\n## Compress text, html, javascript, css, xml and other static resources\n## May kill access to your site for old versions of Internet Explorer\n######################################################################\n# The following is the actual automatic compression setup\ngzip on;\ngzip_vary\t\ton;\ngzip_comp_level 6;\ngzip_proxied\texpired no-cache no-store private auth;\ngzip_min_length 1000;\ngzip_http_version 1.1;\ngzip_types text/plain text/css application/xhtml+xml application/xml+rss application/rss+xml application/x-javascript application/javascript text/javascript application/json text/xml application/xml image/svg+xml;\ngzip_buffers 16 8k;\ngzip_disable \"MSIE [1-6]\\.(?!.*SV1)\";\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->etagtype != -1)\n\t\t{\n\t\t\t$etagValue = ($config->etagtype == 1) ? 'on' : 'off';\n\t\t\t$nginxConf .= <<< CONF\n## Send ETag (you have set it to '$etagValue')\netag $etagValue;\n\nCONF;\n\n\t\t}\n\n\t\t$host = strtolower($config->httphost);\n\n\t\tif (substr($host, 0, 4) == 'www.')\n\t\t{\n\t\t\t$wwwHost = $host;\n\t\t\t$noWwwHost = substr($host, 4);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$noWwwHost = $host;\n\t\t\t$wwwHost = 'www.' . $host;\n\t\t}\n\n\t\t$subfolder = trim($config->rewritebase, '/') ? trim($config->rewritebase, '/').'/' : '';\n\n\t\tswitch ($config->wwwredir)\n\t\t{\n\t\t\tcase 1:\n\t\t\t\t// non-www to www\n\t\t\t\t$nginxConf .= <<<END\n######################################################################\n## Redirect non-www to www\n######################################################################\nif (\\$host = '$noWwwHost' ) {\n\trewrite ^/(.*)$ \\$scheme://$wwwHost/$subfolder$1 permanent;\n}\n\nEND;\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\t// www to non-www\n\t\t\t\t$nginxConf .= <<<END\n######################################################################\n## Redirect www to non-www\n######################################################################\nif (\\$host = '$wwwHost' ) {\n\trewrite ^/(.*)$ \\$scheme://$noWwwHost/$subfolder$1 permanent;\n}\n\nEND;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (!empty($config->olddomain))\n\t\t{\n\t\t\t$nginxConf .= <<<END\n######################################################################\n## Redirect old to new domains\n######################################################################\n\nEND;\n\t\t\t$domains = trim($config->olddomain);\n\t\t\t$domains = explode(',', $domains);\n\t\t\t$newdomain = $config->httphost;\n\n\t\t\tforeach ($domains as $olddomain)\n\t\t\t{\n\t\t\t\t$olddomain = trim($olddomain);\n\n\t\t\t\tif (empty($olddomain))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$olddomain = $this->escape_string_for_regex($olddomain);\n\n\t\t\t\t$nginxConf .= <<<END\nif (\\$host ~ \"$olddomain$\" ) {\n\trewrite ^/(.*)$ \\$scheme://$newdomain/$1 permanent;\n}\n\nEND;\n\t\t\t}\n\t\t}\n\n\t\tif ($config->hstsheader == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## HSTS Header - See http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security\nadd_header Strict-Transport-Security max-age=31536000;\n\nEND;\n\t\t}\n\n\t\tif ($config->cors == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## Cross-Origin Resource Sharing (CORS)\nadd_header Access-Control-Allow-Origin \"*\";\nadd_header Timing-Allow-Origin \"*\";\n\nEND;\n\t\t}\n\n\t\tif ($config->referrerpolicy !== '-1')\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## Referrer-policy\nadd_header Referrer-Policy \"{$config->referrerpolicy}\";\n\nEND;\n\t\t}\n\n\t\tif ($config->notracetrack == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## Disable HTTP methods TRACE and TRACK (protect against XST)\nif (\\$request_method ~ ^(TRACE|TRACK)$ ) {\n\treturn 405;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->reducemimetyperisks == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n## Reduce MIME type security risks\nadd_header X-Content-Type-Options \"nosniff\";\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->reflectedxss == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n## Reflected XSS prevention\nadd_header X-XSS-Protection \"1; mode=block\";\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->notransform == 1)\n\t\t{\n\t\t\t$nginxConf .= <<< ENDCONF\n## Prevent content transformation\nadd_header Cache-Control \"no-transform\";\n\nENDCONF;\n\t\t}\n\n\n\t\tif ($config->cfipfwd == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n######################################################################\n## CloudFlare support - see https://support.cloudflare.com/hc/en-us/articles/200170706-Does-CloudFlare-have-an-IP-module-for-Nginx-\n######################################################################\nset_real_ip_from 199.27.128.0/21;\nset_real_ip_from 173.245.48.0/20;\nset_real_ip_from 103.21.244.0/22;\nset_real_ip_from 103.22.200.0/22;\nset_real_ip_from 103.31.4.0/22;\nset_real_ip_from 141.101.64.0/18;\nset_real_ip_from 108.162.192.0/18;\nset_real_ip_from 190.93.240.0/20;\nset_real_ip_from 188.114.96.0/20;\nset_real_ip_from 197.234.240.0/22;\nset_real_ip_from 198.41.128.0/17;\nset_real_ip_from 162.158.0.0/15;\nset_real_ip_from 104.16.0.0/12;\nset_real_ip_from 2400:cb00::/32;\nset_real_ip_from 2606:4700::/32;\nset_real_ip_from 2803:f800::/32;\nset_real_ip_from 2405:b500::/32;\nset_real_ip_from 2405:8100::/32;\nreal_ip_header X-Forwarded-For;\n\nEND;\n\t\t}\n\n\t\tif ($config->opttimeout == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Timeout handling, see http://wiki.nginx.org/HttpCoreModule\nclient_header_timeout 10;\nclient_body_timeout 10;\nsend_timeout 30;\nkeepalive_timeout 30s;\n\nEND;\n\t\t}\n\n\t\tif ($config->optsockets == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Socket settings, see http://wiki.nginx.org/HttpCoreModule\nconnection_pool_size 8192;\nclient_header_buffer_size 4k;\nlarge_client_header_buffers 8 8k;\nrequest_pool_size 8k;\n\nEND;\n\t\t}\n\n\t\tif ($config->opttcpperf == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Performance, see http://wiki.nginx.org/HttpCoreModule\nsendfile on;\nsendfile_max_chunk 1m;\npostpone_output 0;\ntcp_nopush on;\ntcp_nodelay on;\n\nEND;\n\t\t}\n\n\t\tif ($config->optoutbuf == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Output buffering, see http://wiki.nginx.org/HttpCoreModule\noutput_buffers 8 32k;\n\nEND;\n\t\t}\n\n\t\tif ($config->optfhndlcache == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Filehandle Cache, useful when serving a large number of static files (Joomla! sites do that)\nopen_file_cache max=2000 inactive=20s;\nopen_file_cache_valid 30s;\nopen_file_cache_min_uses 2;\nopen_file_cache_errors on;\n\nEND;\n\t\t}\n\n\t\tif ($config->encutf8 == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Character encoding, see http://wiki.nginx.org/HttpCharsetModule\ncharset utf-8;\nsource_charset utf-8;\n\nEND;\n\t\t}\n\n\t\tif ($config->nginxsecurity == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Security options, see http://wiki.nginx.org/HttpCoreModule\nserver_name_in_redirect off;\nserver_tokens off;\nignore_invalid_headers on;\n\nEND;\n\t\t}\n\n\t\tif ($config->maxclientbody == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n# -- Maximum client body size set to 1 Gigabyte\nclient_max_body_size 1G;\n\nEND;\n\t\t}\n\n\t\tif ($config->blockcommon == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\nset \\$common_exploit 0;\nif (\\$query_string ~ \"proc/self/environ\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"mosConfig_[a-zA-Z_]{1,21}(=|\\%3D)\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"base64_(en|de)code\\(.*\\)\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"(<|%3C).*script.*(>|%3E)\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"GLOBALS(=|\\[|\\%[0-9A-Z]{0,2})\") {\n\tset \\$common_exploit 1;\n}\nif (\\$query_string ~ \"_REQUEST(=|\\[|\\%[0-9A-Z]{0,2})\") {\n\tset \\$common_exploit 1;\n}\nif (\\$common_exploit = 1) {\n\treturn 403;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->enablesef == 1)\n\t\t{\n\t\t\t$nginxConf .= <<<END\n## Enable SEF URLs\nlocation / {\n\ttry_files \\$uri \\$uri/ /index.php?\\$args;\n}\nlocation ~* /index.php$ {\n\t$fastcgi_pass_block\n\tbreak;\n}\n\nEND;\n\t\t}\n\n\t\t$nginxConf .= <<< END\n######################################################################\n## Advanced server protection rules exceptions\n######################################################################\n\nEND;\n\n\t\tif (!empty($config->exceptionfiles))\n\t\t{\n\t\t\tforeach ($config->exceptionfiles as $file)\n\t\t\t{\n\t\t\t\tif (substr($file, -4) == '.php')\n\t\t\t\t{\n\t\t\t\t\t$nginxConf .= <<<END\nlocation = $rewritebaseSlash/$file {\n\t$fastcgi_pass_block\n\tbreak;\n}\n\nEND;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$nginxConf .= <<<END\nlocation = $rewritebaseSlash/$file {\n\tbreak;\n}\n\nEND;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($config->exceptiondirs))\n\t\t{\n\t\t\tforeach ($config->exceptiondirs as $dir)\n\t\t\t{\n\t\t\t\t$dir = trim($dir, '/');\n\t\t\t\t$dir = $this->escape_string_for_regex($dir);\n\t\t\t\t$nginxConf .= <<<END\nlocation ~* ^$rewritebaseSlash/$dir/.*\\.php$\n{\n\tbreak;\n}\nlocation ~* ^$rewritebaseSlash/$dir/.*$\n{\n\tbreak;\n}\n\nEND;\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($config->fullaccessdirs))\n\t\t{\n\t\t\tforeach ($config->fullaccessdirs as $dir)\n\t\t\t{\n\t\t\t\t$dir = trim($dir, '/');\n\t\t\t\t$dir = $this->escape_string_for_regex($dir);\n\t\t\t\t$nginxConf .= <<<END\nlocation ~* ^$rewritebaseSlash/$dir/.*$\n{\n\tbreak;\n}\n\nEND;\n\t\t\t}\n\t\t}\n\n\t\t$nginxConf .= <<< END\n######################################################################\n## Advanced server protection\n######################################################################\n\nEND;\n\n\t\tif ($config->backendprot == 1)\n\t\t{\n\t\t\t$bedirs = implode('|', $config->bepexdirs);\n\t\t\t$betypes = implode('|', $config->bepextypes);\n\t\t\t$nginxConf .= <<<END\n# Allow media files in select back-end directories\nlocation ~* ^$rewritebaseSlash/administrator/($bedirs)/.*.($betypes)$ {\n\tbreak;\n}\n\n# Allow access to the back-end index.php file\nlocation = $rewritebaseSlash/administrator/index.php {\n\t$fastcgi_pass_block\n\tbreak;\n}\nlocation ~* ^$rewritebaseSlash/administrator$ {\n\treturn 301 $rewritebaseSlash/administrator/index.php?\\$args;\n}\nlocation ~* ^$rewritebaseSlash/administrator/$ {\n\treturn 301 $rewritebaseSlash/administrator/index.php?\\$args;\n}\n\n# Disable access to everything else.\nlocation ~* $rewritebaseSlash/administrator.*$ {\n\t# If it is a file, directory or symlink and I haven't deliberately\n\t# enabled access to it, forbid any access to it!\n\tif (-e \\$request_filename) {\n\t\treturn 403;\n\t}\n\t# In any other case, just treat as a SEF URL\n\ttry_files \\$uri \\$uri/ /administrator/index.php?\\$args;\n}\n\nEND;\n\t\t}\n\n\t\tif ($config->frontendprot == 1)\n\t\t{\n\t\t\t$fedirs = implode('|', $config->fepexdirs);\n\t\t\t$fetypes = implode('|', $config->fepextypes);\n\t\t\t$nginxConf .= <<<END\n# Allow media files in select front-end directories\nlocation ~* ^$rewritebaseSlash/($fedirs)/.*.($fetypes)$ {\n\tbreak;\n}\n\n## Disallow front-end access for certain Joomla! system directories (unless access to their files is allowed above)\nlocation ~* ^$rewritebaseSlash/includes/js/ {\n\treturn 403;\n}\nlocation ~* ^$rewritebaseSlash/(cache|includes|language|logs|log|tmp)/ {\n\treturn 403;\n}\n\nEND;\n\t\t\tif ($config->enablesef != 1)\n\t\t\t{\n\t\t\t\t$nginxConf .= <<<END\n# Allow access to the front-end index.php file\nlocation ~* ^$rewritebaseSlash/$ {\n\treturn 301 $rewritebaseSlash/index.php?\\$args;\n}\nlocation ^$rewritebaseSlash/index.php$ {\n\t$fastcgi_pass_block\n\tbreak;\n}\n\nEND;\n\t\t\t}\n\n\t\t\t$nginxConf .= <<<END\n# Allow access to /\nlocation ~* ^$rewritebaseSlash/$ {\n\treturn 301 $rewritebaseSlash/index.php?\\$args;\n}\n\n# Disable access to everything else.\nlocation ~* ^$rewritebaseSlash/.*$ {\n\t# If it is a file, directory or symlink and I haven't deliberately\n\t# enabled access to it, forbid any access to it!\n\tif (-e \\$request_filename) {\n\t\treturn 403;\n\t}\n\t# In any other case, just treat as a SEF URL\n\ttry_files \\$uri \\$uri/ /index.php?\\$args;\n}\n\nEND;\n\t\t}\n\n\t\t$nginxConf .= \"##### Advanced server protection -- END\\n\\n\";\n\n\t\treturn $nginxConf;\n\t}",
"public static function getConfigFile();",
"function create_settings_file()\n\t{\n\t\t$settings = array(\n\t\t\t'db_name' => $this->sets['db_name'],\n\t\t\t'db_pass' => $this->sets['db_pass'],\n\t\t\t'db_user' => $this->sets['db_user'],\n\t\t\t'db_host' => $this->sets['db_host'],\n\t\t\t'db_port' => $this->sets['db_port'],\n\t\t\t'db_socket' => $this->sets['db_socket'],\n\t\t\t'dbtype' => $this->sets['dbtype'],\n\t\t\t'installed' => $this->sets['installed'],\n\t\t\t'admin_email' => $this->sets['admin_email']\n\t\t\t);\n\t\t\t\t\n\t\t$file = \"<?php\nif (!defined('PDNSADMIN')) {\n header('HTTP/1.0 403 Forbidden');\n die;\n}\n\n\\$set = array();\n\n\";\n\t\tforeach ($settings as $set => $val)\n\t\t{\n\t\t\t$file .= \"\\$set['$set'] = '\" . str_replace(array('\\\\', '\\''), array('\\\\\\\\', '\\\\\\''), $val) . \"';\\n\";\n\t\t}\n\n\t\t$file .= '?' . '>';\n\t\treturn $file;\n\t}",
"private function createConfig()\n\t{\n\t\t$configFilename = __DIR__ . '/app/config/config.local.neon';\n\n\t\tcopy(__DIR__ . '/app/config/config.local.example.neon', $configFilename);\n\n\t\t$lines = file($configFilename);\n\n\t\tforeach ($lines as $key => $line)\n\t\t{\n\t\t\tforeach (array('username', 'password', 'database') as $subject)\n\t\t\t{\n\t\t\t\tif (strpos($line, \"\\t\" . $subject))\n\t\t\t\t{\n\t\t\t\t\t$lines[$key] = $this->deleteNewline($line, \"\\n\") . ' ' . $this->config['db'][$subject] . \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (file_put_contents($configFilename, $lines))\n\t\t{\n\t\t\t$this->success('Local config file created ...');\n\t\t}\n\t}",
"public function save($configId)\n\t{\n\t\t/*\n\t\t$originalConfig = new ApplicationConfig();\n\t\t$originalConfig->configuration = $this->configuration;\n\t\t$originalConfig->init();\n\t\t*/\n\t\t$originalConfig = $this->openConfig();\n\t\t\n\t\t$result = array();\n\t\tforeach ($originalConfig as $sectionName => $section) {\n\t\t\t$sec = $this->$sectionName;\n\t\t\tforeach ($section['items'] as $varName => $properties) {\t\t\t\n\t\t\t\t$org = $properties['value'];\n\t\t\t\t$chg = $sec[$varName];\n\t\t\t\tif ($org != $chg) {\n\t\t\t\t\tif (isset($result[$sectionName])) {\n\t\t\t\t\t\t$result[$sectionName][$varName] = $chg;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$result[$sectionName] = array($varName => $chg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$path = YiiBase::getPathOfAlias('application.config.users'.'.'.$configId).'.json';\n\t\tif (count($result) > 0) {\n\t\t\tfile_put_contents($path, CJSON::encode($result));\n\t\t} else { // remove the definintion\n\t\t\tif (file_exists($path)) {\n\t\t\t\t@unlink($path);\n\t\t\t}\n\t\t}\n\t\treturn true;\t\t\n\t}",
"public function setConfig($configId);",
"public function setConfigfile();",
"public function createConfig($config_container = false, $settings, $iniPath = false, $iniName) {\n try {\n //define the main header setting\n if (isset ( $config_container )) {\n $Section = new Config_Container ( \"section\", \"Settings\" );\n } else {\n $Section = new Config_Container ( \"section\", \"{$config_container}\" );\n\n }\n // create variables/values\n if (is_array ( $settings )) {\n foreach ( $settings as $key => $value ) {\n $Section->createDirective ( \"{$key}\", \"{$value}\" );\n }\n }\n // reassign root\n $this->objConf->setRoot ( $Section );\n // write configuration to file\n $result = $this->objConf->writeConfig ( \"{$iniPath}\" . \"{$iniName}\", \"INIFile\" );\n\n if ($result == false) {\n throw new Exception ( $this->Text ( 'word_read_fail' ) );\n }\n } catch ( Exception $e ) {\n $this->errorCallback ( $e );\n }\n }",
"private function createSettingsFile() {\n\t\t$data = (object) [\n\t\t\t\"gtag\" => \"\",\n\t\t\t\"gmap\" => \"\",\n\t\t\t\"sendgrid_api\" => \"\",\n\t\t\t\"pages\" => (object) [\n\t\t\t\t\"home\" => (object) [\n\t\t\t\t\t\"slides\" => [],\n\t\t\t\t\t\"backgroundTestimoni\" => ''\n\t\t\t\t],\n\t\t\t\t\"menu\" => (object) [\n\t\t\t\t\t\"headerImage\" => \"\"\n\t\t\t\t],\n\t\t\t\t\"gallery\" => (object) [\n\t\t\t\t\t\"headerImage\" => \"\"\n\t\t\t\t],\n\t\t\t\t\"contact\" => (object) [\n\t\t\t\t\t\"headerImage\" => \"\"\n\t\t\t\t]\n\t\t\t]\n\t\t];\n\n\t\treturn create_json_file($this->_filePath, $data);\n\t}",
"public function createSection(string $section, array $config): TemplateInterface\n {\n if (in_array($section, $this->configFile->getSections())) {\n throw new ConfigFileException(\"Section already exists\");\n }\n\n $section_config = sprintf(\",\\n '%s' => %s \\n\", $section, Php::toArray($config));\n\n $config_file_string = File::getContent($this->configFile->getFile(), null);\n\n $replace = $section_config . \"];\";\n\n $new_config_file_string = str_replace(\"];\", $replace, $config_file_string);\n\n return $this->withContentFile($new_config_file_string);\n }",
"public function getConfigFilePath(): string;",
"public function create() {\n //$this->configuration->setContainer($this->container);\n //$this->configuration->setConfigRootDirectory('/src/Garbanzo/Core');\n //$this->configuration->loadFile($this->mainConfigFileName);\n }",
"protected abstract function prepareLocalConfigFile($filename);",
"private static function setParts(string $config)\n {\n $parts = explode('.', $config, 2);\n self::$file = $parts[0];\n self::$config = isset($parts[1]) ? 'params.' . $parts[1] : 'params';\n\n if (isset(self::$data[self::$file])) return;\n if (!self::$dir) throw new \\InvalidArgumentException(\"Config files directory missing. Please, use 'setDir' method before.\");\n\n $config_file_path = self::$dir . self::$file . '.php';\n $array_data = require($config_file_path);\n $params = ['params' => $array_data];\n self::$data[self::$file] = new Data($params);\n }",
"public function testConfigFileCreation()\n {\n $config = new Config(ConfigTest::$test_array);\n\n $this->assertInstanceOf('\\BrightNucleus\\Config\\ConfigInterface', $config);\n $this->assertInstanceOf('\\BrightNucleus\\Config\\AbstractConfig', $config);\n $this->assertInstanceOf('\\BrightNucleus\\Config\\Config', $config);\n }"
] | [
"0.70120084",
"0.64181405",
"0.62527025",
"0.5900636",
"0.55067784",
"0.54082155",
"0.5400758",
"0.5213552",
"0.51878846",
"0.51856303",
"0.5146211",
"0.5124348",
"0.5122316",
"0.50778544",
"0.5031468",
"0.5014996",
"0.49830297",
"0.49826974",
"0.49636525",
"0.4949293",
"0.49434945",
"0.4938294",
"0.4917279",
"0.49168673",
"0.48918214",
"0.48132762",
"0.48024988",
"0.47987425",
"0.47940326",
"0.47909492"
] | 0.87564707 | 0 |
CreateConfigFileByPathAndFilename Erzeugt das tmpHighcharts ConfigFile IN: $stringForCfgFile = String welcher in das File geschrieben wird $path, $filename = Pfad un Name des TmpFiles welches erzeugt werden soll | function CreateConfigFileByPathAndFilename($stringForCfgFile, $path, $filename)
{
// Standard-Dateiname .....
$tmpFilename = IPS_GetKernelDir() . $path . "\\" . $filename;
// schreiben der Config Daten
$handle = fopen($tmpFilename,"w");
fwrite($handle, $stringForCfgFile);
fclose($handle);
return $tmpFilename;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CreateConfigFile($stringForCfgFile, $id, $charttype = 'Highcharts')\n {\n $path = \"webfront\\user\\IPSHighcharts\\\\\" . $charttype;\n $filename = $charttype . \"Cfg$id.tmp\";\n\n return $this->CreateConfigFileByPathAndFilename($stringForCfgFile, $path, $filename);\n }",
"private function CreateConfigFile()\n {\n $f = @fopen(dirname(__FILE__) . '/' . $this->configFile, 'wb');\n fclose($f);\n }",
"private function createConfigFile(): void\n {\n if (!file_exists($this->getModulePath() . '/config.php')) {\n $configFile = fopen($this->getModulePath() . '/config.php', 'a+');\n $content = require __DIR__ . '/templates/config.php';\n fputs($configFile, $content);\n fclose($configFile);\n }\n }",
"protected function _createTempFilePath()\n {\n $tempFilePath = tempnam('', '') . '.' . $this->_options['format'];\n\n $this->_tempFilePath = $tempFilePath;\n }",
"protected function createTestFile($sCode){\r\n\t\t\t\r\n\t\t\t$sTestFile = tempnam($this->aConfig[self::OPT_TEMP_DIR], $this->aConfig[self::OPT_TEMP_PREFIX]);\r\n\t\t\t\r\n\t\t\t$this->aFiles[$sTestFile] = $sTestFile;\r\n\t\t\t\r\n\t\t\tfile_put_contents($sTestFile, $sCode);\r\n\t\t\t\r\n\t\t\treturn $sTestFile;\r\n\t\t\t\r\n\t\t}",
"function createConfigFile()\n{\n\t$path = dirname(WP_CONTENT_DIR);\n\t$serverPath = $_SERVER['DOCUMENT_ROOT'];\n\t$content = '<?php define(\"projectPath\",\\''.$path.'\\'); define(\"serverPath\", \\''.$serverPath.'\\'); ?>';\n\t\n\tfile_put_contents(WP_PLUGIN_DIR.\"\\\\vanarts-project-crawler\\\\config.php\",$content,LOCK_EX);\n}",
"private function setConfigPath(): void\n\t{\n\n\t\t$this->scanner->print(\"\\nCONFIG DIRECTORY PARAMETERS\\n\");\n\n\t\t$configDir = $this->scanner->askForInputWithDefaultValues(\n\t\t\t\"Where to create config.jon within /App? [/Config]\",\n\t\t\t\"Config\");\n\n\t\t$this->configDirectory = $this->pathToRootDirectory .\n\t\t\t\t\t\t\t\t\"App\" . DIRECTORY_SEPARATOR .\n\t\t\t\t\t\t\t\t$configDir . DIRECTORY_SEPARATOR;\n\n\t\tFile::createDirectoryIfNotExist($this->configDirectory);\n\t\t$this->configFileName = $this->scanner->askForInputWithDefaultValues(\n\t\t\t\"How would you name your config file? [config.json]\",\n\t\t\t\"config.json\");\n\n\t}",
"protected abstract function prepareLocalConfigFile($filename);",
"function createConfigFile() {\n\t\t$templateFilename = 'config.template.php';\n\t\t$templateHandle = fopen($templateFilename, \"r\");\n\t\tif($templateHandle) {\n\t\t\t/* open include configuration file write only */\n\t\t\t$includeFilename = 'config.inc.php';\n\t \t$includeHandle = fopen($includeFilename, \"w\");\n\t\t\tif($includeHandle) {\n\t\t\t \twhile (!feof($templateHandle)) {\n\t \t\t\t\t$buffer = fgets($templateHandle);\n\n\t\t \t\t\t/* replace _DBC_ variable */\n\t\t \t\t\t$buffer = str_replace( \"_DBC_SERVER_\", $this->dbHostname, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_PORT_\", $this->dbPort, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_USER_\", $this->dbUsername, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_PASS_\", $this->dbPassword, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_NAME_\", $this->dbName, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_DBC_TYPE_\", $this->dbType, $buffer);\n\n\t\t \t\t\t$buffer = str_replace( \"_SITE_URL_\", $this->siteUrl, $buffer);\n\n\t\t \t\t\t/* replace dir variable */\n\t\t \t\t\t$buffer = str_replace( \"_VT_ROOTDIR_\", $this->rootDirectory, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_VT_CACHEDIR_\", $this->cacheDir, $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_VT_TMPDIR_\", $this->cacheDir.\"images/\", $buffer);\n\t\t \t\t\t$buffer = str_replace( \"_VT_UPLOADDIR_\", $this->cacheDir.\"upload/\", $buffer);\n\t\t\t \t$buffer = str_replace( \"_DB_STAT_\", \"true\", $buffer);\n\n\t\t\t\t\t/* replace charset variable */\n\t\t\t\t\t$buffer = str_replace( \"_VT_CHARSET_\", $this->vtCharset, $buffer);\n\n\t\t\t\t\t/* replace default lanugage variable */\n\t\t\t\t\t$buffer = str_replace( \"_VT_DEFAULT_LANGUAGE_\", $this->vtDefaultLanguage, $buffer);\n\n\t\t\t \t/* replace master currency variable */\n\t\t \t\t\t$buffer = str_replace( \"_MASTER_CURRENCY_\", $this->currencyName, $buffer);\n\n\t\t\t \t/* replace the application unique key variable */\n\t\t \t\t$buffer = str_replace( \"_VT_APP_UNIQKEY_\", md5(time() . rand(1,9999999) . md5($this->rootDirectory)) , $buffer);\n\n\t\t\t\t\t/* replace support email variable */\n\t\t\t\t\t$buffer = str_replace( \"_USER_SUPPORT_EMAIL_\", $this->adminEmail, $buffer);\n\n\t\t \t\tfwrite($includeHandle, $buffer);\n\t \t\t}\n\t \t\t\tfclose($includeHandle);\n\t \t\t}\n\t \t\tfclose($templateHandle);\n\t \t}\n\n\t \tif ($templateHandle && $includeHandle) {\n\t \t\treturn true;\n\t \t}\n\t \treturn false;\n\t}",
"public function setConfigFilePath($configFilePath);",
"public function testBadFilePath()\n\t{\n\t\t$loader = LoadManager::getInstance();\n\n\t\t$config1 = tempnam(\"./\", \"config1\");\n\t\t$handle1 = fopen($config1, \"w\");\n\t\tfwrite($handle1, '{\"load\":'.'\"'.$config1.'nonexisting\"}'); // non existing filepath\n\n\t\ttry{\n\t\t\tLoadManager::load($config1);\n\t\t\t$this->fail('Did not throw an exception with a configuration path.');\n\t\t} catch(\\Vcms\\Exception\\NotFound $e) {}\n\n\t\tfclose($handle1);\n\t\tunlink($config1);\n\t}",
"private static function createCoreConfig($path) {\n\t\t\t$path = self::stripTrailingSlash($path);\n\n\t\t\t$contents = self::getCoreConfigContent($path);\n\t\t\t$file = fopen($path.'/'.self::CORE_CONFIG_FILE, 'w+');\n\t\t\tfwrite($file, $contents);\n\t\t\tfclose($file);\n\t\t}",
"public function filePath($params) {\r\n\t\t$params['path'] = 'var/tmpfiles/';\r\n\t}",
"private function _write_config_file($config)\n\t{\n\t\t$this->load->helper('file');\n\t\t$this->load->helper('string');\n\t\t\n\t\t// Open the template file\n\t\t$template = read_file(ROOTPATH.'setup/sample_data/config.php');\n\t\t\n\t\t$replace = array(\n\t\t\t'__ENCRYPTION__' \t=> random_string('alnum', 16),\n\t\t\t'__URL__'\t\t\t=> $config['url']\n\t\t);\n\t\t\n\t\t// Replace the __ variables with the data specified by the user\n\t\t$new_file \t= str_replace(array_keys($replace), $replace, $template);\n\t\t$config_file = APPPATH.'config/config.php';\n\t\tif ( ! write_file($config_file, $new_file, 'w+'))\n\t\t{\n\t\t\t// This shouldn't happen. But just to be safe.\n\t\t\tshow_error('Unable to write to the config file');\n\t\t}\n\t\t\n\t\t@chmod($config_file, FILE_READ_MODE);\n\t\t\n\t\treturn TRUE;\n\t}",
"public function createFromNameAndData($config_name, array $config_data);",
"private function cleanTmpConfigFile(): void\n {\n /* clean config.json into tmp dir */\n $tmpConfigFile = sys_get_temp_dir().\\DIRECTORY_SEPARATOR.'config.json';\n\n if (file_exists($tmpConfigFile)) {\n unlink($tmpConfigFile);\n }\n }",
"public function getConfigurationFilename();",
"abstract protected function getConfigPath();",
"protected function initPath() {\n\n $list = preg_split('/ *, */',$this->config['pagesPath']);\n $basepath = dirname($this->configPath).'/';\n\n foreach($list as $k=>$path){\n if(trim($path) == '') continue;\n $p = realpath($basepath.$path);\n if ($p== '' || !file_exists($p))\n throw new Exception ('The path, '.$path.' given in the configuration doesn\\'t exist !');\n\n if (substr($p,-1) !='/')\n $p.='/';\n\n if ($handle = opendir($p)) {\n while (false !== ($f = readdir($handle))) {\n if ($f[0] != '.' && is_dir($p.$f) && isset($this->config[$f.'.step'])) {\n $this->pages[$f] = $p.$f.'/';\n }\n }\n closedir($handle);\n }\n }\n if (isset($this->config['customPath']) && $this->config['customPath'] != '') {\n $this->customPath = realpath($basepath.$this->config['customPath']);\n if ($this->customPath)\n $this->customPath .= '/';\n }\n\n if (isset($this->config['tempPath']) && $this->config['tempPath'] != '') {\n $this->tempPath = realpath($basepath.$this->config['tempPath']);\n if (!$this->tempPath)\n throw new Exception(\"no temp directory\");\n $this->tempPath .= '/';\n }\n else\n throw new Exception(\"no temp directory\");\n }",
"function setupFromPath($softwarePath)\n\t{\n\t\t$configfile = $softwarePath . 'configuration.php';\n\t\t//joomla 1.6+ test\n\t\t$test_version_file = $softwarePath . 'includes/version.php';\n\n\t\t$params = array();\n\t\t$lines = $this->readFile($configfile);\n\t\tif ($lines === false) {\n\t\t\tFramework::raise(LogLevel::WARNING, Text::_('WIZARD_FAILURE') . ': ' . $configfile . ' ' . Text::_('WIZARD_MANUAL'));\n\t\t\treturn false;\n\t\t} else {\n\t\t\t//parse the file line by line to get only the config variables\n\t\t\t//we can not directly include the config file as JConfig is already defined\n\t\t\t$config = array();\n\t\t\tforeach ($lines as $line) {\n\t\t\t\tif (strpos($line, '$')) {\n\t\t\t\t\t//extract the name and value, it was coded to avoid the use of eval() function\n\t\t\t\t\t// because from Joomla 1.6 the configuration items are declared public in tead of var\n\t\t\t\t\t// we just convert public to var\n\t\t\t\t\t$line = str_replace('public $', 'var $', $line);\n\t\t\t\t\t$vars = explode(\"'\", $line);\n\t\t\t\t\t$names = explode('var', $vars[0]);\n\t\t\t\t\tif (isset($vars[1]) && isset($names[1])) {\n\t\t\t\t\t\t$name = trim($names[1], ' $=');\n\t\t\t\t\t\t$value = trim($vars[1], ' $=');\n\t\t\t\t\t\t$config[$name] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//Save the parameters into the standard JFusion params format\n\t\t\t$params['database_host'] = isset($config['host']) ? $config['host'] : '';\n\t\t\t$params['database_name'] = isset($config['db']) ? $config['db'] : '';\n\t\t\t$params['database_user'] = isset($config['user']) ? $config['user'] : '';\n\t\t\t$params['database_password'] = isset($config['password']) ? $config['password'] : '';\n\t\t\t$params['database_prefix'] = isset($config['dbprefix']) ? $config['dbprefix'] : '';\n\t\t\t$params['database_type'] = isset($config['dbtype']) ? $config['dbtype'] : '';\n\t\t\t$params['source_path'] = $softwarePath;\n\n\t\t\t//determine if this is 1.5 or 1.6+\n\t\t\t$params['joomlaversion'] = (file_exists($test_version_file)) ? '1.6' : '1.5';\n\t\t}\n\t\treturn $params;\n\t}",
"private function createSettingsFile() {\n\t\t$data = (object) [\n\t\t\t\"gtag\" => \"\",\n\t\t\t\"gmap\" => \"\",\n\t\t\t\"sendgrid_api\" => \"\",\n\t\t\t\"pages\" => (object) [\n\t\t\t\t\"home\" => (object) [\n\t\t\t\t\t\"slides\" => [],\n\t\t\t\t\t\"backgroundTestimoni\" => ''\n\t\t\t\t],\n\t\t\t\t\"menu\" => (object) [\n\t\t\t\t\t\"headerImage\" => \"\"\n\t\t\t\t],\n\t\t\t\t\"gallery\" => (object) [\n\t\t\t\t\t\"headerImage\" => \"\"\n\t\t\t\t],\n\t\t\t\t\"contact\" => (object) [\n\t\t\t\t\t\"headerImage\" => \"\"\n\t\t\t\t]\n\t\t\t]\n\t\t];\n\n\t\treturn create_json_file($this->_filePath, $data);\n\t}",
"public function getConfigFilePath(): string;",
"private static function getConfigFilePath()\n {\n $input = new ArgvInput();\n $path = $input->getParameterOption(['-c', '--config'], 'behat.yml');\n $basePath = '';\n\n // If the path provided isn't an absolute path, then find the folder it is in recursively.\n if (substr($path, 0, 1) !== '/') {\n $basePath = self::getBasePathForFile($path, getcwd()) . DIRECTORY_SEPARATOR;\n }\n\n $configFile = $basePath . $path;\n\n if (!file_exists($configFile)) {\n throw new Exception(\n \"Autoclean: Config file '$path' not found at base path: '$basePath',\n please pass in the path to the config file through the -c flag and check permissions.\"\n );\n }\n\n return $configFile;\n }",
"protected function createFileIfNeeded(): void\n {\n if (!$this->files->exists($this->config['file_path'])) {\n $this->createFile();\n }\n }",
"public function createGlobalConfig()\n {\n $basicConfig = [\n 'paths' => [\n 'tests' => 'tests',\n 'output' => $this->outputDir,\n 'data' => $this->dataDir,\n 'support' => $this->supportDir,\n 'envs' => $this->envsDir,\n ],\n 'actor_suffix' => 'Tester',\n 'extensions' => [\n 'enabled' => [ 'Codeception\\Extension\\RunFailed' ],\n 'commands' => $this->getAddtionalCommands(),\n ],\n 'params' => [\n trim($this->envFileName),\n ],\n ];\n\n $str = Yaml::dump($basicConfig, 4);\n if ($this->namespace) {\n $namespace = rtrim($this->namespace, '\\\\');\n $str = \"namespace: $namespace\\n\" . $str;\n }\n $this->createFile('codeception.dist.yml', $str);\n }",
"public function createWorkingDirectoryPath();",
"private function createConfig()\n\t{\n\t\t$configFilename = __DIR__ . '/app/config/config.local.neon';\n\n\t\tcopy(__DIR__ . '/app/config/config.local.example.neon', $configFilename);\n\n\t\t$lines = file($configFilename);\n\n\t\tforeach ($lines as $key => $line)\n\t\t{\n\t\t\tforeach (array('username', 'password', 'database') as $subject)\n\t\t\t{\n\t\t\t\tif (strpos($line, \"\\t\" . $subject))\n\t\t\t\t{\n\t\t\t\t\t$lines[$key] = $this->deleteNewline($line, \"\\n\") . ' ' . $this->config['db'][$subject] . \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (file_put_contents($configFilename, $lines))\n\t\t{\n\t\t\t$this->success('Local config file created ...');\n\t\t}\n\t}",
"protected function initTyposcriptConfiguration(){\n\t\t\t/* TemplatePdf */\n\t\t\t$this->typoscript['templatePdf'] = $this->cObj->stdWrap($this->typoscript['templatePdf'],$this->typoscript['templatePdf.']);\n\t\t\t$this->typoscript['templatePdf'] = t3lib_div::getFileAbsFileName($this->typoscript['templatePdf']);\n\n\t\t\tif(empty($this->typoscript['templatePdf'])){\n\t\t\t\t$this->showError('empty template file Given check your typoscript configuration','templatePdf');\n\t\t\t return false;\n\t\t\t}\n\n\t\t\t/* renderedPdfStorageFolder */\n\t\t\t$this->typoscript['renderedPdfStorageFolder'] = $this->cObj->stdWrap($this->typoscript['renderedPdfStorageFolder'],$this->typoscript['renderedPdfStorageFolder.']);\n\t\t\tif(empty($this->typoscript['renderedPdfStorageFolder'])){\n\t\t\t\t$this->showError('no Storage FolderGiven','renderedPdfStorageFolder');\n\t\t\t\treturn false;\n\t\t\t}\n\n\n\t\t\t$this->typoscript['fileNameFormat'] = $this->cObj->stdWrap($this->typoscript['fileNameFormat'],$this->typoscript['fileNameFormat.']);\n\t\t\tif(empty($this->typoscript['fileNameFormat'])){\n\t\t\t\t$this->showError('no Fileformat String given','fileNameFormat');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$fileformatReplace = array(\n\t\t\t\t\t'###DD###'=>date('d'),\n\t\t\t\t\t'###D###'=>date('j'),\n\t\t\t\t\t'###MM###' =>date('m'),\n\t\t\t\t\t'###M###' =>date('m'),\n\t\t\t\t\t'###YYYY###' => date('Y'),\n\t\t\t\t\t'###YY###' => date('y'),\n\t\t\t\t\t'###MIN###' => date('i'),\n\t\t\t\t\t'###HH###' => date('H'),\n\t\t\t\t\t'###HASH8###' => substr(md5(time().microtime().mt_rand()), 0,8),\n\t\t\t\t\t'###HASH16###' => substr(md5(time().microtime().mt_rand()), 0,16),\n\t\t\t\t\t'###HASH32###' => md5(time().microtime().mt_rand()),\n\t\t\t\t\t'###HASH64###' => md5(time().microtime().mt_rand()) . md5(time().microtime().mt_rand()),\n\t\t\t\t\t'###BASENAME###' => basename($this->typoscript['templatePdf']),\n\t\t\t\t);\n\t\t\t$this->typoscript['fileNameFormat'] = strtr($this->typoscript['fileNameFormat'],$fileformatReplace);\n\t\t\tif($this->typoscript['fileNameFormat']=='.pdf'){\n\t\t\t\t$this->showError('invalid Filename Format');\n\t\t\t\treturn false;\n\t\t\t}\n\n\n\t\t\tif(!array_key_exists('renderConfiguration.', $this->typoscript) or !is_array($this->typoscript['renderConfiguration.'])){\n\t\t\t\t$this->showError('no Render configuration','renderConfiguration');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tswitch($this->typoscript['returnFormat']) {\n\t\t\t\tcase 'filename':\n\t\t\t\tcase 'relative':\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$this->typoscript['returnFormat'] = 'absolute';\n\t\t\t}\n\n\t\t\t// Every thing okay\n\t\t\treturn true;\n\t\t}",
"function mk_filename() {\n // with fixed bug it this function behaviour and open_basedir/environment\n // variables are not maliciously set to move temporary files out of open_basedir\n // In general, we'll try to create these files in ./temp subdir of current\n // directory, but it can be overridden by environment vars both on Windows and\n // Linux\n $filename = tempnam(WRITER_TEMPDIR,WRITER_FILE_PREFIX);\n $filehandle = @fopen($filename, \"wb\");\n // Now, if we have had any troubles, $filehandle will be\n if ($filehandle === false) {\n // Note: that we definitely need to unlink($filename); - tempnam just created it for us!\n // but we can't ;) because of open_basedir (or whatelse prevents us from opening it)\n\n // Fallback to some stupid algorithm of filename generation\n $tries = 0;\n do {\n $filename = WRITER_TEMPDIR.WRITER_FILE_PREFIX.md5(uniqid(rand(), true));\n // Note: \"x\"-mode prevents us from re-using existing files\n // But it require PHP 4.3.2 or later\n $filehandle = @fopen($filename, \"xb\");\n $tries++;\n } while (!$filehandle && $tries < WRITER_RETRIES);\n };\n\n if (!$filehandle) {\n die(WRITER_CANNOT_CREATE_FILE);\n };\n // Release this filehandle - we'll reopen it using some gzip wrappers\n // (if they are available)\n fclose($filehandle);\n\n // Remove temporary file we've just created during testing\n unlink($filename);\n\n return $filename;\n }",
"private static function setParts(string $config)\n {\n $parts = explode('.', $config, 2);\n self::$file = $parts[0];\n self::$config = isset($parts[1]) ? 'params.' . $parts[1] : 'params';\n\n if (isset(self::$data[self::$file])) return;\n if (!self::$dir) throw new \\InvalidArgumentException(\"Config files directory missing. Please, use 'setDir' method before.\");\n\n $config_file_path = self::$dir . self::$file . '.php';\n $array_data = require($config_file_path);\n $params = ['params' => $array_data];\n self::$data[self::$file] = new Data($params);\n }"
] | [
"0.7524631",
"0.59267235",
"0.5826724",
"0.5820451",
"0.55352414",
"0.54273105",
"0.5318755",
"0.5222898",
"0.51970565",
"0.5112779",
"0.50290245",
"0.50232136",
"0.4944061",
"0.49289134",
"0.48709434",
"0.48503178",
"0.4813952",
"0.4783832",
"0.47676647",
"0.4765304",
"0.47590223",
"0.4750318",
"0.47407982",
"0.47401592",
"0.47398207",
"0.47319788",
"0.47185594",
"0.47146687",
"0.4699214",
"0.4693728"
] | 0.8091484 | 0 |
CheckCfgDaten Aufruf bei jedem CfgStart IN: $cfg = .. OUT: korrigierte cfg | function CheckCfgDaten($cfg)
{
$this->DebugModuleName($cfg,"CheckCfgDaten");
global $_IPS;
// Debugging
$this->IfNotIssetSetValue($cfg['Ips']['Debug']['Modules'], false);
$this->IfNotIssetSetValue($cfg['Ips']['Debug']['ShowJSON'], false);
$this->IfNotIssetSetValue($cfg['Ips']['Debug']['ShowJSON_Data'], false);
$this->IfNotIssetSetValue($cfg['Ips']['Debug']['ShowCfg'], false);
// ChartType
$this->IfNotIssetSetValue($cfg['Ips']['ChartType'], 'Highcharts');
if ($cfg['Ips']['ChartType'] != 'Highcharts' && $cfg['Ips']['ChartType'] != 'Highstock')
die ("Abbruch! Es sind nur 'Highcharts' oder 'Highstock' als ChartType zulässig");
// über WebInterface kommt der Aufruf wenn die Content-Variable aktualisiert wird
if ($_IPS['SENDER'] != "WebInterface" && $cfg['RunMode'] != "popup")
$cfg = $this->Check_ContentVariable($cfg, $_IPS['SELF']);
return $cfg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function checkConfig() {\n\t\tglobal $wsTools;\n\t\tglobal $dbWScfg;\n\t\t$message = '';\n\t\t// ueberpruefen, ob ein Eintrag geaendert wurde\n\t\tif ((isset($_REQUEST[self::request_items])) && (!empty($_REQUEST[self::request_items]))) {\n\t\t\t$ids = explode(\",\", $_REQUEST[self::request_items]);\n\t\t\tforeach ($ids as $id) {\n\t\t\t\tif (isset($_REQUEST[dbWatchSiteCfg::field_value.'_'.$id])) {\n\t\t\t\t\t$value = $_REQUEST[dbWatchSiteCfg::field_value.'_'.$id];\n\t\t\t\t\t$where = array();\n\t\t\t\t\t$where[dbWatchSiteCfg::field_id] = $id;\n\t\t\t\t\t$config = array();\n\t\t\t\t\tif (!$dbWScfg->sqlSelectRecord($where, $config)) {\n\t\t\t\t\t\t$this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbWScfg->getError()));\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif (sizeof($config) < 1) {\n\t\t\t\t\t\t$this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, sprintf(ws_error_cfg_id, $id)));\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t$config = $config[0];\n\t\t\t\t\tif ($config[dbWatchSiteCfg::field_value] != $value) {\n\t\t\t\t\t\t// Wert wurde geaendert\n\t\t\t\t\t\t\tif (!$dbWScfg->setValue($value, $id) && $dbWScfg->isError()) {\n\t\t\t\t\t\t\t\t$this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbWScfg->getError()));\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif ($dbWScfg->isMessage()) {\n\t\t\t\t\t\t\t\t$message .= $dbWScfg->getMessage();\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// Datensatz wurde aktualisiert\n\t\t\t\t\t\t\t\t$message .= sprintf(ws_msg_cfg_id_updated, $id, $config[dbWatchSiteCfg::field_name]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// ueberpruefen, ob ein neuer Eintrag hinzugefuegt wurde\n\t\tif ((isset($_REQUEST[dbWatchSiteCfg::field_name])) && (!empty($_REQUEST[dbWatchSiteCfg::field_name]))) {\n\t\t\t// pruefen ob dieser Konfigurationseintrag bereits existiert\n\t\t\t$where = array();\n\t\t\t$where[dbWatchSiteCfg::field_name] = $_REQUEST[dbWatchSiteCfg::field_name];\n\t\t\t$where[dbWatchSiteCfg::field_status] = dbWatchSiteCfg::status_active;\n\t\t\t$result = array();\n\t\t\tif (!$dbWScfg->sqlSelectRecord($where, $result)) {\n\t\t\t\t$this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbWScfg->getError()));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (sizeof($result) > 0) {\n\t\t\t\t// Eintrag existiert bereits\n\t\t\t\t$message .= sprintf(ws_msg_cfg_add_exists, $where[dbWatchSiteCfg::field_name]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Eintrag kann hinzugefuegt werden\n\t\t\t\t$data = array();\n\t\t\t\t$data[dbWatchSiteCfg::field_name] = $_REQUEST[dbWatchSiteCfg::field_name];\n\t\t\t\tif (((isset($_REQUEST[dbWatchSiteCfg::field_type])) && ($_REQUEST[dbWatchSiteCfg::field_type] != dbWatchSiteCfg::type_undefined)) &&\n\t\t\t\t\t\t((isset($_REQUEST[dbWatchSiteCfg::field_value])) && (!empty($_REQUEST[dbWatchSiteCfg::field_value]))) &&\n\t\t\t\t\t\t((isset($_REQUEST[dbWatchSiteCfg::field_label])) && (!empty($_REQUEST[dbWatchSiteCfg::field_label]))) &&\n\t\t\t\t\t\t((isset($_REQUEST[dbWatchSiteCfg::field_description])) && (!empty($_REQUEST[dbWatchSiteCfg::field_description])))) {\n\t\t\t\t\t// Alle Daten vorhanden\n\t\t\t\t\tunset($_REQUEST[dbWatchSiteCfg::field_name]);\n\t\t\t\t\t$data[dbWatchSiteCfg::field_type] = $_REQUEST[dbWatchSiteCfg::field_type];\n\t\t\t\t\tunset($_REQUEST[dbWatchSiteCfg::field_type]);\n\t\t\t\t\t$data[dbWatchSiteCfg::field_value] = stripslashes(str_replace('"', '\"', $_REQUEST[dbWatchSiteCfg::field_value]));\n\t\t\t\t\tunset($_REQUEST[dbWatchSiteCfg::field_value]);\n\t\t\t\t\t$data[dbWatchSiteCfg::field_label] = $_REQUEST[dbWatchSiteCfg::field_label];\n\t\t\t\t\tunset($_REQUEST[dbWatchSiteCfg::field_label]);\n\t\t\t\t\t$data[dbWatchSiteCfg::field_description] = $_REQUEST[dbWatchSiteCfg::field_description];\n\t\t\t\t\tunset($_REQUEST[dbWatchSiteCfg::field_description]);\n\t\t\t\t\t$data[dbWatchSiteCfg::field_status] = dbWatchSiteCfg::status_active;\n\t\t\t\t\t$data[dbWatchSiteCfg::field_update_by] = $wsTools->getDisplayName();\n\t\t\t\t\t$data[dbWatchSiteCfg::field_update_when] = date('Y-m-d H:i:s');\n\t\t\t\t\t$id = -1;\n\t\t\t\t\tif (!$dbWScfg->sqlInsertRecord($data, $id)) {\n\t\t\t\t\t\t$this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbWScfg->getError()));\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t$message .= sprintf(ws_msg_cfg_add_success, $id, $data[dbWatchSiteCfg::field_name]);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// Daten unvollstaendig\n\t\t\t\t\t$message .= ws_msg_cfg_add_incomplete;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!empty($message)) $this->setMessage($message);\n\t\treturn $this->dlgConfig();\n\t}",
"function cfgExist($cfgfile, $dbconnection){\n\t$sql = $dbconnection->query(\"SELECT\n\t\tconfigurations.configurations_localfile\n\t\tFROM\n\t\tconfigurations\n\t\tINNER JOIN svcstatus ON configurations.configurations_svcstatus = svcstatus.svcstatus_id\n\t\tWHERE\n\t\tconfigurations.configurations_localfile = '\".$cfgfile.\"'\");\n if($sql->num_rows < 1) {\n \treturn false;\n }else{\n \treturn true;\n }\n}",
"function db_checkConfig()\n {\n // if (trim($GLOBALS['usrTableName'])=='') {\n setGlobalIfClear('usrTableName','is_usuarios');\n setGlobalIfClear('usrEMail','email');\n setGlobalIfClear('usrRightsField','NULL');\n setGlobalIfClear('usrSessionIDField','userID');\n setGlobalIfClear('usrSuperField','super');\n setGlobalIfClear('usrNicknameField','apelido');\n setGlobalIfClear('usrPassword','senha');\n setGlobalIfClear('usrPasswordAlgorithm','md5');\n setGlobalIfClear('usrLastAccess','lastAccess');\n setGlobalIfClear('usrUniqueIDField','id');\n setGlobalIfClear('usrIPField','lastIP');\n setGlobalIfClear('yMenuAttr','2');\n // }\n }",
"function has_config() {return true;}",
"function check_config_changed()\n {\n global $emu_config_modified_timestamp;\n\n $script_last_ran = sql_value('SELECT `value` FROM sysvars WHERE name = \"last_emu_import\"', '');\n\n if('' == $script_last_ran)\n {\n return true;\n }\n\n $emu_script_last_ran = strtotime($script_last_ran);\n\n if($emu_config_modified_timestamp > $emu_script_last_ran)\n {\n return true;\n }\n\n return false;\n }",
"private function checkConfig(): void\n {\n if (empty($this->userkey)) {\n Log::warning('Config \"message.zenziva.userkey\" is not defined.');\n }\n\n if (empty($this->passkey)) {\n Log::warning('Config \"message.zenziva.passkey\" is not defined.');\n }\n }",
"function checkConfig() {\n return NULL;\n }",
"public function isValidConfig():bool;",
"public function cfgAll()\n {\n $config = $this->getConfig();\n\n try {\n $newConfig = array(\n 'adapter' => $this->pAdapter($config->adapter),\n 'host' => $this->pHost($config->host),\n 'username' => $this->pUsername($config->username),\n 'password' => $this->pPassword($config->password),\n 'dbname' => $this->pDbname($config->dbname),\n 'charset' => $this->pCharset($config->charset),\n 'path' => $this->pPath($config->path),\n 'table' => $this->pTable($config->table),\n );\n } catch (Exception $e) {\n $newConfig = array(\n 'adapter' => $this->pAdapter(),\n 'host' => $this->pHost(),\n 'username' => $this->pUsername(),\n 'password' => $this->pPassword(),\n 'dbname' => $this->pDbname(),\n 'charset' => $this->pCharset(),\n 'path' => $this->pPath(),\n 'table' => $this->pTable(),\n );\n }\n\n if ($config->setData($newConfig)->saveConfig()) {\n $this->addMessage('Config saved');\n } else {\n $this->addMessage('Error. Config don\\'t saved');\n }\n }",
"public function updateCFGFile()\n\t{\n\t\tif ( $this->isSuperUser() )\n\t\t\treturn $this->configuration->replace();\n\t\tthrow new DBWRAPPERINIT(\"NOT_ALLOWED\", 150);\t\t\n\t}",
"public function dlgConfig() {\n \tglobal $parser;\n \tglobal $dbWScfg;\n\t\t$SQL = sprintf(\t\"SELECT * FROM %s WHERE NOT %s='%s' ORDER BY %s\",\n\t\t\t\t\t\t\t\t\t\t$dbWScfg->getTableName(),\n\t\t\t\t\t\t\t\t\t\tdbWatchSiteCfg::field_status,\n\t\t\t\t\t\t\t\t\t\tdbWatchSiteCfg::status_deleted,\n\t\t\t\t\t\t\t\t\t\tdbWatchSiteCfg::field_name);\n\t\t$config = array();\n\t\tif (!$dbWScfg->sqlExec($SQL, $config)) {\n\t\t\t$this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $dbWScfg->getError()));\n\t\t\treturn false;\n\t\t}\n\t\t$count = array();\n\t\t$items = sprintf(\t'<tr><th>%s</th><th>%s</th><th>%s</th></tr>',\n\t\t\t\t\t\t\t\t\t\t\tws_header_cfg_identifier,\n\t\t\t\t\t\t\t\t\t\t\tws_header_cfg_value,\n\t\t\t\t\t\t\t\t\t\t\tws_header_cfg_description );\n\t\t$row = '<tr><td>%s</td><td>%s</td><td>%s</td></tr>';\n\t\t// bestehende Eintraege auflisten\n\t\tforeach ($config as $entry) {\n\t\t\t$id = $entry[dbWatchSiteCfg::field_id];\n\t\t\t$count[] = $id;\n\t\t\t$label = constant($entry[dbWatchSiteCfg::field_label]);\n\t\t\t(isset($_REQUEST[dbWatchSiteCfg::field_value.'_'.$id])) ?\n\t\t\t\t$val = $_REQUEST[dbWatchSiteCfg::field_value.'_'.$id] :\n\t\t\t\t$val = $entry[dbWatchSiteCfg::field_value];\n\t\t\t\t// Hochkommas maskieren\n\t\t\t\t$val = str_replace('\"', '"', stripslashes($val));\n\t\t\t$value = sprintf(\t'<input type=\"text\" name=\"%s_%s\" value=\"%s\" />', dbWatchSiteCfg::field_value, $id,\t$val);\n\t\t\t$desc = constant($entry[dbWatchSiteCfg::field_description]);\n\t\t\t$items .= sprintf($row, $label, $value, $desc);\n\t\t}\n\t\t$items_value = implode(\",\", $count);\n\t\t// Mitteilungen anzeigen\n\t\tif ($this->isMessage()) {\n\t\t\t$intro = sprintf('<div class=\"message\">%s</div>', $this->getMessage());\n\t\t}\n\t\telse {\n\t\t\t$intro = sprintf('<div class=\"intro\">%s</div>', ws_intro_cfg);\n\t\t}\n\t\t$data = array(\n\t\t\t'form_name'\t\t\t\t\t\t=> 'konfiguration',\n\t\t\t'form_action'\t\t\t\t\t=> $this->page_link,\n\t\t\t'action_name'\t\t\t\t\t=> self::request_action,\n\t\t\t'action_value'\t\t\t\t=> self::action_config_check,\n\t\t\t'items_name'\t\t\t\t\t=> self::request_items,\n\t\t\t'items_value'\t\t\t\t\t=> $items_value,\n\t\t\t'header'\t\t\t\t\t\t\t=> ws_header_cfg,\n\t\t\t'intro'\t\t\t\t\t\t\t\t=> $intro,\n\t\t\t'items'\t\t\t\t\t\t\t\t=> $items,\n\t\t\t'btn_ok'\t\t\t\t\t\t\t=> ws_btn_ok,\n\t\t\t'btn_abort'\t\t\t\t\t\t=> ws_btn_abort,\n\t\t\t'abort_location'\t\t\t=> $this->page_link\n\t\t);\n\t\treturn $parser->get($this->template_path.'backend.cfg.htt', $data);\n\t}",
"private function _checkConfigFile()\n {\n return !!file_exists(App::pluginPath('Gallery') . 'Config' . DS . 'config.php');\n }",
"public function ConfigCheck(): void {\n\t\t$config = new Config($this->getDataFolder() . \"config.yml\", Config::YAML);\n\t\tif((!$config->exists(\"config-version\")) || ($config->get(\"config-version\") !== self::CONFIG_VER)){\n\t\t\trename($this->getDataFolder() . \"config.yml\", $this->getDataFolder() . \"config_old.yml\");\n\t\t\t$this->saveResource(\"config.yml\");\n\t\t\t$this->getLogger()->critical(\"Your configuration file is outdated.\");\n\t\t\t$this->getLogger()->notice(\"Your old configuration has been saved as config_old.yml and a new configuration file has been generated.\");\n\t\t\treturn;\n\t\t}\n\t}",
"protected function _validateConfig() {\n\t\t# Megnezni, hogy a config fajl megvan e\n\t\tif (!$this->_existsConfigFile()) {\n\t\t\t$this->_configErrors[] = 'Missing config file: \"' . $this->_getConfigFilePath() . '\"';\n\t\t\t$message = $this->_getConfigErrorsFormatted();\n\t\t\tdie($message);\n\t\t}\n\n\t\t# Megnezni, hogy a config file-ban a json valid e (http://php.net/manual/en/function.json-last-error.php)\n\t\t$config = json_decode(file_get_contents($this->_getConfigFilePath()), true);\n\t\t$hasJsonError = true;\n\t\t$jsonError = 'JSON error (' . $this->_getConfigFilePath() . '): ';\n\t\tswitch (json_last_error()) {\n\t\t\tcase JSON_ERROR_NONE:\n\t\t\t\t$hasJsonError = false;\n\t\t\t\tbreak;\n\t\t\tcase JSON_ERROR_DEPTH:\n\t\t\t\t$this->_configErrors[] = 'Maximum stack depth exceeded';\n\t\t\t\tbreak;\n\t\t\tcase JSON_ERROR_STATE_MISMATCH:\n\t\t\t\t$this->_configErrors[] = $jsonError . 'Underflow or the modes mismatch';\n\t\t\t\tbreak;\n\t\t\tcase JSON_ERROR_CTRL_CHAR:\n\t\t\t\t$this->_configErrors[] = $jsonError . 'Unexpected control character found';\n\t\t\t\tbreak;\n\t\t\tcase JSON_ERROR_SYNTAX:\n\t\t\t\t$this->_configErrors[] = $jsonError . 'Syntax error, malformed JSON';\n\t\t\t\tbreak;\n\t\t\tcase JSON_ERROR_UTF8:\n\t\t\t\t$this->_configErrors[] = $jsonError . 'Malformed UTF-8 characters, possibly incorrectly encoded';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->_configErrors[] = $jsonError . 'Unknown error';\n\t\t\t\tbreak;\n\t\t}\n\t\tif ($hasJsonError) {\n\t\t\t$message = $this->_getConfigErrorsFormatted();\n\t\t\tdie($message);\n\t\t}\n\n\t\t# Megnezni, hogy a config-ban levo file-ok megvannak e ott, ahol jelolve vannak\n\t\t$welcome = $this->_templateRootPath . $config['welcome'];\n\t\tif (!file_exists($welcome)) {\n\t\t\t$this->_configErrors[] = 'Welcome template missing on this path: \"' . $welcome . '\"';\n\t\t\t$message = $this->_getConfigErrorsFormatted();\n\t\t\tdie($message);\n\t\t}\n\t\t$finish = $this->_templateRootPath . $config['finish'];\n\t\tif (!file_exists($finish)) {\n\t\t\t$this->_configErrors[] = 'Finish template missing on this path: \"' . $finish . '\"';\n\t\t\t$message = $this->_getConfigErrorsFormatted();\n\t\t\tdie($message);\n\t\t}\n\n\t\treturn true;\n\t}",
"function check_climaintenance($configfile) {\n $content = file_get_contents($configfile);\n // Set comments to be on newlines, replace '//' with '\\n//', where // does not start with a : colon.\n $content = preg_replace(\"#[^!:]//#\", \"\\n//\", $content);\n $content = preg_replace(\"/;/\", \";\\n\", $content); // Split up statements, replace ';' with ';\\n'\n $content = preg_replace(\"/^[\\s]+/m\", \"\", $content); // Removes all initial whitespace and newlines.\n\n $re = '/^\\$CFG->dataroot\\s+=\\s+[\"\\'](.*?)[\"\\'];/m'; // Lines starting with $CFG->dataroot.\n preg_match($re, $content, $matches);\n if (!empty($matches)) {\n $climaintenance = $matches[count($matches) - 1] . '/climaintenance.html';\n\n if (file_exists($climaintenance)) {\n return true;\n }\n }\n\n return false;\n}",
"public function validateConfig();",
"public function checkConfigExistence(bool $answer = true);",
"protected function checkConfig() {\n\t\t$public_ssl_key = $this->config->getSetting('public_ssl_key');\n\t\t$this->debug(\"configcheck public_ssl_key\", !empty($public_ssl_key));\n\t\tif (empty($public_ssl_key)) {\n\t\t\treturn $this->throwError(\"sslkey_missingconf\");\n\t\t}\n\t\t$this->debug(\"try to open '\".$this->config->getSetting('public_ssl_key').\"'\", file_exists($this->config->getSetting('public_ssl_key')));\n\t\tif (!file_exists($this->config->getSetting('public_ssl_key'))) {\n\t\t\treturn $this->throwError(\"sslkey_missingfile\");\n\t\t}\n\t\t$tokensfile = $this->config->getSetting('tokensfile');\n\t\t$this->debug(\"configcheck tokensfile\", !empty($tokensfile));\n\t\tif (empty($tokensfile)) {\n\t\t\treturn $this->throwError(\"usedtokens_missingconf\");\n\t\t}\n\t\t$loglevel = $this->config->getSetting('loglevel');\n\t\tif ((int)$this->config->getSetting('loglevel') == 0) {\n\t\t\t$this->debug(\"Logging is disabled\", true);\n\t\t}\n\t\telse {\n\t\t\t$logfile = $this->config->getSetting('logfile');\n\t\t\t$this->debug(\"configcheck logfile\", !empty($logfile));\n\t\t\tif (empty($logfile)) {\n\t\t\t\treturn $this->throwError(\"logfile_missingconf\");\n\t\t\t}\n\t\t}\n\t\tif ((boolean)$this->config->getSetting('externalOpenssl') && (!(boolean)$this->config->getSetting('tmp_signature_dir'))) {\t\n\t\t\treturn $this->throwError(\"tmp_signature_dir_missingconf\");\n\t\t}\n\t\tif (self::DEBUG) {\n\t\t\t$this->config->getErrorhandler()->debugErrorMessages();\n\t\t}\n\t\treturn true;\n\t}",
"function CLCFG_aptConf($proxyServer,$proxyPort)\n{\n\n\techo(\"\nrm /etc/apt/apt.conf.d/70debconf 2> /dev/null\n\ncat >> /etc/apt/apt.conf.d/70debconf << \\\"EOF\\\"\n\n//Pre-configure all packages with debconf before they are installed.\n//If you don't like it, comment it out.\nDPkg::Pre-Install-Pkgs {\\\"/usr/sbin/dpkg-preconfigure --apt || true\\\";};\");\n\nif (!empty($proxyServer))\necho (\"\nAcquire::http::Proxy \\\"http://$proxyServer:$proxyPort\\\";\nAcquire::ftp::Proxy \\\"http://$proxyServer:$proxyPort\\\";\");\n\n\necho (\"\nEOF\n\nif test -f /etc/apt/apt.conf.d/70debconf\nthen\n\t\".sendClientLogStatus(\"/etc/apt/apt.conf.d/70debconf was written\",true).\"\nelse\n\t\".sendClientLogStatus(\"/etc/apt/apt.conf.d/70debconf was written\",false,true).\"\nfi\\n\n\");\n}",
"private function validate_config() : void {\n\t\t$validation = Schema::import( $this->config_schema );\n\t\t$validation->in( $this->config );\n\t}",
"private function check()\n {\n $dbs = $this->db_selected;\n $config = $this->config ?? null;\n\n if(empty($config) OR !is_array($config))\n {\n DatabaseException::except('\n The <b>'.$dbs.'</b> database configuration is required. <br>\n Please open the \"'.Config::$_config_file['database'].'\" file to correct it\n ');\n }\n $keys = ['dbms','port','host','username','password','database','charset'];\n\n foreach ($keys As $key)\n {\n if(!array_key_exists($key, $config))\n {\n DatabaseException::except('\n The <b>'.$key.'</b> key of the '.$dbs.' database configuration don\\'t exist. <br>\n Please fill it in array $config[\"database\"][\"'.$dbs.'\"] of the file « '.Config::$_config_file['database'].' »\n ');\n }\n }\n\n foreach ($config As $key => $value)\n {\n if(!in_array($key, ['password','options','prefix', 'debug']) AND empty($value)) \n\t\t\t{\n DatabaseException::except('\n The <b>' . $key . '</b> key of ' . $dbs . ' database configuration must have a valid value. <br>\n Please correct it in array $config[\"database\"][\"'.$dbs.'\"] of the file « ' . Config::$_config_file['database'] . ' »\n ');\n }\n }\n\n $dbms = (strtolower($config['dbms']) === 'mariadb') ? 'mysql' : strtolower($config['dbms']);\n if(!in_array($dbms, ['mysql','oracle','sqlite','sybase']))\n {\n DatabaseException::except('\n The DBMS (<b>'.$dbms.'</b>) you entered for '.$dbs.' database is not supported by dFramework. <br>\n Please correct it in array $config[\"database\"][\"'.$dbs.'\"] of the file « ' . Config::$_config_file['database'] . ' »\n ');\n }\n\n $config['debug'] = $config['debug'] ?? 'auto';\n if(!in_array($config['debug'], ['auto', true, false]))\n {\n DatabaseException::except('\n The <b>database['.$dbs.'][debug]</b> configuration is not set correctly (Accept values: auto/true/false). \n <br>\n Please edit « '.Config::$_config_file['database'].' » file to correct it\n ');\n }\n else if($config['debug'] === 'auto')\n {\n $this->config['debug'] = (Config::get('general.environment') === 'dev');\n }\n\n $this->initialize();\n }",
"function cfg_debug()\n{\n $cfg = cfg_init();\n return $cfg['setup']['debug'] === true;\n}",
"function verifyConfiguration()\n {\n $asset_type_id = $this->input->post('asset_type_id');\n $measure_unit_id = $this->input->post('measure_unit_id');\n $triggers_asset_measurement = Doctrine::getTable('AssetTriggerMeasurementConfig')->checkTriggerAssetMeasurence($asset_type_id, $measure_unit_id);\n $assetId = Doctrine_Core::getTable('AssetTriggerMeasurementConfig')->checkAssetId($asset_type_id);\n\n if ($assetId === false)\n {\n $valor = 0;\n } else\n {\n $valor = $assetId->asset_type_id;\n }\n if ($asset_type_id === $valor)\n {\n $existe_intervalo = false;\n $existe_rango = false;\n\n //Revisar valor entregado por $existe_intervalo cuando ya existe un intervalo\n foreach ($triggers_asset_measurement as $trigger)\n {\n\n if (is_null($trigger->asset_trigger_measurement_config_end))\n {\n $existe_intervalo = true;\n } else\n {\n $existe_rango = true;\n }\n }\n $result = array('existe_intervalo' => $existe_intervalo, 'existe_rango' => $existe_rango);\n } else\n {\n $result = true;\n }\n $json_data = $this->json->encode(array('success' => true, 'result' => $result));\n echo $json_data;\n }",
"static function check_config() {\n $login = module::get_var(\"bitly\", \"login\");\n $api_key = module::get_var(\"bitly\", \"api_key\");\n if (empty($login) || empty($api_key)) {\n site_status::warning(\n t(\"bit.ly is not quite ready! Please provide a <a href=\\\"%url\\\">login and API Key</a>\",\n array(\"url\" => html::mark_clean(url::site(\"admin/bitly\")))),\n \"bitly_config\");\n\n } else if (!self::validate_config($login, $api_key)) {\n site_status::warning(\n t(\"bit.ly is not properly configured! URLs will not be shortened until its <a href=\\\"%url\\\">configuration</a> is updated.\",\n array(\"url\" => html::mark_clean(url::site(\"admin/bitly\")))),\n \"bitly_config\");\n } else {\n site_status::clear(\"bitly_config\");\n return true;\n }\n return false;\n }",
"function process_config($config) {\n\n $return = true;\n\n foreach ($config as $name => $value) {\n if (!set_config($name, $value)) {\n $return = false;\n }\n }\n\n return $return;\n}",
"function _checkConfig(){\n $this->bConfigExists = file_exists(DIR_PLUGINS.\"{$this->sName}/config.php\");\n if(!$this->bConfigExists){\n $this->bConfigWritable = false;\n }else if(is_writable(DIR_PLUGINS.\"{$this->sName}/config.php\")){\n $this->bConfigWritable = true;\n }else{\n @chmod(DIR_PLUGINS.\"{$this->sName}/config.php\",0644);\n if(is_writable(DIR_PLUGINS.\"{$this->sName}/config.php\")){\n $this->bConfigWritable = true;\n }else{\n $this->bConfigWritable = false;\n }\n }\n }",
"protected function checkConfig()\n {\n if (!is_array($this->aData)) {\n throw new BadConfigException(\"Config error. Config data is not an array.\");\n } else {\n if (trim($this->aData['debugEnabled']) == \"\") {\n throw new BadConfigException(\"Config error. Missing required item 'debugEnabled'\");\n }\n if (intval($this->aData['debugEnabled'])) {\n if (empty(trim($this->aData['apiUrlRegisterDeb']))) {\n throw new BadConfigException(\"Config error. Missing required item 'apiUrlRegisterDeb'\");\n }\n } else {\n if (empty(trim($this->aData['apiUrlRegisterProd']))) {\n throw new BadConfigException(\"Config error. Missing required item 'apiUrlRegisterProd'\");\n }\n }\n /*\n if (empty(trim($this->aData['api_url_get_status']))) {\n $this->deb(\"Config isValidConfig fail api_url_get_status\", $this->aData);\n $res = 0;\n }\n */\n if (empty(trim($this->aData['login']))) {\n throw new BadConfigException(\"Config error. Missing required item 'login'\");\n }\n if (empty(trim($this->aData['password']))) {\n throw new BadConfigException(\"Config error. Missing required item 'password'\");\n }\n if (empty(trim($this->aData['productType']))) {\n throw new BadConfigException(\"Config error. Missing required item 'productType'\");\n }\n if (empty(trim($this->aData['productID']))) {\n throw new BadConfigException(\"Config error. Missing required item 'productID'\");\n }\n if (empty(trim($this->aData['includeShipping']))) {\n throw new BadConfigException(\"Config error. Missing required item 'includeShipping'\");\n }\n if (intval($this->aData['includeShipping'])) {\n if (empty(trim($this->aData['shippingProductName']))) {\n throw new BadConfigException(\"Config error. Missing required item 'shippingProductName'\");\n }\n }\n if (empty(trim($this->aData['measure']))) {\n throw new BadConfigException(\"Config error. Missing required item 'measure'\");\n }\n }\n }",
"public function processConfig()\n\t{\n\t\t$this->processConfigFile();\n\t\t$this->checkRequiredConfiguration();\n\t\t$this->processHolidayConfiguration();\n\t}",
"function cfgLocalExist($cfgid, $dbconnection){\n\t$sql = $dbconnection->prepare(\"SELECT\n\tconfigrecord.txtlocalcfg\n\tFROM\n\t\tconfigrecord\n\tWHERE\n\t\tconfigrecord.txtidcfg = ?\");\n\t$sql->bind_param('i', $cfgid);\n $sql->execute();\n $sql->store_result();\n $sql->bind_result($cfgfile);\n $sql->fetch();\n\n if (!file_exists($cfgfile)){\n \treturn false;\n }else{\n \treturn true;\n }\n}",
"function lecture_config() {\n global $CFG,$version,$chemin;\n\n //$lignes=get_records_sql(\"select * from c2iconfig order by cle\",1,\"err_lecture_config\",\"\");\n // surtout pas ca ! c2iconfig ne peut pas avoir de prefix !\n $lignes=get_records(\"config\",null,\"cle\",null,null,1,\"err_lecture_config\",\"\");\n //print_r($lignes);\n if ($lignes)\n foreach($lignes as $ligne) {\n $cle=$ligne->cle;\n $CFG->$cle=$ligne->valeur;\n }\n else erreur_fatale (\"err_lecture_config\");\n //important sinon va raconter n'importe quoi a la 1ERE erreur fatale suivante'\n // (le dossier de resources n'est pas accessible ...')\n\n\n//comparer $CFG->version_release en base avec mes valeurs et mettre � jour la BD au fur et a mesure\n\tif ($CFG->version !=$version) {\n\t\tset_config('pfc2i','version',$version,0);\n\t}\n\n\n//rev 987 adresses variables des listes de feedback\n// a calculer ici car on a besoin de connaitre le type de c2i \n//$adfq=\"qcm-\".$CFG->c2i.\"@education.gouv.fr\";\n//add_config('questions','adresse_feedback_questions',$adfq,$adfq,'adresse des experts validateurs des questions',0);\n\n// rev 1013 simplifie les tests plus tards\n$CFG->unicodedb= strtoupper( $CFG->encodage) != \"ISO-8859-1\";\n/****\n if (get_config_item('activer_filtre_latex',false)) {\n require_once($CFG->dirroot.'/commun/filtres/tex/lib.php');\n tex_filter_maj_bd();\n }\n*****/\n\n\n// important apr�s relecture du theme dans la config\n// il y a encore quelques acc�s direct a CFG->chemin_images dans weblib.php\n$CFG->chemin_theme=$chemin.\"/themes/\".$CFG->theme;\n$CFG->chemin_images=$CFG->chemin_theme.'/images';\n//rev 981\n$CFG->utiliser_form_actions=1; // rev 981 simplification forte des liens openPopup ....\n\n//seulement sur les nationales\n$CFG->utiliser_commentaires_reponses=$CFG->universite_serveur==1; \n\n//version 2.0 éviter un double slash dans ces chemins absolus\n// donc ajouter systématiquement un '/' dans les concanténations \n// verifié le 27/04/2014 par \n// grep -Rin chemin_ressources * |grep CFG (98 occurences)\n// grep -Rin wwwroot * | grep CFG (383 occurences)\n\n$CFG->chemin_ressources = remove_slash_url($CFG->chemin_ressources);\n$CFG->wwwroot = remove_slash_url($CFG->wwwroot);\n//echo \"pp\".$CFG->chemin_ressources;\n\n\n}"
] | [
"0.6189686",
"0.6052682",
"0.5927452",
"0.59242356",
"0.58645916",
"0.5820624",
"0.58089536",
"0.57612216",
"0.5742146",
"0.57128865",
"0.57097214",
"0.5679814",
"0.5670956",
"0.56307703",
"0.5630286",
"0.5627616",
"0.5607494",
"0.5560993",
"0.5555249",
"0.5527415",
"0.55146325",
"0.5507693",
"0.5486921",
"0.5480061",
"0.547693",
"0.54722106",
"0.54206306",
"0.5390678",
"0.53793544",
"0.5374827"
] | 0.7730747 | 0 |
CheckCfg_AreaHighChart IN: $cfg OUT: korrigiertes $cfg | function CheckCfg_AreaHighChart($cfg)
{
$this->DebugModuleName($cfg,"CheckCfg_AreaHighChart");
$this->IfNotIssetSetValue($cfg['HighChart']['Theme'], "");
$this->IfNotIssetSetValue($cfg['HighChart']['Width'], 0);
$this->IfNotIssetSetValue($cfg['HighChart']['Height'], 400);
return $cfg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CheckCfgDaten($cfg)\n {\n $this->DebugModuleName($cfg,\"CheckCfgDaten\");\n\n global $_IPS;\n\n // Debugging\n $this->IfNotIssetSetValue($cfg['Ips']['Debug']['Modules'], \t\t\tfalse);\n $this->IfNotIssetSetValue($cfg['Ips']['Debug']['ShowJSON'], \t\t\tfalse);\n $this->IfNotIssetSetValue($cfg['Ips']['Debug']['ShowJSON_Data'], \tfalse);\n $this->IfNotIssetSetValue($cfg['Ips']['Debug']['ShowCfg'], \t\t\tfalse);\n\n // ChartType\n $this->IfNotIssetSetValue($cfg['Ips']['ChartType'], 'Highcharts');\n\n if ($cfg['Ips']['ChartType'] != 'Highcharts' && $cfg['Ips']['ChartType'] != 'Highstock')\n die (\"Abbruch! Es sind nur 'Highcharts' oder 'Highstock' als ChartType zulässig\");\n\n // über WebInterface kommt der Aufruf wenn die Content-Variable aktualisiert wird\n if ($_IPS['SENDER'] != \"WebInterface\" && $cfg['RunMode'] != \"popup\")\n $cfg = $this->Check_ContentVariable($cfg, $_IPS['SELF']);\n\n return $cfg;\n }",
"function verifyConfiguration()\n {\n $asset_type_id = $this->input->post('asset_type_id');\n $measure_unit_id = $this->input->post('measure_unit_id');\n $triggers_asset_measurement = Doctrine::getTable('AssetTriggerMeasurementConfig')->checkTriggerAssetMeasurence($asset_type_id, $measure_unit_id);\n $assetId = Doctrine_Core::getTable('AssetTriggerMeasurementConfig')->checkAssetId($asset_type_id);\n\n if ($assetId === false)\n {\n $valor = 0;\n } else\n {\n $valor = $assetId->asset_type_id;\n }\n if ($asset_type_id === $valor)\n {\n $existe_intervalo = false;\n $existe_rango = false;\n\n //Revisar valor entregado por $existe_intervalo cuando ya existe un intervalo\n foreach ($triggers_asset_measurement as $trigger)\n {\n\n if (is_null($trigger->asset_trigger_measurement_config_end))\n {\n $existe_intervalo = true;\n } else\n {\n $existe_rango = true;\n }\n }\n $result = array('existe_intervalo' => $existe_intervalo, 'existe_rango' => $existe_rango);\n } else\n {\n $result = true;\n }\n $json_data = $this->json->encode(array('success' => true, 'result' => $result));\n echo $json_data;\n }",
"function sectionConfiguration() {\n\t\tglobal $LANG;\n\t\t$arrOptions[] = '<table>';\n\t\t$arrOptions[] = '<tr>';\n\t\t$strChecked = (!isset($this->arrModParameters['rows']) || $this->arrModParameters['rows']=='all')?'checked=\"checked\"':'';\n\t\t$arrOptions[] = '<td><input name=\"'.$this->pObj->strExtKey.'[rows]\" type=\"radio\" value=\"all\"' . $strChecked . ' /></td>';\n\t\t$arrOptions[] = '<td colspan=\"4\">'.$LANG->getLL('export_all').' ('.$this->arrResults['finished'].')</td>';\n\t\t$arrOptions[] = '</tr>';\n\t\t$arrOptions[] = '<tr>';\n\t\t$strChecked = ($this->arrModParameters['rows']=='selected')?'checked=\"checked\"':'';\n\t\t$arrOptions[] = '<td><input name=\"'.$this->pObj->strExtKey.'[rows]\" type=\"radio\" value=\"selected\"' . $strChecked . ' /></td>';\n\t\t$arrOptions[] = '<td colspan=\"4\">'.$LANG->getLL('export_selected').'</td>';\n\t\t$arrOptions[] = '</tr>';\n\t\t$arrOptions[] = '<tr>';\n\t\t$arrOptions[] = '<td> </td>';\n\t\t$arrOptions[] = '<td>'.$LANG->getLL('export_from').'</td>';\n\t\t$arrOptions[] = '<td><input type=\"text\" name=\"'.$this->pObj->strExtKey.'[configuration][from]\" value=\"' . $this->arrModParameters['configuration']['from'] . '\" /></td>';\n\t\t$arrOptions[] = '<td>'.$LANG->getLL('export_count').'</td>';\n\t\t$arrOptions[] = '<td><input type=\"text\" name=\"'.$this->pObj->strExtKey.'[configuration][count]\" value=\"' . $this->arrModParameters['configuration']['count'] . '\" /></td>';\n\t\t$arrOptions[] = '</tr>';\n\t\t$arrOptions[] = '<tr>';\n\t\t$strChecked = (isset($this->arrModParameters['unfinished']))?'checked=\"checked\"':'';\n\t\t$arrOptions[] = '<td><input name=\"'.$this->pObj->strExtKey.'[unfinished]\" type=\"checkbox\" value=\"1\"' . $strChecked . ' /></td>';\n\t\t$arrOptions[] = '<td colspan=\"4\">'.$LANG->getLL('export_unfinished').' ('.$this->arrResults['unfinished'].')</td>';\n\t\t$arrOptions[] = '</tr>';\n\t\t$arrOptions[] = '</table>';\n\t\t$strOutput = $this->pObj->objDoc->section($LANG->getLL('export_configuration'),t3lib_BEfunc::cshItem('_MOD_'.$GLOBALS['MCONF']['name'],'export_configuration',$GLOBALS['BACK_PATH'],'|<br/>').implode(chr(13),$arrOptions),0,1);\n\t\t$strOutput .= $this->pObj->objDoc->divider(10);\n\t\treturn $strOutput;\n\t}",
"function do_output ($conf,$event)\r\n {\r\n \tif(is_bool($conf)) return $conf;\r\n \t\r\n \tif (is_array($conf) && in_array($event, $conf)) return true;\r\n \t\r\n \tif (!is_array($conf) && (strtolower ($conf) == 'all' || $conf == $event)) return true; \r\n \t\r\n \treturn false;\r\n }",
"function area_show_specific_area($areadata = NULL, $inventory_id = NULL) {\n\tassert(!empty($areadata));\n\tdrupal_add_css(drupal_get_path('module', 'area') . '/css/area.css');\n\tdrupal_add_js('misc/form.js');\n\tdrupal_add_js('misc/collapse.js');\n\tdrupal_set_title(t('area').' '.$areadata['name']);\n\t\n\tglobal $base_url;\n\t\n\t//load js for observation table/map\n\t$observation_path = drupal_get_path('module', 'observation');\n\tdrupal_add_js($observation_path . '/js/observation.js');\n\tdrupal_add_library('system', 'ui.dialog');\n\n\t$output['message'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '\n\t\t\t<div id=\"message\" style=\"display: none; height: auto;\">\n\t\t\t\t<div class=\"messages status\"></div>\n\t\t\t</div>'\n\t);\n\t\n\t/* Create a fieldset for the tabular data */\n\t$output['area'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Area details'),\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'id' => 'area-show-details' // required for CSS\n\t\t\t),\n\t\t\t'#weight' => 1\n\t);\n\t\n\t/* Build the content of the table, leave out empty fields */\n\t$output['area']['table'] = area_get_infotable_of_specific_area($areadata);\n\n\t/* Create a fieldset for the static google maps */\n\t$output['area_map'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Map'),\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'id' => 'area-show-map', // required for CSS\n\t\t\t\t\t'name' => 'map' //used for anchor\n\t\t\t)\n\t);\n\t\n\t$iconBaseUrl = '/' . path_to_theme() . '/images/icons/enabled/';\n\t$output['area_map']['zoom'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '<img style=\"cursor:pointer;\" src=\"' . $iconBaseUrl . 'Zoom in.png\" alt=\"' . t('zoomin') . '\" title=\"' . t('zoomin') . '\" onclick=\"javascript:observationmap.zoomIn(event, ' .$areadata['id'] . ');\" /> '.t('zoomin') \n\t);\n\t\n\t//if user has RED_WRITE Permission and area is not a child, user can add a subarea\n\tif(area_check_access($areadata, 'ACL_RED_WRITE') && empty($areadata['parent_id'])) {\n\t\t$output['area_map']['create_sub_area'] = array(\n\t\t\t\t'#type' => 'markup',\n\t\t\t\t'#prefix' => '</br>',\n\t\t\t\t'#markup' => '<img style=\"cursor:pointer;\" onclick=\"window.location.href=\\''.$base_url . '/area/new/'.$areadata['id'].'\\'\" src=\"'.$iconBaseUrl.'Site map.png\" style=\"cursor:pointer;\" alt=\"' .t('Create a subarea') . '\" title=\"' . t('Create a subarea') . '\"/> '. t('Create a subarea')\n\t\t);\n\t}\n\t\n\t$output['area_map']['map'] = array(\n\t\t\t'#theme' => 'area',\n\t\t\t'#mapid' => 'observationmap',\n\t\t\t'#ch1903' => true,\n\t\t\t'#showall' => false,\n\t\t\t'#scalecontrol' => true,\n\t\t\t'#action' => 'show',\n\t\t\t'#reticle' => false,\n\t\t\t'#geometry_edit_id' => (int) $areadata['id'],\n\t\t\t'#defaultzoom' => '15',\n\t\t\t'#infowindow_content_fetch_url_area' => base_path()\n\t\t\t. 'area/{ID}/areaoverview/ajaxform',\n\t\t\t'#infowindow_content_fetch_url_observation' => base_path()\n\t\t\t. 'observation/{ID}/overview/ajaxform',\n\t\t\t'#geometries_fetch_url' => base_path() . 'area/' . $areadata['id'] . '/json',\n\t);\n\t\n\t/* Create a fieldset for the comment text field */\n\t$output['area_description'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Description'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#collapsed' => false,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'id' => 'area-show-comment',\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible'\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t'#weight' => 2\n\t);\n\t\n\t/* add the comments for the area as an editable textarea */\n\t$output['area_description']['comment'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#markup' => \"<div class='area-description'>\"\n\t\t\t. (empty($areadata['comment']) ? t(\"None available\")\n\t\t\t\t\t: check_plain($areadata['comment'])) . \"</div>\"\n\t);\n\t\n\t/* Create a fieldset for the linked habitats */\n\t$output['area_inventories'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('inventories').' & '.t('observations'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible'\n\t\t\t\t\t),\n\t\t\t\t\t'id' => 'area-show-comment' // required for CSS\n\t\t\t),\n\t\t\t'#weight' => 3\n\t);\n\tif(area_check_access($areadata, 'ACL_RED_WRITE') && user_access(CREATE_INVENTORY)) {\n\t\tglobal $base_url;\n\t\t$iconBaseUrl = '/' . path_to_theme() . '/images/icons/enabled/';\n\t\t\n\t\t$output['area_inventories']['add_inventory'] = array(\n\t\t\t\t'#type' => 'markup',\n\t\t\t\t'#markup' => '<a href=\"'.$base_url.'/inventory/area/'.$areadata['id'].'/new\"> <img src=\"' . $iconBaseUrl . 'Add.png\" alt=\"' . t('Add Inventory') . '\" title=\"' . t('Add Inventory') . '\" />'.t('Add Inventory').'</a>',\n\t\t);\n\t}\n\t\n\t$output['area_inventories']['inventories'] = inventory_show_area_inventories($areadata);\n\t$output['area_inventories']['space'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '<br><br>'\n\t);\n\t\n\t$output['area_inventories']['observations'] = inventory_show_observations($areadata['id'], $inventory_id);\n\t\n\t/* Create a fieldset for the strategies text fields */\n\t$output['area_concept'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Area concept'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#collapsed' => false,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible',\n\t\t\t\t\t\t\t'collapsed'\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t'#weight' => 4\n\t);\n\n\t/* add the protectiont target textarea */\n\t$output['area_concept']['protection_target'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#title' => t('Protection target'),\n\t\t\t'#markup' => \"<pre>\"\n\t\t\t\t\t. (empty($areadata['protection_target'])\n\t\t\t\t\t\t\t? t(\"None available\")\n\t\t\t\t\t\t\t: check_plain($areadata['protection_target']))\n\t\t\t\t\t. \"</pre>\"\n\t);\n\n\t/* add the tending strategies target textarea */\n\t$output['area_concept']['tending_strategies'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#title' => t('Tending strategies'),\n\t\t\t'#markup' => \"<pre>\"\n\t\t\t\t\t. (empty($areadata['tending_strategies'])\n\t\t\t\t\t\t\t? t(\"None available\")\n\t\t\t\t\t\t\t: check_plain($areadata['tending_strategies']))\n\t\t\t\t\t. \"</pre>\"\n\t);\n\n\t/* add the tending strategies target textarea */\n\t$output['area_concept']['safety_precautions'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#title' => t('Safety precautions'),\n\t\t\t'#markup' => \"<pre>\"\n\t\t\t\t\t. (empty($areadata['safety_precautions'])\n\t\t\t\t\t\t\t? t(\"None available\")\n\t\t\t\t\t\t\t: check_plain($areadata['safety_precautions'])) . \"</pre>\"\n\t);\n\n\t/* Create a fieldset for the linked habitats */\n\t$output['area_habitats'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Linked habitats'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible',\n\t\t\t\t\t\t\t'collapsed'\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t'#weight' => 5\n\t);\n\n\tif (function_exists('gallery_list_renderer')) {\n\t\t$output['area_videos'] = gallery_list_renderer(\n\t\t\t'videos',\n\t\t\t'area',\n\t\t\t$areadata['id']);\n\t\t$output['area_images'] = gallery_list_renderer(\n\t\t\t'images',\n\t\t\t'area',\n\t\t\t$areadata['id']);\n\t}\n\n\t/* add the linked habitats */\n\t$results = db_query(\n\t\t'SELECT\n\t\t\tlabel,\n\t\t\tname\n\t\tFROM\n\t\t\t{area_habitat} ah\n\t\t\tJOIN {habitat} h ON ah.habitat_id = h.id\n\t\tWHERE\n\t\t\tah.area_id = ?;',\n\t\tarray($areadata['id']));\n\n\t$habitats = array();\n\tforeach ($results->fetchAll() as $habitat) {\n\t\t$habitats[] = (array) $habitat;\n\t}\n\tif(!empty($habitats)) {\n\t\t$output['area_habitats']['habitats'] = array(\n\t\t\t\t'#theme' => 'datatable',\n\t\t\t\t'#header' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'name' => t('Label'),\n\t\t\t\t\t\t\t\t'width' => 300\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'name' => t('Name'),\n\t\t\t\t\t\t\t\t'width' => 300\n\t\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'#tableWidth' => 900,\n\t\t\t\t'#rows' => $habitats,\n\t\t\t\t'#id_table' => DATATABLE_HABITATS\n\t\t);\n\t} else {\n\t\t$output['area_habitats']['habitats'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#markup' => \"<pre>\".t(\"None available\").\"</pre>\",\n\t\t\t);\n\t}\n\n\t$output['area_files'] = area_files($areadata);\n\t$output['area_files']['#weight'] = 6;\n\n\treturn $output;\n}",
"public function calculateArea();",
"public function getDataChartOfCircuitoBarraPoll() {\n \n $data = array(\n 'dataSource' => array(\n 'chart' => array(),\n 'categories' => array(\n ),\n 'dataset' => array(\n ),\n ),\n );\n $chart = array();\n\n $chart[\"caption\"] = \"Exit Poll\";\n $chart[\"captionFontColor\"] = \"#e20000\";\n $chart[\"captionFontSize\"] = \"15\"; \n $chart[\"palette\"] = \"1\";\n $chart[\"showvalues\"] = \"1\";\n $chart[\"paletteColors\"] = \"#0075c2,#c90606,#f2c500,#12a830,#1aaf5d\";\n $chart[\"showBorder\"] = \"0\";\n $chart[\"showCanvasBorder\"] = \"0\";\n $chart[\"yaxisvaluespadding\"] = \"10\";\n $chart[\"valueFontColor\"] = \"#ffffff\";\n $chart[\"rotateValues\"] = \"1\";\n $chart[\"bgAlpha\"] = \"0,0\";//Fondo \n $chart[\"theme\"] = \"fint\";\n $chart[\"showborder\"] = \"0\";\n $chart[\"decimals\"] = \"0\";\n $chart[\"showLegend\"] = \"0\";\n $chart[\"legendBgColor\"] = \"#ffffff\";\n $chart[\"legendItemFontSize\"] = \"10\";\n $chart[\"legendItemFontColor\"] = \"#666666\";\n $chart[\"baseFontColor\"] = \"#ffffff\"; \n $chart[\"outCnvBaseFontColor\"] = \"#ffffff\";\n $chart[\"formatNumberScale\"] = \"0\";\n\n $chart[\"usePlotGradientColor\"] = \"0\";\n $chart[\"plotBorderAlpha\"] = \"10\";\n $chart[\"legendBorderAlpha\"] = \"0\";\n $chart[\"legendBgAlpha\"] = \"0\";\n $chart[\"legendItemFontColor\"] = \"#ffffff\";\n $chart[\"baseFontColor\"] = \"#ffffff\";\n $chart[\"legendItemFontColor\"] = \"#ffffff\";\n \n $chart[\"divLineDashed\"] = \"0\";\n $chart[\"showHoverEffect\"] = \"1\";\n $chart[\"valuePosition\"] = \"ABOVE\";\n $chart[\"dashed\"] = \"0\";\n $chart[\"divLineDashLen\"] = \"0\";\n $chart[\"divLineGapLen\"] = \"0\";\n $chart[\"canvasBgAlpha\"] = \"0,0\";\n $chart[\"toolTipBgColor\"] = \"#000000\";\n \n //$chart[\"saxisvaluespadding\"] = \"10\";\n //$chart[\"pYAxisMaxValue\"] = \"1000\"; \n\n //$chart[\"sYAxisMaxValue\"] = \"50000\";\n //$chart[\"sYAxisName\"] = \"Exit Poll\"; \n \n $em = $this->getDoctrine()->getManager();\n \n $label = $dataPlan = $dataReal = array();\n $count = 1;\n $votoNO = $votoSI = 0;\n\n $parroquias = [\n 1 => \"PQ. U TOCUYITO\", \n 2 => \"PQ. U INDEPENDENCIA\", \n 3 => \"PQ. MIGUEL PEÑA\",\n 4 => \"PQ. RAFAEL URDANETA\", \n 5 => \"PQ. NEGRO PRIMERO\", \n 6 => \"PQ. SANTA ROSA\"\n ];\n \n foreach ($parroquias as $value) {\n $parroquia = $parroquias[$count];\n $label[\"label\"] = $parroquia; \n $category[] = $label; \n \n $dataPoll = [\n 1 => 15620,//\"PQ. U TOCUYITO\", \n 2 => 9631,//\"PQ. U INDEPENDENCIA\", \n 3 => 100929,//\"PQ. MIGUEL PEÑA\",\n 4 => 43263,//\"PQ. RAFAEL URDANETA\", \n 5 => 3700,//\"PQ. NEGRO PRIMERO\", \n 6 => 17334//\"PQ. SANTA ROSA\"\n ];\n //Cantidad de Votos\n $dataM = $dataPoll[$count]; \n $dataReal3[\"parentyaxis\"] = 'S'; \n $dataReal3[\"renderas\"] = 'column'; \n $dataReal3[\"color\"] = '#47ac44'; \n $dataReal3[\"value\"] = $dataM; //Carga de valores General\n $dataSetReal['data'][] = $dataReal3; //data \n //$dataSetReal['data'] = array('parentyaxis' => 'S', 'renderas' => 'column', 'data' => $dataSetReal['data']); \n\n $dataPlan3[\"value\"] = \"\"; //Carga de valores General\n $dataSetPlan[\"data\"][] = $dataPlan3; //data \n \n $count++; \n } \n \n $dataSetReal[\"seriesname\"] = \"Real\"; \n $dataSetPlan[\"seriesname\"] = \"Plan\"; \n\n $data['dataSource']['chart'] = $chart;\n $data['dataSource']['categories'][][\"category\"] = $category;\n $data['dataSource']['dataset'][] = $dataSetPlan;\n $data['dataSource']['dataset'][] = $dataSetReal;\n\n return json_encode($data);\n }",
"public function area() \n { \n $area=$this->db->query(\"SELECT DISTINCT * FROM \" . DB_PREFIX . \"option_value as op inner join \" . DB_PREFIX . \"option_value_description as od on (op.option_value_id=od.option_value_id) where op.option_id='20' \");\n return $area->rows; \n }",
"function get_estado_area($vals,$args){\n\textract($vals);\n\textract($args);\n\t$do_aplicacion = DB_DataObject::factory('area');\n\t$do_aplicacion -> area_id = $record['area_id'];\n\t$do_aplicacion -> area_baja = '0';\n\tif($do_aplicacion -> find(true))\n\t\treturn '<img title=\"Area no eliminada\" src=\"../img/spirit20_icons/system-tick-alt-02.png\">';\n\telse \n\t\treturn '<img title=\"Area eliminada\" src=\"../img/spirit20_icons/system-red.png\">';\n}",
"function perfdata_config_func($mode = \"\", $inargs, &$outargs, &$result)\n{\n $result = 0;\n $output = \"\";\n\n if ($mode == COMPONENT_CONFIGMODE_GETSETTINGSHTML) {\n\n $enabled = get_option(\"perfdata_email_inclusion\", 0);\n $view = get_option(\"perfdata_email_view\", 0);\n\n $enabled = intval($enabled);\n\n $output = '\n\n <h5 class=\"ul\">' . _(\"Perfdata Email Settings\") . '</h5>\n\n <table class=\"table table-condensed table-no-border table-auto-width\">\n <tr>\n <td></td>\n <td class=\"checkbox\">\n <label>\n <input type=\"checkbox\" class=\"checkbox\" id=\"enabled\" name=\"enabled\" ' . is_checked($enabled, 1) . ' value=\"1\">\n ' . _(\"Enable Perfdata Graphs in Notifcations\") . '\n </label>\n </td>\n </tr>\n <tr>\n <td class=\"vt\">\n <label>' . _(\"Perfdata Graph View\") . ':</label>\n </td>\n <td>\n <select name=\"view\" id=\"view\" class=\"form-control\">\n <option value=\"0\" ' . is_selected($view, 0) . '>' . _(\"Last 4 hours\") . '</option>\n <option value=\"1\" ' . is_selected($view, 1) . '>' . _(\"Last 24 hours\") . '</option>\n <option value=\"2\" ' . is_selected($view, 2) . '>' . _(\"Last 7 days\") . '</option>\n <option value=\"3\" ' . is_selected($view, 3) . '>' . _(\"Last 30 days\") . '</option>\n <option value=\"4\" ' . is_selected($view, 4) . '>' . _(\"Last year\") . '</option>\n </select>\n <div class=\"subtext\">' . _(\"The view (timeperiod) of the graphs to include in notifications.\") . '</div>\n </td>\n </tr>\n </table>';\n }\n\n else if ($mode == COMPONENT_CONFIGMODE_SAVESETTINGS) {\n\n $enabled = grab_array_var($inargs, \"enabled\", 0);\n $view = grab_array_var($inargs, \"view\", 0);\n\n $enabled = intval($enabled);\n $view = intval($view);\n\n if ($view < 0 || $view > 4) {\n $view = 0;\n }\n\n set_option(\"perfdata_email_inclusion\", $enabled);\n set_option(\"perfdata_email_view\", $view);\n }\n\n return $output;\n}",
"private function _validate_configuration() {\n\n $afterpay_merchant_id = strval(Tools::getValue('AFTERPAY_MERCHANT_ID'));\n $afterpay_merchant_key = strval(Tools::getValue('AFTERPAY_MERCHANT_KEY'));\n $afterpay_api_environment = strval(Tools::getValue('AFTERPAY_API_ENVIRONMENT'));\n $afterpay_enabled = strval(Tools::getValue('AFTERPAY_ENABLED'));\n $afterpay_restricted_categories = Tools::getValue('AFTERPAY_RESTRICTED_CATEGORIES', array());\n\n $error = false;\n\n $output = \"\";\n\n //validate Afterpay Enabled\n if (empty($afterpay_enabled) ) {\n\n $output .= $this->displayWarning($this->l('Afterpay is Disabled'));\n }\n\n Configuration::updateValue('AFTERPAY_ENABLED', $afterpay_enabled);\n\n //validate Merchant ID\n if (!$afterpay_merchant_id\n || empty($afterpay_merchant_id)\n || !Validate::isGenericName($afterpay_merchant_id)) {\n\n $output .= $this->displayError($this->l('Invalid Merchant ID value'));\n $error = true;\n }\n else {\n Configuration::updateValue('AFTERPAY_MERCHANT_ID', $afterpay_merchant_id);\n }\n\n //validate Merchant Key\n if (!$afterpay_merchant_key\n || empty($afterpay_merchant_key)\n || !Validate::isGenericName($afterpay_merchant_key)) {\n\n $output .= $this->displayError($this->l('Invalid Merchant Key value'));\n $error = true;\n }\n else {\n Configuration::updateValue('AFTERPAY_MERCHANT_KEY', $afterpay_merchant_key);\n }\n\n //validate API Environment\n if (empty($afterpay_api_environment)) {\n\n $output .= $this->displayError($this->l('Invalid Api Environment value'));\n $error = true;\n }\n else {\n Configuration::updateValue('AFTERPAY_API_ENVIRONMENT', $afterpay_api_environment);\n }\n\n Configuration::updateValue('AFTERPAY_RESTRICTED_CATEGORIES', json_encode($afterpay_restricted_categories));\n\n if( !empty($afterpay_merchant_id) && !empty($afterpay_merchant_key) && !empty($afterpay_api_environment) ) {\n\n $user_agent = \"AfterpayPrestaShop1.7Module \" . $this->version . \" - Merchant ID: \" . $afterpay_merchant_id .\n \" - URL: \" . Tools::getHttpHost(true) . __PS_BASE_URI__;\n\n Configuration::updateValue('AFTERPAY_USER_AGENT', $user_agent);\n\n $afterpay_admin = new AfterpayConfig(\n $afterpay_merchant_id,\n $afterpay_merchant_key,\n $afterpay_api_environment,\n $afterpay_enabled,\n $user_agent\n );\n $payment_limits_check = $afterpay_admin->_update_payment_limits();\n }\n\n if( $payment_limits_check[\"error\"] ) {\n $output .= $this->displayError($this->l( $payment_limits_check[\"message\"] ));\n }\n else if( !$error ) {\n $output .= $this->displayConfirmation($this->l('Settings updated'));\n }\n\n return $output;\n }",
"public function checkClusterConfiguration()\r\n {\r\n $result = (isset($this->settings[\"has_cluster\"]) && !empty($this->settings[\"has_cluster\"])) ? $this->settings[\"has_cluster\"] : '';\r\n if ($result) {\r\n $filterSettingStr = (isset($this->settings[\"cluster_settings\"]) && !empty($this->settings[\"cluster_settings\"])) ? $this->settings[\"cluster_settings\"] : '';\r\n if (empty($filterSettingStr)) {\r\n $this->configErrors[] = \"Cluster configuration not found.\";\r\n }\r\n $filterSettingStr = (isset($this->settings[\"cluster_default_load\"]) && !empty($this->settings[\"cluster_default_load\"])) ? $this->settings[\"cluster_default_load\"] : '';\r\n if (empty($filterSettingStr)) {\r\n $this->configErrors[] = \"Cluster Default Load configuration not found.\";\r\n }\r\n \r\n }else{\r\n $this->configErrors[] = \"Cluster configuration not found.\";\r\n }\r\n\r\n if (!empty($this->configErrors)) {\r\n $response = array(\"configuration\" => array(\"status\" => \"fail\", \"messages\" => $this->configErrors));\r\n echo json_encode($response);\r\n exit();\r\n }\r\n\r\n return true;\r\n }",
"function rhrn_legacy_chart() {\n\techo '<!--[if lte IE 8]> <script src=\"' . plugins_url( \"/js/excanvas.js\", __FILE__ ) . '\"></script><![endif]-->';\n}",
"function plugin_haruca_check_config () {\n haruca_check_upgrade();\n return true;\n}",
"public function Save($save_sections=true) { \n\t\t$content = \"// generated by Magrathea at \".@date(\"Y-m-d h:i:s\").\"\\n\";\n\t\t$data = $this->configs;\n\t\tif( $data == null ) $data = array();\n\t\tif ($save_sections) { \n\t\t\tforeach ($data as $key=>$elem) { \n\t\t\t\t$content .= \"\\n[\".$key.\"]\\n\"; \n\t\t\t\tif(!is_array($elem)){\n\t\t\t\t\tthrow new MagratheaConfigException(\"Hey, you! If you are gonna save a config file with sections, all the configs must be inside one section...\", 1);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tforeach ($elem as $key2=>$elem2) { \n\t\t\t\t\tif(is_array($elem2)) { \n\t\t\t\t\t\tfor($i=0;$i<count($elem2);$i++) { \n\t\t\t\t\t\t\t$content .= \"\\t\".$key2.\"[] = \".$this->SaveValueOnConfig($elem2[$i]).\"\\n\";\n\t\t\t\t\t\t} \n\t\t\t\t\t} else if($elem2==\"\") $content .= \"\\t\".$key2.\" = \\n\";\n\t\t\t\t\telse $content .= \"\\t\".$key2.\" = \".$this->SaveValueOnConfig($elem2).\"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tforeach ($data as $key=>$elem) { \n\t\t\t\tif(is_array($elem)) { \n\t\t\t\t\tfor($i=0;$i<count($elem);$i++) { \n\t\t\t\t\t\t$content .= $key.\"[] = \".$this->SaveValueOnConfig($elem[$i]).\"\\n\";\n\t\t\t\t\t}\n\t\t\t\t} else if($elem==\"\") $content .= $key.\" = \\n\";\n\t\t\t\telse $content .= $key.\" = \".$this->SaveValueOnConfig($elem).\"\\n\";\n\t\t\t} \n\t\t} \n\t\tif(!is_writable($this->path)){\n\t\t\tthrow new MagratheaConfigException(\"Permission denied on path: \".$this->path);\n\t\t}\n\t\t$file = $this->path.\"/\".$this->configFileName;\n\t\tif(file_exists($file)){\n\t\t\t@unlink($file);\n\t\t}\n\t\tif (!$handle = fopen($file, 'w')) { \n\t\t\tthrow new MagratheaConfigException(\"Oh noes! Could not open File: \".$file);\n\t\t} \n\t\tif (!fwrite($handle, $content)) { \n\t\t\tthrow new MagratheaConfigException(\"Oh noes! Could not save File: \".$file);\n\t\t} \n\t\tfclose($handle); \n\t\treturn true; \n\t}",
"public function getArea(){\r\n\t\t\r\n\t}",
"function bank_config($presta,$abo=false){\n\n\t$id = \"\";\n\t$mode = $presta;\n\tif (preg_match(\",[/-][A-F0-9]{4},Uims\",$presta)){\n\t\t$mode = substr($presta,0,-5);\n\t\t$id = substr($presta,-4);\n\t}\n\tif (substr($mode,-5)===\"_test\"){\n\t\t$mode = substr($mode,0,-5);\n\t}\n\n\t// renommage d'un prestataire : assurer la continuite de fonctionnement\n\tif ($mode==\"cyberplus\") $mode = \"systempay\";\n\t$type = null;\n\tif ($abo) $type = 'abo';\n\n\t$config = false;\n\tif ($mode!==\"gratuit\"){\n\t\t$configs = bank_lister_configs($type);\n\t\t$ids = array($id);\n\t\tif ($id) $ids[] = \"\";\n\t\tforeach($ids as $i) {\n\t\t\tforeach($configs as $k=>$c){\n\t\t\t\tif ($c['presta']==$mode\n\t\t\t\t\tAND (!$i OR $i == bank_config_id($c)) ){\n\t\t\t\t\t// si actif c'est le bon, on sort\n\t\t\t\t\tif (isset($c['actif']) AND $c['actif']){\n\t\t\t\t\t\t$config = $c;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// si inactif on le memorise mais on continue a chercher\n\t\t\t\t\tif (!$config){\n\t\t\t\t\t\t$config = $c;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($config){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!$config){\n\t\t\tspip_log(\"Configuration $mode introuvable\",\"bank\"._LOG_ERREUR);\n\t\t\t$config = array('erreur'=>'inconnu');\n\t\t}\n\t}\n\t// gratuit est un cas particulier\n\telse {\n\t\t$config = array(\n\t\t\t'presta' => 'gratuit',\n\t\t\t'actif' => true,\n\t\t);\n\t}\n\n\t#if (!isset($config['actif']) OR !$config['actif']){\n\t#\t$config = array();\n\t#}\n\n\tif (!isset($config['presta'])){\n\t\t$config['presta'] = $mode; // servira pour l'aiguillage dans le futur\n\t}\n\tif (!isset($config['config'])){\n\t\t$config['config'] = ($abo ? 'abo_' : '') . $mode;\n\t}\n\tif (!isset($config['type'])){\n\t\t$config['type'] = ($abo?'abo':'acte');\n\t}\n\n\treturn $config;\n}",
"public function columnChart($title, $labels, $data, $unit) {\n \n// debug($title);\n// debug($labels);\n// debug($data);\n// debug($unit);\n// debug(array_values($data));\n// return;\n// if (sizeof($data) == 1){\n// $data[] = $data[0]+1;\n// $labels[] = '参照物';\n// }\n require $this->KoolControlsFolder . \"/KoolChart/koolchart.php\";\n $chart = new KoolChart(\"chart\");\n $chart->scriptFolder = $this->KoolControlsFolder . \"/KoolChart\";\n $chart->Title->Text = $title;\n $chart->Width = 820;\n $chart->Height = 500;\n//$chart->BackgroundColor = \"#ffffee\";\n \n// $chart->PlotArea->XAxis->Title = \"Quarters\";\n if (count($data) == 0)\n $maxV = 0;\n else $maxV = max($data);\n $chart->PlotArea->XAxis->Set($labels);\n $chart->PlotArea->YAxis->MinValue = 0;\n $chart->PlotArea->YAxis->MaxValue = $maxV;\n $chart->PlotArea->YAxis->Title = \"注册人数 ( .$unit)\";\n $chart->PlotArea->YAxis->LabelsAppearance->DataFormatString = \"$ {0}\";\n $chart->PlotArea->YAxis->MajorStep = ($maxV < 5)? $maxV: (int)($maxV/5);\n \n $series = new ColumnSeries();\n $series->Name = \"人数\";\n $series->TooltipsAppearance->DataFormatString = \"$ {0} $unit\";\n $series->ArrayData($data);\n \n $chart->PlotArea->AddSeries($series);\n \n// $chart->Render();\n return $chart->Render();\n// debug($chart);\n\n// $series = new ColumnSeries();\n// $series->Name = \"Computers\";\n// $series->TooltipsAppearance->DataFormatString = \"$ {0} millions\";\n// $series->ArrayData(array(34, 55, 10, 40));\n// $chart->PlotArea->AddSeries($series);\n//\n// $series = new ColumnSeries();\n// $series->Name = \"Tablets & e-readers\";\n// $series->TooltipsAppearance->DataFormatString = \"$ {0} millions\";\n// $series->ArrayData(array(56, 23, 56, 80));\n// $chart->PlotArea->AddSeries($series);\n }",
"function hschart () {\n\n\ninclude ('grafik_data.php');\n\n}",
"private function format_health_data()\n\t{\n\t\t# host bar color\n\t\tif ($this->host_val < $this->health_critical_percentage)\n\t\t\t$this->host_img = $this->crit_img;\n\t\telseif ($this->host_val < $this->health_warning_percentage)\n\t\t\t$this->host_img = $this->warn_img;\n\t\telse\n\t\t\t$this->host_img = $this->ok_img;\n\n\t\t# service bar color\n\t\tif ($this->service_val < $this->health_critical_percentage)\n\t\t\t$this->service_img = $this->crit_img;\n\t\telseif ($this->service_val < $this->health_warning_percentage)\n\t\t\t$this->service_img = $this->warn_img;\n\t\telse\n\t\t\t$this->service_img = $this->ok_img;\n\t\treturn true;\n\t}",
"public function getDataChartOfBarra1x10() {\n \n $data = array(\n 'dataSource' => array(\n 'chart' => array(),\n 'categories' => array(\n ),\n 'dataset' => array(\n ),\n ),\n );\n $chart = array();\n\n //$chart[\"caption\"] = \"General 1x10 Estados\";\n $chart[\"captionFontColor\"] = \"#e20000\";\n $chart[\"captionFontSize\"] = \"20\"; \n $chart[\"palette\"] = \"1\";\n $chart[\"showvalues\"] = \"1\";\n $chart[\"paletteColors\"] = \"#0075c2,#c90606,#f2c500,#12a830,#1aaf5d\";\n $chart[\"showBorder\"] = \"0\";\n $chart[\"showCanvasBorder\"] = \"0\";\n $chart[\"yaxisvaluespadding\"] = \"10\";\n $chart[\"valueFontColor\"] = \"#ffffff\";\n $chart[\"rotateValues\"] = \"1\";\n $chart[\"bgAlpha\"] = \"0,0\";//Fondo \n $chart[\"theme\"] = \"fint\";\n $chart[\"showborder\"] = \"0\";\n $chart[\"decimals\"] = \"0\";\n $chart[\"showLegend\"] = \"0\";\n $chart[\"legendBgColor\"] = \"#ffffff\";\n $chart[\"legendItemFontSize\"] = \"10\";\n $chart[\"legendItemFontColor\"] = \"#666666\";\n $chart[\"baseFontColor\"] = \"#ffffff\"; \n $chart[\"outCnvBaseFontColor\"] = \"#ffffff\";\n $chart[\"formatNumberScale\"] = \"0\";\n\n $chart[\"usePlotGradientColor\"] = \"0\";\n $chart[\"plotBorderAlpha\"] = \"10\";\n $chart[\"legendBorderAlpha\"] = \"0\";\n $chart[\"legendBgAlpha\"] = \"0\";\n $chart[\"legendItemFontColor\"] = \"#ffffff\";\n $chart[\"baseFontColor\"] = \"#ffffff\";\n $chart[\"legendItemFontColor\"] = \"#ffffff\";\n \n $chart[\"divLineDashed\"] = \"0\";\n $chart[\"showHoverEffect\"] = \"1\";\n $chart[\"valuePosition\"] = \"ABOVE\";\n $chart[\"dashed\"] = \"0\";\n $chart[\"divLineDashLen\"] = \"0\";\n $chart[\"divLineGapLen\"] = \"0\";\n $chart[\"canvasBgAlpha\"] = \"0,0\";\n $chart[\"toolTipBgColor\"] = \"#000000\";\n\n $em = $this->getDoctrine()->getManager();\n \n $label = $dataPlan = $dataReal = array();\n $count = 1;\n $votoNO = $votoSI = 0;\n\n $estados = [\n 1 => \"EDO. CARABOBO\", \n 2 => \"EDO. ZULIA\", \n 3 => \"EDO. ANZOATEGUI\",\n 4 => \"OTROS\" \n ];\n \n foreach ($estados as $value) {\n $estado = $estados[$count];\n $label[\"label\"] = $estado; \n $category[] = $label; \n \n if ($estado != \"OTROS\") {\n $resultEstado = $em->getRepository(\"\\Pequiven\\SEIPBundle\\Entity\\Sip\\Centro\")->findByBarra1x10($estado); \n }else{\n $resultEstado = $em->getRepository(\"\\Pequiven\\SEIPBundle\\Entity\\Sip\\Centro\")->findByBarra1x10Otros(); \n }\n \n if (isset($resultEstado[0][\"SUM(votoSI)\"])) {\n $votoSI = $resultEstado[0][\"SUM(votoSI)\"]; \n }else{\n $votoSI = 0;\n }\n\n if (isset($resultEstado[0][\"SUM(votoNO)\"])) {\n $votoNO = $resultEstado[0][\"SUM(votoNO)\"]; \n }else{\n $votoNO = 0;\n }\n \n $dataReal1[\"value\"] = $votoSI; //Carga de valores General\n $dataSetReal[\"data\"][] = $dataReal1; //data \n \n $dataPlan1[\"value\"] = $votoNO + $votoSI; //Carga de valores General\n $dataSetPlan[\"data\"][] = $dataPlan1; //data \n\n $count++; \n } \n\n $dataSetReal[\"seriesname\"] = \"Real\"; \n $dataSetPlan[\"seriesname\"] = \"Plan\"; \n\n $data['dataSource']['chart'] = $chart;\n $data['dataSource']['categories'][][\"category\"] = $category;\n $data['dataSource']['dataset'][] = $dataSetPlan;\n $data['dataSource']['dataset'][] = $dataSetReal;\n\n return json_encode($data);\n }",
"public static function checkConf()\n\t{\n\t\treturn array(\n\t\t\t'convertGalleryAlbums',\n\t\t\t'convertGalleryImages'\n\t\t);\n\t}",
"public static function checkConf()\n\t{\n\t\treturn array(\n\t\t\t'convertGalleryAlbums',\n\t\t\t'convertGalleryImages'\n\t\t);\n\t}",
"protected function drawGraphArea()\n {\n $this->chart->drawGraphArea(\n $this->getGraphAreaColor(RED),\n $this->getGraphAreaColor(GREEN),\n $this->getGraphAreaColor(BLUE),\n FALSE\n );\n\n if ($this->settings['gradientIntensity'] > 0)\n $this->chart->drawGraphAreaGradient(\n $this->getGraphAreaGradientColor(RED),\n $this->getGraphAreaGradientColor(GREEN),\n $this->getGraphAreaGradientColor(BLUE),\n $this->settings['gradientIntensity']\n );\n else\n $this->chart->drawGraphArea(\n $this->getGraphAreaGradientColor(RED),\n $this->getGraphAreaGradientColor(GREEN),\n $this->getGraphAreaGradientColor(BLUE)\n );\n\n }",
"public function createAreaChart()\n {\n return new OFCAreaChart();\n }",
"private function isValidConfig ()\n {\n // Check 'testCases' exists in Configure or not.\n if (is_null($this->testCases)) {\n trigger_error(\"'testCases' has not been found in AbTestConfig.\");\n return false;\n }\n // Check 'expires' exists in Configure or not.\n if (is_null($this->expires)) {\n trigger_error(\"'expires' has not been found in AbTestConfig.\");\n return false;\n }\n // Check 'values' are unique between all testcases.\n $values = Hash::extract($this->testCases, '{s}.values.{n}');\n if ($values != array_unique($values)) {\n trigger_error(\"There is ununique value in 'values' of AbTestConfig.\");\n return false;\n }\n // Check 'values' have 2 values.\n $values = Hash::extract($this->testCases, '{s}.values');\n foreach ($values as $arr) {\n if (count($arr) != 2) {\n trigger_error(\"AbTestConfig 'values' must have 2 values.\");\n return false;\n }\n }\n // Check each customValueIndex are between 1 and $this->maxCustomIndexValue or not.\n $indexes = Hash::extract($this->testCases, '{s}.customValueIndex');\n foreach ($indexes as $idx) {\n if ($idx > $this->maxCustomIndexValue || $idx < 1) {\n trigger_error(\"customValueIndex must be set between 1 and $this->maxCustomIndexValue, found '$idx'.\");\n return false;\n }\n }\n return true;\n }",
"function checkConfig() {\n return NULL;\n }",
"public function calculateArea()\n {\n //Implement calculateArea() method.\n }",
"public function calculateArea()\n {\n //Implement calculateArea() method.\n }",
"private function _checkConfig($config = null)\n {\n if ($config === null) {\n $config = $this->config;\n }\n if (!($config instanceof ArrayAccess)\n && !is_array($config)\n ) {\n throw new Klarna_IncompleteConfigurationException;\n }\n }"
] | [
"0.61304337",
"0.5347709",
"0.49677858",
"0.48837736",
"0.48718423",
"0.48428452",
"0.4829044",
"0.4805535",
"0.4785907",
"0.47212946",
"0.4721264",
"0.4671753",
"0.46386755",
"0.46236172",
"0.4621761",
"0.46188343",
"0.45924622",
"0.45733523",
"0.4558375",
"0.45121422",
"0.45005044",
"0.44818553",
"0.44818553",
"0.44764107",
"0.44760025",
"0.44735062",
"0.4468995",
"0.44576132",
"0.44576132",
"0.44553724"
] | 0.85321486 | 0 |
CreateArrayForSeries IN: $cfg OUT: der String welcher dann in das IPS_Template geschrieben wird. | function CreateArrayForSeries($cfg)
{
$this->DebugModuleName($cfg,"CreateArrayForSeries");
// Daten für einzelne Serien erzeugen
$dataArr = array();
foreach ($cfg['series'] as $Serie)
{
if ($Serie['Ips']['Type'] == 'pie')
{
$Serie['data'] = $this->CreateDataArrayForPie($cfg, $Serie);
}
else
{
// Daten wurden von extern übergeben
if (isset($Serie['data']))
{
if (is_array($Serie['data']))
$Serie['data'] = $this->CreateDataArrayFromExternalData($Serie['data'], $Serie);
else
$Serie['data'] = $Serie['data'];
}
// Daten werden aus DB gelesen
else
$Serie['data'] = $this->ReadDataFromDBAndCreateDataArray($cfg, $Serie);
}
// ... aus Serie umkopieren
$serieArr = $Serie;
// nicht für JSON benötigte Parameter löschen
unset($serieArr['Param']);
unset($serieArr['AggregatedValues']);
unset($serieArr['Unit']);
unset($serieArr['StartTime']);
unset($serieArr['EndTime']);
unset($serieArr['ReplaceValues']);
unset($serieArr['Ips']);
unset($serieArr['Offset']);
unset($serieArr['AggValue']);
unset($serieArr['AggType']);
unset($serieArr['AggNameFormat']);
unset($serieArr['ScaleFactor']);
unset($serieArr['RoundValue']);
// ersetzten des 'Param'-Parameters (Altlast aus V1.x)
if (isset($Serie['Param']))
$serieArr['Param@@@'] = "@" . $Serie['Param'] . "@";
$dataArr[] = $serieArr;
}
return $dataArr;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _generate(array $array){\n\t\t$result = null;\n\t\tforeach ($array as $sectionName => $sectionData) {\n\t\t\t$result .= \"[$sectionName]\";\n\t\t\t$result .= \"\\n\\t\";\n\t\t\t// TODO a co jezeli $sectionData nie jest array ?!\n\t\t\t$result .= $this->_generateHelper_1((array) $sectionData);\n\t\t\t$result .= \"\\n\";\n\t\t}\n\t\treturn $result;\n\t}",
"public function toTemplateArray() {\n $template_array = array();\n \n $index_base_name = $this->getName();\n \n //Add the field label html\n $template_array[\"{$index_base_name}_label\"] = $this->getLabelHtml();\n \n //Add the field's description if one was specified.\n if(!empty($this->description)) {\n $template_array[\"{$index_base_name}_description\"] = $this->description;\n }\n \n //Add the field html \n $template_array[$index_base_name] = $this->getFieldHtml();\n \n //Add field error message html\n $template_array[\"{$index_base_name}_error\"] = $this->getErrorMessageHtml();\n \n return $template_array;\n }",
"public static function generateFromArray(array $config);",
"function generateTemplatearray($mailkind,$pid,$order_sys_language_uid) {\n\t\t$templates = array();\n\t\t$fields = t3lib_BEfunc::BEenableFields($this->tablename);\n\t\t#debug($fields);\n\t\t$fields = \"sys_language_uid=0 AND pid=\".$pid . \" AND mailkind=\" . $mailkind . $fields;\n\t\t$res_templates = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $this->tablename, $fields);\n\t\t$t3libPage = t3lib_div::makeInstance('t3lib_pageSelect');\n\t\tif($res_templates) {\n\t\t\twhile ($row_templates = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_templates)) {\n\t\t\t\t$temprow = $row_templates;\n\t\t\t\t$temprow = $t3libPage->getRecordOverlay($this->tablename,$temprow,$order_sys_language_uid);\n\t\t\t\t$templates[] = $temprow;\n\n\t\t\t}\n\t\t}\n\t\treturn $templates;\n\t}",
"public function transform($series)\n {\n return [\n 'title' => $series->title,\n 'description' => 'Showing all posts in the series titled ' . $series->title,\n 'keywords' => str_replace(' ', ', ', $series->title),\n 'url' => $series->path(),\n ];\n }",
"public function render(array $conf = []): array\n {\n if (empty($conf)) {\n $conf = ['items' => []];\n }\n\n $items = [];\n foreach ($GLOBALS['TYPO3_CONF_VARS']['EXT']['file_list']['templateLayouts'] as $item) {\n $items[] = $item;\n }\n\n $conf['items'] = array_merge($conf['items'], $items);\n\n return $conf;\n }",
"public function initItemArray(array $config) {\r\n\t\t$items = array();\r\n\t\tif (is_array($config['items'])) {\r\n\t\t\tforeach ($config['items'] as $key=>$item) {\r\n\t\t\t\t$items[] = array(\r\n\t\t\t\t\t// 'value' => $key,\r\n\t\t\t\t\t'value' => ($item[1]? $item[1]: $key),\r\n\t\t\t\t\t'label' => $GLOBALS['TSFE']->sL($item[0])\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $items;\r\n\t}",
"function my_json_encode($cfgArr)\n {\n array_walk_recursive($cfgArr, array($this, 'CheckArrayItems'));\n\n $s = json_encode($cfgArr);\n\n // alle \" entfernen\n $s = str_replace('\"', '',$s);\n\n // Zeilenumbruch, Tabs, etc entfernen ... bin mir nicht so sicher ob das so gut ist\n $s = $this->RemoveUnsupportedStrings($s);\n\n return $s;\n }",
"function crea_array_js($result,$nomArray)\n{\nglobal $db;\n\n\t$numrows=$db->sql_numrows($result);\n\t$fnum=$db->sql_numfields($result);\n\t\t\n\t$html = \"<\".\"script\".\">\\n\";\n\t$html .= $nomArray.\" = new Array();\\n\";\n\tfor ($i = 0; $i < $numrows; $i++) {\n $row = $db->sql_fetchrow($result);\n\t $cArray = $nomArray.\"[\".$nomArray.\".length] = new Array(\";\n for ($x = 0; $x < $fnum; $x++) {\n\t\t $fieldname = $db->sql_fieldname($x,$result);\t \n\t\t $dato_campo = $row[$fieldname];\n\t\t $cArray .= \"'\".$dato_campo.\"'\".\",\";\n }\t\n\t $cArray = substr($cArray,0,$cArray.length-1).\");\\n\";\n\t \n\t$html .= $cArray;\n\t}\n\t$html .= \"</\".\"script\".\">\\n\";\n\techo $html;\n}",
"function dynamic_section( $sections ) {\n //$sections = array();\n $sections[] = array(\n 'title' => __( 'Section via hook', 'business-review' ),\n 'desc' => __( '<p class=\"description\">This is a section created by adding a filter to the sections array. Can be used by child themes to add/remove sections from the options.</p>', 'business-review' ),\n 'icon' => 'el el-paper-clip',\n // Leave this as a blank section, no options just some intro text set above.\n 'fields' => array()\n );\n\n return $sections;\n }",
"public function exportArray ();",
"public function processTemplateArray($args) {\n\t\t\n\t\t\\Q\\Utils::validateProperties(array(\n\t\t\t'validatedEntity' => $args,\n\t\t\t'source' => __file__,\n\t\t\t'propertyList' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'sourceData',\n\t\t\t\t\t'requiredType' => 'array'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'itemTemplate',\n\t\t\t\t\t'requiredType' => 'string'\n\t\t\t\t),\n\t\t\t\t\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'blockTemplate',\n\t\t\t\t\t'importance' => 'optional'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'offset',\n\t\t\t\t\t'importance' => 'optional'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'count',\n\t\t\t\t\t'importance' => 'optional'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'transformations',\n\t\t\t\t\t'importance' => 'optional'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'referenceData',\n\t\t\t\t\t'importance' => 'optional'\n\t\t\t\t)\n\t\t\t)\n\t\t));\n\t\tif (!isset($args['debug'])) {$debug = false;} else {$debug=$args['debug'];}\n\n//Remember: $sourceData is an numeric array of associative arrays, ie, [{}, {}]\n\t\t\n\t\t$sourceData = \\Q\\Utils::makeArrayNumericIndexed($args['sourceData']);\t\n\t\t$itemTemplate = $args['itemTemplate'];\n\t\tif (!isset($args['blockTemplate'])) {\n\t\t\t$args['blockTemplate'] = '<!productList!>';\n\t\t\t$blockTemplate = $args['blockTemplate'];\n\t\t} else {\n\t\t\t$blockTemplate = $args['blockTemplate'];\n\t\t}\n\t\tif (!isset($args['offset'])) {\n\t\t\t$args['offset'] = 0;\n\t\t\t$offset = $args['offset'];\n\t\t} else {\n\t\t\t$offset = $args['offset'];\n\t\t}\n\t\tif (!isset($args['count'])) {\n\t\t\t$args['count'] = 0;\n\t\t\t$count = $args['count'];\n\t\t} else {\n\t\t\t$count = $args['count'];\n\t\t}\n\t\tif (!isset($args['transformations'])) {\n\t\t\t$args['transformations'] = array();\n\t\t\t$transformations = $args['transformations'];\n\t\t} else {\n\t\t\t$transformations = $args['transformations'];\n\t\t}\n\t\tif (!isset($args['referenceData'])) {\n\t\t\t$args['referenceData'] = array();\n\t\t\t$referenceData = $args['referenceData'];\n\t\t} else {\n\t\t\t$referenceData = $args['referenceData'];\n\t\t}\n\t\t\t\n\t\t$itemString = '';\n\t\t$internalGoodies = array();\n\t\t\n\t\t//for ($i=$offset, $len=min($offset+$count, count($sourceData)); $i<$len; $i++){\n\t\t\n\t\t$referenceDataTagList = $this->prepareReferenceData($referenceData);\n\n\n\t\t\t\n\t\tfor ($i = 0, $len = count($sourceData); $i < $len; $i++) {\n\t\t\t$itemRec = $sourceData[$i];\nif ($debug &&!is_array($itemRec)){\necho \"===\";\n\t\\Q\\Utils::dumpCli($itemRec, \"itemRec\");\n\techo htmlentities($itemTemplate);\necho \"===\";\n\t}\t\t\t\n\t\t\t$transformationResult = $this->executeTransformations($transformations, array_merge($itemRec, $referenceDataTagList), $referenceDataTagList);\n\t\t\t\n\t\t\t$enhancedItemRec = array_merge($itemRec, $transformationResult, $referenceDataTagList);\n\t\t\t\n\t\t\t$itemString .= $this->replaceItem($itemTemplate, $enhancedItemRec);\n\t\t}\n\t\t\n\t\t$blockData = array_merge($internalGoodies, $referenceDataTagList, array('productList' => $itemString));\n\t\t$transformationResult = $this->executeTransformations($transformations, $blockData, $referenceDataTagList);\n\t\t$blockData = array_merge($blockData, $transformationResult);\n\t\t$outString = $this->replaceItem($blockTemplate, $blockData);\n\t\t\n\t\t$outArray['outString'] = $outString;\n\t\t$outArray['referenceDataTagList'] = $outString;\n\t\treturn $outArray;\n\t\t\n\t}",
"function formatPGArray($data)\n{\n if (is_array($data))\n {\n $val = '{'.implode(\",\",$data).'}';\n }\n else\n {\n $val = '{'.$data.'}';\n }\n return $val;\n}",
"abstract protected function templates(): array;",
"public function generate($opts = []): array\n {\n $this->values = $opts['values'];\n $this->name = $this->values['name'];\n $this->fields = $this->values['fields'];\n\n /** @var GeneratorOutput[] */\n $output = [];\n // $output[] = $this->generateEmptyConfigYaml();\n $output[] = $this->generateConfigYaml();\n $output[] = $this->generateComponentClass();\n $output[] = $this->generateTwigEmbed();\n $output[] = $this->generateTwigSystem();\n $output[] = $this->generateEnumConst();\n $output[] = $this->generateEnumAll();\n\n return $output;\n }",
"private function createMarkerArray() {\n\t\t// Default values\n\t\t$array = Array(\n\t\t\t'###LBL_MESSAGE###' => htmlspecialchars($this->pi_getLL('form_message')),\n\t\t\t'###VAL_SUBMIT###' => htmlspecialchars($this->pi_getLL('form_submit')),\n\t\t\t'###SIGNATURELENGTH###' => strlen($this->ff['SMSsignature']),\n\t\t\t'###MESSAGEROWS###' => '10',\n\t\t\t'###MESSAGECOLS###' => '53',\n\t\t\t'###ISMIN###' => '20',\n\t\t\t'###ISMAX###' => '63',\n\t\t\t'###SPN_RESTRICTIONS###' => '',\n\t\t\t'###LBL_CHARS_COUNT###' => $this->linkToDoc(htmlspecialchars($this->pi_getLL('form_characters')), $this->ff['LinkRestrictionsPageID'], $this->ff['LinkRestrictionsPageAddParams']),\n\t\t\t'###SPN_CHARS_COUNT###' => '0',\n\t\t\t'###LBL_SMS_COUNT###' => $this->linkToDoc(htmlspecialchars($this->pi_getLL('form_sms')), $this->ff['LinkRestrictionsPageID'], $this->ff['LinkRestrictionsPageAddParams']),\n\t\t\t'###SPN_SMS_COUNT###' => '0',\n\t\t\t'###VAL_RECIPIENTS###' => '',\n\t\t\t'###VAL_MESSAGE###' => '',\n\t\t\t'###CHECKED_FLASH_SMS###' => ''\n\t\t);\n\n\t\tif ($this->ff['HideSignatureExplanation']) {\n\t\t\t$array['###LBL_FOOTNOTE_SIGN###'] = '';\n\t\t} else {\n\t\t\t$array['###LBL_FOOTNOTE_SIGN###'] = htmlspecialchars($this->pi_getLL('form_characters_footnote_sign'));\n\t\t}\n\n\t\t// Maximal number of recipients\n\t\tif ($this->ff['HideMaxRecipients']) {\n\t\t\t$array['###LBL_RECIPIENTS###'] = htmlspecialchars($this->pi_getLL('form_phone'));\n\t\t} else {\n\t\t\t$array['###LBL_RECIPIENTS###'] = htmlspecialchars(sprintf(\n\t\t\t\t$this->pi_getLL('form_phone_template'),\n\t\t\t\t$this->pi_getLL('form_phone'), $this->ff['NumberOfPhones'])\n\t\t\t);\n\t\t}\n\n\t\t// TypoScript Setup values\n\t\tif (!is_null($this->conf['textarea_rows'])) {\n\t\t\t$array['###MESSAGEROWS###'] = $this->conf['textarea_rows'];\n\t\t}\n\t\tif (!is_null($this->conf['textarea_cols'])) {\n\t\t\t$array['###MESSAGECOLS###'] = $this->conf['textarea_cols'];\n\t\t}\n\t\tif (!is_null($this->conf['phone_input_min'])) {\n\t\t\t$array['###ISMIN###'] = $this->conf['phone_input_min'];\n\t\t}\n\t\tif (!is_null($this->conf['phone_input_max'])) {\n\t\t\t$array['###ISMAX###'] = $this->conf['phone_input_max'];\n\t\t}\n\n\t\treturn $array;\n\t}",
"function stregistry_getConfigArray() {\n\tglobal $CONFIG;\n \n $configarray = array(\n \"FriendlyName\" => array(\n \"Type\" => \"System\",\n \"Value\" => 'ST Registry'\n ),\n 'Description' => array(\n 'Type' => 'System',\n 'Value'\t=> 'Official ST Registry Module. Become ST Registrar here: <a href=\"http://www.registry.st/registrars/become-registrar\" target=\"_blank\">www.registry.st/registrars/become-registrar</a>',\n ),\n \"apiHost\" => array(\n \t\"Type\" => \"text\",\n \"Size\" => \"20\",\n \"FriendlyName\" => \"Api gateway hostname\",\n \"Description\" => \"Enter your API hostname\",\n ),\n \"apiPort\" => array(\n \t\"Type\" => \"text\",\n \"Size\" => \"10\",\n \"FriendlyName\" => \"Api gateway port\",\n \"Description\" => \"Enter your API port\",\n ),\n 'apiUseSSL' => array(\n \"Type\" => \"yesno\",\n \"FriendlyName\" => \"SSL\",\n \"Description\" => \"Check if you want to use SSL connection\"\n ),\n \"apiUsername\" => array(\n \"Type\" => \"text\",\n \"Size\" => \"20\",\n \"FriendlyName\" => \"Api Username\",\n \"Description\" => \"Enter your API username here\",\n ),\n \"apiPassword\" => array(\n \"Type\" => \"text\",\n \"Size\" => \"32\",\n \"FriendlyName\" => \"Api Password\",\n \"Description\" => \"Enter your API Password here\",\n ),\n 'allowPremium' => array(\n \"Type\" => \"yesno\",\n \"FriendlyName\" => \"Allow premium domains registration\",\n \"Description\" => \"1 and 2 character(s) domains\"\n ),\n \"oneLetterFee\" => array(\n \t\"Type\" => \"text\",\n \"Size\" => \"20\",\n \"FriendlyName\" => \"One letter premium fee\",\n ),\n \"twoLetterFee\" => array(\n \t\"Type\" => \"text\",\n \"Size\" => \"20\",\n \"FriendlyName\" => \"Two letter premium fee\",\n ),\n \"tesConnection\" => array(\n \"FriendlyName\" => \"Test Connection\",\n ## This jQuery for Test Connection Button: sends request to ST Registry and shows corresponding message (success/fail) ##\n \"Description\" => '<input type=\"button\" id=\"st_testconnection\" class=\"btn primary\" value=\"Test\"/><span id=\"canvasloader-container\" class=\"result_con\"></span>'\n . '<script src=\"../modules/registrars/stregistry/heartcode-canvasloader.js\"></script>'\n . '<script>'\n . '$(\"#st_testconnection\").click(function(){\n if($(\"span#canvasloader-container\").is(\":not(:empty)\")) {\n $(\"span#canvasloader-container\").children().remove();\n }\n var cl = new CanvasLoader(\"canvasloader-container\");\n\t\t\t\tcl.setDiameter(20); // default is 40\n\t\t\t\tcl.show(); // Hidden by default\n\t\t\t\t\n\t\t\t\t// This bit is only for positioning - not necessary\n\t\t\t\t var loaderObj = document.getElementById(\"canvasLoader\");\n\t\t \t\tloaderObj.style[\"top\"] = cl.getDiameter() * -0.5 + \"px\";\n\t\t \t\tloaderObj.style[\"left\"] = cl.getDiameter() * -0.5 + \"px\";\n \n\n var button = $(this);\n\t jQuery.post(\\'../modules/registrars/stregistry/stregistry.php\\', {\n\t \"st_action\": \"st_testconn\",\n\t \"apiUsername\" : button.parents(\"tbody\").find(\"input[name=apiUsername]\").val(),\n \"apiPassword\" : button.parents(\"tbody\").find(\"input[name=apiPassword]\").val(),\n \"apiHost\" : button.parents(\"tbody\").find(\"input[name=apiHost]\").val(),\n \"apiPort\" : button.parents(\"tbody\").find(\"input[name=apiPort]\").val(),\n \"apiUseSSL\" : button.parents(\"tbody\").find(\"input[type=checkbox][name=apiUseSSL]\").prop(\"checked\") ? \"on\" : \"\"\n\t }, function(data){\n\t if(data == \"success\"){\n\t button.parent().find(\"span.result_con\").html(\"<span style=\\\"color:green;font-weight:bold\\\"> Connection success<span>\");\n\t } else {\n\t button.parent().find(\"span.result_con\").html(\"<span style=\\\"color:red;font-weight:bold\\\"> Connection failed<span>\");\n\t }\n\t });\n\t });'\n . '</script>',\n ),\n );\n\n return $configarray;\n}",
"public function toArray()\n {\n return array(\n 'owl' => Mage::helper('mp_slideshow')->__('Owl Slider'),\n 'slick' => Mage::helper('mp_slideshow')->__('Slick Slider'),\n );\n }",
"private function makeSeriesData($data)\n {\n $result = [];\n if (isset($data['rows']) && sizeof($data['rows']) > 0) {\n for ($i = 0; $i < sizeof($data['rows']); $i++) {\n array_push($result, $data['rows'][$i][1]);\n }\n }\n return ['data' => $result, 'name' => 'Sessions'];\n }",
"public function toArray() {\n\t\t$designs = Mage::helper('clipgenerator')->getDesigns();\n\t\t$designArr = array();\n\t\t$designArr[0] = '';\n\t\tforeach ($designs as $v) {\n\t\t\t$designArr[$v['id']] = $v['title'];\n\t\t}\n\n\t\treturn $designArr;\n\t}",
"public static function build($spintax) \r\n\t{\r\n\t\t$table = array();\r\n\r\n\t\t$variables = isset($spintax['vars']) ? $spintax['vars'] : $spintax;\r\n\t\tforeach ($variables as $key => $var) {\r\n\t\t\t$subitems = array();\r\n\r\n\t\t\tforeach ($var as $key_vr => $vr) {\r\n\t\t\t\tif (isset($vr['template'])) {\r\n\t\t\t\t\t$subitems[$key_vr] = self::build($vr);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$table[] = array(\r\n\t\t\t\t'item' => 1,\r\n\t\t\t\t'max' => sizeof($var),\r\n\t\t\t\t'subitems' => $subitems\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn $table;\r\n\t}",
"public function getEmosCustomPageArray($listOfValues)\n {\n $out = \"\";\n if(!$this->anchorTags){\n $counter = 0;\n foreach ($listOfValues as $value) {\n $value = $this->emos_DataFormat($value);\n if($counter == 0) {\n $out .= \" emospro.\".$value.\" = [[\";\n }\n else {\n $out .= \"'\".$value.\"',\";\n }\n $counter += 1;\n }\n $out = substr($out,0,-1);\n $out .= \"]];\\n\";\n }\n else {\n $out .= \"<script type=\\\"text/javascript\\\">\\n\";\n $out .= \" window.emosCustomPageArray = [\";\n foreach ($listOfValues as $value) {\n $value = $this->emos_DataFormat($value);\n $out .= \"'\".$value.\"',\";\n }\n $out = substr($out,0,-1);\n $out .= \"];\\n\";\n $out .= \"</script>\\n\";\n }\n $this->appendPreScript($out);\n }",
"function to_xml(){\r\n\t\tif ($this->skip) return \"\";\r\n\t\t\r\n\t\t$data = array( \"id\" => $this->get_id() );\r\n\t\tfor ($i=0; $i<sizeof($this->config->text); $i++){\r\n\t\t\t$extra = $this->config->text[$i][\"name\"];\r\n\t\t\t$data[$extra]=$this->data[$extra];\r\n\t\t}\r\n\t\treturn json_encode($data);\r\n\t}",
"function TEMPLATE_add_fields_array( $fields )\n{\n $fields[] = 'TEMPLATE_colors';\n $fields[] = 'TEMPLATE_link';\n $fields[] = 'TEMPLATE_link_text';\n \n return $fields;\n}",
"private function generateAssociativeArray() {\n // [types]\n // The list of types for the array to generate. Format:\n // index => type params, index => type params\n //\n // Example:\n // [text => string words:3, stars => number 3]\n $hasTypes = preg_match('/\\[(.+)\\]/', $this->params, $matches);\n if (!$hasTypes) {\n return [];\n }\n\n $value = [];\n\n // Array fields are comma separated\n $fields = preg_split('/,\\s+/', $matches[1]);\n foreach ($fields as $field) {\n $inCorrectFormat = preg_match('/(.+)\\s+=>\\s+(.+)\\s+(.+)/', $field, $matches);\n if (!$inCorrectFormat) {\n continue;\n }\n\n // Extract variables from matches to make it clear what's what\n $index = $matches[1];\n $type = $matches[2];\n $params = $matches[3];\n\n $value[$index] = Generator::generateValue($type, $params);\n }\n\n return $value;\n }",
"public function SeriesBlueprintType()\n{\n$com['seq'][0]=[];\n$com['seq'][0]['ele'][0]=['minOccurs'=>'0','ref'=>'Documentation'];\n$com['seq'][0]['ele'][1]=['minOccurs'=>'0','maxOccurs'=>'unbounded','ref'=>'Quantity'];\n$com['seq'][0]['ele'][2]=['minOccurs'=>'0','maxOccurs'=>'unbounded','ref'=>'AllowedValue'];\n// Name the Series shall have.\n$com['att'][0]=['name'=>'name','type'=>'ShortTokenType','use'=>'required'];\n// Data type this Series shall have.\n$com['att'][1]=['name'=>'seriesType','type'=>'SeriesTypeType','use'=>'required'];\n// Is the Series optional or required?\n$com['att'][2]=['default'=>'required','name'=>'modality','type'=>'ModalityType','use'=>'optional'];\n$com['att'][3]=['default'=>'linear','name'=>'plotScale','type'=>'PlotScaleType','use'=>'optional'];\n$com['att'][4]=['name'=>'dependency','type'=>'DependencyType','use'=>'required'];\n// Maximum number of occurences of the Series. If > 1, the index attribute must be used in the AnIML document.\n$com['att'][5]=['default'=>'1','name'=>'maxOccurs','type'=>'MaxOccursType','use'=>'optional'];\nreturn $com;\n}",
"protected function getAdditionnalTemplateData()\n {\n return array();\n }",
"public function getTypoScriptConfiguration(): array\n {\n if ($this->isHeadless()) {\n return [\n 'tt_content' => [\n $this->getCType() => '< lib.contentElement',\n $this->getCType().'.' => [\n 'fields' => [\n 'content' => [\n 'dataProcessing.' => [\n '0' => HeadlessDataProcessor::class,\n '0.as' => 'fields',\n ],\n ],\n ],\n ],\n ],\n ];\n }\n\n return [\n 'tt_content' => [\n $this->getCType() => '< lib.contentElement',\n $this->getCType().'.' => [\n 'templateName' => $this->getTemplateName(),\n 'dataProcessing.' => [\n '0' => ContentElementObjectDataProcessor::class\n ],\n ]\n ],\n ];\n }",
"function createAsteriskArray() {\n\t\tglobal $asteriskArray;\n\t\tglobal $logFile;\n\t\t\n\t\t$asteriskFilePath = dirname(__FILE__) . '/alpha.csv';\n\t\t// Open the file alpha.txt from the current directory\n\t\t$asteriskFile = fopen($asteriskFilePath, 'r');\n\t\t\n\t\t// Confirm that the file actually opened\n\t\tif (! $asteriskFile) {\n\t\t\t//File didn't open so return an error\n\t\t\techo \"File Open Error - alpha.csv does not exist!\";\n\t\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\twhile (($tempArray = fgetcsv($asteriskFile)) !== FALSE) {\n\t\t\t//Create the temporary array to hold the line read from the file\n\t\t\t\t\t\t\n\t\t\t$tempString = '';\n\n\t\t\tforeach ($tempArray as $key=>$value) {\n\n\t\t\t\tif($key<2) {\n\n\t\t\t\t\t//These are the array parameters so skip them\n\t\t\t\t\tcontinue;\n\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t//Replace 0 with spaces and 1 with a #\n\t\t\t\t\t$tempString .= ($value == 0) ? ' ' : '#';\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Now that we have the entire string create the array entry\n\t\t\t//$tempArray[0] is the letter and $tempArray[1] is the line number\n\t\t\t//of the letter\n\t\t\t$asteriskArray[$tempArray[0]][$tempArray[1]] = $tempString; \n\t\t\t\n\t\t}\n\t\t\n\t\t//writeToLogFile(\"Display Asterisk Array\", $asteriskArray, $logFile);\n\t\t\n\t\treturn $asteriskArray;\n\t}",
"function CreateConfigFile($stringForCfgFile, $id, $charttype = 'Highcharts')\n {\n $path = \"webfront\\user\\IPSHighcharts\\\\\" . $charttype;\n $filename = $charttype . \"Cfg$id.tmp\";\n\n return $this->CreateConfigFileByPathAndFilename($stringForCfgFile, $path, $filename);\n }"
] | [
"0.49171808",
"0.49102846",
"0.48613432",
"0.48016754",
"0.48007444",
"0.4798773",
"0.47615883",
"0.47599903",
"0.47499704",
"0.47422004",
"0.47164506",
"0.47033638",
"0.47033373",
"0.4641563",
"0.46083018",
"0.45988002",
"0.45652696",
"0.45619434",
"0.45498747",
"0.4534557",
"0.4529161",
"0.4521241",
"0.45069554",
"0.44912213",
"0.44768614",
"0.44636384",
"0.4443436",
"0.44422337",
"0.44415817",
"0.4429788"
] | 0.7240915 | 0 |
PopulateValue IN: $val $serie OUT: korrigiertes $cfg | function PopulateValue($val, $serie)
{
// Werte ersetzten (sinnvoll für Boolean, oder Integer - z.B.: Tür/Fenster-Kontakt oder Drehgriffkontakt)
if ($serie['ReplaceValues'] != false)
{
if (isset($serie['ReplaceValues'][$val]))
$val = $serie['ReplaceValues'][$val];
}
// Skalieren von Loggingdaten
if (isset($serie['ScaleFactor']))
$val = $val * $serie['ScaleFactor'];
// Rounden von Nachkommastellen
if (isset($serie['RoundValue']))
$val = round($val, $serie['RoundValue']);
return $val;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function self_load_defaults($val) {\r\n $this->value = $val;\r\n }",
"function update_config_param (\r\n $exper ,\r\n $SVC ,\r\n $service ,\r\n $sect ,\r\n $param ,\r\n $descr ,\r\n $val ,\r\n $type='String')\r\n{\r\n $val_current = $SVC->ifacectrldb($service)->get_config_param_val_r (\r\n $sect ,\r\n $param ,\r\n $exper->instrument()->name() ,\r\n $exper->name()) ;\r\n\r\n if (is_null($val)) return $val_current ;\r\n\r\n $val = trim(\"{$val}\") ; // always turn it into the string even if it's a number\r\n // to allow detecting '' which means a command to remove\r\n // the parameter from the database.\r\n\r\n if ($val_current !== $val) {\r\n if ($val === '') {\r\n $SVC->ifacectrldb($service)->remove_config_param (\r\n $sect ,\r\n $param ,\r\n $exper->instrument()->name() ,\r\n $exper->name()) ;\r\n } else {\r\n $SVC->ifacectrldb($service)->set_config_param_val (\r\n $sect ,\r\n $param ,\r\n $exper->instrument()->name() ,\r\n $exper->name() ,\r\n $val ,\r\n $descr ,\r\n $type) ;\r\n }\r\n }\r\n return $val ;\r\n}",
"function pVal($val){\n\t\t$vals = split(',', $val);\n\t\t\n\t\t// function insert($latitude, $longitude, $idestat, $idactuacio, $idobjecte, $idusuariassig)\n\t\treturn insert($vals[1], $vals[0], $_POST['estatsUps'], $_POST['actuacionsUps'], $_POST['objectesUps'], $_POST['tecnicsUps']);\n\t\t//echo '<br>';\n\t\t\n\t\t// printing valuesw\n\t\t//echo 'lng: '.$vals[0];\n\t\t//echo '<br>lat: '.$vals[1];\n\t\t//echo '<br><br>';\n}",
"function setupValues() {}",
"function setVal($val)//value yg ada dalam table(termasuk nilai variabel identifier), urutkan sesuai dengan variabel field (urutan pertama adalah nilai dari variabel identifier),pisahkan masing masing value dengan karakter +#+ * value inside table (including identifier's value),arrange the value according to the field (first sequence is the value of identifier),divide each value with +#+\r\n\t{\r\n\t\t$this->Value=$val;\r\n\t}",
"private function replace_var_by_value()\r\n\t{\r\n\t\t// Pour chaque varin de l'etape qui comporte une valeur on la modifie dans le corps des étapes.\r\n\t\tswitch($this->c_ik_valmod) \r\n\t\t{\r\n\t\t\t// Only custom value is used to build final result\r\n\t\t\tcase 0:\r\n\t\t\t\t$sql = 'SELECT nom,resultat \r\n\t\t\t\t\t\tFROM '.$_SESSION['iknow'][$this->c_ssid]['struct']['tb_fiches_param']['name'].' \r\n\t\t\t\t\t\tWHERE id_fiche = '.$this->c_id_temp.' \r\n\t\t\t\t\t\tAND TYPE = \"IN\" \r\n\t\t\t\t\t\tAND LENGTH(IFNULL(`RESULTAT`,\"\")) > 0'; // ISHEET_INCLUDE_BLANK_REPLACE\r\n\t\t\t\tbreak;\r\n\t\t\t// Only default value is used with custom value to build final result\r\n\t\t\tcase 1:\r\n\t\t\t\t$resultat = 'IF(\r\n\t\t\t\t\t\t\t\t( LENGTH(IFNULL(`DEFAUT`,\"\")) > 0 ) AND (`RESULTAT` IS NOT NULL AND LENGTH(IFNULL(`RESULTAT`,\"\")) = 0 )\r\n\t\t\t\t\t\t\t\t,`DEFAUT`\r\n\t\t\t\t\t\t\t\t,`RESULTAT`\r\n\t\t\t\t\t\t\t ) AS resultat'; // ISHEET_INCLUDE_BLANK_REPLACE\r\n\t\t\t\t\r\n\t\t\t\t$sql = 'SELECT nom,'.$resultat.' \r\n\t\t\t\t\t\tFROM '.$_SESSION['iknow'][$this->c_ssid]['struct']['tb_fiches_param']['name'].' \r\n\t\t\t\t\t\tWHERE id_fiche = '.$this->c_id_temp.' \r\n\t\t\t\t\t\tAND ( LENGTH(IFNULL(`DEFAUT`,\"\")) > 0 OR LENGTH(IFNULL(`RESULTAT`,\"\")) > 0)\r\n\t\t\t\t\t\tAND TYPE = \"IN\"';\r\n\t\t\t\tbreak;\r\n\t\t\t// Only neutral value is used with custom value to build final result\t\r\n\t\t\tcase 2:\r\n\t\t\t\t$resultat = 'IF(\r\n\t\t\t\t\t\t\t\t( LENGTH(IFNULL(`NEUTRE`,\"\")) > 0 ) AND (`RESULTAT` IS NOT NULL AND LENGTH(IFNULL(`RESULTAT`,\"\")) = 0 )\r\n\t\t\t\t\t\t\t\t,`NEUTRE`\r\n\t\t\t\t\t\t\t\t,`RESULTAT`\r\n\t\t\t\t\t\t\t ) AS resultat'; // ISHEET_INCLUDE_BLANK_REPLACE\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t$sql = 'SELECT nom,'.$resultat.' \r\n\t\t\t\t\t\tFROM '.$_SESSION['iknow'][$this->c_ssid]['struct']['tb_fiches_param']['name'].' \r\n\t\t\t\t\t\tWHERE id_fiche = '.$this->c_id_temp.' \r\n\t\t\t\t\t\tAND ( LENGTH(IFNULL(`NEUTRE`,\"\")) > 0 OR LENGTH(IFNULL(`RESULTAT`,\"\")) > 0)\r\n\t\t\t\t\t\tAND TYPE = \"IN\"';\r\n\t\t\t\tbreak;\r\n\t\t\t// Both default and neutral values are included to build final result\t\r\n\t\t\tcase 3:\r\n\t\t\t\t$resultat = 'IF(\r\n\t\t\t\t\t\t\t\t( LENGTH(IFNULL(`NEUTRE`,\"\")) > 0 OR LENGTH(IFNULL(`DEFAUT`,\"\")) > 0 ) AND (`RESULTAT` IS NOT NULL AND LENGTH(IFNULL(`RESULTAT`,\"\")) = 0 )\r\n\t\t\t\t\t\t\t\t,IF\t(\r\n\t\t\t\t\t\t\t\t\t\tLENGTH(IFNULL(`NEUTRE`,\"\")) > 0\r\n\t\t\t\t\t\t\t\t\t\t,`NEUTRE`\r\n\t\t\t\t\t\t\t\t\t\t,`DEFAUT`\r\n\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t,`RESULTAT`\r\n\t\t\t\t\t\t\t) AS resultat'; // ISHEET_INCLUDE_BLANK_REPLACE\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t$sql = 'SELECT nom,'.$resultat.' \r\n\t\t\t\t\t\tFROM '.$_SESSION['iknow'][$this->c_ssid]['struct']['tb_fiches_param']['name'].' \r\n\t\t\t\t\t\tWHERE id_fiche = '.$this->c_id_temp.' \r\n\t\t\t\t\t\tAND ( LENGTH(IFNULL(`DEFAUT`,\"\")) > 0 OR LENGTH(IFNULL(`NEUTRE`,\"\")) > 0 OR LENGTH(IFNULL(`RESULTAT`,\"\")) > 0)\r\n\t\t\t\t\t\tAND `TYPE` = \"IN\"';\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\t$requete = $this->exec_sql($sql,__LINE__,__FILE__,__FUNCTION__,__CLASS__,$this->link);\r\n\t\t\r\n\t\t$i = 0;\r\n\t\twhile($row = mysql_fetch_array($requete,MYSQL_ASSOC)) \r\n\t\t{\r\n\t\t\tforeach($this->c_Obj_etapes as $value)\r\n\t\t\t{\r\n\t\t\t\tif($i == 0)\r\n\t\t\t\t{\t\r\n\t\t\t\t\t$value->html_temp = $value->contenu;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(!is_null($row['resultat']))\r\n\t\t\t\t{\r\n\t\t\t\t// Specific because string with only space digit is not visible in css span :(\r\n\t\t\t\t// So, do a raw replace space by \r\n\t\t\t\tif(trim($row['resultat']) == \"\") // ADD_VARIN_VISIBLE_BLANK\r\n\t\t\t\t{\r\n\t\t\t\t\t$row['resultat'] = str_replace(\" \",\" \",$row['resultat']);\t\r\n\t\t\t\t}\r\n\t\t\t\t\t// Varin SIBY\r\n\t\t\t\t\t//$value->html_temp = str_replace('<span class=\"BBVarIn\">'.htmlentities($row['nom'],ENT_QUOTES,'UTF-8').'</span>','<span class=\"BBVarIn\">'.$row['resultat'].'</span>',$value->html_temp);\r\n\t\t\t\t\t$value->html_temp = str_replace('<span class=\"BBVarIn\">'.htmlentities($row['nom'],ENT_QUOTES,'UTF-8').'</span>','<span onmouseover=\"ikdoc(\\'id_aide\\');set_text_help(461,\\'\\',\\'\\',\\'<span class=\\\\\\'BBVarInInfo\\\\\\'>'.$row['nom'].'</span>\\');\" onmouseout=\"ikdoc();unset_text_help();\" class=\"ikvalorised ikvalorised_varin BBVarIn\">'.$row['resultat'].'</span>',$value->html_temp); // REMIND_ORIGINAL_VARIN_NAME\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$i = $i + 1;\t\r\n\t\t}\t\r\n\t}",
"private function generateValueData()\n {\n # URL\n if (isset($this->url)) {\n $this->getFullUrlFromUrl();\n $this->getValueFromFullUrl();\n }\n # Full URL\n else if (isset($this->urlFull)) {\n $this->getUrlFromFullUrl();\n $this->getValueFromFullUrl();\n }\n # Value\n else if (isset($this->value)) {\n $this->getFullUrlFromValue();\n $this->getValueFromFullUrl(); # Clean the value\n $this->getUrlFromFullUrl();\n }\n }",
"abstract public function import_value($value);",
"public function setValues($var) {}",
"public function prepareFrontendValue( $val )\r\n {\r\n return $val;\r\n }",
"public function setCfg($mixed, $val = null);",
"function configvalfetch($obj_db)\n{\n\t$sql=\"SELECT *\tFROM `tblconfigsite`\";\n\t//\techo $sql.\"<br>\";\n\t$res_config=$obj_db->select($sql);\n\t$newdata=\"\";\n\tfor($i=0;$i<count($res_config);$i++)\n\t{\n\t\t$fld=$res_config[$i]['varfieldname'];\n\t\t$val=$res_config[$i]['value'];\n\t\t$newdata[$fld]= $val;\n\t}\n\n\t return $newdata;\n\t\n}",
"function self_load_defaults($val) {\r\n }",
"function config_set($key, $val = '', $encode = 'R')\r\n{\r\n if (!in_array($encode, array('R','S','J'))) {\r\n $encode = 'R';\r\n }\r\n \r\n $metas = $key;\r\n if (!is_array($key)) {\r\n $metas = array(array('key'=>$key, 'val'=>$val, 'encode'=>$encode));\r\n }\r\n\r\n $effcnt = 0;\r\n if (count($metas)) {\r\n foreach ($metas AS $meta) {\r\n $op = '';\r\n if (is_string($meta['val'])) {\r\n if ($meta['val'][0]=='+' || $meta['val'][0]=='-') {\r\n $op = $meta['val'][0];\r\n $meta['val'] = substr($meta['val'],1);\r\n }\r\n }\r\n\r\n $db = D();\r\n $val = $meta['val'];\r\n if ($meta['encode']=='S') {\r\n $val = serialize($meta['val']);\r\n }\r\n elseif ($meta['encode']=='J') {\r\n $val = json_encode($meta['val'], JSON_UNESCAPED_UNICODE);\r\n }\r\n $exist = $db->result(\"SELECT `cid` FROM {config} WHERE `key`='%s'\", $meta['key']);\r\n if ($exist) {\r\n if ($op=='') {\r\n $db->query(\"UPDATE {config} SET `val`='%s', `encode`='%s' WHERE `key`='%s'\", $val, $meta['encode'], $meta['key']);\r\n }\r\n else {\t// $op='+' or $op='-'\r\n if (!empty($val)) {\r\n $db->query(\"UPDATE {config} SET `val`=val{$op}%s, `encode`='%s' WHERE `key`='%s'\", $val, $meta['encode'], $meta['key']);\r\n }\r\n }\r\n }\r\n else {\r\n $db->query(\"INSERT INTO {config}(`key`,`val`,`encode`) VALUES('%s','%s','%s')\", $meta['key'], $val, $meta['encode']);\r\n }\r\n \r\n if ($db->affected_rows()) {\r\n ++$effcnt;\r\n }\r\n }\r\n }\r\n return $effcnt;\r\n}",
"function _setInputField($n){\n global $tpl, $aPMConfig;\n \n $rtn = $t = '';\n $p = array();\n if(preg_match('/^([^\\(]+)(\\([^\\)]*\\))?$/',$this->aC[$n]['type'],$m)>0){\n $t = $m[1]; $p = isset($m[2]) ? explode(',',trim($m[2],'( )')) : array();\n }\n for($i=0;$i<count($p);$i++){ $p[$i] = explode('=',trim($p[$i])); if(!isset($p[$i][1])) $p[$i][1]=''; }\n $aPMConfig['sFid'] = $n;\n $aPMConfig['sAlt'] = $this->aC[$n]['alt'];\n $aPMConfig['sDisabled'] = ($this->aC[$n]['disable']===true) ? \"disabled='disabled'\" : '';\n switch($t){\n case 'checkbox':\n $aPMConfig['sFid'] .= \"[]\";\n for($i=0;$i<count($p);$i++){\n $aPMConfig['sLabel'] = $p[$i][1];\n $aPMConfig['sValue'] = $p[$i][0];\n $aPMConfig['sPicked'] = in_array( $p[$i][0], $this->aC[$n]['value'] ) ? \"checked='checked'\" : '';\n $rtn .= $tpl->tbHtml( $this->sTemplate, 'PLUGINS_CONFIG_CHECKBOX' );\n }\n break;\n case 'radio':\n for($i=0;$i<count($p);$i++){\n $aPMConfig['sLabel'] = $p[$i][1];\n $aPMConfig['sValue'] = $p[$i][0];\n $aPMConfig['sPicked'] = $p[$i][0] == $this->aC[$n]['value'] ? \"checked='checked'\" : '';\n $rtn .= $tpl->tbHtml( $this->sTemplate, 'PLUGINS_CONFIG_RADIO' );\n }\n break;\n case 'select':\n $rtn .= $tpl->tbHtml( $this->sTemplate, 'PLUGINS_CONFIG_SELECT_START' );\n for($i=0;$i<count($p);$i++){\n $aPMConfig['sLabel'] = $p[$i][1] != '' ? $p[$i][1] : $p[$i][0];\n $aPMConfig['sValue'] = $p[$i][0];\n $aPMConfig['sPicked'] = $p[$i][0] == $this->aC[$n]['value'] ? \"selected='selected'\" : '';\n $rtn .= $tpl->tbHtml( $this->sTemplate, 'PLUGINS_CONFIG_SELECT_OPTION' );\n }\n $rtn .= $tpl->tbHtml( $this->sTemplate, 'PLUGINS_CONFIG_SELECT_END' );\n break;\n case 'textarea':\n $aPMConfig['sRows'] = isset($p[0][0]) ? $p[0][0] : 4;\n $aPMConfig['sCols'] = isset($p[1][0]) ? $p[1][0] : 40;\n $aPMConfig['sValue'] = htmlspecialchars($this->aC[$n]['value']);\n $rtn .= $tpl->tbHtml( $this->sTemplate, 'PLUGINS_CONFIG_TEXTAREA' );\n break;\n case 'input':\n default:\n $aPMConfig['sSize'] = isset($p[0][0]) ? $p[0][0] : 50;\n $aPMConfig['sValue'] = htmlspecialchars($this->aC[$n]['value']);\n $rtn .= $tpl->tbHtml( $this->sTemplate, 'PLUGINS_CONFIG_INPUT' );\n }\n unset($m); unset($p); unset($t);\n return $rtn;\n }",
"public function populate()\n {\n $config = $this->getConfig();\n\n if (is_array($config)) {\n foreach ($config as $key => $value) {\n $this->$key = $value;\n }\n }\n }",
"function _set_value(){\r\r\n\t\t//extract\r\r\n\t\textract($_POST);\r\r\n\t\t// init\r\r\n\t\t$value = '';\r\r\n\t\t// options\r\r\n\t\tswitch($value_is['options']){\r\r\n\t\t\tcase 'flat':\r\r\n\t\t\t\t$value = (float)$value_is['flat'];\r\r\n\t\t\tbreak;\r\r\n\t\t\tcase 'percent':\r\r\n\t\t\t\t$value = (float)$value_is['percent']. '%';\r\r\n\t\t\tbreak;\r\r\n\t\t\tcase 'sub_pack_bc':// with billing cycle\r\r\n\t\t\tcase 'sub_pack':// without billing cycle\r\r\n\t\t\t\t// format: 'sub_pack#5_6_M_pro-membership' -- without billing cycle\r\r\n\t\t\t\t// format: 'sub_pack#5_6_M_pro-membership_0' -- with billing cycle\r\r\n\t\t\t\t// pack post\r\r\n\t\t\t\t$sub_pack = $value_is['sub_pack'];\r\r\n\t\t\t\t// lifetime\r\r\n\t\t\t\tif($sub_pack['duration_type'] == 'l') $sub_pack['duration_unit'] = 1;\r\r\n\t\t\t\t// membership_type\r\r\n\t\t\t\t$sub_pack['membership_type'] = strtolower(preg_replace('/[\\_]+/', '-', $sub_pack['membership_type']));\t\t\t\t\r\r\n\t\t\t\t// array\r\r\n\t\t\t\t$options = array((float)$sub_pack['cost'], (int)$sub_pack['duration_unit'], $sub_pack['duration_type'], $sub_pack['membership_type']);\t\t\t\t\t\t\t\t \r\r\n\t\t\t\t// billing cycle\r\r\n\t\t\t\tif(isset($sub_pack['num_cycles'])){\r\r\n\t\t\t\t\t// num_cycles, 2 is limited\r\r\n\t\t\t\t\tif((int)$sub_pack['num_cycles'] == 2) $sub_pack['num_cycles'] = (int)$sub_pack['num_cycles_limited'];\t\r\r\n\t\t\t\t\t// append\r\r\n\t\t\t\t\t$options[] = $sub_pack['num_cycles'];\r\r\n\t\t\t\t}\t\t\t \r\r\n\t\t\t\t// set\r\r\n\t\t\t\t$value = 'sub_pack#'. implode('_', $options);\t\r\r\n\t\t\tbreak;\r\r\n\t\t\tcase 'sub_pack_trial':\r\r\n\t\t\t\t// format: sub_pack_trial#5_6_M_1\r\r\n\t\t\t\t// pack post\r\r\n\t\t\t\t$sub_pack = $value_is['sub_pack_trial'];\r\r\n\t\t\t\t// lifetime\r\r\n\t\t\t\tif($sub_pack['duration_type'] == 'l') $sub_pack['duration_unit'] = 1;\t\t\t\t\r\r\n\t\t\t\t// array\r\r\n\t\t\t\t$options = array((float)$sub_pack['cost'], (int)$sub_pack['duration_unit'], $sub_pack['duration_type'], (int)$sub_pack['num_cycles']);\r\r\n\t\t\t\t// set\r\r\n\t\t\t\t$value = 'sub_pack_trial#'. implode('_', $options);\r\r\n\t\t\tbreak;\r\r\n\t\t}\r\r\n\t\t// return \r\r\n\t\treturn $value;\r\r\n\t}",
"public function set_val($val) {\n\t\t$this->val = $val;\n\t}",
"public static function parse($val);",
"function set($val, $name = \"\", $table = \"core\", $uid = USERID) {\n\t\tglobal $sql;\n\t\tif (!strlen($name)) {\n\t\t\tswitch ($table) {\n\t\t\t\tcase 'core':\n\t\t\t\t$name = \"pref\";\n\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t$name = \"user_pref\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$val = addslashes($val);\n\n\t\tswitch ($table ) {\n\t\t\tcase 'core':\n\t\t\tif(!$sql->db_Update($table, \"e107_value='$val' WHERE e107_name='$name'\"))\n\t\t\t{\n\t\t\t\t$sql->db_Insert($table, \"'{$name}', '{$val}'\");\n\t\t\t}\n\t\t\t$this->prefVals[$table][$name] = $val;\n\t\t\tunset($this->prefArrays[$table][$name]);\n\t\t\tbreak;\n\t\t\tcase 'user':\n\t\t\t$sql->db_Update($table, \"user_prefs='$val' WHERE user_id=$uid\");\n\t\t\tbreak;\n\t\t}\n\t}",
"private function _cargaVarConfig()\r\n {\r\n $config_variables = simplexml_load_file('configuration.xml');\r\n foreach ($config_variables as $key => $value) {\r\n switch ($key) {\r\n case \"sdmModule_id\":\r\n $this->_moduleID = $value; break;\r\n case \"widget_name\":\r\n $this->_widget_name = $value; break;\r\n }\r\n } \r\n }",
"function set_config ($categorie,$cle,$valeur,$modifiable=1,$die=0) {\n global $CFG;\n\n //attention aux parentheses ET au triple �gal (certaines valeurs de config sont =0 !!!!)\n if (($old=get_config($cle,false)) !==false){ //d�ja en base (cle est une valeur unique !)\n if ($old !=$valeur) {\n \t$sql=\"update {$CFG->prefix}config set valeur='\".addslashes($valeur).\"' where cle ='\".$cle.\"' \";\n\n \tExecRequete($sql,false,$die);\n } else return $old;\n }else {\n add_config($categorie,$cle,$valeur,$valeur,'',$modifiable);\n }\n //garde cette nouvelle valeur pour la suite\n\t\t$CFG->$cle=$valeur;\n\t\treturn $valeur;\n}",
"public function setValue($var) {}",
"public function setValue($var) {}",
"public function setValue($var) {}",
"public function setValue($var) {}",
"public function setValue($var) {}",
"public function setValue($var) {}",
"public function setValue($var) {}",
"public function setValue($var) {}"
] | [
"0.6046172",
"0.5968747",
"0.5901919",
"0.5893983",
"0.5873498",
"0.57352525",
"0.5542263",
"0.5431021",
"0.54281574",
"0.5410221",
"0.529059",
"0.52721447",
"0.5218927",
"0.52037853",
"0.5196537",
"0.5188604",
"0.5180067",
"0.5168093",
"0.50692344",
"0.50687736",
"0.50523025",
"0.50361425",
"0.5033446",
"0.5033446",
"0.5033446",
"0.5033446",
"0.5033446",
"0.5033446",
"0.5033446",
"0.5033446"
] | 0.71520925 | 0 |
Subsets and Splits