예제 #1
0
파일: template.php 프로젝트: nevetS/flame
/**
 * Overrides theme_devconnect_monetization_roles_form().
 */
function apigee_responsive_devconnect_monetization_roles_form($variables)
{
    $form = $variables['form'];
    $rows = array();
    foreach (element_children($form['developers']) as $uid) {
        $row = array();
        foreach (element_children($form['developers'][$uid]) as $element) {
            $row[] = drupal_render($form['developers'][$uid][$element]);
        }
        $rows[] = array('data' => $row);
    }
    $output = '<div class="table-responsive">' . theme_table(array('header' => $form['#table_headers'], 'rows' => $rows, 'attributes' => array('class' => array('table', 'table-bordered')), 'caption' => '', 'colgroups' => array(), 'sticky' => TRUE, 'empty' => t('Your company has no developers assigned.'))) . '</div>' . drupal_render($form['submit']) . drupal_render_children($form);
    return $output;
}
<?php

// This line is added so that no errors show in the TOC admin page.
if (property_exists($variables['node'], 'arraydesign')) {
    $arraydesign = $variables['node']->arraydesign;
    $arraydesign = chado_expand_var($arraydesign, 'table', 'arraydesignprop', array('return_array' => 1));
    $properties = $arraydesign->arraydesignprop;
    // Check for properties.
    if (count($properties) > 0) {
        ?>
      <div class="tripal_arraydesign-data-block-desc tripal-data-block-desc">Additional information about this array design:</div><?php 
        $header = array('Property Name', 'Value');
        $rows = array();
        foreach ($properties as $property) {
            $rows[] = array(ucfirst(preg_replace('/_/', ' ', $property->type_id->name)), $property->value);
        }
        $table = array('header' => $headers, 'rows' => $rows, 'attributes' => array('id' => 'tripal_arraydesign-table-properties', 'class' => 'tripal-data-table'), 'sticky' => FALSE, 'caption' => '', 'colgroups' => array(), 'empty' => '');
        print theme_table($table);
    }
}
                        }
                        $i++;
                    }
                    // [mRNA] 1 - unspliced means sequence from scaffold co-ordinates
                    $unspliced = 1;
                    $fr_data = push_data($subject->record->subject_id, $unspliced);
                    array_unshift($data, $fr_data);
                    // Here mRNA 0 - spliced sequence means cdna residues
                    $unspliced = 0;
                    $fr_data = push_data($subject->record->subject_id, $unspliced);
                    array_unshift($data, $fr_data);
                    //pushing gene data to array first position using array_unshift
                    $unspliced = 0;
                    $fr_data = push_data($subject->record->object_id, $unspliced);
                    array_unshift($data, $fr_data);
                    $feature_table = array('header' => $feature_headers, 'rows' => $data, 'attributes' => array('id' => 'tripal_feature-fasta-detail-transcript', 'class' => 'tripal-data-table1'), 'sticky' => FALSE, 'caption' => '', 'colgroups' => array(), 'empty' => '');
                    $output .= '<h3 class="accordionClose">Feature Details<span></span></h3>';
                    $output .= '<div>' . theme_table($feature_table) . '</div>';
                    $output .= '</div>';
                    $i++;
                }
                $output .= '</div>';
                print $output;
                ?>
     </p>
     <br><?php 
            }
        }
    }
}
// gene if condition close
/**
 * Themes the question part of a balance-question form.
 *
 * @param array $elements
 *   Asocaitive array containing one element:
 *   - form: associative array containing:
 *     - questionText: array - Forms array item with question text.
 *     - optionsacc: array - Forms array with the accumulation options.
 *     - optionsflow: array - Forms array with the transport options.
 *     - optionsprod: array - Forms array with the reaction options.
 *
 * @ingroup themeable
 */
function theme_closedquestion_question_balance($elements)
{
    $formpart = $elements['form'];
    $header = array(t('Accumulation'), '=', t('&Sigma; Transfer'), '+', t('&Sigma; Reaction'));
    $rows = array();
    $row = array();
    $row[] = drupal_render($formpart['optionsacc']);
    $row[] = ' ';
    $row[] = drupal_render($formpart['optionsflow']);
    $row[] = ' ';
    $row[] = drupal_render($formpart['optionsprod']);
    $rows[] = $row;
    $form_pos = strpos($formpart['questionText']['#markup'], '<formblock/>');
    if ($form_pos !== FALSE) {
        $pre_form = substr($formpart['questionText']['#markup'], 0, $form_pos);
        $post_form = substr($formpart['questionText']['#markup'], $form_pos + 12);
    } else {
        $pre_form = $formpart['questionText']['#markup'];
        $post_form = '';
    }
    $html = '';
    $html .= $pre_form;
    $variables = array('header' => $header, 'rows' => $rows, 'caption' => '', 'attributes' => array('class' => 'cqTable'), 'colgroups' => NULL, 'sticky' => FALSE, 'empty' => '');
    $html .= theme_table($variables);
    $html .= $post_form;
    return $html;
}
<?php

$matrix = array();
unset($state_order['Published']);
//Populate agencies with correct workflow order and default values
foreach ($report as $key => $val) {
    if (!empty($val['Agency']) && !isset($matrix[$val['Agency']])) {
        $matrix[$val['Agency']] = array('agency' => $val['Agency']) + $state_order;
    }
}
//Populate agencies with actual count
foreach ($report as $key => $val) {
    if (!empty($val['Agency'])) {
        $matrix[$val['Agency']][$val['Source']] = $val['Processing Time'];
    }
}
if (!empty($matrix)) {
    echo '<div class="workflow-summary-table">' . theme_table(array('agency' => 'Agency') + array_keys($state_order), $matrix) . '</div>';
} else {
    echo t('Processing time could not be generated. The system expects content within the workflow to generate the report.');
}
<?php

//Setup Schedule Table Variables
$shows_table_header = array(t("Show Title"), t("Show Description"), t("Link"));
$shows_table = array();
?>

<?php 
//Iterate through project shows and add a row for each run
if ($project_node->cablecast_shows) {
    ?>
	<?php 
    foreach ($project_node->cablecast_shows as $show) {
        ?>
		<?php 
        $shows_table[] = array(check_markup($show->title), check_markup($show->body), l('View More', 'node/' . $show->nid));
        ?>
	<?php 
    }
}
?>

<div class="cablecast-project-shows">
  <?php 
print theme_table($shows_table_header, $shows_table);
?>
	<?php 
print theme('pager', NULL, variable_get('cablecast_project_shows_per_page', 20), 0);
?>
</div>
예제 #7
0
function guifi_device_links_print($device, $ltype = '%')
{
    guifi_log(GUIFILOG_TRACE, sprintf('function guifi_device_links_print(%s)', $ltype), $device);
    $oGC = new GeoCalc();
    $dtotal = 0;
    $ltotal = 0;
    if ($ltype == '%') {
        $title = t('network information');
    } else {
        $title = t('network information') . ' (' . $ltype . ')';
    }
    $rows_wds = array();
    $rows_ap_client = array();
    $rows_cable = array();
    $loc1 = db_fetch_object(db_query('SELECT lat, lon, nick ' . 'FROM {guifi_location} WHERE id=%d', $device['nid']));
    $curr_radio = 0;
    switch ($ltype) {
        case '%':
        case 'wds':
        case 'ap/client':
            $dname_curr = '';
            if ($device['radios']) {
                foreach ($device['radios'] as $radio_id => $radio) {
                    if ($radio['interfaces']) {
                        foreach ($radio['interfaces'] as $interface_id => $interface) {
                            if ($interface['ipv4']) {
                                foreach ($interface['ipv4'] as $ipv4_id => $ipv4) {
                                    if ($ipv4['links']) {
                                        foreach ($ipv4['links'] as $link_id => $link) {
                                            guifi_log(GUIFILOG_TRACE, 'going to list link', $link);
                                            $loc2 = db_fetch_object(db_query('SELECT lat, lon, nick FROM {guifi_location} WHERE id=%d', $link['nid']));
                                            $gDist = round($oGC->EllipsoidDistance($loc1->lat, $loc1->lon, $loc2->lat, $loc2->lon), 3);
                                            $dAz = round($oGC->GCAzimuth($loc1->lat, $loc1->lon, $loc2->lat, $loc2->lon));
                                            // Calculo orientacio
                                            if ($dAz < 23) {
                                                $dOr = t("N");
                                            } else {
                                                if ($dAz < 68) {
                                                    $dOr = t("NE");
                                                } else {
                                                    if ($dAz < 113) {
                                                        $dOr = t("E");
                                                    } else {
                                                        if ($dAz < 158) {
                                                            $dOr = t("SE");
                                                        } else {
                                                            if ($dAz < 203) {
                                                                $dOr = t("S");
                                                            } else {
                                                                if ($dAz < 248) {
                                                                    $dOr = t("SW");
                                                                } else {
                                                                    if ($dAz < 293) {
                                                                        $dOr = t("W");
                                                                    } else {
                                                                        if ($dAz < 338) {
                                                                            $dOr = t("NW");
                                                                        } else {
                                                                            $dOr = t("N");
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            $item = _ipcalc($ipv4['ipv4'], $ipv4['netmask']);
                                            $ipdest = explode('.', $link['interface']['ipv4']['ipv4']);
                                            $status_url = guifi_cnml_availability(array('device' => $link['device_id'], 'format' => 'short'));
                                            $cr = db_fetch_object(db_query("SELECT count(*) count FROM {guifi_radios} r WHERE id=%d", $link['device_id']));
                                            if ($cr->count > 1) {
                                                $rn = db_fetch_object(db_query("SELECT ssid FROM {guifi_radios} r WHERE r.id=%d AND r.radiodev_counter=%d", $link['device_id'], $link['interface']['radiodev_counter']));
                                                $dname = guifi_get_hostname($link['device_id']) . '<br />' . $rn->ssid;
                                            } else {
                                                $dname = guifi_get_hostname($link['device_id']);
                                            }
                                            $wrow = array($dname_curr != $radio['ssid'] ? array('data' => '<strong>' . $radio['ssid'] . '</strong>', 'header') : '<small>' . $radio['ssid'] . '</small>', array('data' => $link_id, 'align' => 'right'), '<a href="' . base_path() . 'guifi/device/' . $link['device_id'] . '">' . $dname . '</a>', '<a href="' . base_path() . 'node/' . $link['nid'] . '">' . $loc2->nick . '</a>', $ipv4['ipv4'] . '/' . $item['maskbits'], '.' . $ipdest[3], array('data' => t($link['flag']) . $status_url, 'class' => $link['flag']), $link[routing], $gDist, $dAz . '-' . $dOr);
                                            $dname_curr = $radio['ssid'];
                                            if ($interface['interface_type'] == 'wds/p2p' or $interface['interface_class'] == 'wds/p2p') {
                                                $rows_wds[] = $wrow;
                                            }
                                            if ($link['link_type'] == 'ap/client') {
                                                $rows_ap_client[] = $wrow;
                                            }
                                            $dtotal = $dtotal + $gDist;
                                            $ltotal++;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if ($ltype != '%') {
                break;
            }
        case 'cable':
            $iname_curr = '';
            if ($device['interfaces']) {
                foreach ($device['interfaces'] as $interface_id => $interface) {
                    if ($interface['ipv4']) {
                        foreach ($interface['ipv4'] as $ipv4_id => $ipv4) {
                            if ($ipv4['links']) {
                                foreach ($ipv4['links'] as $link_id => $link) {
                                    $loc2 = db_fetch_object(db_query('SELECT lat, lon, nick FROM {guifi_location} WHERE id=%d', $link['nid']));
                                    $gDist = round($oGC->EllipsoidDistance($loc1->lat, $loc1->lon, $loc2->lat, $loc2->lon), 3);
                                    $item = _ipcalc($ipv4['ipv4'], $ipv4['netmask']);
                                    $ipdest = explode('.', $link['interface']['ipv4']['ipv4']);
                                    if ($gs->var['url'] != NULL) {
                                        $img_url = ' <img src=' . $gs->var['url'] . '?device=' . $link['device_id'] . '&type=availability&format=short>';
                                    } else {
                                        $img_url = NULL;
                                    }
                                    $rows_cable[] = array($iname_curr != $interface['interface_type'] ? $interface['interface_type'] : null, array('data' => $link_id, 'align' => 'right'), l(guifi_get_hostname($link['device_id']), 'guifi/device/' . $link['device_id']), $link['interface']['interface_type'], $ipv4['ipv4'] . '/' . $item['maskbits'], '.' . $ipdest[3], array('data' => t($link['flag']) . $img_url, 'class' => $link['flag']), $link[routing]);
                                    $ltotal++;
                                    $iname_curr = $interface['interface_type'];
                                }
                            } else {
                                $rows_cable[] = array($iname_curr != $interface['interface_type'] ? $interface['interface_type'] : null, null, null, null, $ipv4['ipv4'] . '/' . $item['maskbits']);
                                $ltotal++;
                                $iname_curr = $interface['interface_type'];
                            }
                        }
                    }
                    // foreach link
                    $iname_curr = $interface['interface_type'];
                }
            }
            // foreach ipv4
            if ($ltype == 'cable') {
                break;
            }
    }
    $header_cable = array(t('interface'), array('data' => t('id'), 'align' => 'right'), t('device'), t('remote<br>interface'), t('ip address'), '&nbsp;', t('status'), t('routing'));
    $header_wireless = array_merge($header_cable, array(t('kms.'), t('az.')));
    $header_wireless[3] = t('node');
    $output = '';
    $attr = array('class' => 'list-links');
    if ($rows_ap_client) {
        $output .= theme_box('<hr>' . t('ap/client'), theme_table($header_wireless, $rows_ap_client, $attr));
    }
    if ($rows_wds) {
        $output .= theme_box('<hr>' . t('wds/p2p'), theme_table($header_wireless, $rows_wds, $attr));
    }
    if ($rows_cable) {
        $output .= theme_box('<hr>' . t('cable'), theme_table($header_cable, $rows_cable, $attr));
    }
    if ($output) {
        return '<h2>' . $title . '</h2>' . '<h3>' . t('Totals') . ': ' . $ltotal . ' ' . t('links') . ', ' . $dtotal . ' ' . t('kms.') . '</h3><br>' . $output;
    } else {
        return;
    }
}
예제 #8
0
<br/>
<div>
  Place holder For Citation and Citation Form.
</div>
<br/>
<div>
  Place holder For Link
</div>
<?php 
print theme_fieldset(array('#title' => t("Technical Details"), '#collapsible' => TRUE, '#collapsed' => FALSE, '#children' => theme_table(array(array('colspan' => 3, 'data' => 'Technical Details'), array('data' => 'Mime Type')), $rows) . l('Edit Metadata', '') . '<br/>' . l('Manage Object', '')));
예제 #9
0
/**
 * utility to re-send mail from participants with failed results
 **/
function _connect_action_send_email_resend_failed()
{
    $p_nid = arg(1);
    $parent = node_load($p_nid);
    if (!$parent || !connect_is_parent_node($parent)) {
        return;
    }
    $batch = (int) connect_node_options($parent->nid, 'email_batch');
    $done = 0;
    $report_header = array('participant email', 'result');
    $report_data = array();
    $sql = "SELECT nid FROM {connect_data} WHERE pid = %d";
    $result = db_query($sql, $p_nid);
    while ($row = db_fetch_object($result)) {
        $child = node_load($row->nid);
        if (connect_value('email_defined_result', $parent, $child, 'child') == "Failed") {
            //set lock to prevent connect_nodeapi from firing;
            $_SESSION['connect_child_lock_insert'] = TRUE;
            connect_call_hooks($parent, $child, 'insert');
            unset($_SESSION['connect_child_lock_insert']);
            $report_data[] = array(l(connect_value('email_from', $parent, $child, 'child'), 'node/' . $child->nid), connect_value('email_defined_result', $parent, $child, 'child'));
            $done++;
            if ($batch && $done >= $batch) {
                break;
            }
        }
    }
    if (empty($report_data)) {
        $output .= "<p>There were no failed emails to re-send.</p>\n";
    } else {
        $output = "<p>{$done} emails were re-sent</p>\n";
        $output .= theme_table($report_header, $report_data);
    }
    return $output;
}
예제 #10
0
function ajax_view_query_list()
{
    global $db;
    $header = array('name', 'tags', 'users', 'tracks', 'last_run', '');
    $db->query('SELECT * FROM query ORDER BY created desc');
    $res = $db->fetch_all();
    $rows = array();
    foreach ($res as $result) {
        $rows[] = array($result['name'], json_decode($result['tags']), json_decode($result['users']), json_decode($result['tracks']), $result['heartbeat'], '<a href="#" class="edit-link edit-query" data="' . $result['qid'] . '">edit query</a>' . '<a href="queries/view/~/' . $result['qid'] . '" class="view-link">view query</a>');
    }
    print json_encode(theme_table($header, $rows, array('id' => 'queries_list', 'width' => '50%')));
}
/**
 * Derivative of theme_table() solely for the HOOK_preprocess_table__PATTERN().
 */
function city_of_malmo_table__field_collection_table($variables)
{
    return '<div class="view-my-courses-search-list">' . theme_table($variables) . '</div>';
}
예제 #12
0
/** guifi_node_view(): outputs the node information
 **/
function guifi_node_view($node, $teaser = FALSE, $page = FALSE, $block = FALSE)
{
    node_prepare($node);
    if ($teaser) {
        return $node;
    }
    if ($block) {
        return $node;
    }
    drupal_set_breadcrumb(guifi_node_ariadna($node));
    $node->content['data'] = array('#value' => theme_table(NULL, array(array(array('data' => '<small>' . theme_guifi_node_data($node) . '</small>', 'width' => '50%'), array('data' => theme_guifi_node_map($node), 'width' => '50%')))), '#weight' => 1);
    $node->content['graphs'] = array('#value' => theme_guifi_node_graphs_overview($node), '#weight' => 2);
    $node->content['devices'] = array('#value' => theme_guifi_node_devices_list($node), '#weight' => 3);
    $node->content['wdsLinks'] = array('#value' => theme_guifi_node_links_by_type($node->id, 'wds'), '#weight' => 4);
    $node->content['cableLinks'] = array('#value' => theme_guifi_node_links_by_type($node->id, 'cable'), '#weight' => 5);
    $node->content['clientLinks'] = array('#value' => theme_guifi_node_links_by_type($node->id, 'ap/client'), '#weight' => 6);
    return $node;
}
예제 #13
0
/**
* Theme's a form table for this module.
*
* @param array $element
* A Drupal Form Element.
*
* @return sting
* HTML that renders a table of settings for datastreams.
*/
function fjmtheme_scholar_search_results_table(array $element)
{
    /* We might need to redo the table header theming */
    /* '#header' => array(theme('table_select_header_cell'), $title), */
    /* set caption */
    //$element['caption'] = $element['#header'][1];
    //$element['#header'][1] = t('Title') . ', ' . t('Bibliography');
    $rows = array();
    foreach (element_children($element['rows']) as $child) {
        $setting = $element['rows'][$child];
        $pid = $setting['#pid'];
        $fields = array(drupal_render($element['selections'][$pid]));
        foreach (element_children($setting) as $property) {
            $field = $setting[$property];
            $fields[] = drupal_render($field);
        }
        $rows[] = array('data' => $fields, 'class' => isset($setting['#attributes']['class']) ? $setting['#attributes']['class'] : NULL);
    }
    $attributes = isset($element['#id']) ? array('id' => $element['#id']) : NULL;
    return '<div class="scholar-search-results">' . theme_table($element['#header'], $rows, $attributes, $element['#caption']) . '</div>';
}
	<?php 
    foreach ($schedule_nodes as $schedule_run) {
        ?>
		<?php 
        $schedule_table[] = array(date("h:i", $schedule_run->start_time), l($schedule_run->title, "node/" . $schedule_run->cablecast_show_nid));
        ?>
	<?php 
    }
}
?>

<div id="cablecast_schedule_container">

	<div id="cablecast_schedule_table" style="float:left">
		<?php 
print theme_table($schedule_table_header, $schedule_table);
?>
	</div><!-- End cablecast_schedule_table -->
	
	<div type="text" id="cablecast_schedule_datepicker" style="float:left;margin-left:15px">
	<!-- Set up jquery ui calendar -->
  	<script>
  	$(function() {
  			$("#cablecast_schedule_datepicker").datepicker({
     	 onSelect: function(dateText, inst) { window.location.href = location.href.substring(0,location.href.lastIndexOf("?"))+"?date="+dateText},
     	 });
  		});
  	</script>
  </div><!-- End cablecast_schedule_datepicker -->
</div><!-- End cablecast_schedule_container -->
예제 #15
0
/**
 * Returns HTML (text) rendition of the given file metadata.
 * 
 * Displays all available data
 */
function proofsheet_theme_all_file_metadata($data)
{
    $table_data = array();
    // Place all data into rows for theming
    foreach ($data as $key => $value) {
        if ($key == 'exif:0:data') {
            // We don't need this binary crap.
            continue;
        }
        if (is_array($value)) {
            // Make a nested table for now
            // TODO needs work
            $value = '<div style="size:-1">' . proofsheet_theme_file_metadata($value) . '</div>';
        }
        $table_row = array('key' => array('data' => $key, 'header' => TRUE), 'value' => $value);
        $table_data[] = $table_row;
    }
    // Use Drupal-compatible style theming to render table
    $table_header = array();
    $table_attributes = array('class' => 'file-metadata');
    $table_caption = NULL;
    #print_log($table_data);
    $html = theme_table($table_header, $table_data, $table_attributes, $table_caption);
    return $html;
}
예제 #16
0
/**  guifi_zone_view(): zone view page
**/
function guifi_zone_view($node, $teaser = FALSE, $page = FALSE, $block = FALSE)
{
    node_prepare($node);
    if ($teaser) {
        return $node;
    }
    if ($block) {
        return $node;
    }
    $node->content['data'] = array('#value' => theme_table(NULL, array(array(array('data' => '<small>' . theme_guifi_zone_data($node, FALSE) . '</small>' . theme_guifi_contacts($node), 'width' => '35%'), array('data' => guifi_zone_simple_map($node), 'width' => '65%'))), array('width' => '100%')), '#weight' => 1);
    $node->content['graph'] = array('#value' => theme_guifi_zone_stats($node, FALSE), '#weight' => 2);
    $node->content['nodes'] = array('#value' => theme_guifi_zone_nodes($node, FALSE), '#weight' => 3);
    return $node;
}