diff --git a/kthelp/ktcore/EN/welcome.html b/kthelp/ktcore/EN/welcome.html new file mode 100644 index 0000000..061f2d9 --- /dev/null +++ b/kthelp/ktcore/EN/welcome.html @@ -0,0 +1,12 @@ + + +Welcome to the KnowledgeTree 3.0 + + +

We believe that KnowledgeTree 3.0 Release Candidate +is now stable enough for production evaluation. If you are intending on installing +KnowledgeTree over the next few months we strongly urge you to evaluate the +3.0 Release Candidate and consider it for production use. +There will be an upgrade path for 3.0 Release Candidate to 3.0 Final.

+ + \ No newline at end of file diff --git a/plugins/ktcore/KTCorePlugin.php b/plugins/ktcore/KTCorePlugin.php index f313c50..f0d7785 100644 --- a/plugins/ktcore/KTCorePlugin.php +++ b/plugins/ktcore/KTCorePlugin.php @@ -33,7 +33,7 @@ class KTCorePlugin extends KTPlugin { $this->registerAction('documentaction', 'KTDocumentPermissionsAction', 'ktcore.actions.document.permissions', 'KTPermissions.php'); $this->registerAction('folderaction', 'KTRoleAllocationPlugin', 'ktcore.actions.folder.roles', 'KTPermissions.php'); - $this->registerDashlet('KTBeta1InfoDashlet', 'ktcore.dashlet.beta1info', 'KTDashlets.php'); + $this->registerDashlet('KTInfoDashlet', 'ktcore.dashlet.info', 'KTDashlets.php'); $this->registerDashlet('KTNotificationDashlet', 'ktcore.dashlet.notifications', 'KTDashlets.php'); $this->registerDashlet('KTCheckoutDashlet', 'ktcore.dashlet.checkout', 'KTDashlets.php'); $this->registerDashlet('KTIndexerStatusDashlet', 'ktcore.dashlet.indexer_status', 'KTDashlets.php'); diff --git a/plugins/ktcore/KTDashlets.php b/plugins/ktcore/KTDashlets.php index f34b81c..0a5a7af 100644 --- a/plugins/ktcore/KTDashlets.php +++ b/plugins/ktcore/KTDashlets.php @@ -5,16 +5,73 @@ require_once(KT_LIB_DIR . "/templating/templating.inc.php"); require_once(KT_LIB_DIR . "/dashboard/Notification.inc.php"); require_once(KT_LIB_DIR . "/security/Permission.inc"); +require_once(KT_LIB_DIR . '/help/help.inc.php'); +require_once(KT_LIB_DIR . '/help/helpreplacement.inc.php'); + // ultra simple skeleton for the admin tutorial -class KTBeta1InfoDashlet extends KTBaseDashlet { +class KTInfoDashlet extends KTBaseDashlet { + var $aHelpInfo; + var $canEdit = false; + var $helpLocation = 'ktcore/welcome.html'; + var $help_id; + function is_active($oUser) { + // FIXME help is a little too mixed. + $aHelpInfo = array(); + $can_edit = Permission::userIsSystemAdministrator($_SESSION['userID']); + + $help_path = KTHelp::getHelpSubPath($this->helpLocation); + if ($help_path == false) { + return false; + } + + // We now check for substitute help files. try to generate an error. + $oReplacementHelp = KTHelpReplacement::getByName($help_path); + + $aHelpInfo = KTHelp::getHelpFromFile($this->helpLocation); + + // NORMAL users never see edit-option. + if (!$can_edit) { + if (!PEAR::isError($oReplacementHelp)) { + ; + } elseif ($aHelpInfo != false) { + ; + } else { + return false; + } + } + + + + if (!PEAR::isError($oReplacementHelp)) { + $aHelpInfo['title'] = $oReplacementHelp->getTitle(); + $aHelpInfo['body'] = $oReplacementHelp->getDescription(); + $this->help_id = $oReplacementHelp->getId(); + + } else { + $this->help_id = null; + } + + if (empty($aHelpInfo)) { return false; } + + $this->aHelpInfo = $aHelpInfo; + $this->canEdit = $can_edit; + return true; } function render() { $oTemplating =& KTTemplating::getSingleton(); - $oTemplate = $oTemplating->loadTemplate("ktcore/dashlets/beta1info"); + $oTemplate = $oTemplating->loadTemplate("ktcore/dashlets/kt3release"); + + + $aTemplateData = array( + 'title' => $this->aHelpInfo['title'], + 'body' => $this->aHelpInfo['body'], + 'can_edit' => $this->canEdit, + 'target_name' => $this->helpLocation, + 'help_id' => $this->help_id, ); return $oTemplate->render($aTemplateData); } diff --git a/plugins/ktcore/admin/manageHelp.php b/plugins/ktcore/admin/manageHelp.php index fb42918..f205f0c 100755 --- a/plugins/ktcore/admin/manageHelp.php +++ b/plugins/ktcore/admin/manageHelp.php @@ -97,9 +97,12 @@ class ManageHelpDispatcher extends KTAdminDispatcher { function do_customise() { $name = KTUtil::arrayGet($_REQUEST, 'name'); - $name = KTHelp::getHelpSubPath($name); - $oHelpReplacement = KTHelpReplacement::getByName($name); + $subname = KTHelp::getHelpSubPath($name); + $oHelpReplacement = KTHelpReplacement::getByName($subname); // XXX: Check against "already exists" + + //var_dump($name); + if (!PEAR::isError($oHelpReplacement)) { // Already exists... return $this->errorRedirectTo('editReplacement', _('Replacement already exists.'),'id=' . $oHelpReplacement->getId()); diff --git a/templates/kt3/portlets/admin_mode_portlet.smarty b/templates/kt3/portlets/admin_mode_portlet.smarty index 5d1bc2e..b9d6dbb 100644 --- a/templates/kt3/portlets/admin_mode_portlet.smarty +++ b/templates/kt3/portlets/admin_mode_portlet.smarty @@ -1,7 +1,7 @@