All pastes #570673 Raw Edit

Untitled

public text v1 · immutable
·published 2007-06-16 20:30 UTC
rendered paste body
<?php
/**
 * Implementation of hook_menu().
 */
function pms_menu($may_cache) {
  $items = array();
  
  if (!$may_cache && arg(0) == 'dashboard' && arg(1) == 'ajax' && is_numeric(arg(2))) {
    $items[] = array(
      'path' => 'dashboard/ajax/'. arg(2),
      'title' => t('user item'),
      'callback' => 'pms_ajax_employee',
      'callback arguments' => array(),
      'access' => TRUE,
      'type' => MENU_CALLBACK,
    );
    
  }
  else if(!$may_cache){
    $items[] = array(
      'path' => 'dashboard/ajax',
      'title' => t('user item'),
      'callback' => 'pms_ajax_dashboard',
      'access' => TRUE,
      'type' => MENU_CALLBACK,
    );
    
  }
  if (!$may_cache && arg(0) == 'dashboard' && arg(1) == 'tasks' && is_numeric(arg(2))) {
    $items[] = array(
      'path' => 'dashboard/tasks/'.arg(2),
      'title' => t('user item'),
      'callback' => 'pms_user_employee',
      'callback arguments' => array(),
      'access' => TRUE,
      'type' => MENU_CALLBACK,
    );
  }
if (!$may_cache && arg(0) == 'dashboard' && arg(1) == 'projects' && is_numeric(arg(2))) {
    $items[] = array(
      'path' => 'dashboard/projects/'. arg(2),
      'title' => t('user item'),
      'callback' => 'pms_user_employee_projects',
      'callback arguments' => array(),
      'access' => TRUE,
      'type' => MENU_CALLBACK,
    );
  }
  return $items;
}

function pms_user_employee_projects() {
  $block = views_view_block('employee_project_issues');
  print $block['content'];
  exit();
}

function pms_user_employee() {
  $block = views_view_block('employee_issues');
  print '<div class="box tasks">';
  print '<span class="tl"></span><span class="tr"></span><span class="bl"></span><span class="br"></span>';
  print '<h1>Tasks:</h1>';
  print '<img src="/sites/all/themes/project_worx/images/template/t_min.gif" width="21" height="29" class="mm" alt="minimize" title="minimize" id="projectTasksMM" onclick="Sh+owHideDiv(\'tasks\');" />';
  print '<div id="tasks">';
  print $block['content'];
  print '</div>';
  print '</div>';
  exit();
}

function pms_ajax_employee() {
  $block = views_view_block('employee_issues');
  print $block['content'];
  exit();
}
unction pms_ajax_dashboard() {
  $block = views_view_block('all_issues');
  print $block['content'];
  exit();
}

function pms_perm() {
  return array('access pm dashboard');
}

?>