Commit 4a67395129b07117d815558fa3152d0a45175a94
1 parent
ed0430b1
- improve intro comment.
- correct the admin-mode-never-enabled-bug. git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5013 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
7 changed files
with
89 additions
and
15 deletions
kthelp/ktcore/EN/welcome.html
0 → 100644
| 1 | +<html> | ||
| 2 | +<head> | ||
| 3 | +<title>Welcome to the KnowledgeTree 3.0</title> | ||
| 4 | +</head> | ||
| 5 | +<body> | ||
| 6 | +<p class="descriptiveText">We believe that KnowledgeTree 3.0 Release Candidate | ||
| 7 | +is now stable enough for production evaluation. If you are intending on installing | ||
| 8 | +KnowledgeTree over the next few months we strongly urge you to evaluate the | ||
| 9 | +3.0 Release Candidate and consider it for production use. | ||
| 10 | +There will be an upgrade path for 3.0 Release Candidate to 3.0 Final.</p> | ||
| 11 | +</body> | ||
| 12 | +</html> | ||
| 0 | \ No newline at end of file | 13 | \ No newline at end of file |
plugins/ktcore/KTCorePlugin.php
| @@ -33,7 +33,7 @@ class KTCorePlugin extends KTPlugin { | @@ -33,7 +33,7 @@ class KTCorePlugin extends KTPlugin { | ||
| 33 | $this->registerAction('documentaction', 'KTDocumentPermissionsAction', 'ktcore.actions.document.permissions', 'KTPermissions.php'); | 33 | $this->registerAction('documentaction', 'KTDocumentPermissionsAction', 'ktcore.actions.document.permissions', 'KTPermissions.php'); |
| 34 | $this->registerAction('folderaction', 'KTRoleAllocationPlugin', 'ktcore.actions.folder.roles', 'KTPermissions.php'); | 34 | $this->registerAction('folderaction', 'KTRoleAllocationPlugin', 'ktcore.actions.folder.roles', 'KTPermissions.php'); |
| 35 | 35 | ||
| 36 | - $this->registerDashlet('KTBeta1InfoDashlet', 'ktcore.dashlet.beta1info', 'KTDashlets.php'); | 36 | + $this->registerDashlet('KTInfoDashlet', 'ktcore.dashlet.info', 'KTDashlets.php'); |
| 37 | $this->registerDashlet('KTNotificationDashlet', 'ktcore.dashlet.notifications', 'KTDashlets.php'); | 37 | $this->registerDashlet('KTNotificationDashlet', 'ktcore.dashlet.notifications', 'KTDashlets.php'); |
| 38 | $this->registerDashlet('KTCheckoutDashlet', 'ktcore.dashlet.checkout', 'KTDashlets.php'); | 38 | $this->registerDashlet('KTCheckoutDashlet', 'ktcore.dashlet.checkout', 'KTDashlets.php'); |
| 39 | $this->registerDashlet('KTIndexerStatusDashlet', 'ktcore.dashlet.indexer_status', 'KTDashlets.php'); | 39 | $this->registerDashlet('KTIndexerStatusDashlet', 'ktcore.dashlet.indexer_status', 'KTDashlets.php'); |
plugins/ktcore/KTDashlets.php
| @@ -5,16 +5,73 @@ require_once(KT_LIB_DIR . "/templating/templating.inc.php"); | @@ -5,16 +5,73 @@ require_once(KT_LIB_DIR . "/templating/templating.inc.php"); | ||
| 5 | require_once(KT_LIB_DIR . "/dashboard/Notification.inc.php"); | 5 | require_once(KT_LIB_DIR . "/dashboard/Notification.inc.php"); |
| 6 | require_once(KT_LIB_DIR . "/security/Permission.inc"); | 6 | require_once(KT_LIB_DIR . "/security/Permission.inc"); |
| 7 | 7 | ||
| 8 | +require_once(KT_LIB_DIR . '/help/help.inc.php'); | ||
| 9 | +require_once(KT_LIB_DIR . '/help/helpreplacement.inc.php'); | ||
| 10 | + | ||
| 8 | // ultra simple skeleton for the admin tutorial | 11 | // ultra simple skeleton for the admin tutorial |
| 9 | -class KTBeta1InfoDashlet extends KTBaseDashlet { | 12 | +class KTInfoDashlet extends KTBaseDashlet { |
| 13 | + var $aHelpInfo; | ||
| 14 | + var $canEdit = false; | ||
| 15 | + var $helpLocation = 'ktcore/welcome.html'; | ||
| 16 | + var $help_id; | ||
| 17 | + | ||
| 10 | function is_active($oUser) { | 18 | function is_active($oUser) { |
| 19 | + // FIXME help is a little too mixed. | ||
| 20 | + $aHelpInfo = array(); | ||
| 21 | + $can_edit = Permission::userIsSystemAdministrator($_SESSION['userID']); | ||
| 22 | + | ||
| 23 | + $help_path = KTHelp::getHelpSubPath($this->helpLocation); | ||
| 24 | + if ($help_path == false) { | ||
| 25 | + return false; | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + // We now check for substitute help files. try to generate an error. | ||
| 29 | + $oReplacementHelp = KTHelpReplacement::getByName($help_path); | ||
| 30 | + | ||
| 31 | + $aHelpInfo = KTHelp::getHelpFromFile($this->helpLocation); | ||
| 32 | + | ||
| 33 | + // NORMAL users never see edit-option. | ||
| 34 | + if (!$can_edit) { | ||
| 35 | + if (!PEAR::isError($oReplacementHelp)) { | ||
| 36 | + ; | ||
| 37 | + } elseif ($aHelpInfo != false) { | ||
| 38 | + ; | ||
| 39 | + } else { | ||
| 40 | + return false; | ||
| 41 | + } | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + | ||
| 45 | + | ||
| 46 | + if (!PEAR::isError($oReplacementHelp)) { | ||
| 47 | + $aHelpInfo['title'] = $oReplacementHelp->getTitle(); | ||
| 48 | + $aHelpInfo['body'] = $oReplacementHelp->getDescription(); | ||
| 49 | + $this->help_id = $oReplacementHelp->getId(); | ||
| 50 | + | ||
| 51 | + } else { | ||
| 52 | + $this->help_id = null; | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + if (empty($aHelpInfo)) { return false; } | ||
| 56 | + | ||
| 57 | + $this->aHelpInfo = $aHelpInfo; | ||
| 58 | + $this->canEdit = $can_edit; | ||
| 59 | + | ||
| 11 | return true; | 60 | return true; |
| 12 | } | 61 | } |
| 13 | 62 | ||
| 14 | function render() { | 63 | function render() { |
| 15 | $oTemplating =& KTTemplating::getSingleton(); | 64 | $oTemplating =& KTTemplating::getSingleton(); |
| 16 | - $oTemplate = $oTemplating->loadTemplate("ktcore/dashlets/beta1info"); | 65 | + $oTemplate = $oTemplating->loadTemplate("ktcore/dashlets/kt3release"); |
| 66 | + | ||
| 67 | + | ||
| 68 | + | ||
| 17 | $aTemplateData = array( | 69 | $aTemplateData = array( |
| 70 | + 'title' => $this->aHelpInfo['title'], | ||
| 71 | + 'body' => $this->aHelpInfo['body'], | ||
| 72 | + 'can_edit' => $this->canEdit, | ||
| 73 | + 'target_name' => $this->helpLocation, | ||
| 74 | + 'help_id' => $this->help_id, | ||
| 18 | ); | 75 | ); |
| 19 | return $oTemplate->render($aTemplateData); | 76 | return $oTemplate->render($aTemplateData); |
| 20 | } | 77 | } |
plugins/ktcore/admin/manageHelp.php
| @@ -97,9 +97,12 @@ class ManageHelpDispatcher extends KTAdminDispatcher { | @@ -97,9 +97,12 @@ class ManageHelpDispatcher extends KTAdminDispatcher { | ||
| 97 | 97 | ||
| 98 | function do_customise() { | 98 | function do_customise() { |
| 99 | $name = KTUtil::arrayGet($_REQUEST, 'name'); | 99 | $name = KTUtil::arrayGet($_REQUEST, 'name'); |
| 100 | - $name = KTHelp::getHelpSubPath($name); | ||
| 101 | - $oHelpReplacement = KTHelpReplacement::getByName($name); | 100 | + $subname = KTHelp::getHelpSubPath($name); |
| 101 | + $oHelpReplacement = KTHelpReplacement::getByName($subname); | ||
| 102 | // XXX: Check against "already exists" | 102 | // XXX: Check against "already exists" |
| 103 | + | ||
| 104 | + //var_dump($name); | ||
| 105 | + | ||
| 103 | if (!PEAR::isError($oHelpReplacement)) { | 106 | if (!PEAR::isError($oHelpReplacement)) { |
| 104 | // Already exists... | 107 | // Already exists... |
| 105 | return $this->errorRedirectTo('editReplacement', _('Replacement already exists.'),'id=' . $oHelpReplacement->getId()); | 108 | return $this->errorRedirectTo('editReplacement', _('Replacement already exists.'),'id=' . $oHelpReplacement->getId()); |
templates/kt3/portlets/admin_mode_portlet.smarty
| 1 | <ul class="actionlist"><li> | 1 | <ul class="actionlist"><li> |
| 2 | {if $enabled} | 2 | {if $enabled} |
| 3 | <p><a href="{ktLink base="help.php" subpath="ktcore/admin/admin-mode.html"}" class="ktInline ktHelp" style="float: left; margin: 0 0.5em 0.5em 5px;" >{i18n}What is admin mode?{/i18n}</a> | 3 | <p><a href="{ktLink base="help.php" subpath="ktcore/admin/admin-mode.html"}" class="ktInline ktHelp" style="float: left; margin: 0 0.5em 0.5em 5px;" >{i18n}What is admin mode?{/i18n}</a> |
| 4 | -{i18n}Administrator mode is not currently enabled. {/i18n}</p> | 4 | +{i18n}Administrator mode is enabled. {/i18n}</p> |
| 5 | <a class="ktInline ktAction ktDenied" href="{$toggleurl}">{i18n}Disable Admin Mode{/i18n}</a> | 5 | <a class="ktInline ktAction ktDenied" href="{$toggleurl}">{i18n}Disable Admin Mode{/i18n}</a> |
| 6 | <a href="{$toggleurl}">{i18n}Disable Admin Mode{/i18n}</a> | 6 | <a href="{$toggleurl}">{i18n}Disable Admin Mode{/i18n}</a> |
| 7 | {else} | 7 | {else} |
templates/ktcore/dashlets/beta1info.smarty deleted
| 1 | -<h2>{i18n}Welcome to the KnowledgeTree 3 Release Candidate{/i18n}</h2> | ||
| 2 | -<p class="descriptiveText">{i18n}We believe that KnowledgeTree 3.0 Release Candidate | ||
| 3 | -is now stable enough for production evaluation. If you are intending on installing | ||
| 4 | -KnowledgeTree over the next few months we strongly urge you to evaluate the | ||
| 5 | -3.0 Release Candidate and consider it for production use. | ||
| 6 | -There will be an upgrade path for 3.0 Release Candidate to 3.0 Final.{/i18n}</p> | ||
| 7 | - | ||
| 8 | -<a | ||
| 9 | -href="{$rootUrl}/plugin.php/ktcore.userassistance/kt-bug-reporting-guide">{i18n}Help! Something went wrong!{/i18n}</a> |
templates/ktcore/dashlets/kt3release.smarty
0 → 100644
| 1 | +<h2>{$title}</h2> | ||
| 2 | + | ||
| 3 | +{$body} | ||
| 4 | + | ||
| 5 | +{if $can_edit} | ||
| 6 | +<p><a class="ktAction ktEdit ktInline" | ||
| 7 | + href="{ktLink base="admin.php" subpath="/misc/helpmanagement" query="action=customise&name=`$target_name`"}" >{i18n}Edit this introduction.{/i18n}</a> | ||
| 8 | +<a href="{ktLink base="admin.php" subpath="/misc/helpmanagement" query="action=customise&name=`$target_name`"}">{i18n}Edit this introduction.{/i18n}</a> | ||
| 9 | +{if $help_id}| <a class="ktActionLink ktDelete" href="{ktLink base="admin.php" subpath="/misc/helpmanagement" query="action=deleteReplacement&id=`$help_id`"}">{i18n}Use the standard introduction.{/i18n}</a></p> | ||
| 10 | +{/if} | ||
| 11 | +{/if} | ||
| 0 | \ No newline at end of file | 12 | \ No newline at end of file |