Commits

Surachet Monchawanon  committed e6cc64e

add administrator module

  • Participants
  • Parent commits 162ed2e

Comments (0)

Files changed (1021)

File nbproject/project.properties

 auxiliary.org-nbphpcouncil-modules-php-yii.enabled=true
-include.path=${php.global.include.path}
+file.reference.yii-framework=../yii/framework
+include.path=\
+    ${php.global.include.path}
 php.version=PHP_53
 source.encoding=UTF-8
 src.dir=.

File protected/config/main.php

 <?php
 
 // uncomment the following to define a path alias
-// Yii::setPathOfAlias('local','path/to/local-folder');
+Yii::setPathOfAlias('booster', dirname(__FILE__) . '/../extensions/yii-booster');
 // This is the main Web application configuration. Any writable
 // CWebApplication properties can be configured here.
 return array(
     'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
     'name' => 'My Web Application',
-    // preloading 'log' component
-    // autoloading model and component classes
+    'preload' => array(
+        'booster',
+    ),
     'import' => array(
         'application.models.*',
         'application.components.*',
+        'ext.giix.components.*'
     ),
     'modules' => array(
-        'administrator' => array(
-            
+        'administrator' => array(),
+        'gii' => array(
+            'class' => 'system.gii.GiiModule',
+            'password' => 'lol',
+            'ipFilters' => array('*'),
+            'generatorPaths' => array(
+                'ext.giix.generators',
+            ),
         ),
-    // 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(
+        'booster' => array(
+            'class' => 'ext.yii-booster.components.Booster',
+        ),
+        'messages' => array(
+            'extensionBasePaths' => array(
+                'giix' => 'ext.giix.messages',
+            ),
+        ),
         'user' => array(
-            // enable cookie-based authentication
+// enable cookie-based authentication
             'allowAutoLogin' => true,
         ),
         // uncomment the following to enable URLs in path-format
           ),
          */
         'errorHandler' => array(
-            // use 'site/error' action to display errors
+// use 'site/error' action to display errors
             'errorAction' => 'site/error',
         ),
     ),
     // application-level parameters that can be accessed
-    // using Yii::app()->params['paramName']
+// using Yii::app()->params['paramName']
     'params' => array(
-        // this is used in contact page
+// this is used in contact page
         'adminEmail' => 'webmaster@example.com',
     ),
 );

File protected/data/core.db

Binary file removed.

File protected/extensions/giix/CHANGELOG

+giix Change Log
+===============
+
+Version 1.10, to be released
+----------------------------
+Chg: Better directory organization. Now giix have its own root directory.
+Bug: Fixes issue 23: Removed undefined variables from GxActiveRecord::saveRelated.
+Chg: Removed the message translation from the generated view files.
+Enh: Added a message category to the Yii::t calls.
+Enh: Added the configuration file for generating message translations.
+Enh: Added instructions and details about the patch and messages directory configuration.
+Bug: GxActiveRecord::pkSeparator and GxActiveRecord::repColumnsSeparator shouldn't be static.
+Bug: Now generating the proper label for the relation in the view "_view".
+
+Version 1.9, 2011-07-06
+----------------------------
+Bug: GxActiveRecord::getRelationLabel supported only relations and (table-based) attributes. Support for class properties has been added.
+Chg: The method attributeLabels in the generated base model now have the FK fields set to null by default.
+Chg: The method attributeLabels in the generated base model now have the relations of the model. They are set to null by default.
+Chg: The method GxActiveRecord::label doesn't have the second parameter "ucwords" anymore. The same happens when it is overriden on the generated base model.
+Chg: The method GxActiveRecord::getRelationLabel doesn't have the third parameter "ucwords" anymore.
+Chg: Now the method GxActiveRecord::getRelationLabel gives priority to the explicitly defined label in the model.
+
+Version 1.8, 2011-06-20
+----------------------------
+Enh: Added support to active record labels.
+
+Version 1.7, 2011-06-02
+----------------------------
+Enh: Updated the code from Yii to version 1.1.7 (r3135).
+Enh: Updated the code from Yii in the default template files and generator's index views to version 1.1.7 (r3135).
+Bug: Fixed bug #10. Added proper support to 'uncheckValue'.
+Bug: Fixes issue #11. Now the generated model::search method uses the current instance of the model and allows the use of custom criteria.
+
+Version 1.6, 2011-05-09
+----------------------------
+Bug: Wrong pivot class name was generated when there were table prefixes.
+Enh: Better support to boolean values: formatted display in view "view".
+Bug: Added proper parameter checks in GxActiveRecord::__toString.
+Chg: Raised Yii version in "requirements".
+Enh: Added support for entering PK values. See http://code.google.com/p/yii/issues/detail?id=1770.
+Chg: New default value for GxActiveRecord::saveMultiple: 'detectRelations' option is now false by default.
+Enh: Added GxActiveRecord::fillPkColumnNames.
+Enh: Now GxController::loadModel supports composite PK, has autodetection features and can be used with any attribute (column).
+
+Version 1.5, 2011-05-06
+----------------------------
+Chg: GxController extends again from Controller (reverted from version 1.2).
+Enh: Now GxController::performAjaxValidation supports multiple models.
+Bug: Removed the code for saving the main model and committing the transaction from the loop in GxActiveRecord::saveWithRelated.
+Bug: Fixed a bug where the function would return instead of continue iterating in the loop in GxActiveRecord::saveWithRelated.
+Bug: Do not swallow exceptions anymore in GxActiveRecord::saveWithRelated.
+Bug: Now more code is wrapped in the try-catch block to protect the integrity of the transaction in GxActiveRecord::saveWithRelated.
+Bug: Fixed issue 5.
+Enh: Introduced GxActiveRecord::saveMultiple.
+Chg: Removed the "cancel" button from the _form view.
+
+Version 1.4, 2010-12-30
+----------------------------
+Bug: Saving related MANY_MANY relations could delete or insert wrong data since the check on current relations was not necessarily made against the database.
+
+Version 1.3, 2010-12-23
+----------------------------
+New: Added native support for saving MANY_MANY relations with the new method GxActiveRecord::saveWithRelated.
+New: Added method GxActiveRecord::pivotModels.
+New: Added automatic detection of HAS_MANY and MANY_MANY relations in the POST with the new method GxController::getRelatedData.
+New: The generated model now have the pivot class names in its pivotModels method.
+New: The generated controller now have support for saving MANY_MANY relations automatically.
+
+Version 1.2, 2010-12-14
+----------------------------
+Enh: More inline styling and formatting is removed from the generated code.
+Enh: Now the breadcrumb will contain the string representation of the model instance instead of the primary key value, when appropriate.
+Enh: Now the page heading will contain the string representation of the model instance instead of the primary key value, when appropriate.
+Bug: Fixed a bug were the action name were translated in the breadcrumb link.
+Chg: Now GxController extends directly from CController. Class Controller is no longer necessary.
+Enh: I18n support added to some messages.
+
+Version 1.1.1, 2010-12-10
+----------------------------
+Enh: All inline styling and formatting is removed from the generated code.
+Bug: GxActiveForm::enableAjaxValidation value was passed as a string instead of as a boolean in _form.php, causing it to ever evaluate to true. This caused a new record to be added in every ajax validation post (There weren't a call to GxController::performAjaxValidation).
+Chg: Removed support for enum fields.
+Bug: Now all the output data is HTML encoded.
+New: Added method GxHtml::encodeEx.
+
+Version 1.0, 2010-11-12
+----------------------------
+Initial release, based on gii-template-collection (gtc).
+Updated up to gtc r107 and yii/gii 1.1.3 r2247.

File protected/extensions/giix/FAQ

+giix FAQ: Frequently Asked Questions
+====================================
+
+How to install giix?
+--------------------
+
+See the README file before installing giix.
+See INSTALL file for instructions.
+Read the Yii guide at <http://www.yiiframework.com/doc/guide>.
+Read the gii documentation at <http://www.yiiframework.com/doc/api/GiiModule>.
+
+How to use giix?
+----------------
+
+See the README file before using giix.
+
+After installing, you will see the giix generators on the gii page.
+The giix generators' names start with "giix".
+
+Read the Yii guide at <http://www.yiiframework.com/doc/guide>.
+Read the gii documentation at <http://www.yiiframework.com/doc/api/GiiModule>.
+
+I need help! Where should I go?
+-------------------------------
+
+You can ask you question in the forum discussion for giix at
+<http://www.yiiframework.com/forum/index.php?/topic/13154-giix-%E2%80%94-gii-extended/>.
+Please notice that support is given mainly by the community.
+
+giix is not working. How do I report a bug?
+-------------------------------------------
+
+You can report bugs at <http://code.google.com/p/giix/issues/list>.

File protected/extensions/giix/INSTALL

+Installing giix 
+===============
+
+Downloading
+-----------
+
+Always download the latest release from the extension page at:
+http://www.yiiframework.com/extension/giix
+
+Before installing
+-----------------
+
+1) Make sure you read the Yii guide at <http://www.yiiframework.com/doc/guide>.
+2) Read the Gii documentation at <http://www.yiiframework.com/doc/api/GiiModule>.
+3) Read giix README file. Please give special attention to the "requirements" section.
+
+Installing
+----------
+
+1) Extract the directory "giix" from the
+downloaded archive into your application's protected/extensions directory.
+
+2) Configure the gii generator path in your application, like:
+'modules' => array(
+	'gii' => array(
+		'class' => 'system.gii.GiiModule',
+		'generatorPaths' => array(
+			'ext.giix.generators', // giix generators
+		),
+	),
+),
+
+3) Configure your application to automatically load the giix component classes
+when needed, like:
+'import' => array(
+	...
+	'ext.giix.components.*', // giix components
+),
+
+4) Register the giix messages directory, like the example below.
+Note: This feature is pending on Yii core (as of Yii 1.1.8 revision 3364). You will need to patch your Yii instalation.
+See <http://code.google.com/p/yii/issues/detail?id=2624> for details and the patch.
+'components' => array(
+	...
+	'messages' => array (
+		// Pending on core: http://code.google.com/p/yii/issues/detail?id=2624
+		'extensionBasePaths' => array(
+			'giix' => 'ext.giix.messages', // giix messages directory.
+		),
+	),
+),
+
+It is recommended to set at least the 'password' and 'ipFilters' properties
+in gii for security.
+For more information see the gii documentation at <http://www.yiiframework.com/doc/api/GiiModule>.
+
+Additionaly, you may remove the entire 'generators' directory and generator
+configuration (step 2 above) when releasing your Web application for improved
+security.

File protected/extensions/giix/LICENSE

+giix is free software.
+It is dual-licensed under the terms of the following BSD License and under the
+terms of GNU General Public License v3 <http://www.gnu.org/licenses/gpl.html>.
+
+Copyright (c) 2010-2011, Rodrigo Coelho <rodrigo@giix.org>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in
+      the documentation and/or other materials provided with the distribution.
+    * Neither the name of Rodrigo Coelho nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.

File protected/extensions/giix/README

+giix Readme
+===========
+
+giix version 1.10 (dev, unstable)
+
+giix official website:    http://giix.org/
+
+You should always
+download giix from:       http://www.yiiframework.com/extension/giix
+
+giix on...
+Yii Extension Repository: http://www.yiiframework.com/extension/giix/
+Yii Forum:                http://www.yiiframework.com/forum/index.php?/topic/13154-giix-%E2%80%94-gii-extended/
+Google Code:              http://giix.googlecode.com/
+Ohloh:                    http://www.ohloh.net/p/giix
+
+giix is gii Extended, a code generator for Yii PHP framework.
+giix is inspired and based on gii-template-collection (gtc), by Herbert Maschke (thyseus).
+
+giix is free software and is dual-licensed under the terms of the new BSD License and under the terms of GNU GPL v3. See the LICENSE file.
+
+ACKNOWLEDGEMENTS
+----------------
+
+giix is inspired and uses code from Yii PHP framework and gii-template-collection.
+Many thanks to Qiang Xue, Herbert Maschke and the contributors of these software.
+
+Also, thanks for the huge help from:
+Thiago Talma (Athos)
+Gustavo Salomé Silva (Gustavo)
+
+FEATURES
+--------
+
+giix extends Yii's gii by providing:
+- Proper handling of related model attributes, rendering appropriate form fields based on relation type.
+- More support for HAS_MANY and MANY_MANY relations.
+- Native support for saving MANY_MANY relations with the new method GxActiveRecord::saveWithRelated.
+- Native support for saving multiple (related or not) records with the new method GxActiveRecord::saveMultiple.
+- Automatic string representation for a model via GxActiveRecord::representingColumn() and GxActiveRecord::__toString().
+- Better i18n support and easier to maintain: support to active record labels. You change the label once in the model and it is automatically updated in the views. This is especially useful for plurals.
+- Out-of-the box i18n support by using Yii::t().
+- Bundled translations (pending support on Yii core as of Yii 1.1.8. See <http://code.google.com/p/yii/issues/detail?id=2624> for details).
+- Appropriate form fields are rendered based on model attribute/table field data type.
+- Separated model and basemodel. Basemodel can be regenerated without overwriting your code in the model.
+- Smart methods can query your database for just the needed data (usually the primary key and the field with the string representantion), avoiding manual setup or a "select *".
+- Extensive use of default method parameters. Appropriate data is found automatically.
+- Some (incipient) support for tables with composite primary keys.
+- Generated code is completely free from styling and formatting. Your CSS controls the presentation.
+- Generated code is (almost) free of comments.
+- Well documented and commented source code. Ohloh says that 40% of the lines in the code are comments! You can understand and modify anything you want.
+
+And a lot more! Read the CHANGELOG file and the (richly commented) source code to fully leverage giix's power.
+
+Some of these features come from gtc.
+
+WARNINGS
+--------
+
+Always download the latest release from the extension page at:
+http://www.yiiframework.com/extension/giix
+
+giix is not fully tested now, so please test your application and be careful using it.
+giix is still in development. Some changes may break backwards compatibility.
+
+Are you upgrading? Please don't forget to read the UPGRADE file for instructions!
+
+REQUIREMENTS
+------------
+
+Yii 1.1.9+ is required.
+
+giix should run with:
+- Yii 1.1.8+ (tested with revision 3364 + patch*)
+- Linux
+- Apache 2.2 or nginx 0.8+
+- MySQL 5.x
+- PHP 5.2+
+
+giix may run on other setups, but there is no official suppport for them.
+There is no planned official support for other setups, including Windows/IIS, XAMPP/etc or other DBMS.
+
+* You can use giix with Yii 1.1.8 if you patch your Yii installation with the patch provided in the issue 2624:
+<http://code.google.com/p/yii/issues/detail?id=2624>.
+
+INSTALLATION AND UPGRADING
+--------------------------
+
+Please see INSTALL and UPGRADE files for instructions.
+
+USING
+-----
+
+After installing, you will see the giix generators on the gii page.
+The giix generators' names start with "giix".
+Read the gii doumentation on how to use it
+<http://www.yiiframework.com/doc/api/GiiModule>.
+
+If you want to use the GxActiveRecord::saveWithRelated method, you must first generate
+the pivot model for the cross-reference table of the relationship.
+The pivot model class is the active record between two other active records that have
+a MANY_MANY relationship.
+If you have already generated models for every table in your schema, you are ready to
+use the method to save your MANY_MANY relations.
+If you use the support for saving MANY_MANY relations as generated, you will need to
+manually write code to support scenarios. This is an important security concern.
+
+DONATE
+------
+
+Go to <http://giix.org/> and donate via Flattr or via Paypal.

File protected/extensions/giix/UPGRADE

+Upgrading Instructions for giix
+===============================
+
+IMPORTANT
+
+The following upgrading instructions are cumulative. That is,
+if you want to upgrade from version A to version C and there is
+version B between A and C, you need to follow the instructions