diff --git a/browse.php b/browse.php
index 4179468..8df7aa0 100644
--- a/browse.php
+++ b/browse.php
@@ -164,7 +164,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
'ignorepermissions' => KTBrowseUtil::inAdminMode($this->oUser, $oFolder),
);
$this->oQuery = new BrowseQuery($oFolder->getId(), $this->oUser, $aOptions);
-
+
$this->resultURL = KTUtil::addQueryString($_SERVER['PHP_SELF'], sprintf('fFolderId=%d', $oFolder->getId()));
// and the portlets
@@ -176,6 +176,16 @@ class BrowseDispatcher extends KTStandardDispatcher {
$portlet = new KTActionPortlet(sprintf(_kt('Actions on this folder')));
$aActions = KTFolderActionUtil::getFolderActionsForFolder($oFolder, $this->oUser);
$portlet->setActions($aActions,null);
+ // Set upload button
+ $btnName = _kt('Add Document');
+ $btnAction = '';
+ foreach ($aActions as $item){
+ if($item->getDisplayName() == $btnName){
+ $btnAction = array($item);
+ break;
+ }
+ }
+ $portlet->setButton($btnAction, 'folder_upload');
$this->oPage->addPortlet($portlet);
@@ -255,7 +265,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
$aOptions['result_url'] = $this->resultURL;
$aOptions['is_browse'] = true;
-
+
$collection->setOptions($aOptions);
$collection->setQueryObject($this->oQuery);
diff --git a/lib/actions/folderaction.inc.php b/lib/actions/folderaction.inc.php
index d6a1887..8d8b0bb 100644
--- a/lib/actions/folderaction.inc.php
+++ b/lib/actions/folderaction.inc.php
@@ -6,31 +6,31 @@
* Document Management Made Simple
* Copyright (C) 2008 KnowledgeTree Inc.
* Portions copyright The Jam Warehouse Software (Pty) Limited
- *
+ *
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation.
- *
+ *
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program. If not, see
'; print_r($this->actions);
+ $info = $action[0]->getInfo();
+
+ // Ensure user has permission on / access to the action
+ if(empty($info)){
+ return false;
+ }
+
+ $link = $info['url'];
+ $text = $info['name'];
+
+ switch($btn){
+ case 'document_checkin':
+ $text = _kt('Checkin Document');
+ $class = 'arrow_upload';
+ break;
+ case 'folder_upload':
+ $text = _kt('Upload Document');
+ $class = 'arrow_upload';
+ break;
+ case 'document_download':
+ $text = _kt('Download Document');
+ $class = 'arrow_download';
+ break;
+ default:
+ return false;
+ }
+
+ // Create button html
+ $button = "";
+
+ $this->btn = $button;
+ return true;
}
function render() {
@@ -140,11 +197,17 @@ class KTActionPortlet extends KTPortlet {
return null;
}
$oTemplating =& KTTemplating::getSingleton();
- $oTemplate = $oTemplating->loadTemplate("kt3/portlets/actions_portlet");
+ $oTemplate = $oTemplating->loadTemplate('kt3/portlets/actions_portlet');
$aTemplateData = array(
- "context" => $this,
+ 'context' => $this,
);
+ // Display a button above the action list
+ if(isset($this->btn) && !empty($this->btn)){
+ $aTemplateData['showBtn'] = true;
+ $aTemplateData['btn'] = $this->btn;
+ }
+
return $oTemplate->render($aTemplateData);
}
}
diff --git a/resources/css/kt-framing.css b/resources/css/kt-framing.css
index 1d727be..74d1632 100644
--- a/resources/css/kt-framing.css
+++ b/resources/css/kt-framing.css
@@ -1172,6 +1172,85 @@ The text will be hidden for screen view. The generic fahrner-ish approach comes
+/* upload / download buttons */
+
+.portlet_button {
+ padding: 2px;
+ padding-bottom: 0;
+ height: 40px;
+}
+
+.portlet_button a .btn_text {
+ color: #F8A00C;
+ padding-top: 15px;
+ text-align: center;
+ font-weight: bold;
+ float: left;
+}
+
+
+.portlet_button a:hover .btn_text {
+ color: #F8B01C;
+}
+
+
+#portletbar .portlet .portlet_button a:hover {
+ color: #FFAA00;
+ border: 0px;
+ text-decoration: none;
+}
+
+.portlet_button a .arrow_download {
+ background: transparent url(../../resources/graphics/download_arrow.gif) top right no-repeat;
+ width: 27px;
+ height: 47px;
+ float: right;
+}
+
+.portlet_button a .arrow_upload {
+ background: transparent url(../../resources/graphics/upload_arrow.gif) top right no-repeat;
+ width: 27px;
+ height: 47px;
+ float: right;
+}
+
+.portlet_button a .big_btn_left {
+ background: transparent url(../../resources/graphics/btn_left.gif) top left no-repeat;
+ width: 10px;
+ height: 47px;
+ float: left;
+}
+
+.portlet_button a .big_btn_middle {
+ background: transparent url(../../resources/graphics/btn_middle.gif) repeat-x;
+ height: 47px;
+ float: left;
+ text-align: center;
+ vertical-align: middle;
+ align: center;
+ width: 89%;
+}
+
+.portlet_button a .big_btn_right {
+ background: transparent url(../../resources/graphics/btn_right.gif) top right no-repeat;
+ float: left;
+ width: 10px;
+ height: 47px;
+}
+
+.portlet_button a:hover .big_btn_left {
+ background: transparent url(../../resources/graphics/btn_left_ro.gif) top left no-repeat;
+}
+
+.portlet_button a:hover .big_btn_middle {
+ background: transparent url(../../resources/graphics/btn_middle_ro.gif) repeat-x;
+}
+
+.portlet_button a:hover .big_btn_right {
+ background: transparent url(../../resources/graphics/btn_right_ro.gif) top right no-repeat;
+}
+
+
/* =========== standard listings. */
@@ -2160,7 +2239,7 @@ body #content #add_dashlet
vertical-align: top;
}
-/* Search widget - override ExtJS CSS */
+/* ================= Search widget - override ExtJS CSS ================= */
.x-toolbar{
border: none;
diff --git a/resources/graphics/btn_left.gif b/resources/graphics/btn_left.gif
new file mode 100644
index 0000000..6241bb1
--- /dev/null
+++ b/resources/graphics/btn_left.gif
diff --git a/resources/graphics/btn_left_ro.gif b/resources/graphics/btn_left_ro.gif
new file mode 100644
index 0000000..b9a88ed
--- /dev/null
+++ b/resources/graphics/btn_left_ro.gif
diff --git a/resources/graphics/btn_middle.gif b/resources/graphics/btn_middle.gif
new file mode 100644
index 0000000..59f6fe5
--- /dev/null
+++ b/resources/graphics/btn_middle.gif
diff --git a/resources/graphics/btn_middle_ro.gif b/resources/graphics/btn_middle_ro.gif
new file mode 100644
index 0000000..31cc6bb
--- /dev/null
+++ b/resources/graphics/btn_middle_ro.gif
diff --git a/resources/graphics/btn_right.gif b/resources/graphics/btn_right.gif
new file mode 100644
index 0000000..9ab1f8b
--- /dev/null
+++ b/resources/graphics/btn_right.gif
diff --git a/resources/graphics/btn_right_ro.gif b/resources/graphics/btn_right_ro.gif
new file mode 100644
index 0000000..b5dc908
--- /dev/null
+++ b/resources/graphics/btn_right_ro.gif
diff --git a/resources/graphics/download_arrow.gif b/resources/graphics/download_arrow.gif
new file mode 100644
index 0000000..c5e1e6b
--- /dev/null
+++ b/resources/graphics/download_arrow.gif
diff --git a/resources/graphics/upload_arrow.gif b/resources/graphics/upload_arrow.gif
new file mode 100644
index 0000000..0a668c4
--- /dev/null
+++ b/resources/graphics/upload_arrow.gif
diff --git a/templates/kt3/portlets/actions_portlet.smarty b/templates/kt3/portlets/actions_portlet.smarty
index e271fc4..fe95616 100644
--- a/templates/kt3/portlets/actions_portlet.smarty
+++ b/templates/kt3/portlets/actions_portlet.smarty
@@ -1,3 +1,6 @@
+{if $showBtn}
+{$btn}
+{/if}