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 :  /inetpub/wwwroot/business/ttt/ctools/plugins/content_types/comment/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /inetpub/wwwroot/business/ttt/ctools/plugins/content_types/comment/comment_links.inc
<?php

/**
 * @file
 * Plugins are described by creating a $plugin array which will be used
 * by the system that includes this file.
 */

$plugin = array(
  'single' => TRUE,
  'title' => t('Comment links'),
  'icon' => 'icon_comment.png',
  'description' => t('Comment links of the referenced comment.'),
  'required context' => new ctools_context_required(t('Comment'), 'entity:comment'),
  'category' => t('Comment'),
  'defaults' => array(
    'override_title' => FALSE,
    'override_title_text' => '',
    'build_mode' => '',
  ),
);

/**
 * Output function for the comment links.
 */
function ctools_comment_links_content_type_render($subtype, $conf, $panel_args, $context) {
  if (!empty($context) && empty($context->data)) {
    return;
  }

  $comment = isset($context->data) ? clone $context->data : NULL;
  $block = new stdClass();
  $block->module = 'comment';
  $block->delta = $comment->cid;

  if (empty($comment)) {
    $block->delta   = 'placeholder';
    $block->subject = t('Comment subject.');
    $block->content = t('Comment links go here.');
  }
  else {
    $node = node_load($comment->nid);
    $block->subject = $comment->subject;
    comment_build_content($comment, $node, $conf['build_mode']);
    $block->content = $comment->content['links'];
  }
  return $block;
}

/**
 * Returns an edit form for the custom type.
 */
function ctools_comment_links_content_type_edit_form($form, &$form_state) {
  $conf = $form_state['conf'];

  $entity = entity_get_info('comment');
  $build_mode_options = array();
  foreach ($entity['view modes'] as $mode => $option) {
    $build_mode_options[$mode] = $option['label'];
  }

  $form['build_mode'] = array(
    '#title' => t('Build mode'),
    '#type' => 'select',
    '#description' => t('Select a build mode for this comment.'),
    '#options' => $build_mode_options,
    '#default_value' => $conf['build_mode'],
  );

  return $form;
}

function ctools_comment_links_content_type_edit_form_submit($form, &$form_state) {
  // Copy everything from our defaults.
  foreach (array_keys($form_state['plugin']['defaults']) as $key) {
    $form_state['conf'][$key] = $form_state['values'][$key];
  }
}

function ctools_comment_links_content_type_admin_title($subtype, $conf, $context) {
  return t('"@s" links', array('@s' => $context->identifier));
}

Youez - 2016 - github.com/yon3zu
LinuXploit