Commit f4542f506a5258c7ba667489db1a12a1d6041aa1
1 parent
65970ee4
Fixed disclaimers after help change.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5435 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
13 additions
and
16 deletions
plugins/ktstandard/KTDisclaimers.php
| ... | ... | @@ -61,12 +61,10 @@ class KTDisclaimersPlugin extends KTPlugin { |
| 61 | 61 | $sDisclaimer = false; |
| 62 | 62 | |
| 63 | 63 | if($this->isRegistered()) { |
| 64 | - $help_path = KTHelp::getHelpSubPath($sLocation); | |
| 65 | - $oReplacementHelp = KTHelpReplacement::getByName($help_path); | |
| 66 | - | |
| 67 | - | |
| 68 | - if(!PEAR::isError($oReplacementHelp) && strlen(trim($oReplacementHelp->getDescription()))) { | |
| 69 | - $sDisclaimer = $oReplacementHelp->getDescription(); | |
| 64 | + $aHelp = KTHelp::getHelpInfo($sLocation); | |
| 65 | + | |
| 66 | + if(!PEAR::isError($aHelp) && strlen(trim($aHelp['body']))) { | |
| 67 | + $sDisclaimer = $aHelp['body']; | |
| 70 | 68 | } |
| 71 | 69 | } |
| 72 | 70 | ... | ... |
plugins/ktstandard/admin/manageDisclaimers.php
| ... | ... | @@ -106,19 +106,15 @@ class ManageDisclaimersDispatcher extends KTAdminDispatcher { |
| 106 | 106 | |
| 107 | 107 | function do_customise() { |
| 108 | 108 | $name = KTUtil::arrayGet($_REQUEST, 'name'); |
| 109 | - $subname = KTHelp::getHelpSubPath($name); | |
| 110 | - $oHelpReplacement = KTHelpReplacement::getByName($subname); | |
| 109 | + | |
| 110 | + $subname = KTHelp::_getLocationInfo($name); | |
| 111 | + $oHelpReplacement = KTHelpReplacement::getByName($subname['internal']); | |
| 111 | 112 | |
| 112 | 113 | if (!PEAR::isError($oHelpReplacement)) { |
| 113 | 114 | return $this->redirectTo('edit', 'id=' . $oHelpReplacement->getId()); |
| 114 | 115 | } |
| 115 | 116 | |
| 116 | - $info = KTHelp::getHelpFromFile($name); | |
| 117 | - if ($info === false) { | |
| 118 | - $info = array('name' => $name); | |
| 119 | - $info['title'] = _kt('New Help File'); | |
| 120 | - $info['body'] = _kt('New Help File'); | |
| 121 | - } | |
| 117 | + $info = KTHelp::getHelpInfo($name); | |
| 122 | 118 | |
| 123 | 119 | $oHelpReplacement = KTHelpReplacement::createFromArray(array( |
| 124 | 120 | 'name' => $info['name'], |
| ... | ... | @@ -127,6 +123,9 @@ class ManageDisclaimersDispatcher extends KTAdminDispatcher { |
| 127 | 123 | )); |
| 128 | 124 | |
| 129 | 125 | if (PEAR::isError($oHelpReplacement)) { |
| 126 | + print '<pre>'; | |
| 127 | + var_dump($info); | |
| 128 | + exit(0); | |
| 130 | 129 | return $this->errorRedirectToMain(_kt("Unable to create disclaimer")); |
| 131 | 130 | } |
| 132 | 131 | |
| ... | ... | @@ -135,8 +134,8 @@ class ManageDisclaimersDispatcher extends KTAdminDispatcher { |
| 135 | 134 | |
| 136 | 135 | function do_clear() { |
| 137 | 136 | $name = KTUtil::arrayGet($_REQUEST, 'name'); |
| 138 | - $subname = KTHelp::getHelpSubPath($name); | |
| 139 | - $oHelpReplacement = KTHelpReplacement::getByName($subname); | |
| 137 | + $subname = KTHelp::_getLocationInfo($name); | |
| 138 | + $oHelpReplacement = KTHelpReplacement::getByName($subname['internal']); | |
| 140 | 139 | |
| 141 | 140 | if (PEAR::isError($oHelpReplacement)) { |
| 142 | 141 | return $this->errorRedirectToMain(_kt("Could not find specified item")); | ... | ... |