From 69bffb7fe85347621f41c0baed839452e72930e1 Mon Sep 17 00:00:00 2001 From: Patrick Seeger Date: Fri, 13 Apr 2012 23:44:38 +0200 Subject: Erstes Yii Projekt --- .buildpath | 5 + .project | 22 + .settings/org.eclipse.php.core.prefs | 2 + assets/4988dfef/autocomplete/indicator.gif | Bin 0 -> 1553 bytes .../4988dfef/autocomplete/jquery.autocomplete.css | 48 + assets/4988dfef/jquery.ajaxqueue.js | 116 + assets/4988dfef/jquery.autocomplete.js | 813 ++ assets/4988dfef/jquery.ba-bbq.js | 1137 +++ assets/4988dfef/jquery.bgiframe.js | 39 + assets/4988dfef/jquery.cookie.js | 92 + assets/4988dfef/jquery.js | 9266 ++++++++++++++++++++ assets/4988dfef/jquery.maskedinput.js | 258 + assets/4988dfef/jquery.maskedinput.min.js | 7 + assets/4988dfef/jquery.metadata.js | 148 + assets/4988dfef/jquery.min.js | 4 + assets/4988dfef/jquery.multifile.js | 536 ++ assets/4988dfef/jquery.rating.js | 381 + assets/4988dfef/jquery.treeview.async.js | 110 + assets/4988dfef/jquery.treeview.edit.js | 37 + assets/4988dfef/jquery.treeview.js | 256 + assets/4988dfef/jquery.yii.js | 53 + assets/4988dfef/jquery.yiiactiveform.js | 426 + assets/4988dfef/jquery.yiitab.js | 50 + assets/4988dfef/jui/MIT-LICENSE.txt | 25 + .../css/base/images/ui-bg_flat_0_aaaaaa_40x100.png | Bin 0 -> 86 bytes .../base/images/ui-bg_flat_75_ffffff_40x100.png | Bin 0 -> 75 bytes .../base/images/ui-bg_glass_55_fbf9ee_1x400.png | Bin 0 -> 144 bytes .../base/images/ui-bg_glass_65_ffffff_1x400.png | Bin 0 -> 99 bytes .../base/images/ui-bg_glass_75_dadada_1x400.png | Bin 0 -> 142 bytes .../base/images/ui-bg_glass_75_e6e6e6_1x400.png | Bin 0 -> 137 bytes .../base/images/ui-bg_glass_95_fef1ec_1x400.png | Bin 0 -> 140 bytes .../ui-bg_highlight-soft_75_cccccc_1x100.png | Bin 0 -> 86 bytes .../css/base/images/ui-icons_222222_256x240.png | Bin 0 -> 3800 bytes .../css/base/images/ui-icons_2e83ff_256x240.png | Bin 0 -> 3800 bytes .../css/base/images/ui-icons_454545_256x240.png | Bin 0 -> 3800 bytes .../css/base/images/ui-icons_888888_256x240.png | Bin 0 -> 3800 bytes .../css/base/images/ui-icons_cd0a0a_256x240.png | Bin 0 -> 3800 bytes assets/4988dfef/jui/css/base/jquery-ui.css | 10 + .../4988dfef/jui/css/base/jquery.ui.accordion.css | 10 + assets/4988dfef/jui/css/base/jquery.ui.all.css | 10 + .../jui/css/base/jquery.ui.autocomplete.css | 10 + assets/4988dfef/jui/css/base/jquery.ui.base.css | 10 + assets/4988dfef/jui/css/base/jquery.ui.button.css | 10 + assets/4988dfef/jui/css/base/jquery.ui.core.css | 10 + .../4988dfef/jui/css/base/jquery.ui.datepicker.css | 10 + assets/4988dfef/jui/css/base/jquery.ui.dialog.css | 10 + .../jui/css/base/jquery.ui.progressbar.css | 10 + .../4988dfef/jui/css/base/jquery.ui.resizable.css | 10 + .../4988dfef/jui/css/base/jquery.ui.selectable.css | 10 + assets/4988dfef/jui/css/base/jquery.ui.slider.css | 10 + assets/4988dfef/jui/css/base/jquery.ui.tabs.css | 10 + assets/4988dfef/jui/css/base/jquery.ui.theme.css | 12 + assets/4988dfef/jui/js/jquery-ui-i18n.min.js | 2 + assets/4988dfef/jui/js/jquery-ui.min.js | 15 + assets/4988dfef/rating/delete.gif | Bin 0 -> 752 bytes assets/4988dfef/rating/jquery.rating.css | 12 + assets/4988dfef/rating/star.gif | Bin 0 -> 815 bytes assets/4988dfef/treeview/images/ajax-loader.gif | Bin 0 -> 847 bytes assets/4988dfef/treeview/images/file.gif | Bin 0 -> 110 bytes assets/4988dfef/treeview/images/folder-closed.gif | Bin 0 -> 105 bytes assets/4988dfef/treeview/images/folder.gif | Bin 0 -> 106 bytes assets/4988dfef/treeview/images/minus.gif | Bin 0 -> 837 bytes assets/4988dfef/treeview/images/plus.gif | Bin 0 -> 841 bytes .../treeview/images/treeview-black-line.gif | Bin 0 -> 1877 bytes assets/4988dfef/treeview/images/treeview-black.gif | Bin 0 -> 1216 bytes .../treeview/images/treeview-default-line.gif | Bin 0 -> 1993 bytes .../4988dfef/treeview/images/treeview-default.gif | Bin 0 -> 1222 bytes .../treeview/images/treeview-famfamfam-line.gif | Bin 0 -> 807 bytes .../treeview/images/treeview-famfamfam.gif | Bin 0 -> 1280 bytes .../treeview/images/treeview-gray-line.gif | Bin 0 -> 1877 bytes assets/4988dfef/treeview/images/treeview-gray.gif | Bin 0 -> 1230 bytes .../4988dfef/treeview/images/treeview-red-line.gif | Bin 0 -> 1877 bytes assets/4988dfef/treeview/images/treeview-red.gif | Bin 0 -> 1230 bytes assets/4988dfef/treeview/jquery.treeview.css | 74 + assets/4988dfef/yiitab/jquery.yiitab.css | 58 + css/bg.gif | Bin 0 -> 243 bytes css/form.css | 160 + css/ie.css | 36 + css/main.css | 229 + css/print.css | 29 + css/screen.css | 238 + index-test.php | 15 + index.php | 13 + protected/.htaccess | 1 + protected/components/Controller.php | 23 + protected/components/UserIdentity.php | 33 + protected/config/console.php | 24 + protected/config/main.php | 90 + protected/config/test.php | 17 + protected/controllers/SiteController.php | 103 + protected/data/schema.mysql.sql | 28 + protected/data/schema.sqlite.sql | 28 + protected/data/testdrive.db | Bin 0 -> 3072 bytes protected/models/ContactForm.php | 42 + protected/models/LoginForm.php | 77 + protected/tests/WebTestCase.php | 25 + protected/tests/bootstrap.php | 10 + protected/tests/functional/SiteTest.php | 47 + protected/tests/phpunit.xml | 13 + protected/views/layouts/column1.php | 5 + protected/views/layouts/column2.php | 21 + protected/views/layouts/main.php | 58 + protected/views/site/contact.php | 81 + protected/views/site/error.php | 12 + protected/views/site/index.php | 16 + protected/views/site/login.php | 49 + protected/views/site/pages/about.php | 10 + protected/yiic | 4 + protected/yiic.bat | 16 + protected/yiic.php | 7 + themes/classic/views/.htaccess | 1 + 111 files changed, 15705 insertions(+) create mode 100644 .buildpath create mode 100644 .project create mode 100644 .settings/org.eclipse.php.core.prefs create mode 100644 assets/4988dfef/autocomplete/indicator.gif create mode 100644 assets/4988dfef/autocomplete/jquery.autocomplete.css create mode 100644 assets/4988dfef/jquery.ajaxqueue.js create mode 100644 assets/4988dfef/jquery.autocomplete.js create mode 100644 assets/4988dfef/jquery.ba-bbq.js create mode 100644 assets/4988dfef/jquery.bgiframe.js create mode 100644 assets/4988dfef/jquery.cookie.js create mode 100644 assets/4988dfef/jquery.js create mode 100644 assets/4988dfef/jquery.maskedinput.js create mode 100644 assets/4988dfef/jquery.maskedinput.min.js create mode 100644 assets/4988dfef/jquery.metadata.js create mode 100644 assets/4988dfef/jquery.min.js create mode 100644 assets/4988dfef/jquery.multifile.js create mode 100644 assets/4988dfef/jquery.rating.js create mode 100644 assets/4988dfef/jquery.treeview.async.js create mode 100644 assets/4988dfef/jquery.treeview.edit.js create mode 100644 assets/4988dfef/jquery.treeview.js create mode 100644 assets/4988dfef/jquery.yii.js create mode 100644 assets/4988dfef/jquery.yiiactiveform.js create mode 100644 assets/4988dfef/jquery.yiitab.js create mode 100644 assets/4988dfef/jui/MIT-LICENSE.txt create mode 100644 assets/4988dfef/jui/css/base/images/ui-bg_flat_0_aaaaaa_40x100.png create mode 100644 assets/4988dfef/jui/css/base/images/ui-bg_flat_75_ffffff_40x100.png create mode 100644 assets/4988dfef/jui/css/base/images/ui-bg_glass_55_fbf9ee_1x400.png create mode 100644 assets/4988dfef/jui/css/base/images/ui-bg_glass_65_ffffff_1x400.png create mode 100644 assets/4988dfef/jui/css/base/images/ui-bg_glass_75_dadada_1x400.png create mode 100644 assets/4988dfef/jui/css/base/images/ui-bg_glass_75_e6e6e6_1x400.png create mode 100644 assets/4988dfef/jui/css/base/images/ui-bg_glass_95_fef1ec_1x400.png create mode 100644 assets/4988dfef/jui/css/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png create mode 100644 assets/4988dfef/jui/css/base/images/ui-icons_222222_256x240.png create mode 100644 assets/4988dfef/jui/css/base/images/ui-icons_2e83ff_256x240.png create mode 100644 assets/4988dfef/jui/css/base/images/ui-icons_454545_256x240.png create mode 100644 assets/4988dfef/jui/css/base/images/ui-icons_888888_256x240.png create mode 100644 assets/4988dfef/jui/css/base/images/ui-icons_cd0a0a_256x240.png create mode 100644 assets/4988dfef/jui/css/base/jquery-ui.css create mode 100644 assets/4988dfef/jui/css/base/jquery.ui.accordion.css create mode 100644 assets/4988dfef/jui/css/base/jquery.ui.all.css create mode 100644 assets/4988dfef/jui/css/base/jquery.ui.autocomplete.css create mode 100644 assets/4988dfef/jui/css/base/jquery.ui.base.css create mode 100644 assets/4988dfef/jui/css/base/jquery.ui.button.css create mode 100644 assets/4988dfef/jui/css/base/jquery.ui.core.css create mode 100644 assets/4988dfef/jui/css/base/jquery.ui.datepicker.css create mode 100644 assets/4988dfef/jui/css/base/jquery.ui.dialog.css create mode 100644 assets/4988dfef/jui/css/base/jquery.ui.progressbar.css create mode 100644 assets/4988dfef/jui/css/base/jquery.ui.resizable.css create mode 100644 assets/4988dfef/jui/css/base/jquery.ui.selectable.css create mode 100644 assets/4988dfef/jui/css/base/jquery.ui.slider.css create mode 100644 assets/4988dfef/jui/css/base/jquery.ui.tabs.css create mode 100644 assets/4988dfef/jui/css/base/jquery.ui.theme.css create mode 100644 assets/4988dfef/jui/js/jquery-ui-i18n.min.js create mode 100644 assets/4988dfef/jui/js/jquery-ui.min.js create mode 100644 assets/4988dfef/rating/delete.gif create mode 100644 assets/4988dfef/rating/jquery.rating.css create mode 100644 assets/4988dfef/rating/star.gif create mode 100644 assets/4988dfef/treeview/images/ajax-loader.gif create mode 100644 assets/4988dfef/treeview/images/file.gif create mode 100644 assets/4988dfef/treeview/images/folder-closed.gif create mode 100644 assets/4988dfef/treeview/images/folder.gif create mode 100644 assets/4988dfef/treeview/images/minus.gif create mode 100644 assets/4988dfef/treeview/images/plus.gif create mode 100644 assets/4988dfef/treeview/images/treeview-black-line.gif create mode 100644 assets/4988dfef/treeview/images/treeview-black.gif create mode 100644 assets/4988dfef/treeview/images/treeview-default-line.gif create mode 100644 assets/4988dfef/treeview/images/treeview-default.gif create mode 100644 assets/4988dfef/treeview/images/treeview-famfamfam-line.gif create mode 100644 assets/4988dfef/treeview/images/treeview-famfamfam.gif create mode 100644 assets/4988dfef/treeview/images/treeview-gray-line.gif create mode 100644 assets/4988dfef/treeview/images/treeview-gray.gif create mode 100644 assets/4988dfef/treeview/images/treeview-red-line.gif create mode 100644 assets/4988dfef/treeview/images/treeview-red.gif create mode 100644 assets/4988dfef/treeview/jquery.treeview.css create mode 100644 assets/4988dfef/yiitab/jquery.yiitab.css create mode 100644 css/bg.gif create mode 100644 css/form.css create mode 100644 css/ie.css create mode 100644 css/main.css create mode 100644 css/print.css create mode 100644 css/screen.css create mode 100644 index-test.php create mode 100644 index.php create mode 100644 protected/.htaccess create mode 100644 protected/components/Controller.php create mode 100644 protected/components/UserIdentity.php create mode 100644 protected/config/console.php create mode 100644 protected/config/main.php create mode 100644 protected/config/test.php create mode 100644 protected/controllers/SiteController.php create mode 100644 protected/data/schema.mysql.sql create mode 100644 protected/data/schema.sqlite.sql create mode 100644 protected/data/testdrive.db create mode 100644 protected/models/ContactForm.php create mode 100644 protected/models/LoginForm.php create mode 100644 protected/tests/WebTestCase.php create mode 100644 protected/tests/bootstrap.php create mode 100644 protected/tests/functional/SiteTest.php create mode 100644 protected/tests/phpunit.xml create mode 100644 protected/views/layouts/column1.php create mode 100644 protected/views/layouts/column2.php create mode 100644 protected/views/layouts/main.php create mode 100644 protected/views/site/contact.php create mode 100644 protected/views/site/error.php create mode 100644 protected/views/site/index.php create mode 100644 protected/views/site/login.php create mode 100644 protected/views/site/pages/about.php create mode 100644 protected/yiic create mode 100644 protected/yiic.bat create mode 100644 protected/yiic.php create mode 100644 themes/classic/views/.htaccess diff --git a/.buildpath b/.buildpath new file mode 100644 index 0000000..8bcb4b5 --- /dev/null +++ b/.buildpath @@ -0,0 +1,5 @@ + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..f2378a9 --- /dev/null +++ b/.project @@ -0,0 +1,22 @@ + + + www.astaf.de + + + + + + org.eclipse.wst.validation.validationbuilder + + + + + org.eclipse.dltk.core.scriptbuilder + + + + + + org.eclipse.php.core.PHPNature + + diff --git a/.settings/org.eclipse.php.core.prefs b/.settings/org.eclipse.php.core.prefs new file mode 100644 index 0000000..9309083 --- /dev/null +++ b/.settings/org.eclipse.php.core.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +include_path=0;/www.astaf.de diff --git a/assets/4988dfef/autocomplete/indicator.gif b/assets/4988dfef/autocomplete/indicator.gif new file mode 100644 index 0000000..085ccae Binary files /dev/null and b/assets/4988dfef/autocomplete/indicator.gif differ diff --git a/assets/4988dfef/autocomplete/jquery.autocomplete.css b/assets/4988dfef/autocomplete/jquery.autocomplete.css new file mode 100644 index 0000000..91b6228 --- /dev/null +++ b/assets/4988dfef/autocomplete/jquery.autocomplete.css @@ -0,0 +1,48 @@ +.ac_results { + padding: 0px; + border: 1px solid black; + background-color: white; + overflow: hidden; + z-index: 99999; +} + +.ac_results ul { + width: 100%; + list-style-position: outside; + list-style: none; + padding: 0; + margin: 0; +} + +.ac_results li { + margin: 0px; + padding: 2px 5px; + cursor: default; + display: block; + /* + if width will be 100% horizontal scrollbar will apear + when scroll mode will be used + */ + /*width: 100%;*/ + font: menu; + font-size: 12px; + /* + it is very important, if line-height not setted or setted + in relative units scroll will be broken in firefox + */ + line-height: 16px; + overflow: hidden; +} + +.ac_loading { + background: white url('indicator.gif') right center no-repeat; +} + +.ac_odd { + background-color: #eee; +} + +.ac_over { + background-color: #0A246A; + color: white; +} diff --git a/assets/4988dfef/jquery.ajaxqueue.js b/assets/4988dfef/jquery.ajaxqueue.js new file mode 100644 index 0000000..ca42082 --- /dev/null +++ b/assets/4988dfef/jquery.ajaxqueue.js @@ -0,0 +1,116 @@ +/** + * Ajax Queue Plugin + * + * Homepage: http://jquery.com/plugins/project/ajaxqueue + * Documentation: http://docs.jquery.com/AjaxQueue + */ + +/** + + + + + */ +/* + * Queued Ajax requests. + * A new Ajax request won't be started until the previous queued + * request has finished. + */ + +/* + * Synced Ajax requests. + * The Ajax request will happen as soon as you call this method, but + * the callbacks (success/error/complete) won't fire until all previous + * synced requests have been completed. + */ + + +(function($) { + + var ajax = $.ajax; + + var pendingRequests = {}; + + var synced = []; + var syncedData = []; + + $.ajax = function(settings) { + // create settings for compatibility with ajaxSetup + settings = jQuery.extend(settings, jQuery.extend({}, jQuery.ajaxSettings, settings)); + + var port = settings.port; + + switch(settings.mode) { + case "abort": + if ( pendingRequests[port] ) { + pendingRequests[port].abort(); + } + return pendingRequests[port] = ajax.apply(this, arguments); + case "queue": + var _old = settings.complete; + settings.complete = function(){ + if ( _old ) + _old.apply( this, arguments ); + jQuery([ajax]).dequeue("ajax" + port );; + }; + + jQuery([ ajax ]).queue("ajax" + port, function(){ + ajax( settings ); + }); + return; + case "sync": + var pos = synced.length; + + synced[ pos ] = { + error: settings.error, + success: settings.success, + complete: settings.complete, + done: false + }; + + syncedData[ pos ] = { + error: [], + success: [], + complete: [] + }; + + settings.error = function(){ syncedData[ pos ].error = arguments; }; + settings.success = function(){ syncedData[ pos ].success = arguments; }; + settings.complete = function(){ + syncedData[ pos ].complete = arguments; + synced[ pos ].done = true; + + if ( pos == 0 || !synced[ pos-1 ] ) + for ( var i = pos; i < synced.length && synced[i].done; i++ ) { + if ( synced[i].error ) synced[i].error.apply( jQuery, syncedData[i].error ); + if ( synced[i].success ) synced[i].success.apply( jQuery, syncedData[i].success ); + if ( synced[i].complete ) synced[i].complete.apply( jQuery, syncedData[i].complete ); + + synced[i] = null; + syncedData[i] = null; + } + }; + } + return ajax.apply(this, arguments); + }; + +})(jQuery); \ No newline at end of file diff --git a/assets/4988dfef/jquery.autocomplete.js b/assets/4988dfef/jquery.autocomplete.js new file mode 100644 index 0000000..324b104 --- /dev/null +++ b/assets/4988dfef/jquery.autocomplete.js @@ -0,0 +1,813 @@ +/* + * jQuery Autocomplete plugin 1.1 + * + * Modified for Yii Framework: + * - Renamed "autocomplete" to "legacyautocomplete". + * - Fixed IE8 problems (mario.ffranco). + * + * Copyright (c) 2009 Jörn Zaefferer + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $ + */ + +;(function($) { + +$.fn.extend({ + legacyautocomplete: function(urlOrData, options) { + var isUrl = typeof urlOrData == "string"; + options = $.extend({}, $.Autocompleter.defaults, { + url: isUrl ? urlOrData : null, + data: isUrl ? null : urlOrData, + delay: isUrl ? $.Autocompleter.defaults.delay : 10, + max: options && !options.scroll ? 10 : 150 + }, options); + + // if highlight is set to false, replace it with a do-nothing function + options.highlight = options.highlight || function(value) { return value; }; + + // if the formatMatch option is not specified, then use formatItem for backwards compatibility + options.formatMatch = options.formatMatch || options.formatItem; + + return this.each(function() { + new $.Autocompleter(this, options); + }); + }, + result: function(handler) { + return this.bind("result", handler); + }, + search: function(handler) { + return this.trigger("search", [handler]); + }, + flushCache: function() { + return this.trigger("flushCache"); + }, + setOptions: function(options){ + return this.trigger("setOptions", [options]); + }, + unautocomplete: function() { + return this.trigger("unautocomplete"); + } +}); + +$.Autocompleter = function(input, options) { + + var KEY = { + UP: 38, + DOWN: 40, + DEL: 46, + TAB: 9, + RETURN: 13, + ESC: 27, + COMMA: 188, + PAGEUP: 33, + PAGEDOWN: 34, + BACKSPACE: 8 + }; + + // Create $ object for input element + var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass); + + var timeout; + var previousValue = ""; + var cache = $.Autocompleter.Cache(options); + var hasFocus = 0; + var lastKeyPressCode; + var config = { + mouseDownOnSelect: false + }; + var select = $.Autocompleter.Select(options, input, selectCurrent, config); + + var blockSubmit; + + // prevent form submit in opera when selecting with return key + $.browser.opera && $(input.form).bind("submit.autocomplete", function() { + if (blockSubmit) { + blockSubmit = false; + return false; + } + }); + + // only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all + $input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) { + // a keypress means the input has focus + // avoids issue where input had focus before the autocomplete was applied + hasFocus = 1; + // track last key pressed + lastKeyPressCode = event.keyCode; + switch(event.keyCode) { + + case KEY.UP: + event.preventDefault(); + if ( select.visible() ) { + select.prev(); + } else { + onChange(0, true); + } + break; + + case KEY.DOWN: + event.preventDefault(); + if ( select.visible() ) { + select.next(); + } else { + onChange(0, true); + } + break; + + case KEY.PAGEUP: + event.preventDefault(); + if ( select.visible() ) { + select.pageUp(); + } else { + onChange(0, true); + } + break; + + case KEY.PAGEDOWN: + event.preventDefault(); + if ( select.visible() ) { + select.pageDown(); + } else { + onChange(0, true); + } + break; + + // matches also semicolon + case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA: + case KEY.TAB: + case KEY.RETURN: + if( selectCurrent() ) { + // stop default to prevent a form submit, Opera needs special handling + event.preventDefault(); + blockSubmit = true; + return false; + } + break; + + case KEY.ESC: + select.hide(); + break; + + default: + clearTimeout(timeout); + timeout = setTimeout(onChange, options.delay); + break; + } + }).focus(function(){ + // track whether the field has focus, we shouldn't process any + // results if the field no longer has focus + hasFocus++; + }).blur(function() { + hasFocus = 0; + if (!config.mouseDownOnSelect) { + hideResults(); + } + }).click(function() { + // show select when clicking in a focused field + if ( hasFocus++ > 1 && !select.visible() ) { + onChange(0, true); + } + }).bind("search", function() { + // TODO why not just specifying both arguments? + var fn = (arguments.length > 1) ? arguments[1] : null; + function findValueCallback(q, data) { + var result; + if( data && data.length ) { + for (var i=0; i < data.length; i++) { + if( data[i].result.toLowerCase() == q.toLowerCase() ) { + result = data[i]; + break; + } + } + } + if( typeof fn == "function" ) fn(result); + else $input.trigger("result", result && [result.data, result.value]); + } + $.each(trimWords($input.val()), function(i, value) { + request(value, findValueCallback, findValueCallback); + }); + }).bind("flushCache", function() { + cache.flush(); + }).bind("setOptions", function() { + $.extend(options, arguments[1]); + // if we've updated the data, repopulate + if ( "data" in arguments[1] ) + cache.populate(); + }).bind("unautocomplete", function() { + select.unbind(); + $input.unbind(); + $(input.form).unbind(".autocomplete"); + }); + + + function selectCurrent() { + var selected = select.selected(); + if( !selected ) + return false; + + var v = selected.result; + previousValue = v; + + if ( options.multiple ) { + var words = trimWords($input.val()); + if ( words.length > 1 ) { + var seperator = options.multipleSeparator.length; + var cursorAt = $(input).selection().start; + var wordAt, progress = 0; + $.each(words, function(i, word) { + progress += word.length; + if (cursorAt <= progress) { + wordAt = i; + // Following return caused IE8 to set cursor to the start of the line. + // return false; + } + progress += seperator; + }); + words[wordAt] = v; + // TODO this should set the cursor to the right position, but it gets overriden somewhere + //$.Autocompleter.Selection(input, progress + seperator, progress + seperator); + v = words.join( options.multipleSeparator ); + } + v += options.multipleSeparator; + } + + $input.val(v); + hideResultsNow(); + $input.trigger("result", [selected.data, selected.value]); + return true; + } + + function onChange(crap, skipPrevCheck) { + if( lastKeyPressCode == KEY.DEL ) { + select.hide(); + return; + } + + var currentValue = $input.val(); + + if ( !skipPrevCheck && currentValue == previousValue ) + return; + + previousValue = currentValue; + + currentValue = lastWord(currentValue); + if ( currentValue.length >= options.minChars) { + $input.addClass(options.loadingClass); + if (!options.matchCase) + currentValue = currentValue.toLowerCase(); + request(currentValue, receiveData, hideResultsNow); + } else { + stopLoading(); + select.hide(); + } + }; + + function trimWords(value) { + if (!value) + return [""]; + if (!options.multiple) + return [$.trim(value)]; + return $.map(value.split(options.multipleSeparator), function(word) { + return $.trim(value).length ? $.trim(word) : null; + }); + } + + function lastWord(value) { + if ( !options.multiple ) + return value; + var words = trimWords(value); + if (words.length == 1) + return words[0]; + var cursorAt = $(input).selection().start; + if (cursorAt == value.length) { + words = trimWords(value) + } else { + words = trimWords(value.replace(value.substring(cursorAt), "")); + } + return words[words.length - 1]; + } + + // fills in the input box w/the first match (assumed to be the best match) + // q: the term entered + // sValue: the first matching result + function autoFill(q, sValue){ + // autofill in the complete box w/the first match as long as the user hasn't entered in more data + // if the last user key pressed was backspace, don't autofill + if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) { + // fill in the value (keep the case the user has typed) + $input.val($input.val() + sValue.substring(lastWord(previousValue).length)); + // select the portion of the value not typed by the user (so the next character will erase) + $(input).selection(previousValue.length, previousValue.length + sValue.length); + } + }; + + function hideResults() { + clearTimeout(timeout); + timeout = setTimeout(hideResultsNow, 200); + }; + + function hideResultsNow() { + var wasVisible = select.visible(); + select.hide(); + clearTimeout(timeout); + stopLoading(); + if (options.mustMatch) { + // call search and run callback + $input.search( + function (result){ + // if no value found, clear the input box + if( !result ) { + if (options.multiple) { + var words = trimWords($input.val()).slice(0, -1); + $input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") ); + } + else { + $input.val( "" ); + $input.trigger("result", null); + } + } + } + ); + } + }; + + function receiveData(q, data) { + if ( data && data.length && hasFocus ) { + stopLoading(); + select.display(data, q); + autoFill(q, data[0].value); + select.show(); + } else { + hideResultsNow(); + } + }; + + function request(term, success, failure) { + if (!options.matchCase) + term = term.toLowerCase(); + var data = cache.load(term); + // recieve the cached data + if (data && data.length) { + success(term, data); + // if an AJAX url has been supplied, try loading the data now + } else if( (typeof options.url == "string") && (options.url.length > 0) ){ + + var extraParams = { + timestamp: +new Date() + }; + $.each(options.extraParams, function(key, param) { + extraParams[key] = typeof param == "function" ? param() : param; + }); + + $.ajax({ + // try to leverage ajaxQueue plugin to abort previous requests + mode: "abort", + // limit abortion to this input + port: "autocomplete" + input.name, + dataType: options.dataType, + url: options.url, + data: $.extend({ + q: lastWord(term), + limit: options.max + }, extraParams), + success: function(data) { + var parsed = options.parse && options.parse(data) || parse(data); + cache.add(term, parsed); + success(term, parsed); + } + }); + } else { + // if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match + select.emptyList(); + failure(term); + } + }; + + function parse(data) { + var parsed = []; + var rows = data.split("\n"); + for (var i=0; i < rows.length; i++) { + var row = $.trim(rows[i]); + if (row) { + row = row.split("|"); + parsed[parsed.length] = { + data: row, + value: row[0], + result: options.formatResult && options.formatResult(row, row[0]) || row[0] + }; + } + } + return parsed; + }; + + function stopLoading() { + $input.removeClass(options.loadingClass); + }; + +}; + +$.Autocompleter.defaults = { + inputClass: "ac_input", + resultsClass: "ac_results", + loadingClass: "ac_loading", + minChars: 1, + delay: 400, + matchCase: false, + matchSubset: true, + matchContains: false, + cacheLength: 10, + max: 100, + mustMatch: false, + extraParams: {}, + selectFirst: true, + formatItem: function(row) { return row[0]; }, + formatMatch: null, + autoFill: false, + width: 0, + multiple: false, + multipleSeparator: ", ", + highlight: function(value, term) { + return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1"); + }, + scroll: true, + scrollHeight: 180 +}; + +$.Autocompleter.Cache = function(options) { + + var data = {}; + var length = 0; + + function matchSubset(s, sub) { + if (!options.matchCase) + s = s.toLowerCase(); + var i = s.indexOf(sub); + if (options.matchContains == "word"){ + i = s.toLowerCase().search("\\b" + sub.toLowerCase()); + } + if (i == -1) return false; + return i == 0 || options.matchContains; + }; + + function add(q, value) { + if (length > options.cacheLength){ + flush(); + } + if (!data[q]){ + length++; + } + data[q] = value; + } + + function populate(){ + if( !options.data ) return false; + // track the matches + var stMatchSets = {}, + nullData = 0; + + // no url was specified, we need to adjust the cache length to make sure it fits the local data store + if( !options.url ) options.cacheLength = 1; + + // track all options for minChars = 0 + stMatchSets[""] = []; + + // loop through the array and create a lookup structure + for ( var i = 0, ol = options.data.length; i < ol; i++ ) { + var rawValue = options.data[i]; + // if rawValue is a string, make an array otherwise just reference the array + rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue; + + var value = options.formatMatch(rawValue, i+1, options.data.length); + if ( value === false ) + continue; + + var firstChar = value.charAt(0).toLowerCase(); + // if no lookup array for this character exists, look it up now + if( !stMatchSets[firstChar] ) + stMatchSets[firstChar] = []; + + // if the match is a string + var row = { + value: value, + data: rawValue, + result: options.formatResult && options.formatResult(rawValue) || value + }; + + // push the current match into the set list + stMatchSets[firstChar].push(row); + + // keep track of minChars zero items + if ( nullData++ < options.max ) { + stMatchSets[""].push(row); + } + }; + + // add the data items to the cache + $.each(stMatchSets, function(i, value) { + // increase the cache size + options.cacheLength++; + // add to the cache + add(i, value); + }); + } + + // populate any existing data + setTimeout(populate, 25); + + function flush(){ + data = {}; + length = 0; + } + + return { + flush: flush, + add: add, + populate: populate, + load: function(q) { + if (!options.cacheLength || !length) + return null; + /* + * if dealing w/local data and matchContains than we must make sure + * to loop through all the data collections looking for matches + */ + if( !options.url && options.matchContains ){ + // track all matches + var csub = []; + // loop through all the data grids for matches + for( var k in data ){ + // don't search through the stMatchSets[""] (minChars: 0) cache + // this prevents duplicates + if( k.length > 0 ){ + var c = data[k]; + $.each(c, function(i, x) { + // if we've got a match, add it to the array + if (matchSubset(x.value, q)) { + csub.push(x); + } + }); + } + } + return csub; + } else + // if the exact item exists, use it + if (data[q]){ + return data[q]; + } else + if (options.matchSubset) { + for (var i = q.length - 1; i >= options.minChars; i--) { + var c = data[q.substr(0, i)]; + if (c) { + var csub = []; + $.each(c, function(i, x) { + if (matchSubset(x.value, q)) { + csub[csub.length] = x; + } + }); + return csub; + } + } + } + return null; + } + }; +}; + +$.Autocompleter.Select = function (options, input, select, config) { + var CLASSES = { + ACTIVE: "ac_over" + }; + + var listItems, + active = -1, + data, + term = "", + needsInit = true, + element, + list; + + // Create results + function init() { + if (!needsInit) + return; + element = $("
") + .hide() + .addClass(options.resultsClass) + .css("position", "absolute") + .appendTo(document.body); + + list = $("
").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&c.bgiframe(),this.instances.push(c);return c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;if(a.browser.msie&&a.browser.version<7){b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return b0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]!==e){var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0}},top:function(b,c){if(c.at[1]!==e){var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];if(!c||!c.ownerDocument)return null;if(b)return this.each(function(){a.offset.setOffset(this,b)});return h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&jQuery.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()}(jQuery),function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("
").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===b)return this._value();this._setOption("value",a);return this},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;typeof a!="number"&&(a=0);return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.17"})}(jQuery),function(a,b){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="",g=d.values&&d.values.length||1,h=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":"")),this.range=a([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),d.values.length&&d.values.length!==2&&(d.values=[d.values[0],d.values[0]])),this.range=a("
").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;ic&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i);if(j===!1)return!1;this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0;return!0},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);this._slide(a,this._handleIndex,c);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1;return!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e;return this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());return this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c1)this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);else{if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;Math.abs(c)*2>=b&&(d+=c>0?b:-b);return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.17"})}(jQuery),function(a,b){function f(){return++d}function e(){return++c}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash){e.selected=a;return!1}}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing" +)||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1){this.blur();return!1}e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected")){e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur();return!1}if(!f.length){e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur();return!1}}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$="+a+"]")));return a},destroy:function(){var b=this.options;this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie);return this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e]));return this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0]));return this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a])));return this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+".tabs");return this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup();return this},url:function(a,b){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.17"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a + *
    + * + * + *

    hint text

    + *
    + *
    + * + * + *

    hint text

    + *
    + *
    + * + * + *

    hint text

    + *
    + * + * + * The above code will render the labels and input fields in separate lines. + * In order to render them in the same line, please use the "wide" form as follows, + * + *
    + * ...... + *
    + * + * @author Qiang Xue + * @link http://www.yiiframework.com/ + * @copyright Copyright © 2008-2010 Yii Software LLC + * @license http://www.yiiframework.com/license/ + */ + +div.form +{ +} + +div.form input, +div.form textarea, +div.form select +{ + margin: 0.2em 0 0.5em 0; +} + +div.form fieldset +{ + border: 1px solid #DDD; + padding: 10px; + margin: 0 0 10px 0; + -moz-border-radius:7px; +} + +div.form label +{ + font-weight: bold; + font-size: 0.9em; + display: block; +} + +div.form .row +{ + margin: 5px 0; +} + +div.form .hint +{ + margin: 0; + padding: 0; + color: #999; +} + +div.form .note +{ + font-style: italic; +} + +div.form span.required +{ + color: red; +} + +div.form div.error label:first-child, +div.form label.error, +div.form span.error +{ + color: #C00; +} + +div.form div.error input, +div.form div.error textarea, +div.form div.error select, +div.form input.error, +div.form textarea.error, +div.form select.error +{ + background: #FEE; + border-color: #C00; +} + +div.form div.success input, +div.form div.success textarea, +div.form div.success select, +div.form input.success, +div.form textarea.success, +div.form select.success +{ + background: #E6EFC2; + border-color: #C6D880; +} + + +div.form .errorSummary +{ + border: 2px solid #C00; + padding: 7px 7px 12px 7px; + margin: 0 0 20px 0; + background: #FEE; + font-size: 0.9em; +} + +div.form .errorMessage +{ + color: red; + font-size: 0.9em; +} + +div.form .errorSummary p +{ + margin: 0; + padding: 5px; +} + +div.form .errorSummary ul +{ + margin: 0; + padding: 0 0 0 20px; +} + +div.wide.form label +{ + float: left; + margin-right: 10px; + position: relative; + text-align: right; + width: 100px; +} + +div.wide.form .row +{ + clear: left; +} + +div.wide.form .buttons, div.wide.form .hint, div.wide.form .errorMessage +{ + clear: left; + padding-left: 110px; +} diff --git a/css/ie.css b/css/ie.css new file mode 100644 index 0000000..f015399 --- /dev/null +++ b/css/ie.css @@ -0,0 +1,36 @@ +/* ----------------------------------------------------------------------- + + + Blueprint CSS Framework 1.0.1 + http://blueprintcss.org + + * Copyright (c) 2007-Present. See LICENSE for more info. + * See README for instructions on how to use Blueprint. + * For credits and origins, see AUTHORS. + * This is a compressed file. See the sources in the 'src' directory. + +----------------------------------------------------------------------- */ + +/* ie.css */ +body {text-align:center;} +.container {text-align:left;} +* html .column, * html .span-1, * html .span-2, * html .span-3, * html .span-4, * html .span-5, * html .span-6, * html .span-7, * html .span-8, * html .span-9, * html .span-10, * html .span-11, * html .span-12, * html .span-13, * html .span-14, * html .span-15, * html .span-16, * html .span-17, * html .span-18, * html .span-19, * html .span-20, * html .span-21, * html .span-22, * html .span-23, * html .span-24 {display:inline;overflow-x:hidden;} +* html legend {margin:0px -8px 16px 0;padding:0;} +sup {vertical-align:text-top;} +sub {vertical-align:text-bottom;} +html>body p code {*white-space:normal;} +hr {margin:-8px auto 11px;} +img {-ms-interpolation-mode:bicubic;} +.clearfix, .container {display:inline-block;} +* html .clearfix, * html .container {height:1%;} +fieldset {padding-top:0;} +legend {margin-top:-0.2em;margin-bottom:1em;margin-left:-0.5em;} +textarea {overflow:auto;} +label {vertical-align:middle;position:relative;top:-0.25em;} +input.text, input.title, textarea {background-color:#fff;border:1px solid #bbb;} +input.text:focus, input.title:focus {border-color:#666;} +input.text, input.title, textarea, select {margin:0.5em 0;} +input.checkbox, input.radio {position:relative;top:.25em;} +form.inline div, form.inline p {vertical-align:middle;} +form.inline input.checkbox, form.inline input.radio, form.inline input.button, form.inline button {margin:0.5em 0;} +button, input.button {position:relative;top:0.25em;} \ No newline at end of file diff --git a/css/main.css b/css/main.css new file mode 100644 index 0000000..13327b8 --- /dev/null +++ b/css/main.css @@ -0,0 +1,229 @@ +body +{ + margin: 0; + padding: 0; + color: #555; + font: normal 10pt Arial,Helvetica,sans-serif; + background: #EFEFEF; +} + +#page +{ + margin-top: 5px; + margin-bottom: 5px; + background: white; + border: 1px solid #C9E0ED; +} + +#header +{ + margin: 0; + padding: 0; + border-top: 3px solid #C9E0ED; +} + +#content +{ + padding: 20px; +} + +#sidebar +{ + padding: 20px 20px 20px 0; +} + +#footer +{ + padding: 10px; + margin: 10px 20px; + font-size: 0.8em; + text-align: center; + border-top: 1px solid #C9E0ED; +} + +#logo +{ + padding: 10px 20px; + font-size: 200%; +} + +#mainmenu +{ + background:white url(bg.gif) repeat-x left top; +} + +#mainmenu ul +{ + padding:6px 20px 5px 20px; + margin:0px; +} + +#mainmenu ul li +{ + display: inline; +} + +#mainmenu ul li a +{ + color:#ffffff; + background-color:transparent; + font-size:12px; + font-weight:bold; + text-decoration:none; + padding:5px 8px; +} + +#mainmenu ul li a:hover, #mainmenu ul li.active a +{ + color: #6399cd; + background-color:#EFF4FA; + text-decoration:none; +} + +div.flash-error, div.flash-notice, div.flash-success +{ + padding:.8em; + margin-bottom:1em; + border:2px solid #ddd; +} + +div.flash-error +{ + background:#FBE3E4; + color:#8a1f11; + border-color:#FBC2C4; +} + +div.flash-notice +{ + background:#FFF6BF; + color:#514721; + border-color:#FFD324; +} + +div.flash-success +{ + background:#E6EFC2; + color:#264409; + border-color:#C6D880; +} + +div.flash-error a +{ + color:#8a1f11; +} + +div.flash-notice a +{ + color:#514721; +} + +div.flash-success a +{ + color:#264409; +} + +div.form .rememberMe label +{ + display: inline; +} + +div.view +{ + padding: 10px; + margin: 10px 0; + border: 1px solid #C9E0ED; +} + +div.breadcrumbs +{ + font-size: 0.9em; + padding: 5px 20px; +} + +div.breadcrumbs span +{ + font-weight: bold; +} + +div.search-form +{ + padding: 10px; + margin: 10px 0; + background: #eee; +} + +.portlet +{ + +} + +.portlet-decoration +{ + padding: 3px 8px; + background: #B7D6E7; + border-left: 5px solid #6FACCF; +} + +.portlet-title +{ + font-size: 12px; + font-weight: bold; + padding: 0; + margin: 0; + color: #298dcd; +} + +.portlet-content +{ + font-size:0.9em; + margin: 0 0 15px 0; + padding: 5px 8px; + background:#EFFDFF; +} + +.portlet-content ul +{ + list-style-image:none; + list-style-position:outside; + list-style-type:none; + margin: 0; + padding: 0; +} + +.portlet-content li +{ + padding: 2px 0 4px 0px; +} + +.operations +{ + list-style-type: none; + margin: 0; + padding: 0; +} + +.operations li +{ + padding-bottom: 2px; +} + +.operations li a +{ + font: bold 12px Arial; + color: #0066A4; + display: block; + padding: 2px 0 2px 8px; + line-height: 15px; + text-decoration: none; +} + +.operations li a:visited +{ + color: #0066A4; +} + +.operations li a:hover +{ + background: #80CFFF; +} \ No newline at end of file diff --git a/css/print.css b/css/print.css new file mode 100644 index 0000000..bd79afd --- /dev/null +++ b/css/print.css @@ -0,0 +1,29 @@ +/* ----------------------------------------------------------------------- + + + Blueprint CSS Framework 1.0.1 + http://blueprintcss.org + + * Copyright (c) 2007-Present. See LICENSE for more info. + * See README for instructions on how to use Blueprint. + * For credits and origins, see AUTHORS. + * This is a compressed file. See the sources in the 'src' directory. + +----------------------------------------------------------------------- */ + +/* print.css */ +body {line-height:1.5;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;color:#000;background:none;font-size:10pt;} +.container {background:none;} +hr {background:#ccc;color:#ccc;width:100%;height:2px;margin:2em 0;padding:0;border:none;} +hr.space {background:#fff;color:#fff;visibility:hidden;} +h1, h2, h3, h4, h5, h6 {font-family:"Helvetica Neue", Arial, "Lucida Grande", sans-serif;} +code {font:.9em "Courier New", Monaco, Courier, monospace;} +a img {border:none;} +p img.top {margin-top:0;} +blockquote {margin:1.5em;padding:1em;font-style:italic;font-size:.9em;} +.small {font-size:.9em;} +.large {font-size:1.1em;} +.quiet {color:#999;} +.hide {display:none;} +a:link, a:visited {background:transparent;font-weight:700;text-decoration:underline;} +a:link:after, a:visited:after {content:" (" attr(href) ")";font-size:90%;} \ No newline at end of file diff --git a/css/screen.css b/css/screen.css new file mode 100644 index 0000000..7824d07 --- /dev/null +++ b/css/screen.css @@ -0,0 +1,238 @@ +/* ----------------------------------------------------------------------- + + + Blueprint CSS Framework 1.0.1 + http://blueprintcss.org + + * Copyright (c) 2007-Present. See LICENSE for more info. + * See README for instructions on how to use Blueprint. + * For credits and origins, see AUTHORS. + * This is a compressed file. See the sources in the 'src' directory. + +----------------------------------------------------------------------- */ + +/* reset.css */ +html {margin:0;padding:0;border:0;} +body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, dialog, figure, footer, header, hgroup, nav, section {margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;} +article, aside, details, figcaption, figure, dialog, footer, header, hgroup, menu, nav, section {display:block;} +body {line-height:1.5;background:white;} +table {border-collapse:separate;border-spacing:0;} +caption, th, td {text-align:left;font-weight:normal;float:none !important;} +table, th, td {vertical-align:middle;} +blockquote:before, blockquote:after, q:before, q:after {content:'';} +blockquote, q {quotes:"" "";} +a img {border:none;} +:focus {outline:0;} + +/* typography.css */ +html {font-size:100.01%;} +body {font-size:75%;color:#222;background:#fff;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;} +h1, h2, h3, h4, h5, h6 {font-weight:normal;color:#111;} +h1 {font-size:2em;line-height:1;margin-bottom:0.5em;} +h2 {font-size:1.6em;margin-bottom:0.75em;} +h3 {font-size:1.4em;line-height:1;margin-bottom:1em;} +h4 {font-size:1.2em;line-height:1.25;margin-bottom:1.25em;} +h5 {font-size:1em;font-weight:bold;margin-bottom:1.5em;} +h6 {font-size:1em;font-weight:bold;} +h1 img, h2 img, h3 img, h4 img, h5 img, h6 img {margin:0;} +p {margin:0 0 1.5em;} +.left {float:left !important;} +p .left {margin:1.5em 1.5em 1.5em 0;padding:0;} +.right {float:right !important;} +p .right {margin:1.5em 0 1.5em 1.5em;padding:0;} +a:focus, a:hover {color:#09f;} +a {color:#06c;text-decoration:underline;} +blockquote {margin:1.5em;color:#666;font-style:italic;} +strong, dfn {font-weight:bold;} +em, dfn {font-style:italic;} +sup, sub {line-height:0;} +abbr, acronym {border-bottom:1px dotted #666;} +address {margin:0 0 1.5em;font-style:italic;} +del {color:#666;} +pre {margin:1.5em 0;white-space:pre;} +pre, code, tt {font:1em 'andale mono', 'lucida console', monospace;line-height:1.5;} +li ul, li ol {margin:0;} +ul, ol {margin:0 1.5em 1.5em 0;padding-left:1.5em;} +ul {list-style-type:disc;} +ol {list-style-type:decimal;} +dl {margin:0 0 1.5em 0;} +dl dt {font-weight:bold;} +dd {margin-left:1.5em;} +table {margin-bottom:1.4em;width:100%;} +th {font-weight:bold;} +thead th {background:#c3d9ff;} +th, td, caption {padding:4px 10px 4px 5px;} +tfoot {font-style:italic;} +caption {background:#eee;} +.small {font-size:.8em;margin-bottom:1.875em;line-height:1.875em;} +.large {font-size:1.2em;line-height:2.5em;margin-bottom:1.25em;} +.hide {display:none;} +.quiet {color:#666;} +.loud {color:#000;} +.highlight {background:#ff0;} +.added {background:#060;color:#fff;} +.removed {background:#900;color:#fff;} +.first {margin-left:0;padding-left:0;} +.last {margin-right:0;padding-right:0;} +.top {margin-top:0;padding-top:0;} +.bottom {margin-bottom:0;padding-bottom:0;} + +/* grid.css */ +.container {width:950px;margin:0 auto;} +.column, .span-1, .span-2, .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-9, .span-10, .span-11, .span-12, .span-13, .span-14, .span-15, .span-16, .span-17, .span-18, .span-19, .span-20, .span-21, .span-22, .span-23, .span-24 {float:left;margin-right:10px;} +.last {margin-right:0;} +.span-1 {width:30px;} +.span-2 {width:70px;} +.span-3 {width:110px;} +.span-4 {width:150px;} +.span-5 {width:190px;} +.span-6 {width:230px;} +.span-7 {width:270px;} +.span-8 {width:310px;} +.span-9 {width:350px;} +.span-10 {width:390px;} +.span-11 {width:430px;} +.span-12 {width:470px;} +.span-13 {width:510px;} +.span-14 {width:550px;} +.span-15 {width:590px;} +.span-16 {width:630px;} +.span-17 {width:670px;} +.span-18 {width:710px;} +.span-19 {width:750px;} +.span-20 {width:790px;} +.span-21 {width:830px;} +.span-22 {width:870px;} +.span-23 {width:910px;} +.span-24 {width:950px;margin-right:0;} +input.span-1, textarea.span-1, input.span-2, textarea.span-2, input.span-3, textarea.span-3, input.span-4, textarea.span-4, input.span-5, textarea.span-5, input.span-6, textarea.span-6, input.span-7, textarea.span-7, input.span-8, textarea.span-8, input.span-9, textarea.span-9, input.span-10, textarea.span-10, input.span-11, textarea.span-11, input.span-12, textarea.span-12, input.span-13, textarea.span-13, input.span-14, textarea.span-14, input.span-15, textarea.span-15, input.span-16, textarea.span-16, input.span-17, textarea.span-17, input.span-18, textarea.span-18, input.span-19, textarea.span-19, input.span-20, textarea.span-20, input.span-21, textarea.span-21, input.span-22, textarea.span-22, input.span-23, textarea.span-23, input.span-24, textarea.span-24 {border-left-width:1px;border-right-width:1px;padding-left:5px;padding-right:5px;} +input.span-1, textarea.span-1 {width:18px;} +input.span-2, textarea.span-2 {width:58px;} +input.span-3, textarea.span-3 {width:98px;} +input.span-4, textarea.span-4 {width:138px;} +input.span-5, textarea.span-5 {width:178px;} +input.span-6, textarea.span-6 {width:218px;} +input.span-7, textarea.span-7 {width:258px;} +input.span-8, textarea.span-8 {width:298px;} +input.span-9, textarea.span-9 {width:338px;} +input.span-10, textarea.span-10 {width:378px;} +input.span-11, textarea.span-11 {width:418px;} +input.span-12, textarea.span-12 {width:458px;} +input.span-13, textarea.span-13 {width:498px;} +input.span-14, textarea.span-14 {width:538px;} +input.span-15, textarea.span-15 {width:578px;} +input.span-16, textarea.span-16 {width:618px;} +input.span-17, textarea.span-17 {width:658px;} +input.span-18, textarea.span-18 {width:698px;} +input.span-19, textarea.span-19 {width:738px;} +input.span-20, textarea.span-20 {width:778px;} +input.span-21, textarea.span-21 {width:818px;} +input.span-22, textarea.span-22 {width:858px;} +input.span-23, textarea.span-23 {width:898px;} +input.span-24, textarea.span-24 {width:938px;} +.append-1 {padding-right:40px;} +.append-2 {padding-right:80px;} +.append-3 {padding-right:120px;} +.append-4 {padding-right:160px;} +.append-5 {padding-right:200px;} +.append-6 {padding-right:240px;} +.append-7 {padding-right:280px;} +.append-8 {padding-right:320px;} +.append-9 {padding-right:360px;} +.append-10 {padding-right:400px;} +.append-11 {padding-right:440px;} +.append-12 {padding-right:480px;} +.append-13 {padding-right:520px;} +.append-14 {padding-right:560px;} +.append-15 {padding-right:600px;} +.append-16 {padding-right:640px;} +.append-17 {padding-right:680px;} +.append-18 {padding-right:720px;} +.append-19 {padding-right:760px;} +.append-20 {padding-right:800px;} +.append-21 {padding-right:840px;} +.append-22 {padding-right:880px;} +.append-23 {padding-right:920px;} +.prepend-1 {padding-left:40px;} +.prepend-2 {padding-left:80px;} +.prepend-3 {padding-left:120px;} +.prepend-4 {padding-left:160px;} +.prepend-5 {padding-left:200px;} +.prepend-6 {padding-left:240px;} +.prepend-7 {padding-left:280px;} +.prepend-8 {padding-left:320px;} +.prepend-9 {padding-left:360px;} +.prepend-10 {padding-left:400px;} +.prepend-11 {padding-left:440px;} +.prepend-12 {padding-left:480px;} +.prepend-13 {padding-left:520px;} +.prepend-14 {padding-left:560px;} +.prepend-15 {padding-left:600px;} +.prepend-16 {padding-left:640px;} +.prepend-17 {padding-left:680px;} +.prepend-18 {padding-left:720px;} +.prepend-19 {padding-left:760px;} +.prepend-20 {padding-left:800px;} +.prepend-21 {padding-left:840px;} +.prepend-22 {padding-left:880px;} +.prepend-23 {padding-left:920px;} +.border {padding-right:4px;margin-right:5px;border-right:1px solid #ddd;} +.colborder {padding-right:24px;margin-right:25px;border-right:1px solid #ddd;} +.pull-1 {margin-left:-40px;} +.pull-2 {margin-left:-80px;} +.pull-3 {margin-left:-120px;} +.pull-4 {margin-left:-160px;} +.pull-5 {margin-left:-200px;} +.pull-6 {margin-left:-240px;} +.pull-7 {margin-left:-280px;} +.pull-8 {margin-left:-320px;} +.pull-9 {margin-left:-360px;} +.pull-10 {margin-left:-400px;} +.pull-11 {margin-left:-440px;} +.pull-12 {margin-left:-480px;} +.pull-13 {margin-left:-520px;} +.pull-14 {margin-left:-560px;} +.pull-15 {margin-left:-600px;} +.pull-16 {margin-left:-640px;} +.pull-17 {margin-left:-680px;} +.pull-18 {margin-left:-720px;} +.pull-19 {margin-left:-760px;} +.pull-20 {margin-left:-800px;} +.pull-21 {margin-left:-840px;} +.pull-22 {margin-left:-880px;} +.pull-23 {margin-left:-920px;} +.pull-24 {margin-left:-960px;} +.pull-1, .pull-2, .pull-3, .pull-4, .pull-5, .pull-6, .pull-7, .pull-8, .pull-9, .pull-10, .pull-11, .pull-12, .pull-13, .pull-14, .pull-15, .pull-16, .pull-17, .pull-18, .pull-19, .pull-20, .pull-21, .pull-22, .pull-23, .pull-24 {float:left;position:relative;} +.push-1 {margin:0 -40px 1.5em 40px;} +.push-2 {margin:0 -80px 1.5em 80px;} +.push-3 {margin:0 -120px 1.5em 120px;} +.push-4 {margin:0 -160px 1.5em 160px;} +.push-5 {margin:0 -200px 1.5em 200px;} +.push-6 {margin:0 -240px 1.5em 240px;} +.push-7 {margin:0 -280px 1.5em 280px;} +.push-8 {margin:0 -320px 1.5em 320px;} +.push-9 {margin:0 -360px 1.5em 360px;} +.push-10 {margin:0 -400px 1.5em 400px;} +.push-11 {margin:0 -440px 1.5em 440px;} +.push-12 {margin:0 -480px 1.5em 480px;} +.push-13 {margin:0 -520px 1.5em 520px;} +.push-14 {margin:0 -560px 1.5em 560px;} +.push-15 {margin:0 -600px 1.5em 600px;} +.push-16 {margin:0 -640px 1.5em 640px;} +.push-17 {margin:0 -680px 1.5em 680px;} +.push-18 {margin:0 -720px 1.5em 720px;} +.push-19 {margin:0 -760px 1.5em 760px;} +.push-20 {margin:0 -800px 1.5em 800px;} +.push-21 {margin:0 -840px 1.5em 840px;} +.push-22 {margin:0 -880px 1.5em 880px;} +.push-23 {margin:0 -920px 1.5em 920px;} +.push-24 {margin:0 -960px 1.5em 960px;} +.push-1, .push-2, .push-3, .push-4, .push-5, .push-6, .push-7, .push-8, .push-9, .push-10, .push-11, .push-12, .push-13, .push-14, .push-15, .push-16, .push-17, .push-18, .push-19, .push-20, .push-21, .push-22, .push-23, .push-24 {float:left;position:relative;} +div.prepend-top, .prepend-top {margin-top:1.5em;} +div.append-bottom, .append-bottom {margin-bottom:1.5em;} +.box {padding:1.5em;margin-bottom:1.5em;background:#e5eCf9;} +hr {background:#ddd;color:#ddd;clear:both;float:none;width:100%;height:1px;margin:0 0 17px;border:none;} +hr.space {background:#fff;color:#fff;visibility:hidden;} +.clearfix:after, .container:after {content:"\0020";display:block;height:0;clear:both;visibility:hidden;overflow:hidden;} +.clearfix, .container {display:block;} +.clear {clear:both;} diff --git a/index-test.php b/index-test.php new file mode 100644 index 0000000..e017aae --- /dev/null +++ b/index-test.php @@ -0,0 +1,15 @@ +run(); diff --git a/index.php b/index.php new file mode 100644 index 0000000..1b7ba1c --- /dev/null +++ b/index.php @@ -0,0 +1,13 @@ +run(); diff --git a/protected/.htaccess b/protected/.htaccess new file mode 100644 index 0000000..8d2f256 --- /dev/null +++ b/protected/.htaccess @@ -0,0 +1 @@ +deny from all diff --git a/protected/components/Controller.php b/protected/components/Controller.php new file mode 100644 index 0000000..4d27862 --- /dev/null +++ b/protected/components/Controller.php @@ -0,0 +1,23 @@ + password + 'demo'=>'demo', + 'admin'=>'admin', + ); + if(!isset($users[$this->username])) + $this->errorCode=self::ERROR_USERNAME_INVALID; + else if($users[$this->username]!==$this->password) + $this->errorCode=self::ERROR_PASSWORD_INVALID; + else + $this->errorCode=self::ERROR_NONE; + return !$this->errorCode; + } +} \ No newline at end of file diff --git a/protected/config/console.php b/protected/config/console.php new file mode 100644 index 0000000..15c9353 --- /dev/null +++ b/protected/config/console.php @@ -0,0 +1,24 @@ +dirname(__FILE__).DIRECTORY_SEPARATOR.'..', + 'name'=>'My Console Application', + // application components + 'components'=>array( + 'db'=>array( + 'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db', + ), + // uncomment the following to use a MySQL database + /* + 'db'=>array( + 'connectionString' => 'mysql:host=localhost;dbname=testdrive', + 'emulatePrepare' => true, + 'username' => 'root', + 'password' => '', + 'charset' => 'utf8', + ), + */ + ), +); \ No newline at end of file diff --git a/protected/config/main.php b/protected/config/main.php new file mode 100644 index 0000000..9e840e4 --- /dev/null +++ b/protected/config/main.php @@ -0,0 +1,90 @@ +dirname(__FILE__).DIRECTORY_SEPARATOR.'..', + 'name'=>'My Web Application', + + // preloading 'log' component + 'preload'=>array('log'), + + // autoloading model and component classes + 'import'=>array( + 'application.models.*', + 'application.components.*', + ), + + 'modules'=>array( + // uncomment the following to enable the Gii tool + /* + 'gii'=>array( + 'class'=>'system.gii.GiiModule', + 'password'=>'Enter Your Password Here', + // If removed, Gii defaults to localhost only. Edit carefully to taste. + 'ipFilters'=>array('127.0.0.1','::1'), + ), + */ + ), + + // application components + 'components'=>array( + 'user'=>array( + // enable cookie-based authentication + 'allowAutoLogin'=>true, + ), + // uncomment the following to enable URLs in path-format + /* + 'urlManager'=>array( + 'urlFormat'=>'path', + 'rules'=>array( + '/'=>'/view', + '//'=>'/', + '/'=>'/', + ), + ), + */ + 'db'=>array( + 'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db', + ), + // uncomment the following to use a MySQL database + /* + 'db'=>array( + 'connectionString' => 'mysql:host=localhost;dbname=testdrive', + 'emulatePrepare' => true, + 'username' => 'root', + 'password' => '', + 'charset' => 'utf8', + ), + */ + 'errorHandler'=>array( + // use 'site/error' action to display errors + 'errorAction'=>'site/error', + ), + 'log'=>array( + 'class'=>'CLogRouter', + 'routes'=>array( + array( + 'class'=>'CFileLogRoute', + 'levels'=>'error, warning', + ), + // uncomment the following to show log messages on web pages + /* + array( + 'class'=>'CWebLogRoute', + ), + */ + ), + ), + ), + + // application-level parameters that can be accessed + // using Yii::app()->params['paramName'] + 'params'=>array( + // this is used in contact page + 'adminEmail'=>'webmaster@example.com', + ), +); \ No newline at end of file diff --git a/protected/config/test.php b/protected/config/test.php new file mode 100644 index 0000000..fd7085a --- /dev/null +++ b/protected/config/test.php @@ -0,0 +1,17 @@ +array( + 'fixture'=>array( + 'class'=>'system.test.CDbFixtureManager', + ), + /* uncomment the following to provide test database connection + 'db'=>array( + 'connectionString'=>'DSN for test database', + ), + */ + ), + ) +); diff --git a/protected/controllers/SiteController.php b/protected/controllers/SiteController.php new file mode 100644 index 0000000..8d3084c --- /dev/null +++ b/protected/controllers/SiteController.php @@ -0,0 +1,103 @@ +array( + 'class'=>'CCaptchaAction', + 'backColor'=>0xFFFFFF, + ), + // page action renders "static" pages stored under 'protected/views/site/pages' + // They can be accessed via: index.php?r=site/page&view=FileName + 'page'=>array( + 'class'=>'CViewAction', + ), + ); + } + + /** + * This is the default 'index' action that is invoked + * when an action is not explicitly requested by users. + */ + public function actionIndex() + { + // renders the view file 'protected/views/site/index.php' + // using the default layout 'protected/views/layouts/main.php' + $this->render('index'); + } + + /** + * This is the action to handle external exceptions. + */ + public function actionError() + { + if($error=Yii::app()->errorHandler->error) + { + if(Yii::app()->request->isAjaxRequest) + echo $error['message']; + else + $this->render('error', $error); + } + } + + /** + * Displays the contact page + */ + public function actionContact() + { + $model=new ContactForm; + if(isset($_POST['ContactForm'])) + { + $model->attributes=$_POST['ContactForm']; + if($model->validate()) + { + $headers="From: {$model->email}\r\nReply-To: {$model->email}"; + mail(Yii::app()->params['adminEmail'],$model->subject,$model->body,$headers); + Yii::app()->user->setFlash('contact','Thank you for contacting us. We will respond to you as soon as possible.'); + $this->refresh(); + } + } + $this->render('contact',array('model'=>$model)); + } + + /** + * Displays the login page + */ + public function actionLogin() + { + $model=new LoginForm; + + // if it is ajax validation request + if(isset($_POST['ajax']) && $_POST['ajax']==='login-form') + { + echo CActiveForm::validate($model); + Yii::app()->end(); + } + + // collect user input data + if(isset($_POST['LoginForm'])) + { + $model->attributes=$_POST['LoginForm']; + // validate user input and redirect to the previous page if valid + if($model->validate() && $model->login()) + $this->redirect(Yii::app()->user->returnUrl); + } + // display the login form + $this->render('login',array('model'=>$model)); + } + + /** + * Logs out the current user and redirect to homepage. + */ + public function actionLogout() + { + Yii::app()->user->logout(); + $this->redirect(Yii::app()->homeUrl); + } +} \ No newline at end of file diff --git a/protected/data/schema.mysql.sql b/protected/data/schema.mysql.sql new file mode 100644 index 0000000..32788bd --- /dev/null +++ b/protected/data/schema.mysql.sql @@ -0,0 +1,28 @@ +CREATE TABLE tbl_user ( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + username VARCHAR(128) NOT NULL, + password VARCHAR(128) NOT NULL, + email VARCHAR(128) NOT NULL +); + +INSERT INTO tbl_user (username, password, email) VALUES ('test1', 'pass1', 'test1@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test2', 'pass2', 'test2@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test3', 'pass3', 'test3@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test4', 'pass4', 'test4@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test5', 'pass5', 'test5@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test6', 'pass6', 'test6@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test7', 'pass7', 'test7@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test8', 'pass8', 'test8@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test9', 'pass9', 'test9@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test10', 'pass10', 'test10@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test11', 'pass11', 'test11@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test12', 'pass12', 'test12@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test13', 'pass13', 'test13@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test14', 'pass14', 'test14@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test15', 'pass15', 'test15@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test16', 'pass16', 'test16@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test17', 'pass17', 'test17@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test18', 'pass18', 'test18@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test19', 'pass19', 'test19@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test20', 'pass20', 'test20@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test21', 'pass21', 'test21@example.com'); diff --git a/protected/data/schema.sqlite.sql b/protected/data/schema.sqlite.sql new file mode 100644 index 0000000..e5e0830 --- /dev/null +++ b/protected/data/schema.sqlite.sql @@ -0,0 +1,28 @@ +CREATE TABLE tbl_user ( + id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + username VARCHAR(128) NOT NULL, + password VARCHAR(128) NOT NULL, + email VARCHAR(128) NOT NULL +); + +INSERT INTO tbl_user (username, password, email) VALUES ('test1', 'pass1', 'test1@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test2', 'pass2', 'test2@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test3', 'pass3', 'test3@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test4', 'pass4', 'test4@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test5', 'pass5', 'test5@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test6', 'pass6', 'test6@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test7', 'pass7', 'test7@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test8', 'pass8', 'test8@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test9', 'pass9', 'test9@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test10', 'pass10', 'test10@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test11', 'pass11', 'test11@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test12', 'pass12', 'test12@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test13', 'pass13', 'test13@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test14', 'pass14', 'test14@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test15', 'pass15', 'test15@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test16', 'pass16', 'test16@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test17', 'pass17', 'test17@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test18', 'pass18', 'test18@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test19', 'pass19', 'test19@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test20', 'pass20', 'test20@example.com'); +INSERT INTO tbl_user (username, password, email) VALUES ('test21', 'pass21', 'test21@example.com'); diff --git a/protected/data/testdrive.db b/protected/data/testdrive.db new file mode 100644 index 0000000..0672b21 Binary files /dev/null and b/protected/data/testdrive.db differ diff --git a/protected/models/ContactForm.php b/protected/models/ContactForm.php new file mode 100644 index 0000000..86541cb --- /dev/null +++ b/protected/models/ContactForm.php @@ -0,0 +1,42 @@ +!CCaptcha::checkRequirements()), + ); + } + + /** + * Declares customized attribute labels. + * If not declared here, an attribute would have a label that is + * the same as its name with the first letter in upper case. + */ + public function attributeLabels() + { + return array( + 'verifyCode'=>'Verification Code', + ); + } +} \ No newline at end of file diff --git a/protected/models/LoginForm.php b/protected/models/LoginForm.php new file mode 100644 index 0000000..eb36e4a --- /dev/null +++ b/protected/models/LoginForm.php @@ -0,0 +1,77 @@ +'Remember me next time', + ); + } + + /** + * Authenticates the password. + * This is the 'authenticate' validator as declared in rules(). + */ + public function authenticate($attribute,$params) + { + if(!$this->hasErrors()) + { + $this->_identity=new UserIdentity($this->username,$this->password); + if(!$this->_identity->authenticate()) + $this->addError('password','Incorrect username or password.'); + } + } + + /** + * Logs in the user using the given username and password in the model. + * @return boolean whether login is successful + */ + public function login() + { + if($this->_identity===null) + { + $this->_identity=new UserIdentity($this->username,$this->password); + $this->_identity->authenticate(); + } + if($this->_identity->errorCode===UserIdentity::ERROR_NONE) + { + $duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days + Yii::app()->user->login($this->_identity,$duration); + return true; + } + else + return false; + } +} diff --git a/protected/tests/WebTestCase.php b/protected/tests/WebTestCase.php new file mode 100644 index 0000000..d252bba --- /dev/null +++ b/protected/tests/WebTestCase.php @@ -0,0 +1,25 @@ +setBrowserUrl(TEST_BASE_URL); + } +} diff --git a/protected/tests/bootstrap.php b/protected/tests/bootstrap.php new file mode 100644 index 0000000..780a103 --- /dev/null +++ b/protected/tests/bootstrap.php @@ -0,0 +1,10 @@ +open(''); + $this->assertTextPresent('Welcome'); + } + + public function testContact() + { + $this->open('?r=site/contact'); + $this->assertTextPresent('Contact Us'); + $this->assertElementPresent('name=ContactForm[name]'); + + $this->type('name=ContactForm[name]','tester'); + $this->type('name=ContactForm[email]','tester@example.com'); + $this->type('name=ContactForm[subject]','test subject'); + $this->click("//input[@value='Submit']"); + $this->waitForTextPresent('Body cannot be blank.'); + } + + public function testLoginLogout() + { + $this->open(''); + // ensure the user is logged out + if($this->isTextPresent('Logout')) + $this->clickAndWait('link=Logout (demo)'); + + // test login process, including validation + $this->clickAndWait('link=Login'); + $this->assertElementPresent('name=LoginForm[username]'); + $this->type('name=LoginForm[username]','demo'); + $this->click("//input[@value='Login']"); + $this->waitForTextPresent('Password cannot be blank.'); + $this->type('name=LoginForm[password]','demo'); + $this->clickAndWait("//input[@value='Login']"); + $this->assertTextNotPresent('Password cannot be blank.'); + $this->assertTextPresent('Logout'); + + // test logout process + $this->assertTextNotPresent('Login'); + $this->clickAndWait('link=Logout (demo)'); + $this->assertTextPresent('Login'); + } +} diff --git a/protected/tests/phpunit.xml b/protected/tests/phpunit.xml new file mode 100644 index 0000000..22c96ff --- /dev/null +++ b/protected/tests/phpunit.xml @@ -0,0 +1,13 @@ + + + + + + + + \ No newline at end of file diff --git a/protected/views/layouts/column1.php b/protected/views/layouts/column1.php new file mode 100644 index 0000000..f70b154 --- /dev/null +++ b/protected/views/layouts/column1.php @@ -0,0 +1,5 @@ +beginContent('//layouts/main'); ?> +
    + +
    +endContent(); ?> \ No newline at end of file diff --git a/protected/views/layouts/column2.php b/protected/views/layouts/column2.php new file mode 100644 index 0000000..e435a69 --- /dev/null +++ b/protected/views/layouts/column2.php @@ -0,0 +1,21 @@ +beginContent('//layouts/main'); ?> +
    +
    + +
    +
    +
    + +
    +endContent(); ?> \ No newline at end of file diff --git a/protected/views/layouts/main.php b/protected/views/layouts/main.php new file mode 100644 index 0000000..f2ff75a --- /dev/null +++ b/protected/views/layouts/main.php @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + <?php echo CHtml::encode($this->pageTitle); ?> + + + + +
    + + + + + breadcrumbs)):?> + widget('zii.widgets.CBreadcrumbs', array( + 'links'=>$this->breadcrumbs, + )); ?> + + + + +
    + + + +
    + + + diff --git a/protected/views/site/contact.php b/protected/views/site/contact.php new file mode 100644 index 0000000..51f90a9 --- /dev/null +++ b/protected/views/site/contact.php @@ -0,0 +1,81 @@ +pageTitle=Yii::app()->name . ' - Contact Us'; +$this->breadcrumbs=array( + 'Contact', +); +?> + +

    Contact Us

    + +user->hasFlash('contact')): ?> + +
    + user->getFlash('contact'); ?> +
    + + + +

    +If you have business inquiries or other questions, please fill out the following form to contact us. Thank you. +

    + +
    + +beginWidget('CActiveForm', array( + 'id'=>'contact-form', + 'enableClientValidation'=>true, + 'clientOptions'=>array( + 'validateOnSubmit'=>true, + ), +)); ?> + +

    Fields with * are required.

    + + errorSummary($model); ?> + +
    + labelEx($model,'name'); ?> + textField($model,'name'); ?> + error($model,'name'); ?> +
    + +
    + labelEx($model,'email'); ?> + textField($model,'email'); ?> + error($model,'email'); ?> +
    + +
    + labelEx($model,'subject'); ?> + textField($model,'subject',array('size'=>60,'maxlength'=>128)); ?> + error($model,'subject'); ?> +
    + +
    + labelEx($model,'body'); ?> + textArea($model,'body',array('rows'=>6, 'cols'=>50)); ?> + error($model,'body'); ?> +
    + + +
    + labelEx($model,'verifyCode'); ?> +
    + widget('CCaptcha'); ?> + textField($model,'verifyCode'); ?> +
    +
    Please enter the letters as they are shown in the image above. +
    Letters are not case-sensitive.
    + error($model,'verifyCode'); ?> +
    + + +
    + +
    + +endWidget(); ?> + +
    + + \ No newline at end of file diff --git a/protected/views/site/error.php b/protected/views/site/error.php new file mode 100644 index 0000000..4607ff3 --- /dev/null +++ b/protected/views/site/error.php @@ -0,0 +1,12 @@ +pageTitle=Yii::app()->name . ' - Error'; +$this->breadcrumbs=array( + 'Error', +); +?> + +

    Error

    + +
    + +
    \ No newline at end of file diff --git a/protected/views/site/index.php b/protected/views/site/index.php new file mode 100644 index 0000000..b44b2e6 --- /dev/null +++ b/protected/views/site/index.php @@ -0,0 +1,16 @@ +pageTitle=Yii::app()->name; ?> + +

    Welcome to name); ?>

    + +

    Congratulations! You have successfully created your Yii application.

    + +

    You may change the content of this page by modifying the following two files:

    +
      +
    • View file:
    • +
    • Layout file: getLayoutFile('main'); ?>
    • +
    + +

    For more details on how to further develop this application, please read +the documentation. +Feel free to ask in the forum, +should you have any questions.

    \ No newline at end of file diff --git a/protected/views/site/login.php b/protected/views/site/login.php new file mode 100644 index 0000000..c53bf62 --- /dev/null +++ b/protected/views/site/login.php @@ -0,0 +1,49 @@ +pageTitle=Yii::app()->name . ' - Login'; +$this->breadcrumbs=array( + 'Login', +); +?> + +

    Login

    + +

    Please fill out the following form with your login credentials:

    + +
    +beginWidget('CActiveForm', array( + 'id'=>'login-form', + 'enableClientValidation'=>true, + 'clientOptions'=>array( + 'validateOnSubmit'=>true, + ), +)); ?> + +

    Fields with * are required.

    + +
    + labelEx($model,'username'); ?> + textField($model,'username'); ?> + error($model,'username'); ?> +
    + +
    + labelEx($model,'password'); ?> + passwordField($model,'password'); ?> + error($model,'password'); ?> +

    + Hint: You may login with demo/demo or admin/admin. +

    +
    + +
    + checkBox($model,'rememberMe'); ?> + label($model,'rememberMe'); ?> + error($model,'rememberMe'); ?> +
    + +
    + +
    + +endWidget(); ?> +
    diff --git a/protected/views/site/pages/about.php b/protected/views/site/pages/about.php new file mode 100644 index 0000000..c6c05dc --- /dev/null +++ b/protected/views/site/pages/about.php @@ -0,0 +1,10 @@ +pageTitle=Yii::app()->name . ' - About'; +$this->breadcrumbs=array( + 'About', +); +?> +

    About

    + +

    This is a "static" page. You may change the content of this page +by updating the file .

    \ No newline at end of file diff --git a/protected/yiic b/protected/yiic new file mode 100644 index 0000000..7f56f54 --- /dev/null +++ b/protected/yiic @@ -0,0 +1,4 @@ +#!/usr/bin/env php +