<?php

$view = views_get_current_view();
if ($view->name == 'agency_wise_report') {
    $footer = '';
    $footer .= '<tr><td class="ds-list-head-new  ds-list-head-btm-left" style="padding-left:20px;">Total</td><td></td><td></td><td></td>';
    $cat = array('catalog_type_raw_data', 'catalog_type_document', 'catalog_type_data_apps', 'catalog_type_data_tools', 'catalog_type_data_service');
    for ($i = 0; $i < 5; $i++) {
        $footer .= '<td class="ds-list-item-new-summary" >';
        $result = db_query("SELECT count(distinct ds.nid) as cnt FROM content_type_dataset ds INNER JOIN content_type_agency a ON ds.field_ds_agency_name_nid = a.nid INNER JOIN workflow_node WF On WF.nid=ds.nid WHERE ds.field_ds_catlog_type_type ='{$cat[$i]}' AND WF.sid=10");
        $val = db_query("SELECT count(distinct ds.nid) as cnt  FROM  content_type_dataset ds INNER JOIN content_type_agency a ON ds.field_ds_agency_name_nid = a.nid INNER JOIN content_type_policy_program_open_government ppog ON ds.nid=ppog.nid  INNER JOIN workflow_node WF On WF.nid=ds.nid  where ( ds.field_ds_catlog_type_type ='{$cat[$i]}')  AND ppog.field_ppog_high_value_dataset_value='Yes' AND WF.sid=10 ");
        if ($row = mysql_fetch_object($result)) {
            $total = $row->cnt;
        }
        if ($high = mysql_fetch_object($val)) {
            $val = $high->cnt;
        }
        if ($val != 0) {
            $footer .= $total . '&nbsp;(' . $val . ')';
        } else {
            $footer .= $total;
        }
        $footer .= '</td>';
    }
    $footer .= '<td class="ds-list-item-new-summary" >';
    $result = db_query("SELECT count(distinct ds.nid) as cnt FROM content_type_dataset ds INNER JOIN content_type_agency a ON ds.field_ds_agency_name_nid = a.nid INNER JOIN workflow_node WF On WF.nid=ds.nid where ds.field_ds_catlog_type_type IS NOT NULL AND WF.sid=10");
    $val = db_query("SELECT count(distinct ds.nid) as cnt  FROM  content_type_dataset ds INNER JOIN content_type_agency a ON ds.field_ds_agency_name_nid = a.nid INNER JOIN content_type_policy_program_open_government ppog ON ds.nid=ppog.nid  INNER JOIN workflow_node WF On WF.nid=ds.nid where ppog.field_ppog_high_value_dataset_value='Yes' AND ds.field_ds_catlog_type_type IS NOT NULL AND WF.sid=10");
    if ($row = mysql_fetch_object($result)) {
        $total = $row->cnt;
    }
    if ($high = mysql_fetch_object($val)) {
示例#2
0
 /**
  * Run attachments and let the display do what it needs to do prior
  * to running.
  */
 public function preExecute($args = array())
 {
     $this->old_view[] = views_get_current_view();
     views_set_current_view($this);
     $display_id = $this->current_display;
     // Prepare the view with the information we have, but only if we were
     // passed arguments, as they may have been set previously.
     if ($args) {
         $this->setArguments($args);
     }
     // Let modules modify the view just prior to executing it.
     \Drupal::moduleHandler()->invokeAll('views_pre_view', array($this, $display_id, &$this->args));
     // Allow hook_views_pre_view() to set the dom_id, then ensure it is set.
     $this->dom_id = !empty($this->dom_id) ? $this->dom_id : hash('sha256', $this->storage->id() . REQUEST_TIME . mt_rand());
     // Allow the display handler to set up for execution
     $this->display_handler->preExecute();
 }
示例#3
0
/**
 * Implementation of hook_preprocess_user_picture().
 */
function ginkgo_preprocess_user_picture(&$vars)
{
    $account = $vars['account'];
    if (isset($account->picture) && module_exists('imagecache')) {
        $attr = array('class' => 'user-picture');
        $preset = variable_get('seed_imagecache_user_picture', '30x30_crop');
        if ($view = views_get_current_view()) {
            switch ($view->name) {
                case 'og_members_faces':
                case 'atrium_members':
                case 'atrium_profile':
                    $preset = 'user-m';
                    break;
            }
        }
        $attr['class'] .= ' picture-' . $preset;
        if (file_exists($account->picture)) {
            $image = imagecache_create_url($preset, $account->picture);
            $attr['style'] = 'background-image: url(' . $image . ')';
        }
        $path = 'user/' . $account->uid;
        $vars['picture'] = l($account->name, $path, array('attributes' => $attr));
        $vars['preset'] = $preset;
    }
}
示例#4
0
function boinc_preprocess_views_view(&$vars, $hook)
{
    switch ($vars['name']) {
        case 'boinc_account_computers':
            switch ($vars['display_id']) {
                case 'page_1':
                case 'panel_pane_1':
                    $vars['empty'] = boincwork_views_host_list_empty_text();
                    break;
                case 'page_2':
                    $vars['empty'] = boincwork_views_host_list_empty_text('active');
                    break;
                case 'block_1':
                    $vars['empty'] = boincwork_views_host_list_empty_text('preferences');
                    break;
                default:
            }
            break;
        case 'boinc_account_tasks_all':
            $vars['empty'] = boincwork_views_task_list_empty_text();
            break;
        case 'boinc_friends':
            if ($vars['display_id'] == 'block_1') {
                $vars['header'] = boincuser_views_friends_block_header();
            }
            break;
        case 'boinc_host_list':
            if ($vars['display_id'] == 'page_2') {
                $vars['empty'] = boincwork_views_host_list_empty_text();
            } elseif ($vars['display_id'] == 'page_1') {
                $vars['empty'] = boincwork_views_host_list_empty_text('active');
            }
            break;
        case 'boinc_task':
            // Load view object (view data is not available in header / footer); execute view query
            $view = views_get_current_view();
            $view->execute();
            $result = reset($view->result);
            // Display the stderr output in the footer
            $vars['footer'] = '<h3>' . bts('Stderr output') . '</h3>';
            $vars['footer'] .= '<pre>' . htmlspecialchars($result->result_stderr_out) . '</pre>';
            break;
        case 'boinc_teams':
            if ($vars['display_id'] == 'panel_pane_3') {
                $team_id = arg(2);
                $vars['header'] = boincteam_manage_admins_panel_header($team_id);
            }
            break;
        case 'boinc_workunit':
            ob_start();
            // Get the workunit ID from the URL
            $result_id = arg(1);
            require_boinc(array('util', 'boinc_db'));
            $wu = BoincWorkunit::lookup_id($result_id);
            project_workunit($wu);
            // Output of project_workunit() gets caught in the buffer
            $vars['footer'] = ob_get_clean();
        default:
    }
}
示例#5
0
/**
 * Check if we are in the os_events view context.
 *
 * @param array $display_titles
 *   The display titles to check for. If not provided we check only for
 *   the view context with no particular display.
 * @return bool
 *   Returns TRUE if we are in the os_events view context with the optional
 *   supplied display titles. FALSE otherwise.
 */
function os_events_in_view_context($display_titles = array())
{
    $view = views_get_current_view();
    if (!$view || $view->name != 'os_events') {
        return FALSE;
    }
    if (empty($display_titles)) {
        return $view->name == 'os_events';
    }
    $display_names = array();
    foreach ($view->display as $name => $display) {
        if (in_array(strtolower($display->display_title), $display_titles)) {
            $display_names[] = $name;
        }
    }
    return in_array($view->current_display, $display_names);
}