[ Index ]

Source Code Reference for V1.00

title

Body

[close]

/modules/links/ -> index.php (source)

   1  <?php /* FILES $Id: index.php 23 2008-01-23 17:56:11Z pedroix $ */
   2  if (!defined('W2P_BASE_DIR')) {
   3      die('You should not access this file directly.');
   4  }
   5  
   6  $AppUI->savePlace();
   7  
   8  // retrieve any state parameters
   9  if (isset($_REQUEST['project_id'])) {
  10      $AppUI->setState('LinkIdxProject', w2PgetParam($_REQUEST, 'project_id', null));
  11  }
  12  
  13  $project_id = $AppUI->getState('LinkIdxProject') !== null ? $AppUI->getState('LinkIdxProject') : 0;
  14  
  15  if (w2PgetParam($_GET, 'tab', -1) != -1) {
  16      $AppUI->setState('LinkIdxTab', w2PgetParam($_GET, 'tab'));
  17  }
  18  $tab = $AppUI->getState('LinkIdxTab') !== null ? $AppUI->getState('LinkIdxTab') : 0;
  19  $active = intval(!$AppUI->getState('LinkIdxTab'));
  20  
  21  require_once ($AppUI->getModuleClass('projects'));
  22  
  23  // get the list of visible companies
  24  $extra = array('from' => 'links', 'where' => 'projects.project_id = link_project');
  25  
  26  $project = new CProject();
  27  $projects = $project->getAllowedRecords($AppUI->user_id, 'projects.project_id,project_name', 'project_name', null, $extra, 'projects');
  28  $projects = arrayMerge(array('0' => $AppUI->_('All', UI_OUTPUT_JS)), $projects);
  29  
  30  // setup the title block
  31  $titleBlock = new CTitleBlock('Links', 'folder5.png', $m, "$m.$a");
  32  $titleBlock->addCell($AppUI->_('Search') . ':');
  33  $titleBlock->addCell('<input type="text" class="text" SIZE="10" name="search" onChange="document.searchfilter.submit();" value=' . "'$search'" . 'title="' . $AppUI->_('Search in name and description fields', UI_OUTPUT_JS) . '"/>', '', '<form action="?m=links" method="post" id="searchfilter">', '</form>');
  34  $titleBlock->addCell($AppUI->_('Filter') . ':');
  35  $titleBlock->addCell(arraySelect($projects, 'project_id', 'onChange="document.pickProject.submit()" size="1" class="text"', $project_id), '', '<form name="pickProject" action="?m=links" method="post">', '</form>');
  36  if ($canEdit) {
  37      $titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new link') . '">', '', '<form action="?m=links&a=addedit" method="post">', '</form>');
  38  }
  39  $titleBlock->show();
  40  
  41  $link_types = w2PgetSysVal('LinkType');
  42  if ($tab != -1) {
  43      array_unshift($link_types, 'All Links');
  44  }
  45  array_map(array($AppUI, '_'), $link_types);
  46  
  47  $tabBox = new CTabBox('?m=links', W2P_BASE_DIR . '/modules/links/', $tab);
  48  
  49  $i = 0;
  50  
  51  foreach ($link_types as $link_type) {
  52      $tabBox->add('index_table', $link_type);
  53      ++$i;
  54  }
  55  
  56  $tabBox->show();
  57  
  58  ?>


Generated: Fri Jan 9 03:00:02 2009 Cross-referenced by PHPXref 0.7