query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Get fake data of CategoryCourse
public function fakeCategoryCourseData($categoryCourseFields = []) { $fake = Faker::create(); return array_merge([ 'name' => $fake->word, 'description' => $fake->text, 'category_course_type' => $fake->randomDigitNotNull, 'slug' => $fake->word, 'user_id' => $fake->randomDigitNotNull, 'created_at' => $fake->word, 'updated_at' => $fake->word ], $categoryCourseFields); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function init_category_and_course() {\n global $DB;\n\n // Category.\n $category = new stdClass;\n $category->name = 'category';\n $category->id = $DB->insert_record('course_categories', $category);\n context_coursecat::instance($category->id);\n\n // Course.\n $coursedata = new stdClass;\n $coursedata->category = $category->id;\n $coursedata->fullname = 'fullname';\n $course = create_course($coursedata);\n\n return context_course::instance($course->id);\n }", "public function category_wise_course_get() {\n $category_id = $_GET['category_id'];\n $courses = $this->api_model->category_wise_course_get($category_id);\n $this->set_response($courses, REST_Controller::HTTP_OK);\n }", "abstract public function retrieve_course_summary_data();", "public function coursesCategoryList()\n { \n return CourseCategories::all();\n }", "function getCourseCategoryByCategoryId($id){\n\n $select=$this->select()->where(\" categoryid = ?\",$id);\n return $this->fetchAll($select)->toArray();\n }", "public function getCategoryData()\n {\n $_category = Mage::registry('current_category');\n $data = array();\n if ($_category) {\n $data['categoryId'] = $_category->getId();\n $data['categoryName'] = $_category->getName();\n }\n return $data;\n }", "public function category_wise_course_get($category_id) {\n\t\t$category_details = $this->crud_model->get_category_details_by_id($category_id)->row_array();\n\n\t\tif ($category_details['parent'] > 0) {\n\t\t\t$this->db->where('sub_category_id', $category_id);\n\t\t}else {\n\t\t\t$this->db->where('category_id', $category_id);\n\t\t}\n\t\t$this->db->where('status', 'active');\n\t\t$courses = $this->db->get('course')->result_array();\n\n\t\t// This block of codes return the required data of courses\n\t\t$result = array();\n\t\t$result = $this->course_data($courses);\n\t\treturn $result;\n\t}", "public function getCategories(){\n $sql = \"SELECT DISTINCT cat.id, cat.name, cat.idnumber FROM {$this->table_prefix}course_categories cat\n INNER JOIN {$this->table_prefix}course c ON cat.id = c.category\";\n $result = $this->conn->query($sql);\n $categories;\n if($result->num_rows > 0){\n while($row = $result->fetch_assoc()){\n $categories[] = $row;\n }\n return array(\"erro\" => false, \"description\" => \"Categories found\", \"categories\" => $categories);\n }else{\n return array(\"erro\" => false, \"description\" => \"No categories with course found\", \"categories\" => $categories);\n }\n }", "public static function getCourses()\n {\n global $cont;\n $courses = $cont->prepare(\"SELECT courses.id AS courseId , courses.title AS title , courses.price AS price , courses.body AS body , courses.image AS `image` , categories.name AS catName FROM courses INNER JOIN categories ON courses.catagory_id = categories.id\");\n $courses->execute();\n return $courses;\n }", "public function getCategoryDataFront()\n {\n // Get Categorys\n $categories = CategoryWiseSpecification::orderBy('updated_at', 'desc')->Where('deactivate', 0)->take(4)->get();\n\n foreach($categories as $categoryWiseResource)\n {\n $files = explode(\",\", $categoryWiseResource['file']);\n $categoryWiseResource['attachments'] = Attachment::WhereIn('id', $files)->get();\n }\n \n // Return collection of Categorys as a resource\n return CategoryWiseSpecificationResouerce::collection($categories);\n }", "function getCourseCategoryByCourseId($id){\n $select=$this->select()->where(\" courseid = ?\",$id);\n return $this->fetchAll($select)->toArray();\n }", "function get_course_metadata($courseid) {\n $handler = \\core_customfield\\handler::get_handler('core_course', 'course');\n // This is equivalent to the line above.\n // $handler = \\core_course\\customfield\\course_handler::create();\n $datas = $handler->get_instance_data($courseid);\n $metadata = [];\n foreach ($datas as $data) {\n if (empty($data->get_value())) {\n continue;\n }\n $cat = $data->get_field()->get_category()->get('name');\n $metadata[$data->get_field()->get('shortname')] = $cat . ': ' . $data->get_value();\n }\n return $metadata;\n}", "function get_all_courses_category_wise($category)\n {\n $this->db->select('cs.*,cat.name as category');\n $this->db->from('courses as cs');\n $this->db->join('courses_categories_gp as cc', 'cc.course_id=cs.id');\n $this->db->join('categories as cat', 'cat.id=cc.category_id');\n $this->db->where('cat.seo_url', $category);\n $this->db->where('cat.status', 1);\n $this->db->where('cs.status', 1);\n $this->db->order_by('cs.sort_order', 'asc');\n $query = $this->db->get();\n // return $this->db->last_query();\n if ($query->num_rows() > 0) {\n $courses = $query->result();\n return $courses;\n }\n return false;\n }", "public function getCategory() {}", "public function getCourseList() {\n $course = \\DB::table('courses')->where(\"name\",\"!=\",\"\")->orderBy(\"name\")->pluck(\"name\",\"code\");\n return $course;\n \n \n }", "public function getCategory();", "public function getCategory();", "public static function getCategoryData()\n\t{\n\n\t\tstatic $cats;\n\n\t\t$app = Factory::getApplication();\n\n\t\tif (!isset($cats))\n\t\t{\n\t\t\t$db = Factory::getDbo();\n\n\t\t\t$sql = \"SELECT c.* FROM #__categories as c WHERE extension='\" . JEV_COM_COMPONENT . \"' order by c.lft asc\";\n\t\t\t$db->setQuery($sql);\n\t\t\t$cats = $db->loadObjectList('id');\n\t\t\tforeach ($cats as &$cat)\n\t\t\t{\n\t\t\t\t$cat->name = $cat->title;\n\t\t\t\t$params = new JevRegistry($cat->params);\n\t\t\t\t$cat->color = $params->get(\"catcolour\", \"\");\n\t\t\t\t$cat->overlaps = $params->get(\"overlaps\", 0);\n\t\t\t}\n\t\t\tunset ($cat);\n\n\t\t\t$app->triggerEvent('onGetCategoryData', array(& $cats));\n\n\t\t}\n\n\t\t$app->triggerEvent('onGetAccessibleCategories', array(& $cats, false));\n\n\n\t\treturn $cats;\n\t}", "public static function getCourseData($id)\n {\n global $cont;\n $courseData =$cont->prepare(\"SELECT courses.id AS courseId , courses.title AS title , courses.price AS price , courses.catagory_id AS catId , courses.body AS body , courses.image AS `image` , categories.name AS catName FROM courses INNER JOIN categories ON courses.catagory_id = categories.id WHERE courses.id = ? LIMIT 1 \");\n $courseData->execute([$id]);\n return $courseData->fetchObject();\n }", "public static function courses(){\n return Catalog::where('active',1)\n ->where('for_sale', 1)\n ->where('litmos_deleted', 0)\n ->orderBy('name')\n ->lists( 'name', 'id');\n }", "public function course_data($courses = array()) {\n\t\tforeach ($courses as $key => $course) {\n\t\t\t$courses[$key]['requirements'] = json_decode($course['requirements']);\n\t\t\t$courses[$key]['outcomes'] = json_decode($course['outcomes']);\n\t\t\t$courses[$key]['thumbnail'] = $this->get_image('course_thumbnail', $course['id']);\n\t\t\tif ($course['is_free_course'] == 1) {\n\t\t\t\t$courses[$key]['price'] = get_phrase('free');\n\t\t\t}else{\n\t\t\t\tif ($course['discount_flag'] == 1){\n\t\t\t\t\t$courses[$key]['price'] = currency($course['discounted_price']);\n\t\t\t\t}else{\n\t\t\t\t\t$courses[$key]['price'] = currency($course['price']);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$total_rating = $this->crud_model->get_ratings('course', $course['id'], true)->row()->rating;\n\t\t\t$number_of_ratings = $this->crud_model->get_ratings('course', $course['id'])->num_rows();\n\t\t\tif ($number_of_ratings > 0) {\n\t\t\t\t$courses[$key]['rating'] = ceil($total_rating / $number_of_ratings);\n\t\t\t}else {\n\t\t\t\t$courses[$key]['rating'] = 0;\n\t\t\t}\n\t\t\t$courses[$key]['number_of_ratings'] = $number_of_ratings;\n\t\t\t$instructor_details = $this->user_model->get_all_user($course['user_id'])->row_array();\n\t\t\t$courses[$key]['instructor_name'] = $instructor_details['first_name'].' '.$instructor_details['last_name'];\n\t\t\t$courses[$key]['total_enrollment'] = $this->crud_model->enrol_history($course['id'])->num_rows();\n\t\t\t$courses[$key]['shareable_link'] = site_url('home/course/'.slugify($course['title']).'/'.$course['id']);\n\t\t}\n\n\t\treturn $courses;\n\t}", "function getCategoryDataAction()\n {\n $siteId = $this->request->categoryId;\n $site = $this->category->findByPk($siteId);\n $this->set($site->toArray());\n $this->viewClass = \"JsonView\";\n }", "public function get_course_categories($instructor_id){\n\t\t$this->db->select('*');\n\t\t$this->db->from($this->TABLENAME);\n\t\t$this->db->where('instructor_id', $instructor_id);\n\t\t$this->db->join('course_category', \"course_category.category_id = $this->TABLENAME.category_id\");\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function getcategory()\r\n{\r\n {\r\n $sql = \"select * from categories\";\r\n $result = $this->connect()->query($sql);\r\n if ($result->rowCount() > 0) {\r\n while ($row = $result->fetch()) {\r\n $data[] = $row;\r\n\r\n }\r\n return $data;\r\n }\r\n }\r\n}", "public function getCategories()\n {\n return $this->request(\"core_course_get_categories\");\n }", "public function testGETCategory()\n\t{\n\t\t$request = new ERestTestRequestHelper();\n\n\t\t$request['config'] = [\n\t\t\t'url'\t\t\t=> 'http://api/category/1',\n\t\t\t'type'\t\t=> 'GET',\n\t\t\t'data'\t\t=> null,\n\t\t\t'headers' => [\n\t\t\t\t'X_REST_USERNAME' => 'admin@restuser',\n\t\t\t\t'X_REST_PASSWORD' => 'admin@Access',\n\t\t\t],\n\t\t];\n\n\t\t$request_response = $request->send();\n\t\t$expected_response = '{\"success\":true,\"message\":\"Record Found\",\"data\":{\"totalCount\":1,\"category\":{\"id\":\"1\",\"name\":\"cat1\",\"posts\":[{\"id\":\"1\",\"title\":\"title1\",\"content\":\"content1\",\"create_time\":\"2013-08-07 10:09:41\",\"author_id\":\"1\"}]}}}';\n\t\t$this->assertJsonStringEqualsJsonString($request_response, $expected_response);\n\t}", "public function test_category_retrieval()\n {\n $insertedcategory = factory(Category::class)->create();\n \n // When I fetch the latest categories\n $retrievedcategory = Category::latest()->get();\n \n // Then I should have a correct response of 1 category\n // Inserted category should match first result of latest() method call (retrieved category)\n $this->assertEquals($insertedcategory->toArray(), $retrievedcategory[0]->toArray());\n }", "public function data()\n {\n return response()->json(Category::All(), 200);\n }", "public function testGetCategory()\n {\n $category = Category::first();\n\n $response = $this->get(\"/api/categories/+&= %20\");\n $response->assertResponseStatus(400);\n $response->seeJson([\"success\" => false]);\n\n $response = $this->get(\"/api/categories/123456789\");\n $response->assertResponseStatus(404);\n $response->seeJson([\"success\" => false]);\n\n $response = $this->get(\"/api/categories/\" . $category->slug);\n $response->assertResponseStatus(200);\n $response->seeJson([\"success\" => true]);\n }", "function cicleinscription_get_courses_all(){\n\tglobal $DB;\n\t$sort = 'fullname ASC';\n\t$courses = $DB->get_records_sql(\"\n\t\t\tSELECT\n\t\t\t\tid,\n\t\t\t\tfullname,\n\t\t\t\tshortname \n\t\t\tFROM {course}\n\t\t\tWHERE\n\t\t\t\tcategory <> 0\n\t\t\tORDER BY {$sort}\");\n\n\treturn $courses;\n}" ]
[ "0.68075174", "0.6745047", "0.66860527", "0.65862685", "0.63854486", "0.6350857", "0.63295484", "0.63173205", "0.6317258", "0.6300326", "0.62880677", "0.6280256", "0.62031054", "0.61767656", "0.6127452", "0.60538775", "0.60538775", "0.6052191", "0.6037448", "0.60340387", "0.6024628", "0.60142165", "0.60000795", "0.5961803", "0.59538645", "0.5941811", "0.58763117", "0.5865455", "0.586412", "0.58578527" ]
0.6914699
0
return the config dictionary for a specific feature
public function getFeatureConfig($featureName, $default=array()) { return $this->_remoteConfig->get('feature_' . $featureName, $default); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getGiftOptionsConfigJson()\n {\n return $this->configProvider->getConfig();\n }", "public function getConfig()\n {\n return $this->traitGetConfig();\n }", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "abstract protected function getConfig();", "public function get_config()\n\t{\n\t\treturn $this->cfg;\n\t}", "public function getBestMatchingConfigurationForAllFeatures() {}", "abstract public function getConfig();", "public function getServiceConfiguration();", "public function getConfig(){\n\t\treturn $this->_config;\n\t}", "function getConfiguration() ;", "public function getConfig()\n\t{\n\t\treturn $this->config;\n\t}", "public function getConfig()\n\t{\n\t\treturn $this->config;\n\t}", "public function getConfig()\n\t{\n\t\treturn $this->config;\n\t}", "public function getConfig()\n\t{\n\t\treturn $this->config;\n\t}", "public function getConfig() \n {\n return $this->config;\n }", "public function getConfig()\n {\n return $this['config'];\n }", "public function getConfiguration($param)\n {\n return $this->getConfigData($param);\n }", "public function getConfig(){\n return $this->config;\n }", "public function getConfig()\n {\n return $this->config;\n }", "public function getConfig() {}", "public function getConfig()\n {\n return $this->config;\n }", "public function getConfig()\n {\n return $this->config;\n }", "public function getConfig()\n {\n return $this->config;\n }" ]
[ "0.61788493", "0.6144685", "0.61031914", "0.61031914", "0.61031914", "0.61031914", "0.61031914", "0.61031914", "0.61031914", "0.61031914", "0.607042", "0.60344845", "0.60253006", "0.59971017", "0.5988514", "0.59816664", "0.5941678", "0.5925695", "0.5925695", "0.5925695", "0.5925695", "0.592392", "0.59237236", "0.5916006", "0.58979934", "0.5883694", "0.58536136", "0.58426327", "0.58426327", "0.58426327" ]
0.6577641
0
Return the Shoptimally server url
public function getServerUrl() { return $this->_shoptimallyDomain; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getServerUrl() {\n return $this->conn->getServerUrl();\n }", "function create_short_server_url()\n\t{\n\t\t// usage: $server_url = create_short_server_url();\n\t\tglobal $config;\n\n\t\tif (!empty($config['short_site_url']))\n\t\t{\n\t\t\treturn $config['short_site_url'];\n\t\t}\n\n\t\t$server_protocol = ($config['cookie_secure']) ? 'https://' : 'http://';\n\t\t$server_name = preg_replace('#^\\/?(.*?)\\/?$#', '\\1', trim($config['server_name']));\n\t\t$server_port = ($config['server_port'] <> 80) ? ':' . trim($config['server_port']) : '';\n\t\t$script_name = preg_replace('/^\\/?(.*?)\\/?$/', '\\1', trim($config['script_path']));\n\t\t$script_name = ($script_name == '') ? '' : '/' . $script_name;\n\t\t//$server_url = $server_protocol . $server_name . $server_port . $script_name;\n\t\t$server_url = $server_name . $server_port . $script_name;\n\t\twhile(substr($server_url, -1, 1) == '/')\n\t\t{\n\t\t\t$server_url = substr($server_url, 0, -1);\n\t\t}\n\t\t$server_url = $server_url . '/';\n\n\t\t//$server_url = 'icyphoenix.com/';\n\n\t\t$config['short_site_url'] = $server_url;\n\t\treturn $server_url;\n\t}", "public function getServerUrl() {\n $host = $this->getHeader(Header::HEADER_HOST);\n if (!$host) {\n $host = 'localhost';\n }\n\n if ($this->isSecure) {\n return 'https://' . $host;\n }\n\n return 'http://' . $host;\n }", "protected function getRemoteServerUrl(){\n return rtrim(@$this->params['server']);\n }", "function create_server_url()\n\t{\n\t\tglobal $config;\n\n\t\t$server_protocol = ($config['cookie_secure']) ? 'https://' : 'http://';\n\t\t$server_name = preg_replace('#^\\/?(.*?)\\/?$#', '\\1', trim($config['server_name']));\n\t\t$server_port = ($config['server_port'] <> 80) ? ':' . trim($config['server_port']) : '';\n\t\t$script_name = preg_replace('/^\\/?(.*?)\\/?$/', '\\1', trim($config['script_path']));\n\t\t$script_name = ($script_name == '') ? '' : '/' . $script_name;\n\t\t$server_url = $server_protocol . $server_name . $server_port . $script_name;\n\t\twhile(substr($server_url, -1, 1) == '/')\n\t\t{\n\t\t\t$server_url = substr($server_url, 0, -1);\n\t\t}\n\t\t$server_url = $server_url . '/';\n\n\t\t//$server_url = 'icyphoenix.com/';\n\n\t\treturn $server_url;\n\t}", "static public function selfURL()\r\n {\r\n //global $cfgSite;\r\n $cfgSite = Warecorp_Config_Loader::getInstance()->getAppConfig('cfg.site.xml');\r\n $s = empty($_SERVER[\"HTTPS\"]) ? '' : ($_SERVER[\"HTTPS\"] == \"on\") ? \"s\" : \"\";\r\n $protocol = self::strleft(strtolower($_SERVER[\"SERVER_PROTOCOL\"]), \"/\").$s;\r\n if ($cfgSite->use_port_in_URL == '1') {\r\n $port = ($_SERVER[\"SERVER_PORT\"] == \"80\") ? \"\" : (\":\".$_SERVER[\"SERVER_PORT\"]);\r\n } else {$port = '';}\r\n return $protocol.\"://\".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];\r\n }", "protected function getRemoteMinerUrl(){\n $minerUrl=trim(@$this->params['minerUrl'],'/');\n return $this->getRemoteServerUrl().($minerUrl!=''?'/'.$minerUrl:'');\n }", "protected function _getUrl()\n {\n $s = empty($_SERVER['HTTPS']) ? '' : ($_SERVER['HTTPS'] == 'on') ? 's' : '';\n\n $protocol = substr(strtolower($_SERVER['SERVER_PROTOCOL']), 0, strpos(strtolower($_SERVER['SERVER_PROTOCOL']), '/')) . $s;\n\n $port = ($_SERVER['SERVER_PORT'] == '80') ? '' : (':'.$_SERVER['SERVER_PORT']);\n\n return $protocol . '://' . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI'];\n }", "public static function getBaseUrl()\n\t{\n\t\tlist($host, $address, $port, $ssl) = MHTTPD::getServerInfo();\n\t\t$url = $ssl ? 'https://' : 'http://';\n\t\t$url .= $host.':'.$port;\n\t\treturn $url;\n\t}", "protected function getRemoteScmUrl()\n {\n $scm = $this->getScm();\n $url = '';\n if ($scm->getUsername())\n {\n $url .= $scm->getUsername().'@';\n }\n $url .= $scm->getHost();\n if ($scm->getPort())\n {\n $url .= ':'.$scm->getPort();\n }\n $url .= $scm->getPath();\n return $url;\n }", "public function getUrl(){\n return $this->server->getUrl() . \"/\" . $this->name;\n \n }", "static public function getFull()\n {\n return 'https://' . Config::get('app.Host') . $_SERVER['REQUEST_URI'];\n }", "public function url() \n\t{\n\t\treturn static::protocol().'://'.static::host().$this->server('REQUEST_URI', '/' );\n\t}", "function getUrl() {\n\t\t$url = @( $_SERVER[\"HTTPS\"] != 'on' ) ? 'http://'.$_SERVER[\"SERVER_NAME\"] : 'https://'.$_SERVER[\"SERVER_NAME\"];\n\t\t$url .= ( $_SERVER[\"SERVER_PORT\"] !== 80 ) ? \":\".$_SERVER[\"SERVER_PORT\"] : \"\";\n\t\t$url .= $_SERVER[\"REQUEST_URI\"];\n\t\treturn $url;\n\t}", "private static function getSiteUrl()\n {\n return ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] === 'on' ? \"https\" : \"http\") . \"://\" . $_SERVER['HTTP_HOST'] . ( isset($_SERVER['SCRIPT_URL'] ) ? $_SERVER['SCRIPT_URL'] : '' );\n }", "private function site_url()\n\t{\n\t\t$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443)\n\t\t\t? \"https://\"\n\t\t\t: \"http://\";\n\t\t$domainName = $_SERVER['HTTP_HOST'];\n\n\t\treturn $protocol.$domainName;\n\t}", "public function getRequestURL() {\n\t\t$scheme = $this->getScheme();\n\t\t$port = $this->getServerPort();\n\t\t$url = $scheme . '://';\n\t\t$url .= $this->getServerName();\n\t\tif(($scheme == 'http' && $port != 80) || ($scheme == 'https' && $port != 443)) {\n\t\t\t$url .= ':' . $port;\n\t\t}\n\t\t$url .= $this->getRequestURI();\n\t\treturn $url;\n\t}", "protected function _getURL()\n {\n $s = empty($_SERVER[\"HTTPS\"]) ? '' : ($_SERVER[\"HTTPS\"] == \"on\") ? \"s\" : \"\";\n\n $protocol = substr(\n strtolower($_SERVER[\"SERVER_PROTOCOL\"]), 0, strpos(strtolower($_SERVER[\"SERVER_PROTOCOL\"]), \"/\")\n ) . $s;\n\n $port = ($_SERVER[\"SERVER_PORT\"] == \"80\") ? \"\" : (\":\".$_SERVER[\"SERVER_PORT\"]);\n\n return $protocol.\"://\".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];\n }", "public function getUrl()\n {\n $uri = $this->getHost();\n\n $server = provider::access('server');\n\n if ($server->isExist('PHP_SELF') && $server->isExist('REQUEST_URI') && $server->isValid('REQUEST_URI', validate::T_PRINTABLE)) {\n // for 'good' servers\n $uri .= $server->getValue('REQUEST_URI');\n } else {\n // for IIS\n if ($server->isValid('SCRIPT_NAME', validate::T_PRINTABLE)) {\n $uri .= $server->getValue('SCRIPT_NAME');\n }\n\n if ($server->isValid('QUERY_STRING', validate::T_PRINTABLE)) {\n $uri .= '?' . $server->getValue('QUERY_STRING');\n }\n }\n\n return $uri;\n }", "public function url(){\n $protocol = \"http://\";\n if ( !empty( $_SERVER['HTTPS'] ) ) {\n $protocol = \"https://\";\n }\n $url = $protocol . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\n return $url;\n }", "static function URL ()\n\t\t{\n\t\t\tif (php_sapi_name() === \"cli\")\n\t\t\t\treturn NULL;\n\t\t\treturn (self::Protocol().\"://\".self::ServerName().self::PortReadable().self::RequestURI());\n\t\t}", "function url_site(): string\n{\n //return input_server('REQUEST_SCHEME') . '://' . input_server('SERVER_NAME');\n $site = \\get_site_url();\n $pos = strpos($site, '/', 8);\n return $pos ? substr($site, 0, $pos) : $site;\n}", "function selfURL() {\n \t$s = empty($_SERVER[\"HTTPS\"]) ? '' : ($_SERVER[\"HTTPS\"] == \"on\") ? \"s\" : \"\";\n \t$protocol = strleft(strtolower($_SERVER[\"SERVER_PROTOCOL\"]), \"/\").$s;\n \t$port = ($_SERVER[\"SERVER_PORT\"] == \"80\") ? \"\" : (\":\".$_SERVER[\"SERVER_PORT\"]);\n\t\treturn $protocol.\"://\".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];\n\t}", "function get_act_url() {\n\t\t $act_url = ( isset( $_SERVER['HTTPS'] ) && 'on' === $_SERVER['HTTPS'] ) ? 'https' : 'http';\n\t\t $act_url .= '://' . $_SERVER['SERVER_NAME'];\n\t\t $act_url .= in_array( $_SERVER['SERVER_PORT'], array( '80', '443' ) ) ? '' : \":\" . $_SERVER['SERVER_PORT'];\n\t\t return $act_url;\n}", "public static function siteURL(): string\n {\n return sprintf(\"%s://%s\", Request::scheme(), Request::host());\n }", "public static function getSiteUrl()\n\t{\n\t\t$uri = JUri::getInstance();\n\t\t$base = $uri->toString(array('scheme', 'host', 'port'));\n\n\t\tif (strpos(php_sapi_name(), 'cgi') !== false && !ini_get('cgi.fix_pathinfo') && !empty($_SERVER['REQUEST_URI']))\n\t\t{\n\t\t\t$script_name = $_SERVER['PHP_SELF'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$script_name = $_SERVER['SCRIPT_NAME'];\n\t\t}\n\n\t\t$path = rtrim(dirname($script_name), '/\\\\');\n\n\t\tif ($path)\n\t\t{\n\t\t\t$siteUrl = $base . $path . '/';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$siteUrl = $base . '/';\n\t\t}\n\n\t\tif (JFactory::getApplication()->isClient('administrator'))\n\t\t{\n\t\t\t$adminPos = strrpos($siteUrl, 'administrator/');\n\t\t\t$siteUrl = substr_replace($siteUrl, '', $adminPos, 14);\n\t\t}\n\n\t\treturn $siteUrl;\n\t}", "public function getServerName()\n\t{\n\t\treturn $server_name = \"http://\" . $_SERVER['SERVER_NAME'] . \"/\";\t\n\t}", "public function getOwnURL() \n\t{ \n\t\t$s = empty($_SERVER[\"HTTPS\"]) ? '' : ($_SERVER[\"HTTPS\"] == \"on\") ? \"s\" : \"\"; \n\t\t$protocol = $this->strleft(strtolower($_SERVER[\"SERVER_PROTOCOL\"]), \"/\").$s; \n$port = ($_SERVER[\"SERVER_PORT\"] == \"80\" || $_SERVER[\"SERVER_PORT\"] == \"82\") ? \"\" : (\":\".$_SERVER[\"SERVER_PORT\"]); \n\t\treturn $protocol.\"://\".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI']; \n\t}", "function get_url()\n{\n $url = 'http://'.$_SERVER['SERVER_NAME'].'/space';\n return $url;\n}", "public function getFullUrl()\r\n {\r\n return $this->hostname . '.' . $this->owner->username . '.' . Yii::app()->params['serverBaseHost'];\r\n }" ]
[ "0.77528983", "0.7580038", "0.75591004", "0.75382996", "0.7468451", "0.72993666", "0.72095436", "0.71310747", "0.6994375", "0.698615", "0.69674164", "0.6932052", "0.690589", "0.68949014", "0.6890573", "0.68855315", "0.6883455", "0.6862323", "0.6847014", "0.6803953", "0.68037415", "0.6779826", "0.6777818", "0.6775177", "0.67554975", "0.6719722", "0.67070156", "0.67061764", "0.6666106", "0.66590583" ]
0.81760305
0
Return if the shoptimally js file should be loaded in async mode or not
public function shouldLoadJsAsync() { return (!$this->_remoteConfig->get("javascript_synced")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isAsync();", "public function isAsync(): bool\n {\n return $this->async;\n }", "public static function is_loading_fonts_async() {\n\t\treturn ! empty( get_option( static::ENABLE_ASYNC_FONTS_LOAD, 0 ) );\n\t}", "public function isAsync()\n {\n return $this->async;\n }", "public function isAsynchronous(): bool\n {\n return true;\n }", "public function has_async_action() {\n\t\treturn false;\n\t}", "public function getAsync()\n {\n return (bool)Mage::getStoreConfig(self::CONFIG_ASYNC);\n }", "function Scripts()\n{\n $html = \"<script src='bundle/js/async.js' async></script>\";\n return $html;\n}", "public function isAjaxLoaded()\n {\n return false;\n }", "public function isScriptFileAvailable() {\n return false;\n }", "public function isLoaded(): bool\n {\n return $this->options['load'] || in_array($this->getMethod(), [self::INLOAD, self::POSTLOAD], true);\n }", "public function canShowScript() {\n\t\t$pluginUpgrader = new Utils\\PluginUpgraderSilentAjax();\n\t\t$miLite = $pluginUpgrader->pluginSlugs['miLite'];\n\t\t$miPro = $pluginUpgrader->pluginSlugs['miPro'];\n\t\t$emLite = $pluginUpgrader->pluginSlugs['emLite'];\n\t\t$emPro = $pluginUpgrader->pluginSlugs['emPro'];\n\t\t$activePlugins = get_option( 'active_plugins' );\n\n\t\tif (\n\t\t\tin_array( $miLite, $activePlugins, true ) ||\n\t\t\tin_array( $miPro, $activePlugins, true ) ||\n\t\t\tin_array( $emLite, $activePlugins, true ) ||\n\t\t\tin_array( $emPro, $activePlugins, true )\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$googleAnalyticsId = aioseo()->options->deprecated->webmasterTools->googleAnalytics->id;\n\t\t$gtmContainerId = aioseo()->options->deprecated->webmasterTools->googleAnalytics->gtmContainerId;\n\n\t\tif (\n\t\t\tin_array( 'googleAnalytics', aioseo()->internalOptions->internal->deprecatedOptions, true ) &&\n\t\t\t! $googleAnalyticsId &&\n\t\t\t! $gtmContainerId\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn ! $this->userIsExcluded();\n\t}", "public function isAsync($bool = null){\n if($bool === null)\n return $this->hasAttr(ATTR_ASYNC);\n else{\n if($bool)\n return $this->async('async');\n else\n return $this->rattr(ATTR_ASYNC);\n }\n }", "public static function isLoaded();", "public function should_load_shim() {\n\n\t\t$should_load = get_option( 'hestia_load_shim' );\n\n\t\tif ( ! empty( $should_load ) ) {\n\t\t\treturn $should_load === 'yes';\n\t\t}\n\n\t\t$is_switch_theme = current_filter() === 'after_switch_theme';\n\t\t$slug = $this->get_theme_slug( $is_switch_theme );\n\t\t$key = str_replace( '-', '_', strtolower( trim( $slug ) ) );\n\t\t$theme_install_time = get_option( $key . '_install' );\n\t\t$current_time = time();\n\t\tif ( empty( $current_time ) || empty( $theme_install_time ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ( $current_time - $theme_install_time ) > 60 ) {\n\t\t\tupdate_option( 'hestia_load_shim', 'yes' );\n\t\t\treturn true;\n\t\t}\n\n\t\tupdate_option( 'hestia_load_shim', 'no' );\n\t\treturn false;\n\t}", "private static function _is_loadable()\n\t{\n\t\t$allowed_in_admin = apply_filters('bwp_minify_allowed_in_admin', false);\n\n\t\tif (is_admin() && !$allowed_in_admin)\n\t\t\treturn false;\n\n\t\tif (!did_action('template_redirect'))\n\t\t\treturn true;\n\n\t\t// ignore Geomashup\n\t\tif (!empty($_GET['geo_mashup_content'])\n\t\t\t&& 'render-map' == $_GET['geo_mashup_content'])\n\t\t\treturn false;\n\n\t\t// ignore AEC (Ajax Edit Comment)\n\t\tif (!empty($_GET['aec_page']))\n\t\t\treturn false;\n\n\t\t// ignore Simple:Press forum plugin\n\t\tif (defined('SPVERSION') && function_exists('sp_get_option'))\n\t\t{\n\t\t\t$sp_page = sp_get_option('sfpage');\n\t\t\tif (is_page($sp_page))\n\t\t\t\treturn false;\n\t\t}\n\n\t\t// @since 1.3.1 ignore Maintenance plugin\n\t\tif (bwp_is_maintenance_on())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function isLoaded();", "function defer_js_async($tag){\n\t\n\t// list of scripts to defer\n $scripts_to_defer = array('');\n\n\t// list of scripts to async\n\t$scripts_to_async = array('/src/js/nav.js', 'https://fonts.googleapis.com/css?family=Julius+Sans+One', 'https://fonts.googleapis.com/css?family=Raleway');\n\t \n\t// defer scripts\n\tforeach($scripts_to_defer as $defer_script){\n\t\tif(true == strpos($tag, $defer_script ) )\n\t\treturn str_replace( ' src', ' defer=\"defer\" src', $tag );\t\n\t}\n\n\t// async scripts\n\tforeach($scripts_to_async as $async_script){\n\t\tif(true == strpos($tag, $async_script ) )\n\t\treturn str_replace( ' src', ' async=\"async\" src', $tag );\t\n\t}\n\treturn $tag;\n\t}", "private function are_batch_assets_enqueued() {\n\n\t\t// Run the check on both the style and script enqueue.\n\t\tif ( false !== wp_style_is( 'batch-process-styles', 'enqueued' ) && false !== wp_script_is( 'batch-js', 'enqueued' ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function hasScript()\n {\n return (isset($this->data[\"script\"]));\n }", "public static function isLoaded(): bool\n {\n return !!static::$loaded;\n }", "public function hasConfigLoader(): bool;", "private function should_load() {\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$theme_support = get_theme_support( 'themeisle-demo-import' );\n\n\t\tif ( empty( $theme_support ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function isLazyLoadEnabled()\n {\n $skin = \\XLite\\Core\\Database::getRepo('XLite\\Model\\Module')->getCurrentSkinModule();\n\n return $skin ? $skin->callModuleMethod('isUseLazyLoad') : false;\n }", "public function isForceLoad()\n {\n return (bool) $this->bForceLoad;\n }", "function asc_script_is( $handle, $list = 'enqueued' ) {\n\tglobal $asc_scripts;\n\tif ( ! is_a( $asc_scripts, 'ASC_Scripts' ) ) {\n\t\tif ( ! did_action( 'init' ) )\n\t\t\t_doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),\n\t\t\t\t'<code>asc_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );\n\t\t$asc_scripts = new ASC_Scripts();\n\t}\n\n\treturn (bool) $asc_scripts->query( $handle, $list );\n}", "public function has_lazy_load() {\n\t\treturn $this->get_meta_value( static::LAZY_LOAD_META_KEY ) === '1';\n\t}", "public static function is_running_from_async_action_scheduler() {\n\t\tif ( function_exists( '\\wc_is_running_from_async_action_scheduler' ) ) {\n\t\t\treturn \\wc_is_running_from_async_action_scheduler();\n\t\t}\n\n\t\t// phpcs:ignore WordPress.Security.NonceVerification.Recommended\n\t\treturn isset( $_REQUEST['action'] ) && 'as_async_request_queue_runner' === $_REQUEST['action'];\n\t}", "public function isDeferred();", "public function isAutomaticAsync()\n {\n return $this->isAutomaticAsyncWithHttpInfo()\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }" ]
[ "0.6862745", "0.6744029", "0.6712746", "0.67093897", "0.6676919", "0.63030076", "0.62526053", "0.61136675", "0.60864675", "0.59783345", "0.5844328", "0.5837579", "0.5824437", "0.5787508", "0.5773411", "0.57677233", "0.5690009", "0.5678609", "0.5645875", "0.5636723", "0.56109416", "0.56106526", "0.5569961", "0.5524451", "0.5524118", "0.5518231", "0.55161154", "0.54934746", "0.5486433", "0.5479945" ]
0.8186165
0
Update value map and rewrite mappings.
function updateValueMap(array $valueMap, array $mappings) { $mappings = cleanValueMapMappings($mappings); checkValueMapMappings($mappings); $valueMapId = $valueMap['valuemapid']; unset($valueMap['valuemapid']); // check existence $sql = 'SELECT v.valuemapid FROM valuemaps v WHERE v.valuemapid='.zbx_dbstr($valueMapId).' '.andDbNode('v.valuemapid'); if (!DBfetch(DBselect($sql))) { throw new Exception(_s('Value map with valuemapid "%1$s" does not exist.', $valueMapId)); } // check duplicate name $dbValueMap = DBfetch(DBselect( 'SELECT v.valuemapid'. ' FROM valuemaps v'. ' WHERE v.name='.zbx_dbstr($valueMap['name']). ' '.andDbNode('v.valuemapid') )); if ($dbValueMap && bccomp($valueMapId, $dbValueMap['valuemapid']) != 0) { throw new Exception(_s('Value map "%1$s" already exists.', $valueMap['name'])); } rewriteValueMapMappings($valueMapId, $mappings); DB::update('valuemaps', array( 'values' => $valueMap, 'where' => array('valuemapid' => $valueMapId) )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateValueMapMappings(array $mappings) {\n\tforeach ($mappings as &$mapping) {\n\t\t$mappingid = $mapping['mappingid'];\n\t\tunset($mapping['mappingid']);\n\n\t\tDB::update('mappings', array(\n\t\t\t'values' => $mapping,\n\t\t\t'where' => array('mappingid' => $mappingid)\n\t\t));\n\t}\n\tunset($mapping);\n}", "function rewriteValueMapMappings($valueMapId, array $mappings) {\n\t$dbValueMaps = getValueMapMappings($valueMapId);\n\n\t$mappingsToAdd = array();\n\t$mappingsToUpdate = array();\n\tforeach ($mappings as $mapping) {\n\t\tif (!isset($mapping['mappingid'])) {\n\t\t\t$mappingsToAdd[] = $mapping;\n\t\t}\n\t\telseif (isset($dbValueMaps[$mapping['mappingid']])) {\n\t\t\t$mappingsToUpdate[] = $mapping;\n\t\t\tunset($dbValueMaps[$mapping['mappingid']]);\n\t\t}\n\t}\n\n\tif (!empty($dbValueMaps)) {\n\t\t$dbMappingIds = zbx_objectValues($dbValueMaps, 'mappingid');\n\t\tdeleteValueMapMappings($dbMappingIds);\n\t}\n\n\tif (!empty($mappingsToAdd)) {\n\t\taddValueMapMappings($valueMapId, $mappingsToAdd);\n\t}\n\n\tif (!empty($mappingsToUpdate)) {\n\t\tupdateValueMapMappings($mappingsToUpdate);\n\t}\n}", "function set($key, $newvalue) {\n\t\t$this->valuemap[$key]= $newvalue;\n\t}", "public static function updateMapping()\n {\n $db = static::getDb();\n $command = $db->createCommand();\n $command->setMapping(static::index(), static::type(), static::mapping());\n }", "function addValueMapMappings($valueMapId, array $mappings) {\n\tforeach ($mappings as &$mapping) {\n\t\t$mapping['valuemapid'] = $valueMapId;\n\t}\n\tunset($mapping);\n\n\tDB::insert('mappings', $mappings);\n}", "public static function updateMapping(){\r\n $db = self::getDb();\r\n $command = $db->createCommand();\r\n\t\tif(!$command->indexExists(self::index())){\r\n\t\t\t$command->createIndex(self::index());\r\n\t\t}\r\n $command->setMapping(self::index(), self::type(), self::mapping());\r\n }", "final public function set($key,$value):Main\\Map\n {\n $this->checkAllowed('set')->checkBefore(false,$value);\n $return = $this->onPrepareThis('set');\n $key = $this->onPrepareKey($key);\n $value = $this->onPrepareValueSet($value);\n Base\\Arrs::setRef($key,$value,$return->arr(),$this->isSensitive());\n\n return $return->checkAfter();\n }", "public function set_field_map( $name, $value ) {\n\t\t$this->import[ $name ] = $value;\n\t}", "public function update() {\r\n\t\t$this->getMapper()->update($this);\r\n\t}", "function applyValueMap($value, $valueMapId) {\n\t$mapping = getMappedValue($value, $valueMapId);\n\n\treturn ($mapping === false) ? $value : $mapping.' ('.$value.')';\n}", "public function setMap($value)\n {\n $this->map = $value;\n }", "public function updateMappings()\n {\n /** @var ClassMetadata[] $metadatas */\n $metadatas = $this->sm->getMetadataFactory()->getAllMetadata();\n\n // Refresh all the mappings\n foreach ($metadatas as $metadata) {\n // if we're in the dev env, set the number of replicas to be 0\n if ($this->env == 'dev' || $this->env == 'test_local') {\n $metadata->numberOfReplicas = 0;\n }\n\n // create the index if it doesn't exist yet\n $indexName = $metadata->timeSeriesScale ? $metadata->getCurrentTimeSeriesIndex() : $metadata->index;\n /** @var Index $index */\n $index = $this->client->getIndex($indexName);\n if (!$index->exists()) {\n $this->client->createIndex($indexName, $metadata->getSettings());\n }\n\n // create the type if it doesn't exist yet\n if ($metadata->type) {\n $type = new Type($index, $metadata->type);\n if (!$type->exists()) {\n $this->client->createType($metadata);\n }\n\n // update the mapping\n $result = $this->client->updateMapping($metadata);\n if (true !== $result) {\n echo \"Warning: Failed to update mapping for index '$indexName', type '$metadata->type'. Reason: $result\\n\";\n }\n }\n }\n }", "protected function update($value)\n {\n }", "public function update()\n {\n $this->updateTemplates();\n $this->updateMappings();\n }", "public function update( string $key, $value );", "function getValueMapMappings($valueMapId) {\n\t$mappings = array();\n\n\t$dbMappings = DBselect(\n\t\t'SELECT m.mappingid,m.value,m.newvalue'.\n\t\t' FROM mappings m'.\n\t\t' WHERE m.valuemapid='.zbx_dbstr($valueMapId).\n\t\t\t' '.andDbNode('m.mappingid')\n\t);\n\twhile ($mapping = DBfetch($dbMappings)) {\n\t\t$mappings[$mapping['mappingid']] = $mapping;\n\t}\n\n\treturn $mappings;\n}", "public function setMapValue($name=null);", "public function updateMap(){\n $out = '';\n\n preg_match( '/<phpDBMapper:map>(.*)<\\/phpDBMapper:map>/s', $this->template, $m );\n\n foreach( $this->tableMapper as $c ){\n $tmp = $m[1];\n\n foreach( $c as $key=>$val ){\n $tmp = str_replace( '%'. $key .'%', $val, $tmp );\n $tmp = str_replace(array(\"\\n\", \"\\r\"), '', $tmp);\n }\n\n $out .= $tmp . \"\\n\";\n }\n\n $this->template = preg_replace( '/<phpDBMapper:map[^>]*?>.*?<\\/phpDBMapper:map>/is', $out, $this->template );\n return $this->template;\n }", "public function setValue($key, $value)\n {\n $this->map[$key] = $value;\n }", "public function update($value)\n {\n }", "public function update($value)\n {\n }", "function addValueMap(array $valueMap, array $mappings) {\n\t$mappings = cleanValueMapMappings($mappings);\n\tcheckValueMapMappings($mappings);\n\n\t// check duplicate name\n\t$sql = 'SELECT v.valuemapid'.\n\t\t\t' FROM valuemaps v'.\n\t\t\t' WHERE v.name='.zbx_dbstr($valueMap['name']).\n\t\t\t' '.andDbNode('v.valuemapid');\n\tif (DBfetch(DBselect($sql))) {\n\t\tthrow new Exception(_s('Value map \"%1$s\" already exists.', $valueMap['name']));\n\t}\n\n\t$valueMapIds = DB::insert('valuemaps', array($valueMap));\n\t$valueMapId = reset($valueMapIds);\n\n\taddValueMapMappings($valueMapId, $mappings);\n}", "public function updateData($key, $value) {\n $meta = $this->getData();\n $keys = explode('.', $key);\n $p = &$meta;\n foreach ($keys as $key) {\n if (!isset($p[$key])) {\n $p[$key] = array();\n }\n $p = &$p[$key];\n }\n $p = $value;\n $this->setData(json_encode($meta));\n }", "abstract protected function putValue($key, $value);", "public static function map($key, $value = null)\n {\n if (is_array($key)) {\n foreach ($key as $k => $v) {\n self::map($k, $v);\n }\n }\n\n if (is_scalar($key) && !empty($value)) {\n self::$map[$key] = $value;\n }\n }", "function getMappedValue($value, $valueMapId) {\n\tstatic $valueMaps = array();\n\n\tif ($valueMapId < 1) {\n\t\treturn false;\n\t}\n\n\tif (isset($valueMaps[$valueMapId][$value])) {\n\t\treturn $valueMaps[$valueMapId][$value];\n\t}\n\n\t$dbMappings = DBselect(\n\t\t'SELECT m.newvalue'.\n\t\t' FROM mappings m'.\n\t\t' WHERE m.valuemapid='.zbx_dbstr($valueMapId).\n\t\t\t' AND m.value='.zbx_dbstr($value).\n\t\t\t' '.andDbNode('m.mappingid')\n\t);\n\tif ($mapping = DBfetch($dbMappings)) {\n\t\t$valueMaps[$valueMapId][$value] = $mapping['newvalue'];\n\n\t\treturn $mapping['newvalue'];\n\t}\n\n\treturn false;\n}", "public function save() \n {\n $oMapping = $this->fcpoGetInstance('fcpoerrormapping');\n $aGeneralMappings = $this->_oFcpoHelper->fcpoGetRequestParameter(\"editval\");\n if (is_array($aGeneralMappings) && count($aGeneralMappings) > 0) {\n $oMapping->fcpoUpdateMappings($aGeneralMappings, 'general');\n }\n }", "function convertValueFieldKeys()\n {\n foreach ($this->vars as $key => $val) {\n if (substr($key, -6) == '_value') {\n $this->vars[substr($key, 0, -6)] = $val;\n unset($this->vars[$key]);\n }\n }\n }", "public function addMapping($key, $value)\n {\n $this->mappings[] = array($key, $value);\n }", "protected function update() {}" ]
[ "0.65848035", "0.63964933", "0.599365", "0.5907981", "0.5797674", "0.57654923", "0.57593906", "0.5756137", "0.57470775", "0.57313496", "0.5709067", "0.5635821", "0.5609271", "0.56067586", "0.55859613", "0.55792725", "0.5551356", "0.5512197", "0.5497619", "0.5476295", "0.5476295", "0.5460496", "0.54186714", "0.5404784", "0.5354569", "0.5342469", "0.53422844", "0.5324415", "0.5321498", "0.5315886" ]
0.65634537
1
Clean value map mappings array from empty records when both value and newvalue are empty strings.
function cleanValueMapMappings(array $mappings) { $cleanedMappings = $mappings; foreach ($cleanedMappings as $key => $mapping) { if (zbx_empty($mapping['value']) && zbx_empty($mapping['newvalue'])) { unset($cleanedMappings[$key]); } } return $cleanedMappings; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remove_empty_items($old_array, $mantain_keys=FALSE)\n{\n\t$new_array = array();\n\tforeach($old_array AS $key=>$value)\n\t{\n\t\tif(trim($value) != ''){\n\t\t\tif($mantain_keys)\n\t\t\t{\n\t\t\t\t$new_array[$key] = $value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tarray_push($new_array, $value);\n\t\t\t}\n\t\t}\n\t}\n\treturn $new_array;\n}", "public function cleanValues($values) {\n\t\tforeach($values as $key => $val) {\n\t\t\tif( empty($val) ) {\n\t\t\t\tunset($values[$key]);\n\t\t\t}\n\t\t}\n\t\treturn $values;\n\t}", "public function cleanValues($values) {\n\t\tforeach($values as $key => $val) {\n\t\t\tif( empty($val) ) {\n\t\t\t\tunset($values[$key]);\n\t\t\t}\n\t\t}\n\t\treturn $values;\n\t}", "private function ignoreBlankValueFields($data){\n $arrData = array();\n if(!is_array($data)) return false;\n foreach($data as $valData => $value){\n if($value){\n foreach($value as $valSubKey => $val){\n if(trim($val) != \"\") $arrData[$valData][$valSubKey] = $val;\n }\n }\n }\n return $arrData;\n }", "function del_empty($arr)\n{\n\tforeach ($arr as $key => $value)\n\t{\n\t\tif (trim(strval($value))!='')\n\t\t\t$rzygi[$key] = $value;\n\t}\n\treturn $rzygi;\n}", "public static function changeEmptyStrings($arr) {\r\n \tforeach ($arr as $key=>$value) {\r\n \t\tif (strlen($value) == 0) {\r\n \t\t\t$arr[$key] = NULL;\r\n \t\t} else {\r\n \t\t\t$arr[$key] = htmlspecialchars_decode(utf8_decode($value));\r\n \t\t} \r\n \t}\r\n \treturn $arr;\r\n }", "protected function parseValues()\n {\n\n $this->setValues([]);\n\n $matches = [];\n\n preg_match_all(\"/\\<(.+?)\\>/\", $this->getDomainRegex() . '/' . $this->getRegex(), $matches);\n\n if(!empty($matches[1])){\n foreach($matches[1] as $value){\n $this->values[$value] = null;\n }\n }\n }", "function emptyToNull($val)\n {\n foreach ($val as $name => $value) {\n if (is_string($value) && trim($value) === \"\") {\n $val[$name] = null;\n }\n\n if (is_array($value)) {\n $val[$name] = emptyToNull($value);\n }\n }\n\n return $val;\n }", "protected function cleanUpValue( $value ) {\n\t\t$cleanValue = [];\n\t\tif ( !is_array( $value ) ) {\n\t\t\treturn $cleanValue;\n\t\t}\n\t\tforeach ( $value as $singleValue ) {\n\t\t\t$singleValue = parent::cleanUpValue( $singleValue );\n\t\t\t// Remove options that we don't have here\n\t\t\tif ( !isset( $this->fields[ $singleValue ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$cleanValue[] = $singleValue;\n\t\t}\n\t\treturn $cleanValue;\n\t}", "function clean_url_data($urldata)\n{\n\t$new_urldata = array();\n\tforeach($urldata AS $key=>$value)\n\t{\n\t\tif($value === FALSE || trim($value) == '')\n\t\t{\n\t\t\t$new_urldata[$key] = '';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$new_urldata[$key] = $value;\n\t\t}\n\t}\n\t\n\treturn $new_urldata;\n}", "private function clear_empty_values($row) {\n\t\tforeach( $row as $key => $datum)\n\t\t\tif (($datum==='' || $datum===null)) $row[$key] = $this->default_value;\n\t\treturn $row;\n\t}", "protected function clean_properties(){\n\t\tglobal $database;\n\t\t$clean_properties = array();\n\t\tforeach($this->properties() as $key => $value){\n\t\t\t$clean_properties[$key]=$database->escape_string($value);\t\n\t\t}\n\t\treturn $clean_properties;\t\n\t}", "protected function clean_properties(){\n global $database;\n\n $clean_properties = array();\n\n foreach ($this->properties() as $key => $value) {\n\n // the value is being escaped in cases of sql injections and etc.it is also being paired with the key \n $clean_properties[$key] = $database->escape_string($value);\n }\n\n return $clean_properties;\n }", "public function filterCorrectData(array $value)\n {\n if (!is_array($value)) {\n return [];\n }\n\n foreach ($value as $key => $row) {\n if (is_array($row) && array_key_exists('predefined_values_donation', $row) && empty($row['predefined_values_donation'])) {\n unset($value[$key]);\n }\n }\n return $value;\n }", "function input_mapping(array $mapping, $data)\n{\n $translated = array();\n\n foreach ($mapping as $from => $to) {\n if (array_key_exists($from, $data))\n {\n $translated[$to] = strlen(trim($data[$from])) > 0 ? trim($data[$from]) : null;\n }\n }\n\n return $translated;\n}", "function _cleanup_input_data($data = array()) {\n\t\tif (empty($data) || !is_array($data)) {\n\t\t\treturn false;\n\t\t}\n\t\t// Cleanup data array\n\t\t$_tmp = array();\n\t\tforeach ((array)$data as $k => $v) {\n\t\t\t$k = trim($k);\n\t\t\tif (!strlen($k)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$_tmp[$k] = $v;\n\t\t}\n\t\t$data = $_tmp;\n\t\tunset($_tmp);\n\t\t// Remove non-existed fields from query\n\t\t$avail_fields = $this->_get_avail_fields();\n\t\tforeach ((array)$data as $k => $v) {\n\t\t\tif (!isset($avail_fields[$k])) {\n\t\t\t\tunset($data[$k]);\n\t\t\t}\n\t\t}\n\t\t// Last check\n\t\tif (empty($data) || !is_array($data)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $data;\n\t}", "protected function clean_saved_value() {\n\t\tif ( $this->saved_value !== '' ) {\n\t\t\tif ( ! is_array( $this->saved_value ) && ! is_object( $this->saved_value ) ) {\n\t\t\t\tFrmAppHelper::unserialize_or_decode( $this->saved_value );\n\t\t\t}\n\n\t\t\tif ( is_array( $this->saved_value ) && empty( $this->saved_value ) ) {\n\t\t\t\t$this->saved_value = '';\n\t\t\t}\n\t\t}\n\t}", "protected function cleanProperties()\n {\n global $database;\n\n $clean_properties = array();\n\n foreach ($this->properties() as $key => $value) {\n $clean_properties[$key] = $database->escapeString($value);\n }\n\n return $clean_properties;\n }", "protected function cleanProperties()\n {\n global $database;\n\n $clean_properties = array();\n\n foreach ($this->properties() as $key => $value) {\n $clean_properties[$key] = $database->escapeString($value);\n }\n\n return $clean_properties;\n }", "public static function deleteEmptyStrings($arr) {\r\n \t$temp = array();\r\n \tforeach ($arr as $key=>$value) {\r\n \t\tif (strlen($value) != 0) {\r\n \t\t\t$temp[$key] = htmlspecialchars(utf8_encode($value), ENT_NOQUOTES);\r\n \t\t}\r\n \t}\r\n \treturn $temp;\r\n }", "function emptystr_tonull($arr)\n {\n return array_map(function ($val) {\n if ($val === '') {\n $val = null;\n }\n\n return $val;\n }, $arr);\n }", "protected function fixValue(array $value)/*# : array */\n {\n $result = [];\n foreach ($value as $k => $v) {\n if (false !== strpos($k, $this->field_splitter)) {\n $res = &$this->searchTree($k, $result, true);\n $res = is_array($v) ? $this->fixValue($v) : $v;\n } else {\n $result[$k] = is_array($v) ? $this->fixValue($v) : $v;\n }\n }\n return $result;\n }", "public function getEmptyValues();", "public static function null_safe($arr)\n {\n $newArr = array();\n foreach ($arr as $key => $value) {\n $newArr[$key] = ($value == NULL) ? \"\" : $value;\n }\n return $newArr;\n }", "public function getArraySkipEmpty () {\n\n $values = array();\n\n foreach ($this->values as $key => $value) {\n\n if ($value !== null && (!is_string($value) || strlen($value) > 0)) {\n\n $values[$key] = $value;\n\n }\n\n }\n\n return $values;\n\n }", "public function clean($objArray = null)\n {\n if (!$objArray) {\n $objArray = & $this->_objData;\n }\n\n $ak = array_keys($objArray);\n foreach ($ak as $k) {\n $obj = & $objArray[$k];\n $ak2 = array_keys($obj);\n foreach ($ak2 as $f) {\n $obj[$f] = FormUtil::getPassedValue(trim($obj[$f]));\n }\n }\n\n return $objArray;\n }", "function fieldValuesSimplified() {\n\t\t$arrFieldValuesSimplified = array();\n\t\t$fieldValues = $this->fieldValues();\n\t\tforeach ($fieldValues as $fieldID => $fieldVal) {\n\t\t\tif (!isset($arrFieldValuesSimplified[$fieldID])) {\n\t\t\t\t$arrFieldValuesSimplified[$fieldID] = array();\n\t\t\t}\n\t\t\tforeach ($fieldVal as $fieldSubVal) {\n\t\t\t\t$arrFieldValuesSimplified[$fieldID][] = $fieldSubVal['value'];\n\t\t\t}\n\t\t}\n\t\treturn $arrFieldValuesSimplified;\n\t}", "public function getArrayNullEmpty () {\n\n $values = array();\n\n foreach ($this->values as $key => $value) {\n\n if ($value !== null && is_string($value) && strlen($value) == 0) {\n\n $value = null;\n\n }\n\n $values[$key] = $value;\n\n }\n\n return $values;\n\n }", "function checkValueMapMappings(array $mappings) {\n\tif (empty($mappings)) {\n\t\tthrow new Exception(_('Value mapping must have at least one mapping.'));\n\t}\n\n\tforeach ($mappings as $mapping) {\n\t\tif (zbx_empty($mapping['newvalue'])) {\n\t\t\tthrow new Exception(_('Value cannot be mapped to empty string.'));\n\t\t}\n\t}\n\n\t$valueCount = array_count_values(zbx_objectValues($mappings, 'value'));\n\tforeach ($valueCount as $value => $count) {\n\t\tif ($count > 1) {\n\t\t\tthrow new Exception(_s('Mapping value \"%1$s\" is not unique.', $value));\n\t\t}\n\t}\n}", "function clean_row( &$row ) {\n\n\n if ( array_key_exists( 'address_with_geocode', $row )) {\n $address = json_decode($row['address_with_geocode']['human_address']);\n\n if ( array_key_exists( 'latitude', $row['address_with_geocode'] )) {\n $row['latitude'] = $row['address_with_geocode']['latitude'];\n }\n if ( array_key_exists( 'longitude', $row['address_with_geocode'] )) {\n $row['longitude'] = $row['address_with_geocode']['longitude'];\n }\n\n if ( empty($address->city) && empty($address->state) && empty($address->zip) ) {\n\n $address->address = str_replace(' Kansas City, Missouri','',$address->address,$cnt);\n if ( $cnt ) {\n $row['address_city'] = 'Kansas City';\n $row['address_state'] = 'Missouri';\n }\n $tmp = $address->address;\n $zip = preg_replace('/(.*) (\\d*)$/','$2',$tmp,$cnt);\n\n if ( $cnt ) {\n $row['address_zip'] = $zip;\n $address->address = str_replace(' ' + $zip,'',$address->address,$cnt);\n } else {\n $row['address_zip'] = '';\n \n }\n } else {\n $row['address_city'] = $address->city;\n $row['address_state'] = $address->state;\n $row['address_zip'] = $address->zip;\n }\n $row['address_line_1'] = $address->address;\n }\n\n // Make sure we have values for all the field names except for the key\n foreach ( $this->fields AS $field_name ) {\n if ( !array_key_exists( $field_name, $row ) ) {\n $row[$field_name] = '';\n }\n }\n\n // Turn dates into MySQL dates it remove the 'T' between the date and time\n\n $row['creation_date'] = str_replace('T', ' ', $row['creation_date']);\n $row['closed_date'] = str_replace('T', ' ', $row['closed_date']);\n\n $row['department_id'] = $this->find( 'departments', $row['department']);\n unset( $row['department'] );\n\n $row['work_group_id'] = $this->find( 'work_groups', $row['work_group']);\n unset( $row['work_group'] );\n\n $row['request_type_id'] = $this->find( 'request_types', $row['request_type']);\n unset( $row['request_type'] );\n\n $row['neighborhood_id'] = $this->find( 'neighborhoods', $row['neighborhood']);\n unset( $row['neighborhood'] );\n\n }" ]
[ "0.6188501", "0.61120784", "0.61120784", "0.6060745", "0.6006872", "0.5983826", "0.5898763", "0.5881204", "0.5864059", "0.5776346", "0.573751", "0.55342996", "0.55290204", "0.5498653", "0.5417125", "0.5414063", "0.5380241", "0.53649914", "0.53649914", "0.53271174", "0.5304725", "0.5289116", "0.5277096", "0.52770555", "0.52745205", "0.526017", "0.52439046", "0.52419084", "0.5215109", "0.5213456" ]
0.722858
0
Check value map mappings. 1. check if at least one is defined 2. check if value is numeric 3. check if mappend value is not empty string 4. check for duplicate values
function checkValueMapMappings(array $mappings) { if (empty($mappings)) { throw new Exception(_('Value mapping must have at least one mapping.')); } foreach ($mappings as $mapping) { if (zbx_empty($mapping['newvalue'])) { throw new Exception(_('Value cannot be mapped to empty string.')); } } $valueCount = array_count_values(zbx_objectValues($mappings, 'value')); foreach ($valueCount as $value => $count) { if ($count > 1) { throw new Exception(_s('Mapping value "%1$s" is not unique.', $value)); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filled_out($form_vars) {\n foreach ($form_vars as $key => $value) {\n if ((!isset($key)) || ($value == '')) {\n return false;\n }\n }\n return true;\n}", "function valExistence_check($postedID, $watuObj) {\r\n\r\n $errorVal = true;\r\n $valDoesExist = true;\r\n\r\n $valExistence = ['', '', '']; //might not work\r\n $valExistence[0] = get_post_meta($postedID, 'wpsl_certification_url1', true);\r\n $valExistence[1] = get_post_meta($postedID, 'wpsl_certification_url2', true);\r\n $valExistence[2] = get_post_meta($postedID, 'wpsl_certification_url3', true);\r\n\r\n if (!empty($valExistence[0]) || !empty($valExistence[1]) || !empty($valExistence[2])) {\r\n $valDoesExist = true;\r\n foreach ($watuObj as $val) {\r\n if (!in_array($val, $valExistence)) {\r\n if (empty($valExistence[0])) {\r\n if (($valExistence[1] != $val) && ($valExistence[2] != $val)) {\r\n $errorVal = update_post_meta($postedID, 'wpsl_certification_url1', $val);\r\n }\r\n } elseif (empty($valExistence[1])) {\r\n if (($valExistence[0] != $val) && ($valExistence[2] != $val)) {\r\n $errorVal = update_post_meta($postedID, 'wpsl_certification_url2', $val);\r\n }\r\n } elseif (empty($valExistence[2])) {\r\n if (($valExistence[0] != $val) && ($valExistence[1] != $val)) {\r\n $errorVal = update_post_meta($postedID, 'wpsl_certification_url3', $val);\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n $valDoesExist = false;\r\n }\r\n\r\n return $valDoesExist;\r\n}", "function filled_out($form_vars)\r\n{\r\n foreach ($form_vars as $key => $value)\r\n {\r\n if (!isset($key) || ($value == \"\"))\r\n return true;\r\n }\r\n return true;\r\n}", "function filled_out($forms){\n\t\tforeach ($forms as $key => $value) {\n\t\t\tif( (!isset($key)) || ($value == '') ){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private function numeric($map)\n\t{\n\t\tif(is_array($map[\"values\"]))\n\t\t{\n\t\t\t$valid = true;\n\t\t\t$filter_vals = array_filter($map[\"values\"], \"is_numeric\");\n\t\t\t$valid = (count($filter_vals) == count($map[\"values\"]));\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$valid = is_numeric($map[\"values\"]);\n\t\t}\n\t\t\n\t\tif(!$valid)\n\t\t{\n\t\t\t$this->errors[$map[\"id\"]] = $map[\"error\"];\n\t\t}\n\t\treturn $valid;\n\t}", "function filled_out($form_vars) {\n\t\t// test that if each variable has a value\n\t\tforeach ($form_vars as $key => $value) {\n\t\t\tif ((!isset($key)) || ($value == '')) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function hasOnlyDefaultValues()\n {\n if ($this->create_date !== '2021-06-07 11:49:57') {\n return false;\n }\n\n if ($this->last_update !== '2021-06-07 11:49:57') {\n return false;\n }\n\n if ($this->last_sync !== '1901-01-01 00:00:00') {\n return false;\n }\n\n if ($this->jml_jamban_l_g !== '0') {\n return false;\n }\n\n if ($this->jml_jamban_l_tg !== '0') {\n return false;\n }\n\n if ($this->jml_jamban_p_g !== '0') {\n return false;\n }\n\n if ($this->jml_jamban_p_tg !== '0') {\n return false;\n }\n\n if ($this->jml_jamban_lp_g !== '0') {\n return false;\n }\n\n if ($this->jml_jamban_lp_tg !== '0') {\n return false;\n }\n\n if ($this->tipe_jamban !== '9') {\n return false;\n }\n\n if ($this->a_sedia_pembalut !== '0') {\n return false;\n }\n\n if ($this->a_tempat_sampah_kelas !== '0') {\n return false;\n }\n\n if ($this->a_tempat_sampah_tutup_p !== '0') {\n return false;\n }\n\n if ($this->a_cermin_jamban_p !== '0') {\n return false;\n }\n\n if ($this->a_memiliki_tps !== '0') {\n return false;\n }\n\n if ($this->a_tps_angkut_rutin !== '0') {\n return false;\n }\n\n if ($this->a_anggaran_sanitasi !== '0') {\n return false;\n }\n\n if ($this->a_melibatkan_sanitasi_siswa !== '0') {\n return false;\n }\n\n // otherwise, everything was equal, so return true\n return true;\n }", "private function ignoreBlankValueFields($data){\n $arrData = array();\n if(!is_array($data)) return false;\n foreach($data as $valData => $value){\n if($value){\n foreach($value as $valSubKey => $val){\n if(trim($val) != \"\") $arrData[$valData][$valSubKey] = $val;\n }\n }\n }\n return $arrData;\n }", "function check_value($value) {\n\tif((@count($value)>0 and !@empty($value) and @isset($value)) || $value=='0') {\n\t\treturn true;\n\t}\n}", "function validate($input) {\n\t\t$values = array();\n\t\tforeach($input as $col => $value) {\n\t\t\tif($value != \"\") {\n\t\t\t\t$values[$col] = $value;\n\t\t\t}\n\t\t}\n\t\tif($values[\"instrument\"] == 0) {\n\t\t\tunset($values[\"instrument\"]);\n\t\t}\n\t\t\n\t\tparent::validate($values);\n\t}", "function is_complex_qinsert($parse_map,$table){\n $q_map = $parse_map;\n\n $valid_tbls = array();\n $valid_tbls = get_cols_table($table);\n\n foreach ($q_map as $tbl_name => $tbl_val) {\n # code..\n if(!in_array($tbl_name,$valid_tbls))\n {\n $is_complex = 1;\n return $is_complex;\n }\n }\n\n // handle special case\n $is_contain = false;\n $str = _query_insert_valid($query);\n if(stripos($str,\"values\")==TRUE)\n $is_contain = true;\n\n\n $is_complex = 0;\n\n // validating map\n $needles = array(\"values\",\"VALUES\",\"INTO\",\"into\",\"INSERT\",\"insert\",\"select\",\"SELECT\",\"union\",\"IN\",\"(\",\")\",\"OR\",\"<\",\">\");\n foreach ($q_map as $col => $value) { \n foreach($needles as $needle){\n $pattern ='#\\b'.$needle.'\\b#';\n if (preg_match($pattern,$value) || preg_match($pattern, $col)) { \n $is_complex=1; break; \n } \n }\n }\n\n if($is_contain)\n $is_complex = 1;\n \n return $is_complex ;\n }", "public function hasValues(){\n return $this->_has(1);\n }", "public function valueChecker($className, $memberName, $keyDetails, $value, &$uniqueValuesMap, $instanceNumber)\n\t{\n\t\t$detailsJO = array();\n \n\t\t$name = $keyDetails[Constants::NAME];\n\t\t\n\t\t$type = $keyDetails[Constants::TYPE];\n\n\t\t$varType = gettype($value);\n\n\t\t$test = function ($varType, $type) { if(strtolower($varType) == strtolower($type)){return true; } return false;};\n\n\t\t$check = $test($varType, $type);\n\n\t\tif(array_key_exists($type, Constants::DATA_TYPE))\n\t\t{\n\t\t\t$type = Constants::DATA_TYPE[$type];\n\n\t\t\tif(is_array($value) && count($value) > 0 && array_key_exists(Constants::STRUCTURE_NAME, $keyDetails))\n\t\t\t{\n\t\t\t\t$structureName = $keyDetails[Constants::STRUCTURE_NAME];\n\n\t\t\t\t$index = 0;\n\n\t\t\t\tforeach($value as $data)\n\t\t\t\t{\n\t\t\t\t\t$className = get_class($data);\n\n\t\t\t\t\t$check = $test($className, $structureName);\n\n\t\t\t\t\tif(!$check)\n\t\t\t\t\t{\n\t\t\t\t\t\t$instanceNumber = $index;\n\n\t\t\t\t\t\t$type = Constants::ARRAY_KEY . \"(\" . $structureName . \")\";\n\n\t\t\t\t\t\t$varType = Constants::ARRAY_KEY . \"(\" . $className . \")\";\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$index ++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$check = $test($varType, $type);\n\t\t\t}\n\t\t}\n\n\t\tif(strtolower($varType) == strtolower(Constants::OBJECT) || strtolower($type) == strtolower(Constants::OBJECT))\n\t\t{\n\t\t\tif(strtolower($type) == strtolower(Constants::OBJECT))\n\t\t\t{\n\t\t\t\t$check = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$className = get_class($value);\n\n\t\t\t\t$check = $test($className, $type);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!$check && $value != null)\n {\n $detailsJO[Constants::FIELD] = $memberName;\n \n $detailsJO[Constants::CLASS_KEY] = $className;\n \n $detailsJO[Constants::INDEX] = $instanceNumber;\n \n\t\t\t$detailsJO[Constants::EXPECTED_TYPE] = $type;\n\t\t\t\n\t\t\t$detailsJO[Constants::GIVEN_TYPE] = $varType;\n \n\t\t\tthrow new SDKException(Constants::TYPE_ERROR, null, $detailsJO, null);\n }\n \n\t\tif(array_key_exists(Constants::VALUES, $keyDetails) && (!array_key_exists(Constants::PICKLIST, $keyDetails) || ($keyDetails[Constants::PICKLIST] && Initializer::getInitializer()->getSDKConfig()->getPickListValidation())))\n\t\t{\n\t\t\t$valuesJA = $keyDetails[Constants::VALUES];\n\t\t\t\n\t\t\tif($value instanceof Choice)\n\t\t\t{\n\t\t\t\t$choice = $value;\n\t\t\t\t\n\t\t\t\t$value = $choice->getValue();\n\t\t\t}\n\t\t\t\n\t\t\tif(!in_array($value, $valuesJA))\n\t\t\t{\n\t\t\t $detailsJO[Constants::FIELD] = $memberName;\n\t\t\t\n\t\t\t $detailsJO[Constants::CLASS_KEY] = $className;\n\t\t\t\t\n\t\t\t\t$detailsJO[Constants::INDEX] = $instanceNumber;\n\t\t\t\t\n\t\t\t\t$detailsJO[Constants::GIVEN_VALUE] = $value;\n\t\t\t\t\n\t\t\t $detailsJO[Constants::ACCEPTED_VALUES] = $valuesJA;\n\t\t\t\t\n\t\t\t\tthrow new SDKException(Constants::UNACCEPTED_VALUES_ERROR, null, $detailsJO, null);\n\t\t\t}\n\t\t}\n\n\t\tif(array_key_exists(Constants::UNIQUE, $keyDetails))\n\t\t{\n\t\t\t$valuesArray = null;\n\n\t\t\tif(array_key_exists($name, $uniqueValuesMap))\n\t\t\t{\n\t\t\t\t$valuesArray = $uniqueValuesMap[$name];\n\t\t\t\n\t\t\t\tif($valuesArray != null && in_array($value, $valuesArray))\n\t\t\t\t{\n\t\t\t\t\t$detailsJO[Constants::FIELD] = $memberName;\n\t\t\t\t\t\n\t\t\t\t\t$detailsJO[Constants::CLASS_KEY] = $className;\n\t\t\t\t\t\n\t\t\t\t\t$detailsJO[Constants::FIRST_INDEX] = array_search($value, $valuesArray);\n\t\t\t\t\t\n\t\t\t\t\t$detailsJO[Constants::NEXT_INDEX] = $instanceNumber;\n\t\t\t\t\t\n\t\t\t\t\tthrow new SDKException(Constants::UNIQUE_KEY_ERROR, null , $detailsJO, null);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($valuesArray == null)\n\t\t\t\t{\n\t\t\t\t\t$valuesArray = array();\n\t\t\t\t}\n\n\t\t\t\t$valuesArray[] = $value;\n\t\t\t\t\n\t\t\t\t$uniqueValuesMap[$name] = $valuesArray;\n\t\t\t}\n\t\t}\n\n\t\tif(array_key_exists(Constants::MIN_LENGTH, $keyDetails) || array_key_exists(Constants::MAX_LENGTH, $keyDetails))\n\t\t{\n\t\t\t$count = 0;\n\t\t\t\n\t\t\tif(is_array($value))\n\t\t\t{\n\t\t\t\t$count = count($value);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$count = strlen($value);\n\t\t\t}\n\n\t\t if(array_key_exists(Constants::MAX_LENGTH, $keyDetails) && $count > $keyDetails[Constants::MAX_LENGTH])\n\t\t\t{\n\t\t\t $detailsJO[Constants::FIELD] = $memberName;\n\t\t\t \n\t\t\t $detailsJO[Constants::CLASS_KEY] = $className;\n\t\t\t \n\t\t\t $detailsJO[Constants::GIVEN_LENGTH] = $count;\n\t\t\t \n\t\t\t $detailsJO[Constants::MAXIMUM_LENGTH] = $keyDetails[Constants::MAX_LENGTH];\n\t\t\t\t\n\t\t\t throw new SDKException(Constants::MAXIMUM_LENGTH_ERROR, null, $detailsJO, null);\n\t\t\t}\n\t\t\t\n\t\t\tif(array_key_exists(Constants::MIN_LENGTH, $keyDetails) && $count < $keyDetails[Constants::MIN_LENGTH])\n\t\t\t{\n\t\t\t $detailsJO[Constants::FIELD] = $memberName;\n\t\t\t \n\t\t\t $detailsJO[Constants::CLASS_KEY] = $className;\n\t\t\t \n\t\t\t $detailsJO[Constants::GIVEN_LENGTH] = $count;\n\t\t\t\t\n\t\t\t $detailsJO[Constants::MINIMUM_LENGTH] = $keyDetails[Constants::MIN_LENGTH];\n\t\t\t\t\n\t\t\t\tthrow new SDKException(Constants::MINIMUM_LENGTH_ERROR, null, $detailsJO, null);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(array_key_exists(Constants::REGEX, $keyDetails))\n\t\t{\n\t\t if (!preg_match($keyDetails[Constants::REGEX], $value))\n\t\t\t{\n\t\t\t $detailsJO[Constants::FIELD] = $memberName;\n\t\t\t \n\t\t\t $detailsJO[Constants::CLASS_KEY] = $className;\n\t\t\t\t\n\t\t\t $detailsJO[Constants::INSTANCE_NUMBER] = $instanceNumber;\n\t\t\t\t\n\t\t\t\tthrow new SDKException(Constants::REGEX_MISMATCH_ERROR, null, $detailsJO, null);\n\t\t\t}\n }\n \n return true;\n\t}", "public function hasOnlyDefaultValues()\n {\n if ($this->phadtype !== '') {\n return false;\n }\n\n if ($this->phadid !== '') {\n return false;\n }\n\n if ($this->phadsubid !== '') {\n return false;\n }\n\n if ($this->phadsubidseq !== 0) {\n return false;\n }\n\n if ($this->phadcont !== '') {\n return false;\n }\n\n // otherwise, everything was equal, so return TRUE\n return true;\n }", "public function hasOnlyDefaultValues()\n {\n if ($this->shnttype !== '') {\n return false;\n }\n\n if ($this->shntseq !== 0) {\n return false;\n }\n\n if ($this->shntkey2 !== '') {\n return false;\n }\n\n if ($this->shntform !== '') {\n return false;\n }\n\n // otherwise, everything was equal, so return TRUE\n return true;\n }", "function has_value($value){\r\n\t\treturn isset($value) && $value !==\"\";\r\n\t}", "public function hasValues($key)\n {\n $all = is_array($key) ? $key : array($key);\n foreach($all as $key) {\n if(!isset($this->values[$key]) || $this->values[$key] === '') {\n return false;\n }\n }\n return true;\n }", "public function isMultivalue();", "function checkduplicatetypefield()\n\t{\n\n\t\t$check = $this->base_model->fetch_records_from(TBL_SETTINGS_FIELDS,array('field_name' => $this->input->post('field_name'), 'sms_gateway_id' => $this->input->post('sms_gateway_id')));\t\t\n\t\tif (count($check) == 0 && $this->input->post('id') == '') {\n\t\t return true;\n\t\t} elseif((count($check) >= 1 || count($check) == 0)&& $this->input->post('id') != '') {\n\t\t\treturn true;\n\t\t}else {\n\t\t $this->form_validation->set_message('checkduplicatetypefield', $this->phrases['duplicate']);\n\t\t return false;\n\t\t}\n\t}", "function checkEmptyFields($custInfo) { \n $errorMessageIfEmpty = array(\n \"CustFirstName\" => \"First name is empty\",\n \"CustLastName\" => \"Last name is empty\",\n \"CustAddress\" => \"Address is required\",\n \"CustCity\" => \"City field is empty\",\n \"CustProv\" => \"Province field is empty\",\n \"CustPostal\" => \"Postal Code is empty\",\n \"CustCountry\" => \"Country field is empty\",\n \"CustHomePhone\" => \"Home phone number is required\",\n \"CustBusPhone\" => \"Bus/Cell phone number is required\",\n \"CustEmail\" => \"Please enter your email\",\n \"username\" => \"Username field is empty\",\n \"password\" => \"Password field is empty\"\n );\n \n $actualErrors = array();\n \n foreach($custInfo as $key => $value) {\n if(array_key_exists($key, $errorMessageIfEmpty)) {\n if(trim($value) == \"\") {\n $actualErrors[$key] = $errorMessageIfEmpty[$key];\n } \n }\n } \n return $actualErrors;\n }", "public function hasField($key){ return !empty($this->field_map[$key]); }", "private static function betterEmpty($value)\n {\n return empty($value) && !is_numeric($value);\n }", "public function hasValues() {\n return $this->_has(3);\n }", "public function hasValues() {\n return $this->_has(2);\n }", "function isNoEmptyVariable($tableauPost) {\n $tableau = array();\n foreach ($tableauPost as $key => $value) {\n if (!empty($tableauPost[$key])) {\n $tableau[] = $value;\n }\n\n }\n /* displayArray('arrayInitial',$tableauPost);\n displayArray('arrayFinal',$tableau);*/\n\n if (count($tableauPost) != count($tableau)) {\n return false;\n }\n else {\n return true;\n }\n}", "function issetandfilled($data) {\n if (!isset($data))\n return false;\n\n if (empty(trim($data)))\n return false;\n \n return true;\n}", "public function hasMultipleValues(): bool\n {\n return $this->countNodeArrayValue() > 1;\n }", "function validate_all($required, $data)\n{\n $result = array();\n $result['code'] = 1;\n $result['error'] = \"All OK!\";\n if (count(array_intersect_key($required, $data)) != count($required)) {\n $result['code'] = 0;\n $result['error'] = \"Fields Mismatch!\";\n return $result;\n }\n foreach ($required as $field => $rules) {\n $value = trim($data[$field]);\n $code = 0;\n $error = \"\";\n switch ($rules['type']) {\n case 'numeric':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!is_numeric($value)) {\n $error = $field . \" is not numeric.\";\n } else if (isset($rules['min'])) {\n if ($value < $rules['min']) {\n $error = $field . \" min error.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n } else if (isset($rules['max'])) {\n if ($value > $rules['max']) {\n $error = $field . \" max error.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alpha':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alpha_space':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z ]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alphanumeric':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z0-9]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alphanumeric_space':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z0-9 ]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'email':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match($rules['pattern'], $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'pattern':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match($rules['pattern'], $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'any':\n # code...\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n }\n $result['fields'][$field] = array('code' => $code, 'error' => $error, 'value' => $value, 'field' => $field);\n }\n foreach ($result['fields'] as $row) {\n if ($row[\"code\"] == 0) {\n $result['code'] = 0;\n $result['error'] = $row['error'];\n break;\n }\n }\n return $result;\n}", "protected function valueContainsAdd()\n {\n return (preg_match('/\\+/', $this->condition->value) == 1);\n }", "private function value_exists( $key ) {\n\t\treturn ! empty( $_POST[ $key ] );\n\t}" ]
[ "0.554733", "0.5492197", "0.5414013", "0.53973025", "0.53821963", "0.5349117", "0.5315619", "0.5308529", "0.5282117", "0.52124494", "0.5180297", "0.51794386", "0.5173847", "0.5155307", "0.5143801", "0.5118988", "0.5112995", "0.5111647", "0.51092476", "0.5087512", "0.50378", "0.49965948", "0.49860546", "0.4984826", "0.49763796", "0.4974714", "0.49689156", "0.49622878", "0.49545765", "0.49492082" ]
0.6053362
0
Rewrite value map mappings.
function rewriteValueMapMappings($valueMapId, array $mappings) { $dbValueMaps = getValueMapMappings($valueMapId); $mappingsToAdd = array(); $mappingsToUpdate = array(); foreach ($mappings as $mapping) { if (!isset($mapping['mappingid'])) { $mappingsToAdd[] = $mapping; } elseif (isset($dbValueMaps[$mapping['mappingid']])) { $mappingsToUpdate[] = $mapping; unset($dbValueMaps[$mapping['mappingid']]); } } if (!empty($dbValueMaps)) { $dbMappingIds = zbx_objectValues($dbValueMaps, 'mappingid'); deleteValueMapMappings($dbMappingIds); } if (!empty($mappingsToAdd)) { addValueMapMappings($valueMapId, $mappingsToAdd); } if (!empty($mappingsToUpdate)) { updateValueMapMappings($mappingsToUpdate); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateValueMapMappings(array $mappings) {\n\tforeach ($mappings as &$mapping) {\n\t\t$mappingid = $mapping['mappingid'];\n\t\tunset($mapping['mappingid']);\n\n\t\tDB::update('mappings', array(\n\t\t\t'values' => $mapping,\n\t\t\t'where' => array('mappingid' => $mappingid)\n\t\t));\n\t}\n\tunset($mapping);\n}", "function applyValueMap($value, $valueMapId) {\n\t$mapping = getMappedValue($value, $valueMapId);\n\n\treturn ($mapping === false) ? $value : $mapping.' ('.$value.')';\n}", "function getValueMapMappings($valueMapId) {\n\t$mappings = array();\n\n\t$dbMappings = DBselect(\n\t\t'SELECT m.mappingid,m.value,m.newvalue'.\n\t\t' FROM mappings m'.\n\t\t' WHERE m.valuemapid='.zbx_dbstr($valueMapId).\n\t\t\t' '.andDbNode('m.mappingid')\n\t);\n\twhile ($mapping = DBfetch($dbMappings)) {\n\t\t$mappings[$mapping['mappingid']] = $mapping;\n\t}\n\n\treturn $mappings;\n}", "function convertValueFieldKeys()\n {\n foreach ($this->vars as $key => $val) {\n if (substr($key, -6) == '_value') {\n $this->vars[substr($key, 0, -6)] = $val;\n unset($this->vars[$key]);\n }\n }\n }", "function updateValueMap(array $valueMap, array $mappings) {\n\t$mappings = cleanValueMapMappings($mappings);\n\tcheckValueMapMappings($mappings);\n\n\t$valueMapId = $valueMap['valuemapid'];\n\tunset($valueMap['valuemapid']);\n\n\t// check existence\n\t$sql = 'SELECT v.valuemapid FROM valuemaps v WHERE v.valuemapid='.zbx_dbstr($valueMapId).' '.andDbNode('v.valuemapid');\n\tif (!DBfetch(DBselect($sql))) {\n\t\tthrow new Exception(_s('Value map with valuemapid \"%1$s\" does not exist.', $valueMapId));\n\t}\n\n\t// check duplicate name\n\t$dbValueMap = DBfetch(DBselect(\n\t\t'SELECT v.valuemapid'.\n\t\t' FROM valuemaps v'.\n\t\t' WHERE v.name='.zbx_dbstr($valueMap['name']).\n\t\t\t' '.andDbNode('v.valuemapid')\n\t));\n\tif ($dbValueMap && bccomp($valueMapId, $dbValueMap['valuemapid']) != 0) {\n\t\tthrow new Exception(_s('Value map \"%1$s\" already exists.', $valueMap['name']));\n\t}\n\n\trewriteValueMapMappings($valueMapId, $mappings);\n\n\tDB::update('valuemaps', array(\n\t\t'values' => $valueMap,\n\t\t'where' => array('valuemapid' => $valueMapId)\n\t));\n}", "function addValueMapMappings($valueMapId, array $mappings) {\n\tforeach ($mappings as &$mapping) {\n\t\t$mapping['valuemapid'] = $valueMapId;\n\t}\n\tunset($mapping);\n\n\tDB::insert('mappings', $mappings);\n}", "public function setMapValue($name=null);", "abstract protected function defineMapping();", "public function setMap($value)\n {\n $this->map = $value;\n }", "function cleanValueMapMappings(array $mappings) {\n\t$cleanedMappings = $mappings;\n\n\tforeach ($cleanedMappings as $key => $mapping) {\n\t\tif (zbx_empty($mapping['value']) && zbx_empty($mapping['newvalue'])) {\n\t\t\tunset($cleanedMappings[$key]);\n\t\t}\n\t}\n\n\treturn $cleanedMappings;\n}", "public static function map($key, $value = null)\n {\n if (is_array($key)) {\n foreach ($key as $k => $v) {\n self::map($k, $v);\n }\n }\n\n if (is_scalar($key) && !empty($value)) {\n self::$map[$key] = $value;\n }\n }", "public function set_field_map( $name, $value ) {\n\t\t$this->import[ $name ] = $value;\n\t}", "abstract protected function buildMap();", "protected abstract function map();", "public static function mapValues($attendee){\n $mapped_values = array(\n 'event_id' => $attendee->eventId,\n 'order_id' => $attendee->orderId,\n 'attendee_id' => $attendee->attendeeId,\n 'ticket_class_id' => $attendee->ticketClassId,\n 'change_date' => $attendee->changeDate,\n 'create_date' => $attendee->createDate,\n 'email_address' => $attendee->emailAddress,\n 'last_name' => self::no_overflow($attendee->lastName,50),\n 'first_name' => self::no_overflow($attendee->firstName,50),\n 'category' => $attendee->category,\n 'category_nid' => $attendee->categoryNid,\n 'order_type' => $attendee->orderType,\n 'email_sent' => $attendee->emailSent,\n 'email_send_date' => $attendee->emailSendDate,\n 'reg_type' => $attendee->regType,\n 'region_name' => $attendee->regionName,\n 'region_nid' => $attendee->regionNid,\n 'contestant_last_name' => self::no_overflow($attendee->contestantLastName,50),\n 'contestant_first_name' => self::no_overflow($attendee->contestantFirstName,50),\n 'gender' => $attendee->gender,\n 'grade' => $attendee->grade,\n 'school' => self::no_overflow($attendee->school,255),\n 'year_of_birth' => $attendee->yearOfBirth,\n 'month_of_birth' => $attendee->monthOfBirth,\n 'day_of_birth' => $attendee->dayOfBirth,\n 'home_address_line_1' => self::no_overflow($attendee->homeAddressLine1,255),\n 'home_address_line_2' => self::no_overflow($attendee->homeAddressLine2,255),\n 'home_city' => self::no_overflow($attendee->homeCity,100),\n 'home_prov_state' => $attendee->homeProvState,\n 'home_postal_zip' => self::no_overflow($attendee->homePostalZip,20),\n 'home_phone_1' => self::no_overflow($attendee->homePhone1, 20),\n 'home_phone_2' => self::no_overflow($attendee->homePhone2, 20),\n 'email_consent' => $attendee->emailConsent,\n 'additional_info' => self::no_overflow($attendee->additionalInfo,2500),\n 'language' => $attendee->language,\n );\n\n // _eventbrite_sboc_debug_output($attendee);\n if (isset($attendee->passwordResetUrl)){\n $mapped_values['password_reset_url'] = $attendee->passwordResetUrl;\n }\n\n return $mapped_values;\n }", "function getMappedValue($value, $valueMapId) {\n\tstatic $valueMaps = array();\n\n\tif ($valueMapId < 1) {\n\t\treturn false;\n\t}\n\n\tif (isset($valueMaps[$valueMapId][$value])) {\n\t\treturn $valueMaps[$valueMapId][$value];\n\t}\n\n\t$dbMappings = DBselect(\n\t\t'SELECT m.newvalue'.\n\t\t' FROM mappings m'.\n\t\t' WHERE m.valuemapid='.zbx_dbstr($valueMapId).\n\t\t\t' AND m.value='.zbx_dbstr($value).\n\t\t\t' '.andDbNode('m.mappingid')\n\t);\n\tif ($mapping = DBfetch($dbMappings)) {\n\t\t$valueMaps[$valueMapId][$value] = $mapping['newvalue'];\n\n\t\treturn $mapping['newvalue'];\n\t}\n\n\treturn false;\n}", "private function prepareDynamicMapping() {\n foreach ($this->getFieldMaping() as $field_mapping) {\n if ($this->isTranslatableField($field_mapping)) {\n\n $default_language_source = NULL;\n foreach ($this->getLanguages() as $language) {\n if ($language == NexteuropaNewsroomHelper::getDefaultLanguageUppercase()) {\n $default_language_source = $this->getXpathString();\n }\n else {\n $this->addNewsroomDefaultValueTamper($default_language_source);\n }\n\n if (!empty($field_mapping['query'])) {\n $this->addTranslatableQuery($field_mapping['query'], $language);\n }\n\n $this->addMapper($field_mapping, $language);\n }\n\n }\n else {\n $this->addTampers($field_mapping);\n if (!empty($field_mapping['query'])) {\n $this->addQuery($field_mapping['query']);\n }\n\n $this->addMapper($field_mapping);\n }\n }\n\n }", "private function prepareResultMap() {\n $resultMap = [];\n foreach ($this->encodings as $encoding) {\n $map = \"_\" . $encoding . \"Map\";\n foreach ($this->$map as $ru => $fo) {\n $resultMap[$ru][] = $fo;\n }\n }\n $this->_resultMap = $resultMap;\n }", "public function setMap( $value ) {\n $this->map = $value;\n return $this;\n }", "function addValueMap(array $valueMap, array $mappings) {\n\t$mappings = cleanValueMapMappings($mappings);\n\tcheckValueMapMappings($mappings);\n\n\t// check duplicate name\n\t$sql = 'SELECT v.valuemapid'.\n\t\t\t' FROM valuemaps v'.\n\t\t\t' WHERE v.name='.zbx_dbstr($valueMap['name']).\n\t\t\t' '.andDbNode('v.valuemapid');\n\tif (DBfetch(DBselect($sql))) {\n\t\tthrow new Exception(_s('Value map \"%1$s\" already exists.', $valueMap['name']));\n\t}\n\n\t$valueMapIds = DB::insert('valuemaps', array($valueMap));\n\t$valueMapId = reset($valueMapIds);\n\n\taddValueMapMappings($valueMapId, $mappings);\n}", "final public function set($key,$value):Main\\Map\n {\n $this->checkAllowed('set')->checkBefore(false,$value);\n $return = $this->onPrepareThis('set');\n $key = $this->onPrepareKey($key);\n $value = $this->onPrepareValueSet($value);\n Base\\Arrs::setRef($key,$value,$return->arr(),$this->isSensitive());\n\n return $return->checkAfter();\n }", "public function replaceMap() : self\n {\n // Map enums key and value pairs only if enums have values\n if ($this->enumsHaveValues()) {\n $mapStub = file_get_contents(__DIR__ . '/../stubs/map.stub');\n $this->stub = str_replace('DummyMap', $mapStub, $this->stub);\n $this->replaceMapPairs();\n } else {\n $this->stub = str_replace('DummyMap', '', $this->stub);\n }\n\n return $this;\n }", "protected function mapValues($fieldName, $config, &$record)\n {\n foreach ($config['values'] as $sourceValue => $targetValue) {\n if ($record[$fieldName] == $sourceValue) {\n $record[$config['targetField']] = $targetValue;\n }\n }\n }", "function siteorigin_panels_wp_import_post_meta_map($val) {\n\tif(is_string($val)) return str_replace('<<<br>>>', \"\\n\", $val);\n\telse return array_map('siteorigin_panels_wp_import_post_meta_map', $val);\n}", "private function mapProperties(): void\n {\n $this->properties = Collect::keyBy($this->collection->getProperties()->getValues(), 'identifier');\n }", "private function setupMapping()\n {\n $this->mapping = array();\n $fields = array();\n\n $aliases = array_keys($this->getJoinSettings());\n\n foreach ($aliases as $i => $alias) {\n $fields = array_merge($fields, $this->mapAlias($alias));\n }\n\n $this->mapping['fields'] = array_replace_recursive($fields, $this->getCustomMapping());\n $this->mapping['joins'] = $this->getJoinSettings();\n }", "public function rebuildFromBase( EntityMap $map ): void {\n $current = clone $this;\n\n $this->key = $map->key;\n if ( $current->key !== null ) {\n $this->key = $current->key;\n }\n\n $this->inboundMap = array_merge( $map->inboundMap, $current->inboundMap );\n $this->outboundMap = $map->outboundMap;\n foreach ( $current->outboundMap as $propName => $mapping ) {\n if ( is_string( $mapping ) ) {\n $this->outboundMap[$propName] = $mapping;\n continue;\n }\n\n $baseMapping = array_key_exists( $propName, $map->outboundMap )? $map->outboundMap[$propName] : [];\n $this->outboundMap[$propName] = array_merge( $baseMapping, $mapping );\n }\n\n unset( $current );\n }", "abstract protected function encode($map);", "static function remap($src, $remap){\n\t\tforeach($remap as $k=>$v){\n\t\t\t$dest[$v] = $src[$k];\n\t\t\tunset($src[$k]);\n\t\t}\n\t\treturn array_merge($src,$dest);\n\t}", "public abstract function toMap(): array;" ]
[ "0.6363831", "0.63501376", "0.62233645", "0.61827135", "0.606236", "0.60150653", "0.58843", "0.58351624", "0.5713463", "0.5638377", "0.56364393", "0.56329006", "0.5621672", "0.56185997", "0.5558779", "0.5504929", "0.54890156", "0.54697746", "0.54659724", "0.54304856", "0.5414559", "0.53786486", "0.53056526", "0.5265658", "0.52584076", "0.52490425", "0.5239464", "0.5237677", "0.5225194", "0.52135015" ]
0.6656703
0
Add new mappings to value map.
function addValueMapMappings($valueMapId, array $mappings) { foreach ($mappings as &$mapping) { $mapping['valuemapid'] = $valueMapId; } unset($mapping); DB::insert('mappings', $mappings); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addMapping($key, $value)\n {\n $this->mappings[] = array($key, $value);\n }", "function addValueMap(array $valueMap, array $mappings) {\n\t$mappings = cleanValueMapMappings($mappings);\n\tcheckValueMapMappings($mappings);\n\n\t// check duplicate name\n\t$sql = 'SELECT v.valuemapid'.\n\t\t\t' FROM valuemaps v'.\n\t\t\t' WHERE v.name='.zbx_dbstr($valueMap['name']).\n\t\t\t' '.andDbNode('v.valuemapid');\n\tif (DBfetch(DBselect($sql))) {\n\t\tthrow new Exception(_s('Value map \"%1$s\" already exists.', $valueMap['name']));\n\t}\n\n\t$valueMapIds = DB::insert('valuemaps', array($valueMap));\n\t$valueMapId = reset($valueMapIds);\n\n\taddValueMapMappings($valueMapId, $mappings);\n}", "private function addMapArguments($key, $value)\n\t{\n\t\t$this->_mapArguments[$key] = $value;\n\t}", "public function appendMapping(\\service\\message\\common\\KeyValueItem $value)\n {\n return $this->append(self::mapping, $value);\n }", "public function setMap($value)\n {\n $this->map = $value;\n }", "public function add_value($key, $value){\r\n\t\t$this->_entries[$key] = array('v', $value);\r\n\t}", "function getValueMapMappings($valueMapId) {\n\t$mappings = array();\n\n\t$dbMappings = DBselect(\n\t\t'SELECT m.mappingid,m.value,m.newvalue'.\n\t\t' FROM mappings m'.\n\t\t' WHERE m.valuemapid='.zbx_dbstr($valueMapId).\n\t\t\t' '.andDbNode('m.mappingid')\n\t);\n\twhile ($mapping = DBfetch($dbMappings)) {\n\t\t$mappings[$mapping['mappingid']] = $mapping;\n\t}\n\n\treturn $mappings;\n}", "function set($key, $newvalue) {\n\t\t$this->valuemap[$key]= $newvalue;\n\t}", "public function setMaps($value)\n {\n $this->maps = $value;\n }", "public function setMap( $value ) {\n $this->map = $value;\n return $this;\n }", "function updateValueMap(array $valueMap, array $mappings) {\n\t$mappings = cleanValueMapMappings($mappings);\n\tcheckValueMapMappings($mappings);\n\n\t$valueMapId = $valueMap['valuemapid'];\n\tunset($valueMap['valuemapid']);\n\n\t// check existence\n\t$sql = 'SELECT v.valuemapid FROM valuemaps v WHERE v.valuemapid='.zbx_dbstr($valueMapId).' '.andDbNode('v.valuemapid');\n\tif (!DBfetch(DBselect($sql))) {\n\t\tthrow new Exception(_s('Value map with valuemapid \"%1$s\" does not exist.', $valueMapId));\n\t}\n\n\t// check duplicate name\n\t$dbValueMap = DBfetch(DBselect(\n\t\t'SELECT v.valuemapid'.\n\t\t' FROM valuemaps v'.\n\t\t' WHERE v.name='.zbx_dbstr($valueMap['name']).\n\t\t\t' '.andDbNode('v.valuemapid')\n\t));\n\tif ($dbValueMap && bccomp($valueMapId, $dbValueMap['valuemapid']) != 0) {\n\t\tthrow new Exception(_s('Value map \"%1$s\" already exists.', $valueMap['name']));\n\t}\n\n\trewriteValueMapMappings($valueMapId, $mappings);\n\n\tDB::update('valuemaps', array(\n\t\t'values' => $valueMap,\n\t\t'where' => array('valuemapid' => $valueMapId)\n\t));\n}", "public function appended(mixed $key, mixed $value): NonEmptyMap;", "public function addUserMap(\\EncryptServer\\Protocol\\Vipadmin\\ldap_field_map $value)\n {\n if ($this->user_map === null) {\n $this->user_map = new \\Protobuf\\MessageCollection();\n }\n\n $this->user_map->add($value);\n }", "function updateValueMapMappings(array $mappings) {\n\tforeach ($mappings as &$mapping) {\n\t\t$mappingid = $mapping['mappingid'];\n\t\tunset($mapping['mappingid']);\n\n\t\tDB::update('mappings', array(\n\t\t\t'values' => $mapping,\n\t\t\t'where' => array('mappingid' => $mappingid)\n\t\t));\n\t}\n\tunset($mapping);\n}", "public function set_field_map( $name, $value ) {\n\t\t$this->import[ $name ] = $value;\n\t}", "public static function map($key, $value = null)\n {\n if (is_array($key)) {\n foreach ($key as $k => $v) {\n self::map($k, $v);\n }\n }\n\n if (is_scalar($key) && !empty($value)) {\n self::$map[$key] = $value;\n }\n }", "abstract protected function defineMapping();", "public function setMapValue($name=null);", "public function addMap(array $map)\n {\n $this->_map = array_merge($this->_map, $map);\n return $this;\n }", "public function Add($key, $value)\n {\n $this->Remove($key);\n $this->_keyValPairs[$key] = $value;\n }", "abstract protected function buildMap();", "public function setAttributeMappings(?array $value): void {\n $this->getBackingStore()->set('attributeMappings', $value);\n }", "public function mergeWith(Map $entries): Map\n {\n return $this->setEntries($entries->asArray() + $this->asArray());\n }", "public static function put($key, $value)\n {\n self::$map[$key] = $value;\n }", "function rewriteValueMapMappings($valueMapId, array $mappings) {\n\t$dbValueMaps = getValueMapMappings($valueMapId);\n\n\t$mappingsToAdd = array();\n\t$mappingsToUpdate = array();\n\tforeach ($mappings as $mapping) {\n\t\tif (!isset($mapping['mappingid'])) {\n\t\t\t$mappingsToAdd[] = $mapping;\n\t\t}\n\t\telseif (isset($dbValueMaps[$mapping['mappingid']])) {\n\t\t\t$mappingsToUpdate[] = $mapping;\n\t\t\tunset($dbValueMaps[$mapping['mappingid']]);\n\t\t}\n\t}\n\n\tif (!empty($dbValueMaps)) {\n\t\t$dbMappingIds = zbx_objectValues($dbValueMaps, 'mappingid');\n\t\tdeleteValueMapMappings($dbMappingIds);\n\t}\n\n\tif (!empty($mappingsToAdd)) {\n\t\taddValueMapMappings($valueMapId, $mappingsToAdd);\n\t}\n\n\tif (!empty($mappingsToUpdate)) {\n\t\tupdateValueMapMappings($mappingsToUpdate);\n\t}\n}", "public function add($key, $value)\n\t{\n\t\tif ($this->hasKey($key))\n\t\t{\n\t\t\tthrow new \\Exception('Element '.$key.' already exists in Map');\n\t\t}\n\n\t\t$this->set($key, $value);\n\t}", "public function setValue($key, $value)\n {\n $this->map[$key] = $value;\n }", "protected function _dictionary_add($s_value)\r\n {\r\n if(!isset($this->a_dictionary[$s_value]))\r\n $this->a_dictionary[$s_value] = true;\r\n }", "public function addSingleMapping($src, $dst) {}", "public function addItem($key, $value);" ]
[ "0.73182076", "0.669279", "0.6224705", "0.60660446", "0.5949096", "0.591477", "0.5786055", "0.5690248", "0.568357", "0.56457406", "0.5631266", "0.55204934", "0.5512744", "0.55067956", "0.5459984", "0.5445905", "0.53500444", "0.53463924", "0.5346215", "0.53440773", "0.53285074", "0.53199804", "0.5296748", "0.52893585", "0.5286384", "0.5279611", "0.5232182", "0.5159367", "0.5137386", "0.50935364" ]
0.7024002
1
Update value map mappings.
function updateValueMapMappings(array $mappings) { foreach ($mappings as &$mapping) { $mappingid = $mapping['mappingid']; unset($mapping['mappingid']); DB::update('mappings', array( 'values' => $mapping, 'where' => array('mappingid' => $mappingid) )); } unset($mapping); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateValueMap(array $valueMap, array $mappings) {\n\t$mappings = cleanValueMapMappings($mappings);\n\tcheckValueMapMappings($mappings);\n\n\t$valueMapId = $valueMap['valuemapid'];\n\tunset($valueMap['valuemapid']);\n\n\t// check existence\n\t$sql = 'SELECT v.valuemapid FROM valuemaps v WHERE v.valuemapid='.zbx_dbstr($valueMapId).' '.andDbNode('v.valuemapid');\n\tif (!DBfetch(DBselect($sql))) {\n\t\tthrow new Exception(_s('Value map with valuemapid \"%1$s\" does not exist.', $valueMapId));\n\t}\n\n\t// check duplicate name\n\t$dbValueMap = DBfetch(DBselect(\n\t\t'SELECT v.valuemapid'.\n\t\t' FROM valuemaps v'.\n\t\t' WHERE v.name='.zbx_dbstr($valueMap['name']).\n\t\t\t' '.andDbNode('v.valuemapid')\n\t));\n\tif ($dbValueMap && bccomp($valueMapId, $dbValueMap['valuemapid']) != 0) {\n\t\tthrow new Exception(_s('Value map \"%1$s\" already exists.', $valueMap['name']));\n\t}\n\n\trewriteValueMapMappings($valueMapId, $mappings);\n\n\tDB::update('valuemaps', array(\n\t\t'values' => $valueMap,\n\t\t'where' => array('valuemapid' => $valueMapId)\n\t));\n}", "function set($key, $newvalue) {\n\t\t$this->valuemap[$key]= $newvalue;\n\t}", "function rewriteValueMapMappings($valueMapId, array $mappings) {\n\t$dbValueMaps = getValueMapMappings($valueMapId);\n\n\t$mappingsToAdd = array();\n\t$mappingsToUpdate = array();\n\tforeach ($mappings as $mapping) {\n\t\tif (!isset($mapping['mappingid'])) {\n\t\t\t$mappingsToAdd[] = $mapping;\n\t\t}\n\t\telseif (isset($dbValueMaps[$mapping['mappingid']])) {\n\t\t\t$mappingsToUpdate[] = $mapping;\n\t\t\tunset($dbValueMaps[$mapping['mappingid']]);\n\t\t}\n\t}\n\n\tif (!empty($dbValueMaps)) {\n\t\t$dbMappingIds = zbx_objectValues($dbValueMaps, 'mappingid');\n\t\tdeleteValueMapMappings($dbMappingIds);\n\t}\n\n\tif (!empty($mappingsToAdd)) {\n\t\taddValueMapMappings($valueMapId, $mappingsToAdd);\n\t}\n\n\tif (!empty($mappingsToUpdate)) {\n\t\tupdateValueMapMappings($mappingsToUpdate);\n\t}\n}", "function addValueMapMappings($valueMapId, array $mappings) {\n\tforeach ($mappings as &$mapping) {\n\t\t$mapping['valuemapid'] = $valueMapId;\n\t}\n\tunset($mapping);\n\n\tDB::insert('mappings', $mappings);\n}", "public static function updateMapping()\n {\n $db = static::getDb();\n $command = $db->createCommand();\n $command->setMapping(static::index(), static::type(), static::mapping());\n }", "public function setMap($value)\n {\n $this->map = $value;\n }", "public function set_field_map( $name, $value ) {\n\t\t$this->import[ $name ] = $value;\n\t}", "public static function updateMapping(){\r\n $db = self::getDb();\r\n $command = $db->createCommand();\r\n\t\tif(!$command->indexExists(self::index())){\r\n\t\t\t$command->createIndex(self::index());\r\n\t\t}\r\n $command->setMapping(self::index(), self::type(), self::mapping());\r\n }", "public function update()\n {\n $this->updateTemplates();\n $this->updateMappings();\n }", "function getValueMapMappings($valueMapId) {\n\t$mappings = array();\n\n\t$dbMappings = DBselect(\n\t\t'SELECT m.mappingid,m.value,m.newvalue'.\n\t\t' FROM mappings m'.\n\t\t' WHERE m.valuemapid='.zbx_dbstr($valueMapId).\n\t\t\t' '.andDbNode('m.mappingid')\n\t);\n\twhile ($mapping = DBfetch($dbMappings)) {\n\t\t$mappings[$mapping['mappingid']] = $mapping;\n\t}\n\n\treturn $mappings;\n}", "public function updateMappings()\n {\n /** @var ClassMetadata[] $metadatas */\n $metadatas = $this->sm->getMetadataFactory()->getAllMetadata();\n\n // Refresh all the mappings\n foreach ($metadatas as $metadata) {\n // if we're in the dev env, set the number of replicas to be 0\n if ($this->env == 'dev' || $this->env == 'test_local') {\n $metadata->numberOfReplicas = 0;\n }\n\n // create the index if it doesn't exist yet\n $indexName = $metadata->timeSeriesScale ? $metadata->getCurrentTimeSeriesIndex() : $metadata->index;\n /** @var Index $index */\n $index = $this->client->getIndex($indexName);\n if (!$index->exists()) {\n $this->client->createIndex($indexName, $metadata->getSettings());\n }\n\n // create the type if it doesn't exist yet\n if ($metadata->type) {\n $type = new Type($index, $metadata->type);\n if (!$type->exists()) {\n $this->client->createType($metadata);\n }\n\n // update the mapping\n $result = $this->client->updateMapping($metadata);\n if (true !== $result) {\n echo \"Warning: Failed to update mapping for index '$indexName', type '$metadata->type'. Reason: $result\\n\";\n }\n }\n }\n }", "public function setValue($key, $value)\n {\n $this->map[$key] = $value;\n }", "public function update() {\r\n\t\t$this->getMapper()->update($this);\r\n\t}", "function addValueMap(array $valueMap, array $mappings) {\n\t$mappings = cleanValueMapMappings($mappings);\n\tcheckValueMapMappings($mappings);\n\n\t// check duplicate name\n\t$sql = 'SELECT v.valuemapid'.\n\t\t\t' FROM valuemaps v'.\n\t\t\t' WHERE v.name='.zbx_dbstr($valueMap['name']).\n\t\t\t' '.andDbNode('v.valuemapid');\n\tif (DBfetch(DBselect($sql))) {\n\t\tthrow new Exception(_s('Value map \"%1$s\" already exists.', $valueMap['name']));\n\t}\n\n\t$valueMapIds = DB::insert('valuemaps', array($valueMap));\n\t$valueMapId = reset($valueMapIds);\n\n\taddValueMapMappings($valueMapId, $mappings);\n}", "public function setMapValue($name=null);", "function applyValueMap($value, $valueMapId) {\n\t$mapping = getMappedValue($value, $valueMapId);\n\n\treturn ($mapping === false) ? $value : $mapping.' ('.$value.')';\n}", "public function setMaps($value)\n {\n $this->maps = $value;\n }", "protected function update($value)\n {\n }", "public function update( string $key, $value );", "final public function set($key,$value):Main\\Map\n {\n $this->checkAllowed('set')->checkBefore(false,$value);\n $return = $this->onPrepareThis('set');\n $key = $this->onPrepareKey($key);\n $value = $this->onPrepareValueSet($value);\n Base\\Arrs::setRef($key,$value,$return->arr(),$this->isSensitive());\n\n return $return->checkAfter();\n }", "public function addMapping($key, $value)\n {\n $this->mappings[] = array($key, $value);\n }", "public function update($value)\n {\n }", "public function update($value)\n {\n }", "public function setValues($valueCollection) {\n\n foreach ($valueCollection as $key => $value) {\n if (isset($this[$key])) {\n $this[$key]->setValue($value);\n } //if\n } //foreach\n \n }", "public function setAttributeMappings(?array $value): void {\n $this->getBackingStore()->set('attributeMappings', $value);\n }", "function convertValueFieldKeys()\n {\n foreach ($this->vars as $key => $val) {\n if (substr($key, -6) == '_value') {\n $this->vars[substr($key, 0, -6)] = $val;\n unset($this->vars[$key]);\n }\n }\n }", "public function setValue($entries) {}", "public static function map($key, $value = null)\n {\n if (is_array($key)) {\n foreach ($key as $k => $v) {\n self::map($k, $v);\n }\n }\n\n if (is_scalar($key) && !empty($value)) {\n self::$map[$key] = $value;\n }\n }", "abstract protected function putValue($key, $value);", "public function setMap( $value ) {\n $this->map = $value;\n return $this;\n }" ]
[ "0.6735151", "0.6077406", "0.5931889", "0.59272605", "0.5920307", "0.5842856", "0.57577145", "0.5743764", "0.5730725", "0.57204777", "0.57176685", "0.5679705", "0.5663392", "0.5640082", "0.5599256", "0.5506652", "0.5488184", "0.5479136", "0.5474343", "0.54397917", "0.5438248", "0.5381799", "0.5381799", "0.53810275", "0.53674644", "0.53135526", "0.5293151", "0.52864015", "0.5238302", "0.52353793" ]
0.6771315
0
Delete value map mappings.
function deleteValueMapMappings(array $mappingIds) { DB::delete('mappings', array('mappingid' => $mappingIds)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteTagMaps()\n {\n foreach ($this->tags as $tag) {\n $tag->tagObjectMap->delete();\n }\n }", "function delete_map ($data) {\r\n\t\t$id = (int)$data['id'];\r\n\t\t$table = $this->get_table_name();\r\n\r\n\t\t$result = $this->wpdb->query(\"DELETE FROM {$table} WHERE id={$id}\");\r\n\t\treturn $result ? $id : false;\r\n\t}", "public function deleteAddrMaps(){\n\t\t$guWlDevices = $this->getWlDevices();\n\t\tforeach($guWlDevices as $guDevice){\n\t\t\t$guWlIfaces = $guDevice->getWlIfaces();\n\t\t\tforeach($guWlIfaces as $guWlIface){\n\t\t\t\t$guWlIface->getAddrMap()->delete();\n\t\t\t}\n\t\t}\n\t}", "public static function clear()\n {\n self::$map = array();\n }", "public function deleteAllPersistentData()\n {\n foreach ($this->persistantMap as $key) {\n $this->store->delete($key);\n }\n }", "public function clear()\n {\n $this->map->clear();\n }", "function cleanValueMapMappings(array $mappings) {\n\t$cleanedMappings = $mappings;\n\n\tforeach ($cleanedMappings as $key => $mapping) {\n\t\tif (zbx_empty($mapping['value']) && zbx_empty($mapping['newvalue'])) {\n\t\t\tunset($cleanedMappings[$key]);\n\t\t}\n\t}\n\n\treturn $cleanedMappings;\n}", "public function destroy(Map $map)\n {\n //\n }", "final public function remove(...$values):Main\\Map\n {\n $this->checkAllowed('remove');\n $return = $this->onPrepareThis('remove');\n $data =& $return->arr();\n $data = Base\\Arrs::valuesStrip($return->prepareValues(...$values),$data,$this->isSensitive());\n\n return $return->checkAfter();\n }", "public function deleteMap($var = null) {\n\t\tswitch ($this->type) {\n\t\t\t// Report folder\n\t\t\tcase 'rfolder':\n\t\t\t\t$this->maps = array();\n\t\t\t\tbreak;\n\n\t\t\t// Template\n\t\t\tcase 'template':\n\t\t\t\tif (!isset($var) || strlen($var) == 0)\n\t\t\t\t\t$this->maps = array();\n\t\t\t\telse\n\t\t\t\t\tunset($this->maps[$var]);\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new WSS_Exception('W3S_NodeData-err_del_map', array(), 'Unable to delete map from this node type.');\n\t\t}\n\t}", "public static function removeAll(){\n\n foreach(static::all() as $key => $value){\n static::remove($key);\n }\n }", "public function delete_meta( $key, $value = '', $delete_all = false );", "function deleteValue() {\r\n $val_id = JRequest::getVar('val_id', '', '', 'array');\r\n $value = & JTable::getInstance('cpvalue', 'Table');\r\n foreach ($val_id as $value_id) {\r\n $value->load($value_id);\r\n $value->delete();\r\n }\r\n }", "function onDelete()\n\t{\n\t\treturn $this->getLookupTable()->deleteKey($this->getValue());\n\t}", "public function unsetValues($keys);", "public function deleteAllForKey()\n\t{\n\t\t$keys = $this->getAllKeys();\n return parent::deleteMulti($keys);\n\t}", "public static function clear()\n {\n self::$map = array();\n self::$instances = array();\n }", "function remove()\t{\r\n\t\ttep_db_query(\"delete from IXcore.\" . TABLE_CONFIGURATION . \" where configuration_key in ('\" . implode(\"', '\", $this->keys()) . \"')\");\r\n\t}", "public function drop ()\n {\n //delete the records of the lookup value\n $records = LookupValue::where('lookup_type_id', 1)->get();\n foreach ( $records as $record )\n $record->forceDelete();\n\n //delete the lookup definition itself\n $record = LookupType::find(1);\n $record->forceDelete();\n }", "public function Clear()\n {\n unset($this->_keyValPairs);\n $this->_keyValPairs = array();\n }", "private function deleteSiteMap()\n {\n foreach (glob(DIR_MAIN . '*.xml') as $file) {\n if (strpos($file, 'sitemap')) {\n unlink($file);\n }\n }\n }", "final public function unset(...$keys):Main\\Map\n {\n $this->checkAllowed('unset');\n $return = $this->onPrepareThis('unset');\n Base\\Arrs::unsetsRef($return->prepareKeys(...$keys),$return->arr(),$this->isSensitive());\n\n return $return->checkAfter();\n }", "private function delKey($key)\n {\n $this->model::where('key', $key)->get()->map(function($row){ $row->delete(); });\n }", "function remove() {\r\n global $db;\r\n $db->Execute(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_key in ('\" . implode(\"', '\", $this->keys()) . \"')\");\r\n }", "public function offsetUnset($key)\n {\n unset($this->mapping[$key]);\n }", "public function deleteAll() {\n if (isset($this::$has)) {\n foreach ($this::$has as $key => $value) {\n if(isset($this->$key)) {\n foreach ($this->$key as $item) {\n $item->deleteAll();\n }\n }\n }\n }\n $this->delete();\n }", "function remove() {\n global $db;\n $db->Execute(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_key in ('\" . implode(\"', '\", $this->keys()) . \"')\");\n }", "public function unsetValue($key);", "public function deleteValue($key) {\n\t\t$this->config->deleteKey($key);\n\t}", "function remove(){\n tep_db_query(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_key in ('\" . implode(\"', '\", $this->keys()) . \"')\");\n }" ]
[ "0.6806786", "0.64383763", "0.6337173", "0.62842804", "0.61903334", "0.617208", "0.6073436", "0.6038076", "0.5989403", "0.5945934", "0.5913351", "0.5847852", "0.58337116", "0.5768562", "0.5741361", "0.57350725", "0.5716198", "0.5712116", "0.56711376", "0.5667968", "0.5663113", "0.56581646", "0.56562436", "0.56467533", "0.562085", "0.561179", "0.56111926", "0.55990994", "0.5583295", "0.55679697" ]
0.7379874
0
Apply value mapping to value. If value map or mapping is not found unchanged value returned, otherwise mapped value returned in format: " ()".
function applyValueMap($value, $valueMapId) { $mapping = getMappedValue($value, $valueMapId); return ($mapping === false) ? $value : $mapping.' ('.$value.')'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function applyValue($value);", "protected function transform($value)\n {\n if (null === $this->valueTransformer) {\n return null === $value ? '' : $value;\n }\n return $this->valueTransformer->transform($value);\n }", "function null2unknown($map, $key) {\n if (array_key_exists($key, $map)) {\n if (!is_null($map[$key])) {\n return $map[$key];\n }\n }\n return \"No Value Returned\";\n }", "public function transform($value)\n {\n return $value;\n }", "public function map_mockup($value)\n {\n return trim(str_replace('one', '', $value));\n }", "function getMappedValue($value, $valueMapId) {\n\tstatic $valueMaps = array();\n\n\tif ($valueMapId < 1) {\n\t\treturn false;\n\t}\n\n\tif (isset($valueMaps[$valueMapId][$value])) {\n\t\treturn $valueMaps[$valueMapId][$value];\n\t}\n\n\t$dbMappings = DBselect(\n\t\t'SELECT m.newvalue'.\n\t\t' FROM mappings m'.\n\t\t' WHERE m.valuemapid='.zbx_dbstr($valueMapId).\n\t\t\t' AND m.value='.zbx_dbstr($value).\n\t\t\t' '.andDbNode('m.mappingid')\n\t);\n\tif ($mapping = DBfetch($dbMappings)) {\n\t\t$valueMaps[$valueMapId][$value] = $mapping['newvalue'];\n\n\t\treturn $mapping['newvalue'];\n\t}\n\n\treturn false;\n}", "function format_value($value, $post_id, $field) {\n\t\tif( empty($value) ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\treturn $value;\n\t}", "public function setMapValue($name=null);", "public function transform($value);", "protected function transform($key, $value) {\n\t\tif (in_array($key, $this->except, true)) {\n\t\t\treturn $value;\n\t\t}\n\n\t\treturn is_string($value) ? trim($value) : $value;\n\t}", "public static function map($key, $value = null)\n {\n if (is_array($key)) {\n foreach ($key as $k => $v) {\n self::map($k, $v);\n }\n }\n\n if (is_scalar($key) && !empty($value)) {\n self::$map[$key] = $value;\n }\n }", "public function getValue(): string\n {\n return $this->transform($this->value);\n }", "function get_map(array $map)\n{\n\tforeach($map as $k => $v)\n\t{\n\t\tif(get_has($k))\n\t\t{\n\t\t\t$v(get($k));\n\t\t}\n\t}\n}", "public static function toMap(): callable {\r\n return function ($key, $val) {\r\n return new MapEntry($key, $val);\r\n };\r\n }", "protected function transform(string $key, $value)\n {\n return is_string($value) && $value === '' ? null : $value;\n }", "public function walkValue(Value $value): string\n {\n return '?';\n }", "protected function compileValue()\n {\n if (null === $this->value) {\n return 'null';\n }\n\n if (\\is_array($this->value)) {\n return '('.implode(', ', array_map(\n [$this, 'quoteValue'],\n $this->value\n )).')';\n }\n\n return $this->quoteValue($this->value);\n }", "private function format($value)\n {\n if (is_callable($this->formatter)) {\n $value = call_user_func($this->formatter, $value, $this->dataSet);\n }\n return $value;\n }", "public function mapValue($fromValue, $context = null)\n {\n $this->log($fromValue);\n $toValue = $fromValue;\n return parent::mapValue($toValue, $context);\n }", "public function convert($value): string;", "public function apply($value);", "protected function renderValue($value) {\n if ($value['relation'] && array_key_exists($value['relation'], $this->propertyFormatters)) {\n return call_user_func(array(\"app\\components\\helpers\\PropertyFormatter\", $this->propertyFormatters[$value['relation']]), $value);\n } elseif ($value['type'] && array_key_exists($value['type'], $this->propertyFormatters)) {\n return call_user_func(array(\"app\\components\\helpers\\PropertyFormatter\", $this->propertyFormatters[$value['type']]), $value);\n } else {\n return PropertyFormatter::defaultFormat($value);\n }\n }", "public function convertValue($value) {\n\t\tswitch (TRUE) {\n\t\t\tcase is_array($value):\n\t\t\t\tforeach ($value as $k => $v) {\n\t\t\t\t\t$value[$k] = $this->convertValue($v);\n\t\t\t\t}\n\t\t\t\treturn implode('_', $value);\n\t\t\tcase is_object($value):\n\t\t\t\treturn spl_object_hash($value);\n\t\t\tcase is_int($value):\n\n\t\t\tcase is_float($value):\n\n\t\t\tcase is_string($value):\n\n\t\t\tcase is_bool($value):\n\t\t\t\treturn preg_replace('/[\\\\/\\\\/:\\\\.\\\\\\\\\\\\?%=]+/', '_', strval($value));\n\t\t\tdefault:\n\t\t\t\treturn '';\n\t\t}\n\t}", "public function getValue(): string\n {\n return $this->fusionValue('value') ?? '';\n }", "function uv ($v) {\n return OMap::isa($v) || OList::isa($v) ? $v->val : $v;\n}", "public function getValue($value, $column)\n {\n $val = '';\n if (isset($value[$column['name']])) {\n $val = $value[$column['name']];\n }\n return $val;\n }", "public function translate_moodle_userid_to_mapped_value($userid);", "public function format_value( $value, $slug, $post_id ) {\n\t\tif ( is_numeric( $value ) && intval( $value ) !== 0 ) {\n\t\t\treturn get_post( $value );\n\t\t}\n\n\t\treturn $this->default_value;\n\t}", "public function getModifiedValue(): string\n {\n\t\treturn $this->applyModifiers((string) $this->value);\n\t}", "private function transform($value) {\n $CI = & get_instance();\n // caso seja um array\n if (is_array($value)) {\n // percorre os valores\n foreach ($value as $x) {\n // se for um inteiro\n if (is_integer($x)) {\n $foo[] = $x;\n } else if (is_string($x)) {\n // se for string, adiciona aspas\n $foo[] = $CI->db->escape($x);\n }\n }\n // converte o array em string separada por \",\"\n $result = '(' . implode(',', $foo) . ')';\n }\n // caso seja uma string\n else if (is_string($value)) {\n // adiciona aspas\n $result = $CI->db->escape($value);\n }\n // caso seja valor nullo\n else if (is_null($value)) {\n // armazena NULL\n $result = 'NULL';\n }\n\n // caso seja booleano\n else if (is_bool($value)) {\n // armazena TRUE ou FALSE\n $result = $value ? 'TRUE' : 'FALSE';\n } else {\n $result = $CI->db->escape($value);\n }\n // retorna o valor\n return $result;\n }" ]
[ "0.55988777", "0.5563938", "0.5532002", "0.548586", "0.54554796", "0.5446946", "0.53497505", "0.5325787", "0.5282259", "0.5274987", "0.52523035", "0.5205782", "0.51891816", "0.515676", "0.5149222", "0.51433116", "0.5126327", "0.5110513", "0.5101121", "0.509759", "0.50580055", "0.5048736", "0.5047025", "0.50330496", "0.50274104", "0.50194055", "0.5012349", "0.4983023", "0.49729005", "0.4961895" ]
0.7567082
0
Check, that checkEntitesChanged returns true, when cron was never executed.
public function testNothingModified() { $check = $this->_cs->checkEntitiesChanged(rand(0, 9999), array(self::ENTITY_NAME)); $this->assertTrue($check); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testNothingModifiedLastRunSet()\n {\n $this->_cs->updateLastRun($this->_name);\n sleep(2);\n\n $check = $this->_cs->checkEntitiesChanged($this->_name, array(self::ENTITY_NAME));\n $this->assertFalse($check);\n }", "public function hasChangedEntries();", "public static function check_for_updates()\n {\n }", "public function isUpdated() {}", "public function hasChanged();", "public function hasChanged();", "public function changed() {\n\t\t\tif (!$this->original_data) {\n\t\t\t\tthrow new Exception('call exists() before calling changed()');\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->last_change != $this->original_last_change ||\n\t\t\t $this->last_change_reason != $this->original_last_change_reason ||\n\t\t\t $this->lanes_affected != $this->original_lanes_affected ||\n\t\t\t $this->traffic_impact != $this->original_traffic_impact ||\n\t\t\t $this->reason != $this->original_reason) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\treturn false;\n\t\t}", "public function checkOrdersForUpdateCheckouts()\n {\n $orderCollection = Mage::getModel(\"sales/order\")->getCollection();\n\n //get current timestamp\n $nowTime = new DateTime(null, new DateTimeZone(\"UTC\"));\n $nowTimestamp = $nowTime->getTimestamp();\n\n foreach ($orderCollection as $order) {\n $isTriggered = $order->getUrbitTriggered();\n\n if (isset($isTriggered) && $isTriggered == 'false') {\n $orderUpdateCheckoutTime = $order->getUrbitUpdateCheckoutTime();\n\n if (isset($orderUpdateCheckoutTime) && $orderUpdateCheckoutTime != \"\" && (int)$orderUpdateCheckoutTime <= $nowTimestamp) {\n $this->sendUpdateCheckout($order->getId());\n $order->setData('urbit_triggered', 'true');\n $order->save();\n }\n }\n }\n }", "public function hasChange()\n {\n return (\n count($this->getFieldsWithUpdate()) > 0\n || count($this->getIndexesWithUpdate()) > 0\n || $this->addSoftDelete\n || $this->dropSoftDelete\n || $this->addTimestamps\n || $this->dropTimestamps);\n }", "function validate_on_update() {}", "public function hasChanged(): bool;", "public function hasChanged(): bool;", "private function check()\n {\n foreach ($this->scheduler->getQueuedJobs() as $job) {\n if ($job->isDue(new DateTime()) === true) {\n\n $this->executeIfNotOverlapped($job);\n }\n }\n }", "public function hasUpdates();", "public function shouldUpdateAll()\n {\n return false;\n }", "public function hasChanges () {\n return !!$this->dirty;\n }", "protected function beforeUpdating()\n {\n }", "public function _isDirty() {}", "function before_update() {}", "public function hasUpdate();", "protected function onUpdated()\n {\n return true;\n }", "function isChanged(): bool;", "public function isDirty();", "function testDeterminingChanges() {\n // Initial creation.\n $support_ticket = entity_create('support_ticket', array(\n 'uid' => $this->webUser->id(),\n 'support_ticket_type' => 'ticket',\n 'title' => 'test_changes',\n ));\n $support_ticket->save();\n\n // Update the support_ticket without applying changes.\n $support_ticket->save();\n $this->assertEqual($support_ticket->label(), 'test_changes', 'No changes have been determined.');\n\n // Apply changes.\n $support_ticket->title = 'updated';\n $support_ticket->save();\n\n // The hook implementations support_ticket_test_support_ticket_presave() and\n // support_ticket_test_support_ticket_update() determine changes and change the title.\n $this->assertEqual($support_ticket->label(), 'updated_presave_update', 'Changes have been determined.');\n\n // Test the static support_ticket load cache to be cleared.\n $support_ticket = SupportTicket::load($support_ticket->id());\n $this->assertEqual($support_ticket->label(), 'updated_presave', 'Static cache has been cleared.');\n }", "public function doTestChangedTimeAfterSaveWithoutChanges() {\n $storage = $this->container->get('entity_type.manager')\n ->getStorage($this->entityTypeId);\n $storage->resetCache([$this->entityId]);\n $entity = $storage->load($this->entityId);\n // Test only entities, which implement the EntityChangedInterface.\n if ($entity instanceof EntityChangedInterface) {\n $changed_timestamp = $entity->getChangedTime();\n\n $entity->save();\n $storage = $this->container->get('entity_type.manager')\n ->getStorage($this->entityTypeId);\n $storage->resetCache([$this->entityId]);\n $entity = $storage->load($this->entityId);\n $this->assertEquals($changed_timestamp, $entity->getChangedTime(), 'The entity\\'s changed time wasn\\'t updated after API save without changes.');\n\n // Ensure different save timestamps.\n sleep(1);\n\n // Save the entity on the regular edit form.\n $language = $entity->language();\n $edit_path = $entity->toUrl('edit-form', ['language' => $language]);\n $this->drupalGet($edit_path);\n $this->submitForm([], $this->getFormSubmitAction($entity, $language->getId()));\n\n $storage->resetCache([$this->entityId]);\n $entity = $storage->load($this->entityId);\n $this->assertNotEquals($changed_timestamp, $entity->getChangedTime(), 'The entity\\'s changed time was updated after form save without changes.');\n }\n }", "function wp_schedule_update_checks()\n {\n }", "public function beforeValidationOnUpdate()\n {\n // Timestamp on the update\n $this->modifyAt = time();\n }", "public function beenUpdated()\n {\n return count($this->updatePlan) > 0;\n }", "public function isDirty()\r\n\t{\r\n\t\treturn (count($this->changelog)>0) ? true : false;\r\n\t}", "public function isChanged() {\n\t\treturn $this->_changed > 0;\n\t}" ]
[ "0.7307526", "0.6636282", "0.6423879", "0.62041825", "0.6171108", "0.6171108", "0.61324227", "0.6088629", "0.6065275", "0.60222", "0.5993436", "0.5993436", "0.59595", "0.5943766", "0.593973", "0.59271514", "0.59005326", "0.5892808", "0.58417", "0.5815253", "0.57851183", "0.57670224", "0.5748891", "0.57340115", "0.5730784", "0.5722068", "0.57185525", "0.5716514", "0.5687635", "0.5683605" ]
0.71344936
1
Given a context this method serializes the current graph to nquads of the form .
function to_nquads($context) { if(empty($context)) { throw new \InvalidArgumentException("You must specify the context when serializing to nquads"); } $serializer = new NQuadSerializer(); return $serializer->getSerializedIndex($this->_index, $this->_labeller->qname_to_alias($context)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function serialize(Context $context = null);", "public function serialize(Context $context = null);", "public function serialize(Context $context = null)\n {\n return serialize($context);\n }", "private function contextToString($context) {\n $export = '';\n foreach ($context as $key => $value) {\n $export .= \"{$key}: \";\n $export .= preg_replace(array(\n '/=>\\s+([a-zA-Z])/im',\n '/array\\(\\s+\\)/im',\n '/^ |\\G /m',\n ), array(\n '=> $1',\n 'array()',\n ' ',\n ), str_replace('array (', 'array(', var_export($value, true)));\n $export .= PHP_EOL;\n }\n return str_replace(array('\\\\\\\\', '\\\\\\''), array('\\\\', '\\''), rtrim($export));\n }", "public function serialize()\n {\n return serialize([\n $this->nodes,\n $this->root,\n $this->pointer,\n ]);\n }", "private function contextToString($context)\n {\n $export = '';\n foreach ($context as $key => $value) {\n $export .= \"{$key}: \";\n $export .= preg_replace(array(\n '/=>\\s+([a-zA-Z])/im',\n '/array\\(\\s+\\)/im',\n '/^ |\\G /m'\n ), array(\n '=> $1',\n 'array()',\n ' '\n ), str_replace('array (', '(', var_export($value, true)));\n $export .= PHP_EOL;\n }\n return str_replace(array('\\\\\\\\', '\\\\\\''), array('\\\\', '\\''), rtrim($export));\n }", "public function generate()\n {\n $this->schema->put('@graph', $this->expandGraphs());\n\n return $this->schema->toJson();\n }", "public function __serialize() { \n $serialized = [\n 'instance_name' => $this->instance_name,\n 'local_columns' => array_map(fn($column) => $this->serializeColumn($column), $this->getLocalColumns()),\n 'referenced_columns' => array_map(fn($column) => $this->serializeColumn($column), $this->getReferencedColumns()),\n 'is_reversed_relation' => $this->is_reverse_relation,\n 'target_relation' => $this->getTargetRelation(),\n 'type' => $this->type,\n ];\n\n return $serialized;\n\n }", "public function __toString(): string {\n $context = [];\n foreach ($this->solution as $key => $value) {\n $context[] = \"$key=$value\";\n }\n return '[Twilio.Events.V1.SubscribedEventContext ' . \\implode(' ', $context) . ']';\n }", "public function __toString(): string\n {\n $context = [];\n foreach ($this->solution as $key => $value) {\n $context[] = \"$key=$value\";\n }\n return '[Twilio.Messaging.V1.BrandVettingContext ' . \\implode(' ', $context) . ']';\n }", "public function serializar() {\n\t return json_encode(get_object_vars($this), JSON_FORCE_OBJECT);\n\t\t}", "public function serializar() {\n\t return json_encode(get_object_vars($this), JSON_FORCE_OBJECT);\n\t\t}", "public function toXml($context = NULL, int $options = 0): string {\n if ($context instanceof \\DOMNodeList) {\n $result = '';\n foreach ($context as $node) {\n $result .= $this->saveXML($node, $options);\n }\n return $result;\n }\n return $this->saveXML($context, $options);\n }", "protected function getSerializedData()\n {\n $data = $this->getAttributes();\n\n if (count($this->with) > 0) {\n foreach ($this->with as $relation) {\n $attach = [];\n foreach ($this->{$relation} as $item) {\n $attach[] = $item->getAttributes();\n }\n $data[$relation] = $attach;\n }\n }\n\n return serialize($data);\n }", "public function serialize()\n {\n return serialize(get_object_vars($this));\n }", "public function serialize()\n {\n return serialize(get_object_vars($this));\n }", "public function serialize()\n {\n return serialize(get_object_vars($this));\n }", "public function serialize()\n {\n $nonce = $this->getNonce();\n\n return serialize([$this->id, $nonce, $this->parameters->serialize()]);\n }", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "abstract public function serialize();", "abstract public function serialize();", "public abstract function serialize();", "public function __tostring() {\n\n\t\t\t//convet to string\n\t\t\treturn \"{\".\n\t\t\t\t\t\t\"id:\".$this->_id.\n\t\t\t\t\t\t\"type:\".$this->_type.\n\t\t\t\t\t\t\"path:\".$this->_path.\n\t\t\t\t\t\t\"name:\".$this->_name.\n\t\t\t\t\t\"}\";\n\n\t\t}" ]
[ "0.65871024", "0.65871024", "0.58459175", "0.5122658", "0.5101268", "0.5060301", "0.5042538", "0.5011205", "0.49751905", "0.49704677", "0.49523437", "0.49523437", "0.49452028", "0.4877312", "0.48759097", "0.48759097", "0.48759097", "0.4854968", "0.48272702", "0.48272702", "0.48272702", "0.48272702", "0.48272702", "0.48272702", "0.48264968", "0.48264968", "0.48254925", "0.48254925", "0.48103914", "0.48042324" ]
0.71014583
0
Adds the tripod array(s) to this graph. This method is used to add individual tripod documents, or a series of tripod array documents that are embedded in a view.
function add_tripod_array($tarray) { if (!is_array($tarray)) { throw new \Tripod\Exceptions\Exception("Value passed to add_tripod_array is not of type array"); } // need to convert from tripod storage format to rdf/json as php array format if (isset($tarray["value"][_GRAPHS])) { // iterate add add each graph foreach($tarray["value"][_GRAPHS] as $graph) { $this->add_tarray_to_index($graph); } } else { $this->add_tarray_to_index($tarray); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addChildDocuments(array &$docs) {}", "public function addDocuments(string $documentType, array $documents);", "public function addDocument(string $documentType, array $document);", "public function addData(array $arr);", "public function addRowsFromArray($array)\n {\n foreach ($array as $id => $row) {\n if ($id == self::ID_PARENTS) {\n $this->parents = $row;\n continue;\n }\n\n if (is_array($row)) {\n $row = new Piwik_DataTable_Row($row);\n }\n if ($id == self::ID_SUMMARY_ROW) {\n $this->summaryRow = $row;\n } else {\n $this->addRow($row);\n }\n }\n }", "public function add(array $elements);", "public function addMultiple($type, array $data)\n {\n $type = $this->getType($type);\n $documents = [];\n\n foreach ($data as $id => $values) {\n $documents[] = new Document($id, $values);\n }\n\n $type->addDocuments($documents);\n\n $this->refreshIndex();\n\n return $this;\n }", "public function addFromArray(array $array)\r\n {\r\n foreach ($array as $child) {\r\n $this->add($child);\r\n }\r\n return $this;\r\n }", "protected function addArtefacts(array $artefacts)\n {\n $this->getSubject()->addArtefacts(ProductVariantObserver::ARTEFACT_TYPE, $artefacts);\n }", "function to_tripod_view_array($docId,$context)\n {\n $subjects = $this->get_subjects();\n $contextAlias = $this->_labeller->uri_to_alias($context);\n\n // view\n $doc = array();\n $doc[\"_id\"] = array(_ID_RESOURCE=>$docId,_ID_CONTEXT=>$contextAlias);\n $doc[\"value\"] = array();\n $doc[\"value\"][_IMPACT_INDEX] = $subjects;\n $doc[\"value\"][_GRAPHS] = array();\n foreach ($subjects as $subject)\n {\n $graph = $this->get_subject_subgraph($subject);\n $doc[\"value\"][_GRAPHS][] = $this->index_to_tarray($graph,$contextAlias);\n }\n return $doc;\n }", "public function add($document) {}", "public function addDocuments(array $documents, array $additionalArguments = []): array\n {\n $texts = array_column($documents, 'pageContent');\n $metadatas = array_column($documents, 'metadata');\n\n return $this->addTexts($texts, $metadatas, $additionalArguments);\n }", "public final function addToArray( array &$array )\n {\n\n if ( ! \\is_null( $this->Instructions ) && ( '' != $this->Instructions ) )\n {\n $array[ 'Instructions' ] = $this->Instructions;\n $array[ 'Special Instructions' ] = $this->Instructions;\n }\n\n if ( ! \\is_null( $this->TransmissionReference ) && ( '' != $this->TransmissionReference ) )\n {\n $array[ 'Transmission Reference' ] = $this->TransmissionReference;\n $array[ 'Original Transmission Reference' ] = $this->TransmissionReference;\n }\n\n if ( ! \\is_null( $this->Credit ) && ( '' != $this->Credit ) )\n {\n $array[ 'Credit' ] = $this->Credit;\n }\n\n if ( ! \\is_null( $this->Source ) && ( '' != $this->Source ) )\n {\n $array[ 'Credit' ] = $this->Source;\n }\n\n }", "public function addAllPointers();", "public function addData(array $data, $templates = null);", "public function addData( \\Aimeos\\MW\\View\\Iface $view, array &$tags = [], &$expire = null )\n\t{\n\t\tforeach( $this->getSubClients() as $name => $subclient ) {\n\t\t\t$view = $subclient->addData( $view, $tags, $expire );\n\t\t}\n\n\t\treturn $view;\n\t}", "public function addToPlaylist($array) {\n\t\t$conn\t\t= $this->connect();\n\t\t//$userSession= new Container('fo_user');\n\t\t//$userID\t\t= (isset($userSession->userSession['_id']) && trim($userSession->userSession['_id']) != '') ? (string)$userSession->userSession['_id'] : '0';\n\t\t$collection\t= $conn->snapstate->playlist_media;\n\t\t$query\t\t= array('media_id'\t\t=> $array['video_id'],\n\t\t\t\t\t\t\t'playlist_id'\t=> $array['playlist_id']);\n\t\t$results\t= $collection->insert($query);\n\t}", "public function addToInsertSQLArray();", "public function addRelations(array $relations)\n {\n foreach ($relations as $relation) {\n $this->addRelation($relation);\n }\n }", "public function add(array $data)\n {\n $this->data = array_merge($this->data, $data);\n }", "public function addAll(array $elements): void;", "public function add_all_tentative($tentative_items)\n\t\t{\n\t\t\tparent::add_all_items($tentative_items,'tentative_items');\n\t\t}", "public function add($data)\n {\n if (is_array($data[0])) {\n return array_map(function ($val) use ($data) {\n return [\"view\" => $val, \"content\" => $data[1], \"region\" => $data[2]];\n }, $data[0]);\n }\n // if multiple content (multideminsional) create indexes for them\n if (array_key_exists(0, $data[1])) {\n return array_map(function ($val) use ($data) {\n return [\"view\" => $data[0], \"content\" => $val, \"region\" => $data[2]];\n }, $data[1]);\n }\n return [[\"view\" => $data[0], \"content\" => $data[1], \"region\" => $data[2]]];\n }", "public function addAll(array $uris);", "public function addDocuments(array $documents = array())\n {\n # PUT /accounts/{accountId}/envelopes/{envelopeId}/documents\n }", "public function AddVarArray($aData)\n {\n $this->aTemplateData = array_merge($this->aTemplateData, $aData);\n }", "public function Add(array $input)\n {\n $this->insertAll($input);\n $this->resetProperties();\n }", "function addItineraries($trip_id = 0)\n\t{ \n\t\t$itineraries = $this->buildItinerary($trip_id);\n\t\tif(!$itineraries)\n\t\t\treturn false;\n\n\t\t$insertData = array();\n\t\tforeach($itineraries as $itinerary){\n\t\t\t$insertData[] = array(\n\t\t\t\t\t'trip_id' => $trip_id,\n\t\t\t\t\t'date'\t => $itinerary,\n\t\t\t\t\t'user_id' => $this->session->userdata('id'),\n\t\t\t\t\t'organisation_id' => $this->session->userdata('organisation_id')\n\t\t\t\t\t);\n\t\t}\n\n\t\tif($insertData){\n\t\t\t$this->db->insert_batch('itinerary', $insertData);\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function addData(array $data): void\n {\n $this->data = $this->processSchema([$this->data, $data]);\n $this->cache = [];\n }", "public function __construct()\n {\n //$this->trips = new ArrayCollection();\n }" ]
[ "0.5586756", "0.53605264", "0.5144261", "0.5033833", "0.5026021", "0.49616015", "0.4926217", "0.47832403", "0.4756354", "0.47508278", "0.47250095", "0.46428064", "0.4609396", "0.45870554", "0.45792034", "0.45617917", "0.4488047", "0.4472523", "0.44670612", "0.4455841", "0.44486043", "0.44459602", "0.44434175", "0.44275", "0.44140413", "0.43968078", "0.43881863", "0.43868616", "0.4384885", "0.43820837" ]
0.69171244
0
Get all jobFamilies in one company
public function getAll(Request $request) { $this->validate($request, ["companyId" => "required"]); $jobFamilies = $this->jobFamilyDao->getAll(); $resp = new AppResponse($jobFamilies, trans('messages.allDataRetrieved')); return $this->renderResponse($resp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCompanyEmployees();", "public static function getEnterpriseCompanies(){\n $result = db::get(\"SELECT uid_empresa FROM \". TABLE_EMPRESA .\" WHERE is_enterprise = 1 ORDER BY nombre\", \"*\", 0, \"empresa\");\n return new ArrayObjectList($result);\n }", "public static function all() {\n\n $db = Zend_Registry::get('dbAdapter');\n $result = $db->query('select id from companys')->fetchAll();\n $companys = new SplObjectStorage();\n foreach ($result as $c) {\n try {\n $company = new Yourdelivery_Model_Company($c['id']);\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n continue;\n }\n $companys->attach($company);\n }\n return $companys;\n }", "public function allCompanies()\n {\n return Company::all();\n }", "public function getJobs()\n {\n return $this->hasMany(Job::class, ['id' => 'job_id'])\n ->via('jobsByCategory');\n }", "public function getJobsList($employer_id)\n {\n $em = $this->getEntityManager();\n\t\t\n\t\t$recs = $em->createQuery('SELECT DISTINCT j.id, j.title\n\t\t\tFROM AppBundle:ExtraChecks ec \n\t\t\tLEFT JOIN AppBundle:Jobs j WITH ec.jobCode = j.uniqueid\n\t\t\tWHERE ec.employerId = :eid\n\t\t\tORDER BY j.title')\n\t\t->setParameters(array(\"eid\"=>$employer_id))\n\t\t->getResult();\n\t\t$output = array('0'=>'All');\n\t\tforeach($recs as $idx=>$r) $output[$r['id']] = $r['title'];\n\t\treturn $output;\n\t}", "public function getFamilyObjects()\n {\n $familyObjects = [];\n\n foreach ($this->families as $code => $family) {\n $familyObject = new Family();\n\n $familyObject->setCode($code);\n\n $familyObjects[] = $familyObject;\n }\n\n return $familyObjects;\n }", "public function jobs() {\n return Job::where('company_uid',$this->uid)->get();\n }", "public function getCompanyWithUsers();", "public function getJobs();", "public function getJobs();", "public function companies()\n {\n return $this->morphedByMany('App\\Company', 'taggable');\n }", "public function getEmployees() {\n if ( is_null($this->_employees) ){\n $customers = $this->getTable()->getEmployees();\n $objects = new splObjectStorage();\n\n foreach ($customers AS $customer) {\n try {\n $ccust = new Yourdelivery_Model_Customer_Company($customer->customerId, $this->getId());\n if ($ccust->isDeleted()) {\n continue;\n }\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n continue;\n }\n $objects->attach($ccust);\n }\n $this->_employees = $objects;\n }\n return $this->_employees;\n }", "public function companies(): Collection\n {\n return Company::all();\n }", "public function GetCompaniesArray()\n\t{\n\t\tif (!$this->companies)\n\t\t{\n\t\t\t$this->dbase->Select('job_companies', array('company_id', 'name', 'OPF'), array(), array('name' => 'ASC'));\n\t\t\t$this->companies = array();\n\t\t\twhile ($company = $this->dbase->FetchArray())\n\t\t\t{\n\t\t\t\t$this->companies[$company['company_id']] = $company['name'] . \", \" . $this->lang[$company['OPF'] . \"_short\"];\n\t\t\t}\n\t\t}\n\t\treturn $this->companies;\n\t}", "public static function getAvailableOperatingSystemFamilies(): array\n {\n return self::$osFamilies;\n }", "function Companies(){\n\t\t\t\treturn $this->companies;\n\t\t\t}", "public function getJobNames();", "public function getProductFamily(array $parameters);", "public function getAll()\n {\n\t\t$sql = sprintf('SELECT ats_jobs.*, theme.company AS client, users.subdomain\n\t\t\t\t\t\tFROM ats_jobs\n\t\t\t\t\t\tINNER JOIN users ON (ats_jobs.created_by = users.id)\n\t\t\t\t\t\tINNER JOIN theme ON (ats_jobs.created_by = theme.created_by)\n\t\t\t\t\t\tWHERE ats_jobs.closed = 0\n\t\t\t\t\t\tAND ats_jobs.deleted = 0\n\t\t\t\t\t\tORDER BY ats_jobs.modified_ts DESC');\n\n\t\treturn $this->_db->query($sql)->fetchAll();\n\t}", "public function get_job_list() {\n return $this->find_all_jobs();\n }", "public static function employees(Company $company): array\n {\n // number of employees in total\n $totalNumberOfEmployees = $company->employees()->notLocked()->count();\n\n // 10 random employees\n $tenRandomEmployeesCollection = collect([]);\n $allEmployees = $company->employees()\n ->notLocked()\n ->with('picture')\n ->inRandomOrder()\n ->take(10)\n ->get();\n\n foreach ($allEmployees as $employee) {\n $tenRandomEmployeesCollection->push([\n 'id' => $employee->id,\n 'name' => $employee->name,\n 'avatar' => ImageHelper::getAvatar($employee, 32),\n 'url' => route('employees.show', [\n 'company' => $company,\n 'employee' => $employee,\n ]),\n ]);\n }\n\n // ten random employees\n\n // number of employees hired in the current year\n $employeesHiredInTheCurrentYear = $company->employees()\n ->notLocked()\n ->whereYear('hired_at', (string) Carbon::now()->year)\n ->count();\n\n return [\n 'employees_hired_in_the_current_year' => $employeesHiredInTheCurrentYear,\n 'ten_random_employees' => $tenRandomEmployeesCollection,\n 'number_of_employees_left' => $totalNumberOfEmployees - $tenRandomEmployeesCollection->count(),\n 'view_all_url' => route('employees.index', [\n 'company' => $company,\n ]),\n ];\n }", "public function getAndRemoveJobs()\n\t{\n\t\t//create QueryBuilder\n\t\t$queryBuilder = $this->entityManager->createQueryBuilder();\n\n\t\t//create query\n\t\t$queryBuilder->select(\"j\");\n\t\t$queryBuilder->from(\"yourCMDB:CmdbJob\", \"j\");\n\t\t$queryBuilder->andWhere(\"j.timestamp is null OR j.timestamp <= CURRENT_TIMESTAMP()\");\n\n\t\t//get results\n\t\t$query = $queryBuilder->getQuery();\n\t\t$jobs = $query->getResult();\n\n\t\t//delete the giveb jobs\n\t\tforeach($jobs as $job)\n\t\t{\n\t\t\t$this->entityManager->remove($job);\n\t\t}\n\t\t$this->entityManager->flush();\n\n\t\t//return jobs\n\t\treturn $jobs;\n\t}", "public function sitemapCompanies(){\n $links = array();\n $models = ORM::factory('CatalogCompany')->where('enable','=','1')->find_all();\n foreach($models as $model)\n $links[] = $model->getUri();\n return $links;\n }", "public function getJobsByCategory() {\n return $this->hasMany('App\\jobs', 'category_id', 'id');\n }", "public function jobs()\n {\n return $this->morphedByMany('App\\Job', 'taggable');\n }", "public function allCompanies()\n {\n\n $companies = $this->core_companies;\n\n $items = [];\n foreach ($companies as $company) {\n\n $companyItem = new CompanyCardItem();\n $companyItem->id = $company->id;\n $companyItem->name = $company->name;\n //$companyItem->amount = $catalog->amount;\n $companyItem->title = $company->title;\n if (\\Dash\\count($company->photo))\n $companyItem->image = '/uploaz/eyuf/UserCompany/photo/' . $company->id . '/' . $company->photo[0];\n $companyItem->url = ZUrl::to([\n 'customer/markets/show',\n 'id' => $company->id\n ]);\n $companyItem->distence = \"12km\";\n //$companyItem->image = $catalog->price;\n //$companyItem->price = $catalog->price_old;\n //$companyItem->currency = \"$\";\n //$companyItem->cart_amount = 0;\n\n $items[] = $companyItem;\n }\n return $items;\n }", "public function findAllByAmountOfSubFamiliesAnywhere($filter)\n {\n return $this->createQueryBuilder('u')\n ->andWhere('u.amountOfSubFamilies LIKE :filter')\n ->setParameter('filter','%'.$filter.'%')\n ->addOrderBy('u.totalAmountOfCreatedObjects','DESC')\n ->getQuery()\n ->execute();\n }", "public function retrieveFamilies($userId)\n {\n return $this->start()->uri(\"/api/user/family\")\n ->urlParameter(\"userId\", $userId)\n ->get()\n ->go();\n }", "public function getJobs($filter = false)\n {\n $jobs = array();\n\n $CSO = $this->getResource('CSO');\n foreach($CSO->getJobs($filter) as $job)\n {\n array_push($jobs, $job);\n }\n\n $OpenOnderwijs = $this->getResource('OpenOnderwijs');\n foreach($OpenOnderwijs->getJobs($filter) as $job)\n {\n array_push($jobs, $job);\n }\n\n return $this->output($jobs);\n }" ]
[ "0.5821762", "0.5768272", "0.56965524", "0.56405175", "0.5529036", "0.55276656", "0.54536855", "0.5433209", "0.5394682", "0.53793883", "0.53793883", "0.53534436", "0.5341257", "0.5320014", "0.5305091", "0.52529895", "0.524137", "0.5224712", "0.52157843", "0.52133936", "0.52061844", "0.51844835", "0.5170348", "0.5169146", "0.51610583", "0.515757", "0.51507205", "0.51463485", "0.5122693", "0.51076436" ]
0.60058796
0
Validate save/update jobFamily request.
private function checkJobFamilyRequest(Request $request) { $this->validate($request, [ 'companyId' => 'required|integer|exists:companies,id', 'effBegin' => 'required|date|before_or_equal:effEnd', 'effEnd' => 'required|date', 'description' => 'present|max:255', 'code' => 'required|max:20|alpha_num', 'name' => 'required|max:50' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function validateUpdateRequest( Request $request ) {\n\t\t$this->validate($request, [\n\t\t\t'book_id' => 'exists:books,id',\n\t\t\t'price' => 'numeric|min:1',\n\t\t],[\n\t\t\t'books_id.exists' => 'Not an existing book for this sale.',\n\t\t\t'min' => 'The :attribute field needs at least :min chars.',\n\t\t\t'numeric' => 'The :attribute field needs to be numeric.',\n\t\t\t'price.min' => 'The :attribute needs to be equals or bigger than 1.',\n\t\t]);\n\t}", "public function validateRequest();", "public static function validateUpdateRequest() {\n $errors = array();\n $data = array();\n self::checkID($errors, $data);\n self::checkName($errors, $data);\n if (count($errors) > 0 && count($data) > 0) {\n redirect(url(['_page' => 'home']));\n } else if (count($errors) == 0){\n return $data;\n }\n return null;\n }", "public function validate()\n {\n $this->httpRequest->request;\n foreach (func_get_args() as $key) {\n $value = $this->parameters->get($key);\n if (! isset($value)) {\n throw new InvalidRequestException(\"The $key parameter is required\");\n }\n }\n }", "function validate_on_update() {}", "public function validate(): void\n {\n $requiredParams = [\n 'username',\n 'api_key',\n 'BRANCH',\n 'CUST_ID',\n 'CREATE_BY',\n 'REQUEST_AWB',\n 'REQUEST_BY',\n 'REQUEST_NO',\n 'REASON',\n ];\n\n foreach ($requiredParams as $param) {\n if (! ($this->attributes[$param] ?? null)) {\n throw new InvalidStockAwbRequestException(\"$param is required.\");\n }\n }\n\n return;\n }", "public function checkIsValidForUpdate() {\n $errors = array();\n\n try{\n $this->checkIsValidForCreate();\n }catch(ValidationException $ex) {\n foreach ($ex->getErrors() as $key=>$error) {\n $errors[$key] = $error;\n }\n }\n if (sizeof($errors) > 0) {\n throw new ValidationException($errors, \"Notification is not valid\");\n }\n }", "private function validateRequest()\n {\n return request()->validate([\n 'project_name' => 'required|string|unique:projects',\n ]);\n }", "public function checkIsValidForUpdate() {\n $errors = array();\n\n if (strlen($this->phone) >0 && !is_numeric($this->phone)){\n $errors[\"phone\"] = i18n(\"You must write a valid phone number\");\n }\n if (strlen($this->phone) < 1) {\n $errors[\"phone\"] = i18n(\"You must write a valid phone number\");\n }\n try{\n $this->checkIsValidForCreate();\n }catch(ValidationException $ex) {\n foreach ($ex->getErrors() as $key=>$error) {\n $errors[$key] = $error;\n }\n }\n if (sizeof($errors) > 0) {\n throw new ValidationException($errors, \"User is not valid\");\n }\n }", "public function validateUpdate($obj);", "public function validateSave() {\r\n //0. Pobranie parametrów z walidacją\r\n $this->form->id = ParamUtils::getFromRequest('id', true, 'Błędne wywołanie aplikacji');\r\n $this->form->name = ParamUtils::getFromRequest('name', true, 'Błędne wywołanie aplikacji');\r\n $this->form->surname = ParamUtils::getFromRequest('surname', true, 'Błędne wywołanie aplikacji');\r\n $this->form->birthdate = ParamUtils::getFromRequest('birthdate', true, 'Błędne wywołanie aplikacji');\r\n $this->form->jobTitle = ParamUtils::getFromRequest('jobTitle', true, 'Błędne wywołanie aplikacji');\r\n $this->form->jobPlace = ParamUtils::getFromRequest('jobPlace', true, 'Błędne wywołanie aplikacji');\r\n $this->form->userName = ParamUtils::getFromRequest('userName', true, 'Błędne wywołanie aplikacji');\r\n $this->form->role = ParamUtils::getFromRequest('role', true, 'Błędne wywołanie aplikacji');\r\n $this->form->password = ParamUtils::getFromRequest('password', true, 'Błędne wywołanie aplikacji');\r\n\r\n if (App::getMessages()->isError())\r\n return false;\r\n\r\n // 1. sprawdzenie czy wartości wymagane nie są puste\r\n if (empty(trim($this->form->name))) {\r\n Utils::addErrorMessage('Wprowadź imię');\r\n }\r\n if (empty(trim($this->form->surname))) {\r\n Utils::addErrorMessage('Wprowadź nazwisko');\r\n }\r\n if (empty(trim($this->form->birthdate))) {\r\n Utils::addErrorMessage('Wprowadź datę urodzenia');\r\n }\r\n if (empty(trim($this->form->jobTitle))) {\r\n Utils::addErrorMessage('Wprowadź nazwę stanowiska');\r\n }\r\n if (empty(trim($this->form->jobPlace))) {\r\n Utils::addErrorMessage('Wprowadź miejsce');\r\n }\r\n if (empty(trim($this->form->userName))) {\r\n Utils::addErrorMessage('Wprowadź nazwę użytkownika');\r\n }\r\n if (empty(trim($this->form->role))) {\r\n Utils::addErrorMessage('Wprowadź role użytkownika');\r\n }\r\n if (empty(trim($this->form->password)) && empty(trim($this->form->id))) {\r\n Utils::addErrorMessage('Wprowadź hasło');\r\n }\r\n\r\n if (App::getMessages()->isError())\r\n return false;\r\n\r\n // 2. sprawdzenie poprawności przekazanych parametrów\r\n\r\n \r\n\r\n $check_birth = $this->form->birthdate;\r\n $check_name = $this->form->name;\r\n $check_surname = $this->form->surname;\r\n\r\n $d = checkdate(substr($check_birth, 5, 2), substr($check_birth, 8, 2), substr($check_birth, 0, 4));\r\n if ($d === false || strlen($check_birth) <> 10) {\r\n Utils::addErrorMessage('Zły format daty. Przykład: 2018-12-20 lub data nie istnieje');\r\n }\r\n \r\n\r\n function my_mb_ucfirst($str) {\r\n $fc = mb_strtoupper(mb_substr($str, 0, 1));\r\n return $fc . mb_substr($str, 1);\r\n }\r\n\r\n $this->form->name = my_mb_ucfirst($check_name);\r\n $this->form->surname = my_mb_ucfirst($check_surname);\r\n\r\n// $test = App::getDB()->get('person', '*', [\r\n// 'user_name' => $this->form->userName\r\n// ]);\r\n// $testUser = $test['user_name'];\r\n// var_dump($test); \r\n// var_dump($test['user_name'] === $testUser);die;\r\n// \r\n// if($test['user_name'] === $testUser)\r\n// {\r\n// Utils::addErrorMessage('Podany użytkownik już istnieje');\r\n// }\r\n return !App::getMessages()->isError();\r\n }", "public function validate(): void {\n\n $errors = [];\n\n $this->validateNonEmpty('userId', $errors);\n $this->validateNonEmpty('nodeId', $errors);\n $this->validateNonEmpty('estimationValue', $errors);\n\n if ($errors) {\n throw new RequestValidationException($errors);\n }\n }", "public function validateRequest($request)\n {\n // only JSON content is accepted\n if ($_SERVER['CONTENT_TYPE'] != 'application/json') {\n $this->throwException(REQUEST_CONTENTTYPE_NOT_VALID, 'Requested content-type is not valid');\n }\n // decode json data\n $data = json_decode($this->request, true);\n //print_r($data);\n \n // if post serviceName is not set or empty throws exception \n if (!isset($data['serviceName']) or $data['serviceName'] == \"\") {\n $this->throwException(API_NAME_REQUIRED, \"API name required.\");\n }\n // otherwise save requested serviceName\n $this->serviceName = $data['serviceName'];\n \n // parameters need to be an array\n if (!is_array($data['param'])) {\n $this->throwException(API_PARAM_REQUIRED, \"API PARAM required.\");\n }\n $this->param = $data['param'];\n // print_r($data);\n }", "public function rules()\n {\n return [\n //'order_number'=>'required|unique:jobs|min:10|max:11',\n 'contact_id' => 'exists:contacts,id',\n 'job.option.*.accepted'=>'required|in:on,1,true',\n ];\n }", "public function validate(array $data = array(), $is_update = true)\n {\n $validator = $this->getValidator($data);\n\n // job id only required for updates\n if ($is_update) {\n $validator\n ->required('You must edit an existing job.')\n ->integer('The job you are attempting to edit does not appear to be valid.')\n ->validate('id', 'Job ID');\n }\n\n\t\t// ensure we have a title\n $validator\n ->required('You must enter a job title.')\n ->validate('name', 'Job Title');\n\n\t\t// ensure we have a location\n $validator\n ->required('You must enter a job location.')\n ->validate('location', 'Location');\n\n\t\t// ensure we have a category\n $validator\n ->required('You must enter a job category.')\n ->validate('category', 'Category');\n\n\t\t// ensure we have a category\n $validator\n ->required('You must enter a job description.')\n ->validate('description', 'Description');\n\n // check for errors\n if ($validator->hasErrors()) {\n throw new Skookum_Form_Validator_Exception(\n 'An error occurred on form submission.',\n $validator->getAllErrors()\n );\n }\n\n return $validator->getValidData();\n }", "public abstract function validation();", "abstract public function validate();", "abstract public function validate();", "public function validate_request() {\r\n\t\tif ($this->request != null && sizeof($this->request) != 1)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "protected function _validate() {\n\t}", "public function validate()\n {\n throw new Fdap_Model_Exception(\"This function must be declared and completed in the concrete model class.\");\n }", "public function rules()\n {\n $request = $this->request->all();\n\n if(isset($request['_method']) && $request['_method'] === 'PATCH'){\n return [\n 'name' => 'required|max:200',\n 'description' => 'required',\n ];\n } else {\n return [\n 'name' => 'required|unique:brands|max:200',\n 'description' => 'required',\n 'brand_logo' => 'required|image|max:1024',\n ];\n }\n }", "protected function validateRequest()\n {\n $validators = [\n 'hasClientId' => null,\n 'knownClientId' => null,\n 'timestamp' => 'signed',\n 'hasSignature' => 'signed',\n 'notExpiredTimestamp' => 'signed',\n 'signature' => 'signed',\n ];\n\n foreach ($validators as $validator => $condition) {\n // First make sure the conditions are fulfilled for the validator\n if ($condition) {\n $method = camel_case('validCondition_'.$condition);\n\n if (! $this->{$method}()) {\n continue;\n }\n }\n\n $method = camel_case('valid_'.$validator);\n $this->{$method}();\n }\n }", "public static function validate() {}", "function validate_on_create() {}", "public function rules()\n { \n \n $rules = [ \n 'name' => 'required|unique:brands|max:191' \n ];\n\n if($this->getMethod() == 'PUT' || $this->getMethod() == 'PATCH') $rules['name'] .= ',id, ' . $this->request->get(\"id\");\n\n return $rules;\n }", "public function validateRequestUpdate($request,$ideUsuario,$ideRegion){\n// 'email' => [\n// 'required',\n// Rule::unique('users')->ignore($user->id),\n// ],\n// $rules=[\n// 'usuario' => [\n// 'required',\n// 'max:50',\n// Rule::unique('seg_usuario')->ignore($id),\n// ],\n// 'nombres' => 'required|max:100',\n// 'apellidos' => 'required|max:100' \n// ];\n //'ide_usuario' => 'unique:seg_usuario_region,'.$ideUsuario.',ide_usuario,ide_regio,'.$ideRegion,\n //'unique' => 'El :attribute ya ha sido utilizado'\n $rules=[\n //'ide_usuario_director' => 'unique:cfg_departamento,ide_usuario_director,'.$ideRegion.',ide_departamento',\n 'nombre' => 'required|max:100',\n 'descripcion' => 'required|max:100',\n 'codigo_interno' => 'max:150'\n ];\n $messages=[\n 'required' => 'Debe ingresar :attribute.',\n 'max' => 'La capacidad del campo :attribute es :max'\n //'unique' => 'El usuario ya fue asignado a otro departamento.'\n ];\n $this->validate($request, $rules,$messages); \n }", "function validateRequest($request) {\n $rules = \n [\n 'name' => 'required',\n 'address' => 'required',\n 'phone' => 'required|numeric',\n 'profession' => 'required|in:engineering,maths,physics'\n ]; \n // if validation fails, it will produce an error response }\n $this->validate($request, $rules);\n }", "public function validate()\n {\n $messages = array();\n\n // ID\n if (!Validator::validateField($this->id, 'intVal')) {\n $messages[] = 'ID is invalid.';\n }\n\n // Email\n if (!Validator::validateField($this->email, 'email', array('notEmpty' => array(), 'required' => true))) {\n $messages[] = 'Email address is invalid.';\n }\n\n // Password - no need to validate as it is validated on set and isn't required for an update\n\n // First name\n if (!Validator::validateField($this->first_name, 'stringType', array(\n 'notEmpty' => array(),\n 'length' => array(1, 35),\n 'required' => true\n ))) {\n $messages[] = 'First name is required.';\n }\n\n // Last name\n if (!Validator::validateField($this->last_name, 'stringType', array(\n 'notEmpty' => array(),\n 'length' => array(1, 35),\n 'required' => true\n ))) {\n $messages[] = 'Last name is required.';\n }\n\n // Role\n if (!Validator::validateField($this->role, 'stringType', array(\n 'notEmpty' => array(),\n 'length' => array(1, 35),\n 'required' => true\n ))) {\n $messages[] = 'Role is required.';\n }\n\n // Status\n if (!Validator::validateField($this->status, 'slug', array(\n 'notEmpty' => array(),\n 'length' => array(1, 20),\n 'required' => true\n ))) {\n $messages[] = 'Status is not valid.';\n }\n\n if (!empty($messages)) {\n throw new ValidationException($messages);\n }\n }", "public function isValidRequest() {\n }" ]
[ "0.58357376", "0.58190745", "0.5662971", "0.56121886", "0.5590617", "0.5528992", "0.5528292", "0.55264735", "0.5493111", "0.5443351", "0.54126465", "0.5409019", "0.54027575", "0.53791666", "0.53451353", "0.53294027", "0.53190136", "0.53190136", "0.53169066", "0.5308811", "0.52916056", "0.5260272", "0.5247761", "0.5204081", "0.5203161", "0.52023035", "0.5195843", "0.5194845", "0.5192699", "0.518711" ]
0.71146524
0
Construct a jobFamily object (array).
private function constructJobFamily(Request $request) { $jobFamily = [ "tenant_id" => $this->requester->getTenantId(), "company_id" => $request->companyId, "eff_begin" => $request->effBegin, "eff_end" => $request->effEnd, "description" => $request->description, "name" => $request->name, "code" => $request->code ]; return $jobFamily; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct(array $job_Family_Group = array())\n {\n $this\n ->setJob_Family_Group($job_Family_Group);\n }", "public function getFamilyObjects()\n {\n $familyObjects = [];\n\n foreach ($this->families as $code => $family) {\n $familyObject = new Family();\n\n $familyObject->setCode($code);\n\n $familyObjects[] = $familyObject;\n }\n\n return $familyObjects;\n }", "public function getFamily() {}", "static function createJobDescriptorFromInput()\n {\n $obj = b2input()->json();\n $job = new \\scheduler\\JobDescriptor();\n\n $job->group = trim($obj->group) ?: b2config()->scheduler['defaultGroupName'];\n $job->name = $obj->name;\n $job->type = $obj->type;\n $job->description = $obj->description;\n\n if ($obj->data) {\n $job->data = parse_ini_string($obj->data);\n }\n if (empty($job->data)) {\n $job->data = null;\n }\n\n// var_dump($job);\n\n return $job;\n }", "public function fake(Generator &$faker): Job\n {\n return new Job([\n 'name' => $faker->catchPhrase,\n 'summary' => $faker->sentence,\n 'workflow_id' => random_int(1, Fabricator::getCount('workflows') ?: 4),\n 'stage_id' => random_int(1, Fabricator::getCount('stages') ?: 99),\n ]);\n }", "public function testValidFamilyConifgurationArray()\n\t{\n\t\n\t\t$families = array(\n\n\t\t\t\t'GigTicket' => array(\n\n\t\t\t\t\t'properties' => array (\n\n\t\t\t\t\t\t'date' => array(),\n\t\t\t\t\t\t'start_time' => array(),\n\t\t\t\t\t\t'end_time' => array(),\n\t\t\t\t\t\t'band' => array(),\n\t\t\t\t\t\t'venue' => array(),\n\t\t\t\t\t\t'url' => array(),\n\t\t\t\t\t\t'age_restriction' => array(\n\n\t\t\t\t\t\t\t'G',\n\t\t\t\t\t\t\t'PG',\n\t\t\t\t\t\t\t'PG-13',\n\t\t\t\t\t\t\t'R',\n\t\t\t\t\t\t\t'NC-17'\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\n\t\t\t\t),\n\t\t\t);\n\n\t\t$valid = $this->activate->isValidFamilyArray($families);\n\n\t\t$this->assertNotNull($valid);\n\t\t$this->assertTrue($valid);\n\t}", "public function createJobObject($payload)\n {\n $job = new Job;\n\n $map = $this->getJobSetterMap();\n\n array_walk($map, function ($path, $setter) use ($payload, &$job) {\n try {\n $value = static::getValue(explode('.', $path), $payload);\n $job->$setter($value);\n } catch (\\OutOfRangeException $e) {\n // do nothing\n }\n });\n\n return $job;\n }", "public function getFamilyClass() {}", "public function getProductFamily(array $parameters);", "public function __construct($names, $job)\n\t\t{\n\t\t\t$this->_members[0] = new PartyMember($names[0]);\n\t\t\t$this->_members[1] = new PartyMember($names[1]);\n\t\t\t$this->_members[2] = new PartyMember($names[2]);\n\t\t\t$this->_members[3] = new PartyMember($names[3]);\n\t\t\t$this->_members[4] = new PartyMember($names[4]);\n\n\t\t\t$this->_leader = $names[0];\n\t\t\t#supplies made by passing in starting money\n\t\t\t$this->_job = $job;\n\n\t\t\t$this->_supplies = new Supplies($this->_jobVal[$job][1]);\n\n\n\n\t\t}", "private static function jobToHash($queue, $class, $args)\n\t{\n\t\treturn array(\n\t\t\t'class' => $class,\n\t\t\t'args' => array($args),\n\t\t\t'queue' => $queue,\n\t\t);\n\t}", "protected function createFullFamilyFixtures()\n {\n $male = GenderAwareInterface::GENDER_MALE;\n $female = GenderAwareInterface::GENDER_FEMALE;\n\n $fatherGrandPa = [\n 'id' => 1,\n 'gender' => $male,\n ];\n $fatherGrandMa = [\n 'id' => 2,\n 'gender' => $female,\n ];\n\n $father = [\n 'id' => 3,\n 'gender' => $male,\n 'father_id' => 1,\n 'mother_id' => 2,\n ];\n $mother = [\n 'id' => 4,\n 'gender' => $female,\n ];\n\n // son - is perfect example of Persona:\n // have 3 child, 1 spouse, 1 full sibling (sister) and 2 half-siblings\n $son = [\n 'id' => 5,\n 'gender' => $male,\n 'father_id' => 3,\n 'mother_id' => 4,\n ];\n $sonWife = [\n 'id' => 6,\n 'gender' => $female,\n ];\n $daughter = [\n 'id' => 7,\n 'gender' => $female,\n 'father_id' => 3,\n 'mother_id' => 4,\n ];\n $sonHalfBrotherOnFatherSide = [\n 'id' => 8,\n 'gender' => $male,\n 'father_id' => 3,\n ];\n $sonHalfSisterOnMotherSide = [\n 'id' => 9,\n 'gender' => $female,\n 'mother_id' => 4,\n ];\n\n $grandsonA = [\n 'id' => 10,\n 'gender' => $male,\n 'father_id' => 5,\n 'mother_id' => 6,\n ];\n $grandsonB = [\n 'id' => 11,\n 'gender' => $male,\n 'father_id' => 5,\n 'mother_id' => 6,\n ];\n $grandsonC = [\n 'id' => 12,\n 'gender' => $male,\n 'father_id' => 5,\n 'mother_id' => 6,\n ];\n\n $fixtures = [\n 'fatherGnandPa' => $fatherGrandPa,\n 'fatherGnandMa' => $fatherGrandMa,\n\n 'father' => $father,\n 'mother' => $mother,\n\n 'son' => $son,\n 'sonWife' => $sonWife,\n 'daughter' => $daughter,\n\n 'sonHalfBrotherOnFatherSide' => $sonHalfBrotherOnFatherSide,\n 'sonHalfSisterOnMotherSide' => $sonHalfSisterOnMotherSide,\n\n 'grandsonA' => $grandsonA,\n 'grandsonB' => $grandsonB,\n 'grandsonC' => $grandsonC,\n ];\n foreach ($fixtures as $row) {\n $this->insertRowInTable($row, 'persona');\n }\n\n $relationships = [\n [\n 'husband_id' => $father['id'],\n 'wife_id' => $mother['id'],\n ],\n [\n 'husband_id' => $fatherGrandPa['id'],\n 'wife_id' => $fatherGrandMa['id'],\n ],\n [\n 'husband_id' => $son['id'],\n 'wife_id' => $sonWife['id'],\n ],\n ];\n foreach ($relationships as $spousesRel) {\n $this->insertRowInTable($spousesRel, 'spouse_relationship');\n }\n\n return $fixtures;\n }", "public function __construct($job)\n {\n $payload = [];\n $this->job = $job;\n $payload['data'] = json_encode($this->job);\n\n $payload['classname'] = $this->job->getNameOfClass();\n $this->payload = $payload;\n\n }", "function create_family($frec, $fid)\n\t{\n\t\t//throw new exception(\"create_family - this function is not implemented\");\n\t}", "abstract public function makeJob();", "abstract public function makeJob();", "public function __construct() {\n //$this->family = $family;\n }", "public function maker(): array;", "private function createJob(array $data = [])\n {\n $workflow = fake(WorkflowModel::class);\n $stage = fake(StageModel::class, [\n 'action_id' => 'info',\n 'workflow_id' => $workflow->id,\n 'required' => 1,\n ]);\n fake(StageModel::class, [\n 'action_id' => 'button',\n 'workflow_id' => $workflow->id,\n 'required' => 0,\n ]);\n\n $data = array_merge([\n 'workflow_id' => $workflow->id,\n 'stage_id' => $stage->id,\n ], $data);\n\n return fake(JobModel::class, $data);\n }", "public function createJobObject($payload)\n {\n $job = new Job([\n 'title' => $payload['title'],\n 'name' => $payload['title'],\n 'description' => $payload['description'],\n 'url' => $payload['url'],\n 'location' => $payload['locations'],\n ]);\n\n $job->setCompany($payload['company'])\n ->setDatePostedAsString($payload['date'])\n ->setBaseSalary($payload['salary']);\n\n return $job;\n }", "protected function getJobs(array $items)\n\t{\n\t\tforeach ($items as &$item) {\n\t\t\t$item = new Job($item);\n\t\t}\n\n\t\treturn $items;\n\t}", "public function definition(): array\n {\n return [\n 'uuid' => Uuid::uuid4()->toString(),\n 'name' => $this->faker->name,\n 'description' => implode(' ', $this->faker->sentences()),\n 'startup' => 'java -jar test.jar',\n ];\n }", "public function getJob()\n {\n $this->resolveChildren();\n\n $job = new Job($this->getJobConfig());\n\n foreach ($this->children as $child) {\n $job->add($child->getJob());\n }\n\n return $job;\n }", "private function getImmediateFamily()\n {\n if (!isset($this->immediateFamily)) {\n $this->immediateFamily = array();\n\n $relativeIds = array();\n $relativeIdToRelationshipDescriptionMapping = array();\n $individual = $this->getIndividual();\n if (isset($individual['immediate_family']['data']) && count($individual['immediate_family']['data']) > 0) {\n // aggregate relative ids\n $immediateFamily = $individual['immediate_family']['data'];\n foreach ($immediateFamily as $relative) {\n $relativeId = $relative['individual']['id'];\n $relativeIds[] = $relativeId;\n $relativeIdToRelationshipDescriptionMapping[$relativeId] = $relative['relationship_description'];\n }\n }\n\n // get relatives names and personal photo ids\n if (!empty($relativeIds)) {\n $params = array('fields' => 'name,personal_photo');\n $results = $this->getFamilyGraph()->api($relativeIds, $params);\n if ($results) {\n foreach ($results as $relative) {\n $relativeId = $relative['id'];\n $relative['relationship_description'] = isset($relativeIdToRelationshipDescriptionMapping[$relativeId]) ? $relativeIdToRelationshipDescriptionMapping[$relativeId] : '';\n $this->immediateFamily[] = $relative;\n }\n }\n }\n }\n\n return $this->immediateFamily;\n }", "public function job()\n\t{\n\t\t$job = Resque::redis()->get('worker:' . $this);\n\t\tif (!$job) {\n\t\t\treturn array();\n\t\t} else {\n\t\t\treturn json_decode($job, true);\n\t\t}\n\t}", "public function initFromArray($o)\n {\n parent::initFromArray($o);\n if (isset($o['father'])) {\n $this->father = new \\Gedcomx\\Common\\ResourceReference($o[\"father\"]);\n }\n if (isset($o['mother'])) {\n $this->mother = new \\Gedcomx\\Common\\ResourceReference($o[\"mother\"]);\n }\n if (isset($o['child'])) {\n $this->child = new \\Gedcomx\\Common\\ResourceReference($o[\"child\"]);\n }\n $this->fatherFacts = array();\n if (isset($o['fatherFacts'])) {\n foreach ($o['fatherFacts'] as $i => $x) {\n $this->fatherFacts[$i] = new \\Gedcomx\\Conclusion\\Fact($x);\n }\n }\n $this->motherFacts = array();\n if (isset($o['motherFacts'])) {\n foreach ($o['motherFacts'] as $i => $x) {\n $this->motherFacts[$i] = new \\Gedcomx\\Conclusion\\Fact($x);\n }\n }\n }", "function candidateFactory()\n\t{\n\t\treturn [\n\t\t\t'factory'=>(new JbCandidate)\n\t\t];\n\t}", "function getFamily() { return $this->_family; }", "public function createBoss()\n {\n return new FireChampion([\n new Grasp(),\n new SwordAttack(),\n new FireStorm(),\n ]);\n }", "public function getFamily()\n {\n return $this->family;\n }" ]
[ "0.62322813", "0.5693969", "0.52806205", "0.5211765", "0.5205587", "0.5170847", "0.5098012", "0.5050875", "0.50010294", "0.49415702", "0.4844303", "0.48430607", "0.48242843", "0.47815427", "0.47377852", "0.47377852", "0.47288948", "0.47154403", "0.47093543", "0.46740595", "0.46508488", "0.46498412", "0.46210188", "0.46088457", "0.4607356", "0.4601239", "0.45975447", "0.45971987", "0.45879453", "0.4552078" ]
0.71052134
0
Test, that the method 'quote' works with null.
public function testQuoteWorksWithNull() { $quoted = $this->database->quote(null); $this->assertEquals("''", $quoted); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testQuoteWorksWithEmptyString()\n {\n $quoted = $this->database->quote('');\n\n $this->assertEquals(\"''\", $quoted);\n }", "public function testQuoteWorksWithAlreadyQuotedValue()\n {\n $quoted = $this->database->quote(\"NonEmptyValue\");\n $quoted = $this->database->quote($quoted);\n\n $this->assertEquals(\"'\\'NonEmptyValue\\''\", $quoted);\n }", "public function testQuoteWorksWithNonEmptyValue()\n {\n $quoted = $this->database->quote('NonEmptyValue');\n\n $this->assertEquals(\"'NonEmptyValue'\", $quoted);\n }", "public function testQuoteOrNot()\n {\n // Prepare / Mock\n // The key is the expected output and the value is the input.\n $values = [\n \"'quoted_string'\" => 'quoted_string',\n '123' => 123,\n 'COUNT(id)' => 'COUNT(id)',\n 'null' => 'null',\n 'MAX(random_id)' => 'MAX(random_id)',\n 'true' => 'true',\n 'false' => 'false',\n 'THIS_IS_NOT_QUOTED' => 'THIS_IS_NOT_QUOTED',\n \"'THIS_IS_QUOTED'\" => 'THIS_IS_QUOTED',\n ];\n\n // Add more to this array that would not get quoted.\n // The above array with this value will not get quoted.\n $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = ['THIS_IS_NOT_QUOTED'];\n\n // Execute\n foreach ($values as $key => $value) {\n $result = $this->testObject->quoteOrNot($value);\n\n $this->assertEquals($key, $result);\n }\n }", "public function testconstructSQLClauseNullValues()\n {\n $_SESSION['behat']['GenesisSqlExtension']['keywords'] = [];\n $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = [];\n\n // Prepare / Mock\n $glue = ' AND ';\n $columns = [\n 'firstname' => 'null',\n 'lastname' => '!null',\n 'postcode' => '!NULL',\n 'address' => 'NULL'\n ];\n\n // Execute\n $result = $this->testObject->constructSQLClause($glue, $columns);\n\n $expected = \"firstname is null AND lastname is not null AND postcode is not NULL AND address is NULL\";\n\n // Assert Result\n $this->assertEquals($expected, $result);\n }", "abstract public function Quote($data);", "public static function null();", "public function testIsAvailableWithNullCase()\n {\n $orderId = 123;\n\n $this->caseManagement->expects($this->once())\n ->method('getByOrderId')\n ->with($orderId)\n ->willReturn(null);\n\n $this->assertFalse($this->cancelGuaranteeAbility->isAvailable($orderId));\n }", "public function testBindStringParameterNull()\n {\n self::$database->runTransaction(function (Transaction $t) {\n $t->executeUpdate(\n 'INSERT INTO ' . self::TABLE_NAME . '(id, name, registered, rating, age) '\n . 'VALUES($1, $2, $3, $4, $5)',\n [\n 'parameters' => [\n 'p1' => 6,\n 'p2' => null,\n 'p3' => true,\n 'p4' => 5.0,\n 'p5' => 27\n ],\n 'types' => [\n 'p2' => Database::TYPE_STRING\n ]\n ]\n );\n $t->commit();\n });\n\n $res = self::$database->execute('SELECT * FROM ' . self::TABLE_NAME . ' WHERE name IS NULL');\n\n $this->assertCount(1, iterator_to_array($res));\n }", "function Quote($var='')\n\t{\n\t\tif (is_string($var) || is_numeric($var) || is_null($var)) {\n\t\t\treturn trim(str_replace(\"'\",\"''\",$var));\n\t\t} else if (is_array($var)) {\n\t\t\treturn array_map(array($this, 'Quote'), $var);\n\t\t} else {\n\t\t\ttrigger_error(\"Invalid type passed to DB quote\", E_USER_ERROR);\n\t\t\treturn false;\n\t\t}\n\t}", "protected function quote()\n {\n }", "protected function escapeNULL()\n {\n return 'NULL';\n }", "public function testQuoteArrayWithEmptyArray()\n {\n $originalArray = array();\n\n $quotedArray = $this->database->quoteArray($originalArray);\n\n $this->assertEquals($originalArray, $quotedArray);\n }", "function __return_null()\n {\n }", "public function testSelectWithNullWhereParameter()\n {\n $this->db->select(\"test\", new DBField('id'), null);\n $this->assertEquals(\"SELECT `id` FROM test\", (string) $this->db);\n }", "public function testWhereEqualsNull()\n {\n $query = (new WhereBuilder($this->mockConnection))->where('field', '=', null);\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'is',\n 'value' => 'NULL',\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n }", "public function testNull()\r\n {\r\n $s = new XML_Serializer();\r\n $s->serialize(null);\r\n $this->assertEquals('<NULL />', $s->getSerializedData());\r\n }", "public function shouldGetNullIfNoCO(): void\n {\n $this->assertNoPollutantReading('getCO');\n }", "public function test__toString0()\n{\n\n $actual = $this->setCookie->__toString();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "#[@test]\n public function doesMatch_should_work_with_null() {\n $this->sut->setArguments(array(null, null));\n\n $this->assertTrue($this->sut->doesMatchArgs(array(null, null)));\n }", "public function test__toString1()\n{\n\n // Traversed conditions\n // if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) == false (line 88)\n\n $actual = $this->setCookie->__toString();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function it_always_returns_null()\n {\n $object = new Testee(self::TEST_NULL_VALUE);\n $this->assertEquals(null, $object->getValue());\n }", "function pseudoTypeNull(null $var = null) {}", "public function testSchemaValueConnectionQuoting(): void\n {\n $value = 'string';\n\n $connection = $this->getMockBuilder(PDO::class)\n ->disableOriginalConstructor()\n ->onlyMethods(['quote'])\n ->getMock();\n\n $connection\n ->expects($this->once())\n ->method('quote')\n ->with($value, PDO::PARAM_STR)\n ->will($this->returnValue('string'));\n\n $this->driver->setConnection($connection);\n $this->driver->schemaValue($value);\n }", "public function testSetAndRetrieveNull(): void\n {\n $key = \"A nothing test\";\n $this->testNotStrict->set($key, null);\n $a = $this->testNotStrict->get($key);\n $this->assertNull($a);\n $bool = $this->testNotStrict->has($key);\n $this->assertTrue($bool);\n }", "protected function getQuote(?string $qt = null): string\n\t{\n\t\treturn $qt && \\in_array($qt, self::$allowedQuotes, true) ? $qt : $this->sQuoteCharacter;\n\t}", "public function test__toString3()\n{\n\n // Traversed conditions\n // if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) == true (line 88)\n // if ($k === 'Expires') == true (line 89)\n\n $actual = $this->setCookie->__toString();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function test3ProperParamNull($param)\n {\n //Test null in PHPDoc\n }", "public function test3ParamNull($param)\n {\n //Test null in PHPDoc\n }", "public function test__toString2()\n{\n\n // Traversed conditions\n // if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) == true (line 88)\n // if ($k === 'Expires') == false (line 89)\n\n $actual = $this->setCookie->__toString();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}" ]
[ "0.7069636", "0.6617881", "0.65600824", "0.6297719", "0.6247287", "0.6083242", "0.58178574", "0.5784764", "0.57821524", "0.5776364", "0.5757122", "0.56762415", "0.5613706", "0.5597514", "0.5576952", "0.55647266", "0.55552584", "0.5509211", "0.54911363", "0.54777104", "0.5448493", "0.54404247", "0.5435402", "0.54299325", "0.5417936", "0.5393698", "0.53935045", "0.5390435", "0.53729945", "0.537189" ]
0.8191858
0
Test, that the method 'quote' works with an empty string.
public function testQuoteWorksWithEmptyString() { $quoted = $this->database->quote(''); $this->assertEquals("''", $quoted); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testQuoteWorksWithNonEmptyValue()\n {\n $quoted = $this->database->quote('NonEmptyValue');\n\n $this->assertEquals(\"'NonEmptyValue'\", $quoted);\n }", "public function testQuoteWorksWithAlreadyQuotedValue()\n {\n $quoted = $this->database->quote(\"NonEmptyValue\");\n $quoted = $this->database->quote($quoted);\n\n $this->assertEquals(\"'\\'NonEmptyValue\\''\", $quoted);\n }", "public function testQuoteWorksWithNull()\n {\n $quoted = $this->database->quote(null);\n\n $this->assertEquals(\"''\", $quoted);\n }", "public function testQuoteOrNot()\n {\n // Prepare / Mock\n // The key is the expected output and the value is the input.\n $values = [\n \"'quoted_string'\" => 'quoted_string',\n '123' => 123,\n 'COUNT(id)' => 'COUNT(id)',\n 'null' => 'null',\n 'MAX(random_id)' => 'MAX(random_id)',\n 'true' => 'true',\n 'false' => 'false',\n 'THIS_IS_NOT_QUOTED' => 'THIS_IS_NOT_QUOTED',\n \"'THIS_IS_QUOTED'\" => 'THIS_IS_QUOTED',\n ];\n\n // Add more to this array that would not get quoted.\n // The above array with this value will not get quoted.\n $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = ['THIS_IS_NOT_QUOTED'];\n\n // Execute\n foreach ($values as $key => $value) {\n $result = $this->testObject->quoteOrNot($value);\n\n $this->assertEquals($key, $result);\n }\n }", "public function quote($text);", "function testUrlEncodeQuotes1()\n\t{\n\t\t\t$input = 'This is a test without quotes';\n\t\t\t$expectedOutput = 'This is a test without quotes';\n\t\t\t$this->assertEqual (\n\t\t\t\t\t$expectedOutput,\n\t\t\t\t\t$this->stringUtils->urlEncodeQuotes($input)\n\t\t\t);\n\t}", "abstract public function quoteString($value);", "abstract public function Quote($data);", "public function testEmptyString() : void\n {\n $this->assertEmpty($this->sanitizer->sanitize(''));\n }", "public function testQuoteArrayWithEmptyArray()\n {\n $originalArray = array();\n\n $quotedArray = $this->database->quoteArray($originalArray);\n\n $this->assertEquals($originalArray, $quotedArray);\n }", "protected function quote()\n {\n }", "public function testDefaultStringForStringWithQuotes()\n {\n $this->assertEquals(\n static::TEST_STRING . static::TEST_STRING . static::TEST_STRING,\n StringUtils::defaultString(static::TEST_STRING, StringUtils::NULL_STR, static::TEST_STRING)\n );\n }", "public static function quote($value, $empty = 'NULL')\n {\n return QuerySplitter::quote($value, $empty);\n }", "function Quote($var='')\n\t{\n\t\tif (is_string($var) || is_numeric($var) || is_null($var)) {\n\t\t\treturn trim(str_replace(\"'\",\"''\",$var));\n\t\t} else if (is_array($var)) {\n\t\t\treturn array_map(array($this, 'Quote'), $var);\n\t\t} else {\n\t\t\ttrigger_error(\"Invalid type passed to DB quote\", E_USER_ERROR);\n\t\t\treturn false;\n\t\t}\n\t}", "public function testSchemaValueConnectionQuoting(): void\n {\n $value = 'string';\n\n $connection = $this->getMockBuilder(PDO::class)\n ->disableOriginalConstructor()\n ->onlyMethods(['quote'])\n ->getMock();\n\n $connection\n ->expects($this->once())\n ->method('quote')\n ->with($value, PDO::PARAM_STR)\n ->will($this->returnValue('string'));\n\n $this->driver->setConnection($connection);\n $this->driver->schemaValue($value);\n }", "function it_translates_an_empty_string_into_zero()\n {\n $this->add('')->shouldEqual(0);\n }", "function it_translates_an_empty_string_into_zero()\n {\n $this->add('')->shouldEqual(0);\n }", "function test_spaces_around_quotes_never() {\n\t\t$nbsp = \"\\xC2\\xA0\";\n\n\t\t$problem_input = \"$nbsp\\\"A\";\n\t\t$problem_output = \"$nbsp&#8221;A\";\n\n\t\t$this->assertNotEquals( $problem_output, wptexturize( $problem_input ) );\n\t}", "function __return_empty_string()\n {\n }", "public function testEscape()\n\t{\n\t\t$this->assertEquals('foo', $this->_instance->escape('foo'));\n\t}", "public function testQuoteArrayWithFilledArray()\n {\n $originalArray = array('Hello', 'quoteThis');\n\n $quotedArray = $this->database->quoteArray($originalArray);\n\n $expectedQuotedArray = array(\"'Hello'\", \"'quoteThis'\");\n\n $this->assertEquals($expectedQuotedArray, $quotedArray);\n }", "public function testStripQuotes($input, $expected)\n {\n $result = Foo::stripQuotes($input);\n $this->assertSame($expected, $result);\n }", "public function globalStringConditionMatchesOnEmptyLiteralExpressionWithValueSetToEmptyString() {}", "public function globalStringConditionMatchesOnEmptyLiteralExpressionWithValueSetToEmptyString() {}", "public function testconstructSQLClauseNot()\n {\n $_SESSION['behat']['GenesisSqlExtension']['keywords'] = [];\n $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = [];\n\n // Prepare / Mock\n $glue = ' - ';\n $columns = [\n 'firstname' => '!Abdul',\n 'lastname' => 'Qureshi'\n ];\n\n // Execute\n $result = $this->testObject->constructSQLClause($glue, $columns);\n\n $expected = \"firstname != 'Abdul' - lastname = 'Qureshi'\";\n\n // Assert Result\n $this->assertEquals($expected, $result);\n }", "function test_closing_single_quote( $input, $output ) {\n\t\treturn $this->assertEquals( $output, wptexturize( $input ) );\n\t}", "function _validateQuotedString($qstring)\n {\n // Leading and trailing \"\n $qstring = substr($qstring, 1, -1);\n\n // Perform check, removing quoted characters first.\n return !preg_match('/[\\x0D\\\\\\\\\"]/', preg_replace('/\\\\\\\\./', '', $qstring));\n }", "function testUrlEncodeQuotes3()\n\t{\n\t\t\t$input = 'This is a test with a \"double quote';\n\t\t\t$expectedOutput = \"This is a test with a &quot;double quote\";\n\t\t\t$this->assertEqual (\n\t\t\t\t\t$expectedOutput,\n\t\t\t\t\t$this->stringUtils->urlEncodeQuotes($input)\n\t\t\t);\n\t}", "public function testQuoteAndAmp()\n {\n $this->assertProduces('te\"xt te&xt', 'te&quot;xt te&amp;xt');\n }", "function test_closing_quote( $input, $output ) {\n\t\treturn $this->assertEquals( $output, wptexturize( $input ) );\n\t}" ]
[ "0.7626525", "0.74592537", "0.72566724", "0.6786573", "0.63632715", "0.635894", "0.6331138", "0.6232039", "0.62147313", "0.6125124", "0.6114636", "0.6066547", "0.60434616", "0.59777987", "0.5887147", "0.58598226", "0.58598226", "0.5859166", "0.5805425", "0.5802791", "0.5802668", "0.57566893", "0.5747938", "0.5746764", "0.57219064", "0.5719163", "0.57087153", "0.56808555", "0.5669917", "0.5662664" ]
0.81545603
0
Test, that the method 'quote' works with a non empty value.
public function testQuoteWorksWithNonEmptyValue() { $quoted = $this->database->quote('NonEmptyValue'); $this->assertEquals("'NonEmptyValue'", $quoted); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testQuoteWorksWithAlreadyQuotedValue()\n {\n $quoted = $this->database->quote(\"NonEmptyValue\");\n $quoted = $this->database->quote($quoted);\n\n $this->assertEquals(\"'\\'NonEmptyValue\\''\", $quoted);\n }", "public function testQuoteWorksWithEmptyString()\n {\n $quoted = $this->database->quote('');\n\n $this->assertEquals(\"''\", $quoted);\n }", "public function testQuoteOrNot()\n {\n // Prepare / Mock\n // The key is the expected output and the value is the input.\n $values = [\n \"'quoted_string'\" => 'quoted_string',\n '123' => 123,\n 'COUNT(id)' => 'COUNT(id)',\n 'null' => 'null',\n 'MAX(random_id)' => 'MAX(random_id)',\n 'true' => 'true',\n 'false' => 'false',\n 'THIS_IS_NOT_QUOTED' => 'THIS_IS_NOT_QUOTED',\n \"'THIS_IS_QUOTED'\" => 'THIS_IS_QUOTED',\n ];\n\n // Add more to this array that would not get quoted.\n // The above array with this value will not get quoted.\n $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = ['THIS_IS_NOT_QUOTED'];\n\n // Execute\n foreach ($values as $key => $value) {\n $result = $this->testObject->quoteOrNot($value);\n\n $this->assertEquals($key, $result);\n }\n }", "public function testQuoteWorksWithNull()\n {\n $quoted = $this->database->quote(null);\n\n $this->assertEquals(\"''\", $quoted);\n }", "abstract public function quoteString($value);", "public static function quote($value, $empty = 'NULL')\n {\n return QuerySplitter::quote($value, $empty);\n }", "abstract public function Quote($data);", "public function testValuePassThrough() {\n\t\t$result = $this->Js->value('string \"quote\"', true);\n\t\t$expected = '\"string \\\"quote\\\"\"';\n\t\t$this->assertEquals($expected, $result);\n\t}", "public function testSchemaValueConnectionQuoting(): void\n {\n $value = 'string';\n\n $connection = $this->getMockBuilder(PDO::class)\n ->disableOriginalConstructor()\n ->onlyMethods(['quote'])\n ->getMock();\n\n $connection\n ->expects($this->once())\n ->method('quote')\n ->with($value, PDO::PARAM_STR)\n ->will($this->returnValue('string'));\n\n $this->driver->setConnection($connection);\n $this->driver->schemaValue($value);\n }", "function Quote($var='')\n\t{\n\t\tif (is_string($var) || is_numeric($var) || is_null($var)) {\n\t\t\treturn trim(str_replace(\"'\",\"''\",$var));\n\t\t} else if (is_array($var)) {\n\t\t\treturn array_map(array($this, 'Quote'), $var);\n\t\t} else {\n\t\t\ttrigger_error(\"Invalid type passed to DB quote\", E_USER_ERROR);\n\t\t\treturn false;\n\t\t}\n\t}", "public function quote($text);", "public function testQuoteArrayWithEmptyArray()\n {\n $originalArray = array();\n\n $quotedArray = $this->database->quoteArray($originalArray);\n\n $this->assertEquals($originalArray, $quotedArray);\n }", "protected function quote(?string $value): string {\n\n\t\t\t$quote = $this->quoteInputEncoded;\n\n\t\t\tif ($value === null)\n\t\t\t\treturn \"{$quote}{$quote}\";\n\n\t\t\t$value = str_replace($quote, \"{$quote}{$quote}\", $value);\n\n\t\t\treturn \"{$quote}{$value}{$quote}\";\n\t\t}", "public function quoteValue(mixed $value): mixed;", "protected function quote()\n {\n }", "public function testQuoteArrayWithFilledArray()\n {\n $originalArray = array('Hello', 'quoteThis');\n\n $quotedArray = $this->database->quoteArray($originalArray);\n\n $expectedQuotedArray = array(\"'Hello'\", \"'quoteThis'\");\n\n $this->assertEquals($expectedQuotedArray, $quotedArray);\n }", "function _check_magic_quotes($value){\n\t\treturn $this->_magic_quotes?stripslashes($value):$value;\n\t}", "function testUrlEncodeQuotes1()\n\t{\n\t\t\t$input = 'This is a test without quotes';\n\t\t\t$expectedOutput = 'This is a test without quotes';\n\t\t\t$this->assertEqual (\n\t\t\t\t\t$expectedOutput,\n\t\t\t\t\t$this->stringUtils->urlEncodeQuotes($input)\n\t\t\t);\n\t}", "public function isQuoted(): bool\n\t{\n\t\treturn preg_match('/^\".+?\"$/', $this->getValue());\n\t}", "public function getQuote();", "public static function quote(mixed $val = \"\", string $q = \"\\\"\"): string\n {\n if (is_string($val)) {\n return $q . $val . $q;\n } elseif (is_numeric($val)) {\n return $val;\n } elseif (is_array($val)) {\n return \"StringUtils::quote returned 'array'! \";\n } else {\n return $q . $val . $q;\n }\n }", "public function quote($stringValue);", "function quote_smart($value)\n {\n return $value;\n }", "private function createQuote()\n {\n $isRegular = true;\n $negotiableQuote =\n $this->createPartialMock(\\Magento\\NegotiableQuote\\Model\\NegotiableQuote::class, ['getIsRegularQuote']);\n $negotiableQuote->expects($this->any())\n ->method('getIsRegularQuote')\n ->will($this->returnValue($isRegular));\n $extension = $this->getMockForAbstractClass(\n \\Magento\\Quote\\Api\\Data\\CartExtensionInterface::class,\n [],\n '',\n false,\n false,\n true,\n ['getNegotiableQuote']\n );\n $extension->expects($this->any())\n ->method('getNegotiableQuote')\n ->willReturn($negotiableQuote);\n $this->quote = $this->getMockForAbstractClass(\n \\Magento\\Quote\\Api\\Data\\CartInterface::class,\n ['getExtensionAttributes', 'getId'],\n '',\n false,\n false,\n true,\n ['getAppliedRuleIds']\n );\n $this->quote->expects($this->any())\n ->method('getExtensionAttributes')\n ->willReturn($extension);\n $this->quote->expects($this->any())\n ->method('getAppliedRuleIds')\n ->will($this->returnValue('1'));\n $this->quoteRepository->expects($this->any())\n ->method('get')\n ->willReturn($this->quote);\n }", "public function quote($value)\n\t{\n\t\treturn $this->c->quote($value);\n\t}", "public function quote($value) {\n $new_value = $this->db->quote($value);\n if (($value!=='' || $value!==NULL) && !$new_value) {\n $value = \"'\" . str_replace(\"'\", \"''\", $value) . \"'\";\n }\n else {\n $value = $new_value;\n }\n return $value;\n }", "function test_closing_single_quote( $input, $output ) {\n\t\treturn $this->assertEquals( $output, wptexturize( $input ) );\n\t}", "function sql_quote_string($val,$dbh=NULL) {\n global $SQL_DBH;\n if (is_null($dbh))\n return $SQL_DBH->quote($val);\n else\n return $dbh->quote($val);\n }", "public function testconstructSQLClauseNullValues()\n {\n $_SESSION['behat']['GenesisSqlExtension']['keywords'] = [];\n $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = [];\n\n // Prepare / Mock\n $glue = ' AND ';\n $columns = [\n 'firstname' => 'null',\n 'lastname' => '!null',\n 'postcode' => '!NULL',\n 'address' => 'NULL'\n ];\n\n // Execute\n $result = $this->testObject->constructSQLClause($glue, $columns);\n\n $expected = \"firstname is null AND lastname is not null AND postcode is not NULL AND address is NULL\";\n\n // Assert Result\n $this->assertEquals($expected, $result);\n }", "function test_closing_quote( $input, $output ) {\n\t\treturn $this->assertEquals( $output, wptexturize( $input ) );\n\t}" ]
[ "0.79104733", "0.75641", "0.7298691", "0.71054745", "0.66218436", "0.6510129", "0.6481575", "0.63827497", "0.63782746", "0.6306501", "0.604792", "0.60294026", "0.6005863", "0.60017484", "0.59420395", "0.5915872", "0.59061587", "0.58690095", "0.58325493", "0.5825457", "0.5822829", "0.5798326", "0.5775916", "0.57706463", "0.57095546", "0.5707786", "0.5644686", "0.56354886", "0.5627925", "0.5597807" ]
0.80302304
0
Test, that the method 'quote' works with an already quoted value.
public function testQuoteWorksWithAlreadyQuotedValue() { $quoted = $this->database->quote("NonEmptyValue"); $quoted = $this->database->quote($quoted); $this->assertEquals("'\'NonEmptyValue\''", $quoted); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function quoteString($value);", "public function testQuoteOrNot()\n {\n // Prepare / Mock\n // The key is the expected output and the value is the input.\n $values = [\n \"'quoted_string'\" => 'quoted_string',\n '123' => 123,\n 'COUNT(id)' => 'COUNT(id)',\n 'null' => 'null',\n 'MAX(random_id)' => 'MAX(random_id)',\n 'true' => 'true',\n 'false' => 'false',\n 'THIS_IS_NOT_QUOTED' => 'THIS_IS_NOT_QUOTED',\n \"'THIS_IS_QUOTED'\" => 'THIS_IS_QUOTED',\n ];\n\n // Add more to this array that would not get quoted.\n // The above array with this value will not get quoted.\n $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = ['THIS_IS_NOT_QUOTED'];\n\n // Execute\n foreach ($values as $key => $value) {\n $result = $this->testObject->quoteOrNot($value);\n\n $this->assertEquals($key, $result);\n }\n }", "public function testQuoteWorksWithNonEmptyValue()\n {\n $quoted = $this->database->quote('NonEmptyValue');\n\n $this->assertEquals(\"'NonEmptyValue'\", $quoted);\n }", "public function testQuoteWorksWithEmptyString()\n {\n $quoted = $this->database->quote('');\n\n $this->assertEquals(\"''\", $quoted);\n }", "abstract public function Quote($data);", "public function quote($text);", "public function testSchemaValueConnectionQuoting(): void\n {\n $value = 'string';\n\n $connection = $this->getMockBuilder(PDO::class)\n ->disableOriginalConstructor()\n ->onlyMethods(['quote'])\n ->getMock();\n\n $connection\n ->expects($this->once())\n ->method('quote')\n ->with($value, PDO::PARAM_STR)\n ->will($this->returnValue('string'));\n\n $this->driver->setConnection($connection);\n $this->driver->schemaValue($value);\n }", "public function quote($stringValue);", "public function testQuoteWorksWithNull()\n {\n $quoted = $this->database->quote(null);\n\n $this->assertEquals(\"''\", $quoted);\n }", "protected function quote()\n {\n }", "public function quote($value)\n\t{\n\t\treturn $this->c->quote($value);\n\t}", "public function quote($value) {\n\t\treturn $this -> getAdapter() -> quote($value);\n\t}", "public function testValuePassThrough() {\n\t\t$result = $this->Js->value('string \"quote\"', true);\n\t\t$expected = '\"string \\\"quote\\\"\"';\n\t\t$this->assertEquals($expected, $result);\n\t}", "protected function quote(?string $value): string {\n\n\t\t\t$quote = $this->quoteInputEncoded;\n\n\t\t\tif ($value === null)\n\t\t\t\treturn \"{$quote}{$quote}\";\n\n\t\t\t$value = str_replace($quote, \"{$quote}{$quote}\", $value);\n\n\t\t\treturn \"{$quote}{$value}{$quote}\";\n\t\t}", "public static function quote($value) {\n $connection = self::getConnection();\n return $connection -> quote($value);\n }", "static function quote($value)\n\t{\n\t\treturn \"'\" . str_replace(\"'\", \"\\\\'\", $value) . \"'\";\n\t}", "public function quoteValue(mixed $value): mixed;", "function quote($value, $type)\n {\n return $this->dbc->quoteSmart($value);\n }", "function testUrlEncodeQuotes3()\n\t{\n\t\t\t$input = 'This is a test with a \"double quote';\n\t\t\t$expectedOutput = \"This is a test with a &quot;double quote\";\n\t\t\t$this->assertEqual (\n\t\t\t\t\t$expectedOutput,\n\t\t\t\t\t$this->stringUtils->urlEncodeQuotes($input)\n\t\t\t);\n\t}", "function sql_quote_string($val,$dbh=NULL) {\n global $SQL_DBH;\n if (is_null($dbh))\n return $SQL_DBH->quote($val);\n else\n return $dbh->quote($val);\n }", "public static function quote( $value ) {\n\t\t# Quote \\ here, because it needs always escaping\n\t\t$value = addcslashes( $value, '\\\\' );\n\n\t\t# For readability\n\t\t$single = \"'\";\n\t\t$double = '\"';\n\t\t$quote = $single;\n\n\t\t# It is safe to use '-quoting, unless there is '-quote in the text\n\t\tif ( strpos( $value, $single ) !== false ) {\n\t\t\t# In case there is no variables that need to be escaped, just use \"-quote\n\t\t\tif ( strpos( $value, $double ) === false && !preg_match( '/\\$[^0-9]/', $value ) ) {\n\t\t\t\t$quote = $double;\n\t\t\t# Something needs quoting, pick the quote which causes less quoting\n\t\t\t} else {\n\t\t\t\t$doubleEsc = substr_count( $value, $double ) + substr_count( $value, '$' );\n\t\t\t\t$singleEsc = substr_count( $value, $single );\n\n\t\t\t\tif ( $doubleEsc < $singleEsc ) {\n\t\t\t\t\t$quote = $double;\n\t\t\t\t\t$extra = '$';\n\t\t\t\t} else {\n\t\t\t\t\t$extra = '';\n\t\t\t\t}\n\n\t\t\t\t$value = addcslashes( $value, $quote . $extra );\n\t\t\t}\n\t\t}\n\n\t\treturn $quote . $value . $quote;\n\t}", "public function quote($value) {\n $new_value = $this->db->quote($value);\n if (($value!=='' || $value!==NULL) && !$new_value) {\n $value = \"'\" . str_replace(\"'\", \"''\", $value) . \"'\";\n }\n else {\n $value = $new_value;\n }\n return $value;\n }", "function testUrlEncodeQuotes1()\n\t{\n\t\t\t$input = 'This is a test without quotes';\n\t\t\t$expectedOutput = 'This is a test without quotes';\n\t\t\t$this->assertEqual (\n\t\t\t\t\t$expectedOutput,\n\t\t\t\t\t$this->stringUtils->urlEncodeQuotes($input)\n\t\t\t);\n\t}", "function quote_smart($value)\n {\n return $value;\n }", "public function getQuote();", "function add_quote($value) {\n\t\treturn '\"' . addslashes($value) . '\"';\n\t}", "public static function quote($value)\n {\n return QueryParser::quote($value);\n }", "function testUrlEncodeQuotes2()\n\t{\n\t\t\t$input = \"This is a test with a 'single quote\";\n\t\t\t$expectedOutput = \"This is a test with a &#39;single quote\";\n\t\t\t$this->assertEqual (\n\t\t\t\t\t$expectedOutput,\n\t\t\t\t\t$this->stringUtils->urlEncodeQuotes($input)\n\t\t\t);\n\t}", "protected function _quote ($value)\n {\n if (is_int($value) || is_float($value))\n {\n return $value;\n }\n\n $this->_connect();\n\n return $this->_connection->quote($value);\n }", "public function quote($value){\n $connection = $this -> connect();\n return pg_escape_literal($value);\n }" ]
[ "0.7531826", "0.74169225", "0.7311358", "0.72213227", "0.7098994", "0.70037824", "0.6971641", "0.6855499", "0.6769393", "0.6767682", "0.67640966", "0.67507625", "0.6731821", "0.6695234", "0.66736084", "0.66210836", "0.64541465", "0.64439815", "0.6431746", "0.64203745", "0.6405538", "0.63873106", "0.63819164", "0.63501805", "0.63372993", "0.6284908", "0.627607", "0.6236014", "0.6208578", "0.6201757" ]
0.831404
0
Test, that the method 'quoteArray' works with an empty array.
public function testQuoteArrayWithEmptyArray() { $originalArray = array(); $quotedArray = $this->database->quoteArray($originalArray); $this->assertEquals($originalArray, $quotedArray); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testQuoteArrayWithFilledArray()\n {\n $originalArray = array('Hello', 'quoteThis');\n\n $quotedArray = $this->database->quoteArray($originalArray);\n\n $expectedQuotedArray = array(\"'Hello'\", \"'quoteThis'\");\n\n $this->assertEquals($expectedQuotedArray, $quotedArray);\n }", "public function testImplodeArrayWithInnerArrayAndQuotes()\n {\n $this->assertEquals(\n StringUtils::QUOTE . StringUtils::QUOTE,\n StringUtils::implodeRecursively(array(array()), StringUtils::EMPTY_STR, StringUtils::QUOTE)\n );\n }", "public function testImplodeEmptyArray()\n {\n $this->assertEquals(StringUtils::EMPTY_STR, StringUtils::implodeRecursively(array()));\n }", "public function testDefaultStringForArrayWithQuotes()\n {\n $this->assertEquals(\n static::TEST_STRING . static::TEST_STRING,\n StringUtils::defaultString(array(), StringUtils::NULL_STR, static::TEST_STRING)\n );\n }", "public function testNewArrayIsEmpty()\n {\n $fixture = array();\n \n // Assert that the size of the Array fixture is 0.\n $this->assertEquals(0, sizeof($fixture));\n }", "public function testResultArrayReturnsEmptyArray(): void\n {\n $value = $this->class->result_array();\n\n $this->assertIsArray($value);\n $this->assertEmpty($value);\n }", "public function testEmptyArray() {\n\t\t$array = array(\"a\", \"b\", \"c\");\n\t\t$notInArray = \"\";\n\n\t\t$this->assertFalse(permissionInPermissions($array, $notInArray));\n\t\t$this->assertFalse(permissionInPermissions($array, null));\n\t}", "public function testImplodeArrayWithNull()\n {\n $this->assertEquals(StringUtils::NULL_STR, StringUtils::implodeRecursively(array(null)));\n }", "function __return_empty_array()\n {\n }", "public function testImplodeArrayWithGlue()\n {\n $this->assertEquals(\n StringUtils::QUOTE . static::TEST_STRING . StringUtils::QUOTE . StringUtils::ARRAY_VALUES_SEPARATOR\n . StringUtils::QUOTE . static::TEST_STRING . StringUtils::QUOTE,\n StringUtils::implodeRecursively(\n array(static::TEST_STRING, static::TEST_STRING),\n StringUtils::ARRAY_VALUES_SEPARATOR\n )\n );\n }", "public function testBasicToArrayVoid() {\n\t\t$result = $this->entity->toArray(true);\n\t\t\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertTrue(sizeof($result) > 0);\n\t}", "public function testToArray()\n {\n $this->todo('stub');\n }", "public function testArrayize()\n {\n // check with empty array as input\n $array = array();\n $this->assertEquals($array, Arrays::arrayize($array));\n\n // check non-empty array as input\n $array = array('key' => 'value');\n $this->assertEquals($array, Arrays::arrayize($array));\n\n // check indexes are ignored when input is an array\n $this->assertArrayNotHasKey('invalid', Arrays::arrayize($array, 'invalid'));\n\n // check default index\n $expected = array('string');\n $this->assertEquals($expected, Arrays::arrayize($expected[0]));\n\n // check string index\n $index = 'key';\n $expected = array($index => 'string');\n $this->assertEquals($expected, Arrays::arrayize($expected[$index], $index));\n }", "public function testEmptyArray(): void\n {\n $functionName = 'serialize_Tests_Liip_Serializer_Fixtures_ListModel';\n self::generateSerializers(self::$metadataBuilder, ListModel::class, [$functionName]);\n\n $list = new ListModel();\n $list->array = [];\n $list->hashmap = [];\n $list->listNested = [];\n $data = $functionName($list);\n\n self::assertIsArray($data);\n self::assertArrayHasKey('array', $data);\n self::assertSame([], $data['array']);\n self::assertArrayHasKey('list_nested', $data);\n self::assertSame([], $data['list_nested']);\n self::assertArrayHasKey('hashmap', $data);\n self::assertInstanceOf(\\stdClass::class, $data['hashmap']);\n self::assertCount(0, get_object_vars($data['hashmap']));\n }", "function quoteArr($array) { \n\t\tforeach($array as $key=>$a)\n\t\t{\n\t\t\tif(!is_numeric($array[$key])){\n\t\t\t\t$array[$key] = $this->quote($a);\n\t\t\t}\n\t\t}\n\t\treturn $array;\n }", "function testEmptyInputArray(){\r\n\t\t\r\n\t\t$c = new GenerateWordCloud();\r\n\t\t$words = array();\r\n\t\t$stopwords = array();\r\n\t\tarray_push($stopwords, 'deleted');\r\n\t\t$wordsFiltered = $c->stopWordFilter($words, $stopwords);\r\n\t\t$this -> assertEmpty($wordsFiltered);\r\n\r\n\t}", "public function testDecorateWithEmptyArray()\n {\n $decorator = new ChainDecorator();\n $decorator->decorate($context = new Context());\n\n static::assertEquals([], $context->all());\n }", "public function testResultsAsArray()\n {\n $this->assertNull(null);\n }", "public function testImplodeArrayWithKeys()\n {\n $this->assertEquals(\n StringUtils::QUOTE . static::TEST_STRING . StringUtils::QUOTE . '=' . StringUtils::QUOTE . static::TEST_STRING\n . StringUtils::QUOTE,\n StringUtils::implodeRecursively(\n array(static::TEST_STRING => static::TEST_STRING),\n StringUtils::EMPTY_STR,\n null,\n true\n )\n );\n }", "public function testImplodeArrayWithInnerArray()\n {\n $this->assertEquals(\n StringUtils::OPEN_SQUARE_BRACKET . StringUtils::CLOSE_SQUARE_BRACKET,\n StringUtils::implodeRecursively(array(array()))\n );\n }", "public function testQuoteWorksWithNonEmptyValue()\n {\n $quoted = $this->database->quote('NonEmptyValue');\n\n $this->assertEquals(\"'NonEmptyValue'\", $quoted);\n }", "public function fullQuoteArray($arr, $table, $noQuote = false, $allowNull = false)\n {\n if (is_string($noQuote)) {\n $noQuote = explode(',', $noQuote);\n } elseif (! is_array($noQuote)) {\n $noQuote = (bool) $noQuote;\n }\n if ($noQuote === true) {\n return $arr;\n }\n foreach ($arr as $k => $v) {\n if ($noQuote === false || ! in_array($k, $noQuote)) {\n $arr[$k] = $this->fullQuoteStr($v, $table, $allowNull);\n }\n }\n return $arr;\n }", "public function testFetchArray()\n {\n $this->todo('stub');\n }", "public static function emptyArray()\n {\n $isEmpty = self::arrayWithSize(0);\n return Hamcrest_Core_DescribedAs::describedAs('an empty array', $isEmpty);\n }", "public function testDefaultStringForArray()\n {\n $this->assertEquals(\n StringUtils::OPEN_SQUARE_BRACKET . StringUtils::CLOSE_SQUARE_BRACKET,\n StringUtils::defaultString(array())\n );\n }", "public function testQuoteWorksWithEmptyString()\n {\n $quoted = $this->database->quote('');\n\n $this->assertEquals(\"''\", $quoted);\n }", "public function testQuoteOrNot()\n {\n // Prepare / Mock\n // The key is the expected output and the value is the input.\n $values = [\n \"'quoted_string'\" => 'quoted_string',\n '123' => 123,\n 'COUNT(id)' => 'COUNT(id)',\n 'null' => 'null',\n 'MAX(random_id)' => 'MAX(random_id)',\n 'true' => 'true',\n 'false' => 'false',\n 'THIS_IS_NOT_QUOTED' => 'THIS_IS_NOT_QUOTED',\n \"'THIS_IS_QUOTED'\" => 'THIS_IS_QUOTED',\n ];\n\n // Add more to this array that would not get quoted.\n // The above array with this value will not get quoted.\n $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = ['THIS_IS_NOT_QUOTED'];\n\n // Execute\n foreach ($values as $key => $value) {\n $result = $this->testObject->quoteOrNot($value);\n\n $this->assertEquals($key, $result);\n }\n }", "public function testAssertIsArrayNotEmpty()\n {\n $this->assertIsArrayNotEmpty(['value']);\n\n foreach ([\n [],\n [[]],\n [false],\n [null],\n [''],\n ] as $array) {\n $this->assertException(AssertionFailedError::class, function () use ($array) {\n $this->assertIsArrayNotEmpty($array);\n });\n }\n }", "public function aArray() {}", "public function testCallIgnoresArrayTypeHint()\n {\n $c = new Container;\n $returned = $c->call(function (array $foo = []) {\n return $foo;\n });\n\n $this->assertInternalType('array', $returned);\n $this->assertEmpty($returned);\n }" ]
[ "0.83158636", "0.70378566", "0.68605334", "0.6532251", "0.64105356", "0.63260376", "0.62478715", "0.6235537", "0.62222785", "0.62154603", "0.6164986", "0.61360985", "0.61207527", "0.61153096", "0.6115112", "0.6077848", "0.60670465", "0.60221696", "0.59983295", "0.5940904", "0.5939202", "0.5914701", "0.59123653", "0.5897221", "0.5876026", "0.5868539", "0.5852935", "0.5832459", "0.583226", "0.58314013" ]
0.8767763
0
Test, that the method 'quoteArray' works with a non empty array.
public function testQuoteArrayWithFilledArray() { $originalArray = array('Hello', 'quoteThis'); $quotedArray = $this->database->quoteArray($originalArray); $expectedQuotedArray = array("'Hello'", "'quoteThis'"); $this->assertEquals($expectedQuotedArray, $quotedArray); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testQuoteArrayWithEmptyArray()\n {\n $originalArray = array();\n\n $quotedArray = $this->database->quoteArray($originalArray);\n\n $this->assertEquals($originalArray, $quotedArray);\n }", "public function testImplodeArrayWithInnerArrayAndQuotes()\n {\n $this->assertEquals(\n StringUtils::QUOTE . StringUtils::QUOTE,\n StringUtils::implodeRecursively(array(array()), StringUtils::EMPTY_STR, StringUtils::QUOTE)\n );\n }", "public function testImplodeEmptyArray()\n {\n $this->assertEquals(StringUtils::EMPTY_STR, StringUtils::implodeRecursively(array()));\n }", "public function testImplodeArrayWithGlue()\n {\n $this->assertEquals(\n StringUtils::QUOTE . static::TEST_STRING . StringUtils::QUOTE . StringUtils::ARRAY_VALUES_SEPARATOR\n . StringUtils::QUOTE . static::TEST_STRING . StringUtils::QUOTE,\n StringUtils::implodeRecursively(\n array(static::TEST_STRING, static::TEST_STRING),\n StringUtils::ARRAY_VALUES_SEPARATOR\n )\n );\n }", "public function testDefaultStringForArrayWithQuotes()\n {\n $this->assertEquals(\n static::TEST_STRING . static::TEST_STRING,\n StringUtils::defaultString(array(), StringUtils::NULL_STR, static::TEST_STRING)\n );\n }", "public function testImplodeArrayWithNull()\n {\n $this->assertEquals(StringUtils::NULL_STR, StringUtils::implodeRecursively(array(null)));\n }", "public function testImplodeArrayWithInnerArray()\n {\n $this->assertEquals(\n StringUtils::OPEN_SQUARE_BRACKET . StringUtils::CLOSE_SQUARE_BRACKET,\n StringUtils::implodeRecursively(array(array()))\n );\n }", "function quoteArr($array) { \n\t\tforeach($array as $key=>$a)\n\t\t{\n\t\t\tif(!is_numeric($array[$key])){\n\t\t\t\t$array[$key] = $this->quote($a);\n\t\t\t}\n\t\t}\n\t\treturn $array;\n }", "public function testArrayize()\n {\n // check with empty array as input\n $array = array();\n $this->assertEquals($array, Arrays::arrayize($array));\n\n // check non-empty array as input\n $array = array('key' => 'value');\n $this->assertEquals($array, Arrays::arrayize($array));\n\n // check indexes are ignored when input is an array\n $this->assertArrayNotHasKey('invalid', Arrays::arrayize($array, 'invalid'));\n\n // check default index\n $expected = array('string');\n $this->assertEquals($expected, Arrays::arrayize($expected[0]));\n\n // check string index\n $index = 'key';\n $expected = array($index => 'string');\n $this->assertEquals($expected, Arrays::arrayize($expected[$index], $index));\n }", "public function testEmptyArray() {\n\t\t$array = array(\"a\", \"b\", \"c\");\n\t\t$notInArray = \"\";\n\n\t\t$this->assertFalse(permissionInPermissions($array, $notInArray));\n\t\t$this->assertFalse(permissionInPermissions($array, null));\n\t}", "public function testImplodeArrayWithKeys()\n {\n $this->assertEquals(\n StringUtils::QUOTE . static::TEST_STRING . StringUtils::QUOTE . '=' . StringUtils::QUOTE . static::TEST_STRING\n . StringUtils::QUOTE,\n StringUtils::implodeRecursively(\n array(static::TEST_STRING => static::TEST_STRING),\n StringUtils::EMPTY_STR,\n null,\n true\n )\n );\n }", "public function testToArray()\n {\n $this->todo('stub');\n }", "public function testResultArrayReturnsEmptyArray(): void\n {\n $value = $this->class->result_array();\n\n $this->assertIsArray($value);\n $this->assertEmpty($value);\n }", "public function testBasicToArrayVoid() {\n\t\t$result = $this->entity->toArray(true);\n\t\t\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertTrue(sizeof($result) > 0);\n\t}", "public function fullQuoteArray($arr, $table, $noQuote = false, $allowNull = false)\n {\n if (is_string($noQuote)) {\n $noQuote = explode(',', $noQuote);\n } elseif (! is_array($noQuote)) {\n $noQuote = (bool) $noQuote;\n }\n if ($noQuote === true) {\n return $arr;\n }\n foreach ($arr as $k => $v) {\n if ($noQuote === false || ! in_array($k, $noQuote)) {\n $arr[$k] = $this->fullQuoteStr($v, $table, $allowNull);\n }\n }\n return $arr;\n }", "public function testArrayImplode4()\n {\n $query = \\Jenius\\JeniusHttp::arrayImplode('=', '&', array());\n $this->assertEquals('parameter array tidak boleh kosong.', $query);\n }", "public function testArrayFunctions()\n {\n // list - Assign variables as if they were an array\n list(,, list($var)) = ['a', 'b', ['c', 'd']];\n //$this->assertEquals('c', $var);\n\n // implode — Join array elements with a string\n $var = implode([1, 2, 3, 4]);\n //$this->assertEquals(?, $var);\n\n // sizeof — Alias of count\n // TODO to be implemented\n\n // unset — Unset a given variable\n $arr = [1, 2, 3, 4];\n unset($arr[0]);\n //$this->assertEquals(?, array_keys($arr));\n\n // isset — Determine if a variable is declared and is different than NULL\n $arr = [1, 2, 'key' => 'value', null];\n //$this->assertEquals(?, isset($arr[0]));\n //$this->assertEquals(?, isset($arr['key']));\n //$this->assertEquals(?, isset($arr[2]));\n\n // array_key_exists — Checks if the given key or index exists in the array\n $arr = [1, 2, 'key' => 'value', null];\n //$this->assertEquals(?, array_key_exists(0, $arr));\n //$this->assertEquals(?, array_key_exists('key', $arr));\n //$this->assertEquals(?, array_key_exists(2, $arr));\n\n // in_array — Checks if a value exists in an array\n // TODO to be implemented\n\n // array_flip — Exchanges all keys with their associated values in an array\n // TODO to be implemented\n\n // array_reverse — Return an array with elements in reverse order\n // TODO to be implemented\n\n // array_keys — Return all the keys or a subset of the keys of an array\n // TODO to be implemented\n\n // array_values — Return all the values of an array\n // TODO to be implemented\n\n // array_filter — Filters elements of an array using a callback function\n $arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n //$this->assertEquals(?, array_filter($arr, function ($value) {\n // return $value % 2 > 0;\n //}));\n\n // array_map — Applies the callback to the elements of the given arrays\n $arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n //$this->assertEquals(?, array_map(function ($value) {\n // return $value * 2;\n //}, $arr));\n\n // sort — Sort an array\n // TODO to be implemented\n\n // rsort — Sort an array in reverse order\n // TODO to be implemented\n\n // ksort — Sort an array by key\n // TODO to be implemented\n\n // usort — Sort an array by values using a user-defined comparison function\n // TODO to be implemented\n\n // array_push — Push one or more elements onto the end of array\n // array_pop — Pop the element off the end of array\n // TODO to be implemented\n\n // array_shift — Shift an element off the beginning of array\n // array_unshift — Prepend one or more elements to the beginning of an array\n // TODO to be implemented\n }", "function __return_empty_array()\n {\n }", "private static function doFixArray(array &$array){\n if( get_magic_quotes_gpc() == 1 ){\n foreach($array as $key => $value){\n if( is_array($value) )\n $array[$key] = self::doFixArray($value);\n else\n $array[$key] = stripslashes($value);\n }\n }\n }", "public function testAssertIsArrayNotEmpty()\n {\n $this->assertIsArrayNotEmpty(['value']);\n\n foreach ([\n [],\n [[]],\n [false],\n [null],\n [''],\n ] as $array) {\n $this->assertException(AssertionFailedError::class, function () use ($array) {\n $this->assertIsArrayNotEmpty($array);\n });\n }\n }", "public function testNewArrayIsEmpty()\n {\n $fixture = array();\n \n // Assert that the size of the Array fixture is 0.\n $this->assertEquals(0, sizeof($fixture));\n }", "public function testQuoteWorksWithNonEmptyValue()\n {\n $quoted = $this->database->quote('NonEmptyValue');\n\n $this->assertEquals(\"'NonEmptyValue'\", $quoted);\n }", "public function testIsArray() {\n\t\t$array = array('one' => 1, 'two' => 2);\n\t\t$result = _::isArray($array);\n\t\t$this->assertTrue($result);\n\n\t\t// test that an object is not an array\n\t\t$object = (object)$array;\n\t\t$result = _::isArray($object);\n\t\t$this->assertFalse($result);\n\t}", "function rest_sanitize_array($maybe_array)\n {\n }", "public function testQuoteWorksWithAlreadyQuotedValue()\n {\n $quoted = $this->database->quote(\"NonEmptyValue\");\n $quoted = $this->database->quote($quoted);\n\n $this->assertEquals(\"'\\'NonEmptyValue\\''\", $quoted);\n }", "public function testQuoteOrNot()\n {\n // Prepare / Mock\n // The key is the expected output and the value is the input.\n $values = [\n \"'quoted_string'\" => 'quoted_string',\n '123' => 123,\n 'COUNT(id)' => 'COUNT(id)',\n 'null' => 'null',\n 'MAX(random_id)' => 'MAX(random_id)',\n 'true' => 'true',\n 'false' => 'false',\n 'THIS_IS_NOT_QUOTED' => 'THIS_IS_NOT_QUOTED',\n \"'THIS_IS_QUOTED'\" => 'THIS_IS_QUOTED',\n ];\n\n // Add more to this array that would not get quoted.\n // The above array with this value will not get quoted.\n $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = ['THIS_IS_NOT_QUOTED'];\n\n // Execute\n foreach ($values as $key => $value) {\n $result = $this->testObject->quoteOrNot($value);\n\n $this->assertEquals($key, $result);\n }\n }", "public function testDefaultStringForArray()\n {\n $this->assertEquals(\n StringUtils::OPEN_SQUARE_BRACKET . StringUtils::CLOSE_SQUARE_BRACKET,\n StringUtils::defaultString(array())\n );\n }", "function db_quote_many($array) {\n $to_return = array();\n foreach($array as $value) {\n $to_return[] = db_quote($value);\n }\n return $to_return;\n}", "public function testEscapeArgArrayc()\n {\n \t$client = new RPC_Client_Exec('/bin/ls', array('arrayc'=>array('glue'=>',', 'key-value'=>':', 'key-prefix'=>'-')));\n\n \t$this->assertEquals(\"'a','b','c'\", $client->escapeArg(array('a', 'b', 'c')));\n \t$this->assertEquals(\"'-host':'localhost','-port':'3306','-db':'mydb'\", $client->escapeArg(array('host'=>'localhost', 'port'=>3306, 'db'=>'mydb')));\n }", "function stripslashes_array( $given ) {\n return is_array( $given ) ? array_map( 'stripslashes', $given ) : stripslashes( $given );\n}" ]
[ "0.85830885", "0.72370136", "0.6765561", "0.6455984", "0.6429586", "0.63478357", "0.6231204", "0.622855", "0.6198356", "0.61176497", "0.61146164", "0.60594577", "0.59955674", "0.59897053", "0.5985017", "0.59737647", "0.5956799", "0.5951516", "0.5947273", "0.5912014", "0.5907608", "0.58932924", "0.5878152", "0.5857823", "0.58385134", "0.58371305", "0.58092993", "0.58049744", "0.58016026", "0.5779292" ]
0.8287438
1
This method parses all data provider related information from Contao legacy data container arrays.
protected function parseDataProvider(ContainerInterface $container) { // Parse data provider. if ($container->hasDataProviderDefinition()) { $config = $container->getDataProviderDefinition(); } else { $config = new DefaultDataProviderDefinition(); $container->setDataProviderDefinition($config); } // First check if we are using the "new" notation used in DcGeneral 0.9. if (!is_array($this->getFromDca('dca_config/data_provider'))) { return; } $dataProvidersDca = $this->getFromDca('dca_config/data_provider'); foreach ($dataProvidersDca as $dataProviderDcaName => $dataProviderDca) { $providerInformation = $this->parseSingleDataProvider( $container, $config, $dataProviderDca, $dataProviderDcaName ); if ($providerInformation instanceof ContaoDataProviderInformation) { $initializationData = (array) $providerInformation->getInitializationData(); $baseInitializationData = array( 'name' => $dataProviderDcaName, ); switch ((string) $dataProviderDcaName) { case 'default': $providerInformation->setVersioningEnabled( (bool) $this->getFromDca('config/enableVersioning') ); $container->getBasicDefinition()->setDataProvider($providerInformation->getName()); $baseInitializationData['name'] = $providerInformation->getName(); break; case 'root': $container->getBasicDefinition()->setRootDataProvider($providerInformation->getName()); $baseInitializationData['name'] = $providerInformation->getName(); break; case 'parent': $container->getBasicDefinition()->setParentDataProvider($providerInformation->getName()); $baseInitializationData['name'] = $providerInformation->getName(); break; default: } $providerInformation->setInitializationData( array_merge( $baseInitializationData, $dataProviderDca, $initializationData ) ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _getDataProviderIncorrect4()\n {\n return [\n [\n 'name' => 'Name',\n 'language' => 1,\n 'contentType' => 999,\n 'contentId' => 1,\n ],\n [],\n null,\n null,\n self::EXCEPTION_CONTENT\n ];\n }", "public function parseSQLDataProvider() {}", "public function dataProviderProcess(): array\n {\n return [\n [\n Yaml::parse(file_get_contents(__DIR__ . '/../../Resources/config/sample_config.yml'))['guzzle'],\n Yaml::parse(file_get_contents(__DIR__ . '/../../Resources/config/sample_middleware.yml'))['services'],\n Yaml::parse(file_get_contents(__DIR__ . '/../../Resources/config/sample_events.yml'))['services'],\n ]\n ];\n }", "private function _getDataProviderEmpty2()\n {\n return [\n [\n 'containerDesignBlockModel' => null,\n 'titleDesignBlockModel' => null,\n 'titleDesignTextModel' => null,\n 'descriptionDesignBlockModel' => null,\n 'descriptionDesignTextModel' => null,\n 'paginationDesignBlockModel' => null,\n 'paginationItemDesignBlockModel' => null,\n 'paginationItemDesignTextModel' => null,\n ],\n [\n 'containerDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignTextModel' => [\n 'size' => 0\n ],\n 'descriptionDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'descriptionDesignTextModel' => [\n 'size' => 0\n ],\n 'paginationDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignTextModel' => [\n 'size' => 0\n ],\n ],\n [\n 'containerDesignBlockModel' => ' ',\n 'titleDesignBlockModel' => ' ',\n 'titleDesignTextModel' => ' ',\n 'descriptionDesignBlockModel' => ' ',\n 'descriptionDesignTextModel' => ' ',\n 'paginationDesignBlockModel' => ' ',\n 'paginationItemDesignBlockModel' => ' ',\n 'paginationItemDesignTextModel' => ' ',\n ],\n [\n 'containerDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignTextModel' => [\n 'size' => 0\n ],\n 'descriptionDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'descriptionDesignTextModel' => [\n 'size' => 0\n ],\n 'paginationDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignTextModel' => [\n 'size' => 0\n ],\n ],\n ];\n }", "protected function preprocessData() {}", "private function _getDataProviderIncorrect5()\n {\n return [\n [\n 'name' => 'Name',\n 'language' => 1,\n 'contentType' => 1,\n 'contentId' => 999,\n ],\n [],\n null,\n null,\n self::EXCEPTION_MODEL\n ];\n }", "private function _getDataProviderEmpty3()\n {\n return [\n [\n 'containerDesignBlockId' => ' ',\n 'titleDesignBlockId' => ' ',\n 'titleDesignTextId' => ' ',\n 'descriptionDesignBlockId' => ' ',\n 'descriptionDesignTextId' => ' ',\n 'paginationDesignBlockId' => ' ',\n 'paginationItemDesignBlockId' => ' ',\n 'paginationItemDesignTextId' => ' ',\n ],\n [\n 'containerDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignTextModel' => [\n 'size' => 0\n ],\n 'descriptionDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'descriptionDesignTextModel' => [\n 'size' => 0\n ],\n 'paginationDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignTextModel' => [\n 'size' => 0\n ],\n ],\n [\n 'containerDesignBlockId' => null,\n 'titleDesignBlockId' => null,\n 'titleDesignTextId' => null,\n 'descriptionDesignBlockId' => null,\n 'descriptionDesignTextId' => null,\n 'paginationDesignBlockId' => null,\n 'paginationItemDesignBlockId' => null,\n 'paginationItemDesignTextId' => null,\n ],\n [\n 'containerDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignTextModel' => [\n 'size' => 0\n ],\n 'descriptionDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'descriptionDesignTextModel' => [\n 'size' => 0\n ],\n 'paginationDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignTextModel' => [\n 'size' => 0\n ],\n ],\n ];\n }", "private function _getDataProviderIncorrect2()\n {\n return [\n [\n 'name' => $this->generateStringWithLength('256'),\n 'language' => 1,\n 'contentType' => 1,\n 'contentId' => 1,\n ],\n [\n 'name' => ['maxLength']\n ]\n ];\n }", "private function _getDataProviderIncorrect6()\n {\n $textModel3 = TextModel::model()->save();\n\n return [\n [\n 'name' => '<b> Block name </b>',\n 'language' => ' 1 a',\n 'contentType' => ' 1 d',\n 'contentId' => ' ' . $textModel3->getId() . ' f',\n ],\n [\n 'name' => 'Block name',\n 'language' => 1,\n 'contentType' => 1,\n 'contentId' => $textModel3->getId(),\n ],\n [\n 'name' => '<strong>New name ',\n ],\n [\n 'name' => 'New name',\n 'language' => 1,\n 'contentType' => 1,\n 'contentId' => $textModel3->getId(),\n ]\n ];\n }", "public function dataProviderVOData(): array\n {\n $data1 = [\n 'name' => '张三',\n 'age' => 30,\n ];\n return [\n [$data1],\n ];\n }", "private function _getDataProviderEmpty4()\n {\n return [\n [\n 'containerDesignBlockModel' => [\n 'marginTop' => ' '\n ],\n 'titleDesignBlockModel' => [\n 'marginTop' => ' '\n ],\n 'titleDesignTextModel' => [\n 'size' => ' '\n ],\n 'descriptionDesignBlockModel' => [\n 'marginTop' => ' '\n ],\n 'descriptionDesignTextModel' => [\n 'size' => ' '\n ],\n 'paginationDesignBlockModel' => [\n 'marginTop' => ' '\n ],\n 'paginationItemDesignBlockModel' => [\n 'marginTop' => ' '\n ],\n 'paginationItemDesignTextModel' => [\n 'size' => ' '\n ],\n ],\n [\n 'containerDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignTextModel' => [\n 'size' => 0\n ],\n 'descriptionDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'descriptionDesignTextModel' => [\n 'size' => 0\n ],\n 'paginationDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignTextModel' => [\n 'size' => 0\n ],\n ],\n [\n 'containerDesignBlockModel' => [],\n 'titleDesignBlockModel' => [],\n 'titleDesignTextModel' => [],\n 'descriptionDesignBlockModel' => [],\n 'descriptionDesignTextModel' => [],\n 'paginationDesignBlockModel' => [],\n 'paginationItemDesignBlockModel' => [],\n 'paginationItemDesignTextModel' => [],\n ],\n [\n 'containerDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignTextModel' => [\n 'size' => 0\n ],\n 'descriptionDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'descriptionDesignTextModel' => [\n 'size' => 0\n ],\n 'paginationDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignTextModel' => [\n 'size' => 0\n ],\n ],\n ];\n }", "private function _getDataProviderEmpty1()\n {\n return [\n [],\n [\n 'containerDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignTextModel' => [\n 'size' => 0\n ],\n 'descriptionDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'descriptionDesignTextModel' => [\n 'size' => 0\n ],\n 'paginationDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignTextModel' => [\n 'size' => 0\n ],\n ],\n [\n 'containerDesignBlockModel' => '',\n 'titleDesignBlockModel' => '',\n 'titleDesignTextModel' => '',\n 'descriptionDesignBlockModel' => '',\n 'descriptionDesignTextModel' => '',\n 'paginationDesignBlockModel' => '',\n 'paginationItemDesignBlockModel' => '',\n 'paginationItemDesignTextModel' => '',\n ],\n [\n 'containerDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignTextModel' => [\n 'size' => 0\n ],\n 'descriptionDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'descriptionDesignTextModel' => [\n 'size' => 0\n ],\n 'paginationDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignTextModel' => [\n 'size' => 0\n ],\n ],\n ];\n }", "private function _getDataProviderIncorrect3()\n {\n $textModel2 = TextModel::model()->save();\n\n return [\n [\n 'name' => 'Name',\n 'language' => 999,\n 'contentType' => 1,\n 'contentId' => $textModel2->getId(),\n ],\n [\n 'name' => 'Name',\n 'language' => 1,\n 'contentType' => 1,\n 'contentId' => $textModel2->getId(),\n ]\n ];\n }", "private function _getDataProviderIncorrect1()\n {\n $textModel1 = TextModel::model()->save();\n\n return [\n [\n 'name' => ' Block name ',\n 'language' => ' 1 ',\n 'contentType' => ' 1 ',\n 'contentId' => ' ' . $textModel1->getId() . ' ',\n ],\n [\n 'name' => 'Block name',\n 'language' => 1,\n 'contentType' => 1,\n 'contentId' => $textModel1->getId(),\n ],\n [\n 'name' => ' New name ',\n 'language' => 2,\n 'contentType' => 2,\n ],\n [\n 'name' => 'New name',\n 'language' => 1,\n 'contentType' => 1,\n 'contentId' => $textModel1->getId(),\n ]\n ];\n }", "abstract protected function getDataProvider();", "public function dataProvider(): array\n {\n return [\n [\n FruitType::NUT(),\n [\n Str::upper(FruitType::NUT) => FruitType::NUT(),\n ],\n ],\n [\n FruitType::BERRY(),\n [\n Str::upper(FruitType::NUT) => FruitType::NUT(),\n Str::upper(FruitType::BERRY) => FruitType::BERRY(),\n ],\n ],\n [\n FruitType::LEGUME(),\n [\n Str::upper(FruitType::NUT) => FruitType::NUT(),\n Str::upper(FruitType::BERRY) => FruitType::BERRY(),\n Str::upper(FruitType::LEGUME) => FruitType::LEGUME(),\n ],\n ],\n [\n FruitType::ACCESSORY_FRUIT(),\n [\n Str::upper(FruitType::NUT) => FruitType::NUT(),\n Str::upper(FruitType::BERRY) => FruitType::BERRY(),\n Str::upper(FruitType::LEGUME) => FruitType::LEGUME(),\n Str::upper(FruitType::ACCESSORY_FRUIT) => FruitType::ACCESSORY_FRUIT(),\n ],\n ],\n ];\n }", "protected function resolveDataArrayDependencies() {}", "public function dataProvider()\n {\n return [\n //0------Fields------------------------------------Parsed Fields------------------------------------Parsed Validation\n [['name', 'surname', 'email'], ['name' => 'name', 'surname' => 'surname', 'email' => 'email'], [],\n //-----Request Filter-------Parsed Filter------------\n ['name' => 'first name'], [['where' => ['name', '=', 'first name']] ]],\n\n //1----Fields--------------Parsed Fields-------------Parsed Validation-------------\n [['first_name' => 'name'], ['first_name' => 'name'], [],\n //----Request Filter-------------Parsed Filter------------\n ['first_name' => 'first name'], [['where' => ['name', '=', 'first name']] ]],\n\n //2------Fields------------------------------------\n [['first_name' => ['name' => 'string|nullable'], 'last_name' => ['surname' => 'string|nullable']],\n //---Parsed Fields-----------\n ['first_name' => 'name', 'last_name' => 'surname'],\n //--Parsed Validation-------------\n ['first_name' => 'string|nullable', 'last_name' => 'string|nullable'],\n //---Request Filter-------\n ['first_name' => ['eq' => 'some name']],\n //---Parsed Filter--------\n [['where' => ['name', '=', 'some name']]]],\n\n //3------Fields--------------------\n [ ['name' => ['string', 'nullable'], 'surname' => ['string', 'nullable'] ],\n //---Parsed Fields-----------------\n ['name' => 'name', 'surname' => 'surname'],\n //---Parsed Validation-------------\n ['name' => ['string', 'nullable'], 'surname' => ['string', 'nullable']],\n //---Request filter----------------\n ['and' => ['name' => 'some name', 'surname' => 'last name']],\n //---Parsed Filter-----------------\n [['where' => [['where' => ['name', '=', 'some name']], ['where' => ['surname', '=', 'last name']]]]]],\n\n //4------Fields---------------------\n [['first_name' => 'name', 'last_name' => 'surname', 'email', 'age' ],\n //---Parsed Fields------------------\n ['first_name' => 'name', 'last_name' => 'surname', 'email' => 'email', 'age' => 'age'],\n //---Parsed Validation--------------\n [],\n //---Request Filter-----------------\n ['and' => [\n 'or' => [\n 'first_name' => 'some name',\n 'last_name' => 'last name'\n ],\n 'and' => [\n 'email' => ['neq' => '[email protected]'],\n 'age' => ['gt' => 20]\n ]\n ]],\n //---Parsed Filter-------------------\n [['where' => [\n ['orWhere' => [\n ['where' => ['name', '=', 'some name']],\n ['where' => ['surname', '=', 'last name']]]\n ],\n ['where' => [\n ['where' => ['email', '!=', '[email protected]']],\n ['where' => ['age', '>', 20]]\n ]]\n ]\n ]]],\n\n //5-----Fields------------------------\n [['name', 'surname', 'email'],\n //------Parsed Fields-----------------\n ['name' => 'name', 'surname' => 'surname', 'email' => 'email'],\n //-----Parsed Validation--------------\n [],\n //---Request Filter-------------------\n ['and' => [\n 'name' => ['in' => ['some name', 'name']],\n 'surname' => ['neq' => 'hmmm']\n ],\n ],\n [['where' => [\n ['whereIn' => ['name', ['some name', 'name']]],\n ['where' => ['surname', '!=', 'hmmm']]\n ]]]\n ]\n ];\n }", "public function transformDataProvider() {\n return [\n 'no arguments' => [\n 'definition' => [\n 'source' => [\n 'plugin' => 'embedded_data',\n 'data_rows' => [\n [\n 'id' => 1,\n 'title' => 'content item 1',\n 'term' => 'Apples',\n ],\n [\n 'id' => 2,\n 'title' => 'content item 2',\n 'term' => 'Bananas',\n ],\n [\n 'id' => 3,\n 'title' => 'content item 3',\n 'term' => 'Grapes',\n ],\n ],\n 'ids' => [\n 'id' => ['type' => 'integer'],\n ],\n ],\n 'process' => [\n 'id' => 'id',\n 'type' => [\n 'plugin' => 'default_value',\n 'default_value' => $this->bundle,\n ],\n 'title' => 'title',\n $this->fieldName => [\n 'plugin' => 'entity_generate',\n 'source' => 'term',\n ],\n ],\n 'destination' => [\n 'plugin' => 'entity:node',\n ],\n ],\n 'expected' => [\n 'row 1' => [\n 'id' => 1,\n 'title' => 'content item 1',\n $this->fieldName => [\n 'tid' => 2,\n 'name' => 'Apples',\n ],\n ],\n 'row 2' => [\n 'id' => 2,\n 'title' => 'content item 2',\n $this->fieldName => [\n 'tid' => 3,\n 'name' => 'Bananas',\n ],\n ],\n 'row 3' => [\n 'id' => 3,\n 'title' => 'content item 3',\n $this->fieldName => [\n 'tid' => 1,\n 'name' => 'Grapes',\n ],\n ],\n ],\n 'pre seed' => [\n 'taxonomy_term' => [\n 'name' => 'Grapes',\n 'vid' => $this->vocabulary,\n 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,\n ],\n ],\n ],\n 'no arguments_lookup_only' => [\n 'definition' => [\n 'source' => [\n 'plugin' => 'embedded_data',\n 'data_rows' => [\n [\n 'id' => 1,\n 'title' => 'content item 1',\n 'term' => 'Apples',\n ],\n [\n 'id' => 2,\n 'title' => 'content item 2',\n 'term' => 'Bananas',\n ],\n [\n 'id' => 3,\n 'title' => 'content item 3',\n 'term' => 'Grapes',\n ],\n ],\n 'ids' => [\n 'id' => ['type' => 'integer'],\n ],\n ],\n 'process' => [\n 'id' => 'id',\n 'type' => [\n 'plugin' => 'default_value',\n 'default_value' => $this->bundle,\n ],\n 'title' => 'title',\n $this->fieldName => [\n 'plugin' => 'entity_lookup',\n 'source' => 'term',\n ],\n ],\n 'destination' => [\n 'plugin' => 'entity:node',\n ],\n ],\n 'expected' => [\n 'row 1' => [\n 'id' => 1,\n 'title' => 'content item 1',\n $this->fieldName => [\n 'tid' => NULL,\n 'name' => NULL,\n ],\n ],\n 'row 2' => [\n 'id' => 2,\n 'title' => 'content item 2',\n $this->fieldName => [\n 'tid' => NULL,\n 'name' => NULL,\n ],\n ],\n 'row 3' => [\n 'id' => 3,\n 'title' => 'content item 3',\n $this->fieldName => [\n 'tid' => 1,\n 'name' => 'Grapes',\n ],\n ],\n ],\n 'pre seed' => [\n 'taxonomy_term' => [\n 'name' => 'Grapes',\n 'vid' => $this->vocabulary,\n 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,\n ],\n ],\n ],\n ];\n }", "public function dataParseExceptionDataProvider(): array\n {\n return array_merge(\n $this->prepareNonUniqueNameTestData()\n );\n }", "public function parse() {\n $pointers = apply_filters( 'bc-pointers-manager-pointers', $this->pointers );\n\n $this->pointers = array();\n\n foreach( $pointers as $i => $pointer ) {\n $pointer['id'] = \"{$this->prefix}{$this->version}_{$i}\";\n $this->pointers[ $pointer['id'] ] = (object) $pointer;\n }\n\n }", "public function dataProvider(): array\n {\n return [\n [ FruitType::NUT(), FruitType::NUT(), true ],\n [ FruitType::NUT(), FruitType::BERRY(), false ],\n [ FruitType::NUT(), FruitType::LEGUME(), false ],\n [ FruitType::NUT(), FruitType::ACCESSORY_FRUIT(), false ],\n [ FruitType::ACCESSORY_FRUIT(), FruitType::NUT(), true ],\n [ FruitType::ACCESSORY_FRUIT(), FruitType::BERRY(), true ],\n [ FruitType::ACCESSORY_FRUIT(), FruitType::LEGUME(), true ],\n [ FruitType::ACCESSORY_FRUIT(), FruitType::ACCESSORY_FRUIT(), true ],\n ];\n }", "public function parseProviderData(array $data)\n {\n $client = new Google_Client();\n $client->setAuthConfigFile($this->path);\n $client->setAccessType('offline');\n $client->addScope(array(\n Google_Service_Compute::DEVSTORAGE_FULL_CONTROL,\n Google_Service_Oauth2::PLUS_ME\n )\n );\n $client->setRedirectUri($this->getRedirectURL());\n $client->authenticate($_GET['code']);\n\n $access_token = json_decode($client->getAccessToken());\n\n $oauth2 = new Google_Service_Oauth2($client);\n /** @var Google_Service_Oauth2_Userinfoplus $userInfo */\n $userInfo = $oauth2->userinfo->get();\n\n if ($userInfo) {\n return array(\n 'name' => $userInfo->getName(),\n 'unique_id' => $userInfo->getId(),\n 'attributes' => array(array('attribute' => 'refresh_token', 'value' => isset($access_token->refresh_token) ? $access_token->refresh_token : ''))\n );\n }\n\n return array();\n }", "protected function get_legacy_records() {\n return array(array('course', 'course', $this->courseid),\n array('cm', 'course_modules', $this->contextinstanceid),\n array('reader', 'reader', $this->objectid));\n }", "protected function extractApiData() {\n\n foreach($this->apiData->items as $key => $value) { \n $key = $key + 1;\n $this->dataArray[$key]['id'] = $value->id;\n $this->dataArray[$key]['firstname'] = $value->firstname;\n $this->dataArray[$key]['lastname'] = $value->lastname;\n $this->dataArray[$key]['email'] = $value->email;\n $this->dataArray[$key]['dob'] = isset($value->dob) ? $value->dob : '';\n $this->dataArray[$key]['website_id'] = $value->website_id;\n $this->dataArray[$key]['store_id'] = $value->store_id;\n $this->dataArray[$key]['created_in'] = $value->created_in; \n $this->dataArray[$key]['group_id'] = $value->group_id; \n $this->dataArray[$key]['gender'] = $this->gender[$value->gender];\n $this->dataArray[$key]['address'] = $this->getAddress($value->addresses);\n }\n }", "public function validateDataProvider()\n {\n return [\n 'validate type null value' => [\n 'new_value',\n null,\n 'string',\n [],\n 0,\n null,\n ],\n 'validators not an array' => [\n 'new_value',\n '123',\n 'string',\n [],\n 0,\n null,\n ],\n 'constraint class not found' => [\n 'new_value',\n '123',\n 'string',\n [\n 'NonExistingClass' => [],\n ],\n 1,\n 'Object(EavBundle\\Entity\\EavValue).NonExistingClass',\n ],\n 'constraint not blank' => [\n 'new_blank_value',\n '',\n 'string',\n [\n 'NotBlank' => [],\n ],\n 1,\n 'Object(EavBundle\\Entity\\EavValue).new_blank_value',\n ],\n 'constraint range' => [\n 'new_range_value',\n 1,\n 'integer',\n [\n 'Range' => ['min' => 2],\n ],\n 1,\n 'Object(EavBundle\\Entity\\EavValue).new_range_value',\n ],\n 'constraint less than' => [\n 'new_less_than_value',\n 1000,\n 'integer',\n [\n 'LessThan' => ['value' => 999],\n ],\n 1,\n 'Object(EavBundle\\Entity\\EavValue).new_less_than_value',\n ],\n 'constraint length' => [\n 'new_length_value',\n 'some long text',\n 'string',\n [\n 'Length' => ['max' => 3],\n ],\n 1,\n 'Object(EavBundle\\Entity\\EavValue).new_length_value',\n ],\n 'valid value 1' => [\n 'new_valid_value_1',\n 'some text',\n 'string',\n [\n 'NotBlank' => [],\n 'Length' => ['min' => 4, 'max' => 10],\n ],\n 0,\n null,\n ],\n 'valid value 2' => [\n 'new_valid_value_2',\n 193456,\n 'integer',\n [\n 'NotBlank' => [],\n 'Range' => ['min' => 193450, 'max' => 193457],\n ],\n 0,\n null,\n ],\n ];\n }", "public function dataProvider() {\n return [\n [2, []],\n [1, ['multiple_file_display_type' => 'sources']],\n ];\n }", "protected function parseData($data){\r\n $d = array();\r\n if(is_string($data)){\r\n try{\r\n parse_str($data,$arr);\r\n $d = $arr;\r\n }catch(Exception $e){\r\n //del lam gi ca\r\n }\r\n }elseif(is_array($data)){\r\n $d = $data;\r\n }\r\n if(!$d) return null;\r\n unset($d[$this->idField]);\r\n $r = array();\r\n foreach($d as $f => $v){\r\n if(in_array($f, $this->fields)) $r[$f] = $v;\r\n }\r\n return $r;\r\n }", "public function toArrayProviders()\n\t{\n\t\t$ret = array();\n\t\t$vars = $this->getVars();\n\t\tforeach (array_keys($vars) as $var) {\n\t\t\t$ret[$var] = $this->getVar('{$var}');\n\t\t}\n\t\treturn $ret;\n\t}", "public function fieldsDataProvider() {\n $data['no fields'] = [\n 'configuration' => [\n 'ids' => ['id'],\n ],\n 'expected' => [\n 'id' => 'id',\n 'first_name' => 'first_name',\n 'last_name' => 'last_name',\n 'email' => 'email',\n 'country' => 'country',\n 'ip_address' => 'ip_address',\n ],\n ];\n $data['with fields override'] = [\n 'configuration' => [\n 'ids' => ['id'],\n 'fields' => [\n [\n 'name' => 'id',\n ],\n [\n 'name' => 'first_name',\n 'label' => 'First Name',\n ],\n ],\n ],\n 'expected' => [\n 'id' => 'id',\n 'first_name' => 'First Name',\n ],\n ];\n return $data;\n }" ]
[ "0.5814828", "0.5666497", "0.5643207", "0.55867755", "0.5518758", "0.54982007", "0.5487763", "0.5467615", "0.54540193", "0.54300815", "0.54151106", "0.5404598", "0.53893584", "0.53545254", "0.5320936", "0.531332", "0.53019476", "0.52122253", "0.5193145", "0.51468945", "0.5121529", "0.5116656", "0.51114666", "0.5108298", "0.50978523", "0.509551", "0.50576085", "0.5056816", "0.5042407", "0.5024675" ]
0.6470815
0
Parse the conditions for model relationships from the definition. This includes root entry filters, parent child relationship.
protected function parseConditions(ContainerInterface $container) { if ($container->hasDefinition(ModelRelationshipDefinitionInterface::NAME)) { $definition = $container->getDefinition(ModelRelationshipDefinitionInterface::NAME); } else { $definition = new DefaultModelRelationshipDefinition(); $container->setDefinition(ModelRelationshipDefinitionInterface::NAME, $definition); } $this->parseRootCondition($container, $definition); $this->parseParentChildConditions($definition); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function parseParentChildConditions(\n ModelRelationshipDefinitionInterface $definition\n ) {\n if (($childConditions = $this->getFromDca('dca_config/childCondition')) !== null) {\n foreach ((array) $childConditions as $childCondition) {\n /** @var ParentChildConditionInterface $relationship */\n $relationship = $definition->getChildCondition($childCondition['from'], $childCondition['to']);\n if (!$relationship instanceof ParentChildConditionInterface) {\n $relationship = new ParentChildCondition();\n $relationship\n ->setSourceName($childCondition['from'])\n ->setDestinationName($childCondition['to']);\n $definition->addChildCondition($relationship);\n $setter = $childCondition['setOn'];\n $inverse = $childCondition['inverse'];\n } else {\n $setter = array_merge_recursive((array) $childCondition['setOn'], $relationship->getSetters());\n $inverse = array_merge_recursive(\n (array) $childCondition['inverse'],\n $relationship->getInverseFilterArray()\n );\n }\n\n $relationship\n ->setFilterArray(\n FilterBuilder::fromArray($relationship->getFilterArray())\n ->getFilter()\n ->append(\n FilterBuilder::fromArray((array) $childCondition['filter'])\n )\n ->getAllAsArray()\n )\n ->setSetters($setter)\n ->setInverseFilterArray($inverse);\n }\n }\n }", "public function parseRelationships()\n {\n foreach ($this->relationships as $relationship) {\n if (in_array($relationship->getRelation(), $this::SUBJECTS))\n {\n $root = $this->getRelationship($relationship->getDependentId());\n $root->addDependency($relationship);\n }\n }\n }", "private function _subparse($relCriteria)\n {\n // Merge in default criteria params\n $relCriteria = array_merge([\n 'field' => null,\n 'sourceSite' => null,\n ], $relCriteria);\n\n // Check for now-deprecated sourceLocale param\n if (isset($relCriteria['sourceLocale'])) {\n Craft::$app->getDeprecator()->log('relatedTo:sourceLocale', 'The sourceLocale criteria in relatedTo element query params has been deprecated. Use sourceSite instead.');\n $relCriteria['sourceSite'] = $relCriteria['sourceLocale'];\n unset($relCriteria['sourceLocale']);\n }\n\n // Normalize the sourceSite param (should be an ID)\n if ($relCriteria['sourceSite'] && !is_numeric($relCriteria['sourceSite'])) {\n if ($relCriteria['sourceSite'] instanceof Site) {\n $relCriteria['sourceSite'] = $relCriteria['sourceSite']->id;\n } else {\n $site = Craft::$app->getSites()->getSiteByHandle($relCriteria['sourceSite']);\n if (!$site) {\n // Invalid handle\n return false;\n }\n $relCriteria['sourceSite'] = $site->id;\n }\n }\n\n if (!is_array($relCriteria)) {\n $relCriteria = ['element' => $relCriteria];\n }\n\n // Get the element IDs, wherever they are\n $relElementIds = [];\n $relSourceElementIds = [];\n $glue = 'or';\n\n $elementParams = ['element', 'sourceElement', 'targetElement'];\n $elementParam = null;\n\n foreach ($elementParams as $elementParam) {\n if (isset($relCriteria[$elementParam])) {\n $elements = $relCriteria[$elementParam];\n if (!is_array($elements)) {\n $elements = is_string($elements) ? StringHelper::split($elements) : [$elements];\n }\n\n if (isset($elements[0]) && ($elements[0] === 'and' || $elements[0] === 'or')) {\n $glue = array_shift($elements);\n }\n\n foreach ($elements as $element) {\n if (is_numeric($element)) {\n $relElementIds[] = $element;\n if ($elementParam === 'element') {\n $relSourceElementIds[] = $element;\n }\n } else if ($element instanceof ElementInterface) {\n if ($elementParam === 'targetElement') {\n $relElementIds[] = $element->getSourceId();\n } else {\n $relElementIds[] = $element->id;\n if ($elementParam === 'element') {\n $relSourceElementIds[] = $element->getSourceId();\n }\n }\n } else if ($element instanceof ElementQueryInterface) {\n $ids = $element->ids();\n ArrayHelper::append($relElementIds, ...$ids);\n if ($elementParam === 'element') {\n ArrayHelper::append($relSourceElementIds, ...$ids);\n }\n }\n }\n\n break;\n }\n }\n\n if (empty($relElementIds)) {\n return false;\n }\n\n // Going both ways?\n if ($elementParam === 'element') {\n array_unshift($relElementIds, $glue);\n\n return $this->parse([\n 'or',\n [\n 'sourceElement' => $relElementIds,\n 'field' => $relCriteria['field']\n ],\n [\n 'targetElement' => $relSourceElementIds,\n 'field' => $relCriteria['field']\n ]\n ]);\n }\n\n // Figure out which direction we’re going\n if ($elementParam === 'sourceElement') {\n $dir = self::DIR_FORWARD;\n } else {\n $dir = self::DIR_REVERSE;\n }\n\n // Do we need to check for *all* of the element IDs?\n if ($glue === 'and') {\n // Spread it across multiple relation sub-params\n $newRelatedToParam = ['and'];\n\n foreach ($relElementIds as $elementId) {\n $newRelatedToParam[] = [$elementParam => [$elementId]];\n }\n\n return $this->parse($newRelatedToParam);\n }\n\n $conditions = [];\n $relationFieldIds = [];\n\n if ($relCriteria['field']) {\n // Loop through all of the fields in this rel criteria, create the Matrix-specific conditions right away\n // and save the normal field IDs for later\n $fields = $relCriteria['field'];\n if (!is_array($fields)) {\n $fields = is_string($fields) ? StringHelper::split($fields) : [$fields];\n }\n\n foreach ($fields as $field) {\n if (($fieldModel = $this->_getField($field, $fieldHandleParts)) === null) {\n Craft::warning('Attempting to load relations for an invalid field: ' . $field);\n\n return false;\n }\n\n /** @var Field $fieldModel */\n if ($fieldModel instanceof BaseRelationField) {\n // We'll deal with normal relation fields all together\n $relationFieldIds[] = $fieldModel->id;\n } else if ($fieldModel instanceof Matrix) {\n $blockTypeFieldIds = [];\n\n // Searching by a specific block type field?\n if (isset($fieldHandleParts[1])) {\n // There could be more than one block type field with this handle, so we must loop through all\n // of the block types on this Matrix field\n $blockTypes = Craft::$app->getMatrix()->getBlockTypesByFieldId($fieldModel->id);\n\n foreach ($blockTypes as $blockType) {\n foreach ($blockType->getFields() as $blockTypeField) {\n /** @var Field $blockTypeField */\n if ($blockTypeField->handle == $fieldHandleParts[1]) {\n $blockTypeFieldIds[] = $blockTypeField->id;\n break;\n }\n }\n }\n\n if (empty($blockTypeFieldIds)) {\n continue;\n }\n }\n\n if ($dir === self::DIR_FORWARD) {\n self::$_relateSourcesCount++;\n self::$_relateTargetMatrixBlocksCount++;\n\n $sourcesAlias = 'sources' . self::$_relateSourcesCount;\n $targetMatrixBlocksAlias = 'target_matrixblocks' . self::$_relateTargetMatrixBlocksCount;\n $targetMatrixElementsAlias = 'target_matrixelements' . self::$_relateTargetMatrixBlocksCount;\n\n $subQuery = (new Query())\n ->select([\"$sourcesAlias.targetId\"])\n ->from([$sourcesAlias => Table::RELATIONS])\n ->innerJoin(Table::MATRIXBLOCKS . ' ' . $targetMatrixBlocksAlias, \"[[{$targetMatrixBlocksAlias}.id]] = [[{$sourcesAlias}.sourceId]]\")\n ->innerJoin(Table::ELEMENTS . ' ' . $targetMatrixElementsAlias, \"[[{$targetMatrixElementsAlias}.id]] = [[{$targetMatrixBlocksAlias}.id]]\")\n ->where([\n \"$targetMatrixBlocksAlias.ownerId\" => $relElementIds,\n \"$targetMatrixBlocksAlias.fieldId\" => $fieldModel->id,\n \"$targetMatrixElementsAlias.enabled\" => true,\n \"$targetMatrixElementsAlias.dateDeleted\" => null,\n ]);\n\n if ($relCriteria['sourceSite']) {\n $subQuery->andWhere([\n 'or',\n [\"$sourcesAlias.sourceSiteId\" => null],\n [\"$sourcesAlias.sourceSiteId\" => $relCriteria['sourceSite']]\n ]);\n }\n\n if (!empty($blockTypeFieldIds)) {\n $subQuery->andWhere([\"$sourcesAlias.fieldId\" => $blockTypeFieldIds]);\n }\n } else {\n self::$_relateSourceMatrixBlocksCount++;\n $sourceMatrixBlocksAlias = 'source_matrixblocks' . self::$_relateSourceMatrixBlocksCount;\n $sourceMatrixElementsAlias = 'source_matrixelements' . self::$_relateSourceMatrixBlocksCount;\n $matrixBlockTargetsAlias = 'matrixblock_targets' . self::$_relateSourceMatrixBlocksCount;\n\n $subQuery = (new Query())\n ->select([\"$sourceMatrixBlocksAlias.ownerId\"])\n ->from([$sourceMatrixBlocksAlias => Table::MATRIXBLOCKS])\n ->innerJoin(Table::ELEMENTS . ' ' . $sourceMatrixElementsAlias, \"[[{$sourceMatrixElementsAlias}.id]] = [[{$sourceMatrixBlocksAlias}.id]]\")\n ->innerJoin(Table::RELATIONS . ' ' . $matrixBlockTargetsAlias, \"[[{$matrixBlockTargetsAlias}.sourceId]] = [[{$sourceMatrixBlocksAlias}.id]]\")\n ->where([\n \"$sourceMatrixElementsAlias.enabled\" => true,\n \"$sourceMatrixElementsAlias.dateDeleted\" => null,\n \"$matrixBlockTargetsAlias.targetId\" => $relElementIds,\n \"$sourceMatrixBlocksAlias.fieldId\" => $fieldModel->id\n ]);\n\n if ($relCriteria['sourceSite']) {\n $subQuery->andWhere([\n 'or',\n [\"$matrixBlockTargetsAlias.sourceSiteId\" => null],\n [\"$matrixBlockTargetsAlias.sourceSiteId\" => $relCriteria['sourceSite']]\n ]);\n }\n\n if (!empty($blockTypeFieldIds)) {\n $subQuery->andWhere([\"$matrixBlockTargetsAlias.fieldId\" => $blockTypeFieldIds]);\n }\n }\n\n $conditions[] = ['elements.id' => $subQuery];\n unset($subQuery);\n } else {\n Craft::warning('Attempting to load relations for a non-relational field: ' . $fieldModel->handle);\n\n return false;\n }\n }\n }\n\n // If there were no fields, or there are some non-Matrix fields, add the normal relation condition. (Basically,\n // run this code if the rel criteria wasn't exclusively for Matrix.)\n if (empty($relCriteria['field']) || !empty($relationFieldIds)) {\n if ($dir === self::DIR_FORWARD) {\n self::$_relateSourcesCount++;\n $relTableAlias = 'sources' . self::$_relateSourcesCount;\n $relConditionColumn = 'sourceId';\n $relElementColumn = 'targetId';\n } else {\n self::$_relateTargetsCount++;\n $relTableAlias = 'targets' . self::$_relateTargetsCount;\n $relConditionColumn = 'targetId';\n $relElementColumn = 'sourceId';\n }\n\n $subQuery = (new Query())\n ->select([\"$relTableAlias.$relElementColumn\"])\n ->from([$relTableAlias => Table::RELATIONS])\n ->where([\"$relTableAlias.$relConditionColumn\" => $relElementIds]);\n\n if ($relCriteria['sourceSite']) {\n $subQuery->andWhere([\n 'or',\n [\"$relTableAlias.sourceSiteId\" => null],\n [\"$relTableAlias.sourceSiteId\" => $relCriteria['sourceSite']]\n ]);\n }\n\n if (!empty($relationFieldIds)) {\n $subQuery->andWhere([\"$relTableAlias.fieldId\" => $relationFieldIds]);\n }\n\n $conditions[] = ['elements.id' => $subQuery];\n }\n\n if (empty($conditions)) {\n return false;\n }\n\n if (count($conditions) == 1) {\n return $conditions[0];\n }\n\n array_unshift($conditions, 'or');\n\n return $conditions;\n }", "protected function ancestorsFetchConditions()\r\n {\r\n $filter_parent = $this->getState('filter.parent');\r\n if (!empty($filter_parent))\r\n {\r\n $this->setCondition('parent', new \\MongoId((string) $filter_parent));\r\n }\r\n \r\n $filter_path = $this->getState('filter.path');\r\n if (strlen($filter_path))\r\n {\r\n // if the path doesn't begin with /, prefix it with a /\r\n if (substr($filter_path, 0, 1) !== '/')\r\n {\r\n $filter_path = '/' . $filter_path;\r\n }\r\n $this->setCondition('path', $filter_path);\r\n }\r\n \r\n $filter_path_begins_with = $this->getState('filter.path_begins_with');\r\n if ($filter_path_begins_with && is_string($filter_path_begins_with))\r\n {\r\n $key = new \\MongoRegex('/^'.$filter_path_begins_with.'/i');\r\n \r\n $this->setCondition('path', $key);\r\n }\r\n \r\n return $this;\r\n }", "function get_condition()\r\n {\r\n $owner = $this->owner;\r\n\r\n $conds = array();\r\n $parent = $this->parent;\r\n $category = $parent->get_parameter(WeblcmsManager :: PARAM_CATEGORY);\r\n $category = $category ? $category : 0;\r\n $conds[] = new EqualityCondition(ContentObjectPublication :: PROPERTY_CATEGORY_ID, $category, ContentObjectPublication :: get_table_name());\r\n\r\n $type_cond = array();\r\n $types = array(Assessment :: get_type_name(), Survey :: get_type_name(), Hotpotatoes :: get_type_name());\r\n foreach ($types as $type)\r\n {\r\n $type_cond[] = new EqualityCondition(ContentObject :: PROPERTY_TYPE, $type);\r\n }\r\n $conds[] = new OrCondition($type_cond);\r\n $c = Utilities :: query_to_condition($this->query);\r\n if (! is_null($c))\r\n {\r\n $conds[] = $c;\r\n }\r\n return new AndCondition($conds);\r\n }", "private function parseRelations()\n {\n if ($this->parentRelations === null) {\n $this->parentRelations = [];\n $this->parentEntities = [];\n $this->childEntities = [];\n $this->childRelations = [];\n $this->siblingEntities = [];\n $this->siblingRelations = [];\n foreach ($this->getModule()->getRelations() as $relation) {\n if ($relation->getEntityOneInstance() === $this) {\n if ($relation->getType() === Relation::TYPE_ONE_TO_MANY) {\n $this->childRelations[] = $relation;\n $childEntity = $relation->getRelatedEntity($this);\n $this->childEntities[$childEntity->getNameSingular()] = $childEntity;\n } elseif ($relation->getType() === Relation::TYPE_MANY_TO_MANY) {\n $siblingEntity = $relation->getRelatedEntity($this);\n $this->siblingRelations[] = $relation;\n $this->siblingEntities[$siblingEntity->getNameSingular()] = $siblingEntity;\n }\n }\n if ($relation->getEntityTwoInstance() === $this) {\n if ($relation->getType() === Relation::TYPE_ONE_TO_MANY) {\n $this->parentRelations[] = $relation;\n $parentEntity = $relation->getRelatedEntity($this);\n $this->parentEntities[$parentEntity->getNameSingular()] = $parentEntity;\n } elseif ($relation->getType() === Relation::TYPE_MANY_TO_MANY) {\n $siblingEntity = $relation->getRelatedEntity($this);\n $this->siblingRelations[] = $relation;\n $this->siblingEntities[$siblingEntity->getNameSingular()] = $siblingEntity;\n }\n }\n }\n }\n }", "public function rules()\n {\n $rules = [];\n $this->request = json_decode($this->content);\n $content = $this->request;\n\n foreach($content->conditions as $key => $val)\n {\n $rules['conditions.'.$key.'.id'] = 'required|integer';\n $rules['conditions.'.$key.'.disease_model_id'] = 'required|integer';\n $rules['conditions.'.$key.'.clsf_weather_parameter'] = 'required|integer';\n $rules['conditions.'.$key.'.date_range'] = 'required|boolean';\n\n if (isset($val->date_range))\n if ($val->date_range) {\n $rules['conditions.'.$key.'.start_range'] = 'required|numeric';\n $rules['conditions.'.$key.'.end_range'] = 'required|numeric';\n } else {\n $rules['conditions.'.$key.'.constant'] = 'required|numeric';\n $rules['conditions.'.$key.'.operator'] = 'required|boolean';\n }\n\n $rules['conditions.'.$key.'.time'] = 'required|integer';\n }\n return $rules;\n }", "public function parse($relatedToParam)\n {\n // Ensure the criteria is an array\n if (!is_array($relatedToParam)) {\n $relatedToParam = is_string($relatedToParam) ? StringHelper::split($relatedToParam) : [$relatedToParam];\n }\n\n if (isset($relatedToParam['element']) || isset($relatedToParam['sourceElement']) || isset($relatedToParam['targetElement'])) {\n $relatedToParam = [$relatedToParam];\n }\n\n if (!isset($relatedToParam[0])) {\n return false;\n }\n\n $conditions = [];\n\n if ($relatedToParam[0] === 'and' || $relatedToParam[0] === 'or') {\n $glue = array_shift($relatedToParam);\n } else {\n $glue = 'or';\n }\n\n if ($glue === 'or') {\n // Group all of the unspecified elements, so we avoid adding massive JOINs to the query\n $unspecifiedElements = [];\n\n foreach ($relatedToParam as $i => $relCriteria) {\n if (!is_array($relCriteria)) {\n $unspecifiedElements[] = $relCriteria;\n unset($relatedToParam[$i]);\n }\n }\n\n if (!empty($unspecifiedElements)) {\n $relatedToParam[] = ['element' => $unspecifiedElements];\n }\n }\n\n foreach ($relatedToParam as $relCriteria) {\n $condition = $this->_subparse($relCriteria);\n\n if ($condition) {\n $conditions[] = $condition;\n } else if ($glue === 'or') {\n continue;\n } else {\n return false;\n }\n }\n\n if (empty($conditions)) {\n return false;\n }\n\n if (count($conditions) === 1) {\n return $conditions[0];\n }\n\n array_unshift($conditions, $glue);\n\n return $conditions;\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n $this->addRelation('Evaluacion', '\\\\Evaluacion', RelationMap::MANY_TO_ONE, array (\n 0 =>\n array (\n 0 => ':evpr_c_evaluacion',\n 1 => ':eval_codigo',\n ),\n), null, 'CASCADE', null, false);\n $this->addRelation('Objetivo', '\\\\Objetivo', RelationMap::MANY_TO_ONE, array (\n 0 =>\n array (\n 0 => ':evpr_c_objetivo',\n 1 => ':obje_codigo',\n ),\n), null, 'CASCADE', null, false);\n $this->addRelation('Pregunta', '\\\\Pregunta', RelationMap::MANY_TO_ONE, array (\n 0 =>\n array (\n 0 => ':evpr_c_pregunta',\n 1 => ':preg_codigo',\n ),\n), null, 'CASCADE', null, false);\n $this->addRelation('Seccion', '\\\\Seccion', RelationMap::MANY_TO_ONE, array (\n 0 =>\n array (\n 0 => ':evpr_c_seccion',\n 1 => ':secc_codigo',\n ),\n), null, 'CASCADE', null, false);\n }", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public static function getConditionsHook()\n\t{\n\t\t$conditions = array();\n\n\t\t$conditions['select'] = '`id`, `id` AS sid, `title`, \\'\\' AS `alias`, 1 AS parent_id, `section` AS extension, `description`, `published`, `checked_out`, `checked_out_time`, `access`, `params`, `section`';\n\n\t\t$where_or = array();\n\t\t$where_or[] = \"section REGEXP '^[\\\\-\\\\+]?[[:digit:]]*\\\\.?[[:digit:]]*$'\";\n\t\t$where_or[] = \"section IN ('com_banner', 'com_contact', 'com_contact_details', 'com_content', 'com_newsfeeds', 'com_sections', 'com_weblinks' )\";\n\t\t$conditions['where_or'] = $where_or;\n\n\t\t$conditions['order'] = \"id ASC, section ASC, ordering ASC\";\t\n\n\t\treturn $conditions;\n\t}", "public function buildRelations()\n {\n $this->addRelation('Attribute', '\\\\Thelia\\\\Model\\\\Attribute', RelationMap::MANY_TO_ONE, array('attribute_id' => 'id', ), 'CASCADE', 'RESTRICT');\n $this->addRelation('Feature', '\\\\Thelia\\\\Model\\\\Feature', RelationMap::MANY_TO_ONE, array('feature_id' => 'id', ), 'CASCADE', 'RESTRICT');\n $this->addRelation('ChoiceFilterOther', '\\\\ChoiceFilter\\\\Model\\\\ChoiceFilterOther', RelationMap::MANY_TO_ONE, array('other_id' => 'id', ), 'CASCADE', 'RESTRICT');\n $this->addRelation('Category', '\\\\Thelia\\\\Model\\\\Category', RelationMap::MANY_TO_ONE, array('category_id' => 'id', ), 'CASCADE', 'RESTRICT');\n $this->addRelation('Template', '\\\\Thelia\\\\Model\\\\Template', RelationMap::MANY_TO_ONE, array('template_id' => 'id', ), 'CASCADE', 'RESTRICT');\n }", "function _prepareConditions($conditions, $pExtendingModuleID = null)\n{\n $debug_prefix = debug_indent(\"Module-_prepareConditions() {$this->ModuleID}:\");\n print \"$debug_prefix\\n\";\n $parentRecordConditions = array();\n $whereConditions = array();\n $protectJoinAliases = array();\n $SQL = '';\n\n $use_parent = true;\n if(empty($parentModuleID)){\n if(empty($this->parentModuleID)){\n $use_parent = false;\n } else {\n $parentModuleID = $this->parentModuleID;\n }\n }\n\n if($use_parent){\n $parentModule =& GetModule($parentModuleID);\n $parentPK = end($parentModule->PKFields);\n }\n\n if(! empty($pExtendingModuleID )){\n print \"extending module conditions: $pExtendingModuleID, {$this->ModuleID}\\n\";\n $extendingModule = GetModule($pExtendingModuleID);\n if(!empty( $extendingModule->extendsModuleFilterField )){\n $conditions[$extendingModule->extendsModuleFilterField] = $extendingModule->extendsModuleFilterValue;\n print \"added extended condition:\\n\";\n print_r($conditions);\n }\n }\n\n if(count($conditions) > 0){\n foreach($conditions as $conditionField => $conditionValue){\n print \"$debug_prefix Condition $conditionField => $conditionValue\\n\";\n\n $conditionModuleField = $this->ModuleFields[$conditionField];\n if(empty($conditionModuleField)){\n die(\"field {$this->ModuleID}.$conditionModuleField is empty\\n\");\n }\n $qualConditionField = $conditionModuleField->getQualifiedName($this->ModuleID);\n $conditionJoins = $conditionModuleField->makeJoinDef($this->ModuleID);\n if(count($conditionJoins) > 0){\n foreach(array_keys($conditionJoins) as $conditionJoinAlias){\n $protectJoinAliases[] = $conditionJoinAlias;\n }\n }\n\n if($use_parent){\n if(preg_match('/\\[\\*([\\w]+)\\*\\]/', $conditionValue, $match[1])){\n if($match[1][1] == $parentPK){\n $whereConditions[$qualConditionField] = '/**RecordID**/';\n } else {\n print \"SM found match $match[1][0]\\n\";\n $parentRecordConditions[$qualConditionField] = $match[1][1];\n }\n } else {\n $whereConditions[$qualConditionField] = $conditionValue;\n }\n } else {\n $whereConditions[$qualConditionField] = $conditionValue;\n }\n }\n }\n\n if($use_parent){\n $needParentSubselect = false;\n if(count($parentRecordConditions) > 0){\n foreach($parentRecordConditions as $localConditionField => $parentConditionField){\n $parentModuleField = $parentModule->ModuleFields[$parentConditionField];\n if(empty($parentModuleField)){\n die(\"field {$this->parentModuleID}.$parentConditionField is empty\\n\");\n }\n if(strtolower(get_class($parentModuleField)) != 'tablefield'){\n $needParentSubselect = true;\n }\n }\n if($needParentSubselect){\n $parentJoins = array();\n $parentSelects = array();\n foreach($parentRecordConditions as $localConditionField => $parentConditionField){\n $parentModuleField = $parentModule->ModuleFields[$parentConditionField];\n $parentSelects[] = $parentModuleField->makeSelectDef('iparent');\n $parentJoins = array_merge($parentJoins, $parentModuleField->makeJoinDef('iparent'));\n }\n\n $subSQL = 'SELECT ';\n $subSQL .= implode(\",\\n\", $parentSelects);\n $subSQL .= \"\\nFROM `{$this->parentModuleID}` AS `iparent`\\n\";\n $parentJoins = SortJoins($parentJoins);\n $subSQL .= implode(\"\\n \", $parentJoins);\n $subSQL .= \"\\nWHERE `iparent`.$parentPK = '/**RecordID**/' \\n\";\n\n $SQL = \"\\n INNER JOIN ($subSQL) AS `parent` ON (\\n\";\n $parentConditionStrings = array();\n foreach($parentRecordConditions as $localConditionField => $parentConditionField){\n $parentConditionStrings[] = \"`parent`.$parentConditionField = $localConditionField\";\n }\n $SQL .= implode(\"\\n AND \", $parentConditionStrings);\n $SQL .= \")\\n\";\n } else {\n $SQL = \"\\n INNER JOIN `{$this->parentModuleID}` AS `parent` ON (\\n\";\n $parentConditionStrings = array();\n foreach($parentRecordConditions as $localConditionField => $parentConditionField){\n $parentModuleField = $parentModule->ModuleFields[$parentConditionField];\n $qualParentConditionField = $parentModuleField->getQualifiedName('parent');\n $parentConditionStrings[] = \"$localConditionField = $qualParentConditionField\";;\n }\n $SQL .= implode(\"\\n AND \", $parentConditionStrings);\n $SQL .= \")\\n\";\n\n $whereConditions[\"`parent`.$parentPK\"] = '/**RecordID**/';\n }\n\n }\n }\n\n debug_unindent();\n return array(\n 'parentJoinSQL' => $SQL,\n 'whereConditions' => $whereConditions,\n 'protectJoinAliases' => $protectJoinAliases\n );\n}", "public function getConditions()\n {\n if (array_key_exists(\"conditions\", $this->_propDict)) {\n if (is_a($this->_propDict[\"conditions\"], \"\\Microsoft\\Graph\\Model\\ConditionalAccessConditionSet\") || is_null($this->_propDict[\"conditions\"])) {\n return $this->_propDict[\"conditions\"];\n } else {\n $this->_propDict[\"conditions\"] = new ConditionalAccessConditionSet($this->_propDict[\"conditions\"]);\n return $this->_propDict[\"conditions\"];\n }\n }\n return null;\n }" ]
[ "0.6085739", "0.5768387", "0.5647951", "0.5493991", "0.5421273", "0.52377117", "0.51879257", "0.51806444", "0.51153255", "0.51153255", "0.51153255", "0.51153255", "0.51153255", "0.51153255", "0.51153255", "0.51153255", "0.51153255", "0.5087521", "0.50551236", "0.50551236", "0.50551236", "0.50551236", "0.50551236", "0.50551236", "0.50551236", "0.50551236", "0.50510883", "0.5035819", "0.49747524", "0.49563992" ]
0.63493764
0
Parse and build the backend view definition for the old Contao2 backend view. This method expects to find an instance of Contao2BackendViewDefinitionInterface in the container.
protected function parseBackendView(ContainerInterface $container) { if ($container->hasDefinition(Contao2BackendViewDefinitionInterface::NAME)) { $view = $container->getDefinition(Contao2BackendViewDefinitionInterface::NAME); } else { $view = new Contao2BackendViewDefinition(); $container->setDefinition(Contao2BackendViewDefinitionInterface::NAME, $view); } if (!$view instanceof Contao2BackendViewDefinitionInterface) { throw new DcGeneralInvalidArgumentException( 'Configured BackendViewDefinition does not implement Contao2BackendViewDefinitionInterface.' ); } $this->parseListing($view); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createDefaultBackendLayout() {}", "public function convertLegacyViewDefsToLumia() {}", "protected abstract function _getBackend();", "public function buildFrontend()\n {\n global $TSFE;\n EidUtility::initLanguage();\n\n /** @var TypoScriptFrontendController $TSFE */\n $TSFE = GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Frontend\\\\Controller\\\\TypoScriptFrontendController',\n $GLOBALS['TYPO3_CONF_VARS'], 0, 0);\n EidUtility::initLanguage();\n\n // Get FE User Information\n $TSFE->initFEuser();\n // Important: no Cache for Ajax stuff\n $TSFE->set_no_cache();\n $TSFE->initTemplate();\n // $TSFE->getConfigArray();\n Bootstrap::getInstance()\n ->loadCachedTca();\n $TSFE->cObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');\n $TSFE->settingLanguage();\n $TSFE->settingLocale();\n }", "public function convertLegacyViewDefsToSidecar()\n {\n $client = $this->client == 'wireless' ? 'mobile' : $this->client;\n $this->logUpgradeStatus('Converting ' . $this->client . ' ' . $this->viewtype . ' view defs for ' . $this->module);\n\n // Leave the original legacy viewdefs in tact\n $defs = $this->legacyViewdefs;\n\n // Find out which panel key to use based on viewtype and client\n $panelKey = $this->panelKeys[$this->client.$this->viewtype];\n if (isset($defs[$panelKey])) {\n // Get the converted defs\n $fields = $this->handleConversion($defs, $panelKey);\n\n // If we still don't have new viewdefs then fall back onto the old\n // ones. This shouldn't happen, but we need to make sure we have defs\n $newdefs = $this->loadDefaultMetadata();\n if (empty($newdefs)) {\n $newdefs = $defs;\n }\n\n // Set the new panel defs from the fields that were just converted\n $paneldefs = array(array('label' => 'LBL_PANEL_DEFAULT', 'fields' => $fields));\n\n // Kill the data (old defs) and panels (new defs) elements from the defs\n unset($newdefs['data'], $newdefs['panels']);\n\n // Create, or recreate, the panel defs\n $newdefs['panels'] = $paneldefs;\n\n // Clean up the module name for saving\n $module = $this->getNormalizedModuleName();\n $this->logUpgradeStatus(\"Setting new $client:{$this->type} view defs internally for $module\");\n // Setup the new defs\n $this->sidecarViewdefs[$module][$client]['view'][$this->viewtype] = $newdefs;\n }\n }", "protected function editView_form(){\n $output_path = './resources/views/'. $this->solveName($this->commandObj->argument('model_B'), config('CrudDscaffold.app_name_rules.app_route')). '/';\n $output_filename = '_form.blade.php';\n\n //replace word\n $pattern = '#(.*)<label for=\"'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.name_name')).'_id-field\">(.*)_id</label>(.*){!! Form::text\\(\"'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.name_name')).'_id\", null,(.*)#s';\n $replacement = '\\1<label for=\"'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.name_name')).'_id-field\">\\2_'. $this->relation_display_column. '</label>\\3{!! Form::select(\"'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.name_name')).'_id\", $list[\"'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.app_model_class')).'\"], null,\\4';\n\n //output(use OutputTrait)\n $this->outputReplace( $output_path, $output_filename, $pattern, $replacement, $debug = $this->debug );\n }", "public abstract function getBackend();", "protected function buildView()\n {\n $table = $this->columns;\n\n $columns = $table->map(function ($column) {\n return $column->column.':'.$column->method.','.$column->caption;\n })->implode('|');\n\n $dropdown = $table->filter(function ($column) {\n return true == $column->is_foreign;\n })->transform(function ($column) {\n return $column->column.':'.$column->table_foreign;\n })->implode('|');\n\n $this->view = [\n 'name' => $this->module->name,\n '--columns' => $columns,\n '--controller' => $this->class,\n '--request' => $this->class,\n '--module' => $this->module->id,\n '--dropdown' => $dropdown,\n '--icon' => $this->module->icon,\n ];\n }", "protected function parseListing(Contao2BackendViewDefinitionInterface $view)\n {\n $listing = $view->getListingConfig();\n\n $this->parseListLabel($listing);\n }", "public function getBackend() {}", "public function getBackend() {}", "protected function getFrontendController() {}", "protected function getGroupAndSortingDefinition()\n {\n /** @var Contao2BackendViewDefinitionInterface $view */\n $view = $this->getEnvironment()\n ->getDataDefinition()\n ->getDefinition(Contao2BackendViewDefinitionInterface::NAME);\n\n return $view\n ->getListingConfig()\n ->getGroupAndSortingDefinition();\n }", "public function getBackend();", "protected static function getTypoScriptFrontendController() {}", "protected function buildViewReplacements()\n {\n $viewModule = $this->parseViewModule($this->option('view'));\n\n if (empty($viewModule)) {\n $viewModule = $this->parseViewModule($this->ask('witch module\\'s view do you want to injected to the controller?'));\n }\n\n $views = $this->getViewModuleFiles($viewModule);\n\n foreach ($views as $view) {\n if (! file_exists($view.'.blade.php')) {\n if ($this->confirm(\"The {$viewModule} module has some views does not exist. Do you want to generate it?\", true)) {\n $this->call('make:view', ['name' => $viewModule]);\n }\n\n break;\n }\n }\n\n return [\n 'DummyRootView' => $viewModule,\n ];\n }", "public function getBackend() {\n\t\t$data = unserialize($this->Data);\n\t\tif(isset($data['EnvironmentType']) && class_exists($data['EnvironmentType'])) {\n\t\t\t$env = Injector::inst()->get($data['EnvironmentType']);\n\t\t\tif($env instanceof EnvironmentCreateBackend) {\n\t\t\t\treturn $env;\n\t\t\t} else {\n\t\t\t\tthrow new Exception(\"Invalid backend: \" . $data['EnvironmentType']);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "protected function resolveView() {}", "protected function resolveView() {}", "public function onGetFrontendController()\n {\n $this->pluginBootstrap->Application()->Snippets()->addConfigDir($this->pluginBootstrap->Path() . 'Snippets/');\n\n $this->pluginBootstrap->Application()->Template()->addTemplateDir($this->pluginBootstrap->Path() . 'Views/');\n\n return $this->pluginBootstrap->Path() . 'Controllers/Widgets/SwagBrowserLanguage.php';\n }", "protected function editView_show(){\n $output_path = './resources/views/'. $this->solveName($this->commandObj->argument('model_B'), config('CrudDscaffold.app_name_rules.app_route')). '/';\n $output_filename = 'show.blade.php';\n\n //replace word\n $pattern = '#(.*<label for=\")'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.name_name')).'_id\">'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.NAME_NAME')).'_ID</label>(.*)<p class=\"form-control-static\">{{\\$'.\n $this->solveName($this->commandObj->argument('model_B'), config('CrudDscaffold.app_name_rules.app_model_var')).'->'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.name_name')).'_id}}</p>(.*)#s';\n $replacement = '\\1'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.name_name')).'_'. $this->relation_display_column. '\">'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.NAME_NAME')).'_'. mb_strtoupper($this->relation_display_column). '</label>\\2<p class=\"form-control-static\">{{$'.\n $this->solveName($this->commandObj->argument('model_B'), config('CrudDscaffold.app_name_rules.app_model_var')).'->'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.app_model_var')).'->'. $this->relation_display_column. '}}</p>\\3';\n\n //output(use OutputTrait)\n $this->outputReplace( $output_path, $output_filename, $pattern, $replacement, $debug = $this->debug );\n }", "public function load(ViewsDuplicateBuilderPluginInterface $builder);", "public function initializeBackendTemplate() {}", "protected function getTypoScriptFrontendController() {}", "abstract function buildShowLayout(): void;", "function getBackend() ;", "function phpgwapi_upgrade0_9_14_002()\n\t{\n\t\t// as 0.9.15.xxx are already used in HEAD\n\t\t\n\t\t// this is the 0.9.15.003 update, needed for the new filemanager and vfs-classes in the api\n\t\t$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_vfs','content', array ('type' => 'text', 'nullable' => True));\n\n\t\t// this is the 0.9.15.004 update, needed for the polish translations\n\t\t$GLOBALS['phpgw_setup']->oProc->query(\"UPDATE languages set available='Yes' WHERE lang_id='pl'\");\n\n\t\t$GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.14.500';\n\t\treturn $GLOBALS['setup_info']['phpgwapi']['currentver'];\n\t}", "public function action_index()\n {\n $view = new View('backend/workspace_2col');\n\n $view->column1 = $this->request->get_controller('groups')->widget_groups();\n $view->column2 = $this->request->get_controller('users')->widget_users();\n\n $layout = $this->prepare_layout();\n $layout->content = $view;\n $this->request->response = $layout->render();\n }", "public function actionStep2() {\n\t\ttry {\n\t\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.structure.controllers');\n\t\t\t$newContent = new Content();\n\t\t\t$newContent->setScenario('createStep2');\n\t\t\t$newContent->templateId = \\Yii::app()->session['newcontent']['templateId'];\n\t\t\t$newContent->reconfigure();\n\t\t\t$newContent->attributes = \\Yii::app()->session['newcontent'];\n\t\t\tif($newContent->templateId === null) {\n\t\t\t\tthrow new \\CHttpException('500', \\Yii::t('structure', 'Template is not defined for current content'));\n\t\t\t}\n\t\t\tif(isset($_POST[Html::modelName($newContent)]) === true) {\n\t\t\t\t$newContent->authorId = \\Yii::app()->user->id;\n\t\t\t\t$newContent->nodeId = $this->currentNode->nodeId;\n\t\t\t\t$newContent->attributes = $_POST[Html::modelName($newContent)];\n\t\t\t\t$contentStatus = $newContent->validate();\n\n\t\t\t\tif($contentStatus === true) {\n\t\t\t\t\tif($newContent->save() === true) {\n\t\t\t\t\t\t$newContent->node->reOrder();\n\t\t\t\t\t\t$this->redirect(array('index', 'contentId'=>$newContent->contentId));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(\\Yii::app()->getRequest()->isAjaxRequest === false) {\n\t\t\t\t$this->render('step2', array(\n\t\t\t\t\t'create' => true,\n\t\t\t\t\t'sourceNode' => $this->currentNode,\n\t\t\t\t\t'content'=>$newContent,\n\t\t\t\t));\n\t\t\t} else {\n\t\t\t\t$this->renderPartial('_detail', array(\n\t\t\t\t\t'create' => true,\n\t\t\t\t\t'content'=>$newContent,\n\t\t\t\t));\n\t\t\t}\n\t\t} catch(\\Exception $e) {\n\t\t\t\\Yii::log('Error in '.__METHOD__.'():'.$e->getMessage(), \\CLogger::LEVEL_ERROR, 'sweelix.yii1.admin.structure.controllers');\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function getViewInterface(): ViewInterface\n \n {\n// on cherche l'équivalant de ça mais en mode bonne pratique\n \n \n// reflective class\n return (new \\ReflectionClass(PackageView:: class))\n ->newInstanceArgs([]);\n\n }" ]
[ "0.47539702", "0.45667848", "0.4561278", "0.45092776", "0.44680375", "0.44044855", "0.43766296", "0.4361342", "0.43033186", "0.41850474", "0.41850474", "0.41818166", "0.41485018", "0.41484815", "0.4086026", "0.40842333", "0.40774557", "0.40194514", "0.40194514", "0.40079394", "0.4004799", "0.40012282", "0.39992893", "0.39829138", "0.3982581", "0.39813173", "0.39769474", "0.39576796", "0.39313975", "0.39112493" ]
0.6579138
0
Parse the listing configuration.
protected function parseListing(Contao2BackendViewDefinitionInterface $view) { $listing = $view->getListingConfig(); $this->parseListLabel($listing); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function parseListLabel(ListingConfigInterface $listing)\n {\n if (($formats = $this->getFromDca('dca_config/child_list')) === null) {\n return;\n }\n\n foreach ($formats as $providerName => $format) {\n $formatter = new DefaultModelFormatterConfig();\n $configured = false;\n\n if (isset($format['fields'])) {\n $formatter->setPropertyNames($format['fields']);\n $configured = true;\n }\n\n if (isset($format['format'])) {\n $formatter->setFormat($format['format']);\n $configured = true;\n }\n\n if (isset($format['maxCharacters'])) {\n $formatter->setMaxLength($format['maxCharacters']);\n $configured = true;\n }\n\n if ($configured) {\n $listing->setLabelFormatter($providerName, $formatter);\n }\n }\n }", "protected function parseListing(array $listing) {\n // Append ADDR3 to ADDR2 if not empty.\n if (!empty($listing['ADDR3'])) {\n $listing['ADDR2'] .= ', ' . $listing['ADDR3'];\n }\n // Ensure urls.\n $listing['WEBURL'] = $this->ensureExternalUrl($listing['WEBURL']);\n // Group some fields for component paragraph contact.\n if (!empty($listing['EMAIL']) || !empty($listing['PRIMARYCONTACTFULLNAME']) || !empty($listing['SOCIALMEDIA'])) {\n $urls = [];\n foreach ($listing['SOCIALMEDIA'] as $social) {\n $urls[] = [\n 'uri' => $this->ensureExternalUrl($social['VALUE']),\n 'title' => $social['SERVICE'],\n ];\n }\n $listing['FIELD_CONTACT'] = [\n [\n 'type' => 'contact',\n 'field_name' => $listing['PRIMARYCONTACTFULLNAME'],\n 'field_email' => $listing['EMAIL'],\n 'field_urls' => $urls,\n ],\n ];\n }\n return $listing;\n }", "private function parseConfig(){\n\t\t\treturn parse_ini_file(BASE_PATH . 'config' . DIRECTORY_SEPARATOR . 'config.ini');\n\t\t}", "public static function parse($listing){\n\t\t\tself::init();\n\t\t\t$listing=explode(CR,str_replace(CR.CR,CR,str_replace(LF,CR,trim($listing))));\n\t\t\tforeach($listing as $line)self::parseLine($line);\n\t\t\treturn self::fini();\n\t\t}", "public function listing() {\r\n $options = get_option( 'myhome_redux' );\r\n $show_advanced = is_null( $options['mh-listing-show_advanced'] ) ? true : intval( $options['mh-listing-show_advanced'] );\r\n $show_clear = is_null( $options['mh-listing-show_clear'] ) ? true : intval( $options['mh-listing-show_clear'] );\r\n $show_sort_by = is_null( $options['mh-listing-show_sort_by'] ) ? true : intval( $options['mh-listing-show_sort_by'] );\r\n $show_view_types = is_null( $options['mh-listing-show_view_types'] ) ? true : intval( $options['mh-listing-show_view_types'] );\r\n $advanced_number = is_null( $options['mh-listing-search_form_advanced_number'] ) ? 3 : intval( $options['mh-listing-search_form_advanced_number'] );\r\n // settings from Listing options page\r\n $atts = array(\r\n 'lazy_loading' => $options['mh-listing-lazy_loading'] ? 'true' : 'false',\r\n 'lazy_loading_limit' => intval( $options['mh-listing-load_more_button_number'] ),\r\n 'load_more_button' => $options['mh-listing-load_more_button_label'],\r\n 'load_prev_button' => $options['mh-listing-load_prev_button_label'],\r\n 'listing_default_view' => $options['mh-listing-default_view'],\r\n 'estates_per_page' => $options['mh-listing-estates_limit'],\r\n 'search_form_position' => $options['mh-listing-search_form_position'],\r\n 'label' => $options['mh-listing-label'],\r\n 'search_form_advanced_number' => $advanced_number,\r\n 'show_advanced' => $show_advanced ? 'true' : 'false',\r\n 'show_clear' => $show_clear ? 'true' : 'false',\r\n 'show_sort_by' => $show_sort_by ? 'true' : 'false',\r\n 'show_view_types' => $show_view_types ? 'true' : 'false',\r\n 'agent_id' => $this->id, // get estates only from this agent\r\n 'map' => false\r\n );\r\n\r\n // prepare attributes\r\n foreach ( My_Home_Attribute::get_attributes() as $attr ) {\r\n $value = $options['mh-listing-' . $attr->get_slug() . '_show'];\r\n $atts[$attr->get_slug() . '_show'] = $value ? 'true' : 'false';\r\n }\r\n\r\n // initiate listing\r\n $listing = new My_Home_Listing( $atts );\r\n ?>\r\n <div class=\"mh-listing--full-width mh-listing--horizontal-boxed\">\r\n <?php $listing->listing(); ?>\r\n </div>\r\n <?php\r\n }", "function readLists() {\n\n\t\t// get lists file name\n\t\t$adminops_file = $this->settings['adminops_file'];\n\n\t\tif ($lists = $this->xml_parser->parseXml($adminops_file, true, true)) {\n\t\t\t// read the XML structure into arrays\n\t\t\t$this->titles = $lists['LISTS']['TITLES'][0];\n\n\t\t\tif (is_array($lists['LISTS']['ADMINS'][0])) {\n\t\t\t\t$this->admin_list = $lists['LISTS']['ADMINS'][0];\n\t\t\t\t// check admin list consistency\n\t\t\t\tif (empty($this->admin_list['IPADDRESS'])) {\n\t\t\t\t\t// fill <ipaddress> list to same length as <tmlogin> list\n\t\t\t\t\tif (($cnt = count($this->admin_list['TMLOGIN'])) > 0)\n\t\t\t\t\t\t$this->admin_list['IPADDRESS'] = array_fill(0, $cnt, '');\n\t\t\t\t} else {\n\t\t\t\t\tif (count($this->admin_list['TMLOGIN']) != count($this->admin_list['IPADDRESS']))\n\t\t\t\t\t\ttrigger_error(\"Admin mismatch between <tmlogin>'s and <ipaddress>'s!\", E_USER_WARNING);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (is_array($lists['LISTS']['OPERATORS'][0])) {\n\t\t\t\t$this->operator_list = $lists['LISTS']['OPERATORS'][0];\n\t\t\t\t// check operator list consistency\n\t\t\t\tif (empty($this->operator_list['IPADDRESS'])) {\n\t\t\t\t\t// fill <ipaddress> list to same length as <tmlogin> list\n\t\t\t\t\tif (($cnt = count($this->operator_list['TMLOGIN'])) > 0)\n\t\t\t\t\t\t$this->operator_list['IPADDRESS'] = array_fill(0, $cnt, '');\n\t\t\t\t} else {\n\t\t\t\t\tif (count($this->operator_list['TMLOGIN']) != count($this->operator_list['IPADDRESS']))\n\t\t\t\t\t\ttrigger_error(\"Operators mismatch between <tmlogin>'s and <ipaddress>'s!\", E_USER_WARNING);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->adm_abilities = $lists['LISTS']['ADMIN_ABILITIES'][0];\n\t\t\t$this->op_abilities = $lists['LISTS']['OPERATOR_ABILITIES'][0];\n\n\t\t\t// convert strings to booleans\n\t\t\tforeach ($this->adm_abilities as $ability => $value) {\n\t\t\t\tif (strtoupper($value[0]) == 'TRUE') {\n\t\t\t\t\t$this->adm_abilities[$ability][0] = true;\n\t\t\t\t} else {\n\t\t\t\t\t$this->adm_abilities[$ability][0] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ($this->op_abilities as $ability => $value) {\n\t\t\t\tif (strtoupper($value[0]) == 'TRUE') {\n\t\t\t\t\t$this->op_abilities[$ability][0] = true;\n\t\t\t\t} else {\n\t\t\t\t\t$this->op_abilities[$ability][0] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\t// could not parse XML file\n\t\t\ttrigger_error('Could not read/parse adminops file ' . $adminops_file . ' !', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t}", "public function list() {\n $this->store->listConfig();\n }", "function parseConfig() {\n\n\t\t// Make sure our config file exists\n\t\tif(!file_exists(CONFIGPATH . $this->_options['configFile'])) {\n\t\t\tdie('Unable to find <b>'. CONFIGPATH . $this->_options['configFile'] .'</b> file, please check your application configuration');\n\t\t}\n\n\t\t// Switch the file extension\n\t\tswitch(PPI_Helper::getFileExtension($this->_options['configFile'])) {\n\t\t\tcase 'ini':\n\t\t\t\treturn new PPI_Config_Ini(parse_ini_file(CONFIGPATH . $this->_options['configFile'], true, INI_SCANNER_RAW), $this->_options['configBlock']);\n\n\t\t\tcase 'xml':\n\t\t\t\tdie('Trying to load a xml config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t\tcase 'php':\n\t\t\t\tdie('Trying to load a php config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t}\n\t}", "function wp_parse_list($input_list)\n {\n }", "function initialize() {\n $this->_configure = $this->config->item('biz_listing_configure');\n $this->_pagination = $this->config->item('pagination');\n $this->_validation = $this->config->item('biz_listing_validation');\n }", "public function parse()\n {\n $this->initProps();\n $this->initParams();\n $this->load();\n }", "public function parse()\n {\n $this->data = parse_ini_file($this->fileName);\n }", "public function __construct($listing){\n\t\t//\n\t\t$this->listing = $listing;\n\t}", "function ListConfiguration(){\n\t\t\n\t\t// create a new instance of this class\n\t\t$html_conf = new html_algpdf_conf($this->option,$this->rows,$this->db);\n\t\t\n\t\t// create a new patTemplate instance\n\t\t$t =& $html_conf->createTemplate();\n\t\t\t\t\n\t\t// read templates from file\n\t\t$t->readTemplatesFromFile(\"form_configuration.html\");\t\t\n\t\t\n\t\t// set variables\n\t\t$t->addVars(\"page\",array(\"js_url\" => JAVASCRIPT_URL,\n\t\t\t\t\t\t\t\t \"path_storefiles_value\" => $this->rows->path_storefiles));\n\t\t\n\t\t// write options\n\t\t$html_conf->write_yesno_options(&$t,\"options_recursive\",$this->rows->recursive);\n\t\t$html_conf->write_yesno_options(&$t,\"options_verify_cont\",$this->rows->verify_contents);\n\t\t$html_conf->write_yesno_options(&$t,\"options_verify_attachs\",$this->rows->verify_attachs);\n\t\t$html_conf->write_yesno_options(&$t,\"options_show_cat\",$this->rows->show_cat);\n\t\t$html_conf->write_categories_options(&$t,\"options_cats\",$this->rows->analyze_cats);\n\t\t\n\t\t// hiddens\n\t\t$hiddens = array(\"option\" => $this->option, \"task\" => \"\", \"analyze_cats\" => $this->rows->analyze_cats ,\"id_conf\" => $this->rows->id_conf, \"act\" => \"conf\");\n\t\tforeach ($hiddens as $name=>$value){\n\t\t\t$t->addVars(\"hiddens\",array(\"hidden_name\" => $name, \"hidden_value\" => $value));\n\t\t\t$t->parseTemplate(\"hiddens\",\"a\");\n\t\t}\n\t\t\n\t\t// show output\n\t\t$t->displayParsedTemplate();\n\t}", "public static function settings() {\r\n\t\t// VC Form MH Listing\r\n\t\t// Here we setup MH Listing element (basic data and params)\r\n\t\treturn array(\r\n\t\t\t'name' => esc_html__( 'Property Listings', 'myhome-core' ),\r\n\t\t\t'base' => 'mh_listing',\r\n 'icon' => plugins_url( 'myhome-core/public/img/vc-icon.png' ),\r\n\t\t\t'category' => esc_html__( 'MyHome', 'myhome-core' ),\r\n\t\t\t'params' => My_Home_Listing::get_settings()\r\n\t\t);\r\n\t}", "public function set_listing( $listing ) {\r\n\t\t$this->listing = $listing;\r\n\t}", "public function __construct(Listing $listing)\n {\n $this->listing = $listing;\n }", "public static function parse($config) {\n\t\t$config = explode(\"\\n\", $config);\n\t\t$datasources = array();\n\n\t\twhile(!is_null($line = array_shift($config))) {\n\t\t\tif(!$line) continue;\n\t\t\t$bits = preg_split('`\\s+`', $line, 2);\n\t\t\t$type = array_shift($bits);\n\t\t\t\n\t\t\tif(!in_array($type, array(\n\t\t\t\t'member_include', 'include_file', 'include_remote_file', 'include_list', 'include_sympa_list',\n\t\t\t\t'include_remote_sympa_list', 'include_ldap_query', 'include_ldap_2level_query',\n\t\t\t\t'include_sql_query', 'include_voot_group', 'include_ldap_ca', 'include_ldap_2level_ca',\n\t\t\t\t'include_sql_ca'\n\t\t\t))) continue;\n\t\t\t\n\t\t\t$params = array();\n\t\t\tif(count($bits))\n\t\t\t\t$params['arg'] = array_shift($bits);\n\t\t\t\n\t\t\twhile($line = array_shift($config)) {\n\t\t\t\t$bits = preg_split('`\\s+`', $line, 2);\n\t\t\t\t\n\t\t\t\t$params[array_shift($bits)] = array_shift($bits);\n\t\t\t}\n\t\t\t\n\t\t\t$datasources[] = self::getFromType($type, $params);\n\t\t}\n\t\t\n\t\treturn $datasources;\n\t}", "public function onInitListingComponent()\n {\n return new Listing(\n $this->config,\n $this->modelManager\n );\n }", "function SetupListOptions() {\n\t\tglobal $Security, $scholarship_package;\n\n\t\t// \"edit\"\n\t\t$this->ListOptions->Add(\"edit\");\n\t\t$item =& $this->ListOptions->Items[\"edit\"];\n\t\t$item->CssStyle = \"white-space: nowrap;\";\n\t\t$item->Visible = $Security->CanEdit();\n\t\t$item->OnLeft = FALSE;\n\n\t\t// \"detail_scholarship_payment\"\n\t\t$this->ListOptions->Add(\"detail_scholarship_payment\");\n\t\t$item =& $this->ListOptions->Items[\"detail_scholarship_payment\"];\n\t\t$item->CssStyle = \"white-space: nowrap;\";\n\t\t$item->Visible = $Security->AllowList('scholarship_payment');\n\t\t$item->OnLeft = FALSE;\n\n\t\t// Call ListOptions_Load event\n\t\t$this->ListOptions_Load();\n\t\tif ($scholarship_package->Export <> \"\" ||\n\t\t\t$scholarship_package->CurrentAction == \"gridadd\" ||\n\t\t\t$scholarship_package->CurrentAction == \"gridedit\")\n\t\t\t$this->ListOptions->HideAllOptions();\n\t}", "public function get_default_list_config()\n {\n return '[[' . C__PROPERTY_TYPE__DYNAMIC . ',\"_id\",false,\"LC__CMDB__OBJTYPE__ID\",\"isys_cmdb_dao_category_g_global::get_dynamic_properties\",[\"isys_cmdb_dao_category_g_global\",\"dynamic_property_callback_id\"]],' . '[' . C__PROPERTY_TYPE__DYNAMIC . ',\"_title\",false,\"LC__UNIVERSAL__TITLE_LINK\",\"isys_cmdb_dao_category_g_global::get_dynamic_properties\",[\"isys_cmdb_dao_category_g_global\",\"dynamic_property_callback_title\"]],' . '[' . C__PROPERTY_TYPE__STATIC . ',\"its_type\",\"isys_its_type__title\",\"LC__CMDB__CATG__TYPE\",\"isys_cmdb_dao_category_g_its_type::get_properties\",false],' . '[' . C__PROPERTY_TYPE__DYNAMIC . ',\"_created\",false,\"LC__TASK__DETAIL__WORKORDER__CREATION_DATE\",\"isys_cmdb_dao_category_g_global::get_dynamic_properties\",[\"isys_cmdb_dao_category_g_global\",\"dynamic_property_callback_created\"]],' . '[' . C__PROPERTY_TYPE__DYNAMIC . ',\"_changed\",false,\"LC__CMDB__LAST_CHANGE\",\"isys_cmdb_dao_category_g_global::get_dynamic_properties\",[\"isys_cmdb_dao_category_g_global\",\"dynamic_property_callback_changed\"]],' . '[' . C__PROPERTY_TYPE__STATIC . ',\"purpose\",\"isys_purpose__title\",\"LC__CMDB__CATG__GLOBAL_PURPOSE\",\"isys_cmdb_dao_category_g_global::get_properties\",false],' . '[' . C__PROPERTY_TYPE__STATIC . ',\"category\",\"isys_catg_global_category__title\",\"LC__CMDB__CATG__GLOBAL_CATEGORY\",\"isys_cmdb_dao_category_g_global::get_properties\",false],' . '[' . C__PROPERTY_TYPE__DYNAMIC . ',\"_cmdb_status\",false,\"LC__UNIVERSAL__CMDB_STATUS\",\"isys_cmdb_dao_category_g_global::get_dynamic_properties\",[\"isys_cmdb_dao_category_g_global\",\"dynamic_property_callback_cmdb_status\"]]]';\n }", "public function parse()\n\t{\n\t\t$this->parseGroups();\n\t\t$this->parseBadges();\n\t}", "protected function defineListFilter()\n {\n // Initialise the filter\n $filter = $this->initFilter();\n if (!isset($filter['limit'])) {\n $filter['limit'] = array();\n }\n\n // Handle the page browsing variables\n if (isset($this->piVars['max'])) {\n $filter['limit']['max'] = $this->piVars['max'];\n }\n $filter['limit']['offset'] = isset($this->piVars['page']) ? $this->piVars['page'] : 0;\n\n // If the limit is still empty after that, consider the default value from TypoScript\n if (empty($filter['limit']['max'])) {\n $filter['limit']['max'] = $this->conf['listView.']['limit'];\n }\n\n // Handle sorting variables\n if (isset($this->piVars['sort'])) {\n $sortParts = GeneralUtility::trimExplode('.', $this->piVars['sort'], 1);\n $table = '';\n $field = $sortParts[0];\n if (count($sortParts) == 2) {\n $table = $sortParts[0];\n $field = $sortParts[1];\n }\n $order = isset($this->piVars['order']) ? $this->piVars['order'] : 'asc';\n $orderby = array(0 => array('table' => $table, 'field' => $field, 'order' => $order));\n $filter['orderby'] = $orderby;\n\n // If there were no variables, check a default sorting configuration\n } elseif (!empty($this->conf['listView.']['sort'])) {\n $sortParts = GeneralUtility::trimExplode('.', $this->conf['listView.']['sort'], 1);\n $table = '';\n $field = $sortParts[0];\n if (count($sortParts) == 2) {\n $table = $sortParts[0];\n $field = $sortParts[1];\n }\n $order = isset($this->conf['listView.']['order']) ? $this->conf['listView.']['order'] : 'asc';\n $orderby = array(0 => array('table' => $table, 'field' => $field, 'order' => $order));\n $filter['orderby'] = $orderby;\n }\n\n // Save the filter's hash in session\n $cacheKey = $this->prefixId . '_filterCache_default_' . $this->cObj->data['uid'] . '_' . $GLOBALS['TSFE']->id;\n $GLOBALS['TSFE']->fe_user->setKey('ses', $cacheKey, $filter);\n\n return $filter;\n }", "function my_custom_post_listing() {\n\t\t$labels = array(\n\t\t\t'name' => _x('Property Listings', 'post type general name'),\n\t\t\t'singular_name' => _x('Property Listing', 'post type singular name'),\n\t\t\t'add_new' => _x('Add New', 'listing'),\n\t\t\t'add_new_item' => __('Add New Property Listing'),\n\t\t\t'edit_item' => __('Edit Property Listing'),\n\t\t\t'new_item' => __('New Property Listing'),\n\t\t\t'all_items' => __('All Property Listings'),\n\t\t\t'view_item' => __('View Property Listing'),\n\t\t\t'search_items' => __('Search Property Listings'),\n\t\t\t'not_found' => __('No property listings found'),\n\t\t\t'not_found_in_trash' => __('No listings found in the Trash'),\n\t\t\t'parent_item_colon' => '',\n\t\t\t'menu_name' => 'Listing Management'\n\t\t);\n\t\t$args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'description' => 'Holds our listings and listing specific data',\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'rewrite' => true,\n\t\t\t'hierarchical' => false,\n\t\t\t'menu_position' => 5,\n\t\t\t/*'supports' => array('title','editor','thumbnail','excerpt','comments'),*/\n\t\t\t'supports' => array('title','editor','thumbnail','custom-fields','author'),\n\t\t\t'has_archive' => true,\n\t\t);\n\t\tregister_post_type('listing', $args);\n\t}", "public function load_pagination_listings() {\n\t\t// Validate nonce\n\t\tforminator_validate_ajax( \"forminator_popup_pagination_listings\" );\n\n\t\t$html = forminator_template( 'settings/popup/edit-pagination-listings-content' );\n\n\t\twp_send_json_success( $html );\n\t}", "public function getConfigFieldsList()\n {\n return $this->xmlParser\n ->load($this->getFilePath(self::CONFIG_FILE_NAME))\n ->xmlToArray()['config']['_value']['default']['buy_now'];\n }", "public function listing();", "public function parseConfig() {\n $configArray = file('configs/' . $this->_ip . '.ini');\n \n if($configArray === FALSE || sizeof($configArray) <= 1) {\n trigger_error(\"Couldn't read config\");\n return FALSE;\n }\n \n $config = array();\n $configDirective = '';\n \n foreach($configArray as $lineNumber => $line) {\n $line = trim($line);\n \n // Filter out comments\n if(preg_match('/^;/', $line)) {\n continue;\n }\n \n // Config directive\n if(preg_match('/^\\[/', $line)) {\n $configDirective = substr(substr($line, 1), 0, -1);\n continue;\n }\n \n // Filter out blank lines\n if($line == '') {\n continue;\n }\n \n // Looks to be a regular config directive\n // Split on = and place into config array\n \n $lineSplit = explode(\"=\", $line);\n \n $config[$configDirective][$lineSplit[0]] = $lineSplit[1];\n \n unset($lineSplit);\n \n }\n \n return $config;\n }", "public function listing() {\n $this->aConfigs = $this->oLegalNotice->select();\n }", "public function __construct() {\n //--------------------------------------------------------------------GENERAL\n\t $this->configurationOptions[\"default_note_naming\"] = [\n\t\t \"group\" => \"general\",\n\t\t \"type\" => \"list\",\n\t\t \"options\" => [\"C\"=>\\JText::_(\"MYSONGBOOKS_NOTENAMING_C\"),\"Do\"=>\\JText::_(\"MYSONGBOOKS_NOTENAMING_DO\")],\n\t\t \"default\" => \"C\",\n\t\t \"required\" => true,\n\t\t \"width\" => 180\n\t ];\n\t /*\n $this->configurationOptions[\"dummy_types\"] = [\n \"group\" => \"general\",\n \"type\" => \"text\",\n \"validation\" => \"#^[a-z0-9]+(,[a-z0-9]+)*$#i\",\n \"default\" => \"type-1, type-2, type-3\",\n \"required\" => false\n ];\n\n\t $this->configurationOptions[\"list_maker\"] = [\n\t\t \"group\" => \"general\",\n\t\t \"type\" => \"userlist\",\n\t\t \"default\" => json_encode([\"opt1\", \"opt2\", \"opt3\"]),\n\t\t \"required\" => false\n\t ];\n\n\t $this->configurationOptions[\"counter\"] = [\n\t\t \"group\" => \"general\",\n\t\t \"type\" => \"number\",\n\t\t \"default\" => 5,\n\t\t \"min\" => 0,\n\t\t \"max\" => 10,\n\t\t \"required\" => true,\n\t\t \"width\" => 80\n\t ];*/\n\n //--------------------------------------------------------------------ADVANCED\n $this->configurationOptions[\"show_button_sync_db\"] = [\n \"group\" => \"advanced\",\n \"type\" => \"list\",\n \"options\" => [\"Y\"=>\\JText::_(\"MYSONGBOOKS_YES\"),\"N\"=>\\JText::_(\"MYSONGBOOKS_NO\")],\n \"default\" => \"N\",\n \"required\" => true,\n \"width\" => 80\n ];\n\n //auto-setting translated labels & descriptions\n $STRBASE = str_replace(\"com_\", \"\", COMPONENT_ELEMENT_NAME_MYSONGBOOKS) . \"_CFG_PARAM_\";\n foreach($this->configurationOptions as $k => &$a) {\n if(!isset($a[\"label\"])) {\n $a[\"label\"] = \\JText::_(strtoupper($STRBASE.\"NAME_\".$k));\n }\n if(!isset($a[\"description\"])) {\n $a[\"description\"] = \\JText::_(strtoupper($STRBASE.\"DESC_\".$k));\n }\n }\n }" ]
[ "0.5976186", "0.58750457", "0.5602404", "0.5594105", "0.5582123", "0.5545054", "0.54889315", "0.54671484", "0.5463183", "0.54228306", "0.5382607", "0.536617", "0.53271425", "0.5321914", "0.5294301", "0.528648", "0.5274875", "0.51956105", "0.51213795", "0.5095334", "0.50921303", "0.5081567", "0.5068035", "0.50351596", "0.50030124", "0.4977351", "0.4971422", "0.49705648", "0.49415585", "0.49408418" ]
0.67804027
0
get base file url
public function getFileBaseUrl() { return Mage::getBaseUrl('media').'family'.'/'.'file'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function get_base_url() : string {\n return plugin_dir_url( dirname( __FILE__, 2 ) );\n }", "public function base_url() {\n\t\t$protocol = ( ! empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? 'https' : 'http';\n\t\t$host = $_SERVER['HTTP_HOST'];\n\t\t$script = dirname($_SERVER['SCRIPT_NAME']);\n\t\treturn $protocol . '://' . $host . $script . '/';\n\t}", "function getBaseUrl()\n{\n $doc_root_folders = utf8_explode(\"/\", $_SERVER['DOCUMENT_ROOT']);\n $cwd__folders = utf8_explode(\"/\", getcwd());\n //the difference between those is the path from doc root to the folder where\n //all files for this URI reside\n $path_from_doc_root = implode(\"/\", array_diff($cwd__folders, $doc_root_folders));\n return $_SERVER['HTTP_HOST'].'/'.$path_from_doc_root;\n}", "function get_base_url() {\n $fin_string = '';\n $parts = explode('/', $this->request_uri);\n if (count($parts) > 2) {\n $subparts = array_slice($parts, 2);\n foreach ($subparts as $p)\n $fin_string .= $p . '/';\n return substr($fin_string, 0, -1);\n }\n return $fin_string;\n }", "public function get_base_url()\r\n\t\t{\r\n\t\t\t$url = \"http\";\r\n \t\t\tif ( isset( $_SERVER[ 'HTTPS' ] ) && $_SERVER[ 'HTTPS' ] == \"on\" ) $url .= \"s\";\r\n\t\t\t$url .= \"://\";\r\n \t\t\tif ( $_SERVER[ 'SERVER_PORT' ] != \"80\" )\r\n\t\t\t\t$url .= $_SERVER[ 'SERVER_NAME' ]. \":\" . $_SERVER[ 'SERVER_PORT' ] . $_SERVER[ 'REQUEST_URI' ];\r\n\t\t\telse\r\n\t\t\t\t$url .= $_SERVER[ 'SERVER_NAME' ] . \"/\";\r\n\t\t\t\r\n\t\t\treturn $url . self::HOME_DIR;\r\n\t\t}", "public function getFileBaseUrl()\n {\n return Mage::getBaseUrl('media').'invitationstatus'.'/'.'file';\n }", "public function determineBaseUrl()\n {\n // why this works at all :)\n return dirname($_SERVER['SCRIPT_NAME']);\n }", "public function base_url()\n {\n if (isset($_SERVER['HTTP_HOST']) && preg_match('/^((\\[[0-9a-f:]+\\])|(\\d{1,3}(\\.\\d{1,3}){3})|[a-z0-9\\-\\.]+)(:\\d+)?$/i', $_SERVER['HTTP_HOST']))\n {\n $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? \"https://\" : \"http://\";\n $baseurl = $protocol.$_SERVER['HTTP_HOST'].substr($_SERVER['SCRIPT_NAME'], 0, strpos($_SERVER['SCRIPT_NAME'], basename($_SERVER['SCRIPT_FILENAME'])));\n }\n else\n {\n $baseurl = 'http://localhost/';\n }\n\n return $baseurl;\n }", "public function base_url()\n\t{\n\t\treturn URL::base();\n\t}", "public static function get_baseurl()\n {\n }", "public function get_base_uri()\r\n\t{\r\n\t\tif($this->base_uri != null)\r\n\t\t\treturn $this->base_uri;\r\n\t\t\r\n\t\treturn htmlentities(dirname($_SERVER['PHP_SELF']), ENT_QUOTES | ENT_IGNORE, \"UTF-8\") . '/';\r\n\t}", "private static function base_url($path=NULL)\n {\n\t\tglobal $url;\n $fullurl=$url.$path;\n return $fullurl;\n\t}", "function base_url() {\n return Micro::get(Config::class)->get('app.base_url');\n }", "public function getImageBaseURL()\r\n {\r\n return $this->base_url;\r\n }", "function base_url(){\n $url = BASE_URL;\n return $url;\n }", "protected static function generate_base_url()\n\t{\n\t\t$base_url = parent::generate_base_url();\n\t\treturn str_replace('htdocs/novius-os/', '', $base_url);\n\t}", "public function getUrl()\n {\n if (!$this->filename) {\n return null;\n }\n\n return $this->base_url . '/' . $this->filename;\n }", "public function getBaseURL() {\n $url = $_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://';\n \n $url .= $_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']);\n \n return $url;\n }", "public function getBaseUrl()\n\t\t{\n\t\t\treturn $this->base_url;\n\t\t}", "public function getBaseUrl() : string\n {\n return $this->base;\n }", "public function getBaseUri() {}", "public function getBaseUri() {}", "function base_url(){\n return BASE_URL;\n }", "public function baseUrl() {\n return dirname($_SERVER['PHP_SELF']) . '/';\n }", "function get_base_url() {\n return $this->base_url;\n }", "public function getBaseURL()\n\t{\n\t\treturn $this->base_url;\n\t}", "private static function getUrlBase() {\n\t\tif(!isset(self::$usrBbase)) {\n\t\t\tself::$urlBase =\n\t\t\t\tself::getScheme()\n\t\t\t\t. '://'\n\t\t\t\t. self::getHost()\n\t\t\t\t. ((self::getPort() == 80 || self::getPort() == 443)\n\t\t\t\t\t? ''\n\t\t\t\t\t: ':'.self::getPort())\n\t\t\t\t. self::getBasePath();\n\t\t}\n\t\treturn self::$urlBase;\n\t}", "function get_base()\n\t{\n\t\t$site_url = get_site_option('siteurl');\n\t\t$base = trim(preg_replace('#https?://[^/]+#ui', '', $site_url), '/');\n\n\t\t// @since 1.3.0 - guess min dir to check for any dir that we have to\n\t\t// remove from the base\n\t\t$this->_guess_min_dir();\n\n\t\t$this->base = !empty($this->remove_from_base)\n\t\t\t? preg_replace('#^' . $this->remove_from_base . '/?#ui', '', $base, 1)\n\t\t\t: $base;\n\t}", "public function baseUrl() : string\n {\n return $this->urlGenerator->to('mezzo/upload/');\n }", "protected function detectBaseUrl()\n {\n $filename = $this->request->getServerParams()['SCRIPT_FILENAME'];\n $phpSelf = $this->request->getServerParams()['PHP_SELF'];\n $baseUrl = '/';\n\n $basename = basename($filename);\n if ($basename) {\n $path = ($phpSelf ? trim($phpSelf, '/') : '');\n $basePos = strpos($path, $basename) ?: 0;\n $baseUrl .= substr($path, 0, $basePos) . $basename;\n }\n\n return$baseUrl;\n }" ]
[ "0.80191344", "0.80082136", "0.79639703", "0.79058754", "0.7903817", "0.78937364", "0.78924215", "0.78374004", "0.765912", "0.7641377", "0.76127994", "0.7598394", "0.7596075", "0.75888634", "0.7558855", "0.7551855", "0.75413555", "0.75398713", "0.75356454", "0.753432", "0.75229394", "0.7521031", "0.7519128", "0.7514576", "0.74968284", "0.7478485", "0.74697614", "0.74596864", "0.7444167", "0.74310774" ]
0.81894994
0
get attribute input types
public function getAttributeInputTypes($inputType = null) { $inputTypes = array( 'multiselect' => array( 'backend_model' => 'eav/entity_attribute_backend_array', 'source_model' => 'eav/entity_attribute_source_table' ), 'boolean' => array( 'source_model' => 'eav/entity_attribute_source_boolean' ), 'file' => array( 'backend_model' => 'bs_tc/family_attribute_backend_file' ), 'image' => array( 'backend_model' => 'bs_tc/family_attribute_backend_image' ), ); if (is_null($inputType)) { return $inputTypes; } else if (isset($inputTypes[$inputType])) { return $inputTypes[$inputType]; } return array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _getAllowedAttributeFrontendInputTypes()\n {\n return array(\n 'text',\n 'textarea',\n 'select',\n 'multiselect',\n 'price',\n 'date',\n );\n }", "public function getAttributeInputTypes($inputType = null)\n {\n $inputTypes = array(\n 'multiselect' => array(\n 'backend_model' => 'eav/entity_attribute_backend_array'\n ),\n 'boolean' => array(\n 'source_model' => 'eav/entity_attribute_source_boolean'\n ),\n 'file' => array(\n 'backend_model' => 'tpl_eventsmanager/invitationstatus_attribute_backend_file'\n ),\n 'image' => array(\n 'backend_model' => 'tpl_eventsmanager/invitationstatus_attribute_backend_image'\n ),\n );\n\n if (is_null($inputType)) {\n return $inputTypes;\n } else if (isset($inputTypes[$inputType])) {\n return $inputTypes[$inputType];\n }\n return array();\n }", "public function attributeTypes(): TypeCollection;", "public function getTypeAttribute();", "public function getAttributeTypes()\n {\n return $this->attributeTypes;\n }", "public abstract function getTypeAttribute();", "public function getInputType()\n {\n switch ($this->getAttribute()) {\n case 'category_ids':\n return 'category';\n }\n return 'string';\n }", "protected function getAttributesListByInputType(string $type): array\n {\n if (!array_key_exists($type, $this->attributesByType)) {\n $collection = $this->attributeCollectionFactory->create();\n $collection->addSystemHiddenFilter()->addExcludeHiddenFrontendFilter();\n $collection->addFieldToFilter(AttributeInterface::FRONTEND_INPUT, $type);\n $collection->removeAllFieldsFromSelect()->addFieldToSelect(AttributeInterface::ATTRIBUTE_CODE);\n $this->attributesByType[$type] = $collection->getColumnValues(AttributeInterface::ATTRIBUTE_CODE);\n }\n return $this->attributesByType[$type];\n }", "public function getInputTypeAttribute($value) {\n\t\treturn $this->attacktype[$value];\n\t}", "public function get_desired_types();", "public static function getAllowedTypes();", "public function attributeCustomTypes()\n {\n $flagEnabled = \\common\\components\\Consts::STATUS_ENABLED;\n return array(\n 'id' => array('data-options' => array('checkbox'=>'true'), 'key' => true),\n 'type' => array('width' => 100),\n 'office_id' => array('width' => 100),\n 'int_value' => array('width' => 100),\n 'float_value' => array('width' => 100),\n 'str_value' => array('width' => 100),\n 'flag' => array('width' => 100, 'formatter'=>\"function(value,row){ return '0x'+parseInt(value).toString(16); }\"),\n 'status' => array('width' => 80, 'sortable' => 'true',\n 'formatter' => \"function(value,row){ if (value == {$flagEnabled}) { return $.custom.lan.defaults.role.enabled; } else { return $.custom.lan.defaults.role.disabled; };}\"),\n 'edit_user_id' => array('width' => 100, 'sortable' => 'true', 'formatter' => \"function(value,row){ return row.edit_user_disp; }\"),\n 'created_at' => array('width' => 140, 'sortable' => 'true', 'formatter' => \"function(value,row){return $.custom.utils.humanTime(value);}\"),\n 'updated_at' => array('width' => 140, 'sortable' => 'true', 'formatter' => \"function(value,row){return $.custom.utils.humanTime(value);}\"),\n 'operation' => array('width' => 160, \n 'buttons' => array(\n ),\n ),\n );\n }", "function mixedAttributeTypes () {\r\n return $this->_mixedAttributeTypes;\r\n }", "public function getInputTypesWithOptions()\n {\n $types = [];\n foreach ($this->inputTypes as $code => $inputType) {\n if ($inputType->isManageOptions()) {\n $types[] = $code;\n }\n }\n\n return $types;\n }", "public function type()\n\t{\n\t\treturn Ar::type($this->attributes);\n\t}", "public function getAllowedTypes();", "public function getInputTypeAllowableValues()\n {\n return [\n self::INPUT_TYPE_TEXT_FIELD,\n self::INPUT_TYPE_MULTILINE,\n self::INPUT_TYPE_PASSWORD,\n self::INPUT_TYPE_RADIO,\n self::INPUT_TYPE_CHECKBOX,\n self::INPUT_TYPE_DROP_DOWN,\n self::INPUT_TYPE_LISTBOX,\n self::INPUT_TYPE_SIGNATURE,\n self::INPUT_TYPE_PDF_SIGNATURE,\n self::INPUT_TYPE_BUTTON,\n self::INPUT_TYPE_BLOCK,\n self::INPUT_TYPE_FILE_CHOOSER,\n self::INPUT_TYPE_COMB,\n self::INPUT_TYPE_INLINE_IMAGE,\n self::INPUT_TYPE_UNSUPPORTED,\n ];\n }", "protected function get_array_field_types() {\n\t\treturn array( 'multicheck' );\n\t}", "public function getTypeNameAttribute();", "public function getWidgetsByInputType() {\n\t\t$types = array();\n\t\tif ($this->hasParameter('widgets')) {\n\t\t\tforeach ($this->getParameter('widgets') as $name => $widget) {\n\t\t\t\t$inputs = $widget['input'];\n\t\t\t\tforeach($inputs as $input) {\n\t\t\t\t\tif ($input == 'all') {\n\t\t\t\t\t\t$list = ['select', 'checkbox', 'color', 'date', 'datetime-local', 'email', 'file', 'hidden', 'image', 'month', 'number', 'password', 'radio', 'range', 'search', 'tel', 'text', 'time', 'url', 'week'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$list = [$input];\n\t\t\t\t\t}\n\t\t\t\t\tforeach ($list as $type) {\n\t\t\t\t\t\tif (! isset($types[$type])) {\n\t\t\t\t\t\t\t$types[$type] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$types[$type][] = $name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $types;\n\t}", "public static function getAttributeTypeList() {\n $model = self::_getDataType();\n $LblNm = $model::_getLabelName();\n $table = self::_getDbTable();\n $rs = $table->fetchAll(\n $table->select($LblNm)\n );\n $labels = array();\n foreach($rs as $row) {\n array_push($labels, $row->$LblNm);\n }\n return $labels;\n }", "public function getInputType(): string\n {\n return $this->expectArray\n ? \"array of {$this->type}\"\n : $this->type;\n }", "public function getAllAttributesTypes($context = [])\n {\n return $this->fieldProvider->getFields($context);\n }", "public static function getTypes();", "private function get_element_attributes($type, $name, $value, &$datalist, array $args, array $required = array()){\n $p = array('name' => $name, 'value' => $value);\n \n $etype = 'fe_'.$type;\n $allowed = $etype::acceptedAttributes();\n $datalist = array();\n while(count($args) > 0){\n $arg = array_shift($args);\n if( is_string($arg) ){\n $larg = strtolower($arg);\n if( !array_key_exists($larg, $p) || !array_key_exists('class', $p) ){\n if( in_array($larg, formElement::$boolAttributes) )\n $p[$larg] = $larg;\n elseif( array_key_exists($larg, formElement::$enumAttributes) && array_key_exists(true, formElement::$enumAttributes[$larg]) )\n $p[$larg] = formElement::$enumAttributes[$larg][true];\n else\n $p['class'] = $arg;\n }\n }\n if( is_array($arg) && count($arg) > 0 ){\n if( $this->hasHtmlAttributes($arg, $allowed) ){\n foreach($arg as $n => $v){\n $n = strtolower($n);\n if( !array_key_exists($n, $p) ){\n if( array_key_exists($n, formElement::$enumAttributes) && !in_array($v, formElement::$enumAttributes[$n]) && array_key_exists($v, formElement::$enumAttributes[$n]) )\n $v = formElement::$enumAttributes[$n][$v];\n elseif( in_array($n, formElement::$boolAttributes) ){\n if( (is_bool($v) && !$v) || (!is_bool($v) && $v !== 'true') ) continue;\n $v = $n;\n }\n $p[$n] = $v;\n }\n }\n }elseif( in_array('list', $allowed) )\n $datalist = $arg;\n }\n }\n \n foreach($required as $n){\n if( !array_key_exists($n, $p) )\n throw new InvalidArgumentException(sprintf('Missing required attribute \"%s\".', $n));\n }\n \n return $p;\n }", "protected function getAttr()\r\n\t{\r\n\t\treturn array( 'maxLength', 'width', 'searchMethod', 'searchRangeValues' );\r\n\t}", "protected function getTypes() {}", "public function getTypes();", "public function getTypes();", "public function getTypes();" ]
[ "0.7381745", "0.72468597", "0.7240387", "0.716304", "0.7095789", "0.6928327", "0.6919269", "0.6777201", "0.66418105", "0.6489073", "0.63454354", "0.63284594", "0.63149", "0.6284595", "0.6267661", "0.6252109", "0.6226967", "0.6199218", "0.6113599", "0.6098293", "0.60949606", "0.6093446", "0.6059236", "0.60556155", "0.6039875", "0.60368526", "0.6036149", "0.6030373", "0.6030373", "0.6030373" ]
0.7347085
1
get the template processor
protected function _getTemplateProcessor() { if (null === $this->_templateProcessor) { $this->_templateProcessor = Mage::helper('catalog')->getPageTemplateProcessor(); } return $this->_templateProcessor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTemplateEngine() {\n\t\treturn parent::getTemplateEngine();\n\t}", "public function getProcessor($processor);", "public function getProcessor()\n {\n return $this->processor;\n }", "protected function template()\n\t{\n\t\treturn Phpfox::getLib('template');\t\n\t}", "abstract public function getTemplateCompiler(): ?TemplateCompiler;", "public function getEngine()\n {\n return $this->_smarty();\n }", "public function getTemplate()\n {\n return isset($this->parseTemplate)?$this->parseTemplate:false;\n }", "public function getProcessor();", "public function getProcessor();", "public function get_template()\n {\n }", "public function get_template()\n {\n }", "function get_template()\n {\n }", "public function getTemplate() {}", "public function get_template() {\n return $this->_template;\n }", "public function getEngine()\r\n {\r\n return $this->_smarty;\r\n }", "function getCompiledTemplate()\n {\n return $this->_objectPool[$this->_lastUsedObjectKey]->getCompiledTemplate();\n }", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getEngine()\n {\n return $this->smarty;\n }", "public function getEngine()\n {\n return $this->_smarty;\n }", "public function getTemplatesEngine() {\n\t\treturn $this->templatesEngine;\n\t}", "protected function getCurrentParsedTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "public function getTemplate () {\r\n\t\treturn $this->_template;\r\n\t}", "protected function getDocumentTemplate() {}" ]
[ "0.6912399", "0.6747849", "0.6721066", "0.6661074", "0.6497452", "0.64640933", "0.64554274", "0.6454715", "0.6454715", "0.6433876", "0.6431964", "0.63840663", "0.63819057", "0.63723576", "0.6311399", "0.6286915", "0.6272647", "0.6272647", "0.6272647", "0.6272647", "0.6272647", "0.6272647", "0.6269601", "0.6266681", "0.62568766", "0.62162995", "0.62065864", "0.62065864", "0.6206368", "0.620621" ]
0.83113146
1
Store a newly created Presentation in storage. POST /presentations
public function store(CreatePresentationAPIRequest $request) { $input = $request->all(); $presentations = $this->presentationRepository->create($input); return $this->sendResponse($presentations->toArray(), 'Presentation saved successfully'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store()\n\t{\n\t\t$slide = new Slide;\n\t\t$slide->fill();\n\t\t$slide->save();\n\n\t\treturn $this->respondOK();\n\t}", "public function store()\n {\n $publication = $this->publicationRepo->newPost();\n\n $data = Input::all();\n\n $manager = new PublicationManager($publication, $data);\n\n $manager->save();\n\n $status = 'Success';\n\n return Redirect::back();\n }", "public function store(SlideRequest $request)\n {\n $inputs = $request->all();\n\n if (!empty($request->types)) {\n $inputs['types'] = json_encode($request->types);\n }\n $slide = new Slide($inputs);\n $slide->user_id = Auth::user()->id;\n\n if ($slide->save()) {\n return [\n 'success' => 1,\n 'message' => 'Slide successfully created.'\n ];\n }\n\n return [\n 'success' => 0,\n 'message' => \"Something went wrong while trying to create a new slide.\"\n ];\n }", "public function store(SlideRequest $request)\n {\n $validated = $request->validated();\n $path = $request->file('image')->store('image', 'public-images');\n $params = $request->all();\n $params['image'] = $path;\n Slide::create($params);\n return redirect()->route('admin.slides.index');\n }", "public function store()\n {\n $this->validate([\n 'title' => 'required',\n 'body' => 'required',\n ]);\n\n Page::updateOrCreate(['id' => $this->page_id], [\n 'title' => $this->title,\n 'body' => $this->body,\n 'published' => true\n\n ]);\n\n session()->flash('message',\n $this->page_id ? 'Page Updated Successfully.' : 'Page Created Successfully.');\n\n $this->closeModal();\n $this->closeShowModal();\n $this->resetInputFields();\n }", "public function store(Request $request)\n {\n Presentacion::create([\n 'nombrePresentacion' => $request['nombre'],\n ]);\n\n return redirect('admin/presentacion')->with('message','store');\n\n }", "public function store(Request $request)\n {\n //validate\n\n $this->validate($request, [\n 'slide' => 'required|image|mimes:jpeg,png,jpg'\n ]);\n //process\n $slideName =\n $request->file('slide')->getClientOriginalName()\n . '.' .\n $request->file('slide')->extension();\n $request->file('slide')->storeAs('public/slides', $slideName);\n //store\n Slide::create([\n 'path' => 'storage/slides/' . $slideName\n ]);\n //redirect\n return redirect(route('dashboard.slides.index'));\n\n }", "public function store(StoreAnswersRequest $request)\n {\n if (! Gate::allows('answer_create')) {\n return abort(401);\n }\n $request = $this->saveFiles($request);\n Answer::create($request->all());\n\n\n return redirect()->route('slides.show',$request->get('slide_id'));\n }", "public function store(SlideRequest $request)\n {\n\n $image = $request->file('image');\n\n $filename = time() . '_' . $image->getClientOriginalName();\n\n $path = public_path(config('asset.image_path.slide') . $filename);\n\n $slide = $this->SlideModel->create([\n 'name' => $request->name,\n 'image' => $filename,\n\n ]);\n Images::make($image->getRealPath())->resize(1349, 759)->save($path);\n }", "public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'name' => 'required'\n\t\t);\n\t\t$inputAll = Input::except('_token');\n\t\t$input = Input::except('_token', 'class_id', 'menu_id', 'type_config');\n\t\t$validator = Validator::make($input,$rules);\n\t\tif($validator->fails()) {\n\t\t\tif ($inputAll['type_config'] == TYPE_SLIDE_CLASS) {\n\t\t\t\t$modelId = $inputAll['class_id'][0];\n\t\t\t}\n\t\t\tif ($inputAll['type_config'] == TYPE_SLIDE_BLOCK) {\n\t\t\t\t$modelId = $inputAll['block_id'];\n\t\t\t}\n\t\t\tif ($inputAll['type_config'] == TYPE_SLIDE_MENU) {\n\t\t\t\t$modelId = $inputAll['menu_id'][0];\n\t\t\t}\n\t\t\treturn Redirect::action('SlideController@getCreateSlide', array($input['display_type'], $inputAll['type_config'], $modelId))\n\t ->withErrors($validator)\n\t ->withInput(Input::except('password'));\n } else {\n \t$input['image_url'] = getNameImageUpload($input, IMAGESLIDE, 'image_url');\n \t$input['image_url_mobile'] = getNameImageUpload($input, IMAGESLIDE_MOBILE, 'image_url_mobile');\n\t\t\t// $image = Common::uploadImage(IMAGESLIDE, 'image_url');\n\t\t\t// $imageMobile = Common::uploadImage(IMAGESLIDE_MOBILE, 'image_url_mobile');\n\t\t\t// $input['image_url'] = $image;\n\t\t\t// $input['image_url_mobile'] = $imageMobile;\n\t\t\t$slideId = CommonNormal::create($input);\n\t\t\t$slide = SLide::find($slideId);\n\t\t\tif (isset($inputAll['class_id'])) {\n\t\t\t\t$slide->hasClass()->attach(['class_id' => $inputAll['class_id'][0], 'slide_id' => $slideId]);\n\t\t\t}\n\t\t\tif (isset($inputAll['menu_id'])) {\n\t\t\t\t$slide->hasMenu()->attach(['menu_id' => $inputAll['menu_id'][0], 'slide_id' => $slideId]);\n\t\t\t}\n\t\t\tif ($input['display_type'] == TYPE_SLIDE_FULL) {\n\t\t\t\t$input['display_type'] = null;\n\t\t\t}\n\t\t\treturn Redirect::action('SlideController@getList', array($input['display_type'])) ;\n\t\t}\n\t}", "public function store()\n\t{\n\t\t$fbf_presenca = new FbfPresenca;\n\t\t$fbf_presenca->idpresenca = Input::get('idpresenca');\n$fbf_presenca->idcampeonatorodada = Input::get('idcampeonatorodada');\n$fbf_presenca->idatleta = Input::get('idatleta');\n\n\t\t$fbf_presenca->save();\n\n\t\t// redirect\n\t\tSession::flash('message', 'Registro cadastrado com sucesso!');\n\t\treturn Redirect::to('fbf_presenca');\n\t}", "public function store(CreateRequest $request)\n {\n\n\n $imageName= basename($request->imageFile->store(\"public\" , 'public'));\n $request['image']=$imageName;\n\n Slide::create($request->all());\n\n session()->flash('msg', \"s: تم إضافة السلايد بنجاح\");\n\n return redirect(route('slide'));\n }", "public function store(PublicationCreateRequest $request)\n {\n $input = $request->all();\n\n if ($file = $request->file('photo_id')) {\n $name = time() . $file->getClientOriginalName();\n $file->move('images', $name);\n $photo = Photo::create(['file' => $name]);\n $input['photo_id'] = $photo->id;\n }\n// $input['status'] = true;\n\n $request->user()->publications()->create($input);\n\n return redirect('/doctor/publications');\n }", "private function persist() {\n $session = new Session();\n $items = $this->getItems();\n $session->set('inspiration_board', json_encode($items));\n }", "public function store() {\n $url = Input::get('url');\n if (empty($url)) {\n Session::flash('error', 'Bạn chưa chọn ảnh cho slide');\n return Redirect::back();\n }\n $slider = new SlideImage(Input::all());\n if ($slider->validate()) {\n $slider->created_by = Auth::admin()->get()->id;\n $slider->forceSave();\n Session::flash('success', trans('messages.slider_saved'));\n return Redirect::route('admin.slide.index');\n } else {\n return Redirect::back()->withErrors($slider->errors());\n }\n }", "public function store(Request $request)\n {\n //VALIDATE DATA\n\n $this->validate($request, [\n 'title' => 'required',\n 'featured_img' => 'sometimes|image'\n ]);\n\n // STORE DATA TO THE DATABASE\n\n $slide = new Slide();\n\n $slide->title = $request->input('title');\n $slide->content = $request->input('content');\n\n //HERE WE are checking if someone added a photo or not\n if ($request->hasFile('featured_img')) {\n #Add new photo\n $image = $request->file('featured_img');\n $filename = time() . '.' . $image->getClientOriginalExtension();\n $location = public_path('images/slide/' . $filename);\n Image::make($image)->save($location);\n $oldFilename = $slide->image;\n\n //here we update the database\n $slide->image = $filename;\n\n # Delete the old photo\n Storage::delete($oldFilename);\n }\n\n //save\n $slide->save();\n\n flash('Slide Created Successfully!')->success();\n\n return redirect()->route('slide.index');\n }", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Personalemolument::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n $user = Auth::user();\n\n\t\t$input = new PersonalEmolument();\n $input->code_no = Input::get('code_no');\n $input->designation = Input::get('designation');\n $input->salary_scale = Input::get('salary_scale');\n $input->established_meaning_level = Input::get('established_meaning_level');\n $input->actual_strength = Input::get('actual_strength');\n $input->approved_establishment = Input::get('approved_establishment');\n $input->approved_estimate = Input::get('approved_estimate');\n $input->approved_establishment_next = Input::get('approved_establishment_next');\n $input->approved_estimate_next = Input::get('approved_estimate_next');\n $input->unit_id = $user->unit_id;\n $input->financial_year = Input::get('financial_year');\n $input->save();\n\n\t\treturn Redirect::to('personal_emoluments/index');\n\t}", "private function store()\n {\n $this->session->set('sergsxm_form_'.$this->formId, $this->parameters);\n }", "public function store()\n {\n Pages::create([\n 'title' => request()->get('title'),\n 'permalink' => request()->get('permalink'),\n 'description' => request()->get('description'),\n 'keywords' => request()->get('keywords'),\n 'content' => request()->get('content'),\n 'position' => request()->get('position'),\n 'status' => request()->get('status'),\n 'displayOrder' => request()->get('displayOrder'),\n ]);\n\n return redirect()->to('/admin/pages');\n }", "public function store()\n {\n Artical::create($this->validateArtical());\n\n return redirect('/articals');\n }", "public function store()\n\t{\n\t\t$input = Input::all();\n $projection = Projection::find($input['projection']);\n\n Auth::user()->participant->assignProjection($projection, $input['places']);\n $projection->bookPlaces($input['places']);\n return Redirect::route('profile')->with('flash_message', 'Vos places de projection ont bien été réservée. Merci!');\n\t}", "public function store(Request $request)\n {\n //\n $pres=new Prescription;\n $pres->observacion=$request->observacion;\n $pres->instrucciones=$request->instruccion;\n $pres->paciente_id=$request->paciente_id;\n $pres->medico_id=$request->medico_id;\n $pres->save();\n $pres->medicina()->attach($request->medicamentos);\n return redirect('pacientes/historial/'.$pres->paciente_id);\n }", "public function store(HomeSlideRequest $request)\n {\n $data = $request->all();\n request()->validate([\n 'image' => 'required|image|mimes:jpeg,png,jpg,svg|max:2048',\n ]);\n $data['image'] = $request->file('image')->store(\n 'assets/home-slides',\n 'public'\n );\n\n HomeSlide::create($data);\n Alert::success('Success', 'Data Berhasil Ditambah');\n return redirect()->route('homeSlide.index');\n }", "public function store()\n {\n Request::flash();\n\n // validate the request inputs\n $validator = Validator::make(Request::all(), PermType::webStoreRules());\n if ($validator->fails()) {\n return Redirect::back()->withErrors($validator);\n }\n\n $permType = new PermType();\n $permType->name = Request::get('name');\n $permType->description = Request::get('description');\n $permType->points = Request::get('points');\n $permType->save();\n $permType->respos()->attach(Request::get('users'));\n\n return redirect()->route('permType.index');\n }", "public function store(){\n $validateactualite = $this->validate([\n 'titre'=>'required',\n 'sous_titre'=>'required',\n 'descri'=>'required'\n ]);\n $this->validate([\n 'photo'=>'required'\n ]);\n $record = actualite::create($validateactualite);\n $this->photo->storePubliclyAs('public/actualite/', $record->id.'.png');\n //$this->photos[$index]->storePubliclyAs('public/galleries/', $data->id.'.png' );\n session()->flash('message', 'actualite enregistré avec succès');\n $this->emit('Added');\n $this->dispatchBrowserEvent('Added');\n $this->resetFields();\n }", "public function store()\n {\n $data = Input::all();\n Promociones::create([\n 'title' => $data['title'],\n 'discount' => $data['discount'],\n 'img' => $data['img'],\n 'price' => $data['price'],\n 'normalprice' => $data['normalprice'],\n 'save' => $data['save'],\n 'sold_amount' => $data['sold_amount'],\n 'location' => $data['location'],\n 'period' => $data['period'],\n 'info' => $data['info'],\n 'active' => 1,\n ]);\n return redirect('/promocion');\n }", "public function store(Request $request)\n {\n $this->validate($request, ['name' => 'required', ]);\n\n $experience = Experience::create($request->all());\n\n Session::flash('flash_message', 'Experience added!');\n \n \n return redirect($request->id_user . '/project/' . $request->id_project . '/experience/' .$experience->id . '/upload');\n }", "public function store()\n {\n Request::flash();\n\n // validate the request inputs\n $validator = Validator::make(Request::all(), Perm::webStoreRules());\n if ($validator->fails()) {\n return Redirect::back()->withErrors($validator);\n }\n $perm = new Perm();\n $perm->description = Request::get('description');\n $perm->start = $this->formatDate(Request::get('start_date'), Request::get('start_hour'));\n $perm->end = $this->formatDate(Request::get('end_date'), Request::get('end_hour'));\n if (Request::get('open_date') != '' && Request::get('open_hour') != '') {\n $perm->open = $this->formatDate(Request::get('open_date'), Request::get('open_hour'));\n }\n if (Request::get('pre_open_date') != '' && Request::get('pre_open_hour') != '') {\n $perm->pre_open = $this->formatDate(Request::get('pre_open_date'), Request::get('pre_open_hour'));\n }\n $perm->place = Request::get('place');\n $perm->nbr_permanenciers = Request::get('nbr_permanenciers');\n $perm->perm_type_id = Request::get('perm_type_id');\n $perm->save();\n $perm->respos()->attach(Request::get('users'), ['respo' => true]);\n return redirect()->route('perm.index');\n }", "public function addSlide()\n {\n $this->validate($this->request, [\n 'file' => ['required', 'mimes:jpeg,jpg,bmp,png']\n ]);\n\n $file = $this->request->file('file');\n $fileStored = $file->store(\"slides\", 'uploads');\n Slide::create(['file_url' => $fileStored]);\n }", "public function store(Request $request)\n {\n $this->validate( $request, [\n 'title' => 'required|string|min:2',\n 'location' => 'required',\n 'picture' => 'required|image',\n 'garageType' => 'required',\n 'description' => 'nullable|string',\n 'rentFormat' => 'required',\n 'price' => 'required|numeric',\n ]);\n\n if( ($request->file('picture')) ){\n $path = $request->file('picture')->store('public/garagePics');\n }\n\n $publication = Publication::create([\n 'title' => $request->input('title'),\n 'location' => $request->input('location'),\n 'picture' => $path??null,\n 'garageType' => $request->input('garageType'),\n 'description' => $request->input('description')??'',\n 'rentFormat' => $request->input('rentFormat'),\n 'price' => $request->input('price'),\n 'user_id' => \\Auth::user()->id,\n ]);\n\n return redirect('/');\n\n }" ]
[ "0.715317", "0.67453045", "0.64882326", "0.6467261", "0.6437026", "0.6425936", "0.6332626", "0.626378", "0.6202378", "0.6184346", "0.61726147", "0.6153432", "0.6126967", "0.6122126", "0.61204916", "0.6074654", "0.6074197", "0.6041312", "0.60352933", "0.5972772", "0.59663916", "0.59628123", "0.59579533", "0.5951743", "0.5943117", "0.5942091", "0.59335965", "0.5930935", "0.5924198", "0.591401" ]
0.774602
0
Initializes a new cancel invoice request Builder object.
public static function init(int $version): self { return new self(new CancelInvoiceRequest($version)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function build(): CancelInvoiceRequest\n {\n return CoreHelper::clone($this->instance);\n }", "public function cancelInvoiceOrderRows()\n {\n $this->orderType = ConfigurationProvider::INVOICE_TYPE;\n\n return new CancelOrderRowsRequest($this);\n }", "public function build(): CreateInvoiceRequest\n {\n return CoreHelper::clone($this->instance);\n }", "public function prepareRequest() { \n \n $this->validateRequest();\n \n $soapRequest = new \\Svea\\WebPay\\AdminService\\AdminSoap\\CancelOrderRequest( \n new Authentication( \n $this->orderBuilder->conf->getUsername( ($this->orderBuilder->orderType), $this->orderBuilder->countryCode ), \n $this->orderBuilder->conf->getPassword( ($this->orderBuilder->orderType), $this->orderBuilder->countryCode ) \n ),\n $this->orderBuilder->orderId, \n AdminServiceRequest::CamelCaseOrderType( $this->orderBuilder->orderType ),\n $this->orderBuilder->conf->getPassword(($this->orderBuilder->orderType), $this->orderBuilder->countryCode)\n );\n \n return $soapRequest;\n }", "public static function init(): self\n {\n return new self(new CancelSubscriptionResponse());\n }", "public function cancelAccountCreditOrderRows()\n {\n $this->orderType = ConfigurationProvider::ACCOUNTCREDIT_TYPE;\n\n return new CancelOrderRowsRequest($this);\n }", "protected function prepareCancel()\n {\n include $this->env;\n $this->options['Action'] = 'CancelReportRequests';\n if (isset($THROTTLE_LIMIT_REPORTREQUESTLIST)) {\n $this->throttleLimit = $THROTTLE_LIMIT_REPORTREQUESTLIST;\n }\n if (isset($THROTTLE_TIME_REPORTREQUESTLIST)) {\n $this->throttleTime = $THROTTLE_TIME_REPORTREQUESTLIST;\n }\n $this->throttleGroup = 'CancelReportRequests';\n unset($this->options['MaxCount']);\n unset($this->options['NextToken']);\n }", "function cancel() {\n if($this->request->isAsyncCall()) {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canCancel($this->logged_user)) {\n if($this->request->isSubmitted()) {\n try {\n $this->active_invoice->markAsCanceled($this->logged_user);\n \n $issued_to_user = $this->active_invoice->getIssuedTo();\n if ($issued_to_user instanceof User && Invoices::getNotifyClientAboutCanceledInvoice()) {\n $notify_users = array($issued_to_user);\n \t if ($issued_to_user->getId() != $this->logged_user->getId()) {\n \t $notify_users[] = $this->logged_user;\n \t } // if\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_canceled', $this->active_invoice, $this->logged_user)\n ->sendToUsers($notify_users);\n } // if\n \n \t\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t \t'as' => 'invoice', \n \t 'detailed' => true,\n \t ));\n } catch (Error $e) {\n \t$this->response->exception($e);\n } // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }", "public function cancel(): CancelLease\n {\n $tx = new CancelLease($this->getId());\n $tx->lease = $this;\n\n return $tx;\n }", "public function test_manual_CancelOrderRequest() {\n\n // Stop here and mark this test as incomplete.\n// $this->markTestIncomplete(\n// 'skeleton for test_manual_CancelOrderRequest'\n// );\n \n $countryCode = \"SE\";\n $sveaOrderIdToClose = 349698; \n $orderType = \\ConfigurationProvider::INVOICE_TYPE;\n \n $cancelOrderBuilder = new Svea\\CancelOrderBuilder( Svea\\SveaConfig::getDefaultConfig() );\n $cancelOrderBuilder->setCountryCode( $countryCode );\n $cancelOrderBuilder->setOrderId( $sveaOrderIdToClose );\n $cancelOrderBuilder->orderType = $orderType;\n \n $request = new Svea\\AdminService\\CancelOrderRequest( $cancelOrderBuilder );\n $response = $request->doRequest();\n \n ////print_r(\"cancelorderrequest: \"); //print_r( $response ); \n $this->assertInstanceOf('Svea\\AdminService\\CancelOrderResponse', $response);\n $this->assertEquals(1, $response->accepted ); \n $this->assertEquals(0, $response->resultcode ); \n\n }", "public function cancel () {\n\t\t$this->opts['cancel'] = true;\n\t\treturn $this;\n\t}", "public function cancelRequest($id, $cancel_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling cancel'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/cancel';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($cancel_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($cancel_subscription_request));\n } else {\n $httpBody = $cancel_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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\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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function resetAllInvoiceOptions(): Client\n {\n $this->sendInvoiceByPost = null;\n $this->invoiceMaturityDays = null;\n $this->stopServiceDue = null;\n $this->stopServiceDueDays = null;\n // TODO: Add 'Late fee delay' to list of resets when made available!\n\n /** @var Client $this */\n return $this;\n }", "protected function build()\n {\n $this->request = $this->client->createRequest(RequestInterface::DELETE, 'items/' . $this->get('pio_iid'));\n }", "public function cancelPaymentPlanOrderRows()\n {\n $this->orderType = ConfigurationProvider::PAYMENTPLAN_TYPE;\n\n return new CancelOrderRowsRequest($this);\n }", "public function getApiClientCancel()\n {\n $apiClient = new \\Bliskapaczka\\ApiClient\\Bliskapaczka\\Order\\Cancel(\n \\Configuration::get(self::API_KEY),\n $this->getApiMode(\\Configuration::get(self::TEST_MODE))\n );\n\n return $apiClient;\n }", "public function build(): CancelSubscriptionResponse\n {\n return CoreHelper::clone($this->instance);\n }", "public function setInvoice(string $invoice): TransactionRequest\n {\n $this->invoice = $invoice;\n return $this;\n }", "public function cancelApproval(InvoiceInterface $invoice): void;", "protected function _getNewOCREmptyRequest()\n {\n return $this->_getNewSdkInstance('Radial_RiskService_Sdk_OrderConfirmationRequest');\n }", "protected function _getNewEmptyRequest()\n {\n return $this->_getNewSdkInstance('Radial_RiskService_Sdk_Request');\n }", "public function cancel_request() {\n\n $pending_request_exists = $this->micro_relation_exists($this->from, $this->to, \"P\");\n\n if($pending_request_exists) {\n $this->delete_relation(\"P\");\n }\n }", "public function setStatusCancelled()\n {\n $this->status = 'CANCELLED';\n\n return $this;\n }", "public function cancelRequest(CustomRequest $customRequest, Request $request) {\n DB::beginTransaction();\n\n try {\n $data = Input::all();\n // update request table\n $customRequest->expiry_date = null;\n $customRequest->reject_reason = $data['cancel_reason'];\n $customRequest->status = RequestStatus::Reject;\n $customRequest->status_sidang = StatusSidang::Cancel;\n $customRequest->updated_at = now();\n $customRequest->save();\n\n // check penjadwalan table\n $jadwal = Jadwal::where('request_id', $customRequest->id)->first();\n $adminAddress = \\Config::get('customconfig.admin_address');\n\n $ruanganSidang = new RuanganSidang;\n\n // check jadwal is being sent to the participant or not\n if($jadwal->status_pengiriman >= 2 && $jadwal->status_pengiriman <= 5) \n {\n // format tanggal sidang for display on mail html\n $jadwal->tanggal_sidang = DateTime::createFromFormat('Y-m-d H:i:s', $jadwal->tanggal_sidang)->format('d/m/Y H:i A');\n \n // set dospem, backup, penguji object\n $jadwal->dospem = ProdiUserAssignment::join('prodi_user', 'prodi_user_assignment.prodi_user_id', '=', 'prodi_user.id')\n ->where('prodi_user_assignment.id', $jadwal->dosen_pembimbing_id)->first();\n $jadwal->dospenguji = ProdiUserAssignment::join('prodi_user', 'prodi_user_assignment.prodi_user_id', '=', 'prodi_user.id')\n ->where('prodi_user_assignment.id', $jadwal->dosen_penguji_id)->first();\n \n $ruanganSidang = RuanganSidang::where('id', $jadwal->ruangan_sidang_id)->first();\n\n // try sending cancelling mail to participant\n // sending mail to student first\n Mail::to($customRequest->student()->first()->email)->send(new CancelSidangInvitation($jadwal, 'student', $ruanganSidang));\n // check is using pembimbing or bak one then send the cancel email\n if($jadwal->dosen_pembimbing_backup == 0) {\n Mail::to($jadwal->dospem->email)->send(new CancelSidangInvitation($jadwal, 'dospem', $ruanganSidang));\n } else {\n $jadwal->dospemBAK = ProdiUserAssignment::join('prodi_user', 'prodi_user_assignment.prodi_user_id', '=', 'prodi_user.id')\n ->where('prodi_user_assignment.id', $jadwal->dosen_pembimbing_backup)->first();\n Mail::to($jadwal->dospemBAK->email)->send(new CancelSidangInvitation($jadwal, 'dospemBAK', $ruanganSidang));\n }\n // send email to dospenguji\n Mail::to($jadwal->dospenguji->email)->send(new CancelSidangInvitation($jadwal, 'dospenguji', $ruanganSidang));\n }\n // send mail to admin baak\n Mail::to($adminAddress)->send(new CancelSidangInvitation($jadwal, 'admin_baak', $ruanganSidang));\n\n // send mail to prodi\n Mail::to($jadwal->prodiAdmin()->first()->email)->send(new CancelSidangInvitation($jadwal, 'admin_prodi', $ruanganSidang));\n\n // delete the penjadwalan data\n // check the history got data or not\n $history = History::where('penjadwalan_sidang_id', $jadwal->id)->first();\n\n // delete berita acara sidang\n // check berita acara is using or not\n $beritaAcaraReport = Acara::where('request_id', $customRequest->id)->first();\n\n if(isset($beritaAcaraReport)) {\n $beritaAcaraParticipant = Penguji::where('berita_acara_report_id', $beritaAcaraReport->id)->delete();\n $beritaAcaraReport->delete();\n }\n \n if(isset($history)) {\n $history->delete();\n }\n \n $jadwal->delete();\n\n DB::commit();\n // redirect \n $this->setFlashMessage('success', $customRequest->messages('success', 'cancel'));\n return redirect($this->getRoute('list'));\n } catch(\\Exception $e) {\n DB::rollback();\n return $this->parseErrorAndRedirectToRouteWithErrors($this->getRoute('list'), $e);\n }\n }", "protected function __construct() {\n $this->state = State::PENDING;\n $date = date('Y-m-d H:i:s');\n $this->createTime = new \\DateTime();\n $this->updateTime = new \\DateTime();\n $this->appt = null;\n $this->invoiceId = -1;\n }", "public function setCancelVERB($cancelVERB)\n {\n $this->cancelVERB = $cancelVERB;\n return $this;\n }", "protected function newPendingRequest()\n {\n return new PendingRequest($this);\n }", "public function setCancelType($cancelType)\n {\n $this->cancelType = $cancelType;\n return $this;\n }", "public static function init(Invoice $invoice): self\n {\n return new self(new CreateInvoiceRequest($invoice));\n }", "public function initiateCancellation($request, $serviceRequest){\n //Set `cancelRequest` to false before Db transaction\n (bool) $cancelRequest = false;\n\n //Create new record for CSE on `service_request_cancellations` table.\n DB::transaction(function () use ($request, $serviceRequest, &$cancelRequest) {\n \\App\\Models\\ServiceRequestCancellation::create([\n 'user_id' => $request->user()->id,\n 'service_request_id' => $serviceRequest->id, \n 'reason' => $request->reason\n ]);\n\n ServiceRequest::where('uuid', $serviceRequest['uuid'])->update(['status_id' => ServiceRequest::SERVICE_REQUEST_STATUSES['Canceled']]);\n\n //Create a record on `service_request_progresses`, `activity_logs` tables and send mail to either Admin or Client \n $this->createRecordsAndSendMail($request, $serviceRequest);\n\n $cancelRequest = true;\n\n }, 3);\n\n //Send mail to recipient\n $this->sendCancellationMail($request, $serviceRequest);\n\n return $cancelRequest;\n }" ]
[ "0.7931399", "0.65427566", "0.63232183", "0.5860442", "0.5821607", "0.56856114", "0.56220114", "0.5600572", "0.5574343", "0.54832965", "0.54396015", "0.5359577", "0.53177994", "0.5286857", "0.5225809", "0.5163874", "0.5160002", "0.51590157", "0.5151663", "0.5147623", "0.5117413", "0.51093227", "0.51073915", "0.51013434", "0.5094756", "0.50914305", "0.5078999", "0.5068234", "0.50617677", "0.50326574" ]
0.6757025
1
Initializes a new cancel invoice request object.
public function build(): CancelInvoiceRequest { return CoreHelper::clone($this->instance); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function init(int $version): self\n {\n return new self(new CancelInvoiceRequest($version));\n }", "public function cancelInvoiceOrderRows()\n {\n $this->orderType = ConfigurationProvider::INVOICE_TYPE;\n\n return new CancelOrderRowsRequest($this);\n }", "function cancel() {\n if($this->request->isAsyncCall()) {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canCancel($this->logged_user)) {\n if($this->request->isSubmitted()) {\n try {\n $this->active_invoice->markAsCanceled($this->logged_user);\n \n $issued_to_user = $this->active_invoice->getIssuedTo();\n if ($issued_to_user instanceof User && Invoices::getNotifyClientAboutCanceledInvoice()) {\n $notify_users = array($issued_to_user);\n \t if ($issued_to_user->getId() != $this->logged_user->getId()) {\n \t $notify_users[] = $this->logged_user;\n \t } // if\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_canceled', $this->active_invoice, $this->logged_user)\n ->sendToUsers($notify_users);\n } // if\n \n \t\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t \t'as' => 'invoice', \n \t 'detailed' => true,\n \t ));\n } catch (Error $e) {\n \t$this->response->exception($e);\n } // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }", "public static function init(): self\n {\n return new self(new CancelSubscriptionResponse());\n }", "protected function prepareCancel()\n {\n include $this->env;\n $this->options['Action'] = 'CancelReportRequests';\n if (isset($THROTTLE_LIMIT_REPORTREQUESTLIST)) {\n $this->throttleLimit = $THROTTLE_LIMIT_REPORTREQUESTLIST;\n }\n if (isset($THROTTLE_TIME_REPORTREQUESTLIST)) {\n $this->throttleTime = $THROTTLE_TIME_REPORTREQUESTLIST;\n }\n $this->throttleGroup = 'CancelReportRequests';\n unset($this->options['MaxCount']);\n unset($this->options['NextToken']);\n }", "public function cancelAccountCreditOrderRows()\n {\n $this->orderType = ConfigurationProvider::ACCOUNTCREDIT_TYPE;\n\n return new CancelOrderRowsRequest($this);\n }", "public function prepareRequest() { \n \n $this->validateRequest();\n \n $soapRequest = new \\Svea\\WebPay\\AdminService\\AdminSoap\\CancelOrderRequest( \n new Authentication( \n $this->orderBuilder->conf->getUsername( ($this->orderBuilder->orderType), $this->orderBuilder->countryCode ), \n $this->orderBuilder->conf->getPassword( ($this->orderBuilder->orderType), $this->orderBuilder->countryCode ) \n ),\n $this->orderBuilder->orderId, \n AdminServiceRequest::CamelCaseOrderType( $this->orderBuilder->orderType ),\n $this->orderBuilder->conf->getPassword(($this->orderBuilder->orderType), $this->orderBuilder->countryCode)\n );\n \n return $soapRequest;\n }", "public function cancelRequest($id, $cancel_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling cancel'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/cancel';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($cancel_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($cancel_subscription_request));\n } else {\n $httpBody = $cancel_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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\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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function cancelApproval(InvoiceInterface $invoice): void;", "protected function __construct() {\n $this->state = State::PENDING;\n $date = date('Y-m-d H:i:s');\n $this->createTime = new \\DateTime();\n $this->updateTime = new \\DateTime();\n $this->appt = null;\n $this->invoiceId = -1;\n }", "public function test_manual_CancelOrderRequest() {\n\n // Stop here and mark this test as incomplete.\n// $this->markTestIncomplete(\n// 'skeleton for test_manual_CancelOrderRequest'\n// );\n \n $countryCode = \"SE\";\n $sveaOrderIdToClose = 349698; \n $orderType = \\ConfigurationProvider::INVOICE_TYPE;\n \n $cancelOrderBuilder = new Svea\\CancelOrderBuilder( Svea\\SveaConfig::getDefaultConfig() );\n $cancelOrderBuilder->setCountryCode( $countryCode );\n $cancelOrderBuilder->setOrderId( $sveaOrderIdToClose );\n $cancelOrderBuilder->orderType = $orderType;\n \n $request = new Svea\\AdminService\\CancelOrderRequest( $cancelOrderBuilder );\n $response = $request->doRequest();\n \n ////print_r(\"cancelorderrequest: \"); //print_r( $response ); \n $this->assertInstanceOf('Svea\\AdminService\\CancelOrderResponse', $response);\n $this->assertEquals(1, $response->accepted ); \n $this->assertEquals(0, $response->resultcode ); \n\n }", "public function cancelOrderReference($requestParameters = array());", "public function initiateCancellation($request, $serviceRequest){\n //Set `cancelRequest` to false before Db transaction\n (bool) $cancelRequest = false;\n\n //Create new record for CSE on `service_request_cancellations` table.\n DB::transaction(function () use ($request, $serviceRequest, &$cancelRequest) {\n \\App\\Models\\ServiceRequestCancellation::create([\n 'user_id' => $request->user()->id,\n 'service_request_id' => $serviceRequest->id, \n 'reason' => $request->reason\n ]);\n\n ServiceRequest::where('uuid', $serviceRequest['uuid'])->update(['status_id' => ServiceRequest::SERVICE_REQUEST_STATUSES['Canceled']]);\n\n //Create a record on `service_request_progresses`, `activity_logs` tables and send mail to either Admin or Client \n $this->createRecordsAndSendMail($request, $serviceRequest);\n\n $cancelRequest = true;\n\n }, 3);\n\n //Send mail to recipient\n $this->sendCancellationMail($request, $serviceRequest);\n\n return $cancelRequest;\n }", "public function build(): CreateInvoiceRequest\n {\n return CoreHelper::clone($this->instance);\n }", "public function cancel(): CancelLease\n {\n $tx = new CancelLease($this->getId());\n $tx->lease = $this;\n\n return $tx;\n }", "public function cancel_request() {\n\n $pending_request_exists = $this->micro_relation_exists($this->from, $this->to, \"P\");\n\n if($pending_request_exists) {\n $this->delete_relation(\"P\");\n }\n }", "public function cancelInvoice(Request $request, $uid)\n {\n $invoice = \\Acelle\\Model\\Invoice::findByUid($uid);\n $subscription = $request->user()->customer->subscription;\n\n if (!$request->user()->customer->can('delete', $invoice)) {\n return $this->notAuthorized();\n }\n\n // if subscription is new -> cancel now subscription.\n // Make sure a new subscription must have a pending invoice\n if ($subscription->isNew()) {\n $subscription->abortNew();\n } else {\n $invoice->delete();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.invoice.cancelled'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "protected function newPendingRequest()\n {\n return new PendingRequest($this);\n }", "public function cancelPaymentPlanOrderRows()\n {\n $this->orderType = ConfigurationProvider::PAYMENTPLAN_TYPE;\n\n return new CancelOrderRowsRequest($this);\n }", "protected function _getNewEmptyRequest()\n {\n return $this->_getNewSdkInstance('Radial_RiskService_Sdk_Request');\n }", "protected function _getNewOCREmptyRequest()\n {\n return $this->_getNewSdkInstance('Radial_RiskService_Sdk_OrderConfirmationRequest');\n }", "public function cancel () {\n\t\t$this->opts['cancel'] = true;\n\t\treturn $this;\n\t}", "public function __construct(Invoice $invoice)\n {\n $this->invoice = $invoice;\n }", "function cancel_invoice($id)\r\n\t{\r\n\t\t\r\n\t\t$data['check'] = $this->My_model->select_any_row('invoice',array('INVOICE_NO' => $id)); \r\n\t\tif($data['check']->STATUS == 1)\r\n\t\t{\r\n\t\t\t$status = 0;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$status = 1;\r\n\t\t}\r\n\t\t$this->My_model->update_any_table('invoice',array('STATUS' => $status),array('INVOICE_NO ' => $id));\r\n\t\t$this->session->set_flashdata('msg','<div class=\"alert alert-dark alert-danger\">Invoice Cancelled Successfully</div>');\r\n\t\tredirect('Welcome');\r\n\t}", "public function getApiClientCancel()\n {\n $apiClient = new \\Bliskapaczka\\ApiClient\\Bliskapaczka\\Order\\Cancel(\n \\Configuration::get(self::API_KEY),\n $this->getApiMode(\\Configuration::get(self::TEST_MODE))\n );\n\n return $apiClient;\n }", "public function __construct()\n {\n $this->invoice = $invoice;\n }", "public function myBookingCancel(Request $request)\n {\n $bookingService = BookingService::select()\n ->where('bookingCode', '=', $request->get('bookingCode'))\n ->first();\n\n $bookingService->bookingState = 'C';\n $bookingService->cancelDate = now();\n\n // Update to DB\n $bookingService->save();\n\n return response()->json(['success'=>'Booking Cancel']);\n }", "public function __construct($invoice)\n {\n $this->invoice = $invoice;\n }", "public function __construct(Request $request) {\n parent::__construct($request);\n\n $customerKey = (isset($this->request->customerKey) ? $this->request->customerKey : config('getrets.customer_key'));\n\n $this->getRETS = new GetRETS($customerKey);\n }", "public function __construct($invoice_id)\n {\n $this->invoice_id = $invoice_id;\n }" ]
[ "0.7109145", "0.6703967", "0.64607155", "0.6283016", "0.60510397", "0.59354967", "0.589864", "0.58621365", "0.58344877", "0.5780325", "0.57569593", "0.57067686", "0.5648629", "0.56310797", "0.5623773", "0.5513731", "0.5497899", "0.5472397", "0.5448293", "0.5436929", "0.5421689", "0.54038674", "0.5368102", "0.53547776", "0.5343706", "0.5334331", "0.5317914", "0.5305778", "0.5303805", "0.5298297" ]
0.73137414
0
Validator check existing address as account in blockchain.
public function validateAddress($attribute) { $web3BlockChainAdapter = new Web3BlockChainAdapter(Yii::$app->ethereumAPI); if ($this->network === CryptoCurrencyTypes::NETWORK_TYPE_ETHEREUM && !$web3BlockChainAdapter->isAccount($this->$attribute)) { $this->addError($attribute, 'The address does not exist in the blockchain.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isValidAddress($address);", "public function testCheckAddress() {\n\t$this->assertTrue(Bitcoin::checkAddress(\"1pA14Ga5dtzA1fbeFRS74Ri32dQjkdKe5\"));\n\t$this->assertTrue(Bitcoin::checkAddress(\"1MU97wyf7msCVdaapneW2dW1uXP7oEQsFA\"));\n\t$this->assertTrue(Bitcoin::checkAddress(\"1F417eczAAbh41V4oLGNf3DqXLY72hsM73\"));\n\t$this->assertTrue(Bitcoin::checkAddress(\"1ASgNrpNNejRJVfqK2jHmfJ3ZQnMSUJkwJ\"));\n\t$this->assertFalse(Bitcoin::checkAddress(\"1ASgNrpNNejRJVfqK2jHmfJ3ZQnMSUJ\"));\n\t$this->assertFalse(Bitcoin::checkAddress(\"1111111fnord\"));\n\t}", "public function validateaddress($address){\n return $this->bitcoin->validateaddress($address);\n }", "public function testReturnTrueOnValidLitecoinAddress()\n {\n $result = Wallet::validate(self::VALID_LITECOIN_ADDRESS, Wallet::LITECOIN);\n\n $this->assertTrue($result);\n }", "public function testReturnTrueOnValidBitcoinAddress()\n {\n $result = Wallet::validate(self::VALID_BTC_ADDRESS, Wallet::BITCOIN);\n\n $this->assertTrue($result);\n }", "public function validAddresses() {}", "public function testReturnTrueOnValidEthereumAddress()\n {\n $result = Wallet::validate(self::VALID_ETH_ADDRESS, Wallet::ETHEREUM);\n\n $this->assertTrue($result);\n }", "public function checkAddress($address)\n\t\t{\n\t\t\t$address = strip_tags($address);\n\t\t\t\n\t\t\t$this->groestlcoin->validateaddress($address);\n\t\t\t\n\t\t\tif ($this->groestlcoin->response['result']['isvalid'] == 1){\n\t\t\t\treturn 1;}\n\t\t\telse{\n\t\t\t\treturn 0;}\t\t\t\n\t\t}", "public function testReturnTrueOnValidDogecoinAddress()\n {\n $result = Wallet::validate(self::VALID_DOGECOIN_ADDRESS, Wallet::DOGECOIN);\n\n $this->assertTrue($result);\n }", "public function validate_address($address) { \n\n\t// Decode\n\t$decode = $this->base58_decode($address); \n\tif (strlen($decode) != 50) { return false; }\n\n\t// Compare address versionok\\n\n\t$version = substr($decode, 0, 2);\n\t$p2sh_byte = TESTNET == 1 ? 'c4' : '05';\n\tif (hexdec($version) > hexdec($this->public_prefix) && $version != $p2sh_byte) { return false; }\n\n\t// Compare checksum\n\t$hash = hash('sha256', hash('sha256', pack(\"H*\", substr($decode, 0, 42)), true));\n\treturn substr($decode, -8) == substr($hash, 0, 8);\n\t\t\n}", "public function validate_account(){ \n\t\tif($this->data['Client']['account_holder'][0] != ''){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function validateAddress() {\r\n $leng = mb_strlen($this->data[$this->name]['Address']);\r\n if ($leng > 256) {\r\n return FALSE;\r\n } else if ($leng > 128) {\r\n if (mb_ereg(self::_REGEX_FULLWITH, $this->data[$this->name]['Address']) !== false) {\r\n return FALSE;\r\n }\r\n }\r\n return TRUE;\r\n }", "function verify_address($address) // Colorize: green\n { // Colorize: green\n return isset($address) // Colorize: green\n && // Colorize: green\n is_string($address) // Colorize: green\n && // Colorize: green\n ( // Colorize: green\n filter_var($address, FILTER_VALIDATE_IP) // Colorize: green\n || // Colorize: green\n filter_var($address, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) // Colorize: green\n ); // Colorize: green\n }", "public function testAddress()\n {\n $this->assertTrue(RuValidation::address1('Московский пр., д. 100'));\n $this->assertTrue(RuValidation::address1('Moskovskiy ave., bld. 100'));\n\n $this->assertFalse(RuValidation::address1('I would not tell'));\n }", "public function testReturnTrueOnValidDashAddress()\n {\n $result = Wallet::validate(self::VALID_DASH_ADDRESS, Wallet::DASH);\n\n $this->assertTrue($result);\n }", "public function getAccount($bitcoinaddress);", "public function testThrowExceptionOnInvalidLitecoinAddress()\n {\n $this->expectException(Exceptions\\InvalidAddressFormatException::class);\n Wallet::validate(self::INVALID_ADDRESS, Wallet::LITECOIN);\n }", "function isAddress($input)\n{\n $pattern = \"/^[a-zA-Z0-9]{33,34}$/\";\n return preg_match($pattern, $input);\n}", "public function testThrowExceptionOnInvalidDogecoinAddress()\n {\n $this->expectException(Exceptions\\InvalidAddressFormatException::class);\n Wallet::validate(self::INVALID_ADDRESS, Wallet::DOGECOIN);\n }", "public function validate()\n {\n if ($this->addressA->getCountryCode() !== $this->addressB->getCountryCode()) {\n $this->invalidate();\n return false;\n }\n\n if ($this->addressA->getZip() !== $this->addressB->getZip()) {\n $this->invalidate();\n return false;\n }\n\n if ($this->addressA->getCity() !== $this->addressB->getCity()) {\n $this->invalidate();\n return false;\n }\n\n if ($this->addressA->getStreet() !== $this->addressB->getStreet()) {\n $this->invalidate();\n return false;\n }\n\n if ($this->addressA->getAddressAdditional() !== $this->addressB->getAddressAdditional()) {\n $this->invalidate();\n return false;\n }\n\n return true;\n }", "function eth_verify_wallet($addr, $sig) {\n\treturn true;\n}", "public function validate_address( $address ) {\n\t\t// @codingStandardsIgnoreStart\n\t\treturn strlen( $address ) == 35\n\t\t\t&& ( $address[0] == 'D' || $address[0] == 'T' )\n\t\t\t&& $address[1] == 's';\n\t\t// @codingStandardsIgnoreEnd\n\t}", "function is_valid_btcaddress($pubkey)\r\n\t{\r\n\r\n\t$forbidden_chars = array(\";\",\"$\",\"*\",\"!\",\"[\",\"]\",\"@\",\"#\",\"%\",\"^\",\"&\");\r\n\t$minimal_lenght = 25;\r\n\t\r\n\t$errors_sum =0;\r\n\t//check pubkey lenght\r\n\tif (strlen($pubkey)<$minimal_lenght)\r\n\t\t$errors_sum=$errors_sum+1;\t\r\n\t// check if address begins from 1\t\t\r\n\tif ($pubkey[0]!='1')\r\n\t\t$errors_sum=$errors_sum+1;\r\n\t//check if forbidden chars occure\r\n\tforeach ($forbidden_chars as &$forbidden_character)\r\n\t\t{\r\n\t\tif (strpos($pubkey, $forbidden_character))\r\n\t\t\t$errors_sum=$errors_sum+1;\t\r\n\t\t}\r\n\t//result of checking\r\n\tif ($errors_sum ==0)\r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n\r\n\t}", "public function checkAccount(Account $account, int $lastBlock = -1)\n {\n // TODO: Implement checkAccount() method.\n }", "public function testThrowExceptionOnInvalidBitcoinAddress()\n {\n $this->expectException(Exceptions\\InvalidAddressFormatException::class);\n Wallet::validate(self::INVALID_ADDRESS, Wallet::BITCOIN);\n }", "private function isValidAddress($addressId)\r\n {\r\n $address = Shopware()->Models()->find('Shopware\\Models\\Customer\\Address',$addressId);\r\n return $this->get('shopware_account.address_validator')->isValid($address);\r\n }", "public function testRandomEthereumAddress()\n {\n $initial_value = random_ethereum_address();\n $this->assertInternalType('string', $initial_value);\n \n CryptoStat::setCurrency('ETH');\n $is_valid = CryptoStat::validateAddress($initial_value); \n \n $this->assertTrue($is_valid);\n }", "private function _isValidAccount( $blz, $account ) {\n return ( TRUE );\n }", "function hasValidAddress()\n{\n return isset($_POST[\"address\"]) && isAddress($_POST[\"address\"]);\n}", "public function validate_refund_address_field() {\n\n\t\tWC()->session->set( 'decred_refund_address', null );\n\n\t\t$address = $this->get_post( 'decred-refund-address' );\n\n\t\t// this should never happen as the refund address field should be missing.\n\t\tif ( ! empty( $address ) && ! $this->show_refund_address() ) {\n\t\t\twc_add_notice( __( 'Decred plugin error: unexpected refund address.', 'decred' ), 'error' );\n\t\t\treturn false;\n\t\t}\n\n\t\t// empty address OK if optional, otherwise validate it.\n\t\tif ( empty( $address ) && ! $this->require_refund_address() ) {\n\t\t\t$address_is_valid = true;\n\t\t} else {\n\t\t\t$address_is_valid = $this->validate_address( $address );\n\t\t}\n\n\t\tif ( $address_is_valid ) {\n\t\t\tif ( ! empty( $address ) ) {\n\t\t\t\t// save address now to retrieve it later when order created.\n\t\t\t\tWC()->session->set( 'decred_refund_address', $address );\n\t\t\t}\n\t\t} else {\n\t\t\t// translators: parameter is address entered by user, not to be translated.\n\t\t\t$message = __( 'Please enter a valid Decred address for refunds. Wrong address \"%s\"', 'decred' );\n\t\t\twc_add_notice( sprintf( $message, $address ), 'error' );\n\t\t}\n\t}" ]
[ "0.71650594", "0.70034206", "0.6879885", "0.68313944", "0.6782121", "0.6760822", "0.6639987", "0.6601004", "0.6573855", "0.64992744", "0.6492827", "0.6459363", "0.63669884", "0.6321514", "0.63187397", "0.62727505", "0.6261529", "0.61439997", "0.6137735", "0.6131908", "0.61259997", "0.6113208", "0.6101763", "0.6037958", "0.60248566", "0.6015947", "0.6006419", "0.59712815", "0.5941015", "0.59329784" ]
0.70157564
1
allows change of current set of templates templates will be loaded in that order : ptTplSwitcher_tplCurrent ptTplSwitcher_tplDefault symfony template dir
static public function setCurrentTpl($tpl) { $origin = __CLASS__.'::'.__FUNCTION__; $db = true; $ret = true; $enabled_modules = sfConfig::get('sf_enabled_modules'); if (in_array('switch', $enabled_modules) ) { // this allows for setting the current tpl "permanently" (for all sessions accessing the site) $pt_switcher_config_file = sfConfig::get('sf_plugins_dir').DS.'ptTplSwitcherPlugin'.DS.'config'.DS.'app.yml'; $config = sfYaml::load($pt_switcher_config_file); $config['all']['ptTplSwitcher']['tplCurrent'] = $tpl; $yaml = sfYaml::dump($config); $ret = file_put_contents($pt_switcher_config_file, $yaml); } sfConfig::set('app_ptTplSwitcher_tplCurrent', $tpl); // if ($db) { var_dump($origin, $tpl); } return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setTemplate(){\n if (isset($this->data['template']) && !empty($this->data['template'])){\n $template = APP_ROOT.'/app/templates/'.trim($this->data['template']).'.tpl';\n if (file_exists($template)){\n $this->template = $template;\n return;\n }\n }\n //default\n $this->template = APP_ROOT.'/app/templates/default.tpl';\n }", "private function load_template()\r\n\t{\r\n\t\tif(! $this -> loaded)\r\n\t\t{\r\n\t\t\t$controller = $this -> sp -> targetdir().\"/\".sp_StaticProjector::templates_dir.\"/\".$this->name.\"_controller.php\";\r\n\t\t\tsp_StaticRegister::push_object(\"sp\", $this -> sp);\r\n\t\t\t\r\n\t\t\tif(!file_exists($controller))\r\n\t\t\t{\r\n $controller = $this -> sp -> coretemplatesdir().\"/\".$this->name.\"_controller.php\";\r\n if(! file_exists($controller)) {\r\n $controller = $this -> sp -> coretemplatesdir().\"/default_controller.php\";\r\n }\r\n\t\t\t\t/*if($this -> name == \"default\")\r\n\t\t\t\t{\r\n\t\t\t\t\t$default_controller = $this -> sp -> defaultsdir().\"/default_controller.php\";\r\n\t\t\t\t\t@copy($default_controller, $controller);\r\n\t\t\t\t\tchmod($controller,sp_StaticProjector::file_create_rights);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$base_code = file_get_contents($this -> sp -> defaultsdir().\"/new_controller.txt\");\r\n\t\t\t\t\t$controller_code = str_replace(\"%controller_name%\", $this->name.\"_controller\", $base_code);\r\n\t\t\t\t\tfile_put_contents($controller, $controller_code);\r\n\t\t\t\t}*/\r\n\t\t\t}\r\n\t\t\trequire_once($controller);\r\n\r\n\t\t\t$template = $this -> sp -> targetdir().\"/\".sp_StaticProjector::templates_dir.\"/\".$this->name.\"_template.php\";\r\n\t\t\tif(!file_exists($template))\r\n\t\t\t{\r\n $template = $this -> sp -> coretemplatesdir().\"/\".$this->name.\"_template.php\";\r\n if(! file_exists($template)) {\r\n $template = $this -> sp -> coretemplatesdir().\"/default_template.php\";\r\n }\r\n\t\t\t\t/*if($this -> name == \"default\")\r\n\t\t\t\t{\r\n\t\t\t\t\t$default_template = $this -> sp -> defaultsdir().\"/default_template.php\";\r\n\t\t\t\t\t@copy($default_template, $template);\r\n\t\t\t\t\tchmod($template,sp_StaticProjector::file_create_rights);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$chunks_code = \"\";\r\n\t\t\t\t\t$chunk_base = file_get_contents($this -> sp -> defaultsdir().\"/new_template_chunk.txt\");\r\n\t\t\t\t\tforeach($this -> sp -> get_config() -> default_templates_chunks() as $chunk)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$chunks_code .= str_replace(\"%chunk_name%\",$chunk,$chunk_base);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$template_base = file_get_contents($this -> sp -> defaultsdir().\"/new_template.txt\");\r\n\t\t\t\t\t$template_code = str_replace(\"%template_name%\", $this -> name.\"_template\", $template_base);\r\n\t\t\t\t\t$template_code = str_replace(\"%template_chunks%\", $chunks_code, $template_code);\r\n\t\t\t\t\tfile_put_contents($template, $template_code);\r\n\t\t\t\t}*/\r\n\t\t\t}\r\n\t\t\trequire_once($template);\r\n\t\t\tsp_StaticRegister::pop_object(\"sp\");\r\n\t\t\t\r\n\t\t\t$this -> loaded = true;\r\n\t\t}\r\n\t}", "protected function setTemplatePaths() {}", "public function onAfterTwigTemplatesPaths()\n {\n if (!$this->active) {\n return;\n }\n\n Registry::get('Twig')->twig_paths[] = __DIR__ . '/templates';\n }", "function defaultTemplate(){\n $this->addLocations(); // add addon files to pathfinder\n return array($this->template_file);\n }", "public function setTemplate($tpl_name){\n \tif($this->isAllowedToChangeTemplate()){\n \t\t$this->template = $tpl_name;\n \t\t$this->baseReplaces['tpl_folder'] = $this->getTemplateDir();\n \t\t$GLOBALS['tpl']['activeTemplate'] = $tpl_name;\n \t}\n }", "function defaultTemplate() {\n//\t\t$l = $this->api->locate('addons',__NAMESPACE__,'location');\n//\t\t$addon_location = $this->api->locate('addons',__NAMESPACE__);\n//\t\t$this->api->pathfinder->addLocation($addon_location,array(\n//\t\t\t'js'=>'templates/js',\n//\t\t\t'css'=>'templates/css',\n// 'template'=>'templates',\n//\t\t))->setParent($l);\n\n return array('view/draw');\n }", "public function loadTemplate()\n\t\t{\n\t\t}", "protected function setVarToTemplates()\n {\n $this->templates->set_tpl($this->varName, $this->checkNewCommondaty());\n }", "function defaultTemplate() {\n\t\t$l = $this->api->locate('addons',__NAMESPACE__,'location');\n\t\t$addon_location = $this->api->locate('addons',__NAMESPACE__);\n\t\t$this->api->pathfinder->addLocation($addon_location,array(\n\t\t\t//'js'=>'templates/js',\n\t\t\t//'css'=>'templates/css',\n //'template'=>'templates',\n\t\t))->setParent($l);\n\n //return array('view/lister/tags');\n return parent::defaultTemplate();\n }", "public function loadMenu()\n\t{\n\t\t$request = array(\n\t\t\t't_location' => ( isset( \\IPS\\Request::i()->t_location ) ) ? \\IPS\\Request::i()->t_location : null,\n\t\t\t't_group' => ( isset( \\IPS\\Request::i()->t_group ) ) ? \\IPS\\Request::i()->t_group : null,\n\t\t\t't_key' \t => ( isset( \\IPS\\Request::i()->t_key ) ) ? \\IPS\\Request::i()->t_key : null,\n\t\t\t't_type' => ( isset( \\IPS\\Request::i()->t_type ) ) ? \\IPS\\Request::i()->t_type : 'templates',\n\t\t);\n\n\t\tswitch( $request['t_type'] )\n\t\t{\n\t\t\tdefault:\n\t\t\tcase 'template':\n\t\t\t\t$flag = \\IPS\\cms\\Templates::RETURN_ONLY_TEMPLATE;\n\t\t\t\tbreak;\n\t\t\tcase 'js':\n\t\t\t\t$flag = \\IPS\\cms\\Templates::RETURN_ONLY_JS;\n\t\t\t\tbreak;\n\t\t\tcase 'css':\n\t\t\t\t$flag = \\IPS\\cms\\Templates::RETURN_ONLY_CSS;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$templates = \\IPS\\cms\\Templates::buildTree( \\IPS\\cms\\Templates::getTemplates( $flag + \\IPS\\cms\\Templates::RETURN_DATABASE_ONLY ) );\n\n\t\t$current = new \\IPS\\cms\\Templates;\n\t\t\n\t\tif ( ! empty( $request['t_key'] ) )\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$current = \\IPS\\cms\\Templates::load( $request['t_key'] );\n\t\t\t}\n\t\t\tcatch( \\OutOfRangeException $ex )\n\t\t\t{\n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t\\IPS\\Output::i()->output = \\IPS\\Theme::i()->getTemplate( 'templates' )->menu( $templates, $current, $request );\n\t}", "public function Setup_Templates_List() : void\n {\n $this->Templates = apply_filters(\"WP_Plugin_virtual_pages_templates\",[\n ...array('page.php', 'index.php' ), ...(array) $this->Template]);\n }", "public function loadTemplates() {\n // Get database hooks.\n $doctrine = $this->container->get('doctrine');\n $slideTemplateRepository = $doctrine->getRepository('Os2DisplayCoreBundle:SlideTemplate');\n $screenemplateRepository = $doctrine->getRepository('Os2DisplayCoreBundle:ScreenTemplate');\n $entityManager = $doctrine->getManager();\n\n // Get parameters.\n $path = $this->container->get('kernel')->getRootDir() . '/../web/';\n $serverAddress = $this->container->getParameter('absolute_path_to_server');\n\n // Locate templates in /web/bundles/\n $templates = $this->findTemplates($path . 'bundles/');\n\n foreach ($templates['slides'] as $config) {\n $dir = explode('/web/', pathinfo($config, PATHINFO_DIRNAME));\n $this->loadSlideTemplate($config, $slideTemplateRepository, $entityManager, $dir[1], $serverAddress, $path);\n }\n\n foreach ($templates['screens'] as $config) {\n $dir = explode('/web/', pathinfo($config, PATHINFO_DIRNAME));\n $this->loadScreenTemplate($config, $screenemplateRepository, $entityManager, $dir[1], $serverAddress, $path);\n }\n\n // Get all templates from the database, and push update to screens.\n $existingTemplates = $screenemplateRepository->findAll();\n $middlewareService = $this->container->get('os2display.middleware.communication');\n foreach ($existingTemplates as $template) {\n foreach ($template->getScreens() as $screen) {\n $middlewareService->pushScreenUpdate($screen);\n }\n }\n }", "public function onTwigTemplatePaths()\n {\n $this->grav['twig']->twig_paths[] = __DIR__ . '/templates';\n }", "public function onTwigTemplatePaths()\n {\n $this->grav['twig']->twig_paths[] = __DIR__ . '/templates';\n }", "public function onTwigTemplatePaths()\n {\n $this->grav['twig']->twig_paths[] = __DIR__ . '/templates';\n }", "public function onTwigTemplatePaths()\n {\n $this->grav['twig']->twig_paths[] = __DIR__ . '/templates';\n }", "public function onTwigTemplatePaths()\n {\n $this->grav['twig']->twig_paths[] = __DIR__ . '/templates';\n }", "public function onTwigTemplatePaths(): void\n {\n $this->grav['twig']->twig_paths[] = __DIR__ . \"/templates\";\n }", "public function tempalte()\n \t{\n \t\t$this->load->template('index-1');\n \t}", "function load_templates( $template ) {\n\n if ( is_singular( 'units' ) ) {\n \tif ( $overridden_template = locate_template( 'single-units.php' ) ) {\n\t\t\t $template = $overridden_template;\n\t\t\t } else {\n\t\t\t $template = plugin_dir_path( __file__ ) . 'templates/single-units.php';\n\t\t\t }\n } elseif ( is_archive( 'units' ) ) {\n \tif ( $overridden_template = locate_template( 'archive-units.php' ) ) {\n\t\t\t $template = $overridden_template;\n\t\t\t } else {\n\t\t\t $template = plugin_dir_path( __file__ ) . 'templates/archive-units.php';\n\t\t\t }\n }\n load_template( $template );\n\t}", "protected function _loadTemplates()\n {\n $this->_tpl = array();\n $dir = Solar_Class::dir($this, 'Data');\n $list = glob($dir . '*.php');\n foreach ($list as $file) {\n \n // strip .php off the end of the file name to get the key\n $key = substr(basename($file), 0, -4);\n \n // load the file template\n $this->_tpl[$key] = file_get_contents($file);\n \n // we need to add the php-open tag ourselves, instead of\n // having it in the template file, becuase the PEAR packager\n // complains about parsing the skeleton code.\n // \n // however, only do this on non-view files.\n if (substr($key, 0, 4) != 'view') {\n $this->_tpl[$key] = \"<?php\\n\" . $this->_tpl[$key];\n }\n }\n }", "protected function setTemplateVariables() {}", "public function loadTemplate()\n\t{\n\t\t$t_location = \\IPS\\Request::i()->t_location;\n\t\t$t_key = \\IPS\\Request::i()->t_key;\n\t\t\n\t\tif ( $t_location === 'block' and $t_key === '_default_' and isset( \\IPS\\Request::i()->block_key ) )\n\t\t{\n\t\t\t/* Find it from the normal template system */\n\t\t\tif ( isset( \\IPS\\Request::i()->block_app ) )\n\t\t\t{\n\t\t\t\t$plugin = \\IPS\\Widget::load( \\IPS\\Application::load( \\IPS\\Request::i()->block_app ), \\IPS\\Request::i()->block_key, mt_rand() );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$plugin = \\IPS\\Widget::load( \\IPS\\Plugin::load( \\IPS\\Request::i()->block_plugin ), \\IPS\\Request::i()->block_key, mt_rand() );\n\t\t\t}\n\t\t\t\n\t\t\t$location = $plugin->getTemplateLocation();\n\t\t\t\n\t\t\t$templateBits = \\IPS\\Theme::master()->getRawTemplates( $location['app'], $location['location'], $location['group'], \\IPS\\Theme::RETURN_ALL );\n\t\t\t$templateBit = $templateBits[ $location['app'] ][ $location['location'] ][ $location['group'] ][ $location['name'] ];\n\t\t\t\n\t\t\tif ( ! isset( \\IPS\\Request::i()->noencode ) OR ! \\IPS\\Request::i()->noencode )\n\t\t\t{\n\t\t\t\t$templateBit['template_content'] = htmlentities( $templateBit['template_content'], ENT_DISALLOWED, 'UTF-8', TRUE );\n\t\t\t}\n\t\t\t\n\t\t\t$templateArray = array(\n\t\t\t\t'template_id' \t\t\t=> $templateBit['template_id'],\n\t\t\t\t'template_key' \t\t\t=> 'template_' . $templateBit['template_name'] . '.' . $templateBit['template_id'],\n\t\t\t\t'template_title'\t\t=> $templateBit['template_name'],\n\t\t\t\t'template_desc' \t\t=> null,\n\t\t\t\t'template_content' \t\t=> $templateBit['template_content'],\n\t\t\t\t'template_location' \t=> null,\n\t\t\t\t'template_group' \t\t=> null,\n\t\t\t\t'template_container' \t=> null,\n\t\t\t\t'template_rel_id' \t\t=> null,\n\t\t\t\t'template_user_created' => null,\n\t\t\t\t'template_user_edited' => null,\n\t\t\t\t'template_params' \t => $templateBit['template_data']\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif ( \\is_numeric( $t_key ) )\n\t\t\t\t{\n\t\t\t\t\t$template = \\IPS\\cms\\Templates::load( $t_key, 'template_id' );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$template = \\IPS\\cms\\Templates::load( $t_key );\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch( \\OutOfRangeException $ex )\n\t\t\t{\n\t\t\t\t\\IPS\\Output::i()->json( array( 'error' => true ) );\n\t\t\t}\n\n\t\t\tif ( $template !== null )\n\t\t\t{\n\t\t\t\t$templateArray = array(\n\t 'template_id' \t\t\t=> $template->id,\n\t 'template_key' \t\t\t=> $template->key,\n\t 'template_title'\t\t=> $template->title,\n\t 'template_desc' \t\t=> $template->desc,\n\t 'template_content' \t\t=> ( isset( \\IPS\\Request::i()->noencode ) AND \\IPS\\Request::i()->noencode ) ? $template->content : htmlentities( $template->content, ENT_DISALLOWED, 'UTF-8', TRUE ),\n\t 'template_location' \t=> $template->location,\n\t 'template_group' \t\t=> $template->group,\n\t 'template_container' \t=> $template->container,\n\t 'template_rel_id' \t\t=> $template->rel_id,\n\t 'template_user_created' => $template->user_created,\n\t 'template_user_edited' => $template->user_edited,\n\t 'template_params' \t => $template->params\n\t );\n\t\t\t}\n\t\t}\n\n\t\tif ( \\IPS\\Request::i()->show == 'json' )\n\t\t{\n\t\t\t\\IPS\\Output::i()->json( $templateArray );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\\IPS\\Output::i()->sendOutput( \\IPS\\Theme::i()->getTemplate( 'global', 'core' )->blankTemplate( \\IPS\\Theme::i()->getTemplate( 'templates', 'cms', 'admin' )->viewTemplate( $templateArray ) ), 200, 'text/html', \\IPS\\Output::i()->httpHeaders );\n\t\t}\n\t}", "public function init()\n {\n parent::init();\n if($this->tpl === null || !in_array($this->tpl, $this->type)){\n $this->tpl = 'menu';\n }\n $this->tpl .= '.php';\n }", "function templates()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$object = ( $this->tasks['templates'] == 1 ) ? 'Skin Template' : 'Skin Templates';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'removed' : 'created';\n\t\t\n\t\tforeach ( $this->xml_array['templates_group']['template'] as $k => $v )\n\t\t{\n\t\t\t$this->ipsclass->DB->do_delete( 'skin_templates', \"set_id=1 AND group_name='\".$v['group_name']['VALUE'].\"' AND func_name='\".$v['func_name']['VALUE'].\"'\" );\n\t\t\t\n\t\t\tif ( !$this->ipsclass->input['un'] )\n\t\t\t{\n\t\t\t\t$this->_add_template( $v );\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />{$this->tasks['templates']} {$object} {$operation}....\" );\n\t}", "public function formatTemplateFiles()\n {\n $name = str_replace(\":\", \".\", $this->getName());\n $list = parent::formatTemplateFiles();\n array_unshift(\n $list,\n $this->context->parameters[\"appDir\"] . \"/templates/$name.$this->view.latte\"\n );\n return $list;\n }", "public function onTwigTemplatePaths()\n {\n $this->grav['twig']->twig_paths[] = __DIR__.'/templates';\n }", "public function renderDefault() {\n\t\t$this->onlyForAdmins();\n\t\t$this->template->instances = $this->configManager->getInstances($this->fileName);\n\t}", "public function getMainTpl(){\n return $this->templates['main'];\n }" ]
[ "0.66988117", "0.6542136", "0.6452914", "0.63796985", "0.63705105", "0.63204616", "0.62383723", "0.6216628", "0.61710274", "0.61352193", "0.6073736", "0.60563666", "0.60045666", "0.59754115", "0.59754115", "0.59754115", "0.59754115", "0.59754115", "0.59642917", "0.5925577", "0.5918797", "0.5917633", "0.59029007", "0.5891866", "0.58845806", "0.5878617", "0.5878289", "0.5868778", "0.58544326", "0.5843992" ]
0.7009998
0
Constructor for the pluggable theme handler.
public function __construct() { $this->setup_theme(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __construct() {\n\t\tparent::__construct();\n\n\t\t//Prepare theme\n\t\t$this->theme_setup();\n\n\t}", "public function __construct() {\n\n\t\t// Setup empty class for the global $wpex_theme object\n\t\tglobal $wpex_theme;\n\t\t$wpex_theme = new stdClass;\n\n\t\t// Defines hooks and runs actions on init\n\t\tadd_action( 'init', array( $this, 'actions' ), 0 );\n\n\t\t// Define constants\n\t\tadd_action( 'after_setup_theme', array( $this, 'constants' ), 1 );\n\n\t\t// Load all the theme addons\n\t\tadd_action( 'after_setup_theme', array( &$this, 'addons' ), 2 );\n\n\t\t// Load configuration classes (post types & 3rd party plugins)\n\t\t// Must load first so it can use hooks defined in the classes\n\t\tadd_action( 'after_setup_theme', array( &$this, 'configs' ), 3 );\n\n\t\t// Load all core theme function files\n\t\tadd_action( 'after_setup_theme', array( &$this, 'include_functions' ), 4 );\n\n\t\t// Load framework classes\n\t\tadd_action( 'after_setup_theme', array( &$this, 'classes' ), 5 );\n\n\t\t// Load custom widgets\n\t\tadd_action( 'after_setup_theme', array( &$this, 'custom_widgets' ), 5 );\n\n\t\t// Populate the global opject after all core functions are registered and after the WP object is set up\n\t\t// Would be best to use template_redirect, but need to use wp_head to fix a bug with the Visual Composer Media Grid builder...\n\t\tadd_action( 'wp_head', array( $this, 'global_object' ), 0 );\n\n\t\t// Actions & filters\n\t\tadd_action( 'after_setup_theme', array( &$this, 'add_theme_support' ) );\n\n\t\t// Flush rewrites after theme switch to prevent 404 errors\n\t\tadd_action( 'after_switch_theme', array( &$this, 'flush_rewrite_rules' ) );\n\n\t\t// Load scripts in the WP admin\n\t\tadd_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts' ) );\n\n\t\t// Load theme CSS\n\t\tadd_action( 'wp_enqueue_scripts', array( &$this, 'theme_css' ) );\n\n\t\t// Load responsive CSS - must be added last\n\t\tadd_action( 'wp_enqueue_scripts', array( &$this, 'responsive_css' ), 99 );\n\n\t\t// Load theme js\n\t\tadd_action( 'wp_enqueue_scripts', array( &$this, 'theme_js' ) );\n\n\t\t// Add meta viewport tag to header\n\t\tadd_action( 'wp_head', array( &$this, 'meta_viewport' ), 1 );\n\n\t\t // Add meta viewport tag to header\n\t\tadd_action( 'wp_head', array( &$this, 'meta_edge' ), 0 );\n\n\t\t// Loads CSS for ie8\n\t\tadd_action( 'wp_head', array( &$this, 'ie8_css' ) );\n\n\t\t// Loads html5 shiv script\n\t\tadd_action( 'wp_head', array( &$this, 'html5_shiv' ) );\n\n\t\t// Adds tracking code to the site head\n\t\tadd_action( 'wp_head', array( &$this, 'tracking' ) );\n\n\t\t// Outputs custom CSS to the head\n\t\tadd_action( 'wp_head', array( &$this, 'custom_css' ), 9999 );\n\n\t\t// register sidebar widget areas\n\t\tadd_action( 'widgets_init', array( &$this, 'register_sidebars' ) );\n\n\t\t// Define the directory URI for the gallery metabox calss\n\t\tadd_action( 'wpex_gallery_metabox_dir_uri', array( &$this, 'gallery_metabox_dir_uri' ) );\n\n\t\t// Alter tagcloud widget to display all tags with 1em font size\n\t\tadd_filter( 'widget_tag_cloud_args', array( &$this, 'widget_tag_cloud_args' ) );\n\n\t\t// Alter WP categories widget to display count inside a span\n\t\tadd_filter( 'wp_list_categories', array( &$this, 'wp_list_categories_args' ) );\n\n\t\t// Exclude categories from the blog page\n\t\tadd_filter( 'pre_get_posts', array( &$this, 'pre_get_posts' ) );\n\n\t\t// Add new social profile fields to the user dashboard\n\t\tadd_filter( 'user_contactmethods', array( &$this, 'add_user_social_fields' ) );\n\n\t\t// Add a responsive wrapper to the WordPress oembed output\n\t\tadd_filter( 'embed_oembed_html', array( &$this, 'add_responsive_wrap_to_oembeds' ), 99, 4 );\n\n\t\t// Allow for the use of shortcodes in the WordPress excerpt\n\t\tadd_filter( 'the_excerpt', 'shortcode_unautop' );\n\t\tadd_filter( 'the_excerpt', 'do_shortcode' );\n\n\t\t// Make sure the wp_get_attachment_url() function returns correct page request (HTTP or HTTPS)\n\t\tadd_filter( 'wp_get_attachment_url', array( &$this, 'honor_ssl_for_attachments' ) );\n\n\t\t// Tweak the default password protection output form\n\t\tadd_filter( 'the_password_form', array( &$this, 'custom_password_protected_form' ) );\n\n\t\t// Exclude posts with custom links from the next and previous post links\n\t\tadd_filter( 'get_previous_post_join', array( &$this, 'prev_next_join' ) );\n\t\tadd_filter( 'get_next_post_join', array( &$this, 'prev_next_join' ) );\n\t\tadd_filter( 'get_previous_post_where', array( &$this, 'prev_next_where' ) );\n\t\tadd_filter( 'get_next_post_where', array( &$this, 'prev_next_where' ) );\n\n\t\t// Redirect posts with custom links\n\t\tadd_filter( 'template_redirect', array( &$this, 'redirect_custom_links' ) );\n\n\t}", "public function __construct( $theme = array() ) {\r\n\t\t$this->theme = $theme;\r\n\r\n\t\t$theme = wp_get_theme();\r\n\t\t$arr = array(\r\n\t\t\t'theme-name' => $theme->get( 'Name' ),\r\n\t\t\t'theme-slug' => $theme->get( 'TextDomain' ),\r\n\t\t\t'theme-version' => $theme->get( 'Version' ),\r\n\t\t);\r\n\r\n\t\t$this->theme = wp_parse_args( $this->theme, $arr );\r\n\t\t/**\r\n\t\t * If PHP Version is older than 5.3, we switch back to default theme\r\n\t\t */\r\n\t\tadd_action( 'admin_init', array( $this, 'php_version_check' ) );\r\n\t\t/**\r\n\t\t * Init epsilon dashboard\r\n\t\t */\r\n\t\tadd_filter( 'epsilon-dashboard-setup', array( $this, 'epsilon_dashboard' ) );\r\n\t\tadd_filter( 'epsilon-onboarding-setup', array( $this, 'epsilon_onboarding' ) );\r\n /**\r\n * Enqueue styles and scripts\r\n */\r\n add_action( 'wp_enqueue_scripts', array( $this, 'enqueues' ) );\r\n\t\t/**\r\n\t\t * Customizer enqueues & controls\r\n\t\t */\r\n\t\tadd_action( 'customize_register', array( $this, 'customize_register_init' ) );\r\n\t\t/**\r\n\t\t * Declare content width\r\n\t\t */\r\n\t\tadd_action( 'after_setup_theme', array( $this, 'content_width' ), 10 );\r\n\r\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'customizer_styles' ), 99 );\r\n\t\t/**\r\n\t\t * Grab all class methods and initiate automatically\r\n\t\t */\r\n\t\t$methods = get_class_methods( 'unapp' );\r\n\t\tforeach ( $methods as $method ) {\r\n\t\t\tif ( false !== strpos( $method, 'init_' ) ) {\r\n\t\t\t\t$this->$method();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function MicroBuilder_Theme_Factory () {}", "function mu_themes_in_use(){$this->__construct();}", "protected function __construct()\n {\n parent::__construct();\n $this->initCommands = array();\n $this->additionalCode = array();\n $this->plugins = array();\n\n $this->fns['name'] = $this->fns['prototype'] = $this->fns['body'] = array();\n\n $this->fTheme = fTheme::getInstance();\n $this->fTheme->onBuild('Singleton', 'fjQuery', 'build', 99);\n }", "public function __construct()\n {\n Kirki::add_config(\n self::$config,\n array(\n 'capability' => 'edit_theme_options',\n 'option_type' => 'theme_mod',\n 'disable_output' => false,\n )\n );\n\n /**\n * Set up the panel\n */\n new Panel(\n self::$panel,\n array(\n 'priority' => 30,\n 'title' => esc_attr__('Footer', 'stage'),\n 'description' => esc_attr__('Customize the footer.', 'stage'),\n )\n );\n\n /**\n * Init sections with fields\n */\n $this->colors();\n $this->settings();\n }", "public function init() {\n\n\t\t// Register theme options\n\t\t$this->addOption('typography', 'radio', array(\n\t\t\t'label' => 'plugins.themes.default.option.typography.label',\n\t\t\t'description' => 'plugins.themes.default.option.typography.description',\n\t\t\t'options' => array(\n\t\t\t\t'notoSans' => 'plugins.themes.default.option.typography.notoSans',\n\t\t\t\t'notoSerif' => 'plugins.themes.default.option.typography.notoSerif',\n\t\t\t\t'notoSerif_notoSans' => 'plugins.themes.default.option.typography.notoSerif_notoSans',\n\t\t\t\t'notoSans_notoSerif' => 'plugins.themes.default.option.typography.notoSans_notoSerif',\n\t\t\t\t'lato' => 'plugins.themes.default.option.typography.lato',\n\t\t\t\t'lora' => 'plugins.themes.default.option.typography.lora',\n\t\t\t\t'lora_openSans' => 'plugins.themes.default.option.typography.lora_openSans',\n\t\t\t)\n\t\t));\n\n\t\t$this->addOption('baseColour', 'colour', array(\n\t\t\t'label' => 'plugins.themes.default.option.colour.label',\n\t\t\t'description' => 'plugins.themes.default.option.colour.description',\n\t\t\t'default' => '#1E6292',\n\t\t));\n\n\t\t// Load primary stylesheet\n\t\t$this->addStyle('stylesheet', 'styles/index.less');\n\n\t\t// Store additional LESS variables to process based on options\n\t\t$additionalLessVariables = array();\n\n\t\t// Load fonts from Google Font CDN\n\t\t// To load extended latin or other character sets, see:\n\t\t// https://www.google.com/fonts#UsePlace:use/Collection:Noto+Sans\n\t\tif (Config::getVar('general', 'enable_cdn')) {\n\n\t\t\tif ($this->getOption('typography') === 'notoSerif') {\n\t\t\t\t$this->addStyle(\n\t\t\t\t\t'fontNotoSerif',\n\t\t\t\t\t'//fonts.googleapis.com/css?family=Noto+Serif:400,400i,700,700i',\n\t\t\t\t\tarray('baseUrl' => '')\n\t\t\t\t);\n\t\t\t\t$additionalLessVariables[] = '@font: \"Noto Serif\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen-Sans\", \"Ubuntu\", \"Cantarell\", \"Helvetica Neue\", sans-serif;';\n\n\t\t\t} elseif (strpos($this->getOption('typography'), 'notoSerif') !== false) {\n\t\t\t\t$this->addStyle(\n\t\t\t\t\t'fontNotoSansNotoSerif',\n\t\t\t\t\t'//fonts.googleapis.com/css?family=Noto+Sans:400,400i,700,700i|Noto+Serif:400,400i,700,700i',\n\t\t\t\t\tarray('baseUrl' => '')\n\t\t\t\t);\n\n\t\t\t\t// Update LESS font variables\n\t\t\t\tif ($this->getOption('typography') == 'notoSerif_notoSans') {\n\t\t\t\t\t$additionalLessVariables[] = '@font-heading: \"Noto Serif\", serif;';\n\t\t\t\t} elseif ($this->getOption('typography') == 'notoSans_notoSerif') {\n\t\t\t\t\t$additionalLessVariables[] = '@font: \"Noto Serif\", serif;@font-heading: \"Noto Sans\", serif;';\n\t\t\t\t}\n\n\t\t\t} elseif ($this->getOption('typography') == 'lato') {\n\t\t\t\t$this->addStyle(\n\t\t\t\t\t'fontLato',\n\t\t\t\t\t'//fonts.googleapis.com/css?family=Lato:400,400i,900,900i',\n\t\t\t\t\tarray('baseUrl' => '')\n\t\t\t\t);\n\t\t\t\t$additionalLessVariables[] = '@font: Lato, sans-serif;';\n\n\t\t\t} elseif ($this->getOption('typography') == 'lora') {\n\t\t\t\t$this->addStyle(\n\t\t\t\t\t'fontLora',\n\t\t\t\t\t'//fonts.googleapis.com/css?family=Lora:400,400i,700,700i',\n\t\t\t\t\tarray('baseUrl' => '')\n\t\t\t\t);\n\t\t\t\t$additionalLessVariables[] = '@font: Lora, serif;';\n\n\t\t\t} elseif ($this->getOption('typography') == 'lora_openSans') {\n\t\t\t\t$this->addStyle(\n\t\t\t\t\t'fontLoraOpenSans',\n\t\t\t\t\t'//fonts.googleapis.com/css?family=Lora:400,400i,700,700i|Open+Sans:400,400i,700,700i',\n\t\t\t\t\tarray('baseUrl' => '')\n\t\t\t\t);\n\t\t\t\t$additionalLessVariables[] = '@font: \"Open Sans\", sans-serif;@font-heading: Lora, serif;';\n\n\t\t\t} else {\n\t\t\t\t$this->addStyle(\n\t\t\t\t\t'fontNotoSans',\n\t\t\t\t\t'//fonts.googleapis.com/css?family=Noto+Sans:400,400italic,700,700italic',\n\t\t\t\t\tarray('baseUrl' => '')\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Update colour based on theme option\n\t\tif ($this->getOption('baseColour') !== '#1E6292') {\n\t\t\t$additionalLessVariables[] = '@bg-base:' . $this->getOption('baseColour') . ';';\n\t\t\tif (!$this->isColourDark($this->getOption('baseColour'))) {\n\t\t\t\t$additionalLessVariables[] = '@text-bg-base:rgba(0,0,0,0.84);';\n\t\t\t}\n\t\t}\n\n\t\t// Pass additional LESS variables based on options\n\t\tif (!empty($additionalLessVariables)) {\n\t\t\t$this->modifyStyle('stylesheet', array('addLessVariables' => join($additionalLessVariables)));\n\t\t}\n\n\t\t$request = Application::getRequest();\n\n\t\t// Load icon font FontAwesome - http://fontawesome.io/\n\t\tif (Config::getVar('general', 'enable_cdn')) {\n\t\t\t$url = 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css';\n\t\t} else {\n\t\t\t$url = $request->getBaseUrl() . '/lib/pkp/styles/fontawesome/fontawesome.css';\n\t\t}\n\t\t$this->addStyle(\n\t\t\t'fontAwesome',\n\t\t\t$url,\n\t\t\tarray('baseUrl' => '')\n\t\t);\n\n\t\t// Load jQuery from a CDN or, if CDNs are disabled, from a local copy.\n\t\t$min = Config::getVar('general', 'enable_minified') ? '.min' : '';\n\t\tif (Config::getVar('general', 'enable_cdn')) {\n\t\t\t$jquery = '//ajax.googleapis.com/ajax/libs/jquery/' . CDN_JQUERY_VERSION . '/jquery' . $min . '.js';\n\t\t\t$jqueryUI = '//ajax.googleapis.com/ajax/libs/jqueryui/' . CDN_JQUERY_UI_VERSION . '/jquery-ui' . $min . '.js';\n\t\t} else {\n\t\t\t// Use OJS's built-in jQuery files\n\t\t\t$jquery = $request->getBaseUrl() . '/lib/pkp/lib/vendor/components/jquery/jquery' . $min . '.js';\n\t\t\t$jqueryUI = $request->getBaseUrl() . '/lib/pkp/lib/vendor/components/jqueryui/jquery-ui' . $min . '.js';\n\t\t}\n\t\t// Use an empty `baseUrl` argument to prevent the theme from looking for\n\t\t// the files within the theme directory\n\t\t$this->addScript('jQuery', $jquery, array('baseUrl' => ''));\n\t\t$this->addScript('jQueryUI', $jqueryUI, array('baseUrl' => ''));\n\t\t$this->addScript('jQueryTagIt', $request->getBaseUrl() . '/lib/pkp/js/lib/jquery/plugins/jquery.tag-it.js', array('baseUrl' => ''));\n\n\t\t// Load Bootsrap's dropdown\n\t\t$this->addScript('popper', 'js/lib/popper/popper.js');\n\t\t$this->addScript('bsUtil', 'js/lib/bootstrap/util.js');\n\t\t$this->addScript('bsDropdown', 'js/lib/bootstrap/dropdown.js');\n\n\t\t// Load custom JavaScript for this theme\n\t\t$this->addScript('default', 'js/main.js');\n\n\t\t// Add navigation menu areas for this theme\n\t\t$this->addMenuArea(array('primary', 'user'));\n\t}", "public function __construct() {\r\n\r\n\t\t\t// Set the constants needed by the plugin.\r\n\t\t\t$this->constants();\r\n\r\n\t\t\t// Load the functions files.\r\n\t\t\t$this->includes();\r\n\r\n\t\t\t// Load the installer core.\r\n\t\t\tadd_action( 'after_setup_theme', require( RV_PORTFOLIO_DIR . 'cherry-framework/setup.php' ), 0 );\r\n\r\n\t\t\t// Load the core functions/classes required by the rest of the theme.\r\n\t\t\tadd_action( 'after_setup_theme', array( $this, 'get_core' ), 1 );\r\n\r\n\t\t\tadd_action( 'after_setup_theme', array( 'Cherry_Core', 'load_all_modules' ), 2 );\r\n\r\n\t\t\t// Initialization of modules.\r\n\t\t\tadd_action( 'after_setup_theme', array( $this, 'init' ), 10 );\r\n\r\n\t\t\t// Internationalize the text strings used.\r\n\t\t\tadd_action( 'plugins_loaded', array( $this, 'lang' ), 2 );\r\n\r\n\t\t\t// Load the admin files.\r\n\t\t\tadd_action( 'plugins_loaded', array( $this, 'admin' ), 3 );\r\n\r\n\t\t\t// Load public-facing style sheet.\r\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) );\r\n\r\n\t\t\t// Load public-facing JavaScript.\r\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );\r\n\r\n\t\t\t// Register activation and deactivation hook.\r\n\t\t\tregister_activation_hook( __FILE__, array( $this, 'activation' ) );\r\n\t\t\tregister_deactivation_hook( __FILE__, array( $this, 'deactivation' ) );\r\n\t\t}", "private function __construct()\n\t{\n\t\t//check version first\n\t\t$this->checkPhpVersion();\n\n\t\tadd_action('after_setup_theme',array($this,'themeSetup'));\n\n\t\t// Load admin style sheet and JavaScript.\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'adminStyles' ) );\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'adminScripts' ) );\n\n\t\t// Load public-facing style sheet and JavaScript.\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'styles' ) );\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'scripts' ) );\n\n\n\t\tadd_action( 'widgets_init', array( $this, 'widgets' ) );\n\n\n\t}", "private function __construct() {\n\n\t\tglobal $options, $wpdb;\n\t\t$this->options = $options;\n\t\t$this->wpdb = $wpdb;\n\n\t\t// I love the Redux Framework!\n\t\t// Default theme config.\n\t\tadd_action('wp_head', array( $this, 'faviconList') );\n\t\tadd_action('wp_head', array( $this, 'customCSS') );\n\t\tadd_action('wp_footer', array( $this, 'customJS') );\n\t\tadd_action('wp_footer', array( $this, 'googleAnalytics') );\n\n\t\t// Load custom dasboard widget and wp-admin logo\n\t\t//add_action( 'login_enqueue_scripts', array( $this, 'starLoginLogo') );\n\t\t//add_filter( 'login_headerurl', array( $this, 'starLoginLogoUrl') );\n\t\t//add_filter( 'login_headertitle', array( $this, 'starLoginLogoUrlTitle') );\n\n\t\t// Disable all widgets and welcome panel\n\t\t//add_action('wp_dashboard_setup', array( $this, 'disableDashboardWidgets') );\n\t\t//remove_action('welcome_panel', array( $this, 'wp_welcome_panel') );\n\n\t\t// Star Welcome Dasboard\n\t\t//add_action('welcome_panel', array( $this, 'starWelcomePanel') );\n\t\t//add_action('after_switch_theme',array( $this, 'starWelcomePanelInit') );\n\n\t\t// Admin Custom CSS\n\t\tadd_action('admin_head', array( $this, 'adminCustomCss') );\n\t}", "public function __construct(){\n\n $this->define_theme_globals();\n $this->define_theme_supports();\n $this->define_image_sizes();\n $this->replace_3rd_party_pugins_hooks();\n $this->remove_actions();\n $this->init_hooks();\n $this->include_global();\n\n if( $this->is_request( 'frontend' )){\n add_action('wp_head', array('theme_construct_page', 'init'));\n }\n\n if( $this->is_request( 'admin' )){\n // $this->include_admin();\n }\n }", "protected function addBaseThemeConfigs()\n {\n\n $this[\"request\"] = function () {\n return Request::createFromGlobals();\n };\n\n $this['route'] = $this->factory(\n function ($c) {\n return new Route($c['queue'], $c, $c['request']);\n }\n );\n\n $this['router'] = function ($c) {\n return new Router($c['queue'], $c['route']);\n };\n\n $this['hooker'] = function ($c) {\n return new Hooker($c['objectStorage'], array());\n };\n\n $this['templatingFunctions'] = function ($c) {\n return new TemplatingFunctions($c['objectStorage'], array());\n };\n\n $this['taxonomyHelper'] = function ($c) {\n return new TaxonomyHelper($c['objectStorage'], array());\n };\n\n $this['postTypeHelper'] = function ($c) {\n return new PostTypeHelper($c['objectStorage'], array());\n };\n\n $this['ACFHelper'] = function ($c) {\n return new ACFHelper($c['objectStorage'], $c['objectStorage'], array(), array(\n /**\n * enable this if you want to use the layouts functionality, you will also\n * need to install the advanced custom fields flexible fields plugin\n */\n //$c[\"flexibleLayoutProxy\"]\n ));\n };\n\n $this['shortcodeHelper'] = function ($c) {\n return new ShortcodeHelper($c['objectStorage'], array());\n };\n\n $this['imageSizeHelper'] = function ($c) {\n return new ImageSizeHelper($c['objectStorage'], array());\n };\n\n $this['FlexPress'] = function ($c) {\n return new FlexPress(\n $c,\n $c['router'],\n $c['hooker'],\n $c['templatingFunctions'],\n $c['taxonomyHelper'],\n $c['postTypeHelper'],\n $c['ACFHelper'],\n $c['shortcodeHelper'],\n $c['imageSizeHelper']\n );\n };\n\n }", "public function __construct($theme_args)\n {\n // store theme options\n $this->theme_args = $theme_args;\n\n // load textdomains for admin / front\n if (is_admin()) {\n load_theme_textdomain($this->theme_args['admin_text_domain'], get_stylesheet_directory() . '/inc/languages');\n } else {\n load_theme_textdomain($this->theme_args['text_domain'], get_stylesheet_directory() . '/languages');\n }\n\n add_action('widgets_init', array(&$this, 'load_widgets'));\n\n // load admin class if we are admin\n if (is_admin()) {\n include OXY_TF_DIR . 'inc/OxygennaThemeAdmin.php';\n $admin = new OxygennaThemeAdmin($this);\n }\n\n // load theme options\n global $oxy_theme_options;\n $oxy_theme_options = get_option(THEME_SHORT . '-options');\n\n global $wp_customize;\n if (isset($wp_customize)) {\n include OXY_TF_DIR . 'inc/OxygennaCustomise.php';\n $oxygenna_customise = new OxygennaCustomise();\n }\n\n include OXY_TF_DIR . 'inc/OxygennaOptions.php';\n $this->theme_options = new OxygennaOptions(THEME_SHORT . '-options', THEME_SHORT . '-options', array(\n 'admin_bar' => true\n ));\n\n add_action('after_setup_theme', array(&$this, 'load_option_pages'));\n }", "function init_theme() {\r\n\r\n\t\t$possible_names = self::get_theme_name();\r\n\r\n\t\tforeach( $possible_names as $type => $name ){\r\n\r\n\t\t\t$theme_class = \"WP_Job_Manager_Field_Editor_Themes_\" . ucfirst( $name );\r\n\r\n\t\t\tif( class_exists( $theme_class ) ) {\r\n\t\t\t\t$theme = new $theme_class();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "public function setup_theme()\n {\n }", "function __construct(){\n\t\t\trequire_once('class-sp-theme-admin.php');\n\t\t\t$this->admin = new SP_THEME_ADMIN;\n\n\t\t\t/* LOAD ASSETS */\n\t\t\tadd_action('wp_enqueue_scripts', array( $this, 'assets' ) );\n\n\t\t}", "public function __construct() {\n\n\t\t\t// Call to admin page render function and register new settings \n\t\t\tif ( is_admin() ) {\t\n\t\t\t\tadd_action( 'admin_init', array( 'ELMT_theme_options', 'register_settings' ) );\n\t\t\t}\n\n\t\t}", "public function init(Theme $theme)\n {\n\n }", "public function __construct() {\n\t\tglobal $content_width;\n\t\t$content_width = 680;\n\n\t\tadd_action( 'admin_init', array( $this, 'add_option' ) );\n\t\tadd_action( 'after_setup_theme', array( $this, 'theme_setup' ) );\n\t\tadd_action( 'widgets_init', array( $this, 'widgets_init' ) );\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'stylesheet' ) );\n\t\tadd_action( 'admin_init', array( $this, 'editor_stylesheet' ) );\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'comment_reply' ) );\n\t\tadd_action( 'customize_register', array( $this, 'customize_register' ) );\n\t\tadd_action( 'customize_render_control_header-text', array( $this, 'customizer_help' ) );\n\t\tadd_filter( 'wp_title', array( $this, 'title_tag' ), 10, 2 );\n\t\tadd_filter( 'post_class', array( $this, 'add_last_post_class' ) );\n\n\t}", "public function __construct() {\n\t\t\t// Set the constants needed by the plugin.\n\t\t\t$this->constants();\n\n\t\t\t// Load the functions files.\n\t\t\t$this->includes();\n\n\t\t\t// Load the installer core.\n\t\t\tadd_action( 'after_setup_theme', require( trailingslashit( dirname( __FILE__ ) ) . 'cherry-framework/setup.php' ), 0 );\n\n\t\t\t// Load the core functions/classes required by the rest of the plugin.\n\t\t\tadd_action( 'after_setup_theme', array( $this, 'get_core' ), 1 );\n\n\t\t\t// Laad the modules.\n\t\t\tadd_action( 'after_setup_theme', array( 'Cherry_Core', 'load_all_modules' ), 2 );\n\n\t\t\t// Initialization of modules.\n\t\t\tadd_action( 'after_setup_theme', array( $this, 'init_modules' ), 3 );\n\n\t\t\t// Internationalize the text strings used.\n\t\t\tadd_action( 'plugins_loaded', array( $this, 'lang' ), 1 );\n\n\t\t\t// Load the admin files.\n\t\t\tadd_action( 'plugins_loaded', array( $this, 'admin' ), 2 );\n\n\t\t\t// Register public assets.\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'register_assets' ), 10 );\n\n\t\t\t// Load public-facing StyleSheets.\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ), 11 );\n\n\t\t\t// Load public-facing JavaScripts.\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 11 );\n\n\t\t\t// Register activation and deactivation hook.\n\t\t\tregister_activation_hook( __FILE__, array( $this, 'activation' ) );\n\t\t\tregister_deactivation_hook( __FILE__, array( $this, 'deactivation' ) );\n\n\t\t\t// Apply custom formatter function.\n\t\t\tadd_filter( 'the_content', array( $this, 'clean_shortcodes' ) );\n\n\t\t\t// Add svg mime type\n\t\t\tadd_filter( 'upload_mimes', array( $this, 'add_mime_types' ) );\n\t\t}", "private function __construct() {\n add_action('after_setup_theme', array(\n $this, 'after_setup_theme'));\n add_action('widgets_init', array($this, 'widgets_init'));\n add_action('wp_enqueue_scripts', array(\n $this, 'wp_enqueue_scripts'));\n }", "public function __construct() {\n\t\tadd_action( 'init', array( $this, 'theme_customisations_setup' ), -1 );\n\t\trequire_once( 'custom/functions.php' );\n\t}", "public function __construct() {\n\n\t\tparent::__construct( 'Mlp_Widget', __( 'Language Switcher', 'multilingual-press' ), array(\n\t\t\t'classname' => 'mlp_widget',\n\t\t\t'description' => __( 'MultilingualPress Translations', 'multilingual-press' ),\n\t\t\t'customize_selective_refresh' => true,\n\t\t) );\n\n\t\t// Enqueue style if widget is active (appears in a sidebar) or if in Customizer preview.\n\t\tif ( is_active_widget( false, false, $this->id_base ) || is_customize_preview() ) {\n\t\t\t// Do NOT use wp_enqueue_scripts here as require_style() implicitly hooks into this.\n\t\t\tadd_action( 'template_redirect', array( $this, 'require_style' ) );\n\t\t}\n\t}", "public function __construct()\n {\n $this->autoload['libraries'][] = 'ui/contexts';\n\n parent::__construct();\n\n Template::set_theme('landingpage');\n date_default_timezone_set(\"Asia/Jakarta\");\n }", "public static function init() {\n\t\tif ( ! is_admin() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tself::$theme = wp_get_theme();\n\t\tself::$version = self::$theme->get( 'Version' );\n\n\t\tself::setup_actions();\n\t}", "public function __construct(){\n\n\t\tadd_action( 'customize_register', array( &$this, 'theme_color_customizer' ), 99 );\n\n\t\tadd_action( 'wp_head',array( &$this, 'add_selectors' ) );\n\n\t\tadd_action( 'customize_controls_enqueue_scripts', array( &$this, 'customizer_live_preview' ) );\n\n\t}", "function __construct() {\n\n\t\t\tadd_action( 'after_setup_theme', require( get_template_directory() . '/cherry-framework/setup.php' ), 0 );\n\t\t\tadd_action( 'after_setup_theme', array( $this, 'get_core' ), 1 );\n\t\t\tadd_action( 'after_setup_theme', array( $this, 'setup' ), 5 );\n\t\t\tadd_action( 'after_setup_theme', array( $this, 'load_files' ), 10 );\n\t\t\tadd_action( 'after_setup_theme', array( $this, 'init_modules' ), 15 );\n\t\t\tadd_action( 'after_setup_theme', array( $this, 'register_sidebars' ), 25 );\n\n\t\t\t// Overrides the load textdomain function for the 'cherry-framework' domain.\n\t\t\tadd_filter( 'override_load_textdomain', array( $this, 'override_load_textdomain' ), 5, 3 );\n\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'enqueue_assets' ), 11 );\n\t\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_assets' ) );\n\t\t}", "public function __construct() {\n $this->skinName = 'mikado';\n\n //hook to\n add_action('sienna_mikado_admin_scripts_init', array($this, 'registerStyles'));\n add_action('sienna_mikado_admin_scripts_init', array($this, 'registerScripts'));\n\n add_action('sienna_mikado_enqueue_admin_styles', array($this, 'enqueueStyles'));\n add_action('sienna_mikado_enqueue_admin_scripts', array($this, 'enqueueScripts'));\n\n add_action('sienna_mikado_enqueue_meta_box_styles', array($this, 'enqueueStyles'));\n add_action('sienna_mikado_enqueue_meta_box_scripts', array($this, 'enqueueScripts'));\n\n\t\tadd_action('before_wp_tiny_mce', array($this, 'setShortcodeJSParams'));\n\n\t\t$this->setIcons();\n\t\t$this->setMenuItemPosition();\n }", "public function theme()\n {\n }" ]
[ "0.76027495", "0.73549384", "0.72907364", "0.7160699", "0.7086468", "0.6991841", "0.6988804", "0.69554955", "0.68625504", "0.68606067", "0.685925", "0.6839064", "0.6831412", "0.6815193", "0.6812428", "0.6810435", "0.669928", "0.66859764", "0.66721094", "0.6656739", "0.6648308", "0.66417557", "0.66281927", "0.66236454", "0.6621895", "0.6617114", "0.6610493", "0.65572", "0.6542748", "0.6518755" ]
0.761716
0
Parse config for datasources
public static function parse($config) { $config = explode("\n", $config); $datasources = array(); while(!is_null($line = array_shift($config))) { if(!$line) continue; $bits = preg_split('`\s+`', $line, 2); $type = array_shift($bits); if(!in_array($type, array( 'member_include', 'include_file', 'include_remote_file', 'include_list', 'include_sympa_list', 'include_remote_sympa_list', 'include_ldap_query', 'include_ldap_2level_query', 'include_sql_query', 'include_voot_group', 'include_ldap_ca', 'include_ldap_2level_ca', 'include_sql_ca' ))) continue; $params = array(); if(count($bits)) $params['arg'] = array_shift($bits); while($line = array_shift($config)) { $bits = preg_split('`\s+`', $line, 2); $params[array_shift($bits)] = array_shift($bits); } $datasources[] = self::getFromType($type, $params); } return $datasources; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _parseDsn($dsn)\n {\n $dsn = parse_url($dsn);\n $cfg = [];\n\n //\n // Some drivers (a.k.a. PDO_PGSQL) complains if the port is set\n // without a value, even NULL\n if (isset($dsn['port'])) {\n $cfg['port'] = $dsn['port'];\n }\n\n return $cfg + [\n 'dbname' => isset($dsn['path']) ? trim($dsn['path'], '/') : null,\n 'host' => isset($dsn['host']) ? $dsn['host'] : null,\n 'password' => isset($dsn['pass']) ? $dsn['pass'] : null,\n 'username' => isset($dsn['user']) ? $dsn['user'] : null,\n ];\n }", "public function parseConfig() {\n $configArray = file('configs/' . $this->_ip . '.ini');\n \n if($configArray === FALSE || sizeof($configArray) <= 1) {\n trigger_error(\"Couldn't read config\");\n return FALSE;\n }\n \n $config = array();\n $configDirective = '';\n \n foreach($configArray as $lineNumber => $line) {\n $line = trim($line);\n \n // Filter out comments\n if(preg_match('/^;/', $line)) {\n continue;\n }\n \n // Config directive\n if(preg_match('/^\\[/', $line)) {\n $configDirective = substr(substr($line, 1), 0, -1);\n continue;\n }\n \n // Filter out blank lines\n if($line == '') {\n continue;\n }\n \n // Looks to be a regular config directive\n // Split on = and place into config array\n \n $lineSplit = explode(\"=\", $line);\n \n $config[$configDirective][$lineSplit[0]] = $lineSplit[1];\n \n unset($lineSplit);\n \n }\n \n return $config;\n }", "abstract protected function loadConfig();", "private static function parse_dsn($dsn) {\n /**\n * define dsn array\n */\n $parsed = array(\n 'dbtype' => false,\n 'username' => false,\n 'password' => false,\n 'hostspec' => false,\n 'database' => false\n );\n \n /**\n * if dsn is allready an array return it\n */\n if(is_array($dsn)) {\n $dsn = array_merge($parsed, $dsn);\n\n return $dsn;\n }\n\n /**\n * find and set the db type\n *\n * $dsn => dbtype://username:password@hostspec/database_name\n */\n if(($pos = strpos($dsn, '://')) !== false) {\n $str = substr($dsn, 0, $pos);\n $dsn = substr($dsn, $pos + 3);\n \n $parsed['dbtype'] = $str;\n } else {\n throw new gdatabase_exception('failed to locate database type');\n }\n\n /**\n * find and set username and password\n *\n * $dsn => username:password@hostspec/database_name\n */\n if(($at = strrpos($dsn,'@')) !== false) {\n $str = substr($dsn, 0, $at);\n $dsn = substr($dsn, $at + 1);\n \n if(($pos = strpos($str, ':')) !== false) {\n $parsed['username'] = rawurldecode(substr($str, 0, $pos));\n $parsed['password'] = rawurldecode(substr($str, $pos + 1));\n } else {\n throw new gdatabase_exception('failed to locate username and password');\n }\n }\n \n /**\n * find and set hostspec and database\n *\n * $dsn => hostspec/database\n */\n if(strpos($dsn, '/') !== false) {\n list($host, $db) = explode('/', $dsn, 2);\n \n $parsed['hostspec'] = rawurldecode($host);\n $parsed['database'] = rawurldecode($db);\n } else {\n throw new gdatabase_exception('failed to locate hostname and database');\n }\n\n return $parsed;\n }", "public function initConfigData($host){}", "public function parseData($source, Config $obj): bool\n {\n $return = true;\n\n if (!file_exists($source)) {\n throw new Exception(\"Datasource file does not exist.\");\n }\n\n $currentSection = $obj->getContainer();\n $confArray = parse_ini_file($source, true);\n\n if (!$confArray) {\n throw new Exception(\"File '$source' does not contain configuration data.\");\n }\n\n foreach ($confArray as $key => $value) {\n if (is_array($value)) {\n $currentSection = $currentSection->createSection($key);\n foreach ($value as $directive => $content) {\n // try to split the value if comma found\n if (!is_array($content) && strpos($content, '\"') === false) {\n $values = preg_split('/\\s*,\\s+/', $content);\n if (count($values) > 1) {\n foreach ($values as $k => $v) {\n $currentSection->createDirective($directive, $v);\n }\n } else {\n $currentSection->createDirective($directive, $content);\n }\n } else {\n $currentSection->createDirective($directive, $content);\n }\n }\n } else {\n $currentSection->createDirective($key, $value);\n }\n }\n\n return $return;\n }", "function parseConfig() {\n\n\t\t// Make sure our config file exists\n\t\tif(!file_exists(CONFIGPATH . $this->_options['configFile'])) {\n\t\t\tdie('Unable to find <b>'. CONFIGPATH . $this->_options['configFile'] .'</b> file, please check your application configuration');\n\t\t}\n\n\t\t// Switch the file extension\n\t\tswitch(PPI_Helper::getFileExtension($this->_options['configFile'])) {\n\t\t\tcase 'ini':\n\t\t\t\treturn new PPI_Config_Ini(parse_ini_file(CONFIGPATH . $this->_options['configFile'], true, INI_SCANNER_RAW), $this->_options['configBlock']);\n\n\t\t\tcase 'xml':\n\t\t\t\tdie('Trying to load a xml config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t\tcase 'php':\n\t\t\t\tdie('Trying to load a php config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t}\n\t}", "private function parseConfig(){\n\t\t\treturn parse_ini_file(BASE_PATH . 'config' . DIRECTORY_SEPARATOR . 'config.ini');\n\t\t}", "public function loadConfig($data);", "abstract protected function configs(): array;", "public function setupConfig()\n {\n registry::getInstance()->set('config', $this->parseConfig());\n }", "public function loadConfigs()\n {\n self::$country_configs = self::getCountryConfigs();\n $configs = new parent();\n self::$categories = $configs->getCategories();\n self::$site_data = self::get_site_data();\n self::$payments_name = self::setPaymentGateway();\n }", "function loadFromDatabase(){\n global $DB;\n $resource = $DB->config->get();\n $list = array();\n while($row = $DB->fetchAssoc($resource))\n {\n if(!isset($this->sections[$row['section']])) $this->sections[$row['section']] = new ConfigSection($row['section']);\n $this->sections[$row['section']]->registerFromDatabase($row);\n }\n }", "public function getConfigData()\n {\n return [\n 'alias' => $this->getAlias(),\n 'dbName' => $this->getName(),\n 'dbHost' => $this->getHost(),\n 'dbType' => $this->getType(),\n 'dbUser' => $this->getUserName(),\n 'dbPass' => $this->getPassword()\n ];\n }", "public function prepareConfigSchema()\n {\n // Store Chapters\n $fromchapter = ['labels' => [],'id' => []];\n foreach ($this->container->db->getFormats() as $f) {\n array_push($fromchapter['labels'], $f->getName());\n array_push($fromchapter['id'], $f->getId());\n }\n\n // Store Issues\n $fromissue = ['labels' => [],'id' => []];\n foreach ($this->container->db->getIssues() as $i) {\n array_push($fromissue['labels'], $i->getName());\n array_push($fromissue['id'], $i->getId());\n }\n\n // Store Books\n $frombook = ['labels' => [],'id' => []];\n foreach ($this->container->db->getBooks() as $b) {\n array_push($frombook['labels'], $b->getName());\n array_push($frombook['id'], $b->getId());\n }\n\n // Store Templates\n $fromtemplate = ['labels' => [],'id' => []];\n foreach ($this->container->db->getTemplatenames() as $t) {\n array_push($fromtemplate['labels'], $t->getName());\n array_push($fromtemplate['id'], $t->getId());\n }\n\n // Store Templates\n $fromfield = ['labels' => [],'id' => []];\n foreach ($this->container->db->getTemplatefields() as $t) {\n array_push($fromfield['labels'], $t->getFieldname());\n array_push($fromfield['id'], $t->getId());\n }\n\n // Store Historytypes\n\n foreach (['books', 'issues', 'chapters', 'cloud', 'other', 'self', 'contributional', 'structural', 'fixed'] as $_ht) {\n $historytypes['id'][] = $_ht;\n $historytypes['labels'][] = $this->container->translations['field_historytype_'.$_ht];\n }\n\n // Todo\n $thisfields = [\n 'labels' => ['fielda', 'fieldb','fieldc'],\n 'id' => [1,2,3]\n ];\n\n $lengthinfluence = [\n 'title' => $this->container->translations['field_config'.'lengthinfluence'],\n 'options' => [\n 'collapsed' => true\n ],\n 'type' => 'array',\n 'propertyOrder' => 100,\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => $this->container->translations['field_config'.'lengthinfluence'.'row'],\n 'headerTemplate' => '{{ self.fieldname }}',\n 'properties' => [\n 'factor' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'lengthinfluence'.'factor'],\n ],\n 'fieldname' => [\n 'type' => 'string',\n 'uniqueItems' => true,\n 'enum' => [],//$fromfield['id'],\n 'options' => [\n 'enum_titles' => $fromfield['labels'],\n 'title' => [],//$this->container->translations['field_config'.'lengthinfluence'.'labels'],\n ]\n ]\n ]\n ]\n ];\n\n $schema = [\n 'title' => 'Field Configuration',\n 'type' => 'object',\n 'properties' => [\n 'imagesize' => [\n 'title' => $this->container->translations['field_config'.'imagesize'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => $this->container->translations['field_config'.'imagesize'.'row'],\n 'properties' => [\n 'width' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'imagesize'.'width'],\n ],\n 'height' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'imagesize'.'height'],\n ]\n ]\n ]\n ],\n 'caption_variants' => [\n 'title' => $this->container->translations['field_config'.'imagecaptions'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 11,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'imagecaption'],\n ]\n ],\n 'history' => [\n 'title' => $this->container->translations['field_config'.'history'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'fullhistory' => [\n 'title' => $this->container->translations['field_config'.'fullhistory'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox',\n 'watch' => [\n 'hist' => 'history'\n ],\n 'hidden' => '!history'\n ],\n 'growing' => [\n 'title' => $this->container->translations['field_config'.'growing'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'maxlines' => [\n 'title' => $this->container->translations['field_config'.'maxlines'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'textlength' => [\n 'title' => $this->container->translations['field_config'.'textlength'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'lengthinfluence' => $lengthinfluence,\n 'rtfeditor' => [\n 'title' => $this->container->translations['field_config'.'rtfeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'markdowneditor' => [\n 'title' => $this->container->translations['field_config'.'markdowneditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'codeeditor' => [\n 'title' => $this->container->translations['field_config'.'codeeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'editorcolumns' => [\n 'title' => $this->container->translations['field_config'.'editorcolumns'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => 'Line',\n 'properties' => [\n \"lines\" => [\n 'type' => 'integer',\n 'title' => $this->container->translations['field_config'.'editorcolumns'.'lines'],\n ],\n \"label\" => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'editorcolumns'.'label'],\n ]\n ]\n ]\n ],\n 'arrayeditor' => [\n 'title' => $this->container->translations['field_config'.'arrayeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'columns' => [\n 'title' => $this->container->translations['field_config'.'columns'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'colnames' => [\n 'title' => $this->container->translations['field_config'.'colnames'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'format' => 'text',\n 'title' => $this->container->translations['field_config'.'colnames'.'labels'],\n ]\n ],\n 'latitude' => [\n 'title' => $this->container->translations['field_config'.'latitude'],\n 'type' => 'number',\n 'propertyOrder' => 0\n ],\n 'longitude' => [\n 'title' => $this->container->translations['field_config'.'longitude'],\n 'type' => 'number',\n 'propertyOrder' => 0\n ],\n 'dateformat' => [\n 'title' => $this->container->translations['field_config'.'dateformat'],\n 'type' => 'string',\n 'propertyOrder' => 2,\n 'uniqueItems' => true,\n 'enum' => [\n 'd/m/Y H:i:s', 'd/m/Y H:i', 'd/m/Y', 'm/Y', 'Y'\n ],\n 'options' => [\n 'enum_titles' => [\n 'dd/mm/yyyy hh:mm:ss', 'dd/mm/yyyy hh:mm', 'dd/mm/yyyy', 'mm/yyyy', 'yyyy'\n ]\n ]\n ],\n 'integer' => [\n 'title' => $this->container->translations['field_config'.'integer'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'resolve_foreign' => [\n 'title' => $this->container->translations['field_config'.'resolve_foreign'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'multiple' => [\n 'title' => $this->container->translations['field_config'.'multiple'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n //cloud\n 'threeDee' => [\n 'title' => $this->container->translations['field_config'.'threeDee'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'history_command' => [\n 'title' => $this->container->translations['field_config'.'history_command'],\n 'format' => 'select',\n 'propertyOrder' => -1,\n 'uniqueItems' => true,\n 'type' => 'string',\n 'enum' => $historytypes['id'],\n 'options' => [\n 'enum_titles' => $historytypes['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //legends\n 'legends' => [\n 'options' => [\n 'grid_columns' => 12,\n ],\n 'title' => $this->container->translations['field_config'.'legends'],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string'\n ]\n ],\n //fixed\n 'fixedvalues' => [\n 'options' => [\n 'grid_columns' => 12,\n ],\n 'title' => $this->container->translations['field_config'.'fixedvalues'],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'fixedvalues'.'row'],\n ]\n ],\n //issues, cloud, self, contributional\n 'restrict_to_open' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_open'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n // not implemented so far\n 'restrict_to_book' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_book'],\n 'type' => 'boolean',\n 'propertyOrder' => 2,\n 'format' => 'checkbox'\n ],\n //issues, chapters\n 'frombook' => [\n 'title' => $this->container->translations['field_config'.'frombook'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 1,\n 'uniqueItems' => true,\n 'enum' => $frombook['id'],\n 'options' => [\n 'enum_titles' => $frombook['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //cloud, other, self, contributional\n 'restrict_to_issue' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_issue'],\n 'type' => 'boolean',\n 'propertyOrder' => 4,\n 'format' => 'checkbox'\n ],\n //cloud, other, self, contributional\n 'fromissue' => [\n 'title' => $this->container->translations['field_config'.'fromissue'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 3,\n 'uniqueItems' => true,\n 'enum' => $fromissue['id'],\n 'options' => [\n 'enum_titles' => $fromissue['labels'],\n 'grid_columns' => 12,\n ]\n ],\n\n //contributional,\n 'restrict_to_chapter' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_chapter'],\n 'type' => 'boolean',\n 'propertyOrder' => 6,\n 'format' => 'checkbox'\n ],\n //contributional\n 'fromchapter' => [\n 'title' => $this->container->translations['field_config'.'fromchapter'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 5,\n 'uniqueItems' => true,\n 'enum' => $fromchapter['id'],\n 'options' => [\n 'enum_titles' => $fromchapter['labels'],\n 'grid_columns' => 12,\n ]\n ],\n // not implemented so far\n 'restrict_to_template' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_template'],\n 'type' => 'boolean',\n 'propertyOrder' => 9,\n 'format' => 'checkbox'\n ],\n //contributional, structural\n 'fromtemplate' => [\n 'title' => $this->container->translations['field_config'.'fromtemplate'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 8,\n 'uniqueItems' => true,\n 'enum' => $fromtemplate['id'],\n 'options' => [\n 'enum_titles' => $fromtemplate['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //cloud, other\n 'fromfield' => [\n 'title' => $this->container->translations['field_config'.'fromfield'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 10,\n 'uniqueItems' => true,\n 'enum' => $fromfield['id'],\n 'options' => [\n 'enum_titles' => $fromfield['labels'],\n 'grid_columns' => 12,\n ]\n ],\n ],\n ];\n return json_encode($schema);\n }", "protected function parseConfig(array $config)\n {\n // Currently only one connection is supported. This might be extended\n // in the future being able to use multiple connections and/or having\n // a split between search endpoints and index endpoints.\n $connection = array();\n foreach ($config as $k => $v) {\n if (in_array($k, $this->connAllowedConfig)) {\n $connection[$k] = $v;\n }\n }\n\n // Force the user-agent header to match SugarCRM's version\n $connection['curl'][CURLOPT_USERAGENT] = self::USER_AGENT . '/' . $this->getSugarVersion();\n\n return array('connections' => array($connection));\n }", "protected function parseDsn($dsn)\n{\n\tif (stripos($dsn,'pdo_') === 0) {\n\t\t$pdo = true;\n\t\t$dsn = substr($dsn, 4);\n\t}\n\t\n\t$dsa = parse_url($dsn);\n\tif (!isset($dsa['scheme'])) return [];\n\n\t$path = explode('/', $dsa['path']);\n\tif (!$path[0]) array_shift($path);\n\n\t$dsarray = array(\n\t 'driver' => $dsa['scheme'],\n\t 'host' => $dsa['host'],\n\t 'path' => substr($dsa['path'],1),\n\t 'dbname' => $path[0],\n\t 'user' => $dsa['user'],\n\t 'passw' => array_get($dsa, 'pass'),\n\t 'codepage' => $path[1]? $path[1] : null\n\t);\n\t//new way of adding options e.g. ?charset=utf8\n\tif (!empty($dsa['query'])) parse_str($dsa['query'], $dsarray['options']);\n\n\tif ($dsarray['driver'] == 'sqlite') $dsarray['codepage'] = null;\n\tif ($dsarray['codepage']) $dsarray['options']['charset'] = $dsarray['codepage'];\n\n\tif ($pdo) $dsarray['driver'] = 'pdo_'. $dsarray['driver'];\n\treturn $dsarray;\n}", "public static function parseDSN($dsn){\n $parsed = array(\n 'phptype' => false,\n 'dbsyntax' => false,\n 'username' => false,\n 'password' => false,\n 'protocol' => false,\n 'hostspec' => false,\n 'port' => false,\n 'socket' => false,\n 'database' => false,\n );\n\n if (is_array($dsn)) {\n $dsn = array_merge($parsed, $dsn);\n if (!$dsn['dbsyntax']) {\n $dsn['dbsyntax'] = $dsn['phptype'];\n }\n return $dsn;\n }\n\n // Find phptype and dbsyntax\n if (($pos = strpos($dsn, '://')) !== false) {\n $str = substr($dsn, 0, $pos);\n $dsn = substr($dsn, $pos + 3);\n } else {\n $str = $dsn;\n $dsn = null;\n }\n\n // Get phptype and dbsyntax\n // $str => phptype(dbsyntax)\n $arr = array();\n if (preg_match('|^(.+?)\\((.*?)\\)$|', $str, $arr)) {\n $parsed['phptype'] = $arr[1];\n $parsed['dbsyntax'] = !$arr[2] ? $arr[1] : $arr[2];\n } else {\n $parsed['phptype'] = $str;\n $parsed['dbsyntax'] = $str;\n }\n\n if (!count($dsn)) {\n return $parsed;\n }\n\n // Get (if found): username and password\n // $dsn => username:password@protocol+hostspec/database\n if (($at = strrpos($dsn,'@')) !== false) {\n $str = substr($dsn, 0, $at);\n $dsn = substr($dsn, $at + 1);\n if (($pos = strpos($str, ':')) !== false) {\n $parsed['username'] = rawurldecode(substr($str, 0, $pos));\n $parsed['password'] = rawurldecode(substr($str, $pos + 1));\n } else {\n $parsed['username'] = rawurldecode($str);\n }\n }\n\n // Find protocol and hostspec\n $match = array();\n if (preg_match('|^([^(]+)\\((.*?)\\)/?(.*?)$|', $dsn, $match)) {\n // $dsn => proto(proto_opts)/database\n $proto = $match[1];\n $proto_opts = $match[2] ? $match[2] : false;\n $dsn = $match[3];\n\n } else {\n // $dsn => protocol+hostspec/database (old format)\n if (strpos($dsn, '+') !== false) {\n list($proto, $dsn) = explode('+', $dsn, 2);\n }\n if (strpos($dsn, '/') !== false) {\n list($proto_opts, $dsn) = explode('/', $dsn, 2);\n } else {\n $proto_opts = $dsn;\n $dsn = null;\n }\n }\n\n // process the different protocol options\n $parsed['protocol'] = (!empty($proto)) ? $proto : 'tcp';\n $proto_opts = rawurldecode($proto_opts);\n if (strpos($proto_opts, ':') !== false) {\n list($proto_opts, $parsed['port']) = explode(':', $proto_opts);\n }\n if ($parsed['protocol'] == 'tcp') {\n $parsed['hostspec'] = $proto_opts;\n } elseif ($parsed['protocol'] == 'unix') {\n $parsed['socket'] = $proto_opts;\n }\n\n // Get dabase if any\n // $dsn => database\n if ($dsn) {\n if (($pos = strpos($dsn, '?')) === false) {\n // /database\n $parsed['database'] = rawurldecode($dsn);\n } else {\n // /database?param1=value1&param2=value2\n $parsed['database'] = rawurldecode(substr($dsn, 0, $pos));\n $dsn = substr($dsn, $pos + 1);\n if (strpos($dsn, '&') !== false) {\n $opts = explode('&', $dsn);\n } else { // database?param1=value1\n $opts = array($dsn);\n }\n foreach ($opts as $opt) {\n list($key, $value) = explode('=', $opt);\n if (!isset($parsed[$key])) {\n // don't allow params overwrite\n $parsed[$key] = rawurldecode($value);\n }\n }\n }\n }\n\n return $parsed;\n }", "public static function parseDSN($dsn) {\n\t\t$parsed = array(\n\t\t\t'phptype' => false,\n\t\t\t'dbsyntax' => false,\n\t\t\t'username' => false,\n\t\t\t'password' => false,\n\t\t\t'protocol' => false,\n\t\t\t'hostspec' => false,\n\t\t\t'port' => false,\n\t\t\t'socket' => false,\n\t\t\t'database' => false,\n\t\t);\n\n\t\tif (is_array($dsn)) {\n\t\t\t$dsn = array_merge($parsed, $dsn);\n\t\t\tif (!$dsn['dbsyntax']) {\n\t\t\t\t$dsn['dbsyntax'] = $dsn['phptype'];\n\t\t\t}\n\t\t\treturn $dsn;\n\t\t}\n\n\t\t// Find phptype and dbsyntax\n\t\tif (($pos = strpos($dsn, '://')) !== false) {\n\t\t\t$str = substr($dsn, 0, $pos);\n\t\t\t$dsn = substr($dsn, $pos + 3);\n\t\t} else {\n\t\t\t$str = $dsn;\n\t\t\t$dsn = null;\n\t\t}\n\n\t\t// Get phptype and dbsyntax\n\t\t// $str => phptype(dbsyntax)\n\t\tif (preg_match('|^(.+?)\\((.*?)\\)$|', $str, $arr)) {\n\t\t\t$parsed['phptype'] = $arr[1];\n\t\t\t$parsed['dbsyntax'] = !$arr[2] ? $arr[1] : $arr[2];\n\t\t} else {\n\t\t\t$parsed['phptype'] = $str;\n\t\t\t$parsed['dbsyntax'] = $str;\n\t\t}\n\n\t\tif (!count($dsn)) {\n\t\t\treturn $parsed;\n\t\t}\n\n\t\t// Get (if found): username and password\n\t\t// $dsn => username:password@protocol+hostspec/database\n\t\tif (($at = strrpos($dsn,'@')) !== false) {\n\t\t\t$str = substr($dsn, 0, $at);\n\t\t\t$dsn = substr($dsn, $at + 1);\n\t\t\tif (($pos = strpos($str, ':')) !== false) {\n\t\t\t\t$parsed['username'] = rawurldecode(substr($str, 0, $pos));\n\t\t\t\t$parsed['password'] = rawurldecode(substr($str, $pos + 1));\n\t\t\t} else {\n\t\t\t\t$parsed['username'] = rawurldecode($str);\n\t\t\t}\n\t\t}\n\n\t\t// Find protocol and hostspec\n\n\t\tif (preg_match('|^([^(]+)\\((.*?)\\)/?(.*?)$|', $dsn, $match)) {\n\t\t\t// $dsn => proto(proto_opts)/database\n\t\t\t$proto = $match[1];\n\t\t\t$proto_opts = $match[2] ? $match[2] : false;\n\t\t\t$dsn = $match[3];\n\n\t\t} else {\n\t\t\t// $dsn => protocol+hostspec/database (old format)\n\t\t\tif (strpos($dsn, '+') !== false) {\n\t\t\t\tlist($proto, $dsn) = explode('+', $dsn, 2);\n\t\t\t}\n\t\t\tif (strpos($dsn, '/') !== false) {\n\t\t\t\tlist($proto_opts, $dsn) = explode('/', $dsn, 2);\n\t\t\t} else {\n\t\t\t\t$proto_opts = $dsn;\n\t\t\t\t$dsn = null;\n\t\t\t}\n\t\t}\n\n\t\t// process the different protocol options\n\t\t$parsed['protocol'] = (!empty($proto)) ? $proto : 'tcp';\n\t\t$proto_opts = rawurldecode($proto_opts);\n\t\tif (strpos($proto_opts, ':') !== false) {\n\t\t\tlist($proto_opts, $parsed['port']) = explode(':', $proto_opts);\n\t\t}\n\t\tif ($parsed['protocol'] == 'tcp') {\n\t\t\t$parsed['hostspec'] = $proto_opts;\n\t\t} elseif ($parsed['protocol'] == 'unix') {\n\t\t\t$parsed['socket'] = $proto_opts;\n\t\t}\n\n\t\t// Get dabase if any\n\t\t// $dsn => database\n\t\tif ($dsn) {\n\t\t\tif (($pos = strpos($dsn, '?')) === false) {\n\t\t\t\t// /database\n\t\t\t\t$parsed['database'] = rawurldecode($dsn);\n\t\t\t} else {\n\t\t\t\t// /database?param1=value1&param2=value2\n\t\t\t\t$parsed['database'] = rawurldecode(substr($dsn, 0, $pos));\n\t\t\t\t$dsn = substr($dsn, $pos + 1);\n\t\t\t\tif (strpos($dsn, '&') !== false) {\n\t\t\t\t\t$opts = explode('&', $dsn);\n\t\t\t\t} else { // database?param1=value1\n\t\t\t\t\t$opts = array($dsn);\n\t\t\t\t}\n\t\t\t\tforeach ($opts as $opt) {\n\t\t\t\t\tlist($key, $value) = explode('=', $opt);\n\t\t\t\t\tif (!isset($parsed[$key])) {\n\t\t\t\t\t\t// don't allow params overwrite\n\t\t\t\t\t\t$parsed[$key] = rawurldecode($value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $parsed;\n\t}", "private function readConfig(){\n\n\t\t$this->_ini_array = parse_ini_file(CONFIG.'system.ini');\n\n\t\t$this->_host =\t$this->_ini_array['db_host'];\n\t\t$this->_username = $this->_ini_array['db_username'];\n\t\t$this->_password = $this->_ini_array['db_password'];\n\t\t$this->_database = $this->_ini_array['db_database'];\n\t\n\t\t$this->_log_enabled=$this->_ini_array['log_enabled'];\n\t\t$this->_log_level=$this->_ini_array['log_level'];\n\t\t$this->_log_file_path=$this->_ini_array['log_path'];\n\t\n\n\t\t$this->_lang_default=$this->_ini_array['lang_default'];\n\n\t}", "public function getDatasources()\n {\n return $this->datasources;\n }", "private function parse($config) {\n\t\t$this->domain = $this->getDomainFromConfig($config);\n\n\t\t$this->configurations = $this->getSettingsFromConfig($config);\n\n\t\t$this->declarations = $this->getDeclarationsFromConfig($config);\n\t}", "function getConfigDataList($sFileName, $sFieldName)\n\t{\n\t\t$arrReturn = array();\n\t \t// read config file\n\t \t$lines = @file($sFileName);\n\t \tforeach ($lines as $line_num => $line)\n \t{\n \t\t$pos = strpos($line, $sFieldName);\n \t\tif ($pos !== false)\n \t\t{\n \t\t\t$arrLine = explode(\"=\",trim($line));\n \t\t\tif (is_array($arrLine) && count($arrLine) == 2)\n\t\t\t\t{ \n\t\t\t\t\t$data = $arrLine[1];\n\t\t\t\t\tif ($data)\n\t\t\t\t\t{\n\t\t\t\t\t\t$arrItem = explode(\",\",trim($data));\n\t\t\t\t\t\tif (is_array($arrItem) && count($arrItem) == 2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$arrReturn[$arrItem[1]] = $arrItem[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n \t\t}\n\t }\n\t return $arrReturn;\n\t}", "private function read_config() {\n\t\t$sections = parse_ini_file($this->config['conf'], true);\n\t\tforeach ($sections as $sectionk => $sectionv) {\n\t\t\tforeach ($sectionv as $key => $var)\n\t\t\t\t$this->config[$sectionk . '.' . $key] = $var;\n\t\t}\n\t}", "private function runConfig()\n {\n $configs = [\n [\n 'name' => 'sub_title',\n 'alias_name' => 'SubTitle',\n 'value' => 'SubTitle',\n ],\n [\n 'name' => 'title',\n 'alias_name' => 'Title',\n 'value' => 'Title',\n ],\n ];\n\n foreach ($configs as $config) {\n factory(Config::class)->create($config);\n }\n }", "abstract public function loadConfig(array $config);", "private function detectDataSource()\n {\n $key = $this->config['datasource']['key'];\n $this->log(\"Detecting if there's a data source with key {$key}\");\n $this->dataSource = DataSource::where('key', $key)->get()->first();\n if (!$this->dataSource) {\n $this->info(\"No data source found. Proceeding to automatically create a data source\");\n $this->createDataSource();\n }\n\n $this->info(\"Importing to Data source {$this->dataSource->title}({$this->dataSource->data_source_id})...\");\n }", "public function load()\n {\n $configFilePath = $this->configFilePath();\n if (!file_exists($configFilePath)) {\n $this->hosts = [];\n } else {\n $this->hosts = $this->parser->parse(file_get_contents($configFilePath));\n }\n return $this->hosts();\n }", "abstract protected function loadConfig(array $config);", "public function getDataGridPluginConfig();" ]
[ "0.5976217", "0.5721828", "0.5612049", "0.55250674", "0.5504623", "0.53913856", "0.5366601", "0.5362301", "0.5356582", "0.53168577", "0.53066975", "0.5237124", "0.52257097", "0.5206472", "0.5197289", "0.5191867", "0.5191433", "0.51863676", "0.5180018", "0.51752", "0.5163774", "0.5147487", "0.5133069", "0.51321834", "0.5130924", "0.51025", "0.5079413", "0.5078079", "0.50756747", "0.5074447" ]
0.7190474
0
Commits the active transaction
public function commit() { if ($this->hasActiveTransaction) { parent::commit(); $this->hasActiveTransaction = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function commitTransaction() {\r\n\t\t// TODO: Implement transaction stuff.\r\n\t\t//$this->query('COMMIT TRANSACTION');\r\n\t}", "public function commit()\n {\n if ($this->transactions == 1) {\n $this->transaction->commit();\n }\n\n $this->transactions--;\n\n $this->fireConnectionEvent('committed');\n }", "public function commit()\n {\n if (self::$_transactionLevel == 1) {\n $this->getConnection()->commit();\n }\n \n if (self::$_transactionLevel > 0) {\n self::$_transactionLevel--;\n }\n }", "public static function commitTransaction()\n\t{\n\t\tif (self::$currentTransaction !== null)\n\t\t{\n\t\t\tself::$currentTransaction->commit();\n\t\t\tself::$currentTransaction = null;\n\t\t}\n\t}", "public function commit()\n {\n if ($this->transactions == 1) {\n $this->getPdo()->commit();\n }\n\n $this->transactions--;\n }", "public function commit(): void\n {\n if ($this->transactions == 1) {\n $this->call('commit');\n }\n\n $this->transactions = max(0, $this->transactions - 1);\n }", "public function transactionCommit()\n\t{\n\t\treturn;\n\t}", "public function commit()\n {\n if ($this->store->transactions == 1) {\n $this->store->commit();\n }\n\n --$this->transactions;\n }", "public function commit()\r\n {\r\n if ($this->_txns == 1) {\r\n $this->getMaster()->commit();\r\n }\r\n --$this->_txns;\r\n }", "public function commitTransaction() {\n\t\t//noop\n\t}", "abstract public function commitTransaction();", "public function commit()\n {\n if ($this->transactionCount < 1) {\n return;\n }\n $transaction = $this->unprepared(\"COMMIT;\");\n if (false !== $transaction) {\n $this->transactionCount--;\n }\n }", "public function commit()\n {\n $this->getConnection()->commit();\n }", "public function commit()\n{\n\t$this->query('COMMIT');\n}", "protected static function commitTransaction()\n\t{\n\t\tAbstractUnit::commitTransaction();\n\t}", "public function transactionCommit()\n {\n $this->connectionManager->commit();\n $this->connectionManager->autocommit(true);\n }", "function CommitTrans()\n\t{\n\t\tif ($this->__transCount > 0) {\n\t\t\t$this->__connection->commit();\n\t\t\t$this->__transCount--;\n\t\t}\n\t}", "public function commit()\n {\n $this->connection->commit();\n }", "public function commit()\n {\n throw new Exception('transactions are not yet supported');\n $this->db->commit_delegated_transaction();\n }", "protected function commitTransaction()\n {\n $this->container->make('db')->commit();\n }", "function commit() {\n\t\t\tself::$db->commit();\n\t\t\t$this->begin_executed = false;\n\t\t}", "protected function commit()\n\t{\n\t\t$this->db->commit();\n\t}", "public function commit();", "public function commit();", "public function commit();", "public function commit();", "public function commit();", "public static function commit()\n {\n }", "public function commit()\n {\n $this->getActivePdo()->commit();\n }", "public function commit() {\n if ($this->tx_active) {\n $this->x('COMMIT');\n $this->tx_active = false;\n } else {\n throw new GDBException(\"can't commit, no active transaction\");\n }\n }" ]
[ "0.84967434", "0.83242327", "0.8321", "0.8209178", "0.81601", "0.81048054", "0.80880034", "0.80426186", "0.804144", "0.8012363", "0.7977819", "0.7967638", "0.7955373", "0.79495883", "0.79378855", "0.7908791", "0.7892145", "0.7803367", "0.774375", "0.77212155", "0.77074707", "0.7698125", "0.7663422", "0.7663422", "0.7663422", "0.7663422", "0.7663422", "0.7661143", "0.76505363", "0.7578456" ]
0.8331714
1
Sort an array of photos using the comparator. Keep in mind a couple of other classes that implement Phlickr_Framework_IPhotoList: Phlickr_PhotosetPhotoList all the photos in a photoset. Phlickr_PhotoListIterator will pull all pages from a photo list.
function sort(Phlickr_Framework_IPhotoList $photolist) { foreach ($photolist->getPhotos() as $photo) { $id = $photo->getId(); $keys[$id] = $this->_strategy->stringFromPhoto($photo); $photos[$id] = $photo; } if ($this->isInReverse()) { arsort($keys); } else { asort($keys); } $ret = array(); foreach($keys as $id => $key) { $ret[] = $photos[$id]; } return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function sortPhotosByHeight($photos)\n {\n usort(\n $photos,\n function ($a, $b) {\n /**\n * @var ImageInterface $a\n * @var ImageInterface $b\n */\n return $a->getSize()->getHeight() < $b->getSize()->getHeight();\n }\n );\n\n return $photos;\n }", "public function getOrderedPhotos()\n {\n return $this->photos()->orderBy( 'photo_node.ordering', 'asc')->get();\n }", "public function sort() {\n\t\tif ($this->request->is('post')) {\n\t\t\t$order = explode(\",\", $_POST['order']);\n\t\t\t$i = 1;\n\t\t\tforeach ($order as $photo) {\n\t\t\t\t$this->Picture->read(null, $photo);\n\t\t\t\t$this->Picture->set('order', $i);\n\t\t\t\t$this->Picture->save();\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\n\t\t$this->render(false, false);\n\t}", "private function sortFiles(&$array){\n if(isset($array['files'])) sort($array['files']);\n if(isset($array['images'])) sort($array['images']);\n }", "public function getSortedImages()\n {\n $images = ArrayHelper::index($this->images, 'id');\n if ($images) {\n $image = $images[$this->primaryImage->id];\n unset($images[$this->primaryImage->id]);\n $images = array_merge([$image], $images);\n }\n \n return $images;\n }", "public function syncPhotos($photos = [])\n {\n if ( empty( $photos ) )\n {\n return $this->detachPhotos();\n }\n\n $do = [];\n $i = 0;\n foreach ( $photos as $photo )\n {\n $do[$photo] = ['ordering' => $i];\n $i++;\n }\n return $this->photos()->sync($do, true);\n }", "public function sort(array $paths);", "public function sort();", "public function photos(Builder $photos_sql)\n\t{\n\n\t\t$previousPhotoID = '';\n\t\t$return_photos = array();\n\t\t$photo_counter = 0;\n\t\t$photos = $photos_sql->get();\n\t\tforeach ($photos as $photo_model) {\n\n\t\t\t// Turn data from the database into a front-end friendly format\n\t\t\t$photo = $photo_model->prepareData();\n\n\t\t\t// Set previous and next photoID for navigation purposes\n\t\t\t$photo['previousPhoto'] = $previousPhotoID;\n\t\t\t$photo['nextPhoto'] = '';\n\n\t\t\t// Set current photoID as nextPhoto of previous photo\n\t\t\tif ($previousPhotoID !== '') {\n\t\t\t\t$return_photos[$photo_counter - 1]['nextPhoto'] = $photo['id'];\n\t\t\t}\n\t\t\t$previousPhotoID = $photo['id'];\n\n\t\t\t// Add to return\n\t\t\t$return_photos[$photo_counter] = $photo;\n\n\t\t\t$photo_counter++;\n\t\t}\n\n\t\tif (count($return_photos) > 0) {\n\t\t\t// Enable next and previous for the first and last photo\n\t\t\t$lastElement = end($return_photos);\n\t\t\t$lastElementId = $lastElement['id'];\n\t\t\t$firstElement = reset($return_photos);\n\t\t\t$firstElementId = $firstElement['id'];\n\n\t\t\tif ($lastElementId !== $firstElementId) {\n\t\t\t\t$return_photos[$photo_counter - 1]['nextPhoto'] = $firstElementId;\n\t\t\t\t$return_photos[0]['previousPhoto'] = $lastElementId;\n\t\t\t}\n\t\t}\n\n\t\treturn $return_photos;\n\t}", "public function getPhotos($page, $itemsPerPage);", "public function mySort(array $array);", "public function sortResults(array $results, $order = 'ASC');", "public function getPhotos($filters = array(), $limit = 20, $offset = null)\n {\n $buildQuery = $this->buildQuery($filters, $limit, $offset);\n $queue = $this->getBatchRequest();\n $this->db->batch($queue)->select(\"SELECT * FROM `{$this->domainPhoto}` {$buildQuery['where']} {$buildQuery['sortBy']} LIMIT {$buildQuery['limit']}\", $buildQuery['params']);\n if(isset($buildQuery['params']['NextToken']))\n unset($buildQuery['params']['NextToken']);\n $this->db->batch($queue)->select(\"SELECT COUNT(*) FROM `{$this->domainPhoto}` {$buildQuery['where']}\", $buildQuery['params']);\n $responses = $this->db->batch($queue)->send();\n\n $this->logErrors($responses);\n if(!$responses->areOK())\n return false;\n\n $photos = array();\n foreach($responses[0]->body->SelectResult->Item as $photo)\n $photos[] = $this->normalizePhoto($photo);\n\n if(!empty($photos))\n $photos[0]['totalRows'] = intval($responses[1]->body->SelectResult->Item->Attribute->Value);\n\n return $photos;\n }", "public function getPhotos();", "protected function _sortByArray($array) {}", "public function getImages() {\n if (empty($this->_images) && $this->getImgs()) {\n $images = json_decode($this->getImgs(), true);\n uasort($images, function($a, $b) {\n if (!isset($a['ordering'])) {\n $a['ordering'] = 0;\n }\n\n if (!isset($b['ordering'])) {\n $b['ordering'] = 0;\n }\n\n if ($a['ordering'] == @$b['ordering']) {\n return 0;\n }\n return ($a['ordering'] < $b['ordering']) ? -1 : 1;\n });\n $this->_images = $images;\n }\n\n return $this->_images;\n }", "public function prepareLocalImages($images) {\n\t\t$requestParams = $this->getRequest()->getParams();\n $filter_fields = array('filename','size', 'status'); \n if( !empty($requestParams['order_by']) && in_array($requestParams['order_by'], $filter_fields)) {\n $order_by = $requestParams['order_by'];\n if(isset($requestParams['dir']) && $requestParams['dir']=='desc') { \n $this->order_dir = 'desc';\n }else {\n $this->order_dir = 'asc';\n }\n } else {\n $order_by = '' ;\n }\n $this->order_by = $order_by;\n \n if($order_by == 'size') { \n usort($images, array(\"Imagerecycle_Imagerecycle_Block_Images\",\"cmpSize\") ); \n }else if($order_by == 'status') {\n usort($images, array(\"Imagerecycle_Imagerecycle_Block_Images\",\"cmpStatus\")); \n }else if($order_by == 'filename' && $this->order_dir == 'desc') {\n usort($images, array(\"Imagerecycle_Imagerecycle_Block_Images\",\"cmpNameDesc\")); \n } \n \n $start = ($this->page - 1) * $this->limit;\n $result = array_slice($images, $start, $this->limit);\n \n return $result;\n }", "public function getAllPhotos();", "public function getAroundPhotos($latMin, $latMax, $lngMin, $lngMax, $photosArray){\n $sql = 'SELECT * FROM photos WHERE lat > ? && lat < ? && lng > ? && lng < ? && status=0';\n $aroundPhotos = $this->executeQuery($sql, array($latMin, $latMax, $lngMin, $lngMax));\n $array = json_decode($photosArray);\n $data = [];\n //retain the prefix to retrieve the id of the photo\n foreach($array as $key => $element){\n $array[$key]= str_replace('photo_', '', $element);\n }\n while ($aPhoto = $aroundPhotos->fetch(\\PDO::FETCH_ASSOC))\n {\n $data [] = $aPhoto;\n }\n /*for each photo of the secondary gallery if is id already present in the\n main gallery we remove the photo of the secondary gallery*/\n foreach ($data as $photo){\n if (in_array($photo['id'], $array)){\n unset($data[array_search($photo, $data)]);\n }\n }\n return $data;\n }", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "protected function sortImage(&$array) {\n usort($array, function($a, $b) {\n if ($a['level'] == $b['level']) {\n return 0;\n }\n return ($a['level'] < $b['level']) ? -1 : 1;\n });\n }", "protected function transformPhotos(array $photos, array $options = []): array {\n return array_map(function (Photo $photo) use($options) : array {\n $item = [\n 'id' => $photo['id'],\n 'owner_id' => $photo['user_id'],\n\n 'label' => $photo['label'],\n 'server' => $photo['server'],\n\n 'title' => $photo['title'],\n 'description' => $photo['description'],\n\n 'photo' => [\n 'width' => 200, // stub\n 'height' => 300, // stub\n\n 'source' => sprintf(\n '%s/photos/%s/%d_%s.jpg',\n env('APP_STATIC_URL'),\n $photo['server'],\n $photo['id'],\n $photo['label']\n ),\n\n 'extension' => 'jpg', // stub\n ],\n\n 'created_at' => [\n 'timestamp' => $photo['created_at']->timestamp,\n 'to_string' => $photo['created_at']->toDayDateTimeString(),\n ],\n\n 'updated_at' => [\n 'timestamp' => $photo['updated_at']->timestamp,\n 'to_string' => $photo['updated_at']->toDayDateTimeString(),\n ],\n ];\n\n if (isset($options['include_tags']) && $options['include_tags']) {\n $item['tags'] = $this->transformTags($photo->tags->all());\n }\n\n if (isset($options['include_comments']) && $options['include_comments']) {\n $item['comments'] = [\n 'latest' => $this->transformComments($photo->comments->all()),\n ];\n }\n\n if (isset($options['include_likes']) && $options['include_likes']) {\n $item['likes'] = [\n 'count' => $photo->likes_count,\n 'latest' => $this->transformLikes($photo->likes->all()),\n ];\n }\n\n if (isset($options['include_owner']) && $options['include_owner']) {\n $item['owner'] = $this->transformOwner($photo->owner);\n }\n\n if (isset($options['include_location']) && $options['include_location']) {\n $item['location'] = $photo->location;\n }\n\n return $item;\n }, $photos);\n }", "protected function sortDataArray() {}", "protected function sort()\n {\n // if no comparator is passed sort the internal array\n // by its keys, else use the comparator\n if ($this->comparator == null) {\n return ksort($this->items);\n } else {\n return CollectionUtils::sort($this, $this->comparator);\n }\n }", "public static function all($page = 1, $per_page = 10, $order_by = 'latest')\n {\n $photos = self::get(\"/photos\", [\n 'query' => ['page' => $page, 'per_page' => $per_page, 'order_by' => $order_by]\n ]);\n\n $photosArray = self::getArray($photos->getBody(), get_called_class());\n\n return new ArrayObject($photosArray, $photos->getHeaders());\n }", "public function getPhotos($iPhotoAlbumId = null, $iPage) {\n \t$oLibSearch = Phpfox::getLib('search');\n \t$oUrlSearch = Phpfox::getLib('url');\n Phpfox::getLib('request')->set('page', $iPage);\n \t$bIsUserProfile = false;\n \t\n \tif (defined('PHPFOX_IS_USER_PROFILE')) {\n \t\t$bIsUserProfile = true;\n \t\t$aUser = Phpfox::getService('user')->get($this->_aParams['user_id']); \t\t\t\n \t}\n \t\n \t$sCategory = $aParentModule = null;\t\n\t\t$aSearch = $this->request()->getArray('search');\n\t\t$bIsTagSearch = false;\n\t\t$sView = $this->request()->get('view', false);\n\n $aPageSizes = (empty($iPhotoAlbumId) ? array(20) : array(1000));\n\t\t\n\t\t$aSort = array(\n\t\t\t'latest' => array('photo.photo_id', Phpfox::getPhrase('photo.latest')),\n\t\t);\n\t\t\n \t$oLibSearch->set(array(\n\t\t\t\t'type' => 'photo',\n\t\t\t\t'field' => 'photo.photo_id',\t\t\t\t\n\t\t\t\t'search_tool' => array(\n\t\t\t\t\t'table_alias' => 'photo',\n\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t'default_value' => Phpfox::getPhrase('photo.search_photos'),\n\t\t\t\t\t\t'name' => 'search',\n\t\t\t\t\t\t'field' => 'photo.title'\n\t\t\t\t\t),\n\t\t\t\t\t'sort' => $aSort,\n\t\t\t\t\t'show' => $aPageSizes\n\t\t\t\t),\n\t\t\t\t'display' => 1\n\t\t\t)\n\t\t);\t\t\n\n\t\t$aBrowseParams = array(\n\t\t\t'module_id' => 'photo',\n\t\t\t'alias' => 'photo',\n\t\t\t'field' => 'photo_id',\n\t\t\t'table' => Phpfox::getT('photo'),\n\t\t\t'hide_view' => array('pending', 'my')\n\t\t);\t\n\t\t\n\t\tif ($bIsUserProfile) {\n\t\t\t$oLibSearch->setCondition('AND photo.view_id ' . ($aUser['user_id'] == Phpfox::getUserId() ? 'IN(0,2)' : '= 0') . ' AND photo.group_id = 0 AND photo.type_id = 0 AND photo.privacy IN(' . (Phpfox::getParam('core.section_privacy_item_browsing') ? '%PRIVACY%' : Phpfox::getService('core')->getForBrowse($aUser)) . ') AND photo.user_id = ' . (int) $aUser['user_id']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (defined('PHPFOX_IS_CUSTOM_MODULE')) {\n\t\t\t\t$this->search()->setCondition('AND photo.view_id = 0 AND photo.module_id = \\'' . Phpfox::getLib('database')->escape($this->_aParams['module_id']) . '\\' AND photo.group_id = ' . (int) $this->_aParams['item_id'] . ' AND photo.privacy IN(%PRIVACY%)');\n\t\t\t} else {\n\t\t\t\t$oLibSearch->setCondition('AND photo.view_id = 0 AND photo.group_id = 0 AND photo.type_id = 0 AND photo.privacy IN(%PRIVACY%)');\n\t\t\t}\n\t\t}\n \t\n \tif (!empty($iPhotoAlbumId)) {\n \t\t$oLibSearch->setCondition('AND photo.album_id = '. $iPhotoAlbumId);\n \t}\n \t\n \t$oLibSearch->browse()->params($aBrowseParams)->execute();\n\t\t\n\t\t$aPhotos = $oLibSearch->browse()->getRows();\n\t\t$iCnt = $oLibSearch->browse()->getCount();\n\n\n\t\tPhpfox::getLib('pager')->set(array('page' => $oLibSearch->getPage(), 'size' => $oLibSearch->getDisplay(), 'count' => $oLibSearch->browse()->getCount()));\n\t\t\n\t\tforeach ($aPhotos as $iKey => $aPhoto) {\n\t\t\tif (Phpfox::isModule('like')) {\n\t\t\t\t$aPhoto['is_liked'] = $this->database()->select('lik.like_id AS is_liked')->from(Phpfox::getT('like'), 'lik')->where('lik.type_id = \\'photo\\' AND lik.item_id = '. $aPhoto['photo_id']. ' AND lik.user_id = ' . Phpfox::getUserId())->execute('getField');\n\t\t\t}\t\n\t\n\t\t\t$aPhoto['is_friend'] = $this->database()->select('f.friend_id AS is_friend')->from(Phpfox::getT('friend'), 'f')->where('f.user_id = '. $aPhoto['user_id']. ' AND f.friend_user_id = ' . Phpfox::getUserId())->execute('getField');\n\t\t\t\n\t\t\t$aPhoto = $this->processPhoto($aPhoto);\n\t\t\t$aPhoto['type_id'] = 'photo';\n\t\t\t$aPhoto = Phpfox::getService('accountapi.feed')->processFeed($aPhoto, null, $aPhoto['user_id'], true);\n\t\t\t$aPhotos[$iKey] = $aPhoto;\n\t\t}\n\t\t\n\t\treturn array($iCnt, $aPhotos);\n }", "function getPhotos($inputArr) {\n\n $ro = new GetPhotosRO();\n $album = $inputArr[\"name\"];\n $ro->albumName = $album;\n\n $picPath = \"Pics/$album/*.[jJ][pP][gG]\";\n $files = glob($picPath);\n $numfiles = count($files);\t\n\n for ($i=0; $i < $numfiles; $i++)\n {\n $photoUrl = $files[$i];\n $info = basename($photoUrl);\n $onePhoto = new PhotoInfo($photoUrl, $info);\n array_push($ro->photos, $onePhoto);\n }\n\n error_log(print_r($ro, TRUE));\n\n return $ro;\n}", "function sort(/*. array[int] .*/ $a, $sort_flags = SORT_REGULAR){}", "public function getPhotos()\n {\n return $this->photos;\n }", "public function asort() {}" ]
[ "0.6744327", "0.6459213", "0.61574024", "0.6003576", "0.58748996", "0.5840032", "0.57113194", "0.56348157", "0.5617374", "0.56104434", "0.5560692", "0.55431664", "0.546904", "0.542275", "0.5415622", "0.53793985", "0.5370699", "0.5357239", "0.5326707", "0.5314684", "0.53063935", "0.5277206", "0.51844025", "0.5154213", "0.5149332", "0.5090646", "0.50602275", "0.505929", "0.5045167", "0.5037726" ]
0.69154274
0
Return an array of ids from an array of Phlickr_Photos.
static function idsFromPhotos($photos) { $ids = array(); foreach ($photos as $photo) { $ids[] = $photo->getId(); } return $ids; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function extractIdsArray($data)\n {\n return array_pluck($data['photoset'], 'id');\n }", "public function getImagesId()\n {\n $ids = array();\n foreach ($this->images as $image) {\n $ids[] = $image->getId();\n }\n return $ids;\n }", "function getfileIds($fileArray){\n $imageIdsArray = [];\n foreach($fileArray as $file){\n $imageIdsArray[] = $file['id'];\n }\n return $imageIdsArray;\n}", "function getIds( array $Objects );", "public function getIdArray()\n {\n $idArray = array();\n\n foreach ($this as $importedVideo) {\n $idArray[] = $importedVideo->id;\n }\n\n return $idArray;\n }", "public static function getArrayOfIds($data): array\n {\n return $data->pluck('id')->toArray();\n }", "public function getIds();", "public function getIds();", "function hmg_get_gallery_ids( $post_id = null ) {\n\n\tif( null == $post_id ) \n\t\t$post_id = get_the_id(); \n\t\t\n\treturn array_filter( (array) get_post_meta( $post_id, '_hmg_gallery_images', true ) );\n\t\n}", "public function ids() {\n\t\t$q = $this->query();\n\t\t$q->select(Salesperson::aliasproperty('id'));\n\t\treturn $q->find()->toArray();\n\t}", "public function get_ids($objs)\n {\n $ids = array();\n foreach ($objs as $obj) {\n if ($obj->id) {\n array_push($ids, $obj->id);\n }\n }\n return $ids;\n }", "public abstract function get_ids();", "public function getAllIds(): array;", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "public function getIds() {\n $sources = array();\n \n $sources[] = $this->id;\n \n foreach ($this->points as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->lines as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->polygons as &$g) {\n $sources[] = $g->id;\n }\n if ( !empty($this->address) ) {\n $sources[] = $this->address->id;\n }\n foreach ($this->relationships as &$r) {\n $sources[] = $r->id;\n }\n \n return array_filter($sources);\n }", "public function getIds(): array\n {\n return array_map(fn (Entity $entity) => $entity->getId(), $this->entities);\n }", "function find_public_photos($ids_of_private_photos, $ids_of_all_users_photos_on_page)\n{\n $public_photos = [];\n\n foreach ($ids_of_all_users_photos_on_page as $photo_id)\n if (!in_array($photo_id, $ids_of_private_photos))\n array_push($public_photos, $photo_id);\n\n return $public_photos;\n}", "public function photos(Builder $photos_sql)\n\t{\n\n\t\t$previousPhotoID = '';\n\t\t$return_photos = array();\n\t\t$photo_counter = 0;\n\t\t$photos = $photos_sql->get();\n\t\tforeach ($photos as $photo_model) {\n\n\t\t\t// Turn data from the database into a front-end friendly format\n\t\t\t$photo = $photo_model->prepareData();\n\n\t\t\t// Set previous and next photoID for navigation purposes\n\t\t\t$photo['previousPhoto'] = $previousPhotoID;\n\t\t\t$photo['nextPhoto'] = '';\n\n\t\t\t// Set current photoID as nextPhoto of previous photo\n\t\t\tif ($previousPhotoID !== '') {\n\t\t\t\t$return_photos[$photo_counter - 1]['nextPhoto'] = $photo['id'];\n\t\t\t}\n\t\t\t$previousPhotoID = $photo['id'];\n\n\t\t\t// Add to return\n\t\t\t$return_photos[$photo_counter] = $photo;\n\n\t\t\t$photo_counter++;\n\t\t}\n\n\t\tif (count($return_photos) > 0) {\n\t\t\t// Enable next and previous for the first and last photo\n\t\t\t$lastElement = end($return_photos);\n\t\t\t$lastElementId = $lastElement['id'];\n\t\t\t$firstElement = reset($return_photos);\n\t\t\t$firstElementId = $firstElement['id'];\n\n\t\t\tif ($lastElementId !== $firstElementId) {\n\t\t\t\t$return_photos[$photo_counter - 1]['nextPhoto'] = $firstElementId;\n\t\t\t\t$return_photos[0]['previousPhoto'] = $lastElementId;\n\t\t\t}\n\t\t}\n\n\t\treturn $return_photos;\n\t}", "public function getIds(): array\n {\n return $this->ids;\n }", "function getObjectIDs() {\n\t\t$tmp = array();\n\t\tif ( $this->getCount() > 0 ) {\n\t\t\tforeach ( $this as $oObject ) {\n\t\t\t\t$tmp[] = $oObject->getID();\n\t\t\t}\n\t\t}\n\t\treturn $tmp;\n\t}", "public function getObjectIds();", "public function getAroundPhotos($latMin, $latMax, $lngMin, $lngMax, $photosArray){\n $sql = 'SELECT * FROM photos WHERE lat > ? && lat < ? && lng > ? && lng < ? && status=0';\n $aroundPhotos = $this->executeQuery($sql, array($latMin, $latMax, $lngMin, $lngMax));\n $array = json_decode($photosArray);\n $data = [];\n //retain the prefix to retrieve the id of the photo\n foreach($array as $key => $element){\n $array[$key]= str_replace('photo_', '', $element);\n }\n while ($aPhoto = $aroundPhotos->fetch(\\PDO::FETCH_ASSOC))\n {\n $data [] = $aPhoto;\n }\n /*for each photo of the secondary gallery if is id already present in the\n main gallery we remove the photo of the secondary gallery*/\n foreach ($data as $photo){\n if (in_array($photo['id'], $array)){\n unset($data[array_search($photo, $data)]);\n }\n }\n return $data;\n }", "private function extractIds($models)\n {\n $ids = [];\n foreach($models as $model){\n $ids[] = $model->id;\n }\n return $ids;\n }", "public function mapIds($results)\n {\n return collect($results->getDocuments())->pluck('id')->values();\n }", "public function getAllIds();", "public function getIdsList() {\n return $this->_get(1);\n }", "public function getPhotos();", "public function getTagIds()\n {\n return $this->tags->lists('id')->toArray();\n }", "public function getIds()\n\t{\n\t\treturn $this->ids;\n\t}", "public function getSpotsIds() {\n $query = \"SELECT \" . $this->prefix . \"id FROM ' . $this->prefix . 'spot WHERE spot_track_id=\" . $this->track_id . \" ORDER BY spot_last_update DESC LIMIT \" . $this->limit_spots;\n\n $result = db_query($query);\n\n $spot_ids = array();\n while($row = mysqli_fetch_array($result)){\n $spot_ids[] = $row['spot_id'];\n }\n\n return $spot_ids;\n }" ]
[ "0.7113198", "0.67401737", "0.6545396", "0.6365121", "0.6173614", "0.60859877", "0.599797", "0.599797", "0.59898245", "0.5986281", "0.59597653", "0.5945384", "0.5941317", "0.5913523", "0.5889665", "0.5882111", "0.5877648", "0.58672786", "0.5845231", "0.5748691", "0.5723924", "0.5705264", "0.569744", "0.568882", "0.56854874", "0.5678104", "0.56630415", "0.56220835", "0.5613755", "0.5598128" ]
0.82969815
0
Sort related purses like `usd`, `eur`, other...
public function getSortedPurses() { $purses = $this->purses; if (empty($purses)) { return $purses; } $getOrder = function ($currency) { $order = ['usd' => 0, 'eur' => 1]; return $order[$currency] ?? 100; }; usort($purses, function ($a, $b) use ($getOrder) { return $getOrder($a->currency) <=> $getOrder($b->currency); }); return $purses; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function order();", "public function asort() {}", "function es_add_catalog_order_by_member_prices($catalog_orderby_options) {\n\tunset($catalog_orderby_options[\"rating\"]);\n\n\t$catalog_orderby_options['member_price'] = __( 'Sort by member price', 'woocommerce' );\n\t\n\treturn $catalog_orderby_options;\n}", "function sac_sort_terms_by_description($x,$y) {\n\t$desc_x = (int)$x->description;\n\t$desc_y = (int)$y->description;\n\t\n\treturn $desc_x - $desc_y;\n}", "public function sort();", "function sortByPrice($a, $b) { \n return $a['menor_valor'] - $b['menor_valor'];\n}", "public function &getOrderBy();", "function sortRel($a, $b)\n{\n\tif($a['relevance'] == $b['relevance']) { return 0; }\n\treturn ($a['relevance'] < $b['relevance']) ? 1 : -1;\n}", "private static function sort()\n\t{\n\t\t//Setup order of importantance\n\t\t$changefreqs = array(\n\t\t\t'hourly' => 5,\n\t\t\t'daily' => 4,\n\t\t\t'weekly' => 3,\n\t\t\t'monthly' => 2,\n\t\t\t'yearly' => 1,\n\t\t\t'never' => 0\n\t\t);\n\n\t\t//Setup invidual arrays to sort by\n\t\tforeach(static::$links as $index => $link)\n\t\t{\n\t\t\t$priority[$index] = $link->priority ? $link->priority : 0;\n\t\t\t$changefreq[$index] = $link->changefreq ? $changefreqs[$link->changefreq] : 0;\n\t\t\t$loc[$index] = $link->loc;\n\t\t}\n\n\t\tarray_multisort($priority, SORT_DESC, $changefreq, SORT_DESC, $loc, SORT_ASC, static::$links);\n\t}", "function sortZyxRelNew($a, $b)\n{\n\tif($a['title'] == $b['title']) \n\t{ \n\t\tif($a['relevance'] == $b['relevance']) \n\t\t{ \n\t\t\tif($a['reviewnumber'] == $b['reviewnumber']) { return 0; }\n\t\t\treturn ($a['reviewnumber'] < $b['reviewnumber']) ? 1 : -1;\n\t\t}\n\t\treturn ($a['relevance'] < $b['relevance']) ? 1 : -1;\n\t}\n\treturn ($a['title'] < $b['title']) ? 1 : -1;\n}", "function sortLowToHigh($a, $b)\n{\n return $a->price < $b->price ? -1 : 1; //Compare the prices, evalutes to true\n // return $a->price > $b->price ? 1 : -1; // Gives the same result\n}", "function sortRelZyxNew($a, $b)\n{\n\tif($a['relevance'] == $b['relevance']) \n\t{ \n\t\tif($a['title'] == $b['title']) \n\t\t{ \n\t\t\tif($a['reviewnumber'] == $b['reviewnumber']) { return 0; }\n\t\t\treturn ($a['reviewnumber'] < $b['reviewnumber']) ? 1 : -1;\n\t\t}\n\t\treturn ($a['title'] < $b['title']) ? 1 : -1;\n\t}\n\treturn ($a['relevance'] < $b['relevance']) ? 1 : -1;\n}", "public static function sort_all($a, $b){\n if($a->type == \"book\" && $b->type == \"book\"){\n if (!empty($a->series)){\n if (!empty($b->series)){\n return (strtolower($a->series) == strtolower($b->series)) ? ($a->volume > $b->volume) : strtolower($a->series) > strtolower($b->series);\n }else{\n return (strtolower($a->series) == strtolower($b->title)) ? ($a->volume > $b->volume) : strtolower($a->series) > strtolower($b->title);\n }\n }else{\n if (!empty($b->series)){\n return (strtolower($a->title) == strtolower($b->series)) ? ($a->volume > $b->volume) : strtolower($a->title) > strtolower($b->series);\n }else{\n return (strtolower($a->title) == strtolower($b->title)) ? ($a->volume > $b->volume) : strtolower($a->title) > strtolower($b->title);\n }\n }\n }else if ($a->type == \"movie\" && $b->type == \"movie\"){\n return (strtolower($a->title) == strtolower($b->title)) ? ($a->season > $b->season) : strtolower($a->title) > strtolower($b->title);\n }else{\n return strtolower($a->title) > strtolower($b->title);\n }\n }", "function sortWithMoneyAndAlph($a, $b)\n{\n $aPrice = $a[\"price\"];\n $bPrice = $b[\"price\"];\n if (is_numeric($aPrice) and is_numeric($bPrice)) {\n $diff = $aPrice- $bPrice;\n } elseif (is_numeric($aPrice)) {\n $diff= 1; //only a is a nmber\n } else {\n $diff = -1; //only b is a number\n }\n\n\n $moneyRank = priceSort($a, $b);\n if ($diff == 0) {\n return critterNameSort($a, $b);\n }\n return $moneyRank;\n}", "private function sortAdaptors()\n {\n $this->sorted = [];\n\n if (isset($this->adaptors)) {\n krsort($this->adaptors);\n $this->sorted = array_merge(...$this->adaptors);\n }\n }", "function orderHotelsByRate($array)\n{\n return collect($array)->sortByDesc('hotelRate');\n}", "function publisher_getOrderBy($sort)\r\n{\r\n if ($sort == \"datesub\") {\r\n return \"DESC\";\r\n } else if ($sort == \"counter\") {\r\n return \"DESC\";\r\n } else if ($sort == \"weight\") {\r\n return \"ASC\";\r\n }\r\n}", "function sortRelOld($a, $b)\n{\n\tif($a['relevance'] == $b['relevance']) \n\t{ \n\t\tif($a['reviewnumber'] == $b['reviewnumber']) { return 0; }\n\t\treturn ($a['reviewnumber'] > $b['reviewnumber']) ? 1 : -1;\n\t}\n\treturn ($a['relevance'] < $b['relevance']) ? 1 : -1;\n}", "public function natsort()\n {\n }", "function sortOrderProducts(order_products $orderProducts);", "function sortAbcRelNew($a, $b)\n{\n\tif($a['title'] == $b['title']) \n\t{ \n\t\tif($a['relevance'] == $b['relevance']) \n\t\t{ \n\t\t\tif($a['reviewnumber'] == $b['reviewnumber']) { return 0; }\n\t\t\treturn ($a['reviewnumber'] < $b['reviewnumber']) ? 1 : -1;\n\t\t}\n\t\treturn ($a['relevance'] < $b['relevance']) ? 1 : -1;\n\t}\n\treturn ($a['title'] > $b['title']) ? 1 : -1;\n}", "public function sort()\n {\n foreach (array_keys($this->betTypes) as $type) {\n ksort($this->betTypes[$type]);\n }\n }", "function sortRelNew($a, $b)\n{\n\tif($a['relevance'] == $b['relevance']) \n\t{ \n\t\tif($a['reviewnumber'] == $b['reviewnumber']) { return 0; }\n\t\treturn ($a['reviewnumber'] < $b['reviewnumber']) ? 1 : -1;\n\t}\n\treturn ($a['relevance'] < $b['relevance']) ? 1 : -1;\n}", "function _usort_terms_by_ID($a, $b)\n {\n }", "function sortRelAbcNew($a, $b)\n{\n\tif($a['relevance'] == $b['relevance']) \n\t{ \n\t\tif($a['title'] == $b['title']) \n\t\t{ \n\t\t\tif($a['reviewnumber'] == $b['reviewnumber']) { return 0; }\n\t\t\treturn ($a['reviewnumber'] < $b['reviewnumber']) ? 1 : -1;\n\t\t}\n\t\treturn ($a['title'] > $b['title']) ? 1 : -1;\n\t}\n\treturn ($a['relevance'] < $b['relevance']) ? 1 : -1;\n}", "function tpps_details_tags_sort() {\n $output = \"\";\n\n $query = db_select('tpps_tag', 't')\n ->fields('t')\n ->orderBy('static', 'DESC')\n ->orderBy('tpps_tag_id')\n ->execute();\n $tags = array();\n while (($result = $query->fetchObject())) {\n $tags[$result->tpps_tag_id] = array(\n 'id' => $result->tpps_tag_id,\n 'name' => $result->name,\n 'color' => $result->color,\n 'static' => $result->static,\n );\n }\n\n $output .= tpps_show_tags($tags);\n\n return \"<label for=\\\"tpps-tags-filter\\\">Sort by tags:</label><div id=\\\"tpps-tags-filter\\\">\" . $output . \"</div>\";\n}", "function awesomeSort($a, $b)\n{\n return $a['amount'] <=> $b['amount'];\n}", "private function sortQueryOrders() {\n foreach ($this->queryResult as $index => $order) {\n $order = $this->injectKitData($order);\n $this->statusOutputOrder[$order['Order']['status']][$order['Order']['id']] = $order;\n }\n }", "function hentAlleAktiviteter()\n{\n return Aktivitet::All()->sortByDesc(\"Dato\");\n}", "public function testSortByPrice()\n {\n $item1 = new \\Saitow\\Model\\Tire('sql', 1);\n $item1->setPrice(1.1);\n\n $item2 = new Saitow\\Model\\Tire('xml', 50);\n $item2->setPrice(2.2);\n\n $item3 = new \\Saitow\\Model\\Tire('other', 22);\n $item3->setPrice(0.1);\n\n $items = [$item1, $item2, $item3];\n\n $sorted = TiresCollectionSorter::sort($items, \\Saitow\\Library\\TiresDataSource::ORDERBY_PRICE);\n\n $this->assertEquals($item3, $sorted[0]);\n $this->assertEquals($item1, $sorted[1]);\n $this->assertEquals($item2, $sorted[2]);\n }" ]
[ "0.58277833", "0.5817234", "0.57544994", "0.5681196", "0.5676268", "0.5643054", "0.5612936", "0.556106", "0.5507193", "0.54981184", "0.54958457", "0.5485574", "0.5477926", "0.5457627", "0.5446163", "0.5434187", "0.5407145", "0.5405822", "0.5395751", "0.53804594", "0.5371537", "0.5360131", "0.5350973", "0.53330094", "0.5329497", "0.5323118", "0.53219026", "0.5309128", "0.53039724", "0.52987385" ]
0.6976638
0
field rendu for dbs_client_id
public function dbs_client_id_html() { ?> <input type="text" name="dbs_client_id" value="<?php echo get_option('dbs_client_id')?>" style=" width: 600px !important;"/> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClientes_idclient(){\n return $this->clientes_idclient;\n }", "function clients_field_id($field, $id) {\n global $db;\n $data = null;\n $req = $db->prepare(\"SELECT $field FROM clients WHERE id= ?\");\n $req->execute(array($id));\n $data = $req->fetch();\n //return $data[0];\n return (isset($data[0]))? $data[0] : false;\n}", "public function getidcliente(){\n\t\treturn $this->_idcliente;\n\t}", "public function getIdField() : string\n {\n return 'id';\n }", "public function get_clientid() {\n return $this->clientid;\n }", "function getNomClient($id_client) {\n global $dbHandler, $global_id_agence;\n $db = $dbHandler->openConnection();\n \n $sql = \"SELECT statut_juridique, pp_nom, pp_prenom, pm_raison_sociale, gi_nom FROM ad_cli WHERE id_client=$id_client and id_ag = $global_id_agence\";\n $result = $db->query($sql);\n if (DB :: isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__, $result->getMessage());\n }\n if ($result->numrows() != 1) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__, _(\"Nombre d'occurences différent de 1 !\"));\n }\n $row = $result->fetchrow(DB_FETCHMODE_ASSOC);\n switch ($row['statut_juridique']) {\n case 1 : //PP\n $nom = $row['pp_prenom'] . \" \" . $row['pp_nom'];\n break;\n case 2 : //PM\n $nom = $row['pm_raison_sociale'];\n break;\n case 3 : //GI\n $nom = $row['gi_nom'];\n case 4 : //GS\n $nom = $row['gi_nom'];\n break;\n default : //Autre\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__, _(\"Statut juridique inconnu !\"));\n break;\n }\n $dbHandler->closeConnection(true);\n return $nom;\n}", "public function get_detail_client($client_id=0){\n\t\t$this->setMainTable('mmi_client');\n\t\treturn $this->find('client_id='.intval($client_id));\n\t}", "static function makeRowIdentifier($record) {\n global $user;\n // Start with client.\n if ($user->isPluginEnabled('cl'))\n $row_identifier = $record['client_id'] ? 'cl:'.$record['client_id'] : '';\n // Add billable flag.\n if (!empty($row_identifier)) $row_identifier .= ',';\n $row_identifier .= 'bl:'.$record['billable'];\n // Add project.\n $row_identifier .= $record['project_id'] ? ',pr:'.$record['project_id'] : '';\n // Add task.\n $row_identifier .= $record['task_id'] ? ',ts:'.$record['task_id'] : '';\n // Add custom field 1.\n if ($user->isPluginEnabled('cf')) {\n if ($record['cf_1_id'])\n $row_identifier .= ',cf_1:'.$record['cf_1_id'];\n else if ($record['cf_1_value'])\n $row_identifier .= ',cf_1:'.$record['cf_1_value'];\n }\n\n return $row_identifier;\n }", "public function getCustomFieldPrimaryKey() : string\n {\n return Slug::generate(get_class($this) . ' ' . $this->getId());\n }", "function client_id($id_client){\n $client = array();\n $sql = \"SELECT * FROM client WHERE id_client = \".$id_client.\"\";\n \n $res = $this->pdo->query($sql);\n\t\t\n if(!$res){\n $this->message = \"impossible de modifier le client\";\n return false;\n }\n if($resultats = $res->fetch(PDO::FETCH_OBJ)){\n $client = $resultats;\n }\n return $client;\n }", "protected function getIdField()\n {\n return 'Content-ID';\n }", "function getadvlic_no() {\n return $this->advlic_no;\n }", "function get_client_groups_id( $client_id ) {\r\n global $wpdb;\r\n\r\n $client_groups_id = $wpdb->get_col( $wpdb->prepare( \"SELECT group_id FROM {$wpdb->prefix}wpc_client_group_clients WHERE client_id = %d\", $client_id ) );\r\n\r\n if ( !is_array( $client_groups_id ) )\r\n $client_groups_id = array();\r\n\r\n return $client_groups_id;\r\n }", "public function getIDField(): string {\n\t\treturn $this->idField;\n\t}", "protected function getIdField()\n {\n return self::OBJ_NAME;\n }", "protected function getIdField()\n {\n return self::OBJ_NAME;\n }", "public function getClientId()\n {\n return $this->client_id;\n }", "public function getClientId()\n {\n return $this->client_id;\n }", "public function getClientId()\n {\n return $this->client_id;\n }", "public function getClientId()\n {\n return $this->client_id;\n }", "public function getClientId()\n {\n return $this->client_id;\n }", "function get_client_name($id){\n $answer=$GLOBALS['connect']->query(\"SELECT name, firstName FROM USERS WHERE id='$id'\");\n $data=$answer->fetch();\n return $data[\"name\"].\" \".$data[\"firstName\"];\n\n }", "public function getIdClient()\n {\n return $this->idClient;\n }", "public function getIdClient()\n {\n return $this->idClient;\n }", "function obtenidcliente($rfc){\n\t$funcbase = new dbutils;\n/*** conexion a bd ***/\n $mysqli = $funcbase->conecta();\n if (is_object($mysqli)) {\n\t\t$req = \"SELECT idclientes FROM clientes WHERE rfc = '\" \n \t.$rfc.\"'\"; \n \n \t\t$idcliente = $mysqli->query($req)->fetch_object()->idclientes;\n } else {\n die (\"<h1>'No se establecio la conexion a bd'</h1>\");\n }\n\t\t\n /* liberar la serie de resultados */\n /* cerrar la conexion */\n\t mysqli_close($mysqli);\n\t\t\n\treturn $idcliente;\n}", "public function getIdcliente() {\n\t\t\t\treturn $this->id_cliente ?? \"Id do Cliente não solicitado !!\";\n\t\t\t}", "public function getFieldId()\n {\n \treturn 'product_vendor';\n }", "public function getClientId() : string\n {\n return $this->clientId;\n }", "public function getClientId() : string\n {\n return $this->clientId;\n }", "public function getIdentifierField();" ]
[ "0.66497546", "0.6086246", "0.59521914", "0.5915633", "0.57984173", "0.579681", "0.57920337", "0.5788789", "0.57824993", "0.5767394", "0.57663757", "0.57502115", "0.5743322", "0.5734745", "0.5734118", "0.5734118", "0.57134444", "0.57134444", "0.57134444", "0.57134444", "0.57134444", "0.5709261", "0.56881255", "0.56881255", "0.5674086", "0.5673894", "0.5671302", "0.5661318", "0.5661318", "0.56456953" ]
0.6182331
1
field rendu for dbs_client_secret
public function dbs_client_secret_html() { ?> <input type="text" name="dbs_client_secret" value="<?php echo get_option('dbs_client_secret')?>" style=" width: 600px !important;"/> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSecret(): string;", "function fj_workflow_api_client_secret_field() {\n echo '<input type=\"text\" name=\"workflow_api[client_secret]\" value=\"' . get_option( 'workflow_api' )['client_secret'] . '\" size=\"80\" /><br />';\n}", "public function getClientSecret();", "public function getClientSecret();", "public function get_clientsecret() {\n return $this->clientsecret;\n }", "public function getClientSecret(): string\n {\n return (string) data_get($this->args, 'credentials.secret');\n }", "public function getAppSecret(): string;", "public function getClientSecret() : string\n {\n return $this->clientSecret;\n }", "public function getClientSecret() : string\n {\n return $this->clientSecret;\n }", "public function get_client_secret() {\n return $this->get_option( 'client-secret', '' );\n }", "public function getClientSecret(): string\n {\n return $this->configuration[ConfigurationInterface::CLIENT_SECRET];\n }", "public function getSecret();", "public function getSecret();", "public function getSecret();", "public function getSecret();", "public function getSecret();", "protected function key()\n {\n return \"CLIENT_SECRET\";\n }", "public function getSecret() : string\n {\n return $this->secret;\n }", "public function app_secret_callback()\n {\n printf(\n '<input type=\"text\" id=\"app_secret\" name=\"firebird_name[app_secret]\" value=\"%s\" />',\n isset( $this->options['app_secret'] ) ? esc_attr( $this->options['app_secret']) : ''\n );\n }", "public function get_access_secret()\n\t{\n return self::get_value( 'access_secret' );\n\t}", "public function getSecretId()\n {\n return $this->secret_id;\n }", "private function define_secret() {\n\t\t$secret = '';\n\t\treturn $secret;\n\t}", "public function getOldClientSecret()\n {\n return $this->oldClientSecret;\n }", "public function get_secret() {\r\n return $this->secret;\r\n }", "public function getClientSecret()\n {\n return $this->client_secret;\n }", "public function getClientSecret()\n {\n return $this->client_secret;\n }", "function get_site_secret()\n {\n \t$secret = datalist_get('__site_secret__');\n \tif (!$secret) $secret = init_site_secret();\n \t\n \treturn $secret;\n }", "public function getClientSecret()\n\t{\n\t\treturn $this->_clientSecret;\n\t}", "private function _getSecretKey() {\n return \"hfd&*9997678g__vd45%%$3)(*kshdak\";\n }", "function get_secret_key($link, $data) // Colorize: green\n { // Colorize: green\n return get_property_value($link, $data, \"secret_key\"); // Colorize: green\n }" ]
[ "0.6800839", "0.67984825", "0.67747504", "0.67747504", "0.67043656", "0.66740173", "0.6648752", "0.6643676", "0.6643676", "0.65864605", "0.6578222", "0.65730256", "0.65730256", "0.65730256", "0.65730256", "0.65730256", "0.6505797", "0.64592695", "0.63820696", "0.6275202", "0.6273701", "0.6258257", "0.62495023", "0.6248634", "0.6182404", "0.6182404", "0.6141058", "0.61405957", "0.6115547", "0.61041045" ]
0.6950332
0
field rendu for dbs_authorization
public function dbs_authorization_html() { ?> <input type="text" name="dbs_authorization" value="<?php echo get_option('dbs_authorization')?>" style=" width: 600px !important;"/> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUserfield();", "protected function getExplicitAuthFieldValues() {}", "protected function renderAdditionalIdentityFields() {}", "function field_view($name)\r\n {\r\n if (right::superuser()) return (true);\r\n \r\n $fieldRight = right::get_field($name);\r\n $view = $fieldRight[view];\r\n\r\n $userRight = right::get(\"rights\");\r\n\r\n if ($view != 0) return($userRight & $view);\r\n else return(false); // default no display\r\n }", "public function getAuthorizationString();", "function bacaDataadmin($field, $id_admin_agt) {\n $query = \"SELECT * FROM admin WHERE id_admin = '$id_admin_agt'\";\n $hasil = mysql_query($query);\n $data = mysql_fetch_array($hasil);\n if ($field == 'username')\n return $data['username'];\n else if ($field == 'password')\n return $data['password'];\n }", "function acl_field($type, $select)\r\n{\r\n\tglobal $db;\r\n\t\r\n\t$acl_field = '';\r\n\t\r\n\t$sql = 'SELECT * FROM ' . ACL_OPTION . ' WHERE auth_option LIKE \"' . $type . '%\"';\r\n\tif ( !($result = $db->sql_query($sql)) )\r\n\t{\r\n\t\tmessage(GENERAL_ERROR, 'SQL Error', '', __LINE__, __FILE__, $sql);\r\n\t}\r\n\t\r\n\twhile ( $row = $db->sql_fetchrow($result) )\r\n\t{\r\n\t\t$acl_field[$row[(( $select == 'name' ) ? 'auth_option_id' : 'auth_option')]] = $row[(( $select == 'name' ) ? 'auth_option' : 'auth_option_id')];\r\n\t}\r\n\t$db->sql_freeresult($result);\r\n\t\r\n\treturn $acl_field;\r\n}", "function eralha_crowdfunding_account(){\n\t\t\t\n\t\t}", "protected function composeFields()\n {\n $this->fields = $this->authorization->get();\n }", "protected function renderTrustedPropertiesField() {}", "function get_aut_idautor(){return $this->aut_idautor;}", "public function get_authorization(){\n\t\t$bvars = $this->get_bvars();\n\t\tif ( array_key_exists( 'Authorization', $bvars ) ) {\n\t\t\treturn $bvars[ 'Authorization' ];\t\n\t\t}\n\t\t\n\t\treturn 'Basic Kjo=';\n\t}", "public function fetchField();", "public function PrintAuthInfo() \n {\n if($this->IsAuthenticated())\n echo \"Du är inloggad som: <b>\" . $this->GetAcronym() . \"</b> (\" . $this->GetName() . \")\";\n else\n echo \"Du är <b>UTLOGGAD</b>.\";\n }", "function myAccount($ar=NULL){\n $ar['oid']=XUser::get_current_user_uid();\n if(!is_array($ar['fieldssec'])){\n foreach(array('DATET','DATEF','alias','GRP','GRPA','BO','bohome') as $f){\n $ar['fieldssec'][$f]='ro';\n }\n }\n return $this->edit($ar);\n }", "function external_db_show_password_fields()\n{\n return 0;\n}", "function egsr_author_cap(){\n return Array ( \n 'delete_posts' => true,\n 'delete_published_posts' => true,\n 'edit_posts' => true,\n 'edit_published_posts' => true,\n 'publish_posts' => true,\n 'read' => true,\n 'upload_files' => true,\n );\n}", "public function get_auth_string()\n {\n }", "protected function getAclParam()\n\t{\n\t\treturn 'caneditrow_access';\n\t}", "public function accion(){\n \t$accion = $this->accion;\n \tif ($accion == 'CREAR') {\n \t\t$accion = \"CREACION\";\n \t}else{\n \t\t$accion = \"EDICION\";\n \t}\n \treturn $accion;\n }", "public static function getExplicitAuthFieldValues() {}", "public function relatorio4(){\n $this->isAdmin();\n }", "public function getOGAdminID();", "public function getAuthString()\n {\n }", "function __toString() {\n\t\t \t\n\t\t return \"(\" . $this->id . \", \" . $this->nom_usuari . \", \" . \n \t$this->contrasenya . \", \" . $this->email . \",\" . $this->admin . \")\";\n }", "function oregonaitc_go_access_fields() {\n \n $fields = array(\n\t\tarray(\n 'type' => 'select',\n 'label' => __( 'Valid Subscription', 'oregonaitc' ),\n 'id'\t\t => 'go_access_valid',\n 'options' \t => array( 'yes' => 'Yes', 'no' => 'No' ),\n\t\t),\n\t array(\n 'type' => 'text',\n 'label' => __( 'Get Oregonized Code', 'oregonaitc' ),\n 'id'\t\t => 'go_access_code',\n 'placeholder' => __( '', 'oregonaitc' ),\n\t\t),\t\n ); \n\n return $fields;\n}", "public function authorize() {\n\t\t$this->db = new Database();\n\t\t$this->user = ( 'rjg70' );//$_SERVER['REMOTE_USER']);\n\t\t$this->db->query( 'SELECT * FROM users WHERE crsid = :id' );\n\t\t$this->db->bind( ':id', $this->user );\n\t\t$row = $this->db->single();\n\n\t\t//print_r($row);\n\t\tif ( $row ) {\n\t\t\tif ( $row[\"authorised\"] ) {\n\t\t\t\t$this->admin = $row[\"admin\"];\n\t\t\t\t$this->type = $row[\"type\"];\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function field(){\n\t\t\t$this->aah->check_access();\n\n\t\t\t$nav_id = $this->aah->get_nav_id(__CLASS__.'/field');\n\t\t\t$read_access = $this->aah->check_privilege('read',$nav_id);\n\t\t\t$add_access = $this->aah->check_privilege('add',$nav_id);\n\n\t\t\tif($read_access)\n\t\t\t{\n\t\t\t\t$this->global_model->reinitialize_dao();\n\t\t\t\t$dao = $this->global_model->get_dao();\n\t\t\t\t$data['active_url'] = str_replace('::','/',__METHOD__);\n\t\t\t\t$data['dt2_rows'] = $dao->execute(0,\"SELECT * FROM ref_dt2 WHERE provinsi_id='\".$this->_SYS_PARAMS[1].\"'\")->result_array();\n\t\t\t\t$data['form_id'] = \"search-school-form\";\n\t\t\t\t$data['active_controller'] = $this->active_controller;\n\t\t\t\t$data['containsTable'] = true;\n\t\t\t\t$data['add_access'] = $add_access;\n\t\t\t\t$this->backoffice_template->render($this->active_controller.'/field/index',$data);\n\t\t\t}else{\n\t\t\t\t$this->error_403();\n\t\t\t}\n\t\t}", "function getfield(){\r\n // Талбаруудын утгыг авах\r\n }", "function REST_fields(&$ORM)\n {\n $this->rest->select_fields($ORM);\n }" ]
[ "0.59486073", "0.5891038", "0.5881985", "0.5809195", "0.58043236", "0.5738497", "0.57325053", "0.56825423", "0.5615326", "0.556162", "0.5550581", "0.5548836", "0.5522319", "0.5467614", "0.54668486", "0.54518855", "0.5423192", "0.54074556", "0.53665906", "0.5356529", "0.53524864", "0.534146", "0.5322076", "0.532072", "0.5300412", "0.5298678", "0.52962106", "0.529199", "0.5270252", "0.5263271" ]
0.6223703
0
function to load contact us view
public function contactUsView() { $this->load->view('contactusview' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function contactUs() {\n\n require('view/contactUsView.php');\n\n}", "public function contactUs(){\n $this->load->view('contactUs');\n }", "public function contact()\n\t{\n\t\t$data ['footer'] = $this->page_model->getfooter();\n\n\t\t$this->load->view('templates/header');\n\t\t$this->load->view('home/about/head_about');\n\t\t$this->load->view('home/about/contact', $data);\n\t\t$this->load->view('templates/footer', $data);\n\t}", "public function contact() {\n $this->getView('navigation', array('pagename' => 'Contact'));\n $random = substr(md5(rand()), 0, 7);\n $this->getView('contact',array('cap' => $random));\n }", "public function contactUs() {\n\n $data = '';\n $viewname = Config('constants.frontendView') . '.contact_us';\n return Helper::returnView($viewname, $data);\n }", "public function index()\r\r\n\t{\r\r\n\t\t$this->load->view('contact_view');\r\r\n\t}", "public function contact_us()\n {\n //\n return view('contactus');\n }", "public function contactAction()\n {\n $this->view->render('Contact Us');\n }", "public function showContactPage()\n {\n return view('pages.contact');\n }", "public function getContact(){\n\t\treturn view('pages.contact'); #or pages/contact\n\t}", "public function contact()\n {\n\n $lang = $this->data['lang'];\n $user_id = $this->user_id;\n\n $this->data['page'] = 'contact_us' ;\n\n $body = 'contact' ;\n\n $this->load_pages($body,$this->data); \n\n }", "public function contactUs()\n {\n $this->template->set('global_setting', $this->global_setting);\n $this->template->set('page', 'contact');\n $this->template->set_theme('default_theme');\n $this->template->set_layout('frontend')\n ->title($this->global_setting['site_title'] . ' | Contact Us')\n ->set_partial('header', 'partials/header')\n ->set_partial('footer', 'partials/footer');\n $this->template->build('frontpages/contact_us');\n }", "public function contact_us()\n {\n $navbar = NavBar::first();\n return view('pages.home.contact-us' , compact('navbar'));\n }", "public function contact()\n {\n $breadCrumb = $this->userEngine->breadcrumbGenerate('contact');\n\n return $this->loadPublicView('user.contact', $breadCrumb['data']);\n }", "public function getEfficientcontact()\n {\n return view('contactpage');\n }", "public function contact_us()\n {\n return view('pages.frontsite.contact_us');\n }", "public function contact() {\r\n $this->load->view('font_end/includes/header', $this->data);\r\n $this->load->view('font_end/contact');\r\n $this->load->view('font_end/includes/footer');\r\n }", "public function contact()\n\t{\n\t\treturn view('pages.contact');\n\t}", "public function contact()\n {\n // which contain router class an applied renderView method\n return $this->render('contact');\n }", "public function showContact()\n {\n return view('front.pages.contact');\n }", "public function index()\n\t{\n\n\t\t$this->view('guest/contact-us');\n\t}", "public function lienhe()\n {\n return view('frontend.about.contact',$this->data);\n }", "public function contact()\n\t{\n\t\treturn View::make('contact.contact');\n\t}", "public function contact(){\n return view('frontend.contact');\n \t\n }", "public function contact()\n {\n return View::make('All.contact');\n }", "public function contact()\n {\n return view('templates.them8.contact');\n }", "public function contact()\n {\n return view('pages.contact');\n }", "public function contact_us()\n {\n $data['title'] = 'Contact Us';\n $data['menu'] = 'contact_us';\n $data['seo'] = Seo::where('menu_name', 'contact_us')->first();\n $data['contact_us_phone'] = SiteSetting::where('key', 'contact_us_phone')->select('value')->first();\n $data['contact_us_email'] = SiteSetting::where('key', 'contact_us_email')->select('value')->first();\n $data['contact_us_address'] = SiteSetting::where('key', 'contact_us_address')->select('value')->first();\n return view('contact_us', $data);\n }", "function showContact() {\n $output = $this->outputBoilerplate('contact.html');\n return $output;\n }", "public function show()\n {\n return view('ContactUs');\n }" ]
[ "0.7662578", "0.76327574", "0.75723183", "0.7551234", "0.7521056", "0.7409518", "0.73617864", "0.7329589", "0.7291424", "0.72734326", "0.7239474", "0.72393703", "0.7190757", "0.7185839", "0.7182809", "0.7181831", "0.71703553", "0.71620095", "0.7134234", "0.71118784", "0.71087766", "0.7080415", "0.7038598", "0.70378405", "0.70302665", "0.6997116", "0.69829756", "0.69658035", "0.69474095", "0.69444036" ]
0.8090335
0
Initialize Social Media section and fields
private function initializeSocialMedia() { $this->ch->addSection($this->slug . '_social_media', 'Social Media', 130); foreach ($this->social as $media => $label) { $this->ch->addControl("social_{$media}", $this->slug . '_social_media', $label); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct() {\n\t\t\t//\n\t\t\tparent::__construct(\n\t\t\t\t'zthemename_social_media',\n\t\t\t\tesc_html__( 'Social Media', 'zthemename' ),\n\t\t\t\tarray(\n\t\t\t\t\t'description' => esc_html__( \"Displays your business' social media links\", 'zthemename' ),\n\t\t\t\t\t'customize_selective_refresh' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t\t$options = get_option( 'zthemename_options' );\n\t\t\t$this->socials = $options ? $options['social_media'] : false;\n\t\t}", "function init()\n\t{\n\t\t$this->setType(\"media\");\n\t}", "function simple_initialize_social_meta_admin() {\n\tSIMPLE_SOCIAL_META_Admin::init();\n}", "public function __construct() {\n\t\t$widget_ops = array( \n\t\t\t'classname' => 'media_gallery',\n\t\t\t'description' => 'Add the media gallery',\n\t\t);\n\t\tparent::__construct( 'social_profiles', 'Social Profiles', $widget_ops );\n\t}", "public function init()\n\t{\n //https://www.facebook.com/FacebookDevelopers\n if (!empty($this->username)) $this->username = $this->username;\n if (empty($this->lang)) $this->lang = 'en_US';\n if (empty($this->width)) $this->width = 292;\n if (empty($this->height)) $this->height = 550;\n if (empty($this->show_faces)) $this->show_faces = true;\n if (empty($this->color_scheme)) $this->color_scheme = 'light';\n if (empty($this->show_stream)) $this->show_stream = true;\n if (empty($this->show_border)) $this->show_border = true;\n if (empty($this->show_header)) $this->show_header = true;\n\t}", "public function initialize()\n {\n $this->setSchema(\"social_media\");\n $this->setSource(\"Transaction\");\n $this->belongsTo('comment_id', 'App\\Models\\Comment', 'id', ['alias' => 'Comment']);\n $this->belongsTo('user_id', 'App\\Models\\User', 'id', ['alias' => 'User']);\n }", "public function page_init() {\n register_setting( 'bii_instagram', 'bii_instagram' );\n\n add_settings_section(\n 'bii_instagram_oauth',\n __( 'Authentication', 'bii-instagram' ),\n array( &$this, 'print_oauth_section_info' ),\n 'bii-instagram'\n );\n add_settings_field(\n 'bii_instagram_client_id',\n __( 'Client ID', 'bii-instagram' ),\n array( &$this, 'create_textfield' ),\n 'bii-instagram',\n 'bii_instagram_oauth',\n array( 'code' => true, 'name' => 'client_id' )\n );\n add_settings_field(\n 'bii_instagram_client_secret',\n __( 'Client Secret', 'bii-instagram' ),\n array( &$this, 'create_textfield' ),\n 'bii-instagram',\n 'bii_instagram_oauth',\n array( 'code' => true, 'name' => 'client_secret', 'type' => 'password' )\n );\n }", "public function __construct() {\n\t\t\t//\n\t\t\tparent::__construct(\n\t\t\t\t'zthemename_social_media',\n\t\t\t\tesc_html__( 'Social Media', 'zthemename' ),\n\t\t\t\tarray(\n\t\t\t\t\t'description' => esc_html__( \"Displays your business' social media links\", 'zthemename' ),\n\t\t\t\t\t'customize_selective_refresh' => true,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t//write_log( get_option( $this->option_name ) );\n\n\t\t\t\n\t\t\t//if ( is_active_widget( false, false, $this->id_base ) ) {\n\t\t\t\t//write_log( $this );\n\t\t\t\t//write_log( get_option( $this->option_name ) );\n\t\t\t//}\n\t\t\t\n\t\t}", "public function initialize() {\n // set the default properties for the sekugManageAlbumItemsController class\n $loadjquery = $this->modx->getOption('sekusergalleries.load_jquery');\n $this->setDefaultProperties(array(\n 'gallery' => '',\n 'tplGallery' => 'users.gallery.view',\n 'tplAlbumList' => 'users.gallery.albumlist',\n 'customcss' => '',\n 'loadjquery' => $loadjquery,\n ));\n // if the gallery id is in the request, set it in the properties\n //if (!empty($_REQUEST['gallery'])) {\n $this->setProperty('gallery', ($_REQUEST['gallery']>'') ? $_REQUEST['gallery'] : $this->modx->user->get('id') );\n //}\n }", "function load_fields() {\n\n\t\t// Back end form fields\n\t\t$this->fields = array(\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Title', 'publisher' ),\n\t\t\t\t'id' => 'title',\n\t\t\t\t'type' => 'text',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Buttons Style', 'publisher' ),\n\t\t\t\t'id' => 'style',\n\t\t\t\t'type' => 'image_select',\n\t\t\t\t'section_class' => 'style-floated-left',\n\t\t\t\t'value' => 'clean',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'button' => array(\n\t\t\t\t\t\t'label' => __( 'Button Style', 'publisher' ),\n\t\t\t\t\t\t'img' => bf_get_theme_uri( 'images/shortcodes/bs-social-share-button.png' )\n\t\t\t\t\t),\n\t\t\t\t\t'button-no-text' => array(\n\t\t\t\t\t\t'label' => __( 'Icon Button Style', 'publisher' ),\n\t\t\t\t\t\t'img' => bf_get_theme_uri( 'images/shortcodes/bs-social-share-button-no-text.png' )\n\t\t\t\t\t),\n\t\t\t\t\t'outline-button' => array(\n\t\t\t\t\t\t'label' => __( 'Outline Style', 'publisher' ),\n\t\t\t\t\t\t'img' => bf_get_theme_uri( 'images/shortcodes/bs-social-share-outline-button.png' )\n\t\t\t\t\t),\n\t\t\t\t\t'outline-button-no-text' => array(\n\t\t\t\t\t\t'label' => __( 'Icon Outline Style', 'publisher' ),\n\t\t\t\t\t\t'img' => bf_get_theme_uri( 'images/shortcodes/bs-social-share-outline-button-no-text.png' )\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Colored Style', 'publisher' ),\n\t\t\t\t'id' => 'colored',\n\t\t\t\t'type' => 'switch',\n\t\t\t\t'on-label' => __( 'Yes', 'publisher' ),\n\t\t\t\t'off-label' => __( 'No', 'publisher' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Active Sites', 'publisher' ),\n\t\t\t\t'id' => 'sites',\n\t\t\t\t'type' => 'sorter_checkbox',\n\t\t\t\t'deferred-options' => array(\n\t\t\t\t\t'callback' => 'publisher_social_share_option_list',\n\t\t\t\t),\n\t\t\t\t'section_class' => 'bs-theme-social-share-sorter',\n\t\t\t),\n\t\t);\n\n\t}", "public static function init() {\n\t\tadd_action( 'admin_menu', __CLASS__ . '::simple_social_meta_create_menu' );\n\n\t\t/* Add the post meta box on the 'add_meta_boxes' hook. */\n\t\tadd_action( 'add_meta_boxes', __CLASS__ . '::add_simple_social_meta_meta_box' );\n\n\t\t/* Save the post meta box data on the 'save_post' hook. */\n\t\tadd_action( 'save_post', __CLASS__ . '::save_simple_social_meta_meta_box', 10, 2 );\n\n\t}", "protected function _init()\n {\n $this->_fields += array(\n 'id' => new Sprig_Field_Auto,\n 'name' => new Sprig_Field_Char,\n 'brief' => new Sprig_Field_Char,\n 'content' => new Sprig_Field_Char,\n 'module_id' => new Sprig_Field_Integer,\n 'url' => new Sprig_Field_Char,\n 'meta_title' => new Sprig_Field_Char,\n 'meta_keywords' => new Sprig_Field_Char,\n 'meta_description' => new Sprig_Field_Char,\n 'ord' => new Sprig_Field_Integer(array(\n 'default' => 10,\n )),\n 'status' => new Sprig_Field_Integer(array(\n 'default' => 0,\n )),\n );\n }", "public function __construct()\n {\n\n parent::__construct(\n 'sml_widget', // Base ID\n esc_html__('Social Media Links', 'sml_domain'), // Name\n array('description' => esc_html__('Widget to display Social Media Links', 'sml_domain')) // Args\n );\n\n }", "public function getFieldsSocialMedia($social_media_id, $page_id = 'n/a') {\n //twitter\n if ($social_media_id == '174') {\n $response = $this->twitter_user_profile();\n }\n //facebook\n else if ($social_media_id == '166') {\n $response = $this->getFacebookPageInfo($page_id);\n } else {\n }\n $terms_obj = \\Drupal::entityTypeManager()->getStorage('taxonomy_term')->load($social_media_id);\n $fields = [];\n foreach ($terms_obj->get('field_fields_settings')->getValue() as $pid) {\n $p = \\Drupal\\paragraphs\\Entity\\Paragraph::load($pid['target_id']);\n $fields[$p->field_name->value]['enabled'] = $p->field_enable->value;\n $fields[$p->field_name->value]['type'] = $p->field_field_type->value;\n $fields[$p->field_name->value]['specifications'] = $p->field_field_specification->value;\n if ($p->field_field_type->value == 'Image') {\n $fields[$p->field_name->value]['media_preset'] = $p->field_media_preset_ref->target_id;\n } else if ($p->field_field_type->value == 'text') {\n $fields[$p->field_name->value]['char_limit'] = $p->field_limit_char->value;\n } else {\n $fields[$p->field_name->value]['char_limit'] = $p->field_limit_char->value;\n }\n //insert field value\n if ($social_media_id == '174') {\n if (strpos(strtolower($p->field_name->value), 'name') !== false) {\n $fields[$p->field_name->value]['value'] = isset($response->name) ? $response->name : ' ';\n }\n if (strpos(strtolower($p->field_name->value), 'location') !== false) {\n $fields[$p->field_name->value]['value'] = isset($response->location) ? $response->location : ' ';\n }\n if (strpos(strtolower($p->field_name->value), 'description') !== false || strpos(strtolower($p->field_name->value), 'bio') !== false) {\n $fields[$p->field_name->value]['value'] = isset($response->description) ? $response->description : ' ';\n }\n if (strpos(strtolower($p->field_name->value), 'url') !== false) {\n $fields[$p->field_name->value]['value'] = isset($response->entities->url->urls[0]->expanded_url) ? $response->entities->url->urls[0]->expanded_url : ' ';\n }\n if (strpos(strtolower($p->field_name->value), 'profile') !== false) {\n $fields[$p->field_name->value]['value'] = isset($response->profile_image_url_https) ? $response->profile_image_url_https : ' ';\n }\n if (strpos(strtolower($p->field_name->value), 'banner') !== false) {\n $fields[$p->field_name->value]['value'] = isset($response->profile_banner_url) ? $response->profile_banner_url : ' ';\n }\n }\n if ($social_media_id == '166') {\n // \\Drupal::logger('facebook')->error('<pre><code>' . print_r($page_id, TRUE) . '</code></pre>');\n if (strpos(strtolower($p->field_name->value), 'about') !== false) {\n $fields[$p->field_name->value]['value'] = isset($response['about']) ? $response['about'] : ' ';\n }\n if (strpos(strtolower($p->field_name->value), 'phone') !== false) {\n $fields[$p->field_name->value]['value'] = isset($response['phone']) ? $response['phone'] : ' ';\n }\n if (strpos(strtolower($p->field_name->value), 'website') !== false) {\n $fields[$p->field_name->value]['value'] = isset($response['website']) ? $response['website'] : ' ';\n }\n if (strpos(strtolower($p->field_name->value), 'description') !== false) {\n $fields[$p->field_name->value]['value'] = isset($response['description']) ? $response['description'] : ' ';\n }\n if (strpos(strtolower($p->field_name->value), 'emails') !== false) {\n $emailsAsString = ' ';\n if (isset($response['emails'])) {\n foreach ($response['emails'] as $key => $val) {\n $emailsAsString.= $val . ',';\n }\n }\n $fields[$p->field_name->value]['value'] = $emailsAsString;\n }\n if (strpos(strtolower($p->field_name->value), 'categories') !== false) {\n $fields[$p->field_name->value]['value'] = $response['category_list'];\n }\n if (strpos(strtolower($p->field_name->value), 'banner') !== false || strpos(strtolower($p->field_name->value), 'cover') !== false) {\n $fields[$p->field_name->value]['value'] = $response['cover']['source'];\n }\n if (strpos(strtolower($p->field_name->value), 'profile') !== false || strpos(strtolower($p->field_name->value), 'picture') !== false) {\n $fields[$p->field_name->value]['value'] = $response['picture']['data']['url'];\n }\n }\n }\n //\\Drupal::logger('facebook')->error('<pre><code>' . print_r($fields, true) . '</code></pre>');\n return $fields;\n }", "public function init()\n {\n $this->loadMeta();\n }", "function init()\n {\n\n $elements = array(\n 'page_id' => array('hidden')\n , 'name' => array('text', array('label' => 'Name', 'options' => array('StringLength' => array(false, array(1, 50)),), 'filters' => array('StringTrim'), 'required' => true))\n , 'title' => array('text', array('label' => 'Title', 'options' => array('StringLength' => array(false, array(4, 255)),),'filters' => array('StringTrim'), 'required' => true))\n , 'meta' => array('text', array('label' => 'meta', 'options' => array('StringLength' => array(false, array(4, 255))), 'filters' => array('StringTrim'),))\n , 'description' => array('textarea',array('label' => 'description', 'attribs' => array('rows' => 2), 'filters' => array('StringTrim'), 'required' => true))\n , 'body' => array('textarea',array('label' => 'body', 'attribs' => array('rows' => 7), 'filters' => array('StringTrim'), 'required' => true))\n );\n $this->addElements($elements);\n\n // --- Groups ----------------------------------------------\n $this->addDisplayGroup(array('name','title', 'meta'), 'display-head', array('legend'=>'display-head'));\n $this->addDisplayGroup(array('description', 'body'), 'display-body', array('legend'=>'display-body'));\n parent::init();\n }", "function metaInit () {\n $this->imageMeta = new ImageMeta($this->getImagePath());\n $this->imageMeta->getMeta();\n }", "public function init() {\n\n // register plugin controller under /gallery/\n DatawrapperHooks::register(DatawrapperHooks::GET_PLUGIN_CONTROLLER, array($this, 'process'));\n\n DatawrapperHooks::register(DatawrapperHooks::ALTERNATIVE_SIGNIN, array($this, 'showTwitterSignInButton'));\n\n $this->checkLogin();\n }", "public function init()\n {\n $this->nameSingular = __('Image', 'modularity');\n $this->namePlural = __('Images', 'modularity');\n $this->description = __('Outputs an image', 'modularity');\n\n add_action('acf/load_field/name=mod_image_size', array($this, 'appendImageSizes'));\n }", "public function initialize() {\n $loadjquery = $this->modx->getOption('sekusergalleries.load_jquery');\n $this->setDefaultProperties(array(\n 'tplDirContainer' => 'directory.container',\n 'tplDirGraph' => 'directory.bargraph',\n 'graphcss' => '',\n 'customcss' => '',\n 'loadjquery' => $loadjquery,\n ));\n\n $this->directory_name = $this->modx->user->get('id');\n }", "private function initMedia($media_id){\n \n if (empty($this->media_id)){\n $this->media_id = $media_id;\n }\n \n if (empty($this->media_params)){\n $this->media_params = $this->getMediaParams($this->media_id);\n }\n \n if (empty($this->media_name)){\n $this->media_name = $this->getMediaName();\n }\n }", "function estate_plus_settings_init(){\n\tsiteorigin_settings_add_field('general', 'footer_attribution', 'checkbox');\n\tsiteorigin_settings_add_field('general', 'logo_retina', 'media');\n\tsiteorigin_settings_add_field('general', 'ajax_comments', 'checkbox');\n\tsiteorigin_settings_add_field('layout', 'responsive', 'checkbox');\n\tsiteorigin_settings_add_field('layout', 'responsive_menu', 'checkbox');\n}", "public function page_init()\n {\n register_setting(\n 'my_option_group', // Option group\n 'linkedin_api_option', // Option name\n array( $this, 'sanitize' ) // Sanitize\n );\n\n add_settings_section(\n 'setting_section_id', // ID\n 'Request Settings', // Title\n array(), // Callback\n 'my-setting-admin' // Page\n );\n\n add_settings_field(\n 'redirect_url', // ID\n 'Redirect URL', // Title\n array( $this, 'redirect_url_callback' ), // Callback\n 'my-setting-admin', // Page\n 'setting_section_id' // Section\n );\n\n add_settings_field(\n 'client_id',\n 'Client ID',\n array( $this, 'client_id_callback' ),\n 'my-setting-admin',\n 'setting_section_id'\n );\n\n add_settings_field(\n 'client_secret',\n 'Client Secret',\n array( $this, 'client_secret_callback' ),\n 'my-setting-admin',\n 'setting_section_id'\n );\n\n add_settings_field(\n 'authorization_code',\n 'Authorization Code For An Access Token',\n array( $this, 'authorization_code_callback' ),\n 'my-setting-admin',\n 'setting_section_id'\n );\n\n add_settings_field(\n 'access_token',\n 'Access Token',\n array( $this, 'access_token_callback' ),\n 'my-setting-admin',\n 'setting_section_id'\n );\n\n }", "protected function init() {\n\t\t$this->load_image_sizes();\n\n\t\t// Set image size to WP\n\t\t$this->add_image_sizes();\n\t}", "public function init() {\n\t\tif(strstr($this->_detect_uri(),'media/')):\n\t\t\trequire_once(BASEPATH.'libraries/Image_lib'.EXT); \n\t\t\trequire_once(APPPATH.'libraries/MY_Image_lib'.EXT);\n\t\t\tinclude APPPATH.'config/config.php';\n\t\t include APPPATH.'config/images.php';\n \n\t\t\t$this->config = $config;\n\t \t$this->resize();\n \tendif;\n\t}", "function wpec_gd_settings_init(){\n\n register_setting( 'social_settings', 'social_settings', 'wpec_validate_options' );\n add_settings_section( 'facebook_section', 'Social Media Configuration', 'social_media_section_text', 'wpec_gd_options' );\n add_settings_field( 'facebook_api_key', 'Facebook Application API ID:', 'facebook_api_id', 'wpec_gd_options', 'facebook_section' );\n add_settings_field( 'facebook_app_secret', 'Faceook Application Secret:', 'facebook_app_secret', 'wpec_gd_options', 'facebook_section' );\n\n\t\n //Register Settings for each email. Arrays of Subject and Body\n register_setting( 'wpec_gd_main_options', 'wpec_gd_options_array', 'wpec_validate_options' );\n register_setting( 'wpec_gd_emails', 'site_owner_tipped', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'site_owner_untipped', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'site_owner_expired', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'business_owner_tipped', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'business_owner_untipped', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'business_owner_expired', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'deal_purchaser_tipped', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'deal_purchaser_untipped', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'deal_purchaser_expired', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'deal_purchaser_new_deal', 'wpec_validate_emails' );\n\n add_settings_section( 'main_section', __( 'Main Settings', 'wpec-group-deals' ), 'wpec_options_intro_text', 'wpec_gd_options' );\n add_settings_section( 'email_templates', __( 'Email Templates', 'wpec-group-deals' ), 'wpec_options_email_intro_text', 'wpec_gd_options' );\n \n add_settings_field( 'gd_api_id', __( 'Group Deals API ID', 'wpec-group-deals' ), 'gd_api_id', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'gd_referral_credit', __( 'Referral Credit', 'wpec-group-deals' ), 'gd_referral_credit', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'gd_logo_upload', __( 'Logo Upload', 'wpec-group-deals' ), 'gd_logo_upload', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_dd_home_image_width', __( 'Group Deal Image Width', 'wpec-group-deals' ), 'wpec_options_img_width', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_dd_home_image_height', __( 'Group Deal Image Height', 'wpec-group-deals' ), 'wpec_options_img_height', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_dd_home_image_crop', __( 'Crop Images?', 'wpec-group-deals' ), 'wpec_options_crop_img', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_paypal_email', __( 'Paypal Email:', 'wpec-group-deals' ), 'wpec_paypal_email', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_default_location', __( 'Default Location:', 'wpec-group-deals' ), 'wpec_default_location', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_default_page', __( 'What page should be used for the Group Deals landing page? NOTE: If you do not have multiple locations to choose from, the popup will not show. Going to the home page will show the featured deal you have created. :', 'wpec-group-deals' ), 'wpec_default_page', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_location_threshold', __( 'When determining a user\\'s location, how wide of a radius should the GeoIP system allow for nearby locations?', 'wpec-group-deals' ), 'wpec_location_threshold', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'gd_mobile_theme', __( 'Mobile Theme?', 'wpec-group-deals' ), 'gd_mobile_theme', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_site_owner_tipped_subject', __( 'Site Owner - Deal Tipped {Subject}', 'wpec-group-deals' ), 'wpec_site_owner_tipped_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_site_owner_tipped_body', __( 'Site Owner - Deal Tipped {Body}', 'wpec-group-deals' ), 'wpec_site_owner_tipped_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_site_owner_untipped_subject', __( 'Site Owner - Deal Untipped {Subject}', 'wpec-group-deals' ), 'wpec_site_owner_untipped_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_site_owner_untipped_body', __( 'Site Owner - Deal Untipped {Body}', 'wpec-group-deals' ), 'wpec_site_owner_untipped_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_site_owner_expired_subject', __( 'Site Owner - Deal Expired {Subject}', 'wpec-group-deals' ), 'wpec_site_owner_expired_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_site_owner_expired_body', __( 'Site Owner - Deal Expired {Body}', 'wpec-group-deals' ), 'wpec_site_owner_expired_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_business_owner_tipped_subject', __( 'Business Owner - Deal Tipped {Subject}', 'wpec-group-deals' ), 'wpec_business_owner_tipped_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_business_owner_tipped_body', __( 'Business Owner - Deal Tipped {Body}', 'wpec-group-deals' ), 'wpec_business_owner_tipped_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_business_owner_untipped_subject', __( 'Business Owner - Deal Untipped {Subject}', 'wpec-group-deals' ), 'wpec_business_owner_untipped_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_business_owner_untipped_body', __( 'Business Owner - Deal Untipped {Body}', 'wpec-group-deals' ), 'wpec_business_owner_untipped_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_business_owner_expired_subject', __( 'Business Owner - Deal Expired {Subject}', 'wpec-group-deals' ), 'wpec_business_owner_expired_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_business_owner_expired_body', __( 'Business Owner - Deal Expired {Body}', 'wpec-group-deals' ), 'wpec_business_owner_expired_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_tipped_subject', __( 'Deal Purchaser - Deal Tipped {Subject}', 'wpec-group-deals' ), 'wpec_deal_purchaser_tipped_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_tipped_body', __( 'Deal Purchaser - Deal Tipped {Body}', 'wpec-group-deals' ), 'wpec_deal_purchaser_tipped_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_untipped_subject', __( 'Deal Purchaser - Deal Untipped {Subject}', 'wpec-group-deals' ), 'wpec_deal_purchaser_untipped_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_untipped_body', __( 'Deal Purchaser - Deal Untipped {Body}', 'wpec-group-deals' ), 'wpec_deal_purchaser_untipped_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_expired_subject', __( 'Deal Purchaser - Deal Expired {Subject}', 'wpec-group-deals' ), 'wpec_deal_purchaser_expired_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_expired_body', __( 'Deal Purchaser - Deal Expired {Body}', 'wpec-group-deals' ), 'wpec_deal_purchaser_expired_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_new_deal_subject', __( 'Deal Purchaser - New Deal {Subject}', 'wpec-group-deals' ), 'wpec_deal_purchaser_new_deal_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_new_deal_body', __( 'Deal Purchaser - New Deal {Body}', 'wpec-group-deals' ), 'wpec_deal_purchaser_new_deal_body', 'wpec_gd_options', 'email_templates' );\n \n }", "public function init(){\n /*you can set initial default values and other stuff here.\n * it's also a good place to register any CSS or Javascript your\n * widget may need. */ \n }", "public function __construct($media)\n {\n $this->media = $media;\n }", "public function page_init()\n {\n register_setting(\n 'mj_groups_fields', // group name\n 'mj_option_theme',\n array($this, 'sanitize') // sanitize\n );\n\n add_settings_section(\n 'section_default',\n '',\n '',\n 'config-theme-options'\n );\n\n foreach ($this->formRenderInputs as $key => $value) {\n add_settings_field(\n $value['args']['atributos']['name'],\n $value['titulo'],\n array($this, 'render_field_input'),\n 'config-theme-options',\n 'section_default',\n array('valores' => $value)\n );\n }\n }", "public function init_form_fields() {\n\t\t$this->form_fields = include( 'data/data-settings.php' );\n\t}" ]
[ "0.6914586", "0.6657351", "0.65713793", "0.640563", "0.63056916", "0.6113042", "0.60895747", "0.603586", "0.59583825", "0.5808742", "0.5768256", "0.5752925", "0.5752597", "0.5745953", "0.5743503", "0.5700099", "0.5679294", "0.56469387", "0.56257886", "0.5623103", "0.5615799", "0.5595002", "0.559311", "0.558901", "0.5586079", "0.55724734", "0.55689675", "0.5566521", "0.553515", "0.5531108" ]
0.86034894
0
Initialize Footer Pages section and fields
private function initializeFooterPages() { $this->ch->addSection($this->slug . '_footer_pages', 'Footer Pages', 140); $this->ch->addPagesControl('footer_privacy_policy', $this->slug . '_footer_pages', 'Privacy Policy Page'); $this->ch->addPagesControl('footer_cookie_policy', $this->slug . '_footer_pages', 'Cookie Policy Page'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function initPageFooter()\n\t{\n\t\tinclude_once('view/main_page_footer.php');\n\t}", "public function defineFooter()\n {\n $this->footer = new Footer();\n }", "public function init() {\n extract($this->data);\n\n $this->data['links'] = $this->addTargetToLinks($links);\n\n if (!isset($this->data['logotypeHref'])) {\n $this->data['logotypeHref'] = \"/\";\n }\n\n if (isset($subfooter['flexDirection'])) {\n $direction = $subfooter['flexDirection'] == 'row' ? 'horizontal' : 'vertical';\n $this->data['directionClass'] = $this->getBaseClass() . '__subfooter--' . $direction;\n }\n\n if (isset($subfooter['alignment'])) {\n $alignment = $subfooter['alignment'] ?? 'flex-start';\n $this->data['alignmentClass'] = $this->getBaseClass() . '__subfooter--align-' . $alignment;\n }\n\n $this->data['displaySubFooter'] = $this->displaySubFooter(\n $subfooterLogotype ?? false,\n $subfooter['content'] ?? false\n );\n }", "public function Footer() {\r\n $this->SetTextColor(0,0,0);\r\n /* insertamos numero de pagina y total de paginas*/\r\n $this->Cell(0, 10, 'Página '.$this->getAliasNumPage().\r\n ' de un total de '.\r\n $this-> getAliasNbPages(),\r\n 0, false, 'C', 0, '', 0, false, 'T', 'M');\r\n $this->SetDrawColor(0,0,0);\r\n /* dibujamos una linea roja delimitadora del pie de página */\r\n $this->Line(15,282,195,282);\r\n\r\n }", "protected function makeFooter()\n {\n }", "public function Footer()\n {\n // Go to 10 cm from bottom\n $this->SetY(-10);\n // Set font to Open Sans\n $this->SetFont('opensans', 'I', 6);\n // Print centered page number with datetime and timezone\n $this->AliasNbPages('{totalPages}');\n // The timezone of the user is retrieved from their Auth0 user's profile if available, otherwise the server time zone is used\n // related to this trello card https://trello.com/c/OjWZzsGA\n $timezone = ($_SESSION['auth0_user']['https://www.boxtribute.com/timezone']) ? $_SESSION['auth0_user']['https://www.boxtribute.com/timezone'] : date_default_timezone_get();\n\n $dt = new DateTime('now', new DateTimeZone($timezone));\n // This is quick fix for an issue with the alignment of footer text as the library incorrectly calculates the text length when template variables {totalPages} are used\n $totalPages = ($_GET['count'] && 0 != $_GET['count']) ? round(intval($_GET['count']) / 2) : 1;\n $this->Cell(0, 10, 'Page '.$this->PageNo().' of '.$totalPages.' Printed on '.$dt->format('d-m-Y H:i:s').\" {$timezone}\", 0, 0, 'C');\n }", "function Footer()\n\t{\n\t\t//$this->Image('../imagenes/pie.jpg',15,250,170);\n\t\t$this->AliasNbPages();\n\t\t$this->SetY(-23);\n\t\t\n\t\t$this->SetFont('Arial','B',9);\n\t\t$this->MultiCell(180,5,utf8_decode(''),'0','C');\n\t\t\n\t $this->SetFont('Arial','I',8);\n\t $this->Cell(0,7,'Pag. '.$this->PageNo().' / {nb}',0,1,'C');\n\t}", "function Footer() {\n $this->SetY(-15);\n // Arial italic 8\n $this->SetFont('Arial', 'I', 10);\n // Text color in gray\n $this->SetTextColor(128);\n // Page number\n $this->Cell(0, 10, 'Page ' . $this->PageNo(), 0, 0, 'C');\n }", "function Footer()\n\t\t{\n\t\t}", "function Footer() {\n $this->SetY(-15);\n //Pilih font Arial italic 8\n $this->SetFont('Helvetica', 'I', 8);\n //Tampilkan nomor halaman rata tengah\n $this->Cell(0, 10, 'Page ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');\n }", "public function Footer() {\n $this->SetY(-15);\n // Arial italic 8\n $this->SetFont('Arial', 'I', 8);\n // Text color in gray\n $this->SetTextColor(128);\n // Page number\n $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');\n }", "abstract protected function footer();", "abstract protected function footer();", "function Footer()\n\t\t\t\t{\n\t\t\t\t\t$this->SetY(-15);\n\t\t\t\t\t//Arial italic 8\n\t\t\t\t\t$this->SetFont('Helvetica','I',8);\n\t\t\t\t\t//Page number\n\t\t\t\t\t$this->Cell(0,10,'Page '.$this->PageNo().'/'.$comp_name,'T',0,'C');\n\t\t\t\t\t$this->SetDrawColor(8, 102, 198);\n\t\t\t\t\tparent::Footer();\n\t\t\t\t}", "public function Footer() {\n $this->SetY(-15);\n // Set font\n $this->SetFont('helvetica', 'I', 8);\n // Page number\n $this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');\n }", "protected function footer()\n {\n\n }", "function set_footer() {\r\n $args = func_get_args();\r\n $this->footer = $this->_prep_args($args);\r\n }", "function Footer()\n {\n date_default_timezone_set('UTC+1');\n //Date\n $tDate = date('F j, Y, g:i:s a');\n // Position at 1.5 cm from bottom\n $this->SetY(-15);\n // Arial italic 8\n $this->SetFont('Arial', 'I', 12);\n // Text color in gray\n $this->SetTextColor(128);\n // Page number\n $this->Cell(0, 10,utf8_decode('Page ' . $this->PageNo().' \n CHUYC \n '.$tDate.'\n +237 693 553 454\n '.$this->Image(SITELOGO, 189, 280, 10, 10,'', URLROOT)), 0, 0, 'L');\n }", "public function footer()\n {\n }", "function Footer(){\n\t\t// Positionnement à 1,5 cm du bas\n\t\t$this->SetY(-15);\n\t\t// Police Arial italique 8\n\t\t$this->SetFont('Arial','I',8);\n\t\t// Numéro de page\n\t\t$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');\n\t}", "function Footer()\n {\n $this->SetY(-15);\n // Police Arial italique 8\n $this->SetFont('Arial','I',6);\n // Num?ro de page\n $this->Cell(0,8,'Page '.$this->PageNo().'/{nb}',0,0,'C');$this->Ln(3);\n $this->Cell(0,8,\"Algerian Gulf Life Insurance Company, SPA au capital social de 1.000.000.000 de dinars algériens, 01 Rue Tripoli, Hussein Dey Alger, \",0,0,'C');\n $this->Ln(2);\n $this->Cell(0,8,\"RC : 16/00-1009727 B 15 NIF : 001516100972762-NIS :0015160900296000\",0,0,'C');\n $this->Ln(2);\n $this->Cell(0,8,\"Tel : +213 (0) 21 77 30 12/14/15 Fax : +213 (0) 21 77 29 56 Site Web : www.aglic.dz \",0,0,'C');\n }", "function Footer() {\r\n\t\t\t$this->SetY( -15 );\r\n\t\t\t\r\n\t\t\t//set font to Arial, Bold, size 10\r\n\t\t\t$this->SetFont( 'Arial', 'B', 10 );\r\n\t\t\t\r\n\t\t\t//set font color to blue\r\n\t\t\t$this->SetTextColor( 52, 98, 185 );\r\n\t\t\t\r\n\t\t\t$this->Cell( 0, 10, 'www.iFadey.com', 0, 0, 'L' );\r\n\t\t\t\r\n\t\t\t//set font color to gray\r\n\t\t\t$this->SetTextColor( 150, 150, 150 );\r\n\t\t\t\r\n\t\t\t//write Page No\r\n\t\t\t$this->Cell( 0, 10, 'Page No: ' . $this->PageNo(), 0, 0, 'R' );\r\n\t\t}", "function __construct($page = '', $out_of = '/') {\n parent::__construct();\n $this->footerPage = $page;\n $this->footerOutOf = $out_of;\n }", "function opinionstage_settings_load_footer(){\n}", "function Footer()\r\n {\r\n }", "public function Footer() {\n\t\t$this->SetY(-15);\n\t\t// Set font\n\t\t$this->SetFont('helvetica', 'I', 8);\n\t\t// Page number\n\t\t$this->Cell(0, 10, 'Pagina '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');\n\t}", "public function getFooter();", "public function getFooter();", "function Footer() {\n $this->SetY(-15);\n // Select Arial italic 8\n $this->SetFont('Arial','I',8);\n // Print centered page number\n // $this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');\n $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');\n }", "function Footer()\n {\n $this->SetY(-15);\n // Arial italic 8\n $this->SetFont('Arial','I',8);\n // Page number\n $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');\n }" ]
[ "0.775897", "0.7186598", "0.6756386", "0.6712379", "0.6600335", "0.64397335", "0.6398717", "0.6383972", "0.6381415", "0.6379001", "0.63590825", "0.6307993", "0.6307993", "0.63023746", "0.62960213", "0.62868977", "0.62543774", "0.625065", "0.62491083", "0.62425166", "0.6223854", "0.6219697", "0.6215041", "0.62117934", "0.62075245", "0.62021273", "0.6199482", "0.6199482", "0.61964464", "0.61853015" ]
0.8284984
0
This function will prepare all Admin functionality for the plugin
static function prepare() { // Check that we are in the admin area if (is_admin()) : // Add the sidebar Menu structure add_action('admin_menu', array('ProjectenPlugin_AdminController', 'addMenus')); endif; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function admin_setup()\n\t{\n\t\t\n\t}", "private function define_admin_hooks() {\n\t\t$plugin_admin = new Soisy_Pagamento_Rateale_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n $this->loader->add_filter( 'woocommerce_payment_gateways', $plugin_admin, 'payment_methods' );\n\t\t\n $this->loader->add_filter( 'soisy_settings', $plugin_admin, 'soisy_vars' );\n\t\t\n\t\t$this->loader->add_filter('plugin_action_links', $plugin_admin,'add_soisy_action_links', 10, 2);\n\t\t\n\t\t/*\n\t\t * Payments Gateways extend WC_Payment_Gateway\n\t\t * To have them work properly they must be hooked to 'plugins_loaded'\n\t\t */\n add_action( 'plugins_loaded', 'init_Soisy_Pagamento_Rateale_Gateway_Settings');\n\t}", "public function admin_init() {}", "private function define_admin_hooks() {\n\t\t$plugin_admin = new MySuperCalendar_Admin( $this->get_plugin_name() );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\t\t$this->loader->add_action( 'init', $plugin_admin, 'register_Calendar_post_type' );\n\t\t$this->loader->add_action( 'add_meta_boxes', $plugin_admin, 'add_datepicker_meta_box' );\n\t\t$this->loader->add_action( 'save_post', $plugin_admin, 'save_calendar_post' );\n\t\t$this->loader->add_action( 'admin_menu', $plugin_admin, 'register_plugin_menu_page' );\n\n\n\t}", "private function define_admin_hooks() {\n\n\t\t$plugin_admin = MailChimp_WooCommerce_Admin::instance();\n\n\t\t$this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles');\n\t\t$this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts');\n\n\t\t// Add menu item\n\t\t$this->loader->add_action('admin_menu', $plugin_admin, 'add_plugin_admin_menu');\n\n\t\t// Add Settings link to the plugin\n\t\t$plugin_basename = plugin_basename( plugin_dir_path( __DIR__ ) . $this->plugin_name . '.php');\n\t\t$this->loader->add_filter('plugin_action_links_' . $plugin_basename, $plugin_admin, 'add_action_links');\n\n\t\t// make sure we're listening for the admin init\n\t\t$this->loader->add_action('admin_init', $plugin_admin, 'options_update');\n\n\t\t// put the menu on the admin top bar.\n\t\t//$this->loader->add_action('admin_bar_menu', $plugin_admin, 'admin_bar', 100);\n\n $this->loader->add_action('plugins_loaded', $plugin_admin, 'update_db_check');\n $this->loader->add_action('admin_init', $plugin_admin, 'setup_survey_form');\n $this->loader->add_action('admin_footer', $plugin_admin, 'inject_sync_ajax_call');\n\n // update MC store information when woocommerce general settings are saved\n $this->loader->add_action('woocommerce_settings_save_general', $plugin_admin, 'mailchimp_update_woo_settings');\n \n // update MC store information if \"WooCommerce Multi-Currency Extension\" settings are saved\n if ( class_exists( 'WOOMULTI_CURRENCY_F' ) ) {\n $this->loader->add_action('villatheme_support_woo-multi-currency', $plugin_admin, 'mailchimp_update_woo_settings');\n }\n }", "public static function init()\n\t{\n\t\tif ( get_option( 'Activated_Plugin' ) == 'jh-data-tables' ) \n\t\t{\n\t\t\tdelete_option( 'Activated_Plugin' );\n\n\t\t\t// eg. flush the perma-link structure\n\t\t\tglobal $wp_rewrite;\n\t \t\t$wp_rewrite->flush_rules( true );\n\t\t}\n\t\t\n\t\twp_register_style( 'jh-data-tables-admin-css', plugins_url('admin.css', __FILE__) );\n\t\twp_register_script( 'jh-data-tables-ui-util-js', plugins_url('ui-util.js', __FILE__) );\n\t\twp_register_script( 'jh-data-tables-admin-js', plugins_url('admin.js', __FILE__) );\n\t\twp_register_script( 'jh-data-tables-tinymce-js', plugins_url( 'tinymce/tinymce.min.js', __FILE__) );\n\t\tadd_action( 'admin_enqueue_scripts', array('JHDataTablesAdmin', 'admin_scripts') );\n\t\t\n\t\tadd_action( 'add_meta_boxes', array('JHDataTablesAdmin', 'add_table_editor') );\n\t\tadd_action( 'save_post', array('JHDataTablesAdmin', 'save_table') );\n\t\t//add_action('admin_menu', array('JHDataTablesAdmin', 'add_admin_menus'));\n\t}", "private function define_admin_hooks()\n {\n\n $plugin_admin = new myFOSSIL_Resources_Admin( $this->get_plugin_name(),\n $this->get_version() );\n\n $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin,\n 'enqueue_styles' );\n $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin,\n 'enqueue_scripts' );\n\n\t\t$this->loader->add_action( 'admin_menu', $plugin_admin, 'register_menus' );\n\n /* Custom Post Types */\n $this->loader->add_action( 'init', $plugin_admin, 'create_events' );\n\n /* AJAX */\n $this->loader->add_action( 'wp_ajax_myfossil_resources_load_data', $plugin_admin,\n 'ajax_handler' );\n\n /* Advanced Custom Fields */\n\t\t$this->loader->add_filter( 'acf/settings/path', $plugin_admin, 'acf_settings_path' );\n\t\t$this->loader->add_filter( 'acf/settings/dir', $plugin_admin, 'acf_settings_dir' );\n add_filter('acf/settings/show_admin', '__return_false');\n }", "private function define_admin_hooks() {\n\n\t\t$plugin_admin = new APS_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\n\t}", "function adminer_object() {\n include_once \"./plugins/plugin.php\";\n \n // autoloader\n foreach (glob(\"plugins/*.php\") as $filename) {\n include_once \"./$filename\";\n }\n\n $plugins = array(\n // specify enabled plugins here\n\t\tnew AdminerDumpZip,\n new AdminerTinymce,\n new AdminerFileUpload(PHPLM_UPLOADS),\n new AdminerSlugify,\n new AdminerTranslation,\n new AdminerForeignSystem,\n\t\tnew AdminerEditCalendar,\n\t\tnew AdminerLoginTable(PHPLM_DBNAME),\n# new AdminerDumpXml,\n#\t\tnew AdminerTablesFilter,\n#\t\tnew AdminerEditForeign,\n );\n\n // Combine customization and plugins:\n\n class AdminerCustomization extends AdminerPlugin {\n\n\t\t// Ref: http://sourceforge.net/p/adminer/discussion/960417/thread/647c8b5c/#103c\n\t\tvar $operators = array(\"=\", \"<=\", \">=\");\n\n\t\tfunction name() {\n\t\t\t// custom name in title and heading\n\t\t\treturn PHPLM_NAME;\n\t\t}\n\t\t\n\t\tfunction permanentLogin() {\n\t\t // key used for permanent login\n\t\t return PHPLM_PERMKEY;\n\t\t}\n\t\t\n\t\tfunction credentials() {\n\t\t // server, username and password for connecting to database\n\t\t return array(PHPLM_DBHOST, PHPLM_DBUSER, PHPLM_DBPASS);\n\t\t}\n\t\t\n\t\tfunction database() {\n\t\t // database name, will be escaped by Adminer\n\t\t return PHPLM_DBNAME;\n\t\t}\n\n\t\tfunction tableName($tableStatus) {\n\t\t\t// tables without comments would return empty string and will be ignored by Adminer\n\t\t\t$allowed_tables = Array('balances', 'designations', 'employees', 'leaves');\n\t\t\tif (in_array($tableStatus[\"Name\"], $allowed_tables))\n\t\t\t\treturn h($tableStatus[\"Comment\"]);\n\t\t\telse \n\t\t\t\treturn '';\n\t\t\t}\n\n\t\tfunction fieldName($field, $order = 0) {\n\t\t\tif ($order && preg_match('~_(md5|sha1)$~', $field[\"field\"])) {\n\t\t\t\treturn \"\"; // hide hashes in select\n\t\t\t}\n\n\t\t\t// Hide AutoInc Primary keys during Insert\n\t\t\tif (isset($_GET['edit'])) {\n\t\t\t\t$hidePKfields = Array(\n\t\t\t\t\tArray('htable' => 'employees', 'hfield' => 'EmployeeID')\n\t\t\t\t , Array('htable' => 'leaves', 'hfield' => 'LeaveID')\n\t\t\t\t);\n\t\t\t\tforeach ($hidePKfields as $val) {\n\t\t\t\tif ($_GET['edit'] == $val['htable'] && $field['field'] == $val['hfield'] && !isset($_GET['where'][$val['hfield']]))\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// display only column with comments, first 60 of them plus searched columns\n\t\t\tif ($order < 60) {\n\t\t\t\treturn h($field[\"comment\"]);\n\t\t\t}\n\t\t\tforeach ((array) $_GET[\"where\"] as $key => $where) {\n\t\t\t\tif ($where[\"col\"] == $field[\"field\"] && ($key >= 0 || $where[\"val\"] != \"\")) {\n\t\t\t\t\treturn h($field[\"comment\"]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn \"\";\n\t\t}\n\n\t\tfunction selectLimitProcess() {\n return (isset($_GET[\"limit\"]) ? $_GET[\"limit\"] : PHPLM_PAGEDEFRECS);\n }\n\n function selectLimitPrint($limit) {\n echo \"<fieldset><legend>\" . lang('Limit') . \"</legend><div>\"; // <div> for easy styling\n echo html_select(\"limit\", explode('|', PHPLM_PAGERECS), $limit);\n echo \"</div></fieldset>\\n\";\n }\n\n\t\tfunction selectLink($val, $field) {\n\t\t\tif ($field['field'] == 'LeaveID' && $_GET['select'] == 'leaves' && $val !== NULL)\n\t\t\t\treturn 'leave_summary.php?select=leaves&leaveid='.$val;\n\t\t}\n\n }\n return new AdminerCustomization($plugins);\n\n}", "private function admin_hooks() {\n\t\t\n\t\t// Actions\n\t\t// Load Nav injection\n\t\t$this->add_action ('admin_menu', $this->nav, 'plugin_menu' );\n\t\t\n\t\t// Load Dashboard widget\n\t\t$this->add_action ('wp_dashboard_setup', $this->admin, 'dashboard');\n\t\t\n\t\t// Load Edit Post additions\n\t\t// $this->add_action ('add_meta_boxes', $this->admin, 'post_edit' );\n\n\t\t// Load social toggles on submitbox, if the setting is available\n\t\t// if (get_option('smmp_view_submitbox'))\n\t\t//\t$this->add_action ('post_submitbox_misc_actions', $this->admin, 'admin_post_submitbox' );\n\t\t\n\t\t// On post update/save\n\t\t// $this->add_action ('save_post', $this->admin, 'admin_post_submitbox_submit');\n\t\t\n\t\t\n\t\t// Load Expired Account notice\n\t\t/*try {$this->admin->validate_accounts (); }\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$this->add_action ('admin_notices', $this->admin, 'notice_accounts' );\n\t\t}*/\n\t\t\n\t\t// Filters\n\t\t// Prevent inner links for flow-drive images\n\t\t$this->add_action ('image_downsize', $this->admin, 'filter_image_downsize', 10, 3);\n\t}", "public function setup() {\n\n\t\tadd_filter( 'udb_ms_admin_bar_saved_menu', array( self::get_instance(), 'ms_get_saved_menu' ) );\n\t\tremove_action( 'admin_bar_menu', array( Admin_Bar_Output::get_instance(), 'menu_output' ), 1010 );\n\t\tadd_action( 'admin_bar_menu', array( self::get_instance(), 'menu_output' ), 1015 );\n\n\t}", "public function admin_init () {\n $data = get_plugin_data(__FILE__);\n $this->plugin_name = $data['Name'];\n $this->plugin_version = $data['Version'];\n $this->plugin_slug = plugin_basename(__FILE__, '.php');\n $this->plugin_name_sanitized = basename(__FILE__, '.php');\n\n // init updater class to plugin updates check\n $this->updater();\n }", "function admin_init()\n {\n }", "public function admin_init() {\n $this->add_actions();\n $this->apply_editor_wrap();\n $this->activate_builder_callbacks();\n }", "public function admin_init(){\n\n\t}", "private function define_admin_hooks() {\n\n\t\t$plugin_admin = new Service_Tracker_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'localize_scripts' );\n\n\t\t$this->loader->add_action( 'admin_menu', $plugin_admin, 'admin_page' );\n\n\t}", "private function dc_define_admin_hooks() {\n\n\t\t$plugin_admin = new Dorancafe_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'dc_enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'dc_enqueue_scripts' );\n\n\t}", "public function admin_init() {\n //register settings sections\n foreach ( $this->settings_sections as $tab_key => $sections ) {\n foreach ($sections as $section){\n if ( false == get_option( $this->get_option_prefix($section['id']) ) ) {\n add_option( $this->get_option_prefix($section['id']) );\n }\n\n if ( isset($section['desc']) && !empty($section['desc']) ) {\n $section['desc'] = '<div class=\"inside\">'.$section['desc'].'</div>';\n $callback = function () use($section) {\n echo str_replace('\"', '\\\"', $section['desc']);\n };\n } else if ( isset( $section['callback'] ) ) {\n $callback = $section['callback'];\n } else {\n $callback = null;\n }\n\n add_settings_section( $section['id'], $section['title'], $callback, $tab_key );\n }\n }\n\n //register settings fields\n foreach ( $this->settings_fields as $tab_key => $sections ) {\n foreach ($sections as $section_key => $field ) {\n foreach ($field as $field_args) {\n\n $args = $this->set_default_field_args( $field_args, $tab_key, $section_key );\n\n if ($args['global'] === true) {\n register_setting($tab_key, $args['name_id'], (is_callable($args['sanitize_callback'])) ? $args['sanitize_callback'] : false);\n }\n\n add_settings_field($args['name_id'], $args['label'], array($this, 'callback_' . $args['type']), $tab_key, $section_key, $args);\n\n if ($args['sub_fields']) {\n\n foreach ( $args['sub_fields'] as $sub_field_args ) {\n $sub_field_args['parent'] = $args;\n $sub_args = $this->set_default_field_args( $sub_field_args, $tab_key, $section_key );\n\n add_settings_field($sub_args['name_id'], $sub_args['label'], array($this, 'callback_' . $sub_args['type']), $tab_key, $section_key, $sub_args);\n }\n\n }\n }\n }\n }\n\n // creates our settings in the options table\n foreach ( $this->settings_sections as $tab_key => $sections ) {\n foreach ($sections as $section) {\n register_setting( $tab_key, $this->get_option_prefix( $section['id'] ), array( $this, 'sanitize_options' ) );\n }\n }\n\n }", "function initPlugin()\n {\n $this->getAdminOptions();\n }", "public function admin_init(){\n\t\t\t/* Add theme update data */\n\t\t\tif('plugin' !== $this->config['type']){\n\t\t\t\tadd_filter('pre_set_site_transient_update_themes', array($this, 'add_theme_update_data'), 10, 2);\n\t\t\t}\n\t\t\t/* Add plugin update data */\n\t\t\tif('theme' !== $this->config['type']){\n\t\t\t\tadd_filter('pre_set_site_transient_update_plugins', array($this, 'add_plugin_update_data'), 10, 2);\n\t\t\t}\n\t\t\t/* Plugin Information */\n\t\t\tif('theme' !== $this->config['type']){\n\t\t\t\tadd_filter('plugins_api_result', array($this, 'plugin_info'), 10, 3);\n\t\t\t}\n\t\t}", "private function define_admin_hooks() {\n\n $admin = new Online_Magazine_Manager_Admin( $this->version );\n\n $this->loader->add_action( 'admin_menu', $admin, 'register_admin_menu' );\n $this->loader->add_action( 'init', $admin, 'register_issue_post_type' );\n $this->loader->add_action( 'init', $admin, 'register_issue_article_post_type' );\n $this->loader->add_action( 'init', $admin, 'init_rewrite_rules' );\n $this->loader->add_action( 'parent_file', $admin, 'taxonomy_submenu_correction' );\n\n }", "private function define_admin_hooks() {\n\n\t\t$plugin_admin = new Admin_Hook( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\n\t}", "function init_plugin() : void {\n\n\t// CSS/JS.\n\tadd_action( 'enqueue_block_assets', __NAMESPACE__ . '\\load_block_frontend_assets' );\n\tadd_action( 'enqueue_block_editor_assets', __NAMESPACE__ . '\\load_block_editor_assets' );\n\tadd_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\load_full_assets' );\n\tadd_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\load_messaging_assets' );\n\n\t// Admin-only CSS/JS.\n\tadd_action( 'admin_enqueue_scripts', __NAMESPACE__ . '\\Admin\\load_admin_assets' );\n\tadd_filter( 'admin_body_class', __NAMESPACE__ . '\\Admin\\add_admin_body_class' );\n\n\t// Modify output.\n\tadd_filter( 'body_class', __NAMESPACE__ . '\\add_body_class' );\n\tadd_filter( 'the_content', __NAMESPACE__ . '\\Gating\\maybe_restrict_content' );\n\tadd_filter( 'the_title', __NAMESPACE__ . '\\Gating\\maybe_add_padlock_to_title', 10, 2 );\n\tadd_action( 'wp_head', __NAMESPACE__ . '\\print_meta_tag' );\n\n\t// Admin screens and settings.\n\tadd_filter( 'plugin_action_links_coil-web-monetization/plugin.php', __NAMESPACE__ . '\\Admin\\add_plugin_action_links' );\n\tadd_filter( 'plugin_row_meta', __NAMESPACE__ . '\\Admin\\add_plugin_meta_link', 10, 2 );\n\tadd_action( 'admin_menu', __NAMESPACE__ . '\\Settings\\register_admin_menu' );\n\tadd_action( 'admin_init', __NAMESPACE__ . '\\Settings\\register_admin_content_settings' );\n\tadd_action( 'admin_notices', __NAMESPACE__ . '\\Settings\\admin_welcome_notice' );\n\tadd_action( 'wp_ajax_dismiss_welcome_notice', __NAMESPACE__ . '\\Settings\\dismiss_welcome_notice' );\n\n\t// Term meta.\n\tadd_action( 'edit_term', __NAMESPACE__ . '\\Admin\\maybe_save_term_meta', 10, 3 );\n\tadd_action( 'create_term', __NAMESPACE__ . '\\Admin\\maybe_save_term_meta', 10, 3 );\n\tadd_action( 'delete_term', __NAMESPACE__ . '\\Admin\\delete_term_monetization_meta' );\n\tadd_term_edit_save_form_meta_actions();\n\n\t// Customizer settings.\n\tadd_action( 'customize_register', __NAMESPACE__ . '\\Admin\\add_customizer_messaging_panel' );\n\tadd_action( 'customize_register', __NAMESPACE__ . '\\Admin\\add_customizer_options_panel' );\n\tadd_action( 'customize_register', __NAMESPACE__ . '\\Admin\\add_customizer_learn_more_button_settings_panel' );\n\n\t// User profile settings.\n\tadd_action( 'personal_options', __NAMESPACE__ . '\\User\\add_user_profile_payment_pointer_option' );\n\tadd_action( 'personal_options_update', __NAMESPACE__ . '\\User\\maybe_save_user_profile_payment_pointer_option' );\n\tadd_action( 'edit_user_profile_update', __NAMESPACE__ . '\\User\\maybe_save_user_profile_payment_pointer_option' );\n\tadd_filter( 'option_coil_payment_pointer_id', __NAMESPACE__ . '\\User\\maybe_output_user_payment_pointer' );\n\n\t// Metaboxes.\n\tadd_action( 'load-post.php', __NAMESPACE__ . '\\Admin\\load_metaboxes' );\n\tadd_action( 'load-post-new.php', __NAMESPACE__ . '\\Admin\\load_metaboxes' );\n\tadd_action( 'save_post', __NAMESPACE__ . '\\Admin\\maybe_save_post_metabox' );\n\n\t// Modal messaging\n\tadd_action( 'wp_footer', __NAMESPACE__ . '\\load_plugin_templates' );\n\n\t// Load order - important.\n\tadd_action( 'init', __NAMESPACE__ . '\\Gating\\register_content_meta' );\n\tadd_action( 'init', __NAMESPACE__ . '\\Gating\\register_term_meta' );\n}", "private function define_admin_hooks() {\n\t\t$plugin_admin = new TTR66_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t// Add the TTR66 dash widget and XML upload page/menu\n\t\t$this->loader->add_action( 'wp_dashboard_setup', $plugin_admin, 'add_dashboard_widget');\n\t\t$this->loader->add_action( 'admin_menu', $plugin_admin, 'register_custom_menu_page' );\n\t}", "function _actions() {\n // adpress Specific filters\n //\n add_filter($this->prefix.\"MetaValue\", array(&$this->Admin_actions, 'getMetaValue'),1,2);\n add_filter($this->prefix.\"Render\", array(&$this->UI, \"render_shortcode\"),1,1);\n add_filter($this->prefix.\"Change Destination\", array(&$this->Admin_actions, 'processDestination'), 1, 2);\n add_filter($this->prefix.\"Settings\", array($this->Admin_actions, 'settings'), 1, 1);\n\n // adpress Specific actions\n //\n add_action($this->prefix.\"ProPack\", array(&$this->Admin_actions, 'propack'));\n \n // Regular Actions\n //\n add_action('init' ,array(&$this->Actions,'init') );\n add_action('widgets_init' ,create_function( '', 'register_widget( \"adpressWidget\" );'));\n\n // Admin Actions\n //\n add_action('admin_init' ,array(&$this->Admin_actions,'admin_init') );\n add_action('admin_print_styles' ,array(&$this->Admin_actions,'admin_print_styles') );\n add_action('manage_posts_custom_column' ,array(&$this->Admin_actions,'manage_posts_custom_column'));\n add_action('save_post' ,array(&$this->Admin_actions,'save_post') );\n\n // Mobile Listener\n //\n add_action('wp_ajax_csl_get_ads' , array(&$this->Mobile, 'GetAds') );\n add_action('wp_ajax_nopriv_csl_get_ads' , array(&$this->Mobile, 'GetAds') );\n add_action('wp_ajax_license_reset_propack' , array(&$this->Mobile, 'license_reset_propack'));\n add_action('wp_ajax_nopriv_license_reset_propack' , array(&$this->Mobile, 'license_reset_propack'));\n\n // Admin Filters\n //\n add_filter('manage_edit-adpress_ad_columns',array(&$this->Admin_Filters, 'adpress_ad_columns'));\n\n // Short Codes\n //\n add_shortcode('adpress' ,array(&$this->UI,'render_shortcode') );\n add_shortcode('ADPRESS' ,array(&$this->UI,'render_shortcode') );\n add_shortcode('AdPress' ,array(&$this->UI,'render_shortcode') );\n add_shortcode('Adpress' ,array(&$this->UI,'render_shortcode') );\n\n // Text Domains\n //\n load_plugin_textdomain($this->prefix, false, $this->base_name . '/languages/');\n }", "public function setup() {\n $this->min_level = apply_filters( 'brg/ptt/minimum_user_level', 'activate_plugins' );\n\n add_filter( 'brg/posts_with_templates', array( $this, 'post_types_with_templates' ), 10, 1 );\n\n $this->admin_controller = new BRG_PTT_Admin_Interface_Controller( $this->min_level );\n $this->template_loader = new BRG_Template_Loader(); \n\n // setup the template post type\n $this->setup_posttype();\n }", "public function admin_init() {\n\n\t\t\t$name = $this->options['slug'];\n\t\t\t$this->slug = strtolower(THEME_NAME.'_'.$name);\n\t\t\n\t\t\tadd_option($this->slug.'_fields', '', '', 'yes');\n\t\t\tupdate_option($this->slug.'_fields', $this->options['options']);\n\n\t\t\tadd_action('post_edit_form_tag', array($this, 'set_form_multipart'), 10, 1);\n\t\t\tadd_action('add_meta_boxes'.'_'.$this->screen, array($this, 'register_meta_box'));\n\t\t}", "private function define_admin_hooks() {\n\n\t\t//$theme_admin = new Wpt_Custom_Theme_Admin( $this->get_theme_name(), $this->get_version() );\n\n\t\t//$this->loader->add_action( 'admin_enqueue_scripts', $theme_admin, 'enqueue_styles' );\n\n\t}", "public function initializeAdminPanel() {}", "private function define_admin_hooks()\n {\n $this->loader->add_action('init',$this,'load_options');\n $this->loader->add_action('plugins_loaded','WordPress_Reactro_Admin', 'load_framework');\n }" ]
[ "0.72996587", "0.72607803", "0.72564346", "0.7247739", "0.71733993", "0.71392965", "0.71230614", "0.71088505", "0.70533216", "0.70327485", "0.70326614", "0.7030546", "0.7029993", "0.7004105", "0.6997376", "0.6955343", "0.6923973", "0.6889962", "0.6889035", "0.68272746", "0.6816067", "0.67397726", "0.67082065", "0.6693596", "0.6678008", "0.6676656", "0.66645736", "0.6664059", "0.66594493", "0.66557795" ]
0.7788519
0
Create meta data entry
function createMetaData() { parent::createMetaData(); $this->saveAuthorToMetadata(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_metadata($meta_type, $object_id, $meta_key, $meta_value, $unique = \\false)\n {\n }", "function wp_create_initial_post_meta()\n {\n }", "function createAtomEntry() {\n\t\t$this->create();\n\t}", "public function add_meta( $key, $value, $unique = false );", "protected function save_meta() {}", "public function createMeta($key, $value): void\n {\n /** @var HasMetadataInterface $this */\n $exists = Meta::metable(static::class, $this->id)\n ->where('key', $key)->exists();\n\n if ($exists) {\n $message = \"Can't create meta (key: $key). \";\n $message .= \"Meta already exists\";\n throw new \\Exception($message);\n }\n\n $meta = new Meta;\n\n $meta->key = $key;\n $meta->value = $value;\n\n $this->meta()->save($meta);\n }", "function add_post_meta($term_id, $taxonomy, $meta_key, $meta_value, $unique = false) {\n\n return add_metadata('post', $post_id, $meta_key, $meta_value, $unique);\n}", "function add_post_meta($post_id, $meta_key, $meta_value, $unique = \\false)\n {\n }", "protected function MetaAfterCreate() {\n\t\t}", "public function create($newmeta) {\n\t\tif ($this->req ['auth_type'] == 'oauth') {\n\t\t\tif (is_string ( $newmeta ) && isset ( $_POST ['properties'] ) && is_object ( json_decode ( $_POST ['properties'] ) )) {\n\t\t\t\tif ($this->isCreateable ()) {\n\t\t\t\t\t// @TODO\n\t\t\t\t\t// Need to convert because there is an old structure\n\t\t\t\t\t$aMetavalues = array ();\n\t\t\t\t\tforeach ( json_decode ( $_POST ['properties'] ) as $sName => $sValue ) {\n\t\t\t\t\t\tarray_push ( $aMetavalues, array ('name' => $sName, 'value' => $sValue ) );\n\t\t\t\t\t}\n\t\t\t\t\tif (count ( $aMetavalues ) <= 150) {\n\t\t\t\t\t\t$iPrimaryMeta = ( int ) $this->oMetas->insertMeta ( array ('name' => $newmeta, 'accounts_idaccount' => $this->usr, 'namespaces_idnamespace' => $this->req ['request'] ['ns'] ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (( int ) $iPrimaryMeta > 0 && count ( $aMetavalues ) > 0) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($this->setUsage ( $this->usr, array ('maxmetas' => 1 ) )) {\n\t\t\t\t\t\t\t\tif ($this->oMetavalue->insertValue ( $aMetavalues, $iPrimaryMeta )) {\n\t\t\t\t\t\t\t\t\t$this->addEntry ( 'response', array ('message' => 'Metaitem was created', 'meta' => $iPrimaryMeta ) );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'META_BUDGET_LIMIT_REACHED' ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'META_EXISTS' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'TO_MUCH_PROPERTYS' ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'OAUTH_ONLY' ) );\n\t\t}\n\t\treturn $this->getResponse ();\n\t}", "public function createFromPost($info)\n\t{\n\t\t//task info\n\t\tif (isset($_SESSION['userid'])) $this->userid = $_SESSION['userid'];\n\t\t\n\t\tif (isset($info['title'])) $this->title = $info['title'];\n\t\t\n\t\tif (isset($info['description'])) $this->description = $info['description'];\n\t\t\n\t\tif (isset($info['content'])) $this->content = $info['content'];\n\t\t\n\t\tif (isset($info['location'])) $this->location = $info['location'];\n\t\t\n\t\tif (isset($info['price'])) $this->price = $info['price'];\n\t\t\n\t\t//metadata\n\t\tif (isset($info['category'])) $this->category = $info['category'];\n\t\t\n\t\tif (isset($info['tags'])) $this->tags = $info['tags'];\n\t\t\n\t\tif (isset($info['numimg'])) $this->numimg = $info['numimg'];\n\t\t\n\t\tif (isset($info['enddatetime'])) $this->enddatetime = $info['enddatetime'];\n\t}", "public function run()\n {\n \n $metadata = Metadata::create([\n 'title' => '', \n 'author'=>'Sistema'\n ]);\n }", "public static function meta();", "public function create()\n {\n return view('backend.meta.create');\n }", "protected function make() {\n\n\t\tif ( ! is_null( $this->tag ) && isset( self::$aliases[ $this->tag ] ) ) {\n\t\t\t$this->set( 'key', self::$aliases[ $this->tag ] );\n\t\t}\n\n\t\t// Set Template\n\t\tif ( false !== $this->attributes['label'] ) {\n\t\t\t$template = 'shortcodes/metadata-label.php';\n\t\t} else {\n\t\t\t$template = 'shortcodes/metadata.php';\n\t\t}\n\n\t\t$this->template = new Template( $template );\n\t}", "function meta($name, $content=\"\") {\n\t\t$this->metas[] = array('name' => $name, 'content' => $content);\n\t}", "function createEmployeeMetaData( Request $request )\n\t\t\t{\n\t\t\t\tif ( $this->employeeExists( $request->emp_id ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$employee_meta = new EmployeeMeta();\n\n\t\t\t\t\t\t$employee_meta->status = empty( $request->status ) ? 0 : 1;\n\t\t\t\t\t\t$employee_meta->employee_id = $request->emp_id;\n\t\t\t\t\t\t$employee_meta->address = $request->address;\n\t\t\t\t\t\t$employee_meta->contact = $request->contact;\n\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$result = $employee_meta->save();\n\n\t\t\t\t\t\t\t\tif ( $result )\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\treturn [ $this->finalResponse( 'success', 'User meta saved!', 'Your address and contact have been saved sucessfully.' ) ];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\treturn [ $this->finalResponse() ];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch ( Exception $e )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->finalResponse();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}", "protected function setup_metadata() {\n\t\tif ( $this->get_meta_type() ) {\n\t\t\t$this->fill( $this->get_metadata() );\n\t\t}\n\t}", "private function packMeta()\n {\n $transport = $this->modx->fromJSON(file_get_contents(__DIR__ . '/../transport.json'));\n unset($transport['support']['db']);\n\n $this->builder->setPackageAttributes([\n 'changelog' => file_get_contents(__DIR__ . '/../meta/changelog.txt'),\n 'license' => file_get_contents(__DIR__ . '/../meta/license.txt'),\n 'readme' => file_get_contents(__DIR__ . '/../meta/readme.txt'),\n 'requires' => $transport['support']\n ]);\n }", "private function getMeta() {\n $metadata = array(\n 'title' => 'User', \n 'desc' => 'Request URL: ' . Config::get('app.api_url'), \n 'meta' => array( \n 'title' => 'User | Seeties', \n 'description' => 'Sample meta description' \n ),\n 'sidebar' => View::make('user.sidebar')\n );\n\n return $metadata;\n }", "public function add($info, $meta)\r\n {\r\n\r\n }", "function add_site_meta($site_id, $meta_key, $meta_value, $unique = \\false)\n {\n }", "function tf_add_post_meta($post_id, $meta_key, $meta_value, $unique = false) {\r\n // make sure meta is added to the post, not a revision\r\n if ( $the_post = wp_is_post_revision($post_id) )\r\n $post_id = $the_post;\r\n\r\n $meta_type = 'post';\r\n $object_id = $post_id;\r\n\r\n if ( !$meta_type || !$meta_key )\r\n return false;\r\n\r\n if ( !$object_id = absint($object_id) )\r\n return false;\r\n\r\n if ( ! $table = _get_meta_table($meta_type) )\r\n return false;\r\n\r\n global $wpdb;\r\n\r\n $column = esc_sql($meta_type . '_id');\r\n\r\n // expected_slashed ($meta_key)\r\n // $meta_key = stripslashes($meta_key); // this was the trouble !\r\n // $meta_value = stripslashes_deep($meta_value); // this was the trouble !\r\n $meta_value = sanitize_meta( $meta_key, $meta_value, $meta_type );\r\n\r\n $check = apply_filters( \"add_{$meta_type}_metadata\", null, $object_id, $meta_key, $meta_value, $unique );\r\n if ( null !== $check )\r\n return $check;\r\n\r\n if ( $unique && $wpdb->get_var( $wpdb->prepare(\r\n \"SELECT COUNT(*) FROM $table WHERE meta_key = %s AND $column = %d\",\r\n $meta_key, $object_id ) ) )\r\n return false;\r\n\r\n $_meta_value = $meta_value;\r\n $meta_value = maybe_serialize( $meta_value );\r\n\r\n do_action( \"add_{$meta_type}_meta\", $object_id, $meta_key, $_meta_value );\r\n\r\n $result = $wpdb->insert( $table, array(\r\n $column => $object_id,\r\n 'meta_key' => $meta_key,\r\n 'meta_value' => $meta_value\r\n ) );\r\n\r\n if ( ! $result )\r\n return false;\r\n\r\n $mid = (int) $wpdb->insert_id;\r\n\r\n wp_cache_delete($object_id, $meta_type . '_meta');\r\n\r\n do_action( \"added_{$meta_type}_meta\", $mid, $object_id, $meta_key, $_meta_value );\r\n\r\n return $mid;\r\n }", "public static function createItemMetaForFile($filename) {\n\t\t$exifData = t3lib_div::makeInstance('Tx_Yag_Domain_Import_MetaData_ExifParser')->parseExifData($filename);\n\t\t$iptcData = t3lib_div::makeInstance('Tx_Yag_Domain_Import_MetaData_IptcParser')->parseIptcData($filename);\n\t\t$xmpData = Tx_Yag_Domain_Import_MetaData_XmpParser::parseXmpData($filename);\n\t\t\n\t\t$itemMeta = new Tx_Yag_Domain_Model_ItemMeta();\n\t\t\n\t\t$itemMeta->setExif(serialize($exifData));\n\t\t$itemMeta->setIptc(serialize($iptcData));\n\t\t$itemMeta->setXmp($xmpData);\n\t\t\n\t\t$itemMeta->setAperture($exifData['ApertureValue']);\n\t\t$itemMeta->setArtist($iptcData[\"2#080\"][0]);\n\n\t\t$itemMeta->setArtistMail(self::getXmpValueByKey($xmpData, 'Iptc4xmpCore\\:CiEmailWork'));\n\t\t$itemMeta->setArtistWebsite(self::getXmpValueByKey($xmpData, 'Iptc4xmpCore\\:CiEmailWork')); \n\t\t$itemMeta->setCameraModel($exifData['Make'] . ' - ' . $exifData['Model']);\n\t\t$itemMeta->setCopyright($iptcData[\"2#116\"][0]);\n\t\t$itemMeta->setDescription($exifData['ImageDescription']);\n\t\t$itemMeta->setFlash($exifData['Flash']);\n\t\t$itemMeta->setFocalLength($exifData['FocalLength']);\n\n\t\t$itemMeta->setCaptureDate(new DateTime('@' . $exifData['CaptureTimeStamp']));\n\n\t\t//$itemMeta->setGpsLatitude(); // not available yet\n\t\t//$itemMeta->setGpsLongitude(); // not available yet\n\t\t$itemMeta->setIso($exifData['ISOSpeedRatings']); \n\t\tif(is_array($iptcData['2#025'])) $itemMeta->setKeywords(implode(',', $iptcData['2#025']));\n\t\t$itemMeta->setLens(self::getXmpValueByKey($xmpData, 'aux\\:Lens'));\n\n\t\t$itemMeta->setShutterSpeed($exifData['ShutterSpeedValue']);\n\t\t\n\t\treturn $itemMeta;\n\t}", "public static function generateMeta(array $data = [])\n {\n $array_meta = [];\n\n foreach ($data as $k => $v) {\n $array_meta[] = \"{$k} ='$v' \";\n }\n\n $meta = implode(' ', $array_meta);\n echo \"<meta {$meta} >\";\n }", "function addMeta() {\n\t\n\tif( class_exists('acf') ) {\n\n\t$meta_description = get_field('meta_description', 'option');\n\t$meta_keywords = get_field('meta_keywords', 'option');\n\t$meta_author = get_field('meta_author', 'option');\n\t$meta_og_image = get_field('meta_og_img', 'option');\n\t$meta_img_full = $meta_og_image['url'];\n\n\t}\n\n\tif ( $meta_description ) {\n\t\techo '<meta name=\"description\" content=\"'.$meta_description.'\">'; \n\t}\n\n\tif ( $meta_keywords ) {\n\t\techo '<meta name=\"keywords\" content=\"'.$meta_keywords.'\">'; \n\t}\n\n\tif ( $meta_author ) {\n\t\techo '<meta name=\"author\" content=\"'.$meta_author.'\">'; \n\t}\n\n\tif ( $meta_og_image ) {\n\t\techo '<meta name=\"twitter:card\" content=\"summary\" />';\n\t\techo '<meta property=\"og:image\" content=\"'.$meta_img_full.'\" />';\n\t}\n\n}", "public function Create($extra_meta=array()) {\n $form_instance = $this->form_instance;\n // Retrieve the form instance\n $action_instance = $this->action_instance;\n // Create a new entry SQL helper\n $entries_sql_helper = new VCFF_Reports_Helper_SQL_Entries();\n // Add the entry\n $entries_sql_helper\n ->Add_Entry(array(\n 'form_uuid' => $form_instance->Get_UUID(),\n 'form_type' => $form_instance->Get_Type(),\n 'event_id' => $action_instance->Get_ID(),\n 'event_code' => $action_instance->Get_Code(),\n 'source_url' => 'http://something',\n ));\n // If extra meta information was supplied\n if ($extra_meta && is_array($extra_meta)) {\n // Loop through each submission meta item\n foreach ($extra_meta as $meta_key => $meta_data) {\n // Add the submission meta item\n $entries_sql_helper\n ->Add_Meta_Item(array(\n 'meta_code' => $meta_data['meta_code'],\n 'meta_value' => $meta_data['meta_value'],\n 'meta_label' => $meta_data['meta_label'],\n ));\n }\n }\n // Return the form fields\n $form_fields = $form_instance->fields;\n // Loop through each form field\n foreach ($form_fields as $machine_code => $field_instance) { \n // Add the entry\n $entries_sql_helper\n ->Add_Field_Item(array(\n 'machine_code' => $machine_code,\n 'field_label' => $field_instance->Get_Label(),\n 'field_value' => $field_instance->Get_Value(),\n 'field_value_html' => $field_instance->Get_HTML_Value(false),\n 'field_value_text' => $field_instance->Get_TEXT_Value(false),\n ));\n }\n // Store and retrieve the stored entry\n $entry = $entries_sql_helper->Store();\n \n $flags_sql_helper = new VCFF_Reports_Helper_SQL_Flags();\n \n $flags_sql_helper\n ->Add_Flag(array(\n 'entry_uuid' => $entry['uuid'],\n 'form_uuid' => $form_instance->Get_UUID(),\n 'flag_code' => 'unread',\n 'flag_data' => array('hey'),\n ))\n ->Store();\n \n return $this;\n }", "function add_meta($post_id)\n {\n }", "function AddMetaData($s3object, $value) {\n\t\t\t$this->__meta[$s3object] = $value;\n\t\t}", "protected function _setUniversalData()\n {\n $service = $this->getService();\n $object = $this->getObject();\n $entry = $this->getEntry();\n $attributeValues = $this->getAttributeValues();\n\n $this->_setAttribute('id', $object->getId() . '_' . $this->getStoreId(), 'text');\n\n if (isset($attributeValues['title']['value'])) {\n $titleText = $attributeValues['title']['value'];\n unset($attributeValues['title']); // to prevent \"Reason: Duplicate title\" error\n } elseif ($object->getName()) {\n $titleText = $object->getName();\n } else {\n $titleText = 'no title';\n }\n $entry->setTitle($service->newTitle()->setText($this->_cleanAtomAttribute($titleText)));\n\n if ($object->getUrl()) {\n $links = $entry->getLink();\n if (!is_array($links)) {\n $links = array();\n }\n $link = $service->newLink();\n $link->setHref($object->getUrl());\n $link->setRel('alternate');\n $link->setType('text/html');\n if ($object->getName()) {\n $link->setTitle($object->getName());\n }\n $links[0] = $link;\n $entry->setLink($links);\n }\n\n if (isset($attributeValues['description']['value'])) {\n $descrText = $attributeValues['description']['value'];\n unset($attributeValues['description']); // to prevent \"Reason: Duplicate description\" error\n } elseif ($object->getDescription()) {\n $descrText = $object->getDescription();\n } else {\n $descrText = 'no description';\n }\n $entry->setContent($service->newContent()->setText($this->_cleanAtomAttribute($descrText)));\n\n if (isset($attributeValues['price']['value']) && floatval($attributeValues['price']['value']) > 0) {\n $price = $attributeValues['price']['value'];\n } else {\n $price = $object->getPrice();\n }\n\n $this->_setAttributePrice(false, $price);\n\n if ($object->getQuantity()) {\n $quantity = $object->getQuantity() ? max(1, (int)$object->getQuantity()) : 1;\n $this->_setAttribute('quantity', $quantity, 'int');\n }\n\n $targetCountry = $this->getConfig()->getTargetCountry($this->getStoreId());\n\n if ($object->getData('image_url')) {\n $this->_setAttribute('image_link', $object->getData('image_url'), 'url');\n }\n\n $this->_setAttribute('condition', 'new', 'text');\n $this->_setAttribute('target_country', $targetCountry, 'text');\n $this->_setAttribute('item_language', $this->getConfig()->getCountryInfo($targetCountry, 'language'), 'text');\n // set new 'attribute_values' with removed 'title' and/or 'description' keys to avoid 'duplicate' errors\n $this->setAttributeValues($attributeValues);\n\n return $this;\n }" ]
[ "0.7083554", "0.6598917", "0.6539921", "0.63548154", "0.62541217", "0.6243179", "0.6236825", "0.62103033", "0.6195778", "0.61901003", "0.610156", "0.6097557", "0.6054699", "0.6049887", "0.60415405", "0.60309947", "0.60269785", "0.6017872", "0.5977798", "0.59730774", "0.59566575", "0.59275955", "0.58389544", "0.58330834", "0.5820986", "0.5814597", "0.5811857", "0.58104783", "0.58034766", "0.5789335" ]
0.7447418
0
Deletes the survey from the database
function deleteSurveyRecord() { global $ilDB; $affectedRows = $ilDB->manipulateF("DELETE FROM svy_svy WHERE survey_id = %s", array('integer'), array($this->getSurveyId()) ); $result = $ilDB->queryF("SELECT questionblock_fi FROM svy_qblk_qst WHERE survey_fi = %s", array('integer'), array($this->getSurveyId()) ); $questionblocks = array(); while ($row = $ilDB->fetchAssoc($result)) { array_push($questionblocks, $row["questionblock_fi"]); } if (count($questionblocks)) { $affectedRows = $ilDB->manipulate("DELETE FROM svy_qblk WHERE " . $ilDB->in('questionblock_id', $questionblocks, false, 'integer')); } $affectedRows = $ilDB->manipulateF("DELETE FROM svy_qblk_qst WHERE survey_fi = %s", array('integer'), array($this->getSurveyId()) ); $this->deleteAllUserData(); $affectedRows = $ilDB->manipulateF("DELETE FROM svy_anonymous WHERE survey_fi = %s", array('integer'), array($this->getSurveyId()) ); // delete export files include_once "./Services/Utilities/classes/class.ilUtil.php"; $svy_data_dir = ilUtil::getDataDir()."/svy_data"; $directory = $svy_data_dir."/svy_".$this->getId(); if (is_dir($directory)) { include_once "./Services/Utilities/classes/class.ilUtil.php"; ilUtil::delDir($directory); } include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php"); $mobs = ilObjMediaObject::_getMobsOfObject("svy:html", $this->getId()); // remaining usages are not in text anymore -> delete them // and media objects (note: delete method of ilObjMediaObject // checks whether object is used in another context; if yes, // the object is not deleted!) foreach($mobs as $mob) { ilObjMediaObject::_removeUsage($mob, "svy:html", $this->getId()); $mob_obj =& new ilObjMediaObject($mob); $mob_obj->delete(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testDeleteSurvey()\n {\n $survey = Survey::factory()->create();\n $surveyId = $survey->id;\n\n $response = $this->json('DELETE', \"survey/{$surveyId}\");\n\n $response->assertStatus(204);\n $this->assertDatabaseMissing('survey', ['id' => $surveyId]);\n }", "public function destroy(Survey $survey)\n {\n //\n }", "public function delete(Datastore $db)\n {\n $stmt = $db->prepare('DELETE FROM tbl_survey WHERE col_uuid = :surveyUuid');\n $stmt->bindValue(':surveyUuid', $this->uuid, PDO::PARAM_STR);\n $db->execute($stmt);\n }", "public function Delete($surveyid)\n\t{\n\t\t$surveyid = (int)$surveyid;\n\t\t$prefix = $this->Db->TablePrefix;\n\n\t\t// First Delete all Widgets Associated with the form,\n\t\t$widgets = $this->getWidgets($surveyid);\n\t\tforeach ($widgets as $key=>$widget) {\n\t\t\t\t// for each widget delete all the fields related ..\n\t\t\t\t$query = \"DELETE FROM {$prefix}surveys_fields WHERE surveys_widget_id = {$widget['id']}\";\n\t\t\t\t$this->Db->Query($query);\n\t\t}\n\n\t\t// Delete the actual widget,\n\t\t$query = \"DELETE FROM {$prefix}surveys_widgets WHERE surveys_id = {$surveyid}\";\n\t\t$this->Db->Query($query);\n\n\t\t// Lastly delete the actual suvey\n\t\t$query = \"DELETE FROM {$prefix}surveys WHERE id = $surveyid\";\n\t\t$this->Db->Query($query);\n\n\t\t// Delete all the responses and response value as well..\n\t\t$query = \"DELETE sr, srv\n\t\t\t\t FROM {$prefix}surveys_response as sr, {$prefix}surveys_response_value as srv\n\t\t\t\t WHERE sr.id = srv.surveys_response_id and\n\t\t\t\t sr.surveys_id = {$surveyid}\";\n\n\n\t\t// Delete all the files uploaded from the survey folders..\n\t\t$survey_images_dir = TEMP_DIRECTORY . DIRECTORY_SEPARATOR . 'surveys' . DIRECTORY_SEPARATOR . $surveyid;\n\n\t\tif (is_dir($survey_images_dir)) {\n\t\t// Delete using our library file\n\t\t\t\t$dir = new IEM_FileSystem_Directory($survey_images_dir);\n\t\t\t\t$dir->delete();\n\t\t}\n\n\t\t$this->Db->Query($query);\n\t}", "function delete_question($id){\n $this->db->where('question_id', $id);\n $this->db->delete('questions');\n }", "public function delete($id)\n {\n $this->db->where('id',$id);\n return $this->db->delete('user_survey_answer');\n }", "function pubf_DeleteSingleAnswer(){\n //delete all relations from table actividadrespuesta\n $DeleteSingleAnswer=$this->prepare(\"DELETE FROM actividadrespuesta WHERE idRespuesta = :idRespuesta\");\n $DeleteSingleAnswer->bindParam(':idRespuesta' , $this->idRespuesta);\n $this->executeQueryPrepare($DeleteSingleAnswer);\n $DeleteRelatedAnswer=$this->prepare(\"DELETE FROM respuesta WHERE idRespuesta = :idRespuesta\");\n $DeleteRelatedAnswer->bindParam(':idRespuesta' , $this->idRespuesta);\n $this->executeQueryPrepare($DeleteRelatedAnswer);\n }", "public function destroy(Survey $survey)\n {\n $survey->delete();\n return Redirect::route('surveys');\n }", "public function deleteAnswer()\n {\n $this->is_answer = false;\n $this->topic->is_answered = false;\n $post = $this;\n\n Db::transaction(function() use ($post)\n {\n $post->topic->save();\n $post->save();\n });\n }", "function delete($id = null) {\n if (is_null($id)) { // check for a value in the id variable\n $this->Session->setFlash('Invalid id for survey', true, null, \"error\"); // send an error message\n $this->redirect(array('action'=>'index')); // go back to the index action\n }\n $i = $this->Survey->Respondent->Response->find('count', array('conditions' => array('survey_id' => $id)));\n if ($i > 0) {\n $this->Session->setFlash('A survey that has responses cannot be deleted. Please delete all survey responses first.', true, null, \"error\"); // send an error message\n $this->redirect(array('action'=>'index')); // go back to the index action\n }\n if ($this->Survey->delete($id)) { // delete the survey and return true if successful\n $this->Session->setFlash('Survey deleted', true, null, \"confirm\"); // send a confirmation message\n $this->redirect(array('action'=>'index')); // go back to the index view\n }\n // continue when the delete function returns false\n $this->Session->setFlash('Survey was not deleted', true, null, \"error\"); // send an error message\n $this->redirect(array('action' => 'index')); // go back to the index view\n }", "public function delete()\n {\n $stmt = $this->_db->prepare(\"DELETE FROM score;\");\n $stmt->execute();\n }", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "public function testDeleteSurvey0()\n {\n }", "public function testDeleteSurvey0()\n {\n }", "public function delete(){\n\t\t$db = new Database();\n\t\t$sql = \"DELETE FROM reports WHERE id=?\";\n\t\t$sql = $db->prepareQuery($sql, $this->id);\n\t\t$db->query($sql);\n\t}", "public function delete(){\n\t\t$this->feedbacks_model->delete();\n\t}", "public function delete()\n {\n Contest::destroy($this->modelId);\n $this->modalConfirmDeleteVisible = false;\n $this->resetPage();\n }", "function delete_question() {\r\n global $db;\r\n\r\n // get global user object\r\n global $user;\r\n\r\n // protect from unauthorized access\r\n if (!isset($user) || (!isset($_SESSION['session_survey']))) {\r\n logout();\r\n die();\r\n }\r\n\r\n $question = new Question();\r\n $question->get_from_db($_GET['question_id']);\r\n $survey = new Survey();\r\n $survey->get_from_db($question->getSurvey());\r\n\r\n if ($survey->getCreatedBy() != $user->getId()) {\r\n if ($user->getAdmin() != 1) {\r\n logout();\r\n die();\r\n }\r\n }\r\n\r\n $question->setIsActive(0);\r\n $question->update_in_db();\r\n\r\n $cookie_key = 'msg';\r\n $cookie_value = 'Вие успешно изтрихте елемент от анкетата!';\r\n setcookie($cookie_key, $cookie_value, time() + 1);\r\n header('Location: ' . ROOT_DIR . '?page=survey_edit');\r\n die();\r\n}", "public function deleted(InterviewQuestion $interviewQuestion): void\n {\n //\n }", "function editCleanUp($question_id)\r\n {\r\n \t\t$this->query('DELETE FROM questions WHERE id='.$question_id);\r\n\t\t$this->query('DELETE FROM responses WHERE question_id='.$question_id);\r\n\t\t$this->query('DELETE FROM survey_questions WHERE question_id='.$question_id);\r\n }", "function delete()\n\t{\n\t\t$remove = parent::delete();\n\t\t// always call parent delete function first!!\n\t\tif (!$remove)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->deleteMetaData();\n\n\t\t// Delete all survey questions, constraints and materials\n\t\tforeach ($this->questions as $question_id)\n\t\t{\n\t\t\t$this->removeQuestion($question_id);\n\t\t}\n\t\t$this->deleteSurveyRecord();\n\t\t\n\t\tilUtil::delDir($this->getImportDirectory());\n\t\treturn true;\n\t}", "function delete($id) {\r\n\t\treturn SurveyAnswerQuery::create()->filterByPrimaryKey($id)->delete() > 0;\r\n\t}", "public function destroy($id)\n {\n $questions=DB::table('questions')->where('id', '=',$id)->delete();\n }", "public function deletequestionAction()\r\n {\r\n if ($this->getRequest()->isPost()) {\r\n $params = $this->getRequest()->getParams();\r\n $questionId = $params['questionId'];\r\n\r\n\r\n $question = new Application_Model_DbTable_FicheQuestion();\r\n // delete the question\r\n $question->deleteQuestion($questionId);\r\n\r\n // Return to the page informations\r\n $this->_helper->redirector('gestionquestion', 'admin', null);\r\n\r\n }\r\n\r\n }", "public function destroy(ClientSurvey $clientSurvey)\n {\n //\n }", "public function delete()\n {\n $query = $this->db->getQuery(true);\n\n $query\n ->delete($this->db->quoteName(\"#__crowdf_intentions\"))\n ->where($this->db->quoteName(\"id\") .\"=\". (int)$this->id);\n\n $this->db->setQuery($query);\n $this->db->execute();\n\n $this->reset();\n }", "public function delete() {\n $mysqli = Database::getMYSQLI();\n \n $stmt = $mysqli->prepare(\"DELETE lessons FROM lessons WHERE id = ?\");\n\n $stmt->bind_param('i', $this->id);\n \n $stmt->execute();\n $stmt->close();\n $mysqli->close();\n }", "public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }", "public function delete_question(){\n $question_id = $this->input->post('question_id');\n $challenge_id = $this->input->post('challenge_id');\n\n $question = new stdClass();\n\n if($this->questionlib->isSafeToDelete($question_id) === true){\n $question->question_id = $question_id;\n\n $this->question_model->delete($question);\n $this->challenge_question_model->delete($challenge_id, $question_id);\n $out['deleted'] = true;\n }else{\n $out['message'] = \"Question have associate data, it can't be deleted\";\n }\n $this->output->set_output(json_encode($out));\n\n }", "public function destroy($questionId)\n {\n $question = Question::findOrFail($questionId);\n\n $exam = Exam::findOrFail($question->exam_id);\n $exam->questions_count--;\n $exam->save();\n\n Question::destroy($questionId);\n }" ]
[ "0.76269424", "0.72986805", "0.7138512", "0.70225924", "0.6970275", "0.6942721", "0.6701194", "0.6668022", "0.6628398", "0.6584948", "0.65771836", "0.65684456", "0.65418535", "0.65418535", "0.65384054", "0.65351653", "0.65293497", "0.65052813", "0.6504968", "0.64957595", "0.6470668", "0.6464296", "0.64628285", "0.64550626", "0.64417475", "0.64297044", "0.6426824", "0.642102", "0.6414752", "0.63895494" ]
0.7320372
1
Deletes all user data of a survey
function deleteAllUserData() { global $ilDB; $result = $ilDB->queryF("SELECT finished_id FROM svy_finished WHERE survey_fi = %s", array('integer'), array($this->getSurveyId()) ); $active_array = array(); while ($row = $ilDB->fetchAssoc($result)) { array_push($active_array, $row["finished_id"]); } $affectedRows = $ilDB->manipulateF("DELETE FROM svy_finished WHERE survey_fi = %s", array('integer'), array($this->getSurveyId()) ); foreach ($active_array as $active_fi) { $affectedRows = $ilDB->manipulateF("DELETE FROM svy_answer WHERE active_fi = %s", array('integer'), array($active_fi) ); $affectedRows = $ilDB->manipulateF("DELETE FROM svy_times WHERE finished_fi = %s", array('integer'), array($active_fi) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete()\n {\n foreach ($this->users as $user) {\n $uid = $user->id;\n // delete whole website info for this user\n if ((bool)$this->delete) {\n $model = new FormUserClear($user);\n $model->comments = true;\n $model->content = true;\n $model->feedback = true;\n $model->wall = true;\n $model->make();\n }\n\n // delete avatars\n File::remove('/upload/user/avatar/big/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/medium/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/small/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/original/' . $uid . '.jpg');\n // delete user profile and auth data\n $user->profile()->delete();\n // delete user provider data\n $user->provider()->delete();\n // delete user object\n $user->delete();\n }\n }", "public function deleteData()\n {\t\t\n \t$arrayId = $this->getAllUserId($this->readFromLocalFile());\n \tforeach($arrayId as $id)\n \t{\n \t\t$user = User::find()->where(['id' => $id])->one();\n \t\tif($user)\n \t\t{\n \t\t\t$user->delete();\n \t\t}\n \t}\n \t$this->deleteSelectedLocalItems('user');\n }", "function deleteSurveyRecord()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_svy WHERE survey_id = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\n\t\t$result = $ilDB->queryF(\"SELECT questionblock_fi FROM svy_qblk_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t$questionblocks = array();\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\tarray_push($questionblocks, $row[\"questionblock_fi\"]);\n\t\t}\n\t\tif (count($questionblocks))\n\t\t{\n\t\t\t$affectedRows = $ilDB->manipulate(\"DELETE FROM svy_qblk WHERE \" . $ilDB->in('questionblock_id', $questionblocks, false, 'integer'));\n\t\t}\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_qblk_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t$this->deleteAllUserData();\n\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_anonymous WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t\n\t\t// delete export files\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\t$directory = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tif (is_dir($directory))\n\t\t{\n\t\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t\tilUtil::delDir($directory);\n\t\t}\n\n\t\tinclude_once(\"./Services/MediaObjects/classes/class.ilObjMediaObject.php\");\n\t\t$mobs = ilObjMediaObject::_getMobsOfObject(\"svy:html\", $this->getId());\n\t\t// remaining usages are not in text anymore -> delete them\n\t\t// and media objects (note: delete method of ilObjMediaObject\n\t\t// checks whether object is used in another context; if yes,\n\t\t// the object is not deleted!)\n\t\tforeach($mobs as $mob)\n\t\t{\n\t\t\tilObjMediaObject::_removeUsage($mob, \"svy:html\", $this->getId());\n\t\t\t$mob_obj =& new ilObjMediaObject($mob);\n\t\t\t$mob_obj->delete();\n\t\t}\n\t}", "public function Delete($surveyid)\n\t{\n\t\t$surveyid = (int)$surveyid;\n\t\t$prefix = $this->Db->TablePrefix;\n\n\t\t// First Delete all Widgets Associated with the form,\n\t\t$widgets = $this->getWidgets($surveyid);\n\t\tforeach ($widgets as $key=>$widget) {\n\t\t\t\t// for each widget delete all the fields related ..\n\t\t\t\t$query = \"DELETE FROM {$prefix}surveys_fields WHERE surveys_widget_id = {$widget['id']}\";\n\t\t\t\t$this->Db->Query($query);\n\t\t}\n\n\t\t// Delete the actual widget,\n\t\t$query = \"DELETE FROM {$prefix}surveys_widgets WHERE surveys_id = {$surveyid}\";\n\t\t$this->Db->Query($query);\n\n\t\t// Lastly delete the actual suvey\n\t\t$query = \"DELETE FROM {$prefix}surveys WHERE id = $surveyid\";\n\t\t$this->Db->Query($query);\n\n\t\t// Delete all the responses and response value as well..\n\t\t$query = \"DELETE sr, srv\n\t\t\t\t FROM {$prefix}surveys_response as sr, {$prefix}surveys_response_value as srv\n\t\t\t\t WHERE sr.id = srv.surveys_response_id and\n\t\t\t\t sr.surveys_id = {$surveyid}\";\n\n\n\t\t// Delete all the files uploaded from the survey folders..\n\t\t$survey_images_dir = TEMP_DIRECTORY . DIRECTORY_SEPARATOR . 'surveys' . DIRECTORY_SEPARATOR . $surveyid;\n\n\t\tif (is_dir($survey_images_dir)) {\n\t\t// Delete using our library file\n\t\t\t\t$dir = new IEM_FileSystem_Directory($survey_images_dir);\n\t\t\t\t$dir->delete();\n\t\t}\n\n\t\t$this->Db->Query($query);\n\t}", "public function actionClear()\n {\n //DELETE from xm_report_exam_question where user_id = 3181;\n //DELETE from xm_report_error_question where user_id = 3181;\n //DELETE from xm_report_task where user_id = 3181;\n //DELETE from xm_report_task_detail where user_id = 3181;\n //DELETE from xm_user_rate where uid = 3181;\n //DELETE from xm_report_user_data where user_id = 3181;\n $userId = Yii::$app->request->get('uid');\n Yii::$app->db->createCommand()->delete('xm_report_exam', \"user_id = {$userId}\")->execute();\n Yii::$app->db->createCommand()->delete('xm_report_exam_question', \"user_id = {$userId}\")->execute();\n Yii::$app->db->createCommand()->delete('xm_report_error_question', \"user_id = {$userId}\")->execute();\n Yii::$app->db->createCommand()->delete('xm_report_task', \"user_id = {$userId}\")->execute();\n Yii::$app->db->createCommand()->delete('xm_report_task_detail', \"user_id = {$userId}\")->execute();\n Yii::$app->db->createCommand()->delete('xm_user_rate', \"uid = {$userId}\")->execute();\n Yii::$app->db->createCommand()->delete('xm_report_user_data', \"user_id = {$userId}\")->execute();\n RedisService::deleteKey('wrong_record_uid_'.$userId);\n return $this -> success();\n }", "public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }", "public function deleteAllForUser($userId);", "public function deleteAllForUser($userId);", "public function destroy(Survey $survey)\n {\n //\n }", "public function destroy($id)\n {\n $user = User::findOrFail($id);\n if ($user->role == '1') {\n DB::table('ratings')->where('user_id', $id)->delete();\n }\n if ($user->role == '2') {\n DB::table('ratings')->where('rateable_id', $id)->delete();\n }\n\n $questions = Question::where('user_id', $id)->get();\n $answers = Answer::where('user_id', $id)->get();\n //dd($answers);\n Question::where('user_id', '=', $id)->orWhere('prof_id', '=', $id)->delete(); \n Answer::where('user_id', $id)->delete();\n $notifications = DB::table('notifications')->get();\n foreach($notifications as $n){\n if(json_decode($n->data)->user_id==$id ){\n DB::table('notifications')->where('id',$n->id)->delete();\n }\n elseif(property_exists(json_decode($n->data),'prof_id')){\n if(json_decode($n->data)->prof_id==$id){\n DB::table('notifications')->where('id',$n->id)->delete();\n }\n }\n \n }\n \n //Question::destroy::where('user_id', $id)->get();\n //dd($questions);\n if (auth()->user()->hasPermissionTo('adminpermission')) {\n $user->removeRole($user->roles->implode('name', ', '));\n if ($user->delete()) {\n if ($user->role == '1') {\n \n return redirect()->route('users.index');\n } elseif ($user->role == '2') {\n return redirect()->route('professionals.index');\n }\n elseif ($user->role == '3') {\n return redirect()->route('users.adminIndex');\n }\n }\n }\n else {\n $user->removeRole($user->roles->implode('name', ', '));\n if ($user->delete())\n return redirect()->route('home');\n \n }\n }", "function editCleanUp($question_id)\r\n {\r\n \t\t$this->query('DELETE FROM questions WHERE id='.$question_id);\r\n\t\t$this->query('DELETE FROM responses WHERE question_id='.$question_id);\r\n\t\t$this->query('DELETE FROM survey_questions WHERE question_id='.$question_id);\r\n }", "public function actionClean()\n {\n $old_time = date('Y-m-d H:m:s', strtotime('-1 hour'));\n $users = User::find()\n ->where(['confirm' => 0])\n ->andWhere(['<','create_date', $old_time])\n ->each();\n\n\n foreach($users as $user) {\n\n\n $user->delete();\n\n }\n\n return ExitCode::OK;\n }", "private function delete_all_user_metas() {\n\t\tglobal $wpdb;\n\n\t\t// User option keys are prefixed in single site and multisite when not in network mode.\n\t\t$key_prefix = $this->context->is_network_mode() ? '' : $wpdb->get_blog_prefix();\n\t\t$user_query = new \\WP_User_Query(\n\t\t\tarray(\n\t\t\t\t'fields' => 'id',\n\t\t\t\t'meta_key' => $key_prefix . OAuth_Client::OPTION_ACCESS_TOKEN,\n\t\t\t\t'compare' => 'EXISTS',\n\t\t\t)\n\t\t);\n\n\t\t$users = $user_query->get_results();\n\n\t\tforeach ( $users as $user_id ) {\n\t\t\t// Deletes all user stored options.\n\t\t\t$user_options = new User_Options( $this->context, $user_id );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_ACCESS_TOKEN );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_ACCESS_TOKEN_EXPIRES_IN );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_ACCESS_TOKEN_CREATED );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_REFRESH_TOKEN );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_REDIRECT_URL );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_AUTH_SCOPES );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_ERROR_CODE );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_PROXY_ACCESS_CODE );\n\t\t\t$user_options->delete( Verification::OPTION );\n\t\t\t$user_options->delete( Verification_Tag::OPTION );\n\t\t\t$user_options->delete( Profile::OPTION );\n\n\t\t\t// Clean up old user api key data, moved to options.\n\t\t\t// @todo remove after RC.\n\t\t\t$user_options->delete( 'googlesitekit_api_key' );\n\t\t\t$user_options->delete( 'sitekit_authentication' );\n\t\t\t$user_options->delete( 'googlesitekit_stored_nonce_user_id' );\n\t\t}\n\t}", "function small_groups_clean_database( ) {\n\t\t\n\t\tdelete_option( 'small_groups_plugin_version' );\n\t\tdelete_option( 'small_groups_install_date' );\n\n\t\t// plugin specific database entries\n\t\tdelete_option( 'SMALL_GROUPS_posts_to_posts_plugin' );\n\t\t\n\t\tdelete_option( 'SMALL_GROUPS_deactivate_posts_to_posts' );\n\t\t\n\t\t// user specific database entries\n\t\tdelete_user_meta( get_current_user_id( ), 'SMALL_GROUPS_prompt_timeout', $meta_value );\n\t\tdelete_user_meta( get_current_user_id( ), 'SMALL_GROUPS_start_date', $meta_value );\n\t\tdelete_user_meta( get_current_user_id( ), 'SMALL_GROUPS_hide_notice', $meta_value );\n\n}", "function clearUserAlerts(){\r\n\t\t$user = $_SESSION['userid'];\r\n\t\t$query1 = \"delete from studentalert where userid='$user'\";\r\n\t\t$query2 = \"delete from issuealert where userid='$user'\";\r\n\t\t$query3 = \"delete from useralert where userid='$user'\";\r\n\t\t$query4 = \"delete from firstwatchalert where userid='$user'\";\r\n\t\tmysql_query($query1);\r\n\t\tmysql_query($query2);\r\n\t\tmysql_query($query3);\r\n\t\tmysql_query($query4);\r\n\t}", "public function meDeleteALL ( )\n\t{\n\t\t$userId = $this->getCurrentUserId();\n\t\treturn $this->adminDeleteAllByUser($userId);\n\t}", "public function delete() {\n\t\t$query = \"DELETE FROM Users WHERE userId = :id\";\n\t\t$query_params = array(':id' => $this->userData['userId']);\n\t\texecuteSQL($query, $query_params);\n\t}", "public static function delete_data_for_all_users_in_context(context $context) {\n }", "public function clearUserQuestionTags()\n\t{\n\t\t$this->collUserQuestionTags = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function delete($id)\n {\n $this->db->where('id',$id);\n return $this->db->delete('user_survey_answer');\n }", "public function deleteUser()\n {\n $this->delete();\n }", "public function delExpApp($username)\n { \n $values=array();\n $dateNow=date('Y-m-d');\n $timeNow=date('H:i:s');\n $sqlDel=\"DELETE FROM appointment WHERE (username = '\".$username.\"') AND ((appointment_date < '\".$dateNow.\"') OR (appointment_date < '\".$dateNow.\"' AND appointment_time<'\".$timeNow.\"'))\";\n $this->execute($sqlDel,$values);\n }", "protected function clearCachedUserData()\n {\n $user = Auth::user();\n\n if ($user) {\n $user->deleteUserData();\n }\n }", "public function destroyAll()\n {\n if ( ! Input::has('users')) return;\n\n $ids = [];\n\n foreach(Input::get('users') as $k => $user) {\n $ids[] = $user['id'];\n }\n\n if ($deleted = User::destroy($ids)) {\n return response(trans('app.deleted', ['number' => $deleted]));\n }\n }", "public function delete_all()\n {\n }", "function User_DeleteAll($Ensure=false)\n\t{\n\t\tif (!$Ensure)\n\t\t\ttrigger_error(\"Ensure you want to delete all users!\");\n\t\telse\n\t\t\tj::SQL(\"DELETE FROM jfp_xuser\");\t\n\t}", "public function destroy(UserQuestion $userQuestion)\n {\n //\n }", "function recycle_surveys()\n\t{\n\t\tif ($this->course->has_resources(RESOURCE_SURVEY))\n\t\t{\n\t\t\t$table_survey = Database :: get_course_table(TABLE_SURVEY);\n\t\t\t$table_survey_q = Database :: get_course_table(TABLE_SURVEY_QUESTION);\n\t\t\t$table_survey_q_o = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);\n\t\t\t$table_survey_a = Database :: get_course_Table(TABLE_SURVEY_ANSWER);\n\t\t\t$table_survey_i = Database :: get_course_table(TABLE_SURVEY_INVITATION);\n\t\t\t$ids = implode(',', (array_keys($this->course->resources[RESOURCE_SURVEY])));\n\t\t\t$sql = \"DELETE FROM \".$table_survey_i.\" \";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_a.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_q_o.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_q.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t}\n\t}", "public function resetSurveysAndPollsAction() {\n\t\tif (in_array(APPLICATION_ENV, array('development', 'sandbox', 'testing', 'demo'))) {\n\t\t\t$this->_validateRequiredParameters(array('user_id', 'user_key', 'starbar_id'));\n\t\t\tDb_Pdo::execute(\"DELETE FROM survey_response WHERE user_id = ?\", $this->user_id);\n\t\t\treturn $this->_resultType(true);\n\t\t} else {\n\t\t\treturn $this->_resultType(false);\n\t\t}\n\t}", "function delete_all_user_settings()\n {\n }" ]
[ "0.6742145", "0.6682591", "0.6587738", "0.63381344", "0.62949795", "0.6282547", "0.6268381", "0.6268381", "0.6240806", "0.62358767", "0.6117296", "0.6115654", "0.6049379", "0.6047991", "0.60146284", "0.601251", "0.60046923", "0.60016185", "0.59653705", "0.5955393", "0.5947093", "0.591318", "0.59091985", "0.5905628", "0.5890641", "0.5885978", "0.588362", "0.5876425", "0.58733696", "0.5871762" ]
0.7689275
0
Returns 1, if a survey is complete for use
function isComplete() { if (($this->getTitle()) and (count($this->questions))) { return 1; } else { return 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _isComplete($obj_id)\n\t{\n\t\t$survey = new ilObjSurvey($obj_id, false);\n\t\t$survey->loadFromDb();\n\t\tif (($survey->getTitle()) and (count($survey->questions)))\n\t\t{\n\t\t\treturn 1;\n\t\t} \n\t\t\telse \n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "public function is_complete($survey_id)\n\t{\n\t\t$query = $this->db\n\t\t\t->where('survey_id', $survey_id)\n\t\t\t->where('completed IS NOT NULL', NULL, TRUE)\n\t\t\t->where('member_id', $this->session->userdata('member_id'))\n\t\t\t->order_by('updated', 'DESC')\n\t\t\t->limit(1)\n\t\t\t->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function isComplete() {\n\t\t$questions = $this->getQuestions();\n\t\t\n\t\tforeach((array) $questions as $question) {\n\t\t\tif(!$question->hasAnswer($this->_answers)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function completeSurveyAction() {\n\t\tif (in_array(APPLICATION_ENV, array('development', 'sandbox', 'testing', 'demo'))) {\n\t\t\t$this->_validateRequiredParameters(array('user_id', 'user_key', 'starbar_id', 'survey_type', 'survey_reward_category'));\n\n\t\t\t$survey = new Survey();\n\t\t\t$survey->type = $this->survey_type;\n\t\t\t$survey->reward_category = $this->survey_reward_category;\n\t\t\tGame_Transaction::completeSurvey($this->user_id, $this->starbar_id, $survey);\n\n\t\t\tif ($survey->type == \"survey\" && $survey->reward_category == \"profile\") {\n\t\t\t\t$profileSurvey = new Survey();\n\t\t\t\t$profileSurvey->loadProfileSurveyForStarbar($this->starbar_id);\n\t\t\t\tif ($profileSurvey->id) {\n\t\t\t\t\tDb_Pdo::execute(\"DELETE FROM survey_response WHERE survey_id = ? AND user_id = ?\", $profileSurvey->id, $this->user_id);\n\t\t\t\t\t$surveyResponse = new Survey_Response();\n\t\t\t\t\t$surveyResponse->survey_id = $profileSurvey->id;\n\t\t\t\t\t$surveyResponse->user_id = $this->user_id;\n\t\t\t\t\t$surveyResponse->status = 'completed';\n\t\t\t\t\t$surveyResponse->save();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $this->_resultType(true);\n\t\t} else {\n\t\t\treturn $this->_resultType(false);\n\t\t}\n\t}", "function isComplete()\n\t{\n\t\tif (\n\t\t\tstrlen($this->title) \n\t\t\t&& $this->author \n\t\t\t&& $this->question && \n\t\t\tcount($this->answers) >= $this->correctanswers \n\t\t\t&& $this->getMaximumPoints() > 0\n\t\t)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function isComplete()\n\t{\n\t\tif (($this->title) and ($this->author) and ($this->question) and ($this->getMaximumPoints() > 0))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function hasComplete(){\n return $this->_has(2);\n }", "function questionnaire_user_complete($course, $user, $mod, $questionnaire) {\n global $CFG;\n require_once($CFG->dirroot . '/mod/questionnaire/locallib.php');\n\n if ($responses = questionnaire_get_user_responses($questionnaire->sid, $user->id, $complete = false)) {\n foreach ($responses as $response) {\n if ($response->complete == 'y') {\n echo get_string('submitted', 'questionnaire').' '.userdate($response->submitted).'<br />';\n } else {\n echo get_string('attemptstillinprogress', 'questionnaire').' '.userdate($response->submitted).'<br />';\n }\n }\n } else {\n print_string('noresponses', 'questionnaire');\n }\n\n return true;\n}", "function is_complete_course()\n {\n global $DB, $USER, $CFG;\n $userid = $USER->id;\n require_once(\"$CFG->libdir/gradelib.php\");\n $complete_scorm = 0;\n $complete_quiz = 0;\n\n $modinfo = get_fast_modinfo($this->course);\n\n foreach ($modinfo->get_cms() as $cminfo) {\n\n switch ($cminfo->modname) {\n case 'scorm':\n $params = array(\n \"userid\" => $userid,\n \"scormid\" => $cminfo->instance\n );\n $tracks = $DB->get_records('scorm_scoes_track', $params);\n foreach ($tracks as $track) {\n if (($track->value == 'completed') || ($track->value == 'passed') || ($track->value == 'failed')) {\n $complete_scorm++;\n }\n }\n break;\n case 'quiz':\n\n $grading_info = grade_get_grades($this->course->id, 'mod', 'quiz', $cminfo->instance, $userid);\n $gradebookitem = array_shift($grading_info->items);\n $grade = $gradebookitem->grades[$userid];\n $value = round(floatval(str_replace(\",\", \".\", $grade->str_grade)), 1);\n //verifica se a nota do aluno é igual ou maior que 7 em quiz \n if ($value >= 7.0) {\n $complete_quiz++;\n }\n break;\n default:\n break;\n }\n }\n if ($complete_scorm > 0 && $complete_quiz > 0) {\n return true;\n }\n return false;\n }", "public function getReadyForCompletion() {\n\t\t$ready = $this->getExerciseReadyForCompletion();\n\n\t\t//Is there a question\n\t\tif(count($this->questions) == 0) {\n\t\t\t$ready = 0;\n\t\t} else {\n\t\t\tforeach($this->questions as $question) {\n\t\t\t\t//Is the question filled out\n\t\t\t\t$questionText = $question->getText();\n\t\t\t\tif(empty($questionText)) {\n\t\t\t\t\t$ready= 0;\n\t\t\t\t} else {\n\t\t\t\t\t$possibleAnswers = $question->getPossibleAnswers();\n\t\t\t\t\t//Does it have atleast 2 possible answers\n\t\t\t\t\tif(count($possibleAnswers) < 2) {\n\t\t\t\t\t\t$ready = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tforeach($possibleAnswers as $possibleAnswer) {\n\t\t\t\t\t\t\t//Does each answer have a text\n\t\t\t\t\t\t\t$answerText = $possibleAnswer->getText();\n\t\t\t\t\t\t\tif(empty($answerText)) {\n\t\t\t\t\t\t\t\t$ready= 0;\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\t\treturn $ready;\n\t}", "function isComplete() {\n return (bool) $this->fulfillment['complete'];\n }", "function hasCompletedSurvey($iSurveyId, $sToken) {\n\t\t// Check if this token has already completed this survey\n\t\t$sQuery \t\t= \"SELECT completed FROM lime_tokens_$iSurveyId WHERE token = '$sToken'\";\n\t\t$oResult\t\t= $this->oDbConnection->query($sQuery);\n\t\twhile($aRow = mysqli_fetch_array($oResult)) {\n\t\t\t$isCompleted = $aRow['completed'];\n\t\t}\n\t\treturn (isset($isCompleted) && ($isCompleted != 'N'));\n\t}", "function saveCompletionStatus() \n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$complete = 0;\n\t\tif ($this->isComplete()) \n\t\t{\n\t\t\t$complete = 1;\n\t\t}\n if ($this->getSurveyId() > 0) \n\t\t{\n\t\t\t$affectedRows = $ilDB->manipulateF(\"UPDATE svy_svy SET complete = %s, tstamp = %s WHERE survey_id = %s\",\n\t\t\t\tarray('text','integer','integer'),\n\t\t\t\tarray($this->isComplete(), time(), $this->getSurveyId())\n\t\t\t);\n\t\t}\n\t}", "function isComplete()\n {\n return $this->complete;\n }", "function isCompleted(){\r\n\t\treturn $this->status==IFocusModel::COMPLETE;\r\n\t}", "function languagelesson_is_lesson_complete($lessonid, $userid) {\n\tglobal $CFG, $DB, $LL_QUESTION_TYPE;\n\n // Pull the list of all question types as a string of format [type],[type],[type],.\n\t$qtypeslist = implode(',', array_keys($LL_QUESTION_TYPE));\n\n\t\n// Find the number of question pages \n\t\n // This alias must be the same in both queries, so establish it here.\n\t$tmp_name = \"page\";\n // A sub-query used to ignore pages that have no answers stored for them\n // (instruction pages).\n\t$do_answers_exist = \"select *\n\t\t\t\t\t\t from {$CFG->prefix}languagelesson_answers ans\n\t\t\t\t\t\t where ans.pageid = $tmp_name.id\";\n // Query to pull only pages of stored languagelesson question types, belonging\n // to the current lesson, and having answer records stored.\n\t$get_only_question_pages = \"select *\n\t\t\t\t\t\t\t\tfrom {$CFG->prefix}languagelesson_pages $tmp_name\n\t\t\t\t\t\t\t\twhere qtype in ($qtypeslist)\n\t\t\t\t\t\t\t\t\t and $tmp_name.lessonid=$lessonid\n\t\t\t\t\t\t\t\t\t and exists ($do_answers_exist)\";\n\t$qpages = $DB->get_records_sql($get_only_question_pages);\n\t$numqpages = count($qpages);\n\t\n\t\n// Find the number of questions attempted.\n\t\n\t// See how many questions have been attempted.\n\t$numattempts = languagelesson_count_most_recent_attempts($lessonid, $userid);\n\n\t// If the number of question pages matches the number of attempted questions, it's complete.\n\tif ($numqpages == $numattempts) { return true; }\n\telse { return false; }\n}", "public function activateOfficialsSurvey()\n {\n return $this->mailer->activateOfficialsSurvey($this->data);\n }", "function isSurveyStarted($user_id, $anonymize_id, $appr_id = 0)\n\t{\n\t\tglobal $ilDB;\n\n\t\t// #15031 - should not matter if code was used by registered or anonymous (each code must be unique)\n\t\tif($anonymize_id)\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND anonymous_id = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','text','integer'),\n\t\t\t\tarray($this->getSurveyId(), $anonymize_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\tif ($result->numRows() == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($result);\n\t\t\t\n\t\t\t// yes, we are doing it this way\n\t\t\t$_SESSION[\"finished_id\"][$this->getId()] = $row[\"finished_id\"];\n\t\t\t\n\t\t\treturn (int)$row[\"state\"];\n\t\t}\n\n\t\t/*\n\t\tif ($this->getAnonymize())\n\t\t{\n\t\t\tif ((($user_id != ANONYMOUS_USER_ID) && sizeof($anonymize_id)) && (!($this->isAccessibleWithoutCode() && $this->isAllowedToTakeMultipleSurveys())))\n\t\t\t{\n\t\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\t\" WHERE survey_fi = %s AND anonymous_id = %s AND appr_id = %s\",\n\t\t\t\t\tarray('integer','text','integer'),\n\t\t\t\t\tarray($this->getSurveyId(), $anonymize_id, $appr_id)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\tif ($result->numRows() == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($result);\n\t\t\t$_SESSION[\"finished_id\"][$this->getId()] = $row[\"finished_id\"];\n\t\t\treturn (int)$row[\"state\"];\n\t\t}\t\t\n\t\t*/\n\t}", "public function isComplete()\n\t{\n\t\treturn $this->status == 'Complete';\n\t}", "public function isComplete()\n {\n return $this->status == 'success';\n }", "function isComplete()\r\n {\r\n return $this->_complete;\r\n }", "public function onTrial() : bool\n {\n return (bool) $this->is_freetrial;\n }", "public function is_complete() {\n return (bool) $this->timecompleted;\n }", "function check_form_submitted()\n {\n $query = $this->recruitment_model->get_faculty_info($this->user_id);\n if($query->num_rows()==1)\n {\n if($query->row()->final_submission==1)\n {\n return 1;\n }\n else\n {\n return 0;\n }\n }\n return 0;\n }", "public function isUsedInAssessments(){\n return ($this->assessments == 1);\n }", "public function isComplete() {\n return $this->getDescription() == 'Done';\n }", "public function isReadyForIssuing()\n {\n return $this->isFeePaid();\n }", "public function isCompleted()\r\n {\r\n return $this->status >= 100 || $this->status == 2;\r\n }", "public function hasFinishScore(){\n return $this->_has(3);\n }", "private function surveyExists($survey_id){\n return sizeof(DB::table('survey')->select('id', 'name')->where('id', $survey_id)->get()) > 0;\n }" ]
[ "0.74926424", "0.66521484", "0.665213", "0.6617402", "0.65840304", "0.6520218", "0.64921725", "0.6483236", "0.63189656", "0.61956435", "0.6131194", "0.6110185", "0.6098907", "0.6092287", "0.6069003", "0.60374725", "0.6025306", "0.601311", "0.5991403", "0.59809124", "0.59728056", "0.59549445", "0.5947051", "0.59411365", "0.59315234", "0.59310544", "0.59110785", "0.59025127", "0.5890335", "0.58862025" ]
0.745034
1
Returns 1, if a survey is complete for use
function _isComplete($obj_id) { $survey = new ilObjSurvey($obj_id, false); $survey->loadFromDb(); if (($survey->getTitle()) and (count($survey->questions))) { return 1; } else { return 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isComplete()\n\t{\n\t\tif (($this->getTitle()) and (count($this->questions)))\n\t\t{\n\t\t\treturn 1;\n\t\t} \n\t\t\telse \n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "function isComplete() {\n\t\t$questions = $this->getQuestions();\n\t\t\n\t\tforeach((array) $questions as $question) {\n\t\t\tif(!$question->hasAnswer($this->_answers)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function is_complete($survey_id)\n\t{\n\t\t$query = $this->db\n\t\t\t->where('survey_id', $survey_id)\n\t\t\t->where('completed IS NOT NULL', NULL, TRUE)\n\t\t\t->where('member_id', $this->session->userdata('member_id'))\n\t\t\t->order_by('updated', 'DESC')\n\t\t\t->limit(1)\n\t\t\t->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function completeSurveyAction() {\n\t\tif (in_array(APPLICATION_ENV, array('development', 'sandbox', 'testing', 'demo'))) {\n\t\t\t$this->_validateRequiredParameters(array('user_id', 'user_key', 'starbar_id', 'survey_type', 'survey_reward_category'));\n\n\t\t\t$survey = new Survey();\n\t\t\t$survey->type = $this->survey_type;\n\t\t\t$survey->reward_category = $this->survey_reward_category;\n\t\t\tGame_Transaction::completeSurvey($this->user_id, $this->starbar_id, $survey);\n\n\t\t\tif ($survey->type == \"survey\" && $survey->reward_category == \"profile\") {\n\t\t\t\t$profileSurvey = new Survey();\n\t\t\t\t$profileSurvey->loadProfileSurveyForStarbar($this->starbar_id);\n\t\t\t\tif ($profileSurvey->id) {\n\t\t\t\t\tDb_Pdo::execute(\"DELETE FROM survey_response WHERE survey_id = ? AND user_id = ?\", $profileSurvey->id, $this->user_id);\n\t\t\t\t\t$surveyResponse = new Survey_Response();\n\t\t\t\t\t$surveyResponse->survey_id = $profileSurvey->id;\n\t\t\t\t\t$surveyResponse->user_id = $this->user_id;\n\t\t\t\t\t$surveyResponse->status = 'completed';\n\t\t\t\t\t$surveyResponse->save();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $this->_resultType(true);\n\t\t} else {\n\t\t\treturn $this->_resultType(false);\n\t\t}\n\t}", "function isComplete()\n\t{\n\t\tif (\n\t\t\tstrlen($this->title) \n\t\t\t&& $this->author \n\t\t\t&& $this->question && \n\t\t\tcount($this->answers) >= $this->correctanswers \n\t\t\t&& $this->getMaximumPoints() > 0\n\t\t)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function isComplete()\n\t{\n\t\tif (($this->title) and ($this->author) and ($this->question) and ($this->getMaximumPoints() > 0))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function hasComplete(){\n return $this->_has(2);\n }", "function questionnaire_user_complete($course, $user, $mod, $questionnaire) {\n global $CFG;\n require_once($CFG->dirroot . '/mod/questionnaire/locallib.php');\n\n if ($responses = questionnaire_get_user_responses($questionnaire->sid, $user->id, $complete = false)) {\n foreach ($responses as $response) {\n if ($response->complete == 'y') {\n echo get_string('submitted', 'questionnaire').' '.userdate($response->submitted).'<br />';\n } else {\n echo get_string('attemptstillinprogress', 'questionnaire').' '.userdate($response->submitted).'<br />';\n }\n }\n } else {\n print_string('noresponses', 'questionnaire');\n }\n\n return true;\n}", "function is_complete_course()\n {\n global $DB, $USER, $CFG;\n $userid = $USER->id;\n require_once(\"$CFG->libdir/gradelib.php\");\n $complete_scorm = 0;\n $complete_quiz = 0;\n\n $modinfo = get_fast_modinfo($this->course);\n\n foreach ($modinfo->get_cms() as $cminfo) {\n\n switch ($cminfo->modname) {\n case 'scorm':\n $params = array(\n \"userid\" => $userid,\n \"scormid\" => $cminfo->instance\n );\n $tracks = $DB->get_records('scorm_scoes_track', $params);\n foreach ($tracks as $track) {\n if (($track->value == 'completed') || ($track->value == 'passed') || ($track->value == 'failed')) {\n $complete_scorm++;\n }\n }\n break;\n case 'quiz':\n\n $grading_info = grade_get_grades($this->course->id, 'mod', 'quiz', $cminfo->instance, $userid);\n $gradebookitem = array_shift($grading_info->items);\n $grade = $gradebookitem->grades[$userid];\n $value = round(floatval(str_replace(\",\", \".\", $grade->str_grade)), 1);\n //verifica se a nota do aluno é igual ou maior que 7 em quiz \n if ($value >= 7.0) {\n $complete_quiz++;\n }\n break;\n default:\n break;\n }\n }\n if ($complete_scorm > 0 && $complete_quiz > 0) {\n return true;\n }\n return false;\n }", "public function getReadyForCompletion() {\n\t\t$ready = $this->getExerciseReadyForCompletion();\n\n\t\t//Is there a question\n\t\tif(count($this->questions) == 0) {\n\t\t\t$ready = 0;\n\t\t} else {\n\t\t\tforeach($this->questions as $question) {\n\t\t\t\t//Is the question filled out\n\t\t\t\t$questionText = $question->getText();\n\t\t\t\tif(empty($questionText)) {\n\t\t\t\t\t$ready= 0;\n\t\t\t\t} else {\n\t\t\t\t\t$possibleAnswers = $question->getPossibleAnswers();\n\t\t\t\t\t//Does it have atleast 2 possible answers\n\t\t\t\t\tif(count($possibleAnswers) < 2) {\n\t\t\t\t\t\t$ready = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tforeach($possibleAnswers as $possibleAnswer) {\n\t\t\t\t\t\t\t//Does each answer have a text\n\t\t\t\t\t\t\t$answerText = $possibleAnswer->getText();\n\t\t\t\t\t\t\tif(empty($answerText)) {\n\t\t\t\t\t\t\t\t$ready= 0;\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\t\treturn $ready;\n\t}", "function isComplete() {\n return (bool) $this->fulfillment['complete'];\n }", "function hasCompletedSurvey($iSurveyId, $sToken) {\n\t\t// Check if this token has already completed this survey\n\t\t$sQuery \t\t= \"SELECT completed FROM lime_tokens_$iSurveyId WHERE token = '$sToken'\";\n\t\t$oResult\t\t= $this->oDbConnection->query($sQuery);\n\t\twhile($aRow = mysqli_fetch_array($oResult)) {\n\t\t\t$isCompleted = $aRow['completed'];\n\t\t}\n\t\treturn (isset($isCompleted) && ($isCompleted != 'N'));\n\t}", "function saveCompletionStatus() \n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$complete = 0;\n\t\tif ($this->isComplete()) \n\t\t{\n\t\t\t$complete = 1;\n\t\t}\n if ($this->getSurveyId() > 0) \n\t\t{\n\t\t\t$affectedRows = $ilDB->manipulateF(\"UPDATE svy_svy SET complete = %s, tstamp = %s WHERE survey_id = %s\",\n\t\t\t\tarray('text','integer','integer'),\n\t\t\t\tarray($this->isComplete(), time(), $this->getSurveyId())\n\t\t\t);\n\t\t}\n\t}", "function isComplete()\n {\n return $this->complete;\n }", "function isCompleted(){\r\n\t\treturn $this->status==IFocusModel::COMPLETE;\r\n\t}", "function languagelesson_is_lesson_complete($lessonid, $userid) {\n\tglobal $CFG, $DB, $LL_QUESTION_TYPE;\n\n // Pull the list of all question types as a string of format [type],[type],[type],.\n\t$qtypeslist = implode(',', array_keys($LL_QUESTION_TYPE));\n\n\t\n// Find the number of question pages \n\t\n // This alias must be the same in both queries, so establish it here.\n\t$tmp_name = \"page\";\n // A sub-query used to ignore pages that have no answers stored for them\n // (instruction pages).\n\t$do_answers_exist = \"select *\n\t\t\t\t\t\t from {$CFG->prefix}languagelesson_answers ans\n\t\t\t\t\t\t where ans.pageid = $tmp_name.id\";\n // Query to pull only pages of stored languagelesson question types, belonging\n // to the current lesson, and having answer records stored.\n\t$get_only_question_pages = \"select *\n\t\t\t\t\t\t\t\tfrom {$CFG->prefix}languagelesson_pages $tmp_name\n\t\t\t\t\t\t\t\twhere qtype in ($qtypeslist)\n\t\t\t\t\t\t\t\t\t and $tmp_name.lessonid=$lessonid\n\t\t\t\t\t\t\t\t\t and exists ($do_answers_exist)\";\n\t$qpages = $DB->get_records_sql($get_only_question_pages);\n\t$numqpages = count($qpages);\n\t\n\t\n// Find the number of questions attempted.\n\t\n\t// See how many questions have been attempted.\n\t$numattempts = languagelesson_count_most_recent_attempts($lessonid, $userid);\n\n\t// If the number of question pages matches the number of attempted questions, it's complete.\n\tif ($numqpages == $numattempts) { return true; }\n\telse { return false; }\n}", "public function activateOfficialsSurvey()\n {\n return $this->mailer->activateOfficialsSurvey($this->data);\n }", "function isSurveyStarted($user_id, $anonymize_id, $appr_id = 0)\n\t{\n\t\tglobal $ilDB;\n\n\t\t// #15031 - should not matter if code was used by registered or anonymous (each code must be unique)\n\t\tif($anonymize_id)\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND anonymous_id = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','text','integer'),\n\t\t\t\tarray($this->getSurveyId(), $anonymize_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\tif ($result->numRows() == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($result);\n\t\t\t\n\t\t\t// yes, we are doing it this way\n\t\t\t$_SESSION[\"finished_id\"][$this->getId()] = $row[\"finished_id\"];\n\t\t\t\n\t\t\treturn (int)$row[\"state\"];\n\t\t}\n\n\t\t/*\n\t\tif ($this->getAnonymize())\n\t\t{\n\t\t\tif ((($user_id != ANONYMOUS_USER_ID) && sizeof($anonymize_id)) && (!($this->isAccessibleWithoutCode() && $this->isAllowedToTakeMultipleSurveys())))\n\t\t\t{\n\t\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\t\" WHERE survey_fi = %s AND anonymous_id = %s AND appr_id = %s\",\n\t\t\t\t\tarray('integer','text','integer'),\n\t\t\t\t\tarray($this->getSurveyId(), $anonymize_id, $appr_id)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\tif ($result->numRows() == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($result);\n\t\t\t$_SESSION[\"finished_id\"][$this->getId()] = $row[\"finished_id\"];\n\t\t\treturn (int)$row[\"state\"];\n\t\t}\t\t\n\t\t*/\n\t}", "public function isComplete()\n\t{\n\t\treturn $this->status == 'Complete';\n\t}", "public function isComplete()\n {\n return $this->status == 'success';\n }", "function isComplete()\r\n {\r\n return $this->_complete;\r\n }", "public function onTrial() : bool\n {\n return (bool) $this->is_freetrial;\n }", "public function is_complete() {\n return (bool) $this->timecompleted;\n }", "function check_form_submitted()\n {\n $query = $this->recruitment_model->get_faculty_info($this->user_id);\n if($query->num_rows()==1)\n {\n if($query->row()->final_submission==1)\n {\n return 1;\n }\n else\n {\n return 0;\n }\n }\n return 0;\n }", "public function isUsedInAssessments(){\n return ($this->assessments == 1);\n }", "public function isComplete() {\n return $this->getDescription() == 'Done';\n }", "public function isReadyForIssuing()\n {\n return $this->isFeePaid();\n }", "public function isCompleted()\r\n {\r\n return $this->status >= 100 || $this->status == 2;\r\n }", "public function hasFinishScore(){\n return $this->_has(3);\n }", "private function surveyExists($survey_id){\n return sizeof(DB::table('survey')->select('id', 'name')->where('id', $survey_id)->get()) > 0;\n }" ]
[ "0.74526906", "0.6654149", "0.66524255", "0.6616924", "0.65860105", "0.6522615", "0.6495263", "0.64833015", "0.6320306", "0.6198287", "0.6133489", "0.61097217", "0.60994685", "0.6095202", "0.6071363", "0.60378426", "0.60249984", "0.6013118", "0.5994098", "0.5982669", "0.5975891", "0.59557986", "0.5950148", "0.5942273", "0.59334993", "0.59334695", "0.59150654", "0.5904925", "0.58924985", "0.58850986" ]
0.7493288
0
Saves the completion status of the survey
function saveCompletionStatus() { global $ilDB; $complete = 0; if ($this->isComplete()) { $complete = 1; } if ($this->getSurveyId() > 0) { $affectedRows = $ilDB->manipulateF("UPDATE svy_svy SET complete = %s, tstamp = %s WHERE survey_id = %s", array('text','integer','integer'), array($this->isComplete(), time(), $this->getSurveyId()) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function save() {\n\t\t// If every question is answered, save to the db. Otherwise, to session.\n\t\tif($this->isComplete()) {\n\t\t\t$this->saveToRecord();\n\t\t} else {\n\t\t\t$this->saveToSession();\n\t\t}\n\t}", "public function completeSurveyAction() {\n\t\tif (in_array(APPLICATION_ENV, array('development', 'sandbox', 'testing', 'demo'))) {\n\t\t\t$this->_validateRequiredParameters(array('user_id', 'user_key', 'starbar_id', 'survey_type', 'survey_reward_category'));\n\n\t\t\t$survey = new Survey();\n\t\t\t$survey->type = $this->survey_type;\n\t\t\t$survey->reward_category = $this->survey_reward_category;\n\t\t\tGame_Transaction::completeSurvey($this->user_id, $this->starbar_id, $survey);\n\n\t\t\tif ($survey->type == \"survey\" && $survey->reward_category == \"profile\") {\n\t\t\t\t$profileSurvey = new Survey();\n\t\t\t\t$profileSurvey->loadProfileSurveyForStarbar($this->starbar_id);\n\t\t\t\tif ($profileSurvey->id) {\n\t\t\t\t\tDb_Pdo::execute(\"DELETE FROM survey_response WHERE survey_id = ? AND user_id = ?\", $profileSurvey->id, $this->user_id);\n\t\t\t\t\t$surveyResponse = new Survey_Response();\n\t\t\t\t\t$surveyResponse->survey_id = $profileSurvey->id;\n\t\t\t\t\t$surveyResponse->user_id = $this->user_id;\n\t\t\t\t\t$surveyResponse->status = 'completed';\n\t\t\t\t\t$surveyResponse->save();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $this->_resultType(true);\n\t\t} else {\n\t\t\treturn $this->_resultType(false);\n\t\t}\n\t}", "public function save(){\n\t\t// yei bata feri \"index.php\" ma falne jun chai profile ma jancha\n\t\t$req = new Requirement();\n\n\t\tif(isset($_POST['title'])){\n\t\t$req->setTitle($_POST['title']);\n\t\t}else{\n\t\t\t$req->setTitle(\"\");\n\t\t}\n\t\tif(isset($_POST['date'])){\n\n\t\t$req->setDate($_POST['date']);\n\t\t}else{\n\t\t\t$req->setDate(\"01-01-2001\");\n\t\t}\n\t\tif(isset($_POST['details'])){\n\t\t$req->setDescription($_POST['details']);\n\t\t}else{\n\t\t\t$req->setDescription(\"\");\n\t\t}\n\t\t$req->setStatus(1);\n\t\t$req->setOrgname(\"\");\n\t\t$this->requirement_repository->insert($req);\n\n\t}", "public function save()\n {\n parent::save();\n\n // make sure that we are auditing this phase's survey\n $this->ensure_auditing();\n }", "public function mark_complete() {\n // Create record\n $this->timecompleted = time();\n\n // Save record\n if ($this->id) {\n $this->update();\n } else {\n $this->insert();\n }\n\n // Mark course completion record as started (if not already)\n $cc = array(\n 'course' => $this->course,\n 'userid' => $this->userid\n );\n $ccompletion = new completion_completion($cc);\n $ccompletion->mark_inprogress($this->timecompleted);\n }", "protected function _saveStatus()\n {\n try {\n\n /**\n * update task statuses with completion days\n */\n foreach( $this->_status as $key => $val ) {\n\n if ( in_array( $key, $this->_tasks ) ) {\n $task = Mage::getModel('jirafe_analytics/install')\n ->getCollection()\n ->addFieldToFilter( 'task', $key )\n ->getFirstItem();\n\n $task->setCompletedDt( $val );\n $task->save();\n }\n }\n\n /**\n * refresh status values in cache\n *\n */\n $this->_saveStatusToCache();\n\n return true;\n\n } catch (Exception $e) {\n Mage::helper('jirafe_analytics')->log('ERROR', 'Jirafe_Analytics_Model_Installer::_saveStatus()', $e->getMessage(), $e);\n return false;\n }\n }", "public function save() {\n JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\n // Initialise variables.\n $app = JFactory::getApplication();\n $model = $this->getModel('DwOpportunityresponsestatusForm', 'Dw_opportunities_responses_statusesModel');\n\n // Get the user data.\n $data = JFactory::getApplication()->input->get('jform', array(), 'array');\n\n\t\t// Check if user can edit or create the item ---------------------------------------------------------------------------------------------\n\t\t$id = ( ( $data['id'] == 0 ) || !isset ( $data['id'] ) ) ? null : (int)$data['id'];\n $user = JFactory::getUser();\n\n if( $id ) \n\t\t{\n \t//Check the user can edit this item\n $authorised = $user->authorise('core.edit', 'com_dw_opportunities_responses_statuses');\n\t\t\t\n\t\t\tif(!$authorised && $user->authorise('core.edit.own', 'com_dw_opportunities_responses_statuses'))\n\t\t\t{\n\t\t\t\t//Check the owner from the model\n\t\t\t\t$itemData = $model -> getData($id);\n\t\t\t\t$itemOwner = ( isset ( $itemData -> created_by ) ) ? $itemData -> created_by : null ;\n\t\t\t\t$authorised = $user -> id == $itemOwner ; \n\t\t\t}\n\t\t\n } \n\t\telse \n\t\t{\n //Check the user can create new item\n $authorised = $user->authorise('core.create', 'com_dw_opportunities_responses_statuses');\n\t\t\t\n //Check the user has already created a status for this response_id ( ONLY 1 allowed )\n if( $authorised )\n {\n\t\t\t\t$response_id = ( !empty( $data['response_id'] ) ) ? $data['response_id'] : 0 ;\n\t\t\t\t\n\t\t\t\tJModelLegacy::addIncludePath(JPATH_SITE . '/components/com_dw_opportunities_responses_statuses/models', 'Dw_opportunities_responses_statusesModel');\n\t\t\t\t$responsesstatusesModel = JModelLegacy::getInstance('DWOpportunitiesresponsesstatuses', 'Dw_opportunities_responses_statusesModel', array('ignore_request' => true)); \n\t\t\t\t$responsesstatuses = $responsesstatusesModel -> getItemsByResponse( $response_id );\n\n\t\t\t\tif( $responsesstatuses )\n\t\t\t\t{\n\t\t\t\t\t$authorised = false ;\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t\n }\t\t\n\t\t\n\t\tif( $authorised )\n\t\t{\n\t\t\t//Check if the response belongs to an opportunity that is created by the user\n\t\t\t\n\t\t\t//Get the response object\n\t\t\tJModelLegacy::addIncludePath(JPATH_SITE . '/components/com_dw_opportunities_responses/models', 'Dw_opportunities_responsesModel');\n\t\t\t$responseModel = JModelLegacy::getInstance('DwOpportunityresponse', 'Dw_opportunities_responsesModel', array('ignore_request' => true));\t\n\t\t\t$response = $responseModel ->getData ( $data['response_id'] );\n\t\t\t\n\t\t\t//Get the opportunity\n\t\t\tJModelLegacy::addIncludePath(JPATH_SITE . '/components/com_dw_opportunities/models', 'Dw_opportunitiesModel');\n\t\t\t$opportunityModel = JModelLegacy::getInstance('DwOpportunity', 'Dw_opportunitiesModel', array('ignore_request' => true));\t\n\t\t\t$opportunity = $opportunityModel -> getData ( $response -> opportunity_id );\n\t\t\t\n\t\t\t$authorised = $user -> id == $opportunity -> created_by;\n\t\t\t\n\t\t}\n\n\t\tif (!$authorised)\n\t\t{\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\techo new JResponseJson( '' , JText::_('COM_DW_OPPORTUNITIES_RESPONSES_STATUSES_WIZARD_PERMISSION_DENIED') , true );\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\techo new JResponseJson($e);\n\t\t\t}\n\t\t\n\t\t\tjexit();\n\t\t}\n\t\t// ------------------------------------------------------------------------------------------------------------------------------\n\t\t\n\t\t\n // Validate the posted data.\n $form = $model->getForm();\n if (!$form) {\n JError::raiseError(500, $model->getError());\n return false;\n }\n\n // Validate the posted data.\n $data = $model->validate($form, $data);\n\n // Check for errors.\n if ($data === false) {\n // Get the validation messages.\n $errors = $model->getErrors();\n\n // Push up to three validation messages out to the user.\n for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) {\n if ($errors[$i] instanceof Exception) {\n $app->enqueueMessage($errors[$i]->getMessage(), 'warning');\n } else {\n $app->enqueueMessage($errors[$i], 'warning');\n }\n }\n\n $input = $app->input;\n $jform = $input->get('jform', array(), 'ARRAY');\n\n // Save the data in the session.\n $app->setUserState('com_dw_opportunities_responses_statuses.edit.opportunityresponsestatus.data', $jform, array());\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\techo new JResponseJson( '' , $errors , true );\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\techo new JResponseJson($e);\n\t\t\t}\n\t\t\n\t\t\tjexit();\n }\n\t\t\n\t\t//parameters fields convert into json before save - yesinternet\n\t\tif (isset($data['parameters']) && is_array($data['parameters']))\n\t\t{\n\t\t\t$registry = new JRegistry;\n\t\t\t$registry->loadArray($data['parameters']);\n\t\t\t$data['parameters'] = (string) $registry;\n\t\t}\n\n // Attempt to save the data.\n $return = $model->save($data);\n\n // Check for errors.\n if ($return === false) {\n // Save the data in the session.\n $app->setUserState('com_dw_opportunities_responses_statuses.edit.opportunityresponsestatus.data', $data);\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\techo new JResponseJson( '' , 'Could not save the data' , true );\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\techo new JResponseJson($e);\n\t\t\t}\n\t\t\n\t\t\tjexit();\n }\n\n\n // Check in the profile.\n if ($return) {\n $model->checkin($return);\n }\n\n\t\t//Notify volunteer about the new status ----------------------------------------------------------------------------------------------------\n\t\tJPluginHelper::importPlugin('donorwiz');\n\t\t$dispatcher\t= JEventDispatcher::getInstance();\n\t\t$dispatcher->trigger( 'onOpportunityResponseStatusUpdate' , array( &$data ) );\n\t\t\n\t\ttry\n\t\t{\n\t\t\techo new JResponseJson( $return );\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\techo new JResponseJson($e);\n\t\t}\n\t\n\t\tjexit();\n\n\t\t}", "public function action_save()\n {\n // clear old reject info\n $this->setRejectInfo(null);\n\n if (isset($this->m_partial) && !empty($this->m_partial)) {\n $this->partial($this->m_partial);\n\n return;\n } else {\n $this->doSave();\n }\n }", "public function saveAction()\n {\n $user = Mage::getSingleton('admin/session')->getUser(); \n $post_data = $this->getRequest()->getPost();\n\n try {\n $survey = Mage::getModel('client/survey')->loadSurveyByEmail($user->getEmail());\n if ($survey->getId()) $post_data['id'] = $survey->getId();\n\n $survey->setData($post_data);\n $survey->setName($user->getName());\n $survey->setEmail($user->getEmail());\n\n $survey->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('client')->__('Survey was successfully saved. Thank you!'));\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n }\n\n $this->_redirect('*/*/');\n }", "function saveUserSurvey() {\n $result = array(); // an array to hold the survey results\n if (!$this->Session->check('Survey.respondent')) {\n die('No respondent ID');\n } else {\n $respondentid = $this->Session->read('Survey.respondent');\n $i = $this->Survey->Respondent->find('count', array(\n 'conditions' => array('Respondent.id' => $respondentid)\n ));\n if ($i !== 1) {\n die('Respondent not valid'.$i.' rid '.$respondentid);\n }\n }\n $data = array('Response' => array()); // a blank array to build our data for saving\n $answers = ($this->Session->check('Survey.answers')) ? $this->Session->read('Survey.answers') : array(); // get the answers to the questions\n $gdta = ($this->Session->check('Survey.hierarcy')) ? $this->Session->read('Survey.hierarcy') : array(); // the hierarchy from the session\n $mainGoal = ($this->Session->check('Survey.mainGoal')) ? $this->Session->read('Survey.mainGoal') : ''; // the main goal from the session\n $started = ($this->Session->check('Survey.started')) ? $this->Session->read('Survey.started') : ''; // the start time from the session\n $finished = date(\"Y-m-d H:i:s\"); // get the time that the survey was finished in MySQL DATETIME format\n $data['Response']['maingoal'] = $mainGoal;\n $data['Response']['respondent_id'] = $respondentid;\n $data['Response']['started'] = $started;\n $data['Response']['finished'] = $finished;\n $data['Answer'] = $this->Survey->Question->formatAnswersForSave($answers);\n $data['Objective'] = $gdta;\n $this->Survey->Respondent->Response->save($data);\n $data['Response']['id'] = $this->Survey->Respondent->Response->id;\n $this->Survey->Respondent->Response->saveAssociated($data,array('deep' => true));\n $this->__clearEditSession(CLEAR_SURVEY); // delete the temporary session values associated with the survey\n $this->render('/Pages/completed', 'survey');\n }", "protected function afterSave(){\n /*\n * Link Complete,if you wanna the status can be changed anyway,\n * no matter it was complete or not,then coment's out this line: if ($this->progressstatus == 4) {\n */\n if ($this->progressstatus == 4) {\n $cptmodel = CampaignTask::model()->findByAttributes(array('campaign_id'=>$this->campaign_id));\n if ($cptmodel) {\n $cptmodel->setIsNewRecord(false);\n $cptmodel->setScenario('update');\n $pcount = Task::model()->countByAttributes(array('campaign_id'=>$this->campaign_id, 'progressstatus'=>4));\n $cptmodel->published_count = $pcount;\n if ($cptmodel->total_count > 0) {\n $cptmodel->percentage_done = round($cptmodel->published_count / $cptmodel->total_count, 3);\n }\n $cptmodel->save();\n }\n }\n\n return parent::afterSave();\n }", "function pafd_action_save_status() {\n\n\tif ( 'pa_file' == K::get_var( 'post_type', $_POST ) ) {\n\n\t\tglobal $post;\n\n\t\t$nonce = K::get_var( 'pafd-status-nonce', $_POST );\n\t\t$action = 'pafd_save_status';\n\t\t$status = (int) K::get_var( 'pafd-status', $_POST);\n\n\t\t// Check nonce\n\t\tif ( ! wp_verify_nonce( $nonce, $action ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Ignore autosave\n\t\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Save the status\n\t\twp_set_object_terms( $post->ID, $status, 'pafd_status' );\n\t}\n}", "public function taskComplete(){\n $taskId = $_POST[\"taskId\"];\n\n $this->individualGroupModel->changeTaskCompletion($taskId, true);\n\n //redirect\n $path = '/IndividualGroupController/individualGroup?groupId=' . $_SESSION['current_group']; \n redirect($path);\n }", "function save() {\n $keys = $this->fulfillment['sfid'] ? array('sfid') : array();\n $ret = drupal_write_record('course_outline_fulfillment', $this->fulfillment, $keys);\n\n // Create a Course to track the user's progress.\n $course = new Course($this->getCourseObject()->getCourseNid(), $this->fulfillment['uid']);\n $course->track();\n\n return $ret;\n }", "public function setSuccess()\n {\n $this->attributes['status'] = 2;\n self::save();\n }", "function save_test_completed_date()\n\t{\n\t\t$this->load->model('frontendmodel');\n\n\t\t$this->frontendmodel->update_test_completed_date();\n\t}", "function finishSurvey($finished_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$ilDB->manipulateF(\"UPDATE svy_finished SET state = %s, tstamp = %s\".\n\t\t\t\" WHERE survey_fi = %s AND finished_id = %s\",\n\t\t\tarray('text','integer','integer','integer'),\n\t\t\tarray(1, time(), $this->getSurveyId(), $finished_id)\n\t\t);\t\t\t\n\t\t\n\t\t$this->checkTutorNotification();\n\t}", "public function saveEditAssignStaff($form, $sth_complete)\n {\n $curr_usr = $this->staff_id;\n $curr_date = \"date_trunc('second', NOW()::timestamp)\";\n $status = $form['status'];\n $role = $form['role'];\n\n $sth_approve_by = '';\n $sth_approve_date = '';\n $sth_verify_by = '';\n $sth_verify_date = '';\n $sth_recommend_by = '';\n $sth_recommend_date = '';\n\n // AUTO ASSIGN ROLE PESERTA\n if(empty($form['role'])) {\n $role = 'D';\n }\n\n if($status == 'APPROVE' || $status == 'REJECT') {\n $sth_approve_by = $curr_usr;\n $sth_approve_date = $curr_date;\n } elseif($status == 'RECOMMEND') {\n $sth_verify_by = $curr_usr;\n $sth_verify_date = $curr_date;\n } elseif($status == 'RECOMMEND_BSM') {\n $sth_recommend_by = $curr_usr;\n $sth_recommend_date = $curr_date;\n }\n\n $data = array(\n \"sth_participant_role\" => $role,\n \"sth_status\" => $form['status'],\n \"sth_fee_code\" => $form['fee_category'],\n \"sth_staff_training_benefit\" => $form['tr_benefit_stf'],\n \"sth_dept_training_benefit\" => $form['tr_benefit_dept'],\n \"sth_recommender_reason\" => $form['remark'],\n \"sth_approve_reason\" => $form['remark_other'],\n \"sth_hod_evaluation\" => $form['eva_status'],\n \"sth_enter_by\" => $curr_usr,\n );\n\n $this->db->set(\"sth_enter_date\", $curr_date, false);\n\n // APPROVE & REJECT\n if(!empty($sth_approve_by)) {\n $this->db->set(\"sth_approve_by\", $sth_approve_by);\n }\n\n if(!empty($sth_approve_date)) {\n $this->db->set(\"sth_approve_date\", $sth_approve_date, false);\n }\n\n // RECOMMEND\n if(!empty($sth_verify_by)) {\n $this->db->set(\"sth_verify_by\", $sth_verify_by);\n }\n\n if(!empty($sth_verify_date)) {\n $this->db->set(\"sth_verify_date\", $sth_verify_date, false);\n }\n\n // RECOMMEND_BSM\n if(!empty($sth_recommend_by)) {\n $this->db->set(\"sth_recommend_by\", $sth_recommend_by);\n }\n\n if(!empty($sth_recommend_date)) {\n $this->db->set(\"sth_recommend_date\", $sth_recommend_date, false);\n }\n\n // STH_COMPLETE\n if(!empty($sth_complete)) {\n $this->db->set(\"sth_complete\", $sth_complete);\n }\n\n // // STH_EVALUATOR_ID\n // if(!empty($eva_id)) {\n // $this->db->set(\"STH_EVALUATOR_ID\", $eva_id);\n // }\n \n $this->db->where(\"sth_training_refid\", $form['refid']);\n $this->db->where(\"sth_staff_id\", $form['staff_id_form']);\n\n return $this->db->update(\"ims_hris.staff_training_head\", $data);\n }", "public function submit() {\r\n global $db;\r\n\r\n $this->status = SUBMITTED;\r\n $this->saveMe();\r\n\r\n $sql = \"SELECT d.division_id FROM users as u\r\n LEFT JOIN departments AS d ON d.department_id = u.department_id\r\n WHERE u.user_id = \" . $this->userId;\r\n $divisionId = $db->getRow($sql);\r\n\r\n // save the approvals to the database\r\n foreach($this->approvals as $approval) {\r\n $approval->save($divisionId['division_id']);\r\n }\r\n\r\n $sql = sprintf(\"UPDATE `forms_tracking` SET\r\n `submit_date` = NOW()\r\n WHERE `form_tracking_id` = %s\",\r\n $this->trackingFormId\r\n );\r\n $db->Execute($sql);\r\n\r\n $this->sendSubmissionConfirmationEmail();\r\n\r\n // send notifications\r\n $this->notifyORS();\r\n\r\n // notify Dean if deadline is within DEAN_NOTIFICATION_THRESHOLD_DAYS\r\n if(isset($this->deadline)) {\r\n $dateThreshold = strtotime(DEAN_NOTIFICATION_THRESHOLD_DAYS);\r\n $deadline = strtotime($this->deadline);\r\n if($deadline < $dateThreshold) {\r\n $this->notifyDean();\r\n }\r\n }\r\n\r\n if($this->compliance->requiresBehavioural()) {\r\n $this->notifyHREB();\r\n }\r\n }", "public function saveAssignStaff($form, $sth_complete, $eva_id)\n {\n $curr_usr = $this->staff_id;\n $curr_date = \"date_trunc('second', NOW()::timestamp)\";\n $status = $form['status'];\n $role = $form['role'];\n\n $sth_approve_by = '';\n $sth_approve_date = '';\n $sth_verify_by = '';\n $sth_verify_date = '';\n $sth_recommend_by = '';\n $sth_recommend_date = '';\n\n // AUTO ASSIGN ROLE PESERTA\n if(empty($form['role'])) {\n $role = 'D';\n }\n\n if($status == 'APPROVE' || $status == 'REJECT') {\n $sth_approve_by = $curr_usr;\n $sth_approve_date = $curr_date;\n } elseif($status == 'RECOMMEND') {\n $sth_verify_by = $curr_usr;\n $sth_verify_date = $curr_date;\n } elseif($status == 'RECOMMEND_BSM') {\n $sth_recommend_by = $curr_usr;\n $sth_recommend_date = $curr_date;\n }\n\n $data = array(\n \"sth_training_refid\" => $form['refid'],\n \"sth_staff_id\" => $form['staff_id_form'],\n \"sth_participant_role\" => $role,\n \"sth_status\" => $form['status'],\n \"sth_fee_code\" => $form['fee_category'],\n \"sth_staff_training_benefit\" => $form['tr_benefit_stf'],\n \"sth_dept_training_benefit\" => $form['tr_benefit_dept'],\n \"sth_recommender_reason\" => $form['remark'],\n \"sth_approve_reason\" => $form['remark_other'],\n \"sth_hod_evaluation\" => $form['eva_status'],\n \"sth_enter_by\" => $curr_usr,\n );\n\n $this->db->set(\"sth_enter_date\", $curr_date, false);\n\n // APPROVE & REJECT\n if(!empty($sth_approve_by)) {\n $this->db->set(\"sth_approve_by\", $sth_approve_by);\n }\n\n if(!empty($sth_approve_date)) {\n $this->db->set(\"sth_approve_date\", $sth_approve_date, false);\n }\n\n // RECOMMEND\n if(!empty($sth_verify_by)) {\n $this->db->set(\"sth_verify_by\", $sth_verify_by);\n }\n\n if(!empty($sth_verify_date)) {\n $this->db->set(\"sth_verify_date\", $sth_verify_date, false);\n }\n\n // RECOMMEND_BSM\n if(!empty($sth_recommend_by)) {\n $this->db->set(\"sth_recommend_by\", $sth_verify_by);\n }\n\n if(!empty($sth_recommend_date)) {\n $this->db->set(\"sth_recommend_date\", $sth_recommend_date, false);\n } \n\n // STH_COMPLETE\n if(!empty($sth_complete)) {\n $this->db->set(\"sth_complete\", $sth_complete);\n }\n\n // STH_EVALUATOR_ID\n if(!empty($eva_id)) {\n $this->db->set(\"sth_evaluator_id\", $eva_id);\n }\n\n return $this->db->insert(\"ims_hris.staff_training_head\", $data);\n }", "public function updateStatus() {\n $ref = ORM::forTable('referrals')\n ->findOne($this->data['id']);\n if ($this->data['status'] == 'Assigned' && $this->data['route_id']) {\n $route = ORM::forTable('estimate_routes')\n ->findOne($this->data['route_id']);\n $assignedReferralsCount = ORM::forTable('referrals')\n ->select('id')\n ->where('route_id', $route->id)\n ->count();\n $ref->route_id = $this->data['route_id'];\n $ref->status = 'Assigned';\n $ref->route_order = $assignedReferralsCount;\n\n } elseif ($this->data['status'] == 'Pending') {\n $ref->status = 'Pending';\n $ref->route_order = 0;\n $ref->route_id = NULL;\n } else {\n $ref->status = $this->data['status'];\n }\n if ($ref->save()) {\n $this->renderJson([\n 'success' => true,\n 'message' => 'Job request status updated successfully'\n ]);\n } else {\n $this->renderJson([\n 'success' => false,\n 'message' => 'An error has occurred while saving job request'\n ]);\n }\n }", "public function setSuccess()\n {\n $this->attributes['status'] = 'success';\n self::save();\n }", "public function setSuccess()\n {\n $this->attributes['status'] = 'success';\n self::save();\n }", "function save() {\n\t\tif ($this->input->post('contracts_show_due')) {\n\n\t\t\t$this->mdl_mcb_data->save('contracts_show_due', $this->input->post('contracts_show_due'));\n\n\t\t}\n\n\t\telse {\n\n\t\t\t$this->mdl_mcb_data->save('contracts_show_due', \"FALSE\");\n\n\t\t}\n\t}", "public function postUpdateStatus(){\n\t\t$expense_id = Input::get('expense_id');\n\t\t$status = Input::get('status');\n\t\t$expense = Expense::find($expense_id);\n\t\t$expense->status = $status;\n\t\t$expense->save();\n\t}", "public function complete()\n {\n if ($this->withdrawal->status == Withdrawal::STATUS_IN_PROGRESS) {\n // update withdrawal model\n $this->withdrawal->status = Withdrawal::STATUS_COMPLETED;\n $this->withdrawal->save();\n }\n }", "public function completable()\n {\n $this->status = self::STATUS_COMPLETABLE;\n $this->save();\n\n\t\t$this->fireModelEvent('completable');\n }", "function saveToDb()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t// date handling\n\t\t$rmd_start = $this->getReminderStart();\n\t\tif(is_object($rmd_start))\n\t\t{\n\t\t\t$rmd_start = $rmd_start->get(IL_CAL_DATE);\n\t\t}\n\t\t$rmd_end = $this->getReminderEnd();\n\t\tif(is_object($rmd_end))\n\t\t{\n\t\t\t$rmd_end = $rmd_end->get(IL_CAL_DATE);\n\t\t}\n\t\t\n\t\tinclude_once(\"./Services/RTE/classes/class.ilRTE.php\");\n\t\tif ($this->getSurveyId() < 1)\n\t\t{\n\t\t\t$next_id = $ilDB->nextId('svy_svy');\n\t\t\t$affectedRows = $ilDB->insert(\"svy_svy\", array(\n\t\t\t\t\"survey_id\" => array(\"integer\", $next_id),\n\t\t\t\t\"obj_fi\" => array(\"integer\", $this->getId()),\n\t\t\t\t\"author\" => array(\"text\", $this->getAuthor()),\n\t\t\t\t\"introduction\" => array(\"clob\", ilRTE::_replaceMediaObjectImageSrc($this->getIntroduction(), 0)),\n\t\t\t\t\"outro\" => array(\"clob\", ilRTE::_replaceMediaObjectImageSrc($this->getOutro(), 0)),\n\t\t\t\t\"status\" => array(\"text\", $this->getStatus()),\n\t\t\t\t\"startdate\" => array(\"text\", $this->getStartDate()),\n\t\t\t\t\"enddate\" => array(\"text\", $this->getEndDate()),\n\t\t\t\t\"evaluation_access\" => array(\"text\", $this->getEvaluationAccess()),\n\t\t\t\t\"invitation\" => array(\"text\", $this->getInvitation()),\n\t\t\t\t\"invitation_mode\" => array(\"text\", $this->getInvitationMode()),\n\t\t\t\t\"complete\" => array(\"text\", $this->isComplete()),\n\t\t\t\t\"created\" => array(\"integer\", time()),\n\t\t\t\t\"anonymize\" => array(\"text\", $this->getAnonymize()),\n\t\t\t\t\"show_question_titles\" => array(\"text\", $this->getShowQuestionTitles()),\n\t\t\t\t\"mailnotification\" => array('integer', ($this->getMailNotification()) ? 1 : 0),\n\t\t\t\t\"mailaddresses\" => array('text', strlen($this->getMailAddresses()) ? $this->getMailAddresses() : NULL),\n\t\t\t\t\"mailparticipantdata\" => array('text', strlen($this->getMailParticipantData()) ? $this->getMailParticipantData() : NULL),\n\t\t\t\t\"tstamp\" => array(\"integer\", time()),\n\t\t\t\t\"template_id\" => array(\"integer\", $this->getTemplate()),\n\t\t\t\t\"pool_usage\" => array(\"integer\", $this->getPoolUsage()),\n\t\t\t\t// 360°\n\t\t\t\t\"mode_360\" => array(\"integer\", $this->get360Mode()),\n\t\t\t\t\"mode_360_self_eval\" => array(\"integer\", $this->get360SelfEvaluation()),\n\t\t\t\t\"mode_360_self_rate\" => array(\"integer\", $this->get360SelfRaters()),\n\t\t\t\t\"mode_360_self_appr\" => array(\"integer\", $this->get360SelfAppraisee()),\n\t\t\t\t\"mode_360_results\" => array(\"integer\", $this->get360Results()),\n\t\t\t\t\"mode_360_skill_service\" => array(\"integer\", (int) $this->get360SkillService()),\n\t\t\t\t// reminder/notification\n\t\t\t\t\"reminder_status\" => array(\"integer\", (int)$this->getReminderStatus()),\n\t\t\t\t\"reminder_start\" => array(\"datetime\", $rmd_start),\n\t\t\t\t\"reminder_end\" => array(\"datetime\", $rmd_end),\n\t\t\t\t\"reminder_frequency\" => array(\"integer\", (int)$this->getReminderFrequency()),\t\t\t\t\n\t\t\t\t\"reminder_target\" => array(\"integer\", (int)$this->getReminderTarget()),\n\t\t\t\t\"reminder_last_sent\" => array(\"datetime\", $this->getReminderLastSent()),\n\t\t\t\t\"tutor_ntf_status\" => array(\"integer\", (int)$this->getTutorNotificationStatus()),\n\t\t\t\t\"tutor_ntf_reci\" => array(\"text\", implode(\";\", (array)$this->getTutorNotificationRecipients())),\n\t\t\t\t\"tutor_ntf_target\" => array(\"integer\", (int)$this->getTutorNotificationTarget()),\n\t\t\t\t\"own_results_view\" => array(\"integer\", $this->hasViewOwnResults()),\n\t\t\t\t\"own_results_mail\" => array(\"integer\", $this->hasMailOwnResults())\n \t\t\t));\n\t\t\t$this->setSurveyId($next_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$affectedRows = $ilDB->update(\"svy_svy\", array(\n\t\t\t\t\"author\" => array(\"text\", $this->getAuthor()),\n\t\t\t\t\"introduction\" => array(\"clob\", ilRTE::_replaceMediaObjectImageSrc($this->getIntroduction(), 0)),\n\t\t\t\t\"outro\" => array(\"clob\", ilRTE::_replaceMediaObjectImageSrc($this->getOutro(), 0)),\n\t\t\t\t\"status\" => array(\"text\", $this->getStatus()),\n\t\t\t\t\"startdate\" => array(\"text\", $this->getStartDate()),\n\t\t\t\t\"enddate\" => array(\"text\", $this->getEndDate()),\n\t\t\t\t\"evaluation_access\" => array(\"text\", $this->getEvaluationAccess()),\n\t\t\t\t\"invitation\" => array(\"text\", $this->getInvitation()),\n\t\t\t\t\"invitation_mode\" => array(\"text\", $this->getInvitationMode()),\n\t\t\t\t\"complete\" => array(\"text\", $this->isComplete()),\n\t\t\t\t\"anonymize\" => array(\"text\", $this->getAnonymize()),\n\t\t\t\t\"show_question_titles\" => array(\"text\", $this->getShowQuestionTitles()),\n\t\t\t\t\"mailnotification\" => array('integer', ($this->getMailNotification()) ? 1 : 0),\n\t\t\t\t\"mailaddresses\" => array('text', strlen($this->getMailAddresses()) ? $this->getMailAddresses() : NULL),\n\t\t\t\t\"mailparticipantdata\" => array('text', strlen($this->getMailParticipantData()) ? $this->getMailParticipantData() : NULL),\n\t\t\t\t\"tstamp\" => array(\"integer\", time()),\n\t\t\t\t\"template_id\" => array(\"integer\", $this->getTemplate()),\n\t\t\t\t\"pool_usage\" => array(\"integer\", $this->getPoolUsage()),\n\t\t\t\t// 360°\n\t\t\t\t\"mode_360\" => array(\"integer\", $this->get360Mode()),\n\t\t\t\t\"mode_360_self_eval\" => array(\"integer\", $this->get360SelfEvaluation()),\n\t\t\t\t\"mode_360_self_rate\" => array(\"integer\", $this->get360SelfRaters()),\n\t\t\t\t\"mode_360_self_appr\" => array(\"integer\", $this->get360SelfAppraisee()),\n\t\t\t\t\"mode_360_results\" => array(\"integer\", $this->get360Results()),\n\t\t\t\t\"mode_360_skill_service\" => array(\"integer\", (int) $this->get360SkillService()),\n\t\t\t\t// reminder/notification\n\t\t\t\t\"reminder_status\" => array(\"integer\", $this->getReminderStatus()),\n\t\t\t\t\"reminder_start\" => array(\"datetime\", $rmd_start),\n\t\t\t\t\"reminder_end\" => array(\"datetime\", $rmd_end),\n\t\t\t\t\"reminder_frequency\" => array(\"integer\", $this->getReminderFrequency()),\n\t\t\t\t\"reminder_target\" => array(\"integer\", $this->getReminderTarget()),\n\t\t\t\t\"reminder_last_sent\" => array(\"datetime\", $this->getReminderLastSent()),\n\t\t\t\t\"tutor_ntf_status\" => array(\"integer\", $this->getTutorNotificationStatus()),\n\t\t\t\t\"tutor_ntf_reci\" => array(\"text\", implode(\";\", (array)$this->getTutorNotificationRecipients())),\n\t\t\t\t\"tutor_ntf_target\" => array(\"integer\", $this->getTutorNotificationTarget()),\n\t\t\t\t\"own_results_view\" => array(\"integer\", $this->hasViewOwnResults()),\n\t\t\t\t\"own_results_mail\" => array(\"integer\", $this->hasMailOwnResults())\n\t\t\t), array(\n\t\t\t\"survey_id\" => array(\"integer\", $this->getSurveyId())\n\t\t\t));\n\t\t}\n\t\tif ($affectedRows)\n\t\t{\n\t\t\t// save questions to db\n\t\t\t$this->saveQuestionsToDb();\n\t\t}\n\t\t\n\t\t// moved activation to ilObjectActivation\n\t\tif($this->ref_id)\n\t\t{\n\t\t\tinclude_once \"./Services/Object/classes/class.ilObjectActivation.php\";\t\t\n\t\t\tilObjectActivation::getItem($this->ref_id);\n\t\t\t\n\t\t\t$item = new ilObjectActivation;\t\t\t\n\t\t\tif(!$this->isActivationLimited())\n\t\t\t{\n\t\t\t\t$item->setTimingType(ilObjectActivation::TIMINGS_DEACTIVATED);\n\t\t\t}\n\t\t\telse\n\t\t\t{\t\t\t\t\n\t\t\t\t$item->setTimingType(ilObjectActivation::TIMINGS_ACTIVATION);\n\t\t\t\t$item->setTimingStart($this->getActivationStartDate());\n\t\t\t\t$item->setTimingEnd($this->getActivationEndDate());\n\t\t\t\t$item->toggleVisible($this->getActivationVisibility());\n\t\t\t}\t\t\t\t\t\t\n\t\t\t\n\t\t\t$item->update($this->ref_id);\t\t\n\t\t}\n\t}", "public function postUpdate() {\n\t\t$inputs = Input::all();\n\t\t$completes = Input::get('complete');\n\t\tforeach ($inputs as $key => $value) {\n\t\t\tif (Str::startsWith($key, 'assign_id')) {\n\t\t\t\ttry {\n\t\t\t\t\t$assignment = Assignment::findOrFail($value);\n\t\t\t\t\tforeach ($completes as $complete) {\n\t\t\t\t\t\tif ($value == $complete) {\n\t\t\t\t\t\t\t$assignment->complete = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$assignment->complete = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t# Try to save the assignment\n\t\t\t\t\t$assignment->save();\n\t\t\t\t}\n\t\t\t\t# Fail\n\t\t\t\tcatch (Exception $e) {\n\t\t\t\t\treturn Redirect::to('/home')->with('flash_message', 'Update failed; please try again.'.$e);\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\treturn Redirect::to('/home')->withInput()->with('flash_message', 'Tasks updated.');\n\t}", "public function savesubmit(){\n\t\t$this->autoRender = false;\n\t\t if($this->request->is('POST')){ \n\t\t\t //\n\t\t \n\t\t\t$this->Session->write('project.aftersave', 'sent');\n//\t\t\t$this->Session->write('brief.type', $this->name);\n\t\t\t$this->Session->write('brief.type', $this->params['controller']);\n\t\t\t$this->Session->write('brief.id', $this->Email->id);\n\t\t\t \n\t\t\t \n\t\t\t//echo 'aftersave';\t\n\t\t\t //$this->redirect(array('controller'=>'projects', 'action' => 'view', $this->Session->read('project.id') ));\n\n\t\t }\t\t\n\t}" ]
[ "0.68383175", "0.6781291", "0.66322875", "0.65644103", "0.64687586", "0.62748706", "0.6216078", "0.61764437", "0.61506337", "0.61239", "0.60624427", "0.6021642", "0.60088193", "0.5989063", "0.5963104", "0.5909132", "0.5907373", "0.58487594", "0.58252394", "0.5802479", "0.5768108", "0.57618624", "0.57618624", "0.57389426", "0.5734622", "0.5725779", "0.57037485", "0.5690289", "0.5689356", "0.5687826" ]
0.8126283
0
Inserts a questionblock in the survey and saves the relation to the database
function insertQuestionblock($questionblock_id) { global $ilDB; $result = $ilDB->queryF("SELECT svy_qblk.title, svy_qblk.show_questiontext, svy_qblk.show_blocktitle,". " svy_qblk_qst.question_fi FROM svy_qblk, svy_qblk_qst, svy_svy_qst". " WHERE svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi". " AND svy_svy_qst.question_fi = svy_qblk_qst.question_fi". " AND svy_qblk.questionblock_id = %s". " ORDER BY svy_svy_qst.sequence", array('integer'), array($questionblock_id) ); $questions = array(); $show_questiontext = 0; $show_blocktitle = 0; while ($row = $ilDB->fetchAssoc($result)) { $duplicate_id = $this->duplicateQuestionForSurvey($row["question_fi"]); array_push($questions, $duplicate_id); $title = $row["title"]; $show_questiontext = $row["show_questiontext"]; $show_blocktitle = $row["show_blocktitle"]; } $this->createQuestionblock($title, $show_questiontext, $show_blocktitle, $questions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insertQuestionBlock($a_block_id)\n\t{\n\t\t$new_ids = array();\n\t\t$question_ids = $this->object->getQuestionblockQuestionIds($a_block_id);\n\t\tforeach($question_ids as $qid)\n\t\t{\n\t\t\t$new_ids[] = $this->appendNewQuestionToSurvey($qid, true, true);\n\t\t}\n\t\t\n\t\tif(sizeof($new_ids))\n\t\t{\n\t\t\t$this->object->loadQuestionsFromDb();\n\t\t\t\n\t\t\t$pos = $_REQUEST[\"pgov_pos\"];\n\t\t\n\t\t\t// a[fter]/b[efore] on same page\n\t\t\tif(substr($pos, -1) != \"c\")\n\t\t\t{\n\t\t\t\t// block handling\n\t\t\t\t$current = $this->object->getSurveyPages();\n\t\t\t\t$current = $current[$this->current_page-1];\n\t\t\t\tif(sizeof($current) == 1)\n\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// as questions are moved to first block question\n\t\t\t\t\t// always use existing as first\n\t\t\t\t\t// the new question is moved later on (see below)\n\t\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t\tarray((int)$pos)+$new_ids);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$block_id = array_pop($current);\n\t\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t\tforeach($new_ids as $qid)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->object->addQuestionToBlock($qid, $block_id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// c: as new page (from toolbar/pool)\n\t\t\telse\n\t\t\t{\n\t\t\t\t// re-create block\n\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t$new_ids);\n\t\t\t\t\n\t\t\t\t// after given question\n\t\t\t\tif((int)$pos)\n\t\t\t\t{\n\t\t\t\t\t$pos = (int)$pos.\"a\";\n\t\t\t\t}\n\t\t\t\t// at the beginning\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$first = $this->object->getSurveyPages();\n\t\t\t\t\t$first = $first[0];\n\t\t\t\t\t$first = array_shift($first);\n\t\t\t\t\t$pos = $first[\"question_id\"].\"b\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move to target position\n\t\t\t$this->object->moveQuestions($new_ids, (int)$pos,\n\t\t\t\t((substr($pos, -1) == \"a\") ? 1 : 0));\t\t\t\n\t\t}\n\t}", "function createQuestionblock($title, $show_questiontext, $show_blocktitle, $questions)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t// if the selected questions are not in a continous selection, move all questions of the\n\t\t// questionblock at the position of the first selected question\n\t\t$this->moveQuestions($questions, $questions[0], 0);\n\t\t\n\t\t// now save the question block\n\t\tglobal $ilUser;\n\t\t$next_id = $ilDB->nextId('svy_qblk');\n\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_qblk (questionblock_id, title, show_questiontext,\".\n\t\t\t\" show_blocktitle, owner_fi, tstamp) VALUES (%s, %s, %s, %s, %s, %s)\",\n\t\t\tarray('integer','text','text','text','integer','integer'),\n\t\t\tarray($next_id, $title, $show_questiontext, $show_blocktitle, $ilUser->getId(), time())\n\t\t);\n\t\tif ($affectedRows)\n\t\t{\n\t\t\t$questionblock_id = $next_id;\n\t\t\tforeach ($questions as $index)\n\t\t\t{\n\t\t\t\t$next_id = $ilDB->nextId('svy_qblk_qst');\n\t\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_qblk_qst (qblk_qst_id, survey_fi, questionblock_fi, \" .\n\t\t\t\t\t\"question_fi) VALUES (%s, %s, %s, %s)\",\n\t\t\t\t\tarray('integer','integer','integer','integer'),\n\t\t\t\t\tarray($next_id, $this->getSurveyId(), $questionblock_id, $index)\n\t\t\t\t);\n\t\t\t\t$this->deleteConstraints($index);\n\t\t\t}\n\t\t}\n\t}", "public function createquestion($q,$b,$userid,$qid)\r\n {\r\n $con = new Connection();\r\n $conn = $con->getConnection();\r\n //$qid = $this->getRowCount(\"question\", $conn);\r\n \r\n $sql = \"INSERT INTO question(`question_id`, `exam_id`,`subject_id`, `node_id`,`question`,`created_date`)\r\n VALUES (\". $qid .\",\". $q->getExam_id() .\",\". $q->getSubject_id() .\",\". $q->getNode_id() .\",'\". $q->getQuestion() .\"',now())\";\r\n echo $sql;\r\n echo $userid;\r\n echo $qid;\r\n if (mysqli_query ( $conn, $sql )) {\r\n \r\n $sql = \"INSERT INTO block(`block_id`, `hash_of_blockid`,`id_of_previousblock`, `hash_of_previousblock`,`encrypted_data`,`hash_of_data`,`related_node`,`related_db`,`related_id`)\r\n VALUES (\".$userid.\"\". $qid .\",'\". $b->getHash_of_blockid() .\"',' ',' ','\".$b->getEncrypted_data().\"','\".$b->getHash_of_data().\"',' ',' ',' ')\";\r\n \r\n \r\n echo $sql;\r\n \r\n if (mysqli_query($conn, $sql)) {\r\n $result = array(\r\n \"status\" => \"success\"\r\n );\r\n return $result;\r\n } else {\r\n return \"Error: \" . $sql . \"<br>\" . mysqli_error ( $conn );\r\n }\r\n } else {\r\n return \"Error: \" . $sql . \"<br>\" . mysqli_error ( $conn );\r\n }\r\n \r\n mysqli_close ( $conn );\r\n }", "public function run()\n {\n DB::table('survey_questions')->insert([\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'heading',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Informatie over de patiënt:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Leeftijd:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'textarea',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Onderliggend lijden welk invloed kan hebben op de wondgenezing: (indien niet aanwezig gelieve n.v.t te vermelden).',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'heading',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Informatie over de wond',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => null,\n 'required' => true,\n 'options' => json_encode(['Nieuwe wond', 'Bestaande wond']),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Sinds wanneer?',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 6,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => null,\n 'required' => true,\n 'options' => json_encode(['dag(en)', 'week/weken']),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Welke verband is het meest recentelijk op deze wond aangebracht?',\n 'required' => true,\n 'options' => json_encode([\n ['Fiberverbanden met hoog absorptievermogen of alginaten, gelieve de naam van het product te vermelden:'],\n ['Schuimverband, gelieve de naam van het product te vermelden:'],\n ['Zilververband, gelieve de naam van het product te vermelden:'],\n ['Superabsorberend, gelieve de naam van het product te vermelden:'],\n ['Hydrocolloïde, gelieve de naam van het product te vermelden:'],\n ['Ander(e) type(n), gelieve de naam van het product te vermelden:'],\n 'Geen',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Type wond:',\n 'required' => true,\n 'options' => json_encode([\n 'Acute wond',\n 'Chronische wond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Geïnfecteerd?',\n 'required' => true,\n 'options' => json_encode([\n 'Ja',\n 'Nee',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => 'Andere acute wond, namelijk:',\n 'text' => '(Indien acute wond aangevinkt) het gaat in het bijzonder om een …',\n 'required' => true,\n 'options' => json_encode([\n 'Traumatische wond (oppervlakkige schaafwond, laceratie, flyctenen, oppervlakkige snijwonden en huidscheuren)',\n 'Tweedegraads brandwond',\n 'Dermabrasie / Ontvelling',\n 'Chirurgische wond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => 'Andere chronische wond, namelijk',\n 'text' => '(Indien chronische wond aangevinkt) het gaat in het bijzonder om een …',\n 'required' => true,\n 'options' => json_encode([\n 'Decubitus wond',\n 'Ulcus Cruris beenwond',\n 'Diabetische voetwond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Wat is de hoeveelheid wondvocht?',\n 'required' => true,\n 'options' => json_encode([\n 'Droog',\n 'Vochtig',\n 'Nat',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Locatie van het wondbed',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => '% Necrotisch (zwart)',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => '% Granulerend (rood)',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => '% Beslag (geel)',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Anders, namelijk',\n 'required' => false,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => null,\n 'text' => 'Toestand van de huid rondom de wond:',\n 'required' => true,\n 'options' => json_encode([\n 'Gezond',\n 'Geïrriteerd/rood',\n 'Droog/eczematisch',\n 'Gemacereerd',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'heading',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'D0 – 1e toepassing van AQUACEL Foam of Foam Lite™ ConvaTec:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'date',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Datum (D0):',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Type verband:',\n 'required' => true,\n 'options' => json_encode([\n 'AQUACEL Foam',\n 'AQUACEL Ag Foam',\n 'Foam Lite ConvaTec',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'label',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Afmeting verbandkeuze:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'AQUACEL Foam – plakkend',\n 'required' => true,\n 'options' => json_encode([\n '8 x 8 cm',\n '10 x 10 cm',\n '12,5 x 12,5 cm',\n '17,5 x 17,5 cm',\n '21 x 21 cm',\n '25 x 30 cm',\n '8 x 13 cm',\n '10 x 20 cm',\n '10 x 25 cm',\n '10 x 30 cm',\n '19,8 x 14 cm',\n '20 x 16,9 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'AQUACEL Foam - zonder kleefrand',\n 'required' => true,\n 'options' => json_encode([\n '5 x 5 cm',\n '10 x 10 cm',\n '15 x 15 cm',\n '10 x 20 cm',\n '15 x 20 cm',\n '20 x 20 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'AQUACEL Foam – anatomische vormen',\n 'required' => true,\n 'options' => json_encode([\n 'Allround 19,8 x 14 cm',\n 'Sacrum 20 x 16,9 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Foam Lite™ ConvaTec',\n 'required' => true,\n 'options' => json_encode([\n '5 x 5 cm',\n '8 x 8 cm',\n '10 x 10 cm',\n '10 x 20 cm',\n '15 x 15 cm',\n '5,5 x 12 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => 'Secundair verband, gelieve het primaire verband te vermelden:',\n 'text' => 'Op welke wijze gebruikt u het gekozen verband?',\n 'required' => true,\n 'options' => json_encode([\n 'Primair verband',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => null,\n 'text' => 'Waarom heeft u voor dit specifieke verband gekozen? (Meerdere antwoorden zijn mogelijk)',\n 'required' => true,\n 'options' => json_encode([\n 'Vormbaar, zacht, comfortabel voor de patiënt',\n 'Vochtig wondmilieu met Hydrofiber',\n 'Bescherming van de wondranden (verticale absorptie)',\n 'Vasthouden van wondvocht en bacteriën (retentie)',\n 'Verbetering/ verkleining van de wond',\n 'Minder verbandwissels en/of draagtijd verlengd',\n 'Eenvoudig te gebruiken',\n 'Goede kennis van en ervaringen met schuimverbanden',\n 'Goede kennis van en ervaringen met Hydrofiber-verbanden',\n 'Type wond en hoeveelheid wondvocht',\n 'Fase van de wond',\n 'Locatie van de wond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => null,\n 'text' => 'Hoe ervaart u het aanbrengen van het verband?',\n 'required' => true,\n 'options' => json_encode([\n 'Gemakkelijk',\n ['Redelijk gemakkelijk (omschrijf)'],\n ['Niet gemakkelijk (omschrijf)'],\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Kleeft het verband bij het aanbrengen aan de handschoenen of aan zichzelf?',\n 'required' => true,\n 'options' => json_encode([\n 'Ja',\n 'Nee',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Zo ja, is het herpositioneerbaar?',\n 'required' => true,\n 'options' => json_encode([\n 'Ja',\n 'Nee',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n ]);\n }", "public static function insertSurvey()\n\t{\n\t\tif(isset($_POST['SurveyID']) && (is_numeric($_POST['SurveyID'])))\n\t\t{//insert response!\n\t\t\t$iConn = IDB::conn();\n\t\t\t// turn off auto-commit\n\t\t\tmysqli_autocommit($iConn, FALSE);\n\t\t\t//insert response\n\t\t\t$sql = sprintf(\"INSERT into \" . PREFIX . \"responses(SurveyID,DateAdded) VALUES ('%d',NOW())\",$_POST['SurveyID']);\n\t\t\t$result = @mysqli_query($iConn,$sql); //moved or die() below!\n\t\t\t\n\t\t\tif(!$result)\n\t\t\t{// if error, roll back transaction\n\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\tdie(trigger_error(\"Error Entering Response: \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t} \n\t\t\t\n\t\t\t//retrieve responseid\n\t\t\t$ResponseID = mysqli_insert_id($iConn); //get ID of last record inserted\n\t\t\t\n\t\t\tif(!$result)\n\t\t\t{// if error, roll back transaction\n\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\tdie(trigger_error(\"Error Retrieving ResponseID: \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t} \n\t\n\t\t\t//loop through and insert answers\n\t\t\tforeach($_POST as $varName=> $value)\n\t\t\t{//add objects to collection\n\t\t\t\t $qTest = substr($varName,0,2); //check for \"obj_\" added to numeric type\n\t\t\t\t if($qTest==\"q_\")\n\t\t\t\t {//add choice!\n\t\t\t\t \t$QuestionID = substr($varName,2); //identify question\n\t\t\t\t \t\n\t\t\t\t \tif(is_array($_POST[$varName]))\n\t\t\t\t \t{//checkboxes are arrays, and we need to loop through each checked item to insert\n\t\t\t\t\t \twhile (list ($key,$value) = @each($_POST[$varName])){\n\t\t\t\t\t\t \t$sql = \"insert into \" . PREFIX . \"responses_answers(ResponseID,QuestionID,AnswerID) values($ResponseID,$QuestionID,$value)\";\n\t\t\t\t\t \t\t$result = @mysqli_query($iConn,$sql);\n\t\t\t\t\t \t\tif(!$result)\n\t\t\t\t\t\t\t{// if error, roll back transaction\n\t\t\t\t\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\t\t\t\t\tdie(trigger_error(\"Error Inserting Choice (array/checkbox): \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t}\n\t\t\t \t\t}else{//not an array, so likely radio or select\n\t\t\t\t \t\t$sql = \"insert into \" . PREFIX . \"responses_answers(ResponseID,QuestionID,AnswerID) values($ResponseID,$QuestionID,$value)\";\n\t\t\t\t \t $result = @mysqli_query($iConn,$sql);\n\t\t\t\t \t if(!$result)\n\t\t\t\t\t\t{// if error, roll back transaction\n\t\t\t\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\t\t\t\tdie(trigger_error(\"Error Inserting Choice (single/radio): \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t\t\t\t} \n\t\t\t \t\t}\n\t\t\t\t }\n\t\t\t}\n\t\t\t//we got this far, lets COMMIT!\n\t\t\tmysqli_commit($iConn);\n\t\t\t\n\t\t\t// our transaction is over, turn autocommit back on\n\t\t\tmysqli_autocommit($iConn, TRUE);\n\t\t\t\n\t\t\t//count total responses, update TotalResponses\n\t\t\tself::responseCount((int)$_POST['SurveyID']); //convert to int on way in!\n\t\t\treturn TRUE; #\n\t\t}else{\n\t\t\treturn FALSE;\t\n\t\t}\n\n\t}", "function saveQuestionsToDb() \n\t{\n\t\tglobal $ilDB;\n\t\t// save old questions state\n\t\t$old_questions = array();\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_svy_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\tif ($result->numRows())\n\t\t{\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\t$old_questions[$row[\"question_fi\"]] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// delete existing question relations\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_svy_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t// create new question relations\n\t\tforeach ($this->questions as $key => $value) \n\t\t{\n\t\t\t$next_id = $ilDB->nextId('svy_svy_qst');\n\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_svy_qst (survey_question_id, survey_fi, question_fi, heading, sequence, tstamp) VALUES (%s, %s, %s, %s, %s, %s)\",\n\t\t\t\tarray('integer','integer','integer','text','integer','integer'),\n\t\t\t\tarray($next_id, $this->getSurveyId(), $value, (strlen($old_questions[$value][\"heading\"])) ? $old_questions[$value][\"heading\"] : NULL, $key, time())\n\t\t\t);\n\t\t}\n\t}", "public function run()\n {\n $questao = Question::where('id', 1)->first();\n\n $answer = new Answer();\n $answer->a = 'r1';\n $answer->b = 'r2';\n $answer->c = 'r3';\n $answer->is_correct = 'a';\n //$answer->questions()->attach($questao);\n $answer->save();\n $answer->questions()->attach($questao); \n \n }", "function _addQuestionblock($title = \"\", $owner = 0, $show_questiontext = true, $show_blocktitle = false)\n\t{\t\t\n\t\tglobal $ilDB;\n\t\t$next_id = $ilDB->nextId('svy_qblk');\n\t\t$ilDB->manipulateF(\"INSERT INTO svy_qblk (questionblock_id, title, show_questiontext,\".\n\t\t\t\" show_blocktitle, owner_fi, tstamp) \" .\n\t\t\t\"VALUES (%s, %s, %s, %s, %s, %s)\",\n\t\t\tarray('integer','text','integer','integer','integer','integer'),\n\t\t\tarray($next_id, $title, $show_questiontext, $show_blocktitle, $owner, time())\n\t\t);\n\t\treturn $next_id;\n\t}", "public function insertNewQuestion($a_new_id)\n\t{\n\t\tglobal $rbacsystem, $ilDB, $lng;\n\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\tif (!SurveyQuestion::_isComplete($a_new_id))\n\t\t{\n\t\t\tilUtil::sendFailure($lng->txt(\"survey_error_insert_incomplete_question\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$a_new_id = $this->appendNewQuestionToSurvey($a_new_id);\n\t\t\t$this->object->loadQuestionsFromDb();\n\n\t\t\t$pos = $_REQUEST[\"pgov_pos\"];\n\n\t\t\t// a[fter]/b[efore] on same page\n\t\t\tif(substr($pos, -1) != \"c\")\n\t\t\t{\n\t\t\t\t// block handling\n\t\t\t\t$current = $this->object->getSurveyPages();\n\t\t\t\t$current = $current[$this->current_page-1];\n\t\t\t\tif(sizeof($current) == 1)\n\t\t\t\t{\n\t\t\t\t\t// as questions are moved to first block question\n\t\t\t\t\t// always use existing as first\n\t\t\t\t\t// the new question is moved later on (see below)\n\t\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t\tarray((int)$pos, $a_new_id));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$block_id = array_pop($current);\n\t\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t\t$this->object->addQuestionToBlock($a_new_id, $block_id);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// c: as new page (from toolbar/pool)\n\t\t\telse\n\t\t\t{\n\t\t\t\t// after given question\n\t\t\t\tif((int)$pos)\n\t\t\t\t{\n\t\t\t\t\t$pos = (int)$pos.\"a\";\n\t\t\t\t\t$this->current_page++;\n\t\t\t\t}\n\t\t\t\t// at the beginning\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$first = $this->object->getSurveyPages();\n\t\t\t\t\t$first = $first[0];\n\t\t\t\t\t$first = array_shift($first);\n\t\t\t\t\t$pos = $first[\"question_id\"].\"b\";\n\t\t\t\t\t$this->current_page = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move to target position\n\t\t\t$this->object->moveQuestions(array($a_new_id), (int)$pos,\n\t\t\t\t((substr($pos, -1) == \"a\") ? 1 : 0));\n\t\t}\n\t}", "public function addnewclaimquestion(){\n\tif(isset($this->getData['opertaors']) && !empty($this->getData['opertaors'])){\n\t $operators = commonfunction::implod_array($this->getData['opertaors']);\n\t}\n\telse{\n\t $operators = '';\n \t}\n\tif($this->getData['question_type']=='file'){\n\t $file_upload = 1;\n\t}else{\n\t $file_upload = 0;\n\t}\n\t$question_options ='';\n\tif($this->getData['question_type']=='select' || $this->getData['question_type']=='radio'){\n\t foreach($this->getData['questionoption'] as $key=>$que_option){\n\t\t$que_value = $this->getData['questionvalue'][$key];\n\t\t$question_options .= $que_option.'|'.$que_value.';';\n\t }\n\t}\n\tif(isset($this->getData['subquestion_a']) && $this->getData['subquestion_a']!=''){\n\t $sub_question = isset($this->getData['subquestion_a'])?$this->getData['subquestion_a']:'';\n\t $sub_que_option = isset($this->getData['subquestion_option_a'])?$this->getData['subquestion_option_a']:'';\n\t}else{\n\t $sub_question = isset($this->getData['subquestion'])?$this->getData['subquestion']:'';\n\t $sub_que_option = isset($this->getData['subquestion_option'])?$this->getData['subquestion_option']:'';\n\t}\n\t$lastinserted_id = $this->insertInToTable(CLAIM_QUESTIONS, array(array('sub_question'=>$sub_question,'sub_question_option'=>$sub_que_option,'question_type'=>$this->getData['question_type'],'question'=>$this->getData['question'],'question_options'=>$question_options,'operators'=>$operators,'file_upload'=>$file_upload,'status'=>$this->getData['claim_status'],'created_by'=>$this->Useconfig['user_id'],'created_ip'=>commonfunction::loggedinIP())));\n\treturn $lastinserted_id;\n }", "public function insert_question_info()\n {\n \t\t\t\t\t\t\t\t\n codeQuestions::create([\n 'content' =>request('content'),\n /* 'test_case1' =>request('test_case1'),\n 'test_case1_result' =>request('test_case1_result'), \n 'test_case2' =>request('test_case2'), \n 'test_case2_result' =>request('test_case2_result'),\n 'test_case3' =>request('test_case3'),\n 'test_case3_result' =>request('test_case3_result'),\n // 'student_answer' =>request('student_answer'),*/\n 'degree' =>request('degree'),\n 'language' =>request('language'),\n 'type' =>request('type'),\n 'id_exam' =>request('id_exam')\n ]);\n\n ////////////////to make exam id hidden////////////////////////////////////\n $allExams=exams::all();\n return view('exam_questions',['allExams'=>$allExams]); \n ///////////////////////////////////////\n // return redirect('exam_questions') ;\n \n }", "public function store_survey_post()\n\t\t{\n\t\t\t$clickValue = $this->post('clickValue');\n\t\t\t$optionId = $this->post('optionId');\n\t\t\t$uuid = $this->post('uuid');\n\t\t\t$weekSend = $this->post('weekSend');\n\t\t\tif(!empty($clickValue) &&\n\t\t\t\t!empty($optionId) &&\n\t\t\t\t!empty($uuid) &&\n\t\t\t\t!empty($weekSend)\n\t\t\t)\n\t\t\t{\n\t\t\t\t$insertData = array(\n\t\t\t\t\t'tans_opt_id' => $optionId,\n\t\t\t\t\t'tans_uuid' => $uuid,\n\t\t\t\t\t'tans_week' => $weekSend,\n\t\t\t\t\t'trans_survey_value' => $clickValue\n\t\t\t\t);\n\t\t\t\t$tempStatus = $this->Student_survey_model->storeStudentSurvey($insertData);\n\t\t\t\tif($tempStatus)\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('SUCCESS');\n\t\t\t\t\t$data['message'] = $this->lang->line('VALID_TOKEN_MESSAGE');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t\t$data['message'] = $this->lang->line('unable_save_answer');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t$data['message'] = $this->lang->line('please_pass_required');\n\t\t\t}\n\t\t\t$this->response($data , 200);\n\t\t}", "public function Insertquestion($data) {\n// $this->db->query($query);\n $this->db->insert('question_master', $data);\n }", "function insertQuestion($question_id) \n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\tif (!SurveyQuestion::_isComplete($question_id))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// get maximum sequence index in test\n\t\t\t$result = $ilDB->queryF(\"SELECT survey_question_id FROM svy_svy_qst WHERE survey_fi = %s\",\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($this->getSurveyId())\n\t\t\t);\n\t\t\t$sequence = $result->numRows();\n\t\t\t$duplicate_id = $this->duplicateQuestionForSurvey($question_id);\n\t\t\t$next_id = $ilDB->nextId('svy_svy_qst');\n\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_svy_qst (survey_question_id, survey_fi, question_fi, sequence, tstamp) VALUES (%s, %s, %s, %s, %s)\",\n\t\t\t\tarray('integer', 'integer', 'integer', 'integer', 'integer'),\n\t\t\t\tarray($next_id, $this->getSurveyId(), $duplicate_id, $sequence, time())\n\t\t\t);\n\t\t\t$this->loadQuestionsFromDb();\n\t\t\treturn TRUE;\n\t\t}\n\t}", "public function createAnswer()\n {\n $this->is_answer = true;\n $this->topic->is_answered = true;\n $post = $this;\n\n Db::transaction(function() use ($post)\n {\n $post->topic->save();\n $post->save();\n });\n }", "public function newQuestion($question, $connection) {\r\n\t\t$connection -> exec(\"INSERT INTO `\".$GLOBALS['dbPrefix'].\"question_question` (`set`, `question`, `mode`) VALUES (\" . $this -> setid . \", '\" . $question -> getQuestion() . \"', '\" . $question -> getMode() . \"')\");\r\n\t\t$question -> setId($connection -> lastInsertId());\r\n\t\tarray_push($this -> questions, $question);\r\n\t}", "public function insert_question_and_option()\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->auth->check_operator_auth();\n\t\t$CI->load->model('operator/Questions');\t\t\n\t\t$CI->Questions->question_and_option_entry();\n\t\t\n\t\t$this->session->set_userdata(array('message'=>display('successfully_added_question')));\n\n\t\tredirect(base_url('operator/Oquestion/add_question_form'));\n\t}", "abstract protected function doSaveQuestion(Question $question);", "function insertTagsQuestion($id_question, $id_tag)\n\t{\n\t\tglobal $dbh;\n\n\n\t\t$sql = \"INSERT INTO tags_relation (id_question, id_tag)\n\t\t\t\tVALUES (:id_question, :id_tag)\";\n\n\n\t\t$stmt = $dbh->prepare($sql);\n\t\t$stmt->bindValue(\":id_question\", $id_question);\n\t\t$stmt->bindValue(\":id_tag\", $id_tag);\n\t\t$stmt->execute();\n\t}", "protected function saveInsert()\n {\n }", "function question_answer_insert($data)\n\t{\n\t$this->db->insert('question_answer', $data);\n\t}", "function saveQuestion($questionType) {\n $conn = getDBConnection();\n mysqli_autocommit($conn,FALSE);\n\n if($questionType == FRAGENTYP_TEXTFRAGE) {\n // Textfrage speichern\n $title = mysqli_real_escape_string($conn,$_POST['txtQuestionTitle']);\n $text = mysqli_real_escape_string($conn,$_POST['txtQuestionText']);\n $answer = mysqli_real_escape_string($conn,$_POST['txtAnswer']);\n\n if($title != \"\" && $text != \"\" && $answer != \"\") {\n $poolId = getQuestionPoolId(getChapterId($_SESSION['lectureToAddQuestion'], $_SESSION['chapterToAddQuestion']));\n\n $queryQuestion = \"INSERT INTO \" . FRAGE . \" VALUES (NULL, '$title','$text',$poolId,'$questionType');\";\n mysqli_query($conn, $queryQuestion);\n\n $queryID = \"SELECT \" . FRAGE_FrID . \" FROM \" . FRAGE . \" WHERE \" . FRAGE_FrBezeichnung . \" = '$title' AND \" . FRAGE_FPID . \" = $poolId\";\n $getID = mysqli_fetch_assoc(mysqli_query($conn, $queryID));\n $FrID = $getID[FRAGE_FrID];\n\n $queryAnswer = \"INSERT INTO \" . ANTWORT . \" VALUES ($FrID, '$answer', \" . SHORT_FALSE . \", 0);\";\n mysqli_query($conn, $queryAnswer);\n\n if($queryAnswer && $queryID) {\n echo \"<p>Frage '$title' erfolgreich zum Kapitel '\" . $_SESSION['chapterToAddQuestion'] . \"' hinzugefügt!</p>\";\n mysqli_commit($conn);\n } else {\n echo \"<p>Fehler beim Speichern der Frage. Die Änderungen werden rückgängig gemacht.</p>\";\n mysqli_rollback($conn);\n }\n } else {\n echo \"<p>Unvollständige Angaben. Die Frage wurde nicht gespeichert.</p>\";\n }\n\n } else if ($questionType == FRAGENTYP_MULTIPLE_CHOICE) {\n // Multiple Choice Frage speichern\n $title = $_POST['txtQuestionTitleMC'];\n $text = $_POST['txtQuestionTextMC'];\n //$answers[] = $_POST['txtAnswers'];\n\n $answers = $_POST['txtAnswers'];\n\n $poolId = getQuestionPoolId(getChapterId($_SESSION['lectureToAddQuestion'], $_SESSION['chapterToAddQuestion']));\n $queryQuestion = \"INSERT INTO \" . FRAGE . \" VALUES (NULL, '$title','$text',$poolId,'$questionType');\";\n\n // Kontrolle, ob alle Antworten eingefügt wurden\n $failedQuestions = 0;\n\n if(mysqli_query($conn, $queryQuestion)) {\n for($i = 0; $i < count($answers); $i++) {\n $text = mysqli_real_escape_string($conn,$_POST['txtAnswers'][$i]);\n $bool = mysqli_real_escape_string($conn,$_POST['txtTrueFalse'][$i]);\n\n if($bool == STRING_TRUE) {\n $bool = SHORT_TRUE;\n } else {\n $bool = SHORT_FALSE;\n }\n\n $query = \"SELECT \" . FRAGE_FrID . \" FROM \" . FRAGE . \" WHERE \" . FRAGE_FrBezeichnung . \" = '$title' AND \" . FRAGE_FPID . \" = $poolId\";\n $getID = mysqli_fetch_assoc(mysqli_query($conn, $query));\n $FrID = $getID[FRAGE_FrID];\n\n $queryAnswer = \"INSERT INTO \" . ANTWORT . \" VALUES ($FrID, '$text', '$bool', $i);\";\n\n if(mysqli_query($conn, $queryAnswer)) {\n echo \"<p>Antwort '$text' wurde der Frage hinzugefügt.</p>\";\n } else {\n $failedQuestions++;\n }\n if($failedQuestions > 0 && $i == count($answers) -1) {\n echo \"<p>Fehler beim Speichern aufgetreten. Die Änderungen werden rückgängig gemacht.</p>\";\n mysqli_rollback($conn);\n } else {\n if($i == count($answers) -1) {\n echo \"<p>Frage '$title' erfolgreich zum Kapitel '\" . $_SESSION['chapterToAddQuestion'] . \"' hinzugefügt!</p>\";\n }\n mysqli_commit($conn);\n }\n }\n } else {\n echo \"<p>Fehler beim Speichern der Frage. Der Eintrag wurde rückgängig gemacht.</p>\";\n }\n } else {\n echo '<p>Ungültiger Fragentyp!</p>';\n }\n}", "public function store(Request $request)\n { \n $this->validate($request, [ \n 'region_name' => 'required', \n 'league_name' => 'required', \n 'item_name' => 'required', \n 'description' => 'required', \n ]);\n \n $requestData = $request->all(); \n $requestData['region_id'] = $requestData['region_name']; \n $requestData['parent_id'] = $requestData['league_name']; \n $requestData['category_name'] = $requestData['item_name']; \n \n $category = Categories::create($requestData);\n \n if(isset($requestData['image_ids'])){\n foreach($requestData['image_ids'] as $image_id){\n $category_images = Category_images::find($image_id);\n $category_images->category_id = $category->id;\n $category_images->update();\n } \n }\n \n // save category section\n for($s = 1; $s <= $requestData['total_sections']; $s++){ \n $section_data = [];\n $section_data['category_id'] = $category->id;\n $section_data['id'] = $requestData['section_id_'. $s]; \n\n $section = Category_sections::firstOrNew($section_data);\n $section->section_name = $requestData['section_name_'. $s];\n $section->save();\n \n // save section questions\n $total_section_questions = $requestData['total_section_'. $s .'_questions'];\n if($total_section_questions > 0){\n for($sq = 1; $sq <= $total_section_questions; $sq++){ \n $section_question_data = [];\n $section_question_data['section_id'] = $section->id;\n $section_question_data['id'] = $requestData['question_id_'.$s.'_'. $sq]; \n \n $question = Section_questions::firstOrNew($section_question_data);\n $question->question_name = $requestData['question_name_'.$s.'_'. $sq];\n $question->answer_type = $requestData['answer_type_'.$s.'_'. $sq];\n $question->save(); \n \n // save section question answers\n $total_question_answers = $requestData['total_section_'. $s .'_question_'.$sq.'_answers'];\n if($total_question_answers > 0){\n for($sqa = 1; $sqa <= $total_question_answers; $sqa++){ \n $question_answer_data = [];\n $question_answer_data['question_id'] = $question->id; \n $question_answer_data['id'] = $requestData['answer_id_'.$s.'_'. $sq.'_'. $sqa]; \n \n $answer = Question_answers::firstOrNew($question_answer_data);\n $answer->answer_name = $requestData['answer_name_'.$s.'_'. $sq.'_'. $sqa];\n $answer->score = ($requestData['score_'.$s.'_'. $sq.'_'. $sqa]==\"\"?0:$requestData['score_'.$s.'_'. $sq.'_'. $sqa]);\n $answer->save(); \n }\n }\n }\n }\n \n }\n \n Alert::success('Success Message', 'Item added!'); \n\n return redirect('admin/items'); \n }", "public function store(Request $request,Question $question)\n {\n $question->answers()->create(\n [\n 'text'=>$request->body,\n 'user_id'=> Auth::id()\n ]\n )->save();\n\n// return view('questions.show',[\n// 'question'=>$question,\n// 'success'=>'success'\n// ]);\n return redirect()->route('questions.show',$question->slug)->with('success','Answered Successfull!');\n\n }", "public function question_insert() {\n\t\t$this->check_if_authorized();\n\n\t\t//check validation for user\n\t\t//$this->form_validation->set_rules('title', \t\t\t\t\t\t\t\t\t'Nume produs', 'trim|required|xss_clean|min_length[5]|max_length[64]');\n\t\t//$this->form_validation->set_rules('tags', \t\t\t\t\t\t\t\t\t'Categorie', 'trim|required|xss_clean');\n\t\t//$this->form_validation->set_rules('desc', \t\t\t\t\t\t\t\t\t'Descriere', 'trim|xss_clean');\n\t\t//$this->form_validation->set_rules('code', \t\t\t\t\t\t\t\t\t'Descriere', 'trim|xss_clean');\n\n\t\t$data = array(\n\t\t\t'domain' => $this->input->post('domain'),\n\t\t\t'title' => $this->input->post('title'),\n\t\t\t'tags' => $this->input->post('tags'),\n\t\t\t'solution_tags' => $this->input->post('solution_tags'),\n\t\t\t'desc' => $this->input->post('desc'),\n\t\t\t'code' => $this->input->post('code'),\n\t\t\t'private' => $this->input->post('private')? \"1\" : \"0\",\n\t\t\t'author' => $this->session->userdata['user_id']\n\t\t);\n\n\t\t$question_id = $this->question_model->question_insert($data);\n\t\t$data['message_display'] = '';\n\n\t\t//$result = $this->question_model->get_all();\n\n\t\t//$data['result'] = $result;\n\t\tif($question_id !== FALSE) {\n\t\t\t//$data['page_name'] = 'index';\n\t\t\t//$this->load->view('template',$data);\n\t\t\t// $data['message_display'] .= ' The question was succesfully inserted.';\n\t\t\t// $this->show_question_details($question_id, $data['message_display']);\n\t\t\tredirect ('/question/show_question_details/'.$question_id);\n\t\t} else {\n\t\t\t$data['message_display'] .= 'Error 543653 - could not insert question';\n\t\t\t$data['page_right'] = 'question_form_insert';\n\t\t\t$this->load->view('template', $data);\n\t\t}\n\t}", "function addBlock($userId, $chapterId, $block) {\r\n // pull in the database from the controller\r\n global $db;\r\n \r\n try {\r\n \r\n // the sql query ready to be turned into a prepared statement using the values\r\n $query = 'INSERT INTO blocks\r\n (user_id, chapter_id, block)\r\n VALUES\r\n (:userId, :chapterId, :block)';\r\n \r\n // use the prepared statement by binding/matching the feilds from the form - passed \r\n // in via the parameters - to the values in our sql query\r\n $stmt = $db->prepare($query);\r\n $stmt->bindValue(':userId', $userId);\r\n $stmt->bindValue(':chapterId', $chapterId);\r\n $stmt->bindValue(':block', $block);\r\n $stmt->execute();\r\n $insertId = $db->lastInsertId(); // get and return the last ID that was generated\r\n $stmt->closeCursor();\r\n\r\n return $insertId;\r\n } catch (PDOException $e) {\r\n # $error_message = $e->getMessage();\r\n # display_db_error($error_message);\r\n return 0;\r\n }\r\n}", "public function testQuestionSaving()\n {\n $question = new Question();\n \n $question->subject_id = 123;\n $question->question = \"Test 1\";\n //testing for question\n //testing for subject id \n $question->save();\n\n $this->assertEquals($question->question,\"Test 1\");\n //see in database\n $this->assertDatabaseHas('questions',['question'=>\"Test 1\"]);\n }", "public function submit_survey_post()\n\t\t{\n\t\t\t$testId = $this->post('testId');\n\t\t\t$uuid = $this->post('uuid');\n\t\t\t$weekSend = $this->post('weekSend');\n\t\t\tif(!empty($testId) &&\n\t\t\t\t!empty($uuid) &&\n\t\t\t\t!empty($weekSend)\n\t\t\t)\n\t\t\t{\n\t\t\t\t$insertData = array(\n\t\t\t\t\t'ts_uuid' => $uuid,\n\t\t\t\t\t'ts_test_id' => $testId,\n\t\t\t\t\t'ts_week' => $weekSend,\n\t\t\t\t\t'ts_submitted_on' => date('Y-m-d H:i:s')\n\t\t\t\t);\n\t\t\t\t$tempStatus = $this->Student_survey_model->insertSurvey($insertData);\n\t\t\t\tif($tempStatus)\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('SUCCESS');\n\t\t\t\t\t$data['message'] = $this->lang->line('VALID_TOKEN_MESSAGE');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t\t$data['message'] = $this->lang->line('unable_save_answer');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t$data['message'] = $this->lang->line('please_pass_required');\n\t\t\t}\n\t\t\t$this->response($data , 200);\n\t\t}", "function ipal_send_question(){\r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\tglobal $CFG;\r\n\t\r\n\t$ipal_course=$DB->get_record('ipal',array('id'=>$ipal->id));\r\n\t$record = new stdClass();\r\n\t$record->id = '';\r\n\t$record->course = $ipal_course->course;\r\n\t$record->ipal_id = $ipal->id;\r\n\t$record->quiz_id = $ipal->id;\r\n\t$record->question_id = $_POST['question'];\r\n\t$record->timemodified = time();\r\n\t if($DB->record_exists('ipal_active_questions', array('ipal_id'=>$ipal->id))){\r\n\t $mybool=$DB->delete_records('ipal_active_questions', array('ipal_id'=>$ipal->id));\r\n\t }\r\n\t$lastinsertid = $DB->insert_record('ipal_active_questions', $record);\r\n\r\n}", "public function save()\n {\n parent::save();\n\n // make sure that we are auditing this phase's survey\n $this->ensure_auditing();\n }" ]
[ "0.6799601", "0.62273544", "0.61857647", "0.6134863", "0.60914546", "0.6046759", "0.5936172", "0.5843319", "0.5808651", "0.5791758", "0.5779202", "0.57744384", "0.57185864", "0.5693888", "0.56655055", "0.56449133", "0.560721", "0.5583972", "0.5581142", "0.5574141", "0.5566793", "0.5565094", "0.5543567", "0.55318874", "0.55313325", "0.5530448", "0.54983723", "0.5488635", "0.5476794", "0.5470975" ]
0.6862051
0
Returns the content of all RTE enabled text areas in the test
function getAllRTEContent() { $result = array(); array_push($result, $this->getIntroduction()); array_push($result, $this->getOutro()); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTextContent();", "public function textarea()\n {\n return $this->content(false, false, false, true);\n }", "function getRTETextWithMediaObjects()\n\t{\n\t\treturn parent::getRTETextWithMediaObjects();\n\t}", "function getRTETextWithMediaObjects()\n\t{\n\t\t$text = parent::getRTETextWithMediaObjects();\n\t\treturn $text;\n\t}", "public function getTextContent()\n\t{\n\t\treturn $this->text_content;\n\t}", "public function getContentElements()\n\t{\n\t\treturn $this->getOptionData('tl_content');\n\t}", "public function getContents();", "public function getContents();", "public function getContents();", "public function getContents();", "public function getContents();", "public function get_text_content() {\n\t\treturn $this->text_content;\n\t}", "public function getTextContent()\n {\n return $this->content;\n }", "public function testExtractTextArrayFromRootDomNode() {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }", "public function getTexts()\n {\n return $this->_getChildrenByName('text');\n }", "public function content()\n {\n return $this->regions['content'];\n }", "public function outertext()\n {\n return [];\n }", "function getContent() {\t \t\r\n\t \t$content = '{';\r\n\t\t$content .= !empty($this->alignment) ? $this->alignment : '';\t\t\t \t\r\n\t\t$content .= !empty($this->font) ? $this->font->getContent($this->rtf) : '';\t \t\t\r\n\t\t$content .= Container::getContent().'\\cell \\pard }'.\"\\r\\n\";\r\n\t\treturn $content;\r\n\t}", "protected function getContents()\n {\n $contents = $this->crawler->filter('.page.group');\n if (!$contents->count()) {\n return;\n }\n\n $contents = $contents->html();\n\n // I'll have my own syntax highlighting, WITH BLACKJACK AND HOOKERS\n $this->crawler->filter('pre')->each(function ($code) use (&$contents) {\n $unformatted = htmlentities($code->text());\n $unformatted = '<pre><code class=\"php\">'.$unformatted.'</code></pre>';\n $contents = str_replace('<pre class=\"code php\">'.$code->html().'</pre>', $unformatted, $contents);\n });\n\n return $contents;\n }", "public function getContents() {}", "public function getContents(): array\n {\n return $this->content;\n }", "public function getContents() {}", "public function getContents() {}", "public function getContents() {}", "public function getContents() {}", "public function all_content()\n \t{\n \t\t$result='';\n \t\tforeach($this->content as $target)\n \t\t\tforeach($target as $content)\n \t\t\t\t$result.=$content;\n\n \t\treturn $result;\n \t}", "function botSpawEditorGetContents($editorArea, $hiddenField) {\n}", "public function innertext()\n {\n return [];\n }", "public function getContents()\n {\n return $this->getContents();\n }", "protected function get_templates_text() {\n $text = '';\n foreach ($this->editors as $editor) {\n $text .= $this->$editor ? ' '. $this->$editor : '';\n }\n return trim($text);\n }" ]
[ "0.6343008", "0.6175572", "0.61345696", "0.6133691", "0.60925126", "0.6079329", "0.5953084", "0.5953084", "0.5953084", "0.5953084", "0.5953084", "0.59361285", "0.59264225", "0.5901187", "0.58684564", "0.5849754", "0.58427155", "0.5773082", "0.576314", "0.5734054", "0.57330006", "0.5732841", "0.5732841", "0.5732841", "0.5732841", "0.57249784", "0.56931484", "0.5661898", "0.562004", "0.55891204" ]
0.7268474
0
Cleans up the media objects for all text fields in a test which are using an RTE field
function cleanupMediaobjectUsage() { include_once("./Services/RTE/classes/class.ilRTE.php"); $completecontent = ""; foreach ($this->getAllRTEContent() as $content) { $completecontent .= $content; } ilRTE::_cleanupMediaObjectUsage($completecontent, $this->getType() . ":html", $this->getId()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cleanup() {\n $this->object->removeLock();\n $this->clearCache();\n\n $returnArray = $this->object->get(array_diff(array_keys($this->object->_fields), array('content','ta','introtext','description','link_attributes','pagetitle','longtitle','menutitle','articles_container_settings','properties')));\n foreach ($returnArray as $k => $v) {\n if (strpos($k,'tv') === 0) {\n unset($returnArray[$k]);\n }\n if (strpos($k,'setting_') === 0) {\n unset($returnArray[$k]);\n }\n }\n $returnArray['class_key'] = $this->object->get('class_key');\n $this->workingContext->prepare(true);\n $returnArray['preview_url'] = $this->modx->makeUrl($this->object->get('id'), $this->object->get('context_key'), '', 'full');\n return $this->success('',$returnArray);\n }", "public function cleanup() {\n $this->object->removeLock();\n $this->clearCache();\n\n $returnArray = $this->object->get(array_diff(array_keys($this->object->_fields), array('content','ta','introtext','description','link_attributes','pagetitle','longtitle','menutitle','properties')));\n foreach ($returnArray as $k => $v) {\n if (strpos($k,'tv') === 0) {\n unset($returnArray[$k]);\n }\n }\n\t\t\n\t\t// Remove translations fields\n\t\t$translations = $this->getTranslatedFields();\n\t\tforeach($translations as $lang => $fields){\n\t\t\tforeach($fields as $key => $val){\n\t\t\t\tif(isset($returnArray[$key.$lang])){\n\t\t\t\t\tunset($returnArray[$key.$lang]);\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t\t\n\t\t$this->modx->log(1,print_r($returnArray,true));\n\n\t\t\n $returnArray['class_key'] = $this->object->get('class_key');\n $this->workingContext->prepare(true);\n $returnArray['preview_url'] = $this->modx->makeUrl($this->object->get('id'), $this->object->get('context_key'), '', 'full');\n return $this->success('',$returnArray);\n }", "function media_cleanup() { \r\n global $media;\r\n global $avatars;\r\n global $photoalbumsmedia;\r\n \r\n $query1 = \"SELECT `media_id` , `media_userid` FROM `$media`s;\";\r\n $sqlr1 = bcsql_query( $query1 );\r\n $mediaids = bcsql_fetch_array( $sqlr1 );\r\n $num_rows1 = bcsql_num_rows( $mediaids );\r\n for( $i = 0; $i<$num_rows1; $i++ ) {\r\n $thismedia = $mediaids[ $i ];\r\n $thismediaid = $thismedia[ \"media_id\" ];\r\n $mediaclass = New media( $thismediaid );\r\n $userid = $mediaclass->userid();\r\n $userfile = $uploaddir . $userid .\"/\". $thismediaid;\r\n if( !file_exists( $userfile ) ) {\r\n $sql = \"DELETE FROM `$media` WHERE `media_id` = '$thismediaid';\"; \r\n bcsql_query( $sql );\r\n $sql = \"DELETE FROM `$avatars` WHERE `avatar_mediaid` = '$thismediaid';\";\r\n bcsql_query( $sql );\r\n $sql = \"DELETE FROM `$photoalbumsmedia` WHERE `pamedia_mediaid` = '$thismediaid';\";\r\n bcsql_query( $sql );\r\n }\r\n }\r\n //the oposite thing remains to be done\r\n }", "public function reset()\n {\n $this->values[self::TEXT] = null;\n $this->values[self::MATCHEDTEXT] = null;\n $this->values[self::CANONICALURL] = null;\n $this->values[self::DESCRIPTION] = null;\n $this->values[self::TITLE] = null;\n $this->values[self::THUMBNAIL] = null;\n }", "function prop_clean() {\n\n remove_action('template_redirect', 'rest_output_link_header', 11);\n remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10);\n\n add_filter( 'use_default_gallery_style', '__return_false' );\n\n // Emoji related\n remove_action( 'admin_print_styles', 'print_emoji_styles' );\n\tremove_action( 'wp_head', 'print_emoji_detection_script', 7 );\n\tremove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\n\tremove_action( 'wp_print_styles', 'print_emoji_styles' );\n\tremove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );\n\tremove_filter( 'the_content_feed', 'wp_staticize_emoji' );\n remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );\n\n}", "function _cleanupMediaObjectUsage($a_text, $a_usage_type, $a_usage_id)\n\t{\n\t\t// get current stored mobs\n\t\tinclude_once(\"./Services/MediaObjects/classes/class.ilObjMediaObject.php\");\n\t\t$mobs = ilObjMediaObject::_getMobsOfObject($a_usage_type,\n\t\t\t$a_usage_id);\n\t\twhile (eregi(\"data\\/\".CLIENT_ID.\"\\/mobs\\/mm_([0-9]+)\", $a_text, $found))\n\t\t{\n\t\t\t$a_text = str_replace($found[0], \"\", $a_text);\n\t\t\tif (!in_array($found[1], $mobs))\n\t\t\t{\n\t\t\t\t// save usage if missing\n\t\t\t\tilObjMediaObject::_saveUsage($found[1], $a_usage_type,\n\t\t\t\t\t$a_usage_id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// if already saved everything ok -> take mob out of mobs array\n\t\t\t\tunset($mobs[$found[1]]);\n\t\t\t}\n\t\t}\n\t\t// remaining usages are not in text anymore -> delete them\n\t\t// and media objects (note: delete method of ilObjMediaObject\n\t\t// checks whether object is used in another context; if yes,\n\t\t// the object is not deleted!)\n\t\tforeach($mobs as $mob)\n\t\t{\n\t\t\tilObjMediaObject::_removeUsage($mob, $a_usage_type,\n\t\t\t\t$a_usage_id);\n\t\t\t$mob_obj =& new ilObjMediaObject($mob);\n\t\t\t$mob_obj->delete();\n\t\t}\n\t}", "public function clearRtfPlugins()\n {\n $this->collRtfPlugins = null; // important to set this to NULL since that means it is uninitialized\n }", "public function clean()\n {\n\n $this->tokens = [];\n $this->rawMatches = [];\n\n }", "public function tearDown(): void\n {\n $media = $this->fixtures->getReference('media');\n $media = $this->entityManager->merge($media);\n $this->entityManager->remove($media);\n $this->entityManager->flush();\n\n parent::tearDown();\n }", "public function reset()\n {\n $this->getDb()->exec('delete from media');\n //pictures and vignettes deletion\n $this->deleteMedias();\n //backup deletion\n $this->deleteBackup();\n }", "public function clean()\n {\n $this->file = '';\n $this->vars = array();\n $this->headers = array();\n $this->metas = array();\n $this->jses = array();\n $this->javascript = array();\n $this->attachments = array();\n $this->csses = array();\n }", "public function cleanseFields() {\n $this->dictionary->remove('nospam');\n $this->dictionary->remove('blank');\n $submitVar = $this->controller->getProperty('submitVar');\n if (!empty($submitVar)) {\n $this->dictionary->remove($submitVar);\n }\n }", "function clear()\n {\n $this->meta_name = \"\";\n $this->vocab = \"\";\n $this->text = \"\";\n $this->lang = \"\";\n $this->attrs = array();\n }", "public function tearDown()\n {\n unset($this->_textile);\n }", "protected function tearDown()\n {\n if (count($this->_objects) > 0) {\n foreach($this->_objects as $cf) {\n $this->_instance->deleteCustomField($cf);\n }\n }\n }", "public static function clear(): void\n {\n self::$engine = null;\n self::$validator = null;\n self::$translationFolderPath = \"\";\n self::$lang = self::DEFAULT_LANG;\n }", "public function tear_down() {\n\t\tremove_filter( 'wp_image_editors', array( $this, 'setEngine' ), 10, 2 );\n\t\tparent::tear_down();\n\t}", "public function clean()\n\t{\n\t\tforeach ($this->dirtyFields AS $field)\n\t\t\t$this->cleanField($field);\n\t}", "private function cleanUp() : void\n {\n\n // For every line.\n foreach ($this->contents as $lineId => $line) {\n\n // Test.\n preg_match('/( +)(\\*)( )(.+)/', $line, $output);\n\n // First option - this is proper comment line.\n // Second option - sth is wrong - ignore this line.\n if (isset($output[4]) === true && empty($output[4]) === false) {\n $this->contents[$lineId] = $output[4];\n } else {\n unset($this->contents[$lineId]);\n }\n }\n }", "function getRTETextWithMediaObjects()\n\t{\n\t\treturn parent::getRTETextWithMediaObjects();\n\t}", "public function clearRIssuesRtfplugins()\n {\n $this->collRIssuesRtfplugins = null; // important to set this to NULL since that means it is uninitialized\n }", "function cleanup()\n {\n if (is_object( $this->roottag )) {\n $this->roottag->clear_subtags();\n }\n }", "protected function clear()\n {\n $this->innerHtml = null;\n $this->outerHtml = null;\n $this->text = null;\n }", "function getRTETextWithMediaObjects()\n\t{\n\t\t$text = parent::getRTETextWithMediaObjects();\n\t\treturn $text;\n\t}", "protected function tearDown()\n\t{\n\t\tJDocument::$_buffer = null;\n\t\tunset($this->object);\n\t\tparent::tearDown();\n\t}", "private function unsetProperties(){\n //Human::log(\"--------------------------------------------------- unset initial properties for \".$this->modelName);\n foreach($this->fields() as $f){\n \n $fieldName=$f->name;\n \n unset($this->$fieldName);\n /*\n if(gettype($this->$fieldName)==\"object\"){\n Human::log(\"FIELD now $fieldName is \". get_class($this->$fieldName)); \n }else{\n Human::log(\"FIELD now $fieldName is \". gettype($this->$fieldName)); \n }\n\t \n\t */\n } \n }", "public function cleanup()\n {\n // Remove old parts without binaries \n $this->removePartsWithoutBinary();\n \n // Remove parts where the binary is missing\n $this->removePartsWithMissingBinary();\n \n // Remove binaries without parts\n $this->removeBinariesWithoutParts();\n }", "public function clearEmbargo();", "function sld_rm_post_custom_fields() {\n\t// pages\n\tremove_meta_box( 'postcustom' , 'page' , 'normal' );\n\tremove_meta_box( 'commentstatusdiv' , 'page' , 'normal' );\n\tremove_meta_box( 'commentsdiv' , 'page' , 'normal' );\n\tremove_meta_box( 'authordiv' , 'page' , 'normal' );\n\n\t// posts\n\tremove_meta_box( 'postcustom' , 'post' , 'normal' );\n\tremove_meta_box( 'postexcerpt' , 'post' , 'normal' );\n\tremove_meta_box( 'trackbacksdiv' , 'post' , 'normal' );\n}", "public function clean()\n\t{\n\t\t(($sPlugin = Phpfox_Plugin::get('video.component_block_detail_clean')) ? eval($sPlugin) : false);\n\t}" ]
[ "0.61022234", "0.6075657", "0.6002784", "0.59121126", "0.5902467", "0.58489764", "0.58252573", "0.5776481", "0.5722186", "0.5719736", "0.5719532", "0.5719202", "0.57048184", "0.5586723", "0.55762815", "0.5574571", "0.55657905", "0.5507502", "0.5478062", "0.5444388", "0.5429171", "0.542199", "0.54189795", "0.54145306", "0.53994346", "0.53648853", "0.5362594", "0.53621155", "0.53415465", "0.5340312" ]
0.732645
0
Saves the survey questions to the database
function saveQuestionsToDb() { global $ilDB; // save old questions state $old_questions = array(); $result = $ilDB->queryF("SELECT * FROM svy_svy_qst WHERE survey_fi = %s", array('integer'), array($this->getSurveyId()) ); if ($result->numRows()) { while ($row = $ilDB->fetchAssoc($result)) { $old_questions[$row["question_fi"]] = $row; } } // delete existing question relations $affectedRows = $ilDB->manipulateF("DELETE FROM svy_svy_qst WHERE survey_fi = %s", array('integer'), array($this->getSurveyId()) ); // create new question relations foreach ($this->questions as $key => $value) { $next_id = $ilDB->nextId('svy_svy_qst'); $affectedRows = $ilDB->manipulateF("INSERT INTO svy_svy_qst (survey_question_id, survey_fi, question_fi, heading, sequence, tstamp) VALUES (%s, %s, %s, %s, %s, %s)", array('integer','integer','integer','text','integer','integer'), array($next_id, $this->getSurveyId(), $value, (strlen($old_questions[$value]["heading"])) ? $old_questions[$value]["heading"] : NULL, $key, time()) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save($answers);", "public function saveAction()\n {\n $user = Mage::getSingleton('admin/session')->getUser(); \n $post_data = $this->getRequest()->getPost();\n\n try {\n $survey = Mage::getModel('client/survey')->loadSurveyByEmail($user->getEmail());\n if ($survey->getId()) $post_data['id'] = $survey->getId();\n\n $survey->setData($post_data);\n $survey->setName($user->getName());\n $survey->setEmail($user->getEmail());\n\n $survey->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('client')->__('Survey was successfully saved. Thank you!'));\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n }\n\n $this->_redirect('*/*/');\n }", "public static function insertSurvey()\n\t{\n\t\tif(isset($_POST['SurveyID']) && (is_numeric($_POST['SurveyID'])))\n\t\t{//insert response!\n\t\t\t$iConn = IDB::conn();\n\t\t\t// turn off auto-commit\n\t\t\tmysqli_autocommit($iConn, FALSE);\n\t\t\t//insert response\n\t\t\t$sql = sprintf(\"INSERT into \" . PREFIX . \"responses(SurveyID,DateAdded) VALUES ('%d',NOW())\",$_POST['SurveyID']);\n\t\t\t$result = @mysqli_query($iConn,$sql); //moved or die() below!\n\t\t\t\n\t\t\tif(!$result)\n\t\t\t{// if error, roll back transaction\n\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\tdie(trigger_error(\"Error Entering Response: \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t} \n\t\t\t\n\t\t\t//retrieve responseid\n\t\t\t$ResponseID = mysqli_insert_id($iConn); //get ID of last record inserted\n\t\t\t\n\t\t\tif(!$result)\n\t\t\t{// if error, roll back transaction\n\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\tdie(trigger_error(\"Error Retrieving ResponseID: \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t} \n\t\n\t\t\t//loop through and insert answers\n\t\t\tforeach($_POST as $varName=> $value)\n\t\t\t{//add objects to collection\n\t\t\t\t $qTest = substr($varName,0,2); //check for \"obj_\" added to numeric type\n\t\t\t\t if($qTest==\"q_\")\n\t\t\t\t {//add choice!\n\t\t\t\t \t$QuestionID = substr($varName,2); //identify question\n\t\t\t\t \t\n\t\t\t\t \tif(is_array($_POST[$varName]))\n\t\t\t\t \t{//checkboxes are arrays, and we need to loop through each checked item to insert\n\t\t\t\t\t \twhile (list ($key,$value) = @each($_POST[$varName])){\n\t\t\t\t\t\t \t$sql = \"insert into \" . PREFIX . \"responses_answers(ResponseID,QuestionID,AnswerID) values($ResponseID,$QuestionID,$value)\";\n\t\t\t\t\t \t\t$result = @mysqli_query($iConn,$sql);\n\t\t\t\t\t \t\tif(!$result)\n\t\t\t\t\t\t\t{// if error, roll back transaction\n\t\t\t\t\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\t\t\t\t\tdie(trigger_error(\"Error Inserting Choice (array/checkbox): \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t}\n\t\t\t \t\t}else{//not an array, so likely radio or select\n\t\t\t\t \t\t$sql = \"insert into \" . PREFIX . \"responses_answers(ResponseID,QuestionID,AnswerID) values($ResponseID,$QuestionID,$value)\";\n\t\t\t\t \t $result = @mysqli_query($iConn,$sql);\n\t\t\t\t \t if(!$result)\n\t\t\t\t\t\t{// if error, roll back transaction\n\t\t\t\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\t\t\t\tdie(trigger_error(\"Error Inserting Choice (single/radio): \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t\t\t\t} \n\t\t\t \t\t}\n\t\t\t\t }\n\t\t\t}\n\t\t\t//we got this far, lets COMMIT!\n\t\t\tmysqli_commit($iConn);\n\t\t\t\n\t\t\t// our transaction is over, turn autocommit back on\n\t\t\tmysqli_autocommit($iConn, TRUE);\n\t\t\t\n\t\t\t//count total responses, update TotalResponses\n\t\t\tself::responseCount((int)$_POST['SurveyID']); //convert to int on way in!\n\t\t\treturn TRUE; #\n\t\t}else{\n\t\t\treturn FALSE;\t\n\t\t}\n\n\t}", "public function store_survey_post()\n\t\t{\n\t\t\t$clickValue = $this->post('clickValue');\n\t\t\t$optionId = $this->post('optionId');\n\t\t\t$uuid = $this->post('uuid');\n\t\t\t$weekSend = $this->post('weekSend');\n\t\t\tif(!empty($clickValue) &&\n\t\t\t\t!empty($optionId) &&\n\t\t\t\t!empty($uuid) &&\n\t\t\t\t!empty($weekSend)\n\t\t\t)\n\t\t\t{\n\t\t\t\t$insertData = array(\n\t\t\t\t\t'tans_opt_id' => $optionId,\n\t\t\t\t\t'tans_uuid' => $uuid,\n\t\t\t\t\t'tans_week' => $weekSend,\n\t\t\t\t\t'trans_survey_value' => $clickValue\n\t\t\t\t);\n\t\t\t\t$tempStatus = $this->Student_survey_model->storeStudentSurvey($insertData);\n\t\t\t\tif($tempStatus)\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('SUCCESS');\n\t\t\t\t\t$data['message'] = $this->lang->line('VALID_TOKEN_MESSAGE');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t\t$data['message'] = $this->lang->line('unable_save_answer');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t$data['message'] = $this->lang->line('please_pass_required');\n\t\t\t}\n\t\t\t$this->response($data , 200);\n\t\t}", "public function store(Request $request)\n {\n $question = new Question;\n $question->prompt = $request->prompt;\n $question->difficulty = $request->difficulty;\n $question->total_score = $request->total_score;\n $question->subject_id = 1;\n $question->save();\n\n $a1 = new Answer;\n $a2 = new Answer;\n $a3 = new Answer;\n $a4 = new Answer;\n $a5 = new Answer;\n \n $a1->text = $request->choice1;\n $a2->text = $request->choice2;\n $a3->text = $request->choice3;\n $a4->text = $request->choice4;\n $a5->text = $request->choice5;\n\n $a1->save();\n $a2->save();\n $a3->save();\n $a4->save();\n $a5->save();\n\n $question->answers()->attach($a1->id, array('is_correct' => ($request->isCorrect1 != 1 ? 0 : 1)));\n $question->answers()->attach($a2->id, array('is_correct' => ($request->isCorrect2 != 1 ? 0 : 1)));\n $question->answers()->attach($a3->id, array('is_correct' => ($request->isCorrect3 != 1 ? 0 : 1)));\n $question->answers()->attach($a4->id, array('is_correct' => ($request->isCorrect4 != 1 ? 0 : 1)));\n $question->answers()->attach($a5->id, array('is_correct' => ($request->isCorrect5 != 1 ? 0 : 1)));\n\n // return Redirect::back()->withMsg('Quiz Question Created');\n return redirect('/question');\n }", "function save() {\n\t\t// If every question is answered, save to the db. Otherwise, to session.\n\t\tif($this->isComplete()) {\n\t\t\t$this->saveToRecord();\n\t\t} else {\n\t\t\t$this->saveToSession();\n\t\t}\n\t}", "public function save()\n {\n parent::save();\n\n // make sure that we are auditing this phase's survey\n $this->ensure_auditing();\n }", "public function store(Request $request)\n {\n $paper = Paper::findOrFail($request->get(\"paper_id\"));\n $question = new Question();\n $question->question = $request->get('question');\n $question->language = \"en\";\n $question->paper()->associate($paper);\n $question->save();\n foreach($request->get('choice') as $key => $choice){\n $answer = new Answer();\n $answer->type=\"string\";\n $answer->textual= $choice;\n $answer->correct= in_array($key+1,$request->get('answer')) <=> 0;\n $answer->question()->associate($question);\n $answer->save();\n }\n return redirect()->to(route(\"paper.edit\",$paper->id));\n\n }", "public function save()\n {\n $_SESSION['quiz'][$this->_testId] = serialize($this->_answers);\n }", "public function save() {\n $questionId = request('question');\n $answerTitle = request('answer_title');\n\n $answer = new Answer();\n $answer->question_id = $questionId;\n $answer->title = $answerTitle;\n $answer->save();\n\n return redirect('/poll/answers?question=' . $questionId);\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"question\",\n \"action\" => \"index\"\n ));\n }\n\n $quesid = $this->request->getPost(\"quesid\");\n\n $que = Question::findFirstByQuesId($quesid);\n if (!$que) {\n $this->flash->error(\"Question does not exist \" . $quesid);\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"question\",\n \"action\" => \"index\"\n ));\n }\n\n $que->setQuesId($this->request->getPost(\"quesid\"));\n $que->setDesc($this->request->getPost(\"desc\"));\n $que->setOrder($this->request->getPost(\"order\"));\n $que->setBkgrId($this->request->getPost(\"bkgrid\"));\n $que->setQtype($this->request->getPost(\"qtype\"));\n $que->setAmtText($this->request->getPost(\"amttext\"));\n $que->setAmtType($this->request->getPost(\"amttype\"));\n $que->setCrdt($this->request->getPost(\"crdt\"));\n $que->setCrdtId($this->request->getPost(\"crdtid\"));\n $que->setUpdt($this->request->getPost(\"updt\"));\n $que->setUpdtId($this->request->getPost(\"updtid\"));\n $que->setDelmark($this->request->getPost(\"delmark\"));\n \n\n if (!$que->save()) {\n\n foreach ($que->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"question\",\n \"action\" => \"edit\",\n \"params\" => array($que->quesid)\n ));\n }\n\n $this->flash->success(\"Question was updated successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"question\",\n \"action\" => \"index\"\n ));\n\n }", "function saveUserSurvey() {\n $result = array(); // an array to hold the survey results\n if (!$this->Session->check('Survey.respondent')) {\n die('No respondent ID');\n } else {\n $respondentid = $this->Session->read('Survey.respondent');\n $i = $this->Survey->Respondent->find('count', array(\n 'conditions' => array('Respondent.id' => $respondentid)\n ));\n if ($i !== 1) {\n die('Respondent not valid'.$i.' rid '.$respondentid);\n }\n }\n $data = array('Response' => array()); // a blank array to build our data for saving\n $answers = ($this->Session->check('Survey.answers')) ? $this->Session->read('Survey.answers') : array(); // get the answers to the questions\n $gdta = ($this->Session->check('Survey.hierarcy')) ? $this->Session->read('Survey.hierarcy') : array(); // the hierarchy from the session\n $mainGoal = ($this->Session->check('Survey.mainGoal')) ? $this->Session->read('Survey.mainGoal') : ''; // the main goal from the session\n $started = ($this->Session->check('Survey.started')) ? $this->Session->read('Survey.started') : ''; // the start time from the session\n $finished = date(\"Y-m-d H:i:s\"); // get the time that the survey was finished in MySQL DATETIME format\n $data['Response']['maingoal'] = $mainGoal;\n $data['Response']['respondent_id'] = $respondentid;\n $data['Response']['started'] = $started;\n $data['Response']['finished'] = $finished;\n $data['Answer'] = $this->Survey->Question->formatAnswersForSave($answers);\n $data['Objective'] = $gdta;\n $this->Survey->Respondent->Response->save($data);\n $data['Response']['id'] = $this->Survey->Respondent->Response->id;\n $this->Survey->Respondent->Response->saveAssociated($data,array('deep' => true));\n $this->__clearEditSession(CLEAR_SURVEY); // delete the temporary session values associated with the survey\n $this->render('/Pages/completed', 'survey');\n }", "public function submit_survey_post()\n\t\t{\n\t\t\t$testId = $this->post('testId');\n\t\t\t$uuid = $this->post('uuid');\n\t\t\t$weekSend = $this->post('weekSend');\n\t\t\tif(!empty($testId) &&\n\t\t\t\t!empty($uuid) &&\n\t\t\t\t!empty($weekSend)\n\t\t\t)\n\t\t\t{\n\t\t\t\t$insertData = array(\n\t\t\t\t\t'ts_uuid' => $uuid,\n\t\t\t\t\t'ts_test_id' => $testId,\n\t\t\t\t\t'ts_week' => $weekSend,\n\t\t\t\t\t'ts_submitted_on' => date('Y-m-d H:i:s')\n\t\t\t\t);\n\t\t\t\t$tempStatus = $this->Student_survey_model->insertSurvey($insertData);\n\t\t\t\tif($tempStatus)\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('SUCCESS');\n\t\t\t\t\t$data['message'] = $this->lang->line('VALID_TOKEN_MESSAGE');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t\t$data['message'] = $this->lang->line('unable_save_answer');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t$data['message'] = $this->lang->line('please_pass_required');\n\t\t\t}\n\t\t\t$this->response($data , 200);\n\t\t}", "function saveToDb()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t// date handling\n\t\t$rmd_start = $this->getReminderStart();\n\t\tif(is_object($rmd_start))\n\t\t{\n\t\t\t$rmd_start = $rmd_start->get(IL_CAL_DATE);\n\t\t}\n\t\t$rmd_end = $this->getReminderEnd();\n\t\tif(is_object($rmd_end))\n\t\t{\n\t\t\t$rmd_end = $rmd_end->get(IL_CAL_DATE);\n\t\t}\n\t\t\n\t\tinclude_once(\"./Services/RTE/classes/class.ilRTE.php\");\n\t\tif ($this->getSurveyId() < 1)\n\t\t{\n\t\t\t$next_id = $ilDB->nextId('svy_svy');\n\t\t\t$affectedRows = $ilDB->insert(\"svy_svy\", array(\n\t\t\t\t\"survey_id\" => array(\"integer\", $next_id),\n\t\t\t\t\"obj_fi\" => array(\"integer\", $this->getId()),\n\t\t\t\t\"author\" => array(\"text\", $this->getAuthor()),\n\t\t\t\t\"introduction\" => array(\"clob\", ilRTE::_replaceMediaObjectImageSrc($this->getIntroduction(), 0)),\n\t\t\t\t\"outro\" => array(\"clob\", ilRTE::_replaceMediaObjectImageSrc($this->getOutro(), 0)),\n\t\t\t\t\"status\" => array(\"text\", $this->getStatus()),\n\t\t\t\t\"startdate\" => array(\"text\", $this->getStartDate()),\n\t\t\t\t\"enddate\" => array(\"text\", $this->getEndDate()),\n\t\t\t\t\"evaluation_access\" => array(\"text\", $this->getEvaluationAccess()),\n\t\t\t\t\"invitation\" => array(\"text\", $this->getInvitation()),\n\t\t\t\t\"invitation_mode\" => array(\"text\", $this->getInvitationMode()),\n\t\t\t\t\"complete\" => array(\"text\", $this->isComplete()),\n\t\t\t\t\"created\" => array(\"integer\", time()),\n\t\t\t\t\"anonymize\" => array(\"text\", $this->getAnonymize()),\n\t\t\t\t\"show_question_titles\" => array(\"text\", $this->getShowQuestionTitles()),\n\t\t\t\t\"mailnotification\" => array('integer', ($this->getMailNotification()) ? 1 : 0),\n\t\t\t\t\"mailaddresses\" => array('text', strlen($this->getMailAddresses()) ? $this->getMailAddresses() : NULL),\n\t\t\t\t\"mailparticipantdata\" => array('text', strlen($this->getMailParticipantData()) ? $this->getMailParticipantData() : NULL),\n\t\t\t\t\"tstamp\" => array(\"integer\", time()),\n\t\t\t\t\"template_id\" => array(\"integer\", $this->getTemplate()),\n\t\t\t\t\"pool_usage\" => array(\"integer\", $this->getPoolUsage()),\n\t\t\t\t// 360°\n\t\t\t\t\"mode_360\" => array(\"integer\", $this->get360Mode()),\n\t\t\t\t\"mode_360_self_eval\" => array(\"integer\", $this->get360SelfEvaluation()),\n\t\t\t\t\"mode_360_self_rate\" => array(\"integer\", $this->get360SelfRaters()),\n\t\t\t\t\"mode_360_self_appr\" => array(\"integer\", $this->get360SelfAppraisee()),\n\t\t\t\t\"mode_360_results\" => array(\"integer\", $this->get360Results()),\n\t\t\t\t\"mode_360_skill_service\" => array(\"integer\", (int) $this->get360SkillService()),\n\t\t\t\t// reminder/notification\n\t\t\t\t\"reminder_status\" => array(\"integer\", (int)$this->getReminderStatus()),\n\t\t\t\t\"reminder_start\" => array(\"datetime\", $rmd_start),\n\t\t\t\t\"reminder_end\" => array(\"datetime\", $rmd_end),\n\t\t\t\t\"reminder_frequency\" => array(\"integer\", (int)$this->getReminderFrequency()),\t\t\t\t\n\t\t\t\t\"reminder_target\" => array(\"integer\", (int)$this->getReminderTarget()),\n\t\t\t\t\"reminder_last_sent\" => array(\"datetime\", $this->getReminderLastSent()),\n\t\t\t\t\"tutor_ntf_status\" => array(\"integer\", (int)$this->getTutorNotificationStatus()),\n\t\t\t\t\"tutor_ntf_reci\" => array(\"text\", implode(\";\", (array)$this->getTutorNotificationRecipients())),\n\t\t\t\t\"tutor_ntf_target\" => array(\"integer\", (int)$this->getTutorNotificationTarget()),\n\t\t\t\t\"own_results_view\" => array(\"integer\", $this->hasViewOwnResults()),\n\t\t\t\t\"own_results_mail\" => array(\"integer\", $this->hasMailOwnResults())\n \t\t\t));\n\t\t\t$this->setSurveyId($next_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$affectedRows = $ilDB->update(\"svy_svy\", array(\n\t\t\t\t\"author\" => array(\"text\", $this->getAuthor()),\n\t\t\t\t\"introduction\" => array(\"clob\", ilRTE::_replaceMediaObjectImageSrc($this->getIntroduction(), 0)),\n\t\t\t\t\"outro\" => array(\"clob\", ilRTE::_replaceMediaObjectImageSrc($this->getOutro(), 0)),\n\t\t\t\t\"status\" => array(\"text\", $this->getStatus()),\n\t\t\t\t\"startdate\" => array(\"text\", $this->getStartDate()),\n\t\t\t\t\"enddate\" => array(\"text\", $this->getEndDate()),\n\t\t\t\t\"evaluation_access\" => array(\"text\", $this->getEvaluationAccess()),\n\t\t\t\t\"invitation\" => array(\"text\", $this->getInvitation()),\n\t\t\t\t\"invitation_mode\" => array(\"text\", $this->getInvitationMode()),\n\t\t\t\t\"complete\" => array(\"text\", $this->isComplete()),\n\t\t\t\t\"anonymize\" => array(\"text\", $this->getAnonymize()),\n\t\t\t\t\"show_question_titles\" => array(\"text\", $this->getShowQuestionTitles()),\n\t\t\t\t\"mailnotification\" => array('integer', ($this->getMailNotification()) ? 1 : 0),\n\t\t\t\t\"mailaddresses\" => array('text', strlen($this->getMailAddresses()) ? $this->getMailAddresses() : NULL),\n\t\t\t\t\"mailparticipantdata\" => array('text', strlen($this->getMailParticipantData()) ? $this->getMailParticipantData() : NULL),\n\t\t\t\t\"tstamp\" => array(\"integer\", time()),\n\t\t\t\t\"template_id\" => array(\"integer\", $this->getTemplate()),\n\t\t\t\t\"pool_usage\" => array(\"integer\", $this->getPoolUsage()),\n\t\t\t\t// 360°\n\t\t\t\t\"mode_360\" => array(\"integer\", $this->get360Mode()),\n\t\t\t\t\"mode_360_self_eval\" => array(\"integer\", $this->get360SelfEvaluation()),\n\t\t\t\t\"mode_360_self_rate\" => array(\"integer\", $this->get360SelfRaters()),\n\t\t\t\t\"mode_360_self_appr\" => array(\"integer\", $this->get360SelfAppraisee()),\n\t\t\t\t\"mode_360_results\" => array(\"integer\", $this->get360Results()),\n\t\t\t\t\"mode_360_skill_service\" => array(\"integer\", (int) $this->get360SkillService()),\n\t\t\t\t// reminder/notification\n\t\t\t\t\"reminder_status\" => array(\"integer\", $this->getReminderStatus()),\n\t\t\t\t\"reminder_start\" => array(\"datetime\", $rmd_start),\n\t\t\t\t\"reminder_end\" => array(\"datetime\", $rmd_end),\n\t\t\t\t\"reminder_frequency\" => array(\"integer\", $this->getReminderFrequency()),\n\t\t\t\t\"reminder_target\" => array(\"integer\", $this->getReminderTarget()),\n\t\t\t\t\"reminder_last_sent\" => array(\"datetime\", $this->getReminderLastSent()),\n\t\t\t\t\"tutor_ntf_status\" => array(\"integer\", $this->getTutorNotificationStatus()),\n\t\t\t\t\"tutor_ntf_reci\" => array(\"text\", implode(\";\", (array)$this->getTutorNotificationRecipients())),\n\t\t\t\t\"tutor_ntf_target\" => array(\"integer\", $this->getTutorNotificationTarget()),\n\t\t\t\t\"own_results_view\" => array(\"integer\", $this->hasViewOwnResults()),\n\t\t\t\t\"own_results_mail\" => array(\"integer\", $this->hasMailOwnResults())\n\t\t\t), array(\n\t\t\t\"survey_id\" => array(\"integer\", $this->getSurveyId())\n\t\t\t));\n\t\t}\n\t\tif ($affectedRows)\n\t\t{\n\t\t\t// save questions to db\n\t\t\t$this->saveQuestionsToDb();\n\t\t}\n\t\t\n\t\t// moved activation to ilObjectActivation\n\t\tif($this->ref_id)\n\t\t{\n\t\t\tinclude_once \"./Services/Object/classes/class.ilObjectActivation.php\";\t\t\n\t\t\tilObjectActivation::getItem($this->ref_id);\n\t\t\t\n\t\t\t$item = new ilObjectActivation;\t\t\t\n\t\t\tif(!$this->isActivationLimited())\n\t\t\t{\n\t\t\t\t$item->setTimingType(ilObjectActivation::TIMINGS_DEACTIVATED);\n\t\t\t}\n\t\t\telse\n\t\t\t{\t\t\t\t\n\t\t\t\t$item->setTimingType(ilObjectActivation::TIMINGS_ACTIVATION);\n\t\t\t\t$item->setTimingStart($this->getActivationStartDate());\n\t\t\t\t$item->setTimingEnd($this->getActivationEndDate());\n\t\t\t\t$item->toggleVisible($this->getActivationVisibility());\n\t\t\t}\t\t\t\t\t\t\n\t\t\t\n\t\t\t$item->update($this->ref_id);\t\t\n\t\t}\n\t}", "public function save_survey_data(Request $request)\n\t{\t\n\t\t$survey_id \t= $request['survey_id'];\n\t\t$grp \t\t= GROUP::where('survey_id',$survey_id);\n\t\t$sq \t\t= SQ::where('survey_id', $survey_id);\t\t\n\t\t$data \t\t= json_decode($request['survey_data'],true);\n\t\ttry{\n\t\t\t\tDB::beginTransaction();\n\t\t\t\tif($grp->count() > 0)\n\t\t\t\t{\n\t\t\t\t\t$grp->forceDelete();\n\t\t\t\t\t$msg = \"Update Successfully Survey Group Question\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\t$msg = \"Successfully Create Survey Group & Questions\";\n\t\t\t\t}\n\t\t\t\tif($sq->count() > 0)\n\t\t\t\t{\n\t\t\t\t\t$sq->forceDelete();\n\t\t\t\t}\n\t\t\t\tforeach($data as $key => $value) {\n\t\t\t\t\t//group \n\t\t\t\t\t$grp = new GROUP();\n\t\t\t\t\t$grp->survey_id \t=\t$survey_id;//$request['survey_id'];\n\t\t\t\t\t$grp->title \t\t=\t$value[\"group_name\"]; \n\t\t\t\t\t$grp->description \t=\t$value[\"group_description\"]; \n\t\t\t\t\t$grp->save();\n\t\t\t\t\tforeach ($value['group_questions'] as $key => $val) {\n\t\t\t\t\t// group Question\t\t\t\t \n\t\t\t\t\t\t$sq = \t new SQ();\n\t\t\t\t\t\t$sq->question = $val[\"question\"];\n\t\t\t\t\t\tunset($val[\"question\"]);\n\t\t\t\t\t\t$sq->answer = \tjson_encode($val);\n\t\t\t\t\t\t$sq->survey_id = $survey_id;\n\t\t\t\t\t\t$sq->group_id = $grp->id;\n\t\t\t\t\t\t$sq->save();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tDB::commit();\n\t\t\t\treturn ['status'=>\"success\", \"message\"=>$msg];\n\t\t\t}catch(\\Exception $e){\n\t\t\t\tDB::rollback();\n\t\t\t\tthrow $e;\n\t\t\t}\t\t\t\t\n\t}", "public function store(Request $request)\n {\n $destory = WebinarQuestionnaire::where('webinar_id', $request->webinar_id)\n ->where('fair_id',$request->fair_id)->delete();\n $questions = CareerTest::all(); \n foreach($questions as $question){\n $id = $question->id;\n $answers = $request->input(\"options$id\");\n if($answers){\n foreach($answers as $answer){\n $score = $request->input(\"score$answer\");\n WebinarQuestionnaire::create(array(\n 'fair_id' => $request->fair_id,\n 'webinar_id' => $request->webinar_id,\n 'test_id' => $id,\n 'answer' => $answer,\n 'score' => $score\n ));\n }\n }\n }\n return response()->json(\n [\n 'success' => true,\n 'message' => 'Webinar Questionnaire Set Successfully' \n ],\n 200);\n\n }", "public function run()\n {\n DB::table('survey_questions')->insert([\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'heading',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Informatie over de patiënt:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Leeftijd:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'textarea',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Onderliggend lijden welk invloed kan hebben op de wondgenezing: (indien niet aanwezig gelieve n.v.t te vermelden).',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'heading',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Informatie over de wond',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => null,\n 'required' => true,\n 'options' => json_encode(['Nieuwe wond', 'Bestaande wond']),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Sinds wanneer?',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 6,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => null,\n 'required' => true,\n 'options' => json_encode(['dag(en)', 'week/weken']),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Welke verband is het meest recentelijk op deze wond aangebracht?',\n 'required' => true,\n 'options' => json_encode([\n ['Fiberverbanden met hoog absorptievermogen of alginaten, gelieve de naam van het product te vermelden:'],\n ['Schuimverband, gelieve de naam van het product te vermelden:'],\n ['Zilververband, gelieve de naam van het product te vermelden:'],\n ['Superabsorberend, gelieve de naam van het product te vermelden:'],\n ['Hydrocolloïde, gelieve de naam van het product te vermelden:'],\n ['Ander(e) type(n), gelieve de naam van het product te vermelden:'],\n 'Geen',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Type wond:',\n 'required' => true,\n 'options' => json_encode([\n 'Acute wond',\n 'Chronische wond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Geïnfecteerd?',\n 'required' => true,\n 'options' => json_encode([\n 'Ja',\n 'Nee',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => 'Andere acute wond, namelijk:',\n 'text' => '(Indien acute wond aangevinkt) het gaat in het bijzonder om een …',\n 'required' => true,\n 'options' => json_encode([\n 'Traumatische wond (oppervlakkige schaafwond, laceratie, flyctenen, oppervlakkige snijwonden en huidscheuren)',\n 'Tweedegraads brandwond',\n 'Dermabrasie / Ontvelling',\n 'Chirurgische wond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => 'Andere chronische wond, namelijk',\n 'text' => '(Indien chronische wond aangevinkt) het gaat in het bijzonder om een …',\n 'required' => true,\n 'options' => json_encode([\n 'Decubitus wond',\n 'Ulcus Cruris beenwond',\n 'Diabetische voetwond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Wat is de hoeveelheid wondvocht?',\n 'required' => true,\n 'options' => json_encode([\n 'Droog',\n 'Vochtig',\n 'Nat',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Locatie van het wondbed',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => '% Necrotisch (zwart)',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => '% Granulerend (rood)',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => '% Beslag (geel)',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Anders, namelijk',\n 'required' => false,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => null,\n 'text' => 'Toestand van de huid rondom de wond:',\n 'required' => true,\n 'options' => json_encode([\n 'Gezond',\n 'Geïrriteerd/rood',\n 'Droog/eczematisch',\n 'Gemacereerd',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'heading',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'D0 – 1e toepassing van AQUACEL Foam of Foam Lite™ ConvaTec:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'date',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Datum (D0):',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Type verband:',\n 'required' => true,\n 'options' => json_encode([\n 'AQUACEL Foam',\n 'AQUACEL Ag Foam',\n 'Foam Lite ConvaTec',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'label',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Afmeting verbandkeuze:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'AQUACEL Foam – plakkend',\n 'required' => true,\n 'options' => json_encode([\n '8 x 8 cm',\n '10 x 10 cm',\n '12,5 x 12,5 cm',\n '17,5 x 17,5 cm',\n '21 x 21 cm',\n '25 x 30 cm',\n '8 x 13 cm',\n '10 x 20 cm',\n '10 x 25 cm',\n '10 x 30 cm',\n '19,8 x 14 cm',\n '20 x 16,9 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'AQUACEL Foam - zonder kleefrand',\n 'required' => true,\n 'options' => json_encode([\n '5 x 5 cm',\n '10 x 10 cm',\n '15 x 15 cm',\n '10 x 20 cm',\n '15 x 20 cm',\n '20 x 20 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'AQUACEL Foam – anatomische vormen',\n 'required' => true,\n 'options' => json_encode([\n 'Allround 19,8 x 14 cm',\n 'Sacrum 20 x 16,9 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Foam Lite™ ConvaTec',\n 'required' => true,\n 'options' => json_encode([\n '5 x 5 cm',\n '8 x 8 cm',\n '10 x 10 cm',\n '10 x 20 cm',\n '15 x 15 cm',\n '5,5 x 12 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => 'Secundair verband, gelieve het primaire verband te vermelden:',\n 'text' => 'Op welke wijze gebruikt u het gekozen verband?',\n 'required' => true,\n 'options' => json_encode([\n 'Primair verband',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => null,\n 'text' => 'Waarom heeft u voor dit specifieke verband gekozen? (Meerdere antwoorden zijn mogelijk)',\n 'required' => true,\n 'options' => json_encode([\n 'Vormbaar, zacht, comfortabel voor de patiënt',\n 'Vochtig wondmilieu met Hydrofiber',\n 'Bescherming van de wondranden (verticale absorptie)',\n 'Vasthouden van wondvocht en bacteriën (retentie)',\n 'Verbetering/ verkleining van de wond',\n 'Minder verbandwissels en/of draagtijd verlengd',\n 'Eenvoudig te gebruiken',\n 'Goede kennis van en ervaringen met schuimverbanden',\n 'Goede kennis van en ervaringen met Hydrofiber-verbanden',\n 'Type wond en hoeveelheid wondvocht',\n 'Fase van de wond',\n 'Locatie van de wond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => null,\n 'text' => 'Hoe ervaart u het aanbrengen van het verband?',\n 'required' => true,\n 'options' => json_encode([\n 'Gemakkelijk',\n ['Redelijk gemakkelijk (omschrijf)'],\n ['Niet gemakkelijk (omschrijf)'],\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Kleeft het verband bij het aanbrengen aan de handschoenen of aan zichzelf?',\n 'required' => true,\n 'options' => json_encode([\n 'Ja',\n 'Nee',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Zo ja, is het herpositioneerbaar?',\n 'required' => true,\n 'options' => json_encode([\n 'Ja',\n 'Nee',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n ]);\n }", "abstract protected function doSaveQuestion(Question $question);", "public function store($examId)\n {\n $exam = Exam::findOrFail($examId);\n $exam->questions_count++;\n $exam->save();\n\n $question = new Question;\n $question->question_name = NULL;\n $question->user_id = Auth::user()->user_id;\n $question->exam_id = $examId;\n $question->save();\n\n for ($i = 1; $i <= 4; $i++) {\n $answer = new Answer;\n $answer->answer_name = NULL;\n $answer->correct_answer = \"false\";\n $answer->question_id = $question->question_id;\n\n $answer->user_id = Auth::user()->user_id;\n $answer->exam_id = $exam->exam_id;\n $answer->save();\n }\n\n }", "public function saveAnswerByQuestion($data)\n\t{\n\t\t$this->db->insert('pergunta_jogador', array(\n\t\t\t'id_pergunta' => $data['id_pergunta'],\n\t\t\t'id_resposta' => $data['id_resposta'],\n\t\t\t'id_usuario' => $data['id_usuario'],\n\t\t\t'id_jogo' => $data['id_jogo']\n\t\t));\n\t}", "public function store(ExamQuestionRequest $request, $id)\n {\n //\n try{\n\n $question = new Question();\n $question->exam_id = $id;\n $question->question = $request->question;\n $question->type = $request->q_type;\n $question->sol = $request->co;\n $question->save();\n $x = $request->q_type == 0 ? 4 : 2 ;\n for($i = 1 ; $i <= $x ; $i++){\n $answer = new Answer();\n $answer->answer = $request->a[$i - 1];\n $answer->true = $i == $request->co ? 1 : 0 ;\n $answer->question_id = $question->id;\n $answer->save();\n }\n\n } catch(Exception $e) {\n return redirect()->back()->with([\n 'alert'=>[\n 'icon'=>'error',\n 'title'=>__('site.alert_failed'),\n 'text'=>__('site.question_failed_add'),\n ]]);\n }\n return redirect('admin/exam/'.$id.'/questions')->with([\n 'alert'=>[\n 'icon'=>'success',\n 'title'=>__('site.done'),\n 'text'=>__('site.added successfully'),\n ]]);\n\n }", "public function store(Request $request){\n $question = new Question();\n $question->questionnaire_id = $request->input('q_id');\n $question->question_name = $request->input('q_name');\n $question->question_type = $request->input('q_type');\n $question->choices = $request->input('choices');\n $question->answer = $request->input('q_ans');\n $question->points = $request->input('q_point');\n $question->save();\n }", "public function store(Request $request)\n {\n try{\n $quizId = $request->quiz_id;\n $numberOfQuestion = Quiz::where('id', $quizId)\n ->select('number_of_question')\n ->first();\n $totalQuestions = Question::where('quiz_id', $quizId)->count()+1;\n\n $newQuestion = [\n \"quiz_id\" => $quizId,\n \"question\" => $request->question,\n \"correct_answer\" => $request->correct_answer,\n \"option_1\" => $request->option_1,\n \"option_2\" => $request->option_2,\n \"option_3\" => $request->option_3,\n \"option_4\" => $request->option_4,\n ];\n\n $question = Question::create($newQuestion);\n if ($question) {\n if($totalQuestions == $numberOfQuestion->number_of_question) {\n Quiz::where('id', $quizId)->update(['publish' => 1]);\n }\n return back()->with('success', 'Question Successfully Created');\n }\n else\n return back()->with('error', 'Question Creating Error!');\n } catch (\\Exception $e) {\n dd($e->getMessage());\n }\n }", "public function store(Request $request)\n {\n $data = $this->validateForm($request);\n $question = Question::create($data);\n foreach($data['options'] as $key=>$option){\n $is_correct = false;\n if($key == $data['correct_answer']){\n $is_correct = true;\n }\n $answer = Answer::create([\n 'question_id' => $question->id,\n 'answer' => $option,\n 'is_correct' => $is_correct\n ]);\n }\n\n return redirect()->route('question.index')->with('message', 'Question created successfully');\n\n }", "public function store(Request $request)\n {\n\n $storeData = $request->validate([\n 'question' => 'required',\n 'allotted_time' => 'required',\n ]);\n $question = Question::create($storeData);\n foreach ($request->Options as $Option) {\n $question->answeroptions()->create([\n 'question_id'=>$question->id,\n 'option' => $Option['Option'],\n 'is_ans' => $Option['isans']=='on' ? 1:0 \n ]);\n\n \n }\n\n return redirect(route('questions.index'))->with('completed', 'Question created!');\n }", "public function submit(Request $request, $id)\n {\n if($id != $request->input('survey_id')) {\n if($request->has('return_url')\n && strlen($request->input('return_url'))>5) {\n return response()\n ->header('Location', $request->input('return_url'));\n }\n }\n\n $survey = \\App\\Survey::find($id);\n $answerArray = array();\n $validationArray = array();\n $messageArray = array();\n\n //loop through questions and check for answers\n foreach($survey->questions as $question) {\n if($question->required)\n {\n $validationArray['q-' . $question->id] = 'required';\n $messageArray['q-' . $question->id . '.required'] = $question->label . ' is required';\n }\n if($request->has('q-' . $question->id)) {\n if(is_array($request->input('q-' . $question->id)) && count($request->input('q-' . $question->id))) {\n $answerArray[$question->id] = array(\n 'value' => implode('|', $request->input('q-' . $question->id)),\n 'question_id' => $question->id\n );\n } elseif ( strlen(trim($request->input('q-' . $question->id))) > 0) {\n\n $answerArray[$question->id] = array(\n 'value'=> $request->input('q-' . $question->id),\n 'question_id'=>$question->id\n );\n\n } // I guess there is an empty string\n }\n }\n\n\n\n $this->validate($request, $validationArray, $messageArray);\n\n //if no errors, submit form!\n if(count($answerArray) > 0) {\n $sr = new \\App\\SurveyResponse(['survey_id'=>$id, 'ip'=>$_SERVER['REMOTE_ADDR']]);\n $sr->save();\n foreach($answerArray as $qid => $ans) {\n // print_r($ans);\n $sr->answers()->create($ans);\n }\n }\n\n\n if($survey->return_url\n && strlen($survey->return_url)>5\n && !$survey->kiosk_mode ) {\n return redirect()->away($survey->return_url);\n } else {\n return redirect('thanks/' . $survey->id);\n }\n }", "public function store(Request $request)\n {\n // validate the data\n $request->validate([\n 'animal_name' => 'required',\n 'question' => 'required',\n 'answer' => 'required',\n ]);\n\n // -- post --\n $questionPost = new Question;\n if($request -> worksheet == null) {\n $questionPost -> worksheet_id = $request -> worksheet_name;\n } else {\n $newWorksheet = new Worksheet;\n $newWorksheet -> worksheet_name = $request -> worksheet;\n $newWorksheet -> save();\n\n $worksheetId = Worksheet::where('worksheet_name', $request -> worksheet) -> first();\n $questionPost -> worksheet_id = $worksheetId -> worksheet_id;\n }\n\n $questionPost -> animal_id = $request -> animal_name;\n $questionPost -> question = $request -> question;\n $questionPost -> answer = $request -> answer;\n $questionPost -> question_id = $questionPost -> max('question_id') + 1;\n\n if($request -> description == null) {\n $questionPost -> description_id = $request -> existDesc;\n } else {\n $description = new Question_description;\n $description -> description = $request -> description;\n $description -> save();\n $descriptionId = Question_description::where('description', $request -> description) \n -> first();\n $questionPost -> description_id = $descriptionId -> description_id;\n }\n\n $questionPost -> save();\n\n for ($i = 1; $i <= 4; $i++) { \n $selection = \"selection_\".$i;\n if($request -> $selection == null)\n break;\n $newOption = new Question_option;\n $newOption -> question_id = Question::max('question_id');\n $newOption -> option_id = $i;\n $newOption -> qOption = $request -> $selection;\n $newOption -> save(); \n }\n\n Session::flash('success', 'this post was sucessfully saved');\n return redirect()->route('questionPosts.index'); \n }", "private function json_submitSurvey()\n {\n\n // Gets the input data entered in the Front-End\n $input = json_decode(file_get_contents(\"php://input\"));\n $title = $_POST['title'];\n $description = $_POST['description'];\n $question = $_POST['question'];\n $file = $_FILES['file']['name'];\n\n // Gets the last SurveyID\n $query = \"SELECT surveyID FROM Surveys ORDER BY surveyID DESC LIMIT 1;\";\n $params = [];\n $resLastSurveyID = json_decode($this->recordset->getJSONRecordSet($query, $params), true);\n $currentSurveyID = $resLastSurveyID['data']['0']['surveyID'] + 1;\n\n // Gets the last QuestionID\n $query = \"SELECT questionID FROM Questions ORDER BY questionID DESC LIMIT 1;\";\n $params = [];\n $resLastQuestionID = json_decode($this->recordset->getJSONRecordSet($query, $params), true);\n $currentQuestionID = $resLastQuestionID['data']['0']['questionID'] + 1;\n\n // Create the Uploads Directory\n $uploadsDirectory = dirname(__FILE__, 2) . \"/uploads\";\n $surveyDirectory = $uploadsDirectory . \"/\" . $currentSurveyID;\n $questionDirectory = $surveyDirectory . \"/\" . $currentQuestionID;\n// $questionDirectory = $questionDirectory . \"/\";\n\n // File Permissions\n if (!file_exists($questionDirectory)) {\n mkdir($questionDirectory, 0777, true);\n }\n\n // File Checks\n $path = pathinfo($file);\n $filename = $path['filename'];\n $ext = $path['extension'];\n $temp_name = $_FILES['file']['tmp_name'];\n $path_filename_ext = $questionDirectory . \"/\" . $filename . \".\" . $ext;\n if (file_exists($path_filename_ext)) {\n // echo \"Sorry, File Already Exists.\";\n } else {\n move_uploaded_file($temp_name, $path_filename_ext);\n // echo \"Congratulations! File Uploaded Successfully.\";\n }\n $media_url = \"uploads/\" . $currentSurveyID . \"/\" . $currentQuestionID . \"/\" . $_FILES['file']['name'];\n\n // Insert survey data into the Survey table\n $createSurveyQuery = \"INSERT INTO Surveys (surveyTitle, surveyDescription) VALUES (:surveyTitle, :surveyDescription);\";\n\n $createSurveyParams =\n [\n \":surveyTitle\" => $title,\n \":surveyDescription\" => $description,\n ];\n\n $resCreateSurvey = json_decode($this->recordset->getJSONRecordSet($createSurveyQuery, $createSurveyParams), true);\n\n print_r($resCreateSurvey);\n\n // Insert question data into the Questions table\n $createQuestionQuery = \"INSERT INTO Questions (question, mediaPath, surveyID) VALUES (:question, :media_url, :surveyID);\";\n\n $createQuestionParams =\n [\n \":question\" => $question,\n \":media_url\" => $media_url,\n \":surveyID\" => $currentSurveyID,\n ];\n\n $resCreateQuestion = json_decode($this->recordset->getJSONRecordSet($createQuestionQuery, $createQuestionParams), true);\n\n $res['status'] = 200;\n $res['filename'] = $file;\n $res['dirnametest'] = dirname(__FILE__, 2);\n $res['lastSurveyID'] = $resLastSurveyID;\n $res['lastQuestionID'] = $resLastQuestionID;\n $res['questionDirectory'] = $questionDirectory;\n\n return json_encode($res);\n }", "public function store(Request $request)\n {\n foreach ($request->question_id as $id) {\n\n $survey = new MorssSurvey;\n $survey->semester_id = $request->sem_id;\n $survey->user_id = Auth::user()->id;\n $survey->question_id = $id;\n $survey->rate = $request['qn_'.$id];\n $survey->save();\n\n }\n\n $remarks = new MorssSurveyRemark;\n $remarks->semester_id = $request->sem_id;\n $remarks->user_id = Auth::user()->id;\n $remarks->remarks = nl2br($request->remarks);\n $remarks->save();\n\n return dd($request);\n }", "function answerQuestions() {\n $this->layout = 'survey'; // use the more basic survey layout\n if (!$this->request->is('post')) {\n // if there is no data then show the initial view\n $survey = $this->Session->read('Survey.original'); // get the survey being used\n if (empty($survey['Question'])) { // if there are no questions then we don't need to show the question form at all\n $this->Session->write('Survey.progress', GDTA_ENTRY); // move progress forward and redirect to the runSurvey action\n $this->redirect(array('action' => 'runSurvey'));\n }\n $questions = $survey['Question'];\n $answers = ($this->Session->check('Survey.answers')) ? $this->Session->read('Survey.answers') : array(); // check to see if there are already answers in the session\n $choices = array(); // gather choices here keyed to each question id\n foreach ($questions as &$q) { // go through each question and look to see if there is an answer for it\n $checkId = $q['id'];\n $choices[$checkId] = array();\n if (isset($q['Choice'])) {\n foreach ($q['Choice'] as $choice) {\n $choices[$checkId][$choice['id']] = $choice['value'];\n }\n }\n foreach ($answers as $a) {\n if ($a['question_id'] == $checkId) {\n if ($q['type'] == MULTI_SELECT) {\n $q['answer'] = Set::extract('/id',$a['answer']);\n } else {\n $q['answer'] = $a['answer'];\n }\n break;\n }\n }\n }\n $this->set('questions', $questions); // send questions to the view\n $this->set('choices', $choices); // send choices for questions to the view, ordered for form elements\n } else { // we have form data so process it here\n if (isset($this->request->data['Answer'])) {\n // make sure we have answers in the data set\n $this->Session->write('Survey.answers', $this->request->data['Answer']); // write the answers to the session\n }\n $this->Session->write('Survey.progress', GDTA_ENTRY); // move progress forward and redirect to the runSurvey action\n $this->redirect(array('action' => 'runSurvey'));\n }\n }" ]
[ "0.7209578", "0.71866274", "0.7149955", "0.7146203", "0.7129381", "0.71078825", "0.69727767", "0.68159145", "0.68080336", "0.6793641", "0.67273414", "0.67218655", "0.6706229", "0.6702066", "0.6701771", "0.66964024", "0.6691624", "0.65584666", "0.65310115", "0.6514063", "0.64962", "0.6495149", "0.64504606", "0.64465165", "0.6434394", "0.6420916", "0.6401965", "0.63934153", "0.6382072", "0.6378393" ]
0.78849113
0
Returns a question gui object to a given questiontype and question id
function getQuestionGUI($questiontype, $question_id) { include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php"; return SurveyQuestionGUI::_getQuestionGUI($questiontype, $question_id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create($question, $type = ObjectFactory::TEXT_QUESTION)\n\t{\n\t\t// echo $type;\n\t\t$newQuestion = $this->objectFactory->createQuestion($type);\n\t\t// if ($type == ObjectFactory::SINGLE_CHOICE_QUESTION) echo \"single\";\n\t\t// echo $question;\n\t\t$newQuestion->setQuestion($question);\n\t\t$this->questions[$newQuestion->getId()] = $newQuestion;\n\t\treturn $newQuestion;\n\t}", "public function create($question, $type = ObjectFactory::TEXT_QUESTION) {\n $questionObj = $this->objectFactory->createQuestion($type);\n $questionObj->setQuestion($question);\n $this->poll->addItem($questionObj);\n return $questionObj;\n\t}", "private function getQuestion($id){\n $q = new Question();\n return $q->find($id);\n }", "public static function getQuestionInfoById($question_id) {\n\t\tif($question_id > 0){\n\t\t\treturn self::find($question_id);\n\t\t}\n }", "function ipal_get_qtype($questionid){\r\n\tglobal $DB;\r\n\t$questiontype=$DB->get_record('question',array('id'=>$questionid));\r\n\treturn($questiontype->qtype); \r\n}", "public function getQuestiontype()\n {\n return $this->hasOne(QuestionType::className(), ['id' => 'question_type_id']);\n }", "function getQuestion($id) { \n\ttry {\n\t\t$question = ORM::for_table('questions')->where('id', $id)->find_one();\n\t\tif (!$question) { \n\t\t\treturn 0;\n\t\t} else {\n\t\t\t$theQuestion = array();\n\t\t\t$theQuestion['id'] = $question->id;\n\t\t\t$theQuestion['text'] = $question->text;\n\t\t\t$theQuestion['answer1'] = $question->answer1;\n\t\t\t$theQuestion['answer2'] = $question->answer2;\n\t\t\t$theQuestion['vote_answer1'] = $question->vote_answer1;\n\t\t\t$theQuestion['vote_answer2'] = $question->vote_answer2;\n\t\t\treturn $theQuestion;\n\t\t}\n\t} catch (Exception $e) { \n\t\treturn 0;\n\t}\n}", "function &_instanciateQuestion($question_id) \n\t{\n\t\tif ($question_id < 1) return FALSE;\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\t$question_type = SurveyQuestion::_getQuestionType($question_id);\n\t\tif (strlen($question_type) == 0) return FALSE;\n\t\tSurveyQuestion::_includeClass($question_type);\n\t\t$question = new $question_type();\n\t\t$question->loadFromDb($question_id);\n\t\treturn $question;\n }", "function getQuestion($id){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//internal data. Same as GetInfo()\r\n\t\t$query= \"SELECT * FROM `tbl_question` WHERE `question_id` = $id LIMIT 1 ;\";\r\n\t\t$result = $this->mdb2->query($query) or die('An unknown error occurred while checking the data');\r\n\t\tif(MDB2::isError($result)){\r\n\t\t\treturn \"SelectError\";\r\n\t\t}else{\r\n\t\t\t$native_result = $result->getResource();\r\n\t\t\treturn $native_result;\t\t\t\t\t\t//Returns the question text\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//as a Mysql native result type.\r\n\t\t}\r\n\t}", "function get_by_id_question($id)\n {\n $this->db->where('tfselect_tfque_fk', $id);\n $query = $this->db->get('fis_dtraining_feedback_selections');\n return $query->result();\n }", "protected function addQuestionToolbarForm()\n\t{\n\t\tglobal $lng, $ilCtrl, $tpl;\n\n\t\tinclude_once \"Services/Form/classes/class.ilPropertyFormGUI.php\";\n\t\t$form = new ilPropertyFormGUI();\n\t\t$form->setFormAction($ilCtrl->getFormAction($this, \"addQuestionToolbar\"));\n\t\t$form->setTitle($lng->txt(\"survey_add_new_question\"));\n\n\t\t// question types\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php\";\n\t\t$questiontypes = ilObjSurveyQuestionPool::_getQuestiontypes();\n\t\t$type_map = array();\n\t\tforeach($questiontypes as $trans => $item)\n\t\t{\n\t\t\t$type_map[$item[\"questiontype_id\"]] = $trans;\n\t\t}\n\t\tinclude_once(\"./Services/Form/classes/class.ilSelectInputGUI.php\");\n\t\t$si = new ilSelectInputGUI($lng->txt(\"question_type\"), \"qtype\");\n\t\t$si->setOptions($type_map);\n\t\t$form->addItem($si);\n\n\t\t$pages = $this->object->getSurveyPages();\n\t\tif($pages)\n\t\t{\n\t\t\t$pages_drop = array(\"fst\"=>$lng->txt(\"survey_at_beginning\"));\n\t\t\tforeach($pages as $idx => $questions)\n\t\t\t{\n\t\t\t\t$question = array_shift($questions);\n\t\t\t\tif($question[\"questionblock_id\"])\n\t\t\t\t{\n\t\t\t\t\t$pages_drop[$idx+1] = $lng->txt(\"survey_behind_page\").\" \".$question[\"questionblock_title\"];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$pages_drop[$idx+1] = $lng->txt(\"survey_behind_page\").\" \".strip_tags($question[\"title\"]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$pos = new ilSelectInputGUI($lng->txt(\"position\"), \"pgov\");\n\t\t\t$pos->setOptions($pages_drop);\n\t\t\t$form->addItem($pos);\n\n\t\t\t$pos->setValue($this->current_page);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// #9089: 1st page \n\t\t\t$pos = new ilHiddenInputGUI(\"pgov\");\n\t\t\t$pos->setValue(\"fst\");\n\t\t\t$form->addItem($pos);\n\t\t}\n\n\t\tif($this->object->isPoolActive())\n\t\t{\n\t\t\t$this->editor_gui->createQuestionObject($form);\n\t\t}\n\n\t\t$form->addCommandButton(\"addQuestionToolbar\", $lng->txt(\"create\"));\n\t\t$form->addCommandButton(\"renderPage\", $lng->txt(\"cancel\"));\n\n\t\treturn $tpl->setContent($form->getHTML());\n\t}", "function selectQuestion($id_question)\n\t{\n\t\tglobal $dbh;\n\n\n\t\t$sql = \"SELECT \tQ.id_question,\n\t\t\t\t\t\tQ.title,\n\t\t\t\t\t\tQ.content,\n\t\t\t\t\t\tQ.dateCreated,\n\t\t\t\t\t\tQ.dateModified,\n\n\t\t\t\t\t\tU.id_user,\n\t\t\t\t\t\tU.user_pseudo,\n\t\t\t\t\t\tU.img_profile,\n\t\t\t\t\t\tU.score\n\n\t\t\t\tFROM users U, questions Q\t\t\t\t\n\t\t\t\tWHERE U.id_user = Q.id_user\n\t\t\t\tAND Q.id_question = :id_question\n\t\t\t\tORDER BY Q.dateModified DESC\";\n\n\t\t$stmt = $dbh->prepare($sql);\n\t\t$stmt->bindValue(\":id_question\", $id_question);\n\t\t$stmt->execute();\n\t\t\n\t\t//affiche\n\t\treturn $stmt->fetch();\n\t}", "public function questionAction(int $id) : object\n {\n\n $page = $this->di->get(\"page\");\n $questions = new Questions();\n $questions->setDb($this->di->get(\"dbqb\"));\n $question = $questions->find(\"id\", $id);\n $answers = new Answers();\n $answers->setDb($this->di->get(\"dbqb\"));\n $form = new AnswerForm($this->di, $id);\n $form->check();\n $all_answers_to_question = $answers->findAllWhere(\"question_id = ?\", $id);\n $all_answers_with_comments = [];\n foreach ($all_answers_to_question as $comment) {\n $comments = new Comments();\n $comments->setDb($this->di->get(\"dbqb\"));\n $all_comments = $comments->findAllWhere(\"answer_id = ?\", $comment->rowid);\n array_push($all_answers_with_comments, $all_comments);\n }\n\n $page->add(\"questions/view-question\", [\n \"question\" => $question,\n \"answers\" => $answers->findAllWhere(\"question_id = ?\", $id),\n \"comments\" => $all_answers_with_comments,\n \"form\" => $form->getHTML(),\n ]);\n\n return $page->render([\n \"title\" => \"Update an item\",\n ]);\n }", "function kilman_prep_for_questionform($kilman, $qid, $qtype) {\n $context = context_module::instance($kilman->cm->id);\n if ($qid != 0) {\n $question = clone($kilman->questions[$qid]);\n $question->qid = $question->id;\n $question->sid = $kilman->survey->id;\n $question->id = $kilman->cm->id;\n $draftideditor = file_get_submitted_draft_itemid('question');\n $content = file_prepare_draft_area($draftideditor, $context->id, 'mod_kilman', 'question',\n $qid, array('subdirs' => true), $question->content);\n $question->content = array('text' => $content, 'format' => FORMAT_HTML, 'itemid' => $draftideditor);\n\n if (isset($question->dependencies)) {\n foreach ($question->dependencies as $dependencies) {\n if ($dependencies->dependandor === \"and\") {\n $question->dependquestions_and[] = $dependencies->dependquestionid.','.$dependencies->dependchoiceid;\n $question->dependlogic_and[] = $dependencies->dependlogic;\n } else if ($dependencies->dependandor === \"or\") {\n $question->dependquestions_or[] = $dependencies->dependquestionid.','.$dependencies->dependchoiceid;\n $question->dependlogic_or[] = $dependencies->dependlogic;\n }\n }\n }\n } else {\n $question = \\mod_kilman\\question\\base::question_builder($qtype);\n $question->sid = $kilman->survey->id;\n $question->id = $kilman->cm->id;\n $question->type_id = $qtype;\n $question->type = '';\n $draftideditor = file_get_submitted_draft_itemid('question');\n $content = file_prepare_draft_area($draftideditor, $context->id, 'mod_kilman', 'question',\n null, array('subdirs' => true), '');\n $question->content = array('text' => $content, 'format' => FORMAT_HTML, 'itemid' => $draftideditor);\n }\n return $question;\n}", "function loadFromDb($question_id)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$result = $ilDB->queryF(\"SELECT qpl_questions.*, \" . $this->getAdditionalTableName() . \".* FROM qpl_questions LEFT JOIN \" . $this->getAdditionalTableName() . \" ON \" . $this->getAdditionalTableName() . \".question_fi = qpl_questions.question_id WHERE qpl_questions.question_id = %s\",\n\t\t\tarray(\"integer\"),\n\t\t\tarray($question_id)\n\t\t);\n\t\tif ($result->numRows() == 1)\n\t\t{\n\t\t\t$data = $ilDB->fetchAssoc($result);\n\t\t\t$this->setId($question_id);\n\t\t\t$this->setObjId($data[\"obj_fi\"]);\n\t\t\t$this->setNrOfTries($data['nr_of_tries']);\n\t\t\t$this->setTitle($data[\"title\"]);\n\t\t\t$this->setComment($data[\"description\"]);\n\t\t\t$this->setOriginalId($data[\"original_id\"]);\n\t\t\t$this->setAuthor($data[\"author\"]);\n\t\t\t$this->setPoints($data[\"points\"]);\n\t\t\t$this->setOwner($data[\"owner\"]);\n\t\t\tinclude_once(\"./Services/RTE/classes/class.ilRTE.php\");\n\t\t\t$this->setQuestion(ilRTE::_replaceMediaObjectImageSrc($data[\"question_text\"], 1));\n\t\t\t$this->setCorrectAnswers($data[\"correctanswers\"]);\n\t\t\t$this->setTextRating($data[\"textgap_rating\"]);\n\t\t\t$this->setEstimatedWorkingTime(substr($data[\"working_time\"], 0, 2), substr($data[\"working_time\"], 3, 2), substr($data[\"working_time\"], 6, 2));\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$this->setAdditionalContentEditingMode($data['add_cont_edit_mode']);\n\t\t\t}\n\t\t\tcatch(ilTestQuestionPoolException $e)\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\n\t\t$result = $ilDB->queryF(\"SELECT * FROM qpl_a_textsubset WHERE question_fi = %s ORDER BY aorder ASC\",\n\t\t\tarray('integer'),\n\t\t\tarray($question_id)\n\t\t);\n\t\tinclude_once \"./Modules/TestQuestionPool/classes/class.assAnswerBinaryStateImage.php\";\n\t\tif ($result->numRows() > 0)\n\t\t{\n\t\t\twhile ($data = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\tarray_push($this->answers, new ASS_AnswerBinaryStateImage($data[\"answertext\"], $data[\"points\"], $data[\"aorder\"]));\n\t\t\t}\n\t\t}\n\n\t\tparent::loadFromDb($question_id);\n\t}", "public function getQuestion($id){\r\n $conn = new DB();\r\n $connection = $conn->connect();\r\n\r\n $query = \"SELECT * FROM questions WHERE id = ? LIMIT 1\";\r\n if($stmt = $connection->prepare($query)){\r\n $stmt->bind_param(\"s\", $id);\r\n $stmt->execute();\r\n $stmt->bind_result($qid, $qquestion, $qanswers, $qcorrect_answer, $quiz_id);\r\n $stmt->fetch();\r\n $stmt->close();\r\n }\r\n return [\"id\" => $qid, \"question\" => $qquestion, \"answers\" => $qanswers, \"correct_answer\" => $qcorrect_answer, \"quiz_id\" => $quiz_id];\r\n }", "function show_question($id, $slug)\n\t{\n\t\t$this->form_validation->set_rules('id_questions', 'Id_Questions', 'required');\n\t\t$this->form_validation->set_rules('body', 'Body', 'required');\n\t\tif ($this->form_validation->run() == false) {\n\n\t\t\t$this->model_module->_set_viewers($id);\n\t\t\t$data['question'] = $this->model_module->questions_id('uuid_question', $id);\n\t\t\t$questions_id = $data['question']['id'];\n\t\t\t$data['module'] = $this->model_module->get_module($questions_id, $id);\n\t\t\t$queryGetquestion = \"SELECT `tb_questions` .*, `tbl_users`.`name`,`tbl_users`.`user_email`\n\t\t\t\t\tFROM `tb_questions` JOIN `tbl_users` \n\t\t\t\t\tON `tb_questions`.`id_user` = `tbl_users`. `user_id`\n\t\t\t\t\tlEFT JOIN `tb_sub_module` \n\t\t\t\t\tON `tb_questions`.`id_sub_module` = `tb_sub_module`.`id`\n\t\t\t\t\tWHERE `tb_questions`.`id` = $questions_id\n\t\t\t\";\n\t\t\t$query = $this->db->query($queryGetquestion)->row_array();\n\t\t\t$data['get_question'] = $query;\n\t\t\t$answerQuery = \"SELECT `tb_answers` .*, `tbl_users`.`name`,`tbl_users`.`user_email`\n\t\t\t\tFROM `tb_answers`\n\t\t\t\tJOIN `tb_questions` \n\t\t\t\tON `tb_answers`.`id_questions` = `tb_questions`.`id`\n\t\t\t\tJOIN `tbl_users`\n\t\t\t\tON `tb_answers`.`id_user` = `tbl_users`.`user_id`\n\t\t\t\tWHERE `tb_answers`.`id_questions` = $questions_id\n\t\t\t\tORDER BY `tb_answers`.`created_at` DESC\";\n\t\t\t$answer = $this->db->query($answerQuery)->result_array();\n\t\t\t$data['get_answer'] = $answer;\n\n\t\t\t// response_json($data);\n\t\t\t$this->load->view('layouts/header');\n\t\t\t$this->load->view('_partalis/navigation');\n\t\t\t$this->load->view('modules/show_questions', $data);\n\t\t\t$this->load->view('layouts/footer');\n\t\t} else {\n\t\t\t$this->model_module->addAnswers();\n\t\t\tredirect('user/module/show_question/' . $id . '/' . $slug);\n\t\t}\n\t}", "public function getOneQuestion($id)\n {\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n $post = new Post($this->di->get(\"db\"));\n $user = new User($this->di->get(\"db\"));\n $comment = $this->di->get(\"comment\");\n $tag = $this->di->get(\"tag\");\n\n $question = $post->getOne($id);\n if ($question->type === \"answer\") {\n $this->di->get(\"response\")->redirect(\"questions/{$question->parent}\");\n }\n $question->tags = $tag->getPostTags($question->id);\n $question->user = $user->find(\"id\", $question->userId);\n $question->comments = $comment->getComments($question->id, new User($this->di->get(\"db\")));\n $answers = $post->getAnswers($question->id, new User($this->di->get(\"db\")), $comment);\n\n $view->add(\"comment/question\", [\n \"question\" => $question,\n \"answers\" => $answers,\n ]);\n return $pageRender->renderPage([\"title\" => $question->title]);\n }", "public function get_question($aWhere = array())\n\t{\n\t\tif ($this->question === null) {\n\n\t\t\t$oOrm = new Orm;\n\n\t\t\t$oOrm->select(array('*'))\n\t\t\t\t ->from('question');\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t $aWhere['id_question'] = $this->get_id();\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t \n $this->question = $oOrm->where($aWhere)\n\t\t\t\t\t\t ->load(false, '\\Venus\\src\\Helium\\Entity');\n }\n\n\t\treturn $this->question;\n\t}", "public function createComponentQuestionForm() {\n $form = new Form;\n\n $form->addHidden('test_id');\n $form->addHidden('id');\n $form->addTextArea('text', 'Text')->setRequired();\n $form->addSubmit('submit');\n $form->setDefaults($this->questions->getById($this->questionId));\n $form->onSuccess[] = $this->questionFormSucceeded;\n\n return $form;\n }", "private function createInput($question)\n\t{\n\t\tswitch($question->InputType)\n\t\t{\n\t\t\tcase \"radio\":\n\t\t\tcase \"checkbox\":\n\t\t\t\tprint \"<b>\" . $question->Number . \") \";\n\t\t\t\tprint $question->Text . \"</b> \";\n\t\t\t\tprint '<em>(' . $question->Description . ')</em><br />';\n\t\t\t\tforeach($question->aAnswer as $answer)\n\t\t\t\t{//print data for each\n\t\t\t\t\tprint '<input type=\"' . $question->InputType . '\" name=\"q_' . $question->QuestionID . '[]\" value=\"' . $answer->AnswerID . '\" > ';\n\t\t\t\t\tprint $answer->Text . \" \";\n\t\t\t\t\tif($answer->Description != \"\")\n\t\t\t\t\t{//only print description if not empty\n\t\t\t\t\t\tprint \"<em>(\" . $answer->Description . \")</em>\";\n\t\t\t\t\t}\n\t\t\t\t\tprint '<br />';\t\n\t\t\t\t}\n\t\t\t\tbreak;\t\n\t\t\n\t\t\tcase \"select\":\n\t\t\t\tprint \"<b>\" . $question->Number . \") \";\n\t\t\t\tprint $question->Text . \"</b> \";\n\t\t\t\tprint '<em>(' . $question->Description . ')</em><br />';\n\t\t\t\tprint '<select name=\"q_' . $question->QuestionID . '\">';\n\t\t\t\tforeach($question->aAnswer as $answer)\n\t\t\t\t{//print data for each\n\t\t\t\t\tprint '<option value=\"' . $answer->AnswerID . '\" >' . $answer->Text;\n\t\t\t\t\tif($answer->Description != \"\")\n\t\t\t\t\t{//only print description if not empty\n\t\t\t\t\t\tprint \" <em>(\" . $answer->Description . \")</em>\";\n\t\t\t\t\t}\n\t\t\t\t\tprint '</option>';\t\n\t\t\t\t}\n\t\t\t\tprint '</select><br />';\n\t\t\t\tbreak;\n\t\t}\t\t\t\t\n\t}", "public function initQuestionAndAnswersEditForm () {\n global $tpl, $ilCtrl;\n\n $my_tpl = new ilTemplate(\"tpl.question_and_answers.html\", true, true,\n \"Customizing/global/plugins/Services/Repository/RepositoryObject/MobileQuiz\");\n $rtokenFactory = new ilCtrl();\n $my_tpl->setVariable(\"ACTION_URL\",$this->ctrl->getFormAction($this));\n $my_tpl->setVariable(\"SUBMIT_BUTTON\", $this->txt(\"save\"));\n $my_tpl->setVariable(\"NEW_QUESTION\", $this->txt(\"question_add_head\"));\n $my_tpl->setVariable(\"QUESTION\", $this->txt(\"question_add_text\"));\n $my_tpl->setVariable(\"QUESTION_TYPE\", $this->txt(\"question_add_type\"));\n $my_tpl->setVariable(\"CHOICES\", $this->txt(\"choice_add_texts\"));\n $my_tpl->setVariable(\"MINIMUM\", $this->txt(\"choice_add_numeric_minimum\"));\n $my_tpl->setVariable(\"MAXIMUM\", $this->txt(\"choice_add_numeric_maximum\"));\n $my_tpl->setVariable(\"STEP\", $this->txt(\"choice_add_numeric_steprange\"));\n $my_tpl->setVariable(\"CORRECT_VALUE\", $this->txt(\"choice_add_numeric_correctvalue\"));\n $my_tpl->setVariable(\"TOLERANCE_RANGE\", $this->txt(\"choice_add_numeric_tolerenace_range\"));\n $my_tpl->setVariable(\"VAR_1\", \"value1\");\n $my_tpl->setVariable(\"COMMAND\", \"cmd[changeQuestionAndAnswers]\");\n $my_tpl->setVariable(\"HIDE_QUESTION_TYPE\", 'style=\"display:none;\"');\n \n $my_tpl->setVariable(\"DELETE\", $this->txt(\"choice_delete\"));\n $my_tpl->setVariable(\"DELETE_INFO\", $this->txt(\"choice_delete_info\"));\n $my_tpl->setVariable(\"MOVE_UP\", $this->txt(\"choice_up\"));\n $my_tpl->setVariable(\"MOVE_UP_INFO\", $this->txt(\"choice_up_info\"));\n $my_tpl->setVariable(\"MOVE_DOWN\", $this->txt(\"choice_down\"));\n $my_tpl->setVariable(\"MOVE_DOWN_INFO\", $this->txt(\"choice_down_info\"));\n \n \n // refill fields\n include_once('class.ilObjMobileQuizWizard.php');\n $wiz = new ilObjMobileQuizWizard();\n $wiz -> loadAnswerAndQuestions($_GET['question_id'],$my_tpl, $this->object);\n\n $html = $my_tpl->get();\n $tpl->setContent($html);\n\n $this->ctrl->clearParameters($this);\n }", "public function save_question($question, $form) {\n global $DB;\n if ($this->wizardpagesnumber() == 1 || $question->qtype == 'calculatedformatsimple') {\n $question = parent::save_question($question, $form);\n return $question;\n }\n\n $wizardnow = optional_param('wizardnow', '', PARAM_ALPHA);\n $id = optional_param('id', 0, PARAM_INT); // Question id.\n // In case 'question':\n // For a new question $form->id is empty\n // when saving as new question.\n // The $question->id = 0, $form is $data from question2.php\n // and $data->makecopy is defined as $data->id is the initial question id.\n // Edit case. If it is a new question we don't necessarily need to\n // return a valid question object.\n\n // See where we're coming from.\n switch($wizardnow) {\n case '' :\n case 'question': // Coming from the first page, creating the second.\n if (empty($form->id)) { // or a new question $form->id is empty.\n $question = parent::save_question($question, $form);\n // Prepare the datasets using default $questionfromid.\n $this->preparedatasets($form);\n $form->id = $question->id;\n $this->save_dataset_definitions($form);\n if (isset($form->synchronize) && $form->synchronize == 2) {\n $this->addnamecategory($question);\n }\n } else if (!empty($form->makecopy)) {\n $questionfromid = $form->id;\n $question = parent::save_question($question, $form);\n // Prepare the datasets.\n $this->preparedatasets($form, $questionfromid);\n $form->id = $question->id;\n $this->save_as_new_dataset_definitions($form, $questionfromid);\n if (isset($form->synchronize) && $form->synchronize == 2) {\n $this->addnamecategory($question);\n }\n } else {\n // Editing a question.\n $question = parent::save_question($question, $form);\n // Prepare the datasets.\n $this->preparedatasets($form, $question->id);\n $form->id = $question->id;\n $this->save_dataset_definitions($form);\n if (isset($form->synchronize) && $form->synchronize == 2) {\n $this->addnamecategory($question);\n }\n }\n break;\n case 'datasetdefinitions':\n // Calculated options.\n // It cannot go here without having done the first page,\n // so the qtype_calculatedfmt_opts should exist.\n // We only need to update the synchronize field.\n if (isset($form->synchronize)) {\n $optionssynchronize = $form->synchronize;\n } else {\n $optionssynchronize = 0;\n }\n $DB->set_field('qtype_calculatedfmt_opts', 'synchronize', $optionssynchronize,\n array('questionid' => $question->id));\n if (isset($form->synchronize) && $form->synchronize == 2) {\n $this->addnamecategory($question);\n }\n\n $this->save_dataset_definitions($form);\n break;\n case 'datasetitems':\n $this->save_dataset_items($question, $form);\n $this->save_question_calculatedformat($question, $form);\n break;\n default:\n print_error('invalidwizardpage', 'question');\n break;\n }\n return $question;\n }", "public function show($id)\n\t{\n define( 'LS_BASEURL', 'http://192.168.10.1/limesurvey/index.php'); // adjust this one to your actual LimeSurvey URL\n define( 'LS_USER', 'admin' );\n define( 'LS_PASSWORD', 'qwerty' );\n\n //$client = new Client(LS_BASEURL);\n // the survey to process\n $survey_id=177998;\n\n // instanciate a new client\n $myJSONRPCClient = new \\org\\jsonrpcphp\\JsonRPCClient( LS_BASEURL.'/admin/remotecontrol' );\n\n // receive session key\n $sessionKey= $myJSONRPCClient->get_session_key( LS_USER, LS_PASSWORD );\n\n $questionInfo = $myJSONRPCClient->list_groups($sessionKey,$id);\n\n return $questionInfo;\n\t}", "public function createQuestionAction(int $id) : object\n {\n $page = $this->di->get(\"page\");\n $form = new CreateQuestionForm($this->di, $id);\n $form->check();\n\n $page->add(\"questions/crud/create-question\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $page->render([\n \"title\" => \"Create a question\",\n ]);\n }", "public function ajax_question_details($question_id){\n $question_details = $this->challenge_question_model->get_question_by_id($question_id);\n\n $question_type = $this->challenge_questionlib->get_question_image_type($question_id);\n $out = array();\n $out['question_text'] = $question_details->getText();\n $out['question_type'] = $question_type;\n\n switch($question_type){\n case 'question_type_1':\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['text'] = $val->getText();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_2':\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['text'] = $val->getText();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_3':\n $out['question_image'] = $question_details->getQuestionId();\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['text'] = $val->getText();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_4':\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['answer_image'] = $val->getChoiceId();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_5':\n $out['question_image'] = $question_details->getQuestionId();\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['answer_image'] = $val->getChoiceId();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_6':\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['text'] = $val->getText();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_7':\n $out['correct_text'] = $question_details->getCorrectText();\n break;\n case 'question_type_8':\n $out['correct_text'] = $question_details->getCorrectText();\n $out['question_image'] = $question_details->getQuestionId();\n break;\n case 'question_type_9':\n $out['question_image'] = $question_details->getQuestionId();\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['text'] = $val->getText();\n }\n $out['correct_text'] = $question_details->getCorrectText();\n break;\n case 'question_type_10':\n $out['question_image'] = $question_details->getQuestionId();\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['text'] = $val->getText();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_11':\n $out['question_image'] = $question_details->getQuestionId();\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['answer_image'] = $val->getChoiceId();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_12':\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['answer_image'] = $val->getChoiceId();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_13':\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['text'] = $val->getText();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_14':\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['text'] = $val->getText();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_15':\n $out['question_image'] = $question_details->getQuestionId();\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['text'] = $val->getText();\n }\n $out['correct_text'] = $question_details->getCorrectText();\n break;\n case 'question_type_16':\n $out['correct_text'] = $question_details->getCorrectText();\n $out['read_text'] = $question_details->getReadText();\n break;\n\n }\n\n $this->output->set_output(json_encode($out));\n }", "public function initAddQuestionAndAnswersForm () {\n global $tpl, $ilCtrl;\n\n $my_tpl = new ilTemplate(\"tpl.question_and_answers.html\", true, true,\n \"Customizing/global/plugins/Services/Repository/RepositoryObject/MobileQuiz\");\n $rtokenFactory = new ilCtrl();\n $my_tpl->setVariable(\"ACTION_URL\",$this->ctrl->getFormAction($this));\n $my_tpl->setVariable(\"SUBMIT_BUTTON\", $this->txt(\"save\"));\n $my_tpl->setVariable(\"NEW_QUESTION\", $this->txt(\"question_add_head\"));\n $my_tpl->setVariable(\"QUESTION\", $this->txt(\"question_add_text\"));\n $my_tpl->setVariable(\"QUESTION_TYPE\", $this->txt(\"question_add_type\"));\n $my_tpl->setVariable(\"CHOICES\", $this->txt(\"choice_add_texts\"));\n $my_tpl->setVariable(\"VAR_1\", \"value1\");\n $my_tpl->setVariable(\"COMMAND\", \"cmd[createQuestionAndAnswers]\");\n $my_tpl->setVariable(\"MINIMUM\", $this->txt(\"choice_add_numeric_minimum\"));\n $my_tpl->setVariable(\"MAXIMUM\", $this->txt(\"choice_add_numeric_maximum\"));\n $my_tpl->setVariable(\"STEP\", $this->txt(\"choice_add_numeric_steprange\"));\n $my_tpl->setVariable(\"CORRECT_VALUE\", $this->txt(\"choice_add_numeric_correctvalue\"));\n $my_tpl->setVariable(\"TOLERANCE_RANGE\", $this->txt(\"choice_add_numeric_tolerenace_range\"));\n $my_tpl->setVariable(\"SELECTED_SINGLE\", 'selected=\"selected\"');\n\n $my_tpl->setVariable(\"HIDE_NUMERIC_BLOCK\", 'style=\"display:none;\"');\n $my_tpl->setVariable(\"HIDE_SINGLE_CHOICE_BLOCK\", 'style=\"display:none;\"');\n\n $html = $my_tpl->get();\n $tpl->setContent($html);\n }", "function getQuestionType($question_id) \n\t{\n\t\tglobal $ilDB;\n\t\tif ($question_id < 1) return -1;\n\t\t$result = $ilDB->queryF(\"SELECT type_tag FROM svy_question, svy_qtype WHERE svy_question.question_id = %s AND \" .\n\t\t\t\"svy_question.questiontype_fi = svy_qtype.questiontype_id\",\n\t\t\tarray('integer'),\n\t\t\tarray($question_id)\n\t\t);\n\t\tif ($result->numRows() == 1) \n\t\t{\n\t\t\t$data = $ilDB->fetchAssoc($result);\n\t\t\treturn $data[\"type_tag\"];\n\t\t} \n\t\telse \n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t}", "function get_by_question($id)\n {\n $this->db->where($this->get_table_name() . '.question_id', $id);\n $this->db->join('self_assessment_questions', $this->get_table_name() . '.question_id = self_assessment_questions.question_id');\n\n return $this->db->get($this->get_table_name());\n }", "public function getQuestionById($id = false) {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Query set up\n\t\t\t$return\t\t\t= ($id) ? $db->getRow('tb_question', '*', \"id = {$id}\") : false;\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}" ]
[ "0.6430117", "0.63952506", "0.6327749", "0.62047935", "0.61353356", "0.60501885", "0.6023196", "0.60034496", "0.59641784", "0.5937594", "0.59087265", "0.5892983", "0.58288634", "0.5725175", "0.56953174", "0.5683468", "0.56814265", "0.5660137", "0.5648431", "0.5645041", "0.56425595", "0.56390846", "0.5638919", "0.5632328", "0.55981946", "0.55952567", "0.5585921", "0.55685604", "0.55637866", "0.55374783" ]
0.8167861
0
Returns the question type of a question with a given id
function getQuestionType($question_id) { global $ilDB; if ($question_id < 1) return -1; $result = $ilDB->queryF("SELECT type_tag FROM svy_question, svy_qtype WHERE svy_question.question_id = %s AND " . "svy_question.questiontype_fi = svy_qtype.questiontype_id", array('integer'), array($question_id) ); if ($result->numRows() == 1) { $data = $ilDB->fetchAssoc($result); return $data["type_tag"]; } else { return ""; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getType($id)\n\t{\n\t\tif (empty($id)) //safe because we never use 0 as an id\n\t\t{\n\t\t\t$currentID = $this->getID();\n\t\t\tif (empty($currentID)) return false;\n\t\t\t$id = $currentID;\n\t\t}\n\t\t$result = $this->find('first', array(\n\t\t\t'conditions' => array('id' => $id),\n\t\t\t'fields' => array('ans_type')\n\t\t));\n\t\tif (empty($result)) return false;\n\t\treturn $result['Answer']['ans_type'];\n\t}", "function ipal_get_qtype($questionid){\r\n\tglobal $DB;\r\n\t$questiontype=$DB->get_record('question',array('id'=>$questionid));\r\n\treturn($questiontype->qtype); \r\n}", "private function getQuestion($id){\n $q = new Question();\n return $q->find($id);\n }", "private function getType($id) {\n \n $this->loadTypes();\n \n foreach ($this->types as $type) {\n \n if ($type->getId() === $id) return $type;\n }\n \n return NULL;\n }", "public function getQuestiontype()\n {\n return $this->hasOne(QuestionType::className(), ['id' => 'question_type_id']);\n }", "public function type($id)\n {\n return $this->where('user_type_id', $id);\n }", "protected function get_type_from_id($id)\n\t{\n\t\treturn $this->types->get($id);\n\t}", "function get_by_id_question($id)\n {\n $this->db->where('tfselect_tfque_fk', $id);\n $query = $this->db->get('fis_dtraining_feedback_selections');\n return $query->result();\n }", "function ipal_acceptable_qtype($questionid) {\n global $DB;\n\n // An array of acceptable qutypes supported in ipal.\n $acceptableqtypes = array('multichoice', 'truefalse', 'essay');\n $qtype = $DB->get_field('question', 'qtype', array('id' => $questionid));\n if (in_array($qtype, $acceptableqtypes)) {\n return true;\n } else {\n return $qtype;\n }\n}", "public function getTypeQuestion()\n {\n return $this->typeQuestion;\n }", "function getQuestion($id){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//internal data. Same as GetInfo()\r\n\t\t$query= \"SELECT * FROM `tbl_question` WHERE `question_id` = $id LIMIT 1 ;\";\r\n\t\t$result = $this->mdb2->query($query) or die('An unknown error occurred while checking the data');\r\n\t\tif(MDB2::isError($result)){\r\n\t\t\treturn \"SelectError\";\r\n\t\t}else{\r\n\t\t\t$native_result = $result->getResource();\r\n\t\t\treturn $native_result;\t\t\t\t\t\t//Returns the question text\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//as a Mysql native result type.\r\n\t\t}\r\n\t}", "function getQuestion($id) { \n\ttry {\n\t\t$question = ORM::for_table('questions')->where('id', $id)->find_one();\n\t\tif (!$question) { \n\t\t\treturn 0;\n\t\t} else {\n\t\t\t$theQuestion = array();\n\t\t\t$theQuestion['id'] = $question->id;\n\t\t\t$theQuestion['text'] = $question->text;\n\t\t\t$theQuestion['answer1'] = $question->answer1;\n\t\t\t$theQuestion['answer2'] = $question->answer2;\n\t\t\t$theQuestion['vote_answer1'] = $question->vote_answer1;\n\t\t\t$theQuestion['vote_answer2'] = $question->vote_answer2;\n\t\t\treturn $theQuestion;\n\t\t}\n\t} catch (Exception $e) { \n\t\treturn 0;\n\t}\n}", "public function getQuestionById($id){\n\n $this->db->where('q_id', $id);\n $query = $this->db->get('question');\n return $query->row();\n }", "public function get_message_type_by_id($id)\n\t{\n\t\t$query = $this->db->get_where('message_type', array('message_type_id' => $id));\n\t\treturn $query;\n\t}", "public static function getTypeName($id){\n return Types::findOne($id);\n }", "public function getQuestionById($id = false) {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Query set up\n\t\t\t$return\t\t\t= ($id) ? $db->getRow('tb_question', '*', \"id = {$id}\") : false;\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "public function get_message_type($id)\n\t{\n\t\t$sql=\"SELECT * FROM message_type ORDER BY (`message_type_id` = $id) DESC\";\n\t\t$query=$this->db->query($sql);\n\t\treturn $query->result_object();\n\n\t}", "function get_request_type($id_request_type){\n $this->db->where('id', $id_request_type);\n $query = $this->db->get('type_request');\n return($query->result());\n }", "public function getOneQuestion($id)\n {\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n $post = new Post($this->di->get(\"db\"));\n $user = new User($this->di->get(\"db\"));\n $comment = $this->di->get(\"comment\");\n $tag = $this->di->get(\"tag\");\n\n $question = $post->getOne($id);\n if ($question->type === \"answer\") {\n $this->di->get(\"response\")->redirect(\"questions/{$question->parent}\");\n }\n $question->tags = $tag->getPostTags($question->id);\n $question->user = $user->find(\"id\", $question->userId);\n $question->comments = $comment->getComments($question->id, new User($this->di->get(\"db\")));\n $answers = $post->getAnswers($question->id, new User($this->di->get(\"db\")), $comment);\n\n $view->add(\"comment/question\", [\n \"question\" => $question,\n \"answers\" => $answers,\n ]);\n return $pageRender->renderPage([\"title\" => $question->title]);\n }", "public function fetchFieldTypeFromID($id){\n\t\t\treturn Symphony::Database()->fetchVar('type', 0, \"SELECT `type` FROM `tbl_fields` WHERE `id` = '$id' LIMIT 1\");\n\t\t}", "function getQuestionType()\n\t{\n\t\treturn $this->getPlugin()->getQuestionType();\n\t}", "public function get_quiz_drip_type( $quiz_id ){\n\n\t// basics, checking out the passed in quiz object\n\tif( empty( $quiz_id) || 'quiz' != get_post_type( $quiz_id ) ){\n\t\treturn 'none';\n\t}\n\n\t// retrieve the drip type from the quiz\n\t$drip_type = get_post_meta( $quiz_id , '_sensei_content_drip_type', true ) ;\n\n\t// send back the type string\n\treturn empty( $drip_type ) ? 'none' : $drip_type;\n\n}", "public function get_page_type_idstring($id) {\n foreach ($this->types as $pagetype) {\n if ((int)$pagetype->typeid === (int)$id) {\n return $pagetype->idstring;\n }\n }\n return 'unknown';\n }", "public static function fetchFieldTypeFromID($id)\n {\n return Symphony::Database()->fetchVar('type', 0, sprintf(\"\n SELECT `type` FROM `tbl_fields` WHERE `id` = %d LIMIT 1\",\n $id\n ));\n }", "public function getQuestionnaireTypeId()\n {\n return $this->questionnaire_type_id;\n }", "public function get_type()\n {\n return self::$_id;\n }", "protected function _get_card_type($id)\n\t{\n\t\treturn model('card_type')->get_info_rule(array(\n\t\t\t'id' => $id,\n\t\t\t'status' => 1,\n\t\t));\n\t}", "public static function getQuestionInfoById($question_id) {\n\t\tif($question_id > 0){\n\t\t\treturn self::find($question_id);\n\t\t}\n }", "public function getQuestion($id){\r\n $conn = new DB();\r\n $connection = $conn->connect();\r\n\r\n $query = \"SELECT * FROM questions WHERE id = ? LIMIT 1\";\r\n if($stmt = $connection->prepare($query)){\r\n $stmt->bind_param(\"s\", $id);\r\n $stmt->execute();\r\n $stmt->bind_result($qid, $qquestion, $qanswers, $qcorrect_answer, $quiz_id);\r\n $stmt->fetch();\r\n $stmt->close();\r\n }\r\n return [\"id\" => $qid, \"question\" => $qquestion, \"answers\" => $qanswers, \"correct_answer\" => $qcorrect_answer, \"quiz_id\" => $quiz_id];\r\n }", "public function findCollectionTypeById($id);" ]
[ "0.7716746", "0.73255116", "0.7051248", "0.6959651", "0.6747613", "0.66502106", "0.6642964", "0.65593237", "0.6532787", "0.651467", "0.6488503", "0.64779174", "0.6459869", "0.6445235", "0.6444707", "0.6393059", "0.6329177", "0.6304178", "0.6296919", "0.6266626", "0.6243975", "0.62378734", "0.6190584", "0.6176005", "0.61728466", "0.6170838", "0.61696464", "0.61551136", "0.6137979", "0.61363345" ]
0.78216434
0
Returns the survey database id
function getSurveyId() { return $this->survey_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDatabaseId();", "public function getDatabaseId()\n {\n return $this->database_id;\n }", "public function getIdDatabase()\n {\n return $this->idDatabase;\n }", "public function getDBID()\n {\n return $this->dbID;\n }", "function id_db() {\n\t\treturn mysql_insert_id($this -> dbc);\n\t}", "public function getDatabaseNameIdentifier()\n {\n return $this->database_name;\n }", "function get_id_db($injured_table, $conn, $band_id, $mode) {\n valid_init($injured_table, $conn, $band_id, $mode);\n\n // Get ID from database\n $result = exec_query($conn, \"select id from $injured_table where opaska_id = $band_id and w_akcji = true\", TRUE);\n $id = $result['id'];\n return $id;\n}", "public function getDbId(): int\n {\n return $this->dbId;\n }", "function getId() {\n\t\treturn $this->getData('studyId');\n\t}", "public function get_survey()\n {\n // check the primary key value\n $primary_key_name = static::get_primary_key_name();\n if( is_null( $this->$primary_key_name ) )\n {\n log::warning( 'Tried to delete record with no id.' );\n return;\n }\n \n return new limesurvey\\surveys( $this->sid );\n }", "public function id()\n\t{\n\t\treturn $this->SqueezePlyrID ;\n\t}", "function getQuestionId($questionId, $form){\r\n\r\n\tglobal $db;\r\n\tif(!$db) connectDb();\r\n\r\n\t$formId = getFormId($form);\r\n\tif($formId) {\r\n\t\t$sql = \"SELECT id FROM questions WHERE question ='$questionId' and form_id='$formId' \";\r\n\r\n\t\ttry {\r\n\t\t\t$result = $db->query($sql)->fetch(PDO::FETCH_OBJ);\r\n\t\t}\r\n\t\tcatch (PDOException $e) {\r\n\t\t\t$error = $e->getMessage();\r\n\t\t}\r\n\r\n\t\tif($result) \r\n\t\t\treturn $result->id;\r\n\t\telse\r\n\t\t\treturn null;\r\n\t}\r\n}", "function questionID()\r\n {\r\n $ret = 0;\r\n\r\n if ( is_a( $this->Question, \"eZQuizQuestion\" ) )\r\n {\r\n $ret = $this->Question->id();\r\n }\r\n\r\n return $ret;\r\n }", "public function id()\n\t{\n\t\t// @todo: _id should not be hard-coded (mongo-specific)\n\t\treturn $this->get('_id');\n\t}", "public function getPrimaryKey()\n\t{\n\t\treturn $this->getVenueid();\n\t}", "function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}", "public function id()\n\t{\n\t\treturn $this->get($this->meta()->primary_key);\n\t}", "public function get_id();", "public function get_id();", "function getSiteId() {\n\t\treturn $this->getData('siteId');\n\t}", "public function getAnswerId( ) {\n\t\treturn $this->answer_id;\n\t}", "public function getQuestionId() {\n\t\treturn $this->questionId;\n\t}", "public function get_site_id()\n {\n }", "public function get_site_id()\n {\n }", "function fixtures_query_id() : int\n{\n return mysqli_insert_id($GLOBALS['db']);\n}", "public function getSiteId();", "function GetId ()\n {\n $this->username = isset( $_SESSION [ \"username\" ] ) ? sanitize_string( $_SESSION [ \"username\" ] ) : null;\n if ( !$this->username ) {\n $this->username = isset( $_COOKIE [ \"username\" ] ) ? sanitize_string( $_COOKIE [ \"username\" ] ) : null;\n }\n $this->mongo->setCollection( COLLECTION_ADMINS );\n $data = $this->mongo->dataFindOne( array( \"username\" => $this->username ) );\n return isset( $data[ \"_id\" ] ) ? $data[ \"_id\" ] : 0;\n }", "public function getQuestionId()\r\n{\r\n $query_string = \"SELECT questionid FROM questions \";\r\n $query_string .= \"WHERE question = :question\";\r\n\r\n return $query_string;\r\n}", "function siteId(): ?string\n {\n return app(\\LeMaX10\\MultiSite\\Classes\\Contracts\\SiteManager::class)\n ->id();\n }", "function subj_ID(){\n\t\tglobal $_CON;\n\t\tif(isset($_GET['this_subject'])){\n\t\t\t$_ID = mysqli_real_escape_string($_CON, $_GET['this_subject']);\n\t\treturn $_ID;\n\t\t}\n\t}" ]
[ "0.74579984", "0.6905449", "0.66557485", "0.65227187", "0.64569736", "0.6320144", "0.62798345", "0.6266429", "0.62555987", "0.61761063", "0.61424744", "0.61336404", "0.61072433", "0.61022955", "0.61021936", "0.60531694", "0.5993428", "0.59876806", "0.59876806", "0.59478873", "0.5911038", "0.58999336", "0.5891912", "0.5891912", "0.5865458", "0.5864408", "0.5863749", "0.5855014", "0.5853128", "0.5840912" ]
0.74900234
0
Checks if the survey is accessable without a survey code
function isAccessibleWithoutCode() { return ($this->getAnonymize() == self::ANONYMIZE_OFF || $this->getAnonymize() == self::ANONYMIZE_FREEACCESS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _isAllowed()\n {\n\t$session = Mage::getSingleton('admin/session');\n return ($session->isAllowed('iqnomy') || $session->isAllowed('system/iqnomy'));\n }", "function isDenied() {\n return !empty($this->denied_reasons);\n }", "function check_user_has_data_access($survey_id,$user_id)\n\t{\n\t\t$requests=$this->get_user_study_n_collection_requests($survey_id,$user_id);\n\t\t\t\n\t\t\tforeach($requests as $request)\n\t\t\t{\n\t\t\t\tif ($request['status']=='APPROVED')\n\t\t\t\t{\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\treturn FALSE;\n\t}", "public function hasUsageRights() {}", "public function isAccess();", "public function authorize()\n {\n $internship = Internship::findOrFail($this->route('id'));\n $student = $internship->student;\n\n return $internship->state_id == State::CANCELED && $student->internship == null;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Dilmah_TeaFaq::dilmah_tfaq');\n }", "public function isNotAccessible()\n {\n return ! $this->isAccessible();\n }", "public function checkAccess()\n {\n // need to be modified for security\n }", "public function hasAccess(): bool;", "abstract protected function canAccess();", "public function isDenied()\n {\n return isset($this->_data[OAuth::PARAM_DENIED]);\n }", "public function hasOtherAccess() {\n return $this->_has(17);\n }", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "function isOmitted()\n\t{\n\t\treturn TRUE;\n\t}", "public function checkAccess() {\n\t\t$conf = $GLOBALS['BE_USER']->getTSConfig('backendToolbarItem.tx_newsspaper_role.disabled');\n\t\treturn ($conf['value'] == 1 ? false : true);\n\t}", "public function isPermissible()\n {\n return !$this->invisible && (\n [] === $this->permissions || Wa::panel()->isAccessible(\n $this->module, $this->panel, $this->permissions));\n }", "public function check_access() {\n\n\t\tif (isset($this->current_entity_allowed)) {\n\t\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t\t}\n\n\t\t$this->current_entity_allowed = MKB_Options::option('restrict_on') ?\n\t\t\t(bool) $this->check_entity_access($this->get_current_entity()) :\n\t\t\ttrue; // always allowed if restriction is off\n\n\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Amasty_Acart::acart_reports');\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_logistics/equipment');\n }", "protected function isPermissionCorrect() {}", "public function isDenied() {\n return $this->denied;\n }", "public function hasAccess()\n {\n return $this->access !== null;\n }" ]
[ "0.6477033", "0.6469424", "0.6420514", "0.6329273", "0.63254505", "0.6278072", "0.6244758", "0.6229731", "0.62057775", "0.6197808", "0.6165305", "0.6115632", "0.60924965", "0.6067356", "0.6067356", "0.60672957", "0.60672957", "0.60672957", "0.60656667", "0.60656667", "0.60656667", "0.6046701", "0.60430825", "0.60338193", "0.6019642", "0.6003358", "0.59902257", "0.5960985", "0.59607935", "0.594866" ]
0.65820146
0
Checks if the survey results are to be anonymized
function hasAnonymizedResults() { return ($this->getAnonymize() == self::ANONYMIZE_ON || $this->getAnonymize() == self::ANONYMIZE_FREEACCESS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function shouldAnonymize(): bool\n {\n if (!$this->moduleSettings->get(ModuleName::fromString('Frontend'), 'consent_dialog_enabled', false)) {\n return true;\n }\n\n return $this->consentDialog->hasAgreedTo(ConsentDialog::CONSENT_DIALOG_ANALYTICS_TECHNICAL_NAME);\n }", "function hasSynonyms($author)\r\n {\r\n $CI = &get_instance();\r\n $CI->db->select(\"*\");\r\n $CI->db->distinct();\r\n $CI->db->where(array('synonym_of'=>$author->author_id));\r\n $CI->db->from(\"author\");\r\n\t return ($CI->db->count_all_results() > 0);\r\n }", "public function is_correct_user_answer() {\n\t\t\treturn strtolower($this->correct_answer) == strtolower($this->user_answer); \n\t\t}", "protected function its_response_has_the_expected_aliased_attributes()\n {\n foreach ($this->aliases as $alias => $modelAttribute) {\n $this->assertEquals($this->model->$modelAttribute, $this->resourceResponse[$alias],\n 'alias: ' . $alias . ' does not correspond with attribute: ' . $modelAttribute\n );\n }\n }", "public function isOriginal(){\n return count($this->results) == 0;\n }", "public function isDoNotSpellCheckSet() {}", "public function isCorrectAnswer() {\n\t\t$this->getCorrectAnswer();\n\t}", "protected function setAnonymity()\n {\n \tif ( isset( $_POST['anonymity'] ) && ! empty( $_POST['anonymity'] ) ) {\n \t\t$this->data['anonymity'] = 1;\n \t} else {\n \t\t$this->data['anonymity'] = 0;\n \t}\n }", "public function hasAnswers();", "public function isUsedInAssessments(){\n return ($this->assessments == 1);\n }", "public function testContactAnonymization() {\n $anonymizer = new Anonymizer(false);\n $anonymizer->anonymize($this->contact, false);\n $anonymizer->deleteOldRevisions($this->contact);\n\n $contact = entity_load_single('redhen_contact', $this->contact->contact_id);\n $old_contact = $this->contact;\n\n // Is a contact record still there?\n $this->assertNotEmpty($contact);\n // Did the first name change to \"Anonymous\" as specified in the Anonymizer?\n $this->assertEqual($contact->first_name, \"Anonymous\");\n // Did the revision change?\n $this->assertNotEquals($contact->revision_id, $old_contact->revision_id);\n // Was the old revision deleted?\n $this->assertFalse(entity_revision_load('redhen_contact', $old_contact->revision_id));\n }", "public function isRelawan();", "private function searchCorrectedQuery(\\stdClass $result) {\n if (property_exists($result, \"spelling\")) {\n if ($this->searchQueryInGoogle($result->spelling->correctedQuery)) {\n $this->view->data->info_message = \"On your request nothing has been found. Showing results on <strong>\". $result->spelling->correctedQuery .\"</strong>.\";\n return true;\n }\n }\n return false;\n }", "function allow_view_results() {\n\t\treturn $this->attribute_bool('allow view results');\n\t}", "public function results()\n {\n if(!(php_sapi_name() == 'cli-server'))\n return 403;\n\n if($this->request->server['REMOTE_ADDR'] != '127.0.0.1' && $this->request->server['REMOTE_ADDR'] != '::1')\n return 403;\n\n $matcher = new SurveyMatcher();\n $matcher->match((isset($this->request->get['limit']) ? $this->request->get['limit'] : null));\n }", "public function hasSecretQuestion()\n {\n return Mage::getResourceModel('twofactorauth/user_question')->hasQuestions($this->getUser());\n }", "public function isAnalyzing() {\n\t\treturn $this->_isAnalyzing;\n\t}", "public function isHasResults();", "function check_quiz_pass($taking_id) {\r\n\r\n $quizDataBaseName = 'wp_watupro_taken_exams';\r\n $postmetaDatabaseName = 'wp_postmeta';\r\n $exam = get_recent_exam_ID($taking_id);\r\n $examID = $exam->exam_id;\r\n $user_ID = $exam->user_id;\r\n $userEmail = get_user_meta($user_ID, 'billing_email', true);\r\n $watuObj = get_certificate_data($user_ID);\r\n if (!empty($watuObj)) {\r\n $postedID = get_specific_postmeta_data($postmetaDatabaseName, $userEmail);\r\n if (valExistence_check($postedID, $watuObj) == false) {\r\n $examName = get_recent_exam_name($user_ID);\r\n update_all_data_to_wp_store_locator($user_ID, $examName, $userEmail);\r\n }\r\n }\r\n}", "public function checkDuplicates(){\n\t\t$db = new database();\n\t\t$gebruiker = $db->select(\"*\", \"klant\", 1, ['this'=>\"gebruikersnaam\", \"that\"=>$this->gebruikersnaam]);\n\t\t//var_dump($gebruiker);\n\t\tif(!empty($gebruiker[0])){\n\t\t\treturn true;\n\t\t}\n\n\t}", "function what_questions_can_be_answered( $survey_info, $survey_id, $number_of_questions, $old_answers )\n{\n\tglobal $db;\n\t// the first if clause checks to see if there are any response caps in the survey\n\tif( str_replace('|', '', $survey_info['question_response_caps']) )\n\t{\n\t\t// if we get here there are response caps in the survey, so we explode $question_sums and $response_caps so we can\n\t\t// figure out which questions have hit the cap\n\t\t$question_sums = explode(\"|\", $survey_info['question_sums']);\n\t\t$question_selected_text = explode(\"|\", $survey_info['question_selected_text']);\n\t\t$question_response_caps = explode(\"|\", $survey_info['question_response_caps']);\n\t\t$group_ids = $survey_info['group_ids'];\n\n\t\t// get answers for this survey from all users\n\t\t// now do the query for the actual responses...\n\t\t$sql = \"SELECT DISTINCT u.user_id, sa.answers\n\t\t\t\tFROM \" . USERS_TABLE . \" u\n\t\t\t\tINNER JOIN \" . USER_GROUP_TABLE . \" ug ON ug.user_id = u.user_id\n\t\t\t\tINNER JOIN \" . SURVEY_ANSWERS_TABLE . \" sa ON sa.user_id = ug.user_id\n\t\t\t\tWHERE ( (ug.group_id IN ($group_ids) AND ug.user_pending = 0) OR \" . SURVEY_ALL_REGISTERED_USERS . \" IN ($group_ids) )\n\t\t\t\tAND sa.survey_id = $survey_id\";\n\n\t\tif ( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, \"Could not obtain answer data for the survey in this topic\", '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\t// fetch all the answer info\n\t\t$answer_info = $db->sql_fetchrowset($result);\n\t\t$db->sql_freeresult($result);\n\n\t\t// count the number of responders\n\t\t$number_of_responders = count($answer_info);\n\n\t\t// cycle through the questions 1 by 1 in order to see if we've hit the cap for each question that has a cap\n\t\tfor ( $i = 0; $i < $number_of_questions; $i++ )\n\t\t{\n\t\t\tif( $question_response_caps[$i] > 0 )\n\t\t\t{\n\t\t\t\t// if we get here, this question has a cap so loop through the responding users, get their answers and check against the relevant response cap\n\t\t\t\tfor ( $j = 0; $j < $number_of_responders; $j++ )\n\t\t\t\t{\n\t\t\t\t\t// explode all the answers of this user into an answer array\n\t\t\t\t\t$answers = explode(\"|\", $answer_info[$j]['answers']);\n\n\t\t\t\t\t// here, increment the total if the question is answered and supposed to be totalled at the bottom\n\t\t\t\t\tswitch( $question_sums[$i] )\n\t\t\t\t\t{\n\t\t\t\t\t\tcase \"\":\n\t\t\t\t\t\tcase SURVEY_NO_TOTAL:\n\t\t\t\t\t\tcase SURVEY_TOTAL_BY_AVERAGE_OF_NUMBERS_IN_REPSONSES:\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase SURVEY_TOTAL_BY_RESPONSES:\n\t\t\t\t\t\t\tif( $answers[$i] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$total[$i]++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase SURVEY_TOTAL_BY_NUMBERS_IN_RESPONSES:\n\t\t\t\t\t\t\tif( $answers[$i] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$total[$i] = $total[$i] + $answers[$i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase SURVEY_TOTAL_BY_MATCHING_TEXT:\n\t\t\t\t\t\t\t// note that I used strtolower to make this case insensitive\n\t\t\t\t\t\t\tif( strtolower($answers[$i]) == strtolower($question_selected_text[$i]) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$total[$i]++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// now set a flag to indicate for each question whether it can still be answered (i.e. whether we've hit the response cap)\n\tfor ( $i = 0; $i < $number_of_questions; $i++ )\n\t{\n\t\t$questions_can_be_answered[$i] = ( $question_response_caps[$i] == 0 || $total[$i] < $question_response_caps[$i] || $old_answers[$i] ) ? TRUE : FALSE;\n\t}\n\treturn $questions_can_be_answered;\n}", "public function checkUniqueTitle()\n {\n $this->viewBuilder()->layout(false);\n if($this->request->is('post')) {\n $data = $this->request->data;\n $result = $this->Titles->isTitleExist($data['name']);\n if(!empty($result)){\n echo \"false\";\n } else {\n echo \"true\";\n }\n }\n die;\n }", "function check_alias ($domain)\n{\n $limit = get_domain_properties ($domain);\n if ($limit['aliases'] >= 0)\n {\n if ($limit['alias_count'] >= $limit['aliases'])\n {\n return false;\n }\n }\n return true;\n}", "public function hasStudyAcronym() {\n return $this->_has(10);\n }", "function isSurveyStarted($user_id, $anonymize_id, $appr_id = 0)\n\t{\n\t\tglobal $ilDB;\n\n\t\t// #15031 - should not matter if code was used by registered or anonymous (each code must be unique)\n\t\tif($anonymize_id)\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND anonymous_id = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','text','integer'),\n\t\t\t\tarray($this->getSurveyId(), $anonymize_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\tif ($result->numRows() == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($result);\n\t\t\t\n\t\t\t// yes, we are doing it this way\n\t\t\t$_SESSION[\"finished_id\"][$this->getId()] = $row[\"finished_id\"];\n\t\t\t\n\t\t\treturn (int)$row[\"state\"];\n\t\t}\n\n\t\t/*\n\t\tif ($this->getAnonymize())\n\t\t{\n\t\t\tif ((($user_id != ANONYMOUS_USER_ID) && sizeof($anonymize_id)) && (!($this->isAccessibleWithoutCode() && $this->isAllowedToTakeMultipleSurveys())))\n\t\t\t{\n\t\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\t\" WHERE survey_fi = %s AND anonymous_id = %s AND appr_id = %s\",\n\t\t\t\t\tarray('integer','text','integer'),\n\t\t\t\t\tarray($this->getSurveyId(), $anonymize_id, $appr_id)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\tif ($result->numRows() == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($result);\n\t\t\t$_SESSION[\"finished_id\"][$this->getId()] = $row[\"finished_id\"];\n\t\t\treturn (int)$row[\"state\"];\n\t\t}\t\t\n\t\t*/\n\t}", "public function checkVerification()\n {\n $dns = new Dns($this->domain, config('anonaddy.dns_resolver'));\n\n if (Str::contains($dns->getRecords('MX'), 'MX 10 ' . config('anonaddy.hostname') . '.')) {\n $this->markDomainAsVerified();\n }\n }", "public function hasResults();", "protected function isNotUnique($stat_name)\n\t{\n\t\treturn in_array($stat_name, $this->unique_stats_appid_ununique);\n\t}", "public static function one_sample_per_analysable() {\n return true;\n }", "public static function one_sample_per_analysable() {\n return true;\n }" ]
[ "0.67653316", "0.608136", "0.5473786", "0.5248364", "0.52371323", "0.5225185", "0.52083075", "0.51993686", "0.5180244", "0.5165237", "0.5159649", "0.5105231", "0.5048006", "0.50256985", "0.50199974", "0.49694255", "0.49273774", "0.49112526", "0.49082047", "0.49020296", "0.48668656", "0.48539788", "0.48434633", "0.48416138", "0.48400387", "0.48143902", "0.48141128", "0.47885877", "0.478229", "0.478229" ]
0.8105426
0
Loads a survey object from a database
function loadFromDb() { global $ilDB; $result = $ilDB->queryF("SELECT * FROM svy_svy WHERE obj_fi = %s", array('integer'), array($this->getId()) ); if ($result->numRows() == 1) { $data = $ilDB->fetchAssoc($result); $this->setSurveyId($data["survey_id"]); $this->setAuthor($data["author"]); include_once("./Services/RTE/classes/class.ilRTE.php"); $this->setIntroduction(ilRTE::_replaceMediaObjectImageSrc($data["introduction"], 1)); if (strcmp($data["outro"], "survey_finished") == 0) { $this->setOutro($this->lng->txt("survey_finished")); } else { $this->setOutro(ilRTE::_replaceMediaObjectImageSrc($data["outro"], 1)); } $this->setInvitation($data["invitation"]); $this->setInvitationMode($data["invitation_mode"]); $this->setShowQuestionTitles($data["show_question_titles"]); $this->setStartDate($data["startdate"]); $this->setEndDate($data["enddate"]); $this->setAnonymize($data["anonymize"]); $this->setEvaluationAccess($data["evaluation_access"]); $this->loadQuestionsFromDb(); $this->setStatus($data["status"]); $this->setMailNotification($data['mailnotification']); $this->setMailAddresses($data['mailaddresses']); $this->setMailParticipantData($data['mailparticipantdata']); $this->setTemplate($data['template_id']); $this->setPoolUsage($data['pool_usage']); // 360° $this->set360Mode($data['mode_360']); $this->set360SelfEvaluation($data['mode_360_self_eval']); $this->set360SelfRaters($data['mode_360_self_rate']); $this->set360SelfAppraisee($data['mode_360_self_appr']); $this->set360Results($data['mode_360_results']); $this->set360SkillService($data['mode_360_skill_service']); // reminder/notification $this->setReminderStatus($data["reminder_status"]); $this->setReminderStart($data["reminder_start"] ? new ilDate($data["reminder_start"], IL_CAL_DATE) : null); $this->setReminderEnd($data["reminder_end"] ? new ilDate($data["reminder_end"], IL_CAL_DATE) : null); $this->setReminderFrequency($data["reminder_frequency"]); $this->setReminderTarget($data["reminder_target"]); $this->setReminderLastSent($data["reminder_last_sent"]); $this->setTutorNotificationStatus($data["tutor_ntf_status"]); $this->setTutorNotificationRecipients(explode(";", $data["tutor_ntf_reci"])); $this->setTutorNotificationTarget($data["tutor_ntf_target"]); $this->setViewOwnResults($data["own_results_view"]); $this->setMailOwnResults($data["own_results_mail"]); } // moved activation to ilObjectActivation if($this->ref_id) { include_once "./Services/Object/classes/class.ilObjectActivation.php"; $activation = ilObjectActivation::getItem($this->ref_id); switch($activation["timing_type"]) { case ilObjectActivation::TIMINGS_ACTIVATION: $this->setActivationLimited(true); $this->setActivationStartDate($activation["timing_start"]); $this->setActivationEndDate($activation["timing_end"]); $this->setActivationVisibility($activation["visible"]); break; default: $this->setActivationLimited(false); break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function Load($surveyid)\n\t{\n\t\t$surveyid = (int)$surveyid;\n\t\t$prefix = $this->Db->TablePrefix;\n\t\t$query = \"SELECT * FROM {$prefix}surveys WHERE id = $surveyid\";\n\n\t\t$result = $this->Db->Query($query);\n\t\t$survey = $this->Db->Fetch($result);\n\n\t\treturn $this->_loadData($survey);\n\t}", "function loadQuestionsFromDb() \n\t{\n\t\tglobal $ilDB;\n\t\t$this->questions = array();\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_svy_qst WHERE survey_fi = %s ORDER BY sequence\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\twhile ($data = $ilDB->fetchAssoc($result)) \n\t\t{\n\t\t\t$this->questions[$data[\"sequence\"]] = $data[\"question_fi\"];\n\t\t}\n\t}", "function loadFromDb($question_id)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$result = $ilDB->queryF(\"SELECT qpl_questions.* FROM qpl_questions WHERE question_id = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($question_id)\n\t\t);\n\t\tif ($result->numRows() == 1)\n\t\t{\n\t\t\t$data = $ilDB->fetchAssoc($result);\n\t\t\t$this->setId($question_id);\n\t\t\t$this->setTitle($data[\"title\"]);\n\t\t\t$this->setComment($data[\"description\"]);\n\t\t\t$this->setSuggestedSolution($data[\"solution_hint\"]);\n\t\t\t$this->setOriginalId($data[\"original_id\"]);\n\t\t\t$this->setObjId($data[\"obj_fi\"]);\n\t\t\t$this->setAuthor($data[\"author\"]);\n\t\t\t$this->setOwner($data[\"owner\"]);\n\t\t\t$this->setPoints($data[\"points\"]);\n\n\t\t\tinclude_once(\"./Services/RTE/classes/class.ilRTE.php\");\n\t\t\t$this->setQuestion(ilRTE::_replaceMediaObjectImageSrc($data[\"question_text\"], 1));\n\t\t\t\n\t\t\t$this->setEstimatedWorkingTimeFromDurationString($data[\"working_time\"]);\n\n\t\t\t// load additional data\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM \" . $this->getAdditionalTableName() . \" WHERE question_fi = %s\",\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($question_id)\n\t\t\t);\n\t\t\t\n\t\t\tif ($result->numRows() == 1)\n\t\t\t{\n\t\t\t\t$data = $ilDB->fetchAssoc($result);\n\t\t\t\t\n\t\t\t\t$this->setVipSubId((int) $data['vip_sub_id']);\n\t\t\t\t$this->setVipCookie((string) $data['vip_cookie']);\n\t\t\t\t$this->setVipExercise((string) $data['vip_exercise']);\n\t\t\t\t$this->setVipLang((string) $data['vip_lang']);\n\t\t\t\t$this->setVipExerciseId((int) $data['vip_exercise_id']);\n\t\t\t\t$this->setVipEvaluation((string) $data['vip_evaluation']);\n\t\t\t\t$this->setVipResultStorage((int) $data['vip_result_storage']);\n\t\t\t\t$this->setVipAutoScoring((int) $data['vip_auto_scoring']);\n\t\t\t}\n\t\t}\n\t\tparent::loadFromDb($question_id);\n\t}", "public function get_survey()\n {\n // check the primary key value\n $primary_key_name = static::get_primary_key_name();\n if( is_null( $this->$primary_key_name ) )\n {\n log::warning( 'Tried to delete record with no id.' );\n return;\n }\n \n return new limesurvey\\surveys( $this->sid );\n }", "function loadFromDb($question_id)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$result = $ilDB->queryF(\"SELECT qpl_questions.*, \" . $this->getAdditionalTableName() . \".* FROM qpl_questions LEFT JOIN \" . $this->getAdditionalTableName() . \" ON \" . $this->getAdditionalTableName() . \".question_fi = qpl_questions.question_id WHERE qpl_questions.question_id = %s\",\n\t\t\tarray(\"integer\"),\n\t\t\tarray($question_id)\n\t\t);\n\t\tif ($result->numRows() == 1)\n\t\t{\n\t\t\t$data = $ilDB->fetchAssoc($result);\n\t\t\t$this->setId($question_id);\n\t\t\t$this->setObjId($data[\"obj_fi\"]);\n\t\t\t$this->setNrOfTries($data['nr_of_tries']);\n\t\t\t$this->setTitle($data[\"title\"]);\n\t\t\t$this->setComment($data[\"description\"]);\n\t\t\t$this->setOriginalId($data[\"original_id\"]);\n\t\t\t$this->setAuthor($data[\"author\"]);\n\t\t\t$this->setPoints($data[\"points\"]);\n\t\t\t$this->setOwner($data[\"owner\"]);\n\t\t\tinclude_once(\"./Services/RTE/classes/class.ilRTE.php\");\n\t\t\t$this->setQuestion(ilRTE::_replaceMediaObjectImageSrc($data[\"question_text\"], 1));\n\t\t\t$this->setCorrectAnswers($data[\"correctanswers\"]);\n\t\t\t$this->setTextRating($data[\"textgap_rating\"]);\n\t\t\t$this->setEstimatedWorkingTime(substr($data[\"working_time\"], 0, 2), substr($data[\"working_time\"], 3, 2), substr($data[\"working_time\"], 6, 2));\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$this->setAdditionalContentEditingMode($data['add_cont_edit_mode']);\n\t\t\t}\n\t\t\tcatch(ilTestQuestionPoolException $e)\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\n\t\t$result = $ilDB->queryF(\"SELECT * FROM qpl_a_textsubset WHERE question_fi = %s ORDER BY aorder ASC\",\n\t\t\tarray('integer'),\n\t\t\tarray($question_id)\n\t\t);\n\t\tinclude_once \"./Modules/TestQuestionPool/classes/class.assAnswerBinaryStateImage.php\";\n\t\tif ($result->numRows() > 0)\n\t\t{\n\t\t\twhile ($data = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\tarray_push($this->answers, new ASS_AnswerBinaryStateImage($data[\"answertext\"], $data[\"points\"], $data[\"aorder\"]));\n\t\t\t}\n\t\t}\n\n\t\tparent::loadFromDb($question_id);\n\t}", "public function loadFromDB()\n {\n }", "function load() {\n\t\tglobal $mysql;\n //if(!$this->exists()) return;\n \t$id \t\t= $mysql->escape($this->id);\n \t$tablename \t= $this->class_name();\n \t$this->data = $mysql->executeSql(\"SELECT * FROM \".$tablename.\" WHERE id=$id;\");\n \t$this->id\t= $this->data['id'];\n \tunset($this->data['id']);\n }", "public function load($id){\n\t\t$sql = 'SELECT * FROM answer WHERE answerId = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "private function load()\r\n {\r\n $this->dbFields = MySQL::fetchRecord(MySQL::executeQuery('SELECT * FROM training_slideshow WHERE ts_id='.(int)$this->id),MySQL::fmAssoc);\r\n }", "public function survey()\n {\n \treturn $this->hasOne('Asabanovic\\Surveys\\Model\\Survey');\n }", "public function load($qid)\n\t{\n\t\trequire '../../delete/sc_connection.php';\n\t\t$query = 'SELECT id, question_text, type, answer, form_id FROM question WHERE id = ' .$qid;\n\t\t$result = pg_query($sc_connection, $query) or die('There was a problem running the question query');\n\t\t$row = pg_fetch_array($result);\n\t\t$id = qid;\n\t\t$question_text = $row['question_text'];\n\t\t$type = $row['type'];\n\t\t$answer = $row['answer'];\n\t\t$form_id = $row['form_id'];\n\t}", "public static function load_from_db() {\n // Sanitize $view;\n $view = isset($_GET['view']) ? (integer) $_GET['view'] : 0;\n $view = $view ? $view : false;\n System::$instances = db_get($view);\n }", "private final function loadObjectFromDb()\n {\n # TODO: would be far preferable to use the objectsFromDestinations() code, possibly by refactoring into another shareable function. this is needed because otherwise we're in object A and OrmClass->load() is generating object B, instead of populating object A\n # TODO:NOTE01\n # TODO: must use $this->setLoadedFromDb() per class\n throw new Exception('TODO');\n }", "public function loadById($id);", "public function loadById($id);", "public function load()\n {\n $result = Claroline::getDatabase()->query( \"\n SELECT\n S.id,\n S.title,\n S.publication_date,\n S.max_score,\n R.score,\n R.comment\n FROM\n `{$this->tbl['examination_session']}` AS S,\n `{$this->tbl['examination_score']}` AS R\n WHERE\n R.session_id = S.id\n AND\n R.user_id = \" . Claroline::getDatabase()->escape( $this->userId ) . \"\n ORDER BY\n S.publication_date\" );\n \n $this->resultList = array();\n \n foreach( $result as $line )\n {\n $id = $line[ 'id' ];\n $this->resultList[ $id ][ 'title' ] = $line[ 'title' ];\n $this->resultList[ $id ][ 'score' ] = $line[ 'score' ] . '/' . $line[ 'max_score' ];\n $this->resultList[ $id ][ 'comment' ] = $line[ 'comment' ];\n $this->resultList[ $id ][ 'date' ] = $line[ 'publication_date' ];\n \n }\n }", "public function initialize()\n\t{\n\t // attributes\n\t\t$this->setName('survey');\n\t\t$this->setPhpName('Survey');\n\t\t$this->setClassname('Survey');\n\t\t$this->setPackage('dokeos');\n\t\t$this->setUseIdGenerator(true);\n\t\t// columns\n\t\t$this->addPrimaryKey('SURVEY_ID', 'SurveyId', 'INTEGER', true, 10, null);\n\t\t$this->addColumn('CODE', 'Code', 'VARCHAR', false, 20, null);\n\t\t$this->addColumn('TITLE', 'Title', 'LONGVARCHAR', false, null, null);\n\t\t$this->addColumn('SUBTITLE', 'Subtitle', 'LONGVARCHAR', false, null, null);\n\t\t$this->addColumn('AUTHOR', 'Author', 'VARCHAR', false, 20, null);\n\t\t$this->addColumn('LANG', 'Lang', 'VARCHAR', false, 20, null);\n\t\t$this->addColumn('AVAIL_FROM', 'AvailFrom', 'DATE', false, null, null);\n\t\t$this->addColumn('AVAIL_TILL', 'AvailTill', 'DATE', false, null, null);\n\t\t$this->addColumn('IS_SHARED', 'IsShared', 'CHAR', false, 1, '1');\n\t\t$this->addColumn('TEMPLATE', 'Template', 'VARCHAR', false, 20, null);\n\t\t$this->addColumn('INTRO', 'Intro', 'LONGVARCHAR', false, null, null);\n\t\t$this->addColumn('SURVEYTHANKS', 'Surveythanks', 'LONGVARCHAR', false, null, null);\n\t\t$this->addColumn('CREATION_DATE', 'CreationDate', 'TIMESTAMP', true, null, '0000-00-00 00:00:00');\n\t\t$this->addColumn('INVITED', 'Invited', 'INTEGER', true, 11, null);\n\t\t$this->addColumn('ANSWERED', 'Answered', 'INTEGER', true, 11, null);\n\t\t$this->addColumn('INVITE_MAIL', 'InviteMail', 'LONGVARCHAR', true, null, null);\n\t\t$this->addColumn('REMINDER_MAIL', 'ReminderMail', 'LONGVARCHAR', true, null, null);\n\t\t$this->addColumn('MAIL_SUBJECT', 'MailSubject', 'VARCHAR', true, 255, null);\n\t\t$this->addColumn('ANONYMOUS', 'Anonymous', 'CHAR', true, null, '0');\n\t\t$this->addColumn('ACCESS_CONDITION', 'AccessCondition', 'LONGVARCHAR', false, null, null);\n\t\t$this->addColumn('SHUFFLE', 'Shuffle', 'TINYINT', true, 1, 0);\n\t\t$this->addColumn('ONE_QUESTION_PER_PAGE', 'OneQuestionPerPage', 'TINYINT', true, 1, 0);\n\t\t$this->addColumn('SURVEY_VERSION', 'SurveyVersion', 'VARCHAR', true, 255, '');\n\t\t$this->addColumn('PARENT_ID', 'ParentId', 'INTEGER', true, 10, null);\n\t\t$this->addColumn('SURVEY_TYPE', 'SurveyType', 'INTEGER', true, 11, 0);\n\t\t$this->addColumn('SHOW_FORM_PROFILE', 'ShowFormProfile', 'INTEGER', true, 11, 0);\n\t\t$this->addColumn('FORM_FIELDS', 'FormFields', 'LONGVARCHAR', true, null, null);\n\t\t$this->addColumn('SESSION_ID', 'SessionId', 'SMALLINT', true, 5, 0);\n\t\t// validators\n\t}", "public function Read(){\n if (isset($_SESSION['question'])) {\n unset($_SESSION['question']);\n\n }\n \n $model = Survey::getInstance();\n $questions = $model->get_questions();\n $answers = $model->get_answers();\n // var_dump($query);\n $this->smarty->assign('questions',$questions);\n $this->smarty->assign('answers',$answers);\n\n $this->smarty->show('survey');\n }", "public function load($data){\n\t\t\t\n\t\t$this->db->select('*')->from($this->table);\n\t\t\n\t\tif (is_array($data)) {\n\t\t\t$this->db->where($data);\n\t\t} else {\n\t\t\t$this->db->where($this->primary_key, $data);\n\t\t}\n\t\t\n\t\t$q = $this->db->build_query();\n\t\t\n\t\tif (Model_Provider::has($q)) {\n\t\t\t$this->db->reset();\n\t\t\t\n\t\t\t$obj = Model_Provider::get($q);\n\t\t\t// echo \"<div class='alert alert-success'>$q</div>\";\n\t\t\t\n\t\t\t$this->fill($obj->to_array());\n\t\t\t\n\t\t\treturn $obj;\n\t\t} else {\n\t\t\t$result = $this->db->get_one();\n\n\t\t\t$this->data = $result;\n\t\t\t\n\t\t\tModel_Provider::set($this->db->last_query, $this);\n\t\t\t\n\t\t\treturn $this;\n\t\t}\n\t}", "public function initialize()\n {\n parent::initialize();\n $this->setSchema(\"salesDB\");\n $this->setSource(\"questionnaire\");\n $this->hasMany('id', 'App\\Models\\Question', 'questionnaire_id', ['alias' => 'Question']);\n $this->belongsTo('itinerary_type_id', 'App\\Models\\ItineraryType', 'id', ['alias' => 'ItineraryType']);\n $this->belongsTo('client_id', 'App\\Models\\Client', 'id', ['alias' => 'Client']);\n $this->belongsTo('user_created', 'App\\Models\\User', 'id', ['alias' => 'UserCreated']);\n $this->belongsTo('user_updated', 'App\\Models\\User', 'id', ['alias' => 'UserUpdated']);\n $this->belongsTo('questionnaire_type_id', 'App\\Models\\QuestionnaireType', 'id', ['alias' => 'QuestionnaireType']);\n $this->belongsTo('sync_status_id', 'App\\Models\\SyncStatus', 'id', ['alias' => 'SyncStatus']);\n }", "public static function loadById($id) {\n $db = Db::instance();\n $obj = $db->fetchById($id, __CLASS__, self::DB_TABLE);\n return $obj;\n }", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);" ]
[ "0.6632753", "0.6607859", "0.62475055", "0.62163645", "0.6137934", "0.58923465", "0.58680713", "0.58397454", "0.5775227", "0.57651675", "0.57021284", "0.5612225", "0.55936867", "0.5482907", "0.5482907", "0.54653037", "0.5450741", "0.5440113", "0.5437204", "0.538706", "0.5353258", "0.5330923", "0.5330923", "0.5330923", "0.5330923", "0.5330923", "0.5330923", "0.5330923", "0.5330923", "0.5330923" ]
0.7186936
0
Loads the survey questions from the database
function loadQuestionsFromDb() { global $ilDB; $this->questions = array(); $result = $ilDB->queryF("SELECT * FROM svy_svy_qst WHERE survey_fi = %s ORDER BY sequence", array('integer'), array($this->getSurveyId()) ); while ($data = $ilDB->fetchAssoc($result)) { $this->questions[$data["sequence"]] = $data["question_fi"]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function Read(){\n if (isset($_SESSION['question'])) {\n unset($_SESSION['question']);\n\n }\n \n $model = Survey::getInstance();\n $questions = $model->get_questions();\n $answers = $model->get_answers();\n // var_dump($query);\n $this->smarty->assign('questions',$questions);\n $this->smarty->assign('answers',$answers);\n\n $this->smarty->show('survey');\n }", "function loadFromDb()\n\t{\n\t\tglobal $ilDB;\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_svy WHERE obj_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getId())\n\t\t);\n\t\tif ($result->numRows() == 1) \n\t\t{\n\t\t\t$data = $ilDB->fetchAssoc($result);\n\t\t\t$this->setSurveyId($data[\"survey_id\"]);\n\t\t\t$this->setAuthor($data[\"author\"]);\n\t\t\tinclude_once(\"./Services/RTE/classes/class.ilRTE.php\");\n\t\t\t$this->setIntroduction(ilRTE::_replaceMediaObjectImageSrc($data[\"introduction\"], 1));\n\t\t\tif (strcmp($data[\"outro\"], \"survey_finished\") == 0)\n\t\t\t{\n\t\t\t\t$this->setOutro($this->lng->txt(\"survey_finished\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->setOutro(ilRTE::_replaceMediaObjectImageSrc($data[\"outro\"], 1));\n\t\t\t}\n\t\t\t$this->setInvitation($data[\"invitation\"]);\n\t\t\t$this->setInvitationMode($data[\"invitation_mode\"]);\n\t\t\t$this->setShowQuestionTitles($data[\"show_question_titles\"]);\n\t\t\t$this->setStartDate($data[\"startdate\"]);\n\t\t\t$this->setEndDate($data[\"enddate\"]);\n\t\t\t$this->setAnonymize($data[\"anonymize\"]);\n\t\t\t$this->setEvaluationAccess($data[\"evaluation_access\"]);\n\t\t\t$this->loadQuestionsFromDb();\n\t\t\t$this->setStatus($data[\"status\"]);\n\t\t\t$this->setMailNotification($data['mailnotification']);\n\t\t\t$this->setMailAddresses($data['mailaddresses']);\n\t\t\t$this->setMailParticipantData($data['mailparticipantdata']);\n\t\t\t$this->setTemplate($data['template_id']);\n\t\t\t$this->setPoolUsage($data['pool_usage']);\n\t\t\t// 360°\n\t\t\t$this->set360Mode($data['mode_360']);\n\t\t\t$this->set360SelfEvaluation($data['mode_360_self_eval']);\n\t\t\t$this->set360SelfRaters($data['mode_360_self_rate']);\n\t\t\t$this->set360SelfAppraisee($data['mode_360_self_appr']);\n\t\t\t$this->set360Results($data['mode_360_results']);\n\t\t\t$this->set360SkillService($data['mode_360_skill_service']);\n\t\t\t// reminder/notification\n\t\t\t$this->setReminderStatus($data[\"reminder_status\"]);\n\t\t\t$this->setReminderStart($data[\"reminder_start\"] ? new ilDate($data[\"reminder_start\"], IL_CAL_DATE) : null);\n\t\t\t$this->setReminderEnd($data[\"reminder_end\"] ? new ilDate($data[\"reminder_end\"], IL_CAL_DATE) : null);\n\t\t\t$this->setReminderFrequency($data[\"reminder_frequency\"]);\n\t\t\t$this->setReminderTarget($data[\"reminder_target\"]);\n\t\t\t$this->setReminderLastSent($data[\"reminder_last_sent\"]);\n\t\t\t$this->setTutorNotificationStatus($data[\"tutor_ntf_status\"]);\n\t\t\t$this->setTutorNotificationRecipients(explode(\";\", $data[\"tutor_ntf_reci\"]));\n\t\t\t$this->setTutorNotificationTarget($data[\"tutor_ntf_target\"]);\n\t\t\t\n\t\t\t$this->setViewOwnResults($data[\"own_results_view\"]);\n\t\t\t$this->setMailOwnResults($data[\"own_results_mail\"]);\n\t\t}\n\t\t\n\t\t// moved activation to ilObjectActivation\n\t\tif($this->ref_id)\n\t\t{\n\t\t\tinclude_once \"./Services/Object/classes/class.ilObjectActivation.php\";\n\t\t\t$activation = ilObjectActivation::getItem($this->ref_id);\t\t\t\n\t\t\tswitch($activation[\"timing_type\"])\n\t\t\t{\t\t\t\t\n\t\t\t\tcase ilObjectActivation::TIMINGS_ACTIVATION:\t\n\t\t\t\t\t$this->setActivationLimited(true);\n\t\t\t\t\t$this->setActivationStartDate($activation[\"timing_start\"]);\n\t\t\t\t\t$this->setActivationEndDate($activation[\"timing_end\"]);\n\t\t\t\t\t$this->setActivationVisibility($activation[\"visible\"]);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\t\t\t\n\t\t\t\t\t$this->setActivationLimited(false);\n\t\t\t\t\tbreak;\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "function loadFromDb($question_id)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$result = $ilDB->queryF(\"SELECT qpl_questions.*, \" . $this->getAdditionalTableName() . \".* FROM qpl_questions LEFT JOIN \" . $this->getAdditionalTableName() . \" ON \" . $this->getAdditionalTableName() . \".question_fi = qpl_questions.question_id WHERE qpl_questions.question_id = %s\",\n\t\t\tarray(\"integer\"),\n\t\t\tarray($question_id)\n\t\t);\n\t\tif ($result->numRows() == 1)\n\t\t{\n\t\t\t$data = $ilDB->fetchAssoc($result);\n\t\t\t$this->setId($question_id);\n\t\t\t$this->setObjId($data[\"obj_fi\"]);\n\t\t\t$this->setNrOfTries($data['nr_of_tries']);\n\t\t\t$this->setTitle($data[\"title\"]);\n\t\t\t$this->setComment($data[\"description\"]);\n\t\t\t$this->setOriginalId($data[\"original_id\"]);\n\t\t\t$this->setAuthor($data[\"author\"]);\n\t\t\t$this->setPoints($data[\"points\"]);\n\t\t\t$this->setOwner($data[\"owner\"]);\n\t\t\tinclude_once(\"./Services/RTE/classes/class.ilRTE.php\");\n\t\t\t$this->setQuestion(ilRTE::_replaceMediaObjectImageSrc($data[\"question_text\"], 1));\n\t\t\t$this->setCorrectAnswers($data[\"correctanswers\"]);\n\t\t\t$this->setTextRating($data[\"textgap_rating\"]);\n\t\t\t$this->setEstimatedWorkingTime(substr($data[\"working_time\"], 0, 2), substr($data[\"working_time\"], 3, 2), substr($data[\"working_time\"], 6, 2));\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$this->setAdditionalContentEditingMode($data['add_cont_edit_mode']);\n\t\t\t}\n\t\t\tcatch(ilTestQuestionPoolException $e)\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\n\t\t$result = $ilDB->queryF(\"SELECT * FROM qpl_a_textsubset WHERE question_fi = %s ORDER BY aorder ASC\",\n\t\t\tarray('integer'),\n\t\t\tarray($question_id)\n\t\t);\n\t\tinclude_once \"./Modules/TestQuestionPool/classes/class.assAnswerBinaryStateImage.php\";\n\t\tif ($result->numRows() > 0)\n\t\t{\n\t\t\twhile ($data = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\tarray_push($this->answers, new ASS_AnswerBinaryStateImage($data[\"answertext\"], $data[\"points\"], $data[\"aorder\"]));\n\t\t\t}\n\t\t}\n\n\t\tparent::loadFromDb($question_id);\n\t}", "function loadFromDb($question_id)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$result = $ilDB->queryF(\"SELECT qpl_questions.* FROM qpl_questions WHERE question_id = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($question_id)\n\t\t);\n\t\tif ($result->numRows() == 1)\n\t\t{\n\t\t\t$data = $ilDB->fetchAssoc($result);\n\t\t\t$this->setId($question_id);\n\t\t\t$this->setTitle($data[\"title\"]);\n\t\t\t$this->setComment($data[\"description\"]);\n\t\t\t$this->setSuggestedSolution($data[\"solution_hint\"]);\n\t\t\t$this->setOriginalId($data[\"original_id\"]);\n\t\t\t$this->setObjId($data[\"obj_fi\"]);\n\t\t\t$this->setAuthor($data[\"author\"]);\n\t\t\t$this->setOwner($data[\"owner\"]);\n\t\t\t$this->setPoints($data[\"points\"]);\n\n\t\t\tinclude_once(\"./Services/RTE/classes/class.ilRTE.php\");\n\t\t\t$this->setQuestion(ilRTE::_replaceMediaObjectImageSrc($data[\"question_text\"], 1));\n\t\t\t\n\t\t\t$this->setEstimatedWorkingTimeFromDurationString($data[\"working_time\"]);\n\n\t\t\t// load additional data\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM \" . $this->getAdditionalTableName() . \" WHERE question_fi = %s\",\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($question_id)\n\t\t\t);\n\t\t\t\n\t\t\tif ($result->numRows() == 1)\n\t\t\t{\n\t\t\t\t$data = $ilDB->fetchAssoc($result);\n\t\t\t\t\n\t\t\t\t$this->setVipSubId((int) $data['vip_sub_id']);\n\t\t\t\t$this->setVipCookie((string) $data['vip_cookie']);\n\t\t\t\t$this->setVipExercise((string) $data['vip_exercise']);\n\t\t\t\t$this->setVipLang((string) $data['vip_lang']);\n\t\t\t\t$this->setVipExerciseId((int) $data['vip_exercise_id']);\n\t\t\t\t$this->setVipEvaluation((string) $data['vip_evaluation']);\n\t\t\t\t$this->setVipResultStorage((int) $data['vip_result_storage']);\n\t\t\t\t$this->setVipAutoScoring((int) $data['vip_auto_scoring']);\n\t\t\t}\n\t\t}\n\t\tparent::loadFromDb($question_id);\n\t}", "public function questions($survey = \"\")\n {\n\n $surveyPrefix = \"\";\n $surveyData = $this->survey_model->getSurveyPrefix($survey);\n $data[\"valid_survey\"] = true;\n $data[\"show_questions\"] = true;\n $data[\"survey_errors\"] = false;\n\n // check if the provided slug was valid\n if($surveyData != null) {\n\n // populate survery information\n $surveyPrefix = $surveyData->prefix;\n $data[\"survey_title\"] = $surveyData->title;\n $data[\"survey_subtitle\"] = $surveyData->subtitle;\n }\n else {\n $data[\"valid_survey\"] = false; // display error\n }\n\n // check if the survey was submitted\n if($_SERVER['REQUEST_METHOD'] == 'POST' && $data[\"valid_survey\"]) {\n $result = $this->survey_model->validateSubmission($surveyPrefix);\n if(array_key_exists(\"errors\", $result)) {\n $data[\"errors\"] = $result[\"errors\"];\n $data[\"survey_errors\"] = true;\n }\n else {\n $data[\"show_questions\"] = false;\n }\n }\n\n // check if the user specified a valid survey\n if(!empty($surveyPrefix)) {\n\n $data[\"questions\"] = $this->survey_model->getSurveyData($surveyPrefix);\n ($data[\"questions\"] === null) ? $data[\"valid_survey\"] = false: \"\";\n }\n\n $data[\"active_surveys\"] = \"\";\n $this->load->view('templates/survey/header', $data);\n $this->load->view('templates/survey/nav');\n $this->load->view('templates/survey/survey', $data);\n $this->load->view('templates/survey/footer');\n }", "function getAll() {\r\n\t\treturn SurveyAnswerQuery::create()->find();\r\n\t}", "public function load($qid)\n\t{\n\t\trequire '../../delete/sc_connection.php';\n\t\t$query = 'SELECT id, question_text, type, answer, form_id FROM question WHERE id = ' .$qid;\n\t\t$result = pg_query($sc_connection, $query) or die('There was a problem running the question query');\n\t\t$row = pg_fetch_array($result);\n\t\t$id = qid;\n\t\t$question_text = $row['question_text'];\n\t\t$type = $row['type'];\n\t\t$answer = $row['answer'];\n\t\t$form_id = $row['form_id'];\n\t}", "public function getQuestions()\n {\n $title = \"Questions\";\n $subtitle = \"Here you will find all the questions!\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n\n // Get all the questions\n $questions = $this->di->get(\"questionModel\")->getQuestions();\n\n // Get number of answers\n $answers = [];\n foreach ($questions as $question) {\n $ans = $this->di->get(\"answerModel\")->getAnswersWhere(\"questionId\", $question->id);\n $answers[$question->id] = count($ans);\n }\n\n $data = [\n \"questions\" => $questions,\n \"subtitle\" => $subtitle,\n \"noOfAnswers\" => $answers,\n ];\n\n $view->add(\"pages/questions\", $data);\n $pageRender->renderPage([\"title\" => $title]);\n }", "public function Load($surveyid)\n\t{\n\t\t$surveyid = (int)$surveyid;\n\t\t$prefix = $this->Db->TablePrefix;\n\t\t$query = \"SELECT * FROM {$prefix}surveys WHERE id = $surveyid\";\n\n\t\t$result = $this->Db->Query($query);\n\t\t$survey = $this->Db->Fetch($result);\n\n\t\treturn $this->_loadData($survey);\n\t}", "function get_SurveyQuestions($surveyID){\r\n $sql = $this->db->prepare(\"SELECT * FROM SURVEYQUESTION WHERE SurveyID = :surveyid;\");\r\n $result = $sql->execute(array(\r\n \"surveyid\" => $surveyID\r\n ));\r\n if ($result){\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n else{\r\n return false;\r\n }\r\n }", "function answerQuestions() {\n $this->layout = 'survey'; // use the more basic survey layout\n if (!$this->request->is('post')) {\n // if there is no data then show the initial view\n $survey = $this->Session->read('Survey.original'); // get the survey being used\n if (empty($survey['Question'])) { // if there are no questions then we don't need to show the question form at all\n $this->Session->write('Survey.progress', GDTA_ENTRY); // move progress forward and redirect to the runSurvey action\n $this->redirect(array('action' => 'runSurvey'));\n }\n $questions = $survey['Question'];\n $answers = ($this->Session->check('Survey.answers')) ? $this->Session->read('Survey.answers') : array(); // check to see if there are already answers in the session\n $choices = array(); // gather choices here keyed to each question id\n foreach ($questions as &$q) { // go through each question and look to see if there is an answer for it\n $checkId = $q['id'];\n $choices[$checkId] = array();\n if (isset($q['Choice'])) {\n foreach ($q['Choice'] as $choice) {\n $choices[$checkId][$choice['id']] = $choice['value'];\n }\n }\n foreach ($answers as $a) {\n if ($a['question_id'] == $checkId) {\n if ($q['type'] == MULTI_SELECT) {\n $q['answer'] = Set::extract('/id',$a['answer']);\n } else {\n $q['answer'] = $a['answer'];\n }\n break;\n }\n }\n }\n $this->set('questions', $questions); // send questions to the view\n $this->set('choices', $choices); // send choices for questions to the view, ordered for form elements\n } else { // we have form data so process it here\n if (isset($this->request->data['Answer'])) {\n // make sure we have answers in the data set\n $this->Session->write('Survey.answers', $this->request->data['Answer']); // write the answers to the session\n }\n $this->Session->write('Survey.progress', GDTA_ENTRY); // move progress forward and redirect to the runSurvey action\n $this->redirect(array('action' => 'runSurvey'));\n }\n }", "function get_Questions()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$db = DB::getConnection();\n\t\t\t$st = $db->prepare( 'SELECT * FROM questions' );\n\t\t\t$st->execute( array( ) );\n\t\t}\n\t\tcatch( PDOException $e ) { exit( 'PDO error ' . $e->getMessage() ); }\n\n\t\t$arr = array();\n\t\twhile( $row = $st->fetch() )\n\t\t{\n\t\t\t$arr[] = new Question( $row['id'], $row['question']);\n\t\t}\n\n\t\treturn $arr;\n\t}", "public function load()\n {\n $result = Claroline::getDatabase()->query( \"\n SELECT\n S.id,\n S.title,\n S.publication_date,\n S.max_score,\n R.score,\n R.comment\n FROM\n `{$this->tbl['examination_session']}` AS S,\n `{$this->tbl['examination_score']}` AS R\n WHERE\n R.session_id = S.id\n AND\n R.user_id = \" . Claroline::getDatabase()->escape( $this->userId ) . \"\n ORDER BY\n S.publication_date\" );\n \n $this->resultList = array();\n \n foreach( $result as $line )\n {\n $id = $line[ 'id' ];\n $this->resultList[ $id ][ 'title' ] = $line[ 'title' ];\n $this->resultList[ $id ][ 'score' ] = $line[ 'score' ] . '/' . $line[ 'max_score' ];\n $this->resultList[ $id ][ 'comment' ] = $line[ 'comment' ];\n $this->resultList[ $id ][ 'date' ] = $line[ 'publication_date' ];\n \n }\n }", "private function json_retrieveQuestions()\n {\n // Gets the input data from the Front-End\n $input = json_decode(file_get_contents(\"php://input\"));\n// $surveyID = $_POST['surveyID'];\n $surveyID= $input->surveyID;\n\n // Gets Survey Details\n $surveyQuery = \"SELECT surveyTitle, surveyDescription FROM Surveys WHERE surveyID = :surveyID;\";\n $surveyParams = [\n \":surveyID\" => $surveyID,\n ];\n // This decodes the JSON encoded by getJSONRecordSet() from an associative array\n $resSurveyDetails = json_decode($this->recordset->getJSONRecordSet($surveyQuery, $surveyParams), true);\n $surveyTitle = $resSurveyDetails['data']['0']['surveyTitle'];\n $surveyDescription = $resSurveyDetails['data']['0']['surveyDescription'];\n\n // Gets Questions Details\n $questionsQuery = \"SELECT questionID, question, mediaPath FROM Questions WHERE surveyID = :surveyID;\";\n $questionsParams = [\n \":surveyID\" => $surveyID,\n ];\n\n // This decodes the JSON encoded by getJSONRecordSet() from an associative array\n $resQuestions = json_decode($this->recordset->getJSONRecordSet($questionsQuery, $questionsParams), true);\n $questionID = $resQuestions['data']['0']['questionID'];\n $question = $resQuestions['data']['0']['question'];\n $mediaPath = $resQuestions['data']['0']['mediaPath'];\n\n $nextpage = null;\n\n $res['status'] = 200;\n $res['message'] = \"ok\";\n $res['next_page'] = $nextpage;\n $res['surveyTitle'] = $surveyTitle;\n $res['surveyDescription'] = $surveyDescription;\n $res['questionID'] = $questionID;\n $res['question'] = $question;\n $res['mediaPath'] = $mediaPath;\n\n return json_encode($res);\n }", "public function questions()\n {\n\n $client = new \\GuzzleHttp\\Client();\n\n $request = $client->get('http://localhost/quizci/questions');\n $response = $request->getBody()->getContents();\n\n $res_json_decode = json_decode($response);\n $data_collection = collect($res_json_decode->questions);\n //dd($data_collect);\n\n return View('admin.pages.questions', compact('data_collection'));\n }", "public function getQuestions()\n {\n return DB::table('questionbank_quizzes')\n ->where('quize_id','=',$this->id)\n ->orderBy('subject_id')\n ->get();\n }", "function saveQuestionsToDb() \n\t{\n\t\tglobal $ilDB;\n\t\t// save old questions state\n\t\t$old_questions = array();\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_svy_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\tif ($result->numRows())\n\t\t{\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\t$old_questions[$row[\"question_fi\"]] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// delete existing question relations\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_svy_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t// create new question relations\n\t\tforeach ($this->questions as $key => $value) \n\t\t{\n\t\t\t$next_id = $ilDB->nextId('svy_svy_qst');\n\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_svy_qst (survey_question_id, survey_fi, question_fi, heading, sequence, tstamp) VALUES (%s, %s, %s, %s, %s, %s)\",\n\t\t\t\tarray('integer','integer','integer','text','integer','integer'),\n\t\t\t\tarray($next_id, $this->getSurveyId(), $value, (strlen($old_questions[$value][\"heading\"])) ? $old_questions[$value][\"heading\"] : NULL, $key, time())\n\t\t\t);\n\t\t}\n\t}", "public function questions()\n {\n return $this->hasMany('App\\\\SurveyQuestion','survey_id');\n }", "public function initQuestions()\n\t{\n\t\t$this->collQuestions = array();\n\t}", "function ipal_get_questions_student($qid){\r\n\r\n global $ipal;\r\n global $DB;\r\n global $CFG;\r\n\t\t$q='';\r\n\t\t$pagearray2=array();\r\n\t\t\r\n $aquestions=$DB->get_record('question',array('id'=>$qid));\r\n\t\t\tif($aquestions->questiontext != \"\"){ \r\n\r\n\t$pagearray2[]=array('id'=>$qid, 'question'=>$aquestions->questiontext, 'answers'=>ipal_get_answers_student($qid));\r\n\t\t\t\t\t\t\t}\r\n return($pagearray2);\r\n}", "public function run()\n {\n DB::table('survey_questions')->insert([\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'heading',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Informatie over de patiënt:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Leeftijd:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'textarea',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Onderliggend lijden welk invloed kan hebben op de wondgenezing: (indien niet aanwezig gelieve n.v.t te vermelden).',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'heading',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Informatie over de wond',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => null,\n 'required' => true,\n 'options' => json_encode(['Nieuwe wond', 'Bestaande wond']),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Sinds wanneer?',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 6,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => null,\n 'required' => true,\n 'options' => json_encode(['dag(en)', 'week/weken']),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Welke verband is het meest recentelijk op deze wond aangebracht?',\n 'required' => true,\n 'options' => json_encode([\n ['Fiberverbanden met hoog absorptievermogen of alginaten, gelieve de naam van het product te vermelden:'],\n ['Schuimverband, gelieve de naam van het product te vermelden:'],\n ['Zilververband, gelieve de naam van het product te vermelden:'],\n ['Superabsorberend, gelieve de naam van het product te vermelden:'],\n ['Hydrocolloïde, gelieve de naam van het product te vermelden:'],\n ['Ander(e) type(n), gelieve de naam van het product te vermelden:'],\n 'Geen',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Type wond:',\n 'required' => true,\n 'options' => json_encode([\n 'Acute wond',\n 'Chronische wond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Geïnfecteerd?',\n 'required' => true,\n 'options' => json_encode([\n 'Ja',\n 'Nee',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => 'Andere acute wond, namelijk:',\n 'text' => '(Indien acute wond aangevinkt) het gaat in het bijzonder om een …',\n 'required' => true,\n 'options' => json_encode([\n 'Traumatische wond (oppervlakkige schaafwond, laceratie, flyctenen, oppervlakkige snijwonden en huidscheuren)',\n 'Tweedegraads brandwond',\n 'Dermabrasie / Ontvelling',\n 'Chirurgische wond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => 'Andere chronische wond, namelijk',\n 'text' => '(Indien chronische wond aangevinkt) het gaat in het bijzonder om een …',\n 'required' => true,\n 'options' => json_encode([\n 'Decubitus wond',\n 'Ulcus Cruris beenwond',\n 'Diabetische voetwond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Wat is de hoeveelheid wondvocht?',\n 'required' => true,\n 'options' => json_encode([\n 'Droog',\n 'Vochtig',\n 'Nat',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Locatie van het wondbed',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => '% Necrotisch (zwart)',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => '% Granulerend (rood)',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => '% Beslag (geel)',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Anders, namelijk',\n 'required' => false,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => null,\n 'text' => 'Toestand van de huid rondom de wond:',\n 'required' => true,\n 'options' => json_encode([\n 'Gezond',\n 'Geïrriteerd/rood',\n 'Droog/eczematisch',\n 'Gemacereerd',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'heading',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'D0 – 1e toepassing van AQUACEL Foam of Foam Lite™ ConvaTec:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'date',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Datum (D0):',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Type verband:',\n 'required' => true,\n 'options' => json_encode([\n 'AQUACEL Foam',\n 'AQUACEL Ag Foam',\n 'Foam Lite ConvaTec',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'label',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Afmeting verbandkeuze:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'AQUACEL Foam – plakkend',\n 'required' => true,\n 'options' => json_encode([\n '8 x 8 cm',\n '10 x 10 cm',\n '12,5 x 12,5 cm',\n '17,5 x 17,5 cm',\n '21 x 21 cm',\n '25 x 30 cm',\n '8 x 13 cm',\n '10 x 20 cm',\n '10 x 25 cm',\n '10 x 30 cm',\n '19,8 x 14 cm',\n '20 x 16,9 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'AQUACEL Foam - zonder kleefrand',\n 'required' => true,\n 'options' => json_encode([\n '5 x 5 cm',\n '10 x 10 cm',\n '15 x 15 cm',\n '10 x 20 cm',\n '15 x 20 cm',\n '20 x 20 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'AQUACEL Foam – anatomische vormen',\n 'required' => true,\n 'options' => json_encode([\n 'Allround 19,8 x 14 cm',\n 'Sacrum 20 x 16,9 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Foam Lite™ ConvaTec',\n 'required' => true,\n 'options' => json_encode([\n '5 x 5 cm',\n '8 x 8 cm',\n '10 x 10 cm',\n '10 x 20 cm',\n '15 x 15 cm',\n '5,5 x 12 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => 'Secundair verband, gelieve het primaire verband te vermelden:',\n 'text' => 'Op welke wijze gebruikt u het gekozen verband?',\n 'required' => true,\n 'options' => json_encode([\n 'Primair verband',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => null,\n 'text' => 'Waarom heeft u voor dit specifieke verband gekozen? (Meerdere antwoorden zijn mogelijk)',\n 'required' => true,\n 'options' => json_encode([\n 'Vormbaar, zacht, comfortabel voor de patiënt',\n 'Vochtig wondmilieu met Hydrofiber',\n 'Bescherming van de wondranden (verticale absorptie)',\n 'Vasthouden van wondvocht en bacteriën (retentie)',\n 'Verbetering/ verkleining van de wond',\n 'Minder verbandwissels en/of draagtijd verlengd',\n 'Eenvoudig te gebruiken',\n 'Goede kennis van en ervaringen met schuimverbanden',\n 'Goede kennis van en ervaringen met Hydrofiber-verbanden',\n 'Type wond en hoeveelheid wondvocht',\n 'Fase van de wond',\n 'Locatie van de wond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => null,\n 'text' => 'Hoe ervaart u het aanbrengen van het verband?',\n 'required' => true,\n 'options' => json_encode([\n 'Gemakkelijk',\n ['Redelijk gemakkelijk (omschrijf)'],\n ['Niet gemakkelijk (omschrijf)'],\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Kleeft het verband bij het aanbrengen aan de handschoenen of aan zichzelf?',\n 'required' => true,\n 'options' => json_encode([\n 'Ja',\n 'Nee',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Zo ja, is het herpositioneerbaar?',\n 'required' => true,\n 'options' => json_encode([\n 'Ja',\n 'Nee',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n ]);\n }", "function pubf_LoadAnswer($strRespuesta)\n\t{\n\t\t$strSQLoadContent= $this->selectQuery(\"select idRespuesta,strRespuesta,intCorrecta from respuesta where idRespuesta={$this->idRespuesta}\");\n if($strSQLoadContent){\n $this->idRespuesta = $strSQLoadContent->idRespuesta;\n\t\t\t\t $this->strRespuesta = $strSQLoadContent->strRespuesta;\n }\n\t}", "function getQuestions() { \n\ttry {\n\t\t$questions = ORM::for_table('questions')->find_many();\n\t\tif (!count($questions)) { \n\t\t\treturn 0;\n\t\t}\n\t\t$theQuestions = array();\n\t\tforeach ($questions as $question) { \n\t\t\t$theQuestion = array();\n\t\t\t$theQuestion['id'] = $question->id;\n\t\t\t$theQuestion['text'] = $question->text;\n\t\t\t$theQuestion['answer1'] = $question->answer1;\n\t\t\t$theQuestion['answer2'] = $question->answer2;\n\t\t\t$theQuestions[] = $theQuestion;\n\t\t}\n\t\treturn $theQuestions;\n\t} catch (Exception $e) { \n\t\treturn 0;\n\t}\n}", "function get_survey_questions($survey_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated survey answers\r\n $sql = \"SELECT id\r\n FROM questions\r\n WHERE is_active = '1' AND survey = '$survey_id';\";\r\n\r\n $questions_data = array();\r\n $questions = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $questions_data[$key] = $value;\r\n foreach ($questions_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $questions[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $questions;\r\n}", "function quiz_report_load_questions($quiz){\n global $CFG, $DB;\n $questionlist = quiz_questions_in_quiz($quiz->questions);\n //In fact in most cases the id IN $questionlist below is redundant\n //since we are also doing a JOIN on the qqi table. But will leave it in\n //since this double check will probably do no harm.\n list($usql, $params) = $DB->get_in_or_equal(explode(',', $questionlist));\n $params[] = $quiz->id;\n if (!$questions = $DB->get_records_sql(\"SELECT q.*, qqi.grade AS maxgrade\n FROM {question} q,\n {quiz_question_instances} qqi\n WHERE q.id $usql AND\n qqi.question = q.id AND\n qqi.quiz = ?\", $params)) {\n print_error('noquestionsfound', 'quiz');\n }\n //Now we have an array of questions from a quiz we work out there question nos and remove\n //questions with zero length ie. description questions etc.\n //also put questions in order.\n $number = 1;\n $realquestions = array();\n $questionids = explode(',', $questionlist);\n foreach ($questionids as $id) {\n if ($questions[$id]->length) {\n // Ignore questions of zero length\n $realquestions[$id] = $questions[$id];\n $realquestions[$id]->number = $number;\n $number += $questions[$id]->length;\n }\n }\n return $realquestions;\n}", "function fillQuestion($data)\r\n {\r\n\tfor( $i=0; $i<$data['count']; $i++ ){\r\n\t\t$data[$i]['Question'] = $this->findAll($conditions='id='.$data[$i]['SurveyQuestion']['question_id'], $fields=\"prompt, type\");\r\n\t\t$data[$i]['Question'] = $data[$i]['Question'][0]['Question'];\r\n\t\t$data[$i]['Question']['number'] = $data[$i]['SurveyQuestion']['number'];\r\n\t\t$data[$i]['Question']['id'] = $data[$i]['SurveyQuestion']['question_id'];\r\n\t\t$data[$i]['Question']['sq_id'] = $data[$i]['SurveyQuestion']['id'];\r\n\t\tunset($data[$i]['SurveyQuestion']);\r\n\t}\r\n\r\n\treturn $data;\r\n }", "public function run()\n {\n foreach ($this->questions as $question) {\n /** @var \\App\\Components\\SiteSurvey\\Models\\SiteSurveyQuestion $existing */\n $existing = DB::table('site_survey_questions')\n ->where('name', $question['name'])\n ->first();\n\n if (!$existing) {\n $questionId = DB::table('site_survey_questions')\n ->insertGetId([\n 'name' => $question['name'],\n ]);\n\n if (!empty($question['options'])) {\n foreach ($question['options'] as $option) {\n DB::table('site_survey_question_options')\n ->insert([\n 'site_survey_question_id' => $questionId,\n 'name' => $option,\n ]);\n }\n }\n } elseif (!empty($question['options'])) {\n foreach ($question['options'] as $option) {\n /** @var \\App\\Components\\SiteSurvey\\Models\\SiteSurveyQuestionOption $existingOption */\n $existingOption = DB::table('site_survey_question_options')\n ->where('name', $option)\n ->where('site_survey_question_id', $existing->id)\n ->first();\n\n if (!$existingOption) {\n DB::table('site_survey_question_options')\n ->insert([\n 'site_survey_question_id' => $existing->id,\n 'name' => $option,\n ]);\n }\n }\n }\n }\n }", "function get_survey_questions($survey_id)\n {\n $this->db->join('survey_survey_questions', 'survey_survey_questions.question_id = ' . $this->get_table_name() . '.question_id', 'LEFT');\n\n $this->db->where('survey_survey_questions.survey_id', $survey_id);\n \n return $this->db->get($this->get_table_name());\n }", "function showQuestions()\n\t{\n\t\tif($this->TotalQuestions > 0)\n\t\t{#be certain there are questions\n\t\t\tforeach($this->aQuestion as $question)\n\t\t\t{#print data for each \n\t\t\t\techo $question->Number . ') '; # We're using new Number property instead of id - v2\n\t\t\t\techo $question->Text . ' ';\n\t\t\t\tif($question->Description != ''){echo '(' . $question->Description . ')';}\n\t\t\t\techo '<br />';\n\t\t\t\t$question->showAnswers() . '<br />'; #display array of answer objects\n\t\t\t}\n\t\t}else{\n\t\t\techo 'There are currently no questions for this survey.';\t\n\t\t}\n\t}", "public function questions()\n {\n \treturn $this->hasMany(Question::class);\n }" ]
[ "0.67539793", "0.6587562", "0.63316315", "0.6148872", "0.61152744", "0.61018825", "0.6098469", "0.60228795", "0.600011", "0.5993151", "0.5988139", "0.5935327", "0.59136033", "0.58983463", "0.5869252", "0.58491427", "0.5844125", "0.5832039", "0.5791797", "0.5788542", "0.5782367", "0.5779331", "0.57616764", "0.5752282", "0.57038814", "0.56993806", "0.5675055", "0.56300515", "0.56038886", "0.5581764" ]
0.8036829
0
Sets the authors name of the ilObjSurvey object
function setAuthor($author = "") { $this->author = $author; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setAuthor($a) {\n\t\t$this->set(\"author\",$a);\n\t}", "public function getAuthorname() {}", "protected function setAuthors() {\r\n\t\t// authors, yes, we can handle more than one per article\r\n\t\t$authorsStg = $this->newsItem->getAuthor();\r\n\t\tif (!empty($authorsStg)) {\r\n\t\t\t$authors = t3lib_div::trimExplode(',', $authorsStg);\r\n\t\t\t$allowedCount = intval($this->settings['news']['semantic']['general']['author']['max']);\r\n\t\t\t$this->authors = (empty($allowedCount)) ? $authors : array_slice($authors, 0, $allowedCount);\r\n\t\t}\r\n\t}", "public function getAuthorName()\n {\n return 'Fightmaster.publication.author.name';\n }", "function setAutorName(){\n global $authorName;\n $authorName = \"Charles Dickens\";\n}", "public function setAuthor($author)\n {\n if(strlen($author) <= 50 && strlen($author) > 0 && preg_match('#^[a-zA-Z- ]*$#', $author)) {\n $this->author = $author;\n }\n }", "abstract public function setAuthor($author);", "public function authorsInitials();", "public function setAuthor( $mail, $name = false ) {\n\t\t$this->author = [\n\t\t\t'mail' => $mail,\n\t\t\t'name' => $name\n\t\t];\n\t}", "public function setAuthor($author);", "public function setAuthor(string $author): void\n {\n $this->_author = $author;\n }", "public function setAuthor($author, $encoding = 'UTF-8') {}", "public function setAuthorUsername($AUTHOR_USERNAME)\n {\n $this->AUTHOR_USERNAME = $AUTHOR_USERNAME;\n }", "public function getAuthorName() : void {\n\t\treturn $this->authorName;\n\t}", "public function getAuthorName()\n\t{\n\t\tif(is_null($this->_authorName)){\n\t\t\t$this->loadData();\n\t\t}\n\t\treturn $this->_authorName;\n\t}", "function add_author_name( $template_name, $template_path, $located, $args ) {\n\t\tglobal $product;\n\t\tif ( $template_name == 'single-product/title.php' ) {\n\t\t\t$author = get_post_meta( $product->id, 'author', true );\n\t\t\techo \"<h2 class=\\\"author_name\\\">$author</h2>\";\n\t\t}\n\t}", "function GetAuthor()\n {\n return 'texus';\n }", "public function testUpdateAuthor() {\n $this->put('/api/author/3',\n ['first_name' => 'Karim'] )\n ->seeJson(['first_name' => 'Karim']);\n }", "public function setAuthors($authors)\n {\n $this->setValue('authors', $authors);\n }", "function GetAuthor()\n {\n return 'calguy1000';\n }", "public function authorsNamesForInitial($initial);", "public function setName($name){\n $this->__set('name',$name);\n }", "public function meta_author_name()\n\t{\n\t\treturn $this->get_context_meta_value( __FUNCTION__ );\n\t}", "protected function _syncAuthor() {}", "function setName($name){\n\t\t$this->name=$name;\n\t}", "public function setName($name) \n {\n $this->_name = $name; \n }", "public function getAuthorName()\n {\n return $this->author ? $this->author : $this->createUser->firstname . ' ' . $this->createUser->lastname;\n }", "public function setName($name){\n $this->_name = $name;\n }", "function setDisplayName($name){\n\t\t$this->display_name =$name;\n\t}", "public function set_name( $name ) {\n\t\t$this->label = $name;\n\t\t$this->slug = sanitize_title_with_dashes( $name );\n\t}" ]
[ "0.6555719", "0.6375364", "0.62693906", "0.6217666", "0.6210684", "0.618142", "0.6179138", "0.61727464", "0.61459804", "0.6080455", "0.6054744", "0.6019357", "0.6005423", "0.58982074", "0.58947545", "0.5860473", "0.58526945", "0.5821803", "0.57884383", "0.57872784", "0.5736606", "0.571559", "0.5711368", "0.5710702", "0.570053", "0.569755", "0.569337", "0.5677091", "0.567457", "0.5664903" ]
0.63755816
1
Saves an authors name into the lifecycle metadata if no lifecycle metadata exists This will only be called for conversion of "old" tests where the author hasn't been stored in the lifecycle metadata
function saveAuthorToMetadata($a_author = "") { $md =& new ilMD($this->getId(), 0, $this->getType()); $md_life =& $md->getLifecycle(); if (!$md_life) { if (strlen($a_author) == 0) { global $ilUser; $a_author = $ilUser->getFullname(); } $md_life =& $md->addLifecycle(); $md_life->save(); $con =& $md_life->addContribute(); $con->setRole("Author"); $con->save(); $ent =& $con->addEntity(); $ent->setEntity($a_author); $ent->save(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store_new_author()\n {\n $author = $this->dispatch( new StoreAuthor( $this->authorDataFormat ) );\n $this->assertTrue( $author->exists() );\n }", "function createMetaData()\n\t{\n\t\tparent::createMetaData();\n\t\t$this->saveAuthorToMetadata();\n\t}", "protected function _syncAuthor() {}", "public function testUpdateAuthor() {\n $this->put('/api/author/3',\n ['first_name' => 'Karim'] )\n ->seeJson(['first_name' => 'Karim']);\n }", "public function authorsInitials();", "function checkAuthors () {\n\t\tif ( count ( $this->authors) == 0 ) return ;\n\t\n\t\tif ( isset($this->existing_q) ) {\n\t\t\t$this->wd->loadItem ( $this->existing_q ) ;\n\t\t\t$i = $this->wd->getItem ( $this->existing_q ) ;\n\t\t\t$c1 = $i->getClaims ( $this->props['author'] ) ;\n\t\t\t$c2 = $i->getClaims ( $this->props['short author'] ) ;\n\t\t\t$this->invalidateExistingAuthors ( $c1 ) ;\n\t\t\t$this->invalidateExistingAuthors ( $c2 ) ;\n\t\t\t\n\t\t\t// Special case: Single author, one author already in item...\n\t\t\tif ( count($this->authors) == 1 && count($c1)+count($c2) == 1 ) {\n\t\t\t\t$this->authors[1]->hadthat = true ;\n\t\t\t}\n\t\t}\n\t}", "private function addAuthor(array $authors)\n {\n $checkSQL = \"SELECT Count(id) as 'bool' FROM authors WHERE name_author = ?\";\n $sql = \"INSERT INTO `authors` (`name_author`) VALUES (?)\";\n foreach ($authors as $author) {\n if (!$this->findBySql($checkSQL, [$author])[0]['bool']) {\n $this->findBySql($sql, [$author]);\n }\n }\n }", "function ensureAuthorsInDatabase($authors)\r\n {\r\n $CI = &get_instance();\r\n if (!is_array($authors))\r\n return null;\r\n \r\n $tempresult = array();\r\n foreach ($authors as $author)\r\n {\r\n $current = $this->getByExactName($author->firstname, $author->von, $author->surname, $author->jr);\r\n if ($current == null)\r\n $current = $this->add($author);\r\n \r\n $tempresult[] = $current;\r\n }\r\n //silently drop duplicate authors from list\r\n $authorids = array();\r\n $authors = array();\r\n foreach ($tempresult as $a)\r\n {\r\n if (!in_array($a->author_id,$authorids))\r\n {\r\n $authorids[] = $a->author_id;\r\n $authors[] = $a;\r\n }\r\n else\r\n {\r\n appendMessage(__(\"Dropped duplicate author\").\"<br/>\");\r\n }\r\n }\r\n\r\n return $authors;\r\n }", "public function authors_is_required()\n {\n $entry = Entry::factory()->raw();\n $category = Category::factory()->create();\n\n Sanctum::actingAs(User::factory()->create());\n\n $this->jsonApi()->withData([\n 'type' => 'entries',\n 'attributes' => $entry,\n 'relationships' => [\n 'categories' => [\n 'data' => [\n 'id' => $category->getRouteKey(),\n 'type' => 'categories'\n ]\n ]\n ]\n ])->post(route('api.v1.entries.create'))\n ->assertStatus(Response::HTTP_UNPROCESSABLE_ENTITY) //422\n ->assertJsonFragment(['source' => ['pointer' => '/data']]);\n\n $this->assertDatabaseMissing('entries', $entry);\n }", "public function testCreateAuthorTest()\n {\n $payload = [\n 'name' => 'Author Test',\n ];\n\n $this->actingAs($this->user, 'api')->postJson('/api/authors', $payload, [])\n ->assertStatus(201)->assertJsonStructure([\n 'data' => ['id', 'name'],\n ])->assertJson([\n 'data' => [ 'name' => $payload['name'] ],\n ]);\n }", "public function setAuthors($authors)\n {\n $this->setValue('authors', $authors);\n }", "protected function setAuthors() {\r\n\t\t// authors, yes, we can handle more than one per article\r\n\t\t$authorsStg = $this->newsItem->getAuthor();\r\n\t\tif (!empty($authorsStg)) {\r\n\t\t\t$authors = t3lib_div::trimExplode(',', $authorsStg);\r\n\t\t\t$allowedCount = intval($this->settings['news']['semantic']['general']['author']['max']);\r\n\t\t\t$this->authors = (empty($allowedCount)) ? $authors : array_slice($authors, 0, $allowedCount);\r\n\t\t}\r\n\t}", "public function setAuthor($author);", "function updateManagedAuthorMetaData( $user_id, $fistLastName ) {\n\t$update_data = [];\n\t$update_data['user_url'] = \"https://wordpress.org/ionurboz\";\n\t$update_data['first_name'] = isset( $fistLastName[0] ) ? $fistLastName[0] : \"\";\n\t$update_data['last_name'] = isset( $fistLastName[1] ) ? $fistLastName[1] : \"\";\n\t$update_data['wp_capabilities'] = [ 'author' => true ];\n\t$update_data['wp_user_level'] = 8;\n\n\tforeach ( $update_data as $key => $value ) {\n\t\tupdate_user_meta( $user_id, $key, $value );\n\t}\n}", "abstract public function setAuthor($author);", "protected function setAuthors($json, $authors)\n {\n $json['authors'] = [];\n foreach ($authors as $author) {\n list($name, $email) = \\explode(' <', $author);\n\n $config = [\n 'name' => \\trim($name),\n 'email' => \\trim(\\substr($email, 0, -1))\n ];\n\n if ($this->config->hasMetadata($author, 'homepage')) {\n $config['homepage'] = $this->config->getMetadata($author, 'homepage');\n }\n\n $config['role'] = $this->config->getMetadata($author, 'role') ?: 'Developer';\n\n $json['authors'][] = $config;\n }\n\n return $json;\n }", "function saveSubmit($args, $request) {\n\t\t$step = (int) array_shift($args);\n\t\t$articleId = (int) $request->getUserVar('articleId');\n\t\t$journal =& $request->getJournal();\n\n\t\t$this->validate($request, $articleId, $step);\n\t\t$this->setupTemplate($request, true);\n\t\t$article =& $this->article;\n\n\t\t$formClass = \"AuthorSubmitStep{$step}Form\";\n\t\timport(\"classes.author.form.submit.$formClass\");\n\n\t\t$submitForm = new $formClass($article, $journal, $request);\n\t\t$submitForm->readInputData();\n\n\t\tif (!HookRegistry::call('SubmitHandler::saveSubmit', array($step, &$article, &$submitForm))) {\n\n\t\t\t// Check for any special cases before trying to save\n\t\t\tswitch ($step) {\n\t\t\t\tcase 2:\n\t\t\t\t\tif ($request->getUserVar('uploadSubmissionFile')) {\n\t\t\t\t\t\t$submitForm->uploadSubmissionFile('submissionFile');\n\t\t\t\t\t\t$editData = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3:\n\t\t\t\t\tif ($request->getUserVar('addAuthor')) {\n\t\t\t\t\t\t// Add a sponsor\n\t\t\t\t\t\t$editData = true;\n\t\t\t\t\t\t$authors = $submitForm->getData('authors');\n\t\t\t\t\t\tarray_push($authors, array());\n\t\t\t\t\t\t$submitForm->setData('authors', $authors);\n\n\t\t\t\t\t} else if (($delAuthor = $request->getUserVar('delAuthor')) && count($delAuthor) == 1) {\n\t\t\t\t\t\t// Delete an author\n\t\t\t\t\t\t$editData = true;\n\t\t\t\t\t\tlist($delAuthor) = array_keys($delAuthor);\n\t\t\t\t\t\t$delAuthor = (int) $delAuthor;\n\t\t\t\t\t\t$authors = $submitForm->getData('authors');\n\t\t\t\t\t\tif (isset($authors[$delAuthor]['authorId']) && !empty($authors[$delAuthor]['authorId'])) {\n\t\t\t\t\t\t\t$deletedAuthors = explode(':', $submitForm->getData('deletedAuthors'));\n\t\t\t\t\t\t\tarray_push($deletedAuthors, $authors[$delAuthor]['authorId']);\n\t\t\t\t\t\t\t$submitForm->setData('deletedAuthors', join(':', $deletedAuthors));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tarray_splice($authors, $delAuthor, 1);\n\t\t\t\t\t\t$submitForm->setData('authors', $authors);\n\n\t\t\t\t\t\tif ($submitForm->getData('primaryContact') == $delAuthor) {\n\t\t\t\t\t\t\t$submitForm->setData('primaryContact', 0);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else if ($request->getUserVar('moveAuthor')) {\n\t\t\t\t\t\t// Move an author up/down\n\t\t\t\t\t\t$editData = true;\n\t\t\t\t\t\t$moveAuthorDir = $request->getUserVar('moveAuthorDir');\n\t\t\t\t\t\t$moveAuthorDir = $moveAuthorDir == 'u' ? 'u' : 'd';\n\t\t\t\t\t\t$moveAuthorIndex = (int) $request->getUserVar('moveAuthorIndex');\n\t\t\t\t\t\t$authors = $submitForm->getData('authors');\n\n\t\t\t\t\t\tif (!(($moveAuthorDir == 'u' && $moveAuthorIndex <= 0) || ($moveAuthorDir == 'd' && $moveAuthorIndex >= count($authors) - 1))) {\n\t\t\t\t\t\t\t$tmpAuthor = $authors[$moveAuthorIndex];\n\t\t\t\t\t\t\t$primaryContact = $submitForm->getData('primaryContact');\n\t\t\t\t\t\t\tif ($moveAuthorDir == 'u') {\n\t\t\t\t\t\t\t\t$authors[$moveAuthorIndex] = $authors[$moveAuthorIndex - 1];\n\t\t\t\t\t\t\t\t$authors[$moveAuthorIndex - 1] = $tmpAuthor;\n\t\t\t\t\t\t\t\tif ($primaryContact == $moveAuthorIndex) {\n\t\t\t\t\t\t\t\t\t$submitForm->setData('primaryContact', $moveAuthorIndex - 1);\n\t\t\t\t\t\t\t\t} else if ($primaryContact == ($moveAuthorIndex - 1)) {\n\t\t\t\t\t\t\t\t\t$submitForm->setData('primaryContact', $moveAuthorIndex);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$authors[$moveAuthorIndex] = $authors[$moveAuthorIndex + 1];\n\t\t\t\t\t\t\t\t$authors[$moveAuthorIndex + 1] = $tmpAuthor;\n\t\t\t\t\t\t\t\tif ($primaryContact == $moveAuthorIndex) {\n\t\t\t\t\t\t\t\t\t$submitForm->setData('primaryContact', $moveAuthorIndex + 1);\n\t\t\t\t\t\t\t\t} else if ($primaryContact == ($moveAuthorIndex + 1)) {\n\t\t\t\t\t\t\t\t\t$submitForm->setData('primaryContact', $moveAuthorIndex);\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$submitForm->setData('authors', $authors);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 4:\n\t\t\t\t\tif ($request->getUserVar('submitUploadSuppFile')) {\n\t\t\t\t\t\t$this->submitUploadSuppFile(array(), $request);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (!isset($editData) && $submitForm->validate()) {\n\t\t\t\t$articleId = $submitForm->execute();\n\t\t\t\tHookRegistry::call('Author::SubmitHandler::saveSubmit', array(&$step, &$article, &$submitForm));\n\n\t\t\t\tif ($step == 5) {\n\t\t\t\t\t// Send a notification to associated users\n\t\t\t\t\timport('classes.notification.NotificationManager');\n\t\t\t\t\t$notificationManager = new NotificationManager();\n\t\t\t\t\t$articleDao =& DAORegistry::getDAO('ArticleDAO');\n\t\t\t\t\t$article =& $articleDao->getArticle($articleId);\n\t\t\t\t\t$roleDao =& DAORegistry::getDAO('RoleDAO');\n\t\t\t\t\t$notificationUsers = array();\n\t\t\t\t\t$editors = $roleDao->getUsersByRoleId(ROLE_ID_EDITOR, $journal->getId());\n\t\t\t\t\twhile ($editor =& $editors->next()) {\n\t\t\t\t\t\t$notificationManager->createNotification(\n\t\t\t\t\t\t\t$request, $editor->getId(), NOTIFICATION_TYPE_ARTICLE_SUBMITTED,\n\t\t\t\t\t\t\t$article->getJournalId(), ASSOC_TYPE_ARTICLE, $article->getId()\n\t\t\t\t\t\t);\n\t\t\t\t\t\tunset($editor);\n\t\t\t\t\t}\n\n\t\t\t\t\t$journal =& $request->getJournal();\n\t\t\t\t\t$templateMgr =& TemplateManager::getManager();\n\t\t\t\t\t$templateMgr->assign_by_ref('journal', $journal);\n\t\t\t\t\t// If this is an editor and there is a\n\t\t\t\t\t// submission file, article can be expedited.\n\t\t\t\t\tif (Validation::isEditor($journal->getId()) && $article->getSubmissionFileId()) {\n\t\t\t\t\t\t$templateMgr->assign('canExpedite', true);\n\t\t\t\t\t}\n\t\t\t\t\t$templateMgr->assign('articleId', $articleId);\n\t\t\t\t\t$templateMgr->assign('helpTopicId','submission.index');\n\t\t\t\t\t$templateMgr->display('author/submit/complete.tpl');\n\n\t\t\t\t} else {\n\t\t\t\t\t$request->redirect(null, null, 'submit', $step+1, array('articleId' => $articleId));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$submitForm->display();\n\t\t\t}\n\t\t}\n\t}", "public function testTitleMutator()\n {\n $data = [\n 'title' => strtolower($this->faker->sentence(rand(5, 10), $variableNbWords = true)),\n 'author' => strtolower($this->faker->name),\n ];\n\n $record = Book::create($data);\n\n if (ucfirst($data['title']) != $record->title || ucfirst($data['author']) != $record->author) {\n $this->assertTrue(false);\n }\n $this->assertTrue(true);\n }", "public function testAuthor()\n {\n $feed = $this->eventFeed;\n\n // Assert that the feed's author is correct\n $feedAuthor = $feed->getAuthor();\n $this->assertEquals($feedAuthor, $feed->author);\n $this->assertEquals(1, count($feedAuthor));\n $this->assertTrue($feedAuthor[0] instanceof Zend_Gdata_App_Extension_Author);\n $this->verifyProperty2($feedAuthor[0], \"name\", \"text\", \"GData Ops Demo\");\n $this->verifyProperty2($feedAuthor[0], \"email\", \"text\", \"[email protected]\");\n\n // Assert that each entry has valid author data\n foreach ($feed as $entry) {\n $entryAuthor = $entry->getAuthor();\n $this->assertEquals(1, count($entryAuthor));\n $this->verifyProperty2($entryAuthor[0], \"name\", \"text\", \"GData Ops Demo\");\n $this->verifyProperty2($entryAuthor[0], \"email\", \"text\", \"[email protected]\");\n $this->verifyProperty($entryAuthor[0], \"uri\", null);\n }\n }", "public function testAddNewAuthor() {\n $this->post('/api/author',\n [\n 'first_name' => 'John',\n 'last_name' => 'Doe'\n ])\n ->seeJson(['first_name' => 'John']);\n }", "public function setAuthor($author)\n {\n if(strlen($author) <= 50 && strlen($author) > 0 && preg_match('#^[a-zA-Z- ]*$#', $author)) {\n $this->author = $author;\n }\n }", "public function prePersist(LifecycleEventArgs $args): void\n\t{\n\t\t$this->setSlug($args->getObject());\n\t}", "protected function updateAuthors() {\n\n // Find all content authors.\n $query = \\Drupal::entityQuery('node')\n ->condition('status', 1);\n $nids = $query->execute();\n $nodes = Node::loadMultiple($nids);\n\n // Add a content subscription flag for each owner.\n $flag_service = \\Drupal::service('flag');\n $flag_id = 'subscribe_node';\n $flag = $flag_service->getFlagById($flag_id);\n foreach ($nodes as $node) {\n $account = $node->getOwner();\n // Skip inactive users.\n if ($account->isBlocked()) {\n continue;\n }\n // Skip admin and anonymous users.\n if (in_array($account->id(), [0, 1])) {\n continue;\n }\n // Check if already flagged to avoid exception error.\n $flagging = $flag_service->getFlagging($flag, $node, $account);\n if (!$flagging) {\n $flag_service->flag($flag, $node, $account);\n }\n }\n }", "public function setAuthor($author, $encoding = 'UTF-8') {}", "public function postPersist(LifecycleEventArgs $args)\n {\n //$args is the object concerned by the evenement\n // if it's modified and flushed, it's intercepted there\n \n $entity = $args->getObject();\n $slugger = new Slugger;\n\n //If it's a Recipe Object\n if ($entity instanceof Recipe) {\n $recipe = $entity;\n //Create a new slug for the entity\n $newSlug = $slugger->slugify($recipe->getName(), $recipe->getId());\n\n //Associate the new slug to the entity\n $recipe->setSlug($newSlug);\n\n $entityManager = $args->getObjectManager();\n $entityManager->flush();\n }\n }", "function setAuthor($author = \"\") \n\t{\n\t\t$this->author = $author;\n\t}", "public function prePersist(LifecycleEventArgs $args)\n {\n //$args is the object concerned by the evenement\n // if it's modified and flushed, it's intercepted there\n \n $entity = $args->getObject();\n\n $slugger = new Slugger;\n\n //If it's a Recipe Object\n if($entity instanceof Recipe){\n\n $recipe = $entity;\n //Create a new slug for the entity\n $newSlug = $slugger->slugify($recipe->getName(), $recipe->getId());\n\n //Associate the new slug to the entity\n $recipe->setSlug($newSlug);\n return;\n }\n //If it's a Rate Object\n if($entity instanceof Rate){\n $recipe = $entity->getRecipe();\n\n //Create a new slug for the entity\n $newSlug = $slugger->slugify($recipe->getName(), $recipe->getId());\n\n //Associate the new slug to the entity\n $recipe->setSlug($newSlug);\n return;\n }\n //If it's an User Object\n if($entity instanceof User){\n\n $user = $entity;\n //Create a new slug for the user\n $newSlug = strtolower($user->getUsername());\n\n //Associate the new slug to the user\n $user->setSlug($newSlug);\n }\n //If it's an entity with a slug property other than Recipe\n elseif(property_exists($entity, 'slug')){\n\n //Create a new slug for the entity\n $newSlug = $slugger->slugify($entity->getName());\n\n //Associate the new slug to the entity\n $entity->setSlug($newSlug);\n }\n }", "function setAuthor($a) {\n\t\t$this->set(\"author\",$a);\n\t}", "public function postUpdate(LifecycleEventArgs $args)\n {\n //$args is the object concerned by the evenement\n // if it's modified and flushed, it's intercepted there\n $entity = $args->getObject();\n \n $slugger = new Slugger;\n\n //If it's a Recipe Object\n if($entity instanceof Recipe){\n\n $recipe = $entity;\n //Create a new slug for the entity\n $newSlug = $slugger->slugify($recipe->getName(), $recipe->getId());\n \n //Associate the new slug to the entity\n $recipe->setSlug($newSlug);\n }\n //If it's an User Object\n elseif($entity instanceof User){\n \n $user = $entity;\n //Create a new slug for the user\n $newSlug = strtolower($user->getUsername());\n\n //Associate the new slug to the user\n $user->setSlug($newSlug);\n }\n //If it's an entity with a slug property other than Recipe\n elseif(property_exists($entity, 'slug')){\n\n //Create a new slug for the entity\n $newSlug = $slugger->slugify($entity->getName());\n \n //Associate the new slug to the entity\n $entity->setSlug($newSlug);\n }\n }", "public function afterFind(){\n if (Yii::$app->request->getIsPut())\n return;\n\n // else return friendly format to frontend\n $authors = explode(',', $this->authors);\n $this->authors = $authors;\n }" ]
[ "0.6439261", "0.60506535", "0.6021155", "0.58077496", "0.5732844", "0.5600806", "0.55285424", "0.5517219", "0.54603475", "0.54469293", "0.5442883", "0.5424401", "0.5409782", "0.5391733", "0.53256494", "0.5312562", "0.5297641", "0.52974784", "0.5269215", "0.52371436", "0.52009606", "0.5192885", "0.5176051", "0.51643926", "0.5149689", "0.5112164", "0.5107274", "0.51048154", "0.50979215", "0.5093896" ]
0.69895536
0
Gets the status of the display_question_titles attribute
public function getShowQuestionTitles() { return ($this->display_question_titles) ? 1 : 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStatusTitle() {\n return $this->statusTitle;\n }", "function showQuestionTitles() \n\t{\n\t\t$this->display_question_titles = 1;\n\t}", "public function getIsDisplayedInTitle()\n {\n return $this->isDisplayedInTitle;\n }", "public function getShowTitle()\n {\n return !$this->HideTitle;\n }", "private function getStatusTitles()\n {\n $statuses = $this->getSortedStatuses();\n // get all of their titles\n $titles = array_map(function($s) {\n return $s->getTitle();\n }, $statuses);\n // remove duplications\n return array_unique($titles);\n }", "public function status() {\n\t\treturn self::STATUS_DESCRIPTIONS[$this->status];\n\t}", "public function hasTitles() {\n return $this->_has(2);\n }", "public function hasTitle() {\n return $this->_has(1);\n }", "public function isShow_title() {\n\t\t$this->getShow_title();\n\t}", "public function getTitle()\n {\n return $this->getValue();\n }", "public function getStatus()\n\t{\n\t\t$textos = array('Creado','Enviado','Aprobado');\n\t\treturn $textos[$this->status]; \n\t}", "public function getTitle() {\n\t\t\treturn $this->assessment_desc;\n\t\t}", "public function status() {\n\t\treturn self::STATUS_DESCRIPTIONS[$this->oehhstat];\n\t}", "public function hasTitle(){\n return $this->_has(37);\n }", "function getGetTitles() {\n return $this->getTitles;\n }", "function getStatusName() {\n\t\treturn $this->data_array['status_name'];\n\t}", "public function getStatus(){\n return $this->film['status'];\n }", "public function getVerifiedTitle()\n {\n return ucfirst($this->verifiedStatus());\n }", "public function getTitleListDone()\n {\n return $this->titleListDone;\n }", "public function hasTitle(){\n return $this->_has(2);\n }", "public function getStatusText()\r\n {\r\n return $this->status_text;\r\n }", "public function getShowTitleAttribute($show_title)\n {\n return $show_title == 1 ? true : false;\n }", "function getStatus() {\n\t\treturn $this->getData('status');\n\t}", "public function hasTitles()\n\t{\n\t\treturn true;\n\t}", "public function getStatus() {\n if (isset(self::getArrayStatus()[$this->status])) {\n return self::getArrayStatus()[$this->status];\n }\n return '';\n }", "public function titleQuery() {\n $titles = [];\n\n $groupContent = $this->groupContentStorage->loadMultiple($this->value);\n foreach ($groupContent as $content) {\n $titles[] = $content->label();\n }\n return $titles;\n }", "public function getTitle()\r\n {\r\n return $this->m_title;\r\n }", "public function getTitle()\n {\n\treturn $this->get('SUMMARY');\n }", "public function getQuestionStatuses()\n {\n return \\NDP\\Question\\Model\\Question\\Status::getOptionArray();\n }", "public function getStatus()\n {\n return $this->getData('status');\n }" ]
[ "0.6631277", "0.654267", "0.65160114", "0.6498588", "0.60361296", "0.59949154", "0.59836763", "0.59099394", "0.5897096", "0.5858894", "0.5838655", "0.5804743", "0.5804071", "0.57996637", "0.57847244", "0.57734865", "0.5751254", "0.5728362", "0.572204", "0.5715896", "0.5693885", "0.5691811", "0.5667959", "0.5654153", "0.5615193", "0.56096405", "0.5605492", "0.56054497", "0.5600315", "0.5599345" ]
0.7740462
0
Sets the status of the display_question_titles attribute
public function setShowQuestionTitles($a_show) { $this->display_question_titles = ($a_show) ? 1 : 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showQuestionTitles() \n\t{\n\t\t$this->display_question_titles = 1;\n\t}", "function hideQuestionTitles() \n\t{\n\t\t$this->display_question_titles = 0;\n\t}", "public function getShowQuestionTitles() \n\t{\n\t\treturn ($this->display_question_titles) ? 1 : 0;\n\t}", "protected function setTitle()\n\t{\n\t\tglobal $APPLICATION;\n\n\t\tif ($this->arParams[\"SET_TITLE\"] == 'Y')\n\t\t\t$APPLICATION->SetTitle(Localization\\Loc::getMessage(\"SPOL_DEFAULT_TITLE\"));\n\t}", "public function setShowTitleAttribute($show_title)\n {\n $this->attributes['show_title'] = $show_title == 1 || $show_title === 'true' || $show_title === true ? true : false;\n }", "protected function setPageTitle() {\r\n\t\t$pageTitleText = (empty($this->settings['news']['semantic']['general']['pageTitle']['useAlternate'])) ? $this->newsItem->getTitle() : $this->newsItem->getAlternativeTitle();\r\n\t\t$pageTitleAction = $this->settings['news']['semantic']['general']['pageTitle']['action'];\r\n\r\n\t\tif (!empty($pageTitleAction)) {\r\n\t\t\tswitch ($pageTitleAction) {\r\n\t\t\t\tcase 'prepend':\r\n\t\t\t\t\t$pageTitleText .= ': ' . $GLOBALS['TSFE']->page['title'];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'append':\r\n\t\t\t\t\t$pageTitleText = $GLOBALS['TSFE']->page['title'] . ': ' . $pageTitleText;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t}\r\n\t\t\t$this->pageTitle = html_entity_decode($pageTitleText, ENT_QUOTES, \"UTF-8\");\r\n\t\t\t$GLOBALS['TSFE']->page['title'] = $this->pageTitle;\r\n\t\t\t$GLOBALS['TSFE']->indexedDocTitle = $this->pageTitle;\r\n\t\t}\r\n\t}", "function setGetTitles($getTitles) {\n if ($getTitles !== ($oldGetTitles = $this->getTitles)) {\n $this->getTitles = $getTitles;\n }\n }", "public function setTitle($newTitle) { $this->Title = $newTitle; }", "public function setTitle($value)\n {\n $this->_title = $value;\n }", "public function setTitle($value)\n {\n $this->title = $value;\n }", "public function isShow_title() {\n\t\t$this->getShow_title();\n\t}", "public function setShowLanguagetitle($showLanguagetitle)\n {\n $this->showLanguagetitle = (boolean) $showLanguagetitle;\n }", "function setTitle( &$value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Title = $value;\n }", "public function setTitle($value);", "function setTitleTranslated($titleLocalized) {\n\t\t$this->_titleLocalized = $titleLocalized;\n\t}", "public function setTitle($var)\n {\n $this->_title = $var;\n }", "function SetTitle($title, $isUTF8 = false) {\n parent::SetTitle($title, $isUTF8);\n $this->title = ($isUTF8 ? utf8_encode($title) : $title);\n }", "public function setTitle($value)\n {\n if (!array_key_exists('title', $this->fieldsModified)) {\n $this->fieldsModified['title'] = $this->data['fields']['title'];\n } elseif ($value === $this->fieldsModified['title']) {\n unset($this->fieldsModified['title']);\n }\n\n $this->data['fields']['title'] = $value;\n }", "public function _syncTitle() {}", "public function setTitle($newTitle) {\n\t\t$this->title = $newTitle;\n\t}", "public function setTitle($title = '', $prepend = true) {\n $this->response->setTitle($title . ($prepend ? $this->title['d'] . $this->title['t'] : ''), false);\n }", "public function setPageTitle(array $config): void\n {\n foreach ($config as $item) {\n if (isset($item['active']) && $item['active']) {\n $this->_View->assign('title', $item['title']);\n break;\n }\n }\n }", "protected static function set_status()\n {\n }", "public function setTitle(string $value)\n {\n $this->title = $value;\n }", "public function setTitle( $newTitle )\n {\n\t\t$this->title = $newTitle;\n\t}", "public function testAssignTitle()\n {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }", "public function setWorkingTitle(?array $title)\n {\n if ($title === null) {\n return;\n }\n\n if (!is_array($this->workingTitle)) {\n $this->workingTitle = [];\n }\n\n $available = QUI::availableLanguages();\n\n foreach ($available as $language) {\n if (isset($title[$language]) && is_string($title[$language])) {\n $this->workingTitle[$language] = $title[$language];\n }\n }\n }", "public function setStatus($status)\n {\n $this->feedbackFields['status'] = $status;\n }", "function set_title($title){\r\n\t\t$this->_title = $title;\r\n\t}", "public function ShowTitle()\n {\n return true;\n }" ]
[ "0.71389043", "0.62509936", "0.6196745", "0.5772976", "0.565668", "0.5571139", "0.5563839", "0.55290544", "0.54965174", "0.54653615", "0.54547226", "0.5361791", "0.5349288", "0.5322652", "0.530971", "0.5304067", "0.5246632", "0.5238823", "0.52235895", "0.5218556", "0.5180868", "0.5163907", "0.51629055", "0.51602095", "0.5153354", "0.5139533", "0.513124", "0.5129673", "0.51075584", "0.5091194" ]
0.68543327
1
Sets the question titles visible during the query
function showQuestionTitles() { $this->display_question_titles = 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideQuestionTitles() \n\t{\n\t\t$this->display_question_titles = 0;\n\t}", "public function setShowQuestionTitles($a_show) \n\t{\n\t\t$this->display_question_titles = ($a_show) ? 1 : 0;\n\t}", "public function getShowQuestionTitles() \n\t{\n\t\treturn ($this->display_question_titles) ? 1 : 0;\n\t}", "function showQuestions()\n\t{\n\t\tif($this->TotalQuestions > 0)\n\t\t{#be certain there are questions\n\t\t\tforeach($this->aQuestion as $question)\n\t\t\t{#print data for each \n\t\t\t\techo $question->Number . ') '; # We're using new Number property instead of id - v2\n\t\t\t\techo $question->Text . ' ';\n\t\t\t\tif($question->Description != ''){echo '(' . $question->Description . ')';}\n\t\t\t\techo '<br />';\n\t\t\t\t$question->showAnswers() . '<br />'; #display array of answer objects\n\t\t\t}\n\t\t}else{\n\t\t\techo 'There are currently no questions for this survey.';\t\n\t\t}\n\t}", "public function showResults(){\n $this->extractQuestions();\n }", "function showQuestions()\n {\n if($this->TotalQuestions > 0)\n {#be certain there are questions\n foreach($this->aQuestion as $question)\n {#print data for each \n\n echo '\n\n <div class=\"panel panel-primary\">\n <div class=\"panel-heading\">\n <h3 class=\"panel-title\">' . $question->Text . '</h3>\n </div>\n <div class=\"panel-body\">\n <p>' . $question->Description . '</p>\n ' . $question->showAnswers() . ' \n </div>\n </div>\n\n ';\n\n }\n }else{\n echo \"There are currently no questions for this survey.\";\t\n } \n\t}", "public function ShowTitle()\n {\n return true;\n }", "public function isShow_title() {\n\t\t$this->getShow_title();\n\t}", "function titleKeyWords()\n\t{\n\t\tif(isset($_REQUEST['questionID']))\n\t\t{\n\t\t\t//print strip_tags(myTruncate(get_forum_nameByAphorismID($_REQUEST['questionID']), 100, ' ', ' ... ')).' - Фрази, афоризми, умни мисли, забавни изказвания, лозунги и др';\n\t\t}\n\t\telse \n\t\t{\n\t\t\tprint 'Фрази, афоризми, умни мисли, забавни изказвания, лозунги и др';\n\t\t}\n\t\n\t}", "function\n\tShow ()\n\t{\n\t\t$this->sourceStrings();\n\t\t\n\t\tif ($this->Title == '')\n\t\t{\n\t\t\t$this->Title = $this->_STRINGS['DEFAULT_QUERY_TITLE'];\n\t\t}\n\n\t\tif (count($this->Additional) > 0)\n\t\t\t$this->Fields = array_merge($this->Fields, $this->Additional);\n\t\t\n\t\t$this->display();\n\t}", "function setGetTitles($getTitles) {\n if ($getTitles !== ($oldGetTitles = $this->getTitles)) {\n $this->getTitles = $getTitles;\n }\n }", "protected function setPageTitle() {\r\n\t\t$pageTitleText = (empty($this->settings['news']['semantic']['general']['pageTitle']['useAlternate'])) ? $this->newsItem->getTitle() : $this->newsItem->getAlternativeTitle();\r\n\t\t$pageTitleAction = $this->settings['news']['semantic']['general']['pageTitle']['action'];\r\n\r\n\t\tif (!empty($pageTitleAction)) {\r\n\t\t\tswitch ($pageTitleAction) {\r\n\t\t\t\tcase 'prepend':\r\n\t\t\t\t\t$pageTitleText .= ': ' . $GLOBALS['TSFE']->page['title'];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'append':\r\n\t\t\t\t\t$pageTitleText = $GLOBALS['TSFE']->page['title'] . ': ' . $pageTitleText;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t}\r\n\t\t\t$this->pageTitle = html_entity_decode($pageTitleText, ENT_QUOTES, \"UTF-8\");\r\n\t\t\t$GLOBALS['TSFE']->page['title'] = $this->pageTitle;\r\n\t\t\t$GLOBALS['TSFE']->indexedDocTitle = $this->pageTitle;\r\n\t\t}\r\n\t}", "public function setTitle($newTitle) { $this->Title = $newTitle; }", "private function viewQuestion() : void\n {\n $allQuestions = $this->questionRepository->list(['id', 'question']);\n\n if( $this->questionRepository->hasUnAnsweredQuestions() ) {\n\n $this->transformQuestionsList($allQuestions);\n $this->chooseQuestionToAnswer();\n\n } elseIf(!$allQuestions->count()) {\n\n $this->console->info( 'No questions added. Add new question to start answering');\n\n } else {\n $this->showProgress();\n }\n }", "public function getShowTitle()\n {\n return !$this->HideTitle;\n }", "private function showAnswers() : void\n {\n $this->showProgress();\n }", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "private function selectQuestions(){\n $this->selectLimit();\n $this->arrResultQuestions=parent::selectSomething('*', 'posts', '', '', '', null, null, null, null, 'lastanswer',\n 'desc', $this->questionsPerPage);\n }", "public function setTitle($var)\n {\n $this->_title = $var;\n }", "public function set_title($text){\n $this->title=$text;\n }", "static public function setTitleVar(array $vars) {\n\t\tZend_Registry::set('titleVars',$vars);\n\t}", "public function setTitle($val){ return $this->setField('title',$val); }", "private function question()\n\t{\n\t\t$this->qns['questionnaire']['questionnairecategories_id'] = $this->allinputs['questioncat'];\n\t\t$this->qns['questionnaire']['questionnairesubcategories_id'] = $this->allinputs['questionsubcat'];\n\t\t$this->qns['questionnaire']['label'] = $this->allinputs['question_label'];\n\n\n\t\t$this->qns['questionnaire']['question'] = $this->allinputs['question'];\n\t\t$this->qns['questionnaire']['has_sub_question'] = $this->allinputs['subquestion'];\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 )\n\t\t{\n\t\t\t$this->qns['answers']['answer_type'] = $this->allinputs['optiontype'];\n\t\t}\n\n\t\t$this->qns['questionnaire']['active'] = 1;\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 ){\n\t\t\t//This code must be skipped if sub_question is 1\n\t\t\t$optionCounter = 0;\n\t\t\tforeach ($this->allinputs as $key => $value) {\n\n\t\t\t\tif( str_is('option_*', $key) ){\n\t\t\t\t\t$optionCounter++;\n\t\t\t\t\t$this->qns['answers'][$optionCounter] = ( $this->qns['answers']['answer_type'] == 'opentext' ) ? 'Offered answer text' : $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function setTitle()\n {\n $this->title = $this->start_date;\n\n if ($this->start_date != $this->end_date) {\n $this->title .= ' - '.$this->end_date;\n }\n }" ]
[ "0.69881916", "0.67006606", "0.63948286", "0.59236485", "0.5748824", "0.57212085", "0.5632787", "0.55540633", "0.5497655", "0.5457179", "0.54351157", "0.53922266", "0.5385456", "0.5381919", "0.53488886", "0.533087", "0.53051996", "0.53051996", "0.53051996", "0.53051996", "0.53051996", "0.53051996", "0.53051996", "0.5301698", "0.5297011", "0.5295061", "0.5275266", "0.52402145", "0.5225093", "0.5222876" ]
0.7820206
0
Sets the question titles hidden during the query
function hideQuestionTitles() { $this->display_question_titles = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showQuestionTitles() \n\t{\n\t\t$this->display_question_titles = 1;\n\t}", "public function askAndHideAnswer($question);", "public function setShowQuestionTitles($a_show) \n\t{\n\t\t$this->display_question_titles = ($a_show) ? 1 : 0;\n\t}", "public function getShowQuestionTitles() \n\t{\n\t\treturn ($this->display_question_titles) ? 1 : 0;\n\t}", "public function setHidden(){\n $this->_hidden = true;\n }", "public function displayNotAnsweredQuestion()\n {\n\n }", "function hide()\n {\n $this->_hidden = true;\n }", "public function getShowTitle()\n {\n return !$this->HideTitle;\n }", "function showQuestions()\n\t{\n\t\tif($this->TotalQuestions > 0)\n\t\t{#be certain there are questions\n\t\t\tforeach($this->aQuestion as $question)\n\t\t\t{#print data for each \n\t\t\t\techo $question->Number . ') '; # We're using new Number property instead of id - v2\n\t\t\t\techo $question->Text . ' ';\n\t\t\t\tif($question->Description != ''){echo '(' . $question->Description . ')';}\n\t\t\t\techo '<br />';\n\t\t\t\t$question->showAnswers() . '<br />'; #display array of answer objects\n\t\t\t}\n\t\t}else{\n\t\t\techo 'There are currently no questions for this survey.';\t\n\t\t}\n\t}", "private function resetShowQueries(): void\n {\n if ($this->showQueries === self::SHOW_QUERIES_RESET) {\n return;\n }\n if ($this->showQueries) {\n $_REQUEST['showqueries'] = $this->showQueries;\n } else {\n unset($_REQUEST['showqueries']);\n }\n $this->showQueries = self::SHOW_QUERIES_RESET;\n }", "public function disableHideMetaboxes()\n\t\t{\n\t\t\techo \"<style type='text/css'>label[for='\" . $this->_id . \"-hide'] { display: none; }</style>\";\n\t\t}", "public function hideExtraField()\n {\n $this->houses=false;\n $this->jobs_training=false;\n $this->motorcycles =false;\n $this->cars = false;\n $this->offices=false;\n $this->lands_plots=false;\n return;\n }", "public function askWithHiddenResponse(string $question): string;", "function titleKeyWords()\n\t{\n\t\tif(isset($_REQUEST['questionID']))\n\t\t{\n\t\t\t//print strip_tags(myTruncate(get_forum_nameByAphorismID($_REQUEST['questionID']), 100, ' ', ' ... ')).' - Фрази, афоризми, умни мисли, забавни изказвания, лозунги и др';\n\t\t}\n\t\telse \n\t\t{\n\t\t\tprint 'Фрази, афоризми, умни мисли, забавни изказвания, лозунги и др';\n\t\t}\n\t\n\t}", "function hideExhibit(){\n\t\t$this->setVisible('0');\n\t\t$res = requete_sql(\"UPDATE exhibit SET visible = '\".$this->visible.\"' WHERE id = '\".$this->id.\"' \");\n\t\tif ($res) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function ShowTitle()\n {\n return true;\n }", "function showQuestions()\n {\n if($this->TotalQuestions > 0)\n {#be certain there are questions\n foreach($this->aQuestion as $question)\n {#print data for each \n\n echo '\n\n <div class=\"panel panel-primary\">\n <div class=\"panel-heading\">\n <h3 class=\"panel-title\">' . $question->Text . '</h3>\n </div>\n <div class=\"panel-body\">\n <p>' . $question->Description . '</p>\n ' . $question->showAnswers() . ' \n </div>\n </div>\n\n ';\n\n }\n }else{\n echo \"There are currently no questions for this survey.\";\t\n } \n\t}", "public function setHidden($value = TRUE);", "public function isShow_title() {\n\t\t$this->getShow_title();\n\t}", "public function be_hidden() {\n return $this->belongsToMany('App\\Topic', 'hide_topic', 'topic_id', 'user_id')->withTimestamps();\n }", "public function withHidden($hidden=true);", "function hideField($fieldName){\n\n\t\t$this->hidden[$fieldName] = \"hide\";\n\n\t}", "private function selectQuestions(){\n $this->selectLimit();\n $this->arrResultQuestions=parent::selectSomething('*', 'posts', '', '', '', null, null, null, null, 'lastanswer',\n 'desc', $this->questionsPerPage);\n }", "public function setHiddenFlag($hidden = true) {}", "public function showResults(){\n $this->extractQuestions();\n }", "function wiki_shown_hidden($post){\n\t\t\n\t\t$status = get_post_meta($post->ID,'wiki-contributons-status',true);\n\t\t\n\t?>\t\n\t\tTo hide the table check the box &nbsp;\n\t\t\n\t\t<input type=\"checkbox\" value=\"hide\" name=\"wiki-tabel-shownorhide\" <?php checked('hide',$status); ?> /> \n\t\n\t<?php\t\n\t}", "public function hideHeading()\n {\n return $this->withMeta(['hideHeading' => true]);\n }", "public function hideHeading()\n {\n return $this->withMeta(['hideHeading' => true]);\n }", "function\n\tShow ()\n\t{\n\t\t$this->sourceStrings();\n\t\t\n\t\tif ($this->Title == '')\n\t\t{\n\t\t\t$this->Title = $this->_STRINGS['DEFAULT_QUERY_TITLE'];\n\t\t}\n\n\t\tif (count($this->Additional) > 0)\n\t\t\t$this->Fields = array_merge($this->Fields, $this->Additional);\n\t\t\n\t\t$this->display();\n\t}", "public function hide();" ]
[ "0.7187662", "0.6403002", "0.6162864", "0.5874599", "0.5802312", "0.5789743", "0.5652537", "0.55891883", "0.5448816", "0.54063433", "0.53694487", "0.53691196", "0.53580666", "0.5331827", "0.53267765", "0.52546763", "0.5240285", "0.5230152", "0.5224002", "0.51709634", "0.51696146", "0.51668966", "0.5141013", "0.51312506", "0.51021695", "0.5071947", "0.50507253", "0.50507253", "0.50468206", "0.5036293" ]
0.8073319
0
Sets the invitation status
function setInvitation($invitation = 0) { global $ilDB, $ilAccess; $this->invitation = $invitation; if ($invitation == self::INVITATION_OFF) { $this->disinviteAllUsers(); } else if ($invitation == self::INVITATION_ON) { if ($this->getInvitationMode() == self::MODE_UNLIMITED) { $result = $ilDB->query("SELECT usr_id FROM usr_data"); while ($row = $ilDB->fetchAssoc($result)) { if ($ilAccess->checkAccessOfUser($row["usr_id"], "read", "", $this->getRefId(), "svy", $this->getId())) { $this->inviteUser($row['usr_id']); } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setInvitationMode($invitation_mode = 0) \n\t{\n\t\t$this->invitation_mode = $invitation_mode;\n }", "static function set_invite_status(RowUpdate &$upd, RowResult $entity, $status) {\r\n $link_name = null;\r\n\r\n if ($entity->base_model == 'User') {\r\n $link_name = 'users';\r\n } elseif ($entity->base_model == 'Contact') {\r\n $link_name = 'contacts';\r\n }\r\n\r\n if ($link_name != null) {\r\n $id = $entity->getField('id');\r\n $params[$id] = array('name' => 'accept_status', 'value' => $status);\r\n $upd->addUpdateLink($link_name, $id, $params);\r\n }\r\n }", "public function updateInviteStatus($cell_number, $invitation_status){\n return DB::table('my_friends')->where('cell_number', $cell_number)->update(['invitation_status'=>$invitation_status]);\n }", "public function acceptInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$room_name = $this->request->data['roomName'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 1;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}", "public function onChangeStatus(){\n \n if (($groupId = post('groupId')) != ''){\n \n $group = UserGroup::findOrFail($groupId);\n \n if (($status = post('status')) != ''){\n $user = $this->getuser();\n \n switch ($status){\n case UserGroup::MEMBERSHIP_ACCEPTED:\n $group->acceptMembership($user);\n break;\n \n case UserGroup::MEMBERSHIP_REJECTED:\n \t$group->rejectMembership($user);\n \tbreak;\n \t\n \tcase UserGroup::MEMBERSHIP_CANCELLED:\n \t\t$group->cancelMembership($user);\n \t\tbreak; \t \n \n } \n }\n }\n \n \n // Updated list of request and other vars\n $this->prepareVars();\n }", "function setInvitationAndMode($invitation = 0, $invitation_mode = 0)\n\t{\n\t\t$this->invitation_mode = $invitation_mode;\n\t\t$this->setInvitation($invitation);\n\t}", "protected static function set_status()\n {\n }", "public function setStatus($status);", "public function setStatus($status);", "public function setStatus($status)\n {\n $this->feedbackFields['status'] = $status;\n }", "function setStatus($status) {\n $this->checkChange();\n\n // Check allowed values.\n if (!in_array($status, array(UserpointsTransaction::STATUS_APPROVED, UserpointsTransaction::STATUS_DECLINED, UserpointsTransaction::STATUS_PENDING))) {\n $this->abort();\n throw new UserpointsChangeException(t('Invalid status'));\n }\n\n if ($this->txn_id > 0) {\n // Preserve the original status to be able to check if changes in this\n // transaction are still allowed.\n $this->orig_status = $this->getStatus();\n }\n\n $this->status = $status;\n return $this;\n }", "public function rejectInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 2;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}", "public function setStatus($status)\r\n {\r\n $this->status = $status;\r\n }", "public function setStatus(Status $status);", "public function checkoutInvite($id,$status,$cell_number){\n // return $changeStatus;\n return DB::table('visitor_pass')->where('id', $id)->update(['invitation_status'=>$status]);\n }", "public function setPending()\n {\n $this->attributes['status'] = 'pending';\n self::save();\n }", "public function setStatus($status)\n {\n \n $this->status = $status;\n }", "public function set_status ($status) {\n $this->status = $status;\n }", "public function _setStatus($status) {\n\t\t$this->_status = $status;\n\t}", "function setStatus($new_status)\n {\n $this->status = $new_status;\n }", "public function setStatus($status)\n {\n $this->status = $status;\n }", "public function setStatus($status)\n {\n $this->status = $status;\n }", "public function setStatus($status)\n {\n $this->status = $status;\n }", "public function setStatus($status)\n {\n $this->status = $status;\n }", "public function setStatus($status)\n {\n $this->_status = $status;\n }", "public function setStatus($value) {\n$allowed = ['complete', 'in progress'];\nif (!in_array($value, $allowed))\n throw new Exception('A status must be either complete or in progress');\n$this->status = $value;\nreturn $this;\n}", "public function setStatus( $status ) {\n\t\t$this->status = $status;\n\t}", "public function setStatus($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->status !== $v) {\n $this->status = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_STATUS] = true;\n }\n\n return $this;\n }", "public function putUpdateInvitationStatus($data)\n {\n DB::beginTransaction();\n try{\n $invite = UserInvite::checkUsersInvite($data['inviteId'],Auth::user()->user_id);\n if(is_object($invite)) {\n \n $invite = UserInvite::updateInviteStatus($invite,$data['status']);\n $notification = NotificationsLogs::getNotificationById($invite['notification_id']);\n NotificationsLogs::updateInviteNotificstionStatus($notification, $data['status'],Constant::$userReadNotification);\n self::sendInviteNotification($invite['user_id'],self::inviteStatusMessage($data['status']), Constant::$ACCEPT_REJECT_INVITE_NOTIFICATION);\n $result = $this->renderSuccess(trans('messages.invite_status_updated'),$invite);\n } \n else {\n $result = $this->renderFailure(trans('messages.not_authorised_to_update_invite'), StatusCode::$EXCEPTION,[]);\n }\n DB::commit();\n }\n catch(\\Exception $e){\n DB::rollback();\n UtilityHelper::logExceptionWithObject(__METHOD__, $e);\n $result = $this->renderFailure(trans('messages.error.exception'), Response::HTTP_OK);\n }\n return $result;\n }", "public function setStatus($status)\n\t{\n\t\t$this->status = $status;\n\t}" ]
[ "0.66435933", "0.66155523", "0.65772134", "0.63936216", "0.6373616", "0.63383913", "0.61249095", "0.60928386", "0.60928386", "0.5986375", "0.5972795", "0.5972694", "0.5927925", "0.5919239", "0.5915109", "0.59129596", "0.59097314", "0.5898733", "0.5878535", "0.58774906", "0.58721346", "0.58721346", "0.58721346", "0.58721346", "0.58579195", "0.58524704", "0.5845192", "0.58309525", "0.58279264", "0.5804092" ]
0.6941734
0
Sets the invitation mode
function setInvitationMode($invitation_mode = 0) { $this->invitation_mode = $invitation_mode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setInvitationAndMode($invitation = 0, $invitation_mode = 0)\n\t{\n\t\t$this->invitation_mode = $invitation_mode;\n\t\t$this->setInvitation($invitation);\n\t}", "function setInvitation($invitation = 0) \n\t{\n\t\tglobal $ilDB, $ilAccess;\n\t\t\n\t\t$this->invitation = $invitation;\n\t\tif ($invitation == self::INVITATION_OFF)\n\t\t{\n\t\t\t$this->disinviteAllUsers();\n\t\t}\n\t\telse if ($invitation == self::INVITATION_ON)\n\t\t{\n\t\t\tif ($this->getInvitationMode() == self::MODE_UNLIMITED)\n\t\t\t{\n\t\t\t\t$result = $ilDB->query(\"SELECT usr_id FROM usr_data\");\n\t\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tif ($ilAccess->checkAccessOfUser($row[\"usr_id\"], \"read\", \"\", $this->getRefId(), \"svy\", $this->getId()))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->inviteUser($row['usr_id']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }", "function getInvitationMode() \n\t{\n\t\tinclude_once \"./Services/Administration/classes/class.ilSetting.php\";\n\t\t$surveySetting = new ilSetting(\"survey\");\n\t\t$unlimited_invitation = $surveySetting->get(\"unlimited_invitation\");\n\t\tif (!$unlimited_invitation && $this->invitation_mode == self::MODE_UNLIMITED)\n\t\t{\n\t\t\treturn self::MODE_PREDEFINED_USERS;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn ($this->invitation_mode) ? $this->invitation_mode : self::MODE_UNLIMITED;\n\t\t}\n\t}", "public function acceptInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$room_name = $this->request->data['roomName'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 1;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}", "private function overrideInvitationRequest()\n {\n $this->app->instance(\n Spark\\Http\\Requests\\Settings\\Teams\\CreateInvitationRequest::class,\n CreateInvitationRequest::class\n );\n }", "function getInvitation() \n\t{\n\t\treturn ($this->invitation) ? $this->invitation : self::INVITATION_OFF;\n\t}", "public function setMode($mode) {\n\t\t$editMode = ($mode==\"on\")?true:false;\n\t\t//SessionUtils::setMessageEditionMode($editMode);\n\t\tif ($editMode) {\n\t\t\t$_SESSION[\"FINE_MESSAGE_EDITION_MODE\"] = true;\n\t\t\t$this->isMessageEditionMode = true;\n\t\t} else {\n\t\t\tunset($_SESSION[\"FINE_MESSAGE_EDITION_MODE\"]);\n\t\t}\n\n\t\t$this->content->addFile('../utils.i18n.fine/src/views/enableDisableEdition.php', $this);\n\t\t$this->template->toHtml();\n\t}", "function setMode($mode)\n {\n $this->mode = $mode;\n $this->determineRequiredPermission();\n }", "public function rejectInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 2;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}", "function setMode($mode)\n {\n $this->_mcryptMode = $mode;\n }", "function setMode($mode) {\n\t\t$this->_mode = $mode;\n\t}", "function setMode($mode) {\n\t\t$this->_mode = $mode;\n\t}", "public function setMode($mode) {\n $this->mode = $mode;\n }", "public function setMode($mode = 'create')\n {\n $this->mode = $mode;\n }", "function chch_popup_pro_agile_set_adapter() {\n if(!empty($_POST['_chch_pop_up_pro_newsletter_adapter'])) {\n $_POST['_chch_pop_up_pro_newsletter_adapter'] = 'AgileCRM';\n }\n}", "public function setMode($mode)\n {\n $this->mode = $mode;\n }", "private function setMode($mode)\n {\n $this->mode = $mode;\n }", "function setEncryptionMode($mode)\n {\n $this->encryptionMode = $mode;\n }", "public function SetMode($mode)\n\t{\n\t\t$this->mode = $mode;\n\t}", "private function setMode() {\r\n\t\t$this->mode = substr($this->mode, -1);\r\n\t}", "public function aim_list_mode($mode)\r\n\t{\r\n switch($mode) {\r\n case LIST_PERMIT_ALL:\r\n case LIST_DENY_ALL:\r\n case LIST_PERMIT_SOME:\r\n case LIST_DENY_SOME:\r\n case LIST_ALLOW_BUDDYLIST:\r\n case LIST_BLOCK_AIM:\r\n $this->core->aim_send_raw('toc2_set_pdmode ' . $mode);\r\n break;\r\n default:\r\n $this->core->aim_debug(sprintf('Supplied mode \"\\%s\" to \"%s\" is not a valid buddylist mode', $mode, __FUNCTION__), AIM_WARN);\r\n break;\r\n }\r\n\t}", "public function setMode(array $options)\n {\n $this->soap(\"AVTransport\", \"SetPlayMode\", [\n \"NewPlayMode\" => Helper::setMode($options),\n ]);\n\n return $this;\n }", "public function editionMode() {\n\t\tif (isset($_SESSION[\"FINE_MESSAGE_EDITION_MODE\"])) {\n\t\t\t$this->isMessageEditionMode = true;\n\t\t}\n\t\t$this->content->addFile('../utils.i18n.fine/src/views/enableDisableEdition.php', $this);\n\t\t$this->template->toHtml();\n\t}", "public function approveInvitation() {\n $this->autoRender = false;\n $communityId = $this->request->data['communityId'];\n $community = $this->Community->findById($communityId);\n if (!empty($community)) {\n $userId = $this->Auth->user('id');\n $this->CommunityMember->approve($communityId, $userId);\n\t\t\t//Community follow data\n\t\t\t$followCommunityData = array(\n\t\t\t\t'type' => FollowingPage::COMMUNITY_TYPE,\n\t\t\t\t'page_id' => $communityId,\n\t\t\t\t'user_id' => $userId,\n\t\t\t\t'notification' => FollowingPage::NOTIFICATION_ON\n\t\t\t);\n\t\t\t$this->FollowingPage->followPage($followCommunityData);\n\t\t\t\n $this->Session->setFlash(__('You are now a member of this community.'), 'success');\n } else {\n $this->Session->setFlash(__($this->invalidMessage), 'error');\n }\n }", "public function set_restriction_mode( $mode ) {\n\n\t\tif ( array_key_exists( $mode, $this->get_restriction_modes() ) ) {\n\n\t\t\tupdate_option( $this->restriction_mode_option, $mode );\n\n\t\t\t$this->restriction_mode = $mode;\n\t\t}\n\t}", "public function inviteAction()\n {\n \t$roomId = $this->_getRoomId();\n \t$userDto = Zend_Registry::get('api_user');\n \t$nickname = $this->_getParam('nick_name');\n \t$invited = $this->getMultiUser($this->_getParam('user_list'));\n \t\n \t$result = $this->getBusiness()->invite($roomId, $userDto, $invited, $nickname);\n \t$this->fromArray($result);\n }", "public function setMode($mode)\n {\n $this->_isLiveMode = ($mode == self::LIVE);\n }", "public function inviteAction()\n\t{\n\t\t$user = new Default_Model_User();\n\t\t$resultRow = $user->getUserByEmail($this->loggedEmail);\n\t\t\n\t\t$loggedHandle = $resultRow->handle;\n\t\t$loggedId = $resultRow->id;\n\t\t\n\t\t$handle = $this->_request->getParam('handle');\n\t\t$resultRow = $user->getUserByHandle($handle);\n\t\t$handleId = $resultRow->id;\n\n\t\t$invite = new Default_Model_Invitation();\n\t\tif($invite->createInvitation($loggedId, $handleId)){\n\t\t\t$this->view->success = 1;\n\t\t} else{\n\t\t\t$this->view->success = 0;\n\t\t}\n\t}", "public function actionSendInvitation() {\n\n $dbusers = Yii::app()->db->createCommand()\n ->select('user_name,user_email,user_id')\n ->from(\"user\")\n ->where(\"source='outside'\")\n ->queryAll();\n\n $users = array_chunk($dbusers, 15, true);\n\n $this->render(\"send_invitation\", array(\"users\" => $users));\n }", "function invite()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tlogout_invalid_user($this);\n\t\t\n\t\t# user has submitted the invitation\n\t\tif(!empty($_POST)){\n\t\t\t$response = $this->_tender->invite($_POST);\n\t\t\t$msg = (!empty($response) && $response['boolean'])? 'The Invitation for Bids/Quotations has been sent.' :'ERROR: The Invitation for Bids/Quotations could not be sent.';\n\t\t\t\n\t\t\t$this->native_session->set('__msg',$msg);\n\t\t}\n\t\telse if(!empty($data['a'])){\n\t\t\t$data['msg'] = $this->native_session->get('__msg');\n\t\t\t$data['area'] = 'refresh_list_msg';\n\t\t\t$this->load->view('addons/basic_addons', $data);\n\t\t}\n\t\telse {\n\t\t\t$data['tender'] = $this->_tender->details($data['d']);\n\t\t\t$data['invited'] = $this->_tender->invitations($data['d']);\n\t\t\t$this->load->view('tenders/invite', $data);\n\t\t}\n\t}" ]
[ "0.8270427", "0.69026", "0.6842384", "0.591527", "0.5771707", "0.56666994", "0.55834764", "0.5527616", "0.5438288", "0.54217654", "0.5356928", "0.5356928", "0.5263111", "0.5257753", "0.5226063", "0.5156962", "0.5099934", "0.5094766", "0.5085886", "0.5064742", "0.49838936", "0.4953779", "0.49512506", "0.49291667", "0.492517", "0.49147025", "0.4913419", "0.49133164", "0.4875879", "0.48734498" ]
0.87562764
0
Sets the invitation status and mode (a more performant solution if you change both)
function setInvitationAndMode($invitation = 0, $invitation_mode = 0) { $this->invitation_mode = $invitation_mode; $this->setInvitation($invitation); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setInvitationMode($invitation_mode = 0) \n\t{\n\t\t$this->invitation_mode = $invitation_mode;\n }", "function setInvitation($invitation = 0) \n\t{\n\t\tglobal $ilDB, $ilAccess;\n\t\t\n\t\t$this->invitation = $invitation;\n\t\tif ($invitation == self::INVITATION_OFF)\n\t\t{\n\t\t\t$this->disinviteAllUsers();\n\t\t}\n\t\telse if ($invitation == self::INVITATION_ON)\n\t\t{\n\t\t\tif ($this->getInvitationMode() == self::MODE_UNLIMITED)\n\t\t\t{\n\t\t\t\t$result = $ilDB->query(\"SELECT usr_id FROM usr_data\");\n\t\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tif ($ilAccess->checkAccessOfUser($row[\"usr_id\"], \"read\", \"\", $this->getRefId(), \"svy\", $this->getId()))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->inviteUser($row['usr_id']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }", "function getInvitationMode() \n\t{\n\t\tinclude_once \"./Services/Administration/classes/class.ilSetting.php\";\n\t\t$surveySetting = new ilSetting(\"survey\");\n\t\t$unlimited_invitation = $surveySetting->get(\"unlimited_invitation\");\n\t\tif (!$unlimited_invitation && $this->invitation_mode == self::MODE_UNLIMITED)\n\t\t{\n\t\t\treturn self::MODE_PREDEFINED_USERS;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn ($this->invitation_mode) ? $this->invitation_mode : self::MODE_UNLIMITED;\n\t\t}\n\t}", "static function set_invite_status(RowUpdate &$upd, RowResult $entity, $status) {\r\n $link_name = null;\r\n\r\n if ($entity->base_model == 'User') {\r\n $link_name = 'users';\r\n } elseif ($entity->base_model == 'Contact') {\r\n $link_name = 'contacts';\r\n }\r\n\r\n if ($link_name != null) {\r\n $id = $entity->getField('id');\r\n $params[$id] = array('name' => 'accept_status', 'value' => $status);\r\n $upd->addUpdateLink($link_name, $id, $params);\r\n }\r\n }", "public function acceptInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$room_name = $this->request->data['roomName'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 1;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}", "public function onChangeStatus(){\n \n if (($groupId = post('groupId')) != ''){\n \n $group = UserGroup::findOrFail($groupId);\n \n if (($status = post('status')) != ''){\n $user = $this->getuser();\n \n switch ($status){\n case UserGroup::MEMBERSHIP_ACCEPTED:\n $group->acceptMembership($user);\n break;\n \n case UserGroup::MEMBERSHIP_REJECTED:\n \t$group->rejectMembership($user);\n \tbreak;\n \t\n \tcase UserGroup::MEMBERSHIP_CANCELLED:\n \t\t$group->cancelMembership($user);\n \t\tbreak; \t \n \n } \n }\n }\n \n \n // Updated list of request and other vars\n $this->prepareVars();\n }", "public function changestatusAction()\n {\n $user_params=$this->_request->getParams();\n $automail=new Ep_Message_AutoEmails();\n $ftvrequest_obj = new Ep_Ftv_FtvRequests();\n $ftvcontacts_obj = new Ep_Ftv_FtvContacts();\n $ftvpausetime_obj = new Ep_Ftv_FtvPauseTime();\n\n if($user_params['status'] == 'closed')\n $data = array(\"status\"=>$user_params['status'], \"cancelled_at\"=>date('Y-m-d H:i:s'));////////updating\n elseif($user_params['status'] == 'done')\n $data = array(\"status\"=>$user_params['status'], \"closed_at\"=>date('Y-m-d H:i:s'));////////updating\n else\n $data = array(\"status\"=>$user_params['status'], \"closed_at\"=>NULL, \"cancelled_at\"=>NULL);////////updating\n $query = \"identifier= '\".$user_params['requestId'].\"'\";\n $requestdetails = $ftvrequest_obj->requestDetailsById($user_params['requestId']);\n $contactId = $requestdetails[0]['request_by'];\n $contactdetails = $ftvcontacts_obj->getFtvContactDetails($contactId);\n $contactName = $contactdetails[0]['first_name'].\" \".$contactdetails[0]['last_name'];\n $parameters['ftvobject'] = $requestdetails[0]['request_object'];\n $parameters['ftvcontactName'] = $contactName;\n $ftvrequest_obj->updateFtvRequests($data,$query);\n ////making the time resume if its in pause////\n $inpause = $ftvpausetime_obj->inPause($user_params['requestId']);\n if($inpause == 'yes')\n {\n $data = array(\"resume_at\"=>date('Y-m-d H:i:s'));////////updating\n $query = \"ftvrequest_id = '\".$user_params['requestId'].\"' AND resume_at IS NULL \";\n $ftvpausetime_obj->updateFtvPauseTime($data,$query);\n }\n if($user_params['status'] == 'done')\n {\n if($this->adminLogin->userId != '110823103540627' ) ///when not johny head of BO user for FTV changed\n {\n $parameters['ftvrequestlink'] = \"/ftvchaine/ftvch-requests?submenuId=ML11-SL6\";\n $parameters['ftvType'] = \"chaine\";\n $automail->messageToEPMail('110823103540627',114,$parameters);// to johny\n $parameters['ftvrequestlink'] = \"http://ep-test.edit-place.com/ftvchaine/index\";\n $automail->sendFtvChaineContactsPersonalEmail($contactId,114,$parameters); // to client contact\n }\n else // in case jhony change the status\n {\n $parameters['ftvrequestlink'] = \"http://ep-test.edit-place.com/ftvchaine/index\";\n $automail->sendFtvChaineContactsPersonalEmail($contactId,114,$parameters); // to client contact\n }\n }\n\n }", "public function setDefaultStatus() {\n if (!$this->hasField('field_room')) {\n return;\n }\n if (!$this->get('field_room')->isEmpty()) {\n $room = $this->get('field_room')->entity;\n $approval_required = $room->field_approval_required->getString();\n\n $current_user = \\Drupal::currentUser();\n if ($current_user->hasPermission('bypass room reservation agreement')) {\n $approval_required = FALSE;\n }\n\n $current_status = $this->get('field_status')->getString();\n\n if (!$approval_required && $current_status == 'requested') {\n $this->approve();\n }\n }\n }", "public function updateInviteStatus($cell_number, $invitation_status){\n return DB::table('my_friends')->where('cell_number', $cell_number)->update(['invitation_status'=>$invitation_status]);\n }", "public function rejectInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 2;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}", "protected static function set_status()\n {\n }", "public static function set_email_template_status() {\n\n check_ajax_referer('email-template-status', 'rac_security');\n\n if (isset($_POST['row_id']) && isset($_POST['status'])) {\n $requesting_state = $_POST['status'];\n $post_id = $_POST['row_id'];\n $status = $requesting_state != 'ACTIVE' ? 'racactive' : 'racinactive';\n $new_status = $requesting_state != 'ACTIVE' ? 'ACTIVE' : 'NOTACTIVE';\n $args = array(\n 'ID' => $post_id,\n 'post_status' => $status\n );\n\n wp_update_post($args);\n echo $new_status;\n }\n exit();\n }", "function getInvitation() \n\t{\n\t\treturn ($this->invitation) ? $this->invitation : self::INVITATION_OFF;\n\t}", "function update_organiser_status(){\r\n\t\t$this->organiser_model->update_organiser_status($_POST['status'],$_POST['organiser_id']);\r\n\t\t$this->send_status_email($_POST['status'],$_POST['organiser_id']);\r\n\t\techo \"1\";exit;\r\n\t}", "public function approveInvitation() {\n $this->autoRender = false;\n $communityId = $this->request->data['communityId'];\n $community = $this->Community->findById($communityId);\n if (!empty($community)) {\n $userId = $this->Auth->user('id');\n $this->CommunityMember->approve($communityId, $userId);\n\t\t\t//Community follow data\n\t\t\t$followCommunityData = array(\n\t\t\t\t'type' => FollowingPage::COMMUNITY_TYPE,\n\t\t\t\t'page_id' => $communityId,\n\t\t\t\t'user_id' => $userId,\n\t\t\t\t'notification' => FollowingPage::NOTIFICATION_ON\n\t\t\t);\n\t\t\t$this->FollowingPage->followPage($followCommunityData);\n\t\t\t\n $this->Session->setFlash(__('You are now a member of this community.'), 'success');\n } else {\n $this->Session->setFlash(__($this->invalidMessage), 'error');\n }\n }", "public function setUserStatus() {\n\n $addMember = 1;\n $removeMember = 2;\n $addMemberClosedCommunity = 3;\n\n $this->autoRender = false;\n $user_id = $this->request->data['userId'];\n $community_id = $this->request->data['communityId'];\n $sentStatus = $this->request->data['status'];\n $status = $this->CommunityMember->getCommunityMemberStatus($user_id, $community_id);\n $community = $this->Community->find('first', array(\n 'conditions' => array(\n 'Community.id' => $community_id\n )\n ));\n\n if (!empty($community)) {\n\n /*\n * Check status has changed before send the request\n */\n if ($sentStatus == $status ) {\n if (in_array($community['Community']['type'], array(Community::COMMUNITY_TYPE_OPEN, Community::COMMUNITY_TYPE_SITE))) {\n\n if (!empty($status)) {\n\n switch ($status) {\n case 0:\n $this->CommunityMember->changeCommunityMemberStatus($user_id, $community_id, $addMember);\n $this->Session->setFlash(__('You are now a member of this community'), 'success');\n break;\n case 1:\n\t\t\t\t\t\t\t\t$this->CommunityMember->changeCommunityMemberStatus($user_id, $community_id, $removeMember);\n\t\t\t\t\t\t\t\t$this->removeMemberFromCommunityEvents($community_id, $user_id);\n\t\t\t\t\t\t\t\t//Community unfollow data\n\t\t\t\t\t\t\t\t$followCommunityData = array(\n\t\t\t\t\t\t\t\t\t'type' => FollowingPage::COMMUNITY_TYPE,\n\t\t\t\t\t\t\t\t\t'page_id' => $community_id,\n\t\t\t\t\t\t\t\t\t'user_id' => $user_id\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$this->FollowingPage->unFollowPage($followCommunityData);\n\t\t\t\t\t\t\t\t$this->Session->setFlash(__('You are no longer a member of this community.'), 'success');\n\t\t\t\t\t\t\t\techo $member_count;\n\t\t\t\t\t\t\t\tbreak;\n }\n } else {\n $this->CommunityMember->changeCommunityMemberStatus($user_id, $community_id, $addMember);\n $this->Session->setFlash(__('You are now a member of this community'), 'success');\n }\n } else {\n\n if (!empty($status)) {\n\n switch ($status) {\n case 0:\n $this->CommunityMember->changeCommunityMemberStatus($user_id, $community_id, $addMemberClosedCommunity);\n $this->Session->setFlash(__('The Community admin has been notified about your interest in joining the Community'));\n break;\n case 1:\n $this->CommunityMember->changeCommunityMemberStatus($user_id, $community_id, $removeMember);\n $this->removeMemberFromCommunityEvents($community_id, $user_id);\n $this->Session->setFlash(__('You are no longer a member of this Community.'), 'success');\n break;\n }\n } else {\n $this->CommunityMember->changeCommunityMemberStatus($user_id, $community_id, $addMemberClosedCommunity);\n $this->Session->setFlash(__('The Community admin has been notified about your interest in joining the Community'), 'success');\n\n // add community join request notification task to job queue\n $this->loadModel('Queue.QueuedTask');\n $this->QueuedTask->createJob('CommunityJoinRequestNotification', array(\n 'community_id' => $community_id,\n 'sender_id' => $user_id,\n 'recipient_id' => $community['Community']['created_by'],\n 'community_name' => $community['Community']['name']\n ));\n }\n }\n exit;\n } else {\n $this->Session->setFlash('Sorry !, You have done this action already.', 'error');\n }\n } else {\n $this->Session->setFlash(__($this->invalidMessage), 'error');\n }\n }", "function updatestatus() {\n global $_lib;\n\n $dataH = array();\n $dataH['ID'] = $this->transaction->ID;\n $dataH['RemittanceSequence'] = $this->transaction->RemittanceSequence;\n $dataH['RemittanceDaySequence'] = $this->transaction->RemittanceDaySequence;\n $dataH['RemittanceSendtDateTime'] = $_lib['sess']->get_session('Datetime');\n $dataH['RemittanceSendtPersonID'] = $_lib['sess']->get_person('PersonID');\n $dataH['RemittanceStatus'] = 'sent';\n \n #Disse mŒ fjernes nŒr vi har en godkjenningsprosess\n $dataH['RemittanceApprovedDateTime'] = $_lib['sess']->get_session('Datetime');\n $dataH['RemittanceApprovedPersonID'] = $_lib['sess']->get_person('PersonID');\n\n $_lib['storage']->store_record(array('data' => $dataH, 'table' => 'invoicein', 'debug' => false));\n }", "function setMode($mode)\n {\n $this->mode = $mode;\n $this->determineRequiredPermission();\n }", "public function setMode($mode) {\n\t\t$editMode = ($mode==\"on\")?true:false;\n\t\t//SessionUtils::setMessageEditionMode($editMode);\n\t\tif ($editMode) {\n\t\t\t$_SESSION[\"FINE_MESSAGE_EDITION_MODE\"] = true;\n\t\t\t$this->isMessageEditionMode = true;\n\t\t} else {\n\t\t\tunset($_SESSION[\"FINE_MESSAGE_EDITION_MODE\"]);\n\t\t}\n\n\t\t$this->content->addFile('../utils.i18n.fine/src/views/enableDisableEdition.php', $this);\n\t\t$this->template->toHtml();\n\t}", "public function setPending()\n {\n $this->attributes['status'] = 'pending';\n self::save();\n }", "private function overrideInvitationRequest()\n {\n $this->app->instance(\n Spark\\Http\\Requests\\Settings\\Teams\\CreateInvitationRequest::class,\n CreateInvitationRequest::class\n );\n }", "public function checkoutInvite($id,$status,$cell_number){\n // return $changeStatus;\n return DB::table('visitor_pass')->where('id', $id)->update(['invitation_status'=>$status]);\n }", "public function videoconferenciaNoInterrumpir( ) {\n $this->setNoInterrumpir(\"OFF\");\n //$this->setNoInterrumpir(\"ALLOCATED\");\n }", "public function UpdateFlagViewed(){\n\t\t\tinclude 'dbconnect.php';\n\t\t\t$Changeflag = 1; $flag =0;\n\t\t\t$Sql = $Connection->prepare(\"UPDATE InviteLinks SET flag =:Flag WHERE AdminID=:tempAdminID AND userID=:tempUserId AND flag=:tempFlag AND RoomID=:tempRoomID\");\n\t\t\t$Sql->execute(array('Flag' => $Changeflag, 'tempAdminID' => $this->getAdminID(), 'tempUserId' => $this->getInvitedID(), 'tempFlag' => $flag,'tempRoomID' => $this->getRoomID()));\n\t\t\t$Connection = null;\n\t\t}", "protected function _setApprovedFlag()\n {\n $user = $this->getUser();\n\n if (!empty($user['id'])) {\n $settings = $this->getSettings();\n if ($settings['enable_listings_approval']) {\n return 0;\n }\n else if ($user['listing_approval']) {\n return 0;\n }\n }\n\n return 1;\n }", "public function change_review_status(){\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect('admin');\n\t\t}else {\n\t\t\t$mode = $this->uri->segment(4,0);\n\t\t\t$user_id = $this->uri->segment(5,0);\n\t\t\t$status = ($mode == '0')?'Inactive':'Active';\n\t\t\t$newdata = array('status' => $status);\n\t\t\t$condition = array('id' => $user_id);\n\t\t\t//echo $status;die;\n\t\t\tif($status=='Active'){\n\t\t\t\t$GetReviewDetails=$this->review_model->get_all_details(REVIEW,$condition);\n\t\t\t\t\n\t\t\t\tif($GetReviewDetails->row()->user_id > 0 && $GetReviewDetails->row()->user_id != ''){\n\t\t\t\t\t$GetUserDetails=$this->review_model->get_all_details(USERS,array('id' => $GetReviewDetails->row()->user_id));\n\t\t\t\t\t$GetRentalDetails=$this->review_model->get_all_details(PRODUCT,array('id' => $GetReviewDetails->row()->product_id));\n\t\t\t\t\tif($GetUserDetails->row()->email != ''){\n\t\t\t\t\t\t$newsid='15';\n\t\t\t\t\t\t$template_values=$this->review_model->get_newsletter_template_details($newsid);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$subject = 'From: '.$this->config->item('email_title').' - '.$template_values['news_subject'];\n\t\t\t\t\t\t$adminnewstemplateArr=array('email_title'=> $this->config->item('email_title'),'logo'=> $this->data['logo'],'title'=>$GetReviewDetails->row()->title,'review'=>$GetReviewDetails->row()->review,'rateVal'=>$GetReviewDetails->row()->rateVal,'email_id'=>$GetReviewDetails->row()->email,'nickname'=>$GetReviewDetails->row()->nickname,'full_name'=>$GetReviewDetails->row()->full_name,'date_arrival'=>$GetReviewDetails->row()->date_arrival,'location'=>$GetReviewDetails->row()->location,'user_type'=>$GetReviewDetails->row()->user_type,'rental_id'=>$GetReviewDetails->row()->product_id,'rental_name'=>$GetRentalDetails->row()->product_name,'user_id'=>$GetReviewDetails->row()->user_id,'reviewer_id'=>$GetReviewDetails->row()->reviewer_id,'owner_name'=>ucfirst($GetUserDetails->row()->first_name));\n\t\t\t\t\t\textract($adminnewstemplateArr);\n\t\t\t\t\t\t//$ddd =htmlentities($template_values['news_descrip'],null,'UTF-8');\n\t\t\t\t\t\t$header .=\"Content-Type: text/plain; charset=ISO-8859-1\\r\\n\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t$message .= '<!DOCTYPE HTML>\n\t\t\t\t\t\t\t<html>\n\t\t\t\t\t\t\t<head>\n\t\t\t\t\t\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n\t\t\t\t\t\t\t<meta name=\"viewport\" content=\"width=device-width\"/><body>';\n\t\t\t\t\t\tinclude('./newsletter/registeration'.$newsid.'.php');\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$message .= '</body>\n\t\t\t\t\t\t\t</html>';\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($template_values['sender_name']=='' && $template_values['sender_email']==''){\n\t\t\t\t\t\t\t$sender_email=$this->data['siteContactMail'];\n\t\t\t\t\t\t\t$sender_name=$this->data['siteTitle'];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$sender_name=$template_values['sender_name'];\n\t\t\t\t\t\t\t$sender_email=$template_values['sender_email'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//add inbox from mail \n\t\t\t\t\t\t$this->review_model->simple_insert(INBOX,array('sender_id'=>$sender_email,'user_id'=>$GetUserDetails->row()->email,'mailsubject'=>$subject,'description'=>stripslashes($message)));\n\t\t\t\t\n\t\t\t\t\t\t$email_values = array('mail_type'=>'html',\n\t\t\t\t\t\t\t\t\t\t\t'from_mail_id'=>$sender_email,\n\t\t\t\t\t\t\t\t\t\t\t'mail_name'=>$sender_name,\n\t\t\t\t\t\t\t\t\t\t\t'to_mail_id'=>$GetUserDetails->row()->email,\n\t\t\t\t\t\t\t\t\t\t\t'subject_message'=>$template_values['news_subject'],\n\t\t\t\t\t\t\t\t\t\t\t'body_messages'=>$message\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t$email_send_to_common = $this->review_model->common_email_send($email_values);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->review_model->update_details(REVIEW,$newdata,$condition);\n\t\t\t$this->setErrorMessage('success','Review Status Changed Successfully');\n\t\t\tredirect('admin/review/display_review_list');\n\t\t}\n\t}", "public function putUpdateInvitationStatus($data)\n {\n DB::beginTransaction();\n try{\n $invite = UserInvite::checkUsersInvite($data['inviteId'],Auth::user()->user_id);\n if(is_object($invite)) {\n \n $invite = UserInvite::updateInviteStatus($invite,$data['status']);\n $notification = NotificationsLogs::getNotificationById($invite['notification_id']);\n NotificationsLogs::updateInviteNotificstionStatus($notification, $data['status'],Constant::$userReadNotification);\n self::sendInviteNotification($invite['user_id'],self::inviteStatusMessage($data['status']), Constant::$ACCEPT_REJECT_INVITE_NOTIFICATION);\n $result = $this->renderSuccess(trans('messages.invite_status_updated'),$invite);\n } \n else {\n $result = $this->renderFailure(trans('messages.not_authorised_to_update_invite'), StatusCode::$EXCEPTION,[]);\n }\n DB::commit();\n }\n catch(\\Exception $e){\n DB::rollback();\n UtilityHelper::logExceptionWithObject(__METHOD__, $e);\n $result = $this->renderFailure(trans('messages.error.exception'), Response::HTTP_OK);\n }\n return $result;\n }", "public function accept()\n {\n\n if($this->user['menteer_type']==37 && $this->user['is_matched'] > 0 && $this->user['match_status']=='pending') {\n\n // mentor update\n $update_user = array(\n 'id' => $this->session->userdata('user_id'),\n 'data' => array('match_status' => 'active','match_status_stamp' => date('y-m-d H:i:s')),\n 'table' => 'users'\n );\n $this->Application_model->update($update_user);\n\n // mentee update\n $update_user = array(\n 'id' => $this->user['is_matched'],\n 'data' => array('match_status' => 'active','match_status_stamp' => date('y-m-d H:i:s')),\n 'table' => 'users'\n );\n $this->Application_model->update($update_user);\n\n $mentee = $this->Application_model->get(array('table'=>'users','id'=>$this->user['is_matched']));\n\n // notify mentee about the accept\n\n $data = array();\n $data['first_name'] = $this->user['first_name'];\n $data['last_name'] = $this->user['last_name'];\n\n $message = $this->load->view('/chooser/email/accept', $data, true);\n $this->email->clear();\n $this->email->from($this->config->item('admin_email', 'ion_auth'), $this->config->item('site_title', 'ion_auth'));\n $this->email->to($mentee['email']);\n $this->email->subject('Mentor has accepted');\n $this->email->message($message);\n\n $result = $this->email->send(); // @todo handle false send result\n\n $this->session->set_flashdata('message', '<div class=\"alert alert-success\">The Mentee has been notified about the acceptance.</div>');\n redirect('/dashboard');\n\n }else{\n\n redirect('/dashboard');\n\n }\n\n }", "function oz_send_invitation (&$ozinviter, &$contacts, $personal_message=NULL)\r\n{\r\n\t$from_name = ozi_get_param('oz_from_name',NULL);\r\n\t$from_email = ozi_get_param('oz_from_email',NULL);\r\n\r\n\t//Build the message\r\n\tglobal $_OZINVITER_CALLBACKS;\r\n\t$func = $_OZINVITER_CALLBACKS['get_invite_message']\t;\r\n\t$msg = $func($from_name,$from_email,$personal_message);\r\n\t$subject = $msg['subject'];\r\n\t$text_body = $msg['text_body'];\r\n\t$html_body = $msg['html_body'];\r\n\tif (ozi_get_config('allow_personal_message',TRUE))\r\n\t{\r\n\t\t$text_body = str_replace('{PERSONALMESSAGE}',$personal_message==NULL?'':$personal_message,$text_body);\r\n\t\t$html_body = str_replace('{PERSONALMESSAGE}',$personal_message==NULL?'':htmlentities($personal_message,ENT_COMPAT,'UTF-8'),$html_body);\r\n\t}\r\n\r\n\t//If inviter isn't a social network, then it can only import and not send emails.\r\n\t$res = is_null($ozinviter) ? OZE_UNSUPPORTED_OPERATION : $ozinviter->send_messages($contacts,$subject,$text_body);\r\n\tif ($res===OZE_UNSUPPORTED_OPERATION)\r\n\t{\r\n\t\t$recplist = array();\r\n\r\n\t\t//----------------------------------------------------------------\t\r\n\t\t//Send invitation by email.\r\n\t\t$cl = array();\r\n\t\t$n = count($contacts);\r\n\t\tfor ($i=0; $i<$n; $i++) {\r\n\t\t\t$c = &$contacts[$i];\r\n\t\t\tif (!is_array($c)) $c2=array('type'=>'email','id'=>$c,'email'=>$c);\r\n\t\t\telse $c2 = $c;\r\n\t\t\t$email = $c2['email'];\r\n\t\t\t//$email = is_array($r) ? (isset($r['email']) ? $r['email'] : '') : $r;\r\n\t\t\tif (!empty($email) && abi_valid_email($email)) \r\n\t\t\t{\r\n\t\t\t\t$cl[]=$c2;\r\n\t\t\t\t$recplist[] = $email;\r\n\t\t\t}\r\n\t\t}\r\n\t\tglobal $_OZINVITER_CALLBACKS;\r\n\t\t$func = $_OZINVITER_CALLBACKS['send_emails'];\r\n\t\t$func($from_name,$from_email,$cl,$personal_message);\r\n\t\t//oz_send_emails($cl,$subject,$text_body,$html_body);\r\n\t\t//----------------------------------------------------------------\t\r\n\r\n\t\t//Store recipients list to be presented in output\t\t\r\n\t\t$_REQUEST['oz_recipients'] = $recplist;\r\n\t\t$res = OZE_SUCCESS;\r\n\t}\r\n\t//Other errors include OZE_CAPTCHA, etc\r\n\t\r\n\treturn $res;\r\n}", "function setstatus($user_id=\"\",$status=\"read\")\n { \n $output['success'] = FALSE;\n $ceklogin = $this->cek_session->islogin();\n $output['logged_in'] = $ceklogin;\n $output['message'] = \"fail to set status Message\";\n if($ceklogin)\n {\n $this->mongo_db->select_db(\"Users\");\n $this->mongo_db->select_collection(\"Inbox\"); \n $this->mongo_db->update(array(\n 'type'=>array('$in'=>array(\"inbox\",\"bcmesage\")),\"friend_id\" => $user_id\n ),array('$set'=>array('read'=>(($status===\"read\")?TRUE:FALSE))));\n $output['success'] = TRUE;\n $output['message'] = \"Status Message is Set to \".$status;\n }\n echo json_encode($output);\n }" ]
[ "0.7858737", "0.66267216", "0.63174635", "0.61480963", "0.607003", "0.6060196", "0.5803919", "0.5683074", "0.5574744", "0.55032754", "0.54401493", "0.5417763", "0.5355239", "0.5344447", "0.53327835", "0.53127724", "0.53045356", "0.53002936", "0.52984345", "0.52815634", "0.5275017", "0.52736676", "0.5226621", "0.5212846", "0.5211941", "0.50858665", "0.50695163", "0.50618196", "0.5058662", "0.50475484" ]
0.7752064
1
Sets the introduction text
public function setIntroduction($introduction = "") { $this->introduction = $introduction; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function include_introduction_paragraph() {\n global $edd_options;\n\n if ( isset( $edd_options['taxedd_introduction_text'] ) && !empty( $edd_options['taxedd_introduction_text'] ) && \"\" !== $edd_options['taxedd_introduction_text'] ) {\n $intro_text = $edd_options['taxedd_introduction_text'];\n echo '<p>' . $intro_text . '</p>';\n }\n\n }", "public function introductionAction()\n {\n if (! isset($this->dictionary['introduction'])) {\n $this->homeAction();\n\n } else if (strpos($this->dictionary['introduction'], 'http') !== false) {\n $this->view->externalDict = $this->dictionary['introduction'];\n\n } else {\n $this->view->introduction = 'introduction/' . $this->dictionary['introduction'];\n }\n }", "public static function add_help_text()\n {\n }", "public function intro() {\n\n\t}", "public function intro() {\n\n }", "public function setTitle(string $text = \"untitled\");", "protected function output_intro(): void {\r\n ?>\r\n <h2><?php echo $this->page_title(); ?></h2>\r\n <div class=\"<?php echo self::cl_intro; ?>\"><p><ol>\r\n <li>For each generated page, pick an existing WordPress page to be\r\n overwritten with the generated content, and a schedule for automatic generation.</li>\r\n <li>You can also generate a page immediately. You'll see a confirmation message when it finishes.</li>\r\n <li>WordPress scheduled actions are not always exactly on time, especially during low-traffic periods.</li>\r\n <li>If the content doesn't change after generation, a new revision will not be created.</li>\r\n </ol></p></div>\r\n <?php\r\n }", "public function introduction(){\n\t\tif($this->introduction == 0){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private static function intro()\n {\n $files = ['Intro'];\n $folder = static::$root.'Access'.'/';\n\n self::call($files, $folder);\n }", "public function set_title($text){\n $this->title=$text;\n }", "public function addCaption($text)\n {\n $this->captionCount++;\n $this->captionStarted = $this->timer->elapsedAsSubripTime();\n $this->captionText = $text;\n }", "public function introduction() {\n $this->load->view('header');\n $this->load->view('introduction');\n $this->load->view('footer');\n }", "function showIntro() {\n if (! $_SESSION[\"eligible\"]) {\n return $this->showStart();\n }\n $nexturl = $this->action . '?mode=details';\n $safety = $this->action . '?mode=safety';\n $extra = array('next' => $nexturl, 'safetyurl' => $safety);\n $output = $this->outputBoilerplate('introduction.html', $extra);\n return $output;\n }", "function quadro_site_about() {\n\tglobal $quadro_options;\n\tif ( esc_attr($quadro_options['about_text']) != '' ) {\n\t\techo '<h2 class=\"site-description\">' . esc_attr($quadro_options['about_text']) . '</h2>';\n\t}\n}", "public function setText($text)\r\n {\r\n $this->text = $text;\r\n }", "public function getIntro()\n {\n return $this->getData('intro') ?? '';\n }", "public function setText($text)\n {\n $this->text = $text;\n }", "public function setText($text)\n {\n $this->text = $text;\n }", "public function setText($text)\n {\n $this->text = $text;\n }", "public function introTextImage(){\n if(isset($this->imageIntro)){\n return $this->imageIntro;\n }\n $this->fetchIntroImage();\n return $this->imageIntro;\n }", "public function setText($text) {\n $this->TEXT = $text;\n }", "public function setHelpText(?string $value): void {\n $this->getBackingStore()->set('helpText', $value);\n }", "public function sobre() {\n $this->template->set_title( 'Work for all - Sobre' );\n\n // renderiza a pagina\n\t\t$this->template->render( 'sobre' );\n }", "public function intro(){\n\t\t$html = \"\";\n\t\t$html.= '\n\t\t<div class=\"row description\">\n\t\t\t<div class=\"small-12 large-12 columns\">\n\t\t\t\t\t<h1>Actualites</h1>\n\t\t\t\t<hr/>\n\t\t\t</div>\n\t\t\t<div class=\"small-8 large-8 columns\">\n\t\t\t\t<div class=\"center\">\n\t\t\t\t\t<h2>Qu\\'est ce qui ce trame en Altraya ?</h2>\n\t\t\t\t</div>\n\t\t\t\t<hr/>\n\t\t\t\t<p>- Ajout d\\'une fonctionnalité d\\'élevage : la reproduction</p>\n\t\t\t</div>\n\t\t\t<div class=\"small-4 large-4 columns\">\n\t\t\t\t<a class=\"twitter-timeline\" href=\"https://twitter.com/Karakayne\" data-widget-id=\"579726233640005632\">Tweets de @Karakayne</a>\n\t\t\t\n\t\t\t\t<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?\\'http\\':\\'https\\';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+\"://platform.twitter.com/widgets.js\";fjs.parentNode.insertBefore(js,fjs);}}(document,\"script\",\"twitter-wjs\");</script>\n\t\t\t\n\t\t\t</div>\n\t\t</div>\n\t\t';\n\n\t\techo($html);\n\t}", "private function buildIntroBlock(): void\n {\n //====================================================================//\n // Into Text Block\n $this->blocksFactory()\n ->addTextBlock(\"This is a Demo Text Block!!\".\"You can repeat me as much as you want!\");\n }", "function wpvideocoach_dashboard_slider_introduction()\r\n{\r\n\tglobal $wpvideocoach_dashboard_slider_introduction;\r\n\tif(empty($wpvideocoach_dashboard_slider_introduction)){\r\n\t\t$wpvideocoach_dashboard_slider_introduction = __('Start learning how to manage your website by watching the following tutorial videos.', 'wp-video-coach');\r\n\t}\r\n\treturn $wpvideocoach_dashboard_slider_introduction;\r\n}", "public function setText($text)\n {\n $this->_text = $text;\n }", "public function introduction()\n {\n $introduction_active = true;\n $introduction = Introduction::first();\n $photo_gallery = $this->photo_library_services->random(8);\n\n return view('client.introduction', compact(\n 'introduction_active',\n 'introduction',\n 'photo_gallery'\n )\n );\n }", "public function introduction()\n {\n $rand = rand(0,8);\n return StoryLine::$greetings[$rand];\n }", "function appendText ($text) {\r\n $this->content .= $text;\r\n }" ]
[ "0.66990095", "0.6503752", "0.64799035", "0.62142694", "0.6004803", "0.5992857", "0.59815776", "0.5857462", "0.58244085", "0.57937425", "0.57866424", "0.5755623", "0.5751942", "0.57144773", "0.5675897", "0.5667731", "0.565313", "0.565313", "0.565313", "0.56470037", "0.5642891", "0.5632603", "0.5623247", "0.5620572", "0.5616937", "0.55867904", "0.55793655", "0.5579206", "0.5568378", "0.55465096" ]
0.6584058
1
Sets the outro text
public function setOutro($outro = "") { $this->outro = $outro; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function nosotros() {\n\t\t$this->set('title_for_layout', __('Nosotros - You & I | Organizamos y coordinamos tus eventos') );\n\t}", "function setTopAxisTitle($text = '')\n {\n $this->axis_data[3]['t'] = $text;\n }", "function DrawOwnerText() {\n $iBlack = imagecolorallocate($this->oImage, 0, 0, 0);\n // get height of selected font\n $iOwnerTextHeight = imagefontheight(2);\n // calculate overall height\n $iLineHeight = $this->iHeight - $iOwnerTextHeight - 4;\n \n // draw line above text to separate from CAPTCHA\n imageline($this->oImage, 0, $iLineHeight, $this->iWidth, $iLineHeight, $iBlack);\n \n // write owner text\n imagestring($this->oImage, 2, 3, $this->iHeight - $iOwnerTextHeight - 3, $this->sOwnerText, $iBlack);\n \n // reduce available height for drawing CAPTCHA\n $this->iHeight = $this->iHeight - $iOwnerTextHeight - 5;\n }", "function getOutro() \n\t{\n\t\treturn (strlen($this->outro)) ? $this->outro : NULL;\n\t}", "public function setTexto($txt) {\n $this->texto = Funciones::gCodificar($txt);\n }", "function setRightAxisTitle($text = '')\n {\n $this->axis_data[2]['t'] = $text;\n }", "function SetTextOutline($width, $r=0, $g=-1, $b=-1) //EDITEI\n\t\t{ \n\t\t if ($width == false) //Now resets all values\n\t\t { \n\t\t\t$this->outline_on = false;\n\t\t\t$this->SetLineWidth(0.2); \n\t\t\t$this->SetDrawColor(0); \n\t\t\t$this->_setTextRendering(0); \n\t\t\t$this->_out('0 Tr'); \n\t\t }\n\t\t else\n\t\t { \n\t\t\t$this->SetLineWidth($width); \n\t\t\t$this->SetDrawColor($r, $g , $b); \n\t\t\t$this->_out('2 Tr'); //Fixed\n\t\t } \n\t\t}", "public function setText($text) {\n $this->TEXT = $text;\n }", "public function setText($value)\n\t{\n\t\t$this->setViewState('Text',$value,'');\n\t}", "public function setFooterText($value)\n {\n if (is_array($value)) {\n $this->fields['options']['footer_text_left'] = $value[0];\n $this->fields['options']['footer_text_center'] = $value[1];\n $this->fields['options']['footer_text_right'] = $value[2];\n } else {\n $this->fields['options']['footer_text_left'] = $value;\n }\n }", "function SetTitleFont() {\r\n $this->SetFont(\"Arial\", \"B\", 16);\r\n $this->SetTextColor(0, 0, 0);\r\n }", "function SetLyricsFont() {\r\n $this->SetFont(\"Arial\", \"\", 14);\r\n $this->SetTextColor(0, 0, 0);\r\n }", "private function writeTextToFile() {\n\t\t$text = $this -> pm -> getText($this -> padid);\n\t\t$path = sprintf('%s/%s.tex', $this -> directory, $this -> name);\n\t\tfile_put_contents($path, $text);\n\t}", "public function setText($text)\r\n {\r\n $this->text = $text;\r\n }", "function title(Printer $printer, $text)\n\t{\n\t $printer -> selectPrintMode(Printer::MODE_EMPHASIZED);\n\t $printer -> text(\"\\n-------- \" . $text.\" --------\\n\");\n\t $printer -> selectPrintMode(); // Reset\n\t}", "function setText($text)\r\n {\r\n $this->text = nl2br($text);\r\n $this->wordCount = str_word_count($text);\r\n }", "public function initialize() {\n // default values\n $this->setText('__notext__');\n $this->setTextFont(array(\n 'family' => 'monospace',\n 'style' => 0,\n 'name' => 'Courier'\n ));\n $this->setHeight(0.8);\n $this->setPosition(array(0, 0));\n $this->setTextColor('#000000');\n\n // default flags\n $this->setAlignment(0);\n }", "function setHeaderText($value) {\n $this->header_text = $value;\n}", "public function setText($text)\n {\n $this->text = $text;\n }", "public function setText($text)\n {\n $this->text = $text;\n }", "public function setText($text)\n {\n $this->text = $text;\n }", "function textOut($x, $y, $text)\r\n {\r\n $this->forceFont();\r\n echo \"$this->_canvas.drawString(\\\"$text\\\", $x, $y);\\n\";\r\n }", "function setBottomAxisTitle($text = '')\n {\n $this->axis_data[1]['t'] = $text;\n }", "public function testSetBarcodeTextPositionDefault()\n {\n $this -> printer -> setBarcodeTextPosition();\n $this -> checkOutput(\"\\x1b@\\x1dH\\x00\");\n }", "public function setText($text)\n {\n $this->_text = $text;\n }", "function clsText($pCont, $pFsize, $pFname=false, $pXpos='L', $pYpos=NULL) {\n $this->content = $pCont;\n $this->font = (strlen($pFname)) ? $pFname : \"../fonts/Helvetica\";\n $this->fontSize = ($pFsize) ? $pFsize : 10;\n $this->xpos = (strlen($pXpos) > 0) ? $pXpos : 30;\n $this->ypos = $pYpos;\n }", "public function setTextoNot($TextoNot) {\n\t\t$this->TextoNot = $TextoNot;\n\t}", "public function setHeaderText($value)\n {\n if (is_array($value)) {\n $this->fields['options']['header_text_left'] = $value[0];\n $this->fields['options']['header_text_center'] = $value[1];\n $this->fields['options']['header_text_right'] = $value[2];\n } else {\n $this->fields['options']['header_text_left'] = $value;\n }\n }", "function text()\n {\n ?>\n <input type=\"text\" <?php $this->name_tag(); ?> value=\"<?php echo esc_attr( $this->setting_value ); ?>\" class=\"inferno-setting\" <?php $this->id_tag(\"inferno-concrete-setting-\"); ?> />\n <?php \n if($this->setting['type'] == 'range') {\n $this->range();\n }\n }", "function TituloCampos()\n\t{\n\t\t\n\t\t$this->SetFillColor(244,249,255);\n\t\t$this->SetDrawColor(195,212,235);\n\t\t$this->SetLineWidth(.2);\n\t\t//dimenciones de cada campo\n\t\t$w=array(10,20,21,74,25,25,18);\n\t\t$header=array(strtoupper(_('nro')),strtoupper(_('nro abo.')),strtoupper(_('cedula')),strtoupper(_('nombre y apellido')),strtoupper(_('Etiqueta')),strtoupper(_('telefono')),strtoupper(_('deuda')));\n\t\t$this->SetFont('Arial','B',8);\n\t\t$this->SetX(10);\n\t\tfor($k=0;$k<count($header);$k++)\n\t\t\t$this->Cell($w[$k],7,$header[$k],1,0,'J',1);\n\t\t$this->Ln();\n\t\treturn $w;\n\t}" ]
[ "0.55859053", "0.5551384", "0.5415094", "0.541367", "0.538857", "0.5364005", "0.5321012", "0.52912205", "0.5222795", "0.52048904", "0.5197245", "0.51955503", "0.51946175", "0.51871604", "0.51569766", "0.51373744", "0.513066", "0.5130305", "0.51299244", "0.51299244", "0.51299244", "0.5128859", "0.5101403", "0.50974506", "0.5056895", "0.5026972", "0.50255966", "0.5024157", "0.50183403", "0.50141764" ]
0.6389534
0
Gets the invitation status
function getInvitation() { return ($this->invitation) ? $this->invitation : self::INVITATION_OFF; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function status()\n {\n return $this->UserAPI->request_status_check();\n }", "function get_status() {\n return $this->status;\n }", "public function get_status() {\n return $this->status;\n }", "public function status()\n {\n return $this->status->get($this->entity->status);\n }", "public function getStatus()\n {\n return $this->getData('status');\n }", "function getStatus() {\n\t\treturn $this->getData('status');\n\t}", "public function get_status() {\n return $this->_status;\n }", "public function get_status(){\n return $this->status;\n }", "public function getStatus()\n {\n return $this->getIfSet('status');\n }", "public function getStatusText($invitation)\n\t{\n\t\treturn Df_Invitation_Model_Source_Invitation_Status::s()\n\t\t\t->getOptionText($invitation->getStatus());\n\t}", "public function getStatus()\n {\n return $this->data['status'];\n }", "public function getChallengerStatus()\n {\n return $this->get(self::_CHALLENGER_STATUS);\n }", "public function getStatus()\n {\n return $this->get(self::_STATUS);\n }", "public function getStatus()\n {\n return $this->get(self::_STATUS);\n }", "public function getStatus()\n {\n return $this->get(self::_STATUS);\n }", "public function getStatus()\n {\n return $this->get(self::_STATUS);\n }", "public function getStatus()\n {\n return $this->get(self::STATUS);\n }", "public function get_friendship_status()\n {\n $this->Friend_model->get_friendship_status_model();\n }", "public function get_status()\n {\n }", "public function get_status()\n {\n }", "public function getStatus(){\n\t\treturn $this->status;\n\t}", "public function status()\n {\n return (\n $this->status\n );\n }", "public function GetStatus()\n\t{\n\t\t// Demnach ist der Status in IPS der einzige der vorliegt.\t\t\n\t}", "public function getInvoiceStatus() {\r\n\t\t$status = array();\r\n\t\t\t$status[0] = array('id' => 0, 'name' => 'Completed'); //done, can not be edited, but not retured\r\n\t\t\t$status[1] = array('id' => 1, 'name' => 'Unfinished'); //still open, can be edited\r\n\t\t\t$status[2] = array('id' => 2, 'name' => 'Returned'); //done, can not be edited, retured\r\n\t\t\t$status[3] = array('id' => 3, 'name' => 'Closed'); //memo only, done, closed out. memo close date updated\r\n\t\t\t$status[4] = array('id' => 4, 'name' => 'Converted'); //memo only, converted\r\n\t\t\t$status[5] = array('id' => 5, 'name' => 'Cancelled'); //layaways only, cancelled\r\n\t\treturn $status;\r\n\t}", "function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function status()\r\n {\r\n return $this->status;\r\n }" ]
[ "0.66709155", "0.6628434", "0.6525393", "0.6509014", "0.64705664", "0.6468077", "0.64651036", "0.6437398", "0.6396965", "0.63882416", "0.63682395", "0.63659906", "0.63656074", "0.63656074", "0.63656074", "0.63656074", "0.63568264", "0.6355809", "0.634385", "0.634385", "0.6333829", "0.63317627", "0.632982", "0.6322815", "0.63178796", "0.6309032", "0.6309032", "0.6300497", "0.6300497", "0.6299898" ]
0.71148944
0
Gets the invitation mode
function getInvitationMode() { include_once "./Services/Administration/classes/class.ilSetting.php"; $surveySetting = new ilSetting("survey"); $unlimited_invitation = $surveySetting->get("unlimited_invitation"); if (!$unlimited_invitation && $this->invitation_mode == self::MODE_UNLIMITED) { return self::MODE_PREDEFINED_USERS; } else { return ($this->invitation_mode) ? $this->invitation_mode : self::MODE_UNLIMITED; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getInvitation() \n\t{\n\t\treturn ($this->invitation) ? $this->invitation : self::INVITATION_OFF;\n\t}", "function getMode() {\n\t\treturn $this->get('mode');\n\t}", "public function getMode();", "public function getMode();", "public function getMode();", "public function getMode();", "public static function getMode();", "public function getAuthMode();", "function getMode()\n {\n return $this->mode;\n }", "protected function getMode() {\n\t\treturn $this->mode;\n\t}", "public function get_mode() {\n global $SESSION;\n if (isset($SESSION->homeworkblockmode)) {\n return $SESSION->homeworkblockmode;\n }\n\n $possiblemodes = $this->get_possible_modes();\n $SESSION->homeworkblockmode = $possiblemodes[0];\n return $possiblemodes[0];\n }", "function getMode() {\n\t\treturn $this->mode;\n\t}", "function setInvitationMode($invitation_mode = 0) \n\t{\n\t\t$this->invitation_mode = $invitation_mode;\n }", "function getMode()\n {\n return $this->mode;\n }", "function getMode() {\n\t\treturn $this->_mode;\n\t}", "function getMode() {\n\t\treturn $this->_mode;\n\t}", "public function getAuthMode() {}", "public function getUserMode()\n {\n return($this->options['userMode']);\n }", "public function getMode()\n {\n $data = $this->soap(\"AVTransport\", \"GetTransportSettings\");\n return Helper::getMode($data[\"PlayMode\"]);\n }", "public function getMode(): string;", "public function getMode()\n {\n return $this->_mode;\n }", "public function getMode()\n {\n return $this->mode;\n }", "public function getMode()\n {\n return $this->mode;\n }", "public function getMode()\n {\n return $this->mode;\n }", "public function getMode()\n {\n return $this->mode;\n }", "public function getMode()\n {\n return $this->mode;\n }", "public function getMode()\n {\n return $this->mode;\n }", "public function getMode()\n {\n return $this->mode;\n }", "public function getMode() {\n return $this->mode;\n }", "public function getMode() {\n return $this->mode;\n }" ]
[ "0.7388144", "0.6612674", "0.64337075", "0.64337075", "0.64337075", "0.64337075", "0.6428552", "0.6425317", "0.63013923", "0.62984306", "0.6289621", "0.628857", "0.6260656", "0.6257267", "0.6250272", "0.6250272", "0.6245971", "0.6237522", "0.62316996", "0.62177527", "0.6198738", "0.61861473", "0.61861473", "0.61861473", "0.61861473", "0.61861473", "0.61861473", "0.61861473", "0.61784446", "0.61726147" ]
0.84966975
0
Checks if the survey can be started
function canStartSurvey($anonymous_id = NULL, $a_no_rbac = false) { global $ilAccess; $result = TRUE; $messages = array(); $edit_settings = false; // check start date if (preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->getStartDate(), $matches)) { $epoch_time = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); $now = mktime(); if ($now < $epoch_time) { array_push($messages,$this->lng->txt('start_date_not_reached').' ('. ilDatePresentation::formatDate(new ilDateTime($this->getStartDate(), IL_CAL_TIMESTAMP)). ")"); $result = FALSE; $edit_settings = true; } } // check end date if (preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->getEndDate(), $matches)) { $epoch_time = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); $now = mktime(); if ($now > $epoch_time) { array_push($messages,$this->lng->txt('end_date_reached').' ('. ilDatePresentation::formatDate(new ilDateTime($this->getEndDate(), IL_CAL_TIMESTAMP)). ")"); $result = FALSE; $edit_settings = true; } } // check online status if ($this->getStatus() == self::STATUS_OFFLINE) { array_push($messages, $this->lng->txt("survey_is_offline")); $result = FALSE; $edit_settings = true; } // check rbac permissions if (!$a_no_rbac && !$ilAccess->checkAccess("read", "", $this->ref_id)) { array_push($messages, $this->lng->txt("cannot_participate_survey")); $result = FALSE; } /* // 2. check previous access if (!$result["error"]) { global $ilUser; $survey_started = $this->isSurveyStarted($ilUser->getId(), $anonymous_id); if ($survey_started === 1) { array_push($messages, $this->lng->txt("already_completed_survey")); $result = FALSE; } } */ return array( "result" => $result, "messages" => $messages, "edit_settings" => $edit_settings ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkPublish(){\n\t\trequire('variables.php');\t\t\n\t\t// check the number of results\n\t\t$numResults = $this->getResults(\"count\");\n\t\t// check the number of questions\n\t\t$numQuestions = $this->getQuestions(\"count\");\n\t\t// check the number of options\n\t\t$listQuestion = explode(',', $this->getQuestions());\n\t\t\n\t\tif($numQuestions != 0){\n\t\t\t$questionState = true;\n\t\t\t$optionState = true;\n\t\t\tforeach($listQuestion as $question){\n\t\t\t\t// check the number of options for this question\n\t\t\t\t$numOptions = $this->getOptions($question, \"count\");\n\t\t\t\tif($numOptions < $VAR_QUIZ_MIN_OPTIONS){\n\t\t\t\t\t$optionState = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t$questionState = false;\n\t\t\t$optionState = false;\n\t\t}\n\t\t// run through the checks, return false if failed\n\t\tif($numResults < $VAR_QUIZ_MIN_RESULT || $numQuestions < $VAR_QUIZ_MIN_QUESTIONS || !$optionState){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "private function canRun()\n {\n if (!$this->apiConfig->isAutoInvoiceEnabled()) {\n return false;\n }\n if (!$this->apiConfig->isEnabled()) {\n return false;\n }\n\n return true;\n }", "public function isStarted() {}", "public function canRun(): bool\n\t{\n\t\tif (!file_exists(JPATH_LIBRARIES . '/Jdideal'))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif (class_exists('RSFormProHelper'))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t$helper = JPATH_ADMINISTRATOR\n\t\t\t. '/components/com_rsform/helpers/rsform.php';\n\n\t\tif (file_exists($helper))\n\t\t{\n\t\t\trequire_once $helper;\n\t\t\tRSFormProHelper::readConfig(true);\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function hasStarted() {\n if($this->state != \"unavailable\" &&\n $this->state != \"available\") {\n \n return true;\n } else {\n return false;\n }\n }", "protected function _canRun()\r\n\t{\r\n\t\t$start\t= strtotime($this->_scheduleStart);\r\n\t\t$stop\t= strtotime($this->_scheduleStop);\r\n\t\t$now\t= time();\r\n\t\t\r\n\t\tif($now > $start && $now < $stop) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function user_can_start_application()\n\t {\n\t \t$response = $this->get('/');\n\t \t$response->assertSeeText('Service record request');\n\t \t$response->assertSeeText('Start now');\n\t }", "public function isStarted(){\n\t\t\treturn isset( $_SESSION );\n\t\t}", "public function isStarted();", "public function isStarted();", "public function isStarted();", "public function isRequiresQuestionId();", "public function isStartable()\n {\n $driver = $this->driver;\n if($driver){\n // Check if car is not disponible\n $hasActiveRide = $driver->ridesDrived()\n ->where('rides.id', '!=', $this->getKey())\n ->where('rides.status', self::STATUS_STARTED)\n ->exists();\n if($hasActiveRide){\n return false;\n }\n }\n \n return !in_array($this->status, [self::STATUS_COMPLETED, self::STATUS_CANCELED]);\n }", "protected function hasStarted()\r\n {\r\n return isset($this->_session[$this->_stepsKey]);\r\n }", "public function isStarted() {\n }", "function can_do_add() {\n //try to obtain the report shortname directly from the url parameter\n //(applies only during the first step of the wizard interface)\n $report_shortname = $this->optional_param('report', '', PARAM_ALPHAEXT);\n\n //try to obtain the report shortname from the workflow information\n //(applies only after the first step of the wizard interface)\n if ($report_shortname == '' && isset($this->workflow)) {\n $data = $this->workflow->unserialize_data();\n if ($data !== NULL && isset($data['report'])) {\n $report_shortname = $data['report'];\n }\n }\n\n if ($report_shortname === '') {\n //report info not found, so disallow\n return false;\n }\n\n //check permissions via the report\n $report_instance = php_report::get_default_instance($report_shortname, NULL, php_report::EXECUTION_MODE_SCHEDULED);\n return $report_instance !== false;\n }", "protected function isInitialInstallationInProgress() {}", "public function canStartSession();", "public function isValid(){\n return (bool) ($this->hasStarted() && !$this->isCancelled());\n }", "public function isReady() {}", "public function checkRegistryRequestsAnswers()\n {\n return $this->tracker && $this->translate && $this->util;\n }", "public function isReady(): bool\n {\n $serverSetting = $this->server->getServerSetting();\n $cronable = (int)$serverSetting['cronable'];\n if ($cronable !== 1) {\n return false;\n }\n\n return true;\n }", "public function checkRegistryRequestsAnswers()\n {\n return $this->trackEngine instanceof \\Gems_Tracker_Engine_TrackEngineInterface;\n }", "public function should_run()\n\t{\n\t\treturn $this->config['delete_pms_last_gc'] < time() - $this->config['delete_pms_gc'];\n\t}", "function check_access() {\n if (!get_site()) {\n return true; // no access check before site is fully set up\n }\n $context = empty($this->context) ? get_context_instance(CONTEXT_SYSTEM) : $this->context;\n foreach($this->req_capability as $cap) {\n if (is_valid_capability($cap) and has_capability($cap, $context)) {\n return true;\n }\n }\n return false;\n }", "public function isValid()\n\t{\n\t\tglobal $modSettings;\n\n\t\treturn !empty($modSettings['sphinx_searchd_server']) && !empty($modSettings['sphinxql_searchd_port']);\n\t}", "public function isReady();", "public function isReady();", "protected function shouldPrompt()\n {\n return !$this->rocketeer->isLocal();\n }", "protected function shouldRun()\n {\n return false === (bool) $this->configurationManager->getConfigurationValueByPath('FE/pageUnavailable_force');\n }" ]
[ "0.6248524", "0.58791304", "0.5841688", "0.58054435", "0.5795621", "0.57929575", "0.57818484", "0.5755406", "0.57543755", "0.57543755", "0.57543755", "0.5734453", "0.5733258", "0.572327", "0.5708975", "0.5685468", "0.56821144", "0.5679504", "0.5671747", "0.5658796", "0.56334823", "0.56265014", "0.56221104", "0.5589772", "0.5589362", "0.5587976", "0.55877256", "0.55877256", "0.55806893", "0.5579955" ]
0.61463207
1
Sets the end date of the survey
function setEndDate($end_date = "") { $this->end_date = $end_date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setEndDate($date)\n\t\t{\n\t\t\t$this->end_date = $date;\n\t\t}", "public function setEndDate(DrupalDateTime $end_date = NULL);", "public function setEndDate($date)\n {\n\t\tif($date==null){\n\t\t\t$this->complete_at = null;\n\t\t\t$this->save();\n\t\t\t$this->fireModelEvent('end-refreshed');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif($this->complete_at){\n\t\t\tif($model->complete_at->greaterThan($date)){\n\t\t\t\t$this->complete_at = $date;\n \t\t$this->save();\n\t\t\t\t$this->fireModelEvent('end-delayed');\n\t\t\t}else{\n\t\t\t\t$this->complete_at = $date;\n \t\t$this->save();\n\t\t\t\t$this->fireModelEvent('end-forwarded');\n\t\t\t}\n\t\t}else{\n\t\t\t$this->complete_at = $date;\n \t$this->save();\n\t\t\t$this->fireModelEvent('end-inited');\n\t\t}\n }", "public function setEndDate(string $date);", "public function setDateEnd($dateEnd)\n {\n $this->dateEnd = VT::toDateTimeImmutable($dateEnd);\n }", "public function setEndDate($date)\n\t{\n\t\treturn $this->setDate('End', $date);\n\t}", "public function setEndDate($value)\n {\n $this->endDate = $value;\n }", "public function setEndDate($end_date)\n {\n $this->json()->end_date = $this->dateToString($end_date);\n }", "public function setEnd(ilDateTime $a_date = null)\n\t{\n\t\t$this->end = $a_date;\n\t}", "public function setEndDate($endDate='')\r\n\t\t{\r\n\t\t\tif ($endDate != '')\r\n\t\t\t{\r\n\t\t\t\t$this->end_date = $endDate;\r\n\t\t\t}\r\n\t\t}", "public function set_end_date($end_date)\n\t{\n\t\tif (is_null($end_date)) {\n\t\t\tthrow new InvalidArgumentException(\"Project End Date Invalid!\");\n\t\t}\n\t\t$this->end_date = $end_date;\n\t}", "public function set_end_date()\n {\n if ($this->end_date === NULL && $this->start_date === NULL) {\n $this->formated_end_date = \"the game has not started yet\";\n } elseif($this->end_date === NULL && $this->start_date !== NULL) {\n $this->formated_end_date = \"the game is not finished yet\";\n } else {\n $end_date = Carbon::createFromTimestamp($this->end_date / 1000);\n $this->formated_end_date = $end_date->toDayDateTimeString();\n }\n return $this->formated_end_date; \n }", "function setEndDate(&$oDate)\n {\n if (is_a($oDate, 'date')) {\n $oDate->setHour(23);\n $oDate->setMinute(59);\n $oDate->setSecond(59);\n $oDate->subtractSeconds(25200);\n }\n }", "public function setEndDate( KCommandContext $context )\n {\n $data = $context->data;\n \n if( $data->day || $data->month || $data->year )\n { \n $date = new KDate();\n \n $date->day( (int) $data->day );\n \n $date->month( (int) $data->month );\n \n $date->year( (int) $data->year );\n \n $data->endDate = $date;\n }\n }", "public function setEndDate(?Date $value): void {\n $this->getBackingStore()->set('endDate', $value);\n }", "public function setDateEnd($var)\n {\n GPBUtil::checkString($var, True);\n $this->dateEnd = $var;\n\n return $this;\n }", "public function setEndDate($endDate) {\n $this->endDate = $endDate;\n }", "public function setEndDate($value) \n {\n $this->_fields['EndDate']['FieldValue'] = $value;\n return $this;\n }", "public function setEndDateAttribute($date)\n {\n $this->attributes['end_date'] = $date ? Carbon::parse($date) : null;\n }", "public function setEndDate($value)\n {\n return $this->set('EndDate', $value);\n }", "public function setEndDate($value)\n {\n return $this->set('EndDate', $value);\n }", "private function _retrieveEndDate()\n {\n global $preferences;\n\n $bdate = new \\DateTime($this->_begin_date);\n if ( $preferences->pref_beg_membership != '' ) {\n //case beginning of membership\n list($j, $m) = explode('/', $preferences->pref_beg_membership);\n $edate = new \\DateTime($bdate->format('Y') . '-' . $m . '-' . $j);\n while ( $edate <= $bdate ) {\n $edate->modify('+1 year');\n }\n $this->_end_date = $edate->format('Y-m-d');\n } else if ( $preferences->pref_membership_ext != '' ) {\n //case membership extension\n $dext = new \\DateInterval('P' . $this->_extension . 'M');\n $edate = $bdate->add($dext);\n $this->_end_date = $edate->format('Y-m-d');\n }\n }", "public function get_end_date()\n\t{\n\t\treturn $this->end_date;\n\t}", "public function setEndDate($endDate) {\n $this->endDate = $endDate;\n }", "public function away_mode_end_date() {\n\n\t\t$current = current_time( 'timestamp' ); //The current time\n\n\t\t//if saved date is in the past update it to something in the future\n\t\tif ( isset( $this->settings['end'] ) && isset( $this->settings['enabled'] ) && $current < $this->settings['end'] ) {\n\t\t\t$end = $this->settings['end'];\n\t\t} else {\n\t\t\t$end = strtotime( date( 'n/j/y 12:00 \\a\\m', ( current_time( 'timestamp' ) + ( 86400 * 2 ) ) ) );\n\t\t}\n\n\t\t//Date Field\n\t\t$content = '<input class=\"end_date_field\" type=\"text\" id=\"itsec_away_mode_end_date\" name=\"itsec_away_mode[away_end][date]\" value=\"' . date( 'm/d/y', $end ) . '\"/><br>';\n\t\t$content .= '<label class=\"end_date_field\" for=\"itsec_away_mode_end_date\"> ' . __( 'Set the date at which the admin dashboard should become available', 'it-l10n-ithemes-security-pro' ) . '</label>';\n\n\t\techo $content;\n\n\t}", "public function setEndDateTime($val)\n {\n $this->_propDict[\"endDateTime\"] = $val;\n return $this;\n }", "public function getEndDate()\r\n\t\t{\r\n\t\t\treturn $this->end_date;\r\n\t\t}", "public function setDateEnd($dateEnd = null)\n {\n $this->dateEnd = $dateEnd;\n\n return $this;\n }", "public function setEndDate($endDate)\n {\n if (is_object($endDate) && $endDate instanceOf \\DateTime) {\n $this->endDate = $endDate;\n } else {\n $this->endDate = new \\DateTime($endDate);\n }\n }", "public function setEnd(\\DateTime $end)\n {\n $this->end = $end;\n return $this;\n }" ]
[ "0.7552366", "0.7495753", "0.73110354", "0.72710156", "0.71122223", "0.7094758", "0.70211405", "0.6998029", "0.69622046", "0.6887356", "0.6838195", "0.6836282", "0.67863035", "0.67216444", "0.6696273", "0.6645639", "0.6629302", "0.6628653", "0.65623134", "0.6527369", "0.6527248", "0.6509095", "0.6419964", "0.640713", "0.6374369", "0.6357536", "0.63178575", "0.6299033", "0.62667954", "0.6259096" ]
0.75255376
1
Gets the learners evaluation access
function getEvaluationAccess() { return ($this->evaluation_access) ? $this->evaluation_access : self::EVALUATION_ACCESS_OFF; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEvaluation()\n {\n return $this->evaluation;\n }", "public function getEvaluations();", "public function evaluation()\n {\n return $this->hasMany('App\\Models\\Evaluation', 'user_id');\n }", "public function getEval()\n {\n return $this->hasOne(InterEvaluadores::className(), ['id' => 'eval_id']);\n }", "public function get_Eval(){\n return $this->eval_note;\n }", "public function getLatestEvaluation()\n {\n return $this->latest_evaluation;\n }", "public function evaluations()\n {\n return $this->hasMany(Evaluation::class);\n }", "public function getEvaluations()\n\t{\n\t\t$this->ensureEvaluationsLoaded();\n\t\treturn new GmthBridgeIterator(new \\ArrayIterator($this->_evaluations),\n\t\t\t$this, '\\PhpExtended\\Gmth\\GmthBridgeEvaluation');\n\t}", "public function evaluation()\n {\n return $this->hasOne(\"App\\Services\\Evaluation\\Evaluation\", 'id_employee', 'id_assessor'); // one to many\n /*ถ้าตอน Query เอา table ไหนเป็นหลัก ตรง model ก็เอา pk ของ table นั้นขึ้นทีหลัง*/\n //return $this->hasMany(\"App\\Services\\Evaluation\\Evaluation\", 'id_assessor', 'id_employee'); // one to many\n }", "public function evaluations()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Evaluation', 'application_id');\n\t}", "public function getExpressionLanguageEvaluator()\n {\n return $this->expressionLanguageEvaluator;\n }", "function setEvaluationAccess($evaluation_access = self::EVALUATION_ACCESS_OFF) \n\t{\n\t\t$this->evaluation_access = ($evaluation_access) ? $evaluation_access : self::EVALUATION_ACCESS_OFF;\n\t}", "public function index()\n {\n \\Gate::authorize('view', 'competences_evaluations');\n $Evaluation = EvaluationCompetency::get();\n return $Evaluation;\n }", "public function getTraining()\n {\n return Wrapper\\Player\\Senior::training($this->getId());\n }", "public function getEvaluatePermissions() {}", "public function evaluate()\n {\n try {\n $client = new Client();\n return $client->get($this->getName());\n } catch (\\Exception $exception) {\n $this->systemLogger->logException($exception);\n return null;\n }\n }", "public function evaluate();", "public function evaluate();", "public function getExam()\n {\n return Mage::registry('current_exam');\n }", "public function estimator() : Estimator\n {\n return $this->estimator;\n }", "function &getInvestigators() {\n\t\treturn $this->investigators;\n\t}", "public function getamountEvaluation()\n {\n return $this->amountevaluation;\n }", "public function getExperiment()\n\t{\n\t\treturn $this->getContext()->getExperiment();\n\t}", "public function getAccessDecisionVoters()\n {\n return $this->accessDecisionVoters;\n }", "public function evaluations()\n {\n return $this->belongsToMany('App\\Evaluation');\n }", "public function showEvaluador_Evaluado()\n\t{\n\t\treturn $this->evaluado_evaluador;\n\t}", "public function getExpressionEvaluationDetails()\n {\n if (array_key_exists(\"expressionEvaluationDetails\", $this->_propDict)) {\n if (is_a($this->_propDict[\"expressionEvaluationDetails\"], \"\\Beta\\Microsoft\\Graph\\Model\\ExpressionEvaluationDetails\") || is_null($this->_propDict[\"expressionEvaluationDetails\"])) {\n return $this->_propDict[\"expressionEvaluationDetails\"];\n } else {\n $this->_propDict[\"expressionEvaluationDetails\"] = new ExpressionEvaluationDetails($this->_propDict[\"expressionEvaluationDetails\"]);\n return $this->_propDict[\"expressionEvaluationDetails\"];\n }\n }\n return null;\n }", "public function getCurrentOptimizer()\n {\n return Mage::registry('current_optimizer');\n }", "public function edit(Evaluation $evaluation)\n {\n return $evaluation;\n }", "public function evaluate($estimatorName)\n {\n // Validate estimator\n if( ! in_array($estimatorName, self::ESTIMATORS) ){\n return [\n 'error' => 'bad estimator'\n ];\n }\n\n // Instanciate estimator\n if( $estimatorName === 'knn'){\n $estimator = new KNearestNeighbors(50, true, new Manhattan());\n } else if ( $estimatorName === 'logistic_regression') {\n $estimator = new LogisticRegression(64, new Adam(0.001), 1e-4, 100, 1e-4, 5, new CrossEntropy());\n } else {\n return 'error bad estimator ' . $estimatorName;\n }\n\n // Get training data\n $dataset = $this->getTrainDataset();\n\n // tranform data\n // $transformer = new L1Normalizer();\n //$dataset->apply($transformer);\n\n //podd($dataset);\n // $estimator->train($trainDataset);\n\n // Evaluate\n $validator = new HoldOut(0.2);\n $score = $validator->test($estimator, $dataset, new Accuracy());\n\n return $score;\n }" ]
[ "0.68336177", "0.6548696", "0.6181854", "0.59480107", "0.59089977", "0.58018655", "0.57445985", "0.57018536", "0.56462437", "0.55913204", "0.54815644", "0.54761964", "0.54085046", "0.54072005", "0.5401963", "0.5399825", "0.53792566", "0.53792566", "0.53648746", "0.53397626", "0.5334481", "0.52459514", "0.52457285", "0.5219562", "0.51911706", "0.51697046", "0.5085485", "0.5076998", "0.5052026", "0.50372505" ]
0.6921279
0
Sets the learners evaluation access
function setEvaluationAccess($evaluation_access = self::EVALUATION_ACCESS_OFF) { $this->evaluation_access = ($evaluation_access) ? $evaluation_access : self::EVALUATION_ACCESS_OFF; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEvaluationAccess() \n\t{\n\t\treturn ($this->evaluation_access) ? $this->evaluation_access : self::EVALUATION_ACCESS_OFF;\n\t}", "public function setEvaluation($evaluation)\n {\n $this->evaluation = $evaluation;\n\n return $this;\n }", "public function evaluation()\n {\n return $this->hasMany('App\\Models\\Evaluation', 'user_id');\n }", "public function __construct(Evaluating $evaluater)\n {\n parent::__construct();\n $this->evaluater = $evaluater;\n }", "public function getEvaluation()\n {\n return $this->evaluation;\n }", "function setInvestigators($investigators) {\n\t\treturn $this->investigators = $investigators;\n\t}", "private function setEnableReviews() {\n $this->product->set_reviews_allowed($this->wcData->isEnableReviews());\n }", "public function setEnableTargetsToSelfUpdateAccess($val)\n {\n $this->_propDict[\"enableTargetsToSelfUpdateAccess\"] = $val;\n return $this;\n }", "public function setBuiltin($builtin = false){\n\t\t$this->builtin = $builtin;\n\t}", "public function setReviewers(?array $value): void {\n $this->getBackingStore()->set('reviewers', $value);\n }", "public function getEvaluations();", "public function __wakeup()\n\t{\n\t $this->boolTrain = FALSE;\n\t}", "public function setTrainingAssignmentPreference($val)\n {\n $this->_propDict[\"trainingAssignmentPreference\"] = $val;\n return $this;\n }", "private function fillTechnicks(){\n\t\t$this->technicks = User::where('is_admin',0)->get();\n\t}", "public function setUsernameWarner($usernameWarner)\n\t{\n\t\t$this->username_warner = $usernameWarner;\n\t}", "public function dataprovider_learningobjectives() {\n // Array for storing our runs.\n $runs = array();\n\n // Records that we will be re-using.\n $sufficientgraderecord = array(\n 'classid' => 100,\n 'grade' => 100,\n 'completestatusid' => STUSTATUS_NOTCOMPLETE,\n 'locked' => 0\n );\n $sufficientgraderecordcompleted = array(\n 'classid' => 100,\n 'grade' => 100,\n 'completestatusid' => STUSTATUS_PASSED,\n 'locked' => 1\n );\n $insufficientgraderecord = array(\n 'classid' => 100,\n 'grade' => 0,\n 'completestatusid' => STUSTATUS_NOTCOMPLETE,\n 'locked' => 0\n );\n\n $sufficientlograderecord = array(\n 'completionid' => 1,\n 'classid' => 100,\n 'grade' => 100,\n 'locked' => 0\n );\n $insufficientlograderecord = array(\n 'completionid' => 1,\n 'classid' => 100,\n 'grade' => 0,\n 'locked' => 0\n );\n\n // Arrays specifying user ids.\n $firstuser = array('userid' => 103);\n $seconduser = array('userid' => 104);\n\n /*\n * run with sufficient enrolment grade but insufficient required LO grade\n */\n\n // Each user has an enrolment record with a sufficient grade.\n $enrolments = array();\n $enrolments[] = array_merge($sufficientgraderecord, $firstuser);\n $enrolments[] = array_merge($sufficientgraderecord, $seconduser);\n\n // Each user has an LO grade record with an insufficient grade.\n $logrades = array();\n $logrades[] = array_merge($insufficientlograderecord, $firstuser);\n $logrades[] = array_merge($insufficientlograderecord, $seconduser);\n\n // Each user has a matching in progress and unlocked record.\n $expectedenrolments = array();\n $expectedenrolments[] = array_merge($sufficientgraderecord, $firstuser);\n $expectedenrolments[] = array_merge($sufficientgraderecord, $seconduser);\n $runs[] = array($enrolments, $logrades, $expectedenrolments, 100);\n\n /*\n * run with insufficient enrolment grade but sufficient required LO grade\n */\n\n // Each user has an enrolment record with an insufficient grade.\n $enrolments = array();\n $enrolments[] = array_merge($insufficientgraderecord, $firstuser);\n $enrolments[] = array_merge($insufficientgraderecord, $seconduser);\n\n // Each user has an LO grade record with a sufficient grade.\n $logrades = array();\n $logrades[] = array_merge($sufficientlograderecord, $firstuser);\n $logrades[] = array_merge($sufficientlograderecord, $seconduser);\n\n // Each user has a matching in progress and unlocked record.\n $expectedenrolments = array();\n $expectedenrolments[] = array_merge($insufficientgraderecord, $firstuser);\n $expectedenrolments[] = array_merge($insufficientgraderecord, $seconduser);\n\n $runs[] = array($enrolments, $logrades, $expectedenrolments, 100);\n\n /*\n * run with sufficient enrolment grade and sufficient required LO grade\n */\n\n // Each user has an enrolment record with a sufficient grade.\n $enrolments = array();\n $enrolments[] = array_merge($sufficientgraderecord, $firstuser);\n $enrolments[] = array_merge($sufficientgraderecord, $seconduser);\n\n // Each user has an LO grade record with a sufficient grade.\n $logrades = array();\n $logrades[] = array_merge($sufficientlograderecord, $firstuser);\n $logrades[] = array_merge($sufficientlograderecord, $seconduser);\n\n // Each user has a matching passed and locked record.\n $expectedenrolments = array();\n $expectedenrolments[] = array_merge($sufficientgraderecordcompleted, $firstuser);\n $expectedenrolments[] = array_merge($sufficientgraderecordcompleted, $seconduser);\n\n $runs[] = array($enrolments, $logrades, $expectedenrolments, 100);\n\n // Return all data.\n return $runs;\n }", "protected function setEngineModules()\n {\n $mods = ModulesModel::getEnabled();\n if ($mods) {\n foreach ($mods as $module) {\n $this->setModules(array($module->name => array(\n 'access' => $module->access\n )\n ));\n }\n }\n }", "public function edit(Evaluation $evaluation)\n {\n return $evaluation;\n }", "public function edit(Evaluation $evaluation)\n {\n //\n }", "public function edit(Evaluation $evaluation)\n {\n //\n }", "public function getAccessDecisionVoters()\n {\n return $this->accessDecisionVoters;\n }", "public function setEnableTargetsToSelfAddAccess($val)\n {\n $this->_propDict[\"enableTargetsToSelfAddAccess\"] = $val;\n return $this;\n }", "public function __construct($training)\n {\n $this->training = $training;\n }", "public function test_manual_field_is_view_or_editable_with_view_edit_permissions_on_userset() {\n global $DB, $CFG;\n\n // Skip test if elis/program doesn't exist.\n if (!file_exists($CFG->dirroot.'/elis/program/lib/setup.php')) {\n $this->markTestSkipped('Requires elis/program to be installed.');\n }\n\n $this->resetAfterTest(true);\n $this->load_libraries_for_additional_tests();\n // Load CSV data.\n $this->load_csv_data();\n\n // Setup place holders for capabilities.\n $editcap = 'elis/program:user_edit';\n $viewcap = 'elis/program:user_view';\n\n // Retrieve the PM user id to be assigned to a userset\n $param = array('id' => 103);\n $pmuserinusersetid = $DB->get_field('crlm_user', 'id', $param);\n\n // Retrieve the user who will be assigned a role in the user set.\n $param = array('id' => 101);\n $userroleinuserset = $DB->get_record('user', $param);\n // Set user with role as logged in user\n $this->setUser($userroleinuserset);\n\n // Get the userset context.\n $usersetcontext = context_elis_userset::instance(1);\n // System context.\n $syscontext = context_system::instance();\n\n // Create role and assign capabilites to it.\n $roleid = create_role('testrole', 'testrole', 'testrole');\n assign_capability($editcap, CAP_ALLOW, $roleid, $syscontext->id);\n assign_capability($viewcap, CAP_ALLOW, $roleid, $syscontext->id);\n\n // Assin role to user in the userset context.\n role_assign($roleid, $userroleinuserset->id, $usersetcontext->id);\n\n // Add user to cluster/userset.\n $usersetassign = new clusterassignment(array('clusterid' => 1, 'userid' => $pmuserinusersetid, 'plugin' => 'manual'));\n $usersetassign->save();\n\n $field = new field(array('id' => 101));\n $field->load();\n\n $result = manual_field_is_view_or_editable($field, $syscontext, $editcap, $viewcap, 'user', $pmuserinusersetid);\n\n $this->assertEquals(MANUAL_FIELD_EDITABLE, $result);\n }", "protected function setTrainer(array $input)\n {\n $this->updateByPrimary($input);\n }", "public function testSetGeneAccession() {\n\t\techo (\"\\n********************Test SetGeneAccession()*************************************************\\n\");\n\t\t\n\t\t$this->gene->setGeneAccession ( 'setGeneAccession' );\n\t\t$this->assertEquals ( 'setGeneAccession', $this->gene->getGeneAccession () );\n\t}", "public function setClassLoaders($classLoaders);", "public function setAssignments($val)\n {\n $this->_propDict[\"assignments\"] = $val;\n return $this;\n }", "public function setAccessRecommendation(?string $value): void {\n $this->getBackingStore()->set('accessRecommendation', $value);\n }", "public function set() {\n\t\t$this->token = uniqid(rand(), true);\n\n\t\t$this->time = time();\n\n\t\t$this->$referer = $_SERVER['HTTP_REFERER'];\n\n\t\tif ($this->isEnable()) {\n\t\t\t$_SESSION['token'] = $this->token;\n\t\t\t$_SESSION['token_time'] = $this->time;\n\t\t\t$_SESSION['token_referer'] = $this->$referer;\n\t\t}\n\t}" ]
[ "0.571513", "0.51895964", "0.48469186", "0.47711268", "0.46837318", "0.4634676", "0.46277338", "0.46116176", "0.45736465", "0.4571853", "0.45556095", "0.45538", "0.451422", "0.4508581", "0.44939393", "0.44933492", "0.44925848", "0.44841552", "0.44641665", "0.44641665", "0.44344795", "0.44088793", "0.4407412", "0.43962193", "0.43914083", "0.43887982", "0.4379446", "0.43750757", "0.4344536", "0.4329067" ]
0.684687
0
Gets the outro text
function getOutro() { return (strlen($this->outro)) ? $this->outro : NULL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTELEFONOC()\r\n {\r\n return $this->TELEFONOC;\r\n }", "public function getPromoText()\n {\n return isset($this->promo_text) ? $this->promo_text : '';\n }", "public function getTexto() {\n return $this->texto;\n }", "function getRTETextWithMediaObjects()\n\t{\n\t\t$text = parent::getRTETextWithMediaObjects();\n\t\treturn $text;\n\t}", "public function getText()\n {\n if (!isset($this->_text)) {\n $this->_text = \"\";\n $pageDoc = $this->getPageComment();\n $match = $match2 = array();\n if (preg_match('/(?:\\/\\*\\*|^)[\\s\\*\\r\\f\\n]*\\S.*?[\\r\\f\\n]/', $pageDoc, $match)) {\n if (preg_match('/[\\s\\*\\r\\f\\n]([^@\\{]+)/si', $pageDoc, $match2, 0, mb_strlen($match[0]))) {\n $this->_text = trim(preg_replace('/^\\s*\\*\\s*/Um', '', $match2[1]));\n }\n }\n }\n return $this->_text;\n }", "public function subtitle()\n\t{\n\t\t// Get current language\n $lang = Config::get('app.locale');\n if($lang == \"ar\")\n\t\t\treturn nl2br($this->subtitle_ar);\n\t\telse\n\t\t\treturn nl2br($this->subtitle);\n\t}", "public function getPrintArea() {}", "public function getTextoNot() {\n\t\treturn $this->TextoNot;\n\t}", "public function get_text()\n {\n }", "public function getTextWidth() {}", "public static function getClipboardText(int $monitor) : string {}", "function txt_windowstounix($t=\"\")\n\t{\n\t\t// windows\n\t\t$t = str_replace( \"\\r\\n\" , \"\\n\", $t );\n\t\t// Mac OS 9\n\t\t$t = str_replace( \"\\r\" , \"\\n\", $t );\n\t\treturn $t;\n\t}", "public function getInterfaceText();", "function getNota_txt()\n {\n $nota_txt = 'Hollla';\n $id_situacion = $this->getId_situacion();\n switch ($id_situacion) {\n case '3': // Magna\n $nota_txt = 'Magna cum laude (8,6-9,5/10)';\n break;\n case '4': // Summa\n $nota_txt = 'Summa cum laude (9,6-10/10)';\n break;\n case '10': // Nota numérica\n $num = $this->getNota_num();\n $max = $this->getNota_max();\n $nota_txt = $num . '/' . $max;\n if ($max == 10) {\n if ($num > 9.5) {\n $nota_txt .= ' ' . _(\"Summa cum laude\");\n } elseif ($num > 8.5) {\n $nota_txt .= ' ' . _(\"Magna cum laude\");\n }\n }\n break;\n default:\n $oNota = new Nota($id_situacion);\n $nota_txt = $oNota->getDescripcion();\n break;\n }\n return $nota_txt;\n }", "public function getText()\n {\n return isset($this->Text) ? $this->Text : null;\n }", "private function getTitleText() {\n\t\t$titleText = $this->getOutput()->getProperty( 'wikibase-titletext' );\n\n\t\tif ( $titleText === null ) {\n\t\t\t$titleText = $this->getTitle()->getPrefixedText();\n\t\t}\n\n\t\treturn $titleText;\n\t}", "public function subtitle()\n {\n return null;\n }", "public function getText()\n {\n return $this->text();\n }", "public function getText()\n {\n return $this->text();\n }", "public function getNomeArea() {\n return $this->_nome; \n }", "public function getText()\n {\n return $this->traitGetText();\n }", "public function getBodyText();", "public function getPageText() {\r\n\t\t\t// get page text from database or code\r\n\t\t\treturn USE_DATABASE ? $this->getPageTextFromDatabase() : $this->getPageTextFromCode();\r\n\t\t}", "public function getPreview()\n {\n $text_cut = mb_substr($this->getContent(), 0, 100);\n return $text_cut;\n }", "function get_text()\n {\n if ( !$this->_converted ) {\n $this->_convert();\n }\n\n return $this->text;\n }", "public function getCustomizeText(){\n\n $text = Mage::getStoreConfig(self::XPATH_CONFIG_INSTALLMENT_TEXT);\n if(!empty($text)){\n return $text;\n }\n return __('Juros');\n }", "public function getText()\n\t{\n\t\treturn $this->text;\n\t}", "public function getText()\n\t{\n\t\treturn $this->text;\n\t}", "public function getTopLevelGlyphs() {}", "public function getTextPosition()\n\t{\n\t\treturn $this->textPosition;\n\t}" ]
[ "0.61685777", "0.5809633", "0.56569386", "0.56552404", "0.56225187", "0.5616014", "0.5593915", "0.55923796", "0.55895823", "0.55877066", "0.5496914", "0.54765034", "0.54526955", "0.54436755", "0.5430024", "0.54265815", "0.5426262", "0.5425677", "0.5425677", "0.54237324", "0.5423332", "0.54230225", "0.5415655", "0.54151434", "0.54138756", "0.5401837", "0.53988194", "0.53988194", "0.53951615", "0.53734183" ]
0.7135206
0
Gets the question id's of the questions which are already in the survey
function &getExistingQuestions() { global $ilDB; $existing_questions = array(); $result = $ilDB->queryF("SELECT svy_question.original_id FROM svy_question, svy_svy_qst WHERE " . "svy_svy_qst.survey_fi = %s AND svy_svy_qst.question_fi = svy_question.question_id", array('integer'), array($this->getSurveyId()) ); while ($data = $ilDB->fetchAssoc($result)) { if($data["original_id"]) { array_push($existing_questions, $data["original_id"]); } } return $existing_questions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getQuestionIds(){\n\t\treturn array('todo'); // This will be moved to QuestionTemplate\n\t}", "public function getQuestionIds ($quiz=\"\") \n {\n \tglobal $debug;\n \t\n \t// if $quiz not specified get all questions in db (even those with no quiz)\n \t// Initial sql without where - add where part later if required\n \t$sql = \"SELECT \".$this->table_prefix.$this->quiz_tables['questions'].\".questionid, quizname FROM \". $this->table_prefix.$this->quiz_tables['questions']. \" LEFT OUTER JOIN \".$this->table_prefix.$this->quiz_tables['rel'].\" on \".$this->table_prefix.$this->quiz_tables['questions'].\".questionid=\".$this->table_prefix.$this->quiz_tables['rel'].\".questionid\";\n \tif (isset ($debug) && $debug) {print \"SQL: \\n\".$sql.\"\\n\\n\";}\n \t\n \t// if we limit to a quiz then handle here\n \tif ($quiz!=\"\")\n \t{\n \t\t// add a where clause - no security checking here - it needs to be done at a higher level\n \t\t$sql .= \" WHERE \".$this->table_prefix.$this->quiz_tables['rel'].\".quizname=\\\"$quiz\\\"\";\n \t}\n \t\n \t// Get all the rows into a temp array - we then reformat appropriately (eg. move quizname into array instead of individual rows\n \t\n \t$temp_array = $this->db_object->getRowsAll ($sql);\n \t// check for errors\n \tif (isset ($temp_array['ERRORS'])) \n \t{\n \t\t//-here userfriendly handling?\n \t\tif ($debug) {print \"Error in getQuestionIds \\n\";}\n \t\t$err = Errors::getInstance();\n \t\t$err->errorEvent(ERROR_DATABASE, \"Error reading database\"+$temp_array['ERRORS']);\n\n \t}\n \t\n \t// New array that we return from the function - std 1 dimension\n \t$return_array = array();\n\n \t//print \"DEBUG\\n\";\n \t//print_r ($temp_array);\n \t\n \t// iterate over all arrays - set so we only have one question\n \tforeach ($temp_array as $this_array)\n \t{\n \t\t// pull this out of array as we will use a few times and makes easier to read\n \t\t$this_question_id = $this_array['questionid'];\n \t\t// does this question already exist - if so ignore\n \t\tif (!in_array ($this_question_id, $return_array))\n \t\t{\n \t\t\t$return_array[] = $this_question_id;\n \t\t}\n \t}\n \treturn $return_array;\n }", "protected function GetPreviousQuestionIDs()\n {\n $previousQuesIds = array();\n $allQAs = $this->GetAllQAs();\n \n foreach ($allQAs as $qa)\n {\n $previousQuesIds[] = $qa->GetQuestionId();\n }\n \n return $previousQuesIds;\n }", "public function getResponsesId()\n\t{\n\t\t$prefix = $this->Db->TablePrefix;\n\t\t$query = \"\n\t\t\t\tSELECT id\n\t\t\t\tFROM {$prefix}surveys_response\n\t\t\t\tWHERE\n\t\t\t\t\tsurveys_id = {$this->id}\n\t\t\t\tORDER BY\n\t\t\t\t\tid\n\t\t\t\t;\";\n\n\t\t$result = $this->Db->Query($query);\n\n\t\t$return = array();\n\t\t$counter = 1;\n\t\twhile ($row = $this->Db->Fetch($result)) {\n\t\t\t$return[$counter] = $row['id'];\n\t\t\t$counter++;\n\t\t}\n\n\t\t// get a list of responses\n\t\treturn $return;\n\t}", "public function getQuestionIds()\r\n{\r\n $query_string = \"SELECT questionid FROM questions \";\r\n $query_string .= \"WHERE question = :question AND questionid != :questionid\";\r\n\r\n return $query_string;\r\n}", "private function myQid(){\r\n\t\t$this->db->where('uid', $this->uid);\r\n\t\t$this->db->select('id');\r\n\t\t$this->db->from('wen_answer');\r\n\t\t$tmp = $this->db->get()->result_array();\r\n\t\t$return = array();\r\n\t\tforeach($tmp as $r){\r\n\t\t\t$return[$r['id']] = 1;\r\n\t\t}\r\n\t\treturn $return;\r\n\t}", "public static function getApplicationQuestionIds(MongoId $jobId);", "function get_survey_questions($survey_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated survey answers\r\n $sql = \"SELECT id\r\n FROM questions\r\n WHERE is_active = '1' AND survey = '$survey_id';\";\r\n\r\n $questions_data = array();\r\n $questions = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $questions_data[$key] = $value;\r\n foreach ($questions_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $questions[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $questions;\r\n}", "function getQuizResourceIDs ($Quiz_lesson_id, $tp_id) {\n\t\t$Quiz_sql = \"SELECT * FROM `tme_question` WHERE `LessonID` = '$Quiz_lesson_id' AND `tpname` = '$tp_id' ORDER BY `order` ASC \";\n\t\t$Q_res_rows = mysql_query($Quiz_sql);\n\t\treturn $Q_res_rows;\n\t}", "public static function winnersIds()\n {\n return DB::table('competitionentries')->where('winner', '=', 1)->get();\n }", "function getSurveyId()\n\t{\n\t\treturn $this->survey_id;\n\t}", "function &getSurveyFinishedIds()\n\t{\n\t\tglobal $ilDB, $ilLog;\n\t\t\n\t\t$users = array();\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\tif ($result->numRows())\n\t\t{\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\tarray_push($users, $row[\"finished_id\"]);\n\t\t\t}\n\t\t}\n\t\treturn $users;\n\t}", "public function getPracticeSkillIds()\n {\n $ids = array();\n foreach ($this->practice_skills as $skill) {\n $ids[] = $skill->id;\n }\n \n return $ids;\n }", "public function getSimilarIds()\n {\n return $this->similar_ids;\n }", "public function PullNextQuestionID()\n {\n $questionID = 0;\n \n $foundNextQues = FALSE;\n $lvlQAs = $this->GetLvlQAs();\n \n for($index = 0; $index < count($lvlQAs) && !$foundNextQues; $index++)\n {\n $lvlQA = $lvlQAs[$index];\n \n if(!$lvlQA->IsAnswerIdSet())\n {\n $foundNextQues = TRUE;\n $questionID = $lvlQA->GetQuestionId();\n }\n }\n \n return $questionID;\n }", "public function get_id_question()\n\t{\n\t\treturn $this->id_question;\n\t}", "function ipal_get_questions_student($qid){\r\n\r\n global $ipal;\r\n global $DB;\r\n global $CFG;\r\n\t\t$q='';\r\n\t\t$pagearray2=array();\r\n\t\t\r\n $aquestions=$DB->get_record('question',array('id'=>$qid));\r\n\t\t\tif($aquestions->questiontext != \"\"){ \r\n\r\n\t$pagearray2[]=array('id'=>$qid, 'question'=>$aquestions->questiontext, 'answers'=>ipal_get_answers_student($qid));\r\n\t\t\t\t\t\t\t}\r\n return($pagearray2);\r\n}", "function getQuestions() { \n\ttry {\n\t\t$questions = ORM::for_table('questions')->find_many();\n\t\tif (!count($questions)) { \n\t\t\treturn 0;\n\t\t}\n\t\t$theQuestions = array();\n\t\tforeach ($questions as $question) { \n\t\t\t$theQuestion = array();\n\t\t\t$theQuestion['id'] = $question->id;\n\t\t\t$theQuestion['text'] = $question->text;\n\t\t\t$theQuestion['answer1'] = $question->answer1;\n\t\t\t$theQuestion['answer2'] = $question->answer2;\n\t\t\t$theQuestions[] = $theQuestion;\n\t\t}\n\t\treturn $theQuestions;\n\t} catch (Exception $e) { \n\t\treturn 0;\n\t}\n}", "public function get_questionReferences() {\n return $this->questionReferences;\n }", "function saveQuestionArray($questions, $project_id) {\n\n\t// Loop through questions array, do Insert query for each\n\t$questions_ids = array();\n\n\t$i = 0;\n\tforeach($questions as $question) {\n\t\t$i++;\n\n\t\tDB::insert('question', array(\n\t\t\t'question_project_id' => $project_id,\n\t\t\t'question_title' => $question,\n\t\t\t'question_number' => $i\n\t\t));\n\n // Get the inserted question ID, needed to insert questions\n $question_id = DB::insertId();\n\n // Get the inserted question_id and add to return array\n array_push($questions_ids, DB::insertId());\n\n // TODO do this on seperate question assign page\n // NOTE also insert questions_has_experts to simulate the assigning experts process\n DB::insert('question_has_experts', array(\n 'user_id' => 2,\n 'question_id' => $question_id\n ));\n\n\t}\n\n\t// Return the project ID\n\treturn $questions_ids;\n}", "function alreadyAnswered($sender, $questionId) {\r\n\r\n\tglobal $db;\r\n\t$sql = \"SELECT DISTINCT survey_data.id FROM survey_data, (SELECT choices.id AS cid FROM choices WHERE question_id =\".$questionId.\") AS c WHERE survey_data.sms_number = '\".$sender.\"' AND c.cid=survey_data.choice_id\";\r\n\r\n\t// $result = mysql_query($sql);\r\n\tif(!$db) connectDb();\r\n\ttry {\r\n\t\t$result = $db->query($sql)->fetch(PDO::FETCH_OBJ);\r\n\t}\r\n\tcatch (PDOException $e) {\r\n\t\t$error = $e->getMessage();\r\n\t}\r\n\r\n\tif($result) \r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n}", "function &getQuestionblockQuestionIds($questionblock_id)\n\t{\n\t\tglobal $ilDB;\n\t\t$result = $ilDB->queryF(\"SELECT question_fi FROM svy_qblk_qst WHERE questionblock_fi = %s\",\n\t\t\tarray(\"integer\"),\n\t\t\tarray($questionblock_id)\n\t\t);\n\t\t$ids = array();\n\t\tif ($result->numRows())\n\t\t{\n\t\t\twhile ($data = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\tarray_push($ids, $data['question_fi']);\n\t\t\t}\n\t\t}\n\t\treturn $ids;\n\t}", "function deduce_question_id($question) {\n if(is_array($question))\n if(is_array($question['pytanie']))\n $question = isSet($question['pytanie']['id_pytania'])? \n $question['pytanie']['id_pytania'] : null;\n else\n $question = isSet($question['id_pytania']) ? $question['id_pytania'] : null;\n \n return $question;\n}", "private function getAnswers($question){\n $answerModel = new Answer();\n $answers = $answerModel->where('id_qst',$question->id_qst)->findAll();\n $retMess = \"\";\n $this->answersId = [];\n foreach($answers as $answer){\n array_push($this->answersId,$answer->id_ans);\n $retMess .= \",\".$answer->text;\n }\n\n return $retMess;\n }", "function get_survey_questions($survey_id)\n {\n $this->db->join('survey_survey_questions', 'survey_survey_questions.question_id = ' . $this->get_table_name() . '.question_id', 'LEFT');\n\n $this->db->where('survey_survey_questions.survey_id', $survey_id);\n \n return $this->db->get($this->get_table_name());\n }", "public function ask_get_unanswered_questions()\n\t{\n\t\t$sql = \"SELECT *\n\t\t\t\tFROM \".$this->table_ask.\"\n\t\t\t\tWHERE id NOT IN \n\t\t\t\t(SELECT id_quest FROM `aa_ask` WHERE id_quest != -1) \n\t\t\t\tAND id_quest = -1\";\n\t\t$query = $this->db->query($sql);\n\t\t$res = $query->result();\n\t\tfor( $i=0; $i<count($res); $i++ ) {\n\t\t\t$res[$i]->nb_ans = $this->ask_get_nb_answers($res[$i]->id);\n\t\t\t$res[$i]->nb_views = $this->ask_get_nb_views($res[$i]->id);\n\t\t\t$val = $this->votesManager->votes_get_by_ask($res[$i]->id);\n\t\t\t$res[$i]->nb_votes = ($val) ? $val:0;\n\t\t}\n\t\tif( $query->result() != NULL )\n\t\t\treturn $query->result();\n\t\telse\n\t\t\treturn 0;\n\t}", "public static function getIdsInUse() {\n global $wpdb;\n $products = Cart66Common::getTableName('products');\n $sql = \"SELECT gravity_form_id as gfid from $products where gravity_form_id > 0\";\n $ids = $wpdb->get_col($sql);\n return $ids;\n }", "public function getQuestionId() {\n\t\treturn $this->questionId;\n\t}", "function ipal_get_questions(){ \r\n \r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\tglobal $CFG;\r\n\t$q='';\t\r\n\t$pagearray2=array();\r\n\t // is there an quiz associated with an ipal?\r\n//\t$ipal_quiz=$DB->get_record('ipal_quiz',array('ipal_id'=>$ipal->id));\r\n\t\r\n\t// get quiz and put it into an array\r\n\t$quiz=$DB->get_record('ipal',array('id'=>$ipal->id));\r\n\t\r\n\t//Get the question ids\r\n\t$questions=explode(\",\",$quiz->questions);\r\n\t\r\n\t//get the questions and stuff them into an array\r\n\t\tforeach($questions as $q){\t\r\n\t\t\t\r\n\t\t $aquestions=$DB->get_record('question',array('id'=>$q));\r\n\t\t if(isset($aquestions->questiontext)){\r\n\t\t $pagearray2[]=array('id'=>$q, 'question'=>strip_tags($aquestions->questiontext), 'answers'=>ipal_get_answers($q));\r\n\t\t\t\t \r\n\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t}\r\n \r\n\treturn($pagearray2);\r\n\t}", "public static function getQuestionsAndAnswersForQuestionHistory($inQuestionIdArray){\n\n $returnArray = array(\n 'Result' => 0,\n 'Reason' => \"\",\n 'QuestionResponses' => array()\n );\n\n //validate question array, must have real integers in it\n if(validate::isNotNullOrEmpty_Array($inQuestionIdArray)){\n $containsAllInts = validate::arrayContainAllIntegerValues($inQuestionIdArray);\n if(!$containsAllInts){\n $returnArray['Result'] = 0;\n $returnArray['Reason'] = \"Invalid input.\";\n $inMessage = \"QuestionIdArray did not have all integers in it \".__METHOD__.\"() . \";\n util_errorlogging::LogGeneralError(enum_LogType::Normal, $inMessage, __METHOD__, __FILE__);\n return $returnArray;\n }\n }\n else{\n $returnArray['Result'] = 0;\n $returnArray['Reason'] = \"Invalid input.\";\n $inMessage = \"QuestionIdArray was empty or null in \".__METHOD__.\"() . \";\n util_errorlogging::LogGeneralError(enum_LogType::Normal, $inMessage, __METHOD__, __FILE__);\n return $returnArray;\n }\n\n $questionObjects = question::getAllQuestionsByIds($inQuestionIdArray);\n\n if(count($questionObjects) > 0){\n $responsesArray = self::buildQuestionsAndAnswersArray($questionObjects);\n $returnArray['Result'] = 1;\n $returnArray['QuestionResponses'] = $responsesArray;\n }\n else{\n $returnArray['Result'] = 0;\n $returnArray['Reason'] = \"No questions were found\";\n }\n\n return $returnArray;\n }" ]
[ "0.675986", "0.66616476", "0.6490877", "0.6422709", "0.6293247", "0.61073726", "0.5989688", "0.5893872", "0.58531857", "0.5794064", "0.5775117", "0.5752679", "0.57375944", "0.5723745", "0.56815803", "0.5681364", "0.5671463", "0.5641371", "0.5634838", "0.56335217", "0.5630901", "0.5628875", "0.5589312", "0.55717355", "0.55705136", "0.5558615", "0.5558175", "0.55570346", "0.555126", "0.55136466" ]
0.75862706
0
Get the titles of all available survey question pools
function &getQuestionpoolTitles($could_be_offline = FALSE, $showPath = FALSE) { include_once "./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php"; return ilObjSurveyQuestionPool::_getAvailableQuestionpools($use_object_id = TRUE, $could_be_offline, $showPath); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function titleQuery() {\n $titles = [];\n\n $groupContent = $this->groupContentStorage->loadMultiple($this->value);\n foreach ($groupContent as $content) {\n $titles[] = $content->label();\n }\n return $titles;\n }", "public function getTitleList()\n {\n return $this->getAllExternal('res.partner.title');\n }", "public function getPools()\n\t{\n\t\t$pools = array();\n\t\t$result = '';\n\t\t\n\t\tswitch( $this->db_link->getDriver() )\n\t\t{\n\t\t\tcase 'sqlite':\n\t\t\tcase 'mysql':\n\t\t\t\t$query \t\t= \"SELECT name, numvols, poolid FROM Pool\";\n\t\t\tbreak;\n\t\t\tcase 'pgsql':\n\t\t\t\t$query \t\t= \"SELECT name, numvols, poolid FROM pool\";\n\t\t\tbreak;\n\t\t}\n\n\t\t$result = $this->db_link->runQuery($query);\n\t\tforeach( $result->fetchAll() as $pool )\n\t\t\t$pools[] = $pool;\n\n\t\treturn $pools;\n\t}", "public function getTitlesList() {\n return $this->_get(2);\n }", "public function getTitles(): array {\n return $this->configVars['site']['titles'];\n }", "public static function getTitles( )\n {\n // get array with data. Through DAO this will be a bit of quicker.\n $query = 'SELECT id, title FROM ' . static::tableName();\n $records = Yii::app()\n ->db\n ->createCommand( $query )\n ->queryAll();\n\n // prepare result array\n $data = array();\n foreach( $records as $record ) {\n $data[ $record[ 'id' ] ] = $record[ 'title' ];\n }\n\n return $data;\n }", "public function getAllTitles() {\n $stmt = $this->conn->prepare(\"SELECT title FROM titles\");\n $stmt->execute(); //prepared statements\n $arrayOfTitles = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $arrayOfTitles;\n }", "public function titleQuery() {\n $titles = [];\n\n $results = $this->database->query('SELECT cr.vid, cr.nid, cr.title FROM {catalog_item_revision} cr WHERE cr.vid IN ( :vids[] )', [':vids[]' => $this->value])->fetchAllAssoc('vid', PDO::FETCH_ASSOC);\n $nids = [];\n foreach ($results as $result) {\n $nids[] = $result['nid'];\n }\n\n $catalog_items = $this->catalog_itemStorage->loadMultiple(array_unique($nids));\n\n foreach ($results as $result) {\n $catalog_items[$result['nid']]->set('title', $result['title']);\n $titles[] = $catalog_items[$result['nid']]->label();\n }\n\n return $titles;\n }", "function title_query() {\n $names = array();\n\n $result = db_select('fooaggregator_feed', 'f')\n ->fields('f', array('title'))\n ->condition('f.fid', $this->value, 'IN')\n ->execute();\n foreach ($result as $o) {\n $names[] = check_plain($o->title);\n }\n\n return $names;\n }", "public function getTitles()\n {\n if ( !array_key_exists('titles', $this->_options) ) {\n $this->_options['titles'] = array();\n }\n return $this->getOption('titles');\n }", "public function getTitles(): array\n {\n return $this->titles;\n\t}", "public function getSalespersonAllQuestions() {\n return $this->_salespersonDatasource->getSalespersonAllQuestions();\n }", "public function multiLoadTitles() {\n\t\t$table = self::table;\n\t\t\n\t\t$query = <<<SQL\nSELECT `id`, `course`, `number`, `title` FROM `%s{$table}` ORDER BY `title` ASC\nSQL;\n\n\t\treturn $this->clean($this->getUsingQuery($query));\n\t}", "public function get_title_displays() {\n\n $instance = Envira_Gallery_Common::get_instance();\n return $instance->get_title_displays();\n\n }", "private function _Questions ( ) {\n\t\t$Config = $this->Get ( 'Config' );\n\t\t$quests = $Config['questions'];\n\t\t$groups = $Config['question_groups'];\n\t\tforeach ( $groups as $g => $group ) {\n\t\t\t$Groups[$group] = new stdClass();\n\t\t\t$Groups[$group]->Label = $Config['question_group_labels'][$g];\n\t\t\tforeach ( $quests as $q => $quest ) {\n\t\t\t\tif ( $Config['question_group'][$q] != $g ) continue;\n\t\t\t\t$Groups[$group]->Questions[$quest] = new stdClass();\n\t\t\t\t$Groups[$group]->Questions[$quest]->Label = $Config['question_labels'][$q];\n\t\t\t\t$Groups[$group]->Questions[$quest]->Type = $Config['question_types'][$q];\n\t\t\t\t$Groups[$group]->Questions[$quest]->Field = $Config['question_fields'][$q];\n\t\t\t\t$Groups[$group]->Questions[$quest]->Social = $Config['question_social'][$q];\n\t\t\t\t$Groups[$group]->Questions[$quest]->Display = $Config['question_display'][$q];\n\t\t\t\tif ( $Config['question_options'][$q] )\n\t\t\t\t\t$Groups[$group]->Questions[$quest]->Options = explode ( '|', $Config['question_options'][$q] );\n\t\t\t}\n\t\t\tksort ( $Groups[$group]->Questions );\n\t\t}\n\t\tksort ( $Groups );\n\t\treturn ( $Groups );\n\t}", "public function getPreDefinedQuestions()\n {\n return [\n \"1\" => \"Select a Security Question\",\n \"2\" => \"What was your childhood nickname?\",\n \"3\" => \"What is the name of your favorite childhood friend?\",\n \"4\" => \"What was the name of your first stuffed animal?\",\n \"5\" => \"Where were you when you had your first kiss?\",\n \"6\" => \"What is the name of the company of your first job?\",\n \"7\" => \"What was your favorite place to visit as a child?\",\n \"8\" => \"What was your dream job as a child?\",\n \"9\" => \"What is your preferred musical genre?\",\n \"10\" => \"What is your favorite team?\",\n \"11\" => \"What is your father\\\"s middle name?\"\n ];\n }", "function ipal_get_questions(){ \r\n \r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\tglobal $CFG;\r\n\t$q='';\t\r\n\t$pagearray2=array();\r\n\t // is there an quiz associated with an ipal?\r\n//\t$ipal_quiz=$DB->get_record('ipal_quiz',array('ipal_id'=>$ipal->id));\r\n\t\r\n\t// get quiz and put it into an array\r\n\t$quiz=$DB->get_record('ipal',array('id'=>$ipal->id));\r\n\t\r\n\t//Get the question ids\r\n\t$questions=explode(\",\",$quiz->questions);\r\n\t\r\n\t//get the questions and stuff them into an array\r\n\t\tforeach($questions as $q){\t\r\n\t\t\t\r\n\t\t $aquestions=$DB->get_record('question',array('id'=>$q));\r\n\t\t if(isset($aquestions->questiontext)){\r\n\t\t $pagearray2[]=array('id'=>$q, 'question'=>strip_tags($aquestions->questiontext), 'answers'=>ipal_get_answers($q));\r\n\t\t\t\t \r\n\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t}\r\n \r\n\treturn($pagearray2);\r\n\t}", "public static function getAllTitles() {\n return WebContents::all();\n }", "function getGetTitles() {\n return $this->getTitles;\n }", "private function getJobTitleList() {\n $jobTitleList = $this->getJobTitleService()->getJobTitleList();\n $list = array(\"\" => __('All'));\n foreach ($jobTitleList as $jobTitle) {\n $list[$jobTitle->getId()] = $jobTitle->getJobTitleName();\n }\n return $list;\n }", "public function displayQuestions() {\n $listQuestions = array();\n $sql = 'SELECT `id`, `question`, `picture` FROM `' . self::PREFIX . 'question`';\n $result = $this->db->query($sql);\n $listQuestions = $result->fetchAll(PDO::FETCH_OBJ);\n return $listQuestions;\n }", "public function getPageTitles() {\n\n\t\t\t$sql = new DB_Sql();\n\t\t\t$sql->connect();\n\n\t\t\t$query = \"SELECT title FROM webmatrix_user_pages WHERE template = \".$this->subject_tpl_id.\"\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t// build array from page titles\n\t\t\t$page_titles = array();\n\t\t\tif ($sql->num_rows() > 0) {\n\t\t\t\twhile($sql->next_record()) {\n\t\t\t\t\t$page_titles[] = $sql->Record['title'];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $page_titles;\n\n\t\t}", "protected function getAllItems()\n {\n $sectionModel = new SectionModel();\n\n $categories = $sectionModel->where('is_deleted', 0)->select('id, name, question_type_id')->findAll();\n\n $questions = array();\n\n foreach($categories as $category) {\n // Get type of question\n $qType_id = $category['question_type_id'];\n // get choices and store in a list with the\n // category name as the key\n $choices[$category['name']] = $this->getChoices($qType_id);\n\n $result = $sectionModel->getQuestions($category['id']);\n $questions[$category['name']] = $result;\n }\n\n return [$questions, $choices];\n }", "function showQuestionTitles() \n\t{\n\t\t$this->display_question_titles = 1;\n\t}", "function getAll() {\r\n\t\treturn SurveyAnswerQuery::create()->find();\r\n\t}", "function title_query() {\n $titles = array();\n\n $result = db_query(\"SELECT f.title FROM {aggregator_feed} f WHERE f.fid IN (:fids)\", array(':fids' => $this->value));\n foreach ($result as $term) {\n $titles[] = check_plain($term->title);\n }\n return $titles;\n }", "public function getQuestions()\n {\n $title = \"Questions\";\n $subtitle = \"Here you will find all the questions!\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n\n // Get all the questions\n $questions = $this->di->get(\"questionModel\")->getQuestions();\n\n // Get number of answers\n $answers = [];\n foreach ($questions as $question) {\n $ans = $this->di->get(\"answerModel\")->getAnswersWhere(\"questionId\", $question->id);\n $answers[$question->id] = count($ans);\n }\n\n $data = [\n \"questions\" => $questions,\n \"subtitle\" => $subtitle,\n \"noOfAnswers\" => $answers,\n ];\n\n $view->add(\"pages/questions\", $data);\n $pageRender->renderPage([\"title\" => $title]);\n }", "public function questionnaires()\n {\n return $this->morphedByMany(Questionnaire::class, 'model', 'taggables');\n }", "public function getStrategys()\n {\n return [\n\n ];\n }", "public function getShowQuestionTitles() \n\t{\n\t\treturn ($this->display_question_titles) ? 1 : 0;\n\t}" ]
[ "0.65743417", "0.6205812", "0.5900569", "0.5836954", "0.5836259", "0.5793965", "0.5779317", "0.57228315", "0.5652374", "0.55881345", "0.55739707", "0.5547233", "0.55324525", "0.55057025", "0.54962206", "0.54817736", "0.5478721", "0.54536504", "0.5451263", "0.54329795", "0.5420804", "0.5403345", "0.5390862", "0.53547084", "0.53500855", "0.5335309", "0.5299778", "0.5284227", "0.52787495", "0.52681595" ]
0.7534064
0
Moves a question up in the list of survey questions
function moveUpQuestion($question_id) { $move_questions = array($question_id); $pages =& $this->getSurveyPages(); $pageindex = -1; foreach ($pages as $idx => $page) { if ($page[0]["question_id"] == $question_id) { $pageindex = $idx; } } if ($pageindex > 0) { $this->moveQuestions($move_questions, $pages[$pageindex-1][0]["question_id"], 0); } else { // move up a question in a questionblock $questions = $this->getSurveyQuestions(); $questions = array_keys($questions); $index = array_search($question_id, $questions); if (($index !== FALSE) && ($index > 0)) { $this->moveQuestions($move_questions, $questions[$index-1], 0); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ipal_move_question_up($layout, $questionid) {\n return _ipal_move_question($layout, $questionid, -1);\n}", "function ipal_move_question_down($layout, $questionid) {\n return _ipal_move_question($layout, $questionid, + 1);\n}", "function moveItemUp()\r\n\t{\r\n\t\t$this->content_obj->moveItemUp();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "public function moveDownQuestion($question_id)\n\t{\n\t\t$move_questions = array($question_id);\n\t\t$pages =& $this->getSurveyPages();\n\t\t$pageindex = -1;\n\t\tforeach ($pages as $idx => $page)\n\t\t{\n\t\t\tif (($page[0][\"question_id\"] == $question_id) && (strcmp($page[0][\"questionblock_id\"], \"\") == 0))\n\t\t\t{\n\t\t\t\t$pageindex = $idx;\n\t\t\t}\n\t\t}\n\t\tif (($pageindex < count($pages)-1) && ($pageindex >= 0))\n\t\t{\n\t\t\t$this->moveQuestions($move_questions, $pages[$pageindex+1][count($pages[$pageindex+1])-1][\"question_id\"], 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// move down a question in a questionblock\n\t\t\t$questions = $this->getSurveyQuestions();\n\t\t\t$questions = array_keys($questions);\n\t\t\t$index = array_search($question_id, $questions);\n\t\t\tif (($index !== FALSE) && ($index < count($questions)-1))\n\t\t\t{\n\t\t\t\t$this->moveQuestions($move_questions, $questions[$index+1], 1);\n\t\t\t}\n\t\t}\n\t}", "function moveUpQuestionblock($questionblock_id)\n\t{\n\t\t$pages =& $this->getSurveyPages();\n\t\t$move_questions = array();\n\t\t$pageindex = -1;\n\t\tforeach ($pages as $idx => $page)\n\t\t{\n\t\t\tif ($page[0][\"questionblock_id\"] == $questionblock_id)\n\t\t\t{\n\t\t\t\tforeach ($page as $pageidx => $question)\n\t\t\t\t{\n\t\t\t\t\tarray_push($move_questions, $question[\"question_id\"]);\n\t\t\t\t}\n\t\t\t\t$pageindex = $idx;\n\t\t\t}\n\t\t}\n\t\tif ($pageindex > 0)\n\t\t{\n\t\t\t$this->moveQuestions($move_questions, $pages[$pageindex-1][0][\"question_id\"], 0);\n\t\t}\n\t}", "protected function movePage()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\n\t\t// current_page is already set to new position\n\t\t$target_page = $this->current_page-1;\n\t\t$source_page = $_REQUEST[\"old_pos\"]-1;\n\n\t\t$pages = $this->object->getSurveyPages();\n\t\tforeach($pages[$source_page] as $question)\n\t\t{\n\t\t\t$questions[] = $question[\"question_id\"];\n\t\t}\n\n\t\t// move to first position\n\t\t$position = 0;\n\t\tif($_REQUEST[\"pgov\"] != \"fst\")\n\t\t{\n\t\t\t$position = 1;\n\t\t}\n\n\t\t$target = $pages[$target_page];\n\t\t$target = array_shift($target);\n\t\t$this->object->moveQuestions($questions, $target[\"question_id\"], $position);\n\n\t\tif($target_page < $source_page && $position)\n\t\t{\n\t\t $this->current_page++;\n\t\t}\n\n\t\tilUtil::sendSuccess($lng->txt(\"survey_page_moved\"), true);\n\t\t$ilCtrl->setParameter($this, \"pgov\", $this->current_page);\n\t\t$ilCtrl->redirect($this, \"renderPage\");\n\t}", "function moveItemDown()\r\n\t{\r\n\t\t$this->content_obj->moveItemDown();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "public function move_up($id = null) {\n\t\t$this->SurveyInstanceObject->id = $id;\n\t\tif (!$this->SurveyInstanceObject->exists()) {\n\t\t\tthrow new NotFoundException(__('Invalid survey instance object'));\n\t\t}\n\n\t\t// Permission check to ensure a user is allowed to edit this survey\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\t$surveyInstanceObject = $this->SurveyInstanceObject->read(null, $id);\n\t\t$surveyInstance = $this->SurveyInstance->read(null, $surveyInstanceObject['SurveyInstanceObject']['survey_instance_id']);\n\t\t$survey = $this->Survey->read(null, $surveyInstance['SurveyInstance']['survey_id']);\n\t\tif (!$this->SurveyAuthorisation->checkResearcherPermissionToSurvey($user, $survey))\n\t\t{\n\t\t\t$this->Session->setFlash(__('Permission Denied'));\n\t\t\t$this->redirect(array('controller' => 'surveys', 'action' => 'index'));\n\t\t}\n\n\t\t$above = $this->SurveyInstanceObject->find('first',\n\t\t\t\tarray('conditions' => array('survey_instance_id' => $surveyInstanceObject['SurveyInstanceObject']['survey_instance_id'],\n\t\t\t\t\t\t'order < ' => $surveyInstanceObject['SurveyInstanceObject']['order']),\n\t\t\t\t\t\t'order' => 'SurveyInstanceObject.order desc',\n\t\t\t\t\t\t'limit' => 1));\n\n\t\tif ($above)\n\t\t{\n\t\t\t$top_order = $above['SurveyInstanceObject']['order'];\n\t\t\t$bottom_order = $surveyInstanceObject['SurveyInstanceObject']['order'];\n\t\t\t\t\n\t\t\t$above['SurveyInstanceObject']['order'] = $bottom_order;\n\t\t\t$surveyInstanceObject['SurveyInstanceObject']['order'] = $top_order;\n\t\t\t\t\n\t\t\t$this->SurveyInstanceObject->save($above);\n\t\t\t$this->SurveyInstanceObject->save($surveyInstanceObject);\n\t\t}\n\n\t\t$this->redirect(array('controller' => 'surveyInstances', 'action' => 'edit', $surveyInstance['SurveyInstance']['id']));\n\t}", "public function actionMoveUp()\n\t{\n\t\t$fieldId = $this->_input->filterSingle('field_id', XenForo_Input::UINT);\n\t\treturn $this->_moveField($fieldId, 'up');\n\t}", "function moveDownQuestionblock($questionblock_id)\n\t{\n\t\t$pages =& $this->getSurveyPages();\n\t\t$move_questions = array();\n\t\t$pageindex = -1;\n\t\tforeach ($pages as $idx => $page)\n\t\t{\n\t\t\tif ($page[0][\"questionblock_id\"] == $questionblock_id)\n\t\t\t{\n\t\t\t\tforeach ($page as $pageidx => $question)\n\t\t\t\t{\n\t\t\t\t\tarray_push($move_questions, $question[\"question_id\"]);\n\t\t\t\t}\n\t\t\t\t$pageindex = $idx;\n\t\t\t}\n\t\t}\n\t\tif ($pageindex < count($pages)-1)\n\t\t{\n\t\t\t$this->moveQuestions($move_questions, $pages[$pageindex+1][count($pages[$pageindex+1])-1][\"question_id\"], 1);\n\t\t}\n\t}", "function OnMoveUp(){\n $this->Move();\n $message = \"&MESSAGE=MSG_ITEM_MOVED\";\n $this->AfterSubmitRedirect(\"?\".($this->Package!=\"\" ? \"package=\".$this->Package.\"&\" : \"\").\"page=\" . $this->listHandler . \"&\" . $this->library_ID . \"_start=\" . $this->start . \"&\" . $this->library_ID . \"_order_by=\" . $this->order_by . \"&library=\" . $this->library_ID . \"&\" . $this->library_ID . \"_parent_id=\" . $this->parent_id . \"\" . $message . \"\" . \"&\" . str_replace(\"&amp;\", \"&\", rawurldecode($this->restore)));\n }", "function moveQuestions($move_questions, $target_index, $insert_mode)\n\t{\n\t\t$array_pos = array_search($target_index, $this->questions);\n\t\tif ($insert_mode == 0)\n\t\t{\n\t\t\t$part1 = array_slice($this->questions, 0, $array_pos);\n\t\t\t$part2 = array_slice($this->questions, $array_pos);\n\t\t}\n\t\telse if ($insert_mode == 1)\n\t\t{\n\t\t\t$part1 = array_slice($this->questions, 0, $array_pos + 1);\n\t\t\t$part2 = array_slice($this->questions, $array_pos + 1);\n\t\t}\n\t\tforeach ($move_questions as $question_id)\n\t\t{\n\t\t\tif (!(array_search($question_id, $part1) === FALSE))\n\t\t\t{\n\t\t\t\tunset($part1[array_search($question_id, $part1)]);\n\t\t\t}\n\t\t\tif (!(array_search($question_id, $part2) === FALSE))\n\t\t\t{\n\t\t\t\tunset($part2[array_search($question_id, $part2)]);\n\t\t\t}\n\t\t}\n\t\t$part1 = array_values($part1);\n\t\t$part2 = array_values($part2);\n\t\t$this->questions = array_values(array_merge($part1, $move_questions, $part2));\n\t\tforeach ($move_questions as $question_id)\n\t\t{\n\t\t\t$constraints = $this->getConstraints($question_id);\n\t\t\tforeach ($constraints as $idx => $constraint)\n\t\t\t{\n\t\t\t\tforeach ($part2 as $next_question_id)\n\t\t\t\t{\n\t\t\t\t\tif ($constraint[\"question\"] == $next_question_id)\n\t\t\t\t\t{\n\t\t\t\t\t\t// constraint concerning a question that follows -> delete constraint\n\t\t\t\t\t\t$this->deleteConstraint($constraint[\"id\"]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->saveQuestionsToDb();\n\t}", "function _ipal_move_question($layout, $questionid, $shift) {\n if (!$questionid || !($shift == 1 || $shift == -1)) {\n return $layout;\n }\n\n $questionids = explode(',', $layout);\n $key = array_search($questionid, $questionids);\n if ($key === false) {\n return $layout;\n }\n\n $otherkey = $key + $shift;\n if ($otherkey < 0 || $otherkey >= count($questionids) - 1) {\n return $layout;\n }\n\n $temp = $questionids[$otherkey];\n $questionids[$otherkey] = $questionids[$key];\n $questionids[$key] = $temp;\n\n return implode(',', $questionids);\n}", "public function move_down($id = null) {\n\t\t$this->SurveyInstanceObject->id = $id;\n\t\tif (!$this->SurveyInstanceObject->exists()) {\n\t\t\tthrow new NotFoundException(__('Invalid survey instance object'));\n\t\t}\n\n\t\t// Permission check to ensure a user is allowed to edit this survey\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\t$surveyInstanceObject = $this->SurveyInstanceObject->read(null, $id);\n\t\t$surveyInstance = $this->SurveyInstance->read(null, $surveyInstanceObject['SurveyInstanceObject']['survey_instance_id']);\n\t\t$survey = $this->Survey->read(null, $surveyInstance['SurveyInstance']['survey_id']);\n\t\tif (!$this->SurveyAuthorisation->checkResearcherPermissionToSurvey($user, $survey))\n\t\t{\n\t\t\t$this->Session->setFlash(__('Permission Denied'));\n\t\t\t$this->redirect(array('controller' => 'surveys', 'action' => 'index'));\n\t\t}\n\n\t\t$below = $this->SurveyInstanceObject->find('first',\n\t\t\t\tarray('conditions' => array('survey_instance_id' => $surveyInstanceObject['SurveyInstanceObject']['survey_instance_id'],\n\t\t\t\t\t\t'order > ' => $surveyInstanceObject['SurveyInstanceObject']['order']),\n\t\t\t\t\t\t'order' => 'SurveyInstanceObject.order',\n\t\t\t\t\t\t'limit' => 1));\n\n\t\tif ($below)\n\t\t{\n\t\t\t$bottom_order = $below['SurveyInstanceObject']['order'];\n\t\t\t$top_order = $surveyInstanceObject['SurveyInstanceObject']['order'];\n\t\t\t\t\n\t\t\t$below['SurveyInstanceObject']['order'] = $top_order;\n\t\t\t$surveyInstanceObject['SurveyInstanceObject']['order'] = $bottom_order;\n\t\t\t\t\n\t\t\t$this->SurveyInstanceObject->save($below);\n\t\t\t$this->SurveyInstanceObject->save($surveyInstanceObject);\n\t\t}\n\n\t\t$this->redirect(array('controller' => 'surveyInstances', 'action' => 'edit', $surveyInstance['SurveyInstance']['id']));\n\t}", "function orderdown() {\n\t\torder(-1);\n\t}", "function downQuestion($id = null) {\n $this->autoRender = false; // turn off autoRender because there is no deleteQuestions view\n if($this->request->is('ajax')) {\n // only process ajax requests\n $tempArr = null;\n if ($this->Session->check('SurveyQuestion.new')) {\n //check for the session variable containing questions for this survey\n $tempArr = $this->Session->read('SurveyQuestion.new'); // get temp working copy of questions\n $swapone = $tempArr[$id];\n $swaptwo = $tempArr[$id+1];\n $tempArr[$id+1] = $swapone;\n $tempArr[$id] = $swaptwo;\n }\n $this->Session->write('SurveyQuestion.new',$tempArr); // write the new question array to the session\n $this->set('questions', $tempArr); // send the questions to the view\n $this->layout = 'ajax'; // use the blank ajax layout\n $this->render('/Elements/manage_questions'); // send the element to the receiving element in the view\n }\n }", "protected function movePrevious($a_id)\n\t{\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\t\t$target = $pages[$this->current_page-2];\n\t\tif(sizeof($target))\n\t\t{\n\t\t\t$target_id = $target;\n\t\t\t$target_id = array_pop($target_id);\n\t\t\t$target_block_id = $target_id[\"questionblock_id\"];\n\t\t\t$target_id = $target_id[\"question_id\"];\n\n\t\t\t// nothing to do if no block\n\t\t\tif(sizeof($source) > 1)\n\t\t\t{\n\t\t\t\t$block_id = $source;\n\t\t\t\t$block_id = array_shift($block_id);\n\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t// source pages block is obsolete\n\t\t\t\tif(sizeof($source) == 2)\n\t\t\t\t{\n\t\t\t\t\t// delete block\n\t\t\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// remove question from block\n\t\t\t\t\t$this->object->removeQuestionFromBlock($a_id, $block_id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move source question to target\n\t\t\t$this->object->moveQuestions(array($a_id), $target_id, 1);\n\n\t\t\t// new page has no block yet\n\t\t\tif(sizeof($target) < 2)\n\t\t\t{\n\t\t\t\t// create block and move target question and source into block\n\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\tarray($target_id, $a_id));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// add source question to block\n\t\t\t\t$this->object->addQuestionToBlock($a_id, $target_block_id);\n\t\t\t}\n\n\t\t\t$this->current_page--;\n\t\t}\n\t}", "function orderup() {\n\t\torder(1);\n\t}", "public function previous_question()\n {\n\n $offset = $this->input->post('offset');\n $offset = ($offset - 1 < 0) ? 0 : $offset - 1;\n $this->session->set_userdata('offset', $offset);\n\n $question = $this->OnlineExam->getPreviousQuestion($this->input->post('id'), $offset);\n\n $this->get_question_view($question, $offset);\n die;\n }", "public function moveUpAction()\n {\n $repository = $this->getRepository();\n\n return $this->objectTransform(function ($object, $admin) use ($repository) {\n if (method_exists($repository, 'getHighestPropertyByPosition')) {\n $secondObject = $repository->getHighestPropertyByPosition('orderNum', $object, 'DESC');\n if ($secondObject) {\n $object->setOrderNum($secondObject->getOrderNum());\n $secondObject->setOrderNum($secondObject->getOrderNum() + 1);\n }\n } else {\n $object->setOrderNum($object->getOrderNum() - 1);\n }\n });\n }", "function orderup() {\n\t\t\n\t\t$this->_order(-1);\n\t\t\n\t\t$this->adminLink->makeURL();\n\t\t$this->app->redirect( $this->adminLink->url );\n\t\n\t}", "public function liftUp();", "function previousQuestions() {\n\t\t$arrValidTypes = array(1,2,3,4,5,7,10,11,12,13,14,15,23);\n\t\t$arrCurRecord = BackendUtility::getRecord($this->arrWizardParameters[\"table\"], $this->arrWizardParameters[\"uid\"]);\n\t\tif (!in_array(intval($arrCurRecord['sys_language_uid']),array(-1,0))) {\n\t\t\t$this->blnLocalization = TRUE;\n\t\t}\n \t$strWhereConf = '1=1';\n \t$strWhereConf .= ' AND pid='. $this->arrWizardParameters[\"pid\"];\n\t\t$strWhereConf .= ' AND ' . $this->strItemsTable . '.sys_language_uid IN (0,-1)';\n\t\t$strWhereConf .= ' AND sorting<' . $arrCurRecord[\"sorting\"];\n\t\t$strWhereConf .= BackendUtility::BEenableFields($this->strItemsTable);\n\t\t$strWhereConf .= BackendUtility::deleteClause($this->strItemsTable);\n\t\t$strOrderByConf = 'sorting ASC';\n\t\t$dbRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*',$this->arrWizardParameters[\"table\"],$strWhereConf,'',$strOrderByConf);\n while($arrDbRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($dbRes)) {\n \tif ($this->blnLocalization) {\n \t\t$arrDbRow = $this->getRecordOverlay($this->strItemsTable, $arrDbRow, $arrCurRecord['sys_language_uid']);\n\t\t\t}\n if (!isset($intPage)) {\n if ($arrDbRow['question_type']==22) {\n $intPage = 0;\n } else {\n $intPage = 1;\n }\n }\n if ($arrDbRow['question_type']<>22) {\n if (in_array($arrDbRow['question_type'],$arrValidTypes)) {\n $arrDbRow['page'] = $intPage;\n $this->arrPrevQuestions[$arrDbRow['uid']] = $arrDbRow;\n }\n } else {\n $intPage++;\n }\n\t\t}\n }", "public function actionUp()\n\t{\n\t\tif (!Yii::app()->request->isAjaxRequest)\n\t\t\tthrow new CHttpException(404);\n\t\t\n\t\t$this->layout = false;\n\t\t$id = Yii::app()->request->getParam('id');\n\t\t$current = IdeaHeap::model()->findByPk($id);\n\t\tif (is_null($current))\n\t\t\treturn $this->renderText (false);\n\t\t\n\t\t$criteria = new CDbCriteria();\n\t\t$criteria->condition = 'idea_type_id=:idea_type_id AND option_key=:option_key AND parent_id=:parent_id AND position<:position';\n\t\t$criteria->order = 'position DESC';\n\t\t$criteria->params = array(':position' => $current->position, \n\t\t\t\t\t':idea_type_id' => $current->idea_type_id, \n\t\t\t\t\t':parent_id' => $current->parent_id,\n\t\t\t\t\t':option_key' => $current->option_key,\n\t\t\t\t);\n\t\t\n\t\t$next = IdeaHeap::model()->find($criteria);\n\t\tif (is_null($next))\n\t\t\treturn $this->renderText (false);\n\t\t$tmp = $current->position;\n\t\t$current->position = $next->position;\n\t\t$next->position = $tmp;\n\t\t$current->save(false);\n\t\t$next->save(false);\n\t\treturn $this->renderText (true);\n\t}", "public function nextQuestion(){\n $curr = $this->request->getVar(\"currQuestion\");\n $selected = $this->request->getVar(\"selected\");\n\n if($curr != 1){\n $this->answeredQuestions = $this->session->get('questions');\n $this->answersId = $this->session->get('answers');\n $this->score = $this->session->get('score');\n }\n\n if($curr == 1) $this->resetAll();\n\n $selected -= 1;\n if($curr != 1){\n $this->addValues($selected);\n }\n\n if($curr != 6) {\n $id = $this->generateNextQuestion();\n $question = $this->getQuestion($id);\n $answers = $this->getAnswers($question);\n }\n\n if($curr == 6){\n $id = $this->findRecommendation();\n $this->session->remove('questions');\n $this->session->remove('answers');\n $this->session->remove('score');\n echo \"gotovo,\".$id;\n return;\n }\n\n $this->session->set('questions',$this->answeredQuestions );\n $this->session->set('answers',$this->answersId );\n $this->session->set('score',$this->score);\n\n\n echo $question->text.\"\".$answers;\n\n }", "function deleteAnswer($index = 0)\n\t{\n\t\tif ($index < 0) return;\n\t\tif (count($this->answers) < 1) return;\n\t\tif ($index >= count($this->answers)) return;\n\t\tunset($this->answers[$index]);\n\t\t$this->answers = array_values($this->answers);\n\t\tfor ($i = 0; $i < count($this->answers); $i++)\n\t\t{\n\t\t\tif ($this->answers[$i]->getOrder() > $index)\n\t\t\t{\n\t\t\t\t$this->answers[$i]->setOrder($i);\n\t\t\t}\n\t\t}\n\t}", "public function page_move_smiley()\n\t{\n\t\t$move = ($this->mode == 'up') ? -1 : 1;\n\n\t\t// Position du smiley courant\n\t\t$sql = 'SELECT smiley_order, smiley_cat\n\t\t\t\tFROM ' . SQL_PREFIX . 'smilies\n\t\t\t\tWHERE smiley_id = ' . intval($this->id);\n\t\t$d = Fsb::$db->request($sql);\n\n\t\tif ($d)\n\t\t{\n\t\t\t// ID du smiley a switcher\n\t\t\t$sql = 'SELECT smiley_id\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'smilies\n\t\t\t\t\tWHERE smiley_cat = ' . $d['smiley_cat'] . '\n\t\t\t\t\t\tAND smiley_order = ' . ($d['smiley_order'] + $move);\n\t\t\t$swap_smiley_id = Fsb::$db->get($sql, 'smiley_id');\n\n\t\t\tif ($swap_smiley_id)\n\t\t\t{\n\t\t\t\t// Mise a jour de la position des deux smilies\n\t\t\t\tFsb::$db->update('smilies', array(\n\t\t\t\t\t'smiley_order' =>\t($d['smiley_order'] + $move),\n\t\t\t\t), 'WHERE smiley_id = ' . intval($this->id));\n\n\t\t\t\tFsb::$db->update('smilies', array(\n\t\t\t\t\t'smiley_order' =>\t$d['smiley_order'],\n\t\t\t\t), 'WHERE smiley_id = ' . $swap_smiley_id);\n\n\t\t\t\tFsb::$db->destroy_cache('smilies_');\n\t\t\t}\n\t\t}\n\t\tHttp::redirect('index.' . PHPEXT . '?p=posts_smiley');\n\t}", "public function moveUp($index) {\n\t\t// only perform the move if reasonable to do so\n\t\tif ($index > 0 && $index < $this->count()) {\n\t\t\t$this->move($index, $index - 1);\n\t\t}\n\t\treturn $this;\n\t}", "function OnMoveDown(){\n $this->Move();\n $message = \"&MESSAGE=MSG_ITEM_MOVED\";\n $this->AfterSubmitRedirect(\"?\".($this->Package!=\"\" ? \"package=\".$this->Package.\"&\" : \"\").\"page=\" . $this->listHandler . \"&\" . $this->library_ID . \"_start=\" . $this->start . \"&\" . $this->library_ID . \"_order_by=\" . $this->order_by . \"&library=\" . $this->library_ID . \"&\" . $this->library_ID . \"_parent_id=\" . $this->parent_id . \"\" . $message . \"\" . \"&\" . str_replace(\"&amp;\", \"&\", rawurldecode($this->restore)));\n }", "public function page_move_cat()\n\t{\n\t\t$move = ($this->mode == 'up_cat') ? -1 : 1;\n\n\t\t// Position de la categorie\n\t\t$sql = 'SELECT cat_order\n\t\t\t\tFROM ' . SQL_PREFIX . 'smilies_cat\n\t\t\t\tWHERE cat_id = ' . intval($this->id);\n\t\t$current_cat_order = Fsb::$db->get($sql, 'cat_order');\n\n\t\tif ($current_cat_order)\n\t\t{\n\t\t\t// ID de la categorie a switcher\n\t\t\t$sql = 'SELECT cat_id\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'smilies_cat\n\t\t\t\t\tWHERE cat_order = ' . ($current_cat_order + $move);\n\t\t\t$swap_cat_id = Fsb::$db->get($sql, 'cat_id');\n\n\t\t\tif ($swap_cat_id)\n\t\t\t{\n\t\t\t\t// Mise a jour de la position des deux smilies\n\t\t\t\tFsb::$db->update('smilies_cat', array(\n\t\t\t\t\t'cat_order' =>\t($current_cat_order + $move),\n\t\t\t\t), 'WHERE cat_id = ' . intval($this->id));\n\n\t\t\t\tFsb::$db->update('smilies_cat', array(\n\t\t\t\t\t'cat_order' =>\t$current_cat_order,\n\t\t\t\t), 'WHERE cat_id = ' . $swap_cat_id);\n\n\t\t\t\tFsb::$db->destroy_cache('smilies_');\n\t\t\t}\n\t\t}\n\t\tHttp::redirect('index.' . PHPEXT . '?p=posts_smiley');\n\t}" ]
[ "0.75147176", "0.7072281", "0.6676009", "0.65406096", "0.6449846", "0.6188967", "0.599367", "0.5942243", "0.58477217", "0.58259183", "0.57867455", "0.5775946", "0.5588684", "0.5578091", "0.5547062", "0.5474735", "0.54560435", "0.54468656", "0.5445789", "0.53893167", "0.5319887", "0.53150177", "0.52971035", "0.5226435", "0.5217779", "0.51826084", "0.51724637", "0.5166052", "0.5165621", "0.5164886" ]
0.76685023
0
Moves a questionblock up in the list of survey questions
function moveUpQuestionblock($questionblock_id) { $pages =& $this->getSurveyPages(); $move_questions = array(); $pageindex = -1; foreach ($pages as $idx => $page) { if ($page[0]["questionblock_id"] == $questionblock_id) { foreach ($page as $pageidx => $question) { array_push($move_questions, $question["question_id"]); } $pageindex = $idx; } } if ($pageindex > 0) { $this->moveQuestions($move_questions, $pages[$pageindex-1][0]["question_id"], 0); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveUpQuestion($question_id)\n\t{\n\t\t$move_questions = array($question_id);\n\t\t$pages =& $this->getSurveyPages();\n\t\t$pageindex = -1;\n\t\tforeach ($pages as $idx => $page)\n\t\t{\n\t\t\tif ($page[0][\"question_id\"] == $question_id)\n\t\t\t{\n\t\t\t\t$pageindex = $idx;\n\t\t\t}\n\t\t}\n\t\tif ($pageindex > 0)\n\t\t{\n\t\t\t$this->moveQuestions($move_questions, $pages[$pageindex-1][0][\"question_id\"], 0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// move up a question in a questionblock\n\t\t\t$questions = $this->getSurveyQuestions();\n\t\t\t$questions = array_keys($questions);\n\t\t\t$index = array_search($question_id, $questions);\n\t\t\tif (($index !== FALSE) && ($index > 0))\n\t\t\t{\n\t\t\t\t$this->moveQuestions($move_questions, $questions[$index-1], 0);\n\t\t\t}\n\t\t}\n\t}", "function ipal_move_question_up($layout, $questionid) {\n return _ipal_move_question($layout, $questionid, -1);\n}", "function moveDownQuestionblock($questionblock_id)\n\t{\n\t\t$pages =& $this->getSurveyPages();\n\t\t$move_questions = array();\n\t\t$pageindex = -1;\n\t\tforeach ($pages as $idx => $page)\n\t\t{\n\t\t\tif ($page[0][\"questionblock_id\"] == $questionblock_id)\n\t\t\t{\n\t\t\t\tforeach ($page as $pageidx => $question)\n\t\t\t\t{\n\t\t\t\t\tarray_push($move_questions, $question[\"question_id\"]);\n\t\t\t\t}\n\t\t\t\t$pageindex = $idx;\n\t\t\t}\n\t\t}\n\t\tif ($pageindex < count($pages)-1)\n\t\t{\n\t\t\t$this->moveQuestions($move_questions, $pages[$pageindex+1][count($pages[$pageindex+1])-1][\"question_id\"], 1);\n\t\t}\n\t}", "function moveItemUp()\r\n\t{\r\n\t\t$this->content_obj->moveItemUp();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "function ipal_move_question_down($layout, $questionid) {\n return _ipal_move_question($layout, $questionid, + 1);\n}", "public function moveDownQuestion($question_id)\n\t{\n\t\t$move_questions = array($question_id);\n\t\t$pages =& $this->getSurveyPages();\n\t\t$pageindex = -1;\n\t\tforeach ($pages as $idx => $page)\n\t\t{\n\t\t\tif (($page[0][\"question_id\"] == $question_id) && (strcmp($page[0][\"questionblock_id\"], \"\") == 0))\n\t\t\t{\n\t\t\t\t$pageindex = $idx;\n\t\t\t}\n\t\t}\n\t\tif (($pageindex < count($pages)-1) && ($pageindex >= 0))\n\t\t{\n\t\t\t$this->moveQuestions($move_questions, $pages[$pageindex+1][count($pages[$pageindex+1])-1][\"question_id\"], 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// move down a question in a questionblock\n\t\t\t$questions = $this->getSurveyQuestions();\n\t\t\t$questions = array_keys($questions);\n\t\t\t$index = array_search($question_id, $questions);\n\t\t\tif (($index !== FALSE) && ($index < count($questions)-1))\n\t\t\t{\n\t\t\t\t$this->moveQuestions($move_questions, $questions[$index+1], 1);\n\t\t\t}\n\t\t}\n\t}", "function moveItemDown()\r\n\t{\r\n\t\t$this->content_obj->moveItemDown();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "protected function movePrevious($a_id)\n\t{\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\t\t$target = $pages[$this->current_page-2];\n\t\tif(sizeof($target))\n\t\t{\n\t\t\t$target_id = $target;\n\t\t\t$target_id = array_pop($target_id);\n\t\t\t$target_block_id = $target_id[\"questionblock_id\"];\n\t\t\t$target_id = $target_id[\"question_id\"];\n\n\t\t\t// nothing to do if no block\n\t\t\tif(sizeof($source) > 1)\n\t\t\t{\n\t\t\t\t$block_id = $source;\n\t\t\t\t$block_id = array_shift($block_id);\n\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t// source pages block is obsolete\n\t\t\t\tif(sizeof($source) == 2)\n\t\t\t\t{\n\t\t\t\t\t// delete block\n\t\t\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// remove question from block\n\t\t\t\t\t$this->object->removeQuestionFromBlock($a_id, $block_id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move source question to target\n\t\t\t$this->object->moveQuestions(array($a_id), $target_id, 1);\n\n\t\t\t// new page has no block yet\n\t\t\tif(sizeof($target) < 2)\n\t\t\t{\n\t\t\t\t// create block and move target question and source into block\n\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\tarray($target_id, $a_id));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// add source question to block\n\t\t\t\t$this->object->addQuestionToBlock($a_id, $target_block_id);\n\t\t\t}\n\n\t\t\t$this->current_page--;\n\t\t}\n\t}", "public function moveUp\n\t(\n\t\t$sortOrder\t\t// <int> The sort order of the block associated with this segment piece.\n\t)\t\t\t\t\t// RETURNS <bool> TRUE on success, FALSE on failure.\n\t\n\t// $contentForm->moveUp($sortOrder);\n\t{\n\t\t// Make sure there is upward mobility (a block higher than itself)\n\t\tif($sortOrder <= 1) { return false; }\n\t\t\n\t\t$swapOrder = $sortOrder - 1;\n\t\t\n\t\tDatabase::startTransaction();\n\t\t\n\t\tif($pass = Database::query(\"UPDATE content_block_segment SET sort_order=? WHERE content_id=? AND sort_order=? LIMIT 1\", array(0, $this->contentID, $sortOrder)))\n\t\t{\n\t\t\tif($pass = Database::query(\"UPDATE content_block_segment SET sort_order=? WHERE content_id=? AND sort_order=? LIMIT 1\", array($sortOrder, $this->contentID, $swapOrder)))\n\t\t\t{\n\t\t\t\t$pass = Database::query(\"UPDATE content_block_segment SET sort_order=? WHERE content_id=? AND sort_order=? LIMIT 1\", array($swapOrder, $this->contentID, 0));\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(Database::endTransaction($pass))\n\t\t{\n\t\t\t$this->updateCache();\n\t\t\t\n\t\t\theader(\"Location: \" . $this->baseURL . \"?id=\" . $this->contentID); exit;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "protected function moveNext($a_id)\n\t{\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\t\t$target = $pages[$this->current_page];\n\t\tif(sizeof($target))\n\t\t{\n\t\t\t$target_id = $target;\n\t\t\t$target_id = array_shift($target_id);\n\t\t\t$target_block_id = $target_id[\"questionblock_id\"];\n\t\t\t$target_id = $target_id[\"question_id\"];\n\n\t\t\t// nothing to do if no block\n\t\t\tif(sizeof($source) > 1)\n\t\t\t{\n\t\t\t\t$block_id = $source;\n\t\t\t\t$block_id = array_shift($block_id);\n\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t// source pages block is obsolete\n\t\t\t\tif(sizeof($source) == 2)\n\t\t\t\t{\n\t\t\t\t\t// delete block\n\t\t\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// remove question from block\n\t\t\t\t\t$this->object->removeQuestionFromBlock($a_id, $block_id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move source question to target\n\t\t\t$this->object->moveQuestions(array($a_id), $target_id, 0);\n\n\t\t\t// new page has no block yet\n\t\t\tif(sizeof($target) < 2)\n\t\t\t{\n\t\t\t\t// create block and move target question and source into block\n\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\tarray($a_id, $target_id));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// add source question to block\n\t\t\t\t$this->object->addQuestionToBlock($a_id, $target_block_id);\n\t\t\t}\n\n\t\t\t// only if current page is not \"deleted\"\n\t\t\tif(sizeof($source) > 1)\n\t\t\t{\n\t\t\t\t$this->current_page++;\n\t\t\t}\n\t\t}\n\t}", "protected function deleteBlock()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\t\t\n\t\t$ilCtrl->setParameter($this->editor_gui, \"pgov\", $this->current_page);\n\t\tilUtil::sendQuestion($lng->txt(\"remove_questions\"));\n\t\t\n\t\t$page = $this->object->getSurveyPages();\n\t\t$page = $page[$this->current_page-1];\n\t\t\n\t\t// #10567\n\t\tif($_REQUEST[\"csum\"] != md5(print_r($page, true)))\n\t\t{\n\t\t\t$ilCtrl->redirect($this, \"renderPage\");\n\t\t}\n\t\t\n\t\t$page = array_shift($page);\n\t\t$block_id = $page[\"questionblock_id\"];\n\t\tif($block_id)\n\t\t{\n\t\t\t$this->editor_gui->removeQuestionsForm(array($block_id), array(), array());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->editor_gui->removeQuestionsForm(array(), array($page[\"question_id\"]), array());\n\t\t}\n\t}", "protected function confirmRemoveQuestions()\n\t{\n\t\tglobal $ilCtrl;\n\t\t\n\t\t// gather ids\n\t\t$ids = array();\n\t\tforeach ($_POST as $key => $value)\n\t\t{\n\t\t\tif (preg_match(\"/id_(\\d+)/\", $key, $matches))\n\t\t\t{\n\t\t\t\tarray_push($ids, $matches[1]);\n\t\t\t}\n\t\t}\n\n\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\n\t\t$block_id = $source;\n\t\t$block_id = array_shift($block_id);\n\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\tif(sizeof($ids) && sizeof($source) > sizeof($ids))\n\t\t{\n\t\t\t// block is obsolete\n\t\t\tif(sizeof($source)-sizeof($ids) == 1)\n\t\t\t{\n\t\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t\t}\n\t\t\t// block will remain, remove question(s) from block\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach($ids as $qid)\n\t\t\t\t{\n\t\t\t\t\t$this->object->removeQuestionFromBlock($qid, $block_id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->object->removeQuestions($ids, array());\n\t\t}\n\t\t// all items on page \n\t\telse \n\t\t{\n\t\t\t// remove complete block\n\t\t\tif($block_id)\n\t\t\t{\n\t\t\t\t$this->object->removeQuestions(array(), array($block_id));\n\t\t\t}\n\t\t\t// remove single question\n\t\t\telse\n\t\t\t{\t\t\t\t\n\t\t\t\t$this->object->removeQuestions($ids, array());\n\t\t\t}\n\n\t\t\t// render previous page\n\t\t\tif($this->current_page > 1)\n\t\t\t{\n\t\t\t\t$this->current_page--;\n\t\t\t}\n\t\t}\n\n\t\t$this->object->saveCompletionStatus();\n\t\t\t\n\t\t// #10567\n\t\t$ilCtrl->setParameter($this, \"pgov\", $this->current_page);\n\t\t$ilCtrl->redirect($this, \"renderPage\");\n\t}", "function OnMoveUp(){\n $this->Move();\n $message = \"&MESSAGE=MSG_ITEM_MOVED\";\n $this->AfterSubmitRedirect(\"?\".($this->Package!=\"\" ? \"package=\".$this->Package.\"&\" : \"\").\"page=\" . $this->listHandler . \"&\" . $this->library_ID . \"_start=\" . $this->start . \"&\" . $this->library_ID . \"_order_by=\" . $this->order_by . \"&library=\" . $this->library_ID . \"&\" . $this->library_ID . \"_parent_id=\" . $this->parent_id . \"\" . $message . \"\" . \"&\" . str_replace(\"&amp;\", \"&\", rawurldecode($this->restore)));\n }", "public function insertQuestionBlock($a_block_id)\n\t{\n\t\t$new_ids = array();\n\t\t$question_ids = $this->object->getQuestionblockQuestionIds($a_block_id);\n\t\tforeach($question_ids as $qid)\n\t\t{\n\t\t\t$new_ids[] = $this->appendNewQuestionToSurvey($qid, true, true);\n\t\t}\n\t\t\n\t\tif(sizeof($new_ids))\n\t\t{\n\t\t\t$this->object->loadQuestionsFromDb();\n\t\t\t\n\t\t\t$pos = $_REQUEST[\"pgov_pos\"];\n\t\t\n\t\t\t// a[fter]/b[efore] on same page\n\t\t\tif(substr($pos, -1) != \"c\")\n\t\t\t{\n\t\t\t\t// block handling\n\t\t\t\t$current = $this->object->getSurveyPages();\n\t\t\t\t$current = $current[$this->current_page-1];\n\t\t\t\tif(sizeof($current) == 1)\n\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// as questions are moved to first block question\n\t\t\t\t\t// always use existing as first\n\t\t\t\t\t// the new question is moved later on (see below)\n\t\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t\tarray((int)$pos)+$new_ids);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$block_id = array_pop($current);\n\t\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t\tforeach($new_ids as $qid)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->object->addQuestionToBlock($qid, $block_id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// c: as new page (from toolbar/pool)\n\t\t\telse\n\t\t\t{\n\t\t\t\t// re-create block\n\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t$new_ids);\n\t\t\t\t\n\t\t\t\t// after given question\n\t\t\t\tif((int)$pos)\n\t\t\t\t{\n\t\t\t\t\t$pos = (int)$pos.\"a\";\n\t\t\t\t}\n\t\t\t\t// at the beginning\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$first = $this->object->getSurveyPages();\n\t\t\t\t\t$first = $first[0];\n\t\t\t\t\t$first = array_shift($first);\n\t\t\t\t\t$pos = $first[\"question_id\"].\"b\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move to target position\n\t\t\t$this->object->moveQuestions($new_ids, (int)$pos,\n\t\t\t\t((substr($pos, -1) == \"a\") ? 1 : 0));\t\t\t\n\t\t}\n\t}", "public function move_up($id = null) {\n\t\t$this->SurveyInstanceObject->id = $id;\n\t\tif (!$this->SurveyInstanceObject->exists()) {\n\t\t\tthrow new NotFoundException(__('Invalid survey instance object'));\n\t\t}\n\n\t\t// Permission check to ensure a user is allowed to edit this survey\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\t$surveyInstanceObject = $this->SurveyInstanceObject->read(null, $id);\n\t\t$surveyInstance = $this->SurveyInstance->read(null, $surveyInstanceObject['SurveyInstanceObject']['survey_instance_id']);\n\t\t$survey = $this->Survey->read(null, $surveyInstance['SurveyInstance']['survey_id']);\n\t\tif (!$this->SurveyAuthorisation->checkResearcherPermissionToSurvey($user, $survey))\n\t\t{\n\t\t\t$this->Session->setFlash(__('Permission Denied'));\n\t\t\t$this->redirect(array('controller' => 'surveys', 'action' => 'index'));\n\t\t}\n\n\t\t$above = $this->SurveyInstanceObject->find('first',\n\t\t\t\tarray('conditions' => array('survey_instance_id' => $surveyInstanceObject['SurveyInstanceObject']['survey_instance_id'],\n\t\t\t\t\t\t'order < ' => $surveyInstanceObject['SurveyInstanceObject']['order']),\n\t\t\t\t\t\t'order' => 'SurveyInstanceObject.order desc',\n\t\t\t\t\t\t'limit' => 1));\n\n\t\tif ($above)\n\t\t{\n\t\t\t$top_order = $above['SurveyInstanceObject']['order'];\n\t\t\t$bottom_order = $surveyInstanceObject['SurveyInstanceObject']['order'];\n\t\t\t\t\n\t\t\t$above['SurveyInstanceObject']['order'] = $bottom_order;\n\t\t\t$surveyInstanceObject['SurveyInstanceObject']['order'] = $top_order;\n\t\t\t\t\n\t\t\t$this->SurveyInstanceObject->save($above);\n\t\t\t$this->SurveyInstanceObject->save($surveyInstanceObject);\n\t\t}\n\n\t\t$this->redirect(array('controller' => 'surveyInstances', 'action' => 'edit', $surveyInstance['SurveyInstance']['id']));\n\t}", "protected function movePage()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\n\t\t// current_page is already set to new position\n\t\t$target_page = $this->current_page-1;\n\t\t$source_page = $_REQUEST[\"old_pos\"]-1;\n\n\t\t$pages = $this->object->getSurveyPages();\n\t\tforeach($pages[$source_page] as $question)\n\t\t{\n\t\t\t$questions[] = $question[\"question_id\"];\n\t\t}\n\n\t\t// move to first position\n\t\t$position = 0;\n\t\tif($_REQUEST[\"pgov\"] != \"fst\")\n\t\t{\n\t\t\t$position = 1;\n\t\t}\n\n\t\t$target = $pages[$target_page];\n\t\t$target = array_shift($target);\n\t\t$this->object->moveQuestions($questions, $target[\"question_id\"], $position);\n\n\t\tif($target_page < $source_page && $position)\n\t\t{\n\t\t $this->current_page++;\n\t\t}\n\n\t\tilUtil::sendSuccess($lng->txt(\"survey_page_moved\"), true);\n\t\t$ilCtrl->setParameter($this, \"pgov\", $this->current_page);\n\t\t$ilCtrl->redirect($this, \"renderPage\");\n\t}", "function orderdown() {\n\t\torder(-1);\n\t}", "function crunchify_move_comment_form_below( $fields ) { \n $comment_field = $fields['comment']; \n unset( $fields['comment'] ); \n $fields['comment'] = $comment_field; \n return $fields; \n}", "public function actionMoveUp()\n\t{\n\t\t$fieldId = $this->_input->filterSingle('field_id', XenForo_Input::UINT);\n\t\treturn $this->_moveField($fieldId, 'up');\n\t}", "function orderup() {\n\t\torder(1);\n\t}", "function downQuestion($id = null) {\n $this->autoRender = false; // turn off autoRender because there is no deleteQuestions view\n if($this->request->is('ajax')) {\n // only process ajax requests\n $tempArr = null;\n if ($this->Session->check('SurveyQuestion.new')) {\n //check for the session variable containing questions for this survey\n $tempArr = $this->Session->read('SurveyQuestion.new'); // get temp working copy of questions\n $swapone = $tempArr[$id];\n $swaptwo = $tempArr[$id+1];\n $tempArr[$id+1] = $swapone;\n $tempArr[$id] = $swaptwo;\n }\n $this->Session->write('SurveyQuestion.new',$tempArr); // write the new question array to the session\n $this->set('questions', $tempArr); // send the questions to the view\n $this->layout = 'ajax'; // use the blank ajax layout\n $this->render('/Elements/manage_questions'); // send the element to the receiving element in the view\n }\n }", "function orderup() {\n\t\t\n\t\t$this->_order(-1);\n\t\t\n\t\t$this->adminLink->makeURL();\n\t\t$this->app->redirect( $this->adminLink->url );\n\t\n\t}", "function moveQuestions($move_questions, $target_index, $insert_mode)\n\t{\n\t\t$array_pos = array_search($target_index, $this->questions);\n\t\tif ($insert_mode == 0)\n\t\t{\n\t\t\t$part1 = array_slice($this->questions, 0, $array_pos);\n\t\t\t$part2 = array_slice($this->questions, $array_pos);\n\t\t}\n\t\telse if ($insert_mode == 1)\n\t\t{\n\t\t\t$part1 = array_slice($this->questions, 0, $array_pos + 1);\n\t\t\t$part2 = array_slice($this->questions, $array_pos + 1);\n\t\t}\n\t\tforeach ($move_questions as $question_id)\n\t\t{\n\t\t\tif (!(array_search($question_id, $part1) === FALSE))\n\t\t\t{\n\t\t\t\tunset($part1[array_search($question_id, $part1)]);\n\t\t\t}\n\t\t\tif (!(array_search($question_id, $part2) === FALSE))\n\t\t\t{\n\t\t\t\tunset($part2[array_search($question_id, $part2)]);\n\t\t\t}\n\t\t}\n\t\t$part1 = array_values($part1);\n\t\t$part2 = array_values($part2);\n\t\t$this->questions = array_values(array_merge($part1, $move_questions, $part2));\n\t\tforeach ($move_questions as $question_id)\n\t\t{\n\t\t\t$constraints = $this->getConstraints($question_id);\n\t\t\tforeach ($constraints as $idx => $constraint)\n\t\t\t{\n\t\t\t\tforeach ($part2 as $next_question_id)\n\t\t\t\t{\n\t\t\t\t\tif ($constraint[\"question\"] == $next_question_id)\n\t\t\t\t\t{\n\t\t\t\t\t\t// constraint concerning a question that follows -> delete constraint\n\t\t\t\t\t\t$this->deleteConstraint($constraint[\"id\"]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->saveQuestionsToDb();\n\t}", "public function move_down($id = null) {\n\t\t$this->SurveyInstanceObject->id = $id;\n\t\tif (!$this->SurveyInstanceObject->exists()) {\n\t\t\tthrow new NotFoundException(__('Invalid survey instance object'));\n\t\t}\n\n\t\t// Permission check to ensure a user is allowed to edit this survey\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\t$surveyInstanceObject = $this->SurveyInstanceObject->read(null, $id);\n\t\t$surveyInstance = $this->SurveyInstance->read(null, $surveyInstanceObject['SurveyInstanceObject']['survey_instance_id']);\n\t\t$survey = $this->Survey->read(null, $surveyInstance['SurveyInstance']['survey_id']);\n\t\tif (!$this->SurveyAuthorisation->checkResearcherPermissionToSurvey($user, $survey))\n\t\t{\n\t\t\t$this->Session->setFlash(__('Permission Denied'));\n\t\t\t$this->redirect(array('controller' => 'surveys', 'action' => 'index'));\n\t\t}\n\n\t\t$below = $this->SurveyInstanceObject->find('first',\n\t\t\t\tarray('conditions' => array('survey_instance_id' => $surveyInstanceObject['SurveyInstanceObject']['survey_instance_id'],\n\t\t\t\t\t\t'order > ' => $surveyInstanceObject['SurveyInstanceObject']['order']),\n\t\t\t\t\t\t'order' => 'SurveyInstanceObject.order',\n\t\t\t\t\t\t'limit' => 1));\n\n\t\tif ($below)\n\t\t{\n\t\t\t$bottom_order = $below['SurveyInstanceObject']['order'];\n\t\t\t$top_order = $surveyInstanceObject['SurveyInstanceObject']['order'];\n\t\t\t\t\n\t\t\t$below['SurveyInstanceObject']['order'] = $top_order;\n\t\t\t$surveyInstanceObject['SurveyInstanceObject']['order'] = $bottom_order;\n\t\t\t\t\n\t\t\t$this->SurveyInstanceObject->save($below);\n\t\t\t$this->SurveyInstanceObject->save($surveyInstanceObject);\n\t\t}\n\n\t\t$this->redirect(array('controller' => 'surveyInstances', 'action' => 'edit', $surveyInstance['SurveyInstance']['id']));\n\t}", "public function movePostFromEndToTheMiddle() {}", "function newItemAfter()\r\n\t{\r\n\t\t$this->content_obj->newItemAfter();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "public function liftUp();", "function unfoldQuestionblocks($questionblocks)\n\t{\n\t\tglobal $ilDB;\n\t\tforeach ($questionblocks as $index)\n\t\t{\n\t\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_qblk WHERE questionblock_id = %s\",\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($index)\n\t\t\t);\n\t\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_qblk_qst WHERE questionblock_fi = %s AND survey_fi = %s\",\n\t\t\t\tarray('integer','integer'),\n\t\t\t\tarray($index, $this->getSurveyId())\n\t\t\t);\n\t\t}\n\t}", "public function insertNewQuestion($a_new_id)\n\t{\n\t\tglobal $rbacsystem, $ilDB, $lng;\n\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\tif (!SurveyQuestion::_isComplete($a_new_id))\n\t\t{\n\t\t\tilUtil::sendFailure($lng->txt(\"survey_error_insert_incomplete_question\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$a_new_id = $this->appendNewQuestionToSurvey($a_new_id);\n\t\t\t$this->object->loadQuestionsFromDb();\n\n\t\t\t$pos = $_REQUEST[\"pgov_pos\"];\n\n\t\t\t// a[fter]/b[efore] on same page\n\t\t\tif(substr($pos, -1) != \"c\")\n\t\t\t{\n\t\t\t\t// block handling\n\t\t\t\t$current = $this->object->getSurveyPages();\n\t\t\t\t$current = $current[$this->current_page-1];\n\t\t\t\tif(sizeof($current) == 1)\n\t\t\t\t{\n\t\t\t\t\t// as questions are moved to first block question\n\t\t\t\t\t// always use existing as first\n\t\t\t\t\t// the new question is moved later on (see below)\n\t\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t\tarray((int)$pos, $a_new_id));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$block_id = array_pop($current);\n\t\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t\t$this->object->addQuestionToBlock($a_new_id, $block_id);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// c: as new page (from toolbar/pool)\n\t\t\telse\n\t\t\t{\n\t\t\t\t// after given question\n\t\t\t\tif((int)$pos)\n\t\t\t\t{\n\t\t\t\t\t$pos = (int)$pos.\"a\";\n\t\t\t\t\t$this->current_page++;\n\t\t\t\t}\n\t\t\t\t// at the beginning\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$first = $this->object->getSurveyPages();\n\t\t\t\t\t$first = $first[0];\n\t\t\t\t\t$first = array_shift($first);\n\t\t\t\t\t$pos = $first[\"question_id\"].\"b\";\n\t\t\t\t\t$this->current_page = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move to target position\n\t\t\t$this->object->moveQuestions(array($a_new_id), (int)$pos,\n\t\t\t\t((substr($pos, -1) == \"a\") ? 1 : 0));\n\t\t}\n\t}", "function previousQuestions() {\n\t\t$arrValidTypes = array(1,2,3,4,5,7,10,11,12,13,14,15,23);\n\t\t$arrCurRecord = BackendUtility::getRecord($this->arrWizardParameters[\"table\"], $this->arrWizardParameters[\"uid\"]);\n\t\tif (!in_array(intval($arrCurRecord['sys_language_uid']),array(-1,0))) {\n\t\t\t$this->blnLocalization = TRUE;\n\t\t}\n \t$strWhereConf = '1=1';\n \t$strWhereConf .= ' AND pid='. $this->arrWizardParameters[\"pid\"];\n\t\t$strWhereConf .= ' AND ' . $this->strItemsTable . '.sys_language_uid IN (0,-1)';\n\t\t$strWhereConf .= ' AND sorting<' . $arrCurRecord[\"sorting\"];\n\t\t$strWhereConf .= BackendUtility::BEenableFields($this->strItemsTable);\n\t\t$strWhereConf .= BackendUtility::deleteClause($this->strItemsTable);\n\t\t$strOrderByConf = 'sorting ASC';\n\t\t$dbRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*',$this->arrWizardParameters[\"table\"],$strWhereConf,'',$strOrderByConf);\n while($arrDbRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($dbRes)) {\n \tif ($this->blnLocalization) {\n \t\t$arrDbRow = $this->getRecordOverlay($this->strItemsTable, $arrDbRow, $arrCurRecord['sys_language_uid']);\n\t\t\t}\n if (!isset($intPage)) {\n if ($arrDbRow['question_type']==22) {\n $intPage = 0;\n } else {\n $intPage = 1;\n }\n }\n if ($arrDbRow['question_type']<>22) {\n if (in_array($arrDbRow['question_type'],$arrValidTypes)) {\n $arrDbRow['page'] = $intPage;\n $this->arrPrevQuestions[$arrDbRow['uid']] = $arrDbRow;\n }\n } else {\n $intPage++;\n }\n\t\t}\n }" ]
[ "0.742927", "0.71027523", "0.69884723", "0.66863966", "0.6611965", "0.6556456", "0.60613334", "0.60523176", "0.58192295", "0.57727814", "0.56940085", "0.56110764", "0.55243796", "0.55202246", "0.55148363", "0.5507328", "0.55057025", "0.5454643", "0.5397951", "0.5396283", "0.5348425", "0.5323022", "0.529248", "0.52872264", "0.5266503", "0.5231193", "0.5188265", "0.5158955", "0.50526226", "0.5016773" ]
0.7643607
0
Moves a questionblock down in the list of survey questions
function moveDownQuestionblock($questionblock_id) { $pages =& $this->getSurveyPages(); $move_questions = array(); $pageindex = -1; foreach ($pages as $idx => $page) { if ($page[0]["questionblock_id"] == $questionblock_id) { foreach ($page as $pageidx => $question) { array_push($move_questions, $question["question_id"]); } $pageindex = $idx; } } if ($pageindex < count($pages)-1) { $this->moveQuestions($move_questions, $pages[$pageindex+1][count($pages[$pageindex+1])-1]["question_id"], 1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveUpQuestionblock($questionblock_id)\n\t{\n\t\t$pages =& $this->getSurveyPages();\n\t\t$move_questions = array();\n\t\t$pageindex = -1;\n\t\tforeach ($pages as $idx => $page)\n\t\t{\n\t\t\tif ($page[0][\"questionblock_id\"] == $questionblock_id)\n\t\t\t{\n\t\t\t\tforeach ($page as $pageidx => $question)\n\t\t\t\t{\n\t\t\t\t\tarray_push($move_questions, $question[\"question_id\"]);\n\t\t\t\t}\n\t\t\t\t$pageindex = $idx;\n\t\t\t}\n\t\t}\n\t\tif ($pageindex > 0)\n\t\t{\n\t\t\t$this->moveQuestions($move_questions, $pages[$pageindex-1][0][\"question_id\"], 0);\n\t\t}\n\t}", "public function moveDownQuestion($question_id)\n\t{\n\t\t$move_questions = array($question_id);\n\t\t$pages =& $this->getSurveyPages();\n\t\t$pageindex = -1;\n\t\tforeach ($pages as $idx => $page)\n\t\t{\n\t\t\tif (($page[0][\"question_id\"] == $question_id) && (strcmp($page[0][\"questionblock_id\"], \"\") == 0))\n\t\t\t{\n\t\t\t\t$pageindex = $idx;\n\t\t\t}\n\t\t}\n\t\tif (($pageindex < count($pages)-1) && ($pageindex >= 0))\n\t\t{\n\t\t\t$this->moveQuestions($move_questions, $pages[$pageindex+1][count($pages[$pageindex+1])-1][\"question_id\"], 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// move down a question in a questionblock\n\t\t\t$questions = $this->getSurveyQuestions();\n\t\t\t$questions = array_keys($questions);\n\t\t\t$index = array_search($question_id, $questions);\n\t\t\tif (($index !== FALSE) && ($index < count($questions)-1))\n\t\t\t{\n\t\t\t\t$this->moveQuestions($move_questions, $questions[$index+1], 1);\n\t\t\t}\n\t\t}\n\t}", "function moveUpQuestion($question_id)\n\t{\n\t\t$move_questions = array($question_id);\n\t\t$pages =& $this->getSurveyPages();\n\t\t$pageindex = -1;\n\t\tforeach ($pages as $idx => $page)\n\t\t{\n\t\t\tif ($page[0][\"question_id\"] == $question_id)\n\t\t\t{\n\t\t\t\t$pageindex = $idx;\n\t\t\t}\n\t\t}\n\t\tif ($pageindex > 0)\n\t\t{\n\t\t\t$this->moveQuestions($move_questions, $pages[$pageindex-1][0][\"question_id\"], 0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// move up a question in a questionblock\n\t\t\t$questions = $this->getSurveyQuestions();\n\t\t\t$questions = array_keys($questions);\n\t\t\t$index = array_search($question_id, $questions);\n\t\t\tif (($index !== FALSE) && ($index > 0))\n\t\t\t{\n\t\t\t\t$this->moveQuestions($move_questions, $questions[$index-1], 0);\n\t\t\t}\n\t\t}\n\t}", "function ipal_move_question_down($layout, $questionid) {\n return _ipal_move_question($layout, $questionid, + 1);\n}", "function ipal_move_question_up($layout, $questionid) {\n return _ipal_move_question($layout, $questionid, -1);\n}", "function moveItemDown()\r\n\t{\r\n\t\t$this->content_obj->moveItemDown();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "protected function deleteBlock()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\t\t\n\t\t$ilCtrl->setParameter($this->editor_gui, \"pgov\", $this->current_page);\n\t\tilUtil::sendQuestion($lng->txt(\"remove_questions\"));\n\t\t\n\t\t$page = $this->object->getSurveyPages();\n\t\t$page = $page[$this->current_page-1];\n\t\t\n\t\t// #10567\n\t\tif($_REQUEST[\"csum\"] != md5(print_r($page, true)))\n\t\t{\n\t\t\t$ilCtrl->redirect($this, \"renderPage\");\n\t\t}\n\t\t\n\t\t$page = array_shift($page);\n\t\t$block_id = $page[\"questionblock_id\"];\n\t\tif($block_id)\n\t\t{\n\t\t\t$this->editor_gui->removeQuestionsForm(array($block_id), array(), array());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->editor_gui->removeQuestionsForm(array(), array($page[\"question_id\"]), array());\n\t\t}\n\t}", "protected function moveNext($a_id)\n\t{\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\t\t$target = $pages[$this->current_page];\n\t\tif(sizeof($target))\n\t\t{\n\t\t\t$target_id = $target;\n\t\t\t$target_id = array_shift($target_id);\n\t\t\t$target_block_id = $target_id[\"questionblock_id\"];\n\t\t\t$target_id = $target_id[\"question_id\"];\n\n\t\t\t// nothing to do if no block\n\t\t\tif(sizeof($source) > 1)\n\t\t\t{\n\t\t\t\t$block_id = $source;\n\t\t\t\t$block_id = array_shift($block_id);\n\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t// source pages block is obsolete\n\t\t\t\tif(sizeof($source) == 2)\n\t\t\t\t{\n\t\t\t\t\t// delete block\n\t\t\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// remove question from block\n\t\t\t\t\t$this->object->removeQuestionFromBlock($a_id, $block_id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move source question to target\n\t\t\t$this->object->moveQuestions(array($a_id), $target_id, 0);\n\n\t\t\t// new page has no block yet\n\t\t\tif(sizeof($target) < 2)\n\t\t\t{\n\t\t\t\t// create block and move target question and source into block\n\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\tarray($a_id, $target_id));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// add source question to block\n\t\t\t\t$this->object->addQuestionToBlock($a_id, $target_block_id);\n\t\t\t}\n\n\t\t\t// only if current page is not \"deleted\"\n\t\t\tif(sizeof($source) > 1)\n\t\t\t{\n\t\t\t\t$this->current_page++;\n\t\t\t}\n\t\t}\n\t}", "protected function movePrevious($a_id)\n\t{\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\t\t$target = $pages[$this->current_page-2];\n\t\tif(sizeof($target))\n\t\t{\n\t\t\t$target_id = $target;\n\t\t\t$target_id = array_pop($target_id);\n\t\t\t$target_block_id = $target_id[\"questionblock_id\"];\n\t\t\t$target_id = $target_id[\"question_id\"];\n\n\t\t\t// nothing to do if no block\n\t\t\tif(sizeof($source) > 1)\n\t\t\t{\n\t\t\t\t$block_id = $source;\n\t\t\t\t$block_id = array_shift($block_id);\n\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t// source pages block is obsolete\n\t\t\t\tif(sizeof($source) == 2)\n\t\t\t\t{\n\t\t\t\t\t// delete block\n\t\t\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// remove question from block\n\t\t\t\t\t$this->object->removeQuestionFromBlock($a_id, $block_id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move source question to target\n\t\t\t$this->object->moveQuestions(array($a_id), $target_id, 1);\n\n\t\t\t// new page has no block yet\n\t\t\tif(sizeof($target) < 2)\n\t\t\t{\n\t\t\t\t// create block and move target question and source into block\n\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\tarray($target_id, $a_id));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// add source question to block\n\t\t\t\t$this->object->addQuestionToBlock($a_id, $target_block_id);\n\t\t\t}\n\n\t\t\t$this->current_page--;\n\t\t}\n\t}", "function moveItemUp()\r\n\t{\r\n\t\t$this->content_obj->moveItemUp();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "protected function confirmRemoveQuestions()\n\t{\n\t\tglobal $ilCtrl;\n\t\t\n\t\t// gather ids\n\t\t$ids = array();\n\t\tforeach ($_POST as $key => $value)\n\t\t{\n\t\t\tif (preg_match(\"/id_(\\d+)/\", $key, $matches))\n\t\t\t{\n\t\t\t\tarray_push($ids, $matches[1]);\n\t\t\t}\n\t\t}\n\n\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\n\t\t$block_id = $source;\n\t\t$block_id = array_shift($block_id);\n\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\tif(sizeof($ids) && sizeof($source) > sizeof($ids))\n\t\t{\n\t\t\t// block is obsolete\n\t\t\tif(sizeof($source)-sizeof($ids) == 1)\n\t\t\t{\n\t\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t\t}\n\t\t\t// block will remain, remove question(s) from block\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach($ids as $qid)\n\t\t\t\t{\n\t\t\t\t\t$this->object->removeQuestionFromBlock($qid, $block_id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->object->removeQuestions($ids, array());\n\t\t}\n\t\t// all items on page \n\t\telse \n\t\t{\n\t\t\t// remove complete block\n\t\t\tif($block_id)\n\t\t\t{\n\t\t\t\t$this->object->removeQuestions(array(), array($block_id));\n\t\t\t}\n\t\t\t// remove single question\n\t\t\telse\n\t\t\t{\t\t\t\t\n\t\t\t\t$this->object->removeQuestions($ids, array());\n\t\t\t}\n\n\t\t\t// render previous page\n\t\t\tif($this->current_page > 1)\n\t\t\t{\n\t\t\t\t$this->current_page--;\n\t\t\t}\n\t\t}\n\n\t\t$this->object->saveCompletionStatus();\n\t\t\t\n\t\t// #10567\n\t\t$ilCtrl->setParameter($this, \"pgov\", $this->current_page);\n\t\t$ilCtrl->redirect($this, \"renderPage\");\n\t}", "function downQuestion($id = null) {\n $this->autoRender = false; // turn off autoRender because there is no deleteQuestions view\n if($this->request->is('ajax')) {\n // only process ajax requests\n $tempArr = null;\n if ($this->Session->check('SurveyQuestion.new')) {\n //check for the session variable containing questions for this survey\n $tempArr = $this->Session->read('SurveyQuestion.new'); // get temp working copy of questions\n $swapone = $tempArr[$id];\n $swaptwo = $tempArr[$id+1];\n $tempArr[$id+1] = $swapone;\n $tempArr[$id] = $swaptwo;\n }\n $this->Session->write('SurveyQuestion.new',$tempArr); // write the new question array to the session\n $this->set('questions', $tempArr); // send the questions to the view\n $this->layout = 'ajax'; // use the blank ajax layout\n $this->render('/Elements/manage_questions'); // send the element to the receiving element in the view\n }\n }", "function orderdown() {\n\t\torder(-1);\n\t}", "public function insertQuestionBlock($a_block_id)\n\t{\n\t\t$new_ids = array();\n\t\t$question_ids = $this->object->getQuestionblockQuestionIds($a_block_id);\n\t\tforeach($question_ids as $qid)\n\t\t{\n\t\t\t$new_ids[] = $this->appendNewQuestionToSurvey($qid, true, true);\n\t\t}\n\t\t\n\t\tif(sizeof($new_ids))\n\t\t{\n\t\t\t$this->object->loadQuestionsFromDb();\n\t\t\t\n\t\t\t$pos = $_REQUEST[\"pgov_pos\"];\n\t\t\n\t\t\t// a[fter]/b[efore] on same page\n\t\t\tif(substr($pos, -1) != \"c\")\n\t\t\t{\n\t\t\t\t// block handling\n\t\t\t\t$current = $this->object->getSurveyPages();\n\t\t\t\t$current = $current[$this->current_page-1];\n\t\t\t\tif(sizeof($current) == 1)\n\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// as questions are moved to first block question\n\t\t\t\t\t// always use existing as first\n\t\t\t\t\t// the new question is moved later on (see below)\n\t\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t\tarray((int)$pos)+$new_ids);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$block_id = array_pop($current);\n\t\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t\tforeach($new_ids as $qid)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->object->addQuestionToBlock($qid, $block_id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// c: as new page (from toolbar/pool)\n\t\t\telse\n\t\t\t{\n\t\t\t\t// re-create block\n\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t$new_ids);\n\t\t\t\t\n\t\t\t\t// after given question\n\t\t\t\tif((int)$pos)\n\t\t\t\t{\n\t\t\t\t\t$pos = (int)$pos.\"a\";\n\t\t\t\t}\n\t\t\t\t// at the beginning\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$first = $this->object->getSurveyPages();\n\t\t\t\t\t$first = $first[0];\n\t\t\t\t\t$first = array_shift($first);\n\t\t\t\t\t$pos = $first[\"question_id\"].\"b\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move to target position\n\t\t\t$this->object->moveQuestions($new_ids, (int)$pos,\n\t\t\t\t((substr($pos, -1) == \"a\") ? 1 : 0));\t\t\t\n\t\t}\n\t}", "protected function splitPage($a_id)\n\t{\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\n\t\t$block_questions = array();\n\t\t$add = $block_id = false;\n\t\tforeach($source as $idx => $item)\n\t\t{\n\t\t\tif($item[\"question_id\"] == $a_id)\n\t\t\t{\n\t\t\t\t$block_id = $item[\"questionblock_id\"];\n\t\t\t\t$add = $idx;\n\t\t\t}\n\t\t\tif($add)\n\t\t\t{\n\t\t\t\t$block_questions[] = $item[\"question_id\"];\n\t\t\t}\n\t\t}\n\n\t\t// just 1 question left: block is obsolete\n\t\tif($add == 1)\n\t\t{\n\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t}\n\t\t// remove questions from block\n\t\telse\n\t\t{\n\t\t\tforeach($block_questions as $qid)\n\t\t\t{\n\t\t\t\t$this->object->removeQuestionFromBlock($qid, $block_id);\n\t\t\t}\n\t\t}\n\n\t\t// more than 1 moved?\n\t\tif(sizeof($block_questions) > 1)\n\t\t{\n\t\t\t// create new block and move target questions\n\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t$block_questions);\n\t\t}\n\t\t\n\t\t$this->current_page++;\n\t}", "public function move_down($id = null) {\n\t\t$this->SurveyInstanceObject->id = $id;\n\t\tif (!$this->SurveyInstanceObject->exists()) {\n\t\t\tthrow new NotFoundException(__('Invalid survey instance object'));\n\t\t}\n\n\t\t// Permission check to ensure a user is allowed to edit this survey\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\t$surveyInstanceObject = $this->SurveyInstanceObject->read(null, $id);\n\t\t$surveyInstance = $this->SurveyInstance->read(null, $surveyInstanceObject['SurveyInstanceObject']['survey_instance_id']);\n\t\t$survey = $this->Survey->read(null, $surveyInstance['SurveyInstance']['survey_id']);\n\t\tif (!$this->SurveyAuthorisation->checkResearcherPermissionToSurvey($user, $survey))\n\t\t{\n\t\t\t$this->Session->setFlash(__('Permission Denied'));\n\t\t\t$this->redirect(array('controller' => 'surveys', 'action' => 'index'));\n\t\t}\n\n\t\t$below = $this->SurveyInstanceObject->find('first',\n\t\t\t\tarray('conditions' => array('survey_instance_id' => $surveyInstanceObject['SurveyInstanceObject']['survey_instance_id'],\n\t\t\t\t\t\t'order > ' => $surveyInstanceObject['SurveyInstanceObject']['order']),\n\t\t\t\t\t\t'order' => 'SurveyInstanceObject.order',\n\t\t\t\t\t\t'limit' => 1));\n\n\t\tif ($below)\n\t\t{\n\t\t\t$bottom_order = $below['SurveyInstanceObject']['order'];\n\t\t\t$top_order = $surveyInstanceObject['SurveyInstanceObject']['order'];\n\t\t\t\t\n\t\t\t$below['SurveyInstanceObject']['order'] = $top_order;\n\t\t\t$surveyInstanceObject['SurveyInstanceObject']['order'] = $bottom_order;\n\t\t\t\t\n\t\t\t$this->SurveyInstanceObject->save($below);\n\t\t\t$this->SurveyInstanceObject->save($surveyInstanceObject);\n\t\t}\n\n\t\t$this->redirect(array('controller' => 'surveyInstances', 'action' => 'edit', $surveyInstance['SurveyInstance']['id']));\n\t}", "function crunchify_move_comment_form_below( $fields ) { \n $comment_field = $fields['comment']; \n unset( $fields['comment'] ); \n $fields['comment'] = $comment_field; \n return $fields; \n}", "function newItemAfter()\r\n\t{\r\n\t\t$this->content_obj->newItemAfter();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "function unfoldQuestionblocks($questionblocks)\n\t{\n\t\tglobal $ilDB;\n\t\tforeach ($questionblocks as $index)\n\t\t{\n\t\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_qblk WHERE questionblock_id = %s\",\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($index)\n\t\t\t);\n\t\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_qblk_qst WHERE questionblock_fi = %s AND survey_fi = %s\",\n\t\t\t\tarray('integer','integer'),\n\t\t\t\tarray($index, $this->getSurveyId())\n\t\t\t);\n\t\t}\n\t}", "function OnMoveDown(){\n $this->Move();\n $message = \"&MESSAGE=MSG_ITEM_MOVED\";\n $this->AfterSubmitRedirect(\"?\".($this->Package!=\"\" ? \"package=\".$this->Package.\"&\" : \"\").\"page=\" . $this->listHandler . \"&\" . $this->library_ID . \"_start=\" . $this->start . \"&\" . $this->library_ID . \"_order_by=\" . $this->order_by . \"&library=\" . $this->library_ID . \"&\" . $this->library_ID . \"_parent_id=\" . $this->parent_id . \"\" . $message . \"\" . \"&\" . str_replace(\"&amp;\", \"&\", rawurldecode($this->restore)));\n }", "function moveQuestions($move_questions, $target_index, $insert_mode)\n\t{\n\t\t$array_pos = array_search($target_index, $this->questions);\n\t\tif ($insert_mode == 0)\n\t\t{\n\t\t\t$part1 = array_slice($this->questions, 0, $array_pos);\n\t\t\t$part2 = array_slice($this->questions, $array_pos);\n\t\t}\n\t\telse if ($insert_mode == 1)\n\t\t{\n\t\t\t$part1 = array_slice($this->questions, 0, $array_pos + 1);\n\t\t\t$part2 = array_slice($this->questions, $array_pos + 1);\n\t\t}\n\t\tforeach ($move_questions as $question_id)\n\t\t{\n\t\t\tif (!(array_search($question_id, $part1) === FALSE))\n\t\t\t{\n\t\t\t\tunset($part1[array_search($question_id, $part1)]);\n\t\t\t}\n\t\t\tif (!(array_search($question_id, $part2) === FALSE))\n\t\t\t{\n\t\t\t\tunset($part2[array_search($question_id, $part2)]);\n\t\t\t}\n\t\t}\n\t\t$part1 = array_values($part1);\n\t\t$part2 = array_values($part2);\n\t\t$this->questions = array_values(array_merge($part1, $move_questions, $part2));\n\t\tforeach ($move_questions as $question_id)\n\t\t{\n\t\t\t$constraints = $this->getConstraints($question_id);\n\t\t\tforeach ($constraints as $idx => $constraint)\n\t\t\t{\n\t\t\t\tforeach ($part2 as $next_question_id)\n\t\t\t\t{\n\t\t\t\t\tif ($constraint[\"question\"] == $next_question_id)\n\t\t\t\t\t{\n\t\t\t\t\t\t// constraint concerning a question that follows -> delete constraint\n\t\t\t\t\t\t$this->deleteConstraint($constraint[\"id\"]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->saveQuestionsToDb();\n\t}", "public function movePostFromEndToTheMiddle() {}", "protected function dnd()\n\t{\n\t\t$source_id = (int)array_pop(explode(\"_\", $_REQUEST[\"il_hform_source\"]));\n\t\tif($_REQUEST[\"il_hform_target\"] != \"droparea_end\")\n\t\t{\n\t\t\t$target_id = (int)array_pop(explode(\"_\", $_REQUEST[\"il_hform_target\"]));\n\t\t\t$pos = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$page = $this->object->getSurveyPages();\n\t\t\t$page = $page[$this->current_page-1];\n\t\t\t$last = array_pop($page);\n\t\t\t$target_id = (int)$last[\"question_id\"];\n\t\t\t$pos = 1;\n\t\t}\n\t\tif($source_id != $target_id)\n\t\t{\n\t\t\t$this->object->moveQuestions(array($source_id), $target_id, $pos);\n\t\t}\n\t}", "public function moveUp\n\t(\n\t\t$sortOrder\t\t// <int> The sort order of the block associated with this segment piece.\n\t)\t\t\t\t\t// RETURNS <bool> TRUE on success, FALSE on failure.\n\t\n\t// $contentForm->moveUp($sortOrder);\n\t{\n\t\t// Make sure there is upward mobility (a block higher than itself)\n\t\tif($sortOrder <= 1) { return false; }\n\t\t\n\t\t$swapOrder = $sortOrder - 1;\n\t\t\n\t\tDatabase::startTransaction();\n\t\t\n\t\tif($pass = Database::query(\"UPDATE content_block_segment SET sort_order=? WHERE content_id=? AND sort_order=? LIMIT 1\", array(0, $this->contentID, $sortOrder)))\n\t\t{\n\t\t\tif($pass = Database::query(\"UPDATE content_block_segment SET sort_order=? WHERE content_id=? AND sort_order=? LIMIT 1\", array($sortOrder, $this->contentID, $swapOrder)))\n\t\t\t{\n\t\t\t\t$pass = Database::query(\"UPDATE content_block_segment SET sort_order=? WHERE content_id=? AND sort_order=? LIMIT 1\", array($swapOrder, $this->contentID, 0));\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(Database::endTransaction($pass))\n\t\t{\n\t\t\t$this->updateCache();\n\t\t\t\n\t\t\theader(\"Location: \" . $this->baseURL . \"?id=\" . $this->contentID); exit;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "protected function movePage()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\n\t\t// current_page is already set to new position\n\t\t$target_page = $this->current_page-1;\n\t\t$source_page = $_REQUEST[\"old_pos\"]-1;\n\n\t\t$pages = $this->object->getSurveyPages();\n\t\tforeach($pages[$source_page] as $question)\n\t\t{\n\t\t\t$questions[] = $question[\"question_id\"];\n\t\t}\n\n\t\t// move to first position\n\t\t$position = 0;\n\t\tif($_REQUEST[\"pgov\"] != \"fst\")\n\t\t{\n\t\t\t$position = 1;\n\t\t}\n\n\t\t$target = $pages[$target_page];\n\t\t$target = array_shift($target);\n\t\t$this->object->moveQuestions($questions, $target[\"question_id\"], $position);\n\n\t\tif($target_page < $source_page && $position)\n\t\t{\n\t\t $this->current_page++;\n\t\t}\n\n\t\tilUtil::sendSuccess($lng->txt(\"survey_page_moved\"), true);\n\t\t$ilCtrl->setParameter($this, \"pgov\", $this->current_page);\n\t\t$ilCtrl->redirect($this, \"renderPage\");\n\t}", "function deleteAnswer($index = 0)\n\t{\n\t\tif ($index < 0) return;\n\t\tif (count($this->answers) < 1) return;\n\t\tif ($index >= count($this->answers)) return;\n\t\tunset($this->answers[$index]);\n\t\t$this->answers = array_values($this->answers);\n\t\tfor ($i = 0; $i < count($this->answers); $i++)\n\t\t{\n\t\t\tif ($this->answers[$i]->getOrder() > $index)\n\t\t\t{\n\t\t\t\t$this->answers[$i]->setOrder($i);\n\t\t\t}\n\t\t}\n\t}", "public function insertNewQuestion($a_new_id)\n\t{\n\t\tglobal $rbacsystem, $ilDB, $lng;\n\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\tif (!SurveyQuestion::_isComplete($a_new_id))\n\t\t{\n\t\t\tilUtil::sendFailure($lng->txt(\"survey_error_insert_incomplete_question\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$a_new_id = $this->appendNewQuestionToSurvey($a_new_id);\n\t\t\t$this->object->loadQuestionsFromDb();\n\n\t\t\t$pos = $_REQUEST[\"pgov_pos\"];\n\n\t\t\t// a[fter]/b[efore] on same page\n\t\t\tif(substr($pos, -1) != \"c\")\n\t\t\t{\n\t\t\t\t// block handling\n\t\t\t\t$current = $this->object->getSurveyPages();\n\t\t\t\t$current = $current[$this->current_page-1];\n\t\t\t\tif(sizeof($current) == 1)\n\t\t\t\t{\n\t\t\t\t\t// as questions are moved to first block question\n\t\t\t\t\t// always use existing as first\n\t\t\t\t\t// the new question is moved later on (see below)\n\t\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t\tarray((int)$pos, $a_new_id));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$block_id = array_pop($current);\n\t\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t\t$this->object->addQuestionToBlock($a_new_id, $block_id);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// c: as new page (from toolbar/pool)\n\t\t\telse\n\t\t\t{\n\t\t\t\t// after given question\n\t\t\t\tif((int)$pos)\n\t\t\t\t{\n\t\t\t\t\t$pos = (int)$pos.\"a\";\n\t\t\t\t\t$this->current_page++;\n\t\t\t\t}\n\t\t\t\t// at the beginning\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$first = $this->object->getSurveyPages();\n\t\t\t\t\t$first = $first[0];\n\t\t\t\t\t$first = array_shift($first);\n\t\t\t\t\t$pos = $first[\"question_id\"].\"b\";\n\t\t\t\t\t$this->current_page = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move to target position\n\t\t\t$this->object->moveQuestions(array($a_new_id), (int)$pos,\n\t\t\t\t((substr($pos, -1) == \"a\") ? 1 : 0));\n\t\t}\n\t}", "public function actionDown()\n\t{\n\t\tif (!Yii::app()->request->isAjaxRequest)\n\t\t\tthrow new CHttpException(404);\n\t\t\n\t\t$this->layout = false;\n\t\t$id = Yii::app()->request->getParam('id');\n\t\t$current = IdeaHeap::model()->findByPk($id);\n\t\tif (is_null($current))\n\t\t\treturn $this->renderText (false);\n\t\t\n\t\t$criteria = new CDbCriteria();\n\t\t$criteria->condition = 'idea_type_id=:idea_type_id AND option_key=:option_key AND parent_id=:parent_id AND position>:position';\n\t\t$criteria->order = 'position ASC';\n\t\t$criteria->params = array(':position' => $current->position, \n\t\t\t\t\t':idea_type_id' => $current->idea_type_id, \n\t\t\t\t\t':parent_id' => $current->parent_id,\n\t\t\t\t\t':option_key' => $current->option_key,\n\t\t\t\t);\n\t\t\n\t\t$next = IdeaHeap::model()->find($criteria);\n\t\tif (is_null($next))\n\t\t\treturn $this->renderText (false);\n\t\t$tmp = $current->position;\n\t\t$current->position = $next->position;\n\t\t$next->position = $tmp;\n\t\t$current->save(false);\n\t\t$next->save(false);\n\t\treturn $this->renderText (true);\n\t}", "public function shift(): LayoutBlock\n {\n return $this->blocks->shift();\n }", "function createQuestionblock($title, $show_questiontext, $show_blocktitle, $questions)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t// if the selected questions are not in a continous selection, move all questions of the\n\t\t// questionblock at the position of the first selected question\n\t\t$this->moveQuestions($questions, $questions[0], 0);\n\t\t\n\t\t// now save the question block\n\t\tglobal $ilUser;\n\t\t$next_id = $ilDB->nextId('svy_qblk');\n\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_qblk (questionblock_id, title, show_questiontext,\".\n\t\t\t\" show_blocktitle, owner_fi, tstamp) VALUES (%s, %s, %s, %s, %s, %s)\",\n\t\t\tarray('integer','text','text','text','integer','integer'),\n\t\t\tarray($next_id, $title, $show_questiontext, $show_blocktitle, $ilUser->getId(), time())\n\t\t);\n\t\tif ($affectedRows)\n\t\t{\n\t\t\t$questionblock_id = $next_id;\n\t\t\tforeach ($questions as $index)\n\t\t\t{\n\t\t\t\t$next_id = $ilDB->nextId('svy_qblk_qst');\n\t\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_qblk_qst (qblk_qst_id, survey_fi, questionblock_fi, \" .\n\t\t\t\t\t\"question_fi) VALUES (%s, %s, %s, %s)\",\n\t\t\t\t\tarray('integer','integer','integer','integer'),\n\t\t\t\t\tarray($next_id, $this->getSurveyId(), $questionblock_id, $index)\n\t\t\t\t);\n\t\t\t\t$this->deleteConstraints($index);\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.720421", "0.7062827", "0.6867389", "0.68327665", "0.65457124", "0.6430471", "0.6065341", "0.6018024", "0.60106564", "0.60042584", "0.57333195", "0.5699364", "0.56878304", "0.56110895", "0.5443492", "0.5420068", "0.5396772", "0.53746516", "0.5374626", "0.5346635", "0.53080577", "0.52703", "0.52375925", "0.5237188", "0.52321887", "0.5188545", "0.5087388", "0.50823706", "0.5064", "0.5062792" ]
0.7477163
0
Move questions and/or questionblocks to another position
function moveQuestions($move_questions, $target_index, $insert_mode) { $array_pos = array_search($target_index, $this->questions); if ($insert_mode == 0) { $part1 = array_slice($this->questions, 0, $array_pos); $part2 = array_slice($this->questions, $array_pos); } else if ($insert_mode == 1) { $part1 = array_slice($this->questions, 0, $array_pos + 1); $part2 = array_slice($this->questions, $array_pos + 1); } foreach ($move_questions as $question_id) { if (!(array_search($question_id, $part1) === FALSE)) { unset($part1[array_search($question_id, $part1)]); } if (!(array_search($question_id, $part2) === FALSE)) { unset($part2[array_search($question_id, $part2)]); } } $part1 = array_values($part1); $part2 = array_values($part2); $this->questions = array_values(array_merge($part1, $move_questions, $part2)); foreach ($move_questions as $question_id) { $constraints = $this->getConstraints($question_id); foreach ($constraints as $idx => $constraint) { foreach ($part2 as $next_question_id) { if ($constraint["question"] == $next_question_id) { // constraint concerning a question that follows -> delete constraint $this->deleteConstraint($constraint["id"]); } } } } $this->saveQuestionsToDb(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveUpQuestionblock($questionblock_id)\n\t{\n\t\t$pages =& $this->getSurveyPages();\n\t\t$move_questions = array();\n\t\t$pageindex = -1;\n\t\tforeach ($pages as $idx => $page)\n\t\t{\n\t\t\tif ($page[0][\"questionblock_id\"] == $questionblock_id)\n\t\t\t{\n\t\t\t\tforeach ($page as $pageidx => $question)\n\t\t\t\t{\n\t\t\t\t\tarray_push($move_questions, $question[\"question_id\"]);\n\t\t\t\t}\n\t\t\t\t$pageindex = $idx;\n\t\t\t}\n\t\t}\n\t\tif ($pageindex > 0)\n\t\t{\n\t\t\t$this->moveQuestions($move_questions, $pages[$pageindex-1][0][\"question_id\"], 0);\n\t\t}\n\t}", "function ipal_move_question_up($layout, $questionid) {\n return _ipal_move_question($layout, $questionid, -1);\n}", "function moveUpQuestion($question_id)\n\t{\n\t\t$move_questions = array($question_id);\n\t\t$pages =& $this->getSurveyPages();\n\t\t$pageindex = -1;\n\t\tforeach ($pages as $idx => $page)\n\t\t{\n\t\t\tif ($page[0][\"question_id\"] == $question_id)\n\t\t\t{\n\t\t\t\t$pageindex = $idx;\n\t\t\t}\n\t\t}\n\t\tif ($pageindex > 0)\n\t\t{\n\t\t\t$this->moveQuestions($move_questions, $pages[$pageindex-1][0][\"question_id\"], 0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// move up a question in a questionblock\n\t\t\t$questions = $this->getSurveyQuestions();\n\t\t\t$questions = array_keys($questions);\n\t\t\t$index = array_search($question_id, $questions);\n\t\t\tif (($index !== FALSE) && ($index > 0))\n\t\t\t{\n\t\t\t\t$this->moveQuestions($move_questions, $questions[$index-1], 0);\n\t\t\t}\n\t\t}\n\t}", "function moveDownQuestionblock($questionblock_id)\n\t{\n\t\t$pages =& $this->getSurveyPages();\n\t\t$move_questions = array();\n\t\t$pageindex = -1;\n\t\tforeach ($pages as $idx => $page)\n\t\t{\n\t\t\tif ($page[0][\"questionblock_id\"] == $questionblock_id)\n\t\t\t{\n\t\t\t\tforeach ($page as $pageidx => $question)\n\t\t\t\t{\n\t\t\t\t\tarray_push($move_questions, $question[\"question_id\"]);\n\t\t\t\t}\n\t\t\t\t$pageindex = $idx;\n\t\t\t}\n\t\t}\n\t\tif ($pageindex < count($pages)-1)\n\t\t{\n\t\t\t$this->moveQuestions($move_questions, $pages[$pageindex+1][count($pages[$pageindex+1])-1][\"question_id\"], 1);\n\t\t}\n\t}", "function ipal_move_question_down($layout, $questionid) {\n return _ipal_move_question($layout, $questionid, + 1);\n}", "protected function moveNext($a_id)\n\t{\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\t\t$target = $pages[$this->current_page];\n\t\tif(sizeof($target))\n\t\t{\n\t\t\t$target_id = $target;\n\t\t\t$target_id = array_shift($target_id);\n\t\t\t$target_block_id = $target_id[\"questionblock_id\"];\n\t\t\t$target_id = $target_id[\"question_id\"];\n\n\t\t\t// nothing to do if no block\n\t\t\tif(sizeof($source) > 1)\n\t\t\t{\n\t\t\t\t$block_id = $source;\n\t\t\t\t$block_id = array_shift($block_id);\n\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t// source pages block is obsolete\n\t\t\t\tif(sizeof($source) == 2)\n\t\t\t\t{\n\t\t\t\t\t// delete block\n\t\t\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// remove question from block\n\t\t\t\t\t$this->object->removeQuestionFromBlock($a_id, $block_id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move source question to target\n\t\t\t$this->object->moveQuestions(array($a_id), $target_id, 0);\n\n\t\t\t// new page has no block yet\n\t\t\tif(sizeof($target) < 2)\n\t\t\t{\n\t\t\t\t// create block and move target question and source into block\n\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\tarray($a_id, $target_id));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// add source question to block\n\t\t\t\t$this->object->addQuestionToBlock($a_id, $target_block_id);\n\t\t\t}\n\n\t\t\t// only if current page is not \"deleted\"\n\t\t\tif(sizeof($source) > 1)\n\t\t\t{\n\t\t\t\t$this->current_page++;\n\t\t\t}\n\t\t}\n\t}", "protected function movePrevious($a_id)\n\t{\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\t\t$target = $pages[$this->current_page-2];\n\t\tif(sizeof($target))\n\t\t{\n\t\t\t$target_id = $target;\n\t\t\t$target_id = array_pop($target_id);\n\t\t\t$target_block_id = $target_id[\"questionblock_id\"];\n\t\t\t$target_id = $target_id[\"question_id\"];\n\n\t\t\t// nothing to do if no block\n\t\t\tif(sizeof($source) > 1)\n\t\t\t{\n\t\t\t\t$block_id = $source;\n\t\t\t\t$block_id = array_shift($block_id);\n\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t// source pages block is obsolete\n\t\t\t\tif(sizeof($source) == 2)\n\t\t\t\t{\n\t\t\t\t\t// delete block\n\t\t\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// remove question from block\n\t\t\t\t\t$this->object->removeQuestionFromBlock($a_id, $block_id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move source question to target\n\t\t\t$this->object->moveQuestions(array($a_id), $target_id, 1);\n\n\t\t\t// new page has no block yet\n\t\t\tif(sizeof($target) < 2)\n\t\t\t{\n\t\t\t\t// create block and move target question and source into block\n\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\tarray($target_id, $a_id));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// add source question to block\n\t\t\t\t$this->object->addQuestionToBlock($a_id, $target_block_id);\n\t\t\t}\n\n\t\t\t$this->current_page--;\n\t\t}\n\t}", "public function moveDownQuestion($question_id)\n\t{\n\t\t$move_questions = array($question_id);\n\t\t$pages =& $this->getSurveyPages();\n\t\t$pageindex = -1;\n\t\tforeach ($pages as $idx => $page)\n\t\t{\n\t\t\tif (($page[0][\"question_id\"] == $question_id) && (strcmp($page[0][\"questionblock_id\"], \"\") == 0))\n\t\t\t{\n\t\t\t\t$pageindex = $idx;\n\t\t\t}\n\t\t}\n\t\tif (($pageindex < count($pages)-1) && ($pageindex >= 0))\n\t\t{\n\t\t\t$this->moveQuestions($move_questions, $pages[$pageindex+1][count($pages[$pageindex+1])-1][\"question_id\"], 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// move down a question in a questionblock\n\t\t\t$questions = $this->getSurveyQuestions();\n\t\t\t$questions = array_keys($questions);\n\t\t\t$index = array_search($question_id, $questions);\n\t\t\tif (($index !== FALSE) && ($index < count($questions)-1))\n\t\t\t{\n\t\t\t\t$this->moveQuestions($move_questions, $questions[$index+1], 1);\n\t\t\t}\n\t\t}\n\t}", "protected function movePage()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\n\t\t// current_page is already set to new position\n\t\t$target_page = $this->current_page-1;\n\t\t$source_page = $_REQUEST[\"old_pos\"]-1;\n\n\t\t$pages = $this->object->getSurveyPages();\n\t\tforeach($pages[$source_page] as $question)\n\t\t{\n\t\t\t$questions[] = $question[\"question_id\"];\n\t\t}\n\n\t\t// move to first position\n\t\t$position = 0;\n\t\tif($_REQUEST[\"pgov\"] != \"fst\")\n\t\t{\n\t\t\t$position = 1;\n\t\t}\n\n\t\t$target = $pages[$target_page];\n\t\t$target = array_shift($target);\n\t\t$this->object->moveQuestions($questions, $target[\"question_id\"], $position);\n\n\t\tif($target_page < $source_page && $position)\n\t\t{\n\t\t $this->current_page++;\n\t\t}\n\n\t\tilUtil::sendSuccess($lng->txt(\"survey_page_moved\"), true);\n\t\t$ilCtrl->setParameter($this, \"pgov\", $this->current_page);\n\t\t$ilCtrl->redirect($this, \"renderPage\");\n\t}", "public function movePostFromEndToTheMiddle() {}", "function _ipal_move_question($layout, $questionid, $shift) {\n if (!$questionid || !($shift == 1 || $shift == -1)) {\n return $layout;\n }\n\n $questionids = explode(',', $layout);\n $key = array_search($questionid, $questionids);\n if ($key === false) {\n return $layout;\n }\n\n $otherkey = $key + $shift;\n if ($otherkey < 0 || $otherkey >= count($questionids) - 1) {\n return $layout;\n }\n\n $temp = $questionids[$otherkey];\n $questionids[$otherkey] = $questionids[$key];\n $questionids[$key] = $temp;\n\n return implode(',', $questionids);\n}", "public function reorder_onMove()\n {\n $sourceNode = Page::find(post('sourceNode'));\n $targetNode = post('targetNode') ? Page::find(post('targetNode')) : null;\n\n if ($sourceNode == $targetNode) {\n return;\n }\n\n switch (post('position')) {\n case 'before':\n $sourceNode->moveBefore($targetNode);\n break;\n case 'after':\n $sourceNode->moveAfter($targetNode);\n break;\n case 'child':\n $sourceNode->makeChildOf($targetNode);\n break;\n default:\n $sourceNode->makeRoot();\n break;\n }\n }", "public function insertQuestionBlock($a_block_id)\n\t{\n\t\t$new_ids = array();\n\t\t$question_ids = $this->object->getQuestionblockQuestionIds($a_block_id);\n\t\tforeach($question_ids as $qid)\n\t\t{\n\t\t\t$new_ids[] = $this->appendNewQuestionToSurvey($qid, true, true);\n\t\t}\n\t\t\n\t\tif(sizeof($new_ids))\n\t\t{\n\t\t\t$this->object->loadQuestionsFromDb();\n\t\t\t\n\t\t\t$pos = $_REQUEST[\"pgov_pos\"];\n\t\t\n\t\t\t// a[fter]/b[efore] on same page\n\t\t\tif(substr($pos, -1) != \"c\")\n\t\t\t{\n\t\t\t\t// block handling\n\t\t\t\t$current = $this->object->getSurveyPages();\n\t\t\t\t$current = $current[$this->current_page-1];\n\t\t\t\tif(sizeof($current) == 1)\n\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// as questions are moved to first block question\n\t\t\t\t\t// always use existing as first\n\t\t\t\t\t// the new question is moved later on (see below)\n\t\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t\tarray((int)$pos)+$new_ids);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$block_id = array_pop($current);\n\t\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t\tforeach($new_ids as $qid)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->object->addQuestionToBlock($qid, $block_id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// c: as new page (from toolbar/pool)\n\t\t\telse\n\t\t\t{\n\t\t\t\t// re-create block\n\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t$new_ids);\n\t\t\t\t\n\t\t\t\t// after given question\n\t\t\t\tif((int)$pos)\n\t\t\t\t{\n\t\t\t\t\t$pos = (int)$pos.\"a\";\n\t\t\t\t}\n\t\t\t\t// at the beginning\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$first = $this->object->getSurveyPages();\n\t\t\t\t\t$first = $first[0];\n\t\t\t\t\t$first = array_shift($first);\n\t\t\t\t\t$pos = $first[\"question_id\"].\"b\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move to target position\n\t\t\t$this->object->moveQuestions($new_ids, (int)$pos,\n\t\t\t\t((substr($pos, -1) == \"a\") ? 1 : 0));\t\t\t\n\t\t}\n\t}", "function MoveWord($word,&$wordlocs,$blockfrom,$sfrom,$wfrom,$blockto,$sto,$wto)\n{\n\t$word=TrimWord($word);\n\tif (!isset($wordlocs[$word])) return;\n\t\n\tfor ($loc=0; $loc<count($wordlocs[$word]); $loc++)\n\t{\n\t\t$loci=$wordlocs[$word][$loc];\n\t\tif ($loci[0]==$blockfrom // same block\n\t\t\t&& $loci[1]==$sfrom // same sentence\n\t\t\t&& $loci[2]==$wfrom) // same word\n\t\t{\n\t\t\t// Store new location\n\t\t\t$wordlocs[$word][$loc]=array($blockto,$sto,$wto);\n\t\t}\n\t}\n}", "public function move()\n\t{\n \n $data['kingdom'] = $this->kingdom_model->get_kingdom();\n if($data['kingdom']==null) {\n //error_no_kingdom_yet : 4\n $this->respond_errors(\"error no kingdom yet\",400);\n return;\n }\n $kingdom=$this->kingdom_model->mapper($data['kingdom']);\n \n \n $data[\"queen\"]= $this->queen_model->get_queen();\n if($data['queen']==null) {\n //error_no_queen_yet : 405\n $this->respond_errors(\"error no queen yet\",405);\n return;\n }\n $queen=$this->queen_model->mapper($data['queen']);\n\n $queen->move();\n //if there are no validation errors\n $errors=$queen->validate($kingdom);\n if (sizeof($errors)>0){\n //kingdom_constraint_validation_error:3\n $this->respond_errors($errors,300);\n\n }else{\n $data['queen'] = $this->queen_model->update_queen_pos($queen);\n $this->respond($queen,200);\n }\n\n }", "public function moveNewResultAnswers (): void\n {\n if (!$this->result) {\n throw new Exception('No result set.', 1638189967);\n }\n\n /** @var \\RKW\\RkwCheckup\\Domain\\Model\\ResultAnswer $resultAnswer */\n // Hint for fix: By any reason the \"->toArray()\" function resolves the problem, that some answers are not transferred\n foreach ($this->result->getNewResultAnswer()->toArray() as $resultAnswer) {\n $this->result->addResultAnswer($resultAnswer);\n $this->result->removeNewResultAnswer($resultAnswer);\n }\n }", "public function postClone() {\n\t\t// Clone common parent objects.\n\t\tparent::postClone();\n\n\t\t$tempQuestions = new ArrayCollection();\n\t\tforeach ($this->questions as $question) {\n\t\t\t$newQuestion = clone $question;\n\t\t\t$newQuestion->postClone();\n\t\t\t$newQuestion->setExercise($this);\n\t\t\t$tempQuestions->add($newQuestion);\n\t\t}\n\t\t$this->questions = $tempQuestions;\n\t}", "public function reorder_answers($questiontext, $answers) {\n $locations = array(); // Store the (scaled) location of the *named* placeholder in the main text.\n foreach ($answers as $idx => $answer) {\n if (strlen($answer->placeholder) != 0) {\n $locations[] = 1000 * strpos($questiontext, '{'.$answer->placeholder.'}') + $idx; // Store the pair (location, idx).\n }\n }\n sort($locations); // Performs stable sort of locations.\n\n $ss = new stdClass();\n $answersorder = array();\n foreach ($locations as $i => $location) {\n $answersorder[] = $location % 1000; // Store the new location of the answer in the main text.\n }\n foreach ($answers as $idx => $answer) {\n if (strlen($answer->placeholder) == 0) { // Add the empty placeholder at the end.\n $answersorder[] = $idx;\n }\n }\n return $answersorder;\n }", "public function moveItemAt($currentPosition, $newPosition = 0);", "function moveItemUp()\r\n\t{\r\n\t\t$this->content_obj->moveItemUp();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "public function moveUp\n\t(\n\t\t$sortOrder\t\t// <int> The sort order of the block associated with this segment piece.\n\t)\t\t\t\t\t// RETURNS <bool> TRUE on success, FALSE on failure.\n\t\n\t// $contentForm->moveUp($sortOrder);\n\t{\n\t\t// Make sure there is upward mobility (a block higher than itself)\n\t\tif($sortOrder <= 1) { return false; }\n\t\t\n\t\t$swapOrder = $sortOrder - 1;\n\t\t\n\t\tDatabase::startTransaction();\n\t\t\n\t\tif($pass = Database::query(\"UPDATE content_block_segment SET sort_order=? WHERE content_id=? AND sort_order=? LIMIT 1\", array(0, $this->contentID, $sortOrder)))\n\t\t{\n\t\t\tif($pass = Database::query(\"UPDATE content_block_segment SET sort_order=? WHERE content_id=? AND sort_order=? LIMIT 1\", array($sortOrder, $this->contentID, $swapOrder)))\n\t\t\t{\n\t\t\t\t$pass = Database::query(\"UPDATE content_block_segment SET sort_order=? WHERE content_id=? AND sort_order=? LIMIT 1\", array($swapOrder, $this->contentID, 0));\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(Database::endTransaction($pass))\n\t\t{\n\t\t\t$this->updateCache();\n\t\t\t\n\t\t\theader(\"Location: \" . $this->baseURL . \"?id=\" . $this->contentID); exit;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function reposition_self($pos){ //TODO: could set 1 as default\n\t\t//throw new Exception('ha, gotcha!!');\n\t\t\n\t\t\n\t\t$this->__set('left',$pos++);\n\t\tforeach($this->kids as $kid) $pos = $kid->reposition_self($pos);\n\t\t$this->__set('right',$pos++);\n\t\t\n\t\t//TODO: BUGFIX, this shouldn't be necessary.\n\t\tif(get_class($this) == 'ContentBox')\n\t\t\t$this->reposition_kids();\n\t\t\n\t\t$this->store(); //we might need a writeback ...\n\n\t\treturn $pos;\n\t}", "public function insertUnderwritingAnswers($answers) {\n \n foreach($answers as $currentAnswer) {\n \n $this->insertUnderwritingAnswer($currentAnswer);\n }\n }", "public function insertNewQuestion($a_new_id)\n\t{\n\t\tglobal $rbacsystem, $ilDB, $lng;\n\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\tif (!SurveyQuestion::_isComplete($a_new_id))\n\t\t{\n\t\t\tilUtil::sendFailure($lng->txt(\"survey_error_insert_incomplete_question\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$a_new_id = $this->appendNewQuestionToSurvey($a_new_id);\n\t\t\t$this->object->loadQuestionsFromDb();\n\n\t\t\t$pos = $_REQUEST[\"pgov_pos\"];\n\n\t\t\t// a[fter]/b[efore] on same page\n\t\t\tif(substr($pos, -1) != \"c\")\n\t\t\t{\n\t\t\t\t// block handling\n\t\t\t\t$current = $this->object->getSurveyPages();\n\t\t\t\t$current = $current[$this->current_page-1];\n\t\t\t\tif(sizeof($current) == 1)\n\t\t\t\t{\n\t\t\t\t\t// as questions are moved to first block question\n\t\t\t\t\t// always use existing as first\n\t\t\t\t\t// the new question is moved later on (see below)\n\t\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t\tarray((int)$pos, $a_new_id));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$block_id = array_pop($current);\n\t\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t\t$this->object->addQuestionToBlock($a_new_id, $block_id);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// c: as new page (from toolbar/pool)\n\t\t\telse\n\t\t\t{\n\t\t\t\t// after given question\n\t\t\t\tif((int)$pos)\n\t\t\t\t{\n\t\t\t\t\t$pos = (int)$pos.\"a\";\n\t\t\t\t\t$this->current_page++;\n\t\t\t\t}\n\t\t\t\t// at the beginning\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$first = $this->object->getSurveyPages();\n\t\t\t\t\t$first = $first[0];\n\t\t\t\t\t$first = array_shift($first);\n\t\t\t\t\t$pos = $first[\"question_id\"].\"b\";\n\t\t\t\t\t$this->current_page = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move to target position\n\t\t\t$this->object->moveQuestions(array($a_new_id), (int)$pos,\n\t\t\t\t((substr($pos, -1) == \"a\") ? 1 : 0));\n\t\t}\n\t}", "protected function confirmRemoveQuestions()\n\t{\n\t\tglobal $ilCtrl;\n\t\t\n\t\t// gather ids\n\t\t$ids = array();\n\t\tforeach ($_POST as $key => $value)\n\t\t{\n\t\t\tif (preg_match(\"/id_(\\d+)/\", $key, $matches))\n\t\t\t{\n\t\t\t\tarray_push($ids, $matches[1]);\n\t\t\t}\n\t\t}\n\n\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\n\t\t$block_id = $source;\n\t\t$block_id = array_shift($block_id);\n\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\tif(sizeof($ids) && sizeof($source) > sizeof($ids))\n\t\t{\n\t\t\t// block is obsolete\n\t\t\tif(sizeof($source)-sizeof($ids) == 1)\n\t\t\t{\n\t\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t\t}\n\t\t\t// block will remain, remove question(s) from block\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach($ids as $qid)\n\t\t\t\t{\n\t\t\t\t\t$this->object->removeQuestionFromBlock($qid, $block_id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->object->removeQuestions($ids, array());\n\t\t}\n\t\t// all items on page \n\t\telse \n\t\t{\n\t\t\t// remove complete block\n\t\t\tif($block_id)\n\t\t\t{\n\t\t\t\t$this->object->removeQuestions(array(), array($block_id));\n\t\t\t}\n\t\t\t// remove single question\n\t\t\telse\n\t\t\t{\t\t\t\t\n\t\t\t\t$this->object->removeQuestions($ids, array());\n\t\t\t}\n\n\t\t\t// render previous page\n\t\t\tif($this->current_page > 1)\n\t\t\t{\n\t\t\t\t$this->current_page--;\n\t\t\t}\n\t\t}\n\n\t\t$this->object->saveCompletionStatus();\n\t\t\t\n\t\t// #10567\n\t\t$ilCtrl->setParameter($this, \"pgov\", $this->current_page);\n\t\t$ilCtrl->redirect($this, \"renderPage\");\n\t}", "protected function splitPage($a_id)\n\t{\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\n\t\t$block_questions = array();\n\t\t$add = $block_id = false;\n\t\tforeach($source as $idx => $item)\n\t\t{\n\t\t\tif($item[\"question_id\"] == $a_id)\n\t\t\t{\n\t\t\t\t$block_id = $item[\"questionblock_id\"];\n\t\t\t\t$add = $idx;\n\t\t\t}\n\t\t\tif($add)\n\t\t\t{\n\t\t\t\t$block_questions[] = $item[\"question_id\"];\n\t\t\t}\n\t\t}\n\n\t\t// just 1 question left: block is obsolete\n\t\tif($add == 1)\n\t\t{\n\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t}\n\t\t// remove questions from block\n\t\telse\n\t\t{\n\t\t\tforeach($block_questions as $qid)\n\t\t\t{\n\t\t\t\t$this->object->removeQuestionFromBlock($qid, $block_id);\n\t\t\t}\n\t\t}\n\n\t\t// more than 1 moved?\n\t\tif(sizeof($block_questions) > 1)\n\t\t{\n\t\t\t// create new block and move target questions\n\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t$block_questions);\n\t\t}\n\t\t\n\t\t$this->current_page++;\n\t}", "function crunchify_move_comment_form_below( $fields ) { \n $comment_field = $fields['comment']; \n unset( $fields['comment'] ); \n $fields['comment'] = $comment_field; \n return $fields; \n}", "function createQuestionblock($title, $show_questiontext, $show_blocktitle, $questions)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t// if the selected questions are not in a continous selection, move all questions of the\n\t\t// questionblock at the position of the first selected question\n\t\t$this->moveQuestions($questions, $questions[0], 0);\n\t\t\n\t\t// now save the question block\n\t\tglobal $ilUser;\n\t\t$next_id = $ilDB->nextId('svy_qblk');\n\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_qblk (questionblock_id, title, show_questiontext,\".\n\t\t\t\" show_blocktitle, owner_fi, tstamp) VALUES (%s, %s, %s, %s, %s, %s)\",\n\t\t\tarray('integer','text','text','text','integer','integer'),\n\t\t\tarray($next_id, $title, $show_questiontext, $show_blocktitle, $ilUser->getId(), time())\n\t\t);\n\t\tif ($affectedRows)\n\t\t{\n\t\t\t$questionblock_id = $next_id;\n\t\t\tforeach ($questions as $index)\n\t\t\t{\n\t\t\t\t$next_id = $ilDB->nextId('svy_qblk_qst');\n\t\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_qblk_qst (qblk_qst_id, survey_fi, questionblock_fi, \" .\n\t\t\t\t\t\"question_fi) VALUES (%s, %s, %s, %s)\",\n\t\t\t\t\tarray('integer','integer','integer','integer'),\n\t\t\t\t\tarray($next_id, $this->getSurveyId(), $questionblock_id, $index)\n\t\t\t\t);\n\t\t\t\t$this->deleteConstraints($index);\n\t\t\t}\n\t\t}\n\t}", "function shuffleAnswers($answer1, $answer2, $answer3, $answer4)\n{\n\n\t$i = rand(0,3);\n\n\t//Puts the correct answer on a random position\n\tswitch($i)\n\t{\n\t\tcase 0:\n\t\t\t$antwort1 = $answer1;\n\t\t\t$antwort2 = $answer2;\n\t\t\t$antwort3 = $answer3;\n\t\t\t$antwort4 = $answer4;\n $position1 = 1;\n $position2 = 2;\n $position3 = 3;\n $position4 = 4;\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t$antwort1 = $answer2;\n\t\t\t$antwort2 = $answer1;\n\t\t\t$antwort3 = $answer3;\n\t\t\t$antwort4 = $answer4;\n\t\t\t$position1 = 2;\n $position2 = 1;\n $position3 = 3;\n $position4 = 4;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t$antwort1 = $answer2;\n\t\t\t$antwort2 = $answer3;\n\t\t\t$antwort3 = $answer1;\n\t\t\t$antwort4 = $answer4;\n $position1 = 2;\n $position2 = 3;\n $position3 = 1;\n $position4 = 4;\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\t$antwort1 = $answer2;\n\t\t\t$antwort2 = $answer3;\n\t\t\t$antwort3 = $answer4;\n\t\t\t$antwort4 = $answer1;\n $position1 = 2;\n $position2 = 3;\n $position3 = 4;\n $position4 = 1;\n\t\t\tbreak;\n\t}\n\n $res = [\"casename\"=>$questionData['casename'], \"antwort1\"=>$antwort1, \"antwort2\"=>$antwort2, \"antwort3\"=>$antwort3, \"antwort4\"=>$antwort4, \"positionAnswer1\"=>$position1, \"positionAnswer2\"=>$position2 , \"positionAnswer3\"=>$position3, \"positionAnswer4\"=>$position4];\n return $res;\n}", "public function presetEditorPosition()\n {\n $editor = $this->format;\n\n $editor->shiftCurrentXposition($this->shape->getBorderWidth() / 2);\n\n // if there is no space left on the right of the convas to shift to,\n // we update the y axis to shift down to the next line\n if ($editor->getWidth() - $editor->getCurrentXposition() < $this->shape->getWidth(true)\n && $editor->getHeight() - $editor->getCurrentYposition() >= $this->shape->getHeight(true)) {\n\n $editor->shiftCurrentYposition($editor->biggestYpostion());\n $editor->resetCurrentXposition($this->shape->getBorderWidth() / 2);\n\n }\n }" ]
[ "0.63483036", "0.6289921", "0.6217005", "0.6038968", "0.59166294", "0.58857983", "0.5820077", "0.5809025", "0.5699325", "0.56882113", "0.55860424", "0.55372816", "0.54995656", "0.5494892", "0.5373812", "0.53227085", "0.5264058", "0.5262739", "0.52159387", "0.5134082", "0.50916666", "0.50883085", "0.5061685", "0.50425166", "0.50414884", "0.50405246", "0.5037292", "0.5031553", "0.5002099", "0.4984646" ]
0.6614756
0
Remove a question from the survey
function removeQuestion($question_id) { include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php"; $question =& $this->_instanciateQuestion($question_id); $question->delete($question_id); $this->removeConstraintsConcerningQuestion($question_id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ipal_remove_question($quiz, $questionid) {\n global $DB;\n\n $questionids = explode(',', $quiz->questions);\n $key = array_search($questionid, $questionids);\n if ($key === false) {\n return;\n }\n\n unset($questionids[$key]);\n $quiz->questions = implode(',', $questionids);\n $DB->set_field('ipal', 'questions', $quiz->questions, array('id' => $quiz->id));\n}", "function removequestion($sq_id, $survey_id, $question_id)\r\n\t{\r\n\t\t$this->autoRender = false;\r\n\r\n\t\t// move question to bottom of survey list so deletion can be done\r\n\t\t// without affecting the number order\r\n\t\t$this->SurveyQuestion->moveQuestion($survey_id, $question_id, \"BOTTOM\");\r\n\r\n\t\t// remove the question from the survey association as well as all other\r\n\t\t// references to the question in the responses and questions tables\r\n\t\t$this->SurveyQuestion->del($sq_id);\r\n\t\t//$this->Question->editCleanUp($question_id);\r\n\r\n\t\t$this->set('message', 'The question was removed successfully.');\r\n\t\t$this->set('survey_id', $survey_id);\r\n\r\n\t\t$this->questionssummary($survey_id, $question_id);\r\n\t\t//$this->render('index');\r\n\t}", "public function removeQuestion($request, $response) {\n // init data\n $this->init($request);\n\n // get the question ID\n $questionID = $request->getAttribute('questionID');\n\n $this->group->removeQuestion($questionID);\n $this->group->save();\n\n return $this->return($this->group->array(), $response);\n }", "public function destroy(Survey $survey)\n {\n //\n }", "public function destroy(question $question)\n {\n //\n }", "public function removeQuestions($lecture_id, $chapter_id, $survey_id) {\n $request_parameter = (array) Request::all();\n $questions_to_remove_array = explode(\"_\", $request_parameter['questions_to_remove']);\n\n //print_r($questions_to_remove_array);\n\n if ($this->hasPermission($lecture_id)) {\n DB::transaction(function() use ($questions_to_remove_array, $survey_id) {\n for ($x = 0; $x < sizeof($questions_to_remove_array); $x++) {\n QuestionModel::where(['survey_id' => $survey_id, 'id' => $questions_to_remove_array[$x]])->delete();\n }\n });\n } else {\n // TODO: Permission denied page\n print \"Permission denied\";\n }\n\n return redirect()->route('survey', ['lecture_id' => $lecture_id, 'chapter_id' => $chapter_id, 'survey_id' => $survey_id]);\n }", "public function deleted(InterviewQuestion $interviewQuestion): void\n {\n //\n }", "function ipal_clear_question(){\r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\t\r\n\t if($DB->record_exists('ipal_active_questions', array('ipal_id'=>$ipal->id))){\r\n\t $mybool=$DB->delete_records('ipal_active_questions', array('ipal_id'=>$ipal->id));\r\n\t }\r\n}", "public function destroy(Question $question)\n {\n\n\n }", "function delete_question() {\r\n global $db;\r\n\r\n // get global user object\r\n global $user;\r\n\r\n // protect from unauthorized access\r\n if (!isset($user) || (!isset($_SESSION['session_survey']))) {\r\n logout();\r\n die();\r\n }\r\n\r\n $question = new Question();\r\n $question->get_from_db($_GET['question_id']);\r\n $survey = new Survey();\r\n $survey->get_from_db($question->getSurvey());\r\n\r\n if ($survey->getCreatedBy() != $user->getId()) {\r\n if ($user->getAdmin() != 1) {\r\n logout();\r\n die();\r\n }\r\n }\r\n\r\n $question->setIsActive(0);\r\n $question->update_in_db();\r\n\r\n $cookie_key = 'msg';\r\n $cookie_value = 'Вие успешно изтрихте елемент от анкетата!';\r\n setcookie($cookie_key, $cookie_value, time() + 1);\r\n header('Location: ' . ROOT_DIR . '?page=survey_edit');\r\n die();\r\n}", "public function destroy(Question $question)\n {\n //\n }", "public function destroy(Question $question)\n {\n //\n }", "public function destroy(Question $question)\n {\n //\n }", "function editCleanUp($question_id)\r\n {\r\n \t\t$this->query('DELETE FROM questions WHERE id='.$question_id);\r\n\t\t$this->query('DELETE FROM responses WHERE question_id='.$question_id);\r\n\t\t$this->query('DELETE FROM survey_questions WHERE question_id='.$question_id);\r\n }", "public function destroy(Question $Question)\n {\n //\n }", "public function deleteAnswersByQuestion($idQuestion)\n\t{\n\t\t$this->db->delete('respostas', \" `id_pergunta` = '\".$idQuestion.\"'\"); \n\t}", "public function testDeleteSurvey()\n {\n $survey = Survey::factory()->create();\n $surveyId = $survey->id;\n\n $response = $this->json('DELETE', \"survey/{$surveyId}\");\n\n $response->assertStatus(204);\n $this->assertDatabaseMissing('survey', ['id' => $surveyId]);\n }", "function deleteQuestion($idQuestion = null)\n {\n $this->autoRender = false; // turn off autoRender because there is no deleteQuestions view\n if($this->request->is('ajax')) { // only process ajax requests\n $tempArr = null;\n if ($this->Session->check('SurveyQuestion.new')) { //check for the session variable containing questions for this survey\n $tempArr = $this->Session->read('SurveyQuestion.new'); // get temp working copy of questions\n if (isset($tempArr[$idQuestion]['id']) && ($tempArr[$idQuestion]['id'] != '')) { // questions that have been written to the database will have an id set\n $delArr = array();\n if ($this->Session->check('SurveyQuestion.delete')) { // get a copy of any questions already marked for deletion\n $delArr = $this->Session->read('SurveyQuestion.delete');\n }\n $delArr[] = $tempArr[$idQuestion]['id']; // add our question to the array for deletion from the database\n $this->Session->write('SurveyQuestion.delete',$delArr); // write to the session\n }\n unset($tempArr[$idQuestion]); // remove the question from the temporary question array\n }\n $this->Session->write('SurveyQuestion.new',$tempArr); // write the new question array to the session\n $this->set('questions', $tempArr); // send the questions to the view\n $this->layout = 'ajax'; // use the blank ajax layout\n $this->render('/Elements/manage_questions'); // send the element to the receiving element in the view\n }\n }", "public function removeAnswer(AnswerInterface $answer);", "protected function confirmRemoveQuestions()\n\t{\n\t\tglobal $ilCtrl;\n\t\t\n\t\t// gather ids\n\t\t$ids = array();\n\t\tforeach ($_POST as $key => $value)\n\t\t{\n\t\t\tif (preg_match(\"/id_(\\d+)/\", $key, $matches))\n\t\t\t{\n\t\t\t\tarray_push($ids, $matches[1]);\n\t\t\t}\n\t\t}\n\n\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\n\t\t$block_id = $source;\n\t\t$block_id = array_shift($block_id);\n\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\tif(sizeof($ids) && sizeof($source) > sizeof($ids))\n\t\t{\n\t\t\t// block is obsolete\n\t\t\tif(sizeof($source)-sizeof($ids) == 1)\n\t\t\t{\n\t\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t\t}\n\t\t\t// block will remain, remove question(s) from block\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach($ids as $qid)\n\t\t\t\t{\n\t\t\t\t\t$this->object->removeQuestionFromBlock($qid, $block_id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->object->removeQuestions($ids, array());\n\t\t}\n\t\t// all items on page \n\t\telse \n\t\t{\n\t\t\t// remove complete block\n\t\t\tif($block_id)\n\t\t\t{\n\t\t\t\t$this->object->removeQuestions(array(), array($block_id));\n\t\t\t}\n\t\t\t// remove single question\n\t\t\telse\n\t\t\t{\t\t\t\t\n\t\t\t\t$this->object->removeQuestions($ids, array());\n\t\t\t}\n\n\t\t\t// render previous page\n\t\t\tif($this->current_page > 1)\n\t\t\t{\n\t\t\t\t$this->current_page--;\n\t\t\t}\n\t\t}\n\n\t\t$this->object->saveCompletionStatus();\n\t\t\t\n\t\t// #10567\n\t\t$ilCtrl->setParameter($this, \"pgov\", $this->current_page);\n\t\t$ilCtrl->redirect($this, \"renderPage\");\n\t}", "public static function remove($key){\n if(self::exists($key)){\n unset(self::$answers[strtolower($key)]);\n }\n }", "function delete_question($id){\n $this->db->where('question_id', $id);\n $this->db->delete('questions');\n }", "public function delete_question(){\n $question_id = $this->input->post('question_id');\n $challenge_id = $this->input->post('challenge_id');\n\n $question = new stdClass();\n\n if($this->questionlib->isSafeToDelete($question_id) === true){\n $question->question_id = $question_id;\n\n $this->question_model->delete($question);\n $this->challenge_question_model->delete($challenge_id, $question_id);\n $out['deleted'] = true;\n }else{\n $out['message'] = \"Question have associate data, it can't be deleted\";\n }\n $this->output->set_output(json_encode($out));\n\n }", "function deleteSurveyRecord()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_svy WHERE survey_id = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\n\t\t$result = $ilDB->queryF(\"SELECT questionblock_fi FROM svy_qblk_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t$questionblocks = array();\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\tarray_push($questionblocks, $row[\"questionblock_fi\"]);\n\t\t}\n\t\tif (count($questionblocks))\n\t\t{\n\t\t\t$affectedRows = $ilDB->manipulate(\"DELETE FROM svy_qblk WHERE \" . $ilDB->in('questionblock_id', $questionblocks, false, 'integer'));\n\t\t}\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_qblk_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t$this->deleteAllUserData();\n\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_anonymous WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t\n\t\t// delete export files\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\t$directory = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tif (is_dir($directory))\n\t\t{\n\t\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t\tilUtil::delDir($directory);\n\t\t}\n\n\t\tinclude_once(\"./Services/MediaObjects/classes/class.ilObjMediaObject.php\");\n\t\t$mobs = ilObjMediaObject::_getMobsOfObject(\"svy:html\", $this->getId());\n\t\t// remaining usages are not in text anymore -> delete them\n\t\t// and media objects (note: delete method of ilObjMediaObject\n\t\t// checks whether object is used in another context; if yes,\n\t\t// the object is not deleted!)\n\t\tforeach($mobs as $mob)\n\t\t{\n\t\t\tilObjMediaObject::_removeUsage($mob, \"svy:html\", $this->getId());\n\t\t\t$mob_obj =& new ilObjMediaObject($mob);\n\t\t\t$mob_obj->delete();\n\t\t}\n\t}", "public function deletequestionAction()\r\n {\r\n if ($this->getRequest()->isPost()) {\r\n $params = $this->getRequest()->getParams();\r\n $questionId = $params['questionId'];\r\n\r\n\r\n $question = new Application_Model_DbTable_FicheQuestion();\r\n // delete the question\r\n $question->deleteQuestion($questionId);\r\n\r\n // Return to the page informations\r\n $this->_helper->redirector('gestionquestion', 'admin', null);\r\n\r\n }\r\n\r\n }", "FUNCTION ServiceSurvey_remove_Survey( &$dbh,\n\t\t\t\t\t\t$aspid,\n\t\t\t\t\t\t$surveyid )\n\t{\n\t\tif ( ( $aspid == \"\" ) || ( $surveyid == \"\" ) )\n\t\t{\n\t\t\treturn false ;\n\t\t}\n\t\t$aspid = database_mysql_quote( $aspid ) ;\n\t\t$surveyid = database_mysql_quote( $surveyid ) ;\n\n\t\t$query = \"DELETE FROM chatsurveylogs WHERE aspID = $aspid AND surveyID = $surveyid\" ;\n\t\tdatabase_mysql_query( $dbh, $query ) ;\n\t\t$query = \"DELETE FROM chatsurveys WHERE aspID = $aspid AND surveyID = $surveyid\" ;\n\t\tdatabase_mysql_query( $dbh, $query ) ;\n\t\t$query = \"UPDATE chatrequestlogs SET surveyID = 0 WHERE surveyID = $surveyid AND aspID = $aspid\" ;\n\t\tdatabase_mysql_query( $dbh, $query ) ;\n\n\t\tif ( $dbh[ 'ok' ] )\n\t\t{\n\t\t\treturn true ;\n\t\t}\n\n\t\treturn false ;\n\t}", "function adddelquestion($question_id=null)\r\n {\r\n if(!empty($question_id))\r\n $this->set('responses', $this->Response->findAll($conditions='question_id='.$question_id));\r\n\r\n $this->layout = 'ajax';\r\n }", "public function destroy($questionId)\n {\n $question = Question::findOrFail($questionId);\n\n $exam = Exam::findOrFail($question->exam_id);\n $exam->questions_count--;\n $exam->save();\n\n Question::destroy($questionId);\n }", "public function remove($data) {\n\t\tif ( isset($data[0])) {\n\t\t\tif ( is_numeric($data[0])) {\n\t\t\t\t$dao = new FAQDAO();\n\t\t\t\t$dao = &$dao;\n\t\t\t\t$FAQ = new FAQ($dao);\n\t\t\t\t\n\t\t\t\t$id = $data[0];\n\t\t\t\t$entrie = $FAQ->getQuestion($id);\n\t\t\t\t\n\t\t\t\tif ( count($entrie) > 0) {\n\t\t\t\t\t$FAQ->remove($entrie) ? $this->setMessage('Pergunta excluida com sucesso.') : $this->setMessage('Erro ao excluir pergunta.');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->setMessage('Esta pergunta não existe.');\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->setMessage('Pergunta inválida.');\n\t\t}\n\t\t$this->setMessage('Nenhuma pergunta foi selecionada.');\n\t\t$this->redirect('faq');\n\t}", "function removeConstraintsConcerningQuestion($question_id)\n\t{\n\t\tglobal $ilDB;\n\t\t$result = $ilDB->queryF(\"SELECT constraint_fi FROM svy_qst_constraint WHERE question_fi = %s AND survey_fi = %s\",\n\t\t\tarray('integer','integer'),\n\t\t\tarray($question_id, $this->getSurveyId())\n\t\t);\n\t\tif ($result->numRows() > 0)\n\t\t{\n\t\t\t$remove_constraints = array();\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\tarray_push($remove_constraints, $row[\"constraint_fi\"]);\n\t\t\t}\n\t\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_qst_constraint WHERE question_fi = %s AND survey_fi = %s\",\n\t\t\t\tarray('integer','integer'),\n\t\t\t\tarray($question_id, $this->getSurveyId())\n\t\t\t);\n\t\t\tforeach ($remove_constraints as $key => $constraint_id)\n\t\t\t{\n\t\t\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_constraint WHERE constraint_id = %s\",\n\t\t\t\t\tarray('integer'),\n\t\t\t\t\tarray($constraint_id)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.732547", "0.7144462", "0.67921686", "0.671079", "0.66961396", "0.6647993", "0.6597144", "0.6532178", "0.6525053", "0.65090114", "0.6474149", "0.6474149", "0.6474149", "0.64587915", "0.6458567", "0.641819", "0.6414767", "0.6404972", "0.63994485", "0.636623", "0.6348659", "0.6331797", "0.6323001", "0.6307277", "0.6303357", "0.62952805", "0.62356925", "0.617077", "0.61687857", "0.6151017" ]
0.7198431
1
Remove constraints concerning a question with a given question_id
function removeConstraintsConcerningQuestion($question_id) { global $ilDB; $result = $ilDB->queryF("SELECT constraint_fi FROM svy_qst_constraint WHERE question_fi = %s AND survey_fi = %s", array('integer','integer'), array($question_id, $this->getSurveyId()) ); if ($result->numRows() > 0) { $remove_constraints = array(); while ($row = $ilDB->fetchAssoc($result)) { array_push($remove_constraints, $row["constraint_fi"]); } $affectedRows = $ilDB->manipulateF("DELETE FROM svy_qst_constraint WHERE question_fi = %s AND survey_fi = %s", array('integer','integer'), array($question_id, $this->getSurveyId()) ); foreach ($remove_constraints as $key => $constraint_id) { $affectedRows = $ilDB->manipulateF("DELETE FROM svy_constraint WHERE constraint_id = %s", array('integer'), array($constraint_id) ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteConstraints($question_id)\n\t{\n\t\tglobal $ilDB;\n\t\t$result = $ilDB->queryF(\"SELECT constraint_fi FROM svy_qst_constraint WHERE question_fi = %s AND survey_fi = %s\",\n\t\t\tarray('integer','integer'),\n\t\t\tarray($question_id, $this->getSurveyId())\n\t\t);\n\t\t$constraints = array();\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\tarray_push($constraints, $row[\"constraint_fi\"]);\n\t\t}\n\t\tforeach ($constraints as $constraint_id)\n\t\t{\n\t\t\t$this->deleteConstraint($constraint_id);\n\t\t}\n\t}", "function deleteConstraint($constraint_id)\n\t{\n\t\tglobal $ilDB;\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_constraint WHERE constraint_id = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($constraint_id)\n\t\t);\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_qst_constraint WHERE constraint_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($constraint_id)\n\t\t);\n\t}", "function removeQuestion($question_id)\n\t{\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\t$question =& $this->_instanciateQuestion($question_id);\n\t\t$question->delete($question_id);\n\t\t$this->removeConstraintsConcerningQuestion($question_id);\n\t}", "function editCleanUp($question_id)\r\n {\r\n \t\t$this->query('DELETE FROM questions WHERE id='.$question_id);\r\n\t\t$this->query('DELETE FROM responses WHERE question_id='.$question_id);\r\n\t\t$this->query('DELETE FROM survey_questions WHERE question_id='.$question_id);\r\n }", "function ipal_remove_question($quiz, $questionid) {\n global $DB;\n\n $questionids = explode(',', $quiz->questions);\n $key = array_search($questionid, $questionids);\n if ($key === false) {\n return;\n }\n\n unset($questionids[$key]);\n $quiz->questions = implode(',', $questionids);\n $DB->set_field('ipal', 'questions', $quiz->questions, array('id' => $quiz->id));\n}", "public function updateQuestionFieldIdSchema()\n {\n try {\n $this->client->run(sprintf('DROP INDEX ON :%s(%s)', 'Question', 'field_id'));\n } catch (Neo4jException $e) {\n if (strpos($e->getMessage(), 'Index belongs to constraint') === false) {\n throw $e;\n }\n\n // If the property already belongs to a constraint, then the index\n // has been already been dropped and should not be dropped again.\n // As such one may ignore this exception.\n }\n\n $this->client->run(sprintf(\n 'CREATE CONSTRAINT ON (n:%s) ASSERT n.%s IS UNIQUE',\n 'Question',\n 'field_id'\n ));\n }", "public function removeConstraint($key)\n {\n $key = (string) $key;\n if ($this->hasConstraint($key)) {\n unset($this->dijitParams['constraints'][$key]);\n }\n return $this;\n }", "public function testRemoveConstraint()\n {\n $constraint = new MyConstraint();\n $same = $this->uut->addConstraint($constraint, $constraint)->removeConstraint(MyConstraint::class);\n $this->assertSame($this->uut, $same);\n $this->assertEquals([], $this->uut->getConstraints());\n }", "public function deleteAnswersByQuestion($idQuestion)\n\t{\n\t\t$this->db->delete('respostas', \" `id_pergunta` = '\".$idQuestion.\"'\"); \n\t}", "function delete_question($questionid) {\n global $DB;\n $DB->delete_records(\"question_calculated\", array(\"question\" => $questionid));\n $DB->delete_records(\"question_numerical_units\", array(\"question\" => $questionid));\n if ($datasets = $DB->get_records('question_datasets', array('question' => $questionid))) {\n foreach ($datasets as $dataset) {\n if (!$DB->get_records_select(\n 'question_datasets',\n \"question != ?\n AND datasetdefinition = ?;\", array($questionid, $dataset->datasetdefinition))){\n $DB->delete_records('question_dataset_definitions', array('id' => $dataset->datasetdefinition));\n $DB->delete_records('question_dataset_items', array('definition' => $dataset->datasetdefinition));\n }\n }\n }\n $DB->delete_records(\"question_datasets\", array(\"question\" => $questionid));\n return true;\n }", "public function clearStudentQuestionsRelatedByStudentId()\n\t{\n\t\t$this->collStudentQuestionsRelatedByStudentId = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function clearGroupQuestionsConnectionWithAnswer(){\n if($this->answers){\n $this->setAttribute('condition_question_id', null);\n $this->answers = array();\n $this->deleteGroupQuestionsConnectionWithAnswer();\n }\n }", "function removeConstraint($constraintType, $columnName, $referencesTableName, $referencesColumnName) {\n foreach ($this->constraints as $key => $c) {\n if ($c->equals(new DbConstraint($constraintType, $columnName, $referencesTableName, $referencesColumnName))) {\n unset($this->constraints[$key]);\n }\n }\n }", "public function destroy($id)\n {\n \n Question::where('user_id',Auth::user()->id) ->orWhere('role_id', Auth::user()->isAdmin)->findOrFail($id)->delete();\n //\n }", "public function remove($constraints)\n {\n $query = $this->getModel();\n\n // loop over all given constraints\n\n foreach ($constraints as $where) {\n $query = $query->where($where[0], $where[1], $where[2]);\n }\n return $query->delete();\n }", "public function dropForeignKey($columns, $constraint = null)\r\n {\r\n \r\n }", "function removequestion($sq_id, $survey_id, $question_id)\r\n\t{\r\n\t\t$this->autoRender = false;\r\n\r\n\t\t// move question to bottom of survey list so deletion can be done\r\n\t\t// without affecting the number order\r\n\t\t$this->SurveyQuestion->moveQuestion($survey_id, $question_id, \"BOTTOM\");\r\n\r\n\t\t// remove the question from the survey association as well as all other\r\n\t\t// references to the question in the responses and questions tables\r\n\t\t$this->SurveyQuestion->del($sq_id);\r\n\t\t//$this->Question->editCleanUp($question_id);\r\n\r\n\t\t$this->set('message', 'The question was removed successfully.');\r\n\t\t$this->set('survey_id', $survey_id);\r\n\r\n\t\t$this->questionssummary($survey_id, $question_id);\r\n\t\t//$this->render('index');\r\n\t}", "function delete_question($id){\n $this->db->where('question_id', $id);\n $this->db->delete('questions');\n }", "public function destroy($id)\n {\n $question = Question::findOrFail($id);\n $question->typable->delete();\n $question->delete();\n }", "function getConstraints($question_id)\n \t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$result_array = array();\n\t\t$result = $ilDB->queryF(\"SELECT svy_constraint.*, svy_relation.* FROM svy_qst_constraint, svy_constraint, svy_relation \".\n\t\t\t\"WHERE svy_constraint.relation_fi = svy_relation.relation_id AND \".\n\t\t\t\"svy_qst_constraint.constraint_fi = svy_constraint.constraint_id AND svy_qst_constraint.question_fi = %s \".\n\t\t\t\"AND svy_qst_constraint.survey_fi = %s\",\n\t\t\tarray('integer','integer'),\n\t\t\tarray($question_id, $this->getSurveyId())\n\t\t);\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\t\n\t\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\t\t$question_type = SurveyQuestion::_getQuestionType($row[\"question_fi\"]);\n\t\t\tSurveyQuestion::_includeClass($question_type);\n\t\t\t$question = new $question_type();\n\t\t\t$question->loadFromDb($row[\"question_fi\"]);\n\t\t\t$valueoutput = $question->getPreconditionValueOutput($row[\"value\"]);\n\t\t\tarray_push($result_array, array(\"id\" => $row[\"constraint_id\"], \"question\" => $row[\"question_fi\"], \"short\" => $row[\"shortname\"], \"long\" => $row[\"longname\"], \"value\" => $row[\"value\"], \"conjunction\" => $row[\"conjunction\"], \"valueoutput\" => $valueoutput));\n\t\t}\n\t\treturn $result_array;\n\t}", "public function removeQuestions($lecture_id, $chapter_id, $survey_id) {\n $request_parameter = (array) Request::all();\n $questions_to_remove_array = explode(\"_\", $request_parameter['questions_to_remove']);\n\n //print_r($questions_to_remove_array);\n\n if ($this->hasPermission($lecture_id)) {\n DB::transaction(function() use ($questions_to_remove_array, $survey_id) {\n for ($x = 0; $x < sizeof($questions_to_remove_array); $x++) {\n QuestionModel::where(['survey_id' => $survey_id, 'id' => $questions_to_remove_array[$x]])->delete();\n }\n });\n } else {\n // TODO: Permission denied page\n print \"Permission denied\";\n }\n\n return redirect()->route('survey', ['lecture_id' => $lecture_id, 'chapter_id' => $chapter_id, 'survey_id' => $survey_id]);\n }", "function dropUniqueKeyMSSQL($sFieldName, $sTableName)\n{\n $sQuery =\"select TC.Constraint_Name, CC.Column_Name from information_schema.table_constraints TC\n inner join information_schema.constraint_column_usage CC on TC.Constraint_Name = CC.Constraint_Name\n where TC.constraint_type = 'Unique' and Column_name='{$sFieldName}' and TC.TABLE_NAME='{$sTableName}'\";\n $aUniqueKeyName = Yii::app()->getDb()->createCommand($sQuery)->queryRow();\n if ($aUniqueKeyName!=false)\n {\n Yii::app()->getDb()->createCommand(\"ALTER TABLE {$sTableName} DROP CONSTRAINT {$aUniqueKeyName['Constraint_Name']}\")->execute();\n }\n}", "public function destroy($id)\n {\n $questions=DB::table('questions')->where('id', '=',$id)->delete();\n }", "public function destroy($questionId)\n {\n $question = Question::findOrFail($questionId);\n\n $exam = Exam::findOrFail($question->exam_id);\n $exam->questions_count--;\n $exam->save();\n\n Question::destroy($questionId);\n }", "private function db_ignore_del_req($id)\n {\n RequestedTermination::find($id);\n $terminationRequest->delete;\n }", "public function clearPartnerssRelatedByPatientId()\n {\n $this->collPartnerssRelatedByPatientId = null; // important to set this to NULL since that means it is uninitialized\n }", "public function destroy($id){\n Question::destroy($id);\n }", "public function disableForeignKeyConstraints($connection);", "protected function confirmRemoveQuestions()\n\t{\n\t\tglobal $ilCtrl;\n\t\t\n\t\t// gather ids\n\t\t$ids = array();\n\t\tforeach ($_POST as $key => $value)\n\t\t{\n\t\t\tif (preg_match(\"/id_(\\d+)/\", $key, $matches))\n\t\t\t{\n\t\t\t\tarray_push($ids, $matches[1]);\n\t\t\t}\n\t\t}\n\n\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\n\t\t$block_id = $source;\n\t\t$block_id = array_shift($block_id);\n\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\tif(sizeof($ids) && sizeof($source) > sizeof($ids))\n\t\t{\n\t\t\t// block is obsolete\n\t\t\tif(sizeof($source)-sizeof($ids) == 1)\n\t\t\t{\n\t\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t\t}\n\t\t\t// block will remain, remove question(s) from block\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach($ids as $qid)\n\t\t\t\t{\n\t\t\t\t\t$this->object->removeQuestionFromBlock($qid, $block_id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->object->removeQuestions($ids, array());\n\t\t}\n\t\t// all items on page \n\t\telse \n\t\t{\n\t\t\t// remove complete block\n\t\t\tif($block_id)\n\t\t\t{\n\t\t\t\t$this->object->removeQuestions(array(), array($block_id));\n\t\t\t}\n\t\t\t// remove single question\n\t\t\telse\n\t\t\t{\t\t\t\t\n\t\t\t\t$this->object->removeQuestions($ids, array());\n\t\t\t}\n\n\t\t\t// render previous page\n\t\t\tif($this->current_page > 1)\n\t\t\t{\n\t\t\t\t$this->current_page--;\n\t\t\t}\n\t\t}\n\n\t\t$this->object->saveCompletionStatus();\n\t\t\t\n\t\t// #10567\n\t\t$ilCtrl->setParameter($this, \"pgov\", $this->current_page);\n\t\t$ilCtrl->redirect($this, \"renderPage\");\n\t}", "public function deleteAnswers($question_id)\n\t{\n\t}" ]
[ "0.78046775", "0.67692536", "0.6551546", "0.6256549", "0.60758674", "0.59577733", "0.5932652", "0.58080566", "0.5603048", "0.5531449", "0.5494026", "0.53669024", "0.53598547", "0.5320286", "0.53071296", "0.5298825", "0.5291809", "0.52481395", "0.51934636", "0.51846385", "0.5184545", "0.51828134", "0.51735306", "0.5164469", "0.51577395", "0.51565677", "0.51197165", "0.51147646", "0.5113086", "0.5111134" ]
0.8670779
0
Unfolds question blocks of a question pool
function unfoldQuestionblocks($questionblocks) { global $ilDB; foreach ($questionblocks as $index) { $affectedRows = $ilDB->manipulateF("DELETE FROM svy_qblk WHERE questionblock_id = %s", array('integer'), array($index) ); $affectedRows = $ilDB->manipulateF("DELETE FROM svy_qblk_qst WHERE questionblock_fi = %s AND survey_fi = %s", array('integer','integer'), array($index, $this->getSurveyId()) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeQuestions($remove_questions, $remove_questionblocks)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$block_sizes = array();\n\t\tforeach ($this->getSurveyQuestions() as $question_id => $data)\n\t\t{\n\t\t\tif (in_array($question_id, $remove_questions) or in_array($data[\"questionblock_id\"], $remove_questionblocks))\n\t\t\t{\n\t\t\t\tunset($this->questions[array_search($question_id, $this->questions)]);\n\t\t\t $this->removeQuestion($question_id);\n\t\t\t}\n\t\t\telse if($data[\"questionblock_id\"])\n\t\t\t{\n\t\t\t\t$block_sizes[$data[\"questionblock_id\"]]++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// blocks with just 1 question need to be deleted\n\t\tforeach($block_sizes as $block_id => $size)\n\t\t{\n\t\t\tif($size < 2)\n\t\t\t{\n\t\t\t\t$remove_questionblocks[] = $block_id;\n\t\t\t}\n\t\t}\n\n\t\tforeach (array_unique($remove_questionblocks) as $questionblock_id)\n\t\t{\n\t\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_qblk WHERE questionblock_id = %s\",\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($questionblock_id)\n\t\t\t);\n\t\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_qblk_qst WHERE questionblock_fi = %s AND survey_fi = %s\",\n\t\t\t\tarray('integer','integer'),\n\t\t\t\tarray($questionblock_id, $this->getSurveyId())\n\t\t\t);\n\t\t}\n\t\t\n\t\t$this->questions = array_values($this->questions);\n\t\t$this->saveQuestionsToDb();\n\t}", "protected function confirmRemoveQuestions()\n\t{\n\t\tglobal $ilCtrl;\n\t\t\n\t\t// gather ids\n\t\t$ids = array();\n\t\tforeach ($_POST as $key => $value)\n\t\t{\n\t\t\tif (preg_match(\"/id_(\\d+)/\", $key, $matches))\n\t\t\t{\n\t\t\t\tarray_push($ids, $matches[1]);\n\t\t\t}\n\t\t}\n\n\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\n\t\t$block_id = $source;\n\t\t$block_id = array_shift($block_id);\n\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\tif(sizeof($ids) && sizeof($source) > sizeof($ids))\n\t\t{\n\t\t\t// block is obsolete\n\t\t\tif(sizeof($source)-sizeof($ids) == 1)\n\t\t\t{\n\t\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t\t}\n\t\t\t// block will remain, remove question(s) from block\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach($ids as $qid)\n\t\t\t\t{\n\t\t\t\t\t$this->object->removeQuestionFromBlock($qid, $block_id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->object->removeQuestions($ids, array());\n\t\t}\n\t\t// all items on page \n\t\telse \n\t\t{\n\t\t\t// remove complete block\n\t\t\tif($block_id)\n\t\t\t{\n\t\t\t\t$this->object->removeQuestions(array(), array($block_id));\n\t\t\t}\n\t\t\t// remove single question\n\t\t\telse\n\t\t\t{\t\t\t\t\n\t\t\t\t$this->object->removeQuestions($ids, array());\n\t\t\t}\n\n\t\t\t// render previous page\n\t\t\tif($this->current_page > 1)\n\t\t\t{\n\t\t\t\t$this->current_page--;\n\t\t\t}\n\t\t}\n\n\t\t$this->object->saveCompletionStatus();\n\t\t\t\n\t\t// #10567\n\t\t$ilCtrl->setParameter($this, \"pgov\", $this->current_page);\n\t\t$ilCtrl->redirect($this, \"renderPage\");\n\t}", "function testUnfold(){\n\n #mdx:Unfold\n $_REQUEST = [\n 'user' => [\n 'name' => 'Mary',\n 'email' => ''\n ],\n '_submit' => 1\n ];\n\n $form = new HtForm();\n $form->textin('user[name]')->label('Username');\n $form->textin('user[email]')->label('E-mail')->required(\"Email is required!\");\n $form->button('_submit','Submit');\n\n $form->context($_REQUEST);\n\n if($form->value('_submit')){\n $result = $form->process()->unfold();\n #mdx:o print_r($result)\n }\n #/mdx\n $this->assertEquals('Mary', $result->data['user']['name']);\n $this->assertEquals('Email is required!', $result->errors['user']['email']);\n }", "public function postClone() {\n\t\t// Clone common parent objects.\n\t\tparent::postClone();\n\n\t\t$tempQuestions = new ArrayCollection();\n\t\tforeach ($this->questions as $question) {\n\t\t\t$newQuestion = clone $question;\n\t\t\t$newQuestion->postClone();\n\t\t\t$newQuestion->setExercise($this);\n\t\t\t$tempQuestions->add($newQuestion);\n\t\t}\n\t\t$this->questions = $tempQuestions;\n\t}", "public function &getSurveyQuestions($with_answers = false)\n\t{\n\t\tglobal $ilDB;\n\t\t$obligatory_states =& $this->getObligatoryStates();\n\t\t// get questionblocks\n\t\t$all_questions = array();\n\t\t$result = $ilDB->queryF(\"SELECT svy_qtype.type_tag, svy_qtype.plugin, svy_question.question_id, \".\n\t\t\t\"svy_svy_qst.heading FROM svy_qtype, svy_question, svy_svy_qst WHERE svy_svy_qst.survey_fi = %s AND \" .\n\t\t\t\"svy_svy_qst.question_fi = svy_question.question_id AND svy_question.questiontype_fi = svy_qtype.questiontype_id \" .\n\t\t\t\"ORDER BY svy_svy_qst.sequence\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\t$add = true;\n\t\t\tif ($row[\"plugin\"])\n\t\t\t{\n\t\t\t\tif (!$this->isPluginActive($row[\"type_tag\"]))\n\t\t\t\t{\n\t\t\t\t\t$add = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($add)\n\t\t\t{\n\t\t\t\t$question =& $this->_instanciateQuestion($row[\"question_id\"]);\n\t\t\t\t$questionrow = $question->_getQuestionDataArray($row[\"question_id\"]);\n\t\t\t\tforeach ($row as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$questionrow[$key] = $value;\n\t\t\t\t}\n\t\t\t\t$all_questions[$row[\"question_id\"]] = $questionrow;\n\t\t\t\t$all_questions[$row[\"question_id\"]][\"usableForPrecondition\"] = $question->usableForPrecondition();\n\t\t\t\t$all_questions[$row[\"question_id\"]][\"availableRelations\"] = $question->getAvailableRelations();\n\t\t\t\tif (array_key_exists($row[\"question_id\"], $obligatory_states))\n\t\t\t\t{\n\t\t\t\t\t$all_questions[$row[\"question_id\"]][\"obligatory\"] = $obligatory_states[$row[\"question_id\"]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// get all questionblocks\n\t\t$questionblocks = array();\n\t\tif (count($all_questions))\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT svy_qblk.*, svy_qblk_qst.question_fi FROM svy_qblk, svy_qblk_qst WHERE \" .\n\t\t\t\t\"svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi AND svy_qblk_qst.survey_fi = %s \" .\n\t\t\t\t\"AND \" . $ilDB->in('svy_qblk_qst.question_fi', array_keys($all_questions), false, 'integer'),\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($this->getSurveyId())\n\t\t\t);\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\t$questionblocks[$row['question_fi']] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach ($all_questions as $question_id => $row)\n\t\t{\n\t\t\t$constraints = $this->getConstraints($question_id);\n\t\t\tif (isset($questionblocks[$question_id]))\n\t\t\t{\n\t\t\t\t$all_questions[$question_id][\"questionblock_title\"] = $questionblocks[$question_id]['title'];\n\t\t\t\t$all_questions[$question_id][\"questionblock_id\"] = $questionblocks[$question_id]['questionblock_id'];\n\t\t\t\t$all_questions[$question_id][\"constraints\"] = $constraints;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$all_questions[$question_id][\"questionblock_title\"] = \"\";\n\t\t\t\t$all_questions[$question_id][\"questionblock_id\"] = \"\";\n\t\t\t\t$all_questions[$question_id][\"constraints\"] = $constraints;\n\t\t\t}\n\t\t\tif ($with_answers)\n\t\t\t{\n\t\t\t\t$answers = array();\n\t\t\t\t$result = $ilDB->queryF(\"SELECT svy_variable.*, svy_category.title FROM svy_variable, svy_category \" .\n\t\t\t\t\t\"WHERE svy_variable.question_fi = %s AND svy_variable.category_fi = svy_category.category_id \".\n\t\t\t\t\t\"ORDER BY sequence ASC\",\n\t\t\t\t\tarray('integer'),\n\t\t\t\t\tarray($question_id)\n\t\t\t\t);\n\t\t\t\tif ($result->numRows() > 0) \n\t\t\t\t{\n\t\t\t\t\twhile ($data = $ilDB->fetchAssoc($result)) \n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($answers, $data[\"title\"]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$all_questions[$question_id][\"answers\"] = $answers;\n\t\t\t}\n\t\t}\n\t\treturn $all_questions;\n\t}", "public function unfold(callable $transformer = null);", "function _flatten_blocks(&$blocks)\n {\n }", "public function clearQuestionOffensives()\n\t{\n\t\t$this->collQuestionOffensives = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function eliminateMatchingBlocks()\n {\n $this->_serviceEliminateDuplicates()->eliminateMatchingBlocks();\n }", "public function clearQuestions()\n\t{\n\t\t$this->collQuestions = null; // important to set this to NULL since that means it is uninitialized\n\t}", "function languagelesson_unseen_question_jump($lesson, $user, $pageid) {\n global $DB;\n\n // Get the number of retakes.\n if (!$retakes = $DB->count_records(\"languagelesson_grades\", array(\"lessonid\"=>$lesson->id, \"userid\"=>$user))) {\n $retakes = 0;\n }\n\n // Get all the languagelesson_attempts aka what the user has seen.\n if ($viewedpages = $DB->get_records(\"languagelesson_attempts\", array(\"lessonid\"=>$lesson->id, \"userid\"=>$user, \"retry\"=>$retakes), \"timeseen DESC\")) {\n foreach ($viewedpages as $viewed) {\n $seenpages[] = $viewed->pageid;\n }\n } else {\n $seenpages = array();\n }\n\n // Get the lesson pages.\n $lessonpages = $lesson->load_all_pages();\n\n if ($pageid == LL_UNSEENBRANCHPAGE) { // This only happens when a student leaves in the middle of an unseen question within a branch series.\n $pageid = $seenpages[0]; // Just change the pageid to the last page viewed inside the branch table.\n }\n\n // Go up the pages till branch table.\n while ($pageid != 0) { // This condition should never be satisfied... only happens if there are no branch tables above this page.\n if ($lessonpages[$pageid]->qtype == LL_BRANCHTABLE) {\n break;\n }\n $pageid = $lessonpages[$pageid]->prevpageid;\n }\n\n $pagesinbranch = $lesson->get_sub_pages_of($pageid, array(LL_BRANCHTABLE, LL_ENDOFBRANCH));\n\n // This foreach loop stores all the pages that are within the branch table but are not in the $seenpages array.\n $unseen = array();\n foreach ($pagesinbranch as $page) {\n if (!in_array($page->id, $seenpages)) {\n $unseen[] = $page->id;\n }\n }\n\n if (count($unseen) == 0) {\n if (isset($pagesinbranch)) {\n $temp = end($pagesinbranch);\n $nextpage = $temp->nextpageid; // They have seen all the pages in the branch, so go to EOB/next branch table/EOL.\n } else {\n // There are no pages inside the branch, so return the next page.\n $nextpage = $lessonpages[$pageid]->nextpageid;\n }\n if ($nextpage == 0) {\n return LL_EOL;\n } else {\n return $nextpage;\n }\n } else {\n return $unseen[rand(0, count($unseen)-1)]; // Returns a random page id for the next page.\n }\n}", "function moveUpQuestionblock($questionblock_id)\n\t{\n\t\t$pages =& $this->getSurveyPages();\n\t\t$move_questions = array();\n\t\t$pageindex = -1;\n\t\tforeach ($pages as $idx => $page)\n\t\t{\n\t\t\tif ($page[0][\"questionblock_id\"] == $questionblock_id)\n\t\t\t{\n\t\t\t\tforeach ($page as $pageidx => $question)\n\t\t\t\t{\n\t\t\t\t\tarray_push($move_questions, $question[\"question_id\"]);\n\t\t\t\t}\n\t\t\t\t$pageindex = $idx;\n\t\t\t}\n\t\t}\n\t\tif ($pageindex > 0)\n\t\t{\n\t\t\t$this->moveQuestions($move_questions, $pages[$pageindex-1][0][\"question_id\"], 0);\n\t\t}\n\t}", "function remove_blocks() {\n if ( is_singular( 'webinar' ) && in_the_loop() && is_main_query() ) {\n //parse the blocks so they can be run through the foreach loop\n $blocks = parse_blocks( get_the_content() );\n foreach ( $blocks as $block ) {\n //look to see if your block is in the post content -> if yes continue past it if no then render block as normal\n \n echo $block['blockName'];\n \n if ( 'lazyblock/top-of-page' === $block['blockName'] ) {\n continue;\n } else {\n echo render_block( $block );\n }\n }\n }\n}", "public function clearQuestionVotes()\n\t{\n\t\t$this->collQuestionVotes = null; // important to set this to NULL since that means it is uninitialized\n\t}", "function resetAnswers() {\n\t\tunset($this->_answers);\n\t\t$this->_answers = array();\n\t}", "protected function deleteBlock()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\t\t\n\t\t$ilCtrl->setParameter($this->editor_gui, \"pgov\", $this->current_page);\n\t\tilUtil::sendQuestion($lng->txt(\"remove_questions\"));\n\t\t\n\t\t$page = $this->object->getSurveyPages();\n\t\t$page = $page[$this->current_page-1];\n\t\t\n\t\t// #10567\n\t\tif($_REQUEST[\"csum\"] != md5(print_r($page, true)))\n\t\t{\n\t\t\t$ilCtrl->redirect($this, \"renderPage\");\n\t\t}\n\t\t\n\t\t$page = array_shift($page);\n\t\t$block_id = $page[\"questionblock_id\"];\n\t\tif($block_id)\n\t\t{\n\t\t\t$this->editor_gui->removeQuestionsForm(array($block_id), array(), array());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->editor_gui->removeQuestionsForm(array(), array($page[\"question_id\"]), array());\n\t\t}\n\t}", "function moveDownQuestionblock($questionblock_id)\n\t{\n\t\t$pages =& $this->getSurveyPages();\n\t\t$move_questions = array();\n\t\t$pageindex = -1;\n\t\tforeach ($pages as $idx => $page)\n\t\t{\n\t\t\tif ($page[0][\"questionblock_id\"] == $questionblock_id)\n\t\t\t{\n\t\t\t\tforeach ($page as $pageidx => $question)\n\t\t\t\t{\n\t\t\t\t\tarray_push($move_questions, $question[\"question_id\"]);\n\t\t\t\t}\n\t\t\t\t$pageindex = $idx;\n\t\t\t}\n\t\t}\n\t\tif ($pageindex < count($pages)-1)\n\t\t{\n\t\t\t$this->moveQuestions($move_questions, $pages[$pageindex+1][count($pages[$pageindex+1])-1][\"question_id\"], 1);\n\t\t}\n\t}", "function getUnansweredQuestions($grouping='', $sorting='sorting', $randomize=false) {\n\t\t$questions = $this->getQuestions();\n\t\t$unanswered = array();\n\t\t\n\t\tforeach((array) $questions as $question) {\n\t\t\tif(!$question->hasAnswer($this->_answers)) {\n\t\t\t\t$unanswered[] = $question;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $unanswered;\n\t}", "protected function splitPage($a_id)\n\t{\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\n\t\t$block_questions = array();\n\t\t$add = $block_id = false;\n\t\tforeach($source as $idx => $item)\n\t\t{\n\t\t\tif($item[\"question_id\"] == $a_id)\n\t\t\t{\n\t\t\t\t$block_id = $item[\"questionblock_id\"];\n\t\t\t\t$add = $idx;\n\t\t\t}\n\t\t\tif($add)\n\t\t\t{\n\t\t\t\t$block_questions[] = $item[\"question_id\"];\n\t\t\t}\n\t\t}\n\n\t\t// just 1 question left: block is obsolete\n\t\tif($add == 1)\n\t\t{\n\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t}\n\t\t// remove questions from block\n\t\telse\n\t\t{\n\t\t\tforeach($block_questions as $qid)\n\t\t\t{\n\t\t\t\t$this->object->removeQuestionFromBlock($qid, $block_id);\n\t\t\t}\n\t\t}\n\n\t\t// more than 1 moved?\n\t\tif(sizeof($block_questions) > 1)\n\t\t{\n\t\t\t// create new block and move target questions\n\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t$block_questions);\n\t\t}\n\t\t\n\t\t$this->current_page++;\n\t}", "public function getUnsquaredBlocks(){\n $unsquaredBlocks = array();\n foreach ($this->blocks as $block){\n if ($block->isNotSquared()){\n array_push($unsquaredBlocks, $block);\n }\n }\n return $unsquaredBlocks;\n }", "private static function disperseBlock(\n ManiphestTask $task,\n $spacing) {\n\n $conn = $task->establishConnection('w');\n\n // Find a block of subpriority space which is, on average, sparse enough\n // to hold all the tasks that are inside it with a reasonable level of\n // separation between them.\n\n // We'll start by looking near the target task for a range of numbers\n // which has more space available than tasks. For example, if the target\n // task has subpriority 33 and we want to separate each task by at least 1,\n // we might start by looking in the range [23, 43].\n\n // If we find fewer than 20 tasks there, we have room to reassign them\n // with the desired level of separation. We space them out, then we're\n // done.\n\n // However: if we find more than 20 tasks, we don't have enough room to\n // distribute them. We'll widen our search and look in a bigger range,\n // maybe [13, 53]. This range has more space, so if we find fewer than\n // 40 tasks in this range we can spread them out. If we still find too\n // many tasks, we keep widening the search.\n\n $base = $task->getSubpriority();\n\n $scale = 4.0;\n while (true) {\n $range = ($spacing * $scale) / 2.0;\n $min = ($base - $range);\n $max = ($base + $range);\n\n $result = queryfx_one(\n $conn,\n 'SELECT COUNT(*) N FROM %T WHERE priority = %d AND\n subpriority BETWEEN %f AND %f',\n $task->getTableName(),\n $task->getPriority(),\n $min,\n $max);\n\n $count = $result['N'];\n if ($count < $scale) {\n // We have found a block which we can make sparse enough, so bail and\n // continue below with our selection.\n break;\n }\n\n // This block had too many tasks for its size, so try again with a\n // bigger block.\n $scale *= 2.0;\n }\n\n $rows = queryfx_all(\n $conn,\n 'SELECT id FROM %T WHERE priority = %d AND\n subpriority BETWEEN %f AND %f\n ORDER BY priority, subpriority, id',\n $task->getTableName(),\n $task->getPriority(),\n $min,\n $max);\n\n $task_id = $task->getID();\n $result = null;\n\n // NOTE: In strict mode (which we encourage enabling) we can't structure\n // this bulk update as an \"INSERT ... ON DUPLICATE KEY UPDATE\" unless we\n // provide default values for ALL of the columns that don't have defaults.\n\n // This is gross, but we may be moving enough rows that individual\n // queries are unreasonably slow. An alternate construction which might\n // be worth evaluating is to use \"CASE\". Another approach is to disable\n // strict mode for this query.\n\n $extra_columns = array(\n 'phid' => '\"\"',\n 'authorPHID' => '\"\"',\n 'status' => '\"\"',\n 'priority' => 0,\n 'title' => '\"\"',\n 'originalTitle' => '\"\"',\n 'description' => '\"\"',\n 'dateCreated' => 0,\n 'dateModified' => 0,\n 'mailKey' => '\"\"',\n 'viewPolicy' => '\"\"',\n 'editPolicy' => '\"\"',\n 'ownerOrdering' => '\"\"',\n 'spacePHID' => '\"\"',\n 'bridgedObjectPHID' => '\"\"',\n 'properties' => '\"\"',\n 'points' => 0,\n 'subtype' => '\"\"',\n );\n\n $defaults = implode(', ', $extra_columns);\n\n $sql = array();\n $offset = 0;\n\n // Often, we'll have more room than we need in the range. Distribute the\n // tasks evenly over the whole range so that we're less likely to end up\n // with tasks spaced exactly the minimum distance apart, which may\n // get shifted again later. We have one fewer space to distribute than we\n // have tasks.\n $divisor = (double)(count($rows) - 1.0);\n if ($divisor > 0) {\n $available_distance = (($max - $min) / $divisor);\n } else {\n $available_distance = 0.0;\n }\n\n foreach ($rows as $row) {\n $subpriority = $min + ($offset * $available_distance);\n\n // If this is the task that we're spreading out relative to, keep track\n // of where it is ending up so we can return the new subpriority.\n $id = $row['id'];\n if ($id == $task_id) {\n $result = $subpriority;\n }\n\n $sql[] = qsprintf(\n $conn,\n '(%d, %Q, %f)',\n $id,\n $defaults,\n $subpriority);\n\n $offset++;\n }\n\n foreach (PhabricatorLiskDAO::chunkSQL($sql) as $chunk) {\n queryfx(\n $conn,\n 'INSERT INTO %T (id, %Q, subpriority) VALUES %Q\n ON DUPLICATE KEY UPDATE subpriority = VALUES(subpriority)',\n $task->getTableName(),\n implode(', ', array_keys($extra_columns)),\n $chunk);\n }\n\n return $result;\n }", "public function run()\n {\n $part_b_evals = [\n // self-evaluations col 1 part b\n ['group_id' => '2','choice_id' => '81','meta' => '1'],\n ['group_id' => '2','choice_id' => '85','meta' => '1'],\n ['group_id' => '2','choice_id' => '89','meta' => '1'],\n ['group_id' => '2','choice_id' => '93','meta' => '1'],\n ['group_id' => '2','choice_id' => '97','meta' => '1'],\n ['group_id' => '2','choice_id' => '101','meta' => '1'],\n ['group_id' => '2','choice_id' => '105','meta' => '1'],\n ['group_id' => '2','choice_id' => '109','meta' => '1'],\n ['group_id' => '2','choice_id' => '113','meta' => '1'],\n ['group_id' => '2','choice_id' => '117','meta' => '1'],\n ['group_id' => '2','choice_id' => '121','meta' => '1'],\n ['group_id' => '2','choice_id' => '125','meta' => '1'],\n ['group_id' => '2','choice_id' => '129','meta' => '1'],\n ['group_id' => '2','choice_id' => '133','meta' => '1'],\n ['group_id' => '2','choice_id' => '137','meta' => '1'],\n ['group_id' => '2','choice_id' => '141','meta' => '1'],\n ['group_id' => '2','choice_id' => '145','meta' => '1'],\n ['group_id' => '2','choice_id' => '149','meta' => '1'],\n ['group_id' => '2','choice_id' => '153','meta' => '1'],\n ['group_id' => '2','choice_id' => '157','meta' => '1'],\n\n // self-evaluations col 2 part b\n ['group_id' => '2','choice_id' => '82','meta' => '2'],\n ['group_id' => '2','choice_id' => '86','meta' => '2'],\n ['group_id' => '2','choice_id' => '90','meta' => '2'],\n ['group_id' => '2','choice_id' => '94','meta' => '2'],\n ['group_id' => '2','choice_id' => '98','meta' => '2'],\n ['group_id' => '2','choice_id' => '102','meta' => '2'],\n ['group_id' => '2','choice_id' => '106','meta' => '2'],\n ['group_id' => '2','choice_id' => '110','meta' => '2'],\n ['group_id' => '2','choice_id' => '114','meta' => '2'],\n ['group_id' => '2','choice_id' => '118','meta' => '2'],\n ['group_id' => '2','choice_id' => '122','meta' => '2'],\n ['group_id' => '2','choice_id' => '126','meta' => '2'],\n ['group_id' => '2','choice_id' => '130','meta' => '2'],\n ['group_id' => '2','choice_id' => '134','meta' => '2'],\n ['group_id' => '2','choice_id' => '138','meta' => '2'],\n ['group_id' => '2','choice_id' => '142','meta' => '2'],\n ['group_id' => '2','choice_id' => '146','meta' => '2'],\n ['group_id' => '2','choice_id' => '150','meta' => '2'],\n ['group_id' => '2','choice_id' => '154','meta' => '2'],\n ['group_id' => '2','choice_id' => '158','meta' => '2'],\n\n // self-evaluations col 3 part b\n ['group_id' => '2','choice_id' => '83','meta' => '3'],\n ['group_id' => '2','choice_id' => '87','meta' => '3'],\n ['group_id' => '2','choice_id' => '91','meta' => '3'],\n ['group_id' => '2','choice_id' => '95','meta' => '3'],\n ['group_id' => '2','choice_id' => '99','meta' => '3'],\n ['group_id' => '2','choice_id' => '103','meta' => '3'],\n ['group_id' => '2','choice_id' => '107','meta' => '3'],\n ['group_id' => '2','choice_id' => '111','meta' => '3'],\n ['group_id' => '2','choice_id' => '115','meta' => '3'],\n ['group_id' => '2','choice_id' => '119','meta' => '3'],\n ['group_id' => '2','choice_id' => '123','meta' => '3'],\n ['group_id' => '2','choice_id' => '127','meta' => '3'],\n ['group_id' => '2','choice_id' => '131','meta' => '3'],\n ['group_id' => '2','choice_id' => '135','meta' => '3'],\n ['group_id' => '2','choice_id' => '139','meta' => '3'],\n ['group_id' => '2','choice_id' => '143','meta' => '3'],\n ['group_id' => '2','choice_id' => '147','meta' => '3'],\n ['group_id' => '2','choice_id' => '151','meta' => '3'],\n ['group_id' => '2','choice_id' => '155','meta' => '3'],\n ['group_id' => '2','choice_id' => '159','meta' => '3'],\n\n // self-evaluations col 4 part b\n ['group_id' => '2','choice_id' => '84','meta' => '4'],\n ['group_id' => '2','choice_id' => '88','meta' => '4'],\n ['group_id' => '2','choice_id' => '92','meta' => '4'],\n ['group_id' => '2','choice_id' => '96','meta' => '4'],\n ['group_id' => '2','choice_id' => '100','meta' => '4'],\n ['group_id' => '2','choice_id' => '104','meta' => '4'],\n ['group_id' => '2','choice_id' => '108','meta' => '4'],\n ['group_id' => '2','choice_id' => '112','meta' => '4'],\n ['group_id' => '2','choice_id' => '116','meta' => '4'],\n ['group_id' => '2','choice_id' => '120','meta' => '4'],\n ['group_id' => '2','choice_id' => '124','meta' => '4'],\n ['group_id' => '2','choice_id' => '128','meta' => '4'],\n ['group_id' => '2','choice_id' => '132','meta' => '4'],\n ['group_id' => '2','choice_id' => '136','meta' => '4'],\n ['group_id' => '2','choice_id' => '140','meta' => '4'],\n ['group_id' => '2','choice_id' => '144','meta' => '4'],\n ['group_id' => '2','choice_id' => '148','meta' => '4'],\n ['group_id' => '2','choice_id' => '152','meta' => '4'],\n ['group_id' => '2','choice_id' => '156','meta' => '4'],\n ['group_id' => '2','choice_id' => '160','meta' => '4'],\n ];\n\n foreach ($part_b_evals as $key => $value) {\n Evaluation::create($value);\n }\n }", "function prune ();", "private function resetAll(){\n $this->score = ['heritage'=> 0,'relax'=> 0,'sightseeing'=> 0,'weather'=> 0,'populated'=> 0];\n $this->answeredQuestions = [];\n $this->answersId = [];\n }", "public static function fetchAllUnscoredAnswers($count = 50, $offset = 0) {\n global $user;\n $query = db_select('quiz_assessment_question_user_answers', 'a');\n $query->fields('a', array('result_id', 'question_nid', 'question_vid', 'answer_feedback', 'answer_feedback_format'));\n $query->fields('r', array('title'));\n $query->fields('qnr', array('time_end', 'time_start', 'uid'));\n $query->join('node_revision', 'r', 'a.question_vid = r.vid');\n $query->join('quiz_node_results', 'qnr', 'a.result_id = qnr.result_id');\n $query->join('node', 'n', 'qnr.nid = n.nid');\n $query->condition('a.is_evaluated', 0);\n if (user_access('score own quiz') && user_access('score taken quiz answer')) {\n $query->condition(db_or()->condition('n.uid', $user->uid)->condition('qnr.uid', $user->uid));\n }\n else if (user_access('score own quiz')) {\n $query->condition('n.uid', $user->uid);\n }\n else if (user_access('score taken quiz answer')) {\n $query->condition('qnr.uid', $user->uid);\n }\n $results = $query->execute();\n $unscored = array();\n foreach ($results as $row) {\n $unscored[] = $row;\n }\n return $unscored;\n }", "function recycle_quizzes()\n\t{\n\t\tif ($this->course->has_resources(RESOURCE_QUIZ))\n\t\t{\n\t\t\t//$table_qui_que = Database :: get_course_table(TABLE_QUIZ_QUESTION);\n\t\t\t//$table_qui_ans = Database :: get_course_table(TABLE_QUIZ_ANSWER);\n\t\t\t$table_qui = Database :: get_course_table(TABLE_QUIZ_TEST);\n\t\t\t$table_rel = Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION);\n\t\t\t$ids = implode(',', (array_keys($this->course->resources[RESOURCE_QUIZ])));\n\t\t\t$sql = \"DELETE FROM \".$table_qui.\" WHERE id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_rel.\" WHERE exercice_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t}\n\t}", "public function cloneApplicationQuestions()\n {\n $questionListModel = $this->container->factory->model('QuestionLists', array('factoryClass' => 'FOF30\\\\Factory\\\\MagicFactory'));\n\n $questionListModel->cloneQuestionListToForeignModel($this->getQuestionListId(), '#__cajobboard_applications_questions', 'application_id');\n }", "function kilman_prep_for_questionform($kilman, $qid, $qtype) {\n $context = context_module::instance($kilman->cm->id);\n if ($qid != 0) {\n $question = clone($kilman->questions[$qid]);\n $question->qid = $question->id;\n $question->sid = $kilman->survey->id;\n $question->id = $kilman->cm->id;\n $draftideditor = file_get_submitted_draft_itemid('question');\n $content = file_prepare_draft_area($draftideditor, $context->id, 'mod_kilman', 'question',\n $qid, array('subdirs' => true), $question->content);\n $question->content = array('text' => $content, 'format' => FORMAT_HTML, 'itemid' => $draftideditor);\n\n if (isset($question->dependencies)) {\n foreach ($question->dependencies as $dependencies) {\n if ($dependencies->dependandor === \"and\") {\n $question->dependquestions_and[] = $dependencies->dependquestionid.','.$dependencies->dependchoiceid;\n $question->dependlogic_and[] = $dependencies->dependlogic;\n } else if ($dependencies->dependandor === \"or\") {\n $question->dependquestions_or[] = $dependencies->dependquestionid.','.$dependencies->dependchoiceid;\n $question->dependlogic_or[] = $dependencies->dependlogic;\n }\n }\n }\n } else {\n $question = \\mod_kilman\\question\\base::question_builder($qtype);\n $question->sid = $kilman->survey->id;\n $question->id = $kilman->cm->id;\n $question->type_id = $qtype;\n $question->type = '';\n $draftideditor = file_get_submitted_draft_itemid('question');\n $content = file_prepare_draft_area($draftideditor, $context->id, 'mod_kilman', 'question',\n null, array('subdirs' => true), '');\n $question->content = array('text' => $content, 'format' => FORMAT_HTML, 'itemid' => $draftideditor);\n }\n return $question;\n}", "public function allCompact();", "public function test_interactive_partial_no_submit() {\n $dd = test_question_maker::make_question('ddimageortext');\n $dd->hints = array(\n new question_hint_with_parts(23, 'This is the first hint.',\n FORMAT_MOODLE, false, false),\n new question_hint_with_parts(24, 'This is the second hint.',\n FORMAT_MOODLE, true, true),\n );\n $dd->shufflechoices = false;\n $this->start_attempt_at_question($dd, 'interactive', 4);\n\n // Check the initial state.\n $this->check_current_state(question_state::$todo);\n $this->check_current_mark(null);\n\n $this->check_current_output(\n $this->get_contains_drag_image_home_expectation(1, 1, 1),\n $this->get_contains_drag_image_home_expectation(2, 2, 1),\n $this->get_contains_drag_image_home_expectation(3, 1, 2),\n $this->get_contains_drag_image_home_expectation(4, 2, 2),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p1'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p2'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p3'),\n $this->get_contains_hidden_expectation(\n $this->quba->get_field_prefix($this->slot) . 'p4'),\n $this->get_contains_submit_button_expectation(true),\n $this->get_does_not_contain_feedback_expectation(),\n $this->get_tries_remaining_expectation(3),\n $this->get_no_hint_visible_expectation());\n\n // Save the a partially right answer.\n $this->process_submission(array('p1' => '1', 'p2' => '1', 'p3' => '2', 'p4' => '1'));\n\n // Finish the attempt without clicking check.\n $this->quba->finish_all_questions();\n\n // Verify.\n $this->check_current_state(question_state::$gradedpartial);\n $this->check_current_mark(1);\n\n $this->check_current_output(\n $this->get_contains_drag_image_home_expectation(1, 1, 1),\n $this->get_contains_drag_image_home_expectation(2, 2, 1),\n $this->get_contains_drag_image_home_expectation(3, 1, 2),\n $this->get_contains_drag_image_home_expectation(4, 2, 2),\n $this->get_does_not_contain_submit_button_expectation(),\n $this->get_contains_partcorrect_expectation(),\n $this->get_no_hint_visible_expectation());\n\n // Check regrading does not mess anything up.\n $this->quba->regrade_all_questions();\n\n // Verify.\n $this->check_current_state(question_state::$gradedpartial);\n $this->check_current_mark(1);\n }" ]
[ "0.5401924", "0.51977265", "0.51035273", "0.4845382", "0.4765952", "0.46454492", "0.45468932", "0.45237118", "0.45136034", "0.44803774", "0.44173816", "0.44149223", "0.44084257", "0.4405402", "0.43919164", "0.43918464", "0.43786082", "0.4371785", "0.43571162", "0.43280527", "0.43104464", "0.42875504", "0.4239417", "0.4235631", "0.42167115", "0.42053246", "0.418025", "0.41711846", "0.41637176", "0.4162872" ]
0.6894248
0
Returns the question titles of all questions of a question block
function &getQuestionblockQuestions($questionblock_id) { global $ilDB; $titles = array(); $result = $ilDB->queryF("SELECT svy_question.title, svy_qblk_qst.question_fi, svy_qblk_qst.survey_fi FROM ". "svy_qblk, svy_qblk_qst, svy_question WHERE svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi AND " . "svy_question.question_id = svy_qblk_qst.question_fi AND svy_qblk.questionblock_id = %s", array('integer'), array($questionblock_id) ); $survey_id = ""; while ($row = $ilDB->fetchAssoc($result)) { $titles[$row["question_fi"]] = $row["title"]; $survey_id = $row["survey_fi"]; } $result = $ilDB->queryF("SELECT question_fi, sequence FROM svy_svy_qst WHERE survey_fi = %s ORDER BY sequence", array('integer'), array($survey_id) ); $resultarray = array(); $counter = 1; while ($row = $ilDB->fetchAssoc($result)) { if (array_key_exists($row["question_fi"], $titles)) { $resultarray[$counter++] = $titles[$row["question_fi"]]; } } return $resultarray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getQuestions(): array\n {\n $questions = [];\n foreach ($this->block->getQuestions() as $question) {\n $cleanedAnswer = implode('', $this->fixIsiteMarkupHelper->getParagraphs($question['answer']));\n $questions[] = [\n 'question' => $question['question'],\n 'answer' => $cleanedAnswer,\n ];\n }\n return $questions;\n }", "public function titleQuery() {\n $titles = [];\n\n $groupContent = $this->groupContentStorage->loadMultiple($this->value);\n foreach ($groupContent as $content) {\n $titles[] = $content->label();\n }\n return $titles;\n }", "public function getPreDefinedQuestions()\n {\n return [\n \"1\" => \"Select a Security Question\",\n \"2\" => \"What was your childhood nickname?\",\n \"3\" => \"What is the name of your favorite childhood friend?\",\n \"4\" => \"What was the name of your first stuffed animal?\",\n \"5\" => \"Where were you when you had your first kiss?\",\n \"6\" => \"What is the name of the company of your first job?\",\n \"7\" => \"What was your favorite place to visit as a child?\",\n \"8\" => \"What was your dream job as a child?\",\n \"9\" => \"What is your preferred musical genre?\",\n \"10\" => \"What is your favorite team?\",\n \"11\" => \"What is your father\\\"s middle name?\"\n ];\n }", "public function get_questions() {\n return $this->questions;\n }", "public function getQuestions()\n {\n return $this->questions;\n }", "public function getQuestions()\n {\n return $this->questions;\n }", "public function getQuestions() {\r\n\t\treturn $this->questions;\r\n\t}", "function showQuestions()\n\t{\n\t\tif($this->TotalQuestions > 0)\n\t\t{#be certain there are questions\n\t\t\tforeach($this->aQuestion as $question)\n\t\t\t{#print data for each \n\t\t\t\techo $question->Number . ') '; # We're using new Number property instead of id - v2\n\t\t\t\techo $question->Text . ' ';\n\t\t\t\tif($question->Description != ''){echo '(' . $question->Description . ')';}\n\t\t\t\techo '<br />';\n\t\t\t\t$question->showAnswers() . '<br />'; #display array of answer objects\n\t\t\t}\n\t\t}else{\n\t\t\techo 'There are currently no questions for this survey.';\t\n\t\t}\n\t}", "public function displayQuestions() {\n $listQuestions = array();\n $sql = 'SELECT `id`, `question`, `picture` FROM `' . self::PREFIX . 'question`';\n $result = $this->db->query($sql);\n $listQuestions = $result->fetchAll(PDO::FETCH_OBJ);\n return $listQuestions;\n }", "function ipal_get_questions(){ \r\n \r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\tglobal $CFG;\r\n\t$q='';\t\r\n\t$pagearray2=array();\r\n\t // is there an quiz associated with an ipal?\r\n//\t$ipal_quiz=$DB->get_record('ipal_quiz',array('ipal_id'=>$ipal->id));\r\n\t\r\n\t// get quiz and put it into an array\r\n\t$quiz=$DB->get_record('ipal',array('id'=>$ipal->id));\r\n\t\r\n\t//Get the question ids\r\n\t$questions=explode(\",\",$quiz->questions);\r\n\t\r\n\t//get the questions and stuff them into an array\r\n\t\tforeach($questions as $q){\t\r\n\t\t\t\r\n\t\t $aquestions=$DB->get_record('question',array('id'=>$q));\r\n\t\t if(isset($aquestions->questiontext)){\r\n\t\t $pagearray2[]=array('id'=>$q, 'question'=>strip_tags($aquestions->questiontext), 'answers'=>ipal_get_answers($q));\r\n\t\t\t\t \r\n\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t}\r\n \r\n\treturn($pagearray2);\r\n\t}", "function getQuestionblocksTable($arrFilter)\n\t{\n\t\tglobal $ilUser, $ilDB;\n\t\t\n\t\t$where = \"\";\n\t\tif (is_array($arrFilter))\n\t\t{\n\t\t\tif (array_key_exists('title', $arrFilter) && strlen($arrFilter['title']))\n\t\t\t{\n\t\t\t\t$where .= \" AND \" . $ilDB->like('svy_qblk.title', 'text', \"%%\" . $arrFilter['title'] . \"%%\");\n\t\t\t}\n\t\t}\n \n\t\t$query_result = $ilDB->query(\"SELECT svy_qblk.*, svy_svy.obj_fi FROM svy_qblk , svy_qblk_qst, svy_svy WHERE \".\n\t\t\t\"svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi AND svy_svy.survey_id = svy_qblk_qst.survey_fi \".\n\t\t\t\"$where GROUP BY svy_qblk.questionblock_id, svy_qblk.title, svy_qblk.show_questiontext, svy_qblk.show_blocktitle, \".\n\t\t\t\"svy_qblk.owner_fi, svy_qblk.tstamp, svy_svy.obj_fi\");\n\t\t$rows = array();\n\t\tif ($query_result->numRows())\n\t\t{\n\t\t\t$survey_ref_ids = ilUtil::_getObjectsByOperations(\"svy\", \"write\");\n\t\t\t$surveytitles = array();\n\t\t\tforeach ($survey_ref_ids as $survey_ref_id)\n\t\t\t{\n\t\t\t\t$survey_id = ilObject::_lookupObjId($survey_ref_id);\n\t\t\t\t$surveytitles[$survey_id] = ilObject::_lookupTitle($survey_id);\t\t\t\t\n\t\t\t}\n\t\t\twhile ($row = $ilDB->fetchAssoc($query_result))\n\t\t\t{\n\t\t\t\t$questions_array =& $this->getQuestionblockQuestions($row[\"questionblock_id\"]);\n\t\t\t\t$counter = 1;\n\t\t\t\tforeach ($questions_array as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$questions_array[$key] = \"$counter. $value\";\n\t\t\t\t\t$counter++;\n\t\t\t\t}\n\t\t\t\tif (strlen($surveytitles[$row[\"obj_fi\"]])) // only questionpools which are not in trash\n\t\t\t\t{\n\t\t\t\t\t$rows[$row[\"questionblock_id\"]] = array(\n\t\t\t\t\t\t\"questionblock_id\" => $row[\"questionblock_id\"],\n\t\t\t\t\t\t\"title\" => $row[\"title\"], \n\t\t\t\t\t\t\"svy\" => $surveytitles[$row[\"obj_fi\"]], \n\t\t\t\t\t\t\"contains\" => join($questions_array, \", \"),\n\t\t\t\t\t\t\"owner\" => $row[\"owner_fi\"]\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $rows;\n\t}", "function getQuestions()\n\t{\n\t\treturn $this->aQuestion;\n\t}", "public static function get_question_table_headers() {\n\n $headerdata = array();\n $headerdata[] = get_string('qnumber', 'mod_simplelesson');\n $headerdata[] = get_string('question_name', 'mod_simplelesson');\n $headerdata[] = get_string('question_text', 'mod_simplelesson');\n $headerdata[] = get_string('questionscore', 'mod_simplelesson');\n $headerdata[] = get_string('pagetitle', 'mod_simplelesson');\n $headerdata[] = get_string('setpage', 'mod_simplelesson');\n $headerdata[] = get_string('qlinkheader', 'mod_simplelesson');\n\n return $headerdata;\n }", "public function getQuestions() {\r\n\t\t\treturn $this->_arrQuestions;\r\n\t\t}", "public function getShowQuestionTitles() \n\t{\n\t\treturn ($this->display_question_titles) ? 1 : 0;\n\t}", "public function getQuestions()\n {\n $title = \"Questions\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n $post = new Post($this->di->get(\"db\"));\n $user = new User($this->di->get(\"db\"));\n $tag = $this->di->get(\"tag\");\n\n $questions = $post->getQuestions();\n foreach ($questions as $question) {\n $question->tags = $tag->getPostTags($question->id);\n $question->user = $user->findAllWhere(\"id = ?\", [$question->userId])[0];//$user->find(\"id\", $question->userId);\n }\n\n $pag = $this->getPagination($questions);\n $view->add(\"comment/question-list\", [\n \"questions\" => array_slice($questions, $pag[\"offset\"], $pag[\"length\"], true),\n \"pag\" => $pag,\n ]);\n return $pageRender->renderPage([\"title\" => $title]);\n }", "public function getQuestions()\n {\n return DB::table('questionbank_quizzes')\n ->where('quize_id','=',$this->id)\n ->orderBy('subject_id')\n ->get();\n }", "function getQuestions() { \n\ttry {\n\t\t$questions = ORM::for_table('questions')->find_many();\n\t\tif (!count($questions)) { \n\t\t\treturn 0;\n\t\t}\n\t\t$theQuestions = array();\n\t\tforeach ($questions as $question) { \n\t\t\t$theQuestion = array();\n\t\t\t$theQuestion['id'] = $question->id;\n\t\t\t$theQuestion['text'] = $question->text;\n\t\t\t$theQuestion['answer1'] = $question->answer1;\n\t\t\t$theQuestion['answer2'] = $question->answer2;\n\t\t\t$theQuestions[] = $theQuestion;\n\t\t}\n\t\treturn $theQuestions;\n\t} catch (Exception $e) { \n\t\treturn 0;\n\t}\n}", "function showQuestions()\n {\n if($this->TotalQuestions > 0)\n {#be certain there are questions\n foreach($this->aQuestion as $question)\n {#print data for each \n\n echo '\n\n <div class=\"panel panel-primary\">\n <div class=\"panel-heading\">\n <h3 class=\"panel-title\">' . $question->Text . '</h3>\n </div>\n <div class=\"panel-body\">\n <p>' . $question->Description . '</p>\n ' . $question->showAnswers() . ' \n </div>\n </div>\n\n ';\n\n }\n }else{\n echo \"There are currently no questions for this survey.\";\t\n } \n\t}", "public function getQuestions()\n {\n if (!empty($this->questionsMetadata)) {\n foreach ($this->questions as $question) {\n /** @var Question $question */\n $data = $question->get_data();\n $metadata = $data->get_metadata();\n\n if (!isset($metadata)) {\n $qtype = $data->get_type();\n // HACK: longtextV2 doesn't have a corresponding entity, so force it to use the similar longtext one\n if ($qtype === 'longtextV2') {\n $qtype = 'longtext';\n }\n $metadataClass = '\\\\LearnosityQti\\\\Entities\\\\QuestionTypes\\\\'.$qtype.'_metadata';\n $metadata = new $metadataClass();\n $data->set_metadata($metadata);\n }\n\n $this->populateQuestionMetadata($metadata, $this->questionsMetadata);\n }\n }\n return array_merge(array_values($this->questions), $this->getRubricQuestions());\n }", "function showQuestionTitles() \n\t{\n\t\t$this->display_question_titles = 1;\n\t}", "private function extractQuestions(){\n $this->selectQuestions();\n $num=mysqli_num_rows($this->arrResultQuestions);\n for($i=0; $i<$num; $i++):\n $row=mysqli_fetch_object($this->arrResultQuestions);\n $misc=new misc();\n $fromWho=$misc->singleSelection('username', 'users', 'user_id', '=', $row->user_id);\n ?>\n <article class=\"homePageQuestions homePageArticle<?php echo $i; ?>\">\n <h3 class=\"homePageQuestionHeading\"><a href=\"?questionBody=<?php echo $row->post_id; ?>\"><?php echo $row->name; ?></a></h3>\n <span class=\"homePageQuestionAddFrom\"><span class=\"glyphicon glyphicon-user\"></span><a href=\"?user=<?php echo $row->user_id; ?>\"><?php echo $fromWho; ?></a></span>\n <span class=\"homePageQuestionAddTime\"><span class=\"glyphicon glyphicon-time\"></span><?php echo date('d.m.Y в H:i', $row->timeadded); ?></span>\n <span class=\"homePageQuestionAddTime\"><span class=\"glyphicon glyphicon-tag\"></span><?php echo $this->selectCategory($row->cat_id); ?></span>\n <span class=\"homePageQuestionVisits\"><?php echo $row->visits ?> Показвания</span>\n <?php\n $this->showingQuestionsFooter($row->lastanswered, $row->lastanswer, $row->post_id);\n ?>\n </article>\n <?php\n endfor;\n }", "function &getQuestionpoolTitles($could_be_offline = FALSE, $showPath = FALSE) \n\t{\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php\";\n\t\treturn ilObjSurveyQuestionPool::_getAvailableQuestionpools($use_object_id = TRUE, $could_be_offline, $showPath);\n\t}", "protected function getAllItems()\n {\n $sectionModel = new SectionModel();\n\n $categories = $sectionModel->where('is_deleted', 0)->select('id, name, question_type_id')->findAll();\n\n $questions = array();\n\n foreach($categories as $category) {\n // Get type of question\n $qType_id = $category['question_type_id'];\n // get choices and store in a list with the\n // category name as the key\n $choices[$category['name']] = $this->getChoices($qType_id);\n\n $result = $sectionModel->getQuestions($category['id']);\n $questions[$category['name']] = $result;\n }\n\n return [$questions, $choices];\n }", "public static function questionWords()\n {\n return array('who', 'what', 'where', 'when', 'why', 'how', 'which', 'wherefore', 'whatever', 'whom', 'whose', 'wherewith', 'whither', 'whence');\n }", "public function getQuestions()\n {\n $title = \"Questions\";\n $subtitle = \"Here you will find all the questions!\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n\n // Get all the questions\n $questions = $this->di->get(\"questionModel\")->getQuestions();\n\n // Get number of answers\n $answers = [];\n foreach ($questions as $question) {\n $ans = $this->di->get(\"answerModel\")->getAnswersWhere(\"questionId\", $question->id);\n $answers[$question->id] = count($ans);\n }\n\n $data = [\n \"questions\" => $questions,\n \"subtitle\" => $subtitle,\n \"noOfAnswers\" => $answers,\n ];\n\n $view->add(\"pages/questions\", $data);\n $pageRender->renderPage([\"title\" => $title]);\n }", "public function getQuestions() {\n\t\t$fields = $this->Fields();\n\t\t// remove EditableFormStep\n\t\t$fields = $fields->exclude('ClassName', 'EditableFormStep');\n\t\t// return fields\n\t\treturn $fields;\n\t}", "private function _Questions ( ) {\n\t\t$Config = $this->Get ( 'Config' );\n\t\t$quests = $Config['questions'];\n\t\t$groups = $Config['question_groups'];\n\t\tforeach ( $groups as $g => $group ) {\n\t\t\t$Groups[$group] = new stdClass();\n\t\t\t$Groups[$group]->Label = $Config['question_group_labels'][$g];\n\t\t\tforeach ( $quests as $q => $quest ) {\n\t\t\t\tif ( $Config['question_group'][$q] != $g ) continue;\n\t\t\t\t$Groups[$group]->Questions[$quest] = new stdClass();\n\t\t\t\t$Groups[$group]->Questions[$quest]->Label = $Config['question_labels'][$q];\n\t\t\t\t$Groups[$group]->Questions[$quest]->Type = $Config['question_types'][$q];\n\t\t\t\t$Groups[$group]->Questions[$quest]->Field = $Config['question_fields'][$q];\n\t\t\t\t$Groups[$group]->Questions[$quest]->Social = $Config['question_social'][$q];\n\t\t\t\t$Groups[$group]->Questions[$quest]->Display = $Config['question_display'][$q];\n\t\t\t\tif ( $Config['question_options'][$q] )\n\t\t\t\t\t$Groups[$group]->Questions[$quest]->Options = explode ( '|', $Config['question_options'][$q] );\n\t\t\t}\n\t\t\tksort ( $Groups[$group]->Questions );\n\t\t}\n\t\tksort ( $Groups );\n\t\treturn ( $Groups );\n\t}", "public function showDiscussionTitles()\n\t\t\t{\n\t\t\t\t$sql = 'SELECT cat_id, cat_name, seo_title, has_child, total_discussions'.\n\t\t\t\t\t\t' FROM '.$this->CFG['db']['tbl']['category'].\n\t\t\t\t\t\t' WHERE status = \\'Active\\'';\n\n\t\t\t\t$field_values = array();\n\t\t\t\tif ($this->fields_arr['cat'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql .= ' AND cat_id ='.$this->dbObj->Param($this->fields_arr['cat']);\n\t\t\t\t\t\t$field_values[] = $this->fields_arr['cat'];\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql .=' AND parent_id = 0';\n\t\t\t\t\t}\n\t\t\t\t$sql .= ' ORDER BY disporder';\n\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t$rs = $this->dbObj->Execute($stmt, $field_values);\n\t\t\t\tif (!$rs)\n\t\t\t\t\t trigger_db_error($this->dbObj);\n\n\t\t\t\t$showDiscussionTitles_arr = array();\n\t\t\t\twhile($row = $rs->FetchRow()) {\n\t\t\t\t\t//$row['subforum_titles'] = array();\n\t\t\t\t\t$row['discussion_titles'] = $this->getDiscussionTitles($row['cat_id']);\n\t\t\t\t\t//if(!$row['discussion_titles'])\n\t\t\t\t\t$row['subforum_titles'] = $this->getSubForumTitles($row['cat_id']);\n\t\t\t\t\t$showDiscussionTitles_arr[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $showDiscussionTitles_arr;\n\t\t\t}", "public function getQaArr(){\n $titlecontent1 = str_replace(\"\\r\\n\",\"\\n\",$this->questiontitles);\n $titlecontent = str_replace(\"\\r\",\"\\n\",$titlecontent1);\n $qs = explode(\"\\n\",$titlecontent);\n $qas = array();\n\n foreach( $qs as $q ){\n $qas[] = array(\n 'q' => $q,\n 'a' => ''\n );\n }\n\n return $qas;\n }" ]
[ "0.7195659", "0.6123147", "0.60451055", "0.5898541", "0.589787", "0.589787", "0.58860797", "0.58771163", "0.58643", "0.582942", "0.5808779", "0.5799628", "0.57528436", "0.5694474", "0.56906086", "0.5678182", "0.566772", "0.5605145", "0.5595025", "0.5533997", "0.55311", "0.55292106", "0.5503395", "0.54853874", "0.54801077", "0.54771584", "0.5442739", "0.5441135", "0.5434947", "0.54283607" ]
0.6860446
1
Returns the question id's of all questions of a question block
function &getQuestionblockQuestionIds($questionblock_id) { global $ilDB; $result = $ilDB->queryF("SELECT question_fi FROM svy_qblk_qst WHERE questionblock_fi = %s", array("integer"), array($questionblock_id) ); $ids = array(); if ($result->numRows()) { while ($data = $ilDB->fetchAssoc($result)) { array_push($ids, $data['question_fi']); } } return $ids; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function &getQuestionblockQuestions($questionblock_id)\n\t{\n\t\tglobal $ilDB;\n\t\t$titles = array();\n\t\t$result = $ilDB->queryF(\"SELECT svy_question.title, svy_qblk_qst.question_fi, svy_qblk_qst.survey_fi FROM \".\n\t\t\t\"svy_qblk, svy_qblk_qst, svy_question WHERE svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi AND \" .\n\t\t\t\"svy_question.question_id = svy_qblk_qst.question_fi AND svy_qblk.questionblock_id = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($questionblock_id)\n\t\t);\n\t\t$survey_id = \"\";\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\t$titles[$row[\"question_fi\"]] = $row[\"title\"];\n\t\t\t$survey_id = $row[\"survey_fi\"];\n\t\t}\n\t\t$result = $ilDB->queryF(\"SELECT question_fi, sequence FROM svy_svy_qst WHERE survey_fi = %s ORDER BY sequence\",\n\t\t\tarray('integer'),\n\t\t\tarray($survey_id)\n\t\t);\n\t\t$resultarray = array();\n\t\t$counter = 1;\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\tif (array_key_exists($row[\"question_fi\"], $titles))\n\t\t\t{\n\t\t\t\t$resultarray[$counter++] = $titles[$row[\"question_fi\"]];\n\t\t\t}\n\t\t}\n\t\treturn $resultarray;\n\t}", "public function getQuestionIds(){\n\t\treturn array('todo'); // This will be moved to QuestionTemplate\n\t}", "public function getQuestions(): array\n {\n $questions = [];\n foreach ($this->block->getQuestions() as $question) {\n $cleanedAnswer = implode('', $this->fixIsiteMarkupHelper->getParagraphs($question['answer']));\n $questions[] = [\n 'question' => $question['question'],\n 'answer' => $cleanedAnswer,\n ];\n }\n return $questions;\n }", "function getQuestionblock($questionblock_id)\n\t{\n\t\tglobal $ilDB;\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_qblk WHERE questionblock_id = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($questionblock_id)\n\t\t);\n\t\treturn $ilDB->fetchAssoc($result);\n\t}", "function _getQuestionblock($questionblock_id)\n\t{\n\t\tglobal $ilDB;\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_qblk WHERE questionblock_id = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($questionblock_id)\n\t\t);\n\t\t$row = $ilDB->fetchAssoc($result);\n\t\treturn $row;\n\t}", "private function myQid(){\r\n\t\t$this->db->where('uid', $this->uid);\r\n\t\t$this->db->select('id');\r\n\t\t$this->db->from('wen_answer');\r\n\t\t$tmp = $this->db->get()->result_array();\r\n\t\t$return = array();\r\n\t\tforeach($tmp as $r){\r\n\t\t\t$return[$r['id']] = 1;\r\n\t\t}\r\n\t\treturn $return;\r\n\t}", "public function getQuestionIds()\r\n{\r\n $query_string = \"SELECT questionid FROM questions \";\r\n $query_string .= \"WHERE question = :question AND questionid != :questionid\";\r\n\r\n return $query_string;\r\n}", "public function getQuestionIds ($quiz=\"\") \n {\n \tglobal $debug;\n \t\n \t// if $quiz not specified get all questions in db (even those with no quiz)\n \t// Initial sql without where - add where part later if required\n \t$sql = \"SELECT \".$this->table_prefix.$this->quiz_tables['questions'].\".questionid, quizname FROM \". $this->table_prefix.$this->quiz_tables['questions']. \" LEFT OUTER JOIN \".$this->table_prefix.$this->quiz_tables['rel'].\" on \".$this->table_prefix.$this->quiz_tables['questions'].\".questionid=\".$this->table_prefix.$this->quiz_tables['rel'].\".questionid\";\n \tif (isset ($debug) && $debug) {print \"SQL: \\n\".$sql.\"\\n\\n\";}\n \t\n \t// if we limit to a quiz then handle here\n \tif ($quiz!=\"\")\n \t{\n \t\t// add a where clause - no security checking here - it needs to be done at a higher level\n \t\t$sql .= \" WHERE \".$this->table_prefix.$this->quiz_tables['rel'].\".quizname=\\\"$quiz\\\"\";\n \t}\n \t\n \t// Get all the rows into a temp array - we then reformat appropriately (eg. move quizname into array instead of individual rows\n \t\n \t$temp_array = $this->db_object->getRowsAll ($sql);\n \t// check for errors\n \tif (isset ($temp_array['ERRORS'])) \n \t{\n \t\t//-here userfriendly handling?\n \t\tif ($debug) {print \"Error in getQuestionIds \\n\";}\n \t\t$err = Errors::getInstance();\n \t\t$err->errorEvent(ERROR_DATABASE, \"Error reading database\"+$temp_array['ERRORS']);\n\n \t}\n \t\n \t// New array that we return from the function - std 1 dimension\n \t$return_array = array();\n\n \t//print \"DEBUG\\n\";\n \t//print_r ($temp_array);\n \t\n \t// iterate over all arrays - set so we only have one question\n \tforeach ($temp_array as $this_array)\n \t{\n \t\t// pull this out of array as we will use a few times and makes easier to read\n \t\t$this_question_id = $this_array['questionid'];\n \t\t// does this question already exist - if so ignore\n \t\tif (!in_array ($this_question_id, $return_array))\n \t\t{\n \t\t\t$return_array[] = $this_question_id;\n \t\t}\n \t}\n \treturn $return_array;\n }", "public function get_id_question()\n\t{\n\t\treturn $this->id_question;\n\t}", "function getQuestions() { \n\ttry {\n\t\t$questions = ORM::for_table('questions')->find_many();\n\t\tif (!count($questions)) { \n\t\t\treturn 0;\n\t\t}\n\t\t$theQuestions = array();\n\t\tforeach ($questions as $question) { \n\t\t\t$theQuestion = array();\n\t\t\t$theQuestion['id'] = $question->id;\n\t\t\t$theQuestion['text'] = $question->text;\n\t\t\t$theQuestion['answer1'] = $question->answer1;\n\t\t\t$theQuestion['answer2'] = $question->answer2;\n\t\t\t$theQuestions[] = $theQuestion;\n\t\t}\n\t\treturn $theQuestions;\n\t} catch (Exception $e) { \n\t\treturn 0;\n\t}\n}", "function insertQuestionblock($questionblock_id) \n\t{\n\t\tglobal $ilDB;\n\t\t$result = $ilDB->queryF(\"SELECT svy_qblk.title, svy_qblk.show_questiontext, svy_qblk.show_blocktitle,\".\n\t\t\t\" svy_qblk_qst.question_fi FROM svy_qblk, svy_qblk_qst, svy_svy_qst\".\n\t\t\t\" WHERE svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi\".\n\t\t\t\" AND svy_svy_qst.question_fi = svy_qblk_qst.question_fi\".\n\t\t\t\" AND svy_qblk.questionblock_id = %s\".\n\t\t\t\" ORDER BY svy_svy_qst.sequence\",\n\t\t\tarray('integer'),\n\t\t\tarray($questionblock_id)\n\t\t);\n\t\t$questions = array();\n\t\t$show_questiontext = 0;\n\t\t$show_blocktitle = 0;\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\t$duplicate_id = $this->duplicateQuestionForSurvey($row[\"question_fi\"]);\n\t\t\tarray_push($questions, $duplicate_id);\n\t\t\t$title = $row[\"title\"];\n\t\t\t$show_questiontext = $row[\"show_questiontext\"];\n\t\t\t$show_blocktitle = $row[\"show_blocktitle\"];\n\t\t}\n\t\t$this->createQuestionblock($title, $show_questiontext, $show_blocktitle, $questions);\n\t}", "private function getAnswers($question){\n $answerModel = new Answer();\n $answers = $answerModel->where('id_qst',$question->id_qst)->findAll();\n $retMess = \"\";\n $this->answersId = [];\n foreach($answers as $answer){\n array_push($this->answersId,$answer->id_ans);\n $retMess .= \",\".$answer->text;\n }\n\n return $retMess;\n }", "public function getDependentBlockIds()\n {\n $results = $this->getTable()\n ->addSelect('id', 'blocks', 'id')\n ->addJoin(\n Table::JOIN_TYPE_INNER,\n 'menuInstances',\n 'menuInstances',\n 'sectionId',\n Table::DEFAULT_ALIAS,\n self::PK_FIELD\n )\n ->addJoin(\n Table::JOIN_TYPE_INNER,\n 'menu',\n 'menu',\n self::PK_FIELD,\n 'menuInstances',\n 'menuId'\n )\n ->addJoin(\n Table::JOIN_TYPE_INNER,\n 'blocks',\n 'blocks',\n 'contentId',\n 'menu',\n self::PK_FIELD\n )\n ->addWhere(\n sprintf(\n '%s.%s = :sectionId',\n Table::DEFAULT_ALIAS,\n self::PK_FIELD\n )\n )\n ->addWhere('blocks.contentType = :contentType')\n ->addParameter('sectionId', $this->getId())\n ->addParameter('contentType', BlockModel::TYPE_MENU)\n ->findAll();\n\n $list = [];\n foreach ($results as $result) {\n $list[] = $result['id'];\n }\n\n return $list;\n }", "public function getQuestionId() {\n\t\treturn $this->questionId;\n\t}", "function getQuestionblocksTable($arrFilter)\n\t{\n\t\tglobal $ilUser, $ilDB;\n\t\t\n\t\t$where = \"\";\n\t\tif (is_array($arrFilter))\n\t\t{\n\t\t\tif (array_key_exists('title', $arrFilter) && strlen($arrFilter['title']))\n\t\t\t{\n\t\t\t\t$where .= \" AND \" . $ilDB->like('svy_qblk.title', 'text', \"%%\" . $arrFilter['title'] . \"%%\");\n\t\t\t}\n\t\t}\n \n\t\t$query_result = $ilDB->query(\"SELECT svy_qblk.*, svy_svy.obj_fi FROM svy_qblk , svy_qblk_qst, svy_svy WHERE \".\n\t\t\t\"svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi AND svy_svy.survey_id = svy_qblk_qst.survey_fi \".\n\t\t\t\"$where GROUP BY svy_qblk.questionblock_id, svy_qblk.title, svy_qblk.show_questiontext, svy_qblk.show_blocktitle, \".\n\t\t\t\"svy_qblk.owner_fi, svy_qblk.tstamp, svy_svy.obj_fi\");\n\t\t$rows = array();\n\t\tif ($query_result->numRows())\n\t\t{\n\t\t\t$survey_ref_ids = ilUtil::_getObjectsByOperations(\"svy\", \"write\");\n\t\t\t$surveytitles = array();\n\t\t\tforeach ($survey_ref_ids as $survey_ref_id)\n\t\t\t{\n\t\t\t\t$survey_id = ilObject::_lookupObjId($survey_ref_id);\n\t\t\t\t$surveytitles[$survey_id] = ilObject::_lookupTitle($survey_id);\t\t\t\t\n\t\t\t}\n\t\t\twhile ($row = $ilDB->fetchAssoc($query_result))\n\t\t\t{\n\t\t\t\t$questions_array =& $this->getQuestionblockQuestions($row[\"questionblock_id\"]);\n\t\t\t\t$counter = 1;\n\t\t\t\tforeach ($questions_array as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$questions_array[$key] = \"$counter. $value\";\n\t\t\t\t\t$counter++;\n\t\t\t\t}\n\t\t\t\tif (strlen($surveytitles[$row[\"obj_fi\"]])) // only questionpools which are not in trash\n\t\t\t\t{\n\t\t\t\t\t$rows[$row[\"questionblock_id\"]] = array(\n\t\t\t\t\t\t\"questionblock_id\" => $row[\"questionblock_id\"],\n\t\t\t\t\t\t\"title\" => $row[\"title\"], \n\t\t\t\t\t\t\"svy\" => $surveytitles[$row[\"obj_fi\"]], \n\t\t\t\t\t\t\"contains\" => join($questions_array, \", \"),\n\t\t\t\t\t\t\"owner\" => $row[\"owner_fi\"]\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $rows;\n\t}", "function getQuizResourceIDs ($Quiz_lesson_id, $tp_id) {\n\t\t$Quiz_sql = \"SELECT * FROM `tme_question` WHERE `LessonID` = '$Quiz_lesson_id' AND `tpname` = '$tp_id' ORDER BY `order` ASC \";\n\t\t$Q_res_rows = mysql_query($Quiz_sql);\n\t\treturn $Q_res_rows;\n\t}", "public function get_questionReferences() {\n return $this->questionReferences;\n }", "function ipal_get_questions(){ \r\n \r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\tglobal $CFG;\r\n\t$q='';\t\r\n\t$pagearray2=array();\r\n\t // is there an quiz associated with an ipal?\r\n//\t$ipal_quiz=$DB->get_record('ipal_quiz',array('ipal_id'=>$ipal->id));\r\n\t\r\n\t// get quiz and put it into an array\r\n\t$quiz=$DB->get_record('ipal',array('id'=>$ipal->id));\r\n\t\r\n\t//Get the question ids\r\n\t$questions=explode(\",\",$quiz->questions);\r\n\t\r\n\t//get the questions and stuff them into an array\r\n\t\tforeach($questions as $q){\t\r\n\t\t\t\r\n\t\t $aquestions=$DB->get_record('question',array('id'=>$q));\r\n\t\t if(isset($aquestions->questiontext)){\r\n\t\t $pagearray2[]=array('id'=>$q, 'question'=>strip_tags($aquestions->questiontext), 'answers'=>ipal_get_answers($q));\r\n\t\t\t\t \r\n\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t}\r\n \r\n\treturn($pagearray2);\r\n\t}", "function ipal_get_answers_student($question_id){\r\n global $ipal;\r\n global $DB;\r\n global $CFG;\r\n\r\n\t$answerarray=array(); \r\n\t$line=\"\";\r\n\t$answers=$DB->get_records('question_answers',array('question'=>$question_id));\r\n\t\t\tforeach($answers as $answers){\r\n\t\t\t\t$answerarray[$answers->id]=$answers->answer; \r\n\t\t\t}\r\n\t\t\t\r\n\treturn($answerarray);\r\n}", "public function getResponsesId()\n\t{\n\t\t$prefix = $this->Db->TablePrefix;\n\t\t$query = \"\n\t\t\t\tSELECT id\n\t\t\t\tFROM {$prefix}surveys_response\n\t\t\t\tWHERE\n\t\t\t\t\tsurveys_id = {$this->id}\n\t\t\t\tORDER BY\n\t\t\t\t\tid\n\t\t\t\t;\";\n\n\t\t$result = $this->Db->Query($query);\n\n\t\t$return = array();\n\t\t$counter = 1;\n\t\twhile ($row = $this->Db->Fetch($result)) {\n\t\t\t$return[$counter] = $row['id'];\n\t\t\t$counter++;\n\t\t}\n\n\t\t// get a list of responses\n\t\treturn $return;\n\t}", "protected function GetPreviousQuestionIDs()\n {\n $previousQuesIds = array();\n $allQAs = $this->GetAllQAs();\n \n foreach ($allQAs as $qa)\n {\n $previousQuesIds[] = $qa->GetQuestionId();\n }\n \n return $previousQuesIds;\n }", "public static function getAllIds(): array\n {\n $dao = Dao::getInstance();\n\n $query = \"\n SELECT\n id\n FROM\n help\n ORDER BY id\n \";\n\n $stmt = $dao->prepare($query);\n\n $stmt->execute();\n\n $rows = [];\n while ($row = $stmt->fetch()) {\n $rows[] = $row['id'];\n }\n return $rows;\n }", "public function blocksIds($cursor = null, $stringifyIds = null)\n {\n\t// build parameters\n\t$parameters = null;\n\tif ($cursor != null) {\n\t $parameters['cursor'] = (string) $cursor;\n\t}\n\tif ($stringifyIds !== null) {\n\t $parameters['stringify_ids'] = ((bool) $stringifyIds) ? 'true' : 'false';\n\t}\n\n\t// make the call\n\treturn (array) $this->doCall(\n\t 'blocks/ids.json', $parameters, true\n\t);\n }", "public function claimquebyquestionid(){\n $select = $this->_db->select()\n\t ->from(array(CLAIM_QUESTIONS), array('*'))\n\t\t\t ->where(\"question_id='\".$this->getData['question_id'].\"'\"); //echo $select->__tostring(); die;\n\t $result = $this->getAdapter()->fetchAll($select);\n return $result;\n }", "function ipal_get_questions_student($qid){\r\n\r\n global $ipal;\r\n global $DB;\r\n global $CFG;\r\n\t\t$q='';\r\n\t\t$pagearray2=array();\r\n\t\t\r\n $aquestions=$DB->get_record('question',array('id'=>$qid));\r\n\t\t\tif($aquestions->questiontext != \"\"){ \r\n\r\n\t$pagearray2[]=array('id'=>$qid, 'question'=>$aquestions->questiontext, 'answers'=>ipal_get_answers_student($qid));\r\n\t\t\t\t\t\t\t}\r\n return($pagearray2);\r\n}", "Public function get_id_quetes()\n\t\t\t{\n\t\t\t\treturn $this->id_quetes;\n\t\t\t}", "function get_survey_questions($survey_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated survey answers\r\n $sql = \"SELECT id\r\n FROM questions\r\n WHERE is_active = '1' AND survey = '$survey_id';\";\r\n\r\n $questions_data = array();\r\n $questions = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $questions_data[$key] = $value;\r\n foreach ($questions_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $questions[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $questions;\r\n}", "public function PullNextQuestionID()\n {\n $questionID = 0;\n \n $foundNextQues = FALSE;\n $lvlQAs = $this->GetLvlQAs();\n \n for($index = 0; $index < count($lvlQAs) && !$foundNextQues; $index++)\n {\n $lvlQA = $lvlQAs[$index];\n \n if(!$lvlQA->IsAnswerIdSet())\n {\n $foundNextQues = TRUE;\n $questionID = $lvlQA->GetQuestionId();\n }\n }\n \n return $questionID;\n }", "public function getQuestions()\n {\n return DB::table('questionbank_quizzes')\n ->where('quize_id','=',$this->id)\n ->orderBy('subject_id')\n ->get();\n }", "function &getExistingQuestions() \n\t{\n\t\tglobal $ilDB;\n\t\t$existing_questions = array();\n\t\t$result = $ilDB->queryF(\"SELECT svy_question.original_id FROM svy_question, svy_svy_qst WHERE \" .\n\t\t\t\"svy_svy_qst.survey_fi = %s AND svy_svy_qst.question_fi = svy_question.question_id\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\twhile ($data = $ilDB->fetchAssoc($result)) \n\t\t{\n\t\t\tif($data[\"original_id\"])\n\t\t\t{\n\t\t\t\tarray_push($existing_questions, $data[\"original_id\"]);\n\t\t\t}\n\t\t}\n\t\treturn $existing_questions;\n\t}" ]
[ "0.74495643", "0.660526", "0.64386684", "0.6243731", "0.6138004", "0.5902933", "0.58422184", "0.58057606", "0.5746293", "0.56963265", "0.5694089", "0.5655538", "0.5608283", "0.5489107", "0.5458041", "0.54401386", "0.5422338", "0.5419407", "0.5407205", "0.5402217", "0.53504807", "0.53254783", "0.53170556", "0.5297826", "0.5297203", "0.52918935", "0.52615017", "0.5235155", "0.52222663", "0.52130556" ]
0.8004436
0
Returns the database row for a given question block
function getQuestionblock($questionblock_id) { global $ilDB; $result = $ilDB->queryF("SELECT * FROM svy_qblk WHERE questionblock_id = %s", array('integer'), array($questionblock_id) ); return $ilDB->fetchAssoc($result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _getQuestionblock($questionblock_id)\n\t{\n\t\tglobal $ilDB;\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_qblk WHERE questionblock_id = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($questionblock_id)\n\t\t);\n\t\t$row = $ilDB->fetchAssoc($result);\n\t\treturn $row;\n\t}", "function &getQuestionblockQuestions($questionblock_id)\n\t{\n\t\tglobal $ilDB;\n\t\t$titles = array();\n\t\t$result = $ilDB->queryF(\"SELECT svy_question.title, svy_qblk_qst.question_fi, svy_qblk_qst.survey_fi FROM \".\n\t\t\t\"svy_qblk, svy_qblk_qst, svy_question WHERE svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi AND \" .\n\t\t\t\"svy_question.question_id = svy_qblk_qst.question_fi AND svy_qblk.questionblock_id = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($questionblock_id)\n\t\t);\n\t\t$survey_id = \"\";\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\t$titles[$row[\"question_fi\"]] = $row[\"title\"];\n\t\t\t$survey_id = $row[\"survey_fi\"];\n\t\t}\n\t\t$result = $ilDB->queryF(\"SELECT question_fi, sequence FROM svy_svy_qst WHERE survey_fi = %s ORDER BY sequence\",\n\t\t\tarray('integer'),\n\t\t\tarray($survey_id)\n\t\t);\n\t\t$resultarray = array();\n\t\t$counter = 1;\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\tif (array_key_exists($row[\"question_fi\"], $titles))\n\t\t\t{\n\t\t\t\t$resultarray[$counter++] = $titles[$row[\"question_fi\"]];\n\t\t\t}\n\t\t}\n\t\treturn $resultarray;\n\t}", "function getQuestionRecord($question_id)\n {\n return QuestionBank::where('id','=',$question_id)->first();\n }", "function questionFromDatabase($greater){\n $query = $this->db->query('SELECT * FROM questions WHERE question_id =\"'.$greater.'\"');\n\t\tforeach ($query->result_array() as $row)\n {\n $data = array(\n 'question' => $row[\"question\"],\n 'path' => $row[\"path\"],\n 'question_id' => $row['question_id']\n \t);\n }\n return $data;\n\t}", "public function claimquebyquestionid(){\n $select = $this->_db->select()\n\t ->from(array(CLAIM_QUESTIONS), array('*'))\n\t\t\t ->where(\"question_id='\".$this->getData['question_id'].\"'\"); //echo $select->__tostring(); die;\n\t $result = $this->getAdapter()->fetchAll($select);\n return $result;\n }", "abstract public function getSpecificRow();", "public function readQuestion($Question){\n\n\n\t\t$Result = new Result();\t\n\t\t$Result = $this->_QuestionDAO->readQuestion($Question);\n\t\t\n\t\tif(!$Result->getIsSuccess())\n\t\t\t$Result->setResultObject(\"Database failure in QuestionDAO.readQuestion()\");\t\t\n\n\t\treturn $Result;\n\n\n\t}", "function insertQuestionblock($questionblock_id) \n\t{\n\t\tglobal $ilDB;\n\t\t$result = $ilDB->queryF(\"SELECT svy_qblk.title, svy_qblk.show_questiontext, svy_qblk.show_blocktitle,\".\n\t\t\t\" svy_qblk_qst.question_fi FROM svy_qblk, svy_qblk_qst, svy_svy_qst\".\n\t\t\t\" WHERE svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi\".\n\t\t\t\" AND svy_svy_qst.question_fi = svy_qblk_qst.question_fi\".\n\t\t\t\" AND svy_qblk.questionblock_id = %s\".\n\t\t\t\" ORDER BY svy_svy_qst.sequence\",\n\t\t\tarray('integer'),\n\t\t\tarray($questionblock_id)\n\t\t);\n\t\t$questions = array();\n\t\t$show_questiontext = 0;\n\t\t$show_blocktitle = 0;\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\t$duplicate_id = $this->duplicateQuestionForSurvey($row[\"question_fi\"]);\n\t\t\tarray_push($questions, $duplicate_id);\n\t\t\t$title = $row[\"title\"];\n\t\t\t$show_questiontext = $row[\"show_questiontext\"];\n\t\t\t$show_blocktitle = $row[\"show_blocktitle\"];\n\t\t}\n\t\t$this->createQuestionblock($title, $show_questiontext, $show_blocktitle, $questions);\n\t}", "public function get_row();", "function readOne(){\n $query = \"SELECT\n pantry_item_id, item_name\n FROM\n \" . $this->table_name . \"\n WHERE user_id = ?\";\n\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(1, $this->user_id);\n $stmt->execute();\n return $stmt;\n }", "public function getQuestionId()\r\n{\r\n $query_string = \"SELECT questionid FROM questions \";\r\n $query_string .= \"WHERE question = :question\";\r\n\r\n return $query_string;\r\n}", "function get_question() {\n $ci = & get_instance();\n //load databse library\n $ci->load->database();\n //get data from database\n $ci->db->select(\"*\");\n $ci->db->from('tbl_question_master');\n $query = $ci->db->get();\n if ($query->num_rows() > 0) {\n $result = $query->result();\n return $result;\n } else {\n return false;\n }\n }", "function getQuestionDetail($connection,$questionId){\n $query = \"SELECT * FROM forum_questions WHERE q_id='$questionId'\";\n $question = $connection->query($query);\n return $question;\n\n }", "function get_by_question($id)\n {\n $this->db->where($this->get_table_name() . '.question_id', $id);\n $this->db->join('self_assessment_questions', $this->get_table_name() . '.question_id = self_assessment_questions.question_id');\n\n return $this->db->get($this->get_table_name());\n }", "public function get_details($qid) {\n\t\t$query = $this -> db -> get_where('Question', array('questionID' => $qid));\n\t\treturn $query -> first_row();\n\t}", "function getQuestion($id){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//internal data. Same as GetInfo()\r\n\t\t$query= \"SELECT * FROM `tbl_question` WHERE `question_id` = $id LIMIT 1 ;\";\r\n\t\t$result = $this->mdb2->query($query) or die('An unknown error occurred while checking the data');\r\n\t\tif(MDB2::isError($result)){\r\n\t\t\treturn \"SelectError\";\r\n\t\t}else{\r\n\t\t\t$native_result = $result->getResource();\r\n\t\t\treturn $native_result;\t\t\t\t\t\t//Returns the question text\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//as a Mysql native result type.\r\n\t\t}\r\n\t}", "public function question()\n\t{\n\t\tif($db = $this->module->db())\n\t\t{\n\t\t\tif($result = $db->query(\"SELECT\n\t\t\t\ts_question\n\t\t\t\tFROM\n\t\t\t\t\".$db->getPrefix().\"faq\n\t\t\t\tWHERE\n\t\t\t\tid=\".$this->id.\";\"))\n\t\t\t{\n\t\t\t\twhile( $line = mysql_fetch_array( $result ) )\n\t\t\t\t{\n\t\t\t\t\treturn urldecode($line[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn NULL;\n\t}", "public function showQuestion(){\n $query = \"SELECT * FROM posts ORDER BY rand() limit 12\";\n if ($result = $this->dbobj->dbcon->query($query)) {\n $row = $result->fetch_all(MYSQLI_ASSOC);\n \n }\n else{\n echo \"Error\" .$this->dbobj->dbcon->error;\n }\n return $row;\n }", "public function read()\n {\n // Create query\n $query = '\n SELECT *\n FROM ' . $this->table . ' \n WHERE user_id = ?';\n \n // Prepare statement\n $stmt = $this->conn->prepare($query);\n\n // Bind ID\n $stmt->bindParam(1, $this->user_id);\n\n // Execute query\n $stmt->execute();\n\n return $stmt;\n }", "public function load($id){\n\t\t$sql = 'SELECT * FROM answer WHERE answerId = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "public function getRow()\n {\n return isset($this->row) ? $this->row : null;\n }", "function db_fetch_row($qid) {\n\n\treturn mysqli_fetch_row($qid);\n}", "public function getRow(){\n return $this->_row;\n }", "public function getQuestion()\r\n{\r\n $query_string = \"SELECT questionid, question, choice1, choice2, choice3, choice4, ans \";\r\n $query_string .= \"FROM questions \";\r\n $query_string .= \"WHERE questionid = :questionid\";\r\n\r\n return $query_string;\r\n}", "function read(){\n $query = \"SELECT\n pantry_item_id, item_name, user_id\n FROM\n \" . $this->table_name . \";\";\n\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n\n // execute query\n $stmt->execute();\n\n return $stmt;\n }", "public function createquestion($q,$b,$userid,$qid)\r\n {\r\n $con = new Connection();\r\n $conn = $con->getConnection();\r\n //$qid = $this->getRowCount(\"question\", $conn);\r\n \r\n $sql = \"INSERT INTO question(`question_id`, `exam_id`,`subject_id`, `node_id`,`question`,`created_date`)\r\n VALUES (\". $qid .\",\". $q->getExam_id() .\",\". $q->getSubject_id() .\",\". $q->getNode_id() .\",'\". $q->getQuestion() .\"',now())\";\r\n echo $sql;\r\n echo $userid;\r\n echo $qid;\r\n if (mysqli_query ( $conn, $sql )) {\r\n \r\n $sql = \"INSERT INTO block(`block_id`, `hash_of_blockid`,`id_of_previousblock`, `hash_of_previousblock`,`encrypted_data`,`hash_of_data`,`related_node`,`related_db`,`related_id`)\r\n VALUES (\".$userid.\"\". $qid .\",'\". $b->getHash_of_blockid() .\"',' ',' ','\".$b->getEncrypted_data().\"','\".$b->getHash_of_data().\"',' ',' ',' ')\";\r\n \r\n \r\n echo $sql;\r\n \r\n if (mysqli_query($conn, $sql)) {\r\n $result = array(\r\n \"status\" => \"success\"\r\n );\r\n return $result;\r\n } else {\r\n return \"Error: \" . $sql . \"<br>\" . mysqli_error ( $conn );\r\n }\r\n } else {\r\n return \"Error: \" . $sql . \"<br>\" . mysqli_error ( $conn );\r\n }\r\n \r\n mysqli_close ( $conn );\r\n }", "function getProblemRow($post_id, $table_name) {\n $conn = new my_mysql();\n $query = \"SELECT * FROM $table_name WHERE id='$post_id';\";\n $res = $conn->readQuery($query);\n if ($res) {\n $ret = $res->fetch_assoc();\n return $ret;\n }else {\n return false;\n }\n}", "public function get_row() {\n\t\tif (!isset($this->rows)) {\n\t\t\t$this->get_rows();\n\t\t}\n\t\t$value = current($this->rows);\n\t\tnext($this->rows);\n\t\treturn $value;\n\t}", "function getQuestionById($questionId){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT question, correctAnswer, wrongAnswer1, wrongAnswer2, wrongAnswer3 FROM Question WHERE id='\". $questionId . \"'\";\n\n\t\t$result = $conn->query($query);\n\n\t\tif($result->num_rows != 1){\n\t\t\techo \"Error selecting \" . $questionId . \" details\";\n\t\t}else{\n\t\t\treturn $result->fetch_assoc();\n\t\t}\n\n\t}", "function ques_get_marks($field, $exam_id)\r\n{\r\n include \"connect.inc.php\";\r\n\r\n $query = \"SELECT `$field` FROM `written_questions_full_marks` WHERE `exam_id`='$exam_id'\";\r\n if ($query_run = mysqli_query($con, $query)) {\r\n if ($row = mysqli_fetch_row($query_run)) {\r\n return $row[0];\r\n } else {\r\n\r\n }\r\n } else {\r\n echo \"There was a problem\";\r\n }\r\n}" ]
[ "0.75613815", "0.59266764", "0.58829737", "0.58575773", "0.57087487", "0.5691344", "0.5683966", "0.5666679", "0.5659089", "0.5601667", "0.55425185", "0.553884", "0.55361724", "0.5531035", "0.5467269", "0.5431499", "0.5424674", "0.5387767", "0.5387264", "0.5378758", "0.53688586", "0.53623515", "0.53550476", "0.5350824", "0.53322273", "0.53257686", "0.53206545", "0.5310753", "0.5304193", "0.530184" ]
0.7278639
1
Returns the database row for a given question block
function _getQuestionblock($questionblock_id) { global $ilDB; $result = $ilDB->queryF("SELECT * FROM svy_qblk WHERE questionblock_id = %s", array('integer'), array($questionblock_id) ); $row = $ilDB->fetchAssoc($result); return $row; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getQuestionblock($questionblock_id)\n\t{\n\t\tglobal $ilDB;\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_qblk WHERE questionblock_id = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($questionblock_id)\n\t\t);\n\t\treturn $ilDB->fetchAssoc($result);\n\t}", "function &getQuestionblockQuestions($questionblock_id)\n\t{\n\t\tglobal $ilDB;\n\t\t$titles = array();\n\t\t$result = $ilDB->queryF(\"SELECT svy_question.title, svy_qblk_qst.question_fi, svy_qblk_qst.survey_fi FROM \".\n\t\t\t\"svy_qblk, svy_qblk_qst, svy_question WHERE svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi AND \" .\n\t\t\t\"svy_question.question_id = svy_qblk_qst.question_fi AND svy_qblk.questionblock_id = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($questionblock_id)\n\t\t);\n\t\t$survey_id = \"\";\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\t$titles[$row[\"question_fi\"]] = $row[\"title\"];\n\t\t\t$survey_id = $row[\"survey_fi\"];\n\t\t}\n\t\t$result = $ilDB->queryF(\"SELECT question_fi, sequence FROM svy_svy_qst WHERE survey_fi = %s ORDER BY sequence\",\n\t\t\tarray('integer'),\n\t\t\tarray($survey_id)\n\t\t);\n\t\t$resultarray = array();\n\t\t$counter = 1;\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\tif (array_key_exists($row[\"question_fi\"], $titles))\n\t\t\t{\n\t\t\t\t$resultarray[$counter++] = $titles[$row[\"question_fi\"]];\n\t\t\t}\n\t\t}\n\t\treturn $resultarray;\n\t}", "function getQuestionRecord($question_id)\n {\n return QuestionBank::where('id','=',$question_id)->first();\n }", "function questionFromDatabase($greater){\n $query = $this->db->query('SELECT * FROM questions WHERE question_id =\"'.$greater.'\"');\n\t\tforeach ($query->result_array() as $row)\n {\n $data = array(\n 'question' => $row[\"question\"],\n 'path' => $row[\"path\"],\n 'question_id' => $row['question_id']\n \t);\n }\n return $data;\n\t}", "public function claimquebyquestionid(){\n $select = $this->_db->select()\n\t ->from(array(CLAIM_QUESTIONS), array('*'))\n\t\t\t ->where(\"question_id='\".$this->getData['question_id'].\"'\"); //echo $select->__tostring(); die;\n\t $result = $this->getAdapter()->fetchAll($select);\n return $result;\n }", "abstract public function getSpecificRow();", "public function readQuestion($Question){\n\n\n\t\t$Result = new Result();\t\n\t\t$Result = $this->_QuestionDAO->readQuestion($Question);\n\t\t\n\t\tif(!$Result->getIsSuccess())\n\t\t\t$Result->setResultObject(\"Database failure in QuestionDAO.readQuestion()\");\t\t\n\n\t\treturn $Result;\n\n\n\t}", "function insertQuestionblock($questionblock_id) \n\t{\n\t\tglobal $ilDB;\n\t\t$result = $ilDB->queryF(\"SELECT svy_qblk.title, svy_qblk.show_questiontext, svy_qblk.show_blocktitle,\".\n\t\t\t\" svy_qblk_qst.question_fi FROM svy_qblk, svy_qblk_qst, svy_svy_qst\".\n\t\t\t\" WHERE svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi\".\n\t\t\t\" AND svy_svy_qst.question_fi = svy_qblk_qst.question_fi\".\n\t\t\t\" AND svy_qblk.questionblock_id = %s\".\n\t\t\t\" ORDER BY svy_svy_qst.sequence\",\n\t\t\tarray('integer'),\n\t\t\tarray($questionblock_id)\n\t\t);\n\t\t$questions = array();\n\t\t$show_questiontext = 0;\n\t\t$show_blocktitle = 0;\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\t$duplicate_id = $this->duplicateQuestionForSurvey($row[\"question_fi\"]);\n\t\t\tarray_push($questions, $duplicate_id);\n\t\t\t$title = $row[\"title\"];\n\t\t\t$show_questiontext = $row[\"show_questiontext\"];\n\t\t\t$show_blocktitle = $row[\"show_blocktitle\"];\n\t\t}\n\t\t$this->createQuestionblock($title, $show_questiontext, $show_blocktitle, $questions);\n\t}", "public function get_row();", "function readOne(){\n $query = \"SELECT\n pantry_item_id, item_name\n FROM\n \" . $this->table_name . \"\n WHERE user_id = ?\";\n\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(1, $this->user_id);\n $stmt->execute();\n return $stmt;\n }", "public function getQuestionId()\r\n{\r\n $query_string = \"SELECT questionid FROM questions \";\r\n $query_string .= \"WHERE question = :question\";\r\n\r\n return $query_string;\r\n}", "function get_question() {\n $ci = & get_instance();\n //load databse library\n $ci->load->database();\n //get data from database\n $ci->db->select(\"*\");\n $ci->db->from('tbl_question_master');\n $query = $ci->db->get();\n if ($query->num_rows() > 0) {\n $result = $query->result();\n return $result;\n } else {\n return false;\n }\n }", "function getQuestionDetail($connection,$questionId){\n $query = \"SELECT * FROM forum_questions WHERE q_id='$questionId'\";\n $question = $connection->query($query);\n return $question;\n\n }", "function get_by_question($id)\n {\n $this->db->where($this->get_table_name() . '.question_id', $id);\n $this->db->join('self_assessment_questions', $this->get_table_name() . '.question_id = self_assessment_questions.question_id');\n\n return $this->db->get($this->get_table_name());\n }", "public function get_details($qid) {\n\t\t$query = $this -> db -> get_where('Question', array('questionID' => $qid));\n\t\treturn $query -> first_row();\n\t}", "function getQuestion($id){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//internal data. Same as GetInfo()\r\n\t\t$query= \"SELECT * FROM `tbl_question` WHERE `question_id` = $id LIMIT 1 ;\";\r\n\t\t$result = $this->mdb2->query($query) or die('An unknown error occurred while checking the data');\r\n\t\tif(MDB2::isError($result)){\r\n\t\t\treturn \"SelectError\";\r\n\t\t}else{\r\n\t\t\t$native_result = $result->getResource();\r\n\t\t\treturn $native_result;\t\t\t\t\t\t//Returns the question text\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//as a Mysql native result type.\r\n\t\t}\r\n\t}", "public function question()\n\t{\n\t\tif($db = $this->module->db())\n\t\t{\n\t\t\tif($result = $db->query(\"SELECT\n\t\t\t\ts_question\n\t\t\t\tFROM\n\t\t\t\t\".$db->getPrefix().\"faq\n\t\t\t\tWHERE\n\t\t\t\tid=\".$this->id.\";\"))\n\t\t\t{\n\t\t\t\twhile( $line = mysql_fetch_array( $result ) )\n\t\t\t\t{\n\t\t\t\t\treturn urldecode($line[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn NULL;\n\t}", "public function read()\n {\n // Create query\n $query = '\n SELECT *\n FROM ' . $this->table . ' \n WHERE user_id = ?';\n \n // Prepare statement\n $stmt = $this->conn->prepare($query);\n\n // Bind ID\n $stmt->bindParam(1, $this->user_id);\n\n // Execute query\n $stmt->execute();\n\n return $stmt;\n }", "public function showQuestion(){\n $query = \"SELECT * FROM posts ORDER BY rand() limit 12\";\n if ($result = $this->dbobj->dbcon->query($query)) {\n $row = $result->fetch_all(MYSQLI_ASSOC);\n \n }\n else{\n echo \"Error\" .$this->dbobj->dbcon->error;\n }\n return $row;\n }", "public function load($id){\n\t\t$sql = 'SELECT * FROM answer WHERE answerId = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "public function getRow()\n {\n return isset($this->row) ? $this->row : null;\n }", "function db_fetch_row($qid) {\n\n\treturn mysqli_fetch_row($qid);\n}", "public function getRow(){\n return $this->_row;\n }", "public function getQuestion()\r\n{\r\n $query_string = \"SELECT questionid, question, choice1, choice2, choice3, choice4, ans \";\r\n $query_string .= \"FROM questions \";\r\n $query_string .= \"WHERE questionid = :questionid\";\r\n\r\n return $query_string;\r\n}", "function read(){\n $query = \"SELECT\n pantry_item_id, item_name, user_id\n FROM\n \" . $this->table_name . \";\";\n\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n\n // execute query\n $stmt->execute();\n\n return $stmt;\n }", "public function createquestion($q,$b,$userid,$qid)\r\n {\r\n $con = new Connection();\r\n $conn = $con->getConnection();\r\n //$qid = $this->getRowCount(\"question\", $conn);\r\n \r\n $sql = \"INSERT INTO question(`question_id`, `exam_id`,`subject_id`, `node_id`,`question`,`created_date`)\r\n VALUES (\". $qid .\",\". $q->getExam_id() .\",\". $q->getSubject_id() .\",\". $q->getNode_id() .\",'\". $q->getQuestion() .\"',now())\";\r\n echo $sql;\r\n echo $userid;\r\n echo $qid;\r\n if (mysqli_query ( $conn, $sql )) {\r\n \r\n $sql = \"INSERT INTO block(`block_id`, `hash_of_blockid`,`id_of_previousblock`, `hash_of_previousblock`,`encrypted_data`,`hash_of_data`,`related_node`,`related_db`,`related_id`)\r\n VALUES (\".$userid.\"\". $qid .\",'\". $b->getHash_of_blockid() .\"',' ',' ','\".$b->getEncrypted_data().\"','\".$b->getHash_of_data().\"',' ',' ',' ')\";\r\n \r\n \r\n echo $sql;\r\n \r\n if (mysqli_query($conn, $sql)) {\r\n $result = array(\r\n \"status\" => \"success\"\r\n );\r\n return $result;\r\n } else {\r\n return \"Error: \" . $sql . \"<br>\" . mysqli_error ( $conn );\r\n }\r\n } else {\r\n return \"Error: \" . $sql . \"<br>\" . mysqli_error ( $conn );\r\n }\r\n \r\n mysqli_close ( $conn );\r\n }", "function getProblemRow($post_id, $table_name) {\n $conn = new my_mysql();\n $query = \"SELECT * FROM $table_name WHERE id='$post_id';\";\n $res = $conn->readQuery($query);\n if ($res) {\n $ret = $res->fetch_assoc();\n return $ret;\n }else {\n return false;\n }\n}", "public function get_row() {\n\t\tif (!isset($this->rows)) {\n\t\t\t$this->get_rows();\n\t\t}\n\t\t$value = current($this->rows);\n\t\tnext($this->rows);\n\t\treturn $value;\n\t}", "function getQuestionById($questionId){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT question, correctAnswer, wrongAnswer1, wrongAnswer2, wrongAnswer3 FROM Question WHERE id='\". $questionId . \"'\";\n\n\t\t$result = $conn->query($query);\n\n\t\tif($result->num_rows != 1){\n\t\t\techo \"Error selecting \" . $questionId . \" details\";\n\t\t}else{\n\t\t\treturn $result->fetch_assoc();\n\t\t}\n\n\t}", "function ques_get_marks($field, $exam_id)\r\n{\r\n include \"connect.inc.php\";\r\n\r\n $query = \"SELECT `$field` FROM `written_questions_full_marks` WHERE `exam_id`='$exam_id'\";\r\n if ($query_run = mysqli_query($con, $query)) {\r\n if ($row = mysqli_fetch_row($query_run)) {\r\n return $row[0];\r\n } else {\r\n\r\n }\r\n } else {\r\n echo \"There was a problem\";\r\n }\r\n}" ]
[ "0.72800034", "0.59280366", "0.5879325", "0.58544934", "0.57058764", "0.5691048", "0.5680256", "0.5665899", "0.5658975", "0.5601366", "0.55379295", "0.553576", "0.55320674", "0.55276793", "0.546271", "0.54279304", "0.54223394", "0.53877115", "0.5384596", "0.53764355", "0.5370652", "0.536049", "0.53562564", "0.5345528", "0.53321683", "0.5322595", "0.5319957", "0.5312682", "0.5300534", "0.53001755" ]
0.7563095
0
Adds a questionblock to the database
function _addQuestionblock($title = "", $owner = 0, $show_questiontext = true, $show_blocktitle = false) { global $ilDB; $next_id = $ilDB->nextId('svy_qblk'); $ilDB->manipulateF("INSERT INTO svy_qblk (questionblock_id, title, show_questiontext,". " show_blocktitle, owner_fi, tstamp) " . "VALUES (%s, %s, %s, %s, %s, %s)", array('integer','text','integer','integer','integer','integer'), array($next_id, $title, $show_questiontext, $show_blocktitle, $owner, time()) ); return $next_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertQuestionblock($questionblock_id) \n\t{\n\t\tglobal $ilDB;\n\t\t$result = $ilDB->queryF(\"SELECT svy_qblk.title, svy_qblk.show_questiontext, svy_qblk.show_blocktitle,\".\n\t\t\t\" svy_qblk_qst.question_fi FROM svy_qblk, svy_qblk_qst, svy_svy_qst\".\n\t\t\t\" WHERE svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi\".\n\t\t\t\" AND svy_svy_qst.question_fi = svy_qblk_qst.question_fi\".\n\t\t\t\" AND svy_qblk.questionblock_id = %s\".\n\t\t\t\" ORDER BY svy_svy_qst.sequence\",\n\t\t\tarray('integer'),\n\t\t\tarray($questionblock_id)\n\t\t);\n\t\t$questions = array();\n\t\t$show_questiontext = 0;\n\t\t$show_blocktitle = 0;\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\t$duplicate_id = $this->duplicateQuestionForSurvey($row[\"question_fi\"]);\n\t\t\tarray_push($questions, $duplicate_id);\n\t\t\t$title = $row[\"title\"];\n\t\t\t$show_questiontext = $row[\"show_questiontext\"];\n\t\t\t$show_blocktitle = $row[\"show_blocktitle\"];\n\t\t}\n\t\t$this->createQuestionblock($title, $show_questiontext, $show_blocktitle, $questions);\n\t}", "public function insertQuestionBlock($a_block_id)\n\t{\n\t\t$new_ids = array();\n\t\t$question_ids = $this->object->getQuestionblockQuestionIds($a_block_id);\n\t\tforeach($question_ids as $qid)\n\t\t{\n\t\t\t$new_ids[] = $this->appendNewQuestionToSurvey($qid, true, true);\n\t\t}\n\t\t\n\t\tif(sizeof($new_ids))\n\t\t{\n\t\t\t$this->object->loadQuestionsFromDb();\n\t\t\t\n\t\t\t$pos = $_REQUEST[\"pgov_pos\"];\n\t\t\n\t\t\t// a[fter]/b[efore] on same page\n\t\t\tif(substr($pos, -1) != \"c\")\n\t\t\t{\n\t\t\t\t// block handling\n\t\t\t\t$current = $this->object->getSurveyPages();\n\t\t\t\t$current = $current[$this->current_page-1];\n\t\t\t\tif(sizeof($current) == 1)\n\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// as questions are moved to first block question\n\t\t\t\t\t// always use existing as first\n\t\t\t\t\t// the new question is moved later on (see below)\n\t\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t\tarray((int)$pos)+$new_ids);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$block_id = array_pop($current);\n\t\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t\tforeach($new_ids as $qid)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->object->addQuestionToBlock($qid, $block_id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// c: as new page (from toolbar/pool)\n\t\t\telse\n\t\t\t{\n\t\t\t\t// re-create block\n\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t$new_ids);\n\t\t\t\t\n\t\t\t\t// after given question\n\t\t\t\tif((int)$pos)\n\t\t\t\t{\n\t\t\t\t\t$pos = (int)$pos.\"a\";\n\t\t\t\t}\n\t\t\t\t// at the beginning\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$first = $this->object->getSurveyPages();\n\t\t\t\t\t$first = $first[0];\n\t\t\t\t\t$first = array_shift($first);\n\t\t\t\t\t$pos = $first[\"question_id\"].\"b\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move to target position\n\t\t\t$this->object->moveQuestions($new_ids, (int)$pos,\n\t\t\t\t((substr($pos, -1) == \"a\") ? 1 : 0));\t\t\t\n\t\t}\n\t}", "public function createquestion($q,$b,$userid,$qid)\r\n {\r\n $con = new Connection();\r\n $conn = $con->getConnection();\r\n //$qid = $this->getRowCount(\"question\", $conn);\r\n \r\n $sql = \"INSERT INTO question(`question_id`, `exam_id`,`subject_id`, `node_id`,`question`,`created_date`)\r\n VALUES (\". $qid .\",\". $q->getExam_id() .\",\". $q->getSubject_id() .\",\". $q->getNode_id() .\",'\". $q->getQuestion() .\"',now())\";\r\n echo $sql;\r\n echo $userid;\r\n echo $qid;\r\n if (mysqli_query ( $conn, $sql )) {\r\n \r\n $sql = \"INSERT INTO block(`block_id`, `hash_of_blockid`,`id_of_previousblock`, `hash_of_previousblock`,`encrypted_data`,`hash_of_data`,`related_node`,`related_db`,`related_id`)\r\n VALUES (\".$userid.\"\". $qid .\",'\". $b->getHash_of_blockid() .\"',' ',' ','\".$b->getEncrypted_data().\"','\".$b->getHash_of_data().\"',' ',' ',' ')\";\r\n \r\n \r\n echo $sql;\r\n \r\n if (mysqli_query($conn, $sql)) {\r\n $result = array(\r\n \"status\" => \"success\"\r\n );\r\n return $result;\r\n } else {\r\n return \"Error: \" . $sql . \"<br>\" . mysqli_error ( $conn );\r\n }\r\n } else {\r\n return \"Error: \" . $sql . \"<br>\" . mysqli_error ( $conn );\r\n }\r\n \r\n mysqli_close ( $conn );\r\n }", "function createQuestionblock($title, $show_questiontext, $show_blocktitle, $questions)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t// if the selected questions are not in a continous selection, move all questions of the\n\t\t// questionblock at the position of the first selected question\n\t\t$this->moveQuestions($questions, $questions[0], 0);\n\t\t\n\t\t// now save the question block\n\t\tglobal $ilUser;\n\t\t$next_id = $ilDB->nextId('svy_qblk');\n\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_qblk (questionblock_id, title, show_questiontext,\".\n\t\t\t\" show_blocktitle, owner_fi, tstamp) VALUES (%s, %s, %s, %s, %s, %s)\",\n\t\t\tarray('integer','text','text','text','integer','integer'),\n\t\t\tarray($next_id, $title, $show_questiontext, $show_blocktitle, $ilUser->getId(), time())\n\t\t);\n\t\tif ($affectedRows)\n\t\t{\n\t\t\t$questionblock_id = $next_id;\n\t\t\tforeach ($questions as $index)\n\t\t\t{\n\t\t\t\t$next_id = $ilDB->nextId('svy_qblk_qst');\n\t\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_qblk_qst (qblk_qst_id, survey_fi, questionblock_fi, \" .\n\t\t\t\t\t\"question_fi) VALUES (%s, %s, %s, %s)\",\n\t\t\t\t\tarray('integer','integer','integer','integer'),\n\t\t\t\t\tarray($next_id, $this->getSurveyId(), $questionblock_id, $index)\n\t\t\t\t);\n\t\t\t\t$this->deleteConstraints($index);\n\t\t\t}\n\t\t}\n\t}", "private function addQuestion() : void\n {\n $question = $this->console->ask(__('Type your question'));\n\n $this->console->info('Question successfully added ');\n\n $answer = $this->console->ask(__('Type your answer'));\n\n $this->console->info('Answer successfully added ');\n\n $this->questionRepository->create([\n 'question' => $question,\n 'valid_answer' => $answer,\n ]);\n }", "public function addnewclaimquestion(){\n\tif(isset($this->getData['opertaors']) && !empty($this->getData['opertaors'])){\n\t $operators = commonfunction::implod_array($this->getData['opertaors']);\n\t}\n\telse{\n\t $operators = '';\n \t}\n\tif($this->getData['question_type']=='file'){\n\t $file_upload = 1;\n\t}else{\n\t $file_upload = 0;\n\t}\n\t$question_options ='';\n\tif($this->getData['question_type']=='select' || $this->getData['question_type']=='radio'){\n\t foreach($this->getData['questionoption'] as $key=>$que_option){\n\t\t$que_value = $this->getData['questionvalue'][$key];\n\t\t$question_options .= $que_option.'|'.$que_value.';';\n\t }\n\t}\n\tif(isset($this->getData['subquestion_a']) && $this->getData['subquestion_a']!=''){\n\t $sub_question = isset($this->getData['subquestion_a'])?$this->getData['subquestion_a']:'';\n\t $sub_que_option = isset($this->getData['subquestion_option_a'])?$this->getData['subquestion_option_a']:'';\n\t}else{\n\t $sub_question = isset($this->getData['subquestion'])?$this->getData['subquestion']:'';\n\t $sub_que_option = isset($this->getData['subquestion_option'])?$this->getData['subquestion_option']:'';\n\t}\n\t$lastinserted_id = $this->insertInToTable(CLAIM_QUESTIONS, array(array('sub_question'=>$sub_question,'sub_question_option'=>$sub_que_option,'question_type'=>$this->getData['question_type'],'question'=>$this->getData['question'],'question_options'=>$question_options,'operators'=>$operators,'file_upload'=>$file_upload,'status'=>$this->getData['claim_status'],'created_by'=>$this->Useconfig['user_id'],'created_ip'=>commonfunction::loggedinIP())));\n\treturn $lastinserted_id;\n }", "function addQuestion() {\n //SELECT QuestionNumber FROM BoothQuestions ORDER BY QuestionNumber DESC LIMIT 1\n $dbConnection = new mysqli('student.cs.appstate.edu', 'haithcockce', '900431409', 'QQuizzer');\n $result = mysqli_query($dbConnection, 'SELECT QuestionNumber FROM BoothQuestions \n ORDER BY QuestionNumber DESC LIMIT 1');\n $questionNumber = (mysqli_num_rows($result) == 0 ? 0 : mysqli_fetch_row($result));\n if ($questionNumber != 0) $questionNumber = $questionNumber[0];\n $questionNumber++;\n $result = mysqli_query($dbConnection, 'INSERT INTO BoothQuestions (BoothName, QuestionNumber) \n VALUES (\"'.$_POST['booth'].'\", \"'.$questionNumber.'\")');\n if (!$result) {\n echo 'failed to insert into BoothQuestions';\n exit;\n }\n $fromArray = implode('|$|', $_POST['answers']);\n $result = mysqli_query($dbConnection, 'INSERT INTO Questions \n (QuestionNumber, Question, CorrectAnswer, PossibleAnswers, Shuffle) \n VALUES \n (\"'.$questionNumber.'\", \"'.$_POST['question'].'\", \"'.$_POST['correct'].'\", \"'.$fromArray.'\", \"0\")');\n if (!$result) {\n $questionCheck = mysqli_num_rows(mysqli_query($dbConnection, 'SELECT Question FROM Questions\n WHERE Question=\"'.$_POST['question'].'\"')); \n if ($questionCheck == 1) echo 'found question';\n else echo 'failed to insert into Questions';\n exit;\n }\n echo 'success';\n \n }", "function addQuestion( $page, $question )\n\t{\n\t\ttry\n\t\t{\n\t\t\t$db = DB::getConnection();\n\t\t\t$st = $db->prepare( 'INSERT INTO questions(question) VALUES(:question)' );\n\t\t\t$st->execute( array( 'question' => $question ) );\n\t\t}\n\t\tcatch( PDOException $e ) { exit( 'PDO error ' . $e->getMessage() ); }\n\n\t\t//napravi tablicu\n\t\ttry\n\t\t{\n\t\t\t$st = $db->prepare(\n\t\t\t\t'CREATE TABLE IF NOT EXISTS page_'. $page .' (' .\n\t\t\t\t'id_user int NOT NULL,' .\n\t\t\t\t'username varchar(20) NOT NULL, ' .\n\t\t\t\t'answer varchar(255) NOT NULL )'\n\t\t\t);\n\t\t\t$st->execute();\n\t\t}\n\t\tcatch( PDOException $e ) { exit( \"PDO error #2: \" . $e->getMessage() ); }\n\n\t\treturn true;\n\t}", "function addQuestionToQuiz($qid,$question,$conn)\n {\n // Insert into particular table and get that xid based on type\n $xid = insertParticularQuestionToQuiz($question,$conn); \n\n if($xid==-1)\n {\n return 0;\n }\n\n $type = getQuestionTypeInt($question['type']);\n $marks = $question['mark'];\n \n $stmt = $conn->prepare(\"INSERT INTO Questions(type,xid,marks,qid)VALUES (?, ?, ?, ?)\");\n\n $stmt->bind_param(\"iiii\",$type,$xid,$marks,$qid);\n \n\n if ($stmt->execute() === TRUE) \n {\n return 1;\n } \n else \n {\n return 0;\n }\n }", "public function newQuestion($question, $connection) {\r\n\t\t$connection -> exec(\"INSERT INTO `\".$GLOBALS['dbPrefix'].\"question_question` (`set`, `question`, `mode`) VALUES (\" . $this -> setid . \", '\" . $question -> getQuestion() . \"', '\" . $question -> getMode() . \"')\");\r\n\t\t$question -> setId($connection -> lastInsertId());\r\n\t\tarray_push($this -> questions, $question);\r\n\t}", "public function addQuestion($question) {\r\n\t\tarray_push($this -> questions, $question);\r\n\t}", "public static function NEW_AREA_BLOCK(){\n\t $SQL_String = \"INSERT INTO area_block VALUES(NULL,:am_id,'new','新增子區','','',:area_load,:accept_max_day,:accept_min_day,:wait_list,'[]',\t:editor,NULL,1,1)\";\n\t return $SQL_String;\n\t}", "public function insertNewQuestion($a_new_id)\n\t{\n\t\tglobal $rbacsystem, $ilDB, $lng;\n\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\tif (!SurveyQuestion::_isComplete($a_new_id))\n\t\t{\n\t\t\tilUtil::sendFailure($lng->txt(\"survey_error_insert_incomplete_question\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$a_new_id = $this->appendNewQuestionToSurvey($a_new_id);\n\t\t\t$this->object->loadQuestionsFromDb();\n\n\t\t\t$pos = $_REQUEST[\"pgov_pos\"];\n\n\t\t\t// a[fter]/b[efore] on same page\n\t\t\tif(substr($pos, -1) != \"c\")\n\t\t\t{\n\t\t\t\t// block handling\n\t\t\t\t$current = $this->object->getSurveyPages();\n\t\t\t\t$current = $current[$this->current_page-1];\n\t\t\t\tif(sizeof($current) == 1)\n\t\t\t\t{\n\t\t\t\t\t// as questions are moved to first block question\n\t\t\t\t\t// always use existing as first\n\t\t\t\t\t// the new question is moved later on (see below)\n\t\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t\tarray((int)$pos, $a_new_id));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$block_id = array_pop($current);\n\t\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t\t$this->object->addQuestionToBlock($a_new_id, $block_id);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// c: as new page (from toolbar/pool)\n\t\t\telse\n\t\t\t{\n\t\t\t\t// after given question\n\t\t\t\tif((int)$pos)\n\t\t\t\t{\n\t\t\t\t\t$pos = (int)$pos.\"a\";\n\t\t\t\t\t$this->current_page++;\n\t\t\t\t}\n\t\t\t\t// at the beginning\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$first = $this->object->getSurveyPages();\n\t\t\t\t\t$first = $first[0];\n\t\t\t\t\t$first = array_shift($first);\n\t\t\t\t\t$pos = $first[\"question_id\"].\"b\";\n\t\t\t\t\t$this->current_page = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move to target position\n\t\t\t$this->object->moveQuestions(array($a_new_id), (int)$pos,\n\t\t\t\t((substr($pos, -1) == \"a\") ? 1 : 0));\n\t\t}\n\t}", "public function add($question, $answer)\n\t{\n\t\tif($db = $this->module->db())\n\t\t{\n\t\t\tif($result = $db->query(\"INSERT INTO\n\t\t\t\t\".$db->getPrefix().\"faq(s_question, s_answer)\n\t\t\t\tVALUES( '\".$question.\"', '\".$answer.\"');\"))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function addBlock($userId, $chapterId, $block) {\r\n // pull in the database from the controller\r\n global $db;\r\n \r\n try {\r\n \r\n // the sql query ready to be turned into a prepared statement using the values\r\n $query = 'INSERT INTO blocks\r\n (user_id, chapter_id, block)\r\n VALUES\r\n (:userId, :chapterId, :block)';\r\n \r\n // use the prepared statement by binding/matching the feilds from the form - passed \r\n // in via the parameters - to the values in our sql query\r\n $stmt = $db->prepare($query);\r\n $stmt->bindValue(':userId', $userId);\r\n $stmt->bindValue(':chapterId', $chapterId);\r\n $stmt->bindValue(':block', $block);\r\n $stmt->execute();\r\n $insertId = $db->lastInsertId(); // get and return the last ID that was generated\r\n $stmt->closeCursor();\r\n\r\n return $insertId;\r\n } catch (PDOException $e) {\r\n # $error_message = $e->getMessage();\r\n # display_db_error($error_message);\r\n return 0;\r\n }\r\n}", "public function addQuestionAndAnswers () {\n global $tpl, $ilTabs;\n $ilTabs->activateTab(\"editQuiz\");\n $this->initAddQuestionAndAnswersForm();\n }", "public function addNewSectionQuestion()\n {\n if($this->check_session()){\n $this->form_validation->set_rules('sections', 'Section', 'required');\n $this->form_validation->set_rules('newSectionQues', 'Question', 'required');\n \n if($this->form_validation->run()){\n $formData = ['ex_section_question' => html_escape($this->input->post('newSectionQues')),\n 'ex_sections_id' => $this->input->post('sections')];\n $this->Admin_model->addNewSectionQuestion($formData);\n $this->getSectionQuestionsTable($this->input->post('sections'));\n }else{\n\n }\n }\n }", "public function add() {\n if ($this->id == 0) {\n $reponse = $this->bdd->prepare('INSERT INTO chapitres SET title = :title, body = :body');\n $reponse->execute([\n 'body'=>$this->body, \n 'title'=>$this->title\n ]);\n }\n }", "public function addQuestion($question)\n {\n $this->questions[] = $question;\n }", "function addQuestion($question_id)\n\t{\n\t\tarray_push($this->questions, $question_id);\n\t}", "function AddQuestion($data){\n $this->db->escape($data);\n $this->db->insert($this->questions,$data);\n }", "public function ask_add($author_id, $answer, $title = '', $id_quest=-1)\n\t{\n\t\t$sql = \"INSERT INTO \".$this->table_ask.\"(id_quest, title, text, date, author_id) VALUES(?, ?, ?, ?, ?)\";\n\t\t$data = array($id_quest, $title, $answer, time(), $author_id);\n\t\t$query = $this->db->query($sql, $data);\t\n\t}", "function addAnswer($research_id,$UID,$question_id,$time,$answer){\r\n\t\t//Check correct query to add answer\r\n\t\t$q = new Question(0,$question_id);\r\n\t\t$query_id = $q->getOwner();\r\n\t\tif(isset($query_id)){\r\n\t\t\t$this->dbq->addAnswer($research_id,$UID,$query_id,$question_id,$time,$answer);\r\n\t\t}\r\n\t}", "public function add_question($id)\n {\n $this->question_ids[] = $id;\n }", "public function createAnswer()\n {\n $this->is_answer = true;\n $this->topic->is_answered = true;\n $post = $this;\n\n Db::transaction(function() use ($post)\n {\n $post->topic->save();\n $post->save();\n });\n }", "public function run()\n {\n $questao = Question::where('id', 1)->first();\n\n $answer = new Answer();\n $answer->a = 'r1';\n $answer->b = 'r2';\n $answer->c = 'r3';\n $answer->is_correct = 'a';\n //$answer->questions()->attach($questao);\n $answer->save();\n $answer->questions()->attach($questao); \n \n }", "public function addQuestionAction()\n {\n\n if($this->UserauthenticationController->isAuthenticated()) {\n \n $form = new \\Mos\\HTMLForm\\CForm(array(), array(\n 'title' => array(\n 'type' => 'text',\n 'label' => 'Rubrik:',\n 'required' => true,\n 'validation' => array('not_empty'),\n ), \n 'text' => array(\n 'type' => 'textarea',\n 'label' => 'Text:',\n 'required' => true,\n 'validation' => array('not_empty'),\n ), \n 'tags' => array(\n 'type' => 'text',\n 'label' => 'Taggar (separeras med kommatecken):',\n 'required' => true,\n 'validation' => array('not_empty'),\n ), \n 'submit' => array(\n 'type' => 'submit',\n 'value' => 'Publicera fråga',\n 'callback' => function($form) {\n return true;\n }\n ),\n )\n );\n \n // Check the status of the form\n $status = $form->Check();\n \n // What to do if the form was submitted\n if($status === true) {\n \n $now = gmdate('Y-m-d H:i:s');\n \n $sql = \"INSERT INTO mvc_comments (commentTypeId, userId, userAcronym, userEmail, title, text, created) VALUES ('1', '\" . $_SESSION['user']->id . \"', '\" . $_SESSION['user']->acronym . \"', '\" . $_SESSION['user']->email . \"', '\" . $form->Value('title') . \"', '\" . $form->Value('text') . \"', '\" . $now . \"')\";\n $res = $this->db->executeFetchAll($sql);\n $qid = $this->db->lastInsertId();\n \n // Separate the defined tags for this question.\n $tagsSep = explode(\",\", strtolower($form->Value('tags')));\n foreach ($tagsSep as $key => $val) {\n if (!$this->tagExistAction($val)) {\n $trimmed = trim($val);\n $sql = \"INSERT INTO mvc_tag (name) VALUES (?)\";\n $res = $this->db->executeFetchAll($sql,array($trimmed));\n $tagId = $this->db->lastInsertId();\n }\n else {\n $tagId = $this->getTagIdAction($val);\n }\n $sql = \"INSERT INTO mvc_tag2question (idQuestion, idTag) VALUES (?, ?)\";\n $res = $this->db->executeFetchAll($sql,array($qid, $tagId));\n }\n \n $url = $this->url->create('') . '/question/view/' . $qid;\n $this->response->redirect($url);\n }\n \n // What to do when form could not be processed\n else if($status === false){\n header(\"Location: \" . $_SERVER['PHP_SELF']);\n }\n \n $this->theme->setTitle(\"Skapa en ny fråga\");\n \n $this->views->add('comment/form', [\n 'title' => \"Skapa en ny fråga\",\n 'content' => $form->getHTML()\n ]);\n \n }\n }", "public function add()\r\n {\r\n $this->start();\r\n $this->write_to_db();\r\n }", "function insertParticularQuestionToQuiz($question,$conn)\n {\n if($question['type']==\"radio\")\n {\n return insertRadioQuestion($question,$conn);\n }\n if($question['type']==\"checkbox\")\n {\n return insertCheckboxQuestion($question,$conn);\n }\n else if($question[\"type\"]==\"loose_text\" || $question[\"type\"]==\"strict_text\")\n {\n return insertTextQuestion($question,$conn);\n }\n return -1;\n }", "function saveQuestion($questionType) {\n $conn = getDBConnection();\n mysqli_autocommit($conn,FALSE);\n\n if($questionType == FRAGENTYP_TEXTFRAGE) {\n // Textfrage speichern\n $title = mysqli_real_escape_string($conn,$_POST['txtQuestionTitle']);\n $text = mysqli_real_escape_string($conn,$_POST['txtQuestionText']);\n $answer = mysqli_real_escape_string($conn,$_POST['txtAnswer']);\n\n if($title != \"\" && $text != \"\" && $answer != \"\") {\n $poolId = getQuestionPoolId(getChapterId($_SESSION['lectureToAddQuestion'], $_SESSION['chapterToAddQuestion']));\n\n $queryQuestion = \"INSERT INTO \" . FRAGE . \" VALUES (NULL, '$title','$text',$poolId,'$questionType');\";\n mysqli_query($conn, $queryQuestion);\n\n $queryID = \"SELECT \" . FRAGE_FrID . \" FROM \" . FRAGE . \" WHERE \" . FRAGE_FrBezeichnung . \" = '$title' AND \" . FRAGE_FPID . \" = $poolId\";\n $getID = mysqli_fetch_assoc(mysqli_query($conn, $queryID));\n $FrID = $getID[FRAGE_FrID];\n\n $queryAnswer = \"INSERT INTO \" . ANTWORT . \" VALUES ($FrID, '$answer', \" . SHORT_FALSE . \", 0);\";\n mysqli_query($conn, $queryAnswer);\n\n if($queryAnswer && $queryID) {\n echo \"<p>Frage '$title' erfolgreich zum Kapitel '\" . $_SESSION['chapterToAddQuestion'] . \"' hinzugefügt!</p>\";\n mysqli_commit($conn);\n } else {\n echo \"<p>Fehler beim Speichern der Frage. Die Änderungen werden rückgängig gemacht.</p>\";\n mysqli_rollback($conn);\n }\n } else {\n echo \"<p>Unvollständige Angaben. Die Frage wurde nicht gespeichert.</p>\";\n }\n\n } else if ($questionType == FRAGENTYP_MULTIPLE_CHOICE) {\n // Multiple Choice Frage speichern\n $title = $_POST['txtQuestionTitleMC'];\n $text = $_POST['txtQuestionTextMC'];\n //$answers[] = $_POST['txtAnswers'];\n\n $answers = $_POST['txtAnswers'];\n\n $poolId = getQuestionPoolId(getChapterId($_SESSION['lectureToAddQuestion'], $_SESSION['chapterToAddQuestion']));\n $queryQuestion = \"INSERT INTO \" . FRAGE . \" VALUES (NULL, '$title','$text',$poolId,'$questionType');\";\n\n // Kontrolle, ob alle Antworten eingefügt wurden\n $failedQuestions = 0;\n\n if(mysqli_query($conn, $queryQuestion)) {\n for($i = 0; $i < count($answers); $i++) {\n $text = mysqli_real_escape_string($conn,$_POST['txtAnswers'][$i]);\n $bool = mysqli_real_escape_string($conn,$_POST['txtTrueFalse'][$i]);\n\n if($bool == STRING_TRUE) {\n $bool = SHORT_TRUE;\n } else {\n $bool = SHORT_FALSE;\n }\n\n $query = \"SELECT \" . FRAGE_FrID . \" FROM \" . FRAGE . \" WHERE \" . FRAGE_FrBezeichnung . \" = '$title' AND \" . FRAGE_FPID . \" = $poolId\";\n $getID = mysqli_fetch_assoc(mysqli_query($conn, $query));\n $FrID = $getID[FRAGE_FrID];\n\n $queryAnswer = \"INSERT INTO \" . ANTWORT . \" VALUES ($FrID, '$text', '$bool', $i);\";\n\n if(mysqli_query($conn, $queryAnswer)) {\n echo \"<p>Antwort '$text' wurde der Frage hinzugefügt.</p>\";\n } else {\n $failedQuestions++;\n }\n if($failedQuestions > 0 && $i == count($answers) -1) {\n echo \"<p>Fehler beim Speichern aufgetreten. Die Änderungen werden rückgängig gemacht.</p>\";\n mysqli_rollback($conn);\n } else {\n if($i == count($answers) -1) {\n echo \"<p>Frage '$title' erfolgreich zum Kapitel '\" . $_SESSION['chapterToAddQuestion'] . \"' hinzugefügt!</p>\";\n }\n mysqli_commit($conn);\n }\n }\n } else {\n echo \"<p>Fehler beim Speichern der Frage. Der Eintrag wurde rückgängig gemacht.</p>\";\n }\n } else {\n echo '<p>Ungültiger Fragentyp!</p>';\n }\n}" ]
[ "0.68993133", "0.68234676", "0.647685", "0.6348897", "0.61175936", "0.59939474", "0.5898799", "0.5874287", "0.5863247", "0.5854341", "0.58190054", "0.5786872", "0.57855475", "0.5754912", "0.5753279", "0.57333577", "0.57237875", "0.57237095", "0.57160264", "0.5712088", "0.5698426", "0.5646875", "0.5611839", "0.55535823", "0.553462", "0.55166084", "0.5499736", "0.5464162", "0.54598737", "0.5451714" ]
0.6913594
0
Creates a question block for the survey
function createQuestionblock($title, $show_questiontext, $show_blocktitle, $questions) { global $ilDB; // if the selected questions are not in a continous selection, move all questions of the // questionblock at the position of the first selected question $this->moveQuestions($questions, $questions[0], 0); // now save the question block global $ilUser; $next_id = $ilDB->nextId('svy_qblk'); $affectedRows = $ilDB->manipulateF("INSERT INTO svy_qblk (questionblock_id, title, show_questiontext,". " show_blocktitle, owner_fi, tstamp) VALUES (%s, %s, %s, %s, %s, %s)", array('integer','text','text','text','integer','integer'), array($next_id, $title, $show_questiontext, $show_blocktitle, $ilUser->getId(), time()) ); if ($affectedRows) { $questionblock_id = $next_id; foreach ($questions as $index) { $next_id = $ilDB->nextId('svy_qblk_qst'); $affectedRows = $ilDB->manipulateF("INSERT INTO svy_qblk_qst (qblk_qst_id, survey_fi, questionblock_fi, " . "question_fi) VALUES (%s, %s, %s, %s)", array('integer','integer','integer','integer'), array($next_id, $this->getSurveyId(), $questionblock_id, $index) ); $this->deleteConstraints($index); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function view() {\n\t\t//Note that we don't call parent::view(), because built-in form block controller doesn't have one(!!)\n\t\t\n\t\t$miniSurvey = new MiniSurvey();\n\t\t$miniSurvey->frontEndMode = true;\n\n\t\t$bID = intval($this->bID);\n\t\t$qsID = intval($this->questionSetId);\n\t\t\n\t\t$formDomId = \"miniSurveyView{$bID}\";\n\t\t$hasFileUpload = false;\n\n\t\t$questionsRS = $miniSurvey->loadQuestions($qsID, $bID);\n\t\t$questions = array();\n\t\twhile ($questionRow = $questionsRS->fetchRow()) {\n\t\t\t$question = $questionRow;\n\t\t\t$question['input'] = $miniSurvey->loadInputType($questionRow, false);\n\t\t\tif ($questionRow['inputType'] == 'fileupload') {\n\t\t\t\t$hasFileUpload = true;\n\t\t\t}\n\t\n\t\t\t//Make type names common-sensical\n\t\t\tif ($questionRow['inputType'] == 'text') {\n\t\t\t\t$question['type'] = 'textarea';\n\t\t\t} else if ($questionRow['inputType'] == 'field') {\n\t\t\t\t$question['type'] = 'text';\n\t\t\t} else {\n\t\t\t\t$question['type'] = $questionRow['inputType'];\n\t\t\t}\n\t\n\t\t\t//Construct label \"for\" (and misc. hackery for checkboxlist / radio lists)\n\t\t\tif ($question['type'] == 'checkboxlist') {\n\t\t\t\t$question['input'] = str_replace('<div class=\"checkboxPair\">', '<div class=\"checkboxPair\"><label>', $question['input']);\n\t\t\t\t$question['input'] = str_replace(\"</div>\\n\", \"</label></div>\\n\", $question['input']); //include linebreak in find/replace string so we don't replace the very last closing </div> (the one that closes the \"checkboxList\" wrapper div that's around this whole question)\n\t\t\t} else if ($question['type'] == 'radios') {\n\t\t\t\t//Put labels around each radio items (super hacky string replacement -- this might break in future versions of C5)\n\t\t\t\t$question['input'] = str_replace('<div class=\"radioPair\">', '<div class=\"radioPair\"><label>', $question['input']);\n\t\t\t\t$question['input'] = str_replace('</div>', '</label></div>', $question['input']);\n\t\t\n\t\t\t\t//Make radioList wrapper consistent with checkboxList wrapper\n\t\t\t\t$question['input'] = \"<div class=\\\"radioList\\\">\\n{$question['input']}\\n</div>\\n\";\n\t\t\t} else {\n\t\t\t\t$question['labelFor'] = 'for=\"Question' . $questionRow['msqID'] . '\"';\n\t\t\t}\n\t\n\t\t\t//Remove hardcoded style on textareas\n\t\t\tif ($question['type'] == 'textarea') {\n\t\t\t\t$question['input'] = str_replace('style=\"width:95%\"', '', $question['input']);\n\t\t\t}\n\t\n\t\t\t//Add placeholder attributes\n\t\t\tif ($this->enablePlaceholders) {\n\t\t\t\t$search = 'id=\"Question';\n\t\t\t\t$replace = 'placeholder=\"' . $question['question'] . ($question['required'] ? ' *' : '') . '\" ' . $search;\n\t\t\t\t$question['input'] = str_replace($search, $replace, $question['input']);\n\t\t\t}\n\t\t\t\n\t\t\t//Hide some field labels if showing placeholders\n\t\t\t$question['labelClasses'] = '';\n\t\t\tif ($this->enablePlaceholders && in_array($question['type'], array('text', 'textarea', 'email', 'telephone', 'url'))) {\n\t\t\t\t$question['labelClasses'] .= ' visuallyhidden';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$questions[] = $question;\n\t\t}\n\n\t\t//Prep thank-you message\n\t\t$success = ($_GET['surveySuccess'] && $_GET['qsid'] == intval($qsID));\n\t\t$thanksMsg = $this->thankyouMsg;\n\n\t\t//Prep error message(s)\n\t\t$errorHeader = $formResponse;\n\t\t$errors = is_array($errors) ? $errors : array();\n\t\tif ($invalidIP) {\n\t\t\t$errors[] = $invalidIP;\n\t\t}\n\n\t\t//Prep captcha\n\t\t$surveyBlockInfo = $miniSurvey->getMiniSurveyBlockInfoByQuestionId($qsID, $bID);\n\t\t$captcha = $surveyBlockInfo['displayCaptcha'] ? Loader::helper('validation/captcha') : false;\n\t\t\n\t\t//Send data to the view\n\t\t$this->set('formDomId', $formDomId);\n\t\t$this->set('hasFileUpload', $hasFileUpload);\n\t\t$this->set('qsID', $qsID);\n\t\t$this->set('pURI', $pURI);\n\t\t$this->set('success', $success);\n\t\t$this->set('thanksMsg', $thanksMsg);\n\t\t$this->set('errorHeader', $errorHeader);\n\t\t$this->set('errors', $errors);\n\t\t$this->set('questions', $questions);\n\t\t$this->set('captcha', $captcha);\n\t\t$this->set('enablePlaceholders', $this->enablePlaceholders);\n\t}", "public function testCreateSurveyQuestion0()\n {\n }", "public function testCreateSurveyQuestion0()\n {\n }", "function _addQuestionblock($title = \"\", $owner = 0, $show_questiontext = true, $show_blocktitle = false)\n\t{\t\t\n\t\tglobal $ilDB;\n\t\t$next_id = $ilDB->nextId('svy_qblk');\n\t\t$ilDB->manipulateF(\"INSERT INTO svy_qblk (questionblock_id, title, show_questiontext,\".\n\t\t\t\" show_blocktitle, owner_fi, tstamp) \" .\n\t\t\t\"VALUES (%s, %s, %s, %s, %s, %s)\",\n\t\t\tarray('integer','text','integer','integer','integer','integer'),\n\t\t\tarray($next_id, $title, $show_questiontext, $show_blocktitle, $owner, time())\n\t\t);\n\t\treturn $next_id;\n\t}", "function insertQuestionblock($questionblock_id) \n\t{\n\t\tglobal $ilDB;\n\t\t$result = $ilDB->queryF(\"SELECT svy_qblk.title, svy_qblk.show_questiontext, svy_qblk.show_blocktitle,\".\n\t\t\t\" svy_qblk_qst.question_fi FROM svy_qblk, svy_qblk_qst, svy_svy_qst\".\n\t\t\t\" WHERE svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi\".\n\t\t\t\" AND svy_svy_qst.question_fi = svy_qblk_qst.question_fi\".\n\t\t\t\" AND svy_qblk.questionblock_id = %s\".\n\t\t\t\" ORDER BY svy_svy_qst.sequence\",\n\t\t\tarray('integer'),\n\t\t\tarray($questionblock_id)\n\t\t);\n\t\t$questions = array();\n\t\t$show_questiontext = 0;\n\t\t$show_blocktitle = 0;\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\t$duplicate_id = $this->duplicateQuestionForSurvey($row[\"question_fi\"]);\n\t\t\tarray_push($questions, $duplicate_id);\n\t\t\t$title = $row[\"title\"];\n\t\t\t$show_questiontext = $row[\"show_questiontext\"];\n\t\t\t$show_blocktitle = $row[\"show_blocktitle\"];\n\t\t}\n\t\t$this->createQuestionblock($title, $show_questiontext, $show_blocktitle, $questions);\n\t}", "public function insertQuestionBlock($a_block_id)\n\t{\n\t\t$new_ids = array();\n\t\t$question_ids = $this->object->getQuestionblockQuestionIds($a_block_id);\n\t\tforeach($question_ids as $qid)\n\t\t{\n\t\t\t$new_ids[] = $this->appendNewQuestionToSurvey($qid, true, true);\n\t\t}\n\t\t\n\t\tif(sizeof($new_ids))\n\t\t{\n\t\t\t$this->object->loadQuestionsFromDb();\n\t\t\t\n\t\t\t$pos = $_REQUEST[\"pgov_pos\"];\n\t\t\n\t\t\t// a[fter]/b[efore] on same page\n\t\t\tif(substr($pos, -1) != \"c\")\n\t\t\t{\n\t\t\t\t// block handling\n\t\t\t\t$current = $this->object->getSurveyPages();\n\t\t\t\t$current = $current[$this->current_page-1];\n\t\t\t\tif(sizeof($current) == 1)\n\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// as questions are moved to first block question\n\t\t\t\t\t// always use existing as first\n\t\t\t\t\t// the new question is moved later on (see below)\n\t\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t\tarray((int)$pos)+$new_ids);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$block_id = array_pop($current);\n\t\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t\tforeach($new_ids as $qid)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->object->addQuestionToBlock($qid, $block_id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// c: as new page (from toolbar/pool)\n\t\t\telse\n\t\t\t{\n\t\t\t\t// re-create block\n\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t$new_ids);\n\t\t\t\t\n\t\t\t\t// after given question\n\t\t\t\tif((int)$pos)\n\t\t\t\t{\n\t\t\t\t\t$pos = (int)$pos.\"a\";\n\t\t\t\t}\n\t\t\t\t// at the beginning\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$first = $this->object->getSurveyPages();\n\t\t\t\t\t$first = $first[0];\n\t\t\t\t\t$first = array_shift($first);\n\t\t\t\t\t$pos = $first[\"question_id\"].\"b\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move to target position\n\t\t\t$this->object->moveQuestions($new_ids, (int)$pos,\n\t\t\t\t((substr($pos, -1) == \"a\") ? 1 : 0));\t\t\t\n\t\t}\n\t}", "public function testCreateSurvey0()\n {\n }", "public function testCreateSurvey0()\n {\n }", "public function testCreateSurveyQuestionChoice0()\n {\n }", "public function testCreateSurveyQuestionChoice0()\n {\n }", "public function createQuestionAndAnswers () {\n global $tpl, $lng, $ilCtrl, $ilTabs;\n\n // create wizard object\n include_once('class.ilObjMobileQuizWizard.php');\n $wiz = new ilObjMobileQuizWizard();\n\n\n $ilTabs->activateTab(\"editQuiz\");\n\n\n if ($wiz->checkInput()){\n $wiz->createQuestionAndAnswers($this->object);\n ilUtil::sendSuccess($this->txt(\"question_obj_create\"), true);\n $ilCtrl->redirect($this, \"editQuiz\");\n }\n $this->initAddQuestionAndAnswersFormAfterError();\n //$tpl->setContent(\"Test\");\n }", "public function getPostCreateQuestion()\n {\n $title = \"Ask Question\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n $user = $this->di->get(\"authHelper\")->getLoggedInUser();\n\n if (!$user) {\n $this->di->get(\"response\")->redirect(\"user/login\");\n }\n\n $form = new QuestionForm($this->di);\n $form->check();\n $view->add(\"comment/question-form\", [\"form\" => $form->getHTML([\"use_buttonbar\" => false])]);\n return $pageRender->renderPage([\"title\" => $title]);\n }", "public function create()\n\t{\n\t\treturn view('admin.question.create');\n\t}", "public function create($question, $type = ObjectFactory::TEXT_QUESTION) {\n $questionObj = $this->objectFactory->createQuestion($type);\n $questionObj->setQuestion($question);\n $this->poll->addItem($questionObj);\n return $questionObj;\n\t}", "public function run()\n {\n DB::table('survey_questions')->insert([\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'heading',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Informatie over de patiënt:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Leeftijd:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'textarea',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Onderliggend lijden welk invloed kan hebben op de wondgenezing: (indien niet aanwezig gelieve n.v.t te vermelden).',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'heading',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Informatie over de wond',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => null,\n 'required' => true,\n 'options' => json_encode(['Nieuwe wond', 'Bestaande wond']),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Sinds wanneer?',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 6,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => null,\n 'required' => true,\n 'options' => json_encode(['dag(en)', 'week/weken']),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Welke verband is het meest recentelijk op deze wond aangebracht?',\n 'required' => true,\n 'options' => json_encode([\n ['Fiberverbanden met hoog absorptievermogen of alginaten, gelieve de naam van het product te vermelden:'],\n ['Schuimverband, gelieve de naam van het product te vermelden:'],\n ['Zilververband, gelieve de naam van het product te vermelden:'],\n ['Superabsorberend, gelieve de naam van het product te vermelden:'],\n ['Hydrocolloïde, gelieve de naam van het product te vermelden:'],\n ['Ander(e) type(n), gelieve de naam van het product te vermelden:'],\n 'Geen',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Type wond:',\n 'required' => true,\n 'options' => json_encode([\n 'Acute wond',\n 'Chronische wond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Geïnfecteerd?',\n 'required' => true,\n 'options' => json_encode([\n 'Ja',\n 'Nee',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => 'Andere acute wond, namelijk:',\n 'text' => '(Indien acute wond aangevinkt) het gaat in het bijzonder om een …',\n 'required' => true,\n 'options' => json_encode([\n 'Traumatische wond (oppervlakkige schaafwond, laceratie, flyctenen, oppervlakkige snijwonden en huidscheuren)',\n 'Tweedegraads brandwond',\n 'Dermabrasie / Ontvelling',\n 'Chirurgische wond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => 'Andere chronische wond, namelijk',\n 'text' => '(Indien chronische wond aangevinkt) het gaat in het bijzonder om een …',\n 'required' => true,\n 'options' => json_encode([\n 'Decubitus wond',\n 'Ulcus Cruris beenwond',\n 'Diabetische voetwond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Wat is de hoeveelheid wondvocht?',\n 'required' => true,\n 'options' => json_encode([\n 'Droog',\n 'Vochtig',\n 'Nat',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Locatie van het wondbed',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => '% Necrotisch (zwart)',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => '% Granulerend (rood)',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => '% Beslag (geel)',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Anders, namelijk',\n 'required' => false,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => null,\n 'text' => 'Toestand van de huid rondom de wond:',\n 'required' => true,\n 'options' => json_encode([\n 'Gezond',\n 'Geïrriteerd/rood',\n 'Droog/eczematisch',\n 'Gemacereerd',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'heading',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'D0 – 1e toepassing van AQUACEL Foam of Foam Lite™ ConvaTec:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'date',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Datum (D0):',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Type verband:',\n 'required' => true,\n 'options' => json_encode([\n 'AQUACEL Foam',\n 'AQUACEL Ag Foam',\n 'Foam Lite ConvaTec',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'label',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Afmeting verbandkeuze:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'AQUACEL Foam – plakkend',\n 'required' => true,\n 'options' => json_encode([\n '8 x 8 cm',\n '10 x 10 cm',\n '12,5 x 12,5 cm',\n '17,5 x 17,5 cm',\n '21 x 21 cm',\n '25 x 30 cm',\n '8 x 13 cm',\n '10 x 20 cm',\n '10 x 25 cm',\n '10 x 30 cm',\n '19,8 x 14 cm',\n '20 x 16,9 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'AQUACEL Foam - zonder kleefrand',\n 'required' => true,\n 'options' => json_encode([\n '5 x 5 cm',\n '10 x 10 cm',\n '15 x 15 cm',\n '10 x 20 cm',\n '15 x 20 cm',\n '20 x 20 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'AQUACEL Foam – anatomische vormen',\n 'required' => true,\n 'options' => json_encode([\n 'Allround 19,8 x 14 cm',\n 'Sacrum 20 x 16,9 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Foam Lite™ ConvaTec',\n 'required' => true,\n 'options' => json_encode([\n '5 x 5 cm',\n '8 x 8 cm',\n '10 x 10 cm',\n '10 x 20 cm',\n '15 x 15 cm',\n '5,5 x 12 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => 'Secundair verband, gelieve het primaire verband te vermelden:',\n 'text' => 'Op welke wijze gebruikt u het gekozen verband?',\n 'required' => true,\n 'options' => json_encode([\n 'Primair verband',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => null,\n 'text' => 'Waarom heeft u voor dit specifieke verband gekozen? (Meerdere antwoorden zijn mogelijk)',\n 'required' => true,\n 'options' => json_encode([\n 'Vormbaar, zacht, comfortabel voor de patiënt',\n 'Vochtig wondmilieu met Hydrofiber',\n 'Bescherming van de wondranden (verticale absorptie)',\n 'Vasthouden van wondvocht en bacteriën (retentie)',\n 'Verbetering/ verkleining van de wond',\n 'Minder verbandwissels en/of draagtijd verlengd',\n 'Eenvoudig te gebruiken',\n 'Goede kennis van en ervaringen met schuimverbanden',\n 'Goede kennis van en ervaringen met Hydrofiber-verbanden',\n 'Type wond en hoeveelheid wondvocht',\n 'Fase van de wond',\n 'Locatie van de wond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => null,\n 'text' => 'Hoe ervaart u het aanbrengen van het verband?',\n 'required' => true,\n 'options' => json_encode([\n 'Gemakkelijk',\n ['Redelijk gemakkelijk (omschrijf)'],\n ['Niet gemakkelijk (omschrijf)'],\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Kleeft het verband bij het aanbrengen aan de handschoenen of aan zichzelf?',\n 'required' => true,\n 'options' => json_encode([\n 'Ja',\n 'Nee',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Zo ja, is het herpositioneerbaar?',\n 'required' => true,\n 'options' => json_encode([\n 'Ja',\n 'Nee',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n ]);\n }", "abstract protected function create(string $name, string $description, array $variants): Question;", "public function create()\n {\n //\n if (\\Auth::guest())\n return redirect()->guest('login');\n\n $sections = null;\n\n $data = [\n 'pagetitle' => 'Draft a Question',\n 'sections' => $sections\n ];\n return view('questions.create',$data);\n }", "public function create()\n {\n return view('backend.question.create');\n }", "public function run()\n {\n $question = new TemplateQuestion();\n $question->question = 'Conducted by?';\n $question->template_section_id = 1;\n $question->save();\n\n $question = new TemplateQuestion();\n $question->question = 'date?';\n $question->template_section_id = 1;\n $question->save();\n\n $question = new TemplateQuestion();\n $question->question = 'Location';\n $question->template_section_id = 1;\n $question->save();\n\n //seed another section\n\n $question = new TemplateQuestion();\n $question->question = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';\n $question->template_section_id = 2;\n $question->save();\n\n $question = new TemplateQuestion();\n $question->question = 'trash empty?';\n $question->template_section_id = 2;\n $question->save();\n\n $question = new TemplateQuestion();\n $question->question = 'Water shut off?';\n $question->template_section_id = 2;\n $question->save();\n\n\n }", "public function initAddQuestionAndAnswersForm () {\n global $tpl, $ilCtrl;\n\n $my_tpl = new ilTemplate(\"tpl.question_and_answers.html\", true, true,\n \"Customizing/global/plugins/Services/Repository/RepositoryObject/MobileQuiz\");\n $rtokenFactory = new ilCtrl();\n $my_tpl->setVariable(\"ACTION_URL\",$this->ctrl->getFormAction($this));\n $my_tpl->setVariable(\"SUBMIT_BUTTON\", $this->txt(\"save\"));\n $my_tpl->setVariable(\"NEW_QUESTION\", $this->txt(\"question_add_head\"));\n $my_tpl->setVariable(\"QUESTION\", $this->txt(\"question_add_text\"));\n $my_tpl->setVariable(\"QUESTION_TYPE\", $this->txt(\"question_add_type\"));\n $my_tpl->setVariable(\"CHOICES\", $this->txt(\"choice_add_texts\"));\n $my_tpl->setVariable(\"VAR_1\", \"value1\");\n $my_tpl->setVariable(\"COMMAND\", \"cmd[createQuestionAndAnswers]\");\n $my_tpl->setVariable(\"MINIMUM\", $this->txt(\"choice_add_numeric_minimum\"));\n $my_tpl->setVariable(\"MAXIMUM\", $this->txt(\"choice_add_numeric_maximum\"));\n $my_tpl->setVariable(\"STEP\", $this->txt(\"choice_add_numeric_steprange\"));\n $my_tpl->setVariable(\"CORRECT_VALUE\", $this->txt(\"choice_add_numeric_correctvalue\"));\n $my_tpl->setVariable(\"TOLERANCE_RANGE\", $this->txt(\"choice_add_numeric_tolerenace_range\"));\n $my_tpl->setVariable(\"SELECTED_SINGLE\", 'selected=\"selected\"');\n\n $my_tpl->setVariable(\"HIDE_NUMERIC_BLOCK\", 'style=\"display:none;\"');\n $my_tpl->setVariable(\"HIDE_SINGLE_CHOICE_BLOCK\", 'style=\"display:none;\"');\n\n $html = $my_tpl->get();\n $tpl->setContent($html);\n }", "public function create()\n {\n return view('admin.question.create');\n }", "public function create()\n {\n $survey = new Survey();\n return view('backend.surveys.create')->with('survey', $survey);\n }", "public function create()\n {\n $placeholders = [\n 'Why do pigs like to roll around in the mud?',\n 'Do you speak Pig Latin?',\n 'What\\'s your opinion on Porky Pig?',\n 'Do pigs like pineapples?',\n 'Are you scared of the big bad wolf?',\n 'Have you ever had the swine flu?',\n 'Why did the pig cross the road?'];\n $randomPlaceholder = $placeholders[array_rand($placeholders)];\n return view('questions-create', compact('randomPlaceholder'));\n }", "public function create(\\FanFerret\\QuestionBundle\\Entity\\Question $question);", "public function create()\n {\n BreadcrumbsRegister::Register($this->ModelName,$this->BreadCrumbName);\n return view('admin.questions.create')->with(['title' => $this->BreadCrumbName, 'chapter_id' => $_GET['chapter_id']]);\n }", "public function create()\n {\n $questionData = getQuestionsData(); //Helper function in app\\Support\\helpers.php\n $numberAnswers = $questionData[0];\n $typeKeys = $questionData[1];\n $typeValues = $questionData[2];\n \n return view('questions.create', compact('typeKeys', 'typeValues', 'numberAnswers')); \n }", "public function create(){\n\n // returning view and results\n return view('create_question');\n }", "public function create()\n {\n return view('admin.questions.create');\n }", "public function create()\n {\n return view('admin.questions.create');\n }", "function printSurveyCreationForm() {\n\tglobal $tool_content, $langTitle, $langPollStart, \n\t\t$langPollEnd, $langType, $langSurveyMC, $langSurveyFillText, \n\t\t$langCreate, $langSurveyContinue, $start_cal_Survey, $end_cal_Survey;\n\t\n\t$CurrentDate = date(\"Y-m-d H:i:s\");\n\t$CurrentDate = htmlspecialchars($CurrentDate);\n\t$tool_content .= <<<cData\n\t<form action=\"addsurvey.php\" id=\"survey\" method=\"post\">\n\t<input type=\"hidden\" value=\"0\" name=\"MoreQuestions\">\n\t<table><thead></thead>\n\t\t<tr><td>$langTitle</td><td colspan=\"2\"><input type=\"text\" size=\"50\" name=\"SurveyName\"></td></tr>\n\t\t<tr><td>$langPollStart</td><td colspan=\"2\">\n\t\t\t$start_cal_Survey\n\t\t</td></tr>\n\t\t<tr><td>$langPollEnd</td><td colspan=\"2\">$end_cal_Survey</td></tr>\n\t\t<!--<tr>\n\t\t <td>$langType</td>\n\t\t <td><label>\n\t\t <input name=\"UseCase\" type=\"radio\" value=\"1\" />\n\t $langSurveyMC</label></td>\n\t\t <td><label>\n\t\t <input name=\"UseCase\" type=\"radio\" value=\"2\" />\n\t $langSurveyFillText</label></td>\n\t\t</tr>-->\n\t\t<input name=\"UseCase\" type=\"hidden\" value=\"1\" />\n\t\t<tr><td colspan=\"3\" align=\"right\">\n <input name=\"$langSurveyContinue\" type=\"submit\" value=\"$langSurveyContinue -&gt;\"></td></tr>\n\t</table>\n\t</form>\ncData;\n}" ]
[ "0.66613626", "0.64371026", "0.64371026", "0.6413626", "0.6226909", "0.6092577", "0.6010549", "0.6010549", "0.5955444", "0.5955444", "0.593875", "0.5927579", "0.5902457", "0.58796155", "0.58722836", "0.5850027", "0.5826019", "0.5821744", "0.57599115", "0.57521576", "0.57430565", "0.574212", "0.57362217", "0.5733506", "0.5709625", "0.56971127", "0.56970805", "0.569587", "0.569587", "0.56813705" ]
0.6946752
0
Modifies a question block
function modifyQuestionblock($questionblock_id, $title, $show_questiontext, $show_blocktitle) { global $ilDB; $affectedRows = $ilDB->manipulateF("UPDATE svy_qblk SET title = %s, show_questiontext = %s,". " show_blocktitle = %s WHERE questionblock_id = %s", array('text','text','text','integer'), array($title, $show_questiontext, $show_blocktitle, $questionblock_id) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function modifyQuestion(Question $question): void;", "public function testUpdateSurveyQuestion0()\n {\n }", "public function testUpdateSurveyQuestion0()\n {\n }", "function createQuestionblock($title, $show_questiontext, $show_blocktitle, $questions)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t// if the selected questions are not in a continous selection, move all questions of the\n\t\t// questionblock at the position of the first selected question\n\t\t$this->moveQuestions($questions, $questions[0], 0);\n\t\t\n\t\t// now save the question block\n\t\tglobal $ilUser;\n\t\t$next_id = $ilDB->nextId('svy_qblk');\n\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_qblk (questionblock_id, title, show_questiontext,\".\n\t\t\t\" show_blocktitle, owner_fi, tstamp) VALUES (%s, %s, %s, %s, %s, %s)\",\n\t\t\tarray('integer','text','text','text','integer','integer'),\n\t\t\tarray($next_id, $title, $show_questiontext, $show_blocktitle, $ilUser->getId(), time())\n\t\t);\n\t\tif ($affectedRows)\n\t\t{\n\t\t\t$questionblock_id = $next_id;\n\t\t\tforeach ($questions as $index)\n\t\t\t{\n\t\t\t\t$next_id = $ilDB->nextId('svy_qblk_qst');\n\t\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_qblk_qst (qblk_qst_id, survey_fi, questionblock_fi, \" .\n\t\t\t\t\t\"question_fi) VALUES (%s, %s, %s, %s)\",\n\t\t\t\t\tarray('integer','integer','integer','integer'),\n\t\t\t\t\tarray($next_id, $this->getSurveyId(), $questionblock_id, $index)\n\t\t\t\t);\n\t\t\t\t$this->deleteConstraints($index);\n\t\t\t}\n\t\t}\n\t}", "public function set_data($question) {\n /* accessing the form in this way is probably not correct style */\n $wronganswers = $this->get_wrong_answers($question);\n /* this gets manipulated by javascript */\n $settingsdata = $this->get_itemsettings($question);\n $this->_form->getElement('itemsettings')->setValue($settingsdata);\n $this->_form->getElement('wronganswers')->setValue(array('text' => $wronganswers));\n parent::set_data($question);\n }", "private function question()\n\t{\n\t\t$this->qns['questionnaire']['questionnairecategories_id'] = $this->allinputs['questioncat'];\n\t\t$this->qns['questionnaire']['questionnairesubcategories_id'] = $this->allinputs['questionsubcat'];\n\t\t$this->qns['questionnaire']['label'] = $this->allinputs['question_label'];\n\n\n\t\t$this->qns['questionnaire']['question'] = $this->allinputs['question'];\n\t\t$this->qns['questionnaire']['has_sub_question'] = $this->allinputs['subquestion'];\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 )\n\t\t{\n\t\t\t$this->qns['answers']['answer_type'] = $this->allinputs['optiontype'];\n\t\t}\n\n\t\t$this->qns['questionnaire']['active'] = 1;\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 ){\n\t\t\t//This code must be skipped if sub_question is 1\n\t\t\t$optionCounter = 0;\n\t\t\tforeach ($this->allinputs as $key => $value) {\n\n\t\t\t\tif( str_is('option_*', $key) ){\n\t\t\t\t\t$optionCounter++;\n\t\t\t\t\t$this->qns['answers'][$optionCounter] = ( $this->qns['answers']['answer_type'] == 'opentext' ) ? 'Offered answer text' : $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function testUpdateSurveyQuestionChoice0()\n {\n }", "public function testUpdateSurveyQuestionChoice0()\n {\n }", "public function insertQuestionBlock($a_block_id)\n\t{\n\t\t$new_ids = array();\n\t\t$question_ids = $this->object->getQuestionblockQuestionIds($a_block_id);\n\t\tforeach($question_ids as $qid)\n\t\t{\n\t\t\t$new_ids[] = $this->appendNewQuestionToSurvey($qid, true, true);\n\t\t}\n\t\t\n\t\tif(sizeof($new_ids))\n\t\t{\n\t\t\t$this->object->loadQuestionsFromDb();\n\t\t\t\n\t\t\t$pos = $_REQUEST[\"pgov_pos\"];\n\t\t\n\t\t\t// a[fter]/b[efore] on same page\n\t\t\tif(substr($pos, -1) != \"c\")\n\t\t\t{\n\t\t\t\t// block handling\n\t\t\t\t$current = $this->object->getSurveyPages();\n\t\t\t\t$current = $current[$this->current_page-1];\n\t\t\t\tif(sizeof($current) == 1)\n\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// as questions are moved to first block question\n\t\t\t\t\t// always use existing as first\n\t\t\t\t\t// the new question is moved later on (see below)\n\t\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t\tarray((int)$pos)+$new_ids);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$block_id = array_pop($current);\n\t\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t\tforeach($new_ids as $qid)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->object->addQuestionToBlock($qid, $block_id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// c: as new page (from toolbar/pool)\n\t\t\telse\n\t\t\t{\n\t\t\t\t// re-create block\n\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t$new_ids);\n\t\t\t\t\n\t\t\t\t// after given question\n\t\t\t\tif((int)$pos)\n\t\t\t\t{\n\t\t\t\t\t$pos = (int)$pos.\"a\";\n\t\t\t\t}\n\t\t\t\t// at the beginning\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$first = $this->object->getSurveyPages();\n\t\t\t\t\t$first = $first[0];\n\t\t\t\t\t$first = array_shift($first);\n\t\t\t\t\t$pos = $first[\"question_id\"].\"b\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move to target position\n\t\t\t$this->object->moveQuestions($new_ids, (int)$pos,\n\t\t\t\t((substr($pos, -1) == \"a\") ? 1 : 0));\t\t\t\n\t\t}\n\t}", "function kilman_prep_for_questionform($kilman, $qid, $qtype) {\n $context = context_module::instance($kilman->cm->id);\n if ($qid != 0) {\n $question = clone($kilman->questions[$qid]);\n $question->qid = $question->id;\n $question->sid = $kilman->survey->id;\n $question->id = $kilman->cm->id;\n $draftideditor = file_get_submitted_draft_itemid('question');\n $content = file_prepare_draft_area($draftideditor, $context->id, 'mod_kilman', 'question',\n $qid, array('subdirs' => true), $question->content);\n $question->content = array('text' => $content, 'format' => FORMAT_HTML, 'itemid' => $draftideditor);\n\n if (isset($question->dependencies)) {\n foreach ($question->dependencies as $dependencies) {\n if ($dependencies->dependandor === \"and\") {\n $question->dependquestions_and[] = $dependencies->dependquestionid.','.$dependencies->dependchoiceid;\n $question->dependlogic_and[] = $dependencies->dependlogic;\n } else if ($dependencies->dependandor === \"or\") {\n $question->dependquestions_or[] = $dependencies->dependquestionid.','.$dependencies->dependchoiceid;\n $question->dependlogic_or[] = $dependencies->dependlogic;\n }\n }\n }\n } else {\n $question = \\mod_kilman\\question\\base::question_builder($qtype);\n $question->sid = $kilman->survey->id;\n $question->id = $kilman->cm->id;\n $question->type_id = $qtype;\n $question->type = '';\n $draftideditor = file_get_submitted_draft_itemid('question');\n $content = file_prepare_draft_area($draftideditor, $context->id, 'mod_kilman', 'question',\n null, array('subdirs' => true), '');\n $question->content = array('text' => $content, 'format' => FORMAT_HTML, 'itemid' => $draftideditor);\n }\n return $question;\n}", "public function test_changing_question() {\n global $DB;\n\n // create a 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 $time = mktime(9, 0, 0, 11, 7, 2013);\n\n $this->loadDataSet($this->createArrayDataSet(array(\n 'videoquanda_questions' => array(\n array('id', 'instanceid', 'userid', 'timecreated', 'timemodified' ,'seconds', 'text'),\n array(1, $videoquanda->id, $user->id, $time, $time, 2, 'dummy text')\n )\n )));\n\n $question = array(\n 'text' => 'I have updated my question.',\n 'timemodified' => time()\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 $client = new Client($this->_app);\n $client->request('PUT', '/api/v1/' . $videoquanda->id . '/questions/1', array(), array(), array(), json_encode($question));\n\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n $this->assertGreaterThan($time, $DB->get_field('videoquanda_questions', 'timemodified', array('id' => 1)));\n }", "public function edit(question $question)\n {\n //\n }", "public function setQuestion($question = '')\n {\n $this->question = $question;\n }", "public function render_answer() {\n // TODO: This should be refactored\n $seq = optional_param('seq',0, PARAM_INT);\n $this->set_var('seq', $seq);\n\n try { \n $answers = array();\n if(empty($_POST['answers'])) {\n throw new Exception('Bạn chưa chọn đáp án trả lời!');\n } else {\n $answers = $_POST['answers'];\n }\n \n $this->_log->log(array(__CLASS__,__FUNCTION__,'$time='.$seq,'$answers='. json_encode($answers)));\n \n if(!isset($_SESSION['ma_quiz']['questions'][$seq])) {\n redirect('/mod/rtw/view.php?id='.$this->course_module->id.'&c=ma_quiz&a=question&seq='.$seq+1,'Câu hỏi không tồn tại, đang tải câu hỏi tiếp theo...',1);\n }\n \n $question = $_SESSION['ma_quiz']['questions'][$seq]; \n if(!isset($question->show_time)) {\n throw new Exception();\n }\n \n $now = new DateTime();\n $remain_seconds = date_utils::getSecondsBetween(new DateTime($question->show_time), $now);\n if($remain_seconds <= 0) { \n $error_message = 'Câu hỏi đã hết thời gian trả lời!';\n throw new Exception();\n }\n\n $is_corrected = $this->check_answers($question, $answers);\n \n if ($is_corrected) {\n $point = 1;\n $coin = 1;\n }\n else {\n $point = 0;\n $coin = 0;\n }\n \n $data_update = array('submit_time' => $now->format(date_utils::$formatSQLDateTime));\n \n if($point == 1) {\n // Update coin and experience\n $coin_id = player::getInstance()->change_coin($question->game_player_id, $coin);\n $experience_id = player::getInstance()->incrExp($question->game_player_id, $coin);\n $data_update['is_correct'] = 1;\n $data_update['coin_id'] = $coin_id;\n $data_update['experience_id'] = $experience_id;\n $this->set_var('change_coin', $coin);\n } \n // update user answer\n $data_update['user_answer'] = json_encode($answers);\n\n \n $style = '';\n $this->set_var('point', $point);\n $this->set_var('style', $style);\n $this->set_var('correct_answers', $this->get_correct_answers($question));\n game_ma_quiz::getInstance()->update($question->game_ma_quiz_id, $data_update);\n \n unset($_SESSION['ma_quiz']['questions'][$seq]);\n $this->doRender('result.php');\n \n } catch (Exception $e) {\n $this->_log->log($e, 'error');\n $error_message = $e->getMessage() ? $e->getMessage() : 'Hệ thống đang bận, vui lòng thử lại sau';\n $this->set_var('error_message', $error_message);\n $this->doRender('error.php');\n }\n }", "function setQuestion( &$question )\r\n {\r\n if ( is_a( $question, \"eZQuizQuestion\" ) )\r\n $this->Question = $question;\r\n }", "public function changeQuestionAndAnswers () {\n global $ilUser, $tpl, $ilTabs, $ilCtrl;\n $ilTabs->activateTab(\"editQuiz\");\n\n // update database\n // create wizard object\n include_once('class.ilObjMobileQuizWizard.php');\n $wiz = new ilObjMobileQuizWizard();\n $wiz->changeQuestionAndAnswers($this->object);\n\n $_GET['question_id'] = $_POST['question_id'];\n $this->initQuestionAndAnswersEditForm();\n\n // load changed data and display them\n }", "public function updateclaimquestion(){\n try{\n\t if(isset($this->getData['operators'])){\n\t $opertaors = commonfunction::implod_array($this->getData['operators']);\n\t $update = $this->UpdateInToTable(CLAIM_QUESTIONS, array(array('operators'=>$opertaors, 'question'=>$this->getData['claimquename'], 'status'=>$this->getData['claim_status'])), \"question_id='\".$this->getData['question_id'].\"'\");\n\t }\n\t else{\n\t $update = $this->UpdateInToTable(CLAIM_QUESTIONS, array(array('question'=>$this->getData['claimquename'], 'status'=>$this->getData['claim_status'])), \"question_id='\".$this->getData['question_id'].\"'\");\n\t }\n\t}\n\tcatch (Exception $e) {\n $this->_logger->info('Class-'.__CLASS__.',Function-'.__FUNCTION__.',Line-'.__LINE__.',Error-'.$e->getMessage());\n } \n\t return $update;\n }", "function _addQuestionblock($title = \"\", $owner = 0, $show_questiontext = true, $show_blocktitle = false)\n\t{\t\t\n\t\tglobal $ilDB;\n\t\t$next_id = $ilDB->nextId('svy_qblk');\n\t\t$ilDB->manipulateF(\"INSERT INTO svy_qblk (questionblock_id, title, show_questiontext,\".\n\t\t\t\" show_blocktitle, owner_fi, tstamp) \" .\n\t\t\t\"VALUES (%s, %s, %s, %s, %s, %s)\",\n\t\t\tarray('integer','text','integer','integer','integer','integer'),\n\t\t\tarray($next_id, $title, $show_questiontext, $show_blocktitle, $owner, time())\n\t\t);\n\t\treturn $next_id;\n\t}", "public function setQuestion(string $question): void\n {\n $this->question = $question;\n }", "protected function deleteBlock()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\t\t\n\t\t$ilCtrl->setParameter($this->editor_gui, \"pgov\", $this->current_page);\n\t\tilUtil::sendQuestion($lng->txt(\"remove_questions\"));\n\t\t\n\t\t$page = $this->object->getSurveyPages();\n\t\t$page = $page[$this->current_page-1];\n\t\t\n\t\t// #10567\n\t\tif($_REQUEST[\"csum\"] != md5(print_r($page, true)))\n\t\t{\n\t\t\t$ilCtrl->redirect($this, \"renderPage\");\n\t\t}\n\t\t\n\t\t$page = array_shift($page);\n\t\t$block_id = $page[\"questionblock_id\"];\n\t\tif($block_id)\n\t\t{\n\t\t\t$this->editor_gui->removeQuestionsForm(array($block_id), array(), array());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->editor_gui->removeQuestionsForm(array(), array($page[\"question_id\"]), array());\n\t\t}\n\t}", "public function askAndHideAnswer($question);", "public function edit(Question $question)\n {\n //\n }", "public function edit(Question $question)\n {\n //\n }", "public function edit(Question $question)\n {\n //\n }", "public function updateUserQuestion()\n\t{\n\t\tif (Input::has('add_good_answer'))\n\t\t{\n\t\t\t// increase number of good answers\n\t\t\t$apiResponse = $this->apiDispatcher->callApiRoute('api_add_good_answer', [\n\t\t\t\t'auth_token' => $this->apiAuthToken,\n\t\t\t\t'id' => Input::get('user_question_id'),\n\t\t\t]);\n\t\t}\n\n\t\tif (Input::has('add_bad_answer'))\n\t\t{\n\t\t\t// increase number of bad answers\n\t\t\t$apiResponse = $this->apiDispatcher->callApiRoute('api_add_bad_answer', [\n\t\t\t\t'auth_token' => $this->apiAuthToken,\n\t\t\t\t'id' => Input::get('user_question_id'),\n\t\t\t]);\n\t\t}\n\n\t\tif (Input::has('update'))\n\t\t{\n\t\t\t// update question and/or answer\n\t\t\t$apiResponse = $this->apiDispatcher->callApiRoute('api_update_user_question', [\n\t\t\t\t'auth_token' => $this->apiAuthToken,\n\t\t\t\t'id' => Input::get('user_question_id'),\n\t\t\t\t'question' => Input::get('question'),\n\t\t\t\t'answer' => Input::get('answer')\n\t\t\t]);\n\n\t\t\t/*\n\t\t\t * Store in session for next request only\n\t\t\t * This will force learning page to display concrete user question instead of random one,\n\t\t\t * and the answer div to be displayed so user can see updated fields\n\t\t\t */\n\t\t\tSession::flash('user_question_id', Input::get('user_question_id'));\n\t\t\tSession::flash('display_answer', true);\n\t\t}\n\n\t\t/*\n\t\t * Success API response\n\t\t */\n\t\tif (isset($apiResponse) && $apiResponse->getSuccess())\n\t\t{\n\t\t\t// redirect to learning page display user question\n\t\t\treturn Redirect::route('learning_page_display_user_question');\n\t\t}\n\n\t\t// unexpected API resppnse\n\t\tthrow new Exception('Unexpected API response');\n\t}", "public function testUpdateSurvey0()\n {\n }", "public function testUpdateSurvey0()\n {\n }", "public function view() {\n\t\t//Note that we don't call parent::view(), because built-in form block controller doesn't have one(!!)\n\t\t\n\t\t$miniSurvey = new MiniSurvey();\n\t\t$miniSurvey->frontEndMode = true;\n\n\t\t$bID = intval($this->bID);\n\t\t$qsID = intval($this->questionSetId);\n\t\t\n\t\t$formDomId = \"miniSurveyView{$bID}\";\n\t\t$hasFileUpload = false;\n\n\t\t$questionsRS = $miniSurvey->loadQuestions($qsID, $bID);\n\t\t$questions = array();\n\t\twhile ($questionRow = $questionsRS->fetchRow()) {\n\t\t\t$question = $questionRow;\n\t\t\t$question['input'] = $miniSurvey->loadInputType($questionRow, false);\n\t\t\tif ($questionRow['inputType'] == 'fileupload') {\n\t\t\t\t$hasFileUpload = true;\n\t\t\t}\n\t\n\t\t\t//Make type names common-sensical\n\t\t\tif ($questionRow['inputType'] == 'text') {\n\t\t\t\t$question['type'] = 'textarea';\n\t\t\t} else if ($questionRow['inputType'] == 'field') {\n\t\t\t\t$question['type'] = 'text';\n\t\t\t} else {\n\t\t\t\t$question['type'] = $questionRow['inputType'];\n\t\t\t}\n\t\n\t\t\t//Construct label \"for\" (and misc. hackery for checkboxlist / radio lists)\n\t\t\tif ($question['type'] == 'checkboxlist') {\n\t\t\t\t$question['input'] = str_replace('<div class=\"checkboxPair\">', '<div class=\"checkboxPair\"><label>', $question['input']);\n\t\t\t\t$question['input'] = str_replace(\"</div>\\n\", \"</label></div>\\n\", $question['input']); //include linebreak in find/replace string so we don't replace the very last closing </div> (the one that closes the \"checkboxList\" wrapper div that's around this whole question)\n\t\t\t} else if ($question['type'] == 'radios') {\n\t\t\t\t//Put labels around each radio items (super hacky string replacement -- this might break in future versions of C5)\n\t\t\t\t$question['input'] = str_replace('<div class=\"radioPair\">', '<div class=\"radioPair\"><label>', $question['input']);\n\t\t\t\t$question['input'] = str_replace('</div>', '</label></div>', $question['input']);\n\t\t\n\t\t\t\t//Make radioList wrapper consistent with checkboxList wrapper\n\t\t\t\t$question['input'] = \"<div class=\\\"radioList\\\">\\n{$question['input']}\\n</div>\\n\";\n\t\t\t} else {\n\t\t\t\t$question['labelFor'] = 'for=\"Question' . $questionRow['msqID'] . '\"';\n\t\t\t}\n\t\n\t\t\t//Remove hardcoded style on textareas\n\t\t\tif ($question['type'] == 'textarea') {\n\t\t\t\t$question['input'] = str_replace('style=\"width:95%\"', '', $question['input']);\n\t\t\t}\n\t\n\t\t\t//Add placeholder attributes\n\t\t\tif ($this->enablePlaceholders) {\n\t\t\t\t$search = 'id=\"Question';\n\t\t\t\t$replace = 'placeholder=\"' . $question['question'] . ($question['required'] ? ' *' : '') . '\" ' . $search;\n\t\t\t\t$question['input'] = str_replace($search, $replace, $question['input']);\n\t\t\t}\n\t\t\t\n\t\t\t//Hide some field labels if showing placeholders\n\t\t\t$question['labelClasses'] = '';\n\t\t\tif ($this->enablePlaceholders && in_array($question['type'], array('text', 'textarea', 'email', 'telephone', 'url'))) {\n\t\t\t\t$question['labelClasses'] .= ' visuallyhidden';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$questions[] = $question;\n\t\t}\n\n\t\t//Prep thank-you message\n\t\t$success = ($_GET['surveySuccess'] && $_GET['qsid'] == intval($qsID));\n\t\t$thanksMsg = $this->thankyouMsg;\n\n\t\t//Prep error message(s)\n\t\t$errorHeader = $formResponse;\n\t\t$errors = is_array($errors) ? $errors : array();\n\t\tif ($invalidIP) {\n\t\t\t$errors[] = $invalidIP;\n\t\t}\n\n\t\t//Prep captcha\n\t\t$surveyBlockInfo = $miniSurvey->getMiniSurveyBlockInfoByQuestionId($qsID, $bID);\n\t\t$captcha = $surveyBlockInfo['displayCaptcha'] ? Loader::helper('validation/captcha') : false;\n\t\t\n\t\t//Send data to the view\n\t\t$this->set('formDomId', $formDomId);\n\t\t$this->set('hasFileUpload', $hasFileUpload);\n\t\t$this->set('qsID', $qsID);\n\t\t$this->set('pURI', $pURI);\n\t\t$this->set('success', $success);\n\t\t$this->set('thanksMsg', $thanksMsg);\n\t\t$this->set('errorHeader', $errorHeader);\n\t\t$this->set('errors', $errors);\n\t\t$this->set('questions', $questions);\n\t\t$this->set('captcha', $captcha);\n\t\t$this->set('enablePlaceholders', $this->enablePlaceholders);\n\t}", "public function edit(UserQuestion $userQuestion)\n {\n //\n }", "public function setQuestion(?Question $question)\n {\n $this->question = $question;\n }" ]
[ "0.67802197", "0.65440124", "0.65440124", "0.62129766", "0.6184781", "0.6141038", "0.6078981", "0.6078981", "0.6051003", "0.6049248", "0.58989984", "0.58399624", "0.58349174", "0.5829611", "0.5807976", "0.5803189", "0.5778517", "0.5770963", "0.576397", "0.5743169", "0.5687713", "0.5681547", "0.5681547", "0.5681547", "0.5638324", "0.56210405", "0.56210405", "0.55998576", "0.55770403", "0.55492383" ]
0.689889
0