Commit 0839af47a36f41d06f872f0c7b28ce967f00ddad
Merge branch 'edge' of github.com:ktgit/knowledgetree into edge
Showing
6 changed files
with
156 additions
and
29 deletions
plugins/ktcore/KTWidgets.php
| @@ -1165,6 +1165,8 @@ class KTCoreImageSelectWidget extends KTWidget { | @@ -1165,6 +1165,8 @@ class KTCoreImageSelectWidget extends KTWidget { | ||
| 1165 | $oTemplate = $oTemplating->loadTemplate('ktcore/forms/widgets/base'); | 1165 | $oTemplate = $oTemplating->loadTemplate('ktcore/forms/widgets/base'); |
| 1166 | 1166 | ||
| 1167 | $this->aJavascript[] = 'thirdpartyjs/jquery/jquery-1.3.2.js'; | 1167 | $this->aJavascript[] = 'thirdpartyjs/jquery/jquery-1.3.2.js'; |
| 1168 | + $this->aJavascript[] = 'thirdpartyjs/jquery/plugins/selectimage/jquery.selectimage.js'; | ||
| 1169 | + $this->aJavascript[] = 'resources/js/kt_selectimage.js'; | ||
| 1168 | 1170 | ||
| 1169 | if (!empty($this->aJavascript)) { | 1171 | if (!empty($this->aJavascript)) { |
| 1170 | // grab our inner page. | 1172 | // grab our inner page. |
| @@ -1172,14 +1174,15 @@ class KTCoreImageSelectWidget extends KTWidget { | @@ -1172,14 +1174,15 @@ class KTCoreImageSelectWidget extends KTWidget { | ||
| 1172 | $oPage->requireJSResources($this->aJavascript); | 1174 | $oPage->requireJSResources($this->aJavascript); |
| 1173 | } | 1175 | } |
| 1174 | 1176 | ||
| 1175 | - $this->aCSS[] = 'resources/css/kt_imageselect.css'; | 1177 | + //$this->aCSS[] = 'resources/css/kt_imageselect.css'; |
| 1178 | + $this->aCSS[] = 'thirdpartyjs/jquery/plugins/selectimage/css/selectimage.css'; | ||
| 1176 | 1179 | ||
| 1177 | if (!empty($this->aCSS)) { | 1180 | if (!empty($this->aCSS)) { |
| 1178 | // grab our inner page. | 1181 | // grab our inner page. |
| 1179 | $oPage =& $GLOBALS['main']; | 1182 | $oPage =& $GLOBALS['main']; |
| 1180 | $oPage->requireCSSResources($this->aCSS); | 1183 | $oPage->requireCSSResources($this->aCSS); |
| 1181 | } | 1184 | } |
| 1182 | - | 1185 | + |
| 1183 | $widget_content = $this->getWidget(); | 1186 | $widget_content = $this->getWidget(); |
| 1184 | 1187 | ||
| 1185 | $aTemplateData = array( | 1188 | $aTemplateData = array( |
resources/js/kt_selectimage.js
0 → 100755
setup/wizard/templates/complete.tpl
| @@ -34,17 +34,22 @@ | @@ -34,17 +34,22 @@ | ||
| 34 | <br/> | 34 | <br/> |
| 35 | [START MENU] => [Programs] => [KnowledgeTree 3.7.x] => [services] | 35 | [START MENU] => [Programs] => [KnowledgeTree 3.7.x] => [services] |
| 36 | <br/> | 36 | <br/> |
| 37 | - Right-Click and run [Install Services] as administrator | 37 | + Right-Click and run [Install Services] as administrator, if applicable, or |
| 38 | + <br/> | ||
| 39 | + Click [Install Services] | ||
| 38 | <br/> | 40 | <br/> |
| 39 | [START MENU] => [Programs] => [KnowledgeTree 3.7.x] => [services] | 41 | [START MENU] => [Programs] => [KnowledgeTree 3.7.x] => [services] |
| 40 | <br/> | 42 | <br/> |
| 41 | - Right-Click and run [Start Services] as administrator | 43 | + Right-Click and run [Start Services] as administrator, if applicable, or |
| 44 | + <br/> | ||
| 45 | + Click [Start Services] | ||
| 42 | <br/> | 46 | <br/> |
| 43 | <br/> | 47 | <br/> |
| 44 | <b>Alternatively:</b> | 48 | <b>Alternatively:</b> |
| 45 | <br/> | 49 | <br/> |
| 46 | Open a command prompt and enter the following: | 50 | Open a command prompt and enter the following: |
| 47 | <br/> | 51 | <br/> |
| 52 | + <br/> | ||
| 48 | cd <?php echo "\"".SYSTEM_DIR."\""; ?> <br/> | 53 | cd <?php echo "\"".SYSTEM_DIR."\""; ?> <br/> |
| 49 | dmsctl.bat install<br/> | 54 | dmsctl.bat install<br/> |
| 50 | dmsctl.bat start | 55 | dmsctl.bat start |
templates/ktcore/forms/widgets/imageselect.smarty
| @@ -2,32 +2,17 @@ | @@ -2,32 +2,17 @@ | ||
| 2 | <field> | 2 | <field> |
| 3 | <div id="kt_image_select_container"> | 3 | <div id="kt_image_select_container"> |
| 4 | 4 | ||
| 5 | - {foreach key=id item=src from=$value} | 5 | + <input type="hidden" id="selectimage_src" name="selectimage_src" value=""> |
| 6 | + <input type="hidden" id="selectimage_alt" name="selectimage_alt" value=""> | ||
| 7 | + <input type="hidden" id="selectimage_title" name="selectimage_title" value=""> | ||
| 8 | + <input type="hidden" id="selectimage_name" name="selectimage_name" value=""> | ||
| 9 | + <input type="hidden" id="selectimage_id" name="selectimage_id" value=""> | ||
| 6 | 10 | ||
| 7 | - <div class="jq_select_image"> | ||
| 8 | - <img class="kt_image_select" id="kt_image_select_{$id}" src="{$src}" border="0"/> | ||
| 9 | - </div> | ||
| 10 | - <script type="text/javascript"> | ||
| 11 | - var toggle_{$id} = 1; | ||
| 12 | - var selected = ''; | ||
| 13 | - | ||
| 14 | - var multiselect = false; | ||
| 15 | - | ||
| 16 | - var hover = '#f9f9f9'; | ||
| 17 | - var click = '#f2943a'; //Orange | ||
| 18 | - var background_color = 'white'; //also set in css | ||
| 19 | - | ||
| 20 | - jQuery('#kt_image_select_{$id}').click(function(){ldelim} | ||
| 21 | - jQuery('#kt_image_select').val('{$src}'); | ||
| 22 | - | ||
| 23 | - //Resetting background: | ||
| 24 | - jQuery("img[id*='kt_image_select_']").css('border', '10px solid ' + background_color); | ||
| 25 | - jQuery('#kt_image_select_{$id}').css('border', '10px solid ' + click); | ||
| 26 | - | ||
| 27 | - {rdelim}) | ||
| 28 | - </script> | ||
| 29 | - | ||
| 30 | - {/foreach} | 11 | + {foreach key=id item=src from=$value} |
| 12 | + <div class="jq_select_image"> | ||
| 13 | + <img class="kt_image_select" id="kt_image_select_{$id}" src="{$src}" border="0"/> | ||
| 14 | + </div> | ||
| 15 | + {/foreach} | ||
| 31 | 16 | ||
| 32 | </div> | 17 | </div> |
| 33 | 18 |
thirdpartyjs/jquery/plugins/selectimage/css/selectimage.css
0 → 100644
| 1 | +#selectimage_container img { | ||
| 2 | + cursor: pointer; | ||
| 3 | + text-decoration: none; | ||
| 4 | + border: 10px solid white; | ||
| 5 | +} | ||
| 6 | + | ||
| 7 | +#selectimage_container img:hover { | ||
| 8 | + text-decoration: none; | ||
| 9 | + border: 10px solid white; | ||
| 10 | +} | ||
| 11 | + | ||
| 12 | +.jq_select_image { | ||
| 13 | + float: left; | ||
| 14 | + border: 1px solid #cccccc; | ||
| 15 | + margin-right: 5px; | ||
| 16 | + padding: 0px; | ||
| 17 | + display:inline; | ||
| 18 | + height:70px; | ||
| 19 | +} | ||
| 20 | + | ||
| 21 | +.selectimage_border_background { | ||
| 22 | + border: 10px solid white; | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +.selectimage_border_hover { | ||
| 26 | + border: 10px solid #9c9c9c; | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +.selectimage_border_click { | ||
| 30 | + border: 10px solid #f2943a; | ||
| 31 | +} | ||
| 0 | \ No newline at end of file | 32 | \ No newline at end of file |
thirdpartyjs/jquery/plugins/selectimage/jquery.selectimage.js
0 → 100755
| 1 | +/** | ||
| 2 | + * jQuery Select Image Plugin | ||
| 3 | + * | ||
| 4 | + * @author Charl Mert <charl@knowledgetree.com> | ||
| 5 | + * | ||
| 6 | + * KnowledgeTree Community Edition | ||
| 7 | + * Document Management Made Simple | ||
| 8 | + * Copyright (C) 2009, 2010 KnowledgeTree Inc. | ||
| 9 | + * | ||
| 10 | + * This program is free software; you can redistribute it and/or modify it under | ||
| 11 | + * the terms of the GNU General Public License version 3 as published by the | ||
| 12 | + * Free Software Foundation. | ||
| 13 | + * | ||
| 14 | + * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 15 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
| 16 | + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
| 17 | + * details. | ||
| 18 | + * | ||
| 19 | + * You should have received a copy of the GNU General Public License | ||
| 20 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 21 | + * | ||
| 22 | + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, | ||
| 23 | + * California 94120-7775, or email info@knowledgetree.com. | ||
| 24 | + * | ||
| 25 | + * The interactive user interfaces in modified source and object code versions | ||
| 26 | + * of this program must display Appropriate Legal Notices, as required under | ||
| 27 | + * Section 5 of the GNU General Public License version 3. | ||
| 28 | + * | ||
| 29 | + * In accordance with Section 7(b) of the GNU General Public License version 3, | ||
| 30 | + * these Appropriate Legal Notices must retain the display of the "Powered by | ||
| 31 | + * KnowledgeTree" logo and retain the original copyright notice. If the display of the | ||
| 32 | + * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices | ||
| 33 | + * must display the words "Powered by KnowledgeTree" and retain the original | ||
| 34 | + * copyright notice. | ||
| 35 | + * Contributor( s): ______________________________________ | ||
| 36 | + */ | ||
| 37 | + | ||
| 38 | +jQuery.fn.selectImage = function() { | ||
| 39 | + return this.each(function(){ | ||
| 40 | + | ||
| 41 | + var opt = jQuery.extend({ | ||
| 42 | + passBackNamespace : 'selectimage', //TODO: Let plugin detect parent form and produce the hidden inputs. For now the user has to place the predefined hidden inputs onto the form manually. | ||
| 43 | + multiselect : false, | ||
| 44 | + hover : '#e2e2e2', | ||
| 45 | + click : '#f2943a', //Orange | ||
| 46 | + background : 'white', | ||
| 47 | + selected : '' | ||
| 48 | + }, opt); | ||
| 49 | + | ||
| 50 | + var containerId = this.id; | ||
| 51 | + var custId = 0; | ||
| 52 | + | ||
| 53 | + //Setting up border | ||
| 54 | + jQuery('#' + containerId + ' img' ).css('border', '10px solid ' + opt.background); | ||
| 55 | + | ||
| 56 | + jQuery('#' + containerId + ' img').each(function(){ | ||
| 57 | + //Assigning custom id's to attach event handlers to | ||
| 58 | + if (this.id == '') { | ||
| 59 | + this.id = 'select_image_img_' + custId; | ||
| 60 | + custId++; | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + var toggle = 1; | ||
| 64 | + | ||
| 65 | + //Click to select | ||
| 66 | + jQuery('#' + this.id).click(function(){ | ||
| 67 | + opt.selected = this.id; | ||
| 68 | + jQuery('#' + opt.passBackNamespace + '_src').val(this.src); | ||
| 69 | + jQuery('#' + opt.passBackNamespace + '_alt').val(this.alt); | ||
| 70 | + jQuery('#' + opt.passBackNamespace + '_title').val(this.title); | ||
| 71 | + | ||
| 72 | + //Resetting background: | ||
| 73 | + jQuery('#' + containerId + ' img' ).css('border', '10px solid ' + opt.background); | ||
| 74 | + jQuery('#' + this.id).css('border', '10px solid ' + opt.click); | ||
| 75 | + }) | ||
| 76 | + | ||
| 77 | + //Hover Effect | ||
| 78 | + jQuery('#' + this.id).mouseenter(function(){ | ||
| 79 | + if (this.id != opt.selected) { | ||
| 80 | + jQuery('#' + this.id).css('border', '10px solid ' + opt.hover).show("slow"); | ||
| 81 | + } | ||
| 82 | + }) | ||
| 83 | + | ||
| 84 | + jQuery('#' + this.id).mouseleave(function(){ | ||
| 85 | + if (this.id != opt.selected) { | ||
| 86 | + jQuery('#' + this.id).css('border', '10px solid ' + opt.background).show("slow"); | ||
| 87 | + } | ||
| 88 | + }) | ||
| 89 | + | ||
| 90 | + }); | ||
| 91 | + }); | ||
| 92 | +}; | ||
| 93 | + | ||
| 94 | +jQuery.log = function(message) { | ||
| 95 | + if(window.console) { | ||
| 96 | + console.debug(message); | ||
| 97 | + } else { | ||
| 98 | + alert(message); | ||
| 99 | + } | ||
| 100 | +}; | ||
| 0 | \ No newline at end of file | 101 | \ No newline at end of file |