Commit fe41597dcab165209d217fad6f2e793e64fb3bde

Authored by Neil Blakey-Milner
1 parent 188cffba

Add breadcrumbs, and use successRedirectTo when an action is

successfully performed.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3858 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/administration/help/manageHelp.php
... ... @@ -14,6 +14,12 @@ $sectionName = "Administration";
14 14 require_once(KT_DIR . "/presentation/webpageTemplate.inc");
15 15  
16 16 class ManageHelpDispatcher extends KTAdminDispatcher {
  17 + // Breadcrumbs base - added to in methods
  18 + var $aBreadcrumbs = array(
  19 + array('action' => 'administration', 'name' => 'Administration'),
  20 + array('action' => 'manageHelp', 'name' => 'Help Administration'),
  21 + );
  22 +
17 23 function do_main() {
18 24 return $this->getData();
19 25 }
... ... @@ -37,16 +43,12 @@ class ManageHelpDispatcher extends KTAdminDispatcher {
37 43 $aTemplateData = array(
38 44 "help" => $oHelpReplacement,
39 45 );
  46 + $this->aBreadcrumbs[] = array(
  47 + 'name' => 'Edit help item',
  48 + );
40 49 return $oTemplate->render($aTemplateData);
41 50 }
42 51  
43   - function handleOutput($data) {
44   - global $main;
45   - $main->bFormDisabled = true;
46   - $main->setCentralPayload($data);
47   - $main->render();
48   - }
49   -
50 52 function do_editReplacement() {
51 53 $id = KTUtil::arrayGet($_REQUEST, 'id');
52 54 $oHelpReplacement = KTHelpReplacement::get($id);
... ... @@ -66,7 +68,7 @@ class ManageHelpDispatcher extends KTAdminDispatcher {
66 68 if (PEAR::isError($res)) {
67 69 return $this->errorRedirectToMain("Could not delete specified item");
68 70 }
69   - return $this->errorRedirectToMain("Item deleted");
  71 + return $this->successRedirectToMain("Item deleted");
70 72 }
71 73  
72 74 function do_updateReplacement() {
... ... @@ -84,7 +86,7 @@ class ManageHelpDispatcher extends KTAdminDispatcher {
84 86 if (PEAR::isError($res)) {
85 87 return $this->errorRedirectToMain("Error updating item");
86 88 }
87   - return $this->errorRedirectToMain("Item updated");
  89 + return $this->successRedirectToMain("Item updated");
88 90 }
89 91  
90 92 function do_customise() {
... ... @@ -103,7 +105,7 @@ class ManageHelpDispatcher extends KTAdminDispatcher {
103 105 if (PEAR::isError($oHelpReplacement)) {
104 106 return $this->errorRedirectToMain("Unable to create replacement");
105 107 }
106   - return $this->redirectTo('editReplacement', 'id=' . $oHelpReplacement->getId());
  108 + return $this->successRedirectTo('editReplacement', 'id=' . $oHelpReplacement->getId());
107 109 }
108 110 }
109 111  
... ...