';
$o .= '
';
$o .= '';
$o .= theme('storm_link', array('source_module' => '', 'destination_module' => 'stormorganization'));
$o .= theme('storm_link', array('source_module' => '', 'destination_module' => 'stormperson'));
$o .= theme('storm_link', array('source_module' => '', 'destination_module' => 'stormteam'));
$o .= theme('storm_link', array('source_module' => '', 'destination_module' => 'stormproject'));
$o .= theme('storm_link', array('source_module' => '', 'destination_module' => 'stormtask'));
$o .= theme('storm_link', array('source_module' => '', 'destination_module' => 'stormticket'));
$o .= theme('storm_link', array('source_module' => '', 'destination_module' => 'stormtimetracking'));
$o .= '
';
$o .= '';
$o .= theme('storm_link', array('source_module' => '', 'destination_module' => 'stormnote'));
$o .= theme('storm_link', array('source_module' => '', 'destination_module' => 'storminvoice'));
$o .= theme('storm_link', array('source_module' => '', 'destination_module' => 'stormexpense'));
$o .= theme('storm_link', array('source_module' => '', 'destination_module' => 'stormknowledgebase'));
$o .= theme('storm_link', array('source_module' => '', 'destination_module' => 'stormattribute'));
$o .= theme('storm_link', array('source_module' => '', 'destination_module' => 'stormconfiguration'));
$o .= '
';
$o .= '
';
$o .= '';
return $o;
}
function theme_storm_form_group($form) {
drupal_add_css(
drupal_get_path('module', 'storm') .'/storm.css',
array('type' => 'file')
);
$row = array();
foreach (element_children($form) as $key) {
array_push($row, drupal_render($form[$key]));
}
$rows[] = array('data' => $row, 'class' => 'formgroup');
$output .= theme('table', array(), $rows, array('class' => 'formgroup'));
return $output;
}
function theme_datetime($element) {
return theme('form_element', $element, ''. $element['#children'] .'
');
}
function theme_dateext($element) {
return theme('form_element', $element, ''. $element['#children'] .'
');
}
function theme_storm_list_report($header, $rows, $title, $footer) {
$css_all_file = drupal_get_path('module', 'storm') .'/storm_list_report_all.css';
$css_print_file = drupal_get_path('module', 'storm') .'/storm_list_report_print.css';
$query_string = '?'. drupal_substr(variable_get('css_js_query_string', '0'), 0, 1);
$o = "\n";
$o .= '';
$o .= '';
$o .= ''. (drupal_get_title() ? strip_tags(drupal_get_title()) : variable_get('site_name', 'Drupal')) .'';
$o .= '';
$o .= '';
$o .= '';
$o .= '';
$o .= '';
$o .= ''. $title .'
';
$o .= '';
$o .= theme('table', $header, $rows);
$o .= '
';
$o .= '';
$o .= '';
$o .= '';
return $o;
}
function theme_storm_report($header, $content, $title, $footer, $headtitle='') {
$css_all_file = drupal_get_path('module', 'storm') .'/storm_report_all.css';
$css_print_file = drupal_get_path('module', 'storm') .'/storm_report_print.css';
$query_string = '?'. drupal_substr(variable_get('css_js_query_string', '0'), 0, 1);
$o = "\n";
$o .= '';
$o .= '';
$o .= ''. ($headtitle ? strip_tags($headtitle) : $title) .'';
$o .= '';
$o .= '';
$o .= '';
$o .= '';
$o .= '';
$o .= ''. $title .'
';
$o .= '';
$o .= $content;
$o .= '
';
$o .= '';
$o .= '';
$o .= '';
return $o;
}
function theme_storm_view_item($label, $value) {
$o = '' . $label . ':
' . $value . '
';
return $o;
}
function theme_storm_link($args = array()) {
if (isset($args['source_module'])) {
$source_module = $args['source_module'];
} else {
$source_module = '';
}
if (isset($args['destination_module'])) {
$destination_module = $args['destination_module'];
} else {
$destination_module = '';
}
if (isset($args['node_nid'])) {
$node_nid = $args['node_nid'];
} else {
$node_nid = 0;
}
if (isset($args['weight'])) {
$weight = $args['weight'];
} else {
$weight = 0;
}
switch ($source_module) {
case "stormorganization":
$params_key = 'organization_nid';
break;
case "stormproject":
$params_key = 'project_nid';
break;
case "stormtask":
$params_key = 'task_nid';
break;
case "stormticket":
$params_key = 'ticket_nid';
break;
}
switch ($destination_module) {
case "stormattribute":
$user_access_check = 'Storm: access administration pages';
$list_text = t('Attributes');
$list_path = 'storm/attributes';
$add_icon_type = 'stormattribute';
$add_path = 'storm/attributes/add';
$dt_id = 'stormattributes';
break;
case "stormconfiguration":
$user_access_check = 'Storm: access administration pages';
$list_text = t('Configuration');
$list_path = 'admin/config/system/storm';
$add_icon_type = '';
$add_path = '';
$dt_id = 'stormconfiguration';
break;
case "stormexpense":
$user_access_check = 'Storm expense: access';
$list_text = t('Expenses');
$list_path = 'storm/expenses';
$add_icon_type = 'stormexpense';
$add_path = 'node/add/'. $destination_module;
$dt_id = 'stormexpenses';
break;
case "storminvoice":
$user_access_check = 'Storm invoice: access';
$list_text = t('Invoices');
$list_path = 'storm/invoices';
$add_icon_type = 'storminvoice';
$add_path = 'node/add/'. $destination_module;
$dt_id = 'storminvoices';
break;
case "stormknowledgebase":
$user_access_check = 'Storm knowledgebase: access';
$list_text = t('Knowledge base');
$list_path = 'storm/knowledgebase';
$add_icon_type = 'stormknowledgebase';
$add_path = 'node/add/'. $destination_module;
$dt_id = 'stormknowledgebase';
break;
case "stormnote":
$user_access_check = 'Storm note: access';
$list_text = t('Notes');
$list_path = 'storm/notes';
$add_icon_type = 'stormnote';
$add_path = 'node/add/'. $destination_module;
$dt_id = 'stormnotes';
break;
case "stormorganization":
$user_access_check = 'Storm organization: access';
$list_text = t('Organizations');
$list_path = 'storm/organizations';
$add_icon_type = 'stormorganization';
$add_path = 'node/add/'. $destination_module;
$dt_id = 'stormorganizations';
break;
case "stormperson":
$user_access_check = 'Storm person: access';
$list_text = t('People');
$list_path = 'storm/people';
$add_icon_type = 'stormperson';
$add_path = 'node/add/'. $destination_module;
$dt_id = 'stormpeople';
break;
case "stormproject":
$user_access_check = 'Storm project: access';
$list_text = t('Projects');
$list_path = 'storm/projects';
$add_icon_type = 'stormproject';
$add_path = 'node/add/'. $destination_module;
$dt_id = 'stormprojects';
break;
case "stormtask":
$user_access_check = 'Storm task: access';
$list_text = t('Tasks');
$list_path = 'storm/tasks';
$add_icon_type = 'stormtask';
$add_path = 'node/add/'. $destination_module;
$dt_id = 'stormtasks';
break;
case "stormteam":
$user_access_check = 'Storm team: access';
$list_text = t('Teams');
$list_path = 'storm/teams';
$add_icon_type = 'stormteam';
$add_path = 'node/add/'. $destination_module;
$dt_id = 'stormteams';
break;
case "stormticket":
$user_access_check = 'Storm ticket: access';
$list_text = t('Tickets');
$list_path = 'storm/tickets';
$add_icon_type = 'stormticket';
$add_path = 'node/add/'. $destination_module;
$dt_id = 'stormtickets';
break;
case "stormtimetracking":
$user_access_check = 'Storm timetracking: access';
$list_text = t('Timetrackings');
$list_path = 'storm/timetrackings';
$add_icon_type = 'stormtimetracking';
$node_links_key = 'timetrackings';
$add_path = 'node/add/'. $destination_module;
$dt_id = 'stormtimetrackings';
break;
}
if (($destination_module=='stormconfiguration' && user_access($user_access_check)) || (module_exists($destination_module) && user_access($user_access_check))) {
if ($node_nid == 0) {
$params = array();
}
else {
$params = array('query' => array($params_key => $node_nid));
}
$v = l($list_text, $list_path, $params);
if (!$add_icon_type=='') {
$i->type = $add_icon_type;
if ($node_nid == 0) {
$params = $_GET;
}
else {
$params = $_GET;
$params[$params_key] = $node_nid;
}
$v .= storm_icon_add($add_path, $i, $params);
}
if ($node_nid == 0) {
$r = variable_get('storm_icons_display', TRUE) ? '' : '';
$r .= $v;
$r .= '';
}
else {
$r = array(
'#prefix' => variable_get('storm_icons_display', TRUE) ? '' : '',
'#suffix' => '',
'#value' => $v,
'#weight' => $weight,
);
}
return $r;
}
}