| 1 |
joko |
1.1 |
<? |
| 2 |
|
|
/** |
| 3 |
|
|
* This file contains the YAA_JobGroups child class, it inherits |
| 4 |
|
|
* from the WebExplorer_Module_AbstractNavigationList. |
| 5 |
|
|
* |
| 6 |
|
|
* @author Andreas Motl <andreas.motl@ilo.de> |
| 7 |
|
|
* @package org.netfrag.app |
| 8 |
|
|
* @name YAA::JobGroups |
| 9 |
|
|
* |
| 10 |
|
|
*/ |
| 11 |
|
|
|
| 12 |
|
|
/** |
| 13 |
|
|
* Cvs-Log: |
| 14 |
|
|
* |
| 15 |
|
|
* $Id: Generic.php,v 1.18 2003/04/11 00:55:49 joko Exp $ |
| 16 |
|
|
* |
| 17 |
|
|
* $Log: Generic.php,v $ |
| 18 |
|
|
* |
| 19 |
|
|
*/ |
| 20 |
|
|
|
| 21 |
|
|
/** |
| 22 |
|
|
* This requires the WebExplorer::Module::AbstractNavigationList |
| 23 |
|
|
* component as base class. |
| 24 |
|
|
* |
| 25 |
|
|
*/ |
| 26 |
|
|
loadModule('WebExplorer::Module::AbstractNavigationList'); |
| 27 |
|
|
|
| 28 |
|
|
/** |
| 29 |
|
|
* The YAA_JobGroups child class inherits from a WebExplorer |
| 30 |
|
|
* component to ensure querying against known api/infrastructure. |
| 31 |
|
|
* This could also be decoupled later. |
| 32 |
|
|
* |
| 33 |
|
|
* It queries the backend for a list of known groups of jobs/tasks |
| 34 |
|
|
* using the DataSource::Generic chain and displays them inside |
| 35 |
|
|
* a VerticalCSSNavTable by using the AbstractNavigationList. |
| 36 |
|
|
* |
| 37 |
|
|
* The links contain http query arguments which should trigger |
| 38 |
|
|
* the request processor (MVC) to navigate back to the job control |
| 39 |
|
|
* page (where we came from) displaying a list of jobs/tasks |
| 40 |
|
|
* filtered by an additional url argument inside the content area. |
| 41 |
|
|
* |
| 42 |
|
|
* |
| 43 |
|
|
* @link http://www.netfrag.org/~joko/ |
| 44 |
|
|
* @author Andreas Motl <andreas.motl@ilo.de> |
| 45 |
|
|
* |
| 46 |
|
|
* @copyright (c) 2003 - All Rights reserved. |
| 47 |
|
|
* |
| 48 |
|
|
* @link http://www.gnu.org/licenses/lgpl.txt |
| 49 |
|
|
* @license GNU LGPL (GNU Lesser General Public License) |
| 50 |
|
|
* |
| 51 |
|
|
* |
| 52 |
|
|
* @package org.netfrag.app |
| 53 |
|
|
* @subpackage YAA |
| 54 |
|
|
* @name YAA::JobGroups |
| 55 |
|
|
* |
| 56 |
|
|
* |
| 57 |
|
|
*/ |
| 58 |
|
|
class YAA_JobGroups extends WebExplorer_Module_AbstractNavigationList { |
| 59 |
|
|
|
| 60 |
|
|
function propagate() { |
| 61 |
|
|
|
| 62 |
|
|
// default link arguments |
| 63 |
|
|
/* |
| 64 |
|
|
$link_vars_template = array( |
| 65 |
|
|
'ap' => "explorer", |
| 66 |
|
|
'ecl' => "content", |
| 67 |
|
|
'ect' => "data", |
| 68 |
|
|
'ecdlk' => "rpc", |
| 69 |
|
|
'ecat' => "list", |
| 70 |
|
|
); |
| 71 |
|
|
*/ |
| 72 |
|
|
|
| 73 |
|
|
// default link arguments to branch back to ourselves (page level!) |
| 74 |
|
|
$link_vars_template = array( |
| 75 |
|
|
'ap' => "pcontrol" |
| 76 |
|
|
); |
| 77 |
|
|
|
| 78 |
|
|
// define link defaults |
| 79 |
|
|
$alt_caption = "Alle Jobs der Gruppe '$label' anzeigen."; |
| 80 |
|
|
|
| 81 |
|
|
foreach ($this->result as $entry) { |
| 82 |
|
|
|
| 83 |
|
|
// extract values from deep nested result |
| 84 |
|
|
if (is_array($entry)) { |
| 85 |
|
|
$label = $entry[label]; |
| 86 |
|
|
$filter = $entry[filter]; |
| 87 |
|
|
} else { |
| 88 |
|
|
$label = $entry; |
| 89 |
|
|
} |
| 90 |
|
|
|
| 91 |
|
|
// copy link variables from default template and define new ones |
| 92 |
|
|
$link_vars = $link_vars_template; |
| 93 |
|
|
$link_vars[filter] = $filter; |
| 94 |
|
|
|
| 95 |
|
|
// build link url |
| 96 |
|
|
$url = url::short(null, $link_vars); |
| 97 |
|
|
|
| 98 |
|
|
// add link to widget |
| 99 |
|
|
$this->nav->add($url, $label, $alt_caption); |
| 100 |
|
|
|
| 101 |
|
|
} |
| 102 |
|
|
|
| 103 |
|
|
} |
| 104 |
|
|
|
| 105 |
|
|
} |
| 106 |
|
|
|
| 107 |
|
|
|
| 108 |
|
|
?> |