~litlfred/ihris-retention/trunk

« back to all changes in this revision

Viewing changes to lib/iHRIS_RetainBreadCrumbs.php

  • Committer: Carl Leitner
  • Date: 2012-05-08 15:58:18 UTC
  • Revision ID: litlfred@ibiblio.org-20120508155818-ennt8i93qpdb5184
merged in much of RD changes/edits

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
 
46
46
 
47
47
 
48
 
    public static function show($page,$projection) {
 
48
    public static function show($page,$projection, $step = null, $show_help = true) {
49
49
        if(!$page instanceof I2CE_Page) {
50
50
            I2CE::raiseError("Bad page");
51
51
            return false;
59
59
            I2CE::raiseError("Bad projection");
60
60
            return false;
61
61
        }
62
 
 
63
 
        if (count($projection->getChildIds('financial')) == 0) {
64
 
            $step = 1;
65
 
        } else  if (count($projection->getChildIds('pool')) == 0) {
66
 
            $step = 2;
67
 
        } else  if (!$projection->hasInterventions()) {
68
 
            $step = 3;
69
 
        } else if (count($projection->getChildIds('scenario')) == 0) {
70
 
            $step = 4;
71
 
        } else {
72
 
            $step = 6;
 
62
        if ($step === null) {
 
63
            if (count($projection->getChildIds('financial')) == 0) {
 
64
                $step = 1;
 
65
            } else  if (count($projection->getChildIds('pool')) == 0) {
 
66
                $step = 2;
 
67
            } else  if (!$projection->hasInterventions()) {
 
68
                $step = 3;
 
69
            } else if (count($projection->getChildIds('scenario')) == 0) {
 
70
                $step = 4;
 
71
            } else {
 
72
                $step = 6;
 
73
            }
73
74
        }
74
75
        if ($page->request_exists('instruct')) {
75
76
            $step = $page->request('instruct');
76
77
        }
77
 
        $help_file = 'step_' . $step .'.html';
78
 
        if ($help_file = $template->findTemplate($help_file )) {
79
 
            $template->userMessage(file_get_contents($help_file),'notice',false);
 
78
        if ($show_help) {
 
79
            $help_file = 'step_' . $step .'.html';
 
80
            if ($help_file = $template->findTemplate($help_file )) {
 
81
                $template->userMessage(file_get_contents($help_file),'notice',false);
 
82
            }
80
83
        }
81
84
 
82
85
        $template->setDisplayDataImmediate('instruct', $step);