Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial first commit

  • Loading branch information...
commit 56450255387a0c33b72ee9e80297d9ae2651d321 1 parent 7cdfa04
Antonio Ramirez authored
Showing with 41,503 additions and 0 deletions.
  1. +46 −0 .gitignore
  2. +5 −0 INSTALL.md
  3. +4 −0 README.md
  4. +14 −0 backend/components/Controller.php
  5. +12 −0 backend/config/environments/main-private.php
  6. +9 −0 backend/config/environments/main-prod.php
  7. +11 −0 backend/config/environments/params-private.php
  8. +11 −0 backend/config/environments/params-prod.php
  9. +12 −0 backend/config/main-env.php
  10. +30 −0 backend/config/main-local.php
  11. +105 −0 backend/config/main.php
  12. +9 −0 backend/config/params-env.php
  13. +14 −0 backend/config/params-local.php
  14. +39 −0 backend/config/params.php
  15. +30 −0 backend/config/test.php
  16. +103 −0 backend/controllers/SiteController.php
  17. 0  backend/extensions/behaviors/.ctlib
  18. 0  backend/extensions/validators/.ctlib
  19. 0  backend/lib/.ctlib
  20. +115 −0 backend/models/LoginForm.php
  21. 0  backend/modules/.ctlib
  22. +7 −0 backend/views/layouts/column1.php
  23. +23 −0 backend/views/layouts/column2.php
  24. +78 −0 backend/views/layouts/main.php
  25. +81 −0 backend/views/site/contact.php
  26. +12 −0 backend/views/site/error.php
  27. +45 −0 backend/views/site/index.php
  28. +49 −0 backend/views/site/login.php
  29. +10 −0 backend/views/site/pages/about.php
  30. 0  backend/widgets/.ctlib
  31. +133 −0 backend/www/.htaccess
  32. 0  backend/www/css/.ctlib
  33. BIN  backend/www/images/favicon.ico
  34. +46 −0 backend/www/index.php
  35. 0  backend/www/themes/bootstrap/Bootstrap-2.0.4.version
  36. +815 −0 backend/www/themes/bootstrap/css/bootstrap-responsive.css
  37. +9 −0 backend/www/themes/bootstrap/css/bootstrap-responsive.min.css
  38. +4,983 −0 backend/www/themes/bootstrap/css/bootstrap.css
  39. +9 −0 backend/www/themes/bootstrap/css/bootstrap.min.css
  40. BIN  backend/www/themes/bootstrap/images/glyphicons-halflings-white.png
  41. BIN  backend/www/themes/bootstrap/images/glyphicons-halflings.png
  42. +1,825 −0 backend/www/themes/bootstrap/js/bootstrap.js
  43. +6 −0 backend/www/themes/bootstrap/js/bootstrap.min.js
  44. +76 −0 backend/www/themes/bootstrap/views/layouts/main.php
  45. +1 −0  common/.htaccess
  46. +42 −0 common/components/WebApplication.php
  47. +38 −0 common/config/environments/params-private.php
  48. +37 −0 common/config/environments/params-prod.php
  49. +23 −0 common/config/params-env.php
  50. +39 −0 common/config/params-local.php
  51. +49 −0 common/config/params.php
  52. 0  common/data/.ctlib
  53. +43 −0 common/extensions/EZendAutoloader.php
  54. +118 −0 common/extensions/behaviors/crypt/ECryptBehavior.php
  55. +77 −0 common/extensions/behaviors/password/ABcryptPasswordStrategy.php
  56. +50 −0 common/extensions/behaviors/password/AHashPasswordStrategy.php
  57. +22 −0 common/extensions/behaviors/password/ALegacyMd5PasswordStrategy.php
  58. +22 −0 common/extensions/behaviors/password/ALegacySha1PasswordStrategy.php
  59. +265 −0 common/extensions/behaviors/password/APasswordBehavior.php
  60. +216 −0 common/extensions/behaviors/password/APasswordStrategy.php
  61. +64 −0 common/extensions/behaviors/password/README.md
  62. +21 −0 common/extensions/behaviors/password/tests/ABcryptPasswordStrategyTest.php
  63. +85 −0 common/extensions/behaviors/password/tests/AHashPasswordStrategyTest.php
  64. +24 −0 common/extensions/bootstrap/LICENSE.txt
  65. 0  common/extensions/bootstrap/YiiBootstrap-0.9.12.version
  66. +9 −0 common/extensions/bootstrap/assets/css/bootstrap-responsive.min.css
  67. +131 −0 common/extensions/bootstrap/assets/css/bootstrap-yii.css
  68. +9 −0 common/extensions/bootstrap/assets/css/bootstrap.min.css
  69. BIN  common/extensions/bootstrap/assets/img/glyphicons-halflings-white.png
  70. BIN  common/extensions/bootstrap/assets/img/glyphicons-halflings.png
  71. BIN  common/extensions/bootstrap/assets/img/loading.gif
  72. +6 −0 common/extensions/bootstrap/assets/js/bootstrap.min.js
  73. +338 −0 common/extensions/bootstrap/components/Bootstrap.php
  74. +32 −0 common/extensions/bootstrap/gii/bootstrap/BootstrapCode.php
  75. +14 −0 common/extensions/bootstrap/gii/bootstrap/BootstrapGenerator.php
  76. +35 −0 common/extensions/bootstrap/gii/bootstrap/templates/default/_form.php
  77. +28 −0 common/extensions/bootstrap/gii/bootstrap/templates/default/_search.php
  78. +26 −0 common/extensions/bootstrap/gii/bootstrap/templates/default/_view.php
  79. +70 −0 common/extensions/bootstrap/gii/bootstrap/templates/default/admin.php
  80. +183 −0 common/extensions/bootstrap/gii/bootstrap/templates/default/controller.php
  81. +24 −0 common/extensions/bootstrap/gii/bootstrap/templates/default/create.php
  82. +26 −0 common/extensions/bootstrap/gii/bootstrap/templates/default/index.php
  83. +28 −0 common/extensions/bootstrap/gii/bootstrap/templates/default/update.php
  84. +36 −0 common/extensions/bootstrap/gii/bootstrap/templates/default/view.php
  85. +64 −0 common/extensions/bootstrap/gii/bootstrap/views/index.php
  86. 0  common/extensions/bootstrap/lib/Bootstrap-2.0.4.version
  87. +33 −0 common/extensions/bootstrap/lib/bootstrap/.gitignore
  88. +176 −0 common/extensions/bootstrap/lib/bootstrap/LICENSE
  89. +59 −0 common/extensions/bootstrap/lib/bootstrap/Makefile
  90. +100 −0 common/extensions/bootstrap/lib/bootstrap/README.md
  91. BIN  common/extensions/bootstrap/lib/bootstrap/img/glyphicons-halflings-white.png
  92. BIN  common/extensions/bootstrap/lib/bootstrap/img/glyphicons-halflings.png
  93. +10 −0 common/extensions/bootstrap/lib/bootstrap/js/.jshintrc
  94. +112 −0 common/extensions/bootstrap/lib/bootstrap/js/README.md
  95. +90 −0 common/extensions/bootstrap/lib/bootstrap/js/bootstrap-alert.js
  96. +96 −0 common/extensions/bootstrap/lib/bootstrap/js/bootstrap-button.js
  97. +169 −0 common/extensions/bootstrap/lib/bootstrap/js/bootstrap-carousel.js
  98. +157 −0 common/extensions/bootstrap/lib/bootstrap/js/bootstrap-collapse.js
  99. +100 −0 common/extensions/bootstrap/lib/bootstrap/js/bootstrap-dropdown.js
  100. +218 −0 common/extensions/bootstrap/lib/bootstrap/js/bootstrap-modal.js
  101. +98 −0 common/extensions/bootstrap/lib/bootstrap/js/bootstrap-popover.js
  102. +151 −0 common/extensions/bootstrap/lib/bootstrap/js/bootstrap-scrollspy.js
  103. +135 −0 common/extensions/bootstrap/lib/bootstrap/js/bootstrap-tab.js
  104. +275 −0 common/extensions/bootstrap/lib/bootstrap/js/bootstrap-tooltip.js
  105. +61 −0 common/extensions/bootstrap/lib/bootstrap/js/bootstrap-transition.js
  106. +285 −0 common/extensions/bootstrap/lib/bootstrap/js/bootstrap-typeahead.js
  107. +54 −0 common/extensions/bootstrap/lib/bootstrap/js/tests/index.html
  108. +63 −0 common/extensions/bootstrap/lib/bootstrap/js/tests/phantom.js
  109. +14 −0 common/extensions/bootstrap/lib/bootstrap/js/tests/server.js
  110. +56 −0 common/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-alert.js
  111. +77 −0 common/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-button.js
  112. +28 −0 common/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-carousel.js
  113. +54 −0 common/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-collapse.js
  114. +87 −0 common/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-dropdown.js
  115. +114 −0 common/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-modal.js
  116. +21 −0 common/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-phantom.js
  117. +93 −0 common/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-popover.js
  118. +31 −0 common/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-scrollspy.js
  119. +61 −0 common/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-tab.js
  120. +136 −0 common/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-tooltip.js
  121. +13 −0 common/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-transition.js
  122. +148 −0 common/extensions/bootstrap/lib/bootstrap/js/tests/unit/bootstrap-typeahead.js
  123. +9,252 −0 common/extensions/bootstrap/lib/bootstrap/js/tests/vendor/jquery.js
  124. +232 −0 common/extensions/bootstrap/lib/bootstrap/js/tests/vendor/qunit.css
  125. +1,510 −0 common/extensions/bootstrap/lib/bootstrap/js/tests/vendor/qunit.js
  126. +33 −0 common/extensions/bootstrap/lib/bootstrap/less/accordion.less
  127. +58 −0 common/extensions/bootstrap/lib/bootstrap/less/alerts.less
  128. +36 −0 common/extensions/bootstrap/lib/bootstrap/less/badges.less
  129. +62 −0 common/extensions/bootstrap/lib/bootstrap/less/bootstrap.less
  130. +24 −0 common/extensions/bootstrap/lib/bootstrap/less/breadcrumbs.less
  131. +191 −0 common/extensions/bootstrap/lib/bootstrap/less/button-groups.less
  132. +191 −0 common/extensions/bootstrap/lib/bootstrap/less/buttons.less
  133. +121 −0 common/extensions/bootstrap/lib/bootstrap/less/carousel.less
  134. +29 −0 common/extensions/bootstrap/lib/bootstrap/less/close.less
  135. +57 −0 common/extensions/bootstrap/lib/bootstrap/less/code.less
  136. +20 −0 common/extensions/bootstrap/lib/bootstrap/less/component-animations.less
  137. +143 −0 common/extensions/bootstrap/lib/bootstrap/less/dropdowns.less
  138. +584 −0 common/extensions/bootstrap/lib/bootstrap/less/forms.less
  139. +5 −0 common/extensions/bootstrap/lib/bootstrap/less/grid.less
  140. +22 −0 common/extensions/bootstrap/lib/bootstrap/less/hero-unit.less
  141. +55 −0 common/extensions/bootstrap/lib/bootstrap/less/labels-badges.less
  142. +38 −0 common/extensions/bootstrap/lib/bootstrap/less/labels.less
  143. +17 −0 common/extensions/bootstrap/lib/bootstrap/less/layouts.less
  144. +631 −0 common/extensions/bootstrap/lib/bootstrap/less/mixins.less
  145. +90 −0 common/extensions/bootstrap/lib/bootstrap/less/modals.less
  146. +364 −0 common/extensions/bootstrap/lib/bootstrap/less/navbar.less
  147. +363 −0 common/extensions/bootstrap/lib/bootstrap/less/navs.less
  148. +36 −0 common/extensions/bootstrap/lib/bootstrap/less/pager.less
  149. +56 −0 common/extensions/bootstrap/lib/bootstrap/less/pagination.less
  150. +49 −0 common/extensions/bootstrap/lib/bootstrap/less/popovers.less
  151. +117 −0 common/extensions/bootstrap/lib/bootstrap/less/progress-bars.less
  152. +126 −0 common/extensions/bootstrap/lib/bootstrap/less/reset.less
  153. +26 −0 common/extensions/bootstrap/lib/bootstrap/less/responsive-1200px-min.less
  154. +149 −0 common/extensions/bootstrap/lib/bootstrap/less/responsive-767px-max.less
  155. +17 −0 common/extensions/bootstrap/lib/bootstrap/less/responsive-768px-979px.less
  156. +146 −0 common/extensions/bootstrap/lib/bootstrap/less/responsive-navbar.less
  157. +41 −0 common/extensions/bootstrap/lib/bootstrap/less/responsive-utilities.less
  158. +48 −0 common/extensions/bootstrap/lib/bootstrap/less/responsive.less
  159. +29 −0 common/extensions/bootstrap/lib/bootstrap/less/scaffolding.less
  160. +191 −0 common/extensions/bootstrap/lib/bootstrap/less/sprites.less
  161. +176 −0 common/extensions/bootstrap/lib/bootstrap/less/tables.less
  162. +47 −0 common/extensions/bootstrap/lib/bootstrap/less/thumbnails.less
  163. +35 −0 common/extensions/bootstrap/lib/bootstrap/less/tooltip.less
  164. +235 −0 common/extensions/bootstrap/lib/bootstrap/less/type.less
  165. +23 −0 common/extensions/bootstrap/lib/bootstrap/less/utilities.less
  166. +205 −0 common/extensions/bootstrap/lib/bootstrap/less/variables.less
  167. +27 −0 common/extensions/bootstrap/lib/bootstrap/less/wells.less
  168. +524 −0 common/extensions/bootstrap/widgets/BootActiveForm.php
  169. +88 −0 common/extensions/bootstrap/widgets/BootAlert.php
  170. +70 −0 common/extensions/bootstrap/widgets/BootBadge.php
  171. +96 −0 common/extensions/bootstrap/widgets/BootBaseMenu.php
  172. +88 −0 common/extensions/bootstrap/widgets/BootBreadcrumbs.php
  173. +244 −0 common/extensions/bootstrap/widgets/BootButton.php
  174. +81 −0 common/extensions/bootstrap/widgets/BootButtonColumn.php
  175. +97 −0 common/extensions/bootstrap/widgets/BootButtonGroup.php
  176. +155 −0 common/extensions/bootstrap/widgets/BootCarousel.php
  177. +56 −0 common/extensions/bootstrap/widgets/BootDataColumn.php
  178. +59 −0 common/extensions/bootstrap/widgets/BootDetailView.php
  179. +119 −0 common/extensions/bootstrap/widgets/BootDropdown.php
  180. +102 −0 common/extensions/bootstrap/widgets/BootGridView.php
  181. +62 −0 common/extensions/bootstrap/widgets/BootHero.php
  182. +71 −0 common/extensions/bootstrap/widgets/BootLabel.php
  183. +31 −0 common/extensions/bootstrap/widgets/BootListView.php
  184. +224 −0 common/extensions/bootstrap/widgets/BootMenu.php
  185. +100 −0 common/extensions/bootstrap/widgets/BootModal.php
  186. +142 −0 common/extensions/bootstrap/widgets/BootNavbar.php
  187. +111 −0 common/extensions/bootstrap/widgets/BootPager.php
  188. +82 −0 common/extensions/bootstrap/widgets/BootProgress.php
  189. +186 −0 common/extensions/bootstrap/widgets/BootTabbable.php
  190. +45 −0 common/extensions/bootstrap/widgets/BootThumbnails.php
  191. +49 −0 common/extensions/bootstrap/widgets/BootTypeahead.php
  192. +358 −0 common/extensions/bootstrap/widgets/input/BootInput.php
  193. +215 −0 common/extensions/bootstrap/widgets/input/BootInputHorizontal.php
  194. +57 −0 common/extensions/bootstrap/widgets/input/BootInputInline.php
  195. +34 −0 common/extensions/bootstrap/widgets/input/BootInputSearch.php
  196. +170 −0 common/extensions/bootstrap/widgets/input/BootInputVertical.php
  197. 0  common/lib/Behat-2.4.version
  198. BIN  common/lib/Behat/behat.phar
  199. BIN  common/lib/Behat/extensions/mink_extension.phar
  200. BIN  common/lib/Behat/mink.phar
  201. +1 −0  common/lib/Yii/.htaccess
  202. +855 −0 common/lib/Yii/YiiBase.php
  203. +971 −0 common/lib/Yii/base/CApplication.php
  204. +58 −0 common/lib/Yii/base/CApplicationComponent.php
  205. +103 −0 common/lib/Yii/base/CBehavior.php
  206. +686 −0 common/lib/Yii/base/CComponent.php
  207. +54 −0 common/lib/Yii/base/CErrorEvent.php
  208. +579 −0 common/lib/Yii/base/CErrorHandler.php
  209. +22 −0 common/lib/Yii/base/CException.php
  210. +36 −0 common/lib/Yii/base/CExceptionEvent.php
  211. +40 −0 common/lib/Yii/base/CHttpException.php
  212. +612 −0 common/lib/Yii/base/CModel.php
  213. +66 −0 common/lib/Yii/base/CModelBehavior.php
  214. +39 −0 common/lib/Yii/base/CModelEvent.php
  215. +517 −0 common/lib/Yii/base/CModule.php
  216. +329 −0 common/lib/Yii/base/CSecurityManager.php
  217. +108 −0 common/lib/Yii/base/CStatePersister.php
  218. +686 −0 common/lib/Yii/base/interfaces.php
  219. +109 −0 common/lib/Yii/caching/CApcCache.php
  220. +377 −0 common/lib/Yii/caching/CCache.php
  221. +314 −0 common/lib/Yii/caching/CDbCache.php
  222. +164 −0 common/lib/Yii/caching/CDummyCache.php
  223. +107 −0 common/lib/Yii/caching/CEAcceleratorCache.php
  224. +221 −0 common/lib/Yii/caching/CFileCache.php
  225. +271 −0 common/lib/Yii/caching/CMemCache.php
  226. +109 −0 common/lib/Yii/caching/CWinCache.php
Sorry, we could not display the entire diff because too many files (4,938) changed.
View
46 .gitignore
@@ -0,0 +1,46 @@
+# cache directories
+Thumbs.db
+*.DS_Store
+*.empty
+
+#phpstorm project files
+.idea
+
+#netbeans project files
+nbproject
+
+#zend studio project files
+.buildpath
+.project
+.settings
+
+# sass cache files
+*.sass-cache
+
+# mac deployment helpers
+switch
+index
+
+# runtime and cache directories
+/backend/www/assets
+/backend/runtime
+
+/frontend/www/assets
+/frontend/runtime
+
+/console/runtime
+
+# configuration files created locally by post deployment script or by a developer
+/backend/config/*-env.php
+/backend/config/*-local.php
+
+/frontend/config/*-env.php
+/frontend/config/*-local.php
+
+/common/config/*-env.php
+/common/config/*-local.php
+
+/console/config/*-env.php
+/console/config/*-local.php
+
+
View
5 INSTALL.md
@@ -0,0 +1,5 @@
+h1. Boilerplate project installation instructions
+
+You should insert all prequisites for your project
+along with installation instructions in here.
+Do not forget to add description of project to @README.md@ document!
View
4 README.md
@@ -0,0 +1,4 @@
+h1. Boilerplate project
+
+You should insert the brief and long descriptions of your project here,
+and installation instructions in @INSTALL.md@ document
View
14 backend/components/Controller.php
@@ -0,0 +1,14 @@
+<?php
+/**
+ * Controller.php
+ *
+ * @author: antonio ramirez <antonio@clevertech.biz>
+ * Date: 7/23/12
+ * Time: 12:55 AM
+ */
+class Controller extends CController {
+
+ public $breadcrumbs = array();
+ public $menu = array();
+
+}
View
12 backend/config/environments/main-private.php
@@ -0,0 +1,12 @@
+<?php
+/**
+ * main.php
+ *
+ * @author: antonio ramirez <antonio@clevertech.biz>
+ * Date: 7/22/12
+ * Time: 5:48 PM
+ *
+ * This file will be merged on main-env.php configuration file. It should contain application configuration settings,
+ * related to your development machine. You can also use main-local.php
+ */
+return array();
View
9 backend/config/environments/main-prod.php
@@ -0,0 +1,9 @@
+<?php
+/**
+ * main.php
+ *
+ * @author: antonio ramirez <antonio@clevertech.biz>
+ * Date: 7/22/12
+ * Time: 5:48 PM
+ */
+return array();
View
11 backend/config/environments/params-private.php
@@ -0,0 +1,11 @@
+<?php
+/**
+ * params-private.php
+ *
+ * @author: antonio ramirez <antonio@clevertech.biz>
+ * Date: 7/22/12
+ * Time: 5:51 PM
+ */
+return array(
+ 'env.code' => 'private'
+);
View
11 backend/config/environments/params-prod.php
@@ -0,0 +1,11 @@
+<?php
+/**
+ * params-private.php
+ *
+ * @author: antonio ramirez <antonio@clevertech.biz>
+ * Date: 7/22/12
+ * Time: 5:51 PM
+ */
+return array(
+ 'env.code' => 'prod'
+);
View
12 backend/config/main-env.php
@@ -0,0 +1,12 @@
+<?php
+/**
+ * main-env.php
+ *
+ * @author: antonio ramirez <antonio@clevertech.biz>
+ * Date: 7/22/12
+ * Time: 6:26 PM
+ *
+ * Once used, the runpostdeploy command, this file will be filled with the configuration details of the environment
+ * specified in the command and will be merged with the main.php configuration file.
+ */
+return array();
View
30 backend/config/main-local.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * main-local.php
+ *
+ * @author: antonio ramirez <antonio@clevertech.biz>
+ * Date: 7/22/12
+ * Time: 6:25 PM
+ *
+ * This file should have the configuration settings of your backend application that will be merged to the main.php.
+ *
+ * This configurations should be only related to your development machine.
+ */
+
+return array(
+ 'components' => array(
+ 'db'=> array(
+ 'connectionString' => $params['db.connectionString'],
+ 'username' => $params['db.username'],
+ 'password' => $params['db.password'],
+ 'schemaCachingDuration' => YII_DEBUG ? 0 : 86400000, // 1000 days
+ 'enableParamLogging' => Yii_DEBUG,
+ 'charset' => 'utf8'
+ ),
+ 'urlManager' => array(
+ 'urlFormat' => $params['url.format'],
+ 'showScriptName' => $params['url.showScriptName'],
+ 'rules' => $params['url.rules']
+ )
+ )
+);
View
105 backend/config/main.php
@@ -0,0 +1,105 @@
+<?php
+/**
+ * main.php
+ *
+ * @author: antonio ramirez <antonio@clevertech.biz>
+ * Date: 7/22/12
+ * Time: 5:48 PM
+ *
+ * This file holds the configuration settings of your backend application.
+ **/
+$currentDir = dirname(__FILE__);
+
+$root = $currentDir . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..';
+
+$params = require_once($currentDir . DIRECTORY_SEPARATOR . 'params.php');
+
+// Setup some default path aliases. These alias may vary from projects.
+Yii::setPathOfAlias('root', $root);
+Yii::setPathOfAlias('common', $root . DIRECTORY_SEPARATOR . 'common');
+Yii::setPathOfAlias('backend', $root . DIRECTORY_SEPARATOR . 'backend');
+Yii::setPathOfAlias('www', $root. DIRECTORY_SEPARATOR . 'backend' . DIRECTORY_SEPARATOR . 'www');
+/* uncomment if you need to use frontend folders */
+/* Yii::setPathOfAlias('frontend', $root . DIRECTORY_SEPARATOR . 'frontend'); */
+
+
+$mainLocalFile = $currentDir . DIRECTORY_SEPARATOR . 'main-local.php';
+$mainLocalConfiguration = file_exists($mainLocalFile)? require($mainLocalFile): array();
+
+$mainEnvFile = $currentDir . DIRECTORY_SEPARATOR . 'main-env.php';
+$mainEnvConfiguration = file_exists($mainEnvFile) ? require($mainEnvFile) : array();
+
+return CMap::mergeArray(
+ array(
+ 'name' => 'Clevertech Backend Boilerplate',
+ // @see http://www.yiiframework.com/doc/api/1.1/CApplication#basePath-detail
+ 'basePath' => 'backend',
+ // set parameters
+ 'params' => $params,
+ // preload components required before running applications
+ // @see http://www.yiiframework.com/doc/api/1.1/CModule#preload-detail
+ 'preload' => array('bootstrap', 'log'),
+ // @see http://www.yiiframework.com/doc/api/1.1/CApplication#language-detail
+ 'language' => 'en',
+ // using bootstrap theme
+ 'theme' => 'bootstrap',
+ // setup import paths aliases
+ // @see http://www.yiiframework.com/doc/api/1.1/YiiBase#import-detail
+ 'import' => array(
+ 'common.components.*',
+ 'common.extensions.*',
+ /* uncomment if required */
+ /* 'common.extensions.behaviors.*', */
+ /* 'common.extensions.validators.*', */
+ 'common.models.*',
+ // uncomment if behaviors are required
+ // you can also import a specific one
+ /* 'common.extensions.behaviors.*', */
+ // uncomment if validators on common folder are required
+ /* 'common.extensions.validators.*', */
+ 'application.components.*',
+ 'application.controllers.*',
+ 'application.models.*'
+ ),
+ /* uncomment and set if required */
+ // @see http://www.yiiframework.com/doc/api/1.1/CModule#setModules-detail
+ /* 'modules' => array(
+ 'gii' => array(
+ 'class' => 'system.gii.GiiModule',
+ 'password' => 'clevertech',
+ 'generatorsPaths' => array(
+ 'bootstrap.gii'
+ )
+ )
+ ), */
+ 'components' => array(
+ /* load bootstrap components */
+ 'bootstrap' => array(
+ 'class' => 'common.extensions.bootstrap.components.Bootstrap',
+ 'coreCss' => false
+ ),
+ 'errorHandler' => array(
+ // @see http://www.yiiframework.com/doc/api/1.1/CErrorHandler#errorAction-detail
+ 'errorAction'=>'site/error'
+ ),
+ 'db'=> array(
+ 'connectionString' => $params['db.connectionString'],
+ 'username' => $params['db.username'],
+ 'password' => $params['db.password'],
+ 'schemaCachingDuration' => YII_DEBUG ? 0 : 86400000, // 1000 days
+ 'enableParamLogging' => YII_DEBUG,
+ 'charset' => 'utf8'
+ ),
+ 'urlManager' => array(
+ 'urlFormat' => 'path',
+ 'showScriptName' => false,
+ 'urlSuffix' => '/',
+ 'rules' => $params['url.rules']
+ ),
+ ),
+ /* make sure you have your cache set correctly before uncommenting */
+ /* 'cache' => $params['cache.core'], */
+ /* 'contentCache' => $params['cache.content'] */
+ ),
+ CMap::mergeArray($mainEnvConfiguration, $mainLocalConfiguration)
+);
View
9 backend/config/params-env.php
@@ -0,0 +1,9 @@
+<?php
+/**
+ * params-env.php
+ *
+ * @author: antonio ramirez <antonio@clevertech.biz>
+ * Date: 7/22/12
+ * Time: 6:26 PM
+ */
+return array();
View
14 backend/config/params-local.php
@@ -0,0 +1,14 @@
+<?php
+/**
+ * params-local.php
+ *
+ * @author: antonio ramirez <antonio@clevertech.biz>
+ * Date: 7/22/12
+ * Time: 5:59 PM
+ */
+/**
+ * Put any configuration parameters here for your local development
+ */
+return array(
+
+);
View
39 backend/config/params.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * params.php
+ *
+ * @author: antonio ramirez <antonio@clevertech.biz>
+ * Date: 7/22/12
+ * Time: 1:38 PM
+ */
+$currentDir = dirname(__FILE__);
+
+$paramsLocalFile = $currentDir . DIRECTORY_SEPARATOR . 'params-local.php';
+$paramsLocalFileArray = file_exists($paramsLocalFile) ? require($paramsLocalFile) : array();
+
+$paramsEnvFile = $currentDir . DIRECTORY_SEPARATOR . 'params-env.php';
+$paramsEnvFileArray = file_exists($paramsEnvFile) ? require($paramsEnvFile) : array();
+
+$paramsCommonFile = $currentDir . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR .
+ 'common' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'params.php';
+
+$paramsCommonArray = file_exists($paramsCommonFile) ? require($paramsCommonFile) : array();
+
+return CMap::mergeArray(
+ $paramsCommonArray,
+ // merge frontend specific with resulting env-local merge *override by local
+ CMap::mergeArray(
+ array(
+ 'url.rules' => array(
+ /* for REST please @see http://www.yiiframework.com/wiki/175/how-to-create-a-rest-api/ */
+ /* other @see http://www.yiiframework.com/doc/guide/1.1/en/topics.url */
+ '<controller:\w+>/<id:\d+>' => '<controller>/view',
+ '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
+ '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
+ ),
+ // add here all frontend-specific parameters
+ ),
+ // merge environment parameters with local *override by local
+ CMap::mergeArray($paramsEnvFileArray, $paramsLocalFileArray)
+ )
+);
View
30 backend/config/test.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * test.php
+ *
+ * configuration file for testing
+ *
+ * @author: antonio ramirez <antonio@clevertech.biz>
+ * Date: 7/24/12
+ * Time: 8:08 AM
+ */
+return CMap::mergeArray(
+ require(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'main.php'),
+ array(
+ 'components' => array(
+ 'fixture' => array(
+ 'class' => 'system.test.CDbFixtureManager'
+ ),
+ /* uncomment if we require to run commands against test database */
+ /*
+ 'db' => array(
+ 'connectionString' => $params['testdb.connectionString'],
+ 'username' => $params['testdb.username'],
+ 'password' => $params['testdb.password'],
+ 'charset' => 'utf8'
+ ),
+ */
+
+ )
+ )
+);
View
103 backend/controllers/SiteController.php
@@ -0,0 +1,103 @@
+<?php
+/**
+ * SiteController.php
+ *
+ * @author: antonio ramirez <antonio@clevertech.biz>
+ * Date: 7/24/12
+ * Time: 1:21 AM
+ */
+
+class SiteController extends Controller {
+ /**
+ * @return array list of action filters (See CController::filter)
+ */
+ public function filters() {
+ return array('accessControl');
+ }
+
+ /**
+ * @return array rules for the "accessControl" filter.
+ */
+ public function accessRules() {
+ return array(
+ array('allow', // Allow registration form for anyone
+ 'actions' => array('index', 'login', 'logout', 'recover', 'captcha', 'error', 'test'),
+ ),
+ array('allow', // Allow all actions for logged in users ("@")
+ 'users' => array('@'),
+ ),
+ array('deny'), // Deny anything else
+ );
+ }
+
+ /**
+ *
+ * @return array actions
+ */
+ public function actions() {
+ return array(
+ 'captcha' => array(
+ 'class' => 'CCaptchaAction',
+ 'backColor' => 0xFFFFFF,
+ 'foreColor' => 0x0099CC,
+ ),
+ 'page' => array(
+ 'class' => 'CViewAction',
+ ),
+ );
+ }
+
+ /**
+ * Renders index page
+ */
+ public function actionIndex() {
+ $this->render('index');
+ }
+
+ /**
+ * Action to render the error
+ * todo: design proper error page
+ */
+ public function actionError() {
+ if ($error = app()->errorHandler->error) {
+ if (app()->request->isAjaxRequest)
+ echo $error['message'];
+ else
+ $this->render('error', $error);
+ }
+ }
+
+ /**
+ * Action to render login form or handle user's login
+ * and redirection
+ */
+ public function actionLogin() {
+ $model = new LoginForm();
+
+ if (isset($_POST['ajax']) && $_POST['ajax'] === 'login-form') {
+ echo CActiveForm::validate($model, array('username', 'password', 'verifyCode'));
+ Yii::app()->end();
+ }
+
+ if (isset($_POST['LoginForm'])) {
+ $model->attributes = $_POST['LoginForm'];
+ if ($model->validate(array('username', 'password', 'verifyCode')) && $model->login())
+ $this->redirect(user()->returnUrl);
+ }
+
+ $sent = r()->getParam('sent', 0);
+ $this->render('login', array(
+ 'model' => $model,
+ 'sent' => $sent,
+ ));
+ }
+
+ /**
+ * This is the action that handles user's logout
+ */
+ public function actionLogout() {
+ user()->logout();
+ $this->redirect(app()->homeUrl);
+ }
+
+}
View
0  backend/extensions/behaviors/.ctlib
No changes.
View
0  backend/extensions/validators/.ctlib
No changes.
View
0  backend/lib/.ctlib
No changes.
View
115 backend/models/LoginForm.php
@@ -0,0 +1,115 @@
+<?php
+/**
+ * LoginForm.php
+ *
+ * @author: antonio ramirez <antonio@clevertech.biz>
+ * Date: 7/22/12
+ * Time: 8:37 PM
+ */
+
+class LoginForm extends CFormModel {
+
+ // maximum number of login attempts before display captcha
+ const MAX_LOGIN_ATTEMPTS = 3;
+
+ public $username;
+ public $password;
+ public $email;
+ public $rememberMe;
+ public $verifyCode;
+ private $_identity;
+ private $_user = null;
+
+ /**
+ * Model rules
+ * @return array
+ */
+ public function rules() {
+ return array(
+ array('username, password, email', 'required'),
+ array('username', 'length', 'max' => 45),
+ array('password', 'length', 'max' => 50, 'min' => 6),
+ array('verifyCode', 'validateCaptcha'),
+ array('password', 'authenticate'),
+ array('rememberMe', 'boolean'),
+ array('email', 'email'),
+ array('email', 'length', 'max' => 125),
+ array('email', 'exist', 'className' => 'Customer'),
+ );
+ }
+
+ /**
+ * Returns attribute labels
+ * @return array
+ */
+ public function attributeLabels() {
+ return array(
+ 'username' => Yii::t('labels', 'Username or e-mail'),
+ 'rememberMe' => Yii::t('labels', 'Remember me next time'),
+ );
+ }
+
+ /**
+ * Authenticates user input against DB
+ * @param $attribute
+ * @param $params
+ */
+ public function authenticate($attribute, $params) {
+ if (!$this->hasErrors()) {
+ $this->_identity = new UserIdentity($this->username, $this->password);
+ if (!$this->_identity->authenticate()) {
+ if (($user = $this->user) !== null && $user->login_attempts < 100)
+ $user->saveAttributes(array('login_attempts' => $user->login_attempts + 1));
+ $this->addError('username', Yii::t('errors', 'Incorrect username and/or password.'));
+ $this->addError('password', Yii::t('errors', 'Incorrect username and/or password.'));
+ }
+ }
+ }
+
+ /**
+ * Validates captcha code
+ * @param $attribute
+ * @param $params
+ */
+ public function validateCaptcha($attribute, $params) {
+ if ($this->getRequireCaptcha())
+ CValidator::createValidator('captcha', $this, $attribute, $params)->validate($this);
+ }
+
+ /**
+ * Login
+ * @return bool
+ */
+ 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;
+ }
+ }
+
+ /**
+ * Returns
+ * @return null
+ */
+ public function getUser() {
+ if ($this->_user === null) {
+ $attribute = strpos($this->username, '@') ? 'email' : 'username';
+ $this->_user = User::model()->find(array('condition' => $attribute . '=:loginname', 'params' => array(':loginname' => $this->username)));
+ }
+ return $this->_user;
+ }
+
+ /**
+ * Returns whether it requires captcha or not
+ * @return bool
+ */
+ public function getRequireCaptcha() {
+ return ($user = $this->user) !== null && $user->login_attempts >= self::MAX_LOGIN_ATTEMPTS;
+ }
+
+}
View
0  backend/modules/.ctlib
No changes.
View
7 backend/views/layouts/column1.php
@@ -0,0 +1,7 @@
+<?php $this->beginContent('//layouts/main'); ?>
+<div class="container">
+ <div id="content">
+ <?php echo $content; ?>
+ </div><!-- content -->
+</div>
+<?php $this->endContent(); ?>
View
23 backend/views/layouts/column2.php
@@ -0,0 +1,23 @@
+<?php $this->beginContent('//layouts/main'); ?>
+<div class="container">
+ <div class="span-19">
+ <div id="content">
+ <?php echo $content; ?>
+ </div><!-- content -->
+ </div>
+ <div class="span-5 last">
+ <div id="sidebar">
+ <?php
+ $this->beginWidget('zii.widgets.CPortlet', array(
+ 'title'=>'Operations',
+ ));
+ $this->widget('zii.widgets.CMenu', array(
+ 'items'=>$this->menu,
+ 'htmlOptions'=>array('class'=>'operations'),
+ ));
+ $this->endWidget();
+ ?>
+ </div><!-- sidebar -->
+ </div>
+</div>
+<?php $this->endContent(); ?>
View
78 backend/views/layouts/main.php
@@ -0,0 +1,78 @@
+<?php
+
+cs()->registerCoreScript('jquery.ui');
+cs()->registerScript('cores' . time(), '
+ $("select, input:checkbox, input:radio, input:file,input:text,input:password, textarea").uniform();', CClientScript::POS_LOAD);
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <meta name="language" content="en"/>
+
+ <link rel="icon" href="<?php echo Yii::app()->request->baseUrl; ?>/favicon.ico" type="image/x-icon"/>
+ <!-- blueprint CSS framework -->
+ <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css"
+ media="screen, projection"/>
+ <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css"
+ media="print"/>
+ <!--[if lt IE 8]>
+ <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css"
+ media="screen, projection"/>
+ <![endif]-->
+
+ <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css"/>
+ <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css"/>
+ <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/uniform.aristo.css"/>
+
+ <title><?php echo CHtml::encode($this->pageTitle); ?></title>
+</head>
+
+<body>
+
+<div class="container" id="page">
+
+ <div id="header">
+ <div id="logo"><?php echo CHtml::encode(Yii::app()->name); ?></div>
+ </div>
+ <!-- header -->
+
+ <div id="mainmenu">
+ <?php $this->widget('zii.widgets.CMenu', array(
+ 'items' => array(
+ array('label' => 'Home', 'url' => array('/site/index')),
+ array('label' => 'About', 'url' => array('/site/page', 'view' => 'about')),
+ array('label' => 'Contact', 'url' => array('/site/contact')),
+ array('label' => 'Categories', 'url' => array('/category/index'), 'visible' => !Yii::app()->user->isGuest),
+ array('label' => 'Sources', 'url' => array('/source/index'), 'visible' => !Yii::app()->user->isGuest),
+ array('label' => 'Source Types', 'url' => array('/sourceType/index'), 'visible' => !Yii::app()->user->isGuest),
+ array('label' => 'Users', 'url' => array('/user/index'), 'visible' => !Yii::app()->user->isGuest),
+ array('label' => 'Login', 'url' => array('/site/login'), 'visible' => Yii::app()->user->isGuest),
+ array('label' => 'Logout (' . Yii::app()->user->name . ')', 'url' => array('/site/logout'), 'visible' => !Yii::app()->user->isGuest)
+ ),
+ )); ?>
+ </div>
+ <!-- mainmenu -->
+ <?php if (isset($this->breadcrumbs)): ?>
+ <?php $this->widget('zii.widgets.CBreadcrumbs', array(
+ 'links' => $this->breadcrumbs,
+ )); ?><!-- breadcrumbs -->
+ <?php endif?>
+
+ <?php echo $content; ?>
+
+ <div id="footer">
+ Copyright &copy; <?php echo date('Y'); ?> by My Company.<br/>
+ All Rights Reserved.<br/>
+ <?php echo Yii::powered(); ?>
+ </div>
+ <!-- footer -->
+
+</div>
+<!-- page -->
+<!-- =uniform buttons-->
+<script src="<?php echo bu('js/jquery.uniform.js');?>"></script>
+
+</body>
+</html>
View
81 backend/views/site/contact.php
@@ -0,0 +1,81 @@
+<?php
+$this->pageTitle=Yii::app()->name . ' - Contact Us';
+$this->breadcrumbs=array(
+ 'Contact',
+);
+?>
+
+<h1>Contact Us</h1>
+
+<?php if(Yii::app()->user->hasFlash('contact')): ?>
+
+<div class="flash-success">
+ <?php echo Yii::app()->user->getFlash('contact'); ?>
+</div>
+
+<?php else: ?>
+
+<p>
+ If you have business inquiries or other questions, please fill out the following form to contact us. Thank you.
+</p>
+
+<div class="form">
+
+ <?php $form=$this->beginWidget('CActiveForm', array(
+ 'id'=>'contact-form',
+ 'enableClientValidation'=>true,
+ 'clientOptions'=>array(
+ 'validateOnSubmit'=>true,
+ ),
+)); ?>
+
+ <p class="note">Fields with <span class="required">*</span> are required.</p>
+
+ <?php echo $form->errorSummary($model); ?>
+
+ <div class="row">
+ <?php echo $form->labelEx($model,'name'); ?>
+ <?php echo $form->textField($model,'name'); ?>
+ <?php echo $form->error($model,'name'); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->labelEx($model,'email'); ?>
+ <?php echo $form->textField($model,'email'); ?>
+ <?php echo $form->error($model,'email'); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->labelEx($model,'subject'); ?>
+ <?php echo $form->textField($model,'subject',array('size'=>60,'maxlength'=>128)); ?>
+ <?php echo $form->error($model,'subject'); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->labelEx($model,'body'); ?>
+ <?php echo $form->textArea($model,'body',array('rows'=>6, 'cols'=>50)); ?>
+ <?php echo $form->error($model,'body'); ?>
+ </div>
+
+ <?php if(CCaptcha::checkRequirements()): ?>
+ <div class="row">
+ <?php echo $form->labelEx($model,'verifyCode'); ?>
+ <div>
+ <?php $this->widget('CCaptcha'); ?>
+ <?php echo $form->textField($model,'verifyCode'); ?>
+ </div>
+ <div class="hint">Please enter the letters as they are shown in the image above.
+ <br/>Letters are not case-sensitive.</div>
+ <?php echo $form->error($model,'verifyCode'); ?>
+ </div>
+ <?php endif; ?>
+
+ <div class="row buttons">
+ <?php echo CHtml::submitButton('Submit'); ?>
+ </div>
+
+ <?php $this->endWidget(); ?>
+
+</div><!-- form -->
+
+<?php endif; ?>
View
12 backend/views/site/error.php
@@ -0,0 +1,12 @@
+<?php
+$this->pageTitle=Yii::app()->name . ' - Error';
+$this->breadcrumbs=array(
+ 'Error',
+);
+?>
+
+<h2>Error <?php echo $code; ?></h2>
+
+<div class="error">
+<?php echo CHtml::encode($message); ?>
+</div>
View
45 backend/views/site/index.php
@@ -0,0 +1,45 @@
+<?php $this->pageTitle=Yii::app()->name; ?>
+
+<h1>Welcome to <i><?php echo CHtml::encode(Yii::app()->name); ?></i></h1>
+
+<?php Yii::app()->user->setFlash('success', '<strong>Well done!</strong> You have successfully created your Yii application.');?>
+<?php $this->widget('bootstrap.widgets.BootAlert'); ?>
+
+<p>You may change the content of this page by modifying the following two files:</p>
+<ul>
+ <li>View file: <tt><?php echo __FILE__; ?></tt></li>
+ <li>Layout file: <tt><?php echo $this->getLayoutFile('main'); ?></tt></li>
+</ul>
+
+<p>For more details on how to further develop this application, please read
+the <a href="http://www.yiiframework.com/doc/">documentation</a>.
+Feel free to ask in the <a href="http://www.yiiframework.com/forum/">forum</a>,
+should you have any questions.</p>
+
+<?php
+
+$gridDataProvider = new CArrayDataProvider(array(
+ array('id'=>1, 'firstName'=>'Mark', 'lastName'=>'Otto', 'language'=>'CSS'),
+ array('id'=>2, 'firstName'=>'Jacob', 'lastName'=>'Thornton', 'language'=>'JavaScript'),
+ array('id'=>3, 'firstName'=>'Stu', 'lastName'=>'Dent', 'language'=>'HTML'),
+));
+
+?>
+<?php $this->widget('bootstrap.widgets.BootGridView', array(
+ 'type'=>'striped bordered condensed',
+ 'dataProvider'=>$gridDataProvider,
+ 'template'=>"{items}",
+ 'columns'=>array(
+ array('name'=>'id', 'header'=>'#'),
+ array('name'=>'firstName', 'header'=>'First name'),
+ array('name'=>'lastName', 'header'=>'Last name'),
+ array('name'=>'language', 'header'=>'Language'),
+ array(
+ 'class'=>'bootstrap.widgets.BootButtonColumn',
+ 'viewButtonUrl'=>'Yii::app()->controller->createUrl("view",array("id"=>$data["id"]))',
+ 'updateButtonUrl'=>'Yii::app()->controller->createUrl("update",array("id"=>$data["id"]))',
+ 'deleteButtonUrl'=>'Yii::app()->controller->createUrl("delete",array("id"=>$data["id"]))',
+ 'htmlOptions'=>array('style'=>'width: 50px'),
+ ),
+ ),
+)); ?>
View
49 backend/views/site/login.php
@@ -0,0 +1,49 @@
+<?php
+$this->pageTitle=Yii::app()->name . ' - Login';
+$this->breadcrumbs=array(
+ 'Login',
+);
+?>
+
+<h1>Login</h1>
+
+<p>Please fill out the following form with your login credentials:</p>
+
+<div class="form">
+ <?php $form=$this->beginWidget('CActiveForm', array(
+ 'id'=>'login-form',
+ 'enableClientValidation'=>true,
+ 'clientOptions'=>array(
+ 'validateOnSubmit'=>true,
+ ),
+)); ?>
+
+ <p class="note">Fields with <span class="required">*</span> are required.</p>
+
+ <div class="row">
+ <?php echo $form->labelEx($model,'username'); ?>
+ <?php echo $form->textField($model,'username'); ?>
+ <?php echo $form->error($model,'username'); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->labelEx($model,'password'); ?>
+ <?php echo $form->passwordField($model,'password'); ?>
+ <?php echo $form->error($model,'password'); ?>
+ <p class="hint">
+ Hint: You may login with <tt>demo/demo</tt> or <tt>admin/admin</tt>.
+ </p>
+ </div>
+
+ <div class="row rememberMe">
+ <?php echo $form->checkBox($model,'rememberMe'); ?>
+ <?php echo $form->label($model,'rememberMe'); ?>
+ <?php echo $form->error($model,'rememberMe'); ?>
+ </div>
+
+ <div class="row buttons">
+ <?php echo CHtml::submitButton('Login'); ?>
+ </div>
+
+ <?php $this->endWidget(); ?>
+</div><!-- form -->
View
10 backend/views/site/pages/about.php
@@ -0,0 +1,10 @@
+<?php
+$this->pageTitle=Yii::app()->name . ' - About';
+$this->breadcrumbs=array(
+ 'About',
+);
+?>
+<h1>About</h1>
+
+<p>This is a "static" page. You may change the content of this page
+by updating the file <tt><?php echo __FILE__; ?></tt>.</p>
View
0  backend/widgets/.ctlib
No changes.
View
133 backend/www/.htaccess
@@ -0,0 +1,133 @@
+# ----------------------------------------------------------------------
+# gzip compression
+# ----------------------------------------------------------------------
+
+<IfModule mod_deflate.c>
+# force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
+<IfModule mod_setenvif.c>
+ <IfModule mod_headers.c>
+ SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s,?\s(gzip|deflate)?|X{4,13}|~{4,13}|-{4,13})$ HAVE_Accept-Encoding
+ RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
+ </IfModule>
+</IfModule>
+# html, txt, css, js, json, xml, htc:
+<IfModule filter_module>
+ FilterDeclare COMPRESS
+ FilterProvider COMPRESS DEFLATE resp=Content-Type /text/(html|css|javascript|plain|x(ml|-component))/
+ FilterProvider COMPRESS DEFLATE resp=Content-Type /application/(javascript|json|xml|x-javascript)/
+ FilterChain COMPRESS
+ FilterProtocol COMPRESS change=yes;byteranges=no
+</IfModule>
+
+<IfModule !mod_filter.c>
+ # Legacy versions of Apache
+ AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
+ AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
+ AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
+</IfModule>
+
+# webfonts and svg:
+ <FilesMatch "\.(ttf|otf|eot|svg)$" >
+ SetOutputFilter DEFLATE
+ </FilesMatch>
+</IfModule>
+
+
+
+# ----------------------------------------------------------------------
+# Expires headers (for better cache control)
+# ----------------------------------------------------------------------
+
+# these are pretty far-future expires headers
+# they assume you control versioning with cachebusting query params like
+# <script src="application.js?20100608">
+# additionally, consider that outdated proxies may miscache
+# www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
+
+# if you don't use filenames to version, lower the css and js to something like
+# "access plus 1 week" or so
+
+<IfModule mod_expires.c>
+ ExpiresActive on
+
+# Perhaps better to whitelist expires rules? Perhaps.
+ ExpiresDefault "access plus 1 month"
+
+# cache.appcache needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)
+ ExpiresByType text/cache-manifest "access plus 0 seconds"
+
+# your document html
+ ExpiresByType text/html "access plus 0 seconds"
+
+# data
+ ExpiresByType text/xml "access plus 0 seconds"
+ ExpiresByType application/xml "access plus 0 seconds"
+ ExpiresByType application/json "access plus 0 seconds"
+
+# rss feed
+ ExpiresByType application/rss+xml "access plus 1 hour"
+
+# favicon (cannot be renamed)
+ ExpiresByType image/x-icon "access plus 1 week"
+
+# media: images, video, audio
+ ExpiresByType image/gif "access plus 1 month"
+ ExpiresByType image/png "access plus 1 month"
+ ExpiresByType image/jpg "access plus 1 month"
+ ExpiresByType image/jpeg "access plus 1 month"
+ ExpiresByType video/ogg "access plus 1 month"
+ ExpiresByType audio/ogg "access plus 1 month"
+ ExpiresByType video/mp4 "access plus 1 month"
+ ExpiresByType video/webm "access plus 1 month"
+
+# htc files (css3pie)
+ ExpiresByType text/x-component "access plus 1 month"
+
+# webfonts
+ ExpiresByType font/truetype "access plus 1 month"
+ ExpiresByType font/opentype "access plus 1 month"
+ ExpiresByType application/x-font-woff "access plus 1 month"
+ ExpiresByType image/svg+xml "access plus 1 month"
+ ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
+
+# css and javascript
+ ExpiresByType text/css "access plus 2 months"
+ ExpiresByType application/javascript "access plus 2 months"
+ ExpiresByType text/javascript "access plus 2 months"
+
+ <IfModule mod_headers.c>
+ Header append Cache-Control "public"
+ </IfModule>
+
+</IfModule>
+
+
+
+# ----------------------------------------------------------------------
+# ETag removal
+# ----------------------------------------------------------------------
+
+# Since we're sending far-future expires, we don't need ETags for
+# static content.
+# developer.yahoo.com/performance/rules.html#etags
+FileETag None
+
+RedirectMatch 404 /\\.git(/|$)
+
+RewriteEngine on
+
+# If you are in a sub folder of your web root you
+# might have to enable something like this:
+#
+# RewriteBase /~antonio/app/frontend/www
+
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+
+RewriteRule . index.php
+
+# Tmp for large data uploads
+<IfModule mod_php5.c>
+php_value upload_max_filesize 60M
+php_value post_max_size 60M
+</IfModule>
View
0  backend/www/css/.ctlib
No changes.
View
BIN  backend/www/images/favicon.ico
Binary file not shown
View
46 backend/www/index.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * index.php
+ *
+ * @author: antonio ramirez <antonio@clevertech.biz>
+ * Date: 7/22/12
+ * Time: 11:13 AM
+ */
+defined('YII_DEBUG') or define('YII_DEBUG',true);
+defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
+
+// On dev display all errors
+if(YII_DEBUG) {
+ error_reporting(-1);
+ ini_set('display_errors', true);
+}
+
+date_default_timezone_set('UTC');
+
+chdir(dirname(__FILE__).'/../..');
+
+$root=dirname(__FILE__).'/..';
+$common=$root.'/../common';
+
+require_once($common.'/lib/Yii/yii.php');
+$config=require('backend/config/main.php');
+require_once($common.'/components/WebApplication.php');
+require_once('common/lib/global.php');
+
+
+$app = Yii::createApplication('WebApplication', $config);
+
+/* please, uncomment the following if you are using ZF library */
+/*
+Yii::import('common.extensions.EZendAutoloader', true);
+
+EZendAutoloader::$prefixes = array('Zend');
+EZendAutoloader::$basePath = Yii::getPathOfAlias('common.lib') . DIRECTORY_SEPARATOR;
+
+Yii::registerAutoloader(array("EZendAutoloader", "loadClass"), true);
+*/
+
+$app->run();
+
+/* uncomment if you wish to debug your resulting config */
+/* echo '<pre>' . dump($config) . '</pre>'; */
View
0  backend/www/themes/bootstrap/Bootstrap-2.0.4.version
No changes.
View
815 backend/www/themes/bootstrap/css/bootstrap-responsive.css
@@ -0,0 +1,815 @@
+/*!
+ * Bootstrap Responsive v2.0.4
+ *
+ * Copyright 2012 Twitter, Inc
+ * Licensed under the Apache License v2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Designed and built with all the love in the world @twitter by @mdo and @fat.
+ */
+
+.clearfix {
+ *zoom: 1;
+}
+
+.clearfix:before,
+.clearfix:after {
+ display: table;
+ content: "";
+}
+
+.clearfix:after {
+ clear: both;
+}
+
+.hide-text {
+ font: 0/0 a;
+ color: transparent;
+ text-shadow: none;
+ background-color: transparent;
+ border: 0;
+}
+
+.input-block-level {
+ display: block;
+ width: 100%;
+ min-height: 28px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -ms-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+.hidden {
+ display: none;
+ visibility: hidden;
+}
+
+.visible-phone {
+ display: none !important;
+}
+
+.visible-tablet {
+ display: none !important;
+}
+
+.hidden-desktop {
+ display: none !important;
+}
+
+@media (max-width: 767px) {
+ .visible-phone {
+ display: inherit !important;
+ }
+ .hidden-phone {
+ display: none !important;
+ }
+ .hidden-desktop {
+ display: inherit !important;
+ }
+ .visible-desktop {
+ display: none !important;
+ }
+}
+
+@media (min-width: 768px) and (max-width: 979px) {
+ .visible-tablet {
+ display: inherit !important;
+ }
+ .hidden-tablet {
+ display: none !important;
+ }
+ .hidden-desktop {
+ display: inherit !important;
+ }
+ .visible-desktop {
+ display: none !important ;
+ }
+}
+
+@media (max-width: 480px) {
+ .nav-collapse {
+ -webkit-transform: translate3d(0, 0, 0);
+ }
+ .page-header h1 small {
+ display: block;
+ line-height: 18px;
+ }
+ input[type="checkbox"],
+ input[type="radio"] {
+ border: 1px solid #ccc;
+ }
+ .form-horizontal .control-group > label {
+ float: none;
+ width: auto;
+ padding-top: 0;
+ text-align: left;
+ }
+ .form-horizontal .controls {
+ margin-left: 0;
+ }
+ .form-horizontal .control-list {
+ padding-top: 0;
+ }
+ .form-horizontal .form-actions {
+ padding-right: 10px;
+ padding-left: 10px;
+ }
+ .modal {
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ left: 10px;
+ width: auto;
+ margin: 0;
+ }
+ .modal.fade.in {
+ top: auto;
+ }
+ .modal-header .close {
+ padding: 10px;
+ margin: -10px;
+ }
+ .carousel-caption {
+ position: static;
+ }
+}
+
+@media (max-width: 767px) {
+ body {
+ padding-right: 20px;
+ padding-left: 20px;
+ }
+ .navbar-fixed-top,
+ .navbar-fixed-bottom {
+ margin-right: -20px;
+ margin-left: -20px;
+ }
+ .container-fluid {
+ padding: 0;
+ }
+ .dl-horizontal dt {
+ float: none;
+ width: auto;
+ clear: none;
+ text-align: left;
+ }
+ .dl-horizontal dd {
+ margin-left: 0;
+ }
+ .container {
+ width: auto;
+ }
+ .row-fluid {
+ width: 100%;
+ }
+ .row,
+ .thumbnails {
+ margin-left: 0;
+ }
+ [class*="span"],
+ .row-fluid [class*="span"] {
+ display: block;
+ float: none;
+ width: auto;
+ margin-left: 0;
+ }
+ .input-large,
+ .input-xlarge,
+ .input-xxlarge,
+ input[class*="span"],
+ select[class*="span"],
+ textarea[class*="span"],
+ .uneditable-input {
+ display: block;
+ width: 100%;
+ min-height: 28px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -ms-box-sizing: border-box;
+ box-sizing: border-box;
+ }
+ .input-prepend input,
+ .input-append input,
+ .input-prepend input[class*="span"],
+ .input-append input[class*="span"] {
+ display: inline-block;
+ width: auto;
+ }
+}
+
+@media (min-width: 768px) and (max-width: 979px) {
+ .row {
+ margin-left: -20px;
+ *zoom: 1;
+ }
+ .row:before,
+ .row:after {
+ display: table;
+ content: "";
+ }
+ .row:after {
+ clear: both;
+ }
+ [class*="span"] {
+ float: left;
+ margin-left: 20px;
+ }
+ .container,
+ .navbar-fixed-top .container,
+ .navbar-fixed-bottom .container {
+ width: 724px;
+ }
+ .span12 {
+ width: 724px;
+ }
+ .span11 {
+ width: 662px;
+ }
+ .span10 {
+ width: 600px;
+ }
+ .span9 {
+ width: 538px;
+ }
+ .span8 {
+ width: 476px;
+ }
+ .span7 {
+ width: 414px;
+ }
+ .span6 {
+ width: 352px;
+ }
+ .span5 {
+ width: 290px;
+ }
+ .span4 {
+ width: 228px;
+ }
+ .span3 {
+ width: 166px;
+ }
+ .span2 {
+ width: 104px;
+ }
+ .span1 {
+ width: 42px;
+ }
+ .offset12 {
+ margin-left: 764px;
+ }
+ .offset11 {
+ margin-left: 702px;
+ }
+ .offset10 {
+ margin-left: 640px;
+ }
+ .offset9 {
+ margin-left: 578px;
+ }
+ .offset8 {
+ margin-left: 516px;
+ }
+ .offset7 {
+ margin-left: 454px;
+ }
+ .offset6 {
+ margin-left: 392px;
+ }
+ .offset5 {
+ margin-left: 330px;
+ }
+ .offset4 {
+ margin-left: 268px;
+ }
+ .offset3 {
+ margin-left: 206px;
+ }
+ .offset2 {
+ margin-left: 144px;
+ }
+ .offset1 {
+ margin-left: 82px;
+ }
+ .row-fluid {
+ width: 100%;
+ *zoom: 1;
+ }
+ .row-fluid:before,
+ .row-fluid:after {
+ display: table;
+ content: "";
+ }
+ .row-fluid:after {
+ clear: both;
+ }
+ .row-fluid [class*="span"] {
+ display: block;
+ float: left;
+ width: 100%;
+ min-height: 28px;
+ margin-left: 2.762430939%;
+ *margin-left: 2.709239449638298%;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -ms-box-sizing: border-box;
+ box-sizing: border-box;
+ }
+ .row-fluid [class*="span"]:first-child {
+ margin-left: 0;
+ }
+ .row-fluid .span12 {
+ width: 99.999999993%;
+ *width: 99.9468085036383%;
+ }
+ .row-fluid .span11 {
+ width: 91.436464082%;
+ *width: 91.38327259263829%;
+ }
+ .row-fluid .span10 {
+ width: 82.87292817100001%;
+ *width: 82.8197366816383%;
+ }
+ .row-fluid .span9 {
+ width: 74.30939226%;
+ *width: 74.25620077063829%;
+ }
+ .row-fluid .span8 {
+ width: 65.74585634900001%;
+ *width: 65.6926648596383%;
+ }
+ .row-fluid .span7 {
+ width: 57.182320438000005%;
+ *width: 57.129128948638304%;
+ }
+ .row-fluid .span6 {
+ width: 48.618784527%;
+ *width: 48.5655930376383%;
+ }
+ .row-fluid .span5 {
+ width: 40.055248616%;
+ *width: 40.0020571266383%;
+ }
+ .row-fluid .span4 {
+ width: 31.491712705%;
+ *width: 31.4385212156383%;
+ }
+ .row-fluid .span3 {
+ width: 22.928176794%;
+ *width: 22.874985304638297%;
+ }
+ .row-fluid .span2 {
+ width: 14.364640883%;
+ *width: 14.311449393638298%;
+ }
+ .row-fluid .span1 {
+ width: 5.801104972%;
+ *width: 5.747913482638298%;
+ }
+ input,
+ textarea,
+ .uneditable-input {
+ margin-left: 0;
+ }
+ input.span12,
+ textarea.span12,
+ .uneditable-input.span12 {
+ width: 714px;
+ }
+ input.span11,
+ textarea.span11,
+ .uneditable-input.span11 {
+ width: 652px;
+ }
+ input.span10,
+ textarea.span10,
+ .uneditable-input.span10 {
+ width: 590px;
+ }
+ input.span9,
+ textarea.span9,
+ .uneditable-input.span9 {
+ width: 528px;
+ }
+ input.span8,
+ textarea.span8,
+ .uneditable-input.span8 {
+ width: 466px;
+ }
+ input.span7,
+ textarea.span7,
+ .uneditable-input.span7 {
+ width: 404px;
+ }
+ input.span6,
+ textarea.span6,
+ .uneditable-input.span6 {
+ width: 342px;
+ }
+ input.span5,
+ textarea.span5,
+ .uneditable-input.span5 {
+ width: 280px;
+ }
+ input.span4,
+ textarea.span4,
+ .uneditable-input.span4 {
+ width: 218px;
+ }
+ input.span3,
+ textarea.span3,
+ .uneditable-input.span3 {
+ width: 156px;
+ }
+ input.span2,
+ textarea.span2,
+ .uneditable-input.span2 {
+ width: 94px;
+ }
+ input.span1,
+ textarea.span1,
+ .uneditable-input.span1 {
+ width: 32px;
+ }
+}
+
+@media (min-width: 1200px) {
+ .row {
+ margin-left: -30px;
+ *zoom: 1;
+ }
+ .row:before,
+ .row:after {
+ display: table;
+ content: "";
+ }
+ .row:after {
+ clear: both;
+ }
+ [class*="span"] {
+ float: left;
+ margin-left: 30px;
+ }
+ .container,
+ .navbar-fixed-top .container,
+ .navbar-fixed-bottom .container {
+ width: 1170px;
+ }
+ .span12 {
+ width: 1170px;
+ }
+ .span11 {
+ width: 1070px;
+ }
+ .span10 {
+ width: 970px;
+ }
+ .span9 {
+ width: 870px;
+ }
+ .span8 {
+ width: 770px;
+ }
+ .span7 {
+ width: 670px;
+ }
+ .span6 {
+ width: 570px;
+ }
+ .span5 {
+ width: 470px;
+ }
+ .span4 {
+ width: 370px;
+ }
+ .span3 {
+ width: 270px;
+ }
+ .span2 {
+ width: 170px;
+ }
+ .span1 {
+ width: 70px;
+ }
+ .offset12 {
+ margin-left: 1230px;
+ }
+ .offset11 {
+ margin-left: 1130px;
+ }
+ .offset10 {
+ margin-left: 1030px;
+ }
+ .offset9 {
+ margin-left: 930px;
+ }
+ .offset8 {
+ margin-left: 830px;
+ }
+ .offset7 {
+ margin-left: 730px;
+ }
+ .offset6 {
+ margin-left: 630px;
+ }
+ .offset5 {
+ margin-left: 530px;
+ }
+ .offset4 {
+ margin-left: 430px;
+ }
+ .offset3 {
+ margin-left: 330px;
+ }
+ .offset2 {
+ margin-left: 230px;
+ }
+ .offset1 {
+ margin-left: 130px;
+ }
+ .row-fluid {
+ width: 100%;
+ *zoom: 1;
+ }
+ .row-fluid:before,
+ .row-fluid:after {
+ display: table;
+ content: "";
+ }
+ .row-fluid:after {
+ clear: both;
+ }
+ .row-fluid [class*="span"] {
+ display: block;
+ float: left;
+ width: 100%;
+ min-height: 28px;
+ margin-left: 2.564102564%;
+ *margin-left: 2.510911074638298%;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -ms-box-sizing: border-box;
+ box-sizing: border-box;
+ }
+ .row-fluid [class*="span"]:first-child {
+ margin-left: 0;
+ }
+ .row-fluid .span12 {
+ width: 100%;
+ *width: 99.94680851063829%;
+ }
+ .row-fluid .span11 {
+ width: 91.45299145300001%;
+ *width: 91.3997999636383%;
+ }
+ .row-fluid .span10 {
+ width: 82.905982906%;
+ *width: 82.8527914166383%;
+ }
+ .row-fluid .span9 {
+ width: 74.358974359%;
+ *width: 74.30578286963829%;
+ }
+ .row-fluid .span8 {
+ width: 65.81196581200001%;
+ *width: 65.7587743226383%;
+ }
+ .row-fluid .span7 {
+ width: 57.264957265%;
+ *width: 57.2117657756383%;
+ }
+ .row-fluid .span6 {
+ width: 48.717948718%;
+ *width: 48.6647572286383%;
+ }
+ .row-fluid .span5 {
+ width: 40.170940171000005%;
+ *width: 40.117748681638304%;
+ }
+ .row-fluid .span4 {
+ width: 31.623931624%;
+ *width: 31.5707401346383%;
+ }
+ .row-fluid .span3 {
+ width: 23.076923077%;
+ *width: 23.0237315876383%;
+ }
+ .row-fluid .span2 {
+ width: 14.529914530000001%;
+ *width: 14.4767230406383%;
+ }
+ .row-fluid .span1 {
+ width: 5.982905983%;
+ *width: 5.929714493638298%;
+ }
+ input,
+ textarea,
+ .uneditable-input {
+ margin-left: 0;
+ }
+ input.span12,
+ textarea.span12,
+ .uneditable-input.span12 {
+ width: 1160px;
+ }
+ input.span11,
+ textarea.span11,
+ .uneditable-input.span11 {
+ width: 1060px;
+ }
+ input.span10,
+ textarea.span10,
+ .uneditable-input.span10 {
+ width: 960px;
+ }
+ input.span9,
+ textarea.span9,
+ .uneditable-input.span9 {
+ width: 860px;
+ }
+ input.span8,
+ textarea.span8,
+ .uneditable-input.span8 {
+ width: 760px;
+ }
+ input.span7,
+ textarea.span7,
+ .uneditable-input.span7 {
+ width: 660px;
+ }
+ input.span6,
+ textarea.span6,
+ .uneditable-input.span6 {
+ width: 560px;
+ }
+ input.span5,
+ textarea.span5,
+ .uneditable-input.span5 {
+ width: 460px;
+ }
+ input.span4,
+ textarea.span4,
+ .uneditable-input.span4 {
+ width: 360px;
+ }
+ input.span3,
+ textarea.span3,
+ .uneditable-input.span3 {
+ width: 260px;
+ }
+ input.span2,
+ textarea.span2,
+ .uneditable-input.span2 {
+ width: 160px;
+ }
+ input.span1,
+ textarea.span1,
+ .uneditable-input.span1 {
+ width: 60px;
+ }
+ .thumbnails {
+ margin-left: -30px;
+ }
+ .thumbnails > li {
+ margin-left: 30px;
+ }
+ .row-fluid .thumbnails {
+ margin-left: 0;
+ }
+}
+
+@media (max-width: 979px) {
+ body {
+ padding-top: 0;
+ }
+ .navbar-fixed-top,
+ .navbar-fixed-bottom {
+ position: static;
+ }
+ .navbar-fixed-top {
+ margin-bottom: 18px;
+ }
+ .navbar-fixed-bottom {
+ margin-top: 18px;
+ }
+ .navbar-fixed-top .navbar-inner,
+ .navbar-fixed-bottom .navbar-inner {
+ padding: 5px;
+ }
+ .navbar .container {
+ width: auto;
+ padding: 0;
+ }
+ .navbar .brand {
+