{"code": " public function actionGetItems(){\n $sql = 'SELECT id, name as value FROM x2_opportunities WHERE name LIKE :qterm ORDER BY name ASC';\n $command = Yii::app()->db->createCommand($sql);\n $qterm = $_GET['term'].'%';\n $command->bindParam(\":qterm\", $qterm, PDO::PARAM_STR);\n $result = $command->queryAll();\n echo CJSON::encode($result);\n Yii::app()->end();\n }", "label_name": "Base", "label": 1} {"code": " public function remove()\n {\n $this->checkCSRFParam();\n $project = $this->getProject();\n $action = $this->actionModel->getById($this->request->getIntegerParam('action_id'));\n\n if (! empty($action) && $this->actionModel->remove($action['id'])) {\n $this->flash->success(t('Action removed successfully.'));\n } else {\n $this->flash->failure(t('Unable to remove this action.'));\n }\n\n $this->response->redirect($this->helper->url->to('ActionController', 'index', array('project_id' => $project['id'])));\n }", "label_name": "Base", "label": 1} {"code": " public function testDoesNotTouchClosureListeners()\n {\n $this->getServer()->flush();\n $this->getServer()->enqueue(array(\n \"HTTP/1.1 200 OK\\r\\n\" .\n \"Date: Mon, 12 Nov 2012 03:06:37 GMT\\r\\n\" .\n \"Cache-Control: private, s-maxage=0, max-age=0, must-revalidate\\r\\n\" .\n \"Last-Modified: Mon, 12 Nov 2012 02:53:38 GMT\\r\\n\" .\n \"Content-Length: 2\\r\\n\\r\\nhi\",\n \"HTTP/1.0 304 Not Modified\\r\\n\" .\n \"Date: Mon, 12 Nov 2012 03:06:38 GMT\\r\\n\" .\n \"Content-Type: text/html; charset=UTF-8\\r\\n\" .\n \"Last-Modified: Mon, 12 Nov 2012 02:53:38 GMT\\r\\n\" .\n \"Age: 6302\\r\\n\\r\\n\",\n \"HTTP/1.0 304 Not Modified\\r\\n\" .\n \"Date: Mon, 12 Nov 2012 03:06:38 GMT\\r\\n\" .\n \"Content-Type: text/html; charset=UTF-8\\r\\n\" .\n \"Last-Modified: Mon, 12 Nov 2012 02:53:38 GMT\\r\\n\" .\n \"Age: 6302\\r\\n\\r\\n\",\n ));\n $client = new Client($this->getServer()->getUrl());\n $client->addSubscriber(new CachePlugin());\n $client->getEventDispatcher()->addListener('command.after_send', function(){});\n $this->assertEquals(200, $client->get()->send()->getStatusCode());\n $this->assertEquals(200, $client->get()->send()->getStatusCode());\n $this->assertEquals(200, $client->get()->send()->getStatusCode());\n }", "label_name": "Base", "label": 1} {"code": " function selectObjectBySql($sql) {\n //$logFile = \"C:\\\\xampp\\\\htdocs\\\\supserg\\\\tmp\\\\queryLog.txt\";\n //$lfh = fopen($logFile, 'a');\n //fwrite($lfh, $sql . \"\\n\"); \n //fclose($lfh); \n $res = @mysqli_query($this->connection, $this->injectProof($sql));\n if ($res == null)\n return null;\n return mysqli_fetch_object($res);\n }", "label_name": "Class", "label": 2} {"code": "\tpublic function register()\n\t{\n\t\tJSession::checkToken('post') or jexit(JText::_('JINVALID_TOKEN'));\n\n\t\t// Get the application\n\t\t$app = JFactory::getApplication();\n\n\t\t// Get the form data.\n\t\t$data = $this->input->post->get('user', array(), 'array');\n\n\t\t// Get the model and validate the data.\n\t\t$model = $this->getModel('Registration', 'UsersModel');\n\n\t\t$form = $model->getForm();\n\n\t\tif (!$form)\n\t\t{\n\t\t\tJError::raiseError(500, $model->getError());\n\n\t\t\treturn false;\n\t\t}\n\n\t\t$return = $model->validate($form, $data);\n\n\t\t// Check for errors.\n\t\tif ($return === false)\n\t\t{\n\t\t\t// Get the validation messages.\n\t\t\t$errors = $model->getErrors();\n\n\t\t\t// Push up to three validation messages out to the user.\n\t\t\tfor ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++)\n\t\t\t{\n\t\t\t\tif ($errors[$i] instanceof Exception)\n\t\t\t\t{\n\t\t\t\t\t$app->enqueueMessage($errors[$i]->getMessage(), 'notice');\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$app->enqueueMessage($errors[$i], 'notice');\n\t\t\t}\n\n\t\t\t// Save the data in the session.\n\t\t\t$app->setUserState('users.registration.form.data', $data);\n\n\t\t\t// Redirect back to the registration form.\n\t\t\t$this->setRedirect('index.php?option=com_users&view=registration');\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// Finish the registration.\n\t\t$return = $model->register($data);\n\n\t\t// Check for errors.\n\t\tif ($return === false)\n\t\t{\n\t\t\t// Save the data in the session.\n\t\t\t$app->setUserState('users.registration.form.data', $data);\n\n\t\t\t// Redirect back to the registration form.\n\t\t\t$message = JText::sprintf('COM_USERS_REGISTRATION_SAVE_FAILED', $model->getError());\n\t\t\t$this->setRedirect('index.php?option=com_users&view=registration', $message, 'error');\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// Flush the data from the session.\n\t\t$app->setUserState('users.registration.form.data', null);\n\n\t\treturn true;\n\t}", "label_name": "Class", "label": 2} {"code": " foreach($course_RET as $period_date)\n {\n // $period_days_append_sql .=\"(sp.start_time<='$period_date[END_TIME]' AND '$period_date[START_TIME]'<=sp.end_time AND IF(course_period_date IS NULL, course_period_date='$period_date[COURSE_PERIOD_DATE]',DAYS LIKE '%$period_date[DAYS]%')) OR \";\n $period_days_append_sql .=\"(sp.start_time<='$period_date[END_TIME]' AND '$period_date[START_TIME]'<=sp.end_time AND (cpv.course_period_date IS NULL OR cpv.course_period_date='$period_date[COURSE_PERIOD_DATE]') AND cpv.DAYS LIKE '%$period_date[DAYS]%') OR \";\n\n }", "label_name": "Base", "label": 1} {"code": " public function toolbar() {\n// global $user;\n\n $menu = array();\n\t\t$dirs = array(\n\t\t\tBASE.'framework/modules/administration/menus',\n\t\t\tBASE.'themes/'.DISPLAY_THEME.'/modules/administration/menus'\n\t\t);\n\n\t\tforeach ($dirs as $dir) {\n\t\t if (is_readable($dir)) {\n\t\t\t $dh = opendir($dir);\n\t\t\t while (($file = readdir($dh)) !== false) {\n\t\t\t\t if (substr($file,-4,4) == '.php' && is_readable($dir.'/'.$file) && is_file($dir.'/'.$file)) {\n\t\t\t\t\t $menu[substr($file,0,-4)] = include($dir.'/'.$file);\n if (empty($menu[substr($file,0,-4)])) unset($menu[substr($file,0,-4)]);\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t}\n\n // sort the top level menus alphabetically by filename\n\t\tksort($menu);\t\t\n\t\t$sorted = array();\n\t\tforeach($menu as $m) $sorted[] = $m;\n \n // slingbar position\n if (isset($_COOKIE['slingbar-top'])){\n $top = $_COOKIE['slingbar-top'];\n } else {\n $top = SLINGBAR_TOP;\n }\n \n\t\tassign_to_template(array(\n 'menu'=>(bs3()) ? $sorted : json_encode($sorted),\n \"top\"=>$top\n ));\n }", "label_name": "Class", "label": 2} {"code": "\tfunction manage() {\n\t global $db;\n\t \n\t expHistory::set('manageable', $this->params);\n//\t $classes = array();\n $dir = BASE.\"framework/modules/ecommerce/billingcalculators\";\n if (is_readable($dir)) {\n $dh = opendir($dir);\n while (($file = readdir($dh)) !== false) {\n if (is_file(\"$dir/$file\") && substr(\"$dir/$file\", -4) == \".php\") {\n include_once(\"$dir/$file\");\n $classname = substr($file, 0, -4);\n $id = $db->selectValue('billingcalculator', 'id', 'calculator_name=\"'.$classname.'\"');\n if (empty($id)) {\n// $calobj = null;\n $calcobj = new $classname();\n if ($calcobj->isSelectable() == true) {\n $obj = new billingcalculator(array(\n 'title'=>$calcobj->name(),\n// 'user_title'=>$calcobj->title,\n 'body'=>$calcobj->description(), \n 'calculator_name'=>$classname,\n 'enabled'=>false));\n $obj->save();\n }\n }\n }\n }\n }\n \n $bcalc = new billingcalculator();\n $calculators = $bcalc->find('all');\n assign_to_template(array(\n 'calculators'=>$calculators\n ));\n\t}", "label_name": "Base", "label": 1} {"code": "\t\tform_end_row();\n\t\t$i++;\n\t}\n\n\n\thtml_end_box(false);\n\n/*\n\tprint \"
\";\n\tif (isset($check) && is_array($check)) {\n\t\tprint_r($check);\n\t}\n\tprint \"
\";\n*/\n\n}", "label_name": "Base", "label": 1} {"code": " }elseif($k == \"error\"){\r\n\r\n self::error($v);\r\n\r\n }elseif(!in_array($k, $arr) && $k != 'paging'){\r", "label_name": "Base", "label": 1} {"code": " public function save()\n {\n $user = $this->getUser();\n $values = $this->request->getValues();\n\n if (! $this->userSession->isAdmin()) {\n if (isset($values['role'])) {\n unset($values['role']);\n }\n }\n\n list($valid, $errors) = $this->userValidator->validateModification($values);\n\n if ($valid) {\n if ($this->userModel->update($values)) {\n $this->flash->success(t('User updated successfully.'));\n $this->response->redirect($this->helper->url->to('UserViewController', 'show', array('user_id' => $user['id'])), true);\n return;\n } else {\n $this->flash->failure(t('Unable to update this user.'));\n }\n }\n\n $this->show($values, $errors);\n }", "label_name": "Base", "label": 1} {"code": " public static function handler($vars) {\r\n self::$vars();\r\n }\r", "label_name": "Base", "label": 1} {"code": " return new Response($emailLog->getHtmlLog());\n } elseif ($request->get('type') == 'params') {", "label_name": "Base", "label": 1} {"code": " foreach ($week as $dayNum => $day) {\r\n if ($dayNum == $now['mday']) {\r\n $currentweek = $weekNum;\r\n }\r\n if ($dayNum <= $endofmonth) {\r\n// $monthly[$weekNum][$dayNum]['number'] = ($monthly[$weekNum][$dayNum]['ts'] != -1) ? $db->countObjects(\"eventdate\", $locsql . \" AND date >= \" . expDateTime::startOfDayTimestamp($day['ts']) . \" AND date <= \" . expDateTime::endOfDayTimestamp($day['ts'])) : -1;\r\n $monthly[$weekNum][$dayNum]['number'] = ($monthly[$weekNum][$dayNum]['ts'] != -1) ? $ed->find(\"count\", $locsql . \" AND date >= \" . expDateTime::startOfDayTimestamp($day['ts']) . \" AND date <= \" . expDateTime::endOfDayTimestamp($day['ts'])) : -1;\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": "\tpublic function fixsessions() {\n\t global $db;\n\n//\t\t$test = $db->sql('CHECK TABLE '.$db->prefix.'sessionticket');\n\t\t$fix = $db->sql('REPAIR TABLE '.$db->prefix.'sessionticket');\n\t\tflash('message', gt('Sessions Table was Repaired'));\n\t\texpHistory::back();\n\t}", "label_name": "Class", "label": 2} {"code": " public function save(){\n $cat_name = I(\"cat_name\");\n $s_number = I(\"s_number/d\") ? I(\"s_number/d\") : 99 ;\n $cat_id = I(\"cat_id/d\")? I(\"cat_id/d\") : 0;\n $parent_cat_id = I(\"parent_cat_id/d\")? I(\"parent_cat_id/d\") : 0;\n $item_id = I(\"item_id/d\");\n\n $login_user = $this->checkLogin();\n if (!$this->checkItemPermn($login_user['uid'] , $item_id)) {\n $this->sendError(10103);\n return;\n }\n //\u7981\u6b62\u7a7a\u76ee\u5f55\u7684\u751f\u6210\n if (!$cat_name) {\n return;\n }\n \n if ($parent_cat_id && $parent_cat_id == $cat_id) {\n $this->sendError(10101,\"\u4e0a\u7ea7\u76ee\u5f55\u4e0d\u80fd\u9009\u62e9\u81ea\u8eab\");\n return;\n }\n \n $data['cat_name'] = $cat_name ;\n $data['s_number'] = $s_number ;\n $data['item_id'] = $item_id ;\n $data['parent_cat_id'] = $parent_cat_id ;\n if ($parent_cat_id > 0 ) {\n $row = D(\"Catalog\")->where(\" cat_id = '$parent_cat_id' \")->find() ;\n $data['level'] = $row['level'] +1 ;\n }else{\n $data['level'] = 2;\n }\n\n if ($cat_id > 0 ) {\n \n //\u5982\u679c\u4e00\u4e2a\u76ee\u5f55\u5df2\u7ecf\u662f\u522b\u7684\u76ee\u5f55\u7684\u7236\u76ee\u5f55\uff0c\u90a3\u4e48\u5b83\u5c06\u65e0\u6cd5\u518d\u8f6c\u4e3alevel4\u76ee\u5f55\n if (D(\"Catalog\")->where(\" parent_cat_id = '$cat_id' \")->find() && $data['level'] == 4 ) {\n $this->sendError(10101,\"\u8be5\u76ee\u5f55\u542b\u6709\u5b50\u76ee\u5f55\uff0c\u4e0d\u5141\u8bb8\u8f6c\u4e3a\u5e95\u5c42\u76ee\u5f55\u3002\");\n return;\n }\n \n $ret = D(\"Catalog\")->where(\" cat_id = '$cat_id' \")->save($data);\n $return = D(\"Catalog\")->where(\" cat_id = '$cat_id' \")->find();\n\n }else{\n $data['addtime'] = time();\n $cat_id = D(\"Catalog\")->add($data);\n $return = D(\"Catalog\")->where(\" cat_id = '$cat_id' \")->find();\n \n }\n if (!$return) {\n $return['error_code'] = 10103 ;\n $return['error_message'] = 'request fail' ;\n }\n $this->sendResult($return);\n \n }", "label_name": "Base", "label": 1} {"code": " public function confirm()\n {\n $project = $this->getProject();\n $filter = $this->customFilterModel->getById($this->request->getIntegerParam('filter_id'));\n\n $this->response->html($this->helper->layout->project('custom_filter/remove', array(\n 'project' => $project,\n 'filter' => $filter,\n 'title' => t('Remove a custom filter')\n )));\n }", "label_name": "Class", "label": 2} {"code": " public function testRemoveAuthorizationHeaderOnRedirect()\n {\n $mock = new MockHandler([\n new Response(302, ['Location' => 'http://test.com']),\n static function (RequestInterface $request) {\n self::assertFalse($request->hasHeader('Authorization'));\n return new Response(200);\n }\n ]);\n $handler = HandlerStack::create($mock);\n $client = new Client(['handler' => $handler]);\n $client->get('http://example.com?a=b', ['auth' => ['testuser', 'testpass']]);\n }", "label_name": "Class", "label": 2} {"code": " public function backup($type='json')\r\n {\r\n global $DB;\r\n global $website;\r\n\r\n $out = array();\r\n\r\n $DB->query('SELECT * FROM nv_structure WHERE website = '.protect($website->id), 'object');\r\n\r\n if($type='json')\r\n $out = json_encode($DB->result());\r\n\r\n return $out;\r\n }\r", "label_name": "Base", "label": 1} {"code": " public function take($value)\n {\n return $this->limit($value);\n }", "label_name": "Base", "label": 1} {"code": " public function validate() {\n global $db;\n // check for an sef url field. If it exists make sure it's valid and not a duplicate\n //this needs to check for SEF URLS being turned on also: TODO\n\n if (property_exists($this, 'sef_url') && !(in_array('sef_url', $this->do_not_validate))) {\n if (empty($this->sef_url)) $this->makeSefUrl();\n if (!isset($this->validates['is_valid_sef_name']['sef_url'])) $this->validates['is_valid_sef_name']['sef_url'] = array();\n if (!isset($this->validates['uniqueness_of']['sef_url'])) $this->validates['uniqueness_of']['sef_url'] = array();\n }\n\n // safeguard again loc data not being pass via forms...sometimes this happens when you're in a router\n // mapped view and src hasn't been passed in via link to the form \n if (isset($this->id) && empty($this->location_data)) {\n $loc = $db->selectValue($this->tablename, 'location_data', 'id=' . $this->id);\n if (!empty($loc)) $this->location_data = $loc;\n }\n\n // run the validation as defined in the models\n if (!isset($this->validates)) return true;\n $messages = array();\n $post = empty($_POST) ? array() : expString::sanitize($_POST);\n foreach ($this->validates as $validation=> $field) {\n foreach ($field as $key=> $value) {\n $fieldname = is_numeric($key) ? $value : $key;\n $opts = is_numeric($key) ? array() : $value;\n $ret = expValidator::$validation($fieldname, $this, $opts);\n if (!is_bool($ret)) {\n $messages[] = $ret;\n expValidator::setErrorField($fieldname);\n unset($post[$fieldname]);\n }\n }\n }\n\n if (count($messages) >= 1) expValidator::failAndReturnToForm($messages, $post);\n }", "label_name": "Base", "label": 1} {"code": " public function getDisplayName ($plural=true) {\n return Yii::t('users', '{user}', array(\n '{user}' => Modules::displayName($plural, 'Users'),\n ));\n }", "label_name": "Base", "label": 1} {"code": " public static function decode($jwt, $key = null, $verify = true)\n {\n $tks = explode('.', $jwt);\n\n if (count($tks) != 3) {\n throw new Exception('Wrong number of segments');\n }\n\n list($headb64, $payloadb64, $cryptob64) = $tks;\n\n if (null === ($header = json_decode(JWT::urlsafeB64Decode($headb64)))) {\n throw new Exception('Invalid segment encoding');\n }\n\n if (null === $payload = json_decode(JWT::urlsafeB64Decode($payloadb64))) {\n throw new Exception('Invalid segment encoding');\n }\n\n $sig = JWT::urlsafeB64Decode($cryptob64);\n\n if ($verify) {\n if (empty($header->alg)) {\n throw new DomainException('Empty algorithm');\n }\n\n if (!JWT::verifySignature($sig, \"$headb64.$payloadb64\", $key, $header->alg)) {\n throw new UnexpectedValueException('Signature verification failed');\n }\n }\n\n return $payload;\n }", "label_name": "Class", "label": 2} {"code": " function getFontSize()\n {\n $fs = $GLOBALS['PMA_Config']->get('fontsize');\n if (!is_null($fs)) {\n return $fs;\n }\n if (isset($_COOKIE['pma_fontsize'])) {\n return $_COOKIE['pma_fontsize'];\n }\n return '82%';\n }", "label_name": "Base", "label": 1} {"code": " public function testInvalidRequests($requestRange)\n {\n $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream'))->setAutoEtag();\n\n // prepare a request for a range of the testing file\n $request = Request::create('/');\n $request->headers->set('Range', $requestRange);\n\n $response = clone $response;\n $response->prepare($request);\n $response->sendContent();\n\n $this->assertEquals(416, $response->getStatusCode());\n #$this->assertEquals('', $response->headers->get('Content-Range'));\n }", "label_name": "Base", "label": 1} {"code": " public function __construct(AuthManager $auth, Repository $config)\n {\n $this->lockoutTime = $config->get('auth.lockout.time');\n $this->maxLoginAttempts = $config->get('auth.lockout.attempts');\n\n $this->auth = $auth;\n $this->config = $config;\n }", "label_name": "Class", "label": 2} {"code": " function reset_stats() {\n// global $db;\n\n // reset the counters\n// $db->sql ('UPDATE '.$db->prefix.'banner SET impressions=0 WHERE 1');\n banner::resetImpressions();\n// $db->sql ('UPDATE '.$db->prefix.'banner SET clicks=0 WHERE 1');\n banner::resetClicks();\n \n // let the user know we did stuff. \n flash('message', gt(\"Banner statistics reset.\"));\n expHistory::back();\n }", "label_name": "Base", "label": 1} {"code": " public static function meta($cont_title='', $cont_desc='', $pre =''){\n global $data;\n //print_r($data);\n //if(empty($data['posts'][0]->title)){ \n\n if(is_array($data) && isset($data['posts'][0]->title)){\n \n $sitenamelength = strlen(Options::get('sitename'));\n $limit = 70-$sitenamelength-6;\n $cont_title = substr(Typo::Xclean(Typo::strip($data['posts'][0]->title)),0,$limit);\n $titlelength = strlen($data['posts'][0]->title);\n if($titlelength > $limit+3) { $dotted = \"...\";} else {$dotted = \"\";}\n $cont_title = \"{$pre} {$cont_title}{$dotted} - \";\n }else{\n $cont_title = \"\";\n }\n if(is_array($data) && isset($data['posts'][0]->content)){\n $desc = Typo::strip($data['posts'][0]->content);\n }else{\n $desc = \"\";\n }\n\n $meta = \"\n \n \n {$cont_title}\".Options::get('sitename').\"\n \n \n \n \n \n \n \n \n \";\n \n $meta .= \"\n \";\n echo $meta;\n }", "label_name": "Base", "label": 1} {"code": "\tpublic function formatItem( Article $article, $pageText = null ) {\n\t\t$item = $article->mTitle;\n\n\t\tif ( $pageText !== null ) {\n\t\t\t//Include parsed/processed wiki markup content after each item before the closing tag.\n\t\t\t$item .= $pageText;\n\t\t}\n\n\t\t$item = $this->getItemStart() . $item . $this->itemEnd;\n\n\t\t$item = $this->replaceTagParameters( $item, $article );\n\n\t\treturn $item;\n\t}", "label_name": "Class", "label": 2} {"code": "\tprotected function parse()\n\t{\n\t\tparent::parse();\n\n\t\t// grab the error-type from the parameters\n\t\t$errorType = $this->getParameter('type');\n\n\t\t// set correct headers\n\t\tswitch($errorType)\n\t\t{\n\t\t\tcase 'module-not-allowed':\n\t\t\tcase 'action-not-allowed':\n\t\t\t\tSpoonHTTP::setHeadersByCode(403);\n\t\t\t\tbreak;\n\n\t\t\tcase 'not-found':\n\t\t\t\tSpoonHTTP::setHeadersByCode(404);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// querystring provided?\n\t\tif($this->getParameter('querystring') !== null)\n\t\t{\n\t\t\t// split into file and parameters\n\t\t\t$chunks = explode('?', $this->getParameter('querystring'));\n\n\t\t\t// get extension\n\t\t\t$extension = SpoonFile::getExtension($chunks[0]);\n\n\t\t\t// if the file has an extension it is a non-existing-file\n\t\t\tif($extension != '' && $extension != $chunks[0])\n\t\t\t{\n\t\t\t\t// set correct headers\n\t\t\t\tSpoonHTTP::setHeadersByCode(404);\n\n\t\t\t\t// give a nice error, so we can detect which file is missing\n\t\t\t\techo 'Requested file (' . implode('?', $chunks) . ') not found.';\n\n\t\t\t\t// stop script execution\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\n\t\t// assign the correct message into the template\n\t\t$this->tpl->assign('message', BL::err(SpoonFilter::toCamelCase($errorType, '-')));\n\t}", "label_name": "Base", "label": 1} {"code": " public static function returnChildrenAsJSON() {\r\n global $db;\r\n\r\n //$nav = section::levelTemplate(intval($_REQUEST['id'], 0));\r\n $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;\r\n $nav = $db->selectObjects('section', 'parent=' . $id, 'rank');\r\n //FIXME $manage_all is moot w/ cascading perms now?\r\n $manage_all = false;\r\n if (expPermissions::check('manage', expCore::makeLocation('navigation', '', $id))) {\r\n $manage_all = true;\r\n }\r\n //FIXME recode to use foreach $key=>$value\r\n $navcount = count($nav);\r\n for ($i = 0; $i < $navcount; $i++) {\r\n if ($manage_all || expPermissions::check('manage', expCore::makeLocation('navigation', '', $nav[$i]->id))) {\r\n $nav[$i]->manage = 1;\r\n $view = true;\r\n } else {\r\n $nav[$i]->manage = 0;\r\n $view = $nav[$i]->public ? true : expPermissions::check('view', expCore::makeLocation('navigation', '', $nav[$i]->id));\r\n }\r\n $nav[$i]->link = expCore::makeLink(array('section' => $nav[$i]->id), '', $nav[$i]->sef_name);\r\n if (!$view) unset($nav[$i]);\r\n }\r\n $nav= array_values($nav);\r\n// $nav[$navcount - 1]->last = true;\r\n if (count($nav)) $nav[count($nav) - 1]->last = true;\r\n// echo expJavascript::ajaxReply(201, '', $nav);\r\n $ar = new expAjaxReply(201, '', $nav);\r\n $ar->send();\r\n }\r", "label_name": "Class", "label": 2} {"code": " public function manage_messages() {\n expHistory::set('manageable', $this->params);\n \n $page = new expPaginator(array(\n\t\t\t'model'=>'order_status_messages',\n\t\t\t'where'=>1,\n 'limit'=>10,\n\t\t\t'order'=>'body',\n 'page'=>(isset($this->params['page']) ? $this->params['page'] : 1),\n 'controller'=>$this->params['controller'],\n 'action'=>$this->params['action'],\n\t\t\t//'columns'=>array('Name'=>'title')\n ));\n\n //eDebug($page);\n\t\tassign_to_template(array(\n 'page'=>$page\n ));\n }", "label_name": "Class", "label": 2} {"code": " public function approve_submit() {\n global $history;\n \n if (empty($this->params['id'])) {\n flash('error', gt('No ID supplied for comment to approve'));\n $lastUrl = expHistory::getLast('editable');\n }\n \n /* The global constants can be overriden by passing appropriate params */ \n //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet\n $require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : $this->params['require_login'];\n $require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : $this->params['require_approval'];\n $require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : $this->params['require_notification'];\n $notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : $this->params['notification_email'];\n \n $simplenote = new expSimpleNote($this->params['id']);\n //FIXME here is where we might sanitize the note before approving it\n $simplenote->body = $this->params['body'];\n $simplenote->approved = $this->params['approved'];\n $simplenote->save();\n \n $lastUrl = makelink($history->history[$history->history['lasts']['type']][count($history->history[$history->history['lasts']['type']])-1]['params']);\n if (!empty($this->params['tab']))\n {\n $lastUrl .= \"#\".$this->params['tab'];\n }\n redirect_to($lastUrl);\n }", "label_name": "Base", "label": 1} {"code": " function manage() {\n expHistory::set('viewable', $this->params);\n // $category = new storeCategory();\n // $categories = $category->getFullTree();\n // \n // // foreach($categories as $i=>$val){\n // // if (!empty($this->values) && in_array($val->id,$this->values)) {\n // // $this->tags[$i]->value = true;\n // // } else {\n // // $this->tags[$i]->value = false;\n // // }\n // // $this->tags[$i]->draggable = $this->draggable; \n // // $this->tags[$i]->checkable = $this->checkable; \n // // }\n //\n // $obj = json_encode($categories); \n }", "label_name": "Base", "label": 1} {"code": "\tprivate function _hiddencategories( $option ) {\n\t\t//@TODO: Unfinished functionality! Never implemented by original author.\n\t}", "label_name": "Class", "label": 2} {"code": " public function __construct($message, $code = 0, Exception $previous = null)\n {\n parent::__construct($message, $code, $previous);\n }", "label_name": "Base", "label": 1} {"code": " foreach ($allgroups as $gid) {\r\n $g = group::getGroupById($gid);\r\n expPermissions::grantGroup($g, 'manage', $sloc);\r\n }\r", "label_name": "Base", "label": 1} {"code": " $percent = round($percent, 0);\n } else {\n $percent = round($percent, 2); // school default\n }\n if ($ret == '%')\n return $percent;\n\n if (!$_openSIS['_makeLetterGrade']['grades'][$grade_scale_id])\n $_openSIS['_makeLetterGrade']['grades'][$grade_scale_id] = DBGet(DBQuery('SELECT TITLE,ID,BREAK_OFF FROM report_card_grades WHERE SYEAR=\\'' . $cp[1]['SYEAR'] . '\\' AND SCHOOL_ID=\\'' . $cp[1]['SCHOOL_ID'] . '\\' AND GRADE_SCALE_ID=\\'' . $grade_scale_id . '\\' ORDER BY BREAK_OFF IS NOT NULL DESC,BREAK_OFF DESC,SORT_ORDER'));\n\n foreach ($_openSIS['_makeLetterGrade']['grades'][$grade_scale_id] as $grade) {\n if ($does_breakoff == 'Y' ? $percent >= $programconfig[$staff_id][$course_period_id . '-' . $grade['ID']] && is_numeric($programconfig[$staff_id][$course_period_id . '-' . $grade['ID']]) : $percent >= $grade['BREAK_OFF'])\n return $ret == 'ID' ? $grade['ID'] : $grade['TITLE'];\n }\n}", "label_name": "Base", "label": 1} {"code": " public static function makeConfig ($file) {\n $config = \"getMessage();\n }\n \n return $config;\n }", "label_name": "Compound", "label": 4} {"code": "function db_start()\n{\n global $DatabaseServer, $DatabaseUsername, $DatabasePassword, $DatabaseName, $DatabasePort, $DatabaseType;\n\n switch ($DatabaseType) {\n case 'mysqli':\n $connection = new mysqli($DatabaseServer, $DatabaseUsername, $DatabasePassword, $DatabaseName, $DatabasePort);\n break;\n }\n\n // Error code for both.\n if ($connection === false) {\n switch ($DatabaseType) {\n case 'mysqli':\n $errormessage = mysqli_error($connection);\n break;\n }\n db_show_error(\"\", \"\" . _couldNotConnectToDatabase . \": $DatabaseServer\", $errormessage);\n }\n return $connection;\n}", "label_name": "Base", "label": 1} {"code": "\tpublic function &storeFromDefaultForm($created_success_msg, $modified_success_msg, $redirect_page=false, $debug=false, $x_param = false) {\r\n\t\t$objectid = ( isset($_POST[$this->handler->keyName]) )\r\n\t\t\t\t? (int) $_POST[$this->handler->keyName]\r\n\t\t\t\t: 0;\r\n\t\tif ($debug) {\r\n\t\t\tif ($x_param) {\r\n\t\t\t\t$icmsObj = $this->handler->getD($objectid, true, $x_param);\r\n\t\t\t} else {\r\n\t\t\t\t$icmsObj = $this->handler->getD($objectid);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tif ($x_param) {\r\n\t\t\t\t$icmsObj = $this->handler->get($objectid, true, false, false, $x_param);\r\n\t\t\t} else {\r\n\t\t\t\t$icmsObj = $this->handler->get($objectid);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * @todo multilanguage persistable handler is not fully implemented yet\r\n\t\t */\r\n\r\n\t\t// if handler is the Multilanguage handler, we will need to treat this for multilanguage\r\n\t\tif (is_subclass_of($this->handler, 'icmspersistablemlobjecthandler')) {\r\n\r\n\t\t\tif ($icmsObj->isNew()) {\r\n\t\t\t\t// This is a new object. We need to store the meta data and then the language data\r\n\t\t\t\t// First, we will get rid of the multilanguage data to only store the meta data\r\n\t\t\t\t$icmsObj->stripMultilanguageFields();\r\n\t\t\t\t$newObject =& $this->doStoreFromDefaultForm($icmsObj, $objectid, $created_success_msg, $modified_success_msg, $redirect_page, $debug);\r\n\t\t\t\t/**\r\n\t\t\t\t * @todo we need to trap potential errors here\r\n\t\t\t\t */\r\n\r\n\t\t\t\t// ok, the meta daa is stored. Let's recreate the object and then\r\n\t\t\t\t// get rid of anything not multilanguage\r\n\t\t\t\tunset($icmsObj);\r\n\t\t\t\t$icmsObj = $this->handler->get($objectid);\r\n\t\t\t\t$icmsObj->stripNonMultilanguageFields();\r\n\r\n\t\t\t\t$icmsObj->setVar($this->handler->keyName, $newObject->getVar($this->handler->keyName));\r\n\t\t\t\t$this->handler->changeTableNameForML();\r\n\t\t\t\t$ret =& $this->doStoreFromDefaultForm($icmsObj, $objectid, $created_success_msg, $modified_success_msg, $redirect_page, $debug);\r\n\r\n\t\t\t\treturn $ret;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn $this->doStoreFromDefaultForm($icmsObj, $objectid, $created_success_msg, $modified_success_msg, $redirect_page, $debug);\r\n\t\t}\r\n\t}\r", "label_name": "Base", "label": 1} {"code": " protected function tearDown()\n {\n Request::setTrustedHeaderName(Request::HEADER_CLIENT_IP, $this->originalTrustedHeaderName);\n }", "label_name": "Class", "label": 2} {"code": " function scan_page($parent_id) {\r\n global $db;\r\n\r\n $sections = $db->selectObjects('section','parent=' . $parent_id);\r\n $ret = '';\r\n foreach ($sections as $page) {\r\n $cLoc = serialize(expCore::makeLocation('container','@section' . $page->id));\r\n $ret .= scan_container($cLoc, $page->id);\r\n $ret .= scan_page($page->id);\r\n }\r\n return $ret;\r\n }\r", "label_name": "Base", "label": 1} {"code": " public static function hasChildren($i) {\r\n global $sections;\r\n\r\n if (($i + 1) >= count($sections)) return false;\r\n return ($sections[$i]->depth < $sections[$i + 1]->depth) ? true : false;\r\n }\r", "label_name": "Base", "label": 1} {"code": "function current_user_get_bug_filter( $p_project_id = null ) {\n\t$f_filter_string = gpc_get_string( 'filter', '' );\n\t$t_filter = '';\n\n\tif( !is_blank( $f_filter_string ) ) {\n\t\tif( is_numeric( $f_filter_string ) ) {\n\t\t\t$t_token = token_get_value( TOKEN_FILTER );\n\t\t\tif( null != $t_token ) {\n\t\t\t\t$t_filter = json_decode( $t_token, true );\n\t\t\t}\n\t\t} else {\n\t\t\t$t_filter = json_decode( $f_filter_string, true );\n\t\t}\n\t\t$t_filter = filter_ensure_valid_filter( $t_filter );\n\t} else if( !filter_is_cookie_valid() ) {\n\t\t$t_filter = filter_get_default();\n\t} else {\n\t\t$t_user_id = auth_get_current_user_id();\n\t\t$t_filter = user_get_bug_filter( $t_user_id, $p_project_id );\n\t}\n\n\treturn $t_filter;\n}", "label_name": "Class", "label": 2} {"code": " $section = new section($this->params);\r\n } else {\r\n notfoundController::handle_not_found();\r\n exit;\r\n }\r\n if (!empty($section->id)) {\r\n $check_id = $section->id;\r\n } else {\r\n $check_id = $section->parent;\r\n }\r\n if (expPermissions::check('manage', expCore::makeLocation('navigation', '', $check_id))) {\r\n if (empty($section->id)) {\r\n $section->active = 1;\r\n $section->public = 1;\r\n if (!isset($section->parent)) {\r\n // This is another precaution. The parent attribute\r\n // should ALWAYS be set by the caller.\r\n //FJD - if that's the case, then we should die.\r\n notfoundController::handle_not_authorized();\r\n exit;\r\n //$section->parent = 0;\r\n }\r\n }\r\n assign_to_template(array(\r\n 'section' => $section,\r\n 'glyphs' => self::get_glyphs(),\r\n ));\r\n } else { // User does not have permission to manage sections. Throw a 403\r\n notfoundController::handle_not_authorized();\r\n }\r\n }\r", "label_name": "Class", "label": 2} {"code": " AND lang = '.protect($lang).'\r\n AND subtype IN ('.implode(\",\", array_map(function($k){ return protect($k);}, $subtypes)).')'\r\n );\r", "label_name": "Base", "label": 1} {"code": " public static function error ($vars=\"\") {\n if( isset($vars) && $vars != \"\" ) {\n include(GX_PATH.'/inc/lib/Control/Error/'.$vars.'.control.php');\n }else{\n include(GX_PATH.'/inc/lib/Control/Error/404.control.php');\n }\n }", "label_name": "Base", "label": 1} {"code": " public function save_change_password() {\n global $user;\n\n $isuser = ($this->params['uid'] == $user->id) ? 1 : 0;\n\n if (!$user->isAdmin() && !$isuser) {\n flash('error', gt('You do not have permissions to change this users password.'));\n expHistory::back();\n }\n\n if (($isuser && empty($this->params['password'])) || (!empty($this->params['password']) && $user->password != user::encryptPassword($this->params['password']))) {\n flash('error', gt('The current password you entered is not correct.'));\n expHistory::returnTo('editable');\n }\n //eDebug($user);\n $u = new user($this->params['uid']);\n\n $ret = $u->setPassword($this->params['new_password1'], $this->params['new_password2']);\n //eDebug($u, true);\n if (is_string($ret)) {\n flash('error', $ret);\n expHistory::returnTo('editable');\n } else {\n $params = array();\n $params['is_admin'] = !empty($u->is_admin);\n $params['is_acting_admin'] = !empty($u->is_acting_admin);\n $u->update($params);\n }\n\n if (!$isuser) {\n flash('message', gt('The password for') . ' ' . $u->username . ' ' . gt('has been changed.'));\n } else {\n $user->password = $u->password;\n flash('message', gt('Your password has been changed.'));\n }\n expHistory::back();\n }", "label_name": "Class", "label": 2} {"code": " $contents[] = ['class' => 'text-center', 'text' => tep_draw_bootstrap_button(IMAGE_DELETE, 'fas fa-trash', null, 'primary', null, 'btn-danger xxx text-white mr-2') . tep_draw_bootstrap_button(IMAGE_CANCEL, 'fas fa-times', tep_href_link('testimonials.php', 'page=' . $_GET['page'] . '&tID=' . $tInfo->testimonials_id), null, null, 'btn-light')];", "label_name": "Base", "label": 1} {"code": "\tpublic function column_title( $post ) {\n\t\tlist( $mime ) = explode( '/', $post->post_mime_type );\n\n\t\t$title = _draft_or_post_title();\n\t\t$thumb = wp_get_attachment_image( $post->ID, array( 60, 60 ), true, array( 'alt' => '' ) );\n\t\t$link_start = $link_end = '';\n\n\t\tif ( current_user_can( 'edit_post', $post->ID ) && ! $this->is_trash ) {\n\t\t\t$link_start = sprintf(\n\t\t\t\t'',\n\t\t\t\tget_edit_post_link( $post->ID ),\n\t\t\t\t/* translators: %s: attachment title */\n\t\t\t\tesc_attr( sprintf( __( '“%s” (Edit)' ), $title ) )\n\t\t\t);\n\t\t\t$link_end = '';\n\t\t}\n\n\t\t$class = $thumb ? ' class=\"has-media-icon\"' : '';\n\t\t?>\n\t\t>\n\t\t\t\n\t\t\t\t\">\n\t\t\t\n\t\t\n\t\t

\n\t\t\t \n\t\t\tID );\n\t\t\techo wp_basename( $file );\n\t\t\t?>\n\t\t

\n\t\tsubtaskModel->getById($this->request->getIntegerParam('subtask_id'));\n\n if (empty($subtask)) {\n throw new PageNotFoundException();\n }\n\n return $subtask;\n }", "label_name": "Class", "label": 2} {"code": " public function showUnpublished() {\n expHistory::set('viewable', $this->params);\n \n // setup the where clause for looking up records.\n $where = parent::aggregateWhereClause();\n $where = \"((unpublish != 0 AND unpublish < \".time().\") OR (publish > \".time().\")) AND \".$where;\n if (isset($this->config['only_featured'])) $where .= ' AND is_featured=1';\n\n $page = new expPaginator(array(\n 'model'=>'news',\n 'where'=>$where,\n 'limit'=>25,\n 'order'=>'unpublish',\n 'page'=>(isset($this->params['page']) ? $this->params['page'] : 1),\n 'controller'=>$this->baseclassname,\n 'action'=>$this->params['action'],\n 'src'=>$this->loc->src,\n 'columns'=>array(\n gt('Title')=>'title',\n gt('Published On')=>'publish',\n gt('Status')=>'unpublish'\n ),\n ));\n \n assign_to_template(array(\n 'page'=>$page\n ));\n }", "label_name": "Base", "label": 1} {"code": "\tfunction edit() {\n\t if (empty($this->params['content_id'])) {\n\t flash('message',gt('An error occurred: No content id set.'));\n expHistory::back(); \n\t } \n /* The global constants can be overridden by passing appropriate params */\n //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet\n// $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login'];\n// $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval'];\n// $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification'];\n// $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email'];\n \n \n\t $id = empty($this->params['id']) ? null : $this->params['id'];\n\t $comment = new expComment($id);\n //FIXME here is where we might sanitize the comment before displaying/editing it\n\t\tassign_to_template(array(\n\t\t 'content_id'=>$this->params['content_id'],\n 'content_type'=>$this->params['content_type'],\n\t\t 'comment'=>$comment\n\t\t));\n\t}\t", "label_name": "Base", "label": 1} {"code": " private function mailPassthru($to, $subject, $body, $header, $params)\n {\n //Check overloading of mail function to avoid double-encoding\n if (ini_get('mbstring.func_overload') & 1) {\n $subject = $this->secureHeader($subject);\n } else {\n $subject = $this->encodeHeader($this->secureHeader($subject));\n }\n if (ini_get('safe_mode') || !($this->UseSendmailOptions)) {\n $result = @mail($to, $subject, $body, $header);\n } else {\n $result = @mail($to, $subject, $body, $header, $params);\n }\n return $result;\n }", "label_name": "Compound", "label": 4} {"code": " function ac_sigleme($str, $name, $id) {\n global $cms_db, $sess;\n\n $sess->gc( true );\n\t if( $id >= 1 && $this->session_enabled ) {\n $this->db->query(sprintf(\"delete from %s where name = '%s' and sid != '%s' and user_id = '%s'\",\n $cms_db[sessions],\n addslashes($name),\n $str,\n $id));\n }\n }", "label_name": "Base", "label": 1} {"code": " public static function url() {\r\n return Site::$url.'/inc/lib/Vendor';\r\n }\r", "label_name": "Base", "label": 1} {"code": " public function validateReference()\n {\n $docElem = $this->sigNode->ownerDocument->documentElement;\n if (! $docElem->isSameNode($this->sigNode)) {\n if ($this->sigNode->parentNode != null) {\n $this->sigNode->parentNode->removeChild($this->sigNode);\n }\n }\n $xpath = $this->getXPathObj();\n $query = \"./secdsig:SignedInfo/secdsig:Reference\";\n $nodeset = $xpath->query($query, $this->sigNode);\n if ($nodeset->length == 0) {\n throw new Exception(\"Reference nodes not found\");\n }\n\n /* Initialize/reset the list of validated nodes. */\n $this->validatedNodes = array();\n\n foreach ($nodeset AS $refNode) {\n if (! $this->processRefNode($refNode)) {\n /* Clear the list of validated nodes. */\n $this->validatedNodes = null;\n throw new Exception(\"Reference validation failed\");\n }\n }\n return true;\n }", "label_name": "Base", "label": 1} {"code": " public function AddAddress($address, $name = '') {\n return $this->AddAnAddress('to', $address, $name);\n }", "label_name": "Class", "label": 2} {"code": " function edit_order_item() {\n $oi = new orderitem($this->params['id'], true, true);\n if (empty($oi->id)) {\n flash('error', gt('Order item doesn\\'t exist.'));\n expHistory::back();\n }\n $oi->user_input_fields = expUnserialize($oi->user_input_fields);\n $params['options'] = $oi->opts;\n $params['user_input_fields'] = $oi->user_input_fields;\n $oi->product = new product($oi->product->id, true, true);\n if ($oi->product->parent_id != 0) {\n $parProd = new product($oi->product->parent_id);\n //$oi->product->optiongroup = $parProd->optiongroup; \n $oi->product = $parProd;\n }\n //FIXME we don't use selectedOpts?\n// $oi->selectedOpts = array();\n// if (!empty($oi->opts)) {\n// foreach ($oi->opts as $opt) {\n// $option = new option($opt[0]);\n// $og = new optiongroup($option->optiongroup_id);\n// if (!isset($oi->selectedOpts[$og->id]) || !is_array($oi->selectedOpts[$og->id]))\n// $oi->selectedOpts[$og->id] = array($option->id);\n// else\n// array_push($oi->selectedOpts[$og->id], $option->id);\n// }\n// }\n //eDebug($oi->selectedOpts);\n\n assign_to_template(array(\n 'oi' => $oi,\n 'params' => $params\n ));\n }", "label_name": "Base", "label": 1} {"code": "function PMA_Process_formset(FormDisplay $form_display)\n{\n if (filter_input(INPUT_GET, 'mode') == 'revert') {\n // revert erroneous fields to their default values\n $form_display->fixErrors();\n PMA_generateHeader303();\n }\n\n if (!$form_display->process(false)) {\n // handle form view and failed POST\n $form_display->display(true, true);\n return;\n }\n\n // check for form errors\n if (!$form_display->hasErrors()) {\n PMA_generateHeader303();\n return;\n }\n\n // form has errors, show warning\n $separator = PMA_URL_getArgSeparator('html');\n $page = filter_input(INPUT_GET, 'page');\n $formset = filter_input(INPUT_GET, 'formset');\n $formset = $formset ? \"{$separator}formset=$formset\" : '';\n $formId = filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT);\n if ($formId === null && $page == 'servers') {\n // we've just added a new server, get its id\n $formId = $form_display->getConfigFile()->getServerCount();\n }\n $formId = $formId ? \"{$separator}id=$formId\" : '';\n ?>\n
\n

\n
\n mode=revert\">\n \n \n
\n displayErrors() ?>\n \n  \n mode=edit\">\n _writeCsv($plugin, $tmpDir . $plugin . DS);\n\t\t}\n\t\t/* site_configs\u306e\u7de8\u96c6 (email / google_analytics_id / version) */\n\t\t$targets = ['email', 'google_analytics_id', 'version'];\n\t\t$path = $tmpDir . 'site_configs.csv';\n\t\t$fp = fopen($path, 'a+');\n\t\t$records = [];\n\t\twhile(($record = fgetcsvReg($fp, 10240)) !== false) {\n\t\t\tif (in_array($record[1], $targets)) {\n\t\t\t\t$record[2] = '';\n\t\t\t}\n\t\t\t$records[] = '\"' . implode('\",\"', $record) . '\"';\n\t\t}\n\t\tftruncate($fp, 0);\n\t\tfwrite($fp, implode(\"\\n\", $records));\n\t\t/* ZIP\u306b\u56fa\u3081\u3066\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9 */\n\t\t$fileName = 'default';\n\t\t$Simplezip = new Simplezip();\n\t\t$Simplezip->addFolder($tmpDir);\n\t\t$Simplezip->download($fileName);\n\t\temptyFolder($tmpDir);\n\t\texit();\n\t}", "label_name": "Base", "label": 1} {"code": " public function __construct()\n {\n $this->options['alias'] = ''; // alias to replace root dir name\n $this->options['dirMode'] = 0755; // new dirs mode\n $this->options['fileMode'] = 0644; // new files mode\n $this->options['quarantine'] = '.quarantine'; // quarantine folder name - required to check archive (must be hidden)\n $this->options['rootCssClass'] = 'elfinder-navbar-root-local';\n $this->options['followSymLinks'] = true;\n $this->options['detectDirIcon'] = ''; // file name that is detected as a folder icon e.g. '.diricon.png'\n $this->options['keepTimestamp'] = array('copy', 'move'); // keep timestamp at inner filesystem allowed 'copy', 'move' and 'upload'\n $this->options['substituteImg'] = true; // support substitute image with dim command\n $this->options['statCorrector'] = null; // callable to correct stat data `function(&$stat, $path, $statOwner, $volumeDriveInstance){}`\n }", "label_name": "Base", "label": 1} {"code": " public function AddBCC($address, $name = '') {\n return $this->AddAnAddress('bcc', $address, $name);\n }", "label_name": "Base", "label": 1} {"code": " public function enable()\n {\n $this->checkCSRFParam();\n $project = $this->getProject();\n $swimlane_id = $this->request->getIntegerParam('swimlane_id');\n\n if ($this->swimlaneModel->enable($project['id'], $swimlane_id)) {\n $this->flash->success(t('Swimlane updated successfully.'));\n } else {\n $this->flash->failure(t('Unable to update this swimlane.'));\n }\n\n $this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id'])));\n }", "label_name": "Base", "label": 1} {"code": " public static function Zipped () {\r\n\r\n global $HTTP_ACCEPT_ENCODING;\r\n\r\n if( headers_sent() ){\r\n\r\n $encoding = false;\r\n\r\n }elseif( strpos($HTTP_ACCEPT_ENCODING, 'x-gzip') !== false ){\r\n\r\n $encoding = 'x-gzip';\r\n\r\n }elseif( strpos($HTTP_ACCEPT_ENCODING,'gzip') !== false ){\r\n\r\n $encoding = 'gzip';\r\n\r\n }else{\r\n\r\n $encoding = false;\r\n\r\n }\r\n\r\n if( $encoding ){\r\n\r\n $contents = ob_get_contents();\r\n ob_end_clean();\r\n header('Content-Encoding: '.$encoding);\r\n print(\"\\x1f\\x8b\\x08\\x00\\x00\\x00\\x00\\x00\");\r\n $size = strlen($contents);\r\n $contents = gzcompress($contents, 9);\r\n $contents = substr($contents, 0, $size);\r\n print($contents);\r\n exit();\r\n\r\n }else{\r\n\r\n ob_end_flush();\r\n exit();\r\n\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": " foreach ($fields as $field => $title) {\n if($i==0 && $j==0){\n echo '
';\n }elseif($i==0 && $j>0){\n echo '
';\n }\n echo '
';\n \n /*if ($i % 2 == 0)\n echo '';*/\n $i++;\n if($i==2){\n $i = 0;\n }\n $j++;\n }", "label_name": "Base", "label": 1} {"code": "\t\tfunction uninstallPage()\n\t\t{\n\t\t\t$id = $this->getId();\n\n\t\t\tif(empty($_POST['uninstall_confirm']))\n\t\t\t{\n\n\t\t\t\t$plug_vars = e107::getPlug()->load($id)->getMeta();\n\n\t\t\t\t$name = e107::getPlug()->getName();\n\t\t\t\t$this->addTitle(EPL_ADLAN_63);\n\t\t\t\t$this->addTitle($name);\n\n\t\t\t\treturn $this->pluginConfirmUninstall($plug_vars);\n\t\t\t}\n\n\t\t\t$post = e107::getParser()->filter($_POST);\n\n\n\n\t\t//\t$id = e107::getPlugin\n\n\t\t\t$text = e107::getPlugin()->uninstall($id, $post);\n\n\t\t\te107::getMessage()->add($text, E_MESSAGE_SUCCESS);\n\t\t\t$log = e107::getPlugin()->getLog();\n\t\t\te107::getDebug()->log($log);\n\n\t\t\t$this->redirectAction('list');\n\t\t}", "label_name": "Compound", "label": 4} {"code": " public function showUnpublished() {\n expHistory::set('viewable', $this->params);\n \n // setup the where clause for looking up records.\n $where = parent::aggregateWhereClause();\n $where = \"((unpublish != 0 AND unpublish < \".time().\") OR (publish > \".time().\")) AND \".$where;\n if (isset($this->config['only_featured'])) $where .= ' AND is_featured=1';\n\n $page = new expPaginator(array(\n 'model'=>'news',\n 'where'=>$where,\n 'limit'=>25,\n 'order'=>'unpublish',\n 'page'=>(isset($this->params['page']) ? $this->params['page'] : 1),\n 'controller'=>$this->baseclassname,\n 'action'=>$this->params['action'],\n 'src'=>$this->loc->src,\n 'columns'=>array(\n gt('Title')=>'title',\n gt('Published On')=>'publish',\n gt('Status')=>'unpublish'\n ),\n ));\n \n assign_to_template(array(\n 'page'=>$page\n ));\n }", "label_name": "Class", "label": 2} {"code": "\tprivate static function listFilesInDirectory($dir, $omitSymlinks, $prefix = '')\n\t{\n\t\tif (!is_dir($dir)) {\n\t\t\treturn false;\n\t\t}\n\t\t$excludes = array(\".\",\"..\");\n\t\t$result = array();\n\t\t$files = self::localScandir($dir);\n\t\tif(!$files) {\n\t\t\treturn array();\n\t\t}\n\t\tforeach($files as $file) {\n\t\t\tif(!in_array($file, $excludes)) {\n\t\t\t\t$path = $dir.DIRECTORY_SEPARATOR.$file;\n\t\t\t\tif(is_link($path)) {\n\t\t\t\t\tif($omitSymlinks) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$result[] = $prefix.$file;\n\t\t\t\t\t}\n\t\t\t\t} else if(is_dir($path)) {\n\t\t\t\t\t$result[] = $prefix.$file.DIRECTORY_SEPARATOR;\n\t\t\t\t\t$subs = elFinderVolumeFTP::listFilesInDirectory($path, $omitSymlinks, $prefix.$file.DIRECTORY_SEPARATOR);\n\t\t\t\t\tif($subs) {\n\t\t\t\t\t\t$result = array_merge($result, $subs);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$result[] = $prefix.$file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "label_name": "Base", "label": 1} {"code": " call_user_func($listener, $event, $eventName, $this);\n if ($event->isPropagationStopped()) {\n break;\n }\n }\n }", "label_name": "Base", "label": 1} {"code": "\tfunction _real_escape( $string ) {\n\t\tif ( $this->dbh ) {\n\t\t\tif ( $this->use_mysqli ) {\n\t\t\t\treturn mysqli_real_escape_string( $this->dbh, $string );\n\t\t\t} else {\n\t\t\t\treturn mysql_real_escape_string( $string, $this->dbh );\n\t\t\t}\n\t\t}\n\n\t\t$class = get_class( $this );\n\t\tif ( function_exists( '__' ) ) {\n\t\t\t/* translators: %s: database access abstraction class, usually wpdb or a class extending wpdb */\n\t\t\t_doing_it_wrong( $class, sprintf( __( '%s must set a database connection for use with escaping.' ), $class ), '3.6.0' );\n\t\t} else {\n\t\t\t_doing_it_wrong( $class, sprintf( '%s must set a database connection for use with escaping.', $class ), '3.6.0' );\n\t\t}\n\t\treturn addslashes( $string );\n\t}", "label_name": "Base", "label": 1} {"code": " function productFeed() {\n// global $db;\n //check query password to avoid DDOS\n /*\n * condition = new\n * description \n * id - SKU \n * link \n * price \n * title \n * brand - manufacturer \n * image link - fullsized image, up to 10, comma seperated \n * product type - category - \"Electronics > Audio > Audio Accessories MP3 Player Accessories\",\"Health & Beauty > Healthcare > Biometric Monitors > Pedometers\" \n */\n $out = '\"id\",\"condition\",\"description\",\"like\",\"price\",\"title\",\"brand\",\"image link\",\"product type\"' . chr(13) . chr(10);\n\n $p = new product();\n $prods = $p->find('all', 'parent_id=0 AND ');\n //$prods = $db->selectObjects('product','parent_id=0 AND');\n }", "label_name": "Base", "label": 1} {"code": "\t function update_upcharge() {\n $this->loc->src = \"@globalstoresettings\";\n $config = new expConfig($this->loc);\n\t\t$this->config = $config->config;\n\t\t\n\t\t//This will make sure that only the country or region that given a rate value will be saved in the db\n\t\t$upcharge = array();\n\t\tforeach($this->params['upcharge'] as $key => $item) {\n\t\t\tif(!empty($item)) {\n\t\t\t\t$upcharge[$key] = $item;\n\t\t\t}\n\t\t}\n\t\t$this->config['upcharge'] = $upcharge;\n\t\t\n $config->update(array('config'=>$this->config));\n flash('message', gt('Configuration updated'));\n expHistory::back();\n }", "label_name": "Base", "label": 1} {"code": " $this->subtaskTimeTrackingModel->logEndTime($subtaskId, $this->userSession->getId());\n $this->subtaskTimeTrackingModel->updateTaskTimeTracking($task['id']);\n }", "label_name": "Base", "label": 1} {"code": "\tpublic function testPages () {\n $this->visitPages ( $this->allPages );\n\t}", "label_name": "Class", "label": 2} {"code": " public function confirm()\n {\n $task = $this->getTask();\n $link = $this->getTaskLink();\n\n $this->response->html($this->template->render('task_internal_link/remove', array(\n 'link' => $link,\n 'task' => $task,\n )));\n }", "label_name": "Base", "label": 1} {"code": "\tpublic function handleObjectDeletion($confirm_msg = false, $op='del', $userSide=false) {\r\n\t\tglobal $impresscms;\r\n\r\n\t\t$objectid = (isset($_REQUEST[$this->handler->keyName])) ? (int) $_REQUEST[$this->handler->keyName] : 0;\r\n\t\t$icmsObj = $this->handler->get($objectid);\r\n\r\n\t\tif ($icmsObj->isNew()) {\r\n\t\t\tredirect_header(\"javascript:history.go(-1)\", 3, _CO_ICMS_NOT_SELECTED);\r\n\t\t\texit();\r\n\t\t}\r\n\r\n\t\t$confirm = ( isset($_POST['confirm']) ) ? $_POST['confirm'] : 0;\r\n\t\tif ($confirm) {\r\n\t\t\tif (!$this->handler->delete($icmsObj)) {\r\n\t\t\t\tredirect_header($_POST['redirect_page'], 3, _CO_ICMS_DELETE_ERROR . $icmsObj->getHtmlErrors());\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\r\n\t\t\tredirect_header($_POST['redirect_page'], 3, _CO_ICMS_DELETE_SUCCESS);\r\n\t\t\texit();\r\n\t\t} else {\r\n\t\t\t// no confirm: show deletion condition\r\n\r\n\t\t\ticms_cp_header();\r\n\r\n\t\t\tif (!$confirm_msg) {\r\n\t\t\t\t$confirm_msg = _CO_ICMS_DELETE_CONFIRM;\r\n\t\t\t}\r\n\r\n\t\t\t$hiddens = array(\r\n\t\t\t\t\t\t'op' => $op,\r\n\t\t\t\t\t\t$this->handler->keyName => $icmsObj->getVar($this->handler->keyName),\r\n\t\t\t\t\t\t'confirm' => 1,\r\n\t\t\t\t\t\t'redirect_page' => $impresscms->urls['previouspage']\r\n\t\t\t);\r\n\t\t\tif ($this->handler->_moduleName == 'system') {\r\n\t\t\t\t$hiddens['fct'] = isset($_GET['fct']) ? $_GET['fct'] : false;\r\n\t\t\t}\r\n\t\t\ticms_core_Message::confirm($hiddens, xoops_getenv('SCRIPT_NAME'), sprintf($confirm_msg , $icmsObj->getVar($this->handler->identifierName)), _CO_ICMS_DELETE);\r\n\r\n\t\t\ticms_cp_footer();\r\n\r\n\t\t}\r\n\t\texit();\r\n\t}\r", "label_name": "Base", "label": 1} {"code": "\t\t\tforeach($paths as $path)\n\t\t\t{\n\t\t\t\t// Convert wild-cards to RegEx\n\t\t\t\t$path = str_replace(array(':any', '*'), '.*', str_replace(':num', '[0-9]+', $path));\n\n\t\t\t\t// Does the RegEx match?\n\t\t\t\tif (!empty($_SERVER['HTTP_HOST']) AND preg_match('#^'.$path.'$#', $_SERVER['HTTP_HOST']))\n\t\t\t\t{\n\t\t\t\t\tdefine('ENVIRONMENT', $env);\n\t\t\t\t\tbreak 2;\n\t\t\t\t}\n\t\t\t}", "label_name": "Class", "label": 2} {"code": " public function beforeSave() {\n if(strpos($this->tag,self::DELIM) !== false) {\n $this->tag = strtr($this->tag,array(self::DELIM => ''));\n }\n return true;\n }", "label_name": "Class", "label": 2} {"code": "\t\t $controller = new $ctlname();\n\t\t if (method_exists($controller,'isSearchable') && $controller->isSearchable()) {\n//\t\t\t $mods[$controller->name()] = $controller->addContentToSearch();\n $mods[$controller->searchName()] = $controller->addContentToSearch();\n\t\t }\n\t }\n\t\n\t uksort($mods,'strnatcasecmp');\n\t assign_to_template(array(\n 'mods'=>$mods\n ));\n }", "label_name": "Base", "label": 1} {"code": "\tpublic function setListAttributes( $attributes ) {\n\t\t$this->listAttributes = \\Sanitizer::fixTagAttributes( $attributes, 'ul' );\n\t}", "label_name": "Class", "label": 2} {"code": " public function routeDeleteProvider()\n {\n return [\n ['/api/articles/', 1, 'articles', 'batchDelete', false, 200],\n ['/api/v1/articles/', 1, 'articles', 'batchDelete', false, 200],\n ['/api/v2/articles/', 2, 'articles', 'batchDelete', false, 200],\n\n ['/api/articles/5', 1, 'articles', 'delete', 5, 200],\n ['/api/v1/articles/5', 1, 'articles', 'delete', 5, 200],\n ['/api/v2/articles/5', 2, 'articles', 'delete', 5, 200],\n ];\n }", "label_name": "Base", "label": 1} {"code": " public function confirm()\n {\n $project = $this->getProject();\n $swimlane = $this->getSwimlane();\n\n $this->response->html($this->helper->layout->project('swimlane/remove', array(\n 'project' => $project,\n 'swimlane' => $swimlane,\n )));\n }", "label_name": "Class", "label": 2} {"code": " public function remove()\n {\n $this->checkCSRFParam();\n $project = $this->getProject();\n $filter = $this->customFilterModel->getById($this->request->getIntegerParam('filter_id'));\n\n $this->checkPermission($project, $filter);\n\n if ($this->customFilterModel->remove($filter['id'])) {\n $this->flash->success(t('Custom filter removed successfully.'));\n } else {\n $this->flash->failure(t('Unable to remove this custom filter.'));\n }\n\n $this->response->redirect($this->helper->url->to('CustomFilterController', 'index', array('project_id' => $project['id'])));\n }", "label_name": "Base", "label": 1} {"code": " public static function parseAndTrimImport($str, $isHTML = false) { //\ufffdDeath from above\ufffd? \ufffd\n //echo \"1
\"; eDebug($str);\n// global $db;\n\n $str = str_replace(\"\ufffd\", \"’\", $str);\n $str = str_replace(\"\ufffd\", \"‘\", $str);\n $str = str_replace(\"\ufffd\", \"®\", $str);\n $str = str_replace(\"\ufffd\", \"-\", $str);\n $str = str_replace(\"\ufffd\", \"—\", $str);\n $str = str_replace(\"\ufffd\", \"”\", $str);\n $str = str_replace(\"\ufffd\", \"“\", $str);\n $str = str_replace(\"\\r\\n\", \" \", $str);\n $str = str_replace(\"\\,\", \",\", $str);\n $str = str_replace('\"\"', '\"', $str); //do this no matter what...in case someone added a quote in a non HTML field\n if (!$isHTML) {\n //if HTML, then leave the single quotes alone, otheriwse replace w/ special Char \n $str = str_replace('\"', \""\", $str);\n }\n $str = str_replace(\"\ufffd\", \"¼\", $str);\n $str = str_replace(\"\ufffd\", \"½\", $str);\n $str = str_replace(\"\ufffd\", \"¾\", $str);\n //$str = htmlspecialchars($str);\n //$str = utf8_encode($str);\n// if (DB_ENGINE=='mysqli') {\n//\t $str = @mysqli_real_escape_string($db->connection,trim(str_replace(\"\ufffd\", \"™\", $str)));\n// } elseif(DB_ENGINE=='mysql') {\n// $str = @mysql_real_escape_string(trim(str_replace(\"\ufffd\", \"™\", $str)),$db->connection);\n// } else {\n//\t $str = trim(str_replace(\"\ufffd\", \"™\", $str));\n// }\n $str = @expString::escape(trim(str_replace(\"\ufffd\", \"™\", $str)));\n //echo \"2
\"; eDebug($str,die);\n return $str;\n }", "label_name": "Class", "label": 2} {"code": "\tprivate function convertTimestamp( $inputDate ) {\n\t\t$timestamp = $inputDate;\n\t\tswitch ( $inputDate ) {\n\t\t\tcase 'today':\n\t\t\t\t$timestamp = date( 'YmdHis' );\n\t\t\t\tbreak;\n\t\t\tcase 'last hour':\n\t\t\t\t$date = new \\DateTime();\n\t\t\t\t$date->sub( new \\DateInterval( 'P1H' ) );\n\t\t\t\t$timestamp = $date->format( 'YmdHis' );\n\t\t\t\tbreak;\n\t\t\tcase 'last day':\n\t\t\t\t$date = new \\DateTime();\n\t\t\t\t$date->sub( new \\DateInterval( 'P1D' ) );\n\t\t\t\t$timestamp = $date->format( 'YmdHis' );\n\t\t\t\tbreak;\n\t\t\tcase 'last week':\n\t\t\t\t$date = new \\DateTime();\n\t\t\t\t$date->sub( new \\DateInterval( 'P7D' ) );\n\t\t\t\t$timestamp = $date->format( 'YmdHis' );\n\t\t\t\tbreak;\n\t\t\tcase 'last month':\n\t\t\t\t$date = new \\DateTime();\n\t\t\t\t$date->sub( new \\DateInterval( 'P1M' ) );\n\t\t\t\t$timestamp = $date->format( 'YmdHis' );\n\t\t\t\tbreak;\n\t\t\tcase 'last year':\n\t\t\t\t$date = new \\DateTime();\n\t\t\t\t$date->sub( new \\DateInterval( 'P1Y' ) );\n\t\t\t\t$timestamp = $date->format( 'YmdHis' );\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( is_numeric( $timestamp ) ) {\n\t\t\treturn $this->DB->addQuotes( $timestamp );\n\t\t}\n\t\treturn 0;\n\t}", "label_name": "Class", "label": 2} {"code": " public function confirm()\n {\n $project = $this->getProject();\n $filter = $this->customFilterModel->getById($this->request->getIntegerParam('filter_id'));\n\n $this->response->html($this->helper->layout->project('custom_filter/remove', array(\n 'project' => $project,\n 'filter' => $filter,\n 'title' => t('Remove a custom filter')\n )));\n }", "label_name": "Base", "label": 1} {"code": "\tprotected function _mkdir($path, $name) {\n\t\t$path = $this->_joinPath($path, $name);\n\n\t\tif (@mkdir($path)) {\n\t\t\t@chmod($path, $this->options['dirMode']);\n\t\t\tclearstatcache();\n\t\t\treturn $path;\n\t\t}\n\n\t\treturn false;\n\t}", "label_name": "Base", "label": 1} {"code": "function createWhereClause($owner, $filter, $search, $daterange, $ok, $warning, $critical, $unknown)\n{\n\t$where_clause = \"\";\n\t\n\t// owner\n\tif($owner == \"owned\"){ $where_clause .= \" AND owner != ''\"; }\n\telseif($owner == \"not owned\"){ $where_clause .= \" AND owner = ''\"; }\n\n\t// advanced search (with *)\n\tif($search != \"\"){\n\t\t$like = \"\";\n\t\tif( substr($search, 0, 1) === '*' ){\n\t\t\t$like .= \"%\";\n\t\t}\n\t\t$like .= trim($search, '*');\n\t\tif ( substr($search, -1) === '*' ) {\n\t\t\t$like .= \"%\";\n\t\t}\n\n\t\t$where_clause .= \" AND $filter LIKE '$like'\";\n\t}\n\n\t// daterange\n\tif($daterange != \"\"){\n\t\t$daterange_parts = explode(\" - \", $daterange);\n\t\t$start = $daterange_parts[0];\n\t\t$end = $daterange_parts[1];\n\n\t\t// modify start and end timestamp (1 Jan 1970 = -3600).\n\t\t// perhaps a little bug from DateRangePicker\n\t\t$start = strtotime($start);\n\t\t$start += 3600;\n\t\t$end = strtotime($end);\n\t\t$end += 86400 + 3600;\n\t\t$where_clause .= \" AND o_sec > $start AND o_sec < $end\";\n\t}\n\n\t// states\n\t$states_list = \"\";\n\tif($ok != \"\")\t\t{ $states_list .= \"0,\"; }\n\tif($warning != \"\")\t{ $states_list .= \"1,\"; }\n\tif($critical != \"\")\t{ $states_list .= \"2,\"; }\n\tif($unknown != \"\")\t{ $states_list .= \"3,\"; }\n\t$states_list = trim($states_list, \",\");\n\t\n\tif($states_list != \"\"){\n\t\t$where_clause .= \" AND state IN ($states_list)\";\n\t}\n\n\t$where_clause .= \" ORDER BY o_sec DESC LIMIT 500\";\n\treturn $where_clause;\n}", "label_name": "Base", "label": 1} {"code": " public static function webuser_comments_count($webuser_id)\r\n {\r\n global $DB;\r\n global $website;\r\n\r\n $DB->query(' \r\n SELECT COUNT(*) AS total \r\n FROM nv_comments \r\n WHERE website = '.protect($website->id).' \r\n AND user = '.protect($webuser_id).'\r\n AND status = 0'\r\n );\r\n\r\n $out = $DB->result('total');\r\n if(is_array($out))\r\n $out = $out[0];\r\n\r\n return $out;\r\n }\r", "label_name": "Base", "label": 1} {"code": " public static function delete($id) {\r\n $id = Typo::int($id);\r\n try\r\n {\r\n $vars1 = array(\r\n 'table' => 'posts',\r\n 'where' => array(\r\n 'id' => $id\r\n )\r\n );\r\n $d = Db::delete($vars1);\r\n\r\n $vars2 = array(\r\n 'table' => 'posts_param',\r\n 'where' => array(\r\n 'post_id' => $id\r\n )\r\n );\r\n $d = Db::delete($vars2);\r\n Hooks::run('post_sqldel_action', $id);\r\n return true;\r\n }\r\n catch (Exception $e)\r\n {\r\n return $e->getMessage();\r\n }\r\n\r\n }\r", "label_name": "Base", "label": 1} {"code": "function teampass_whitelist() {\n $bdd = teampass_connect();\n\t$apiip_pool = teampass_get_ips();\n\tif (count($apiip_pool) > 0 && !array_search($_SERVER['REMOTE_ADDR'], $apiip_pool)) {\n\t\trest_error('IPWHITELIST');\n\t}\n}", "label_name": "Base", "label": 1} {"code": "function process_user(){\n #'''Call /delta for the given user ID and process any changes.'''\n// creation d'un client dropbox\n include(\"lib/dropboxAPI.php\");\n $myCustomClient = new dbx\\Client($accessToken, $clientIdentifier);\n\n //Articles\n $pathPrefix=\"/Chargements appareil photo/ArticleTdm\";\n $cursortxt = \"lib/cursor.txt\";\n $url=\"url\";\n delta($myCustomClient ,$cursortxt, $url, $pathPrefix);\n\n //Challenge\n $pathPrefix=\"/Chargements appareil photo/ChallengeTdm\";\n $cursortxt = \"lib/cursorC.txt\";\n $url=\"challenge_update\";\n delta($myCustomClient , $cursortxt, $url, $pathPrefix);\n}", "label_name": "Base", "label": 1} {"code": " function update() {\r\n parent::update();\r\n expSession::clearAllUsersSessionCache('navigation');\r\n }\r", "label_name": "Base", "label": 1} {"code": "function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1)\n{\n\t// List of special chars for filenames in windows are defined on page https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file\n\t// Char '>' '<' '|' '$' and ';' are special chars for shells.\n\t// Char '/' and '\\' are file delimiters.\n\t$filesystem_forbidden_chars = array('<', '>', '/', '\\\\', '?', '*', '|', '\"', ':', '\u00b0', '$', ';');\n\treturn dol_string_nospecial($unaccent ?dol_string_unaccent($str) : $str, $newstr, $filesystem_forbidden_chars);\n}", "label_name": "Base", "label": 1} {"code": " self::$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);\n return self::$mysqli;\n }\n }", "label_name": "Base", "label": 1} {"code": "\tpublic function delete_version() {\n\t if (empty($this->params['id'])) {\n\t flash('error', gt('The version you are trying to delete could not be found'));\n\t }\n\t \n\t // get the version\n\t $version = new help_version($this->params['id']);\n\t if (empty($version->id)) {\n\t flash('error', gt('The version you are trying to delete could not be found'));\n\t }\n\t \n\t // if we have errors than lets get outta here!\n\t if (!expQueue::isQueueEmpty('error')) expHistory::back();\n\t \n\t // delete the version\n\t $version->delete();\n\t \n\t expSession::un_set('help-version');\n\n\t flash('message', gt('Deleted version').' '.$version->version.' '.gt('and all documents in that version.'));\n\t expHistory::back();\t \n\t}", "label_name": "Class", "label": 2} {"code": "function phoromatic_account_id_to_group_name($account_id)\n{\n\t// XXX deprecated\n\treturn phoromatic_server::account_id_to_group_name($account_id);\n}", "label_name": "Base", "label": 1} {"code": " public function validate() {\n global $db;\n // check for an sef url field. If it exists make sure it's valid and not a duplicate\n //this needs to check for SEF URLS being turned on also: TODO\n\n if (property_exists($this, 'sef_url') && !(in_array('sef_url', $this->do_not_validate))) {\n if (empty($this->sef_url)) $this->makeSefUrl();\n if (!isset($this->validates['is_valid_sef_name']['sef_url'])) $this->validates['is_valid_sef_name']['sef_url'] = array();\n if (!isset($this->validates['uniqueness_of']['sef_url'])) $this->validates['uniqueness_of']['sef_url'] = array();\n }\n\n // safeguard again loc data not being pass via forms...sometimes this happens when you're in a router\n // mapped view and src hasn't been passed in via link to the form \n if (isset($this->id) && empty($this->location_data)) {\n $loc = $db->selectValue($this->tablename, 'location_data', 'id=' . $this->id);\n if (!empty($loc)) $this->location_data = $loc;\n }\n\n // run the validation as defined in the models\n if (!isset($this->validates)) return true;\n $messages = array();\n $post = empty($_POST) ? array() : expString::sanitize($_POST);\n foreach ($this->validates as $validation=> $field) {\n foreach ($field as $key=> $value) {\n $fieldname = is_numeric($key) ? $value : $key;\n $opts = is_numeric($key) ? array() : $value;\n $ret = expValidator::$validation($fieldname, $this, $opts);\n if (!is_bool($ret)) {\n $messages[] = $ret;\n expValidator::setErrorField($fieldname);\n unset($post[$fieldname]);\n }\n }\n }\n\n if (count($messages) >= 1) expValidator::failAndReturnToForm($messages, $post);\n }", "label_name": "Class", "label": 2} {"code": "\tpublic function quicksearch($text)\r\n\t{\r\n\t\tglobal $DB;\r\n\t\tglobal $website;\r\n\t\t\r\n\t\t$like = ' LIKE '.protect('%'.$text.'%');\r\n\t\t\r\n\t\t// we search for the IDs at the dictionary NOW (to avoid inefficient requests)\r\n\t\t\r\n\t\t$DB->query('SELECT DISTINCT (nvw.node_id)\r\n\t\t\t\t\t FROM nv_webdictionary nvw\r\n\t\t\t\t\t WHERE nvw.node_type = \"feed\" \r\n\t\t\t\t\t AND nvw.website = '.$website->id.' \r\n\t\t\t\t\t AND nvw.text '.$like, 'array');\r\n\t\t\t\t\t\t \r\n\t\t$dict_ids = $DB->result(\"node_id\");\r\n\t\t\r\n\t\t// all columns to look for\t\r\n\t\t$cols[] = 'i.id' . $like;\r\n\r\n\t\tif(!empty($dict_ids))\r\n\t\t\t$cols[] = 'i.id IN ('.implode(',', $dict_ids).')';\r\n\t\t\t\r\n\t\t$where = ' AND ( ';\t\r\n\t\t$where.= implode( ' OR ', $cols); \r\n\t\t$where .= ')';\r\n\t\t\r\n\t\treturn $where;\r\n\t}\t\r", "label_name": "Base", "label": 1} {"code": "\tpublic static function sessionDataDecode(&$var, $checkIs = null) {\n\t\tif (self::$base64encodeSessionData) {\n\t\t\t$data = @unserialize(@base64_decode($var));\n\t\t} else {\n\t\t\t$data = $var;\n\t\t}\n\t\t$chk = true;\n\t\tif ($checkIs) {\n\t\t\tswitch ($checkIs) {\n\t\t\t\tcase 'array':\n\t\t\t\t\t$chk = is_array($data);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'string':\n\t\t\t\t\t$chk = is_string($data);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'object':\n\t\t\t\t\t$chk = is_object($data);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'int':\n\t\t\t\t\t$chk = is_int($data);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!$chk) {\n\t\t\tunset($var);\n\t\t\treturn false;\n\t\t}\n\t\treturn $data;\n\t}", "label_name": "Base", "label": 1} {"code": " public function load($id)\n {\n try {\n $select = $this->zdb->select($this->table);\n $select->where($this->fpk . ' = ' . $id);\n\n $results = $this->zdb->execute($select);\n if ($results->count() > 0) {\n $result = $results->current();\n $this->loadFromRS($result);\n\n return true;\n } else {\n Analog::log(\n 'Unknown ID ' . $id,\n Analog::ERROR\n );\n return false;\n }\n } catch (Throwable $e) {\n Analog::log(\n 'Cannot load ' . $this->getType() . ' from id `' . $id . '` | ' .\n $e->getMessage(),\n Analog::WARNING\n );\n throw $e;\n }\n }", "label_name": "Base", "label": 1} {"code": " public static function getHelpVersion($version_id) {\n global $db;\n\n return $db->selectValue('help_version', 'version', 'id=\"'.$version_id.'\"');\n }", "label_name": "Base", "label": 1} {"code": " public function saveConfig() { \n if (!empty($this->params['aggregate']) || !empty($this->params['pull_rss'])) {\n if ($this->params['order'] == 'rank ASC') {\n expValidator::failAndReturnToForm(gt('User defined ranking is not allowed when aggregating or pull RSS data feeds.'), $this->params);\n }\n }\n \n parent::saveConfig();\n }", "label_name": "Base", "label": 1} {"code": "\tfunction edit() {\n\t if (empty($this->params['content_id'])) {\n\t flash('message',gt('An error occurred: No content id set.'));\n expHistory::back(); \n\t } \n /* The global constants can be overridden by passing appropriate params */\n //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet\n// $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login'];\n// $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval'];\n// $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification'];\n// $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email'];\n \n \n\t $id = empty($this->params['id']) ? null : $this->params['id'];\n\t $comment = new expComment($id);\n //FIXME here is where we might sanitize the comment before displaying/editing it\n\t\tassign_to_template(array(\n\t\t 'content_id'=>$this->params['content_id'],\n 'content_type'=>$this->params['content_type'],\n\t\t 'comment'=>$comment\n\t\t));\n\t}\t", "label_name": "Base", "label": 1} {"code": "\tfunction edit_vendor() {\n\t\t$vendor = new vendor();\n\t\t\n\t\tif(isset($this->params['id'])) {\n\t\t\t$vendor = $vendor->find('first', 'id =' .$this->params['id']);\n\t\t\tassign_to_template(array(\n 'vendor'=>$vendor\n ));\n\t\t}\n\t}", "label_name": "Base", "label": 1} {"code": " public function index(Request $request)\n {\n\n $contents = $this->getComments($request);\n\n\n return $this->view('comment::admin.comments.index', ['contents' => $contents]);\n }", "label_name": "Base", "label": 1} {"code": " public function save($check_notify = false)\n {\n if (isset($_POST['email_recipients']) && is_array($_POST['email_recipients'])) {\n $this->email_recipients = base64_encode(serialize($_POST['email_recipients']));\n }\n\n return parent::save($check_notify);\n }", "label_name": "Class", "label": 2} {"code": " private function getMergeSql()\n {\n switch ($this->driver) {\n case 'mysql':\n return \"INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :lifetime, :time) \".\n \"ON DUPLICATE KEY UPDATE $this->dataCol = VALUES($this->dataCol), $this->lifetimeCol = VALUES($this->lifetimeCol), $this->timeCol = VALUES($this->timeCol)\";\n case 'oci':\n // DUAL is Oracle specific dummy table\n return \"MERGE INTO $this->table USING DUAL ON ($this->idCol = :id) \".\n \"WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :lifetime, :time) \".\n \"WHEN MATCHED THEN UPDATE SET $this->dataCol = :data, $this->lifetimeCol = :lifetime, $this->timeCol = :time\";\n case 'sqlsrv' === $this->driver && version_compare($this->pdo->getAttribute(\\PDO::ATTR_SERVER_VERSION), '10', '>='):\n // MERGE is only available since SQL Server 2008 and must be terminated by semicolon\n // It also requires HOLDLOCK according to http://weblogs.sqlteam.com/dang/archive/2009/01/31/UPSERT-Race-Condition-With-MERGE.aspx\n return \"MERGE INTO $this->table WITH (HOLDLOCK) USING (SELECT 1 AS dummy) AS src ON ($this->idCol = :id) \".\n \"WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :lifetime, :time) \".\n \"WHEN MATCHED THEN UPDATE SET $this->dataCol = :data, $this->lifetimeCol = :lifetime, $this->timeCol = :time;\";\n case 'sqlite':\n return \"INSERT OR REPLACE INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :lifetime, :time)\";\n }\n }", "label_name": "Base", "label": 1} {"code": " public function delete($id) {\n $this->auth->checkIfOperationIsAllowed('delete_user');\n //Test if user exists\n $data['users_item'] = $this->users_model->getUsers($id);\n if (empty($data['users_item'])) {\n redirect('notfound');\n } else {\n $this->users_model->deleteUser($id);\n }\n log_message('error', 'User #' . $id . ' has been deleted by user #' . $this->session->userdata('id'));\n $this->session->set_flashdata('msg', lang('users_delete_flash_msg_success'));\n redirect('users');\n }", "label_name": "Compound", "label": 4} {"code": "\tprotected function canCreateTmb($path, $stat, $checkTmbPath = true) {\n\t\treturn (!$checkTmbPath || $this->tmbPathWritable) \n\t\t\t&& (!$this->tmbPath || strpos($path, $this->tmbPath) === false) // do not create thumnbnail for thumnbnail\n\t\t\t&& $this->imgLib \n\t\t\t&& strpos($stat['mime'], 'image') === 0 \n\t\t\t&& ($this->imgLib == 'gd' ? in_array($stat['mime'], array('image/jpeg', 'image/png', 'image/gif', 'image/x-ms-bmp')) : true);\n\t}", "label_name": "Base", "label": 1} {"code": " public function downloadfile() {\n if (empty($this->params['fileid'])) {\n flash('error', gt('There was an error while trying to download your file. No File Specified.'));\n expHistory::back();\n }\n \n $fd = new filedownload($this->params['fileid']); \n if (empty($this->params['filenum'])) $this->params['filenum'] = 0;\n\n if (empty($fd->expFile['downloadable'][$this->params['filenum']]->id)) {\n flash('error', gt('There was an error while trying to download your file. The file you were looking for could not be found.'));\n expHistory::back();\n } \n \n $fd->downloads++;\n $fd->save();\n \n // this will set the id to the id of the actual file..makes the download go right.\n $this->params['id'] = $fd->expFile['downloadable'][$this->params['filenum']]->id;\n parent::downloadfile(); \n }", "label_name": "Base", "label": 1} {"code": "\tpublic function localFileSystemInotify($path, $standby, $compare) {\n\t\tif (isset($this->sessionCache['localFileSystemInotify_disable'])) {\n\t\t\treturn false;\n\t\t}\n\t\t$path = realpath($path);\n\t\t$mtime = filemtime($path);\n\t\tif ($mtime != $compare) {\n\t\t\treturn $mtime;\n\t\t}\n\t\t$inotifywait = defined('ELFINER_INOTIFYWAIT_PATH')? ELFINER_INOTIFYWAIT_PATH : 'inotifywait';\n\t\t$path = escapeshellarg($path);\n\t\t$standby = max(1, intval($standby));\n\t\t$cmd = $inotifywait.' '.$path.' -t '.$standby.' -e moved_to,moved_from,move,close_write,delete,delete_self';\n\t\t$this->procExec($cmd , $o, $r);\n\t\tif ($r === 0) {\n\t\t\t// changed\n\t\t\tclearstatcache();\n\t\t\t$mtime = @filemtime($path); // error on busy?\n\t\t\treturn $mtime? $mtime : time();\n\t\t} else if ($r === 2) {\n\t\t\t// not changed (timeout)\n\t\t\treturn $compare;\n\t\t}\n\t\t// error\n\t\t// cache to $_SESSION\n\t\t$this->sessionCache['localFileSystemInotify_disable'] = true;\n\t\t$this->session->set($this->id, $this->sessionCache, true);\n\t\treturn false;\n\t}", "label_name": "Base", "label": 1} {"code": "\tpublic static function login() {\n\t\tuser::login(expString::sanitize($_POST['username']),expString::sanitize($_POST['password']));\n\t\tif (!isset($_SESSION[SYS_SESSION_KEY]['user'])) { // didn't successfully log in\n\t\t\tflash('error', gt('Invalid Username / Password'));\n\t\t\tif (expSession::is_set('redirecturl_error')) {\n\t\t\t\t$url = expSession::get('redirecturl_error');\n\t\t\t\texpSession::un_set('redirecturl_error');\n\t\t\t\theader(\"Location: \".$url);\n\t\t\t} else {\n\t\t\t\texpHistory::back();\n\t\t\t}\n\t\t} else { // we're logged in\n\t\t\tglobal $user;\n\n if (expSession::get('customer-login')) expSession::un_set('customer-login');\n\t\t\tif (!empty($_POST['username'])) flash('message', gt('Welcome back').' '.expString::sanitize($_POST['username']));\n if ($user->isAdmin()) {\n expHistory::back();\n } else {\n foreach ($user->groups as $g) {\n if (!empty($g->redirect)) {\n $url = URL_FULL.$g->redirect;\n break;\n }\n }\n if (isset($url)) {\n header(\"Location: \".$url);\n } else {\n expHistory::back();\n }\n }\n\t\t}\n\t}", "label_name": "Class", "label": 2} {"code": " public function __construct() {\r\n\r\n self::map();\r\n\r\n }\r", "label_name": "Base", "label": 1} {"code": " $module_views[$key]['name'] = gt($value['name']);\n }\n\n // look for a config form for this module's current view \n// $controller->loc->mod = expModules::getControllerClassName($controller->loc->mod);\n //check to see if hcview was passed along, indicating a hard-coded module\n// if (!empty($controller->params['hcview'])) {\n// $viewname = $controller->params['hcview'];\n// } else {\n// $viewname = $db->selectValue('container', 'view', \"internal='\".serialize($controller->loc).\"'\");\n// }\n// $viewconfig = $viewname.'.config';\n// foreach ($modpaths as $path) {\n// if (file_exists($path.'/'.$viewconfig)) {\n// $fileparts = explode('_', $viewname);\n// if ($fileparts[0]=='show'||$fileparts[0]=='showall') array_shift($fileparts);\n// $module_views[$viewname]['name'] = ucwords(implode(' ', $fileparts)).' '.gt('View Configuration');\n// $module_views[$viewname]['file'] =$path.'/'.$viewconfig;\n// }\n// }\n \n // sort the views highest to lowest by filename\n // we are reverse sorting now so our array merge\n // will overwrite property..we will run array_reverse\n // when we're finished to get them back in the right order\n krsort($common_views);\n krsort($module_views);\n\n if (!empty($moduleconfig)) $common_views = array_merge($common_views, $moduleconfig);\n $views = array_merge($common_views, $module_views);\n $views = array_reverse($views);\n\n return $views;\n}", "label_name": "Base", "label": 1} {"code": " function edit_option_master() {\n expHistory::set('editable', $this->params);\n \n $params = isset($this->params['id']) ? $this->params['id'] : $this->params;\n $record = new option_master($params); \n assign_to_template(array(\n 'record'=>$record\n ));\n }", "label_name": "Class", "label": 2} {"code": " public function submit(Request $request)\n {\n return logout();\n }", "label_name": "Compound", "label": 4} {"code": " public function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0) {\n $this->host = $host;\n\n // If no port value is passed, retrieve it\n if ($port == false) {\n $this->port = $this->POP3_PORT;\n } else {\n $this->port = $port;\n }\n\n // If no port value is passed, retrieve it\n if ($tval == false) {\n $this->tval = $this->POP3_TIMEOUT;\n } else {\n $this->tval = $tval;\n }\n\n $this->do_debug = $debug_level;\n $this->username = $username;\n $this->password = $password;\n\n // Refresh the error log\n $this->error = null;\n\n // Connect\n $result = $this->Connect($this->host, $this->port, $this->tval);\n\n if ($result) {\n $login_result = $this->Login($this->username, $this->password);\n\n if ($login_result) {\n $this->Disconnect();\n\n return true;\n }\n\n }\n\n // We need to disconnect regardless if the login succeeded\n $this->Disconnect();\n\n return false;\n }", "label_name": "Base", "label": 1} {"code": " $comments->records[$key]->avatar = $db->selectObject('user_avatar',\"user_id='\".$record->poster.\"'\");\n }\n\n if (empty($this->params['config']['disable_nested_comments'])) $comments->records = self::arrangecomments($comments->records);\n // eDebug($sql, true);\n \n // count the unapproved comments\n if ($require_approval == 1 && $user->isAdmin()) {\n $sql = 'SELECT count(com.id) as c FROM '.$db->prefix.'expComments com ';\n $sql .= 'JOIN '.$db->prefix.'content_expComments cnt ON com.id=cnt.expcomments_id ';\n $sql .= 'WHERE cnt.content_id='.$this->params['content_id'].\" AND cnt.content_type='\".$this->params['content_type'].\"' \";\n $sql .= 'AND com.approved=0';\n $unapproved = $db->countObjectsBySql($sql);\n } else {\n $unapproved = 0;\n } \n \n $this->config = $this->params['config'];\n $type = !empty($this->params['type']) ? $this->params['type'] : gt('Comment');\n $ratings = !empty($this->params['ratings']) ? true : false;\n\n assign_to_template(array(\n 'comments'=>$comments,\n 'config'=>$this->params['config'],\n 'unapproved'=>$unapproved,\n\t\t\t'content_id'=>$this->params['content_id'], \n\t\t\t'content_type'=>$this->params['content_type'],\n\t\t\t'user'=>$user,\n\t\t\t'hideform'=>$this->params['hideform'],\n\t\t\t'hidecomments'=>$this->params['hidecomments'],\n\t\t\t'title'=>$this->params['title'],\n\t\t\t'formtitle'=>$this->params['formtitle'],\n 'type'=>$type,\n 'ratings'=>$ratings,\n 'require_login'=>$require_login,\n 'require_approval'=>$require_approval,\n 'require_notification'=>$require_notification,\n 'notification_email'=>$notification_email,\n\t\t));\n\t}", "label_name": "Class", "label": 2} {"code": "\tfunction access($attr, $path, $data, $volume) {\n\t\treturn strpos(basename($path), '.') === 0 // if file/folder begins with '.' (dot)\n\t\t\t? !($attr == 'read' || $attr == 'write') // set read+write to false, other (locked+hidden) set to true\n\t\t\t: null; // else elFinder decide it itself\n\t}", "label_name": "Base", "label": 1} {"code": "function nvweb_menu_load_actions()\r\n{\r\n\tglobal $DB;\t\r\n\tglobal $structure;\r\n\tglobal $current;\r\n\tglobal $website;\r\n\t\t\t\r\n\tif(empty($structure['actions']))\r\n\t{\r\n\t\t$structure['actions'] = array();\r\n\r\n\t\t$DB->query('\r\n SELECT node_id, subtype, text\r\n\t\t\t FROM nv_webdictionary \r\n\t\t\t WHERE node_type = \"structure\"\r\n\t\t\t AND lang = '.protect($current['lang']).'\r\n\t\t\t AND subtype IN(\"action-type\", \"action-jump-item\", \"action-jump-branch\", \"action-new-window\")\r\n\t\t\t AND website = '.$website->id\r\n );\r\n\t\t\t\t\t\r\n\t\t$data = $DB->result();\r\n\t\t\r\n\t\tif(!is_array($data))\r\n\t\t $data = array();\r\n\r\n\t\tforeach($data as $row)\r\n\t\t{\r\n\t\t\t$structure['actions'][$row->node_id][$row->subtype] = $row->text;\r\n\t\t}\r\n\t}\r\n}\r", "label_name": "Base", "label": 1} {"code": " public static function activate($id){\r\n $act = Db::query(\r\n sprintf(\"UPDATE `user` SET `status` = '1' WHERE `id` = '%d'\", \r\n Typo::int($id)\r\n )\r\n );\r\n if($act){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": " $sloc = expCore::makeLocation('navigation', null, $section->id);\r\n // remove any manage permissions for this page and it's children\r\n // $db->delete('userpermission', \"module='navigationController' AND internal=\".$section->id);\r\n // $db->delete('grouppermission', \"module='navigationController' AND internal=\".$section->id);\r\n foreach ($allusers as $uid) {\r\n $u = user::getUserById($uid);\r\n expPermissions::grant($u, 'manage', $sloc);\r\n }\r\n foreach ($allgroups as $gid) {\r\n $g = group::getGroupById($gid);\r\n expPermissions::grantGroup($g, 'manage', $sloc);\r\n }\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": "\tpublic static function login() {\n\t\tuser::login(expString::sanitize($_POST['username']),expString::sanitize($_POST['password']));\n\t\tif (!isset($_SESSION[SYS_SESSION_KEY]['user'])) { // didn't successfully log in\n\t\t\tflash('error', gt('Invalid Username / Password'));\n\t\t\tif (expSession::is_set('redirecturl_error')) {\n\t\t\t\t$url = expSession::get('redirecturl_error');\n\t\t\t\texpSession::un_set('redirecturl_error');\n\t\t\t\theader(\"Location: \".$url);\n\t\t\t} else {\n\t\t\t\texpHistory::back();\n\t\t\t}\n\t\t} else { // we're logged in\n\t\t\tglobal $user;\n\n if (expSession::get('customer-login')) expSession::un_set('customer-login');\n\t\t\tif (!empty($_POST['username'])) flash('message', gt('Welcome back').' '.expString::sanitize($_POST['username']));\n if ($user->isAdmin()) {\n expHistory::back();\n } else {\n foreach ($user->groups as $g) {\n if (!empty($g->redirect)) {\n $url = URL_FULL.$g->redirect;\n break;\n }\n }\n if (isset($url)) {\n header(\"Location: \".$url);\n } else {\n expHistory::back();\n }\n }\n\t\t}\n\t}", "label_name": "Base", "label": 1} {"code": "\t\t\\CsrfMagic\\Csrf::$callback = function ($tokens) {\n\t\t\tthrow new \\App\\Exceptions\\AppException('Invalid request - Response For Illegal Access', 403);\n\t\t};", "label_name": "Compound", "label": 4} {"code": " static function activate($uid, $karmalevel = 'pear.dev')\n {\n require_once 'Damblan/Karma.php';\n\n global $dbh, $auth_user;\n\n $karma = new Damblan_Karma($dbh);\n\n $user = user::info($uid, null, 0);\n if (!isset($user['registered'])) {\n return false;\n }\n @$arr = unserialize($user['userinfo']);\n\n include_once 'pear-database-note.php';\n note::removeAll($uid);\n\n $data = array();\n $data['registered'] = 1;\n $data['active'] = 1;\n /* $data['ppp_only'] = 0; */\n if (is_array($arr)) {\n $data['userinfo'] = $arr[1];\n }\n $data['created'] = gmdate('Y-m-d H:i');\n $data['createdby'] = $auth_user->handle;\n $data['handle'] = $user['handle'];\n\n user::update($data, true);\n\n $karma->grant($user['handle'], $karmalevel);\n if ($karma->has($user['handle'], 'pear.dev')) {\n include_once 'pear-rest.php';\n $pear_rest = new pearweb_Channel_REST_Generator(PEAR_REST_PATH, $dbh);\n $pear_rest->saveMaintainerREST($user['handle']);\n $pear_rest->saveAllMaintainersREST();\n }\n\n include_once 'pear-database-note.php';\n note::add($uid, \"Account opened\");\n $msg = \"Your PEAR account request has been opened.\\n\".\n \"To log in, go to http://\" . PEAR_CHANNELNAME . \"/ and click on \\\"login\\\" in\\n\".\n \"the top-right menu.\\n\";\n $xhdr = 'From: ' . $auth_user->handle . '@php.net';\n if (!DEVBOX) {\n mail($user['email'], \"Your PEAR Account Request\", $msg, $xhdr, '-f ' . PEAR_BOUNCE_EMAIL);\n }\n return true;\n }", "label_name": "Base", "label": 1} {"code": " function edit_section() {\r\n global $db, $user;\r\n\r\n $parent = new section($this->params['parent']);\r\n if (empty($parent->id)) $parent->id = 0;\r\n assign_to_template(array(\r\n 'haveStandalone' => ($db->countObjects('section', 'parent=-1') && $parent->id >= 0),\r\n 'parent' => $parent,\r\n 'isAdministrator' => $user->isAdmin(),\r\n ));\r\n }\r", "label_name": "Class", "label": 2} {"code": " public function withoutHeader($header)\n {\n if (!$this->hasHeader($header)) {\n return $this;\n }\n\n $new = clone $this;\n $name = strtolower($header);\n unset($new->headers[$name]);\n\n foreach (array_keys($new->headerLines) as $key) {\n if (strtolower($key) === $name) {\n unset($new->headerLines[$key]);\n }\n }\n\n return $new;\n }", "label_name": "Base", "label": 1} {"code": " function reparent_standalone() {\r\n $standalone = $this->section->find($this->params['page']);\r\n if ($standalone) {\r\n $standalone->parent = $this->params['parent'];\r\n $standalone->update();\r\n expSession::clearAllUsersSessionCache('navigation');\r\n expHistory::back();\r\n } else {\r\n notfoundController::handle_not_found();\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": "\tpublic function delete_version() {\n\t if (empty($this->params['id'])) {\n\t flash('error', gt('The version you are trying to delete could not be found'));\n\t }\n\t \n\t // get the version\n\t $version = new help_version($this->params['id']);\n\t if (empty($version->id)) {\n\t flash('error', gt('The version you are trying to delete could not be found'));\n\t }\n\t \n\t // if we have errors than lets get outta here!\n\t if (!expQueue::isQueueEmpty('error')) expHistory::back();\n\t \n\t // delete the version\n\t $version->delete();\n\t \n\t expSession::un_set('help-version');\n\n\t flash('message', gt('Deleted version').' '.$version->version.' '.gt('and all documents in that version.'));\n\t expHistory::back();\t \n\t}", "label_name": "Base", "label": 1} {"code": " function move_standalone() {\r\n expSession::clearAllUsersSessionCache('navigation');\r\n assign_to_template(array(\r\n 'parent' => $this->params['parent'],\r\n ));\r\n }\r", "label_name": "Class", "label": 2} {"code": " public static function navtojson() {\r\n return json_encode(self::navhierarchy());\r\n }\r", "label_name": "Class", "label": 2} {"code": "function VerifyVariableSchedule($columns)\n{\n// $teacher=$columns['TEACHER_ID'];\n// $secteacher=$columns['SECONDARY_TEACHER_ID'];\n// if($_REQUEST['tables']['course_periods'][$_REQUEST['course_period_id']]['TEACHER_ID']!='')\n// $all_teacher=$teacher.($secteacher!=''?','.$secteacher:'');\n// else\n// $all_teacher=($secteacher!=''?$secteacher:'');\n \n \n $teacher=($_REQUEST['tables']['course_periods'][$_REQUEST['course_period_id']]['TEACHER_ID']!=''?$_REQUEST['tables']['course_periods'][$_REQUEST['course_period_id']]['TEACHER_ID']:$columns['TEACHER_ID']);\n $secteacher=($_REQUEST['tables']['course_periods'][$_REQUEST['course_period_id']]['SECONDARY_TEACHER_ID']!=''?$_REQUEST['tables']['course_periods'][$_REQUEST['course_period_id']]['SECONDARY_TEACHER_ID']:$columns['SECONDARY_TEACHER_ID']);\n // $secteacher=$qr_teachers[1]['SECONDARY_TEACHER_ID'];\n\n if($_REQUEST['tables']['course_periods'][$_REQUEST['course_period_id']]['TEACHER_ID']!='')\n $all_teacher=$teacher.($secteacher!=''?','.$secteacher:'');", "label_name": "Base", "label": 1} {"code": " $backup = ['sys' => $GLOBALS['TYPO3_CONF_VARS']['SYS'], 'server' => $_SERVER];", "label_name": "Class", "label": 2} {"code": " public function actionGetItems(){\n $sql = \n 'SELECT id, name as value \n FROM x2_templates \n WHERE name \n LIKE :qterm \n ORDER BY name ASC';\n\n $command = Yii::app()->db->createCommand($sql);\n $qterm = $_GET['term'].'%';\n $command->bindParam(\":qterm\", $qterm, PDO::PARAM_STR);\n $result = $command->queryAll();\n echo CJSON::encode($result); exit;\n }", "label_name": "Class", "label": 2} {"code": " public function actionGetItems() {\n $sql = 'SELECT id, name as value FROM x2_accounts WHERE name LIKE :qterm ORDER BY name ASC';\n $command = Yii::app()->db->createCommand($sql);\n $qterm = $_GET['term'] . '%';\n $command->bindParam(\":qterm\", $qterm, PDO::PARAM_STR);\n $result = $command->queryAll();\n echo CJSON::encode($result);\n exit;\n }", "label_name": "Class", "label": 2} {"code": " public function __construct(Image $image, File $file, ImageRepo $imageRepo)\n {\n $this->image = $image;\n $this->file = $file;\n $this->imageRepo = $imageRepo;\n }", "label_name": "Base", "label": 1} {"code": " public function confirm()\n {\n $task = $this->getTask();\n $link_id = $this->request->getIntegerParam('link_id');\n $link = $this->taskExternalLinkModel->getById($link_id);\n\n if (empty($link)) {\n throw new PageNotFoundException();\n }\n\n $this->response->html($this->template->render('task_external_link/remove', array(\n 'link' => $link,\n 'task' => $task,\n )));\n }", "label_name": "Class", "label": 2} {"code": " public static function get_param($key = NULL) {\n $info = [\n 'stype' => htmlentities(self::$search_type),\n 'stext' => htmlentities(self::$search_text),\n 'method' => htmlentities(self::$search_method),\n 'datelimit' => self::$search_date_limit,\n 'fields' => self::$search_fields,\n 'sort' => self::$search_sort,\n 'chars' => htmlentities(self::$search_chars),\n 'order' => self::$search_order,\n 'forum_id' => self::$forum_id,\n 'memory_limit' => self::$memory_limit,\n 'composevars' => self::$composevars,\n 'rowstart' => self::$rowstart,\n 'search_param' => self::$search_param,\n ];\n\n return $key === NULL ? $info : (isset($info[$key]) ? $info[$key] : NULL);\n }", "label_name": "Compound", "label": 4} {"code": " foreach ($value as $k => $val) {\n if ($k != 'LAST_UPDATED') {\n if ($k != 'UPDATED_BY') {\n if ($k == 'ID')\n $data['data'][$i]['SCHOOL_ID'] = $val;\n else if ($k == 'SYEAR')\n $data['data'][$i]['SCHOOL_YEAR'] = $val;\n else if ($k == 'TITLE')\n $data['data'][$i]['SCHOOL_NAME'] = $val;\n else if ($k == 'WWW_ADDRESS')\n $data['data'][$i]['URL'] = $val;\n else\n $data['data'][$i][$k] = $val;\n }\n }\n }", "label_name": "Base", "label": 1} {"code": "function exception_for($reason)\n{\n return $reason instanceof \\Exception\n ? $reason\n : new RejectionException($reason);\n}", "label_name": "Base", "label": 1} {"code": " public function params()\n {\n $project = $this->getProject();\n $values = $this->request->getValues();\n\n if (empty($values['action_name']) || empty($values['project_id']) || empty($values['event_name'])) {\n $this->create();\n return;\n }\n\n $action = $this->actionManager->getAction($values['action_name']);\n $action_params = $action->getActionRequiredParameters();\n\n if (empty($action_params)) {\n $this->doCreation($project, $values + array('params' => array()));\n }\n\n $projects_list = $this->projectUserRoleModel->getActiveProjectsByUser($this->userSession->getId());\n unset($projects_list[$project['id']]);\n\n $this->response->html($this->template->render('action_creation/params', array(\n 'values' => $values,\n 'action_params' => $action_params,\n 'columns_list' => $this->columnModel->getList($project['id']),\n 'users_list' => $this->projectUserRoleModel->getAssignableUsersList($project['id']),\n 'projects_list' => $projects_list,\n 'colors_list' => $this->colorModel->getList(),\n 'categories_list' => $this->categoryModel->getList($project['id']),\n 'links_list' => $this->linkModel->getList(0, false),\n 'priorities_list' => $this->projectTaskPriorityModel->getPriorities($project),\n 'project' => $project,\n 'available_actions' => $this->actionManager->getAvailableActions(),\n 'swimlane_list' => $this->swimlaneModel->getList($project['id']),\n 'events' => $this->actionManager->getCompatibleEvents($values['action_name']),\n )));\n }", "label_name": "Base", "label": 1} {"code": " function addDiscountToCart() {\n// global $user, $order;\n global $order;\n //lookup discount to see if it's real and valid, and not already in our cart\n //this will change once we allow more than one coupon code\n\n $discount = new discounts();\n $discount = $discount->getCouponByName($this->params['coupon_code']);\n\n if (empty($discount)) {\n flash('error', gt(\"This discount code you entered does not exist.\"));\n //redirect_to(array('controller'=>'cart', 'action'=>'checkout')); \n expHistory::back();\n }\n\n //check to see if it's in our cart already\n if ($this->isDiscountInCart($discount->id)) {\n flash('error', gt(\"This discount code is already in your cart.\"));\n //redirect_to(array('controller'=>'cart', 'action'=>'checkout'));\n expHistory::back();\n }\n\n //this should really be reworked, as it shoudn't redirect directly and not return\n $validateDiscountMessage = $discount->validateDiscount();\n if ($validateDiscountMessage == \"\") {\n //if all good, add to cart, otherwise it will have redirected\n $od = new order_discounts();\n $od->orders_id = $order->id;\n $od->discounts_id = $discount->id;\n $od->coupon_code = $discount->coupon_code;\n $od->title = $discount->title;\n $od->body = $discount->body;\n $od->save();\n // set this to just the discount applied via this coupon?? if so, when though? $od->discount_total = ??;\n flash('message', gt(\"The discount code has been applied to your cart.\"));\n } else {\n flash('error', $validateDiscountMessage);\n }\n //redirect_to(array('controller'=>'cart', 'action'=>'checkout')); \n expHistory::back();\n }", "label_name": "Base", "label": 1} {"code": "\t\t\t\t$this->paths[substr($key, strlen('path-'))] = $value;\r\n\t\t}\t\r", "label_name": "Base", "label": 1} {"code": "\t\t\t\t\t\t$rqv = strip_tags($rqv);\n\t\t\t\t\t}\n\t\t\t\t\t$v = implode(',', $_REQUEST[$var]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// TODO add more validation handling checks... then again, PTS client has its own validation of the env vars\n\t\t\t\t\t$v = strip_tags($_REQUEST[$var]);\n\t\t\t\t}\n\t\t\t\tif(!empty($v) && $v !== 0)\n\t\t\t\t{\n\t\t\t\t\t$posted[$var] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $posted;\n\t}", "label_name": "Base", "label": 1} {"code": " public function search() {\n// global $db, $user;\n global $db;\n\n $sql = \"select DISTINCT(a.id) as id, a.firstname as firstname, a.middlename as middlename, a.lastname as lastname, a.organization as organization, a.email as email \";\n $sql .= \"from \" . $db->prefix . \"addresses as a \"; //R JOIN \" . \n //$db->prefix . \"billingmethods as bm ON bm.addresses_id=a.id \";\n $sql .= \" WHERE match (a.firstname,a.lastname,a.email,a.organization) against ('\" . $this->params['query'] .\n \"*' IN BOOLEAN MODE) \";\n $sql .= \"order by match (a.firstname,a.lastname,a.email,a.organization) against ('\" . $this->params['query'] . \"*' IN BOOLEAN MODE) ASC LIMIT 12\";\n $res = $db->selectObjectsBySql($sql);\n foreach ($res as $key=>$record) {\n $res[$key]->title = $record->firstname . ' ' . $record->lastname;\n }\n //eDebug($sql);\n $ar = new expAjaxReply(200, gt('Here\\'s the items you wanted'), $res);\n $ar->send();\n }", "label_name": "Base", "label": 1} {"code": " public static function getItems($term) {\n $model = X2Model::model(Yii::app()->controller->modelClass);\n if (isset($model)) {\n $tableName = $model->tableName();\n $sql = 'SELECT id, name as value \n FROM ' . $tableName . ' WHERE name LIKE :qterm ORDER BY name ASC';\n $command = Yii::app()->db->createCommand($sql);\n $qterm = $term . '%';\n $command->bindParam(\":qterm\", $qterm, PDO::PARAM_STR);\n $result = $command->queryAll();\n echo CJSON::encode($result);\n }\n Yii::app()->end();\n }", "label_name": "Base", "label": 1} {"code": " public function testRedirectLinkGeneration () {\n Yii::app()->controller = new MarketingController (\n 'campaign', new MarketingModule ('campaign', null));\n $_SERVER['SERVER_NAME'] = 'localhost';\n $cmb = $this->instantiate();\n $contact = $this->contacts('testUser_unsent');\n $campaign = $this->campaign('redirectLinkGeneration');\n $url = preg_replace ('/^[^\"]*\"([^\"]*)\".*$/', '$1', $campaign->content);\n list($subject,$message,$uniqueId) = $cmb->prepareEmail(\n $this->campaign('redirectLinkGeneration'),\n $contact,$this->listItem('testUser_unsent')->emailAddress);\n $this->assertRegExp ('/'.preg_quote (urlencode ($url)).'/', $message);\n\n }", "label_name": "Class", "label": 2} {"code": " $otherPublisherName = MAX_buildName($aOtherPublisher['publisher_id'], $aOtherPublisher['name']);\n if ($aOtherPublisher['publisher_id'] != $affiliateid) {\n $form .= \"\";\n }\n }\n $form .= \"\";\n\n addPageFormTool($GLOBALS['strMoveTo'], 'iconZoneMove', $form);\n }\n\n //delete\n if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)\n || OA_Permission::isAccount(OA_ACCOUNT_MANAGER)\n || OA_Permission::hasPermission(OA_PERM_ZONE_DELETE)) {\n $deleteConfirm = phpAds_DelConfirm($GLOBALS['strConfirmDeleteZone']);\n addPageLinkTool($GLOBALS[\"strDelete\"], MAX::constructUrl(MAX_URL_ADMIN, \"zone-delete.php?token=\" . urlencode(phpAds_SessionGetToken()) . \"&affiliateid=$affiliateid&zoneid=$zoneid&returnurl=affiliate-zones.php\"), \"iconDelete\", null, $deleteConfirm);\n }\n\n //shortcut\n addPageShortcut($GLOBALS['strBackToZones'], MAX::constructUrl(MAX_URL_ADMIN, \"affiliate-zones.php?affiliateid=$affiliateid\"), \"iconBack\");\n $entityString = _getEntityString($aEntities);\n addPageShortcut($GLOBALS['strZoneHistory'], MAX::constructUrl(MAX_URL_ADMIN, \"stats.php?entity=zone&breakdown=history&$entityString\"), 'iconStatistics');\n}", "label_name": "Compound", "label": 4} {"code": " public function searchNew() {\n global $db, $user;\n //$this->params['query'] = str_ireplace('-','\\-',$this->params['query']);\n $sql = \"select DISTINCT(p.id) as id, p.title, model, sef_url, f.id as fileid, \";\n $sql .= \"match (p.title,p.model,p.body) against ('\" . $this->params['query'] . \"*' IN BOOLEAN MODE) as relevance, \";\n $sql .= \"CASE when p.model like '\" . $this->params['query'] . \"%' then 1 else 0 END as modelmatch, \";\n $sql .= \"CASE when p.title like '%\" . $this->params['query'] . \"%' then 1 else 0 END as titlematch \";\n $sql .= \"from \" . $db->prefix . \"product as p INNER JOIN \" .\n $db->prefix . \"content_expFiles as cef ON p.id=cef.content_id AND cef.content_type IN ('product','eventregistration','donation','giftcard') AND cef.subtype='mainimage' INNER JOIN \" . $db->prefix .\n \"expFiles as f ON cef.expFiles_id = f.id WHERE \";\n if (!$user->isAdmin()) $sql .= '(p.active_type=0 OR p.active_type=1) AND ';\n $sql .= \" match (p.title,p.model,p.body) against ('\" . $this->params['query'] . \"*' IN BOOLEAN MODE) AND p.parent_id=0 \";\n $sql .= \" HAVING relevance > 0 \";\n //$sql .= \"GROUP BY p.id \"; \n $sql .= \"order by modelmatch,titlematch,relevance desc LIMIT 10\";\n\n eDebug($sql);\n $res = $db->selectObjectsBySql($sql);\n eDebug($res, true);\n $ar = new expAjaxReply(200, gt('Here\\'s the items you wanted'), $res);\n $ar->send();\n }", "label_name": "Base", "label": 1} {"code": "function db_case($array)\n{\n\tglobal $DatabaseType;\n\n\t$counter = 0;\n\tif ($DatabaseType == 'mysqli') {\n\t\t$array_count = count($array);\n\t\t$string = \" CASE WHEN $array[0] =\";\n\t\t$counter++;\n\t\t$arr_count = count($array);\n\t\tfor ($i = 1; $i < $arr_count; $i++) {\n\t\t\t$value = $array[$i];\n\n\t\t\tif ($value == \"''\" && substr($string, -1) == '=') {\n\t\t\t\t$value = ' IS NULL';\n\t\t\t\t$string = substr($string, 0, -1);\n\t\t\t}\n\n\t\t\t$string .= \"$value\";\n\t\t\tif ($counter == ($array_count - 2) && $array_count % 2 == 0)\n\t\t\t\t$string .= \" ELSE \";\n\t\t\telseif ($counter == ($array_count - 1))\n\t\t\t\t$string .= \" END \";\n\t\t\telseif ($counter % 2 == 0)\n\t\t\t\t$string .= \" WHEN $array[0]=\";\n\t\t\telseif ($counter % 2 == 1)\n\t\t\t\t$string .= \" THEN \";\n\n\t\t\t$counter++;\n\t\t}\n\t}\n\n\treturn $string;\n}", "label_name": "Base", "label": 1} {"code": " function fread($handle, $length)\n {\n if (\\yiiunit\\framework\\base\\SecurityTest::$fread !== null) {\n return \\yiiunit\\framework\\base\\SecurityTest::$fread;\n }\n if (\\yiiunit\\framework\\base\\SecurityTest::$fopen !== null) {\n return $length < 8 ? \\str_repeat('s', $length) : 'test1234';\n }\n\n return \\fread($handle, $length);\n }", "label_name": "Class", "label": 2} {"code": " public function countFoldersInFolder(Folder $folder, $useFilters = true, $recursive = false)\n {\n $this->assureFolderReadPermission($folder);\n $filters = $useFilters ? $this->fileAndFolderNameFilters : [];\n return $this->driver->countFoldersInFolder($folder->getIdentifier(), $recursive, $filters);\n }", "label_name": "Base", "label": 1} {"code": " function import() {\r\n $pullable_modules = expModules::listInstalledControllers($this->baseclassname);\r\n $modules = new expPaginator(array(\r\n 'records' => $pullable_modules,\r\n 'controller' => $this->loc->mod,\r\n 'action' => $this->params['action'],\r\n 'order' => isset($this->params['order']) ? $this->params['order'] : 'section',\r\n 'dir' => isset($this->params['dir']) ? $this->params['dir'] : '',\r\n 'page' => (isset($this->params['page']) ? $this->params['page'] : 1),\r\n 'columns' => array(\r\n gt('Title') => 'title',\r\n gt('Page') => 'section'\r\n ),\r\n ));\r\n\r\n assign_to_template(array(\r\n 'modules' => $modules,\r\n ));\r\n }\r", "label_name": "Base", "label": 1} {"code": " foreach ($data['alertred'] as $alert) {\n # code...\n echo \"
  • $alert
  • \\n\";\n }", "label_name": "Base", "label": 1} {"code": "\tfunction unlockTables() {\n $sql = \"UNLOCK TABLES\";\n \n $res = mysqli_query($this->connection, $sql);\n return $res;\n }", "label_name": "Class", "label": 2} {"code": " return getenv('REMOTE_ADDR');\n } else {\n return false;\n }\n }", "label_name": "Base", "label": 1} {"code": " public function remove()\n {\n $project = $this->getProject();\n $this->checkCSRFParam();\n $column_id = $this->request->getIntegerParam('column_id');\n\n if ($this->columnModel->remove($column_id)) {\n $this->flash->success(t('Column removed successfully.'));\n } else {\n $this->flash->failure(t('Unable to remove this column.'));\n }\n\n $this->response->redirect($this->helper->url->to('ColumnController', 'index', array('project_id' => $project['id'])));\n }", "label_name": "Base", "label": 1} {"code": " public function confirm()\n {\n $project = $this->getProject();\n\n $this->response->html($this->helper->layout->project('action/remove', array(\n 'action' => $this->actionModel->getById($this->request->getIntegerParam('action_id')),\n 'available_events' => $this->eventManager->getAll(),\n 'available_actions' => $this->actionManager->getAvailableActions(),\n 'project' => $project,\n 'title' => t('Remove an action')\n )));\n }", "label_name": "Base", "label": 1} {"code": " public static function isActive($thm){\r\n if(Options::v('themes') === $thm){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": " $section = new section(intval($page));\r\n if ($section) {\r\n// self::deleteLevel($section->id);\r\n $section->delete();\r\n }\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": "\tprotected function _downloadErrorLog()\n\t{\n\t\t$tmpDir = TMP . 'logs' . DS;\n\t\t$Folder = new Folder($tmpDir);\n\t\t$files = $Folder->read(true, true, false);\n\t\tif (count($files[0]) === 0 && count($files[1]) === 0) {\n\t\t\treturn false;\n\t\t}\n\t\t// ZIP\u5727\u7e2e\u3057\u3066\u51fa\u529b\n\t\t$fileName = 'basercms_logs_' . date('Ymd_His');\n\t\t$Simplezip = new Simplezip();\n\t\t$Simplezip->addFolder($tmpDir);\n\t\t$Simplezip->download($fileName);\n\t\treturn true;\n\t}", "label_name": "Base", "label": 1} {"code": " foreach ($val as $vkey => $value) {\n if ($vkey != 'LAST_UPDATED') {\n if ($vkey != 'UPDATED_BY') {\n if ($vkey == 'ID')\n echo '' . htmlentities($value) . '';\n else if ($vkey == 'SYEAR')\n echo '' . htmlentities($value) . '';\n else if ($vkey == 'TITLE')\n echo '' . htmlentities($value) . '';\n else if ($vkey == 'WWW_ADDRESS')\n echo '' . htmlentities($value) . '';\n else\n echo '<' . $vkey . '>' . htmlentities($value) . '';\n }\n }\n }", "label_name": "Base", "label": 1} {"code": "\tpublic function addTable( $table, $alias ) {\n\t\tif ( empty( $table ) ) {\n\t\t\tthrow new \\MWException( __METHOD__ . ': An empty table name was passed.' );\n\t\t}\n\t\tif ( empty( $alias ) || is_numeric( $alias ) ) {\n\t\t\tthrow new \\MWException( __METHOD__ . ': An empty or numeric table alias was passed.' );\n\t\t}\n\t\tif ( !isset( $this->tables[$alias] ) ) {\n\t\t\t$this->tables[$alias] = $this->DB->tableName( $table );\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "label_name": "Class", "label": 2} {"code": "\tpublic function approve() {\n\t expHistory::set('editable', $this->params);\n \n /* The global constants can be overriden by passing appropriate params */ \n //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet\n// $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login'];\n// $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval'];\n// $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification'];\n// $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email'];\n\t \n\t if (empty($this->params['id'])) {\n\t flash('error', gt('No ID supplied for comment to approve'));\n\t expHistory::back();\n\t }\n\t \n\t $comment = new expComment($this->params['id']);\n\t assign_to_template(array(\n 'comment'=>$comment\n ));\n\t}", "label_name": "Class", "label": 2} {"code": " public function confirm()\n {\n $project = $this->getProject();\n $category = $this->getCategory();\n\n $this->response->html($this->helper->layout->project('category/remove', array(\n 'project' => $project,\n 'category' => $category,\n )));\n }", "label_name": "Base", "label": 1} {"code": " public function admin_delete($id = null)\n {\n if (!$this->request->is('post') && !$this->request->is('delete')) {\n throw new MethodNotAllowedException(__('Action not allowed, post or delete request expected.'));\n }\n if (!$this->_isAdmin()) {\n throw new Exception('Administrators only.');\n }\n $this->User->id = $id;\n $conditions = array('User.id' => $id);\n if (!$this->_isSiteAdmin()) {\n $conditions['org_id'] = $this->Auth->user('org_id');\n }\n $user = $this->User->find('first', array(\n 'conditions' => $conditions,\n 'recursive' => -1\n ));\n if (empty($user)) {\n throw new NotFoundException(__('Invalid user'));\n }\n $fieldsDescrStr = 'User (' . $id . '): ' . $user['User']['email'];\n if ($this->User->delete($id)) {\n $this->__extralog(\"delete\", $fieldsDescrStr, '');\n if ($this->_isRest()) {\n return $this->RestResponse->saveSuccessResponse('User', 'admin_delete', $id, $this->response->type(), 'User deleted.');\n } else {\n $this->Flash->success(__('User deleted'));\n $this->redirect(array('action' => 'index'));\n }\n }\n $this->Flash->error(__('User was not deleted'));\n $this->redirect(array('action' => 'index'));\n }", "label_name": "Class", "label": 2} {"code": " $f = function (\\Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition $v = null) { return $v; }; return $f(${($_ = isset($this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition']) ? $this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition'] : ($this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition'] = new \\Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition())) && false ?: '_'});", "label_name": "Base", "label": 1} {"code": " public function params()\n {\n $project = $this->getProject();\n $values = $this->request->getValues();\n\n if (empty($values['action_name']) || empty($values['project_id']) || empty($values['event_name'])) {\n $this->create();\n return;\n }\n\n $action = $this->actionManager->getAction($values['action_name']);\n $action_params = $action->getActionRequiredParameters();\n\n if (empty($action_params)) {\n $this->doCreation($project, $values + array('params' => array()));\n }\n\n $projects_list = $this->projectUserRoleModel->getActiveProjectsByUser($this->userSession->getId());\n unset($projects_list[$project['id']]);\n\n $this->response->html($this->template->render('action_creation/params', array(\n 'values' => $values,\n 'action_params' => $action_params,\n 'columns_list' => $this->columnModel->getList($project['id']),\n 'users_list' => $this->projectUserRoleModel->getAssignableUsersList($project['id']),\n 'projects_list' => $projects_list,\n 'colors_list' => $this->colorModel->getList(),\n 'categories_list' => $this->categoryModel->getList($project['id']),\n 'links_list' => $this->linkModel->getList(0, false),\n 'priorities_list' => $this->projectTaskPriorityModel->getPriorities($project),\n 'project' => $project,\n 'available_actions' => $this->actionManager->getAvailableActions(),\n 'swimlane_list' => $this->swimlaneModel->getList($project['id']),\n 'events' => $this->actionManager->getCompatibleEvents($values['action_name']),\n )));\n }", "label_name": "Base", "label": 1} {"code": " foreach ($elem[2] as $field) {\n echo '\n \n    '.$field[1].' :\n \n
    \n \n ';\n }", "label_name": "Base", "label": 1} {"code": "\tfunction __construct() {\n\t\tparent::__construct( 'GlobalNewFiles' );\n\t}", "label_name": "Class", "label": 2} {"code": " $conditions[] = sprintf(\"\\$this->has('%s')\", $service);\n }\n\n if (!$conditions) {\n return '';\n }\n\n return implode(' && ', $conditions);\n }", "label_name": "Base", "label": 1} {"code": "\tpublic function manage_versions() {\n\t expHistory::set('manageable', $this->params);\n\t \n\t $hv = new help_version();\n\t $current_version = $hv->find('first', 'is_current=1');\n\t \n\t $sql = 'SELECT hv.*, COUNT(h.title) AS num_docs FROM '.DB_TABLE_PREFIX.'_help h ';\n\t $sql .= 'RIGHT JOIN '.DB_TABLE_PREFIX.'_help_version hv ON h.help_version_id=hv.id GROUP BY hv.version';\n\n\t $page = new expPaginator(array(\n 'sql'=>$sql,\n 'limit'=>30,\n 'order' => (isset($this->params['order']) ? $this->params['order'] : 'version'),\n 'dir' => (isset($this->params['dir']) ? $this->params['dir'] : 'DESC'),\n 'page'=>(isset($this->params['page']) ? $this->params['page'] : 1),\n 'controller'=>$this->baseclassname,\n 'action'=>$this->params['action'],\n 'src'=>$this->loc->src,\n 'columns'=>array(\n gt('Version')=>'version',\n gt('Title')=>'title',\n gt('Current')=>'is_current',\n gt('# of Docs')=>'num_docs'\n ),\n ));\n\t \n\t assign_to_template(array(\n 'current_version'=>$current_version,\n 'page'=>$page\n ));\n\t}", "label_name": "Class", "label": 2} {"code": "\tpublic static function GetNewTransactionId()\n\t{\n\t\tif (!is_dir(APPROOT.'data/transactions'))\n\t\t{\n\t\t\tif (!is_writable(APPROOT.'data'))\n\t\t\t{\n\t\t\t\tthrow new Exception('The directory \"'.APPROOT.'data\" must be writable to the application.');\n\t\t\t}\n\t\t\t/** @noinspection MkdirRaceConditionInspection */\n\t\t\tif (!@mkdir(APPROOT.'data/transactions'))\n\t\t\t{\n\t\t\t\tthrow new Exception('Failed to create the directory \"'.APPROOT.'data/transactions\". Ajust the rights on the parent directory or let an administrator create the transactions directory and give the web sever enough rights to write into it.');\n\t\t\t}\n\t\t}\n\t\tif (!is_writable(APPROOT.'data/transactions'))\n\t\t{\n\t\t\tthrow new Exception('The directory \"'.APPROOT.'data/transactions\" must be writable to the application.');\n\t\t}\n\t\tself::CleanupOldTransactions();\n\t\t$id = basename(tempnam(APPROOT.'data/transactions', static::GetUserPrefix()));\n\t\tself::Info('GetNewTransactionId: Created transaction: '.$id);\n\n\t\treturn (string)$id;\n\t}", "label_name": "Compound", "label": 4} {"code": " public function __construct($uri = '')\n {\n if ($uri != null) {\n $parts = parse_url($uri);\n if ($parts === false) {\n throw new \\InvalidArgumentException(\"Unable to parse URI: $uri\");\n }\n $this->applyParts($parts);\n }\n }", "label_name": "Base", "label": 1} {"code": " $sloc = expCore::makeLocation('navigation', null, $section->id);\r\n // remove any manage permissions for this page and it's children\r\n // $db->delete('userpermission', \"module='navigationController' AND internal=\".$section->id);\r\n // $db->delete('grouppermission', \"module='navigationController' AND internal=\".$section->id);\r\n foreach ($allusers as $uid) {\r\n $u = user::getUserById($uid);\r\n expPermissions::grant($u, 'manage', $sloc);\r\n }\r\n foreach ($allgroups as $gid) {\r\n $g = group::getGroupById($gid);\r\n expPermissions::grantGroup($g, 'manage', $sloc);\r\n }\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": " public function breadcrumb() {\r\n global $sectionObj;\r\n\r\n expHistory::set('viewable', $this->params);\r\n $id = $sectionObj->id;\r\n $current = null;\r\n // Show not only the location of a page in the hierarchy but also the location of a standalone page\r\n $current = new section($id);\r\n if ($current->parent == -1) { // standalone page\r\n $navsections = section::levelTemplate(-1, 0);\r\n foreach ($navsections as $section) {\r\n if ($section->id == $id) {\r\n $current = $section;\r\n break;\r\n }\r\n }\r\n } else {\r\n $navsections = section::levelTemplate(0, 0);\r\n foreach ($navsections as $section) {\r\n if ($section->id == $id) {\r\n $current = $section;\r\n break;\r\n }\r\n }\r\n }\r\n assign_to_template(array(\r\n 'sections' => $navsections,\r\n 'current' => $current,\r\n ));\r\n }\r", "label_name": "Class", "label": 2} {"code": " public function testBuild()\n {\n $version = Constants::VERSION;\n $versionParts = explode('.', $version);\n $major = (int) $versionParts[0];\n $minor = (int) $versionParts[1];\n $patch = isset($versionParts[2]) ? (int) $versionParts[2] : 0;\n\n $expectedId = $major * 10000 + $minor * 100 + $patch;\n\n self::assertEquals('1.14', Constants::VERSION, 'Invalid release number');\n self::assertTrue(\\in_array(Constants::STATUS, ['dev', 'stable']), 'Invalid status');\n self::assertEquals($expectedId, Constants::VERSION_ID, 'Invalid version ID');\n }", "label_name": "Base", "label": 1} {"code": " function manage() {\r\n global $db, $router, $user;\r\n\r\n expHistory::set('manageable', $router->params);\r\n assign_to_template(array(\r\n 'canManageStandalones' => self::canManageStandalones(),\r\n 'sasections' => $db->selectObjects('section', 'parent=-1'),\r\n 'user' => $user,\r\n// 'canManagePagesets' => $user->isAdmin(),\r\n// 'templates' => $db->selectObjects('section_template', 'parent=0'),\r\n ));\r\n }\r", "label_name": "Class", "label": 2} {"code": " public static function _date2timestamp( $datetime, $wtz=null ) {\r\n if( !isset( $datetime['hour'] )) $datetime['hour'] = 0;\r\n if( !isset( $datetime['min'] )) $datetime['min'] = 0;\r\n if( !isset( $datetime['sec'] )) $datetime['sec'] = 0;\r\n if( empty( $wtz ) && ( !isset( $datetime['tz'] ) || empty( $datetime['tz'] )))\r\n return mktime( $datetime['hour'], $datetime['min'], $datetime['sec'], $datetime['month'], $datetime['day'], $datetime['year'] );\r\n $output = $offset = 0;\r\n if( empty( $wtz )) {\r\n if( iCalUtilityFunctions::_isOffset( $datetime['tz'] )) {\r\n $offset = iCalUtilityFunctions::_tz2offset( $datetime['tz'] ) * -1;\r\n $wtz = 'UTC';\r\n }\r\n else\r\n $wtz = $datetime['tz'];\r\n }\r\n if(( 'Z' == $wtz ) || ( 'GMT' == strtoupper( $wtz )))\r\n $wtz = 'UTC';\r\n try {\r\n $strdate = sprintf( '%04d-%02d-%02d %02d:%02d:%02d', $datetime['year'], $datetime['month'], $datetime['day'], $datetime['hour'], $datetime['min'], $datetime['sec'] );\r\n $d = new DateTime( $strdate, new DateTimeZone( $wtz ));\r\n if( 0 != $offset ) // adjust for offset\r\n $d->modify( $offset.' seconds' );\r\n $output = $d->format( 'U' );\r\n unset( $d );\r\n }\r\n catch( Exception $e ) {\r\n $output = mktime( $datetime['hour'], $datetime['min'], $datetime['sec'], $datetime['month'], $datetime['day'], $datetime['year'] );\r\n }\r\n return $output;\r\n }\r", "label_name": "Base", "label": 1} {"code": " public function remove()\n {\n $this->checkCSRFParam();\n $project = $this->getProject();\n $swimlane_id = $this->request->getIntegerParam('swimlane_id');\n\n if ($this->swimlaneModel->remove($project['id'], $swimlane_id)) {\n $this->flash->success(t('Swimlane removed successfully.'));\n } else {\n $this->flash->failure(t('Unable to remove this swimlane.'));\n }\n\n $this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id'])));\n }", "label_name": "Base", "label": 1} {"code": " public static function recent($vars) {\r\n\r\n $catW = isset($vars['cat'])? \" AND `cat` = '\".$vars['cat']:\"\";\r\n $type = isset($vars['type'])? $vars['type']: \"post\";\r\n $num = isset($vars['num'])? $vars['num']: \"10\";\r\n $sql = \"SELECT * FROM `posts`\r\n WHERE `type` = '{$type}' $catW AND `status` = '1'\r\n ORDER BY `date` DESC LIMIT {$num}\";\r\n $posts = Db::result($sql);\r\n if(isset($posts['error'])){\r\n $posts['error'] = \"No Posts found.\";\r\n }else{\r\n $posts = self::prepare($posts);\r\n }\r\n return $posts;\r\n }\r", "label_name": "Base", "label": 1} {"code": "\t\t\t$iloc = expUnserialize($container->internal);\n\t\t\tif ($db->selectObject('sectionref',\"module='\".$iloc->mod.\"' AND source='\".$iloc->src.\"'\") == null) {\n\t\t\t// There is no sectionref for this container. Populate sectionref\n if ($container->external != \"N;\") {\n $newSecRef = new stdClass();\n $newSecRef->module = $iloc->mod;\n $newSecRef->source = $iloc->src;\n $newSecRef->internal = '';\n $newSecRef->refcount = 1;\n// $newSecRef->is_original = 1;\n\t\t\t\t\t$eloc = expUnserialize($container->external);\n//\t\t\t\t\t$section = $db->selectObject('sectionref',\"module='containermodule' AND source='\".$eloc->src.\"'\");\n $section = $db->selectObject('sectionref',\"module='container' AND source='\".$eloc->src.\"'\");\n\t\t\t\t\tif (!empty($section)) {\n\t\t\t\t\t\t$newSecRef->section = $section->id;\n\t\t\t\t\t\t$db->insertObject($newSecRef,\"sectionref\");\n\t\t\t\t\t\t$missing_sectionrefs[] = gt(\"Missing sectionref for container replaced\").\": \".$iloc->mod.\" - \".$iloc->src.\" - PageID #\".$section->id;\n\t\t\t\t\t} else {\n $db->delete('container','id=\"'.$container->id.'\"');\n $missing_sectionrefs[] = gt(\"Cant' find the container page for container\").\": \".$iloc->mod.\" - \".$iloc->src.' - '.gt('deleted');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n assign_to_template(array(\n 'missing_sectionrefs'=>$missing_sectionrefs,\n ));\n\t}", "label_name": "Base", "label": 1} {"code": " public function showall() {\n expHistory::set('viewable', $this->params);\n // figure out if should limit the results\n if (isset($this->params['limit'])) {\n $limit = $this->params['limit'] == 'none' ? null : $this->params['limit'];\n } else {\n $limit = (isset($this->config['limit']) && $this->config['limit'] != '') ? $this->config['limit'] : 10;\n } \n $order = isset($this->config['order']) ? $this->config['order'] : 'publish DESC';\n\n // pull the news posts from the database\n $items = $this->news->find('all', $this->aggregateWhereClause(), $order);\n\n // merge in any RSS news and perform the sort and limit the number of posts we return to the configured amount.\n if (!empty($this->config['pull_rss'])) $items = $this->mergeRssData($items);\n \n // setup the pagination object to paginate the news stories.\n $page = new expPaginator(array(\n 'records'=>$items,\n 'limit'=>$limit,\n 'order'=>$order,\n 'page'=>(isset($this->params['page']) ? $this->params['page'] : 1),\n 'controller'=>$this->params['controller'],\n 'action'=>$this->params['action'],\n 'src'=>$this->loc->src,\n 'view'=>empty($this->params['view']) ? null : $this->params['view']\n ));\n \n assign_to_template(array(\n 'page'=>$page,\n 'items'=>$page->records,\n 'rank'=>($order==='rank')?1:0,\n 'params'=>$this->params,\n ));\n }", "label_name": "Base", "label": 1} {"code": " public function params()\n {\n $project = $this->getProject();\n $values = $this->request->getValues();\n\n if (empty($values['action_name']) || empty($values['project_id']) || empty($values['event_name'])) {\n $this->create();\n return;\n }\n\n $action = $this->actionManager->getAction($values['action_name']);\n $action_params = $action->getActionRequiredParameters();\n\n if (empty($action_params)) {\n $this->doCreation($project, $values + array('params' => array()));\n }\n\n $projects_list = $this->projectUserRoleModel->getActiveProjectsByUser($this->userSession->getId());\n unset($projects_list[$project['id']]);\n\n $this->response->html($this->template->render('action_creation/params', array(\n 'values' => $values,\n 'action_params' => $action_params,\n 'columns_list' => $this->columnModel->getList($project['id']),\n 'users_list' => $this->projectUserRoleModel->getAssignableUsersList($project['id']),\n 'projects_list' => $projects_list,\n 'colors_list' => $this->colorModel->getList(),\n 'categories_list' => $this->categoryModel->getList($project['id']),\n 'links_list' => $this->linkModel->getList(0, false),\n 'priorities_list' => $this->projectTaskPriorityModel->getPriorities($project),\n 'project' => $project,\n 'available_actions' => $this->actionManager->getAvailableActions(),\n 'swimlane_list' => $this->swimlaneModel->getList($project['id']),\n 'events' => $this->actionManager->getCompatibleEvents($values['action_name']),\n )));\n }", "label_name": "Base", "label": 1} {"code": " public static function hasChildren($i) {\r\n global $sections;\r\n\r\n if (($i + 1) >= count($sections)) return false;\r\n return ($sections[$i]->depth < $sections[$i + 1]->depth) ? true : false;\r\n }\r", "label_name": "Base", "label": 1} {"code": " function update_optiongroup_master() {\n global $db;\n\n $id = empty($this->params['id']) ? null : $this->params['id'];\n $og = new optiongroup_master($id);\n $oldtitle = $og->title;\n $og->update($this->params);\n \n // if the title of the master changed we should update the option groups that are already using it.\n if ($oldtitle != $og->title) {\n $db->sql('UPDATE '.$db->prefix.'optiongroup SET title=\"'.$og->title.'\" WHERE title=\"'.$oldtitle.'\"');\n }\n \n expHistory::back();\n }", "label_name": "Base", "label": 1} {"code": " protected static function __Load($path) {\n include_once($path);\n }", "label_name": "Base", "label": 1} {"code": " public function get_view_config() {\n global $template;\n \n // set paths we will search in for the view\n $paths = array(\n BASE.'themes/'.DISPLAY_THEME.'/modules/common/views/file/configure',\n BASE.'framework/modules/common/views/file/configure',\n );\n\n foreach ($paths as $path) {\n $view = $path.'/'.$this->params['view'].'.tpl';\n if (is_readable($view)) {\n if (bs(true)) {\n $bstrapview = $path.'/'.$this->params['view'].'.bootstrap.tpl';\n if (file_exists($bstrapview)) {\n $view = $bstrapview;\n }\n }\n if (bs3(true)) {\n $bstrapview = $path.'/'.$this->params['view'].'.bootstrap3.tpl';\n if (file_exists($bstrapview)) {\n $view = $bstrapview;\n }\n }\n $template = new controllertemplate($this, $view);\n $ar = new expAjaxReply(200, 'ok');\n\t\t $ar->send();\n }\n }\n }", "label_name": "Base", "label": 1} {"code": " self::assertSame($shouldBePresent, $request->hasHeader('Authorization'));\n self::assertSame($shouldBePresent, $request->hasHeader('Cookie'));\n\n return new Response(200);\n }\n ]);", "label_name": "Class", "label": 2} {"code": " public static function canImportData() {\r\n return true;\r\n }\r", "label_name": "Base", "label": 1} {"code": " function import() {\r\n $pullable_modules = expModules::listInstalledControllers($this->baseclassname);\r\n $modules = new expPaginator(array(\r\n 'records' => $pullable_modules,\r\n 'controller' => $this->loc->mod,\r\n 'action' => $this->params['action'],\r\n 'order' => isset($this->params['order']) ? $this->params['order'] : 'section',\r\n 'dir' => isset($this->params['dir']) ? $this->params['dir'] : '',\r\n 'page' => (isset($this->params['page']) ? $this->params['page'] : 1),\r\n 'columns' => array(\r\n gt('Title') => 'title',\r\n gt('Page') => 'section'\r\n ),\r\n ));\r\n\r\n assign_to_template(array(\r\n 'modules' => $modules,\r\n ));\r\n }\r", "label_name": "Base", "label": 1} {"code": " public static function admin($var, $data='') {\r\n if (isset($data)) {\r\n # code...\r\n $GLOBALS['data'] = $data;\r\n }\r\n include(GX_PATH.'/gxadmin/themes/'.$var.'.php');\r\n }\r", "label_name": "Base", "label": 1} {"code": " function getConfig($apikey){\r\n $url = \"http://api.themoviedb.org/3/configuration?api_key=\".$apikey;\r\n $config = $this->curl($url);\r\n return $config;\r\n }\r", "label_name": "Base", "label": 1} {"code": " static function displayname() {\r\n return \"Events\";\r\n }\r", "label_name": "Class", "label": 2} {"code": " public function confirm()\n {\n $task = $this->getTask();\n $link_id = $this->request->getIntegerParam('link_id');\n $link = $this->taskExternalLinkModel->getById($link_id);\n\n if (empty($link)) {\n throw new PageNotFoundException();\n }\n\n $this->response->html($this->template->render('task_external_link/remove', array(\n 'link' => $link,\n 'task' => $task,\n )));\n }", "label_name": "Base", "label": 1} {"code": " public function remove()\n {\n $id = (int)$this->id;\n try {\n $delete = $this->zdb->delete(self::TABLE);\n $delete->where(\n self::PK . ' = ' . $id\n );\n $this->zdb->execute($delete);\n Analog::log(\n 'Saved search #' . $id . ' (' . $this->name\n . ') deleted successfully.',\n Analog::INFO\n );\n return true;\n } catch (\\RuntimeException $re) {\n throw $re;\n } catch (Throwable $e) {\n Analog::log(\n 'Unable to delete saved search ' . $id . ' | ' . $e->getMessage(),\n Analog::ERROR\n );\n throw $e;\n }\n }", "label_name": "Base", "label": 1} {"code": " public function actionHideWidget() {\n if (isset($_POST['name'])) {\n $name = $_POST['name'];\n\n $layout = Yii::app()->params->profile->getLayout();\n\n // the widget could be in any of the blocks in the page, so check all of them\n foreach ($layout as $b => &$block) {\n if (isset($block[$name])) {\n if ($b == 'right') {\n $layout['hiddenRight'][$name] = $block[$name];\n } else {\n $layout['hidden'][$name] = $block[$name];\n }\n unset($block[$name]);\n Yii::app()->params->profile->saveLayout($layout);\n break;\n }\n }\n\n // make a list of hidden widgets, using
  • , to send back to the browser\n $list = \"\";\n foreach ($layout['hidden'] as $name => $widget) {\n $list .= \"
  • {$widget['title']}
  • \";\n }\n foreach ($layout['hiddenRight'] as $name => $widget) {\n $list .= \"
  • {$widget['title']}
  • \";\n }\n\n echo Yii::app()->params->profile->getWidgetMenu();\n }\n }", "label_name": "Class", "label": 2} {"code": " public static function initializeNavigation() {\r\n $sections = section::levelTemplate(0, 0);\r\n return $sections;\r\n }\r", "label_name": "Base", "label": 1} {"code": "\tfunction insertServiceCategorieInDB(){\n\t\tglobal $pearDB, $centreon;\n\n\t\tif (testServiceCategorieExistence($_POST[\"sc_name\"])){\n $DBRESULT = $pearDB->query(\"INSERT INTO `service_categories` (`sc_name`, `sc_description`, `level`, `icon_id`, `sc_activate` ) \n VALUES ('\".$_POST[\"sc_name\"].\"', '\".$_POST[\"sc_description\"].\"', \".\n (isset($_POST['sc_severity_level']) && $_POST['sc_type'] ? $pearDB->escape($_POST['sc_severity_level']):\"NULL\").\", \".\n (isset($_POST['sc_severity_icon']) && $_POST['sc_type'] ? $pearDB->escape($_POST['sc_severity_icon']) : \"NULL\").\", \".\n \"'\".$_POST[\"sc_activate\"][\"sc_activate\"].\"')\");", "label_name": "Base", "label": 1} {"code": " function edit() {\r\n global $template;\r\n\r\n parent::edit();\r\n $allforms = array();\r\n $allforms[\"\"] = gt('Disallow Feedback');\r\n // calculate which event date is the one being edited\r\n $event_key = 0;\r\n foreach ($template->tpl->tpl_vars['record']->value->eventdate as $key=>$d) {\r\n \t if ($d->id == $this->params['date_id']) $event_key = $key;\r\n \t}\r\n\r\n assign_to_template(array(\r\n 'allforms' => array_merge($allforms, expTemplate::buildNameList(\"forms\", \"event/email\", \"tpl\", \"[!_]*\")),\r\n 'checked_date' => !empty($this->params['date_id']) ? $this->params['date_id'] : null,\r\n 'event_key' => $event_key,\r\n ));\r\n }\r", "label_name": "Base", "label": 1} {"code": " public static function type($id) {\r\n\r\n return Categories::type($id);\r\n\r\n }\r", "label_name": "Base", "label": 1} {"code": " function remove() {\r\n global $db;\r\n\r\n $section = $db->selectObject('section', 'id=' . $this->params['id']);\r\n if ($section) {\r\n section::removeLevel($section->id);\r\n $db->decrement('section', 'rank', 1, 'rank > ' . $section->rank . ' AND parent=' . $section->parent);\r\n $section->parent = -1;\r\n $db->updateObject($section, 'section');\r\n expSession::clearAllUsersSessionCache('navigation');\r\n expHistory::back();\r\n } else {\r\n notfoundController::handle_not_authorized();\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": " public function gc($force = false)\n {\n if ($force || mt_rand(0, 1000000) < $this->gcProbability) {\n $this->db->createCommand()\n ->delete($this->cacheTable, '[[expire]] > 0 AND [[expire]] < ' . time())\n ->execute();\n }\n }", "label_name": "Class", "label": 2} {"code": "function db_properties($table)\n{\n\tglobal $DatabaseType, $DatabaseUsername;\n\n\tswitch ($DatabaseType) {\n\t\tcase 'mysqli':\n\t\t\t$result = DBQuery(\"SHOW COLUMNS FROM $table\");\n\t\t\twhile ($row = db_fetch_row($result)) {\n\t\t\t\t$properties[strtoupper($row['FIELD'])]['TYPE'] = strtoupper($row['TYPE'], strpos($row['TYPE'], '('));\n\t\t\t\tif (!$pos = strpos($row['TYPE'], ','))\n\t\t\t\t\t$pos = strpos($row['TYPE'], ')');\n\t\t\t\telse\n\t\t\t\t\t$properties[strtoupper($row['FIELD'])]['SCALE'] = substr($row['TYPE'], $pos + 1);\n\n\t\t\t\t$properties[strtoupper($row['FIELD'])]['SIZE'] = substr($row['TYPE'], strpos($row['TYPE'], '(') + 1, $pos);\n\n\t\t\t\tif ($row['NULL'] != '')\n\t\t\t\t\t$properties[strtoupper($row['FIELD'])]['NULL'] = \"Y\";\n\t\t\t\telse\n\t\t\t\t\t$properties[strtoupper($row['FIELD'])]['NULL'] = \"N\";\n\t\t\t}\n\t\t\tbreak;\n\t}\n\treturn $properties;\n}", "label_name": "Base", "label": 1} {"code": " public static function name($id) {\r\n\r\n return Categories::name($id);\r\n\r\n }\r", "label_name": "Base", "label": 1} {"code": "\tpublic function approvedFileExtension($filename, $type = 'image')\n\t{\n\t\t$ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION));\n\t\tif ($type == 'image') {\n\t\t\tswitch ($ext) {\n\t\t\t\tcase 'gif':\n\t\t\t\tcase 'png':\n\t\t\t\tcase 'jpeg':\n\t\t\t\tcase 'jpg':\n\t\t\t\tcase 'svg':\n\t\t\t\t\treturn true;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t} elseif ($type == 'cert') {\n\t\t\tswitch ($ext) {\n\t\t\t\tcase 'pem':\n\t\t\t\t\treturn true;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "label_name": "Base", "label": 1} {"code": "function XMLRPCremoveImageFromGroup($name, $imageid){\n $groups = getUserResources(array(\"imageAdmin\"), array(\"manageGroup\"), 1);\n \n if($groupid = getResourceGroupID(\"image/$name\")){\n if(!array_key_exists($groupid, $groups['image'])){\n return array('status' => 'error',\n 'errorcode' => 46,\n 'errormsg' => 'Unable to access image group');\n }\n $resources = getUserResources(array(\"imageAdmin\"), array(\"manageGroup\"));\n if(!array_key_exists($imageid, $resources['image'])){\n return array('status' => 'error',\n 'errorcode' => 47,\n 'errormsg' => 'Unable to access image');\n }\n\n $allimages = getImages();\n $query = \"DELETE FROM resourcegroupmembers \"\n . \"WHERE resourceid={$allimages[$imageid]['resourceid']} \"\n . \"AND resourcegroupid=$groupid\";\n doQuery($query, 287);\n return array('status' => 'success');\n } else {\n return array('status' => 'error',\n 'errorcode' => 83,\n 'errormsg' => 'invalid resource group name');\n }\n}", "label_name": "Class", "label": 2} {"code": "function db_seq_nextval($seqname)\n{\n\tglobal $DatabaseType;\n\n\tif ($DatabaseType == 'mysqli')\n\t\t$seq = \"fn_\" . strtolower($seqname) . \"()\";\n\treturn $seq;\n}", "label_name": "Base", "label": 1} {"code": "\tpublic function delete() {\n\t global $db;\n \n /* The global constants can be overriden by passing appropriate params */ \n //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet\n// $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login'];\n// $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval'];\n// $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification'];\n// $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email'];\n\t \n\t if (empty($this->params['id'])) {\n\t flash('error', gt('Missing id for the comment you would like to delete'));\n\t expHistory::back();\n\t }\n\t \n\t // delete the comment\n $comment = new expComment($this->params['id']);\n $comment->delete();\n \n // delete the association too\n $db->delete($comment->attachable_table, 'expcomments_id='.$this->params['id']); \n \n // send the user back where they came from.\n expHistory::back();\n\t}", "label_name": "Base", "label": 1} {"code": " public function backup($type='json')\r\n {\r\n global $DB;\r\n global $website;\r\n\r\n $out = array();\r\n\r\n $DB->query('SELECT * FROM nv_webusers WHERE website = '.protect($website->id), 'object');\r\n\r\n if($type='json')\r\n $out['nv_webusers'] = json_encode($DB->result());\r\n\r\n $DB->query('SELECT nwp.* FROM nv_webuser_profiles nwp, nv_webusers nw\r\n WHERE nwp.webuser = nw.id\r\n AND nw.website = '.protect($website->id),\r\n 'object');\r\n\r\n if($type='json')\r\n $out['nv_webuser_profiles'] = json_encode($DB->result());\r\n\r\n if($type='json')\r\n $out = json_encode($out);\r\n\r\n return $out;\r\n }\r", "label_name": "Base", "label": 1} {"code": " self::rpc($p);\r\n //echo \"'$p'
    \";\r\n }\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": " static function description() {\r\n return \"Manage events and schedules, and optionally publish them.\";\r\n }\r", "label_name": "Base", "label": 1} {"code": " function delete_option_master() {\n global $db;\n\n $masteroption = new option_master($this->params['id']);\n \n // delete any implementations of this option master\n $db->delete('option', 'option_master_id='.$masteroption->id);\n $masteroption->delete('optiongroup_master_id=' . $masteroption->optiongroup_master_id);\n //eDebug($masteroption);\n expHistory::back();\n }", "label_name": "Base", "label": 1} {"code": "function critere_where_dist($idb, &$boucles, $crit) {\n\t$boucle = &$boucles[$idb];\n\tif (isset($crit->param[0])) {\n\t\t$_where = calculer_liste($crit->param[0], $idb, $boucles, $boucle->id_parent);\n\t} else {\n\t\t$_where = '@$Pile[0][\"where\"]';\n\t}\n\n\tif ($crit->cond) {\n\t\t$_where = \"(($_where) ? ($_where) : '')\";\n\t}\n\n\tif ($crit->not) {\n\t\t$_where = \"array('NOT',$_where)\";\n\t}\n\n\t$boucle->where[] = $_where;\n}", "label_name": "Base", "label": 1} {"code": " public function avatar($avatar_name)\n {\n list($user_id,$size) = explode('_',str_replace(\".jpg\",'',$avatar_name));\n $avatarFile = storage_path('app/'.User::getAvatarPath($user_id,$size));\n if(!is_file($avatarFile)){\n $avatarFile = public_path('static/images/default_avatar.jpg');\n }\n $image = Image::make($avatarFile);\n $response = response()->make($image->encode('jpg'));\n $image->destroy();\n $response->header('Content-Type', 'image/jpeg');\n $response->header('Expires', date(DATE_RFC822,strtotime(\" 2 day\")));\n $response->header('Cache-Control', 'private, max-age=86400, pre-check=86400');\n return $response;\n }", "label_name": "Base", "label": 1} {"code": "\tpublic function update($key, $qty) {\n\t\tif ((int)$qty && ((int)$qty > 0)) {\n\t\t\t$this->session->data['cart'][$key] = (int)$qty;\n\t\t} else {\n\t\t\t$this->remove($key);\n\t\t}\n\n\t\t$this->data = array();\n\t}", "label_name": "Base", "label": 1} {"code": " foreach($gc as $gcc=>$gcd)\n {\n if($gcd!='' && $gcc!='GRADE_LEVEL')\n {\n $sql_columns[]=$gcc;\n $sql_values[]=\"'\".$gcd.\"'\";\n }\n if($gcd!='' && $gcc=='GRADE_LEVEL')\n {\n foreach($get_cs_grade as $gcsgi=>$gcsgd)\n {\n if($gcd==$gcsd['ID']) \n {\n \n $sql_columns[]='GRADE_LEVEL';\n $sql_values[]=\"'\".$get_ts_grade[$gcsgi]['ID'].\"'\";\n \n }\n }\n }\n }", "label_name": "Base", "label": 1} {"code": " protected function fsock_get_contents(&$url, $timeout, $redirect_max, $ua, $outfp)\n {\n $connect_timeout = 3;\n $connect_try = 3;\n $method = 'GET';\n $readsize = 4096;\n $ssl = '';\n\n $getSize = null;\n $headers = '';\n\n $arr = parse_url($url);\n if (!$arr) {\n // Bad request\n return false;\n }\n if ($arr['scheme'] === 'https') {\n $ssl = 'ssl://';\n }\n\n // query\n $arr['query'] = isset($arr['query']) ? '?' . $arr['query'] : '';\n // port\n $port = isset($arr['port']) ? $arr['port'] : '';\n $arr['port'] = $port ? $port : ($ssl ? 443 : 80);\n\n $url_base = $arr['scheme'] . '://' . $arr['host'] . ($port ? (':' . $port) : '');", "label_name": "Base", "label": 1} {"code": " function edit() {\r\n global $template;\r\n\r\n parent::edit();\r\n $allforms = array();\r\n $allforms[\"\"] = gt('Disallow Feedback');\r\n // calculate which event date is the one being edited\r\n $event_key = 0;\r\n foreach ($template->tpl->tpl_vars['record']->value->eventdate as $key=>$d) {\r\n \t if ($d->id == $this->params['date_id']) $event_key = $key;\r\n \t}\r\n\r\n assign_to_template(array(\r\n 'allforms' => array_merge($allforms, expTemplate::buildNameList(\"forms\", \"event/email\", \"tpl\", \"[!_]*\")),\r\n 'checked_date' => !empty($this->params['date_id']) ? $this->params['date_id'] : null,\r\n 'event_key' => $event_key,\r\n ));\r\n }\r", "label_name": "Base", "label": 1} {"code": " foreach($item->attributes as $name => $value)\n if ($name !== 'id' && $name !== 'listId')\n $copy->$name = $value;\n $lineItems[] = $copy;\n }\n return $lineItems;\n }", "label_name": "Base", "label": 1} {"code": " app('files')->delete(LaravelLogViewer::pathToLogFile(base64_decode($this->request->input('del'))));", "label_name": "Base", "label": 1} {"code": "\t\t\tforeach ( $option as $_option ) {\n\t\t\t\t//Parameter functions return true or false. The full parameter data will be passed into the Query object later.\n\t\t\t\tif ( $this->parameters->$parameter( $_option ) === false ) {\n\t\t\t\t\t//Do not build this into the output just yet. It will be collected at the end.\n\t\t\t\t\t$this->logger->addMessage( \\DynamicPageListHooks::WARN_WRONGPARAM, $parameter, $_option );\n\t\t\t\t}\n\t\t\t}", "label_name": "Class", "label": 2} {"code": " public function testIsExpiredReturnsTrueIfCompiledFileDoesntExist()\n {\n $compiler = new BladeCompiler($files = $this->getFiles(), __DIR__);\n $files->shouldReceive('exists')->once()->with(__DIR__.'/'.sha1('foo').'.php')->andReturn(false);\n $this->assertTrue($compiler->isExpired('foo'));\n }", "label_name": "Class", "label": 2} {"code": "function db_start()\n{\n global $DatabaseServer, $DatabaseUsername, $DatabasePassword, $DatabaseName, $DatabasePort, $DatabaseType;\n\n switch ($DatabaseType) {\n case 'mysqli':\n $connection = new mysqli($DatabaseServer, $DatabaseUsername, $DatabasePassword, $DatabaseName, $DatabasePort);\n break;\n }\n\n // Error code for both.\n if ($connection === false) {\n switch ($DatabaseType) {\n case 'mysqli':\n $errormessage = mysqli_error($connection);\n break;\n }\n db_show_error(\"\", \"\" . _couldNotConnectToDatabase . \": $DatabaseServer\", $errormessage);\n }\n return $connection;\n}", "label_name": "Base", "label": 1} {"code": " public function admin () {\r\n User::secure();\r\n System::gZip();\r\n if( User::access(2) ) {\r\n System::versionCheck();\r\n Control::handler('backend');\r\n }else{\r\n Theme::admin('header');\r\n Control::error('noaccess');\r\n Theme::admin('footer');\r\n }\r\n System::Zipped();\r\n }\r", "label_name": "Base", "label": 1} {"code": " function insertObject($object, $table) {\n //if ($table==\"text\") eDebug($object,true); \n $sql = \"INSERT INTO `\" . $this->prefix . \"$table` (\";\n $values = \") VALUES (\";\n foreach (get_object_vars($object) as $var => $val) {\n //We do not want to save any fields that start with an '_'\n if ($var{0} != '_') {\n $sql .= \"`$var`,\";\n if ($values != \") VALUES (\") {\n $values .= \",\";\n }\n $values .= \"'\" . $this->escapeString($val) . \"'\";\n }\n }\n $sql = substr($sql, 0, -1) . substr($values, 0) . \")\";\n //if($table=='text')eDebug($sql,true);\n if (@mysqli_query($this->connection, $sql) != false) {\n $id = mysqli_insert_id($this->connection);\n return $id;\n } else\n return 0;\n }", "label_name": "Class", "label": 2} {"code": " public function approve_submit() {\n global $history;\n \n if (empty($this->params['id'])) {\n flash('error', gt('No ID supplied for comment to approve'));\n $lastUrl = expHistory::getLast('editable');\n }\n \n /* The global constants can be overriden by passing appropriate params */ \n //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet\n $require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : $this->params['require_login'];\n $require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : $this->params['require_approval'];\n $require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : $this->params['require_notification'];\n $notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : $this->params['notification_email'];\n \n $simplenote = new expSimpleNote($this->params['id']);\n //FIXME here is where we might sanitize the note before approving it\n $simplenote->body = $this->params['body'];\n $simplenote->approved = $this->params['approved'];\n $simplenote->save();\n \n $lastUrl = makelink($history->history[$history->history['lasts']['type']][count($history->history[$history->history['lasts']['type']])-1]['params']);\n if (!empty($this->params['tab']))\n {\n $lastUrl .= \"#\".$this->params['tab'];\n }\n redirect_to($lastUrl);\n }", "label_name": "Class", "label": 2} {"code": "\tpublic static function object_votes_by_score($object, $object_id)\r\n\t{\r\n\t\tglobal $DB;\r\n\t\tglobal $website;\r\n\t\t\r\n\t\t$DB->query('\r\n\t\t\tSELECT value, COUNT(*) as votes\r\n\t\t\t FROM nv_webuser_votes\r\n WHERE website = '.protect($website->id).'\r\n\t\t\t AND object = '.protect($object).'\r\n AND object_id = '.protect($object_id).'\r\n\t\t\t GROUP BY value\r\n\t\t\t ORDER BY value ASC\r\n\t\t ');\r\n\t\t\t\t\t \r\n\t\t$data = $DB->result();\r\n\t\t\r\n\t\treturn $data;\r\n\t}\r", "label_name": "Base", "label": 1} {"code": " $module_views[$key]['name'] = gt($value['name']);\n }\n\n // look for a config form for this module's current view \n// $controller->loc->mod = expModules::getControllerClassName($controller->loc->mod);\n //check to see if hcview was passed along, indicating a hard-coded module\n// if (!empty($controller->params['hcview'])) {\n// $viewname = $controller->params['hcview'];\n// } else {\n// $viewname = $db->selectValue('container', 'view', \"internal='\".serialize($controller->loc).\"'\");\n// }\n// $viewconfig = $viewname.'.config';\n// foreach ($modpaths as $path) {\n// if (file_exists($path.'/'.$viewconfig)) {\n// $fileparts = explode('_', $viewname);\n// if ($fileparts[0]=='show'||$fileparts[0]=='showall') array_shift($fileparts);\n// $module_views[$viewname]['name'] = ucwords(implode(' ', $fileparts)).' '.gt('View Configuration');\n// $module_views[$viewname]['file'] =$path.'/'.$viewconfig;\n// }\n// }\n \n // sort the views highest to lowest by filename\n // we are reverse sorting now so our array merge\n // will overwrite property..we will run array_reverse\n // when we're finished to get them back in the right order\n krsort($common_views);\n krsort($module_views);\n\n if (!empty($moduleconfig)) $common_views = array_merge($common_views, $moduleconfig);\n $views = array_merge($common_views, $module_views);\n $views = array_reverse($views);\n\n return $views;\n}", "label_name": "Class", "label": 2} {"code": " public function remove()\n {\n $this->checkCSRFParam();\n $project = $this->getProject();\n $action = $this->actionModel->getById($this->request->getIntegerParam('action_id'));\n\n if (! empty($action) && $this->actionModel->remove($action['id'])) {\n $this->flash->success(t('Action removed successfully.'));\n } else {\n $this->flash->failure(t('Unable to remove this action.'));\n }\n\n $this->response->redirect($this->helper->url->to('ActionController', 'index', array('project_id' => $project['id'])));\n }", "label_name": "Base", "label": 1} {"code": "\tpublic function behaviors() {\n\t\treturn array_merge(parent::behaviors(),array(\n\t\t\t'X2LinkableBehavior'=>array(\n\t\t\t\t'class'=>'X2LinkableBehavior',\n\t\t\t\t'module'=>'marketing'\n\t\t\t),\n\t\t\t'ERememberFiltersBehavior' => array(\n\t\t\t\t'class'=>'application.components.ERememberFiltersBehavior',\n\t\t\t\t'defaults'=>array(),\n\t\t\t\t'defaultStickOnClear'=>false\n\t\t\t)\n\t\t));\n\t}", "label_name": "Base", "label": 1} {"code": " function testMissingExtensionFatal()\n {\n $ext = 'php_ext';\n $warn = 'The ' . $ext\n . ' extension is missing. Please check your PHP configuration.';\n\n $this->expectOutputRegex('@' . preg_quote($warn) . '@');\n\n PMA_warnMissingExtension($ext, true);\n }", "label_name": "Base", "label": 1} {"code": " public function create_directory() {\n if (!AuthUser::hasPermission('file_manager_mkdir')) {\n Flash::set('error', __('You do not have sufficient permissions to create a directory.'));\n redirect(get_url('plugin/file_manager/browse/'));\n }\n \n // CSRF checks\n if (isset($_POST['csrf_token'])) {\n $csrf_token = $_POST['csrf_token'];\n if (!SecureToken::validateToken($csrf_token, BASE_URL.'plugin/file_manager/create_directory')) {\n Flash::set('error', __('Invalid CSRF token found!'));\n redirect(get_url('plugin/file_manager/browse/'));\n }\n }\n else {\n Flash::set('error', __('No CSRF token found!'));\n redirect(get_url('plugin/file_manager/browse/'));\n }\n\n $data = $_POST['directory'];\n\n $path = str_replace('..', '', $data['path']);\n $dirname = str_replace('..', '', $data['name']);\n $dir = FILES_DIR . \"/{$path}/{$dirname}\";\n\n if (mkdir($dir)) {\n $mode = Plugin::getSetting('dirmode', 'file_manager');\n chmod($dir, octdec($mode));\n } else {\n Flash::set('error', __('Directory :name has not been created!', array(':name' => $dirname)));\n }\n redirect(get_url('plugin/file_manager/browse/' . $path));\n }", "label_name": "Class", "label": 2} {"code": " function captureAuthorization() {\n //eDebug($this->params,true);\n $order = new order($this->params['id']);\n /*eDebug($this->params); \n //eDebug($order,true);*/\n //eDebug($order,true);\n //$billing = new billing();\n\n //eDebug($billing, true);\n //$billing->calculator = new $calcname($order->billingmethod[0]->billingcalculator_id);\n $calc = $order->billingmethod[0]->billingcalculator->calculator;\n $calc->config = $order->billingmethod[0]->billingcalculator->config;\n\n //$calc = new $calc-\n //eDebug($calc,true);\n if (!method_exists($calc, 'delayed_capture')) {\n flash('error', gt('The Billing Calculator does not support delayed capture'));\n expHistory::back();\n }\n\n $result = $calc->delayed_capture($order->billingmethod[0], $this->params['capture_amt'], $order);\n\n if (empty($result->errorCode)) {\n flash('message', gt('The authorized payment was successfully captured'));\n expHistory::back();\n\n } else {\n flash('error', gt('An error was encountered while capturing the authorized payment.') . '

    ' . $result->message);\n expHistory::back();\n }\n }", "label_name": "Base", "label": 1} {"code": " $count += $db->dropTable($basename);\n }\n \n flash('message', gt('Deleted').' '.$count.' '.gt('unused tables').'.');\n expHistory::back();\n }", "label_name": "Class", "label": 2} {"code": " public function __construct(){\n\n }", "label_name": "Base", "label": 1} {"code": "\tpublic function netmountPrepare($options) {\n\t\tif (!empty($_REQUEST['encoding']) && @iconv('UTF-8', $_REQUEST['encoding'], '') !== false) {\n\t\t\t$options['encoding'] = $_REQUEST['encoding'];\n\t\t\tif (!empty($_REQUEST['locale']) && @setlocale(LC_ALL, $_REQUEST['locale'])) {\n\t\t\t\tsetlocale(LC_ALL, elFinder::$locale);\n\t\t\t\t$options['locale'] = $_REQUEST['locale'];\n\t\t\t}\n\t\t}\n\t\t$options['statOwner'] = true;\n\t\t$options['allowChmodReadOnly'] = true;\n\t\treturn $options;\n\t}", "label_name": "Base", "label": 1} {"code": " public function safePath($filename = 'data.csv'){\n return implode(DIRECTORY_SEPARATOR, array(\n Yii::app()->basePath,\n 'data',\n $filename\n ));\n }", "label_name": "Base", "label": 1} {"code": " public function remove()\n {\n $this->checkCSRFParam();\n $project = $this->getProject();\n $filter = $this->customFilterModel->getById($this->request->getIntegerParam('filter_id'));\n\n $this->checkPermission($project, $filter);\n\n if ($this->customFilterModel->remove($filter['id'])) {\n $this->flash->success(t('Custom filter removed successfully.'));\n } else {\n $this->flash->failure(t('Unable to remove this custom filter.'));\n }\n\n $this->response->redirect($this->helper->url->to('CustomFilterController', 'index', array('project_id' => $project['id'])));\n }", "label_name": "Base", "label": 1} {"code": " public static function format($date, $format='') {\r\n $timezone = Options::v('timezone');\r\n $time = strtotime($date);\r\n (empty($format))? $format = \"j F Y H:i A T\" : $format = $format;\r\n $date = new DateTime($date);\r\n $date->setTimezone(new DateTimeZone($timezone));\r\n $newdate = $date->format($format);\r\n return $newdate;\r\n }\r", "label_name": "Base", "label": 1} {"code": " protected function getShopByRequest(Request $request)\n {\n $repository = $this->get(ModelManager::class)->getRepository(Shop::class);\n\n $shop = null;\n if ($request->getPost('__shop') !== null) {\n $shop = $repository->getActiveById($request->getPost('__shop'));\n }\n\n if ($shop === null && $request->getCookie('shop') !== null) {\n $shop = $repository->getActiveById($request->getCookie('shop'));\n }\n\n if ($shop && $request->getCookie('shop') !== null && $request->getPost('__shop') == null) {\n $requestShop = $repository->getActiveByRequest($request);\n if ($requestShop !== null && $shop->getId() !== $requestShop->getId() && $shop->getBaseUrl() !== $requestShop->getBaseUrl()) {\n $shop = $requestShop;\n }\n }\n\n if ($shop === null) {\n $shop = $repository->getActiveByRequest($request);\n }\n\n if ($shop === null) {\n $shop = $repository->getActiveDefault();\n }\n\n return $shop;\n }", "label_name": "Base", "label": 1} {"code": " $passwd = generate_password(PASSWORD_LENGTH);\n\n if (change_user_password($name, $passwd)) {\n $email = safe_field(\"email\", 'txp_users', \"name = '\".doSlash($name).\"'\");\n\n if (send_new_password($passwd, $email, $name)) {\n $changed[] = $name;\n $msg = 'author_updated';\n } else {\n return author_list(array(gTxt('could_not_mail').' '.txpspecialchars($name), E_ERROR));\n }\n }\n }\n\n break;\n }\n\n if ($changed) {\n return author_list(gTxt($msg, array('{name}' => txpspecialchars(join(', ', $changed)))));\n }\n\n author_list($msg);\n}", "label_name": "Base", "label": 1} {"code": " $section = new section($this->params);\r\n } else {\r\n notfoundController::handle_not_found();\r\n exit;\r\n }\r\n if (!empty($section->id)) {\r\n $check_id = $section->id;\r\n } else {\r\n $check_id = $section->parent;\r\n }\r\n if (expPermissions::check('manage', expCore::makeLocation('navigation', '', $check_id))) {\r\n if (empty($section->id)) {\r\n $section->active = 1;\r\n $section->public = 1;\r\n if (!isset($section->parent)) {\r\n // This is another precaution. The parent attribute\r\n // should ALWAYS be set by the caller.\r\n //FJD - if that's the case, then we should die.\r\n notfoundController::handle_not_authorized();\r\n exit;\r\n //$section->parent = 0;\r\n }\r\n }\r\n assign_to_template(array(\r\n 'section' => $section,\r\n 'glyphs' => self::get_glyphs(),\r\n ));\r\n } else { // User does not have permission to manage sections. Throw a 403\r\n notfoundController::handle_not_authorized();\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": "\tpublic function formatItem( Article $article, $pageText = null ) {\n\t\tglobal $wgLang;\n\n\t\t$item = '';\n\n\t\t// DPL Article, not MediaWiki.\n\t\t$date = $article->getDate();\n\t\tif ( $date !== null ) {\n\t\t\t$item .= $date . ' ';\n\t\t\tif ( $article->mRevision !== null ) {\n\t\t\t\t$item .= '[{{fullurl:' . $article->mTitle . '|oldid=' . $article->mRevision . '}} ' . htmlspecialchars( $article->mTitle ) . ']';\n\t\t\t} else {\n\t\t\t\t$item .= $article->mLink;\n\t\t\t}\n\t\t} else {\n\t\t\t// output the link to the article\n\t\t\t$item .= $article->mLink;\n\t\t}\n\n\t\tif ( $article->mSize != null ) {\n\t\t\t$byte = 'B';\n\t\t\t$pageLength = $wgLang->formatNum( $article->mSize );\n\t\t\t$item .= \" [{$pageLength} {$byte}]\";\n\t\t}\n\n\t\tif ( $article->mCounter !== null ) {\n\t\t\t$contLang = MediaWikiServices::getInstance()->getContentLanguage();\n\n\t\t\t$item .= ' ' . $contLang->getDirMark() . '(' . wfMessage( 'hitcounters-nviews', $wgLang->formatNum( $article->mCounter ) )->escaped() . ')';\n\t\t}\n\n\t\tif ( $article->mUserLink !== null ) {\n\t\t\t$item .= ' . . [[User:' . $article->mUser . '|' . $article->mUser . ']]';\n\t\t\tif ( $article->mComment != '' ) {\n\t\t\t\t$item .= ' { ' . $article->mComment . ' }';\n\t\t\t}\n\t\t}\n\n\t\tif ( $article->mContributor !== null ) {\n\t\t\t$item .= ' . . [[User:' . $article->mContributor . '|' . $article->mContributor . \" $article->mContrib]]\";\n\t\t}\n\n\t\tif ( !empty( $article->mCategoryLinks ) ) {\n\t\t\t$item .= ' . . ' . wfMessage( 'categories' ) . ': ' . implode( ' | ', $article->mCategoryLinks ) . '';\n\t\t}\n\n\t\tif ( $this->getParameters()->getParameter( 'addexternallink' ) && $article->mExternalLink !== null ) {\n\t\t\t$item .= ' \u2192 ' . $article->mExternalLink;\n\t\t}\n\n\t\tif ( $pageText !== null ) {\n\t\t\t//Include parsed/processed wiki markup content after each item before the closing tag.\n\t\t\t$item .= $pageText;\n\t\t}\n\n\t\t$item = $this->getItemStart() . $item . $this->getItemEnd();\n\n\t\t$item = $this->replaceTagParameters( $item, $article );\n\n\t\treturn $item;\n\t}", "label_name": "Class", "label": 2} {"code": " $pos = strpos($val, $match);\n\n if ($pos !== false) {\n if ($field != '') {\n $var = '$r' . getvarname($field);\n $itm = trim(substr($val, $pos + strlen($match)));\n\n if ($itm != '')\n eval($var . '=\"' . str_replace('\"', '\\\"', $itm) . '\";');\n }\n\n if (!$scanall)\n break;\n }\n }\n }\n }\n\n if (empty($r)) {\n if ($hasreg) $r['registered'] = 'no';\n } else {\n if ($hasreg) $r['registered'] = 'yes';\n\n $r = format_dates($r, $dateformat);\n }\n\n return $r;\n}", "label_name": "Base", "label": 1} {"code": "\tpublic function start()\n\t{\n\t\t@session_start();\n\t\t$this->started = session_id()? true : false;\n\t\t\n\t\treturn $this;\n\t}", "label_name": "Base", "label": 1} {"code": " protected function _save($fp, $dir, $name, $stat)\n {\n //TODO optionally encrypt $fp before uploading if mime is not already encrypted type\n $path = $this->_joinPath($dir, $name);\n return $this->connect->put($path, $fp)\n ? $path\n : false;\n }", "label_name": "Base", "label": 1} {"code": " $that->assertGreaterThanOrEqual(time() - 1, $criteria[$that->options['expiry_field']]['$lt']->sec);\n }));", "label_name": "Base", "label": 1} {"code": " foreach ($page as $pageperm) {\r\n if (!empty($pageperm['manage'])) return true;\r\n }\r", "label_name": "Base", "label": 1} {"code": " public static function insert($vars) {\n if(is_array($vars)) {\n $slug = Typo::slugify($vars['title']);\n $vars = array_merge($vars, array('slug' => $slug));\n //print_r($vars);\n $ins = array(\n 'table' => 'options',\n 'key' => $vars\n );\n $post = Db::insert($ins);\n }\n return $post;\n }", "label_name": "Base", "label": 1} {"code": " public function showall() {\n expHistory::set('viewable', $this->params);\n // figure out if should limit the results\n if (isset($this->params['limit'])) {\n $limit = $this->params['limit'] == 'none' ? null : $this->params['limit'];\n } else {\n $limit = (isset($this->config['limit']) && $this->config['limit'] != '') ? $this->config['limit'] : 10;\n } \n $order = isset($this->config['order']) ? $this->config['order'] : 'publish DESC';\n\n // pull the news posts from the database\n $items = $this->news->find('all', $this->aggregateWhereClause(), $order);\n\n // merge in any RSS news and perform the sort and limit the number of posts we return to the configured amount.\n if (!empty($this->config['pull_rss'])) $items = $this->mergeRssData($items);\n \n // setup the pagination object to paginate the news stories.\n $page = new expPaginator(array(\n 'records'=>$items,\n 'limit'=>$limit,\n 'order'=>$order,\n 'page'=>(isset($this->params['page']) ? $this->params['page'] : 1),\n 'controller'=>$this->params['controller'],\n 'action'=>$this->params['action'],\n 'src'=>$this->loc->src,\n 'view'=>empty($this->params['view']) ? null : $this->params['view']\n ));\n \n assign_to_template(array(\n 'page'=>$page,\n 'items'=>$page->records,\n 'rank'=>($order==='rank')?1:0,\n 'params'=>$this->params,\n ));\n }", "label_name": "Base", "label": 1} {"code": " private function formatResponse($view, $title, $settings, $status = 'ok')\n {\n if ($view instanceof View) {\n $html = $view->__toString();\n $show_settings = (int) Str::startsWith($view->getName(), 'widgets.settings.');\n } else {\n $html = (string) $view;\n $show_settings = (int) $this->show_settings;\n }\n\n return response()->json([\n 'status' => $status,\n 'title' => __($title),\n 'html' => $html,\n 'show_settings' => $show_settings,\n 'settings' => $settings,\n ]);\n }", "label_name": "Base", "label": 1} {"code": " public function saveOption(Request $request) {\n\n $cleanFromXss = true;\n $option = $request->all();\n\n // Allow for this keys\n if (isset($option['option_key'])) {\n if ($option['option_key'] == 'website_head') {\n $cleanFromXss = false;\n }\n if ($option['option_key'] == 'website_footer') {\n $cleanFromXss = false;\n }\n }\n\n if ($cleanFromXss) {\n $clean = new HTMLClean();\n $option = $clean->cleanArray($option);\n }\n\n return save_option($option);\n }", "label_name": "Base", "label": 1} {"code": " function handleFormSubmission() {\r\n $request = $request = $this->pageContext->getRequest();\r\n\r\n $dbw = getTransactableDatabase('scratch-confirmaccount-bypasses');\r\n\r\n foreach (self::requestVariableActionMapping as $fieldKey => $action) {\r\n if ($request->getText($fieldKey)) {\r\n $action($request->getText($fieldKey), $dbw);\r\n }\r\n }\r\n\r\n commitTransaction($dbw, 'scratch-confirmaccount-bypasses');\r\n\r\n $this->render();\r\n }\r", "label_name": "Compound", "label": 4} {"code": " public function __construct(PromotionGatewayInterface $gateway, PromotionItemBuilder $itemBuilder)\n {\n $this->gateway = $gateway;\n $this->itemBuilder = $itemBuilder;\n\n $this->requiredDalAssociations = [\n 'personaRules',\n 'personaCustomers',\n 'cartRules',\n 'orderRules',\n 'discounts.discountRules',\n 'discounts.promotionDiscountPrices',\n 'setgroups',\n 'setgroups.setGroupRules',\n ];\n }", "label_name": "Base", "label": 1} {"code": " public static function error ($vars=\"\") {\n if( isset($vars) && $vars != \"\" ) {\n include(GX_PATH.'/inc/lib/Control/Error/'.$vars.'.control.php');\n }else{\n include(GX_PATH.'/inc/lib/Control/Error/404.control.php');\n }\n }", "label_name": "Base", "label": 1} {"code": " function prepareInputForUpdate($input) {\n\n if (isset($input[\"passwd\"])) {\n if (empty($input[\"passwd\"])) {\n unset($input[\"passwd\"]);\n } else {\n $input[\"passwd\"] = Toolbox::encrypt(stripslashes($input[\"passwd\"]), GLPIKEY);\n }\n }\n\n if (isset($input[\"_blank_passwd\"]) && $input[\"_blank_passwd\"]) {\n $input['passwd'] = '';\n }\n\n if (isset($input['mail_server']) && !empty($input['mail_server'])) {\n $input[\"host\"] = Toolbox::constructMailServerConfig($input);\n }\n\n if (isset($input['name']) && !NotificationMailing::isUserAddressValid($input['name'])) {\n Session::addMessageAfterRedirect(__('Invalid email address'), false, ERROR);\n }\n\n return $input;\n }", "label_name": "Base", "label": 1} {"code": " private function sub_resource_download()\n {\n if (empty($this->response->meta->sub_resource_id)) {\n $this->response->meta->sub_resource_id = 0;\n }\n $attachment = $this->m_devices->read_sub_resource($this->response->meta->id, $this->response->meta->sub_resource, $this->response->meta->sub_resource_id, '*', '', '', '');\n $this->load->helper('file');\n if (php_uname('s') === 'Windows NT') {\n $temp = explode('\\\\', $attachment[0]->attributes->filename);\n } else {\n $temp = explode('/', $attachment[0]->attributes->filename);\n }\n $filename = $temp[count($temp)-1];\n $filename = preg_replace('/'.$this->response->meta->id.'_/', '', $filename, 1);\n header('Content-Type: '.get_mime_by_extension($attachment[0]->attributes->filename));\n header('Content-Disposition: attachment;filename=\"'.$filename.'\"');\n header('Cache-Control: max-age=0');\n readfile($attachment[0]->attributes->filename);\n }", "label_name": "Base", "label": 1} {"code": " private function getCategory()\n {\n $category = $this->categoryModel->getById($this->request->getIntegerParam('category_id'));\n\n if (empty($category)) {\n throw new PageNotFoundException();\n }\n\n return $category;\n }", "label_name": "Class", "label": 2} {"code": "function logging($module,$command,$user=false){\n\tglobal $database_eonweb;\n\tglobal $dateformat;\n\tif($user)\n\t\tsqlrequest($database_eonweb,\"insert into logs values ('','\".time().\"','$user','$module','$command','\".$_SERVER[\"REMOTE_ADDR\"].\"');\");\n\telseif(isset($_COOKIE['user_name']))\n\t\tsqlrequest($database_eonweb,\"insert into logs values ('','\".time().\"','\".$_COOKIE['user_name'].\"','$module','$command','\".$_SERVER[\"REMOTE_ADDR\"].\"');\");\n}", "label_name": "Base", "label": 1} {"code": "\tpublic function approvedFileExtension($filename, $type = 'image')\n\t{\n\t\t$ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION));\n\t\tif ($type == 'image') {\n\t\t\tswitch ($ext) {\n\t\t\t\tcase 'gif':\n\t\t\t\tcase 'png':\n\t\t\t\tcase 'jpeg':\n\t\t\t\tcase 'jpg':\n\t\t\t\tcase 'svg':\n\t\t\t\t\treturn true;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t} elseif ($type == 'cert') {\n\t\t\tswitch ($ext) {\n\t\t\t\tcase 'pem':\n\t\t\t\t\treturn true;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "label_name": "Base", "label": 1} {"code": " function updateObject($object, $table, $where=null, $identifier='id', $is_revisioned=false) {\n\n if ($is_revisioned) {\n $object->revision_id++;\n //if ($table==\"text\") eDebug($object);\n $res = $this->insertObject($object, $table);\n //if ($table==\"text\") eDebug($object,true); \n $this->trim_revisions($table, $object->$identifier, WORKFLOW_REVISION_LIMIT);\n return $res;\n }\n $sql = \"UPDATE \" . $this->prefix . \"$table SET \";\n foreach (get_object_vars($object) as $var => $val) {\n //We do not want to save any fields that start with an '_'\n //if($is_revisioned && $var=='revision_id') $val++;\n if ($var{0} != '_') {\n if (is_array($val) || is_object($val)) {\n $val = serialize($val); \n $sql .= \"`$var`='\".$val.\"',\";\n } else {\n $sql .= \"`$var`='\" . $this->escapeString($val) . \"',\";\n }\n }\n }\n $sql = substr($sql, 0, -1) . \" WHERE \";\n if ($where != null)\n $sql .= $this->injectProof($where);\n else\n $sql .= \"`\" . $identifier . \"`=\" . $object->$identifier;\n //if ($table == 'text') eDebug($sql,true); \n $res = (@mysqli_query($this->connection, $sql) != false);\n return $res;\n }", "label_name": "Base", "label": 1} {"code": "\tpublic function validate($value, $isUserFormat = false)\n\t{\n\t\tif (empty($value)) {\n\t\t\treturn;\n\t\t}\n\t\tif (\\is_string($value)) {\n\t\t\t$value = \\App\\Json::decode($value);\n\t\t}\n\t\tif (!\\is_array($value)) {\n\t\t\tthrow new \\App\\Exceptions\\Security('ERR_ILLEGAL_FIELD_VALUE||' . $this->getFieldModel()->getFieldName() . '||' . $this->getFieldModel()->getModuleName() . '||' . $value, 406);\n\t\t}\n\t\t$currencies = \\App\\Fields\\Currency::getAll(true);\n\t\tforeach ($value['currencies'] ?? [] as $id => $currency) {\n\t\t\tif (!isset($currencies[$id])) {\n\t\t\t\tthrow new \\App\\Exceptions\\Security('ERR_ILLEGAL_FIELD_VALUE||' . $this->getFieldModel()->getFieldName() . '||' . $this->getFieldModel()->getModuleName() . '||' . $id, 406);\n\t\t\t}\n\t\t\t$price = $currency['price'];\n\t\t\tif ($isUserFormat) {\n\t\t\t\t$price = App\\Fields\\Double::formatToDb($price);\n\t\t\t}\n\t\t\tif (!is_numeric($price)) {\n\t\t\t\tthrow new \\App\\Exceptions\\Security('ERR_ILLEGAL_FIELD_VALUE||' . $this->getFieldModel()->getFieldName() . '||' . $this->getFieldModel()->getModuleName() . '||' . $price, 406);\n\t\t\t}\n\t\t}\n\t}", "label_name": "Class", "label": 2} {"code": " protected function getSubtask()\n {\n $subtask = $this->subtaskModel->getById($this->request->getIntegerParam('subtask_id'));\n\n if (empty($subtask)) {\n throw new PageNotFoundException();\n }\n\n return $subtask;\n }", "label_name": "Base", "label": 1} {"code": " public function save_change_password() {\n global $user;\n\n $isuser = ($this->params['uid'] == $user->id) ? 1 : 0;\n\n if (!$user->isAdmin() && !$isuser) {\n flash('error', gt('You do not have permissions to change this users password.'));\n expHistory::back();\n }\n\n if (($isuser && empty($this->params['password'])) || (!empty($this->params['password']) && $user->password != user::encryptPassword($this->params['password']))) {\n flash('error', gt('The current password you entered is not correct.'));\n expHistory::returnTo('editable');\n }\n //eDebug($user);\n $u = new user($this->params['uid']);\n\n $ret = $u->setPassword($this->params['new_password1'], $this->params['new_password2']);\n //eDebug($u, true);\n if (is_string($ret)) {\n flash('error', $ret);\n expHistory::returnTo('editable');\n } else {\n $params = array();\n $params['is_admin'] = !empty($u->is_admin);\n $params['is_acting_admin'] = !empty($u->is_acting_admin);\n $u->update($params);\n }\n\n if (!$isuser) {\n flash('message', gt('The password for') . ' ' . $u->username . ' ' . gt('has been changed.'));\n } else {\n $user->password = $u->password;\n flash('message', gt('Your password has been changed.'));\n }\n expHistory::back();\n }", "label_name": "Base", "label": 1} {"code": " public function testValidateRequestUri()\n {\n new Request('GET', true);\n }", "label_name": "Base", "label": 1} {"code": " $this->subtaskTimeTrackingModel->logEndTime($subtaskId, $this->userSession->getId());\n $this->subtaskTimeTrackingModel->updateTaskTimeTracking($task['id']);\n }", "label_name": "Base", "label": 1} {"code": " foreach ($fields as $field) {\n $fieldName = $field->fieldName;\n if ($field->type == 'date' || $field->type == 'dateTime') {\n if (is_numeric($record->$fieldName))\n $record->$fieldName = Formatter::formatLongDateTime($record->$fieldName);\n }elseif ($field->type == 'link') {\n $name = $record->$fieldName;\n if (!empty($field->linkType)) {\n list($name, $id) = Fields::nameAndId($name);\n }\n if (!empty($name))\n $record->$fieldName = $name;\n }elseif ($fieldName == 'visibility') {\n $record->$fieldName = $record->$fieldName == 1 ? 'Public' : 'Private';\n }\n }", "label_name": "Class", "label": 2} {"code": " public function testGetDropdownValue($params, $expected, $session_params = []) {\n $this->login();\n\n $bkp_params = [];\n //set session params if any\n if (count($session_params)) {\n foreach ($session_params as $param => $value) {\n if (isset($_SESSION[$param])) {\n $bkp_params[$param] = $_SESSION[$param];\n }\n $_SESSION[$param] = $value;\n }\n }\n\n $params['_idor_token'] = \\Session::getNewIDORToken($params['itemtype'] ?? '');\n\n $result = \\Dropdown::getDropdownValue($params, false);\n\n //reset session params before executing test\n if (count($session_params)) {\n foreach ($session_params as $param => $value) {\n if (isset($bkp_params[$param])) {\n $_SESSION[$param] = $bkp_params[$param];\n } else {\n unset($_SESSION[$param]);\n }\n }\n }\n\n $this->array($result)->isIdenticalTo($expected);\n }", "label_name": "Base", "label": 1} {"code": " public function actionGetItems($modelType){\n \n $sql = 'SELECT id, name as value FROM x2_campaigns WHERE name LIKE :qterm ORDER BY name ASC';\n \n $command = Yii::app()->db->createCommand($sql);\n $qterm = '%'.$_GET['term'].'%';\n $command->bindParam(\":qterm\", $qterm, PDO::PARAM_STR);\n $result = $command->queryAll();\n echo CJSON::encode($result);\n exit;\n }", "label_name": "Class", "label": 2} {"code": " public function testLogoutDelete()\n {\n $GLOBALS['cfg']['Server']['auth_swekey_config'] = '';\n $GLOBALS['cfg']['CaptchaLoginPrivateKey'] = '';\n $GLOBALS['cfg']['CaptchaLoginPublicKey'] = '';\n $_REQUEST['old_usr'] = 'pmaolduser';\n $GLOBALS['cfg']['LoginCookieDeleteAll'] = true;\n $GLOBALS['cfg']['Servers'] = array(1);\n\n $_COOKIE['pmaPass-0'] = 'test';\n\n $this->object->authCheck();\n\n $this->assertFalse(\n isset($_COOKIE['pmaPass-0'])\n );\n }", "label_name": "Class", "label": 2} {"code": " public function testIsActivePhp53()\n {\n if (PHP_VERSION_ID >= 50400) {\n $this->markTestSkipped('Test skipped, for PHP 5.3 only.');\n }\n\n $this->assertFalse($this->proxy->isActive());\n }", "label_name": "Base", "label": 1} {"code": " public function __construct($message = null, $code = 0, Exception $previous = null)\n {\n if ($message === null) {\n $message = _('Authentication required');\n }\n parent::__construct($message, $code, $previous);\n }", "label_name": "Base", "label": 1} {"code": "\tpublic function insert()\r\n\t{\r\n\t\tglobal $DB;\r\n \r\n\t\t$ok = $DB->execute(' \r\n \t\t\tINSERT INTO nv_menus\r\n\t\t\t\t(id, codename, icon, lid, notes, functions, enabled)\r\n\t\t\tVALUES \r\n\t\t\t\t( 0, :codename, :icon, :lid, :notes, :functions, :enabled)',\r\n\t\t\tarray(\r\n\t\t\t\t'codename' => value_or_default($this->codename, \"\"),\r\n\t\t\t\t'icon' => value_or_default($this->icon, \"\"),\r\n\t\t\t\t'lid' => value_or_default($this->lid, 0),\r\n\t\t\t\t'notes' => value_or_default($this->notes, \"\"),\r\n\t\t\t\t'functions' => json_encode($this->functions),\r\n\t\t\t\t'enabled' => value_or_default($this->enabled, 0)\r\n\t\t\t)\r\n\t\t);\r\n\t\t\t\t\r\n\t\tif(!$ok)\r\n\t\t\tthrow new Exception($DB->get_last_error());\r\n\t\t\r\n\t\t$this->id = $DB->get_last_id();\r\n\t\t\r\n\t\treturn true;\r\n\t}\t\r", "label_name": "Base", "label": 1} {"code": " function scan_page($parent_id) {\r\n global $db;\r\n\r\n $sections = $db->selectObjects('section','parent=' . $parent_id);\r\n $ret = '';\r\n foreach ($sections as $page) {\r\n $cLoc = serialize(expCore::makeLocation('container','@section' . $page->id));\r\n $ret .= scan_container($cLoc, $page->id);\r\n $ret .= scan_page($page->id);\r\n }\r\n return $ret;\r\n }\r", "label_name": "Base", "label": 1} {"code": " $banner->increaseImpressions();\n }\n }\n \n // assign banner to the template and show it!\n assign_to_template(array(\n 'banners'=>$banners\n ));\n }", "label_name": "Base", "label": 1} {"code": " protected function getCheckFileQuery()\n {\n global $zdb;\n\n $select = $zdb->select(self::TABLE);\n $select->columns(\n array(\n 'picture',\n 'format'\n )\n );\n $select->where(self::PK . ' = ' . $this->db_id);\n return $select;\n }", "label_name": "Base", "label": 1} {"code": " private function getSwimlane()\n {\n $swimlane = $this->swimlaneModel->getById($this->request->getIntegerParam('swimlane_id'));\n\n if (empty($swimlane)) {\n throw new PageNotFoundException();\n }\n\n return $swimlane;\n }", "label_name": "Base", "label": 1} {"code": " public static function validateNumber(\n $path,\n $values,\n $allow_neg,\n $allow_zero,\n $max_value,\n $error_string\n ) {\n if ($values[$path] === '') {\n return '';\n }\n\n if (intval($values[$path]) != $values[$path]\n || (! $allow_neg && $values[$path] < 0)\n || (! $allow_zero && $values[$path] == 0)\n || $values[$path] > $max_value\n ) {\n return $error_string;\n }\n\n return '';\n }", "label_name": "Class", "label": 2} {"code": "function svn_utils_criteria_list_to_query($criteria_list)\n{\n $criteria_list = str_replace('>', ' ASC', $criteria_list);\n $criteria_list = str_replace('<', ' DESC', $criteria_list);\n return $criteria_list;\n}", "label_name": "Base", "label": 1} {"code": " private function __checkIfPulledEventExistsAndAddOrUpdate($event, $eventId, &$successes, &$fails, $eventModel, $server, $user, $jobId)\n {\n // check if the event already exist (using the uuid)\n $existingEvent = $eventModel->find('first', array('conditions' => array('Event.uuid' => $event['Event']['uuid'])));\n $passAlong = $server['Server']['id'];\n if (!$existingEvent) {\n // add data for newly imported events\n $result = $eventModel->_add($event, true, $user, $server['Server']['org_id'], $passAlong, true, $jobId);\n if ($result === true) {\n $successes[] = $eventId;\n } else {\n $fails[$eventId] = __('Failed (partially?) because of errors: ') . $result;\n }\n } else {\n if (!$existingEvent['Event']['locked'] && !$server['Server']['internal']) {\n $fails[$eventId] = __('Blocked an edit to an event that was created locally. This can happen if a synchronised event that was created on this instance was modified by an administrator on the remote side.');\n } else {\n $result = $eventModel->_edit($event, $user, $existingEvent['Event']['id'], $jobId, $passAlong);\n if ($result === true) {\n $successes[] = $eventId;\n } elseif (isset($result['error'])) {\n $fails[$eventId] = $result['error'];\n } else {\n $fails[$eventId] = json_encode($result);\n }\n }\n }\n }", "label_name": "Class", "label": 2} {"code": "\tpublic function setLoggerChannel($channel = 'Organizr', $username = null)\n\t{\n\t\tif ($this->hasDB()) {\n\t\t\t$setLogger = false;\n\t\t\tif ($username) {\n\t\t\t\t$username = htmlspecialchars($username);\n\t\t\t}\n\t\t\tif ($this->logger) {\n\t\t\t\tif ($channel) {\n\t\t\t\t\tif (strtolower($this->logger->getChannel()) !== strtolower($channel)) {\n\t\t\t\t\t\t$setLogger = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($username) {\n\t\t\t\t\tif (strtolower($this->logger->getTraceId()) !== strtolower($channel)) {\n\t\t\t\t\t\t$setLogger = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$setLogger = true;\n\t\t\t}\n\t\t\tif ($setLogger) {\n\t\t\t\t$channel = $channel ?: 'Organizr';\n\t\t\t\treturn $this->setupLogger($channel, $username);\n\t\t\t} else {\n\t\t\t\treturn $this->logger;\n\t\t\t}\n\t\t}\n\t}", "label_name": "Base", "label": 1} {"code": " public function confirm()\n {\n $task = $this->getTask();\n $comment = $this->getComment();\n\n $this->response->html($this->template->render('comment/remove', array(\n 'comment' => $comment,\n 'task' => $task,\n 'title' => t('Remove a comment')\n )));\n }", "label_name": "Base", "label": 1} {"code": " public function setAutoLogin()\n {\n // create object and set current session data to AutoLogin\n $this->mAutoLogin = new AutoLogin($this->db);\n $this->mAutoLogin->setValue('atl_session_id', $this->getValue('ses_session_id'));\n $this->mAutoLogin->setValue('atl_org_id', (int) $this->getValue('ses_org_id'));\n $this->mAutoLogin->setValue('atl_usr_id', (int) $this->getValue('ses_usr_id'));\n\n // set new auto_login_id and save data\n $this->mAutoLogin->setValue('atl_auto_login_id', $this->mAutoLogin->generateAutoLoginId((int) $this->getValue('ses_usr_id')));\n $this->mAutoLogin->save();\n\n // save cookie for autologin\n $currDateTime = new \\DateTime();\n $oneYearDateInterval = new \\DateInterval('P1Y');\n $oneYearAfterDateTime = $currDateTime->add($oneYearDateInterval);\n $timestampExpired = $oneYearAfterDateTime->getTimestamp();\n\n self::setCookie($this->cookieAutoLoginId, $this->mAutoLogin->getValue('atl_auto_login_id'), $timestampExpired);\n }", "label_name": "Base", "label": 1} {"code": "function init_args()\n{\n\t$_REQUEST = strings_stripSlashes($_REQUEST);\n \n $args = new stdClass();\n $args->user_id = $_SESSION['userID'];\n $args->tproject_id = $_SESSION['testprojectID'];\n $args->tproject_name = $_SESSION['testprojectName'];\n \n $args->tplan_id = isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : $_SESSION['testplanID'];\n \n $args->id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;\n $args->version_id = isset($_REQUEST['version_id']) ? $_REQUEST['version_id'] : 0;\n $args->level = isset($_REQUEST['level']) ? $_REQUEST['level'] : null;\n \n // Can be a list (string with , (comma) has item separator), \n $args->keyword_id = isset($_REQUEST['keyword_id']) ? $_REQUEST['keyword_id'] : 0;\n\n return $args; \n}", "label_name": "Base", "label": 1} {"code": " public function toCompiled()\n {\n return $this->processor->processUpdate($this, []);\n }", "label_name": "Base", "label": 1} {"code": " function configure() {\n expHistory::set('editable', $this->params);\n // little bit of trickery so that that categories can have their own configs\n \n $this->loc->src = \"@globalstoresettings\";\n $config = new expConfig($this->loc);\n $this->config = $config->config;\n $pullable_modules = expModules::listInstalledControllers($this->baseclassname, $this->loc);\n $views = expTemplate::get_config_templates($this, $this->loc);\n \n $gc = new geoCountry(); \n $countries = $gc->find('all');\n \n $gr = new geoRegion(); \n $regions = $gr->find('all');\n \n assign_to_template(array(\n 'config'=>$this->config,\n 'pullable_modules'=>$pullable_modules,\n 'views'=>$views,\n 'countries'=>$countries,\n 'regions'=>$regions,\n 'title'=>static::displayname()\n ));\n } ", "label_name": "Base", "label": 1} {"code": " foreach ($grpusers as $u) {\r\n $emails[$u->email] = trim(user::getUserAttribution($u->id));\r\n }\r", "label_name": "Base", "label": 1} {"code": " public function __construct(\n $status = 200,\n array $headers = [],\n $body = null,\n $version = '1.1',\n $reason = null\n ) {\n $this->statusCode = (int) $status;\n\n if ($body !== null) {\n $this->stream = stream_for($body);\n }\n\n $this->setHeaders($headers);\n if (!$reason && isset(self::$phrases[$this->statusCode])) {\n $this->reasonPhrase = self::$phrases[$status];\n } else {\n $this->reasonPhrase = (string) $reason;\n }\n\n $this->protocol = $version;\n }", "label_name": "Base", "label": 1} {"code": "function delete_bp($bp,$bdd){\n $sql = \"delete from bp where name = '\" . $bp . \"'\";\n $bdd->exec($sql);\n\n\t$sql = \"delete from bp_services where bp_name = '\" . $bp . \"'\";\n $bdd->exec($sql);\n\n\t$sql = \"delete from bp_links where bp_name = '\" . $bp . \"'\";\n\t$bdd->exec($sql);\n\t\n\t$sql = \"delete from bp_links where bp_link = '\" . $bp . \"'\";\n\t$bdd->exec($sql);\n}", "label_name": "Base", "label": 1} {"code": " private static function retrieveClosurePattern($pure, $closureName)\n {\n $pattern = '/';\n if (!$pure) {\n $pattern .= preg_quote(self::$registeredDelimiters[0]) . \"\\s*\";\n }\n $pattern .= \"$closureName\\(([a-z0-9,\\.\\s]+)\\)\";\n if (!$pure) {\n $pattern .= \"\\s*\" . preg_quote(self::$registeredDelimiters[1]);\n }\n return $pattern . \"/i\";\n }", "label_name": "Variant", "label": 0} {"code": "\tpublic function setHeadListAttributes( $attributes ) {\n\t\t$this->headListAttributes = \\Sanitizer::fixTagAttributes( $attributes, 'ul' );\n\t}", "label_name": "Class", "label": 2} {"code": " public function getFilePath($fileName = null)\n {\n if ($fileName === null) {\n $fileName = $this->fileName;\n }\n\n return $this->theme->getPath().'/'.$this->dirName.'/'.$fileName;\n }", "label_name": "Class", "label": 2} {"code": "function db_start()\n{\n global $DatabaseServer, $DatabaseUsername, $DatabasePassword, $DatabaseName, $DatabasePort, $DatabaseType;\n\n switch ($DatabaseType) {\n case 'mysqli':\n $connection = new mysqli($DatabaseServer, $DatabaseUsername, $DatabasePassword, $DatabaseName, $DatabasePort);\n break;\n }\n\n // Error code for both.\n if ($connection === false) {\n switch ($DatabaseType) {\n case 'mysqli':\n $errormessage = mysqli_error($connection);\n break;\n }\n db_show_error(\"\", \"\" . _couldNotConnectToDatabase . \": $DatabaseServer\", $errormessage);\n }\n return $connection;\n}", "label_name": "Base", "label": 1} {"code": " public function saveconfig() {\n global $db;\n\n if (empty($this->params['id'])) return false;\n $calcname = $db->selectValue('shippingcalculator', 'calculator_name', 'id='.$this->params['id']);\n $calc = new $calcname($this->params['id']);\n $conf = serialize($calc->parseConfig($this->params)); \n $calc->update(array('config'=>$conf));\n expHistory::back();\n }", "label_name": "Class", "label": 2} {"code": " $arrDetail['total_price'] = sc_currency_value($cartItem->price) * $cartItem->qty;\n $arrCartDetail[] = $arrDetail;\n }\n\n //Set session info order\n session(['dataOrder' => $dataOrder]);\n session(['arrCartDetail' => $arrCartDetail]);\n\n //Create new order\n $newOrder = (new ShopOrder)->createOrder($dataOrder, $dataTotal, $arrCartDetail);\n\n if ($newOrder['error'] == 1) {\n return redirect(sc_route('cart'))->with(['error' => $newOrder['msg']]);\n }\n //Set session orderID\n session(['orderID' => $newOrder['orderID']]);\n\n //Create new address\n if ($address_process == 'new') {\n $addressNew = [\n 'first_name' => $shippingAddress['first_name'] ?? '',\n 'last_name' => $shippingAddress['last_name'] ?? '',\n 'first_name_kana' => $shippingAddress['first_name_kana'] ?? '',\n 'last_name_kana' => $shippingAddress['last_name_kana'] ?? '',\n 'postcode' => $shippingAddress['postcode'] ?? '',\n 'address1' => $shippingAddress['address1'] ?? '',\n 'address2' => $shippingAddress['address2'] ?? '',\n 'country' => $shippingAddress['country'] ?? '',\n 'phone' => $shippingAddress['phone'] ?? '',\n ];\n ShopCustomer::find($uID)->addresses()->save(new ShopCustomerAddress(sc_clean($addressNew)));\n session()->forget('address_process'); //destroy address_process\n }\n\n $paymentMethod = sc_get_class_plugin_controller('Payment', session('paymentMethod'));\n\n if ($paymentMethod) {\n // Check payment method\n return (new $paymentMethod)->processOrder();\n } else {\n return (new ShopCartController)->completeOrder();\n }\n }", "label_name": "Base", "label": 1} {"code": " public function getHeader()\n {\n $html = '\n '.$this->getTitle().'\n ';\n\n $html .= 'getStaticUrl('css/bootstrap.css').'\" rel=\"stylesheet\">\n getStaticUrl('css/font-awesome.css').'\" rel=\"stylesheet\">\n getStaticUrl('css/global.css').'\" rel=\"stylesheet\">\n getStaticUrl('css/ui-lightness/jquery-ui.css').'\" rel=\"stylesheet\">\n getStaticUrl('../application/modules/user/static/css/user.css').'\" rel=\"stylesheet\">\n \n \n ';\n return $html;\n }", "label_name": "Base", "label": 1} {"code": " public function logout()\n {\n // Initialize the current auth session before trying to remove it\n if (is_null($this->user) && !$this->check()) {\n return;\n }\n\n if ($this->isImpersonator()) {\n $this->user = $this->getImpersonator();\n $this->stopImpersonate();\n return;\n }\n\n if ($this->user) {\n $this->user->setRememberToken(null);\n $this->user->forceSave();\n }\n\n $this->user = null;\n\n Session::flush();\n Cookie::queue(Cookie::forget($this->sessionKey));\n }", "label_name": "Base", "label": 1} {"code": " public static function loadFrom(Db $zdb, $id, $mailing, $new = true)\n {\n try {\n $select = $zdb->select(self::TABLE);\n $select->where('mailing_id = ' . $id);\n\n $results = $zdb->execute($select);\n $result = $results->current();\n\n return $mailing->loadFromHistory($result, $new);\n } catch (Throwable $e) {\n Analog::log(\n 'Unable to load mailing model #' . $id . ' | ' .\n $e->getMessage(),\n Analog::WARNING\n );\n throw $e;\n }\n }", "label_name": "Base", "label": 1} {"code": " public function get($columns = ['*'])\n {\n if (!is_null($this->cacheMinutes)) {\n $results = $this->getCached($columns);\n }\n else {\n $results = $this->getFresh($columns);\n }\n\n $models = $this->getModels($results ?: []);\n\n return $this->model->newCollection($models);\n }", "label_name": "Base", "label": 1} {"code": " public function actionGetItems(){\n $model = X2Model::model ($this->modelClass);\n if (isset ($model)) {\n $tableName = $model->tableName ();\n $sql = \n 'SELECT id, subject as value\n FROM '.$tableName.' WHERE subject LIKE :qterm ORDER BY subject ASC';\n $command = Yii::app()->db->createCommand($sql);\n $qterm = $_GET['term'].'%';\n $command->bindParam(\":qterm\", $qterm, PDO::PARAM_STR);\n $result = $command->queryAll();\n echo CJSON::encode($result);\n }\n Yii::app()->end();\n }", "label_name": "Class", "label": 2} {"code": "function get_is_file($dir, $item) {\t\t// can this file be edited?\n\treturn @is_file(get_abs_item($dir,$item));\n}", "label_name": "Base", "label": 1} {"code": " public function load($id)\n {\n try {\n $select = $this->zdb->select(self::TABLE);\n $select->where(self::PK . ' = ' . $id);\n\n $results = $this->zdb->execute($select);\n $result = $results->current();\n\n if ($result) {\n $this->loadFromRs($result);\n }\n } catch (Throwable $e) {\n Analog::log(\n 'Unable to retrieve field type for field ' . $id . ' | ' .\n $e->getMessage(),\n Analog::ERROR\n );\n }\n }", "label_name": "Base", "label": 1} {"code": " public function confirm()\n {\n $project = $this->getProject();\n\n $this->response->html($this->helper->layout->project('action/remove', array(\n 'action' => $this->actionModel->getById($this->request->getIntegerParam('action_id')),\n 'available_events' => $this->eventManager->getAll(),\n 'available_actions' => $this->actionManager->getAvailableActions(),\n 'project' => $project,\n 'title' => t('Remove an action')\n )));\n }", "label_name": "Base", "label": 1} {"code": " static function description() { return gt(\"Places navigation links/menus on the page.\"); }\r", "label_name": "Base", "label": 1} {"code": " function reset_stats() {\n// global $db;\n\n // reset the counters\n// $db->sql ('UPDATE '.$db->prefix.'banner SET impressions=0 WHERE 1');\n banner::resetImpressions();\n// $db->sql ('UPDATE '.$db->prefix.'banner SET clicks=0 WHERE 1');\n banner::resetClicks();\n \n // let the user know we did stuff. \n flash('message', gt(\"Banner statistics reset.\"));\n expHistory::back();\n }", "label_name": "Class", "label": 2} {"code": "\tstatic function convertUTF($string) {\n\t\treturn $string = str_replace('?', '', htmlspecialchars($string, ENT_IGNORE, 'UTF-8'));\n\t} ", "label_name": "Base", "label": 1} {"code": "function core_load_function($fid)\r\n{\r\n\tglobal $DB;\r\n global $menu_layout;\r\n\r\n // check if fid is an internal function\r\n // or we need to retrieve its information from the database\r\n switch($fid)\r\n {\r\n case 'utils':\r\n $func = new stdClass();\r\n $func->id = 'utils';\r\n $func->codename = 'utils';\r\n $func->category = 'internal';\r\n $func->icon = '';\r\n $func->lid = '';\r\n $func->enabled = 1;\r\n break;\r\n\r\n case 'grid_notes':\r\n $func = new stdClass();\r\n $func->id = 'grid_notes';\r\n $func->codename = 'grid_notes';\r\n $func->category = 'content';\r\n $func->icon = '';\r\n $func->lid = '';\r\n $func->enabled = 1;\r\n break;\r\n\r\n case 'permissions':\r\n $func = new stdClass();\r\n $func->id = 'permissions';\r\n $func->codename = 'permissions';\r\n $func->category = 'config';\r\n $func->icon = '';\r\n $func->lid = '';\r\n $func->enabled = 1;\r\n break;\r\n\r\n default:\r\n if(is_numeric($fid))\r\n $where = 'id = '.intval($fid);\r\n else\r\n $where = 'codename = '.protect($fid);\r\n\r\n $DB->query('SELECT *\r\n FROM nv_functions\r\n WHERE '.$where.'\r\n AND enabled = 1');\r\n\r\n $func = $DB->first();\r\n\r\n if(!$menu_layout->function_is_displayed($func->id))\r\n $func = false;\r\n }\r\n\r\n return $func;\r\n}\r", "label_name": "Base", "label": 1} {"code": " public function attorn(){\n $login_user = $this->checkLogin();\n $this->checkAdmin();\n $username = I(\"username\");\n $item_id = I(\"item_id/d\");\n\n $item = D(\"Item\")->where(\"item_id = '$item_id' \")->find();\n\n\n $member = D(\"User\")->where(\" username = '%s' \",array($username))->find();\n\n if (!$member) {\n $this->sendError(10209);\n return ;\n }\n\n $data['username'] = $member['username'] ;\n $data['uid'] = $member['uid'] ;\n \n\n $id = D(\"Item\")->where(\" item_id = '$item_id' \")->save($data);\n\n $return = D(\"Item\")->where(\"item_id = '$item_id' \")->find();\n\n if (!$return) {\n $this->sendError(10101);\n return ;\n }\n\n $this->sendResult($return);\n }", "label_name": "Compound", "label": 4} {"code": " public function confirm()\n {\n $project = $this->getProject();\n $swimlane = $this->getSwimlane();\n\n $this->response->html($this->helper->layout->project('swimlane/remove', array(\n 'project' => $project,\n 'swimlane' => $swimlane,\n )));\n }", "label_name": "Base", "label": 1} {"code": " public function disable()\n {\n $this->checkCSRFParam();\n $project = $this->getProject();\n $swimlane_id = $this->request->getIntegerParam('swimlane_id');\n\n if ($this->swimlaneModel->disable($project['id'], $swimlane_id)) {\n $this->flash->success(t('Swimlane updated successfully.'));\n } else {\n $this->flash->failure(t('Unable to update this swimlane.'));\n }\n\n $this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id'])));\n }", "label_name": "Base", "label": 1} {"code": "function nvweb_menu_load_dictionary()\r\n{\r\n\tglobal $DB;\t\r\n\tglobal $structure;\r\n\tglobal $current;\r\n\tglobal $website;\r\n\t\t\t\r\n\tif(empty($structure['dictionary']))\r\n\t{\r\n\t\t$structure['dictionary'] = array();\r\n\r\n\t\t$DB->query('SELECT node_id, text\r\n\t\t\t\t\t FROM nv_webdictionary \r\n\t\t\t\t\t WHERE node_type = \"structure\"\r\n\t\t\t\t\t AND subtype = \"title\" \r\n\t\t\t\t\t AND lang = '.protect($current['lang']).'\r\n\t\t\t\t\t AND website = '.$website->id);\t\t\r\n\t\t\t\t\t\r\n\t\t$data = $DB->result();\r\n\t\t\r\n\t\tif(!is_array($data)) $data = array();\r\n\t\t$dictionary = array();\r\n\t\t\r\n\t\tforeach($data as $item)\r\n\t\t{\r\n\t\t\t$structure['dictionary'][$item->node_id] = $item->text;\r\n\t\t}\r\n\t}\r\n}\r", "label_name": "Base", "label": 1} {"code": " public function testPOSTForRestProjectManager()\n {\n $post_resource = json_encode([\n 'label' => 'Test Request 9748',\n 'shortname' => 'test9748',\n 'description' => 'Test of Request 9748 for REST API Project Creation',\n 'is_public' => true,\n 'template_id' => 100,\n ]);\n\n $response = $this->getResponseByName(\n REST_TestDataBuilder::TEST_USER_DELEGATED_REST_PROJECT_MANAGER_NAME,\n $this->request_factory->createRequest(\n 'POST',\n 'projects'\n )->withBody(\n $this->stream_factory->createStream(\n $post_resource\n )\n )\n );\n\n $project = json_decode($response->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR);\n self::assertEquals(201, $response->getStatusCode());\n self::assertArrayHasKey(\"id\", $project);\n }", "label_name": "Class", "label": 2} {"code": " public function validateMulti(array $credentialCandidates)\n {\n $lastException = null;\n\n foreach ($credentialCandidates as $credential) {\n if (false == $credential instanceof CredentialInterface) {\n throw new \\InvalidArgumentException('Expected CredentialInterface');\n }\n if (null == $credential->getPublicKey()) {\n continue;\n }\n\n try {\n $result = $this->validate($credential->getPublicKey());\n\n if ($result === false) {\n return;\n }\n\n return $credential;\n } catch (LightSamlSecurityException $ex) {\n $lastException = $ex;\n }\n }\n\n if ($lastException) {\n throw $lastException;\n } else {\n throw new LightSamlSecurityException('No public key available for signature verification');\n }\n }", "label_name": "Class", "label": 2} {"code": " function categoryBreadcrumb() {\n// global $db, $router;\n\n //eDebug($this->category);\n\n /*if(isset($router->params['action']))\n {\n $ancestors = $this->category->pathToNode(); \n }else if(isset($router->params['section']))\n {\n $current = $db->selectObject('section',' id= '.$router->params['section']);\n $ancestors[] = $current;\n if( $current->parent != -1 || $current->parent != 0 )\n { \n while ($db->selectObject('section',' id= '.$router->params['section']);)\n if ($section->id == $id) {\n $current = $section;\n break;\n }\n }\n }\n eDebug($sections);\n $ancestors = $this->category->pathToNode(); \n }*/\n\n $ancestors = $this->category->pathToNode();\n // eDebug($ancestors);\n assign_to_template(array(\n 'ancestors' => $ancestors\n ));\n }", "label_name": "Base", "label": 1} {"code": "\tpublic function delete() {\n\t global $user;\n\n $count = $this->address->find('count', 'user_id=' . $user->id);\n if($count > 1)\n { \n $address = new address($this->params['id']);\n\t if ($user->isAdmin() || ($user->id == $address->user_id)) {\n if ($address->is_billing)\n {\n $billAddress = $this->address->find('first', 'user_id=' . $user->id . \" AND id != \" . $address->id);\n $billAddress->is_billing = true;\n $billAddress->save();\n }\n if ($address->is_shipping) \n {\n $shipAddress = $this->address->find('first', 'user_id=' . $user->id . \" AND id != \" . $address->id);\n $shipAddress->is_shipping = true;\n $shipAddress->save();\n }\n\t parent::delete();\n\t }\n }\n else\n {\n flash(\"error\", gt(\"You must have at least one address.\"));\n }\n\t expHistory::back();\n\t}", "label_name": "Base", "label": 1} {"code": " $values = [READ => __('Read'),\n CREATE => __('Create'),", "label_name": "Compound", "label": 4} {"code": "\tpublic function save_comment( $comment_id = 0, $approval = '' ) {\r\n\t\tif ( !$comment_id || 'spam' === $approval || empty( $_POST['comment_location'] ) || !is_array( $_POST['comment_location'] ) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tGeoMashupDB::set_object_location( 'comment', $comment_id, $_POST['comment_location'] );\r\n\t}\r", "label_name": "Class", "label": 2} {"code": " protected function getRot13EnvVarProcessorService()\n {\n return $this->services['Symfony\\Component\\DependencyInjection\\Tests\\Dumper\\Rot13EnvVarProcessor'] = new \\Symfony\\Component\\DependencyInjection\\Tests\\Dumper\\Rot13EnvVarProcessor();\n }", "label_name": "Base", "label": 1} {"code": "\t\t $controller = new $ctlname();\n\t\t if (method_exists($controller,'isSearchable') && $controller->isSearchable()) {\n//\t\t\t $mods[$controller->name()] = $controller->addContentToSearch();\n $mods[$controller->searchName()] = $controller->addContentToSearch();\n\t\t }\n\t }\n\t\n\t uksort($mods,'strnatcasecmp');\n\t assign_to_template(array(\n 'mods'=>$mods\n ));\n }", "label_name": "Base", "label": 1} {"code": " public function pinCommentAction(ProjectComment $comment)\n {\n $comment->setPinned(!$comment->isPinned());\n try {\n $this->repository->saveComment($comment);\n } catch (\\Exception $ex) {\n $this->flashUpdateException($ex);\n }\n\n return $this->redirectToRoute('project_details', ['id' => $comment->getProject()->getId()]);\n }", "label_name": "Compound", "label": 4} {"code": "function realCharForNumericEntities($matches)\n{\n\t$newstringnumentity = $matches[1];\n\n\tif (preg_match('/^x/i', $newstringnumentity)) {\n\t\t$newstringnumentity = hexdec(preg_replace('/^x/i', '', $newstringnumentity));\n\t}\n\n\t// The numeric value we don't want as entities\n\tif (($newstringnumentity >= 65 && $newstringnumentity <= 90) || ($newstringnumentity >= 97 && $newstringnumentity <= 122)) {\n\t\treturn chr((int) $newstringnumentity);\n\t}\n\n\treturn '&#'.$matches[1];\n}", "label_name": "Base", "label": 1} {"code": " public function confirm()\n {\n $task = $this->getTask();\n $link_id = $this->request->getIntegerParam('link_id');\n $link = $this->taskExternalLinkModel->getById($link_id);\n\n if (empty($link)) {\n throw new PageNotFoundException();\n }\n\n $this->response->html($this->template->render('task_external_link/remove', array(\n 'link' => $link,\n 'task' => $task,\n )));\n }", "label_name": "Base", "label": 1} {"code": " protected function _validateSecretKey()\n {\n if (is_array($this->_publicActions) && in_array($this->getRequest()->getActionName(), $this->_publicActions)) {\n return true;\n }\n\n if (!($secretKey = $this->getRequest()->getParam(Mage_Adminhtml_Model_Url::SECRET_KEY_PARAM_NAME, null))\n || $secretKey != Mage::getSingleton('adminhtml/url')->getSecretKey()) {\n return false;\n }\n return true;\n }", "label_name": "Compound", "label": 4} {"code": " function edit_section() {\r\n global $db, $user;\r\n\r\n $parent = new section($this->params['parent']);\r\n if (empty($parent->id)) $parent->id = 0;\r\n assign_to_template(array(\r\n 'haveStandalone' => ($db->countObjects('section', 'parent=-1') && $parent->id >= 0),\r\n 'parent' => $parent,\r\n 'isAdministrator' => $user->isAdmin(),\r\n ));\r\n }\r", "label_name": "Base", "label": 1} {"code": "function phoromatic_system_id_to_name($system_id, $aid = false)\n{\n\treturn phoromatic_server::system_id_to_name($system_id, $aid);\n}", "label_name": "Base", "label": 1} {"code": " public static function ridOld($tokens) {\r\n $time = time();\r\n foreach ($tokens as $token => $value) {\r\n if ($time - $value['time'] > 3600) {\r\n unset($tokens[$token]);\r\n }\r\n }\r\n return $tokens;\r\n }\r", "label_name": "Base", "label": 1} {"code": " public function delete() {\n global $db, $history;\n \n /* The global constants can be overriden by passing appropriate params */ \n //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet\n $require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : $this->params['require_login'];\n $require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : $this->params['require_approval'];\n $require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : $this->params['require_notification'];\n $notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : $this->params['notification_email'];\n \n if (empty($this->params['id'])) {\n flash('error', gt('Missing id for the comment you would like to delete'));\n $lastUrl = expHistory::getLast('editable');\n }\n \n // delete the note\n $simplenote = new expSimpleNote($this->params['id']);\n $rows = $simplenote->delete();\n \n // delete the assocication too\n $db->delete($simplenote->attachable_table, 'expsimplenote_id='.$this->params['id']); \n \n // send the user back where they came from.\n $lastUrl = expHistory::getLast('editable');\n if (!empty($this->params['tab']))\n {\n $lastUrl .= \"#\".$this->params['tab'];\n }\n redirect_to($lastUrl);\n }", "label_name": "Class", "label": 2} {"code": " $contents[] = ['class' => 'text-center', 'text' => tep_draw_bootstrap_button(IMAGE_DELETE, 'fas fa-trash', null, 'primary', null, 'btn-danger xxx text-white mr-2') . tep_draw_bootstrap_button(IMAGE_CANCEL, 'fas fa-times', tep_href_link('reviews.php', 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id), null, null, 'btn-light')];", "label_name": "Base", "label": 1} {"code": "function db_properties($table)\n{\n global $DatabaseType, $DatabaseUsername;\n\n switch ($DatabaseType) {\n case 'mysqli':\n $result = DBQuery(\"SHOW COLUMNS FROM $table\");\n while ($row = db_fetch_row($result)) {\n $properties[strtoupper($row['FIELD'])]['TYPE'] = strtoupper($row['TYPE'], strpos($row['TYPE'], '('));\n if (!$pos = strpos($row['TYPE'], ','))\n $pos = strpos($row['TYPE'], ')');\n else\n $properties[strtoupper($row['FIELD'])]['SCALE'] = substr($row['TYPE'], $pos + 1);\n\n $properties[strtoupper($row['FIELD'])]['SIZE'] = substr($row['TYPE'], strpos($row['TYPE'], '(') + 1, $pos);\n\n if ($row['NULL'] != '')\n $properties[strtoupper($row['FIELD'])]['NULL'] = \"Y\";\n else\n $properties[strtoupper($row['FIELD'])]['NULL'] = \"N\";\n }\n break;\n }\n return $properties;\n}", "label_name": "Base", "label": 1} {"code": " public function getMissingAmount()\n {\n if (empty($this->_id)) {\n return (double)$this->amount;\n }\n\n try {\n $select = $this->zdb->select(Contribution::TABLE);\n $select->columns(\n array(\n 'sum' => new Expression('SUM(montant_cotis)')\n )\n )->where(self::PK . ' = ' . $this->_id);\n\n $results = $this->zdb->execute($select);\n $result = $results->current();\n $dispatched_amount = $result->sum;\n return (double)$this->_amount - (double)$dispatched_amount;\n } catch (Throwable $e) {\n Analog::log(\n 'An error occurred retrieving missing amounts | ' .\n $e->getMessage(),\n Analog::ERROR\n );\n throw $e;\n }\n }", "label_name": "Base", "label": 1} {"code": " public function confirm()\n {\n $project = $this->getProject();\n\n $this->response->html($this->helper->layout->project('action/remove', array(\n 'action' => $this->actionModel->getById($this->request->getIntegerParam('action_id')),\n 'available_events' => $this->eventManager->getAll(),\n 'available_actions' => $this->actionManager->getAvailableActions(),\n 'project' => $project,\n 'title' => t('Remove an action')\n )));\n }", "label_name": "Base", "label": 1} {"code": "\tpublic function update() {\n global $user;\n\n if (expSession::get('customer-signup')) expSession::set('customer-signup', false);\n if (isset($this->params['address_country_id'])) {\n $this->params['country'] = $this->params['address_country_id'];\n unset($this->params['address_country_id']);\n }\n if (isset($this->params['address_region_id'])) {\n $this->params['state'] = $this->params['address_region_id'];\n unset($this->params['address_region_id']);\n }\n\t\tif ($user->isLoggedIn()) {\n\t\t\t// check to see how many other addresses this user has already.\n\t\t\t$count = $this->address->find('count', 'user_id='.$user->id);\n\t\t\t// if this is first address save for this user we'll make this the default\n\t\t\tif ($count == 0) \n {\n $this->params['is_default'] = 1;\n $this->params['is_billing'] = 1;\n $this->params['is_shipping'] = 1;\n }\n\t\t\t// associate this address with the current user.\n\t\t\t$this->params['user_id'] = $user->id;\n\t\t\t// save the object\n\t\t\t$this->address->update($this->params);\n\t\t}\n else { //if (ecomconfig::getConfig('allow_anonymous_checkout')){\n //user is not logged in, but allow anonymous checkout is enabled so we'll check \n //a few things that we don't check in the parent 'stuff and create a user account.\n $this->params['is_default'] = 1;\n $this->params['is_billing'] = 1;\n $this->params['is_shipping'] = 1; \n $this->address->update($this->params);\n }\n\t\texpHistory::back(); \n\t}", "label_name": "Base", "label": 1} {"code": " public function confirm()\n {\n $project = $this->getProject();\n\n $this->response->html($this->helper->layout->project('column/remove', array(\n 'column' => $this->columnModel->getById($this->request->getIntegerParam('column_id')),\n 'project' => $project,\n )));\n }", "label_name": "Class", "label": 2} {"code": " public function update() {\n\n //populate the alt tag field if the user didn't\n if (empty($this->params['alt'])) $this->params['alt'] = $this->params['title'];\n \n // call expController update to save the image\n parent::update();\n }", "label_name": "Base", "label": 1} {"code": "\tprivate function _addeditdate( $option ) {\n\t\t$this->addTable( 'revision_actor_temp', 'rev' );\n\t\t$this->addSelect( [ 'rev.revactor_timestamp' ] );\n\t\t$this->addWhere(\n\t\t\t[\n\t\t\t\t$this->tableNames['page'] . '.page_id = rev.revactor_page',\n\t\t\t]\n\t\t);\n\t}", "label_name": "Class", "label": 2} {"code": "\tprotected function LoadData()\n\t{\n\t\t$this->dataLoaded = true;\n\n\t\t$args = array();\n\t\t$args[] = $this->hash;\n\t\t$args[] = '--no-merges';\n\n\t\t$canSkip = true;\n\t\tif ($this->skip > 0)\n\t\t\t$canSkip = $this->exe->CanSkip();\n\n\t\tif ($canSkip) {\n\t\t\tif ($this->limit > 0) {\n\t\t\t\t$args[] = '--max-count=' . $this->limit;\n\t\t\t}\n\t\t\tif ($this->skip > 0) {\n\t\t\t\t$args[] = '--skip=' . $this->skip;\n\t\t\t}\n\t\t} else {\n\t\t\tif ($this->limit > 0) {\n\t\t\t\t$args[] = '--max-count=' . ($this->limit + $this->skip);\n\t\t\t}\n\t\t}", "label_name": "Base", "label": 1} {"code": "function _download_header($filename, $filesize = 0)\n{\n\t$browser=id_browser();\n\theader('Content-Type: '.(($browser=='IE' || $browser=='OPERA')?\n\t\t'application/octetstream':'application/octet-stream'));", "label_name": "Base", "label": 1} {"code": " public function configure() {\n $this->config['defaultbanner'] = array();\n if (!empty($this->config['defaultbanner_id'])) {\n $this->config['defaultbanner'][] = new expFile($this->config['defaultbanner_id']);\n } \n\t parent::configure();\n\t $banners = $this->banner->find('all', null, 'companies_id');\n\t assign_to_template(array(\n 'banners'=>$banners,\n 'title'=>static::displayname()\n ));\n\t}", "label_name": "Base", "label": 1} {"code": "\t\tforeach($return as $index => $value) {\n\t\t\tif(! is_string($value))\n\t\t\t\t$return[$index] = $defaultvalue;\n\t\t\telseif($addslashes)\n\t\t\t\t$return[$index] = addslashes($value);\n\t\t}", "label_name": "Class", "label": 2} {"code": " static function description() { return gt(\"Places navigation links/menus on the page.\"); }\r", "label_name": "Class", "label": 2} {"code": " public function update_discount() {\n $id = empty($this->params['id']) ? null : $this->params['id'];\n $discount = new discounts($id);\n // find required shipping method if needed\n if ($this->params['required_shipping_calculator_id'] > 0) {\n $this->params['required_shipping_method'] = $this->params['required_shipping_methods'][$this->params['required_shipping_calculator_id']];\n } else {\n $this->params['required_shipping_calculator_id'] = 0;\n }\n \n $discount->update($this->params);\n expHistory::back();\n }", "label_name": "Base", "label": 1} {"code": " public static function start() {\r\n session_name('GeniXCMS');\r\n session_start();\r\n //unset($_SESSION);\r\n if (!isset($_SESSION['gxsess']) || $_SESSION['gxsess'] == \"\" ) {\r\n $_SESSION['gxsess'] = array (\r\n 'key' => self::sesKey(),\r\n 'time' => date(\"Y-m-d H:i:s\"),\r\n 'val' => array()\r\n );\r\n }\r\n\r\n $GLOBALS['start_time'] = microtime(TRUE);\r\n\r\n }\r", "label_name": "Base", "label": 1} {"code": " public static function updatePassword(Db $zdb, $id_adh, $pass)\n {\n try {\n $cpass = password_hash($pass, PASSWORD_BCRYPT);\n\n $update = $zdb->update(self::TABLE);\n $update->set(\n array('mdp_adh' => $cpass)\n )->where(self::PK . ' = ' . $id_adh);\n $zdb->execute($update);\n Analog::log(\n 'Password for `' . $id_adh . '` has been updated.',\n Analog::DEBUG\n );\n return true;\n } catch (Throwable $e) {\n Analog::log(\n 'An error occurred while updating password for `' . $id_adh .\n '` | ' . $e->getMessage(),\n Analog::ERROR\n );\n throw $e;\n }\n }", "label_name": "Base", "label": 1} {"code": " private function getSwimlane()\n {\n $swimlane = $this->swimlaneModel->getById($this->request->getIntegerParam('swimlane_id'));\n\n if (empty($swimlane)) {\n throw new PageNotFoundException();\n }\n\n return $swimlane;\n }", "label_name": "Base", "label": 1} {"code": " public static function canView($section) {\r\n global $db;\r\n\r\n if ($section == null) {\r\n return false;\r\n }\r\n if ($section->public == 0) {\r\n // Not a public section. Check permissions.\r\n return expPermissions::check('view', expCore::makeLocation('navigation', '', $section->id));\r\n } else { // Is public. check parents.\r\n if ($section->parent <= 0) {\r\n // Out of parents, and since we are still checking, we haven't hit a private section.\r\n return true;\r\n } else {\r\n $s = $db->selectObject('section', 'id=' . $section->parent);\r\n return self::canView($s);\r\n }\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": "\tstatic function convertUTF($string) {\n\t\treturn $string = str_replace('?', '', htmlspecialchars($string, ENT_IGNORE, 'UTF-8'));\n\t} ", "label_name": "Base", "label": 1} {"code": " public function whereFileName($fileName)\n {\n $this->selectSingle = $this->model->getFileNameParts($fileName);\n\n return $this;\n }", "label_name": "Base", "label": 1} {"code": " public function show()\n {\n $task = $this->getTask();\n $subtask = $this->getSubtask();\n\n $this->response->html($this->template->render('subtask_restriction/show', array(\n 'status_list' => array(\n SubtaskModel::STATUS_TODO => t('Todo'),\n SubtaskModel::STATUS_DONE => t('Done'),\n ),\n 'subtask_inprogress' => $this->subtaskStatusModel->getSubtaskInProgress($this->userSession->getId()),\n 'subtask' => $subtask,\n 'task' => $task,\n )));\n }", "label_name": "Base", "label": 1} {"code": " public function IsSMTP() {\n $this->Mailer = 'smtp';\n }", "label_name": "Class", "label": 2} {"code": "\t\tpublic function transferPage()\n\t\t{\n\t\t\t//FIXME Put Import code in here. \n\t\t}", "label_name": "Base", "label": 1} {"code": " public static function getTemplateHierarchyFlat($parent, $depth = 1) {\r\n global $db;\r\n\r\n $arr = array();\r\n $kids = $db->selectObjects('section_template', 'parent=' . $parent, 'rank');\r\n//\t\t$kids = expSorter::sort(array('array'=>$kids,'sortby'=>'rank', 'order'=>'ASC'));\r\n for ($i = 0, $iMax = count($kids); $i < $iMax; $i++) {\r\n $page = $kids[$i];\r\n $page->depth = $depth;\r\n $page->first = ($i == 0 ? 1 : 0);\r\n $page->last = ($i == count($kids) - 1 ? 1 : 0);\r\n $arr[] = $page;\r\n $arr = array_merge($arr, self::getTemplateHierarchyFlat($page->id, $depth + 1));\r\n }\r\n return $arr;\r\n }\r", "label_name": "Base", "label": 1} {"code": " function update() {\r\n parent::update();\r\n expSession::clearAllUsersSessionCache('navigation');\r\n }\r", "label_name": "Base", "label": 1} {"code": "\tfunction update_vendor() {\n\t\t$vendor = new vendor();\n\t\t\n\t\t$vendor->update($this->params['vendor']);\n expHistory::back();\n }", "label_name": "Class", "label": 2} {"code": "\t\t\t$fontfile = self::_getfontpath().$file;\n\t\t} elseif (@file_exists($file)) {\n\t\t\t$fontfile = $file;\n\t\t}\n\t\treturn $fontfile;\n\t}", "label_name": "Base", "label": 1} {"code": " public static function isActive($mod){\r\n $json = Options::v('modules');\r\n $mods = json_decode($json, true);\r\n //print_r($mods);\r\n if (!is_array($mods) || $mods == \"\") {\r\n $mods = array();\r\n }\r\n\r\n if(in_array($mod, $mods)){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": "\t\t\t$rest = $count - ( floor( $nsize ) * floor( $iGroup ) );\n\t\t\tif ( $rest > 0 ) {\n\t\t\t\t$nsize += 1;\n\t\t\t}\n\t\t\t$output .= \"{|\" . $rowColFormat . \"\\n|\\n\";\n\t\t\tfor ( $g = 0; $g < $iGroup; $g++ ) {\n\t\t\t\t$output .= $lister->formatList( $articles, $nstart, $nsize );\n\t\t\t\tif ( $columns != 1 ) {\n\t\t\t\t\t$output .= \"\\n|valign=top|\\n\";\n\t\t\t\t} else {\n\t\t\t\t\t$output .= \"\\n|-\\n|\\n\";\n\t\t\t\t}\n\t\t\t\t$nstart = $nstart + $nsize;\n\t\t\t\t// if ($rest != 0 && $g+1==$rest) $nsize -= 1;\n\t\t\t\tif ( $nstart + $nsize > $count ) {\n\t\t\t\t\t$nsize = $count - $nstart;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$output .= \"\\n|}\\n\";\n\t\t} elseif ( $rowSize > 0 ) {", "label_name": "Class", "label": 2} {"code": " public function confirm()\n {\n $project = $this->getProject();\n $swimlane = $this->getSwimlane();\n\n $this->response->html($this->helper->layout->project('swimlane/remove', array(\n 'project' => $project,\n 'swimlane' => $swimlane,\n )));\n }", "label_name": "Base", "label": 1} {"code": " $q = self::$mysqli->query($vars) ;\n if($q === false) {\n user_error(\"Query failed: \".self::$mysqli->error.\"
    \\n$vars\"); \n return false; \n }\n }\n \n return $q;\n }", "label_name": "Base", "label": 1} {"code": " $rndString = function ($len = 10) {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $randomString = '';\n for ($i = 0; $i < $len; $i++) {\n $randomString .= $characters[rand(0, strlen($characters) - 1)];\n }\n\n return $randomString;\n };", "label_name": "Class", "label": 2} {"code": " protected function registerBackendPermissions()\n {\n BackendAuth::registerCallback(function ($manager) {\n $manager->registerPermissions('October.System', [\n 'system.manage_updates' => [\n 'label' => 'system::lang.permissions.manage_software_updates',\n 'tab' => 'system::lang.permissions.name'\n ],\n 'system.access_logs' => [\n 'label' => 'system::lang.permissions.access_logs',\n 'tab' => 'system::lang.permissions.name'\n ],\n 'system.manage_mail_settings' => [\n 'label' => 'system::lang.permissions.manage_mail_settings',\n 'tab' => 'system::lang.permissions.name'\n ],\n 'system.manage_mail_templates' => [\n 'label' => 'system::lang.permissions.manage_mail_templates',\n 'tab' => 'system::lang.permissions.name'\n ]\n ]);\n });\n }", "label_name": "Class", "label": 2} {"code": " public function manage_sitemap() {\r\n global $db, $user, $sectionObj, $sections;\r\n\r\n expHistory::set('viewable', $this->params);\r\n $id = $sectionObj->id;\r\n $current = null;\r\n // all we need to do is determine the current section\r\n $navsections = $sections;\r\n if ($sectionObj->parent == -1) {\r\n $current = $sectionObj;\r\n } else {\r\n foreach ($navsections as $section) {\r\n if ($section->id == $id) {\r\n $current = $section;\r\n break;\r\n }\r\n }\r\n }\r\n assign_to_template(array(\r\n 'sasections' => $db->selectObjects('section', 'parent=-1'),\r\n 'sections' => $navsections,\r\n 'current' => $current,\r\n 'canManage' => ((isset($user->is_acting_admin) && $user->is_acting_admin == 1) ? 1 : 0),\r\n ));\r\n }\r", "label_name": "Base", "label": 1} {"code": " function manage() {\n expHistory::set('viewable', $this->params);\n // $category = new storeCategory();\n // $categories = $category->getFullTree();\n // \n // // foreach($categories as $i=>$val){\n // // if (!empty($this->values) && in_array($val->id,$this->values)) {\n // // $this->tags[$i]->value = true;\n // // } else {\n // // $this->tags[$i]->value = false;\n // // }\n // // $this->tags[$i]->draggable = $this->draggable; \n // // $this->tags[$i]->checkable = $this->checkable; \n // // }\n //\n // $obj = json_encode($categories); \n }", "label_name": "Base", "label": 1} {"code": " } elseif (!empty($this->params['src'])) {\r\n if ($this->params['src'] == $loc->src) {\r\n $this->config = $config->config;\r\n break;\r\n }\r\n }\r\n }\r", "label_name": "Class", "label": 2} {"code": "function prepareExchangedData($data, $type)\n{\n global $SETTINGS;\n\n //load ClassLoader\n require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';\n //Load AES\n $aes = new SplClassLoader('Encryption\\Crypt', '../includes/libraries');\n $aes->register();\n\n if ($type == \"encode\") {\n if (isset($SETTINGS['encryptClientServer'])\n && $SETTINGS['encryptClientServer'] === \"0\"\n ) {\n return json_encode(\n $data,\n JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP\n );\n } else {\n return Encryption\\Crypt\\aesctr::encrypt(\n json_encode(\n $data,\n JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP\n ),\n $_SESSION['key'],\n 256\n );\n }\n } elseif ($type == \"decode\") {\n if (isset($SETTINGS['encryptClientServer'])\n && $SETTINGS['encryptClientServer'] === \"0\"\n ) {\n return json_decode(\n $data,\n true\n );\n } else {\n return json_decode(\n Encryption\\Crypt\\aesctr::decrypt(\n $data,\n $_SESSION['key'],\n 256\n ),\n true\n );\n }\n }\n}", "label_name": "Base", "label": 1} {"code": " foreach ($nodes as $node) {\r\n if ((($perm == 'view' && $node->public == 1) || expPermissions::check($perm, expCore::makeLocation('navigation', '', $node->id))) && !in_array($node->id, $ignore_ids)) {\r\n if ($node->active == 1) {\r\n $text = str_pad('', ($depth + ($full ? 1 : 0)) * 3, '.', STR_PAD_LEFT) . $node->name;\r\n } else {\r\n $text = str_pad('', ($depth + ($full ? 1 : 0)) * 3, '.', STR_PAD_LEFT) . '(' . $node->name . ')';\r\n }\r\n $ar[$node->id] = $text;\r\n foreach (self::levelDropdownControlArray($node->id, $depth + 1, $ignore_ids, $full, $perm, $addstandalones, $addinternalalias) as $id => $text) {\r\n $ar[$id] = $text;\r\n }\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": " public function setPassword($newPassword, $doHashing = true)\n {\n global $gSettingsManager, $gPasswordHashAlgorithm, $gChangeNotification;\n\n if (!$doHashing) {\n if (is_object($gChangeNotification)) {\n $gChangeNotification->logUserChange(\n (int) $this->getValue('usr_id'),\n 'usr_password',\n $this->getValue('usr_password'),\n $newPassword,\n $this\n );\n }\n return parent::setValue('usr_password', $newPassword, false);\n }\n\n // get the saved cost value that fits your server performance best and rehash your password\n $options = array('cost' => 10);\n if (isset($gSettingsManager) && $gSettingsManager->has('system_hashing_cost')) {\n $options['cost'] = $gSettingsManager->getInt('system_hashing_cost');\n }\n\n $newPasswordHash = PasswordUtils::hash($newPassword, $gPasswordHashAlgorithm, $options);\n\n if ($newPasswordHash === false) {\n return false;\n }\n\n if (is_object($gChangeNotification)) {\n $gChangeNotification->logUserChange(\n (int) $this->getValue('usr_id'),\n 'usr_password',\n $this->getValue('usr_password'),\n $newPasswordHash,\n $this\n );\n }\n return parent::setValue('usr_password', $newPasswordHash, false);\n }", "label_name": "Base", "label": 1} {"code": " $src = substr($ref->source, strlen($prefix)) . $section->id;\r\n if (call_user_func(array($ref->module, 'hasContent'))) {\r\n $oloc = expCore::makeLocation($ref->module, $ref->source);\r\n $nloc = expCore::makeLocation($ref->module, $src);\r\n if ($ref->module != \"container\") {\r\n call_user_func(array($ref->module, 'copyContent'), $oloc, $nloc);\r\n } else {\r\n call_user_func(array($ref->module, 'copyContent'), $oloc, $nloc, $section->id);\r\n }\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": " public function confirm()\n {\n $project = $this->getProject();\n $filter = $this->customFilterModel->getById($this->request->getIntegerParam('filter_id'));\n\n $this->response->html($this->helper->layout->project('custom_filter/remove', array(\n 'project' => $project,\n 'filter' => $filter,\n 'title' => t('Remove a custom filter')\n )));\n }", "label_name": "Base", "label": 1} {"code": "\tpublic function __construct()\n\t{\n\t\t$this->headers = \\App\\Controller\\Headers::getInstance();\n\t\tif (!self::$activatedLocale && \\App\\Config::performance('CHANGE_LOCALE')) {\n\t\t\t\\App\\Language::initLocale();\n\t\t\tself::$activatedLocale = true;\n\t\t}\n\t\tif (!self::$activatedCsrf) {\n\t\t\tif ($this->csrfActive && \\App\\Config::security('csrfActive')) {\n\t\t\t\trequire_once 'config/csrf_config.php';\n\t\t\t\t\\CsrfMagic\\Csrf::init();\n\t\t\t\t$this->csrfActive = true;\n\t\t\t} else {\n\t\t\t\t$this->csrfActive = false;\n\t\t\t}\n\t\t\tself::$activatedCsrf = true;\n\t\t}\n\t}", "label_name": "Compound", "label": 4} {"code": "\t\t\t\t\t$args['name'][$i] = $this->normalize($name, $opts);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$args['name'] = $this->normalize($args['name'], $opts);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "label_name": "Base", "label": 1} {"code": " public static function getTemplateHierarchyFlat($parent, $depth = 1) {\r\n global $db;\r\n\r\n $arr = array();\r\n $kids = $db->selectObjects('section_template', 'parent=' . $parent, 'rank');\r\n//\t\t$kids = expSorter::sort(array('array'=>$kids,'sortby'=>'rank', 'order'=>'ASC'));\r\n for ($i = 0, $iMax = count($kids); $i < $iMax; $i++) {\r\n $page = $kids[$i];\r\n $page->depth = $depth;\r\n $page->first = ($i == 0 ? 1 : 0);\r\n $page->last = ($i == count($kids) - 1 ? 1 : 0);\r\n $arr[] = $page;\r\n $arr = array_merge($arr, self::getTemplateHierarchyFlat($page->id, $depth + 1));\r\n }\r\n return $arr;\r\n }\r", "label_name": "Base", "label": 1} {"code": " public function remove()\n {\n $this->checkCSRFParam();\n $project = $this->getProject();\n $category = $this->getCategory();\n\n if ($this->categoryModel->remove($category['id'])) {\n $this->flash->success(t('Category removed successfully.'));\n } else {\n $this->flash->failure(t('Unable to remove this category.'));\n }\n\n $this->response->redirect($this->helper->url->to('CategoryController', 'index', array('project_id' => $project['id'])));\n }", "label_name": "Base", "label": 1} {"code": " public function delete(){\n $login_user = $this->checkLogin();\n $uid = $login_user['uid'] ;\n\n $id = I(\"id/d\")? I(\"id/d\") : 0;\n $teamItemInfo = D(\"TeamItem\")->where(\" id = '$id' \")->find();\n $item_id = $teamItemInfo['item_id'] ;\n $team_id = $teamItemInfo['team_id'] ;\n\n if(!$this->checkItemManage($uid , $item_id)){\n $this->sendError(10303);\n return ;\n }\n\n $ret = D(\"TeamItemMember\")->where(\" item_id = '$item_id' and team_id = '$team_id' \")->delete();\n $ret = D(\"TeamItem\")->where(\" id = '$id' \")->delete();\n\n if ($ret) {\n $this->sendResult($ret);\n }else{\n $return['error_code'] = 10103 ;\n $return['error_message'] = 'request fail' ;\n $this->sendResult($return);\n }\n }", "label_name": "Compound", "label": 4} {"code": " $evs = $this->event->find('all', \"id=\" . $edate->event_id . $featuresql);\r\n foreach ($evs as $key=>$event) {\r\n if ($condense) {\r\n $eventid = $event->id;\r\n $multiday_event = array_filter($events, create_function('$event', 'global $eventid; return $event->id === $eventid;'));\r\n if (!empty($multiday_event)) {\r\n unset($evs[$key]);\r\n continue;\r\n }\r\n }\r\n $evs[$key]->eventstart += $edate->date;\r\n $evs[$key]->eventend += $edate->date;\r\n $evs[$key]->date_id = $edate->id;\r\n if (!empty($event->expCat)) {\r\n $catcolor = empty($event->expCat[0]->color) ? null : trim($event->expCat[0]->color);\r\n// if (substr($catcolor,0,1)=='#') $catcolor = '\" style=\"color:'.$catcolor.';';\r\n $evs[$key]->color = $catcolor;\r\n }\r\n }\r\n if (count($events) < 500) { // magic number to not crash loop?\r\n $events = array_merge($events, $evs);\r\n } else {\r\n// $evs[$key]->title = gt('Too many events to list').', '.(count($edates)-count($events)).' '.gt('not displayed!');\r\n// $events = array_merge($events, $evs);\r\n flash('notice',gt('Too many events to list').', '.(count($edates)-count($events)).' '.gt('not displayed!'));\r\n break; // keep from breaking system by too much data\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": " public function store()\n {\n $title = $this->title;\n if ($title === null || trim($title) === '') {\n $title = new Expression('NULL');\n }\n\n $subtitle = $this->subtitle;\n if ($subtitle === null || trim($subtitle) === '') {\n $subtitle = new Expression('NULL');\n }\n\n $data = array(\n 'model_header' => $this->header,\n 'model_footer' => $this->footer,\n 'model_type' => $this->type,\n 'model_title' => $title,\n 'model_subtitle' => $subtitle,\n 'model_body' => $this->body,\n 'model_styles' => $this->styles\n );\n\n try {\n if ($this->id !== null) {\n $update = $this->zdb->update(self::TABLE);\n $update->set($data)->where(\n self::PK . '=' . $this->id\n );\n $this->zdb->execute($update);\n } else {\n $data['model_name'] = $this->name;\n $insert = $this->zdb->insert(self::TABLE);\n $insert->values($data);\n $add = $this->zdb->execute($insert);\n if (!($add->count() > 0)) {\n Analog::log('Not stored!', Analog::ERROR);\n return false;\n }\n }\n return true;\n } catch (Throwable $e) {\n Analog::log(\n 'An error occurred storing model: ' . $e->getMessage() .\n \"\\n\" . print_r($data, true),\n Analog::ERROR\n );\n throw $e;\n }\n }", "label_name": "Base", "label": 1} {"code": " foreach( $zones as $id => $zone )\r\n {\r\n //print_r($zone);\r\n /**\r\n * Only get timezones explicitely not part of \"Others\".\r\n * @see http://www.php.net/manual/en/timezones.others.php\r\n */\r\n if ( preg_match( '/^(America|Antartica|Arctic|Asia|Atlantic|Europe|Indian|Pacific)\\//', $zone['timezone_id'] )\r\n && $zone['timezone_id']) {\r\n $cities[$zone['timezone_id']][] = $key;\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": " public static function create() {\r\n $length = \"80\";\r\n $token = \"\";\r\n $codeAlphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\r\n $codeAlphabet.= \"abcdefghijklmnopqrstuvwxyz\";\r\n $codeAlphabet.= \"0123456789\";\r\n // $codeAlphabet.= \"!@#$%^&*()[]\\/{}|:\\<>\";\r\n //$codeAlphabet.= SECURITY_KEY;\r\n for($i=0;$i<$length;$i++){\r\n $token .= $codeAlphabet[Typo::crypto_rand_secure(0,strlen($codeAlphabet))];\r\n }\r\n $url = $_SERVER['REQUEST_URI'];\r\n $url = htmlspecialchars($url, ENT_QUOTES, 'UTF-8');\r\n $ip = $_SERVER['REMOTE_ADDR'];\r\n $time = time();\r\n define('TOKEN', $token);\r\n define('TOKEN_URL', $url);\r\n define('TOKEN_IP', $ip);\r\n define('TOKEN_TIME', $time);\r\n $json = self::json();\r\n Options::update('tokens',$json);\r\n return $token;\r\n }\r", "label_name": "Base", "label": 1} {"code": " $db->updateObject($value, 'section');\r\n }\r\n $db->updateObject($moveSec, 'section');\r\n //handle re-ranking of previous parent\r\n $oldSiblings = $db->selectObjects(\"section\", \"parent=\" . $oldParent . \" AND rank>\" . $oldRank . \" ORDER BY rank\");\r\n $rerank = 1;\r\n foreach ($oldSiblings as $value) {\r\n if ($value->id != $moveSec->id) {\r\n $value->rank = $rerank;\r\n $db->updateObject($value, 'section');\r\n $rerank++;\r\n }\r\n }\r\n if ($oldParent != $moveSec->parent) {\r\n //we need to re-rank the children of the parent that the moving section has just left\r\n $childOfLastMove = $db->selectObjects(\"section\", \"parent=\" . $oldParent . \" ORDER BY rank\");\r\n for ($i = 0, $iMax = count($childOfLastMove); $i < $iMax; $i++) {\r\n $childOfLastMove[$i]->rank = $i;\r\n $db->updateObject($childOfLastMove[$i], 'section');\r\n }\r\n }\r\n }\r\n }\r\n self::checkForSectionalAdmins($move);\r\n expSession::clearAllUsersSessionCache('navigation');\r\n }\r", "label_name": "Base", "label": 1} {"code": "\tprivate static function init() {\n\t\t\\DPL\\Config::init();\n\n\t\tif ( !isset( self::$createdLinks ) ) {\n\t\t\tself::$createdLinks = [\n\t\t\t\t'resetLinks' => false,\n\t\t\t\t'resetTemplates' => false,\n\t\t\t\t'resetCategories' => false,\n\t\t\t\t'resetImages' => false,\n\t\t\t\t'resetdone' => false,\n\t\t\t\t'elimdone' => false\n\t\t\t];\n\t\t}\n\t}", "label_name": "Class", "label": 2} {"code": " protected function moveVotes()\n {\n $sql = \"SELECT * FROM package_proposal_votes WHERE pkg_prop_id = {$this->proposal}\";\n $res = $this->mdb2->query($sql);\n if (MDB2::isError($res)) {\n throw new RuntimeException(\"DB error occurred: {$res->getDebugInfo()}\");\n }\n if ($res->numRows() == 0) {\n return; // nothing to do\n }\n\n $insert = \"INSERT INTO package_proposal_comments (\";\n $insert .= \"user_handle, pkg_prop_id, timestamp, comment\";\n $insert .= \") VALUES(%s, {$this->proposal}, %d, %s)\";\n\n $delete = \"DELETE FROM package_proposal_votes WHERE\";\n $delete .= \" pkg_prop_id = {$this->proposal}\";\n $delete .= \" AND user_handle = %s\";\n\n while ($row = $res->fetchRow(MDB2_FETCHMODE_OBJECT)) {\n\n $comment = \"Original vote: {$row->value}\\n\";\n $comment .= \"Conditional vote: \" . ($row->is_conditional != 0)?'yes':'no' . \"\\n\";\n $comment .= \"Comment on vote: \" . $row->comment . \"\\n\\n\";\n $comment .= \"Reviewed: \" . implode(\", \", unserialize($row->reviews));\n\n $sql = sprintf(\n $insert,\n $this->mdb2->quote($row->user_handle),\n $row->timestamp,\n $this->mdb2->quote($comment)\n );\n $this->queryChange($sql);\n\n $sql = sprintf(\n $delete,\n $this->mdb2->quote($row->user_handle)\n );\n $this->queryChange($sql);\n }", "label_name": "Base", "label": 1} {"code": " $query->whereExists(function ($permissionQuery) use (&$tableDetails, $morphClass) {\n /** @var Builder $permissionQuery */\n $permissionQuery->select('id')->from('joint_permissions')\n ->whereColumn('joint_permissions.entity_id', '=', $tableDetails['tableName'] . '.' . $tableDetails['entityIdColumn'])\n ->where('entity_type', '=', $morphClass)\n ->where('action', '=', 'view')\n ->whereIn('role_id', $this->getCurrentUserRoles())\n ->where(function (QueryBuilder $query) {\n $this->addJointHasPermissionCheck($query, $this->currentUser()->id);\n });\n });", "label_name": "Class", "label": 2} {"code": "\tprivate function getTempDir($volumeTempPath = null) {\n\t\t$testDirs = array();\n\t\tif ($this->uploadTempPath) {\n\t\t\t$testDirs[] = rtrim(realpath($this->uploadTempPath), DIRECTORY_SEPARATOR);\n\t\t}\n\t\tif ($volumeTempPath) {\n\t\t\t$testDirs[] = rtrim(realpath($volumeTempPath), DIRECTORY_SEPARATOR);\n\t\t}\n\t\tif (function_exists('sys_get_temp_dir')) {\n\t\t\t$testDirs[] = sys_get_temp_dir();\n\t\t}\n\t\t$tempDir = '';\n\t\tforeach($testDirs as $testDir) {\n\t\t\tif (!$testDir || !is_dir($testDir)) continue;\n\t\t\tif (is_writable($testDir)) {\n\t\t\t\t$tempDir = $testDir;\n\t\t\t\t$gc = time() - 3600;\n\t\t\t\tforeach(glob($tempDir . DIRECTORY_SEPARATOR .'ELF*') as $cf) {\n\t\t\t\t\tif (filemtime($cf) < $gc) {\n\t\t\t\t\t\t@unlink($cf);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $tempDir;\n\t}", "label_name": "Base", "label": 1} {"code": "\tstatic public function getStatusText($_lng, $_status = 0)\n\t{\n\t\tswitch($_status)\n\t\t{\n\t\t\tcase 0:\n\t\t\t\treturn $_lng['ticket']['open'];\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\treturn $_lng['ticket']['wait_reply'];\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\treturn $_lng['ticket']['replied'];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn $_lng['ticket']['closed'];\n\t\t\t\tbreak;\n\t\t}\n\t}", "label_name": "Class", "label": 2} {"code": "\tfunction selectBillingOptions() {\n\t\t\n\t}", "label_name": "Base", "label": 1} {"code": " public function confirm()\n {\n $project = $this->getProject();\n $tag_id = $this->request->getIntegerParam('tag_id');\n $tag = $this->tagModel->getById($tag_id);\n\n $this->response->html($this->template->render('project_tag/remove', array(\n 'tag' => $tag,\n 'project' => $project,\n )));\n }", "label_name": "Class", "label": 2} {"code": "\tprotected function replaceTagCount( $tag, $nr ) {\n\t\treturn str_replace( '%NR%', $nr, $tag );\n\t}", "label_name": "Class", "label": 2} {"code": "\tstatic function convertXMLFeedSafeChar($str) {\n\t\t$str = str_replace(\"
    \",\"\",$str);\n $str = str_replace(\"
    \",\"\",$str);\n $str = str_replace(\"
    \",\"\",$str);\n $str = str_replace(\"
    \",\"\",$str);\n $str = str_replace(\""\",'\"',$str);\n $str = str_replace(\"'\",\"'\",$str);\n $str = str_replace(\"’\",\"'\",$str);\n $str = str_replace(\"‘\",\"'\",$str); \n $str = str_replace(\"®\",\"\",$str);\n $str = str_replace(\"\ufffd\",\"-\", $str);\n $str = str_replace(\"\ufffd\",\"-\", $str); \n $str = str_replace(\"\ufffd\", '\"', $str);\n $str = str_replace(\"”\",'\"', $str);\n $str = str_replace(\"\ufffd\", '\"', $str);\n $str = str_replace(\"“\",'\"', $str);\n $str = str_replace(\"\\r\\n\",\" \",$str); \n $str = str_replace(\"\ufffd\",\" 1/4\",$str);\n $str = str_replace(\"¼\",\" 1/4\", $str);\n $str = str_replace(\"\ufffd\",\" 1/2\",$str);\n $str = str_replace(\"½\",\" 1/2\",$str);\n $str = str_replace(\"\ufffd\",\" 3/4\",$str);\n $str = str_replace(\"¾\",\" 3/4\",$str);\n $str = str_replace(\"\ufffd\", \"(TM)\", $str);\n $str = str_replace(\"™\",\"(TM)\", $str);\n $str = str_replace(\"®\",\"(R)\", $str);\n $str = str_replace(\"\ufffd\",\"(R)\",$str); \n $str = str_replace(\"&\",\"&\",$str); \n\t\t$str = str_replace(\">\",\">\",$str); \t\t\n return trim($str);\n\t}", "label_name": "Base", "label": 1} {"code": "\tprotected function _mkdir($path, $name) {\n\t\t$path = $this->_joinPath($path, $name);\n\t\tif (ftp_mkdir($this->connect, $path) === false) {\n\t\t\treturn false;\n\t\t} \n\t\t\n\t\t$this->options['dirMode'] && @ftp_chmod($this->connect, $this->options['dirMode'], $path);\n\t\treturn $path;\n\t}", "label_name": "Base", "label": 1} {"code": "\tprotected function _rmdir($path) {\n\t\t$ret = @rmdir($path);\n\t\t$ret && clearstatcache();\n\t\treturn $ret;\n\t}", "label_name": "Base", "label": 1} {"code": " $contents[] = ['class' => 'text-center', 'text' => tep_draw_bootstrap_button(IMAGE_SAVE, 'fas fa-save', null, 'primary', null, 'btn-success xxx text-white mr-2') . tep_draw_bootstrap_button(IMAGE_CANCEL, 'fas fa-times', tep_href_link('currencies.php', 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id), null, null, 'btn-light')];", "label_name": "Base", "label": 1} {"code": " public function event()\n {\n $project = $this->getProject();\n $values = $this->request->getValues();\n\n if (empty($values['action_name']) || empty($values['project_id'])) {\n return $this->create();\n }\n\n return $this->response->html($this->template->render('action_creation/event', array(\n 'values' => $values,\n 'project' => $project,\n 'available_actions' => $this->actionManager->getAvailableActions(),\n 'events' => $this->actionManager->getCompatibleEvents($values['action_name']),\n )));\n }", "label_name": "Base", "label": 1} {"code": " public function __construct() {\n $this->pop_conn = 0;\n $this->connected = false;\n $this->error = null;\n }", "label_name": "Class", "label": 2} {"code": " public function testQueryMustBeValid()\n {\n (new Uri(''))->withQuery(new \\stdClass);\n }", "label_name": "Base", "label": 1} {"code": " function edit_externalalias() {\r\n $section = isset($this->params['id']) ? $this->section->find($this->params['id']) : new section($this->params);\r\n if ($section->parent == -1) {\r\n notfoundController::handle_not_found();\r\n exit;\r\n } // doesn't work for standalone pages\r\n if (empty($section->id)) {\r\n $section->public = 1;\r\n if (!isset($section->parent)) {\r\n // This is another precaution. The parent attribute\r\n // should ALWAYS be set by the caller.\r\n //FJD - if that's the case, then we should die.\r\n notfoundController::handle_not_authorized();\r\n exit;\r\n //$section->parent = 0;\r\n }\r\n }\r\n assign_to_template(array(\r\n 'section' => $section,\r\n 'glyphs' => self::get_glyphs(),\r\n ));\r\n }\r", "label_name": "Base", "label": 1} {"code": " private function _new_password($user_id = 0, $password, $token)\n {\n \t$auth = Auth::instance();\n\t\t$user = ORM::factory('user',$user_id);\n\t\tif ($user->loaded == true)\n\t\t{\n\t\t\t// Determine Method (RiverID or standard)\n\n\t\t\tif (kohana::config('riverid.enable') == TRUE AND ! empty($user->riverid))\n\t\t\t{\n\t\t\t\t// Use RiverID\n\n\t\t\t\t// We don't really have to save the password locally but if a deployer\n\t\t\t\t// ever wants to switch back locally, it's nice to have the pw there\n\t\t\t\t$user->password = $password;\n\t\t\t\t$user->save();\n\n\t\t\t\t// Relay the password change back to the RiverID server\n\t\t\t\t$riverid = new RiverID;\n\t\t\t\t$riverid->email = $user->email;\n\t\t\t\t$riverid->token = $token;\n\t\t\t\t$riverid->new_password = $password;\n\t\t\t\tif ($riverid->setpassword() == FALSE)\n\t\t\t\t{\n\t\t\t\t\t// TODO: Something went wrong. Tell the user.\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Use Standard\n\n\t\t\t\tif($auth->hash_password($user->email.$user->last_login, $auth->find_salt($token)) == $token)\n\t\t\t\t{\n\t\t\t\t\t$user->password = $password;\n\t\t\t\t\t$user->save();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// TODO: Something went wrong, tell the user.\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t// TODO: User doesn't exist, tell the user (meta, I know).\n\n\t\treturn FALSE;\n\t}", "label_name": "Base", "label": 1} {"code": "\t\t\t\tunset($k, $v);\n\t\t\t}\n\t\t}\n\n\t\treturn self::$user;\n\t}", "label_name": "Base", "label": 1} {"code": "\tprivate function _firstrevisionsince( $option ) {\n\t\t$this->addTable( 'revision_actor_temp', 'rev' );\n\t\t$this->addSelect(\n\t\t\t[\n\t\t\t\t'rev.revactor_rev',\n\t\t\t\t'rev.revactor_timestamp'\n\t\t\t]\n\t\t);\n\t\t// tell the query optimizer not to look at rows that the following subquery will filter out anyway\n\t\t$this->addWhere(\n\t\t\t[\n\t\t\t\t$this->tableNames['page'] . '.page_id = rev.revactor_page',\n\t\t\t\t'rev.revactor_timestamp >= ' . $this->DB->addQuotes( $option )\n\t\t\t]\n\t\t);\n\t\t$this->addWhere(\n\t\t\t[\n\t\t\t\t$this->tableNames['page'] . '.page_id = rev.revactor_page',\n\t\t\t\t'rev.revactor_timestamp = (SELECT MIN(rev_aux_snc.revactor_timestamp) FROM ' . $this->tableNames['revision_actor_temp'] . ' AS rev_aux_snc WHERE rev_aux_snc.revactor_page=rev.revactor_page AND rev_aux_snc.revactor_timestamp >= ' . $this->convertTimestamp( $option ) . ')'\n\t\t\t]\n\t\t);\n\t}", "label_name": "Class", "label": 2} {"code": " public function confirm()\n {\n $project = $this->getProject();\n $category = $this->getCategory();\n\n $this->response->html($this->helper->layout->project('category/remove', array(\n 'project' => $project,\n 'category' => $category,\n )));\n }", "label_name": "Base", "label": 1} {"code": " public function save()\n {\n $project = $this->getProject();\n\n $values = $this->request->getValues();\n list($valid, $errors) = $this->categoryValidator->validateCreation($values);\n\n if ($valid) {\n if ($this->categoryModel->create($values) !== false) {\n $this->flash->success(t('Your category have been created successfully.'));\n $this->response->redirect($this->helper->url->to('CategoryController', 'index', array('project_id' => $project['id'])), true);\n return;\n } else {\n $errors = array('name' => array(t('Another category with the same name exists in this project')));\n }\n }\n\n $this->create($values, $errors);\n }", "label_name": "Class", "label": 2} {"code": " public function getTestData()\n {\n return [\n [[], 'Kimai - ' . Constants::VERSION . ' ' . Constants::STATUS . ' (' . Constants::NAME . ') by Kevin Papst and contributors.'],\n [['--name' => true], Constants::NAME],\n [['--candidate' => true], Constants::STATUS],\n [['--short' => true], Constants::VERSION],\n [['--semver' => true], Constants::VERSION . '-' . Constants::STATUS],\n ];\n }", "label_name": "Base", "label": 1} {"code": " public function activate_discount(){ \n if (isset($this->params['id'])) {\n $discount = new discounts($this->params['id']);\n $discount->update($this->params);\n //if ($discount->discountulator->hasConfig() && empty($discount->config)) {\n //flash('messages', $discount->discountulator->name().' requires configuration. Please do so now.');\n //redirect_to(array('controller'=>'billing', 'action'=>'configure', 'id'=>$discount->id));\n //}\n }\n \n expHistory::back();\n }", "label_name": "Base", "label": 1} {"code": " public static function error ($vars=\"\", $val='') {\r\n if( isset($vars) && $vars != \"\" ) {\r\n\r\n $file = GX_PATH.'/inc/lib/Control/Error/'.$vars.'.control.php';\r\n if (file_exists($file)) {\r\n\r\n include($file);\r\n\r\n }\r\n\r\n }else{\r\n\r\n include(GX_PATH.'/inc/lib/Control/Error/unknown.control.php');\r\n\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": "\tpublic static function simple($input)\n\t{\n\t\treturn empty($str) ? '' : pts_strings::keep_in_string($input, pts_strings::CHAR_LETTER | pts_strings::CHAR_NUMERIC | pts_strings::CHAR_DASH | pts_strings::CHAR_DECIMAL | pts_strings::CHAR_SPACE | pts_strings::CHAR_UNDERSCORE | pts_strings::CHAR_COMMA | pts_strings::CHAR_AT | pts_strings::CHAR_COLON);\n\t}", "label_name": "Compound", "label": 4} {"code": "function GETPOST($paramname,$check='',$method=0)\n{\n\tif (empty($method)) $out = isset($_GET[$paramname])?$_GET[$paramname]:(isset($_POST[$paramname])?$_POST[$paramname]:'');\n\telseif ($method==1) $out = isset($_GET[$paramname])?$_GET[$paramname]:'';\n\telseif ($method==2) $out = isset($_POST[$paramname])?$_POST[$paramname]:'';\n\telseif ($method==3) $out = isset($_POST[$paramname])?$_POST[$paramname]:(isset($_GET[$paramname])?$_GET[$paramname]:'');\n\n\tif (! empty($check))\n\t{\n\t\t// Check if numeric\n\t\tif ($check == 'int' && ! preg_match('/^[-\\.,0-9]+$/i',trim($out))) $out='';\n\t\t// Check if alpha\n\t\t//if ($check == 'alpha' && ! preg_match('/^[ =:@#\\/\\\\\\(\\)\\-\\._a-z0-9]+$/i',trim($out))) $out='';\n\t\t// '\"' is dangerous because param in url can close the href= or src= and add javascript functions.\n\t\tif ($check == 'alpha' && preg_match('/\"/',trim($out))) $out='';\n\t}\n\n\treturn $out;\n}", "label_name": "Base", "label": 1} {"code": " public function confirm()\n {\n $project = $this->getProject();\n\n $this->response->html($this->helper->layout->project('action/remove', array(\n 'action' => $this->actionModel->getById($this->request->getIntegerParam('action_id')),\n 'available_events' => $this->eventManager->getAll(),\n 'available_actions' => $this->actionManager->getAvailableActions(),\n 'project' => $project,\n 'title' => t('Remove an action')\n )));\n }", "label_name": "Base", "label": 1} {"code": " public function getQuerySelect()\n {\n }", "label_name": "Base", "label": 1} {"code": "\tfunction delete_vendor() {\n\t\tglobal $db;\n\t\t\n if (!empty($this->params['id'])){\n\t\t\t$db->delete('vendor', 'id =' .$this->params['id']);\n\t\t}\n expHistory::back();\n }", "label_name": "Base", "label": 1} {"code": " static function displayname() {\n return gt(\"e-Commerce Category Manager\");\n }", "label_name": "Class", "label": 2} {"code": " $newret = recyclebin::restoreFromRecycleBin($iLoc, $page_id);\r\n if (!empty($newret)) $ret .= $newret . '
    ';\r\n if ($iLoc->mod == 'container') {\r\n $ret .= scan_container($container->internal, $page_id);\r\n }\r\n }\r\n return $ret;\r\n }\r", "label_name": "Base", "label": 1} {"code": " public function uploadAvatar(Request $request)\n {\n $user = auth()->user();\n\n if ($user && $request->hasFile('admin_avatar')) {\n $user->clearMediaCollection('admin_avatar');\n\n $user->addMediaFromRequest('admin_avatar')\n ->toMediaCollection('admin_avatar');\n }\n\n if ($user && $request->has('avatar')) {\n $data = json_decode($request->avatar);\n $user->clearMediaCollection('admin_avatar');\n\n $user->addMediaFromBase64($data->data)\n ->usingFileName($data->name)\n ->toMediaCollection('admin_avatar');\n }\n\n return new UserResource($user);\n }", "label_name": "Base", "label": 1} {"code": " public function save()\n {\n $project = $this->getProject();\n\n $values = $this->request->getValues();\n list($valid, $errors) = $this->categoryValidator->validateCreation($values);\n\n if ($valid) {\n if ($this->categoryModel->create($values) !== false) {\n $this->flash->success(t('Your category have been created successfully.'));\n $this->response->redirect($this->helper->url->to('CategoryController', 'index', array('project_id' => $project['id'])), true);\n return;\n } else {\n $errors = array('name' => array(t('Another category with the same name exists in this project')));\n }\n }\n\n $this->create($values, $errors);\n }", "label_name": "Class", "label": 2} {"code": " public function remove()\n {\n $project = $this->getProject();\n $this->checkCSRFParam();\n $column_id = $this->request->getIntegerParam('column_id');\n\n if ($this->columnModel->remove($column_id)) {\n $this->flash->success(t('Column removed successfully.'));\n } else {\n $this->flash->failure(t('Unable to remove this column.'));\n }\n\n $this->response->redirect($this->helper->url->to('ColumnController', 'index', array('project_id' => $project['id'])));\n }", "label_name": "Base", "label": 1} {"code": " public function __construct(array $attributes = null)\n {\n $rootDir = realpath(__DIR__ . \"/../\");\n $this->setChroot(array($rootDir));\n $this->setRootDir($rootDir);\n $this->setTempDir(sys_get_temp_dir());\n $this->setFontDir($rootDir . \"/lib/fonts\");\n $this->setFontCache($this->getFontDir());\n\n $ver = \"\";\n $versionFile = realpath(__DIR__ . \"/../VERSION\");\n if (file_exists($versionFile) && ($version = trim(file_get_contents($versionFile))) !== false && $version !== '$Format:<%h>$') {\n $ver = \"/$version\";\n }\n $this->setHttpContext([\n \"http\" => [\n \"follow_location\" => false,\n \"user_agent\" => \"Dompdf$ver https://github.com/dompdf/dompdf\"\n ]\n ]);\n\n if (null !== $attributes) {\n $this->set($attributes);\n }\n }", "label_name": "Base", "label": 1} {"code": " function __construct($uid, $folder = null, $is_safe = false)\n {\n // decode combined UID-folder identifier\n if (preg_match('/^\\d+-.+/', $uid)) {\n list($uid, $folder) = explode('-', $uid, 2);\n }\n\n $this->uid = $uid;\n $this->app = rcube::get_instance();\n $this->storage = $this->app->get_storage();\n $this->folder = strlen($folder) ? $folder : $this->storage->get_folder();\n\n // Set current folder\n $this->storage->set_folder($this->folder);\n $this->storage->set_options(array('all_headers' => true));\n\n $this->headers = $this->storage->get_message($uid);\n\n if (!$this->headers) {\n return;\n }\n\n $this->mime = new rcube_mime($this->headers->charset);\n $this->subject = $this->headers->get('subject');\n list(, $this->sender) = each($this->mime->decode_address_list($this->headers->from, 1));\n\n $this->set_safe($is_safe || $_SESSION['safe_messages'][$this->folder.':'.$uid]);\n $this->opt = array(\n 'safe' => $this->is_safe,\n 'prefer_html' => $this->app->config->get('prefer_html'),\n 'get_url' => $this->app->url(array(\n 'action' => 'get',\n 'mbox' => $this->folder,\n 'uid' => $uid))\n );\n\n if (!empty($this->headers->structure)) {\n $this->get_mime_numbers($this->headers->structure);\n $this->parse_structure($this->headers->structure);\n }\n else {\n $this->body = $this->storage->get_body($uid);\n }\n\n // notify plugins and let them analyze this structured message object\n $this->app->plugins->exec_hook('message_load', array('object' => $this));\n }", "label_name": "Compound", "label": 4} {"code": " public static function recent($vars, $type = 'post') {\n $sql = \"SELECT * FROM `posts` WHERE `type` = '{$type}' ORDER BY `date` DESC LIMIT {$vars}\";\n $posts = Db::result($sql);\n if(isset($posts['error'])){\n $posts['error'] = \"No Posts found.\";\n }else{\n $posts = $posts;\n }\n return $posts;\n }", "label_name": "Compound", "label": 4} {"code": " public static function verify($gresponse) {\r\n new Xaptcha();\r\n $recaptcha = new \\ReCaptcha\\ReCaptcha(self::$secret);\r\n $resp = $recaptcha->verify($gresponse, $_SERVER['REMOTE_ADDR']);\r\n if ($resp->isSuccess()) {\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": "\tpublic function admin_maintenance($mode = '')\n\t{\n\t\t$this->_checkReferer();\n\t\tswitch($mode) {\n\t\t\tcase 'backup':\n\t\t\t\tset_time_limit(0);\n\t\t\t\t$this->_backupDb($this->request->query['backup_encoding']);\n\t\t\t\tbreak;\n\t\t\tcase 'restore':\n\t\t\t\tset_time_limit(0);\n\t\t\t\t$messages = [];\n\t\t\t\tif (!$this->request->data) {\n\t\t\t\t\tif ($this->Tool->isOverPostSize()) {\n\t\t\t\t\t\t$messages[] = __d('baser', '\u9001\u4fe1\u3067\u304d\u308b\u30c7\u30fc\u30bf\u91cf\u3092\u8d85\u3048\u3066\u3044\u307e\u3059\u3002\u5408\u8a08\u3067 %s \u4ee5\u5185\u306e\u30c7\u30fc\u30bf\u3092\u9001\u4fe1\u3057\u3066\u304f\u3060\u3055\u3044\u3002', ini_get('post_max_size'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->notFound();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($this->_restoreDb($this->request->data)) {\n\t\t\t\t\t$messages[] = __d('baser', '\u30c7\u30fc\u30bf\u306e\u5fa9\u5143\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002');\n\t\t\t\t\t$error = false;\n\t\t\t\t} else {\n\t\t\t\t\t$messages[] = __d('baser', '\u30c7\u30fc\u30bf\u306e\u5fa9\u5143\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002\u30ed\u30b0\u306e\u78ba\u8a8d\u3092\u884c\u306a\u3063\u3066\u4e0b\u3055\u3044\u3002');\n\t\t\t\t\t$error = true;\n\t\t\t\t}\n\t\t\t\t// Page\u30e2\u30c7\u30eb\u304c\u30ec\u30b9\u30c8\u30a2\u51e6\u7406\u3067AppModel\u3067\u521d\u671f\u5316\u3055\u308cClassRegistry\u306b\u30bb\u30c3\u30c8\u3055\u308c\u3066\u3044\u308b\u70ba\n\t\t\t\tClassRegistry::flush();\n\t\t\t\tBcSite::flash();\n\t\t\t\tif (!$error && !$this->Page->createAllPageTemplate()) {\n\t\t\t\t\t$messages[] = __d('baser', \"\u30da\u30fc\u30b8\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u751f\u6210\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002\\n\u8868\u793a\u3067\u304d\u306a\u3044\u30da\u30fc\u30b8\u306f\u30da\u30fc\u30b8\u7ba1\u7406\u3088\u308a\u66f4\u65b0\u51e6\u7406\u3092\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002\");\n\t\t\t\t}\n\t\t\t\tif ($messages) {\n\t\t\t\t\tif ($error) {\n\t\t\t\t\t\t$this->BcMessage->setError(implode(\"\\n\", $messages));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->BcMessage->setInfo(implode(\"\\n\", $messages));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tclearAllCache();\n\t\t\t\t$this->redirect(['action' => 'maintenance']);\n\t\t\t\tbreak;\n\t\t}\n\t\t$this->pageTitle = __d('baser', '\u30c7\u30fc\u30bf\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9');\n\t\t$this->help = 'tools_maintenance';\n\t}", "label_name": "Base", "label": 1} {"code": "\tpublic function __construct( \\DPL\\Parameters $parameters, \\Parser $parser ) {\n\t\tparent::__construct( $parameters, $parser );\n\t\t$this->textSeparator = $parameters->getParameter( 'inlinetext' );\n\t}", "label_name": "Class", "label": 2} {"code": "\tpublic function options($hash) {\n\t\t$create = $createext = array();\n\t\tif (isset($this->archivers['create']) && is_array($this->archivers['create'])) {\n\t\t\tforeach($this->archivers['create'] as $m => $v) {\n\t\t\t\t$create[] = $m;\n\t\t\t\t$createext[$m] = $v['ext'];\n\t\t\t}\n\t\t}\n\t\treturn array(\n\t\t\t'path' => $this->path($hash),\n\t\t\t'url' => $this->URL,\n\t\t\t'tmbUrl' => $this->tmbURL,\n\t\t\t'disabled' => $this->disabled,\n\t\t\t'separator' => $this->separator,\n\t\t\t'copyOverwrite' => intval($this->options['copyOverwrite']),\n\t\t\t'uploadOverwrite' => intval($this->options['uploadOverwrite']),\n\t\t\t'uploadMaxSize' => intval($this->uploadMaxSize),\n\t\t\t'dispInlineRegex' => $this->options['dispInlineRegex'],\n\t\t\t'jpgQuality' => intval($this->options['jpgQuality']),\n\t\t\t'archivers' => array(\n\t\t\t\t'create' => $create,\n\t\t\t\t'extract' => isset($this->archivers['extract']) && is_array($this->archivers['extract']) ? array_keys($this->archivers['extract']) : array(),\n\t\t\t\t'createext' => $createext\n\t\t\t),\n\t\t\t'uiCmdMap' => (isset($this->options['uiCmdMap']) && is_array($this->options['uiCmdMap']))? $this->options['uiCmdMap'] : array(),\n\t\t\t'syncChkAsTs' => intval($this->options['syncChkAsTs']),\n\t\t\t'syncMinMs' => intval($this->options['syncMinMs'])\n\t\t);\n\t}", "label_name": "Base", "label": 1} {"code": " public static function inc($vars, $data, $dir){\r\n $file = $dir.\"/\".$vars.\".php\";\r\n if (file_exists($file)) {\r\n include($file);\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": "1);break}D.className=ca.join(\" \")}null!=ha?(D=ha,D.className+=\" \"+qa,I=aa,Ga.className=\"geTempDlgCreateBtn\"):(I=D=null,Ga.className=\"geTempDlgCreateBtn geTempDlgBtnDisabled\")}function q(ha,qa){if(null!=I){var aa=function(ra){oa.isExternal?e(oa,function(ia){ca(ia,ra)},na):oa.url?mxUtils.get(TEMPLATE_PATH+\"/\"+oa.url,mxUtils.bind(this,function(ia){200<=ia.getStatus()&&299>=ia.getStatus()?ca(ia.getText(),ra):na()})):ca(b.emptyDiagramXml,ra)},ca=function(ra,ia){x||b.hideDialog(!0);f(ra,ia,oa,qa)},na=function(){z(mxResources.get(\"cannotLoad\"));\nla()},la=function(){I=oa;Ga.className=\"geTempDlgCreateBtn\";qa&&(Ka.className=\"geTempDlgOpenBtn\")},oa=I;I=null;\"boolean\"!==typeof qa&&(qa=oa.isExternal&&m);1==ha?g(oa.url,oa):qa?(Ka.className=\"geTempDlgOpenBtn geTempDlgBtnDisabled geTempDlgBtnBusy\",aa()):(Ga.className=\"geTempDlgCreateBtn geTempDlgBtnDisabled geTempDlgBtnBusy\",ha=null==b.mode||b.mode==App.MODE_GOOGLE||b.mode==App.MODE_BROWSER?mxResources.get(\"diagramName\"):mxResources.get(\"filename\"),ha=new FilenameDialog(b,b.defaultFilename+\".drawio\",\nmxResources.get(\"ok\"),aa,ha,function(ra){var ia=null!=ra&&0 -1) {\n $scope.filteredNodes.splice(index,1);\n }\n growl.success('The node ' + node.nodeLabel + ' has been deleted.');\n },\n $scope.errorHandler\n );\n }\n });\n };", "label_name": "Base", "label": 1} {"code": "var T=document.createElement(\"tbody\"),N=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(g=mxUtils.indexOf(b.pages,b.currentPage));for(q=e.length-1;0<=q;q--){var Q=function(R){var Y=new Date(R.modifiedDate),ba=null;if(0<=Y.getTime()){var ea=function(fa){x.stop();v.innerHTML=\"\";var aa=mxUtils.parseXml(fa),va=b.editor.extractGraphModel(aa.documentElement,!0);if(null!=va){var ja=function(Ha){null!=Ha&&(Ha=Ba(Editor.parseDiagramNode(Ha)));return Ha},Ba=function(Ha){var ra=Ha.getAttribute(\"background\");\nif(null==ra||\"\"==ra||ra==mxConstants.NONE)ra=d.defaultPageBackgroundColor;n.style.backgroundColor=ra;(new mxCodec(Ha.ownerDocument)).decode(Ha,d.getModel());d.maxFitScale=1;d.fit(8);d.center();return Ha};M.style.display=\"none\";M.innerHTML=\"\";t=aa;z=fa;k=parseSelectFunction=null;l=0;if(\"mxfile\"==va.nodeName){aa=va.getElementsByTagName(\"diagram\");k=[];for(fa=0;fa:, /, \\\\, ?, &, *, \\', \"');\n return;\n }\n var r = $scope.requisitionsData.getRequisition(foreignSource);\n if (r) {\n bootbox.alert('Cannot add the requisition ' + foreignSource+ ' because there is already a requisition with that name');\n return;\n }\n // Create Requisition\n RequisitionsService.addRequisition(foreignSource).then(\n function(r) { // success\n growl.success('The requisition ' + r.foreignSource + ' has been created.');\n },\n $scope.errorHandler\n );\n }\n });\n };", "label_name": "Compound", "label": 4} {"code": " function onError(err) {\n if (this === client) {\n assert(!cliError, makeMsg('Unexpected multiple client errors'));\n cliError = err;\n } else {\n assert(!srvError, makeMsg('Unexpected multiple server errors'));\n srvError = err;\n }\n assert.strictEqual(err.level, 'handshake');\n assert(/handshake failed/i.test(err.message),\n makeMsg('Wrong error message'));\n }", "label_name": "Base", "label": 1} {"code": "Wa,Xa,K,Ga,Ja,Ia,Ha);c.stroke()};Ea.prototype.moveNW=function(c,l,x,p,v,A,B,ha,K){\"square\"==B||\"default\"==B&&\"square\"==A||!K?c.moveTo(0,0):c.moveTo(0,ha)};Ea.prototype.moveNE=function(c,l,x,p,v,A,B,ha,K){\"square\"==B||\"default\"==B&&\"square\"==A||!K?c.moveTo(p,0):c.moveTo(p-ha,0)};Ea.prototype.moveSE=function(c,l,x,p,v,A,B,ha,K){\"square\"==B||\"default\"==B&&\"square\"==A||!K?c.moveTo(p,v):c.moveTo(p,v-ha)};Ea.prototype.moveSW=function(c,l,x,p,v,A,B,ha,K){\"square\"==B||\"default\"==B&&\"square\"==A||!K?c.moveTo(0,\nv):c.moveTo(ha,v)};Ea.prototype.paintNW=function(c,l,x,p,v,A,B,ha,K){if(K)if(\"rounded\"==B||\"default\"==B&&\"rounded\"==A||\"invRound\"==B||\"default\"==B&&\"invRound\"==A){l=0;if(\"rounded\"==B||\"default\"==B&&\"rounded\"==A)l=1;c.arcTo(ha,ha,0,0,l,ha,0)}else(\"snip\"==B||\"default\"==B&&\"snip\"==A||\"fold\"==B||\"default\"==B&&\"fold\"==A)&&c.lineTo(ha,0);else c.lineTo(0,0)};Ea.prototype.paintTop=function(c,l,x,p,v,A,B,ha,K){\"square\"==B||\"default\"==B&&\"square\"==A||!K?c.lineTo(p,0):c.lineTo(p-ha,0)};Ea.prototype.paintNE=", "label_name": "Base", "label": 1} {"code": "va&&(\"shape\"!=va||Na)&&(!Na||la||0>mxUtils.indexOf(d,va))&&(Ca=mxUtils.setStyle(Ca,va,Ra))}Editor.simpleLabels&&(Ca=mxUtils.setStyle(mxUtils.setStyle(Ca,\"html\",null),\"whiteSpace\",null));Q.setStyle(J,Ca)}}finally{Q.endUpdate()}return I};n.addListener(\"cellsInserted\",function(I,V){q(V.getProperty(\"cells\"),null,null,null,null,!0,!0)});n.addListener(\"textInserted\",function(I,V){q(V.getProperty(\"cells\"),!0)});this.insertHandler=q;this.createDivs();this.createUi();this.refresh();var y=mxUtils.bind(this,", "label_name": "Base", "label": 1} {"code": "ServerStderr.prototype._write = function(data, encoding, cb) {\n var channel = this._channel;\n var sshstream = channel._client._sshstream;\n var outgoing = channel.outgoing;\n var packetSize = outgoing.packetSize;\n var id = outgoing.id;\n var window = outgoing.window;\n var len = data.length;\n var p = 0;\n var ret;\n var buf;\n var sliceLen;\n\n if (channel.outgoing.state !== 'open')\n return;\n\n while (len - p > 0 && window > 0) {\n sliceLen = len - p;\n if (sliceLen > window)\n sliceLen = window;\n if (sliceLen > packetSize)\n sliceLen = packetSize;\n\n ret = sshstream.channelExtData(id, data.slice(p, p + sliceLen), STDERR);\n\n p += sliceLen;\n window -= sliceLen;\n\n if (!ret) {\n channel._waitClientDrain = true;\n channel._chunkErr = undefined;\n channel._chunkcbErr = cb;\n break;\n }\n }\n\n outgoing.window = window;\n\n if (len - p > 0) {\n if (window === 0)\n channel._waitWindow = true;\n if (p > 0) {\n // partial\n buf = Buffer.allocUnsafe(len - p);\n data.copy(buf, 0, p);\n channel._chunkErr = buf;\n } else\n channel._chunkErr = data;\n channel._chunkcbErr = cb;\n return;\n }\n\n if (!channel._waitClientDrain)\n cb();\n};", "label_name": "Base", "label": 1} {"code": "mxUtils.bind(this,function(){0===C&&(c=U.full_path,m=J.path,v=\"\",O(null,!0))})));k.appendChild(E)})(X[u])}}));G()}else G(),mxUtils.write(k,mxResources.get(\"noFiles\"));100==V.length&&(k.appendChild(A),B=function(){k.scrollTop>=k.scrollHeight-k.offsetHeight&&P()},mxEvent.addListener(k,\"scroll\",B))}),y)}}))});b?this.user?t():this.updateUser(function(){t()},y,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){t()},y,!0)}),y)};GitLabClient.prototype.logout=function(){this.ui.editor.loadUrl(this.redirectUri+\n\"?doLogout=1&state=\"+encodeURIComponent(\"cId=\"+this.clientId+\"&domain=\"+window.location.hostname));this.clearPersistentToken();this.setUser(null);b=null;this.setToken(null)}})();DrawioComment=function(b,e,f,c,m,n,v){this.file=b;this.id=e;this.content=f;this.modifiedDate=c;this.createdDate=m;this.isResolved=n;this.user=v;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,e,f,c,m){e()};DrawioComment.prototype.editComment=function(b,e,f){e()};DrawioComment.prototype.deleteComment=function(b,e){b()};DriveComment=function(b,e,f,c,m,n,v,d){DrawioComment.call(this,b,e,f,c,m,n,v);this.pCommentId=d};mxUtils.extend(DriveComment,DrawioComment);DriveComment.prototype.addReply=function(b,e,f,c,m){b={content:b.content};c?b.verb=\"resolve\":m&&(b.verb=\"reopen\");this.file.ui.drive.executeRequest({url:\"/files/\"+this.file.getId()+\"/comments/\"+this.id+\"/replies\",params:b,method:\"POST\"},mxUtils.bind(this,function(n){e(n.replyId)}),f)};", "label_name": "Base", "label": 1} {"code": "B)):N.isSelectionEmpty()&&N.isEnabled()?(B.addSeparator(),this.addMenuItems(B,[\"editData\"],null,G),B.addSeparator(),this.addSubmenu(\"layout\",B),this.addSubmenu(\"insert\",B),this.addMenuItems(B,[\"-\",\"exitGroup\"],null,G)):N.isEnabled()&&this.addMenuItems(B,[\"-\",\"lockUnlock\"],null,G)};var A=Menus.prototype.addPopupMenuEditItems;Menus.prototype.addPopupMenuEditItems=function(B,F,G){A.apply(this,arguments);this.editorUi.editor.graph.isSelectionEmpty()&&this.addMenuItems(B,[\"copyAsImage\"],null,G)};EditorUi.prototype.toggleFormatPanel=", "label_name": "Class", "label": 2} {"code": "51+\"px\"})}).resize()})}})(jQuery);(function(a){a.fn.fc_show_popup=function(b){b=a.extend({functionOpen:!1},b);return this.each(function(){var b=a(this),e=match_class_prefix(\"form_\",b),d=a(\"#\"+e);b.unbind().click(function(){d.find(\".fc_valid, .fc_invalid\").removeClass(\"fc_invalid fc_valid\");var b=d.find('input[name=\"form_title\"]').val();buttonsOpts=[];0 0 ? parseInt(o.width) : 450;\t\n\t\theight = o.height > 0 ? parseInt(o.height) : 300;\n\n\t\tfm.one('load', function() {\n\t\t\tparent = fm.getUI();\n\t\t\tcwd = fm.getUI('cwd');\n\n\t\t\twin.appendTo('body');\n\t\t\t\n\t\t\t// close window on escape\n\t\t\t$(document).keydown(function(e) {\n\t\t\t\te.keyCode == 27 && self.opened() && win.trigger('close')\n\t\t\t})\n\t\t\t\n\t\t\tif ($.fn.resizable && !fm.UA.Touch) {\n\t\t\t\twin.resizable({ \n\t\t\t\t\thandles : 'se', \n\t\t\t\t\tminWidth : 350, \n\t\t\t\t\tminHeight : 120, \n\t\t\t\t\tresize : function() { \n\t\t\t\t\t\t// use another event to avoid recursion in fullscreen mode\n\t\t\t\t\t\t// may be there is clever solution, but i cant find it :(\n\t\t\t\t\t\tpreview.trigger('changesize'); \n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\tself.change(function() {\n\t\t\t\tif (self.opened()) {\n\t\t\t\t\tself.value ? preview.trigger($.Event('update', {file : self.value})) : win.trigger('close');\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\t$.each(fm.commands.quicklook.plugins || [], function(i, plugin) {\n\t\t\t\tif (typeof(plugin) == 'function') {\n\t\t\t\t\tnew plugin(self)\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tpreview.bind('update', function() {\n\t\t\t\tself.info.show();\n\t\t\t});\n\t\t});\n\t\t\n\t}", "label_name": "Base", "label": 1} {"code": " setup: function () {\n var data = this.model.get('data') || {};\n\n this.entityType = this.model.get('relatedType') || data.entityType || null;\n this.entityId = this.model.get('relatedId') || data.entityId || null;\n this.entityName = this.model.get('relatedName') || data.entityName || null;\n\n this.messageData['relatedEntityType'] = this.translateEntityType(this.entityType);\n this.messageData['relatedEntity'] = '' + this.entityName +'';\n\n this.createMessage();\n }", "label_name": "Base", "label": 1} {"code": "function(I){mxEvent.isConsumed(I)||((mxEvent.isControlDown(I)||mxClient.IS_MAC&&mxEvent.isMetaDown(I))&&13==I.keyCode?(D.click(),mxEvent.consume(I)):27==I.keyCode&&(n.click(),mxEvent.consume(I)))}));D.focus();D.className=\"geCommentEditBtn gePrimaryBtn\";Y.appendChild(D);F.insertBefore(Y,O);V.style.display=\"none\";O.style.display=\"none\";U.focus()}function e(H,F){F.innerHTML=\"\";H=new Date(H.modifiedDate);var J=b.timeSince(H);null==J&&(J=mxResources.get(\"lessThanAMinute\"));mxUtils.write(F,mxResources.get(\"timeAgo\",\n[J],\"{1} ago\"));F.setAttribute(\"title\",H.toLocaleDateString()+\" \"+H.toLocaleTimeString())}function g(H){var F=document.createElement(\"img\");F.className=\"geCommentBusyImg\";F.src=IMAGE_PATH+\"/spin.gif\";H.appendChild(F);H.busyImg=F}function k(H){H.style.border=\"1px solid red\";H.removeChild(H.busyImg)}function m(H){H.style.border=\"\";H.removeChild(H.busyImg)}function p(H,F,J,R,W){function O(Q,P,T){var X=document.createElement(\"li\");X.className=\"geCommentAction\";var ba=document.createElement(\"a\");ba.className=", "label_name": "Base", "label": 1} {"code": " function mapTOC(suite, obj) {\n var ret = obj;\n obj = obj[suite.title] = obj[suite.title] || { suite: suite };\n suite.suites.forEach(function(suite){\n mapTOC(suite, obj);\n });\n return ret;\n }", "label_name": "Base", "label": 1} {"code": "function assertArg(arg, name, reason) {\n if (!arg) {\n throw ngMinErr('areq', 'Argument \\'{0}\\' is {1}', (name || '?'), (reason || 'required'));\n }\n return arg;\n}", "label_name": "Class", "label": 2} {"code": "function tileLevel(inPath, outPath, zoom, tileSize, pattern, quality) {\n var dotExtension = pattern.replace(/.*(\\.[^.]+)$/, '$1');\n var patternedFilename = pattern.replace(/\\{z\\}/, '' + zoom)\n .replace(/\\{x\\}/, '%[fx:page.x/' + tileSize + ']')\n .replace(/\\{y\\}/, '%[fx:page.y/' + tileSize + ']')\n .replace(/\\.[^.]+$/, '');\n var patternedFilenameWithoutTheFilename = '';\n if (pattern.indexOf(path.sep) > 0) {\n patternedFilenameWithoutTheFilename = pattern.replace(new RegExp(path.sep+'[^'+path.sep+']*$'), '')\n .replace(/\\{z\\}/, '' + zoom);\n }\n return mkdirp(outPath + path.sep + patternedFilenameWithoutTheFilename)\n .then(()=>{\n var command = 'convert ' + inPath +\n ' -crop ' + tileSize + 'x' + tileSize +\n ' -set filename:tile \"' + patternedFilename + '\"' +\n ' -quality ' + quality + ' +repage +adjoin' +\n ' \"' + outPath + '/%[filename:tile]' + dotExtension + '\"' ;\n execSync(command);\n });\n}", "label_name": "Class", "label": 2} {"code": "null!=this.linkHint&&(this.linkHint.style.visibility=\"\")};var Za=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Za.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function b(c,l,x){mxShape.call(this);this.line=c;this.stroke=l;this.strokewidth=null!=x?x:1;this.updateBoundsFromLine()}function e(){mxSwimlane.call(this)}function k(){mxSwimlane.call(this)}function n(){mxCylinder.call(this)}function D(){mxCylinder.call(this)}function t(){mxActor.call(this)}function F(){mxCylinder.call(this)}function d(){mxCylinder.call(this)}function f(){mxCylinder.call(this)}function g(){mxCylinder.call(this)}function m(){mxShape.call(this)}function q(){mxShape.call(this)}", "label_name": "Class", "label": 2} {"code": "null,this.container)}));q.appendChild(u);u.className=\"geBtn gePrimaryBtn\";b.editor.cancelFirst||q.appendChild(e);if(null!=k)for(c=0;c

    ';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar attrs = (cell.value != null) ? cell.value.attributes : null;\n\n\t\t\tif (ui.editor.isChromelessView())\n\t\t\t{\n\t\t\t\thighlight.highlight(graph.view.getState(cell));\n\t\t\t}\n\t\n\t\t\tif (attrs != null)\n\t\t\t{\n\t\t\t\tvar label = graph.sanitizeHtml(graph.getLabel(cell));\n\t\t\t\t\n\t\t\t\tif (label != null && label.length > 0)\n\t\t\t\t{\n\t\t\t\t\tdiv.innerHTML = '

    ' + label + '

    ';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdiv.innerHTML = '';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor (var i = 0; i < attrs.length; i++)\n\t\t\t\t{\n\t\t\t\t\tif (mxUtils.indexOf(ignored, attrs[i].nodeName) < 0 &&\n\t\t\t\t\t\tattrs[i].nodeValue.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t// TODO: Add click handler on h2 to output data\n\t\t\t\t\t\tvar h2 = document.createElement('h2');\n\t\t\t\t\t\tmxUtils.write(h2, attrs[i].nodeName);\n\t\t\t\t\t\tdiv.appendChild(h2);\n\t\t\t\t\t\tvar p = document.createElement('p');\n\t\t\t\t\t\tmxUtils.write(p, attrs[i].nodeValue);\n\t\t\t\t\t\tdiv.appendChild(p);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar label = graph.convertValueToString(cell);\n\t\t\t\t\n\t\t\t\tif (label != '')\n\t\t\t\t{\n\t\t\t\t\tdiv.innerHTML = '

    ' + graph.sanitizeHtml(label) + '

    ';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdiv.innerHTML = '

    No data

    ';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!ui.editor.isChromelessView())\n\t\t\t{\n\t\t\t\tvar button = document.createElement('button');\n\t\t\t\tbutton.setAttribute('title', 'Click or Shift+Click to write data for all selected cells to the browser console');\n\t\t\t\tbutton.style['float'] = 'none';\n\t\t\t\tmxUtils.write(button, 'Write to Console');\n\n\t\t\t\tmxEvent.addListener(button, 'click', function(evt)\n\t\t\t\t{\n\t\t\t\t\textractData(evt);\n\t\t\t\t});\n\n\t\t\t\tdiv.appendChild(button);\n\t\t\t}\n\t\t}\n\t};", "label_name": "Base", "label": 1} {"code": "\twp.updates.showErrorInCredentialsForm = function( message ) {\n\t\tvar $modal = $( '.notification-dialog' );\n\n\t\t// Remove any existing error.\n\t\t$modal.find( '.error' ).remove();\n\n\t\t$modal.find( 'h3' ).after( '
    ' + message + '
    ' );\n\t};", "label_name": "Compound", "label": 4} {"code": "Oa+=\"@import url(\"+Ma+\");\\n\":Ia+='@font-face {\\nfont-family: \"'+Ca+'\";\\nsrc: url(\"'+Ma+'\");\\n}\\n'}Ka.appendChild(Ba.createTextNode(Oa+Ia));xa.getElementsByTagName(\"defs\")[0].appendChild(Ka)}null!=la&&(this.shapeBackgroundColor=Fa,this.shapeForegroundColor=Aa,this.stylesheet=la,this.refresh());return xa};var B=Graph.prototype.createSvgImageExport;Graph.prototype.createSvgImageExport=function(){var p=B.apply(this,arguments);if(this.mathEnabled){var C=p.drawText;p.drawText=function(I,T){if(null!=I.text&&\nnull!=I.text.value&&I.text.checkBounds()&&(mxUtils.isNode(I.text.value)||I.text.dialect==mxConstants.DIALECT_STRICTHTML)){var P=I.text.getContentNode();if(null!=P){P=P.cloneNode(!0);if(P.getElementsByTagNameNS)for(var O=P.getElementsByTagNameNS(\"http://www.w3.org/1998/Math/MathML\",\"math\");0\");this.div.style.visibility=\"\";mxUtils.fit(this.div)}};", "label_name": "Base", "label": 1} {"code": "Conf.prototype.save = function (where, cb) {\n var target = this.sources[where]\n if (!target || !(target.path || target.source) || !target.data) {\n var er\n if (where !== 'builtin') er = new Error('bad save target: ' + where)\n if (cb) {\n process.nextTick(cb.bind(null, er))\n return this\n }\n return this.emit('error', er)\n }\n\n if (target.source) {\n var pref = target.prefix || ''\n Object.keys(target.data).forEach(function (k) {\n target.source[pref + k] = target.data[k]\n })\n if (cb) process.nextTick(cb)\n return this\n }\n\n var data = ini.stringify(target.data)\n\n var then = function then (er) {\n if (er) return done(er)\n\n fs.chmod(target.path, mode, done)\n }\n\n var done = function done (er) {\n if (er) {\n if (cb) return cb(er)\n else return this.emit('error', er)\n }\n this._saving --\n if (this._saving === 0) {\n if (cb) cb()\n this.emit('save')\n }\n }\n\n then = then.bind(this)\n done = done.bind(this)\n this._saving ++\n\n var mode = where === 'user' ? '0600' : '0666'\n if (!data.trim()) {\n fs.unlink(target.path, function () {\n // ignore the possible error (e.g. the file doesn't exist)\n done(null)\n })\n } else {\n correctMkdir(path.dirname(target.path), function (er) {\n if (er) return then(er)\n fs.writeFile(target.path, data, 'utf8', function (er) {\n if (er) return then(er)\n if (where === 'user' && myUid && myGid) {\n fs.chown(target.path, +myUid, +myGid, then)\n } else {\n then()\n }\n })\n })\n }\n\n return this\n}", "label_name": "Class", "label": 2} {"code": "Graph.compressNode(x))));c(v)}return m};EditorUi.prototype.anonymizeString=function(c,e){for(var g=[],k=0;k 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tlist.style.display = '';\n\t\t\t\t\t\tdiv.style.left = '160px';\n\t\t\t\t\t\tlist.innerHTML = '';\n\n\t\t\t\t\t\tcustomCatCount = 0;\n\t\t\t\t\t\tcategories = {'draw.io': docList};\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (var cat in searchImportCats)\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\tcategories[cat] = searchImportCats[cat];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tinitUi();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\taddTemplates(true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (isSearch)\n\t\t\t{\n\t\t\t\tsearchDocsCallback(searchInput.value, callback2);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\trecentDocsCallback(callback2);\n\t\t\t}\n\t\t}", "label_name": "Base", "label": 1} {"code": "c,!c&&r[a]&&(d.extend(r[a]),q&&!q.date&&console.warn(\"This method of applying plugins is deprecated. See documentation for details.\")))};d.locale(m,{});\"object\"===typeof module&&\"object\"===typeof module.exports?module.exports=d:\"function\"===typeof define&&define.amd?define([],function(){return d}):q.date=d})(this);", "label_name": "Class", "label": 2} {"code": "function getInputs(body) {\n if (body.length !== 1) return;\n var lastExpression = body[0].expression;\n var candidate = lastExpression.toWatch;\n if (candidate.length !== 1) return candidate;\n return candidate[0] !== lastExpression ? candidate : undefined;\n}", "label_name": "Class", "label": 2} {"code": "\"bVisible\").length}function aa(a,b){var c=[];h.map(a.aoColumns,function(a,e){a[b]&&c.push(e)});return c}function Ia(a){var b=a.aoColumns,c=a.aoData,d=m.ext.type.detect,e,f,g,j,i,h,l,q,u;e=0;for(f=b.length;eq[f])d(l.length+q[f],o);else if(\"string\"===typeof q[f]){j=0;for(i=l.length;j \\\"\"+d+'\"\\n';else c=\"===>\"+a+\"<===(\"+typeof a+\")\";return c};(function(a){a.fn.fc_set_tab_list=function(b){var c={toggle_speed:300,fc_list_forms:a(\".fc_list_forms\"),fc_list_add:a(\"#fc_list_add\")};b=a.extend(c,b);return this.each(function(){var c=a(this),d=c.closest(\"ul\").children(\"li\"),f=\"fc_list_\"+c.children(\"input\").val(),g=a(\"#\"+f),h=a(\"#fc_install_new\");b.fc_list_forms.not(\":first\").slideUp(0);0===b.fc_list_add.size()?d.filter(\":first\").addClass(\"fc_active\"):b.fc_list_add.unbind().click(function(){d.removeClass(\"fc_active\");b.fc_list_forms.not(h).slideUp(0);\nh.slideDown(0);h.find(\"ul.fc_groups_tabs a:first\").click();h.find(\"input[type=text]:first\").focus();jQuery(\"#addon_details\").html(\"\")});c.not(\".fc_type_heading\").click(function(){d.removeClass(\"fc_active\");c.addClass(\"fc_active\");b.fc_list_forms.not(\"#\"+f).slideUp(0);g.slideDown(0);g.find(\"ul.fc_groups_tabs a:first\").click();jQuery(\"#fc_add_new_module\").hide()})})}})(jQuery);(function(a){a.fn.fc_toggle_element=function(b){b=a.extend({show_on_start:!1,toggle_speed:300},b);return this.each(function(){var c=a(this),e=\"show\";if(c.is(\"select\")){var d=c.children(\"option:selected\"),f=match_class_prefix(\"show___\",d),e=\"show\";if(\"undefined\"==typeof f||0===f.length)f=match_class_prefix(\"hide___\",d),e=\"hide\";\"undefined\"!=typeof f&&(g=a(\"#\"+f));!1===b.show_on_start?g.slideUp(0).addClass(\"fc_inactive_element hidden\").removeClass(\"fc_active_element\"):g.slideDown(0).addClass(\"fc_active_element\").removeClass(\"fc_inactive_element hidden\");", "label_name": "Base", "label": 1} {"code": "D=C.createElement(\"output\");C.appendChild(D);C=new mxXmlCanvas2D(D);C.translate(Math.floor((1-z.x)/L),Math.floor((1-z.y)/L));C.scale(1/L);var G=0,P=C.save;C.save=function(){G++;P.apply(this,arguments)};var K=C.restore;C.restore=function(){G--;K.apply(this,arguments)};var F=t.drawShape;t.drawShape=function(H){mxLog.debug(\"entering shape\",H,G);F.apply(this,arguments);mxLog.debug(\"leaving shape\",H,G)};t.drawState(m.getView().getState(m.model.root),C);mxLog.show();mxLog.debug(mxUtils.getXml(D));mxLog.debug(\"stateCounter\",", "label_name": "Base", "label": 1} {"code": "Aa.style.padding=\"0px\";Aa.style.boxShadow=\"none\";Aa.className=\"geMenuItem\";Aa.style.display=\"inline-block\";Aa.style.width=\"40px\";Aa.style.height=\"12px\";Aa.style.marginBottom=\"-2px\";Aa.style.backgroundImage=\"url(\"+mxWindow.prototype.normalizeImage+\")\";Aa.style.backgroundPosition=\"top center\";Aa.style.backgroundRepeat=\"no-repeat\";Aa.setAttribute(\"title\",\"Minimize\");var za=!1,Ca=mxUtils.bind(this,function(){W.innerHTML=\"\";if(!za){var ua=function(Fa,Ra,db){Fa=X(\"\",Fa.funct,null,Ra,Fa,db);Fa.style.width=\n\"40px\";Fa.style.opacity=\"0.7\";return ya(Fa,null,\"pointer\")},ya=function(Fa,Ra,db){null!=Ra&&Fa.setAttribute(\"title\",Ra);Fa.style.cursor=null!=db?db:\"default\";Fa.style.margin=\"2px 0px\";W.appendChild(Fa);mxUtils.br(W);return Fa};ya(U.sidebar.createVertexTemplate(\"text;strokeColor=none;fillColor=none;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;\",60,30,\"Text\",mxResources.get(\"text\"),!0,!1,null,!0,!0),mxResources.get(\"text\")+\" (\"+Editor.ctrlKey+\"+Shift+X)\");ya(U.sidebar.createVertexTemplate(\"shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;pointerEvents=1;\",", "label_name": "Base", "label": 1} {"code": " $scope.deleteNode = function(node) {\n bootbox.confirm('Are you sure you want to remove the node ' + node.nodeLabel + '?', function(ok) {\n if (ok) {\n RequisitionsService.startTiming();\n RequisitionsService.deleteNode(node).then(\n function() { // success\n var index = -1;\n for(var i = 0; i < $scope.filteredNodes.length; i++) {\n if ($scope.filteredNodes[i].foreignId === node.foreignId) {\n index = i;\n }\n }\n if (index > -1) {\n $scope.filteredNodes.splice(index,1);\n }\n growl.success('The node ' + node.nodeLabel + ' has been deleted.');\n },\n $scope.errorHandler\n );\n }\n });\n };", "label_name": "Compound", "label": 4} {"code": "if(null!=d&&d==c)return a}for(a=a.firstChild;null!=a;){d=mxUtils.findNode(a,b,c);if(null!=d)return d;a=a.nextSibling}return null},getFunctionName:function(a){var b=null;null!=a&&(null!=a.name?b=a.name:(b=mxUtils.trim(a.toString()),/^function\\s/.test(b)&&(b=mxUtils.ltrim(b.substring(9)),a=b.indexOf(\"(\"),0');\r\n return;\r\n }\r\n\r\n var pqr = i.value;\r\n\r\n\r\n ajax_call('Validator.php?u=' + i.value + 'user', usercheck_callback, usercheck_error);\r\n}\r", "label_name": "Base", "label": 1} {"code": "\twp.updates.beforeunload = function() {\n\t\tif ( wp.updates.updateLock ) {\n\t\t\treturn wp.updates.l10n.beforeunload;\n\t\t}\n\t};", "label_name": "Compound", "label": 4} {"code": "function(e){var f=e.split(\"/\");return 1y.length){H.view.validate();var wa=new mxFastOrganicLayout(H);wa.forceConstant=3*fa;wa.disableEdgeStyle=!1;wa.resetEdges=!1;var Ea=wa.isVertexIgnored;wa.isVertexIgnored=function(Da){return Ea.apply(this,arguments)||0>mxUtils.indexOf(y,Da)};this.executeLayout(function(){wa.execute(H.getDefaultParent());Fa()},!0,u);u=null}}this.hideDialog()}finally{H.model.endUpdate()}null!=u&&u()}}catch(Da){this.handleError(Da)}};EditorUi.prototype.getSearch=", "label_name": "Base", "label": 1} {"code": " main.getHostIcon = function (obj, classes) {\n var icon = '';\n var alt = '';\n\n if (obj && obj.common && obj.common.icon) {\n var result = getIconHtml(obj);\n icon = result.icon;\n alt = result.alt;\n }\n icon = icon || 'img/no-image.png';\n alt = alt || '';\n\n return '\"'';\n };", "label_name": "Base", "label": 1} {"code": "function(C){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=C?C:!this.formatWindow.window.isVisible()):b(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var B=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=null);null!=this.formatWindow&&(this.formatWindow.window.setVisible(!1),this.formatWindow.window.destroy(),", "label_name": "Class", "label": 2} {"code": "c=mb[c];return null!=c?c(this.state):null}}else Graph.createHandle=function(){},Graph.handleFactory={};var rb=new mxPoint(1,0),zb=new mxPoint(1,0),Bb=mxUtils.toRadians(-30);rb=mxUtils.getRotatedPoint(rb,Math.cos(Bb),Math.sin(Bb));var Ab=mxUtils.toRadians(-150);zb=mxUtils.getRotatedPoint(zb,Math.cos(Ab),Math.sin(Ab));mxEdgeStyle.IsometricConnector=function(c,l,x,p,v){var A=c.view;p=null!=p&&0ka.max&&(la=ka.max);la=encodeURIComponent((\"int\"==wa?parseInt(la):la)+\"\");T(Aa,la,ka)}var ca=document.createElement(\"input\");N(xa,ca,!0);ca.value=decodeURIComponent(ta);ca.className=\"gePropEditor\";\"int\"!=wa&&\"float\"!=wa||ka.allowAuto||(ca.type=\"number\",ca.step=\"int\"==wa?\"1\":\"any\",null!=ka.min&&(ca.min=parseFloat(ka.min)),null!=ka.max&&(ca.max=parseFloat(ka.max)));u.appendChild(ca);mxEvent.addListener(ca,\"keypress\",function(la){13==la.keyCode&&da()});ca.focus();mxEvent.addListener(ca,", "label_name": "Class", "label": 2} {"code": " 'binary===': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) === right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },", "label_name": "Class", "label": 2} {"code": "function HTMLCov(runner) {\n var jade = require('jade')\n , file = __dirname + '/templates/coverage.jade'\n , str = fs.readFileSync(file, 'utf8')\n , fn = jade.compile(str, { filename: file })\n , self = this;\n\n JSONCov.call(this, runner, false);\n\n runner.on('end', function(){\n process.stdout.write(fn({\n cov: self.cov\n , coverageClass: coverageClass\n }));\n });\n}", "label_name": "Base", "label": 1} {"code": "ea.x-16;ka.y+=ea.y;return ka};var C=Menus.prototype.createPopupMenu;Menus.prototype.createPopupMenu=function(O,X,ea){var ka=this.editorUi.editor.graph;O.smartSeparators=!0;C.apply(this,arguments);\"1\"==urlParams.sketch?ka.isEnabled()&&(O.addSeparator(),1==ka.getSelectionCount()&&this.addMenuItems(O,[\"-\",\"lockUnlock\"],null,ea)):1==ka.getSelectionCount()?(ka.isCellFoldable(ka.getSelectionCell())&&this.addMenuItems(O,ka.isCellCollapsed(X)?[\"expand\"]:[\"collapse\"],null,ea),this.addMenuItems(O,[\"collapsible\",\n\"-\",\"lockUnlock\",\"enterGroup\"],null,ea),O.addSeparator(),this.addSubmenu(\"layout\",O)):ka.isSelectionEmpty()&&ka.isEnabled()?(O.addSeparator(),this.addMenuItems(O,[\"editData\"],null,ea),O.addSeparator(),this.addSubmenu(\"layout\",O),this.addSubmenu(\"insert\",O),this.addMenuItems(O,[\"-\",\"exitGroup\"],null,ea)):ka.isEnabled()&&this.addMenuItems(O,[\"-\",\"lockUnlock\"],null,ea)};var H=Menus.prototype.addPopupMenuEditItems;Menus.prototype.addPopupMenuEditItems=function(O,X,ea){H.apply(this,arguments);this.editorUi.editor.graph.isSelectionEmpty()&&", "label_name": "Class", "label": 2} {"code": "\"top center\";ea.style.backgroundRepeat=\"no-repeat\";ea.setAttribute(\"title\",\"Minimize\");var ha=!1,ma=mxUtils.bind(this,function(){T.innerHTML=\"\";if(!ha){var aa=function(la,qa,ta){la=C(\"\",la.funct,null,qa,la,ta);la.style.width=\"40px\";la.style.opacity=\"0.7\";return ca(la,null,\"pointer\")},ca=function(la,qa,ta){null!=qa&&la.setAttribute(\"title\",qa);la.style.cursor=null!=ta?ta:\"default\";la.style.margin=\"2px 0px\";T.appendChild(la);mxUtils.br(T);return la};ca(F.sidebar.createVertexTemplate(\"text;strokeColor=none;fillColor=none;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;\",", "label_name": "Base", "label": 1} {"code": "mxCellRenderer.prototype.destroy=function(u){D.apply(this,arguments);null!=u.secondLabel&&(u.secondLabel.destroy(),u.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(u){return[u.shape,u.text,u.secondLabel,u.control]};var G=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){G.apply(this,arguments);this.enumerationState=0};var P=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(u){null!=u.shape&&this.redrawEnumerationState(u);\nreturn P.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(u){u=decodeURIComponent(mxUtils.getValue(u.style,\"enumerateValue\",\"\"));\"\"==u&&(u=++this.enumerationState);return'
    '+mxUtils.htmlEntities(u)+\"
    \"};mxGraphView.prototype.redrawEnumerationState=function(u){var E=\"1\"==mxUtils.getValue(u.style,\"enumerate\",0);E&&null==u.secondLabel?(u.secondLabel=new mxText(\"\",new mxRectangle,mxConstants.ALIGN_LEFT,", "label_name": "Base", "label": 1} {"code": "function forEachSorted(obj, iterator, context) {\n var keys = Object.keys(obj).sort();\n for (var i = 0; i < keys.length; i++) {\n iterator.call(context, obj[keys[i]], keys[i]);\n }\n return keys;\n}", "label_name": "Class", "label": 2} {"code": "ta.style.width=\"40px\";ta.style.height=\"12px\";ta.style.marginBottom=\"-2px\";ta.style.backgroundImage=\"url(\"+mxWindow.prototype.normalizeImage+\")\";ta.style.backgroundPosition=\"top center\";ta.style.backgroundRepeat=\"no-repeat\";ta.setAttribute(\"title\",\"Minimize\");var Na=!1,Ca=mxUtils.bind(this,function(){S.innerHTML=\"\";if(!Na){var za=function(Da,La,Ya){Da=X(\"\",Da.funct,null,La,Da,Ya);Da.style.width=\"40px\";Da.style.opacity=\"0.7\";return wa(Da,null,\"pointer\")},wa=function(Da,La,Ya){null!=La&&Da.setAttribute(\"title\",", "label_name": "Class", "label": 2} {"code": "function dialog_form(a,b,c,e,d){\"undefined\"==typeof e&&(e=\"json\");a.submit(function(f){f.preventDefault();a.ajaxSubmit({context:a,dataType:e,beforeSerialize:function(a,b){\"undefined\"!=typeof d&&!1!==d&&d.call(this,a,b)},beforeSend:function(c,d,e){var f=0Nightscout documentation.\"\n ,persistent: true\n };\n ctx.adminnotifies.addNotify(message);\n }\n\n next();\n }", "label_name": "Base", "label": 1} {"code": " setup: function () {\n var data = this.model.get('data') || {};\n\n this.userId = data.userId;\n\n this.messageData['entityType'] = Espo.Utils.upperCaseFirst((this.translate(data.entityType, 'scopeNames') || '').toLowerCase());\n if (data.personEntityId) {\n this.messageData['from'] = '' + data.personEntityName + '';\n } else {\n this.messageData['from'] = data.fromString || this.translate('empty address');\n }\n\n this.emailId = data.emailId;\n this.emailName = data.emailName;\n\n this.createMessage();\n }", "label_name": "Base", "label": 1} {"code": " filters.push({'condition': 'AND', 'filters': this.filterPanels[id].getValue(), 'id': id, label: this.filterPanels[id].title});\n }\n }\n \n // NOTE: always trigger a OR condition, otherwise we sould loose inactive FilterPanles\n //return filters.length == 1 ? filters[0].filters : [{'condition': 'OR', 'filters': filters}];\n return [{'condition': 'OR', 'filters': filters}];\n },", "label_name": "Base", "label": 1} {"code": "mxShape.prototype.clear=function(){if(null!=this.node.ownerSVGElement)for(;null!=this.node.lastChild;)this.node.removeChild(this.node.lastChild);else this.node.style.cssText=\"position:absolute;\"+(null!=this.cursor?\"cursor:\"+this.cursor+\";\":\"\"),this.node.innerHTML=\"\"};", "label_name": "Base", "label": 1} {"code": "mxClient.IS_CHROMEAPP&&!g||navigator.standalone||!(g||mxClient.IS_SVG&&(null==document.documentMode||9f.length?\"preview\":\"openInNewWindow\"),function(){var v=5E5>f.length?k.value:f;if(null!=u)u(v);else if(g)try{var x=b.openLink(v);null!=x&&(null==l||0', 'gsi'), '');\r\n }\r\n var span = document.createElement('span');\r\n span.innerHTML = data;\r\n parse(span);\r\n return span;\r\n } \r", "label_name": "Base", "label": 1} {"code": "var M=mxText.prototype.redraw;mxText.prototype.redraw=function(){M.apply(this,arguments);null!=this.node&&\"DIV\"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(p,C,I){function T(){for(var la=R.getSelectionCells(),Aa=[],Fa=0;Fa' +\n\t\t\t\t'
    {ext}
    ' +\n\t\t\t'
    ' +\n\t\t\t'
    ' +\n\t\t\t\t'
    ' +\n\t\t\t\t'{percent} ' +\n\t\t\t'
    ' +\n\t\t\t'
    ' +\n\t\t\t\t'{name} ' +\n\t\t\t'
    ' +\n\t\t\t'
    ' +\n\t\t\t\t'
    ' +\n\t\t\t'
    ' +\n\t\t\t'
    {size}
    ' +\n\t\t\t'
    ' +\n\t\t'';\n\n\t\tif (plupload.typeOf(files) !== 'array') {\n\t\t\tfiles = [files];\n\t\t}\n\n\t\t$.each(files, function(i, file) {\n\t\t\tvar ext = o.core.utils.Mime.getFileExtension(file.name) || 'none';\n\n\t\t\thtml += file_html.replace(/\\{(\\w+)\\}/g, function($0, $1) {\n\t\t\t\tswitch ($1) {\n\t\t\t\t\tcase 'thumb_width':\n\t\t\t\t\tcase 'thumb_height':\n\t\t\t\t\t\treturn self.options[$1];\n\n\t\t\t\t\tcase 'size':\n\t\t\t\t\t\treturn plupload.formatSize(file.size);\n\n\t\t\t\t\tcase 'ext':\n\t\t\t\t\t\treturn ext;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn file[$1] || '';\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tself.filelist.append(html);\n\t},", "label_name": "Base", "label": 1} {"code": "arguments):(this.addOp(this.lineOp,O,R),this.lastX=O,this.lastY=R)};p.prototype.moveTo=function(O,R){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,O,R),this.lastX=O,this.lastY=R,this.firstX=O,this.firstY=R)};p.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,arguments):this.addOp(this.closeOp)};p.prototype.quadTo=function(O,R,Y,da){this.passThrough?this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,O,\nR,Y,da),this.lastX=Y,this.lastY=da)};p.prototype.curveTo=function(O,R,Y,da,ha,Z){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,O,R,Y,da,ha,Z),this.lastX=ha,this.lastY=Z)};p.prototype.arcTo=function(O,R,Y,da,ha,Z,ea){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var aa=mxUtils.arcToCurves(this.lastX,this.lastY,O,R,Y,da,ha,Z,ea);if(null!=aa)for(var ua=0;ua= 2.1) {\n\t\t\t\t\t\t\t\t\tif (processing > 0) {\n\t\t\t\t\t\t\t\t\t\tdirctorys.push(entry);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tprocessing = 0;\n\t\t\t\t\t\t\t\t\t\tdirReader = entry.createReader();\n\t\t\t\t\t\t\t\t\t\tprocessing++;\n\t\t\t\t\t\t\t\t\t\treadEntries(dirReader);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};", "label_name": "Base", "label": 1} {"code": "return u};Graph.getFontUrl=function(u,E){u=Graph.customFontElements[u.toLowerCase()];null!=u&&(E=u.url);return E};Graph.processFontAttributes=function(u){u=u.getElementsByTagName(\"*\");for(var E=0;E task._id),\n datasets: [{\n values: templateInstance.topTasks.get().map((task) => task.count),\n }],\n },\n tooltipOptions: {\n },\n })\n }\n })\n })\n }", "label_name": "Base", "label": 1} {"code": "this.editor.graph.pageVisible;0==q&&(this.editor.graph.pageVisible=q);var X=this.createDownloadRequest(M,d,l,W,x,p,y,A,B,I,O,P,K);this.editor.graph.pageVisible=U;return X}catch(u){this.handleError(u)}}))}else{var F=null,H=mxUtils.bind(this,function(M){M.length<=MAX_REQUEST_SIZE?this.saveData(z,\"svg\",M,\"image/svg+xml\"):this.handleError({message:mxResources.get(\"drawingTooLarge\")},mxResources.get(\"error\"),mxUtils.bind(this,function(){mxUtils.popup(F)}))});if(\"svg\"==d){var S=this.editor.graph.background;", "label_name": "Class", "label": 2} {"code": "Graph.compressNode(x))));c(v)}return m};EditorUi.prototype.anonymizeString=function(c,e){for(var g=[],k=0;k= 0) {\r\n var k = v.shift();\r\n var v = v.join(':');\r\n style.push(k + ':' + v);\r\n }\r\n }\r\n }\r\n // Process image\r\n if (element.tagName == 'IMG') {\r\n if (! obj.options.acceptImages) {\r\n element.remove();\r\n } else {\r\n // Check if is data\r\n element.setAttribute('tabindex', '900');\r\n // Check attributes for persistance\r\n obj.addImage(element.src);\r\n }\r\n } else {\r\n // Remove attributes\r\n var numAttributes = element.attributes.length - 1;\r\n for (var i = numAttributes; i >= 0 ; i--) {\r\n element.removeAttribute(element.attributes[i].name);\r\n }\r\n }\r\n element.style = '';\r\n // Add valid style\r\n if (style && style.length) {\r\n element.setAttribute('style', style.join(';'));\r\n }\r\n }\r\n // Parse children\r\n if (element.children.length) {\r\n for (var i = 0; i < element.children.length; i++) {\r\n parse(element.children[i]);\r\n }\r\n }\r\n\r\n if (remove.indexOf(element.constructor) >= 0) {\r\n element.remove();\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": " 'readYAML': function(test) {\n test.expect(4);\n var obj;\n obj = grunt.file.readYAML('test/fixtures/utf8.yaml');\n test.deepEqual(obj, this.object, 'file should be read as utf8 by default and parsed correctly.');\n\n obj = grunt.file.readYAML('test/fixtures/iso-8859-1.yaml', {encoding: 'iso-8859-1'});\n test.deepEqual(obj, this.object, 'file should be read using the specified encoding.');\n\n test.throws(function() {\n obj = grunt.file.readYAML('test/fixtures/error.yaml');\n }, function(err) {\n return err.message.indexOf('undefined') === -1;\n }, 'error thrown should not contain undefined.');\n\n grunt.file.defaultEncoding = 'iso-8859-1';\n obj = grunt.file.readYAML('test/fixtures/iso-8859-1.yaml');\n test.deepEqual(obj, this.object, 'changing the default encoding should work.');\n test.done();\n },", "label_name": "Base", "label": 1} {"code": "Q.marginBottom||0;R.allowGaps=Q.allowGaps||0;R.horizontal=\"1\"==mxUtils.getValue(Q,\"horizontalRack\",\"0\");R.resizeParent=!1;R.fill=!0;return R}return T.apply(this,arguments)};this.updateGlobalUrlVariables()};var B=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(u,E){return Graph.processFontStyle(B.apply(this,arguments))};var I=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(u,E,J,T,N,Q,R,Y,ba,ea,Z){I.apply(this,arguments);Graph.processFontAttributes(Z)};", "label_name": "Base", "label": 1} {"code": "function(P,K){0 i.material-icons');\n }\n\n \tif (inst.text() == 'volume_off'){\n \t\t$.get(this.wwwDir+ 'user/setsettingajax/new_chat_sound/1');\n \t\tconfLH.new_chat_sound_enabled = 1;\n \t\tinst.text('volume_up');\n \t} else {\n \t\t$.get(this.wwwDir+ 'user/setsettingajax/new_chat_sound/0');\n \t\tconfLH.new_chat_sound_enabled = 0;\n \t\tinst.text('volume_off');\n \t}\n \treturn false;\n };", "label_name": "Compound", "label": 4} {"code": " setTemplates: function() {\n var iconHTML = '';\n if (this.options.suggestionIcon !== '') {\n iconHTML = '';\n }\n\n // suggestions\n if (this.options.fields.length) {\n this.suggestionTpl = this.sandbox.util.template('' +\n '
    \">' +\n '
    ' +\n '
    ' +\n ' <% _.each(fields, function(field, idx) { %>' +\n '
    ;\"><%= context[field.id] %>
    ' +\n ' <% }) %>' +\n '
    ' +\n '
    ' +\n '
    ');\n } else {\n this.suggestionTpl = this.sandbox.util.template('' +\n '
    \">' +\n '
    ' +\n iconHTML +\n '
    <%= context[this.options.valueKey] %>
    ' +\n '
    ' +\n '
    ');\n }\n\n if (!!this.options.footerContent) {\n this.footerTpl = this.sandbox.util.template(\n '
    ' +\n this.options.footerContent +\n '
    '\n );\n }\n },", "label_name": "Base", "label": 1} {"code": "x[C].apply(this,arguments);null!=G&&B.push(G)}b.sidebar.showEntries(0mxUtils.indexOf(d,y)&&d.push(y);m()})}:function(){var y=document.createElement(\"div\"),z=document.createElement(\"span\");z.style.marginTop=\"6px\";mxUtils.write(z,mxResources.get(\"builtinPlugins\")+\": \");", "label_name": "Base", "label": 1} {"code": " obj.select = function(o) {\r\n var menu = el.querySelectorAll('nav a');\r\n for (var i = 0; i < menu.length; i++) {\r\n menu[i].classList.remove('selected');\r\n }\r\n o.classList.add('selected');\r\n\r\n // Better navigation\r\n if (options && options.collapse == true) {\r\n if (o.classList.contains('show')) {\r\n menu = el.querySelectorAll('nav');\r\n for (var i = 0; i < menu.length; i++) {\r\n menu[i].style.display = '';\r\n }\r\n o.style.display = 'none';\r\n } else {\r\n menu = el.querySelectorAll('nav');\r\n for (var i = 0; i < menu.length; i++) {\r\n menu[i].style.display = 'none';\r\n }\r\n\r\n menu = el.querySelector('.show');\r\n if (menu) {\r\n menu.style.display = 'block';\r\n }\r\n\r\n menu = jSuites.findElement(o.parentNode, 'selected');\r\n if (menu) {\r\n menu.style.display = '';\r\n }\r\n }\r\n }\r\n\r\n // Close menu if is oped\r\n if (jSuites.getWindowWidth() < 800) {\r\n setTimeout(function() {\r\n obj.hide();\r\n }, 0);\r\n }\r\n }\r", "label_name": "Base", "label": 1} {"code": "l,v),new mxPoint(p-l,A),new mxPoint(0,A)],this.isRounded,B,!0);c.end()};mxCellRenderer.registerShape(\"singleArrow\",Za);mxUtils.extend(z,mxActor);z.prototype.redrawPath=function(c,l,x,p,v){var A=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,\"arrowWidth\",Za.prototype.arrowWidth))));l=p*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,\"arrowSize\",Za.prototype.arrowSize))));x=(v-A)/2;A=x+A;var B=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/\n2;this.addPoints(c,[new mxPoint(0,v/2),new mxPoint(l,0),new mxPoint(l,x),new mxPoint(p-l,x),new mxPoint(p-l,0),new mxPoint(p,v/2),new mxPoint(p-l,v),new mxPoint(p-l,A),new mxPoint(l,A),new mxPoint(l,v)],this.isRounded,B,!0);c.end()};mxCellRenderer.registerShape(\"doubleArrow\",z);mxUtils.extend(L,mxActor);L.prototype.size=.1;L.prototype.fixedSize=20;L.prototype.redrawPath=function(c,l,x,p,v){l=\"0\"!=mxUtils.getValue(this.style,\"fixedSize\",\"0\")?Math.max(0,Math.min(p,parseFloat(mxUtils.getValue(this.style,", "label_name": "Class", "label": 2} {"code": " value: function __isInt(value) {\n return /^(\\-|\\+)?([1-9]+[0-9]*)$/.test(value);\n }", "label_name": "Class", "label": 2} {"code": "(W.removeAttribute(\"disabled\"),W.checked=!m.pageVisible):(W.setAttribute(\"disabled\",\"disabled\"),W.checked=!1)};L=200;var D=1,G=null;if(c.pdfPageExport&&!t){var P=function(){V.value=Math.max(1,Math.min(D,Math.max(parseInt(V.value),parseInt(H.value))));H.value=Math.max(1,Math.min(D,Math.min(parseInt(V.value),parseInt(H.value))))},K=c.addRadiobox(z,\"pages\",mxResources.get(\"allPages\"),!0),F=c.addRadiobox(z,\"pages\",mxResources.get(\"pages\")+\":\",!1,null,!0),H=document.createElement(\"input\");H.style.cssText=", "label_name": "Class", "label": 2} {"code": "ba.model.setRoot(na.root)}ma=va(ba,ma,oa!=ia);ba!=P&&ba.container.parentNode.removeChild(ba.container)}}else ma=va(P);null==ma?p.handleError({message:mxResources.get(\"errorUpdatingPreview\")}):(ma.mathEnabled&&(ia=ma.wnd.document,ya&&(ma.wnd.IMMEDIATE_PRINT=!0),ia.writeln('