code
stringlengths 12
2.05k
| label_name
stringclasses 5
values | label
int64 0
4
|
---|---|---|
function MAX_adRenderImageBeacon($logUrl, $beaconId = 'beacon', $userAgent = null)
{
if (!isset($userAgent) && isset($_SERVER['HTTP_USER_AGENT'])) {
$userAgent = $_SERVER['HTTP_USER_AGENT'];
}
$beaconId .= '_{random}';
// Add beacon image for logging
if (isset($userAgent) && preg_match("#Mozilla/(1|2|3|4)#", $userAgent)
&& !preg_match("#compatible#", $userAgent)) {
$div = "<layer id='{$beaconId}' width='0' height='0' border='0' visibility='hide'>";
$style = '';
$divEnd = '</layer>';
} else {
$div = "<div id='{$beaconId}' style='position: absolute; left: 0px; top: 0px; visibility: hidden;'>";
$style = " style='width: 0px; height: 0px;'";
$divEnd = '</div>';
}
$beacon = "$div<img src='".htmlspecialchars($logUrl)."' width='0' height='0' alt=''{$style} />{$divEnd}";
return $beacon;
} | Base | 1 |
public function __destruct()
{
if ($this->Mailer == 'smtp') { //close any open SMTP connection nicely
$this->smtpClose();
}
} | Compound | 4 |
protected function getBodyTagAttributes()
{
$formEngineParameters = [];
$parameters = parent::getBodyTagAttributes();
$formEngineParameters['fieldChangeFunc'] = $this->parameters['fieldChangeFunc'];
$formEngineParameters['fieldChangeFuncHash'] = GeneralUtility::hmac(serialize($this->parameters['fieldChangeFunc']));
$parameters['data-add-on-params'] .= HttpUtility::buildQueryString(['P' => $formEngineParameters], '&');
return $parameters;
} | Class | 2 |
public function deleteByName(){
$item_id = I("item_id/d");
$env_id = I("env_id/d");
$var_name = I("var_name");
$login_user = $this->checkLogin();
$uid = $login_user['uid'] ;
if(!$this->checkItemEdit($uid , $item_id)){
$this->sendError(10303);
return ;
}
$ret = D("ItemVariable")->where(" item_id = '%d' and env_id = '%d' and var_name = '%s' ",array($item_id,$env_id,$var_name))->delete();
if ($ret) {
$this->sendResult($ret);
}else{
$this->sendError(10101);
}
} | Compound | 4 |
fwrite(STDERR, sprintf("%2d %s ==> %s\n", $i + 1, $test, var_export($result, true))); | Class | 2 |
protected function GetOrderedRefs($refList, $type, $order, $count = 0, $skip = 0)
{
if (!$refList)
return;
if (empty($type) || empty($order))
return null;
$args = array();
$args[] = '--sort=' . $order;
$args[] = '--format="%(refname)"';
if ($count > 0) {
if ($skip > 0) {
$args[] = '--count=' . ($count + $skip);
} else {
$args[] = '--count=' . $count;
}
} | Base | 1 |
protected function fixupImportedAttributes($modelName, X2Model &$model) {
if ($modelName === 'Contacts' || $modelName === 'X2Leads')
$this->fixupImportedContactName ($model);
if ($modelName === 'Actions' && isset($model->associationType))
$this->reconstructImportedActionAssoc($model);
if ($model->hasAttribute('visibility')) {
// Nobody every remembers to set visibility... set it for them
if(empty($model->visibility) && ($model->visibility !== 0 && $model->visibility !== "0")
|| $model->visibility == 'Public') {
$model->visibility = 1;
} elseif($model->visibility == 'Private')
$model->visibility = 0;
}
// If date fields were provided, do not create new values for them
if (!empty($model->createDate) || !empty($model->lastUpdated) ||
!empty($model->lastActivity)) {
$now = time();
if (empty($model->createDate))
$model->createDate = $now;
if (empty($model->lastUpdated))
$model->lastUpdated = $now;
if ($model->hasAttribute('lastActivity') && empty($model->lastActivity))
$model->lastActivity = $now;
}
if($_SESSION['leadRouting'] == 1){
$assignee = $this->getNextAssignee();
if($assignee == "Anyone")
$assignee = "";
$model->assignedTo = $assignee;
}
// Loop through our override and set the manual data
foreach($_SESSION['override'] as $attr => $val){
$model->$attr = $val;
}
} | Base | 1 |
public function onRouteStartup(Enlight_Controller_EventArgs $args)
{
$request = $args->getRequest();
if (strpos($request->getPathInfo(), '/backend') === 0
|| strpos($request->getPathInfo(), '/api/') === 0
) {
return;
}
$shop = $this->getShopByRequest($request);
if (!$shop->getHost()) {
$shop->setHost($request->getHttpHost());
}
if (!$shop->getBaseUrl()) {
$preferBasePath = $this->get(Shopware_Components_Config::class)->preferBasePath;
$shop->setBaseUrl($preferBasePath ? $request->getBasePath() : $request->getBaseUrl());
}
if (!$shop->getBasePath()) {
$shop->setBasePath($request->getBasePath());
}
// Read original base path for resources
$request->getBasePath();
$request->setBaseUrl($shop->getBaseUrl());
// Update path info
$request->setPathInfo(
$this->createPathInfo($request, $shop)
);
if (($host = $request->getHeader('X_FORWARDED_HOST')) !== null
&& $host === $shop->getHost()
) {
// If the base path is null, set it to empty string. Otherwise the request will try to assemble the base path. On a reverse proxy setup with varnish this will fail on virtual URLs like /en
// The X-Forwarded-Host header is only set in such environments
if ($shop->getBasePath() === null) {
$shop->setBasePath('');
}
$request->setSecure();
$request->setBasePath($shop->getBasePath());
$request->setBaseUrl($shop->getBaseUrl());
$request->setHttpHost($shop->getHost());
}
$this->validateShop($shop);
$this->get(ShopRegistrationServiceInterface::class)->registerShop($shop);
} | Base | 1 |
$evs = $this->event->find('all', "id=" . $edate->event_id . $featuresql);
foreach ($evs as $key=>$event) {
if ($condense) {
$eventid = $event->id;
$multiday_event = array_filter($events, create_function('$event', 'global $eventid; return $event->id === $eventid;'));
if (!empty($multiday_event)) {
unset($evs[$key]);
continue;
}
}
$evs[$key]->eventstart += $edate->date;
$evs[$key]->eventend += $edate->date;
$evs[$key]->date_id = $edate->id;
if (!empty($event->expCat)) {
$catcolor = empty($event->expCat[0]->color) ? null : trim($event->expCat[0]->color);
// if (substr($catcolor,0,1)=='#') $catcolor = '" style="color:'.$catcolor.';';
$evs[$key]->color = $catcolor;
}
}
if (count($events) < 500) { // magic number to not crash loop?
$events = array_merge($events, $evs);
} else {
// $evs[$key]->title = gt('Too many events to list').', '.(count($edates)-count($events)).' '.gt('not displayed!');
// $events = array_merge($events, $evs);
flash('notice',gt('Too many events to list').', '.(count($edates)-count($events)).' '.gt('not displayed!'));
break; // keep from breaking system by too much data
}
}
| Base | 1 |
public static function unsetTransactionPart(Db $zdb, Login $login, $trans_id, $contrib_id)
{
try {
//first, we check if contribution is part of transaction
$c = new Contribution($zdb, $login, (int)$contrib_id);
if ($c->isTransactionPartOf($trans_id)) {
$update = $zdb->update(self::TABLE);
$update->set(
array(Transaction::PK => null)
)->where(
self::PK . ' = ' . $contrib_id
);
$zdb->execute($update);
return true;
} else {
Analog::log(
'Contribution #' . $contrib_id .
' is not actually part of transaction #' . $trans_id,
Analog::WARNING
);
return false;
}
} catch (Throwable $e) {
Analog::log(
'Unable to detach contribution #' . $contrib_id .
' to transaction #' . $trans_id . ' | ' . $e->getMessage(),
Analog::ERROR
);
throw $e;
}
} | Base | 1 |
public static function navtojson() {
return json_encode(self::navhierarchy());
}
| Base | 1 |
$sloc = expCore::makeLocation('navigation', null, $section->id);
// remove any manage permissions for this page and it's children
// $db->delete('userpermission', "module='navigationController' AND internal=".$section->id);
// $db->delete('grouppermission', "module='navigationController' AND internal=".$section->id);
foreach ($allusers as $uid) {
$u = user::getUserById($uid);
expPermissions::grant($u, 'manage', $sloc);
}
foreach ($allgroups as $gid) {
$g = group::getGroupById($gid);
expPermissions::grantGroup($g, 'manage', $sloc);
}
}
}
| Class | 2 |
function manage () {
expHistory::set('viewable', $this->params);
$vendor = new vendor();
$vendors = $vendor->find('all');
if(!empty($this->params['vendor'])) {
$purchase_orders = $this->purchase_order->find('all', 'vendor_id=' . $this->params['vendor']);
} else {
$purchase_orders = $this->purchase_order->find('all');
}
assign_to_template(array(
'purchase_orders'=>$purchase_orders,
'vendors' => $vendors,
'vendor_id' => @$this->params['vendor']
));
} | Base | 1 |
foreach ($page as $pageperm) {
if (!empty($pageperm['manage'])) return true;
}
| Base | 1 |
list($workgroup, $user) = explode('\\', $user);
} else {
$workgroup = null;
}
$this->state->init($workgroup, $user, $this->server->getPassword());
} | Base | 1 |
public function show()
{
$task = $this->getTask();
$subtask = $this->getSubtask();
$this->response->html($this->template->render('subtask_converter/show', array(
'subtask' => $subtask,
'task' => $task,
)));
} | Base | 1 |
public function meta_box_subject() {
$placeholder = __( 'What is your conversation about?', 'supportflow' );
echo '<h4>' . __( 'Subject', 'supportflow' ) . '</h4>';
echo '<input type="text" id="subject" name="post_title" class="sf_autosave" placeholder="' . $placeholder . '" value="' . get_the_title() . '" autocomplete="off" />';
echo '<p class="description">' . __( 'Please describe what this ticket is about in several words', 'supportflow' ) . '</p>';
} | Base | 1 |
printf('<p>%s<br><strong>%s</strong> %s</p>',$row->post_title,$row->meta_key,$row->meta_value);
}
} | Base | 1 |
public static function isPublic($s) {
if ($s == null) {
return false;
}
while ($s->public && $s->parent > 0) {
$s = new section($s->parent);
}
$lineage = (($s->public) ? 1 : 0);
return $lineage;
}
| Base | 1 |
public function autocomplete() {
return;
global $db;
$model = $this->params['model'];
$mod = new $model();
$srchcol = explode(",",$this->params['searchoncol']);
/*for ($i=0; $i<count($srchcol); $i++) {
if ($i>=1) $sql .= " OR ";
$sql .= $srchcol[$i].' LIKE \'%'.$this->params['query'].'%\'';
}*/
// $sql .= ' AND parent_id=0';
//eDebug($sql);
//$res = $mod->find('all',$sql,'id',25);
$sql = "select DISTINCT(p.id), p.title, model, sef_url, f.id as fileid from ".$db->prefix."product as p INNER JOIN ".$db->prefix."content_expfiles as cef ON p.id=cef.content_id INNER JOIN ".$db->prefix."expfiles as f ON cef.expfiles_id = f.id where match (p.title,p.model,p.body) against ('" . $this->params['query'] . "') AND p.parent_id=0 order by match (p.title,p.model,p.body) against ('" . $this->params['query'] . "') desc LIMIT 25";
//$res = $db->selectObjectsBySql($sql);
//$res = $db->selectObjectBySql('SELECT * FROM `exponent_product`');
$ar = new expAjaxReply(200, gt('Here\'s the items you wanted'), $res);
$ar->send();
} | Base | 1 |
public function getQueryOrderby()
{
return $this->name;
} | Base | 1 |
$stmt->bindValue(":$field", $domain, SQLITE3_TEXT);
if($bindcomment) {
$stmt->bindValue(":comment", $comment, SQLITE3_TEXT);
}
if($stmt->execute() && $stmt->reset())
$num++;
else
{
$stmt->close();
if($returnnum)
return $num;
else
{
if($num === 1)
$plural = "";
else
$plural = "s";
return "Error: ".$db->lastErrorMsg().", added ".$num." domain".$plural;
}
}
}
// Close prepared statement and return number of processed rows
$stmt->close();
$db->exec("COMMIT;");
if($returnnum)
return $num;
else
{
$finalcount = intval($db->querySingle($countquery));
$modified = $finalcount - $initialcount;
// If we add less domains than the user specified, then they wanted to add duplicates
if($modified !== $num)
{
$delta = $num - $modified;
$extra = " (skipped ".$delta." duplicates)";
}
else
{
$extra = "";
}
if($num === 1)
$plural = "";
else
$plural = "s";
return "Success, added ".$modified." of ".$num." domain".$plural.$extra;
}
} | Class | 2 |
foreach ($val as $k => $v) {
unset($process[$key][$k]);
$stripTags = \in_array($k, $whiteList) ? false : $stripTagsConf;
if (\is_string($k)) {
$filteredKey = self::filterValue($k, $regex, $stripTags);
} else {
$filteredKey = $k;
}
if ($filteredKey === '' || $filteredKey === null) {
continue;
}
if (\is_array($v)) {
$process[$key][$filteredKey] = self::filterArrayValue($v, $regex, $stripTags);
continue;
}
if (\is_string($v)) {
$process[$key][$filteredKey] = self::filterValue($v, $regex, $stripTags);
continue;
}
$process[$key][$filteredKey] = $v;
} | Base | 1 |
protected function filter($files) {
foreach ($files as $i => $file) {
if (!empty($file['hidden']) || !$this->default->mimeAccepted($file['mime'])) {
unset($files[$i]);
}
}
return array_merge($files, array());
} | Base | 1 |
public static function editor($mode = 'light'){
$editor = Options::v('use_editor');
if($editor == 'on'){
$GLOBALS['editor'] = true;
}else{
$GLOBALS['editor'] = false;
}
if ($mode == 'light') {
$GLOBALS['editor_mode'] = 'light';
}else{
$GLOBALS['editor_mode'] = 'full';
}
//return $editor;
}
| Base | 1 |
function edit_section() {
global $db, $user;
$parent = new section($this->params['parent']);
if (empty($parent->id)) $parent->id = 0;
assign_to_template(array(
'haveStandalone' => ($db->countObjects('section', 'parent=-1') && $parent->id >= 0),
'parent' => $parent,
'isAdministrator' => $user->isAdmin(),
));
}
| Class | 2 |
public static function canImportData() {
return true;
}
| Base | 1 |
return $fa->nameGlyph($icons, 'icon-');
}
} else {
return array();
}
}
| Class | 2 |
public static function filesByMedia($media, $offset=0, $limit=-1, $wid=NULL, $text="", $orderby="date_added DESC, name ASC")
{
global $DB;
global $website;
if(empty($wid))
$wid = $website->id;
if($limit < 1)
$limit = 2147483647;
if(!empty($text))
$text = ' AND name LIKE '.protect('%'.$text.'%');
$DB->query(' SELECT SQL_CALC_FOUND_ROWS * FROM nv_files
WHERE type = '.protect($media).'
AND enabled = 1
AND website = '.$wid.'
'.$text.'
ORDER BY '.$orderby.'
LIMIT '.$limit.'
OFFSET '.$offset);
$total = $DB->foundRows();
$rows = $DB->result();
return array($rows, $total);
}
| Base | 1 |
foreach($image->expTag as $tag) {
if (isset($used_tags[$tag->id])) {
$used_tags[$tag->id]->count++;
} else {
$exptag = new expTag($tag->id);
$used_tags[$tag->id] = $exptag;
$used_tags[$tag->id]->count = 1;
}
} | Base | 1 |
public function actionGetItems(){
$sql = 'SELECT id, name as value FROM x2_opportunities WHERE name LIKE :qterm ORDER BY name ASC';
$command = Yii::app()->db->createCommand($sql);
$qterm = $_GET['term'].'%';
$command->bindParam(":qterm", $qterm, PDO::PARAM_STR);
$result = $command->queryAll();
echo CJSON::encode($result);
Yii::app()->end();
} | Class | 2 |
public function __viewIndex()
{
$this->setPageType('table');
$this->setTitle(__('%1$s – %2$s', array(__('Pages'), __('Symphony'))));
$nesting = Symphony::Configuration()->get('pages_table_nest_children', 'symphony') == 'yes';
if ($nesting && isset($_GET['parent']) && is_numeric($_GET['parent'])) {
$parent = PageManager::fetchPageByID((int)$_GET['parent'], array('title', 'id'));
}
$this->appendSubheading(isset($parent) ? $parent['title'] : __('Pages'), Widget::Anchor(
__('Create New'), Administration::instance()->getCurrentPageURL() . 'new/' . ($nesting && isset($parent) ? "?parent={$parent['id']}" : null),
__('Create a new page'), 'create button', null, array('accesskey' => 'c')
)); | Base | 1 |
public function activate_address()
{
global $db, $user;
$object = new stdClass();
$object->id = $this->params['id'];
$db->setUniqueFlag($object, 'addresses', $this->params['is_what'], "user_id=" . $user->id);
flash("message", gt("Successfully updated address."));
expHistory::back();
} | Base | 1 |
public function __construct(string $appName,
IRequest $request,
ITimeFactory $timeFactory,
IInitialState $initialState,
BookingService $bookingService,
AppointmentConfigService $appointmentConfigService,
URLGenerator $urlGenerator,
LoggerInterface $logger) {
parent::__construct($appName, $request);
$this->bookingService = $bookingService;
$this->timeFactory = $timeFactory;
$this->appointmentConfigService = $appointmentConfigService;
$this->initialState = $initialState;
$this->urlGenerator = $urlGenerator;
$this->logger = $logger;
} | Class | 2 |
function comments_list($params)
{
if (!user_can_access('module.comments.index')) {
return;
}
if (!isset($params['content_id'])) {
if (isset($params['rel_id']) and isset($params['rel_type'])) {
$data = array(
'rel_id' => $params['rel_id'],
'rel_type' => $params['rel_type'],
);
}
} else {
$data = array(
'content_id' => $params['content_id']
);
}
if (isset($params['search-keyword']) and $params['search-keyword']) {
$kw = $data['keyword'] = $params['search-keyword'];
$data['search_in_fields'] = 'comment_name,comment_body,comment_email,comment_website,from_url,comment_subject';
}
$data['order_by'] = 'created_at desc';
$comments = $postComments = get_comments($data);
if (isset($params['content_id'])) {
$content = get_content_by_id($params['content_id']);
$content_id = $params['content_id'];
} else {
$content = false;
$content_id = false;
}
$moderation_is_required = get_option('require_moderation', 'comments') == 'y';
$view_file = $this->views_dir . 'comments_list.php';
$view = new View($view_file);
$view->assign('params', $params);
$view->assign('comments', $comments);
$view->assign('content_id', $content_id);
$view->assign('content', $content);
$view->assign('moderation_is_required', $moderation_is_required);
return $view->display();
} | Base | 1 |
public function confirm()
{
$task = $this->getTask();
$subtask = $this->getSubtask();
$this->response->html($this->template->render('subtask/remove', array(
'subtask' => $subtask,
'task' => $task,
)));
} | Base | 1 |
public static function all()
{
global $DB;
global $website;
$DB->query('SELECT *
FROM nv_webuser_groups
WHERE website = '.protect($website->id));
return $DB->result();
}
| Base | 1 |
public function remove()
{
$this->checkCSRFParam();
$project = $this->getProject();
$swimlane_id = $this->request->getIntegerParam('swimlane_id');
if ($this->swimlaneModel->remove($project['id'], $swimlane_id)) {
$this->flash->success(t('Swimlane removed successfully.'));
} else {
$this->flash->failure(t('Unable to remove this swimlane.'));
}
$this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id'])));
} | Base | 1 |
public function configure() {
$this->config['defaultbanner'] = array();
if (!empty($this->config['defaultbanner_id'])) {
$this->config['defaultbanner'][] = new expFile($this->config['defaultbanner_id']);
}
parent::configure();
$banners = $this->banner->find('all', null, 'companies_id');
assign_to_template(array(
'banners'=>$banners,
'title'=>static::displayname()
));
} | Base | 1 |
public function safePath($filename = 'data.csv'){
return implode(DIRECTORY_SEPARATOR, array(
Yii::app()->basePath,
'data',
$filename
));
} | Class | 2 |
private function getTaskLink()
{
$link = $this->taskLinkModel->getById($this->request->getIntegerParam('link_id'));
if (empty($link)) {
throw new PageNotFoundException();
}
return $link;
} | Base | 1 |
public function testRenderWithTrustedHeaderDisabled()
{
Request::setTrustedHeaderName(Request::HEADER_CLIENT_IP, '');
$strategy = new InlineFragmentRenderer($this->getKernelExpectingRequest(Request::create('/')));
$this->assertSame('foo', $strategy->render('/', Request::create('/'))->getContent());
} | Class | 2 |
public static function name($id) {
$id = sprintf('%d', $id);
if(isset($id)){
$cat = Db::result("SELECT `name` FROM `cat`
WHERE `id` = '{$id}' LIMIT 1");
//print_r($cat);
if(isset($cat['error'])){
return '';
}else{
return $cat[0]->name;
}
}else{
echo "No ID Selected";
}
//print_r($cat);
}
| Base | 1 |
function PMA_getErrorReportForm()
{
$html = "";
$html .= '<form action="error_report.php" method="post" name="report_frm"'
. ' id="report_frm" class="ajax">'
. '<fieldset style="padding-top:0px">';
$html .= '<p>' . __(
'phpMyAdmin has encountered an error. We have collected data about'
. ' this error as well as information about relevant configuration'
. ' settings to send to the phpMyAdmin team to help us in'
. ' debugging the problem.'
) . '</p>';
$html .= '<div class="label"><label><p>'
. __('You may examine the data in the error report:')
. '</p></label></div>'
. '<pre class="report-data">'
. PMA_getReportData()
. '</pre>';
$html .= '<div class="label"><label><p>'
. __('Please explain the steps that lead to the error:')
. '</p></label></div>'
. '<textarea class="report-description" name="description"'
. 'id="report_description"></textarea>';
$html .= '<input type="checkbox" name="always_send"'
. ' id="always_send_checkbox"/>'
. '<label for="always_send_checkbox">'
. __('Automatically send report next time')
. '</label>';
$html .= '</fieldset>';
$html .= PMA_URL_getHiddenInputs();
$reportData = PMA_getReportData(false);
if (! empty($reportData)) {
$html .= PMA_getHiddenFields($reportData);
}
$html .= '</form>';
return $html;
} | Base | 1 |
public function toolbar() {
// global $user;
$menu = array();
$dirs = array(
BASE.'framework/modules/administration/menus',
BASE.'themes/'.DISPLAY_THEME.'/modules/administration/menus'
);
foreach ($dirs as $dir) {
if (is_readable($dir)) {
$dh = opendir($dir);
while (($file = readdir($dh)) !== false) {
if (substr($file,-4,4) == '.php' && is_readable($dir.'/'.$file) && is_file($dir.'/'.$file)) {
$menu[substr($file,0,-4)] = include($dir.'/'.$file);
if (empty($menu[substr($file,0,-4)])) unset($menu[substr($file,0,-4)]);
}
}
}
}
// sort the top level menus alphabetically by filename
ksort($menu);
$sorted = array();
foreach($menu as $m) $sorted[] = $m;
// slingbar position
if (isset($_COOKIE['slingbar-top'])){
$top = $_COOKIE['slingbar-top'];
} else {
$top = SLINGBAR_TOP;
}
assign_to_template(array(
'menu'=>(bs3()) ? $sorted : json_encode($sorted),
"top"=>$top
));
} | Base | 1 |
public function actionGetItems(){
$sql = 'SELECT id, name as value FROM x2_docs WHERE name LIKE :qterm ORDER BY name ASC';
$command = Yii::app()->db->createCommand($sql);
$qterm = '%'.$_GET['term'].'%';
$command->bindParam(":qterm", $qterm, PDO::PARAM_STR);
$result = $command->queryAll();
echo CJSON::encode($result); exit;
} | Base | 1 |
public static function client()
{
if (is_null(self::$client)) new CertificateAuthenticate();
return self::$client;
} | Base | 1 |
public static function rss() {
switch (SMART_URL) {
case true:
# code...
$inFold = (Options::v('permalink_use_index_php') == "on")? "/index.php":"";
$url = Site::$url.$inFold."/rss".GX_URL_PREFIX;
break;
default:
# code...
$url = Site::$url."/index.php?rss";
break;
}
return $url;
}
| Base | 1 |
function build_daterange_sql($timestamp, $endtimestamp=null, $field='date', $multiday=false) {
if (empty($endtimestamp)) {
$date_sql = "((".$field." >= " . expDateTime::startOfDayTimestamp($timestamp) . " AND ".$field." <= " . expDateTime::endOfDayTimestamp($timestamp) . ")";
} else {
$date_sql = "((".$field." >= " . expDateTime::startOfDayTimestamp($timestamp) . " AND ".$field." <= " . expDateTime::endOfDayTimestamp($endtimestamp) . ")";
}
if ($multiday)
$date_sql .= " OR (" . expDateTime::startOfDayTimestamp($timestamp) . " BETWEEN ".$field." AND dateFinished)";
$date_sql .= ")";
return $date_sql;
}
| Class | 2 |
protected function setUp()
{
parent::setUp();
$mongoClass = version_compare(phpversion('mongo'), '1.3.0', '<') ? 'Mongo' : 'MongoClient';
$this->mongo = $this->getMockBuilder($mongoClass)
->disableOriginalConstructor()
->getMock();
$this->options = array(
'id_field' => '_id',
'data_field' => 'data',
'time_field' => 'time',
'expiry_field' => 'expires_at',
'database' => 'sf2-test',
'collection' => 'session-test',
);
$this->storage = new MongoDbSessionHandler($this->mongo, $this->options);
} | Base | 1 |
$q = self::query($sql);
}
return true;
}
| Base | 1 |
function db_seq_nextval($seqname)
{
global $DatabaseType;
if ($DatabaseType == 'mysqli')
$seq = "fn_" . strtolower($seqname) . "()";
return $seq;
} | Base | 1 |
public function editTitle() {
global $user;
$file = new expFile($this->params['id']);
if ($user->id==$file->poster || $user->isAdmin()) {
$file->title = $this->params['newValue'];
$file->save();
$ar = new expAjaxReply(200, gt('Your title was updated successfully'), $file);
} else {
$ar = new expAjaxReply(300, gt("You didn't create this file, so you can't edit it."));
}
$ar->send();
} | Class | 2 |
public function read($sessionId)
{
$dbData = $this->getCollection()->findOne(array(
$this->options['id_field'] => $sessionId,
$this->options['expiry_field'] => array('$gte' => new \MongoDate()),
));
return null === $dbData ? '' : $dbData[$this->options['data_field']]->bin;
} | Base | 1 |
function load_gallery($auc_id)
{
$UPLOADED_PICTURES = array();
if (is_dir(UPLOAD_PATH . $auc_id)) {
if ($dir = opendir(UPLOAD_PATH . $auc_id)) {
while ($file = @readdir($dir)) {
if ($file != '.' && $file != '..' && strpos($file, 'thumb-') === false) {
$UPLOADED_PICTURES[] = UPLOAD_FOLDER . $auc_id . '/' . $file;
}
}
closedir($dir);
}
}
return $UPLOADED_PICTURES;
} | Base | 1 |
foreach($fields as $field)
{
if(substr($key, 0, strlen($field.'-'))==$field.'-')
{
$this->dictionary[substr($key, strlen($field.'-'))][$field] = $value;
}
}
| Base | 1 |
public function searchAdmin(){
$criteria = new CDbCriteria;
return $this->searchBase($criteria);
} | Base | 1 |
public function checkForReassign($operator)
{
$operator_name = ($this->locale == get_home_locale())
? $operator['vclocalename']
: $operator['vccommonname'];
$is_operator_correct = $this->nextAgent == $operator['operatorid']
|| $this->agentId == $operator['operatorid'];
if ($this->state == self::STATE_WAITING && $is_operator_correct) {
// Prepare message
if ($this->nextAgent == $operator['operatorid']) {
$message_to_post = getlocal(
"Operator <strong>{0}</strong> changed operator <strong>{1}</strong>",
array($operator_name, $this->agentName),
$this->locale,
true
);
} else {
$message_to_post = getlocal(
"Operator {0} is back",
array($operator_name),
$this->locale,
true
);
}
// Update thread info
$this->state = self::STATE_CHATTING;
$this->nextAgent = 0;
$this->agentId = $operator['operatorid'];
$this->agentName = $operator_name;
$this->save();
// Send messages
$this->postMessage(self::KIND_EVENTS, $message_to_post);
}
} | Base | 1 |
public function __construct()
{
parent::__construct();
$this->middleware(
static function ($request, $next) {
app('view')->share('title', (string)trans('firefly.transactions'));
app('view')->share('mainTitleIcon', 'fa-exchange');
return $next($request);
}
);
} | Compound | 4 |
function GoodAuthDigestTestController($serverPort) {
$args = array('Authorization' => 'Digest username="admin", ' .
'realm="Restricted area", nonce="564a12611dae8", ' .
'uri="/test_auth_digest.php", cnonce="MjIyMTg1", nc=00000001, ' .
'qop="auth", response="e544aaed06917adea3e5c74dd49f0e32", ' .
'opaque="cdce8a5c95a1427d74df7acbf41c9ce0"');
var_dump(request(php_uname('n'), $serverPort, "test_auth_digest.php",
[], [], $args));
} | Class | 2 |
$section = new section(intval($page));
if ($section) {
// self::deleteLevel($section->id);
$section->delete();
}
}
}
| Class | 2 |
protected function itemLock($hashes, $autoUnlock = true)
{
if (!elFinder::$commonTempPath) {
return;
}
if (!is_array($hashes)) {
$hashes = array($hashes);
}
foreach ($hashes as $hash) {
$lock = elFinder::$commonTempPath . DIRECTORY_SEPARATOR . $hash . '.lock';
if ($this->itemLocked($hash)) {
$cnt = file_get_contents($lock) + 1;
} else {
$cnt = 1;
}
if (file_put_contents($lock, $cnt, LOCK_EX)) {
if ($autoUnlock) {
$this->autoUnlocks[] = $hash;
}
}
}
} | Base | 1 |
public function update()
{
$project = $this->getProject();
$tag_id = $this->request->getIntegerParam('tag_id');
$tag = $this->tagModel->getById($tag_id);
$values = $this->request->getValues();
list($valid, $errors) = $this->tagValidator->validateModification($values);
if ($tag['project_id'] != $project['id']) {
throw new AccessForbiddenException();
}
if ($valid) {
if ($this->tagModel->update($values['id'], $values['name'])) {
$this->flash->success(t('Tag updated successfully.'));
} else {
$this->flash->failure(t('Unable to update this tag.'));
}
$this->response->redirect($this->helper->url->to('ProjectTagController', 'index', array('project_id' => $project['id'])));
} else {
$this->edit($values, $errors);
}
} | Base | 1 |
function updateObject($object, $table, $where=null, $identifier='id', $is_revisioned=false) {
if ($is_revisioned) {
$object->revision_id++;
//if ($table=="text") eDebug($object);
$res = $this->insertObject($object, $table);
//if ($table=="text") eDebug($object,true);
$this->trim_revisions($table, $object->$identifier, WORKFLOW_REVISION_LIMIT);
return $res;
}
$sql = "UPDATE " . $this->prefix . "$table SET ";
foreach (get_object_vars($object) as $var => $val) {
//We do not want to save any fields that start with an '_'
//if($is_revisioned && $var=='revision_id') $val++;
if ($var{0} != '_') {
if (is_array($val) || is_object($val)) {
$val = serialize($val);
$sql .= "`$var`='".$val."',";
} else {
$sql .= "`$var`='" . $this->escapeString($val) . "',";
}
}
}
$sql = substr($sql, 0, -1) . " WHERE ";
if ($where != null)
$sql .= $this->injectProof($where);
else
$sql .= "`" . $identifier . "`=" . $object->$identifier;
//if ($table == 'text') eDebug($sql,true);
$res = (@mysqli_query($this->connection, $sql) != false);
return $res;
} | Base | 1 |
function fopen($filename, $mode)
{
if (\yiiunit\framework\base\SecurityTest::$fopen !== null) {
return \yiiunit\framework\base\SecurityTest::$fopen;
}
return \fopen($filename, $mode);
} | Class | 2 |
public function write($template = '')
{
if (!empty($this->script_files)) {
$this->set_env('request_token', $this->app->get_request_token());
}
$commands = $this->get_js_commands($framed);
// if all js commands go to parent window we can ignore all
// script files and skip rcube_webmail initialization (#1489792)
if ($framed) {
$this->scripts = array();
$this->script_files = array();
$this->header = '';
$this->footer = '';
}
// write all javascript commands
$this->add_script($commands, 'head_top');
// send clickjacking protection headers
$iframe = $this->framed || $this->env['framed'];
if (!headers_sent() && ($xframe = $this->app->config->get('x_frame_options', 'sameorigin'))) {
header('X-Frame-Options: ' . ($iframe && $xframe == 'deny' ? 'sameorigin' : $xframe));
} | Compound | 4 |
$contents = ['form' => tep_draw_form('rates', 'tax_rates.php', 'page=' . $_GET['page'] . '&action=insert')]; | Base | 1 |
$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('specials.php', 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id), null, null, 'btn-light')]; | Base | 1 |
public function contactInformationSave(Request $request) {
session_append_array('checkout_v2', [
'first_name'=> $request->get('first_name'),
'last_name'=> $request->get('last_name'),
'email'=> $request->get('email'),
'phone'=> $request->get('phone')
]);
$validate = $this->_validateContactInformation($request->all());
if ($validate['valid'] == false) {
session_set('errors', $validate['errors']);
return redirect(route('checkout.contact_information'));
}
// Success
return redirect(route('checkout.shipping_method'));
} | Base | 1 |
public function __construct() {
global $GLOBALS, $data;
self::$editors =& $GLOBALS;
self::$data =& $data;
self::$url = Options::v('siteurl');
self::$domain = Options::v('sitedomain');
self::$name = Options::v('sitename');
self::$key = Options::v('sitekeywords');
self::$desc = Options::v('sitedesc');
self::$email = Options::v('siteemail');
self::$slogan = Options::v('siteslogan');
}
| Base | 1 |
$p = $vars['paging']-(ceil($maxpage/2)-1);
$limit = $curr+ceil($maxpage/2)-1;
// echo "more maxpage";
}else{
$p = $vars['paging']-(ceil($maxpage/2)-1);
$limit = $curr + floor($maxpage/2);
}
for ($i=$p ; $i <= $limit /*ceil($total/$vars['max'])+1*/ ; $i++ ) {
# code...
if($smart == true){
$url = $vars['url']."/paging/".$i;
}else{
$url = $vars['url']."&paging=".$i;
}
if($vars['paging'] == $i){ $sel = "class=\"active\"";}else{$sel='';}
$r .= "<li {$sel}><a href=\"{$url}\">$i</a></li>";
}
$r .= "</ul>";
}elseif(isset($vars['type']) && $vars['type'] == 'pager'){ // PAGER
| Base | 1 |
public function save()
{
$project = $this->getProject();
$values = $this->request->getValues();
list($valid, $errors) = $this->categoryValidator->validateCreation($values);
if ($valid) {
if ($this->categoryModel->create($values) !== false) {
$this->flash->success(t('Your category have been created successfully.'));
$this->response->redirect($this->helper->url->to('CategoryController', 'index', array('project_id' => $project['id'])), true);
return;
} else {
$errors = array('name' => array(t('Another category with the same name exists in this project')));
}
}
$this->create($values, $errors);
} | Base | 1 |
public function Recipient($to) {
$this->error = null; // so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Recipient() without being connected");
return false;
}
fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
$this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
}
if($code != 250 && $code != 251) {
$this->error =
array("error" => "RCPT not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
}
return false;
}
return true;
} | Class | 2 |
public function withPort($port)
{
$port = $this->filterPort($this->scheme, $this->host, $port);
if ($this->port === $port) {
return $this;
}
$new = clone $this;
$new->port = $port;
return $new;
} | Base | 1 |
function __construct()
{
# code...
self::$smtphost = Options::get('smtphost');
self::$smtpuser = Options::get('smtpuser');
self::$smtppass = Options::get('smtppass');
self::$smtpssl = Options::get('smtpssl');
self::$siteemail = Options::get('siteemail');
self::$sitename = Options::get('sitename');
} | Base | 1 |
public function save()
{
if(!empty($this->id))
return $this->update();
else
return $this->insert();
}
| Base | 1 |
function move_standalone() {
expSession::clearAllUsersSessionCache('navigation');
assign_to_template(array(
'parent' => $this->params['parent'],
));
}
| Base | 1 |
protected function getSubtask()
{
$subtask = $this->subtaskModel->getById($this->request->getIntegerParam('subtask_id'));
if (empty($subtask)) {
throw new PageNotFoundException();
}
return $subtask;
} | Base | 1 |
static public function customerHasTickets($_cid = 0) {
if ($_cid != 0) {
$result_stmt = Database::prepare("
SELECT `id` FROM `" . TABLE_PANEL_TICKETS . "` WHERE `customerid` = :cid"
);
Database::pexecute($result_stmt, array('cid' => $_cid));
$tickets = array();
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
$tickets[] = $row['id'];
}
return $tickets;
}
return false;
} | Class | 2 |
public function save()
{
$project = $this->getProject();
$values = $this->request->getValues();
list($valid, $errors) = $this->categoryValidator->validateCreation($values);
if ($valid) {
if ($this->categoryModel->create($values) !== false) {
$this->flash->success(t('Your category have been created successfully.'));
$this->response->redirect($this->helper->url->to('CategoryController', 'index', array('project_id' => $project['id'])), true);
return;
} else {
$errors = array('name' => array(t('Another category with the same name exists in this project')));
}
}
$this->create($values, $errors);
} | Base | 1 |
public function approve_toggle() {
global $history;
if (empty($this->params['id'])) return;
/* The global constants can be overriden by passing appropriate params */
//sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet
$require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : $this->params['require_login'];
$require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : $this->params['require_approval'];
$require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : $this->params['require_notification'];
$notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : $this->params['notification_email'];
$simplenote = new expSimpleNote($this->params['id']);
$simplenote->approved = $simplenote->approved == 1 ? 0 : 1;
$simplenote->save();
$lastUrl = makelink($history->history[$history->history['lasts']['type']][count($history->history[$history->history['lasts']['type']])-1]['params']);
if (!empty($this->params['tab']))
{
$lastUrl .= "#".$this->params['tab'];
}
redirect_to($lastUrl);
} | Base | 1 |
$src = substr($ref->source, strlen($prefix)) . $section->id;
if (call_user_func(array($ref->module, 'hasContent'))) {
$oloc = expCore::makeLocation($ref->module, $ref->source);
$nloc = expCore::makeLocation($ref->module, $src);
if ($ref->module != "container") {
call_user_func(array($ref->module, 'copyContent'), $oloc, $nloc);
} else {
call_user_func(array($ref->module, 'copyContent'), $oloc, $nloc, $section->id);
}
}
}
| Base | 1 |
public function remove()
{
$this->checkCSRFParam();
$project = $this->getProject();
$filter = $this->customFilterModel->getById($this->request->getIntegerParam('filter_id'));
$this->checkPermission($project, $filter);
if ($this->customFilterModel->remove($filter['id'])) {
$this->flash->success(t('Custom filter removed successfully.'));
} else {
$this->flash->failure(t('Unable to remove this custom filter.'));
}
$this->response->redirect($this->helper->url->to('CustomFilterController', 'index', array('project_id' => $project['id'])));
} | Class | 2 |
public function breadcrumb() {
global $sectionObj;
expHistory::set('viewable', $this->params);
$id = $sectionObj->id;
$current = null;
// Show not only the location of a page in the hierarchy but also the location of a standalone page
$current = new section($id);
if ($current->parent == -1) { // standalone page
$navsections = section::levelTemplate(-1, 0);
foreach ($navsections as $section) {
if ($section->id == $id) {
$current = $section;
break;
}
}
} else {
$navsections = section::levelTemplate(0, 0);
foreach ($navsections as $section) {
if ($section->id == $id) {
$current = $section;
break;
}
}
}
assign_to_template(array(
'sections' => $navsections,
'current' => $current,
));
}
| Base | 1 |
public static function setTransactionPart(Db $zdb, $trans_id, $contrib_id)
{
try {
$update = $zdb->update(self::TABLE);
$update->set(
array(Transaction::PK => $trans_id)
)->where(self::PK . ' = ' . $contrib_id);
$zdb->execute($update);
return true;
} catch (Throwable $e) {
Analog::log(
'Unable to attach contribution #' . $contrib_id .
' to transaction #' . $trans_id . ' | ' . $e->getMessage(),
Analog::ERROR
);
throw $e;
}
} | Base | 1 |
public function delete() {
global $db;
/* The global constants can be overriden by passing appropriate params */
//sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet
// $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login'];
// $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval'];
// $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification'];
// $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email'];
if (empty($this->params['id'])) {
flash('error', gt('Missing id for the comment you would like to delete'));
expHistory::back();
}
// delete the comment
$comment = new expComment($this->params['id']);
$comment->delete();
// delete the association too
$db->delete($comment->attachable_table, 'expcomments_id='.$this->params['id']);
// send the user back where they came from.
expHistory::back();
} | Base | 1 |
function update_option_master() {
global $db;
$id = empty($this->params['id']) ? null : $this->params['id'];
$opt = new option_master($id);
$oldtitle = $opt->title;
$opt->update($this->params);
// if the title of the master changed we should update the option groups that are already using it.
if ($oldtitle != $opt->title) {
}$db->sql('UPDATE '.$db->prefix.'option SET title="'.$opt->title.'" WHERE option_master_id='.$opt->id);
expHistory::back();
} | Base | 1 |
public function read($source) {
$source = $this->escapePath($source);
// close the single quote, open a double quote where we put the single quote...
$source = str_replace('\'', '\'"\'"\'', $source);
// since returned stream is closed by the caller we need to create a new instance
// since we can't re-use the same file descriptor over multiple calls
$command = sprintf('%s --authentication-file=/proc/self/fd/3 //%s/%s -c \'get %s /proc/self/fd/5\'',
Server::CLIENT,
$this->server->getHost(),
$this->name,
$source
);
$connection = new Connection($command);
$connection->writeAuthentication($this->server->getUser(), $this->server->getPassword());
$fh = $connection->getFileOutputStream();
stream_context_set_option($fh, 'file', 'connection', $connection);
return $fh;
} | Base | 1 |
$dplArg = $this->wgRequest->getVal( $arg, '' );
if ( $dplArg == '' ) {
$input = preg_replace( '/\{%' . $arg . ':(.*)%\}/U', '\1', $input );
$input = str_replace( '{%' . $arg . '%}', '', $input );
} else {
$input = preg_replace( '/\{%' . $arg . ':.*%\}/U ', $dplArg, $input );
$input = str_replace( '{%' . $arg . '%}', $dplArg, $input );
}
}
return $input;
} | Class | 2 |
$resultItem['qtip'] = $item->getDescription() ? $item->getDescription() : ' ';
$result[] = $resultItem;
}
return $this->adminJson($result);
} | Base | 1 |
public function enqueue_scripts() {
global $geo_mashup_options, $pagenow, $post;
// The location editor works only on posts
if ( empty( $post ) )
return null;
$load_location_editor = (
is_admin() and
preg_match( '/(post|page)(-new|).php/', $pagenow ) and
in_array( $post->post_type, $geo_mashup_options->get( 'overall', 'located_post_types' ) )
);
$load_location_editor = apply_filters( 'geo_mashup_load_location_editor', $load_location_editor );
// If we're on a post editing page, queue up the form interface elements
if ( $load_location_editor ) {
$this->enqueue_form_client_items();
}
}
| Class | 2 |
function fm_get_size($file)
{
static $iswin;
static $isdarwin;
if (!isset($iswin)) {
$iswin = (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN');
}
if (!isset($isdarwin)) {
$isdarwin = (strtoupper(substr(PHP_OS, 0)) == "DARWIN");
}
static $exec_works;
if (!isset($exec_works)) {
$exec_works = (function_exists('exec') && !ini_get('safe_mode') && @exec('echo EXEC') == 'EXEC');
}
// try a shell command
if ($exec_works) {
$cmd = ($iswin) ? "for %F in (\"$file\") do @echo %~zF" : ($isdarwin ? "stat -f%z \"$file\"" : "stat -c%s \"$file\"");
@exec($cmd, $output);
if (is_array($output) && ctype_digit($size = trim(implode("\n", $output)))) {
return $size;
}
}
// try the Windows COM interface
if ($iswin && class_exists("COM")) {
try {
$fsobj = new COM('Scripting.FileSystemObject');
$f = $fsobj->GetFile( realpath($file) );
$size = $f->Size;
} catch (Exception $e) {
$size = null;
}
if (ctype_digit($size)) {
return $size;
}
}
// if all else fails
return filesize($file);
} | Base | 1 |
public static function go($input, $path, $allowed='', $uniq=false, $size='', $width = '', $height = ''){
$filename = Typo::cleanX($_FILES[$input]['name']);
$filename = str_replace(' ', '_', $filename);
if(isset($_FILES[$input]) && $_FILES[$input]['error'] == 0){
if($uniq == true){
$uniqfile = sha1(microtime().$filename);
}else{
$uniqfile = '';
}
$extension = pathinfo($_FILES[$input]['name'], PATHINFO_EXTENSION);
$filetmp = $_FILES[$input]['tmp_name'];
$filepath = GX_PATH.$path.$uniqfile.$filename;
if(!in_array(strtolower($extension), $allowed)){
$result['error'] = 'File not allowed';
}else{
if(move_uploaded_file(
$filetmp,
$filepath)
){
$result['filesize'] = filesize($filepath);
$result['filename'] = $uniqfile.$filename;
$result['path'] = $path.$uniqfile.$filename;
$result['filepath'] = $filepath;
$result['fileurl'] = Options::get('siteurl').$path.$uniqfile.$filename;
}else{
$result['error'] = 'Cannot upload to directory, please check
if directory is exist or You had permission to write it.';
}
}
}else{
//$result['error'] = $_FILES[$input]['error'];
$result['error'] = '';
}
return $result;
} | Compound | 4 |
$this->paths[substr($key, strlen('path-'))] = $value;
}
| Base | 1 |
public function getList($location, $features, $etag, $mediatypes) {
$featuresArray = explode(';', $features);
$mediaTypesArray = explode(';', $mediatypes);
try {
return $this->getFilesAndAlbums($location, $featuresArray, $etag, $mediaTypesArray);
} catch (\Exception $exception) {
return $this->jsonError($exception);
}
} | Base | 1 |
public function remove()
{
$project = $this->getProject();
$this->checkCSRFParam();
$column_id = $this->request->getIntegerParam('column_id');
if ($this->columnModel->remove($column_id)) {
$this->flash->success(t('Column removed successfully.'));
} else {
$this->flash->failure(t('Unable to remove this column.'));
}
$this->response->redirect($this->helper->url->to('ColumnController', 'index', array('project_id' => $project['id'])));
} | Base | 1 |
public static function ajax ($vars="", $val='') {
if( isset($vars) && $vars != "" ) {
$file = GX_PATH.'/inc/lib/Control/Ajax/'.$vars.'-ajax.control.php';
if (file_exists($file)) {
include($file);
}else {
self::error('404');
}
}
}
| Base | 1 |
function edit_externalalias() {
$section = isset($this->params['id']) ? $this->section->find($this->params['id']) : new section($this->params);
if ($section->parent == -1) {
notfoundController::handle_not_found();
exit;
} // doesn't work for standalone pages
if (empty($section->id)) {
$section->public = 1;
if (!isset($section->parent)) {
// This is another precaution. The parent attribute
// should ALWAYS be set by the caller.
//FJD - if that's the case, then we should die.
notfoundController::handle_not_authorized();
exit;
//$section->parent = 0;
}
}
assign_to_template(array(
'section' => $section,
'glyphs' => self::get_glyphs(),
));
}
| Base | 1 |
public function confirm()
{
$task = $this->getTask();
$comment = $this->getComment();
$this->response->html($this->template->render('comment/remove', array(
'comment' => $comment,
'task' => $task,
'title' => t('Remove a comment')
)));
} | Class | 2 |
$method = $this->request->get('_method', $this->query->get('_method', 'POST'));
if (\is_string($method)) {
$this->method = strtoupper($method);
}
}
}
} | Base | 1 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.