403Webshell
Server IP : 195.130.67.5  /  Your IP : 216.73.217.154
Web Server : Microsoft-IIS/10.0
System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586
User : IUSR ( 0)
PHP Version : 7.4.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/inetpub/wwwroot/business/sites/all/modules/ctools/plugins/contexts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/inetpub/wwwroot/business/sites/all/modules/ctools/plugins/contexts/query_string.inc
<?php

/**
 * @file
 * Context plugin that can extract arbitrary values from the query string.
 */

/**
 * $plugin array which will be used by the system that includes this file.
 */
$plugin = array(
  'title' => t('Query string value'),
  'description' => t('A context that extracts a value from the query string.'),
  'context' => 'ctools_context_query_string_create_query_string',
  'context name' => 'query_string',
  'keyword' => 'query_string',
  'edit form' => 'ctools_context_query_string_settings_form',
  'convert list' => array(
    'raw' => t('Raw string'),
    'html_safe' => t('HTML-safe string'),
  ),
  'convert' => 'ctools_context_query_string_convert',
);

/**
 * Create a context from manual configuration.
 */
function ctools_context_query_string_create_query_string($empty, $data = NULL, $conf = FALSE) {
  $context = new ctools_context('query_string');
  $context->plugin = 'query_string';

  if ($empty) {
    return $context;
  }

  if ($conf) {
    if (!empty($_GET[$data['key']])) {
      $context->data = $_GET[$data['key']];
    }
    else {
      $context->data = $data['fallback_value'];
    }
  }
  return $context;
}

/**
 * Form builder; settings for the context.
 */
function ctools_context_query_string_settings_form($form, &$form_state) {
  $form['key'] = array(
    '#title' => t('Query string key'),
    '#description' => t('Enter the key of the value that must be returned from the query string.'),
    '#type' => 'textfield',
    '#required' => TRUE,
  );
  if (isset($form_state['conf']['key'])) {
    $form['key']['#default_value'] = $form_state['conf']['key'];
  }
  $form['fallback_value'] = array(
    '#title' => t('Fallback value'),
    '#description' => t('Enter a value that must be returned if the above specified key does not exist in the query string.'),
    '#type' => 'textfield',
  );
  if (!empty($form_state['conf']['fallback_value'])) {
    $form['fallback_value']['#default_value'] = $form_state['conf']['fallback_value'];
  }
  return $form;
}

/**
 * Submit handler; settings form for the context.
 */
function ctools_context_query_string_settings_form_submit($form, &$form_state) {
  $form_state['conf']['key'] = $form_state['values']['key'];
  $form_state['conf']['fallback_value'] = $form_state['values']['fallback_value'];
}

/**
 * Convert a context into a string.
 */
function ctools_context_query_string_convert($context, $type) {
  switch ($type) {
    case 'raw':
      return $context->data;

    case 'html_safe':
      return check_plain($context->data);
  }
}

Youez - 2016 - github.com/yon3zu
LinuXploit