diff --git a/README.md b/README.md index 54bd499..9bd6480 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ DIRECTORY STRUCTURE ------------------- apps/ ready-to-use Web apps built on Yii 2 - bootstrap/ a simple app supporting user login and contact page + basic/ a simple app supporting user login and contact page build/ internally used build tools docs/ documentation yii/ framework source files diff --git a/apps/advanced/.gitignore b/apps/advanced/.gitignore new file mode 100644 index 0000000..b1cf719 --- /dev/null +++ b/apps/advanced/.gitignore @@ -0,0 +1 @@ +/yii \ No newline at end of file diff --git a/apps/bootstrap/LICENSE.md b/apps/advanced/LICENSE.md similarity index 100% rename from apps/bootstrap/LICENSE.md rename to apps/advanced/LICENSE.md diff --git a/apps/advanced/README.md b/apps/advanced/README.md new file mode 100644 index 0000000..a2bcdd4 --- /dev/null +++ b/apps/advanced/README.md @@ -0,0 +1,98 @@ +Yii 2 Advanced Application Template +=================================== + +**NOTE** Yii 2 and the relevant applications and extensions are still under heavy +development. We may make significant changes without prior notices. Please do not +use them for production. Please consider using [Yii v1.1](https://github.com/yiisoft/yii) +if you have a project to be deployed for production soon. + + +Thank you for using Yii 2 Advanced Application Template - an application template +that works out-of-box and can be easily customized to fit for your needs. + +Yii 2 Advanced Application Template is best suitable for large projects requiring frontend and backstage separation, +deployment in different environments, configuration nesting etc. + + +DIRECTORY STRUCTURE +------------------- + +``` +common + config/ contains shared configurations + models/ contains model classes used in both backstage and frontend +console + config/ contains console configurations + controllers/ contains console controllers (commands) + migrations/ contains database migrations + models/ contains console-specific model classes + runtime/ contains files generated during runtime +backstage + assets/ contains application assets such as JavaScript and CSS + config/ contains backstage configurations + controllers/ contains Web controller classes + models/ contains backstage-specific model classes + runtime/ contains files generated during runtime + views/ contains view files for the Web application + www/ contains the entry script and Web resources +frontend + assets/ contains application assets such as JavaScript and CSS + config/ contains frontend configurations + controllers/ contains Web controller classes + models/ contains frontend-specific model classes + runtime/ contains files generated during runtime + views/ contains view files for the Web application + www/ contains the entry script and Web resources +vendor/ contains dependent 3rd-party packages +environments/ contains environment-based overrides +``` + + + +REQUIREMENTS +------------ + +The minimum requirement by Yii is that your Web server supports PHP 5.3.?. + + +INSTALLATION +------------ + +### Install via Composer + +If you do not have [Composer](http://getcomposer.org/), you may download it from +[http://getcomposer.org/](http://getcomposer.org/) or run the following command on Linux/Unix/MacOS: + +~~~ +curl -s http://getcomposer.org/installer | php +~~~ + +You can then install the Bootstrap Application using the following command: + +~~~ +php composer.phar create-project --stability=dev yiisoft/yii2-app-advanced yii-advanced +~~~ + +Now you should be able to access: + +- the frontend using the URL `http://localhost/yii-advanced/frontend/www/` +- the backstage using the URL `http://localhost/yii-advanced/backstage/www/` + +assuming `yii-advanced` is directly under the document root of your Web server. + + +### Install from an Archive File + +This is not currently available. We will provide it when Yii 2 is formally released. + +GETTING STARTED +--------------- + +After template application and its dependencies are downloaded you need to initialize it and set some config values to +match your application requirements. + +1. Execute `install` command selecting `dev` as environment. +2. Set `id` value in `console/config/main.php`, `frontend/config/main.php`, `backstage/config/main.php`. +3. Create new database. It is assumed that MySQL InnoDB is used. If not, adjust `console/migrations/m130524_201442_init.php`. +4. In `common/config/params.php` set your database details in `components.db` values. + diff --git a/apps/bootstrap/assets/.gitignore b/apps/advanced/backstage/assets/.gitkeep similarity index 100% rename from apps/bootstrap/assets/.gitignore rename to apps/advanced/backstage/assets/.gitkeep diff --git a/apps/advanced/backstage/config/.gitignore b/apps/advanced/backstage/config/.gitignore new file mode 100644 index 0000000..20da318 --- /dev/null +++ b/apps/advanced/backstage/config/.gitignore @@ -0,0 +1,2 @@ +main-local.php +params-local.php \ No newline at end of file diff --git a/apps/bootstrap/config/assets.php b/apps/advanced/backstage/config/assets.php similarity index 100% rename from apps/bootstrap/config/assets.php rename to apps/advanced/backstage/config/assets.php diff --git a/apps/advanced/backstage/config/main.php b/apps/advanced/backstage/config/main.php new file mode 100644 index 0000000..d3288bd --- /dev/null +++ b/apps/advanced/backstage/config/main.php @@ -0,0 +1,39 @@ + 'change-me', + 'basePath' => dirname(__DIR__), + 'preload' => array('log'), + 'controllerNamespace' => 'backstage\controllers', + 'modules' => array( + ), + 'components' => array( + 'db' => $params['components.db'], + 'cache' => $params['components.cache'], + 'user' => array( + 'class' => 'yii\web\User', + 'identityClass' => 'common\models\User', + ), + 'assetManager' => array( + 'bundles' => require(__DIR__ . '/assets.php'), + ), + 'log' => array( + 'class' => 'yii\logging\Router', + 'targets' => array( + array( + 'class' => 'yii\logging\FileTarget', + 'levels' => array('error', 'warning'), + ), + ), + ), + ), + 'params' => $params, +); diff --git a/apps/bootstrap/config/params.php b/apps/advanced/backstage/config/params.php similarity index 100% rename from apps/bootstrap/config/params.php rename to apps/advanced/backstage/config/params.php diff --git a/apps/advanced/backstage/controllers/SiteController.php b/apps/advanced/backstage/controllers/SiteController.php new file mode 100644 index 0000000..d40738a --- /dev/null +++ b/apps/advanced/backstage/controllers/SiteController.php @@ -0,0 +1,33 @@ +render('index'); + } + + public function actionLogin() + { + $model = new LoginForm(); + if ($this->populate($_POST, $model) && $model->login()) { + Yii::$app->response->redirect(array('site/index')); + } else { + echo $this->render('login', array( + 'model' => $model, + )); + } + } + + public function actionLogout() + { + Yii::$app->getUser()->logout(); + Yii::$app->getResponse()->redirect(array('site/index')); + } +} diff --git a/apps/bootstrap/runtime/.gitignore b/apps/advanced/backstage/models/.gitkeep similarity index 100% rename from apps/bootstrap/runtime/.gitignore rename to apps/advanced/backstage/models/.gitkeep diff --git a/apps/advanced/backstage/runtime/.gitignore b/apps/advanced/backstage/runtime/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/apps/advanced/backstage/runtime/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/apps/advanced/backstage/views/layouts/main.php b/apps/advanced/backstage/views/layouts/main.php new file mode 100644 index 0000000..44117f4 --- /dev/null +++ b/apps/advanced/backstage/views/layouts/main.php @@ -0,0 +1,64 @@ +registerAssetBundle('app'); +?> +beginPage(); ?> + + + + + <?php echo Html::encode($this->title); ?> + head(); ?> + + +
+ beginBody(); ?> +
+

My Company

+ + + +
+ + isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : array(), + )); ?> + + +
+ + + endBody(); ?> +
+ + + +endPage(); ?> diff --git a/apps/bootstrap/views/site/index.php b/apps/advanced/backstage/views/site/index.php similarity index 100% rename from apps/bootstrap/views/site/index.php rename to apps/advanced/backstage/views/site/index.php diff --git a/apps/bootstrap/views/site/login.php b/apps/advanced/backstage/views/site/login.php similarity index 100% rename from apps/bootstrap/views/site/login.php rename to apps/advanced/backstage/views/site/login.php diff --git a/apps/advanced/backstage/www/.gitignore b/apps/advanced/backstage/www/.gitignore new file mode 100644 index 0000000..148f2b0 --- /dev/null +++ b/apps/advanced/backstage/www/.gitignore @@ -0,0 +1 @@ +/index.php \ No newline at end of file diff --git a/apps/advanced/backstage/www/assets/.gitignore b/apps/advanced/backstage/www/assets/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/apps/advanced/backstage/www/assets/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/apps/bootstrap/www/css/site.css b/apps/advanced/backstage/www/css/site.css similarity index 100% rename from apps/bootstrap/www/css/site.css rename to apps/advanced/backstage/www/css/site.css diff --git a/apps/advanced/common/config/.gitignore b/apps/advanced/common/config/.gitignore new file mode 100644 index 0000000..46f6eb4 --- /dev/null +++ b/apps/advanced/common/config/.gitignore @@ -0,0 +1 @@ +params-local.php \ No newline at end of file diff --git a/apps/advanced/common/config/params.php b/apps/advanced/common/config/params.php new file mode 100644 index 0000000..b9409f9 --- /dev/null +++ b/apps/advanced/common/config/params.php @@ -0,0 +1,16 @@ + 'admin@example.com', + + 'components.cache' => array( + 'class' => 'yii\caching\FileCache', + ), + + 'components.db' => array( + 'class' => 'yii\db\Connection', + 'dsn' => 'mysql:host=localhost;dbname=yii2advanced', + 'username' => 'root', + 'password' => '', + ), +); \ No newline at end of file diff --git a/apps/advanced/common/models/LoginForm.php b/apps/advanced/common/models/LoginForm.php new file mode 100644 index 0000000..4631dbd --- /dev/null +++ b/apps/advanced/common/models/LoginForm.php @@ -0,0 +1,58 @@ +username); + if (!$user || !$user->validatePassword($this->password)) { + $this->addError('password', 'Incorrect username or password.'); + } + } + + /** + * Logs in a user using the provided username and password. + * @return boolean whether the user is logged in successfully + */ + public function login() + { + if ($this->validate()) { + $user = User::findByUsername($this->username); + Yii::$app->user->login($user, $this->rememberMe ? 3600*24*30 : 0); + return true; + } else { + return false; + } + } +} diff --git a/apps/advanced/common/models/User.php b/apps/advanced/common/models/User.php new file mode 100644 index 0000000..110487e --- /dev/null +++ b/apps/advanced/common/models/User.php @@ -0,0 +1,115 @@ + array( + 'class' => 'yii\behaviors\AutoTimestamp', + 'attributes' => array( + ActiveRecord::EVENT_BEFORE_INSERT => 'create_time', + ActiveRecord::EVENT_BEFORE_INSERT => 'update_time', + ActiveRecord::EVENT_BEFORE_UPDATE => 'update_time', + ), + ), + ); + } + + public static function findIdentity($id) + { + return static::find($id); + } + + public static function findByUsername($username) + { + return static::find(array('username' => $username, 'status' => static::STATUS_ACTIVE)); + } + + public function getId() + { + return $this->id; + } + + public function getAuthKey() + { + return $this->auth_key; + } + + public function validateAuthKey($authKey) + { + return $this->auth_key === $authKey; + } + + public function validatePassword($password) + { + return SecurityHelper::validatePassword($password, $this->password_hash); + } + + public function rules() + { + return array( + array('username', 'filter', 'filter' => 'trim'), + array('username', 'required'), + array('username', 'length', 'min' => 2, 'max' => 255), + + array('email', 'filter', 'filter' => 'trim'), + array('email', 'required'), + array('email', 'email'), + array('email', 'unique', 'message' => 'This email address has already been taken.'), + + array('password', 'required'), + array('password', 'length', 'min' => 6), + ); + } + + public function scenarios() + { + return array( + 'signup' => array('username', 'email', 'password'), + 'login' => array('username', 'password'), + ); + } + + public function beforeSave($insert) + { + if(parent::beforeSave($insert)) { + if($this->isNewRecord) { + if(!empty($this->password)) { + $this->password_hash = SecurityHelper::generatePasswordHash($this->password); + } + } + return true; + } + return false; + } +} diff --git a/apps/advanced/composer.json b/apps/advanced/composer.json new file mode 100644 index 0000000..db97efd --- /dev/null +++ b/apps/advanced/composer.json @@ -0,0 +1,44 @@ +{ + "name": "yiisoft/yii2-app-advanced", + "description": "Yii 2 Advanced Application Template", + "keywords": ["yii", "framework", "advanced", "application template"], + "homepage": "http://www.yiiframework.com/", + "type": "project", + "license": "BSD-3-Clause", + "support": { + "issues": "https://github.com/yiisoft/yii2/issues?state=open", + "forum": "http://www.yiiframework.com/forum/", + "wiki": "http://www.yiiframework.com/wiki/", + "irc": "irc://irc.freenode.net/yii", + "source": "https://github.com/yiisoft/yii2" + }, + "minimum-stability": "dev", + "require": { + "php": ">=5.3.0", + "yiisoft/yii2": "dev-master", + "yiisoft/yii2-composer": "dev-master" + }, + "scripts": { + "post-install-cmd": [ + "yii\\composer\\InstallHandler::setPermissions" + ], + "post-update-cmd": [ + "yii\\composer\\InstallHandler::setPermissions" + ] + }, + "extra": { + "yii-install-writable": [ + "backstage/runtime", + "backstage/www/assets", + + "console/runtime", + "console/migrations", + + "frontend/runtime", + "frontend/www/assets" + ], + "yii-install-executable": [ + "yii" + ] + } +} diff --git a/apps/advanced/console/config/.gitignore b/apps/advanced/console/config/.gitignore new file mode 100644 index 0000000..20da318 --- /dev/null +++ b/apps/advanced/console/config/.gitignore @@ -0,0 +1,2 @@ +main-local.php +params-local.php \ No newline at end of file diff --git a/apps/advanced/console/config/main.php b/apps/advanced/console/config/main.php new file mode 100644 index 0000000..83cb2e3 --- /dev/null +++ b/apps/advanced/console/config/main.php @@ -0,0 +1,32 @@ + 'change-me', + 'basePath' => dirname(__DIR__), + 'preload' => array('log'), + 'controllerNamespace' => 'console\controllers', + 'modules' => array( + ), + 'components' => array( + 'db' => $params['components.db'], + 'cache' => $params['components.cache'], + 'log' => array( + 'class' => 'yii\logging\Router', + 'targets' => array( + array( + 'class' => 'yii\logging\FileTarget', + 'levels' => array('error', 'warning'), + ), + ), + ), + ), + 'params' => $params, +); diff --git a/apps/advanced/console/config/params.php b/apps/advanced/console/config/params.php new file mode 100644 index 0000000..1e197d0 --- /dev/null +++ b/apps/advanced/console/config/params.php @@ -0,0 +1,5 @@ + 'admin@example.com', +); \ No newline at end of file diff --git a/apps/advanced/console/controllers/.gitkeep b/apps/advanced/console/controllers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/apps/advanced/console/migrations/m130524_201442_init.php b/apps/advanced/console/migrations/m130524_201442_init.php new file mode 100644 index 0000000..24a74c3 --- /dev/null +++ b/apps/advanced/console/migrations/m130524_201442_init.php @@ -0,0 +1,27 @@ +createTable('tbl_user', array( + 'id' => Schema::TYPE_PK, + 'username' => Schema::TYPE_STRING.' NOT NULL', + 'password_hash' => Schema::TYPE_STRING.' NOT NULL', + 'email' => Schema::TYPE_STRING.' NOT NULL', + 'role' => 'tinyint NOT NULL DEFAULT 10', + + 'status' => 'tinyint NOT NULL DEFAULT 10', + 'create_time' => Schema::TYPE_INTEGER.' NOT NULL', + 'update_time' => Schema::TYPE_INTEGER.' NOT NULL', + ), $tableOptions); + } + + public function down() + { + $this->dropTable('tbl_user'); + } +} diff --git a/apps/bootstrap/vendor/.gitignore b/apps/advanced/console/models/.gitkeep similarity index 100% rename from apps/bootstrap/vendor/.gitignore rename to apps/advanced/console/models/.gitkeep diff --git a/apps/advanced/console/runtime/.gitignore b/apps/advanced/console/runtime/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/apps/advanced/console/runtime/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/apps/advanced/environments/dev/backstage/config/main-local.php b/apps/advanced/environments/dev/backstage/config/main-local.php new file mode 100644 index 0000000..f74bfa3 --- /dev/null +++ b/apps/advanced/environments/dev/backstage/config/main-local.php @@ -0,0 +1,17 @@ + array( +// 'debug' => array( +// 'class' => 'yii\debug\Module', +// ), + ), + 'components' => array( + 'log' => array( + 'targets' => array( +// array( +// 'class' => 'yii\logging\DebugTarget', +// ) + ), + ), + ), +); diff --git a/apps/advanced/environments/dev/backstage/config/params-local.php b/apps/advanced/environments/dev/backstage/config/params-local.php new file mode 100644 index 0000000..2670143 --- /dev/null +++ b/apps/advanced/environments/dev/backstage/config/params-local.php @@ -0,0 +1,3 @@ +run(); diff --git a/apps/advanced/environments/dev/common/config/params-local.php b/apps/advanced/environments/dev/common/config/params-local.php new file mode 100644 index 0000000..2670143 --- /dev/null +++ b/apps/advanced/environments/dev/common/config/params-local.php @@ -0,0 +1,3 @@ + array( +// 'debug' => array( +// 'class' => 'yii\debug\Module', +// ), + ), + 'components' => array( + 'log' => array( + 'targets' => array( +// array( +// 'class' => 'yii\logging\DebugTarget', +// ) + ), + ), + ), +); diff --git a/apps/advanced/environments/dev/frontend/config/params-local.php b/apps/advanced/environments/dev/frontend/config/params-local.php new file mode 100644 index 0000000..2670143 --- /dev/null +++ b/apps/advanced/environments/dev/frontend/config/params-local.php @@ -0,0 +1,3 @@ +run(); diff --git a/apps/advanced/environments/dev/yii b/apps/advanced/environments/dev/yii new file mode 100644 index 0000000..d763217 --- /dev/null +++ b/apps/advanced/environments/dev/yii @@ -0,0 +1,25 @@ +#!/usr/bin/env php +run(); diff --git a/apps/advanced/environments/index.php b/apps/advanced/environments/index.php new file mode 100644 index 0000000..ff907d2 --- /dev/null +++ b/apps/advanced/environments/index.php @@ -0,0 +1,38 @@ + array( + * 'path' => 'directory storing the local files', + * 'writable' => array( + * // list of directories that should be set writable + * ), + * ), + * ); + * ``` + */ +return array( + 'Development' => array( + 'path' => 'dev', + 'writable' => array( + // handled by composer.json already + ), + 'executable' => array( + 'yiic', + ), + ), + 'Production' => array( + 'path' => 'prod', + 'writable' => array( + // handled by composer.json already + ), + 'executable' => array( + 'yiic', + ), + ), +); diff --git a/apps/advanced/environments/prod/backstage/config/main-local.php b/apps/advanced/environments/prod/backstage/config/main-local.php new file mode 100644 index 0000000..5b61b0e --- /dev/null +++ b/apps/advanced/environments/prod/backstage/config/main-local.php @@ -0,0 +1,3 @@ +run(); diff --git a/apps/advanced/environments/prod/common/config/params-local.php b/apps/advanced/environments/prod/common/config/params-local.php new file mode 100644 index 0000000..2670143 --- /dev/null +++ b/apps/advanced/environments/prod/common/config/params-local.php @@ -0,0 +1,3 @@ +run(); diff --git a/apps/advanced/environments/prod/yii b/apps/advanced/environments/prod/yii new file mode 100644 index 0000000..395aede --- /dev/null +++ b/apps/advanced/environments/prod/yii @@ -0,0 +1,25 @@ +#!/usr/bin/env php +run(); diff --git a/apps/advanced/frontend/assets/.gitkeep b/apps/advanced/frontend/assets/.gitkeep new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/apps/advanced/frontend/assets/.gitkeep @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/apps/advanced/frontend/config/.gitignore b/apps/advanced/frontend/config/.gitignore new file mode 100644 index 0000000..20da318 --- /dev/null +++ b/apps/advanced/frontend/config/.gitignore @@ -0,0 +1,2 @@ +main-local.php +params-local.php \ No newline at end of file diff --git a/apps/advanced/frontend/config/assets.php b/apps/advanced/frontend/config/assets.php new file mode 100644 index 0000000..ee0d610 --- /dev/null +++ b/apps/advanced/frontend/config/assets.php @@ -0,0 +1,18 @@ + array( + 'basePath' => '@wwwroot', + 'baseUrl' => '@www', + 'css' => array( + 'css/site.css', + ), + 'js' => array( + + ), + 'depends' => array( + 'yii', + 'yii/bootstrap/responsive', + ), + ), +); diff --git a/apps/advanced/frontend/config/main.php b/apps/advanced/frontend/config/main.php new file mode 100644 index 0000000..607c9a9 --- /dev/null +++ b/apps/advanced/frontend/config/main.php @@ -0,0 +1,39 @@ + 'change-me', + 'basePath' => dirname(__DIR__), + 'preload' => array('log'), + 'controllerNamespace' => 'frontend\controllers', + 'modules' => array( + ), + 'components' => array( + 'db' => $params['components.db'], + 'cache' => $params['components.cache'], + 'user' => array( + 'class' => 'yii\web\User', + 'identityClass' => 'common\models\User', + ), + 'assetManager' => array( + 'bundles' => require(__DIR__ . '/assets.php'), + ), + 'log' => array( + 'class' => 'yii\logging\Router', + 'targets' => array( + array( + 'class' => 'yii\logging\FileTarget', + 'levels' => array('error', 'warning'), + ), + ), + ), + ), + 'params' => $params, +); diff --git a/apps/advanced/frontend/config/params.php b/apps/advanced/frontend/config/params.php new file mode 100644 index 0000000..1e197d0 --- /dev/null +++ b/apps/advanced/frontend/config/params.php @@ -0,0 +1,5 @@ + 'admin@example.com', +); \ No newline at end of file diff --git a/apps/advanced/frontend/controllers/SiteController.php b/apps/advanced/frontend/controllers/SiteController.php new file mode 100644 index 0000000..cd3339c --- /dev/null +++ b/apps/advanced/frontend/controllers/SiteController.php @@ -0,0 +1,61 @@ + array( + 'class' => 'yii\web\CaptchaAction', + ), + ); + } + + public function actionIndex() + { + echo $this->render('index'); + } + + public function actionLogin() + { + $model = new LoginForm(); + if ($this->populate($_POST, $model) && $model->login()) { + Yii::$app->response->redirect(array('site/index')); + } else { + echo $this->render('login', array( + 'model' => $model, + )); + } + } + + public function actionLogout() + { + Yii::$app->getUser()->logout(); + Yii::$app->getResponse()->redirect(array('site/index')); + } + + public function actionContact() + { + $model = new ContactForm; + if ($this->populate($_POST, $model) && $model->contact(Yii::$app->params['adminEmail'])) { + Yii::$app->session->setFlash('contactFormSubmitted'); + Yii::$app->response->refresh(); + } else { + echo $this->render('contact', array( + 'model' => $model, + )); + } + } + + public function actionAbout() + { + echo $this->render('about'); + } +} diff --git a/apps/advanced/frontend/models/ContactForm.php b/apps/advanced/frontend/models/ContactForm.php new file mode 100644 index 0000000..b3d8682 --- /dev/null +++ b/apps/advanced/frontend/models/ContactForm.php @@ -0,0 +1,63 @@ + 'Verification Code', + ); + } + + /** + * Sends an email to the specified email address using the information collected by this model. + * @param string $email the target email address + * @return boolean whether the model passes validation + */ + public function contact($email) + { + if ($this->validate()) { + $name = '=?UTF-8?B?' . base64_encode($this->name) . '?='; + $subject = '=?UTF-8?B?' . base64_encode($this->subject) . '?='; + $headers = "From: $name <{$this->email}>\r\n" . + "Reply-To: {$this->email}\r\n" . + "MIME-Version: 1.0\r\n" . + "Content-type: text/plain; charset=UTF-8"; + mail($email, $subject, $this->body, $headers); + return true; + } else { + return false; + } + } +} diff --git a/apps/advanced/frontend/runtime/.gitignore b/apps/advanced/frontend/runtime/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/apps/advanced/frontend/runtime/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/apps/bootstrap/views/layouts/main.php b/apps/advanced/frontend/views/layouts/main.php similarity index 100% rename from apps/bootstrap/views/layouts/main.php rename to apps/advanced/frontend/views/layouts/main.php diff --git a/apps/bootstrap/views/site/about.php b/apps/advanced/frontend/views/site/about.php similarity index 100% rename from apps/bootstrap/views/site/about.php rename to apps/advanced/frontend/views/site/about.php diff --git a/apps/bootstrap/views/site/contact.php b/apps/advanced/frontend/views/site/contact.php similarity index 100% rename from apps/bootstrap/views/site/contact.php rename to apps/advanced/frontend/views/site/contact.php diff --git a/apps/advanced/frontend/views/site/index.php b/apps/advanced/frontend/views/site/index.php new file mode 100644 index 0000000..158b61c --- /dev/null +++ b/apps/advanced/frontend/views/site/index.php @@ -0,0 +1,47 @@ +title = 'Welcome'; +?> +
+

Welcome!

+ +

Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus + commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

+ Get started with Yii +
+ +
+ + +
+
+

Heading

+ +

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris + condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. + Donec sed odio dui.

+ +

View details »

+
+
+

Heading

+ +

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris + condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. + Donec sed odio dui.

+ +

View details »

+
+
+

Heading

+ +

Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta + felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum + massa.

+ +

View details »

+
+
+ diff --git a/apps/advanced/frontend/views/site/login.php b/apps/advanced/frontend/views/site/login.php new file mode 100644 index 0000000..f676b98 --- /dev/null +++ b/apps/advanced/frontend/views/site/login.php @@ -0,0 +1,24 @@ +title = 'Login'; +$this->params['breadcrumbs'][] = $this->title; +?> +

title); ?>

+ +

Please fill out the following fields to login:

+ + array('class' => 'form-horizontal'))); ?> + field($model, 'username')->textInput(); ?> + field($model, 'password')->passwordInput(); ?> + field($model, 'rememberMe')->checkbox(); ?> +
+ 'btn btn-primary')); ?> +
+ diff --git a/apps/advanced/frontend/www/.gitignore b/apps/advanced/frontend/www/.gitignore new file mode 100644 index 0000000..148f2b0 --- /dev/null +++ b/apps/advanced/frontend/www/.gitignore @@ -0,0 +1 @@ +/index.php \ No newline at end of file diff --git a/apps/advanced/frontend/www/assets/.gitignore b/apps/advanced/frontend/www/assets/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/apps/advanced/frontend/www/assets/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/apps/advanced/frontend/www/css/site.css b/apps/advanced/frontend/www/css/site.css new file mode 100644 index 0000000..890a953 --- /dev/null +++ b/apps/advanced/frontend/www/css/site.css @@ -0,0 +1,78 @@ +body { + padding-top: 20px; + padding-bottom: 60px; +} + +/* Custom container */ +.container { + margin: 0 auto; + max-width: 1000px; +} + +.container > hr { + margin: 60px 0; +} + +/* Main marketing message and sign up button */ +.jumbotron { + margin: 80px 0; + text-align: center; +} + +.jumbotron h1 { + font-size: 100px; + line-height: 1; +} + +.jumbotron .lead { + font-size: 24px; + line-height: 1.25; +} + +.jumbotron .btn { + font-size: 21px; + padding: 14px 24px; +} + +/* Supporting marketing content */ +.marketing { + margin: 60px 0; +} + +.marketing p + h4 { + margin-top: 28px; +} + +/* Customize the navbar links to be fill the entire space of the .navbar */ +.navbar .navbar-inner { + padding: 0; +} + +.navbar .nav { + margin: 0; + display: table; + width: 100%; +} + +.navbar .nav li { + display: table-cell; + width: 1%; + float: none; +} + +.navbar .nav li a { + font-weight: bold; + text-align: center; + border-left: 1px solid rgba(255, 255, 255, .75); + border-right: 1px solid rgba(0, 0, 0, .1); +} + +.navbar .nav li:first-child a { + border-left: 0; + border-radius: 3px 0 0 3px; +} + +.navbar .nav li:last-child a { + border-right: 0; + border-radius: 0 3px 3px 0; +} diff --git a/apps/advanced/install b/apps/advanced/install new file mode 100644 index 0000000..6864440 --- /dev/null +++ b/apps/advanced/install @@ -0,0 +1,112 @@ +#!/usr/bin/env php + $name) { + echo " [$i] $name\n"; +} +echo "\n Your choice [0-" . (count($envs) - 1) . ', or "q" to quit] '; +$answer = trim(fgets(STDIN)); +if (!ctype_digit($answer) || !isset($envNames[$answer])) { + echo "\n Quit installation.\n"; + return; +} + +$env = $envs[$envNames[$answer]]; +echo "\n Install the application under '{$envNames[$answer]}' environment? [yes|no] "; +$answer = trim(fgets(STDIN)); +if (strncasecmp($answer, 'y', 1)) { + echo "\n Quit installation.\n"; + return; +} + +echo "\n Start installation ...\n\n"; +$files = getFileList("$root/environments/{$env['path']}"); +$all = false; +foreach ($files as $file) { + if (!copyFile($root, "environments/{$env['path']}/$file", $file, $all)) { + break; + } +} + +if (isset($env['writable'])) { + foreach ($env['writable'] as $writable) { + echo " chmod 0777 $writable\n"; + @chmod("$root/$writable", 0777); + } +} + +if (isset($env['executable'])) { + foreach ($env['executable'] as $executable) { + echo " chmod 0755 $executable\n"; + @chmod("$root/$executable", 0755); + } +} + +echo "\n ... installation completed.\n\n"; + +function getFileList($root, $basePath = '') +{ + $files = array(); + $handle = opendir($root); + while (($path = readdir($handle)) !== false) { + if ($path === '.svn' || $path === '.' || $path === '..') { + continue; + } + $fullPath = "$root/$path"; + $relativePath = $basePath === '' ? $path : "$basePath/$path"; + if (is_dir($fullPath)) { + $files = array_merge($files, getFileList($fullPath, $relativePath)); + } else { + $files[] = $relativePath; + } + } + closedir($handle); + return $files; +} + +function copyFile($root, $source, $target, &$all) +{ + if (!is_file($root . '/' . $source)) { + echo " skip $target ($source not exist)\n"; + return true; + } + if (is_file($root . '/' . $target)) { + if (file_get_contents($root . '/' . $source) === file_get_contents($root . '/' . $target)) { + echo " unchanged $target\n"; + return true; + } + if ($all) { + echo " overwrite $target\n"; + } else { + echo " exist $target\n"; + echo " ...overwrite? [Yes|No|All|Quit] "; + $answer = trim(fgets(STDIN)); + if (!strncasecmp($answer, 'q', 1)) { + return false; + } else { + if (!strncasecmp($answer, 'y', 1)) { + echo " overwrite $target\n"; + } else { + if (!strncasecmp($answer, 'a', 1)) { + echo " overwrite $target\n"; + $all = true; + } else { + echo " skip $target\n"; + return true; + } + } + } + } + file_put_contents($root . '/' . $target, file_get_contents($root . '/' . $source)); + return true; + } + echo " generate $target\n"; + @mkdir(dirname($root . '/' . $target), 0777, true); + file_put_contents($root . '/' . $target, file_get_contents($root . '/' . $source)); + return true; +} diff --git a/apps/advanced/install.bat b/apps/advanced/install.bat new file mode 100644 index 0000000..dc2cd83 --- /dev/null +++ b/apps/advanced/install.bat @@ -0,0 +1,20 @@ +@echo off + +rem ------------------------------------------------------------- +rem Yii command line install script for Windows. +rem +rem @author Qiang Xue +rem @link http://www.yiiframework.com/ +rem @copyright Copyright © 2012 Yii Software LLC +rem @license http://www.yiiframework.com/license/ +rem ------------------------------------------------------------- + +@setlocal + +set YII_PATH=%~dp0 + +if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe + +"%PHP_COMMAND%" "%YII_PATH%install" %* + +@endlocal diff --git a/apps/bootstrap/requirements.php b/apps/advanced/requirements.php similarity index 100% rename from apps/bootstrap/requirements.php rename to apps/advanced/requirements.php diff --git a/apps/advanced/vendor/.gitignore b/apps/advanced/vendor/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/apps/advanced/vendor/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/apps/bootstrap/yii.bat b/apps/advanced/yii.bat similarity index 100% rename from apps/bootstrap/yii.bat rename to apps/advanced/yii.bat diff --git a/apps/basic/LICENSE.md b/apps/basic/LICENSE.md new file mode 100644 index 0000000..6edcc4f --- /dev/null +++ b/apps/basic/LICENSE.md @@ -0,0 +1,32 @@ +The Yii framework is free software. It is released under the terms of +the following BSD License. + +Copyright © 2008-2013 by Yii Software LLC (http://www.yiisoft.com) +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 Yii Software LLC 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 OWNER 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. \ No newline at end of file diff --git a/apps/bootstrap/README.md b/apps/basic/README.md similarity index 72% rename from apps/bootstrap/README.md rename to apps/basic/README.md index a1376ba..5300448 100644 --- a/apps/bootstrap/README.md +++ b/apps/basic/README.md @@ -1,5 +1,5 @@ -Yii 2 Bootstrap Application -=========================== +Yii 2 Basic Application Template +================================ **NOTE** Yii 2 and the relevant applications and extensions are still under heavy development. We may make significant changes without prior notices. Please do not @@ -7,10 +7,10 @@ use them for production. Please consider using [Yii v1.1](https://github.com/yii if you have a project to be deployed for production soon. -Thank you for choosing Yii 2 - the new generation of high-performance PHP framework. +Thank you for using Yii 2 Basic Application Template - an application template +that works out-of-box and can be easily customized to fit for your needs. -The Yii 2 Bootstrap Application is a Web application template that you can easily customize -to fit for your needs. It is particularly suitable for small Websites which mainly contain +Yii 2 Basic Application Template is best suitable for small Websites which mainly contain a few informational pages. @@ -49,11 +49,11 @@ curl -s http://getcomposer.org/installer | php You can then install the Bootstrap Application using the following command: ~~~ -php composer.phar create-project --stability=dev yiisoft/yii2-bootstrap bootstrap +php composer.phar create-project --stability=dev yiisoft/yii2-app-basic yii-basic ~~~ -Now you should be able to access the Bootstrap Application using the URL `http://localhost/bootstrap/www/`, -assuming `bootstrap` is directly under the document root of your Web server. +Now you should be able to access the application using the URL `http://localhost/yii-basic/www/`, +assuming `yii-basic` is directly under the document root of your Web server. ### Install from an Archive File diff --git a/apps/bootstrap/www/assets/.gitignore b/apps/basic/assets/.gitkeep similarity index 100% rename from apps/bootstrap/www/assets/.gitignore rename to apps/basic/assets/.gitkeep diff --git a/apps/bootstrap/commands/HelloController.php b/apps/basic/commands/HelloController.php similarity index 96% rename from apps/bootstrap/commands/HelloController.php rename to apps/basic/commands/HelloController.php index 16f5f74..b5ecac2 100644 --- a/apps/bootstrap/commands/HelloController.php +++ b/apps/basic/commands/HelloController.php @@ -24,6 +24,6 @@ class HelloController extends Controller */ public function actionIndex($message = 'hello world') { - echo $message; + echo $message."\n"; } } \ No newline at end of file diff --git a/apps/bootstrap/composer.json b/apps/basic/composer.json similarity index 77% rename from apps/bootstrap/composer.json rename to apps/basic/composer.json index 6bd87cc..29b05d1 100644 --- a/apps/bootstrap/composer.json +++ b/apps/basic/composer.json @@ -1,7 +1,7 @@ { - "name": "yiisoft/yii2-bootstrap", - "description": "Yii 2 Bootstrap Application", - "keywords": ["yii", "framework", "bootstrap"], + "name": "yiisoft/yii2-app-basic", + "description": "Yii 2 Basic Application Template", + "keywords": ["yii", "framework", "basic", "application template"], "homepage": "http://www.yiiframework.com/", "type": "project", "license": "BSD-3-Clause", @@ -27,11 +27,11 @@ ] }, "extra": { - "writable": [ + "yii-install-writable": [ "runtime", "www/assets" ], - "executable": [ + "yii-install-executable": [ "yii" ] } diff --git a/apps/basic/config/assets.php b/apps/basic/config/assets.php new file mode 100644 index 0000000..ee0d610 --- /dev/null +++ b/apps/basic/config/assets.php @@ -0,0 +1,18 @@ + array( + 'basePath' => '@wwwroot', + 'baseUrl' => '@www', + 'css' => array( + 'css/site.css', + ), + 'js' => array( + + ), + 'depends' => array( + 'yii', + 'yii/bootstrap/responsive', + ), + ), +); diff --git a/apps/bootstrap/config/console.php b/apps/basic/config/console.php similarity index 88% rename from apps/bootstrap/config/console.php rename to apps/basic/config/console.php index df96023..bfb3ed7 100644 --- a/apps/bootstrap/config/console.php +++ b/apps/basic/config/console.php @@ -1,5 +1,5 @@ 'bootstrap-console', 'basePath' => dirname(__DIR__), @@ -22,5 +22,5 @@ return array( ), ), ), - 'params' => require(__DIR__ . '/params.php'), + 'params' => $params, ); diff --git a/apps/bootstrap/config/main.php b/apps/basic/config/main.php similarity index 92% rename from apps/bootstrap/config/main.php rename to apps/basic/config/main.php index b5980da..9adfba6 100644 --- a/apps/bootstrap/config/main.php +++ b/apps/basic/config/main.php @@ -1,5 +1,5 @@ 'bootstrap', 'basePath' => dirname(__DIR__), @@ -34,5 +34,5 @@ return array( ), ), ), - 'params' => require(__DIR__ . '/params.php'), + 'params' => $params, ); diff --git a/apps/basic/config/params.php b/apps/basic/config/params.php new file mode 100644 index 0000000..1e197d0 --- /dev/null +++ b/apps/basic/config/params.php @@ -0,0 +1,5 @@ + 'admin@example.com', +); \ No newline at end of file diff --git a/apps/bootstrap/controllers/SiteController.php b/apps/basic/controllers/SiteController.php similarity index 100% rename from apps/bootstrap/controllers/SiteController.php rename to apps/basic/controllers/SiteController.php diff --git a/apps/bootstrap/models/ContactForm.php b/apps/basic/models/ContactForm.php similarity index 100% rename from apps/bootstrap/models/ContactForm.php rename to apps/basic/models/ContactForm.php diff --git a/apps/bootstrap/models/LoginForm.php b/apps/basic/models/LoginForm.php similarity index 100% rename from apps/bootstrap/models/LoginForm.php rename to apps/basic/models/LoginForm.php diff --git a/apps/bootstrap/models/User.php b/apps/basic/models/User.php similarity index 100% rename from apps/bootstrap/models/User.php rename to apps/basic/models/User.php diff --git a/apps/basic/requirements.php b/apps/basic/requirements.php new file mode 100644 index 0000000..5a2d910 --- /dev/null +++ b/apps/basic/requirements.php @@ -0,0 +1,96 @@ + 'PDO extension', + 'mandatory' => true, + 'condition' => extension_loaded('pdo'), + 'by' => 'All DB-related classes', + ), + array( + 'name' => 'PDO SQLite extension', + 'mandatory' => false, + 'condition' => extension_loaded('pdo_sqlite'), + 'by' => 'All DB-related classes', + 'memo' => 'Required for SQLite database.', + ), + array( + 'name' => 'PDO MySQL extension', + 'mandatory' => false, + 'condition' => extension_loaded('pdo_mysql'), + 'by' => 'All DB-related classes', + 'memo' => 'Required for MySQL database.', + ), + // Cache : + array( + 'name' => 'Memcache extension', + 'mandatory' => false, + 'condition' => extension_loaded('memcache') || extension_loaded('memcached'), + 'by' => 'CMemCache', + 'memo' => extension_loaded('memcached') ? 'To use memcached set CMemCache::useMemcached to true.' : '' + ), + array( + 'name' => 'APC extension', + 'mandatory' => false, + 'condition' => extension_loaded('apc') || extension_loaded('apc'), + 'by' => 'CApcCache', + ), + // Additional PHP extensions : + array( + 'name' => 'Mcrypt extension', + 'mandatory' => false, + 'condition' => extension_loaded('mcrypt'), + 'by' => 'CSecurityManager', + 'memo' => 'Required by encrypt and decrypt methods.' + ), + // PHP ini : + 'phpSafeMode' => array( + 'name' => 'PHP safe mode', + 'mandatory' => false, + 'condition' => $requirementsChecker->checkPhpIniOff("safe_mode"), + 'by' => 'File uploading and console command execution', + 'memo' => '"safe_mode" should be disabled at php.ini', + ), + 'phpExposePhp' => array( + 'name' => 'Expose PHP', + 'mandatory' => false, + 'condition' => $requirementsChecker->checkPhpIniOff("expose_php"), + 'by' => 'Security reasons', + 'memo' => '"expose_php" should be disabled at php.ini', + ), + 'phpAllowUrlInclude' => array( + 'name' => 'PHP allow url include', + 'mandatory' => false, + 'condition' => $requirementsChecker->checkPhpIniOff("allow_url_include"), + 'by' => 'Security reasons', + 'memo' => '"allow_url_include" should be disabled at php.ini', + ), + 'phpSmtp' => array( + 'name' => 'PHP mail SMTP', + 'mandatory' => false, + 'condition' => strlen(ini_get('SMTP'))>0, + 'by' => 'Email sending', + 'memo' => 'PHP mail SMTP server required', + ), +); +$requirementsChecker->checkYii()->check($requirements)->render(); diff --git a/apps/basic/runtime/.gitignore b/apps/basic/runtime/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/apps/basic/runtime/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/apps/basic/vendor/.gitignore b/apps/basic/vendor/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/apps/basic/vendor/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/apps/basic/views/layouts/main.php b/apps/basic/views/layouts/main.php new file mode 100644 index 0000000..635e118 --- /dev/null +++ b/apps/basic/views/layouts/main.php @@ -0,0 +1,66 @@ +registerAssetBundle('app'); +?> +beginPage(); ?> + + + + + <?php echo Html::encode($this->title); ?> + head(); ?> + + +
+ beginBody(); ?> +
+

My Company

+ + + +
+ + isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : array(), + )); ?> + + +
+ + + endBody(); ?> +
+ + + +endPage(); ?> diff --git a/apps/basic/views/site/about.php b/apps/basic/views/site/about.php new file mode 100644 index 0000000..86e19e1 --- /dev/null +++ b/apps/basic/views/site/about.php @@ -0,0 +1,16 @@ +title = 'About'; +$this->params['breadcrumbs'][] = $this->title; +?> +

title); ?>

+ +

+ This is the About page. You may modify the following file to customize its content: +

+ + + diff --git a/apps/basic/views/site/contact.php b/apps/basic/views/site/contact.php new file mode 100644 index 0000000..e740d0f --- /dev/null +++ b/apps/basic/views/site/contact.php @@ -0,0 +1,46 @@ +title = 'Contact'; +$this->params['breadcrumbs'][] = $this->title; +?> +

title); ?>

+ +session->hasFlash('contactFormSubmitted')): ?> +
+ Thank you for contacting us. We will respond to you as soon as possible. +
+ + +

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

+ + array('class' => 'form-horizontal'), + 'fieldConfig' => array('inputOptions' => array('class' => 'input-xlarge')), +)); ?> + field($model, 'name')->textInput(); ?> + field($model, 'email')->textInput(); ?> + field($model, 'subject')->textInput(); ?> + field($model, 'body')->textArea(array('rows' => 6)); ?> + field($model, 'verifyCode'); + echo $field->begin() + . $field->label() + . Captcha::widget() + . Html::activeTextInput($model, 'verifyCode', array('class' => 'input-medium')) + . $field->error() + . $field->end(); + ?> +
+ 'btn btn-primary')); ?> +
+ diff --git a/apps/basic/views/site/index.php b/apps/basic/views/site/index.php new file mode 100644 index 0000000..158b61c --- /dev/null +++ b/apps/basic/views/site/index.php @@ -0,0 +1,47 @@ +title = 'Welcome'; +?> +
+

Welcome!

+ +

Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus + commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

+ Get started with Yii +
+ +
+ + +
+
+

Heading

+ +

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris + condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. + Donec sed odio dui.

+ +

View details »

+
+
+

Heading

+ +

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris + condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. + Donec sed odio dui.

+ +

View details »

+
+
+

Heading

+ +

Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta + felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum + massa.

+ +

View details »

+
+
+ diff --git a/apps/basic/views/site/login.php b/apps/basic/views/site/login.php new file mode 100644 index 0000000..f676b98 --- /dev/null +++ b/apps/basic/views/site/login.php @@ -0,0 +1,24 @@ +title = 'Login'; +$this->params['breadcrumbs'][] = $this->title; +?> +

title); ?>

+ +

Please fill out the following fields to login:

+ + array('class' => 'form-horizontal'))); ?> + field($model, 'username')->textInput(); ?> + field($model, 'password')->passwordInput(); ?> + field($model, 'rememberMe')->checkbox(); ?> +
+ 'btn btn-primary')); ?> +
+ diff --git a/apps/basic/www/assets/.gitignore b/apps/basic/www/assets/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/apps/basic/www/assets/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/apps/basic/www/css/site.css b/apps/basic/www/css/site.css new file mode 100644 index 0000000..890a953 --- /dev/null +++ b/apps/basic/www/css/site.css @@ -0,0 +1,78 @@ +body { + padding-top: 20px; + padding-bottom: 60px; +} + +/* Custom container */ +.container { + margin: 0 auto; + max-width: 1000px; +} + +.container > hr { + margin: 60px 0; +} + +/* Main marketing message and sign up button */ +.jumbotron { + margin: 80px 0; + text-align: center; +} + +.jumbotron h1 { + font-size: 100px; + line-height: 1; +} + +.jumbotron .lead { + font-size: 24px; + line-height: 1.25; +} + +.jumbotron .btn { + font-size: 21px; + padding: 14px 24px; +} + +/* Supporting marketing content */ +.marketing { + margin: 60px 0; +} + +.marketing p + h4 { + margin-top: 28px; +} + +/* Customize the navbar links to be fill the entire space of the .navbar */ +.navbar .navbar-inner { + padding: 0; +} + +.navbar .nav { + margin: 0; + display: table; + width: 100%; +} + +.navbar .nav li { + display: table-cell; + width: 1%; + float: none; +} + +.navbar .nav li a { + font-weight: bold; + text-align: center; + border-left: 1px solid rgba(255, 255, 255, .75); + border-right: 1px solid rgba(0, 0, 0, .1); +} + +.navbar .nav li:first-child a { + border-left: 0; + border-radius: 3px 0 0 3px; +} + +.navbar .nav li:last-child a { + border-right: 0; + border-radius: 0 3px 3px 0; +} diff --git a/apps/bootstrap/www/index.php b/apps/basic/www/index.php similarity index 100% rename from apps/bootstrap/www/index.php rename to apps/basic/www/index.php diff --git a/apps/bootstrap/yii b/apps/basic/yii similarity index 100% rename from apps/bootstrap/yii rename to apps/basic/yii diff --git a/apps/basic/yii.bat b/apps/basic/yii.bat new file mode 100644 index 0000000..5e21e2e --- /dev/null +++ b/apps/basic/yii.bat @@ -0,0 +1,20 @@ +@echo off + +rem ------------------------------------------------------------- +rem Yii command line bootstrap script for Windows. +rem +rem @author Qiang Xue +rem @link http://www.yiiframework.com/ +rem @copyright Copyright © 2012 Yii Software LLC +rem @license http://www.yiiframework.com/license/ +rem ------------------------------------------------------------- + +@setlocal + +set YII_PATH=%~dp0 + +if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe + +"%PHP_COMMAND%" "%YII_PATH%yii" %* + +@endlocal diff --git a/docs/guide/bootstrap.md b/docs/guide/bootstrap.md index 47e3b8f..26a6bde 100644 --- a/docs/guide/bootstrap.md +++ b/docs/guide/bootstrap.md @@ -1,15 +1,30 @@ Bootstrap with Yii ================== -A ready-to-use Web application is distributed together with Yii. You may find -its source code under the `app` folder after you expand the Yii release file. -If you have installed Yii under a Web-accessible folder, you should be able to -access this application through the following URL: +Yii provides a few read-to-use application templates. Based on your needs, you may +choose one of them to bootstrap your project. + +In following, we describe how to get started with the "Yii 2 Basic Application Template". + + +### Install via Composer + +If you do not have [Composer](http://getcomposer.org/), you may download it from +[http://getcomposer.org/](http://getcomposer.org/) or run the following command on Linux/Unix/MacOS: ~~~ -http://localhost/yii/apps/bootstrap/index.php +curl -s http://getcomposer.org/installer | php ~~~ +You can then install the Bootstrap Application using the following command: + +~~~ +php composer.phar create-project --stability=dev yiisoft/yii2-app-basic yii-basic +~~~ + +Now you should be able to access the Bootstrap Application using the URL `http://localhost/yii-basic/www/`, +assuming `yii-basic` is directly under the document root of your Web server. + As you can see, the application has four pages: the homepage, the about page, the contact page and the login page. The contact page displays a contact @@ -20,42 +35,34 @@ and the login page allows users to be authenticated before accessing privileged The following diagram shows the directory structure of this application. ~~~ -app/ - index.php Web application entry script file - index-test.php entry script file for the functional tests - assets/ containing published resource files - css/ containing CSS files - img/ containing image files - themes/ containing application themes - protected/ containing protected application files - yii yii command line script for Unix/Linux - yii.bat yii command line script for Windows - commands/ containing customized yii console commands - components/ containing reusable user components - config/ containing configuration files - console.php the console application configuration - main.php the Web application configuration - controllers/ containing controller class files - SiteController.php the default controller class - data/ containing the sample database - schema.mysql.sql the DB schema for the sample MySQL database - schema.sqlite.sql the DB schema for the sample SQLite database - bootstrap.db the sample SQLite database file - vendor/ containing third-party extensions and libraries - messages/ containing translated messages - models/ containing model class files - User.php the User model - LoginForm.php the form model for 'login' action - ContactForm.php the form model for 'contact' action - runtime/ containing temporarily generated files - views/ containing controller view and layout files - layouts/ containing layout view files - main.php the base layout shared by all pages - site/ containing view files for the 'site' controller - about.php the view for the 'about' action - contact.php the view for the 'contact' action - index.php the view for the 'index' action - login.php the view for the 'login' action +yii-basic/ + yii yii command line script for Unix/Linux + yii.bat yii command line script for Windows + requirements.php the requirement checker script + commands/ containing customized yii console commands + config/ containing configuration files + console.php the console application configuration + main.php the Web application configuration + controllers/ containing controller class files + SiteController.php the default controller class + vendor/ containing third-party extensions and libraries + models/ containing model class files + User.php the User model + LoginForm.php the form model for 'login' action + ContactForm.php the form model for 'contact' action + runtime/ containing temporarily generated files + views/ containing controller view and layout files + layouts/ containing layout view files + main.php the base layout shared by all pages + site/ containing view files for the 'site' controller + about.php the view for the 'about' action + contact.php the view for the 'contact' action + index.php the view for the 'index' action + login.php the view for the 'login' action + www/ containing Web-accessible resources + index.php Web application entry script file + assets/ containing published resource files + css/ containing CSS files ~~~ diff --git a/docs/guide/upgrade-from-v1.md b/docs/guide/upgrade-from-v1.md index cc0de73..b3d4411 100644 --- a/docs/guide/upgrade-from-v1.md +++ b/docs/guide/upgrade-from-v1.md @@ -216,12 +216,14 @@ Using a widget is more straightforward in 2.0. You mainly use the `begin()`, `en methods of the `Widget` class. For example, ```php -// $this refers to the View object // Note that you have to "echo" the result to display it echo \yii\widgets\Menu::widget(array('items' => $items)); -// $this refers to the View object -$form = \yii\widgets\ActiveForm::begin($this); +// Passing an array to initialize the object properties +$form = \yii\widgets\ActiveForm::begin(array( + 'options' => array('class' => 'form-horizontal'), + 'fieldConfig' => array('inputOptions' => array('class' => 'input-xlarge')), +)); ... form inputs here ... \yii\widgets\ActiveForm::end(); ``` diff --git a/extensions/composer/composer.json b/extensions/composer/composer.json index 49f99fe..d8cf49d 100644 --- a/extensions/composer/composer.json +++ b/extensions/composer/composer.json @@ -19,7 +19,7 @@ ], "minimum-stability": "dev", "require": { - "yiisoft/yii2": "dev-master" + "yiisoft/yii2": "*" }, "autoload": { "psr-0": { "yii\\composer": "" } diff --git a/extensions/composer/yii/composer/InstallHandler.php b/extensions/composer/yii/composer/InstallHandler.php index 6d43abd..9e36a35 100644 --- a/extensions/composer/yii/composer/InstallHandler.php +++ b/extensions/composer/yii/composer/InstallHandler.php @@ -8,15 +8,28 @@ namespace yii\composer; use Composer\Script\CommandEvent; +use yii\console\Application; +use yii\console\Exception; + +defined('YII_DEBUG') or define('YII_DEBUG', true); + +// fcgi doesn't have STDIN defined by default +defined('STDIN') or define('STDIN', fopen('php://stdin', 'r')); /** * InstallHandler is called by Composer after it installs/updates the current package. * * @author Qiang Xue + * @author Tobias Munk * @since 2.0 */ class InstallHandler { + const PARAM_WRITABLE = 'yii-install-writable'; + const PARAM_EXECUTABLE = 'yii-install-executable'; + const PARAM_CONFIG = 'yii-install-config'; + const PARAM_COMMANDS = 'yii-install-commands'; + /** * Sets the correct permissions of files and directories. * @param CommandEvent $event @@ -24,11 +37,11 @@ class InstallHandler public static function setPermissions($event) { $options = array_merge(array( - 'writable' => array(), - 'executable' => array(), + self::PARAM_WRITABLE => array(), + self::PARAM_EXECUTABLE => array(), ), $event->getComposer()->getPackage()->getExtra()); - foreach ((array)$options['writable'] as $path) { + foreach ((array)$options[self::PARAM_WRITABLE] as $path) { echo "Setting writable: $path ..."; if (is_dir($path)) { chmod($path, 0777); @@ -39,7 +52,7 @@ class InstallHandler } } - foreach ((array)$options['executable'] as $path) { + foreach ((array)$options[self::PARAM_EXECUTABLE] as $path) { echo "Setting executable: $path ..."; if (is_file($path)) { chmod($path, 0755); @@ -50,4 +63,35 @@ class InstallHandler } } } + + /** + * Executes a yii command. + * @param CommandEvent $event + */ + public static function run($event) + { + $options = array_merge(array( + self::PARAM_COMMANDS => array(), + ), $event->getComposer()->getPackage()->getExtra()); + + if (!isset($options[self::PARAM_CONFIG])) { + throw new Exception('Please specify the "' . self::PARAM_CONFIG . '" parameter in composer.json.'); + } + $configFile = getcwd() . '/' . $options[self::PARAM_CONFIG]; + if (!is_file($configFile)) { + throw new Exception("Config file does not exist: $configFile"); + } + + require(__DIR__ . '/../../../yii2/yii/Yii.php'); + $application = new Application(require($configFile)); + $request = $application->getRequest(); + + foreach ((array)$options[self::PARAM_COMMANDS] as $command) { + $params = str_getcsv($command, ' '); // see http://stackoverflow.com/a/6609509/291573 + $request->setParams($params); + list($route, $params) = $request->resolve(); + echo "Running command: yii {$command}\n"; + $application->runAction($route, $params); + } + } } diff --git a/extensions/smarty/composer.json b/extensions/smarty/composer.json new file mode 100644 index 0000000..b1e1681 --- /dev/null +++ b/extensions/smarty/composer.json @@ -0,0 +1,28 @@ +{ + "name": "yiisoft/yii2-smarty", + "description": "The Smarty integration for the Yii framework", + "keywords": ["yii", "smarty", "renderer"], + "type": "library", + "license": "BSD-3-Clause", + "support": { + "issues": "https://github.com/yiisoft/yii2/issues?state=open", + "forum": "http://www.yiiframework.com/forum/", + "wiki": "http://www.yiiframework.com/wiki/", + "irc": "irc://irc.freenode.net/yii", + "source": "https://github.com/yiisoft/yii2" + }, + "authors": [ + { + "name": "Alenxader Makarov", + "email": "sam@rmcreative.ru" + } + ], + "minimum-stability": "dev", + "require": { + "yiisoft/yii2": "*", + "smarty/smarty": "v3.1.13" + }, + "autoload": { + "psr-0": { "yii\\smarty": "" } + } +} diff --git a/framework/yii/renderers/SmartyViewRenderer.php b/extensions/smarty/yii/smarty/ViewRenderer.php similarity index 95% rename from framework/yii/renderers/SmartyViewRenderer.php rename to extensions/smarty/yii/smarty/ViewRenderer.php index ac66e0d..d8c5d30 100644 --- a/framework/yii/renderers/SmartyViewRenderer.php +++ b/extensions/smarty/yii/smarty/ViewRenderer.php @@ -7,13 +7,13 @@ * @license http://www.yiiframework.com/license/ */ -namespace yii\renderers; +namespace yii\smarty; use Yii; use Smarty; use yii\base\View; -use yii\base\ViewRenderer; use yii\helpers\Html; +use yii\base\ViewRenderer as BaseViewRenderer; /** * SmartyViewRenderer allows you to use Smarty templates in views. @@ -21,7 +21,7 @@ use yii\helpers\Html; * @author Alexander Makarov * @since 2.0 */ -class SmartyViewRenderer extends ViewRenderer +class ViewRenderer extends BaseViewRenderer { /** * @var string the directory or path alias pointing to where Smarty cache will be stored. diff --git a/extensions/twig/composer.json b/extensions/twig/composer.json new file mode 100644 index 0000000..0ff7437 --- /dev/null +++ b/extensions/twig/composer.json @@ -0,0 +1,28 @@ +{ + "name": "yiisoft/yii2-twig", + "description": "The Twig integration for the Yii framework", + "keywords": ["yii", "twig", "renderer"], + "type": "library", + "license": "BSD-3-Clause", + "support": { + "issues": "https://github.com/yiisoft/yii2/issues?state=open", + "forum": "http://www.yiiframework.com/forum/", + "wiki": "http://www.yiiframework.com/wiki/", + "irc": "irc://irc.freenode.net/yii", + "source": "https://github.com/yiisoft/yii2" + }, + "authors": [ + { + "name": "Alenxader Makarov", + "email": "sam@rmcreative.ru" + } + ], + "minimum-stability": "dev", + "require": { + "yiisoft/yii2": "*", + "twig/twig": "v1.13.0" + }, + "autoload": { + "psr-0": { "yii\\twig": "" } + } +} diff --git a/framework/yii/renderers/TwigViewRenderer.php b/extensions/twig/yii/twig/ViewRenderer.php similarity index 95% rename from framework/yii/renderers/TwigViewRenderer.php rename to extensions/twig/yii/twig/ViewRenderer.php index de561d3..7498d86 100644 --- a/framework/yii/renderers/TwigViewRenderer.php +++ b/extensions/twig/yii/twig/ViewRenderer.php @@ -11,7 +11,7 @@ namespace yii\renderers; use Yii; use yii\base\View; -use yii\base\ViewRenderer; +use yii\base\ViewRenderer as BaseViewRenderer; use yii\helpers\Html; /** @@ -20,7 +20,7 @@ use yii\helpers\Html; * @author Alexander Makarov * @since 2.0 */ -class TwigViewRenderer extends ViewRenderer +class ViewRenderer extends BaseViewRenderer { /** * @var string the directory or path alias pointing to where Twig cache will be stored. diff --git a/framework/composer.json b/framework/composer.json index 4ef6f89..3265c11 100644 --- a/framework/composer.json +++ b/framework/composer.json @@ -64,7 +64,7 @@ "source": "https://github.com/yiisoft/yii2" }, "require": { - "php": ">=5.3.11", + "php": ">=5.3.7", "ext-mbstring": "*", "lib-pcre": "*" }, @@ -72,9 +72,9 @@ "psr-0": { "yii\\": "/" } }, "suggest": { - "michelf/php-markdown": "Required for Markdown helper.", - "twig/twig": "Required for TwigViewRenderer.", - "smarty/smarty": "Required for SmartyViewRenderer.", - "ezyang/htmlpurifier": "Required for Purifier helper." + "michelf/php-markdown": "Required by Markdown.", + "twig/twig": "Required by TwigViewRenderer.", + "smarty/smarty": "Required by SmartyViewRenderer.", + "ezyang/htmlpurifier": "Required by HtmlPurifier." } } diff --git a/framework/yii/YiiBase.php b/framework/yii/YiiBase.php index df5f631..4fe0e77 100644 --- a/framework/yii/YiiBase.php +++ b/framework/yii/YiiBase.php @@ -616,6 +616,7 @@ class YiiBase YiiBase::$aliases = array( '@yii' => array( '@yii/bootstrap' => __DIR__ . '/bootstrap', + '@yii/jui' => __DIR__ . '/jui', '@yii' => __DIR__, ), ); diff --git a/framework/yii/base/Model.php b/framework/yii/base/Model.php index 98901bf..c7432f5 100644 --- a/framework/yii/base/Model.php +++ b/framework/yii/base/Model.php @@ -9,7 +9,7 @@ namespace yii\base; use ArrayObject; use ArrayIterator; -use yii\helpers\StringHelper; +use yii\helpers\Inflector; use yii\validators\RequiredValidator; use yii\validators\Validator; @@ -504,7 +504,7 @@ class Model extends Component implements \IteratorAggregate, \ArrayAccess */ public function generateAttributeLabel($name) { - return StringHelper::camel2words($name, true); + return Inflector::camel2words($name, true); } /** diff --git a/framework/yii/base/View.php b/framework/yii/base/View.php index 8bede3d..f0656d7 100644 --- a/framework/yii/base/View.php +++ b/framework/yii/base/View.php @@ -88,21 +88,23 @@ class View extends Component /** * @var array a list of available renderers indexed by their corresponding supported file extensions. * Each renderer may be a view renderer object or the configuration for creating the renderer object. - * The default setting supports both Smarty and Twig (their corresponding file extension is "tpl" - * and "twig" respectively. Please refer to [[SmartyRenderer]] and [[TwigRenderer]] on how to install - * the needed libraries for these template engines. + * For example, the following configuration enables both Smarty and Twig view renderers: + * + * ~~~ + * array( + * 'tpl' => array( + * 'class' => 'yii\smarty\ViewRenderer', + * ), + * 'twig' => array( + * 'class' => 'yii\twig\ViewRenderer', + * ), + * ) + * ~~~ * * If no renderer is available for the given view file, the view file will be treated as a normal PHP * and rendered via [[renderPhpFile()]]. */ - public $renderers = array( - 'tpl' => array( - 'class' => 'yii\renderers\SmartyRenderer', - ), - 'twig' => array( - 'class' => 'yii\renderers\TwigRenderer', - ), - ); + public $renderers; /** * @var Theme|array the theme object or the configuration array for creating the theme object. * If not set, it means theming is not enabled. diff --git a/framework/yii/bootstrap/Carousel.php b/framework/yii/bootstrap/Carousel.php new file mode 100644 index 0000000..3d38b54 --- /dev/null +++ b/framework/yii/bootstrap/Carousel.php @@ -0,0 +1,172 @@ + array( + * // the item contains only the image + * '', + * // equivalent to the above + * array( + * 'content' => '', + * ), + * // the item contains both the image and the caption + * array( + * 'content' => '', + * 'caption' => '

This is title

This is the caption text

', + * 'options' => array(...), + * ), + * ) + * )); + * ``` + * + * @see http://twitter.github.io/bootstrap/javascript.html#carousel + * @author Antonio Ramirez + * @since 2.0 + */ +class Carousel extends Widget +{ + /** + * @var array|boolean the labels for the previous and the next control buttons. + * If false, it means the previous and the next control buttons should not be displayed. + */ + public $controls = array('‹', '›'); + /** + * @var array list of slides in the carousel. Each array element represents a single + * slide with the following structure: + * + * ```php + * array( + * // required, slide content (HTML), such as an image tag + * 'content' => '', + * // optional, the caption (HTML) of the slide + * 'caption'=> '

This is title

This is the caption text

', + * // optional the HTML attributes of the slide container + * 'options' => array(), + * ) + * ``` + */ + public $items = array(); + + + /** + * Initializes the widget. + */ + public function init() + { + parent::init(); + $this->addCssClass($this->options, 'carousel'); + } + + /** + * Renders the widget. + */ + public function run() + { + echo Html::beginTag('div', $this->options) . "\n"; + echo $this->renderIndicators() . "\n"; + echo $this->renderItems() . "\n"; + echo $this->renderControls() . "\n"; + echo Html::endTag('div') . "\n"; + $this->registerPlugin('carousel'); + } + + /** + * Renders carousel indicators. + * @return string the rendering result + */ + public function renderIndicators() + { + $indicators = array(); + for ($i = 0, $count = count($this->items); $i < $count; $i++) { + $options = array('data-target' => '#' . $this->options['id'], 'data-slide-to' => $i); + if ($i === 0) { + $this->addCssClass($options, 'active'); + } + $indicators[] = Html::tag('li', '', $options); + } + return Html::tag('ol', implode("\n", $indicators), array('class' => 'carousel-indicators')); + } + + /** + * Renders carousel items as specified on [[items]]. + * @return string the rendering result + */ + public function renderItems() + { + $items = array(); + for ($i = 0, $count = count($this->items); $i < $count; $i++) { + $items[] = $this->renderItem($this->items[$i], $i); + } + return Html::tag('div', implode("\n", $items), array('class' => 'carousel-inner')); + } + + /** + * Renders a single carousel item + * @param string|array $item a single item from [[items]] + * @param integer $index the item index as the first item should be set to `active` + * @return string the rendering result + * @throws InvalidConfigException if the item is invalid + */ + public function renderItem($item, $index) + { + if (is_string($item)) { + $content = $item; + $caption = null; + $options = array(); + } elseif (isset($item['content'])) { + $content = $item['content']; + $caption = ArrayHelper::getValue($item, 'caption'); + if ($caption !== null) { + $caption = Html::tag('div', $caption, array('class' => 'carousel-caption')); + } + $options = ArrayHelper::getValue($item, 'options', array()); + } else { + throw new InvalidConfigException('The "content" option is required.'); + } + + $this->addCssClass($options, 'item'); + if ($index === 0) { + $this->addCssClass($options, 'active'); + } + + return Html::tag('div', $content . "\n" . $caption, $options); + } + + /** + * Renders previous and next control buttons. + * @throws InvalidConfigException if [[controls]] is invalid. + */ + public function renderControls() + { + if (isset($this->controls[0], $this->controls[1])) { + return Html::a($this->controls[0], '#' . $this->options['id'], array( + 'class' => 'left carousel-control', + 'data-slide' => 'prev', + )) . "\n" + . Html::a($this->controls[1], '#' . $this->options['id'], array( + 'class' => 'right carousel-control', + 'data-slide' => 'next', + )); + } elseif ($this->controls === false) { + return ''; + } else { + throw new InvalidConfigException('The "controls" property must be either false or an array of two elements.'); + } + } +} diff --git a/framework/yii/bootstrap/Collapse.php b/framework/yii/bootstrap/Collapse.php new file mode 100644 index 0000000..d83df3c --- /dev/null +++ b/framework/yii/bootstrap/Collapse.php @@ -0,0 +1,133 @@ + array( + * // equivalent to the above + * 'Collapsible Group Item #1' => array( + * 'content' => 'Anim pariatur cliche...', + * // open its content by default + * 'contentOptions' => array('class'=>'in') + * ), + * // another group item + * 'Collapsible Group Item #2' => array( + * 'content' => 'Anim pariatur cliche...', + * 'contentOptions' => array(...), + * 'options' => array(...), + * ), + * ) + * )); + * ``` + * + * @see http://twitter.github.io/bootstrap/javascript.html#collapse + * @author Antonio Ramirez + * @since 2.0 + */ +class Collapse extends Widget +{ + /** + * @var array list of groups in the collapse widget. Each array element represents a single + * group with the following structure: + * + * ```php + * // item key is the actual group header + * 'Collapsible Group Item #1' => array( + * // required, the content (HTML) of the group + * 'content' => 'Anim pariatur cliche...', + * // optional the HTML attributes of the content group + * 'contentOptions'=> array(), + * // optional the HTML attributes of the group + * 'options'=> array(), + * ) + * ``` + */ + public $items = array(); + + + /** + * Initializes the widget. + */ + public function init() + { + parent::init(); + $this->addCssClass($this->options, 'accordion'); + } + + /** + * Renders the widget. + */ + public function run() + { + echo Html::beginTag('div', $this->options) . "\n"; + echo $this->renderItems() . "\n"; + echo Html::endTag('div') . "\n"; + $this->registerPlugin('collapse'); + } + + /** + * Renders collapsible items as specified on [[items]]. + * @return string the rendering result + */ + public function renderItems() + { + $items = array(); + $index = 0; + foreach ($this->items as $header => $item) { + $options = ArrayHelper::getValue($item, 'options', array()); + $this->addCssClass($options, 'accordion-group'); + $items[] = Html::tag('div', $this->renderItem($header, $item, ++$index), $options); + } + + return implode("\n", $items); + } + + /** + * Renders a single collapsible item group + * @param string $header a label of the item group [[items]] + * @param array $item a single item from [[items]] + * @param integer $index the item index as each item group content must have an id + * @return string the rendering result + * @throws InvalidConfigException + */ + public function renderItem($header, $item, $index) + { + if (isset($item['content'])) { + $id = $this->options['id'] . '-collapse' . $index; + $options = ArrayHelper::getValue($item, 'contentOptions', array()); + $options['id'] = $id; + $this->addCssClass($options, 'accordion-body collapse'); + + $header = Html::a($header, '#' . $id, array( + 'class' => 'accordion-toggle', + 'data-toggle' => 'collapse', + 'data-parent' => '#' . $this->options['id'] + )) . "\n"; + + $content = Html::tag('div', $item['content'], array('class' => 'accordion-inner')) . "\n"; + } else { + throw new InvalidConfigException('The "content" option is required.'); + } + $group = array(); + + $group[] = Html::tag('div', $header, array('class' => 'accordion-heading')); + $group[] = Html::tag('div', $content, $options); + + return implode("\n", $group); + } +} \ No newline at end of file diff --git a/framework/yii/bootstrap/Modal.php b/framework/yii/bootstrap/Modal.php index 1a70209..0608fbe 100644 --- a/framework/yii/bootstrap/Modal.php +++ b/framework/yii/bootstrap/Modal.php @@ -14,18 +14,6 @@ use yii\helpers\Html; /** * Modal renders a modal window that can be toggled by clicking on a button. * - * For example, - * - * ~~~php - * echo Modal::widget(array( - * 'header' => '

Hello world

', - * 'body' => 'Say hello...', - * 'toggleButton' => array( - * 'label' => 'click me', - * ), - * )); - * ~~~ - * * The following example will show the content enclosed between the [[begin()]] * and [[end()]] calls within the modal window: * @@ -54,12 +42,6 @@ class Modal extends Widget */ public $header; /** - * @var string the body content in the modal window. Note that anything between - * the [[begin()]] and [[end()]] calls of the Modal widget will also be treated - * as the body content, and will be rendered before this. - */ - public $body; - /** * @var string the footer content in the modal window. */ public $footer; @@ -154,7 +136,7 @@ class Modal extends Widget */ protected function renderBodyEnd() { - return $this->body . "\n" . Html::endTag('div'); + return Html::endTag('div'); } /** @@ -217,9 +199,9 @@ class Modal extends Widget ), $this->options); $this->addCssClass($this->options, 'modal'); - $this->pluginOptions = array_merge(array( + $this->clientOptions = array_merge(array( 'show' => false, - ), $this->pluginOptions); + ), $this->clientOptions); if ($this->closeButton !== null) { $this->closeButton = array_merge(array( diff --git a/framework/yii/bootstrap/TypeAhead.php b/framework/yii/bootstrap/TypeAhead.php index 4aee46a..0704404 100644 --- a/framework/yii/bootstrap/TypeAhead.php +++ b/framework/yii/bootstrap/TypeAhead.php @@ -19,10 +19,9 @@ use yii\helpers\Html; * * ```php * echo TypeAhead::widget(array( - * 'form' => $form, * 'model' => $model, * 'attribute' => 'country', - * 'pluginOptions' => array( + * 'clientOptions' => array( * 'source' => array('USA', 'ESP'), * ), * )); @@ -33,7 +32,7 @@ use yii\helpers\Html; * ```php * echo TypeAhead::widget(array( * 'name' => 'country', - * 'pluginOptions' => array( + * 'clientOptions' => array( * 'source' => array('USA', 'ESP'), * ), * )); @@ -77,8 +76,8 @@ class TypeAhead extends Widget * If [[model]] is null or not from an [[Model]] instance, then the field will be rendered according to * the [[name]] attribute. * @return string the rendering result - * @throws InvalidConfigException when none of the required attributes are set to render the textInput. That is, - * if [[model]] and [[attribute]] are not set, then [[name]] is required. + * @throws InvalidConfigException when none of the required attributes are set to render the textInput. + * That is, if [[model]] and [[attribute]] are not set, then [[name]] is required. */ public function renderField() { @@ -87,7 +86,7 @@ class TypeAhead extends Widget } elseif ($this->name !== null) { return Html::textInput($this->name, $this->value, $this->options); } else { - throw new InvalidConfigException('Either "name" or "model" and "attribute" properties must be specified.'); + throw new InvalidConfigException("Either 'name' or 'model' and 'attribute' properties must be specified."); } } } diff --git a/framework/yii/bootstrap/Widget.php b/framework/yii/bootstrap/Widget.php index c607485..a2e6d77 100644 --- a/framework/yii/bootstrap/Widget.php +++ b/framework/yii/bootstrap/Widget.php @@ -35,14 +35,14 @@ class Widget extends \yii\base\Widget * For example, [this page](http://twitter.github.io/bootstrap/javascript.html#modals) shows * how to use the "Modal" plugin and the supported options (e.g. "remote"). */ - public $pluginOptions = array(); + public $clientOptions = array(); /** * @var array the event handlers for the underlying Bootstrap JS plugin. * Please refer to the corresponding Bootstrap plugin Web page for possible events. * For example, [this page](http://twitter.github.io/bootstrap/javascript.html#modals) shows * how to use the "Modal" plugin and the supported events (e.g. "shown"). */ - public $pluginEvents = array(); + public $clientEvents = array(); /** @@ -69,15 +69,15 @@ class Widget extends \yii\base\Widget $view->registerAssetBundle(static::$responsive ? 'yii/bootstrap/responsive' : 'yii/bootstrap'); $view->registerAssetBundle("yii/bootstrap/$name"); - if ($this->pluginOptions !== false) { - $options = empty($this->pluginOptions) ? '' : Json::encode($this->pluginOptions); + if ($this->clientOptions !== false) { + $options = empty($this->clientOptions) ? '' : Json::encode($this->clientOptions); $js = "jQuery('#$id').$name($options);"; $view->registerJs($js); } - if (!empty($this->pluginEvents)) { + if (!empty($this->clientEvents)) { $js = array(); - foreach ($this->pluginEvents as $event => $handler) { + foreach ($this->clientEvents as $event => $handler) { $js[] = "jQuery('#$id').on('$event', $handler);"; } $view->registerJs(implode("\n", $js)); diff --git a/framework/yii/console/Application.php b/framework/yii/console/Application.php index 31580e8..58c2de4 100644 --- a/framework/yii/console/Application.php +++ b/framework/yii/console/Application.php @@ -127,7 +127,6 @@ class Application extends \yii\base\Application 'message' => 'yii\console\controllers\MessageController', 'help' => 'yii\console\controllers\HelpController', 'migrate' => 'yii\console\controllers\MigrateController', - 'app' => 'yii\console\controllers\AppController', 'cache' => 'yii\console\controllers\CacheController', 'asset' => 'yii\console\controllers\AssetController', ); diff --git a/framework/yii/console/Controller.php b/framework/yii/console/Controller.php index fe32daa..22ec39f 100644 --- a/framework/yii/console/Controller.php +++ b/framework/yii/console/Controller.php @@ -36,12 +36,35 @@ class Controller extends \yii\base\Controller public $interactive = true; /** - * @var bool whether to enable ANSI style in output. + * @var boolean whether to enable ANSI style in output. + * Defaults to null meaning auto-detect. + */ + private $_colors; + + /** + * Whether to enable ANSI style in output. + * * Setting this will affect [[ansiFormat()]], [[stdout()]] and [[stderr()]]. * If not set it will be auto detected using [[yii\helpers\Console::streamSupportsAnsiColors()]] with STDOUT * for [[ansiFormat()]] and [[stdout()]] and STDERR for [[stderr()]]. + * @param resource $stream + * @return boolean Whether to enable ANSI style in output. + */ + public function getColors($stream = STDOUT) + { + if ($this->_colors === null) { + return Console::streamSupportsAnsiColors($stream); + } + return $this->_colors; + } + + /** + * Whether to enable ANSI style in output. */ - public $colors; + public function setColors($value) + { + $this->_colors = (bool) $value; + } /** * Runs an action with the specified action ID and parameters. @@ -138,7 +161,7 @@ class Controller extends \yii\base\Controller */ public function ansiFormat($string) { - if ($this->ansi === true || $this->ansi === null && Console::streamSupportsAnsiColors(STDOUT)) { + if ($this->getColors()) { $args = func_get_args(); array_shift($args); $string = Console::ansiFormat($string, $args); @@ -162,7 +185,7 @@ class Controller extends \yii\base\Controller */ public function stdout($string) { - if ($this->ansi === true || $this->ansi === null && Console::streamSupportsAnsiColors(STDOUT)) { + if ($this->getColors()) { $args = func_get_args(); array_shift($args); $string = Console::ansiFormat($string, $args); @@ -186,7 +209,7 @@ class Controller extends \yii\base\Controller */ public function stderr($string) { - if ($this->ansi === true || $this->ansi === null && Console::streamSupportsAnsiColors(STDERR)) { + if ($this->getColors(STDERR)) { $args = func_get_args(); array_shift($args); $string = Console::ansiFormat($string, $args); @@ -259,6 +282,6 @@ class Controller extends \yii\base\Controller */ public function globalOptions() { - return array(); + return array('colors', 'interactive'); } } diff --git a/framework/yii/console/Request.php b/framework/yii/console/Request.php index d1a6aa6..a9a4b03 100644 --- a/framework/yii/console/Request.php +++ b/framework/yii/console/Request.php @@ -15,9 +15,32 @@ class Request extends \yii\base\Request { const ANONYMOUS_PARAMS = '-args'; - public function getRawParams() + private $_params; + + /** + * Returns the command line arguments. + * @return array the command line arguments. It does not include the entry script name. + */ + public function getParams() + { + if (!isset($this->_params)) { + if (isset($_SERVER['argv'])) { + $this->_params = $_SERVER['argv']; + array_shift($this->_params); + } else { + $this->_params = array(); + } + } + return $this->_params; + } + + /** + * Sets the command line arguments. + * @param array $params the command line arguments + */ + public function setParams($params) { - return isset($_SERVER['argv']) ? $_SERVER['argv'] : array(); + $this->_params = $params; } /** @@ -26,9 +49,7 @@ class Request extends \yii\base\Request */ public function resolve() { - $rawParams = $this->getRawParams(); - array_shift($rawParams); // the 1st argument is the yii script name - + $rawParams = $this->getParams(); if (isset($rawParams[0])) { $route = $rawParams[0]; array_shift($rawParams); diff --git a/framework/yii/console/controllers/AppController.php b/framework/yii/console/controllers/AppController.php deleted file mode 100644 index 6baf019..0000000 --- a/framework/yii/console/controllers/AppController.php +++ /dev/null @@ -1,316 +0,0 @@ - - * @author Alexander Makarov - * @since 2.0 - */ -class AppController extends Controller -{ - private $_rootPath; - private $_config; - - /** - * @var string custom template path. If specified, templates will be - * searched there additionally to `framework/console/webapp`. - */ - public $templatesPath; - - /** - * @var string application type. If not specified default application - * skeleton will be used. - */ - public $type = 'default'; - - public function init() - { - parent::init(); - - if ($this->templatesPath && !is_dir($this->templatesPath)) { - throw new Exception('--templatesPath "'.$this->templatesPath.'" does not exist or can not be read.'); - } - } - - public function globalOptions() - { - return array('templatesPath', 'type'); - } - - public function actionIndex() - { - $this->forward('help/index', array('-args' => array('app/create'))); - } - - /** - * Generates Yii application at the path specified via appPath parameter. - * - * @param string $path the directory where the new application will be created. - * If the directory does not exist, it will be created. After the application - * is created, please make sure the directory has enough permissions. - * - * @throws \yii\base\Exception if path specified is not valid - * @return integer the exit status - */ - public function actionCreate($path) - { - $path = strtr($path, '/\\', DIRECTORY_SEPARATOR); - if (strpos($path, DIRECTORY_SEPARATOR) === false) { - $path = '.'.DIRECTORY_SEPARATOR.$path; - } - $dir = rtrim(realpath(dirname($path)), '\\/'); - if ($dir === false || !is_dir($dir)) { - throw new Exception("The directory '$path' is not valid. Please make sure the parent directory exists."); - } - - if (basename($path) === '.') { - $this->_rootPath = $path = $dir; - } else { - $this->_rootPath = $path = $dir.DIRECTORY_SEPARATOR.basename($path); - } - - if ($this->confirm("Create \"$this->type\" application under '$path'?")) { - $sourceDir = $this->getSourceDir(); - $config = $this->getConfig(); - - $list = $this->buildFileList($sourceDir, $path); - - if (is_array($config)) { - foreach ($config as $file => $settings) { - if (isset($settings['handler'])) { - $list[$file]['callback'] = $settings['handler']; - } - } - } - - $this->copyFiles($list); - - if (is_array($config)) { - foreach ($config as $file => $settings) { - if (isset($settings['permissions'])) { - @chmod($path.'/'.$file, $settings['permissions']); - } - } - } - - echo "\nYour application has been created successfully under {$path}.\n"; - } - } - - /** - * @throws \yii\base\Exception if source directory wasn't located - * @return string - */ - protected function getSourceDir() - { - $customSource = realpath($this->templatesPath.'/'.$this->type); - $defaultSource = realpath($this->getDefaultTemplatesPath().'/'.$this->type); - - if ($customSource) { - return $customSource; - } elseif ($defaultSource) { - return $defaultSource; - } else { - throw new Exception('Unable to locate the source directory for "'.$this->type.'".'); - } - } - - /** - * @return string default templates path - */ - protected function getDefaultTemplatesPath() - { - return realpath(__DIR__.'/../webapp'); - } - - /** - * @return array|null template configuration - */ - protected function getConfig() - { - if ($this->_config === null) { - $this->_config = require $this->getDefaultTemplatesPath() . '/config.php'; - if ($this->templatesPath && file_exists($this->templatesPath)) { - $this->_config = array_merge($this->_config, require $this->templatesPath . '/config.php'); - } - } - if (isset($this->_config[$this->type])) { - return $this->_config[$this->type]; - } - } - - /** - * @param string $source path to source file - * @param string $pathTo path to file we want to get relative path for - * @param string $varName variable name w/o $ to replace value with relative path for - * - * @return string target file contents - */ - public function replaceRelativePath($source, $pathTo, $varName) - { - $content = file_get_contents($source); - $relativeFile = str_replace($this->getSourceDir(), '', $source); - - $relativePath = $this->getRelativePath($pathTo, $this->_rootPath.$relativeFile); - $relativePath = str_replace('\\', '\\\\', $relativePath); - - return preg_replace('/\$'.$varName.'\s*=(.*?);/', "\$".$varName."=$relativePath;", $content); - } - - /** - * @param string $path1 absolute path - * @param string $path2 absolute path - * - * @return string relative path - */ - protected function getRelativePath($path1, $path2) - { - $segs1 = explode(DIRECTORY_SEPARATOR, $path1); - $segs2 = explode(DIRECTORY_SEPARATOR, $path2); - $n1 = count($segs1); - $n2 = count($segs2); - - for ($i = 0; $i < $n1 && $i < $n2; ++$i) { - if ($segs1[$i] !== $segs2[$i]) { - break; - } - } - - if ($i === 0) { - return "'" . $path1 . "'"; - } - $up = ''; - for ($j = $i; $j < $n2 - 1; ++$j) { - $up .= '/..'; - } - for(; $i < $n1 - 1; ++$i) { - $up .= '/' . $segs1[$i]; - } - - return '__DIR__.\'' . $up . '/' . basename($path1) . '\''; - } - - - /** - * Copies a list of files from one place to another. - * @param array $fileList the list of files to be copied (name => spec). - * The array keys are names displayed during the copy process, and array values are specifications - * for files to be copied. Each array value must be an array of the following structure: - *
    - *
  • source: required, the full path of the file/directory to be copied from
  • - *
  • target: required, the full path of the file/directory to be copied to
  • - *
  • callback: optional, the callback to be invoked when copying a file. The callback function - * should be declared as follows: - *
    -	 *   function foo($source, $params)
    -	 *   
    - * where $source parameter is the source file path, and the content returned - * by the function will be saved into the target file.
  • - *
  • params: optional, the parameters to be passed to the callback
  • - *
- * @see buildFileList - */ - protected function copyFiles($fileList) - { - $overwriteAll = false; - foreach ($fileList as $name => $file) { - $source = strtr($file['source'], '/\\', DIRECTORY_SEPARATOR); - $target = strtr($file['target'], '/\\', DIRECTORY_SEPARATOR); - $callback = isset($file['callback']) ? $file['callback'] : null; - $params = isset($file['params']) ? $file['params'] : null; - - if (is_dir($source)) { - if (!is_dir($target)) { - mkdir($target, 0777, true); - } - continue; - } - - if ($callback !== null) { - $content = call_user_func($callback, $source, $params); - } else { - $content = file_get_contents($source); - } - if (is_file($target)) { - if ($content === file_get_contents($target)) { - echo " unchanged $name\n"; - continue; - } - if ($overwriteAll) { - echo " overwrite $name\n"; - } - else { - echo " exist $name\n"; - echo " ...overwrite? [Yes|No|All|Quit] "; - $answer = trim(fgets(STDIN)); - if (!strncasecmp($answer, 'q', 1)) { - return; - } elseif (!strncasecmp($answer, 'y', 1)) { - echo " overwrite $name\n"; - } elseif (!strncasecmp($answer, 'a', 1)) { - echo " overwrite $name\n"; - $overwriteAll = true; - } else { - echo " skip $name\n"; - continue; - } - } - } - else { - if (!is_dir(dirname($target))) { - mkdir(dirname($target), 0777, true); - } - echo " generate $name\n"; - } - file_put_contents($target, $content); - } - } - - /** - * Builds the file list of a directory. - * This method traverses through the specified directory and builds - * a list of files and subdirectories that the directory contains. - * The result of this function can be passed to {@link copyFiles}. - * @param string $sourceDir the source directory - * @param string $targetDir the target directory - * @param string $baseDir base directory - * @param array $ignoreFiles list of the names of files that should - * be ignored in list building process. - * @param array $renameMap hash array of file names that should be - * renamed. Example value: array('1.old.txt' => '2.new.txt'). - * @return array the file list (see {@link copyFiles}) - */ - protected function buildFileList($sourceDir, $targetDir, $baseDir='', $ignoreFiles=array(), $renameMap=array()) - { - $list = array(); - $handle = opendir($sourceDir); - while (($file = readdir($handle)) !== false) { - if (in_array($file, array('.', '..', '.svn', '.gitignore', '.hgignore')) || in_array($file, $ignoreFiles)) { - continue; - } - $sourcePath = $sourceDir.DIRECTORY_SEPARATOR.$file; - $targetPath = $targetDir.DIRECTORY_SEPARATOR.strtr($file, $renameMap); - $name = $baseDir === '' ? $file : $baseDir.'/'.$file; - $list[$name] = array( - 'source' => $sourcePath, - 'target' => $targetPath, - ); - if (is_dir($sourcePath)) { - $list = array_merge($list, self::buildFileList($sourcePath, $targetPath, $name, $ignoreFiles, $renameMap)); - } - } - closedir($handle); - return $list; - } -} diff --git a/framework/yii/console/controllers/HelpController.php b/framework/yii/console/controllers/HelpController.php index c40ea66..9319163 100644 --- a/framework/yii/console/controllers/HelpController.php +++ b/framework/yii/console/controllers/HelpController.php @@ -13,7 +13,8 @@ use yii\base\InlineAction; use yii\console\Controller; use yii\console\Exception; use yii\console\Request; -use yii\helpers\StringHelper; +use yii\helpers\Console; +use yii\helpers\Inflector; /** * This command provides help information about console commands. @@ -56,7 +57,7 @@ class HelpController extends Controller $result = Yii::$app->createController($command); if ($result === false) { throw new Exception(Yii::t('yii', 'No help for unknown command "{command}".', array( - '{command}' => $command, + '{command}' => $this->ansiFormat($command, Console::FG_YELLOW), ))); } @@ -96,7 +97,7 @@ class HelpController extends Controller foreach ($class->getMethods() as $method) { $name = $method->getName(); if ($method->isPublic() && !$method->isStatic() && strpos($name, 'action') === 0 && $name !== 'actions') { - $actions[] = StringHelper::camel2id(substr($name, 6)); + $actions[] = Inflector::camel2id(substr($name, 6)); } } sort($actions); @@ -143,14 +144,15 @@ class HelpController extends Controller { $commands = $this->getCommands(); if (!empty($commands)) { - echo "The following commands are available:\n\n"; + $this->stdout("\nThe following commands are available:\n\n", Console::BOLD); foreach ($commands as $command) { - echo "* $command\n"; + echo "- " . $this->ansiFormat($command, Console::FG_YELLOW) . "\n"; } - echo "\nTo see the help of each command, enter:\n"; - echo "\n yii help \n\n"; + $this->stdout("\nTo see the help of each command, enter:\n", Console::BOLD); + echo "\n yii " . $this->ansiFormat('help', Console::FG_YELLOW) . ' ' + . $this->ansiFormat('', Console::FG_CYAN) . "\n\n"; } else { - echo "\nNo commands are found.\n"; + $this->stdout("\nNo commands are found.\n\n", Console::BOLD); } } @@ -167,19 +169,18 @@ class HelpController extends Controller } if ($comment !== '') { - echo "\nDESCRIPTION\n"; - echo "\n" . $comment . "\n\n"; + $this->stdout("\nDESCRIPTION\n", Console::BOLD); + echo "\n" . Console::renderColoredString($comment) . "\n\n"; } $actions = $this->getActions($controller); if (!empty($actions)) { - echo "\nSUB-COMMANDS\n\n"; + $this->stdout("\nSUB-COMMANDS\n\n", Console::BOLD); $prefix = $controller->getUniqueId(); foreach ($actions as $action) { + echo '- ' . $this->ansiFormat($prefix.'/'.$action, Console::FG_YELLOW); if ($action === $controller->defaultAction) { - echo "* $prefix/$action (default)"; - } else { - echo "* $prefix/$action"; + $this->stdout(' (default)', Console::FG_GREEN); } $summary = $this->getActionSummary($controller, $action); if ($summary !== '') { @@ -187,8 +188,9 @@ class HelpController extends Controller } echo "\n"; } - echo "\n\nTo see the detailed information about individual sub-commands, enter:\n"; - echo "\n yii help \n\n"; + echo "\nTo see the detailed information about individual sub-commands, enter:\n"; + echo "\n yii " . $this->ansiFormat('help', Console::FG_YELLOW) . ' ' + . $this->ansiFormat('', Console::FG_CYAN) . "\n\n"; } } @@ -253,25 +255,25 @@ class HelpController extends Controller $options = $this->getOptionHelps($controller); if ($tags['description'] !== '') { - echo "\nDESCRIPTION"; - echo "\n\n" . $tags['description'] . "\n\n"; + $this->stdout("\nDESCRIPTION\n", Console::BOLD); + echo "\n" . Console::renderColoredString($tags['description']) . "\n\n"; } - echo "\nUSAGE\n\n"; + $this->stdout("\nUSAGE\n\n", Console::BOLD); if ($action->id === $controller->defaultAction) { - echo 'yii ' . $controller->getUniqueId(); + echo 'yii ' . $this->ansiFormat($controller->getUniqueId(), Console::FG_YELLOW); } else { - echo "yii " . $action->getUniqueId(); + echo 'yii ' . $this->ansiFormat($action->getUniqueId(), Console::FG_YELLOW); } list ($required, $optional) = $this->getArgHelps($method, isset($tags['param']) ? $tags['param'] : array()); - if (!empty($required)) { - echo ' <' . implode('> <', array_keys($required)) . '>'; + foreach ($required as $arg => $description) { + $this->stdout(' <' . $arg . '>', Console::FG_CYAN); } - if (!empty($optional)) { - echo ' [' . implode('] [', array_keys($optional)) . ']'; + foreach ($optional as $arg => $description) { + $this->stdout(' [' . $arg . ']', Console::FG_CYAN); } if (!empty($options)) { - echo ' [...options...]'; + $this->stdout(' [...options...]', Console::FG_RED); } echo "\n\n"; @@ -281,7 +283,7 @@ class HelpController extends Controller $options = $this->getOptionHelps($controller); if (!empty($options)) { - echo "\nOPTIONS\n\n"; + $this->stdout("\nOPTIONS\n\n", Console::BOLD); echo implode("\n\n", $options) . "\n\n"; } } @@ -310,9 +312,9 @@ class HelpController extends Controller $comment = $tag; } if ($param->isDefaultValueAvailable()) { - $optional[$name] = $this->formatOptionHelp('* ' . $name, false, $type, $param->getDefaultValue(), $comment); + $optional[$name] = $this->formatOptionHelp('- ' . $this->ansiFormat($name, Console::FG_CYAN), false, $type, $param->getDefaultValue(), $comment); } else { - $required[$name] = $this->formatOptionHelp('* ' . $name, true, $type, null, $comment); + $required[$name] = $this->formatOptionHelp('- ' . $this->ansiFormat($name, Console::FG_CYAN), true, $type, null, $comment); } } @@ -352,9 +354,9 @@ class HelpController extends Controller $type = null; $comment = $doc; } - $options[$name] = $this->formatOptionHelp('--' . $name, false, $type, $defaultValue, $comment); + $options[$name] = $this->formatOptionHelp($this->ansiFormat('--' . $name, Console::FG_RED), false, $type, $defaultValue, $comment); } else { - $options[$name] = $this->formatOptionHelp('--' . $name, false, null, $defaultValue, ''); + $options[$name] = $this->formatOptionHelp($this->ansiFormat('--' . $name, Console::FG_RED), false, null, $defaultValue, ''); } } ksort($options); diff --git a/framework/yii/console/controllers/MigrateController.php b/framework/yii/console/controllers/MigrateController.php index 0acc672..b437450 100644 --- a/framework/yii/console/controllers/MigrateController.php +++ b/framework/yii/console/controllers/MigrateController.php @@ -115,11 +115,13 @@ class MigrateController extends Controller } $this->migrationPath = $path; - if (is_string($this->db)) { - $this->db = Yii::$app->getComponent($this->db); - } - if (!$this->db instanceof Connection) { - throw new Exception("The 'db' option must refer to the application component ID of a DB connection."); + if($action->id!=='create') { + if (is_string($this->db)) { + $this->db = Yii::$app->getComponent($this->db); + } + if (!$this->db instanceof Connection) { + throw new Exception("The 'db' option must refer to the application component ID of a DB connection."); + } } $version = Yii::getVersion(); diff --git a/framework/yii/db/ActiveRecord.php b/framework/yii/db/ActiveRecord.php index 2b7d2b8..dd90782 100644 --- a/framework/yii/db/ActiveRecord.php +++ b/framework/yii/db/ActiveRecord.php @@ -18,6 +18,7 @@ use yii\db\Connection; use yii\db\TableSchema; use yii\db\Expression; use yii\helpers\StringHelper; +use yii\helpers\Inflector; /** * ActiveRecord is the base class for classes representing relational data in terms of objects. @@ -261,14 +262,14 @@ class ActiveRecord extends Model /** * Declares the name of the database table associated with this AR class. - * By default this method returns the class name as the table name by calling [[StringHelper::camel2id()]] + * By default this method returns the class name as the table name by calling [[Inflector::camel2id()]] * with prefix 'tbl_'. For example, 'Customer' becomes 'tbl_customer', and 'OrderItem' becomes * 'tbl_order_item'. You may override this method if the table is not named after this convention. * @return string the table name */ public static function tableName() { - return 'tbl_' . StringHelper::camel2id(StringHelper::basename(get_called_class()), '_'); + return 'tbl_' . Inflector::camel2id(StringHelper::basename(get_called_class()), '_'); } /** diff --git a/framework/yii/db/mssql/Schema.php b/framework/yii/db/mssql/Schema.php index c52dfc3..1991542 100644 --- a/framework/yii/db/mssql/Schema.php +++ b/framework/yii/db/mssql/Schema.php @@ -156,14 +156,14 @@ class Schema extends \yii\db\Schema { $column = new ColumnSchema(); - $column->name = $info['COLUMN_NAME']; - $column->allowNull = $info['IS_NULLABLE'] == 'YES'; - $column->dbType = $info['DATA_TYPE']; + $column->name = $info['column_name']; + $column->allowNull = $info['is_nullable'] == 'YES'; + $column->dbType = $info['data_type']; $column->enumValues = array(); // mssql has only vague equivalents to enum $column->isPrimaryKey = null; // primary key will be determined in findColumns() method - $column->autoIncrement = $info['IsIdentity'] == 1; + $column->autoIncrement = $info['is_identity'] == 1; $column->unsigned = stripos($column->dbType, 'unsigned') !== false; - $column->comment = $info['Comment'] === null ? '' : $column['Comment']; + $column->comment = $info['comment'] === null ? '' : $info['comment']; $column->type = self::TYPE_STRING; if (preg_match('/^(\w+)(?:\(([^\)]+)\))?/', $column->dbType, $matches)) { @@ -191,11 +191,11 @@ class Schema extends \yii\db\Schema $column->phpType = $this->getColumnPhpType($column); - if ($info['COLUMN_DEFAULT'] == '(NULL)') { - $info['COLUMN_DEFAULT'] = null; + if ($info['column_default'] == '(NULL)') { + $info['column_default'] = null; } - if ($column->type !== 'timestamp' || $info['COLUMN_DEFAULT'] !== 'CURRENT_TIMESTAMP') { - $column->defaultValue = $column->typecast($info['COLUMN_DEFAULT']); + if ($column->type !== 'timestamp' || $info['column_default'] !== 'CURRENT_TIMESTAMP') { + $column->defaultValue = $column->typecast($info['column_default']); } return $column; @@ -221,9 +221,9 @@ class Schema extends \yii\db\Schema $sql = << true, * )); * ``` @@ -29,6 +29,6 @@ namespace yii\helpers; * @author Alexander Makarov * @since 2.0 */ -class Purifier extends base\Purifier +class HtmlPurifier extends base\HtmlPurifier { } diff --git a/framework/yii/helpers/Inflector.php b/framework/yii/helpers/Inflector.php new file mode 100644 index 0000000..72f77a7 --- /dev/null +++ b/framework/yii/helpers/Inflector.php @@ -0,0 +1,18 @@ + + * @since 2.0 + */ +class Inflector extends base\Inflector +{ +} diff --git a/framework/yii/helpers/base/Console.php b/framework/yii/helpers/base/Console.php index b611919..c8b89c4 100644 --- a/framework/yii/helpers/base/Console.php +++ b/framework/yii/helpers/base/Console.php @@ -45,6 +45,7 @@ class Console const BG_CYAN = 46; const BG_GREY = 47; + const RESET = 0; const NORMAL = 0; const BOLD = 1; const ITALIC = 3; @@ -240,34 +241,41 @@ class Console } /** - * Sets the ANSI format for any text that is printed afterwards. + * Returns the ANSI format code. * - * You can pass any of the FG_*, BG_* and TEXT_* constants and also [[xterm256ColorFg]] and [[xterm256ColorBg]]. + * @param array $format You can pass any of the FG_*, BG_* and TEXT_* constants and also [[xtermFgColor]] and [[xtermBgColor]]. * TODO: documentation + * @return string */ - public static function ansiFormatBegin() + public static function ansiFormatCode($format) { - echo "\033[" . implode(';', func_get_args()) . 'm'; + return "\033[" . implode(';', $format) . 'm'; } /** - * Resets any ANSI format set by previous method [[ansiFormatBegin()]] - * Any output after this is will have default text style. + * Sets the ANSI format for any text that is printed afterwards. + * + * @param array $format You can pass any of the FG_*, BG_* and TEXT_* constants and also [[xtermFgColor]] and [[xtermBgColor]]. + * TODO: documentation + * @see ansiFormatEnd() */ - public static function ansiFormatReset() + public static function beginAnsiFormat($format) { - echo "\033[0m"; + echo "\033[" . implode(';', $format) . 'm'; } /** - * Returns the ANSI format code. + * Resets any ANSI format set by previous method [[ansiFormatBegin()]] + * Any output after this is will have default text style. + * This is equal to * - * You can pass any of the FG_*, BG_* and TEXT_* constants and also [[xterm256ColorFg]] and [[xterm256ColorBg]]. - * TODO: documentation + * ```php + * echo Console::ansiFormatCode(array(Console::RESET)) + * ``` */ - public static function ansiFormatCode($format) + public static function endAnsiFormat() { - return "\033[" . implode(';', $format) . 'm'; + echo "\033[0m"; } /** @@ -275,7 +283,7 @@ class Console * * @param string $string the string to be formatted * @param array $format array containing formatting values. - * You can pass any of the FG_*, BG_* and TEXT_* constants and also [[xterm256ColorFg]] and [[xterm256ColorBg]]. + * You can pass any of the FG_*, BG_* and TEXT_* constants and also [[xtermFgColor]] and [[xtermBgColor]]. * @return string */ public static function ansiFormat($string, $format=array()) @@ -284,15 +292,32 @@ class Console return "\033[0m" . ($code !== '' ? "\033[" . $code . "m" : '') . $string . "\033[0m"; } - //const COLOR_XTERM256 = 38;// http://en.wikipedia.org/wiki/Talk:ANSI_escape_code#xterm-256colors - public static function xterm256ColorFg($i) // TODO naming! + /** + * Returns the ansi format code for xterm foreground color. + * You can pass the returnvalue of this to one of the formatting methods: + * [[ansiFormat]], [[ansiFormatCode]], [[beginAnsiFormat]] + * + * @param integer $colorCode xterm color code + * @return string + * @see http://en.wikipedia.org/wiki/Talk:ANSI_escape_code#xterm-256colors + */ + public static function xtermFgColor($colorCode) { - return '38;5;' . $i; + return '38;5;' . $colorCode; } - public static function xterm256ColorBg($i) // TODO naming! + /** + * Returns the ansi format code for xterm foreground color. + * You can pass the returnvalue of this to one of the formatting methods: + * [[ansiFormat]], [[ansiFormatCode]], [[beginAnsiFormat]] + * + * @param integer $colorCode xterm color code + * @return string + * @see http://en.wikipedia.org/wiki/Talk:ANSI_escape_code#xterm-256colors + */ + public static function xtermBgColor($colorCode) { - return '48;5;' . $i; + return '48;5;' . $colorCode; } /** @@ -303,7 +328,7 @@ class Console */ public static function stripAnsiFormat($string) { - return preg_replace('/\033\[[\d;]+m/', '', $string); // TODO currently only strips color + return preg_replace('/\033\[[\d;?]*\w/', '', $string); } // TODO refactor and review @@ -418,10 +443,11 @@ class Console } /** - * TODO syntax copied from https://github.com/pear/Console_Color2/blob/master/Console/Color2.php + * Converts a string to ansi formatted by replacing patterns like %y (for yellow) with ansi control codes * - * Converts colorcodes in the format %y (for yellow) into ansi-control - * codes. The conversion table is: ('bold' meaning 'light' on some + * // TODO documentation + * Uses almost the same syntax as https://github.com/pear/Console_Color2/blob/master/Console/Color2.php + * The conversion table is: ('bold' meaning 'light' on some * terminals). It's almost the same conversion table irssi uses. *
 	 *                  text      text            background
@@ -450,7 +476,6 @@ class Console
 	 *
 	 * @param string $string  String to convert
 	 * @param bool   $colored Should the string be colored?
-	 *
 	 * @return string
 	 */
 	public static function renderColoredString($string, $colored = true)
@@ -508,22 +533,23 @@ class Console
 	}
 
 	/**
-	* Escapes % so they don't get interpreted as color codes
-	*
-	* @param string $string String to escape
-	*
-	* @access public
-	* @return string
-	*/
+	 * Escapes % so they don't get interpreted as color codes when
+	 * the string is parsed by [[renderColoredString]]
+	 *
+	 * @param string $string String to escape
+	 *
+	 * @access public
+	 * @return string
+	 */
 	public static function escape($string)
 	{
 		return str_replace('%', '%%', $string);
 	}
 
 	/**
-	 * Returns true if the stream supports colorization. ANSI colors is disabled if not supported by the stream.
+	 * Returns true if the stream supports colorization. ANSI colors are disabled if not supported by the stream.
 	 *
-	 * - windows without asicon
+	 * - windows without ansicon
 	 * - not tty consoles
 	 *
 	 * @param mixed $stream
@@ -532,7 +558,7 @@ class Console
 	public static function streamSupportsAnsiColors($stream)
 	{
 		return DIRECTORY_SEPARATOR == '\\'
-			? null !== getenv('ANSICON')
+			? getenv('ANSICON') !== false || getenv('ConEmuANSI') === 'ON'
 			: function_exists('posix_isatty') && @posix_isatty($stream);
 	}
 
@@ -542,18 +568,47 @@ class Console
 	 */
 	public static function isRunningOnWindows()
 	{
-		return strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
+		return DIRECTORY_SEPARATOR == '\\';
 	}
 
 	/**
 	 * Usage: list($w, $h) = ConsoleHelper::getScreenSize();
 	 *
-	 * @return array
+	 * @return array|boolean An array of ($width, $height) or false when it was not able to determine size.
 	 */
-	public static function getScreenSize()
+	public static function getScreenSize($refresh = false)
 	{
-		// TODO implement
-		return array(150, 50);
+		static $size;
+		if ($size !== null && !$refresh) {
+			return $size;
+		}
+
+		if (static::isRunningOnWindows()) {
+			$output = array();
+			exec('mode con', $output);
+			if(isset($output) && strpos($output[1], 'CON')!==false) {
+				return $size = array((int)preg_replace('~[^0-9]~', '', $output[3]), (int)preg_replace('~[^0-9]~', '', $output[4]));
+			}
+		} else {
+
+			// try stty if available
+			$stty = array();
+			if (exec('stty -a 2>&1', $stty) && preg_match('/rows\s+(\d+);\s*columns\s+(\d+);/mi', implode(' ', $stty), $matches)) {
+				return $size = array($matches[2], $matches[1]);
+			}
+
+			// fallback to tput, which may not be updated on terminal resize
+			if (($width = (int) exec('tput cols 2>&1')) > 0 && ($height = (int) exec('tput lines 2>&1')) > 0) {
+				return $size = array($width, $height);
+			}
+
+			// fallback to ENV variables, which may not be updated on terminal resize
+			if (($width = (int) getenv('COLUMNS')) > 0 && ($height = (int) getenv('LINES')) > 0) {
+				return $size = array($width, $height);
+			}
+		}
+
+		return $size = false;
 	}
 
 	/**
@@ -607,27 +662,23 @@ class Console
 	/**
 	 * Prints text to STDOUT appended with a carriage return (PHP_EOL).
 	 *
-	 * @param string $text
-	 * @param bool $raw
-	 *
+	 * @param string $string
 	 * @return mixed Number of bytes printed or bool false on error
 	 */
-	public static function output($text = null)
+	public static function output($string = null)
 	{
-		return static::stdout($text . PHP_EOL);
+		return static::stdout($string . PHP_EOL);
 	}
 
 	/**
 	 * Prints text to STDERR appended with a carriage return (PHP_EOL).
 	 *
-	 * @param string $text
-	 * @param bool   $raw
-	 *
+	 * @param string $string
 	 * @return mixed Number of bytes printed or false on error
 	 */
-	public static function error($text = null)
+	public static function error($string = null)
 	{
-		return static::stderr($text . PHP_EOL);
+		return static::stderr($string . PHP_EOL);
 	}
 
 	/**
diff --git a/framework/yii/helpers/base/Html.php b/framework/yii/helpers/base/Html.php
index f601772..90396ec 100644
--- a/framework/yii/helpers/base/Html.php
+++ b/framework/yii/helpers/base/Html.php
@@ -1364,7 +1364,7 @@ class Html
 			return Yii::$app->getRequest()->getUrl();
 		} else {
 			$url = Yii::getAlias($url);
-			if ($url[0] === '/' || strpos($url, '://')) {
+			if ($url[0] === '/' || $url[0] === '#' || strpos($url, '://')) {
 				return $url;
 			} else {
 				return Yii::$app->getRequest()->getBaseUrl() . '/' . $url;
diff --git a/framework/yii/helpers/base/Purifier.php b/framework/yii/helpers/base/HtmlPurifier.php
similarity index 53%
rename from framework/yii/helpers/base/Purifier.php
rename to framework/yii/helpers/base/HtmlPurifier.php
index 2c5d334..70fb6bd 100644
--- a/framework/yii/helpers/base/Purifier.php
+++ b/framework/yii/helpers/base/HtmlPurifier.php
@@ -7,28 +7,14 @@
 namespace yii\helpers\base;
 
 /**
- * Purifier provides an ability to clean up HTML from any harmful code.
+ * HtmlPurifier is the concrete implementation of the [[yii\helpers\HtmlPurifier]] class.
  *
- * Basic usage is the following:
- *
- * ```php
- * $my_html = Purifier::process($my_text);
- * ```
- *
- * If you want to configure it:
- *
- * ```php
- * $my_html = Purifier::process($my_text, array(
- *     'Attr.EnableID' => true,
- * ));
- * ```
- *
- * For more details please refer to HTMLPurifier documentation](http://htmlpurifier.org/).
+ * You should use [[yii\helpers\HtmlPurifier]] instead of this class in your application.
  *
  * @author Alexander Makarov 
  * @since 2.0
  */
-class Purifier
+class HtmlPurifier
 {
 	public static function process($content, $config = null)
 	{
diff --git a/framework/yii/helpers/base/Inflector.php b/framework/yii/helpers/base/Inflector.php
new file mode 100644
index 0000000..cc5d33f
--- /dev/null
+++ b/framework/yii/helpers/base/Inflector.php
@@ -0,0 +1,478 @@
+
+ * @since 2.0
+ */
+class Inflector
+{
+	/**
+	 * @var array the rules for converting a word into its plural form.
+	 * The keys are the regular expressions and the values are the corresponding replacements.
+	 */
+	public static $plurals = array(
+		'/([nrlm]ese|deer|fish|sheep|measles|ois|pox|media)$/i' => '\1',
+		'/^(sea[- ]bass)$/i' => '\1',
+		'/(m)ove$/i' => '\1oves',
+		'/(f)oot$/i' => '\1eet',
+		'/(h)uman$/i' => '\1umans',
+		'/(s)tatus$/i' => '\1tatuses',
+		'/(s)taff$/i' => '\1taff',
+		'/(t)ooth$/i' => '\1eeth',
+		'/(quiz)$/i' => '\1zes',
+		'/^(ox)$/i' => '\1\2en',
+		'/([m|l])ouse$/i' => '\1ice',
+		'/(matr|vert|ind)(ix|ex)$/i' => '\1ices',
+		'/(x|ch|ss|sh)$/i' => '\1es',
+		'/([^aeiouy]|qu)y$/i' => '\1ies',
+		'/(hive)$/i' => '\1s',
+		'/(?:([^f])fe|([lr])f)$/i' => '\1\2ves',
+		'/sis$/i' => 'ses',
+		'/([ti])um$/i' => '\1a',
+		'/(p)erson$/i' => '\1eople',
+		'/(m)an$/i' => '\1en',
+		'/(c)hild$/i' => '\1hildren',
+		'/(buffal|tomat|potat|ech|her|vet)o$/i' => '\1oes',
+		'/(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|vir)us$/i' => '\1i',
+		'/us$/i' => 'uses',
+		'/(alias)$/i' => '\1es',
+		'/(ax|cris|test)is$/i' => '\1es',
+		'/s$/' => 's',
+		'/^$/' => '',
+		'/$/' => 's',		
+	);
+	/**
+	 * @var array the rules for converting a word into its singular form.
+	 * The keys are the regular expressions and the values are the corresponding replacements.
+	 */
+	public static $singulars = array(
+		'/([nrlm]ese|deer|fish|sheep|measles|ois|pox|media|ss)$/i' => '\1',
+		'/^(sea[- ]bass)$/i' => '\1',
+		'/(s)tatuses$/i' => '\1tatus',
+		'/(f)eet$/i' => '\1oot',
+		'/(t)eeth$/i' => '\1ooth',
+		'/^(.*)(menu)s$/i' => '\1\2',
+		'/(quiz)zes$/i' => '\\1',
+		'/(matr)ices$/i' => '\1ix',
+		'/(vert|ind)ices$/i' => '\1ex',
+		'/^(ox)en/i' => '\1',
+		'/(alias)(es)*$/i' => '\1',
+		'/(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|viri?)i$/i' => '\1us',
+		'/([ftw]ax)es/i' => '\1',
+		'/(cris|ax|test)es$/i' => '\1is',
+		'/(shoe|slave)s$/i' => '\1',
+		'/(o)es$/i' => '\1',
+		'/ouses$/' => 'ouse',
+		'/([^a])uses$/' => '\1us',
+		'/([m|l])ice$/i' => '\1ouse',
+		'/(x|ch|ss|sh)es$/i' => '\1',
+		'/(m)ovies$/i' => '\1\2ovie',
+		'/(s)eries$/i' => '\1\2eries',
+		'/([^aeiouy]|qu)ies$/i' => '\1y',
+		'/([lr])ves$/i' => '\1f',
+		'/(tive)s$/i' => '\1',
+		'/(hive)s$/i' => '\1',
+		'/(drive)s$/i' => '\1',
+		'/([^fo])ves$/i' => '\1fe',
+		'/(^analy)ses$/i' => '\1sis',
+		'/(analy|diagno|^ba|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis',
+		'/([ti])a$/i' => '\1um',
+		'/(p)eople$/i' => '\1\2erson',
+		'/(m)en$/i' => '\1an',
+		'/(c)hildren$/i' => '\1\2hild',
+		'/(n)ews$/i' => '\1\2ews',
+		'/eaus$/' => 'eau',
+		'/^(.*us)$/' => '\\1',
+		'/s$/i' => '',		
+	);
+	/**
+	 * @var array the special rules for converting a word between its plural form and singular form.
+	 * The keys are the special words in singular form, and the values are the corresponding plural form.
+	 */
+	public static $specials = array(
+		'atlas' => 'atlases',
+		'beef' => 'beefs',
+		'brother' => 'brothers',
+		'cafe' => 'cafes',
+		'child' => 'children',
+		'cookie' => 'cookies',
+		'corpus' => 'corpuses',
+		'cow' => 'cows',
+		'curve' => 'curves',
+		'foe' => 'foes',
+		'ganglion' => 'ganglions',
+		'genie' => 'genies',
+		'genus' => 'genera',
+		'graffito' => 'graffiti',
+		'hoof' => 'hoofs',
+		'loaf' => 'loaves',
+		'man' => 'men',
+		'money' => 'monies',
+		'mongoose' => 'mongooses',
+		'move' => 'moves',
+		'mythos' => 'mythoi',
+		'niche' => 'niches',
+		'numen' => 'numina',
+		'occiput' => 'occiputs',
+		'octopus' => 'octopuses',
+		'opus' => 'opuses',
+		'ox' => 'oxen',
+		'penis' => 'penises',
+		'sex' => 'sexes',
+		'soliloquy' => 'soliloquies',
+		'testis' => 'testes',
+		'trilby' => 'trilbys',
+		'turf' => 'turfs',
+		'wave' => 'waves',
+		'Amoyese' => 'Amoyese',
+		'bison' => 'bison',
+		'Borghese' => 'Borghese',
+		'bream' => 'bream',
+		'breeches' => 'breeches',
+		'britches' => 'britches',
+		'buffalo' => 'buffalo',
+		'cantus' => 'cantus',
+		'carp' => 'carp',
+		'chassis' => 'chassis',
+		'clippers' => 'clippers',
+		'cod' => 'cod',
+		'coitus' => 'coitus',
+		'Congoese' => 'Congoese',
+		'contretemps' => 'contretemps',
+		'corps' => 'corps',
+		'debris' => 'debris',
+		'diabetes' => 'diabetes',
+		'djinn' => 'djinn',
+		'eland' => 'eland',
+		'elk' => 'elk',
+		'equipment' => 'equipment',
+		'Faroese' => 'Faroese',
+		'flounder' => 'flounder',
+		'Foochowese' => 'Foochowese',
+		'gallows' => 'gallows',
+		'Genevese' => 'Genevese',
+		'Genoese' => 'Genoese',
+		'Gilbertese' => 'Gilbertese',
+		'graffiti' => 'graffiti',
+		'headquarters' => 'headquarters',
+		'herpes' => 'herpes',
+		'hijinks' => 'hijinks',
+		'Hottentotese' => 'Hottentotese',
+		'information' => 'information',
+		'innings' => 'innings',
+		'jackanapes' => 'jackanapes',
+		'Kiplingese' => 'Kiplingese',
+		'Kongoese' => 'Kongoese',
+		'Lucchese' => 'Lucchese',
+		'mackerel' => 'mackerel',
+		'Maltese' => 'Maltese',
+		'mews' => 'mews',
+		'moose' => 'moose',
+		'mumps' => 'mumps',
+		'Nankingese' => 'Nankingese',
+		'news' => 'news',
+		'nexus' => 'nexus',
+		'Niasese' => 'Niasese',
+		'Pekingese' => 'Pekingese',
+		'Piedmontese' => 'Piedmontese',
+		'pincers' => 'pincers',
+		'Pistoiese' => 'Pistoiese',
+		'pliers' => 'pliers',
+		'Portuguese' => 'Portuguese',
+		'proceedings' => 'proceedings',
+		'rabies' => 'rabies',
+		'rice' => 'rice',
+		'rhinoceros' => 'rhinoceros',
+		'salmon' => 'salmon',
+		'Sarawakese' => 'Sarawakese',
+		'scissors' => 'scissors',
+		'series' => 'series',
+		'Shavese' => 'Shavese',
+		'shears' => 'shears',
+		'siemens' => 'siemens',
+		'species' => 'species',
+		'swine' => 'swine',
+		'testes' => 'testes',
+		'trousers' => 'trousers',
+		'trout' => 'trout',
+		'tuna' => 'tuna',
+		'Vermontese' => 'Vermontese',
+		'Wenchowese' => 'Wenchowese',
+		'whiting' => 'whiting',
+		'wildebeest' => 'wildebeest',
+		'Yengeese' => 'Yengeese',
+	);
+	/**
+	 * @var array map of special chars and its translation. This is used by [[slug()]].
+	 */
+	public static $transliteration = array(
+		'/ä|æ|ǽ/' => 'ae',
+		'/ö|œ/' => 'oe',
+		'/ü/' => 'ue',
+		'/Ä/' => 'Ae',
+		'/Ü/' => 'Ue',
+		'/Ö/' => 'Oe',
+		'/À|Á|Â|Ã|Å|Ǻ|Ā|Ă|Ą|Ǎ/' => 'A',
+		'/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª/' => 'a',
+		'/Ç|Ć|Ĉ|Ċ|Č/' => 'C',
+		'/ç|ć|ĉ|ċ|č/' => 'c',
+		'/Ð|Ď|Đ/' => 'D',
+		'/ð|ď|đ/' => 'd',
+		'/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě/' => 'E',
+		'/è|é|ê|ë|ē|ĕ|ė|ę|ě/' => 'e',
+		'/Ĝ|Ğ|Ġ|Ģ/' => 'G',
+		'/ĝ|ğ|ġ|ģ/' => 'g',
+		'/Ĥ|Ħ/' => 'H',
+		'/ĥ|ħ/' => 'h',
+		'/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ/' => 'I',
+		'/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı/' => 'i',
+		'/Ĵ/' => 'J',
+		'/ĵ/' => 'j',
+		'/Ķ/' => 'K',
+		'/ķ/' => 'k',
+		'/Ĺ|Ļ|Ľ|Ŀ|Ł/' => 'L',
+		'/ĺ|ļ|ľ|ŀ|ł/' => 'l',
+		'/Ñ|Ń|Ņ|Ň/' => 'N',
+		'/ñ|ń|ņ|ň|ʼn/' => 'n',
+		'/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ/' => 'O',
+		'/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º/' => 'o',
+		'/Ŕ|Ŗ|Ř/' => 'R',
+		'/ŕ|ŗ|ř/' => 'r',
+		'/Ś|Ŝ|Ş|Ș|Š/' => 'S',
+		'/ś|ŝ|ş|ș|š|ſ/' => 's',
+		'/Ţ|Ț|Ť|Ŧ/' => 'T',
+		'/ţ|ț|ť|ŧ/' => 't',
+		'/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ/' => 'U',
+		'/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ/' => 'u',
+		'/Ý|Ÿ|Ŷ/' => 'Y',
+		'/ý|ÿ|ŷ/' => 'y',
+		'/Ŵ/' => 'W',
+		'/ŵ/' => 'w',
+		'/Ź|Ż|Ž/' => 'Z',
+		'/ź|ż|ž/' => 'z',
+		'/Æ|Ǽ/' => 'AE',
+		'/ß/' => 'ss',
+		'/IJ/' => 'IJ',
+		'/ij/' => 'ij',
+		'/Œ/' => 'OE',
+		'/ƒ/' => 'f'
+	);
+
+	/**
+	 * Converts a word to its plural form.
+	 * Note that this is for English only!
+	 * For example, 'apple' will become 'apples', and 'child' will become 'children'.
+	 * @param string $word the word to be pluralized
+	 * @return string the pluralized word
+	 */
+	public static function pluralize($word)
+	{
+		if (isset(self::$specials[$word])) {
+			return self::$specials[$word];
+		}
+		foreach (static::$plurals as $rule => $replacement) {
+			if (preg_match($rule, $word)) {
+				return preg_replace($rule, $replacement, $word);
+			}
+		}
+		return $word;
+	}
+
+	/**
+	 * Returns the singular of the $word
+	 * @param string $word the english word to singularize
+	 * @return string Singular noun.
+	 */
+	public static function singularize($word)
+	{
+		$result = array_search($word, self::$specials, true);
+		if ($result !== false) {
+			return $result;
+		}
+		foreach (static::$singulars as $rule => $replacement) {
+			if (preg_match($rule, $word)) {
+				return preg_replace($rule, $replacement, $word);
+			}
+		}
+		return $word;
+	}
+
+	/**
+	 * Converts an underscored or CamelCase word into a English
+	 * sentence.
+	 * @param string $words
+	 * @param bool $ucAll whether to set all words to uppercase
+	 * @return string
+	 */
+	public static function titleize($words, $ucAll = false)
+	{
+		$words = static::humanize(static::underscore($words), $ucAll);
+		return $ucAll ? ucwords($words) : ucfirst($words);
+	}
+
+	/**
+	 * Returns given word as CamelCased
+	 * Converts a word like "send_email" to "SendEmail". It
+	 * will remove non alphanumeric character from the word, so
+	 * "who's online" will be converted to "WhoSOnline"
+	 * @see variablize
+	 * @param string $word the word to CamelCase
+	 * @return string
+	 */
+	public static function camelize($word)
+	{
+		return str_replace(' ', '', ucwords(preg_replace('/[^A-Z^a-z^0-9]+/', ' ', $word)));
+	}
+
+	/**
+	 * Converts a CamelCase name into space-separated words.
+	 * For example, 'PostTag' will be converted to 'Post Tag'.
+	 * @param string $name the string to be converted
+	 * @param boolean $ucwords whether to capitalize the first letter in each word
+	 * @return string the resulting words
+	 */
+	public static function camel2words($name, $ucwords = true)
+	{
+		$label = trim(strtolower(str_replace(array(
+			'-',
+			'_',
+			'.'
+		), ' ', preg_replace('/(? ' ',
+				'/\\s+/' => $replacement,
+				'/(?<=[a-z])([A-Z])/' => $replacement . '\\1',
+				str_replace(':rep', preg_quote($replacement, '/'), '/^[:rep]+|[:rep]+$/') => ''
+			);
+		return preg_replace(array_keys($map), array_values($map), $string);
+	}
+
+	/**
+	 * Converts a table name to its class name. For example, converts "people" to "Person"
+	 * @param string $table_name
+	 * @return string
+	 */
+	public static function classify($table_name)
+	{
+		return static::camelize(static::singularize($table_name));
+	}
+
+	/**
+	 * Converts number to its ordinal English form. For example, converts 13 to 13th, 2 to 2nd ...
+	 * @param int $number the number to get its ordinal value
+	 * @return string
+	 */
+	public static function ordinalize($number)
+	{
+		if (in_array(($number % 100), range(11, 13))) {
+			return $number . 'th';
+		}
+		switch (($number % 10)) {
+			case 1: return $number . 'st';
+			case 2: return $number . 'nd';
+			case 3: return $number . 'rd';
+			default: return $number . 'th';
+		}
+	}
+}
diff --git a/framework/yii/helpers/base/StringHelper.php b/framework/yii/helpers/base/StringHelper.php
index 646bcbb..5b854ac 100644
--- a/framework/yii/helpers/base/StringHelper.php
+++ b/framework/yii/helpers/base/StringHelper.php
@@ -65,84 +65,4 @@ class StringHelper
 		}
 		return $path;
 	}
-
-	/**
-	 * Converts a word to its plural form.
-	 * Note that this is for English only!
-	 * For example, 'apple' will become 'apples', and 'child' will become 'children'.
-	 * @param string $name the word to be pluralized
-	 * @return string the pluralized word
-	 */
-	public static function pluralize($name)
-	{
-		static $rules = array(
-			'/(m)ove$/i' => '\1oves',
-			'/(f)oot$/i' => '\1eet',
-			'/(c)hild$/i' => '\1hildren',
-			'/(h)uman$/i' => '\1umans',
-			'/(m)an$/i' => '\1en',
-			'/(s)taff$/i' => '\1taff',
-			'/(t)ooth$/i' => '\1eeth',
-			'/(p)erson$/i' => '\1eople',
-			'/([m|l])ouse$/i' => '\1ice',
-			'/(x|ch|ss|sh|us|as|is|os)$/i' => '\1es',
-			'/([^aeiouy]|qu)y$/i' => '\1ies',
-			'/(?:([^f])fe|([lr])f)$/i' => '\1\2ves',
-			'/(shea|lea|loa|thie)f$/i' => '\1ves',
-			'/([ti])um$/i' => '\1a',
-			'/(tomat|potat|ech|her|vet)o$/i' => '\1oes',
-			'/(bu)s$/i' => '\1ses',
-			'/(ax|test)is$/i' => '\1es',
-			'/s$/' => 's',
-		);
-		foreach ($rules as $rule => $replacement) {
-			if (preg_match($rule, $name)) {
-				return preg_replace($rule, $replacement, $name);
-			}
-		}
-		return $name . 's';
-	}
-
-	/**
-	 * Converts a CamelCase name into space-separated words.
-	 * For example, 'PostTag' will be converted to 'Post Tag'.
-	 * @param string $name the string to be converted
-	 * @param boolean $ucwords whether to capitalize the first letter in each word
-	 * @return string the resulting words
-	 */
-	public static function camel2words($name, $ucwords = true)
-	{
-		$label = trim(strtolower(str_replace(array('-', '_', '.'), ' ', preg_replace('/(? array(
+ *         array(
+ *             'header' => 'Section 1',
+ *             'content' => 'Mauris mauris ante, blandit et, ultrices a, suscipit eget...',
+ *         ),
+ *         array(
+ *             'header' => 'Section 2',
+ *             'headerOptions' => array(...),
+ *             'content' => 'Sed non urna. Phasellus eu ligula. Vestibulum sit amet purus...',
+ *             'options' => array(...),
+ *         ),
+ *     ),
+ * ));
+ * ```
+ *
+ * @see http://api.jqueryui.com/accordion/
+ * @author Alexander Kochetov 
+ * @since 2.0
+ */
+class Accordion extends Widget
+{
+	/**
+	 * @var array list of sections in the accordion widget. Each array element represents a single
+	 * section with the following structure:
+	 *
+	 * ```php
+	 * array(
+	 *     // required, the header (HTML) of the section
+	 *     'header' => 'Section label',
+	 *     // required, the content (HTML) of the section
+	 *     'content' => 'Mauris mauris ante, blandit et, ultrices a, suscipit eget...',
+	 *     // optional the HTML attributes of the section content container
+	 *     'options'=> array(...),
+	 *     // optional the HTML attributes of the section header container
+	 *     'headerOptions'=> array(...),
+	 * )
+	 * ```
+	 */
+	public $items = array();
+
+
+	/**
+	 * Renders the widget.
+	 */
+	public function run()
+	{
+		echo Html::beginTag('div', $this->options) . "\n";
+		echo $this->renderSections() . "\n";
+		echo Html::endTag('div') . "\n";
+		$this->registerWidget('accordion');
+	}
+
+	/**
+	 * Renders collapsible sections as specified on [[items]].
+	 * @return string the rendering result.
+	 * @throws InvalidConfigException.
+	 */
+	protected function renderSections()
+	{
+		$sections = array();
+		foreach ($this->items as $item) {
+			if (!isset($item['header'])) {
+				throw new InvalidConfigException("The 'header' option is required.");
+			}
+			if (!isset($item['content'])) {
+				throw new InvalidConfigException("The 'content' option is required.");
+			}
+			$headerOptions = ArrayHelper::getValue($item, 'headerOptions', array());
+			$sections[] = Html::tag('h3', $item['header'], $headerOptions);
+			$options = ArrayHelper::getValue($item, 'options', array());
+			$sections[] = Html::tag('div', $item['content'], $options);;
+		}
+
+		return implode("\n", $sections);
+	}
+}
diff --git a/framework/yii/jui/AutoComplete.php b/framework/yii/jui/AutoComplete.php
new file mode 100644
index 0000000..f5bbae9
--- /dev/null
+++ b/framework/yii/jui/AutoComplete.php
@@ -0,0 +1,92 @@
+ $model,
+ *     'attribute' => 'country',
+ *     'clientOptions' => array(
+ *         'source' => array('USA', 'RUS'),
+ *     ),
+ * ));
+ * ```
+ *
+ * The following example will use the name property instead:
+ *
+ * ```php
+ * echo AutoComplete::widget(array(
+ *     'name'  => 'country',
+ *     'clientOptions' => array(
+ *         'source' => array('USA', 'RUS'),
+ *     ),
+ * ));
+ *```
+ *
+ * @see http://api.jqueryui.com/autocomplete/
+ * @author Alexander Kochetov 
+ * @since 2.0
+ */
+class AutoComplete extends Widget
+{
+	/**
+	 * @var \yii\base\Model the data model that this widget is associated with.
+	 */
+	public $model;
+	/**
+	 * @var string the model attribute that this widget is associated with.
+	 */
+	public $attribute;
+	/**
+	 * @var string the input name. This must be set if [[model]] and [[attribute]] are not set.
+	 */
+	public $name;
+	/**
+	 * @var string the input value.
+	 */
+	public $value;
+
+
+	/**
+	 * Renders the widget.
+	 */
+	public function run()
+	{
+		echo $this->renderField();
+		$this->registerWidget('autocomplete');
+	}
+
+	/**
+	 * Renders the AutoComplete field. If [[model]] has been specified then it will render an active field.
+	 * If [[model]] is null or not from an [[Model]] instance, then the field will be rendered according to
+	 * the [[name]] attribute.
+	 * @return string the rendering result.
+	 * @throws InvalidConfigException when none of the required attributes are set to render the textInput.
+	 * That is, if [[model]] and [[attribute]] are not set, then [[name]] is required.
+	 */
+	public function renderField()
+	{
+		if ($this->model instanceof Model && $this->attribute !== null) {
+			return Html::activeTextInput($this->model, $this->attribute, $this->options);
+		} elseif ($this->name !== null) {
+			return Html::textInput($this->name, $this->value, $this->options);
+		} else {
+			throw new InvalidConfigException("Either 'name' or 'model' and 'attribute' properties must be specified.");
+		}
+	}
+}
diff --git a/framework/yii/jui/Dialog.php b/framework/yii/jui/Dialog.php
new file mode 100644
index 0000000..f4b3b12
--- /dev/null
+++ b/framework/yii/jui/Dialog.php
@@ -0,0 +1,52 @@
+ array(
+ *         'modal' => true,
+ *     ),
+ * ));
+ *
+ * echo 'Dialog contents here...';
+ *
+ * Dialog::end();
+ * ```
+ *
+ * @see http://api.jqueryui.com/dialog/
+ * @author Alexander Kochetov 
+ * @since 2.0
+ */
+class Dialog extends Widget
+{
+	/**
+	 * Initializes the widget.
+	 */
+	public function init()
+	{
+		parent::init();
+		echo Html::beginTag('div', $this->options) . "\n";
+	}
+
+	/**
+	 * Renders the widget.
+	 */
+	public function run()
+	{
+		echo Html::endTag('div') . "\n";
+		$this->registerWidget('dialog');
+	}
+}
diff --git a/framework/yii/jui/Menu.php b/framework/yii/jui/Menu.php
new file mode 100644
index 0000000..d4e390c
--- /dev/null
+++ b/framework/yii/jui/Menu.php
@@ -0,0 +1,85 @@
+
+ * @since 2.0
+ */
+class Menu extends \yii\widgets\Menu
+{
+	/**
+	 * @var array the options for the underlying jQuery UI widget.
+	 * Please refer to the corresponding jQuery UI widget Web page for possible options.
+	 * For example, [this page](http://api.jqueryui.com/accordion/) shows
+	 * how to use the "Accordion" widget and the supported options (e.g. "header").
+	 */
+	public $clientOptions = array();
+	/**
+	 * @var array the event handlers for the underlying jQuery UI widget.
+	 * Please refer to the corresponding jQuery UI widget Web page for possible events.
+	 * For example, [this page](http://api.jqueryui.com/accordion/) shows
+	 * how to use the "Accordion" widget and the supported events (e.g. "create").
+	 */
+	public $clientEvents = array();
+
+
+	/**
+	 * Initializes the widget.
+	 * If you override this method, make sure you call the parent implementation first.
+	 */
+	public function init()
+	{
+		parent::init();
+		if (!isset($this->options['id'])) {
+			$this->options['id'] = $this->getId();
+		}
+	}
+
+	/**
+	 * Renders the widget.
+	 */
+	public function run()
+	{
+		parent::run();
+		$this->registerWidget('menu');
+	}
+
+	/**
+	 * Registers a specific jQuery UI widget and the related events
+	 * @param string $name the name of the jQuery UI widget
+	 */
+	protected function registerWidget($name)
+	{
+		$id = $this->options['id'];
+		$view = $this->getView();
+		$view->registerAssetBundle("yii/jui/$name");
+		$view->registerAssetBundle(Widget::$theme . "/$name");
+
+		if ($this->clientOptions !== false) {
+			$options = empty($this->clientOptions) ? '' : Json::encode($this->clientOptions);
+			$js = "jQuery('#$id').$name($options);";
+			$view->registerJs($js);
+		}
+
+		if (!empty($this->clientEvents)) {
+			$js = array();
+			foreach ($this->clientEvents as $event => $handler) {
+				$js[] = "jQuery('#$id').on('$name$event', $handler);";
+			}
+			$view->registerJs(implode("\n", $js));
+		}
+	}
+}
diff --git a/framework/yii/jui/ProgressBar.php b/framework/yii/jui/ProgressBar.php
new file mode 100644
index 0000000..a7697e5
--- /dev/null
+++ b/framework/yii/jui/ProgressBar.php
@@ -0,0 +1,62 @@
+ array(
+ *         'value' => 75,
+ *     ),
+ * ));
+ * ```
+ *
+ * The following example will show the content enclosed between the [[begin()]]
+ * and [[end()]] calls within the widget container:
+ *
+ * ~~~php
+ * ProgressBar::widget(array(
+ *     'clientOptions' => array(
+ *         'value' => 75,
+ *     ),
+ * ));
+ *
+ * echo '
Loading...
'; + * + * ProgressBar::end(); + * ~~~ + * @see http://api.jqueryui.com/progressbar/ + * @author Alexander Kochetov + * @since 2.0 + */ +class ProgressBar extends Widget +{ + /** + * Initializes the widget. + */ + public function init() + { + parent::init(); + echo Html::beginTag('div', $this->options) . "\n"; + } + + /** + * Renders the widget. + */ + public function run() + { + echo Html::endTag('div') . "\n"; + $this->registerWidget('progressbar'); + } +} diff --git a/framework/yii/jui/Tabs.php b/framework/yii/jui/Tabs.php new file mode 100644 index 0000000..052ffe7 --- /dev/null +++ b/framework/yii/jui/Tabs.php @@ -0,0 +1,116 @@ + array( + * array( + * 'header' => 'One', + * 'content' => 'Mauris mauris ante, blandit et, ultrices a, suscipit eget...', + * ), + * array( + * 'header' => 'Two', + * 'headerOptions' => array(...), + * 'content' => 'Sed non urna. Phasellus eu ligula. Vestibulum sit amet purus...', + * 'options' => array(...), + * ), + * ), + * )); + * ``` + * + * @see http://api.jqueryui.com/tabs/ + * @author Alexander Kochetov + * @since 2.0 + */ +class Tabs extends Widget +{ + /** + * @var array list of tabs in the tabs widget. Each array element represents a single + * tab with the following structure: + * + * ```php + * array( + * // required, the header (HTML) of the tab + * 'header' => 'Tab label', + * // required, the content (HTML) of the tab + * 'content' => 'Mauris mauris ante, blandit et, ultrices a, suscipit eget...', + * // optional the HTML attributes of the tab content container + * 'options'=> array(...), + * // optional the HTML attributes of the tab header container + * 'headerOptions'=> array(...), + * ) + * ``` + */ + public $items = array(); + + + /** + * Renders the widget. + */ + public function run() + { + echo Html::beginTag('div', $this->options) . "\n"; + echo $this->renderHeaders() . "\n"; + echo $this->renderContents() . "\n"; + echo Html::endTag('div') . "\n"; + $this->registerWidget('tabs'); + } + + /** + * Renders tabs headers as specified on [[items]]. + * @return string the rendering result. + * @throws InvalidConfigException. + */ + protected function renderHeaders() + { + $headers = array(); + foreach ($this->items as $n => $item) { + if (!isset($item['header'])) { + throw new InvalidConfigException("The 'header' option is required."); + } + $options = ArrayHelper::getValue($item, 'options', array()); + $id = isset($options['id']) ? $options['id'] : $this->options['id'] . '-tab' . $n; + $headerOptions = ArrayHelper::getValue($item, 'headerOptions', array()); + $headers[] = Html::tag('li', Html::a($item['header'], "#$id"), $headerOptions); + } + + return Html::tag('ul', implode("\n", $headers)); + } + + /** + * Renders tabs contents as specified on [[items]]. + * @return string the rendering result. + * @throws InvalidConfigException. + */ + protected function renderContents() + { + $contents = array(); + foreach ($this->items as $n => $item) { + if (!isset($item['content'])) { + throw new InvalidConfigException("The 'content' option is required."); + } + $options = ArrayHelper::getValue($item, 'options', array()); + if (!isset($options['id'])) { + $options['id'] = $this->options['id'] . '-tab' . $n; + } + $contents[] = Html::tag('div', $item['content'], $options); + } + + return implode("\n", $contents); + } +} diff --git a/framework/yii/jui/Widget.php b/framework/yii/jui/Widget.php new file mode 100644 index 0000000..eea76d3 --- /dev/null +++ b/framework/yii/jui/Widget.php @@ -0,0 +1,83 @@ + + * @since 2.0 + */ +class Widget extends \yii\base\Widget +{ + /** + * @var string the jQuery UI theme bundle. + */ + public static $theme = 'yii/jui/theme/base'; + /** + * @var array the HTML attributes for the widget container tag. + */ + public $options = array(); + /** + * @var array the options for the underlying jQuery UI widget. + * Please refer to the corresponding jQuery UI widget Web page for possible options. + * For example, [this page](http://api.jqueryui.com/accordion/) shows + * how to use the "Accordion" widget and the supported options (e.g. "header"). + */ + public $clientOptions = array(); + /** + * @var array the event handlers for the underlying jQuery UI widget. + * Please refer to the corresponding jQuery UI widget Web page for possible events. + * For example, [this page](http://api.jqueryui.com/accordion/) shows + * how to use the "Accordion" widget and the supported events (e.g. "create"). + */ + public $clientEvents = array(); + + + /** + * Initializes the widget. + * If you override this method, make sure you call the parent implementation first. + */ + public function init() + { + parent::init(); + if (!isset($this->options['id'])) { + $this->options['id'] = $this->getId(); + } + } + + /** + * Registers a specific jQuery UI widget and the related events + * @param string $name the name of the jQuery UI widget + */ + protected function registerWidget($name) + { + $id = $this->options['id']; + $view = $this->getView(); + $view->registerAssetBundle("yii/jui/$name"); + $view->registerAssetBundle(static::$theme . "/$name"); + + if ($this->clientOptions !== false) { + $options = empty($this->clientOptions) ? '' : Json::encode($this->clientOptions); + $js = "jQuery('#$id').$name($options);"; + $view->registerJs($js); + } + + if (!empty($this->clientEvents)) { + $js = array(); + foreach ($this->clientEvents as $event => $handler) { + $js[] = "jQuery('#$id').on('$name$event', $handler);"; + } + $view->registerJs(implode("\n", $js)); + } + } +} diff --git a/framework/yii/jui/assets.php b/framework/yii/jui/assets.php new file mode 100644 index 0000000..d2d8f7c --- /dev/null +++ b/framework/yii/jui/assets.php @@ -0,0 +1,864 @@ + array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.core.js', + ), + 'depends' => array('yii/jquery'), + ), + 'yii/jui/widget' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.widget.js', + ), + 'depends' => array('yii/jquery'), + ), + 'yii/jui/accordion' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.accordion.js', + ), + 'depends' => array('yii/jui/core', 'yii/jui/widget', 'yii/jui/effect/all'), + ), + 'yii/jui/autocomplete' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.autocomplete.js', + ), + 'depends' => array('yii/jui/core', 'yii/jui/widget', 'yii/jui/position', 'yii/jui/menu'), + ), + 'yii/jui/button' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.button.js', + ), + 'depends' => array('yii/jui/core', 'yii/jui/widget'), + ), + 'yii/jui/datepicker' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.datepicker.js', + ), + 'depends' => array('yii/jui/core', 'yii/jui/effect/all'), + ), + 'yii/jui/datepicker/i18n/af' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-af.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/ar' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-ar.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/ar_DZ' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-ar-DZ.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/az' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-az.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/be' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-be.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/bg' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-bg.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/bs' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-bs.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/ca' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-ca.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/cs' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-cs.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/cy_GB' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-cy-GB.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/da' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-da.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/de' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-de.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/el' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-el.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/en_AU' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-en-AU.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/en_GB' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-en-GB.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/en_NZ' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-en-NZ.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/eo' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-eo.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/es' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-es.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/et' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-et.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/eu' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-eu.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/fa' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-fa.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/fi' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-fi.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/fo' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-fo.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/fr' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-fr.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/fr_CA' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-fr-CA.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/fr_CH' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-fr-CH.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/gl' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-gl.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/he' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-he.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/hi' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-hi.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/hr' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-hr.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/hu' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-hu.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/hy' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-hy.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/id' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-id.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/is' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-is.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/it' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-it.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/ja' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-ja.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/ka' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-ka.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/kk' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-kk.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/km' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-km.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/ko' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-ko.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/ky' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-ky.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/lb' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-lb.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/lt' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-lt.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/lv' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-lv.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/mk' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-mk.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/ml' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-ml.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-ms.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/nb' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-nb.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/nl' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-nl.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/nl_BE' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-nl-BE.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/nn' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-nn.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/no' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-no.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/pl' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-pl.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/pt' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-pt.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/pt_BR' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-pt-BR.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/rm' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-rm.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/ro' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-ro.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/ru' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-ru.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/sk' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-sk.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/sl' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-sl.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/sq' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-sq.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/sr' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-sr.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/sr_SR' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-sr-SR.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/sv' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-sv.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/ta' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-ta.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/th' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-th.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/tj' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-tj.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/tr' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-tr.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/uk' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-uk.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/vi' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-vi.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/zh_CN' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-zh-CN.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/zh_HK' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-zh-HK.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/datepicker/i18n/zh_TW' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'i18n/jquery.ui.datepicker-zh-TW.js', + ), + 'depends' => array('yii/jui/datepicker'), + ), + 'yii/jui/dialog' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.dialog.js', + ), + 'depends' => array('yii/jui/core', 'yii/jui/widget', 'yii/jui/button', 'yii/jui/draggable', 'yii/jui/mouse', 'yii/jui/position', 'yii/jui/resizable', 'yii/jui/effect/all'), + ), + 'yii/jui/draggable' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.draggable.js', + ), + 'depends' => array('yii/jui/core', 'yii/jui/widget', 'yii/jui/mouse'), + ), + 'yii/jui/droppable' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.droppable.js', + ), + 'depends' => array('yii/jui/draggable'), + ), + 'yii/jui/effect' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.effect.js', + ), + 'depends' => array('yii/jquery'), + ), + 'yii/jui/effect/all' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.effect.js', + ), + 'depends' => array('yii/jui/effect/blind', 'yii/jui/effect/bounce', 'yii/jui/effect/clip', 'yii/jui/effect/drop', 'yii/jui/effect/explode', 'yii/jui/effect/fade', 'yii/jui/effect/fold', 'yii/jui/effect/highlight', 'yii/jui/effect/pulsate', 'yii/jui/effect/scale', 'yii/jui/effect/shake', 'yii/jui/effect/slide', 'yii/jui/effect/transfer'), + ), + 'yii/jui/effect/blind' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.effect-blind.js', + ), + 'depends' => array('yii/jui/effect'), + ), + 'yii/jui/effect/bounce' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.effect-bounce.js', + ), + 'depends' => array('yii/jui/effect'), + ), + 'yii/jui/effect/clip' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.effect-clip.js', + ), + 'depends' => array('yii/jui/effect'), + ), + 'yii/jui/effect/drop' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.effect-drop.js', + ), + 'depends' => array('yii/jui/effect'), + ), + 'yii/jui/effect/explode' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.effect-explode.js', + ), + 'depends' => array('yii/jui/effect'), + ), + 'yii/jui/effect/fade' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.effect-fade.js', + ), + 'depends' => array('yii/jui/effect'), + ), + 'yii/jui/effect/fold' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.effect-fold.js', + ), + 'depends' => array('yii/jui/effect'), + ), + 'yii/jui/effect/highlight' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.effect-highlight.js', + ), + 'depends' => array('yii/jui/effect'), + ), + 'yii/jui/effect/pulsate' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.effect-pulsate.js', + ), + 'depends' => array('yii/jui/effect'), + ), + 'yii/jui/effect/scale' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.effect-scale.js', + ), + 'depends' => array('yii/jui/effect'), + ), + 'yii/jui/effect/shake' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.effect-shake.js', + ), + 'depends' => array('yii/jui/effect'), + ), + 'yii/jui/effect/slide' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.effect-slide.js', + ), + 'depends' => array('yii/jui/effect'), + ), + 'yii/jui/effect/transfer' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.effect-transfer.js', + ), + 'depends' => array('yii/jui/effect'), + ), + 'yii/jui/menu' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.menu.js', + ), + 'depends' => array('yii/jui/core', 'yii/jui/widget', 'yii/jui/position'), + ), + 'yii/jui/mouse' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.mouse.js', + ), + 'depends' => array('yii/jui/widget'), + ), + 'yii/jui/position' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.position.js', + ), + 'depends' => array('yii/jquery'), + ), + 'yii/jui/progressbar' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.progressbar.js', + ), + 'depends' => array('yii/jui/core', 'yii/jui/widget'), + ), + 'yii/jui/resizable' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.resizable.js', + ), + 'depends' => array('yii/jui/core', 'yii/jui/widget', 'yii/jui/mouse'), + ), + 'yii/jui/selectable' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.selectable.js', + ), + 'depends' => array('yii/jui/core', 'yii/jui/widget', 'yii/jui/mouse'), + ), + 'yii/jui/slider' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.slider.js', + ), + 'depends' => array('yii/jui/core', 'yii/jui/widget', 'yii/jui/mouse'), + ), + 'yii/jui/sortable' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.sortable.js', + ), + 'depends' => array('yii/jui/core', 'yii/jui/widget', 'yii/jui/mouse'), + ), + 'yii/jui/spinner' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.spinner.js', + ), + 'depends' => array('yii/jui/core', 'yii/jui/widget', 'yii/jui/button'), + ), + 'yii/jui/tabs' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.tabs.js', + ), + 'depends' => array('yii/jui/core', 'yii/jui/widget', 'yii/jui/effect/all'), + ), + 'yii/jui/tooltip' => array( + 'sourcePath' => __DIR__ . '/assets', + 'js' => array( + 'jquery.ui.tooltip.js', + ), + 'depends' => array('yii/jui/core', 'yii/jui/widget', 'yii/jui/position', 'yii/jui/effect/all'), + ), + 'yii/jui/theme/base' => array( + 'sourcePath' => __DIR__ . '/assets', + 'css' => array( + 'themes/base/jquery.ui.theme.css', + ), + ), + 'yii/jui/theme/base/core' => array( + 'sourcePath' => __DIR__ . '/assets', + 'css' => array( + 'themes/base/jquery.ui.core.css', + ), + 'depends' => array('yii/jui/theme/base'), + ), + 'yii/jui/theme/base/accordion' => array( + 'sourcePath' => __DIR__ . '/assets', + 'css' => array( + 'themes/base/jquery.ui.accordion.css', + ), + 'depends' => array('yii/jui/theme/base/core'), + ), + 'yii/jui/theme/base/autocomplete' => array( + 'sourcePath' => __DIR__ . '/assets', + 'css' => array( + 'themes/base/jquery.ui.autocomplete.css', + ), + 'depends' => array('yii/jui/theme/base/core', 'yii/jui/theme/base/menu'), + ), + 'yii/jui/theme/base/button' => array( + 'sourcePath' => __DIR__ . '/assets', + 'css' => array( + 'themes/base/jquery.ui.button.css', + ), + 'depends' => array('yii/jui/theme/base/core'), + ), + 'yii/jui/theme/base/datepicker' => array( + 'sourcePath' => __DIR__ . '/assets', + 'css' => array( + 'themes/base/jquery.ui.datepicker.css', + ), + 'depends' => array('yii/jui/theme/base/core'), + ), + 'yii/jui/theme/base/dialog' => array( + 'sourcePath' => __DIR__ . '/assets', + 'css' => array( + 'themes/base/jquery.ui.dialog.css', + ), + 'depends' => array('yii/jui/theme/base/core', 'yii/jui/theme/base/button', 'yii/jui/theme/base/resizable'), + ), + 'yii/jui/theme/base/menu' => array( + 'sourcePath' => __DIR__ . '/assets', + 'css' => array( + 'themes/base/jquery.ui.menu.css', + ), + 'depends' => array('yii/jui/theme/base/core'), + ), + 'yii/jui/theme/base/progressbar' => array( + 'sourcePath' => __DIR__ . '/assets', + 'css' => array( + 'themes/base/jquery.ui.progressbar.css', + ), + 'depends' => array('yii/jui/theme/base/core'), + ), + 'yii/jui/theme/base/resizable' => array( + 'sourcePath' => __DIR__ . '/assets', + 'css' => array( + 'themes/base/jquery.ui.resizable.css', + ), + 'depends' => array('yii/jui/theme/base/core'), + ), + 'yii/jui/theme/base/selectable' => array( + 'sourcePath' => __DIR__ . '/assets', + 'css' => array( + 'themes/base/jquery.ui.selectable.css', + ), + 'depends' => array('yii/jui/theme/base/core'), + ), + 'yii/jui/theme/base/slider' => array( + 'sourcePath' => __DIR__ . '/assets', + 'css' => array( + 'themes/base/jquery.ui.slider.css', + ), + 'depends' => array('yii/jui/theme/base/core'), + ), + 'yii/jui/theme/base/spinner' => array( + 'sourcePath' => __DIR__ . '/assets', + 'css' => array( + 'themes/base/jquery.ui.spinner.css', + ), + 'depends' => array('yii/jui/theme/base/core', 'yii/jui/theme/base/button'), + ), + 'yii/jui/theme/base/tabs' => array( + 'sourcePath' => __DIR__ . '/assets', + 'css' => array( + 'themes/base/jquery.ui.tabs.css', + ), + 'depends' => array('yii/jui/theme/base/core'), + ), + 'yii/jui/theme/base/tooltip' => array( + 'sourcePath' => __DIR__ . '/assets', + 'css' => array( + 'themes/base/jquery.ui.tooltip.css', + ), + 'depends' => array('yii/jui/theme/base/core'), + ), +); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-af.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-af.js new file mode 100644 index 0000000..0922ef7 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-af.js @@ -0,0 +1,23 @@ +/* Afrikaans initialisation for the jQuery UI date picker plugin. */ +/* Written by Renier Pretorius. */ +jQuery(function($){ + $.datepicker.regional['af'] = { + closeText: 'Selekteer', + prevText: 'Vorige', + nextText: 'Volgende', + currentText: 'Vandag', + monthNames: ['Januarie','Februarie','Maart','April','Mei','Junie', + 'Julie','Augustus','September','Oktober','November','Desember'], + monthNamesShort: ['Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun', + 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'], + dayNames: ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'], + dayNamesShort: ['Son', 'Maa', 'Din', 'Woe', 'Don', 'Vry', 'Sat'], + dayNamesMin: ['So','Ma','Di','Wo','Do','Vr','Sa'], + weekHeader: 'Wk', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['af']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ar-DZ.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ar-DZ.js new file mode 100644 index 0000000..7b175af --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ar-DZ.js @@ -0,0 +1,23 @@ +/* Algerian Arabic Translation for jQuery UI date picker plugin. (can be used for Tunisia)*/ +/* Mohamed Cherif BOUCHELAGHEM -- cherifbouchelaghem@yahoo.fr */ + +jQuery(function($){ + $.datepicker.regional['ar-DZ'] = { + closeText: 'إغلاق', + prevText: '<السابق', + nextText: 'التالي>', + currentText: 'اليوم', + monthNames: ['جانفي', 'فيفري', 'مارس', 'أفريل', 'ماي', 'جوان', + 'جويلية', 'أوت', 'سبتمبر','أكتوبر', 'نوفمبر', 'ديسمبر'], + monthNamesShort: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'], + dayNames: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + dayNamesShort: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + dayNamesMin: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + weekHeader: 'أسبوع', + dateFormat: 'dd/mm/yy', + firstDay: 6, + isRTL: true, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['ar-DZ']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ar.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ar.js new file mode 100644 index 0000000..cef0f08 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ar.js @@ -0,0 +1,23 @@ +/* Arabic Translation for jQuery UI date picker plugin. */ +/* Khaled Alhourani -- me@khaledalhourani.com */ +/* NOTE: monthNames are the original months names and they are the Arabic names, not the new months name فبراير - يناير and there isn't any Arabic roots for these months */ +jQuery(function($){ + $.datepicker.regional['ar'] = { + closeText: 'إغلاق', + prevText: '<السابق', + nextText: 'التالي>', + currentText: 'اليوم', + monthNames: ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'مايو', 'حزيران', + 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], + monthNamesShort: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'], + dayNames: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + dayNamesShort: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + dayNamesMin: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + weekHeader: 'أسبوع', + dateFormat: 'dd/mm/yy', + firstDay: 6, + isRTL: true, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['ar']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-az.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-az.js new file mode 100644 index 0000000..a133a9e --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-az.js @@ -0,0 +1,23 @@ +/* Azerbaijani (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Jamil Najafov (necefov33@gmail.com). */ +jQuery(function($) { + $.datepicker.regional['az'] = { + closeText: 'Bağla', + prevText: '<Geri', + nextText: 'İrəli>', + currentText: 'Bugün', + monthNames: ['Yanvar','Fevral','Mart','Aprel','May','İyun', + 'İyul','Avqust','Sentyabr','Oktyabr','Noyabr','Dekabr'], + monthNamesShort: ['Yan','Fev','Mar','Apr','May','İyun', + 'İyul','Avq','Sen','Okt','Noy','Dek'], + dayNames: ['Bazar','Bazar ertəsi','Çərşənbə axşamı','Çərşənbə','Cümə axşamı','Cümə','Şənbə'], + dayNamesShort: ['B','Be','Ça','Ç','Ca','C','Ş'], + dayNamesMin: ['B','B','Ç','С','Ç','C','Ş'], + weekHeader: 'Hf', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['az']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-be.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-be.js new file mode 100644 index 0000000..6ea12f7 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-be.js @@ -0,0 +1,23 @@ +/* Belarusian initialisation for the jQuery UI date picker plugin. */ +/* Written by Pavel Selitskas */ +jQuery(function($){ + $.datepicker.regional['be'] = { + closeText: 'Зачыніць', + prevText: '←Папяр.', + nextText: 'Наст.→', + currentText: 'Сёньня', + monthNames: ['Студзень','Люты','Сакавік','Красавік','Травень','Чэрвень', + 'Ліпень','Жнівень','Верасень','Кастрычнік','Лістапад','Сьнежань'], + monthNamesShort: ['Сту','Лют','Сак','Кра','Тра','Чэр', + 'Ліп','Жні','Вер','Кас','Ліс','Сьн'], + dayNames: ['нядзеля','панядзелак','аўторак','серада','чацьвер','пятніца','субота'], + dayNamesShort: ['ндз','пнд','аўт','срд','чцв','птн','сбт'], + dayNamesMin: ['Нд','Пн','Аў','Ср','Чц','Пт','Сб'], + weekHeader: 'Тд', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['be']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-bg.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-bg.js new file mode 100644 index 0000000..86ab885 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-bg.js @@ -0,0 +1,24 @@ +/* Bulgarian initialisation for the jQuery UI date picker plugin. */ +/* Written by Stoyan Kyosev (http://svest.org). */ +jQuery(function($){ + $.datepicker.regional['bg'] = { + closeText: 'затвори', + prevText: '<назад', + nextText: 'напред>', + nextBigText: '>>', + currentText: 'днес', + monthNames: ['Януари','Февруари','Март','Април','Май','Юни', + 'Юли','Август','Септември','Октомври','Ноември','Декември'], + monthNamesShort: ['Яну','Фев','Мар','Апр','Май','Юни', + 'Юли','Авг','Сеп','Окт','Нов','Дек'], + dayNames: ['Неделя','Понеделник','Вторник','Сряда','Четвъртък','Петък','Събота'], + dayNamesShort: ['Нед','Пон','Вто','Сря','Чет','Пет','Съб'], + dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Съ'], + weekHeader: 'Wk', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['bg']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-bs.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-bs.js new file mode 100644 index 0000000..f08870f --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-bs.js @@ -0,0 +1,23 @@ +/* Bosnian i18n for the jQuery UI date picker plugin. */ +/* Written by Kenan Konjo. */ +jQuery(function($){ + $.datepicker.regional['bs'] = { + closeText: 'Zatvori', + prevText: '<', + nextText: '>', + currentText: 'Danas', + monthNames: ['Januar','Februar','Mart','April','Maj','Juni', + 'Juli','August','Septembar','Oktobar','Novembar','Decembar'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', + 'Jul','Aug','Sep','Okt','Nov','Dec'], + dayNames: ['Nedelja','Ponedeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'], + dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'], + dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'], + weekHeader: 'Wk', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['bs']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ca.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ca.js new file mode 100644 index 0000000..a10b549 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ca.js @@ -0,0 +1,23 @@ +/* Inicialització en català per a l'extensió 'UI date picker' per jQuery. */ +/* Writers: (joan.leon@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['ca'] = { + closeText: 'Tanca', + prevText: 'Anterior', + nextText: 'Següent', + currentText: 'Avui', + monthNames: ['gener','febrer','març','abril','maig','juny', + 'juliol','agost','setembre','octubre','novembre','desembre'], + monthNamesShort: ['gen','feb','març','abr','maig','juny', + 'jul','ag','set','oct','nov','des'], + dayNames: ['diumenge','dilluns','dimarts','dimecres','dijous','divendres','dissabte'], + dayNamesShort: ['dg','dl','dt','dc','dj','dv','ds'], + dayNamesMin: ['dg','dl','dt','dc','dj','dv','ds'], + weekHeader: 'Set', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['ca']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-cs.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-cs.js new file mode 100644 index 0000000..b96b1a5 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-cs.js @@ -0,0 +1,23 @@ +/* Czech initialisation for the jQuery UI date picker plugin. */ +/* Written by Tomas Muller (tomas@tomas-muller.net). */ +jQuery(function($){ + $.datepicker.regional['cs'] = { + closeText: 'Zavřít', + prevText: '<Dříve', + nextText: 'Později>', + currentText: 'Nyní', + monthNames: ['leden','únor','březen','duben','květen','červen', + 'červenec','srpen','září','říjen','listopad','prosinec'], + monthNamesShort: ['led','úno','bře','dub','kvě','čer', + 'čvc','srp','zář','říj','lis','pro'], + dayNames: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'], + dayNamesShort: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'], + dayNamesMin: ['ne','po','út','st','čt','pá','so'], + weekHeader: 'Týd', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['cs']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-cy-GB.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-cy-GB.js new file mode 100644 index 0000000..cf3a38e --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-cy-GB.js @@ -0,0 +1,23 @@ +/* Welsh/UK initialisation for the jQuery UI date picker plugin. */ +/* Written by William Griffiths. */ +jQuery(function($){ + $.datepicker.regional['cy-GB'] = { + closeText: 'Done', + prevText: 'Prev', + nextText: 'Next', + currentText: 'Today', + monthNames: ['Ionawr','Chwefror','Mawrth','Ebrill','Mai','Mehefin', + 'Gorffennaf','Awst','Medi','Hydref','Tachwedd','Rhagfyr'], + monthNamesShort: ['Ion', 'Chw', 'Maw', 'Ebr', 'Mai', 'Meh', + 'Gor', 'Aws', 'Med', 'Hyd', 'Tac', 'Rha'], + dayNames: ['Dydd Sul', 'Dydd Llun', 'Dydd Mawrth', 'Dydd Mercher', 'Dydd Iau', 'Dydd Gwener', 'Dydd Sadwrn'], + dayNamesShort: ['Sul', 'Llu', 'Maw', 'Mer', 'Iau', 'Gwe', 'Sad'], + dayNamesMin: ['Su','Ll','Ma','Me','Ia','Gw','Sa'], + weekHeader: 'Wy', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['cy-GB']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-da.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-da.js new file mode 100644 index 0000000..7e42948 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-da.js @@ -0,0 +1,23 @@ +/* Danish initialisation for the jQuery UI date picker plugin. */ +/* Written by Jan Christensen ( deletestuff@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['da'] = { + closeText: 'Luk', + prevText: '<Forrige', + nextText: 'Næste>', + currentText: 'Idag', + monthNames: ['Januar','Februar','Marts','April','Maj','Juni', + 'Juli','August','September','Oktober','November','December'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', + 'Jul','Aug','Sep','Okt','Nov','Dec'], + dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'], + dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'], + dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'], + weekHeader: 'Uge', + dateFormat: 'dd-mm-yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['da']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-de.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-de.js new file mode 100644 index 0000000..abe75c4 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-de.js @@ -0,0 +1,23 @@ +/* German initialisation for the jQuery UI date picker plugin. */ +/* Written by Milian Wolff (mail@milianw.de). */ +jQuery(function($){ + $.datepicker.regional['de'] = { + closeText: 'Schließen', + prevText: '<Zurück', + nextText: 'Vor>', + currentText: 'Heute', + monthNames: ['Januar','Februar','März','April','Mai','Juni', + 'Juli','August','September','Oktober','November','Dezember'], + monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun', + 'Jul','Aug','Sep','Okt','Nov','Dez'], + dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], + dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], + dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'], + weekHeader: 'KW', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['de']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-el.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-el.js new file mode 100644 index 0000000..1ac4756 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-el.js @@ -0,0 +1,23 @@ +/* Greek (el) initialisation for the jQuery UI date picker plugin. */ +/* Written by Alex Cicovic (http://www.alexcicovic.com) */ +jQuery(function($){ + $.datepicker.regional['el'] = { + closeText: 'Κλείσιμο', + prevText: 'Προηγούμενος', + nextText: 'Επόμενος', + currentText: 'Τρέχων Μήνας', + monthNames: ['Ιανουάριος','Φεβρουάριος','Μάρτιος','Απρίλιος','Μάιος','Ιούνιος', + 'Ιούλιος','Αύγουστος','Σεπτέμβριος','Οκτώβριος','Νοέμβριος','Δεκέμβριος'], + monthNamesShort: ['Ιαν','Φεβ','Μαρ','Απρ','Μαι','Ιουν', + 'Ιουλ','Αυγ','Σεπ','Οκτ','Νοε','Δεκ'], + dayNames: ['Κυριακή','Δευτέρα','Τρίτη','Τετάρτη','Πέμπτη','Παρασκευή','Σάββατο'], + dayNamesShort: ['Κυρ','Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ'], + dayNamesMin: ['Κυ','Δε','Τρ','Τε','Πε','Πα','Σα'], + weekHeader: 'Εβδ', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['el']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-en-AU.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-en-AU.js new file mode 100644 index 0000000..c1a1020 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-en-AU.js @@ -0,0 +1,23 @@ +/* English/Australia initialisation for the jQuery UI date picker plugin. */ +/* Based on the en-GB initialisation. */ +jQuery(function($){ + $.datepicker.regional['en-AU'] = { + closeText: 'Done', + prevText: 'Prev', + nextText: 'Next', + currentText: 'Today', + monthNames: ['January','February','March','April','May','June', + 'July','August','September','October','November','December'], + monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], + weekHeader: 'Wk', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['en-AU']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-en-GB.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-en-GB.js new file mode 100644 index 0000000..16a096e --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-en-GB.js @@ -0,0 +1,23 @@ +/* English/UK initialisation for the jQuery UI date picker plugin. */ +/* Written by Stuart. */ +jQuery(function($){ + $.datepicker.regional['en-GB'] = { + closeText: 'Done', + prevText: 'Prev', + nextText: 'Next', + currentText: 'Today', + monthNames: ['January','February','March','April','May','June', + 'July','August','September','October','November','December'], + monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], + weekHeader: 'Wk', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['en-GB']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-en-NZ.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-en-NZ.js new file mode 100644 index 0000000..7819df0 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-en-NZ.js @@ -0,0 +1,23 @@ +/* English/New Zealand initialisation for the jQuery UI date picker plugin. */ +/* Based on the en-GB initialisation. */ +jQuery(function($){ + $.datepicker.regional['en-NZ'] = { + closeText: 'Done', + prevText: 'Prev', + nextText: 'Next', + currentText: 'Today', + monthNames: ['January','February','March','April','May','June', + 'July','August','September','October','November','December'], + monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], + weekHeader: 'Wk', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['en-NZ']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-eo.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-eo.js new file mode 100644 index 0000000..39e44fc --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-eo.js @@ -0,0 +1,23 @@ +/* Esperanto initialisation for the jQuery UI date picker plugin. */ +/* Written by Olivier M. (olivierweb@ifrance.com). */ +jQuery(function($){ + $.datepicker.regional['eo'] = { + closeText: 'Fermi', + prevText: '<Anta', + nextText: 'Sekv>', + currentText: 'Nuna', + monthNames: ['Januaro','Februaro','Marto','Aprilo','Majo','Junio', + 'Julio','Aŭgusto','Septembro','Oktobro','Novembro','Decembro'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', + 'Jul','Aŭg','Sep','Okt','Nov','Dec'], + dayNames: ['Dimanĉo','Lundo','Mardo','Merkredo','Ĵaŭdo','Vendredo','Sabato'], + dayNamesShort: ['Dim','Lun','Mar','Mer','Ĵaŭ','Ven','Sab'], + dayNamesMin: ['Di','Lu','Ma','Me','Ĵa','Ve','Sa'], + weekHeader: 'Sb', + dateFormat: 'dd/mm/yy', + firstDay: 0, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['eo']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-es.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-es.js new file mode 100644 index 0000000..97a2d6e --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-es.js @@ -0,0 +1,23 @@ +/* Inicialización en español para la extensión 'UI date picker' para jQuery. */ +/* Traducido por Vester (xvester@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['es'] = { + closeText: 'Cerrar', + prevText: '<Ant', + nextText: 'Sig>', + currentText: 'Hoy', + monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio', + 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'], + monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun', + 'Jul','Ago','Sep','Oct','Nov','Dic'], + dayNames: ['Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado'], + dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'], + dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'], + weekHeader: 'Sm', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['es']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-et.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-et.js new file mode 100644 index 0000000..62cbea8 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-et.js @@ -0,0 +1,23 @@ +/* Estonian initialisation for the jQuery UI date picker plugin. */ +/* Written by Mart Sõmermaa (mrts.pydev at gmail com). */ +jQuery(function($){ + $.datepicker.regional['et'] = { + closeText: 'Sulge', + prevText: 'Eelnev', + nextText: 'Järgnev', + currentText: 'Täna', + monthNames: ['Jaanuar','Veebruar','Märts','Aprill','Mai','Juuni', + 'Juuli','August','September','Oktoober','November','Detsember'], + monthNamesShort: ['Jaan', 'Veebr', 'Märts', 'Apr', 'Mai', 'Juuni', + 'Juuli', 'Aug', 'Sept', 'Okt', 'Nov', 'Dets'], + dayNames: ['Pühapäev', 'Esmaspäev', 'Teisipäev', 'Kolmapäev', 'Neljapäev', 'Reede', 'Laupäev'], + dayNamesShort: ['Pühap', 'Esmasp', 'Teisip', 'Kolmap', 'Neljap', 'Reede', 'Laup'], + dayNamesMin: ['P','E','T','K','N','R','L'], + weekHeader: 'näd', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['et']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-eu.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-eu.js new file mode 100644 index 0000000..a71db2c --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-eu.js @@ -0,0 +1,23 @@ +/* Euskarako oinarria 'UI date picker' jquery-ko extentsioarentzat */ +/* Karrikas-ek itzulia (karrikas@karrikas.com) */ +jQuery(function($){ + $.datepicker.regional['eu'] = { + closeText: 'Egina', + prevText: '<Aur', + nextText: 'Hur>', + currentText: 'Gaur', + monthNames: ['urtarrila','otsaila','martxoa','apirila','maiatza','ekaina', + 'uztaila','abuztua','iraila','urria','azaroa','abendua'], + monthNamesShort: ['urt.','ots.','mar.','api.','mai.','eka.', + 'uzt.','abu.','ira.','urr.','aza.','abe.'], + dayNames: ['igandea','astelehena','asteartea','asteazkena','osteguna','ostirala','larunbata'], + dayNamesShort: ['ig.','al.','ar.','az.','og.','ol.','lr.'], + dayNamesMin: ['ig','al','ar','az','og','ol','lr'], + weekHeader: 'As', + dateFormat: 'yy-mm-dd', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['eu']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-fa.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-fa.js new file mode 100644 index 0000000..bb957f6 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-fa.js @@ -0,0 +1,59 @@ +/* Persian (Farsi) Translation for the jQuery UI date picker plugin. */ +/* Javad Mowlanezhad -- jmowla@gmail.com */ +/* Jalali calendar should supported soon! (Its implemented but I have to test it) */ +jQuery(function($) { + $.datepicker.regional['fa'] = { + closeText: 'بستن', + prevText: '<قبلی', + nextText: 'بعدی>', + currentText: 'امروز', + monthNames: [ + 'فروردين', + 'ارديبهشت', + 'خرداد', + 'تير', + 'مرداد', + 'شهريور', + 'مهر', + 'آبان', + 'آذر', + 'دی', + 'بهمن', + 'اسفند' + ], + monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'], + dayNames: [ + 'يکشنبه', + 'دوشنبه', + 'سه‌شنبه', + 'چهارشنبه', + 'پنجشنبه', + 'جمعه', + 'شنبه' + ], + dayNamesShort: [ + 'ی', + 'د', + 'س', + 'چ', + 'پ', + 'ج', + 'ش' + ], + dayNamesMin: [ + 'ی', + 'د', + 'س', + 'چ', + 'پ', + 'ج', + 'ش' + ], + weekHeader: 'هف', + dateFormat: 'yy/mm/dd', + firstDay: 6, + isRTL: true, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['fa']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-fi.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-fi.js new file mode 100644 index 0000000..bd6d994 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-fi.js @@ -0,0 +1,23 @@ +/* Finnish initialisation for the jQuery UI date picker plugin. */ +/* Written by Harri Kilpiö (harrikilpio@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['fi'] = { + closeText: 'Sulje', + prevText: '«Edellinen', + nextText: 'Seuraava»', + currentText: 'Tänään', + monthNames: ['Tammikuu','Helmikuu','Maaliskuu','Huhtikuu','Toukokuu','Kesäkuu', + 'Heinäkuu','Elokuu','Syyskuu','Lokakuu','Marraskuu','Joulukuu'], + monthNamesShort: ['Tammi','Helmi','Maalis','Huhti','Touko','Kesä', + 'Heinä','Elo','Syys','Loka','Marras','Joulu'], + dayNamesShort: ['Su','Ma','Ti','Ke','To','Pe','La'], + dayNames: ['Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai'], + dayNamesMin: ['Su','Ma','Ti','Ke','To','Pe','La'], + weekHeader: 'Vk', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['fi']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-fo.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-fo.js new file mode 100644 index 0000000..cb0e3de --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-fo.js @@ -0,0 +1,23 @@ +/* Faroese initialisation for the jQuery UI date picker plugin */ +/* Written by Sverri Mohr Olsen, sverrimo@gmail.com */ +jQuery(function($){ + $.datepicker.regional['fo'] = { + closeText: 'Lat aftur', + prevText: '<Fyrra', + nextText: 'Næsta>', + currentText: 'Í dag', + monthNames: ['Januar','Februar','Mars','Apríl','Mei','Juni', + 'Juli','August','September','Oktober','November','Desember'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun', + 'Jul','Aug','Sep','Okt','Nov','Des'], + dayNames: ['Sunnudagur','Mánadagur','Týsdagur','Mikudagur','Hósdagur','Fríggjadagur','Leyardagur'], + dayNamesShort: ['Sun','Mán','Týs','Mik','Hós','Frí','Ley'], + dayNamesMin: ['Su','Má','Tý','Mi','Hó','Fr','Le'], + weekHeader: 'Vk', + dateFormat: 'dd-mm-yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['fo']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-fr-CA.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-fr-CA.js new file mode 100644 index 0000000..e208221 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-fr-CA.js @@ -0,0 +1,23 @@ +/* Canadian-French initialisation for the jQuery UI date picker plugin. */ +jQuery(function ($) { + $.datepicker.regional['fr-CA'] = { + closeText: 'Fermer', + prevText: 'Précédent', + nextText: 'Suivant', + currentText: 'Aujourd\'hui', + monthNames: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', + 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'], + monthNamesShort: ['janv.', 'févr.', 'mars', 'avril', 'mai', 'juin', + 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'], + dayNames: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'], + dayNamesShort: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'], + dayNamesMin: ['D', 'L', 'M', 'M', 'J', 'V', 'S'], + weekHeader: 'Sem.', + dateFormat: 'yy-mm-dd', + firstDay: 0, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: '' + }; + $.datepicker.setDefaults($.datepicker.regional['fr-CA']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-fr-CH.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-fr-CH.js new file mode 100644 index 0000000..e574537 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-fr-CH.js @@ -0,0 +1,23 @@ +/* Swiss-French initialisation for the jQuery UI date picker plugin. */ +/* Written Martin Voelkle (martin.voelkle@e-tc.ch). */ +jQuery(function($){ + $.datepicker.regional['fr-CH'] = { + closeText: 'Fermer', + prevText: '<Préc', + nextText: 'Suiv>', + currentText: 'Courant', + monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin', + 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'], + monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun', + 'Jul','Aoû','Sep','Oct','Nov','Déc'], + dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], + dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'], + dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'], + weekHeader: 'Sm', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['fr-CH']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-fr.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-fr.js new file mode 100644 index 0000000..934afd1 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-fr.js @@ -0,0 +1,25 @@ +/* French initialisation for the jQuery UI date picker plugin. */ +/* Written by Keith Wood (kbwood{at}iinet.com.au), + Stéphane Nahmani (sholby@sholby.net), + Stéphane Raimbault */ +jQuery(function($){ + $.datepicker.regional['fr'] = { + closeText: 'Fermer', + prevText: 'Précédent', + nextText: 'Suivant', + currentText: 'Aujourd\'hui', + monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin', + 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'], + monthNamesShort: ['Janv.','Févr.','Mars','Avril','Mai','Juin', + 'Juil.','Août','Sept.','Oct.','Nov.','Déc.'], + dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], + dayNamesShort: ['Dim.','Lun.','Mar.','Mer.','Jeu.','Ven.','Sam.'], + dayNamesMin: ['D','L','M','M','J','V','S'], + weekHeader: 'Sem.', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['fr']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-gl.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-gl.js new file mode 100644 index 0000000..59b989a --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-gl.js @@ -0,0 +1,23 @@ +/* Galician localization for 'UI date picker' jQuery extension. */ +/* Translated by Jorge Barreiro . */ +jQuery(function($){ + $.datepicker.regional['gl'] = { + closeText: 'Pechar', + prevText: '<Ant', + nextText: 'Seg>', + currentText: 'Hoxe', + monthNames: ['Xaneiro','Febreiro','Marzo','Abril','Maio','Xuño', + 'Xullo','Agosto','Setembro','Outubro','Novembro','Decembro'], + monthNamesShort: ['Xan','Feb','Mar','Abr','Mai','Xuñ', + 'Xul','Ago','Set','Out','Nov','Dec'], + dayNames: ['Domingo','Luns','Martes','Mércores','Xoves','Venres','Sábado'], + dayNamesShort: ['Dom','Lun','Mar','Mér','Xov','Ven','Sáb'], + dayNamesMin: ['Do','Lu','Ma','Mé','Xo','Ve','Sá'], + weekHeader: 'Sm', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['gl']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-he.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-he.js new file mode 100644 index 0000000..b9e8dee --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-he.js @@ -0,0 +1,23 @@ +/* Hebrew initialisation for the UI Datepicker extension. */ +/* Written by Amir Hardon (ahardon at gmail dot com). */ +jQuery(function($){ + $.datepicker.regional['he'] = { + closeText: 'סגור', + prevText: '<הקודם', + nextText: 'הבא>', + currentText: 'היום', + monthNames: ['ינואר','פברואר','מרץ','אפריל','מאי','יוני', + 'יולי','אוגוסט','ספטמבר','אוקטובר','נובמבר','דצמבר'], + monthNamesShort: ['ינו','פבר','מרץ','אפר','מאי','יוני', + 'יולי','אוג','ספט','אוק','נוב','דצמ'], + dayNames: ['ראשון','שני','שלישי','רביעי','חמישי','שישי','שבת'], + dayNamesShort: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'], + dayNamesMin: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'], + weekHeader: 'Wk', + dateFormat: 'dd/mm/yy', + firstDay: 0, + isRTL: true, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['he']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-hi.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-hi.js new file mode 100644 index 0000000..6c563b9 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-hi.js @@ -0,0 +1,23 @@ +/* Hindi initialisation for the jQuery UI date picker plugin. */ +/* Written by Michael Dawart. */ +jQuery(function($){ + $.datepicker.regional['hi'] = { + closeText: 'बंद', + prevText: 'पिछला', + nextText: 'अगला', + currentText: 'आज', + monthNames: ['जनवरी ','फरवरी','मार्च','अप्रेल','मई','जून', + 'जूलाई','अगस्त ','सितम्बर','अक्टूबर','नवम्बर','दिसम्बर'], + monthNamesShort: ['जन', 'फर', 'मार्च', 'अप्रेल', 'मई', 'जून', + 'जूलाई', 'अग', 'सित', 'अक्ट', 'नव', 'दि'], + dayNames: ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरुवार', 'शुक्रवार', 'शनिवार'], + dayNamesShort: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'], + dayNamesMin: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'], + weekHeader: 'हफ्ता', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['hi']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-hr.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-hr.js new file mode 100644 index 0000000..2fe37b6 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-hr.js @@ -0,0 +1,23 @@ +/* Croatian i18n for the jQuery UI date picker plugin. */ +/* Written by Vjekoslav Nesek. */ +jQuery(function($){ + $.datepicker.regional['hr'] = { + closeText: 'Zatvori', + prevText: '<', + nextText: '>', + currentText: 'Danas', + monthNames: ['Siječanj','Veljača','Ožujak','Travanj','Svibanj','Lipanj', + 'Srpanj','Kolovoz','Rujan','Listopad','Studeni','Prosinac'], + monthNamesShort: ['Sij','Velj','Ožu','Tra','Svi','Lip', + 'Srp','Kol','Ruj','Lis','Stu','Pro'], + dayNames: ['Nedjelja','Ponedjeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'], + dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'], + dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'], + weekHeader: 'Tje', + dateFormat: 'dd.mm.yy.', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['hr']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-hu.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-hu.js new file mode 100644 index 0000000..b28c268 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-hu.js @@ -0,0 +1,23 @@ +/* Hungarian initialisation for the jQuery UI date picker plugin. */ +/* Written by Istvan Karaszi (jquery@spam.raszi.hu). */ +jQuery(function($){ + $.datepicker.regional['hu'] = { + closeText: 'bezár', + prevText: 'vissza', + nextText: 'előre', + currentText: 'ma', + monthNames: ['Január', 'Február', 'Március', 'Április', 'Május', 'Június', + 'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'], + monthNamesShort: ['Jan', 'Feb', 'Már', 'Ápr', 'Máj', 'Jún', + 'Júl', 'Aug', 'Szep', 'Okt', 'Nov', 'Dec'], + dayNames: ['Vasárnap', 'Hétfő', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'], + dayNamesShort: ['Vas', 'Hét', 'Ked', 'Sze', 'Csü', 'Pén', 'Szo'], + dayNamesMin: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'], + weekHeader: 'Hét', + dateFormat: 'yy.mm.dd.', + firstDay: 1, + isRTL: false, + showMonthAfterYear: true, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['hu']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-hy.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-hy.js new file mode 100644 index 0000000..6d4eca5 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-hy.js @@ -0,0 +1,23 @@ +/* Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Levon Zakaryan (levon.zakaryan@gmail.com)*/ +jQuery(function($){ + $.datepicker.regional['hy'] = { + closeText: 'Փակել', + prevText: '<Նախ.', + nextText: 'Հաջ.>', + currentText: 'Այսօր', + monthNames: ['Հունվար','Փետրվար','Մարտ','Ապրիլ','Մայիս','Հունիս', + 'Հուլիս','Օգոստոս','Սեպտեմբեր','Հոկտեմբեր','Նոյեմբեր','Դեկտեմբեր'], + monthNamesShort: ['Հունվ','Փետր','Մարտ','Ապր','Մայիս','Հունիս', + 'Հուլ','Օգս','Սեպ','Հոկ','Նոյ','Դեկ'], + dayNames: ['կիրակի','եկուշաբթի','երեքշաբթի','չորեքշաբթի','հինգշաբթի','ուրբաթ','շաբաթ'], + dayNamesShort: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'], + dayNamesMin: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'], + weekHeader: 'ՇԲՏ', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['hy']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-id.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-id.js new file mode 100644 index 0000000..6327fa6 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-id.js @@ -0,0 +1,23 @@ +/* Indonesian initialisation for the jQuery UI date picker plugin. */ +/* Written by Deden Fathurahman (dedenf@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['id'] = { + closeText: 'Tutup', + prevText: '<mundur', + nextText: 'maju>', + currentText: 'hari ini', + monthNames: ['Januari','Februari','Maret','April','Mei','Juni', + 'Juli','Agustus','September','Oktober','Nopember','Desember'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun', + 'Jul','Agus','Sep','Okt','Nop','Des'], + dayNames: ['Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'], + dayNamesShort: ['Min','Sen','Sel','Rab','kam','Jum','Sab'], + dayNamesMin: ['Mg','Sn','Sl','Rb','Km','jm','Sb'], + weekHeader: 'Mg', + dateFormat: 'dd/mm/yy', + firstDay: 0, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['id']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-is.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-is.js new file mode 100644 index 0000000..925341a --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-is.js @@ -0,0 +1,23 @@ +/* Icelandic initialisation for the jQuery UI date picker plugin. */ +/* Written by Haukur H. Thorsson (haukur@eskill.is). */ +jQuery(function($){ + $.datepicker.regional['is'] = { + closeText: 'Loka', + prevText: '< Fyrri', + nextText: 'Næsti >', + currentText: 'Í dag', + monthNames: ['Janúar','Febrúar','Mars','Apríl','Maí','Júní', + 'Júlí','Ágúst','September','Október','Nóvember','Desember'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maí','Jún', + 'Júl','Ágú','Sep','Okt','Nóv','Des'], + dayNames: ['Sunnudagur','Mánudagur','Þriðjudagur','Miðvikudagur','Fimmtudagur','Föstudagur','Laugardagur'], + dayNamesShort: ['Sun','Mán','Þri','Mið','Fim','Fös','Lau'], + dayNamesMin: ['Su','Má','Þr','Mi','Fi','Fö','La'], + weekHeader: 'Vika', + dateFormat: 'dd/mm/yy', + firstDay: 0, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['is']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-it.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-it.js new file mode 100644 index 0000000..a01f043 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-it.js @@ -0,0 +1,23 @@ +/* Italian initialisation for the jQuery UI date picker plugin. */ +/* Written by Antonello Pasella (antonello.pasella@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['it'] = { + closeText: 'Chiudi', + prevText: '<Prec', + nextText: 'Succ>', + currentText: 'Oggi', + monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno', + 'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'], + monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu', + 'Lug','Ago','Set','Ott','Nov','Dic'], + dayNames: ['Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato'], + dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'], + dayNamesMin: ['Do','Lu','Ma','Me','Gi','Ve','Sa'], + weekHeader: 'Sm', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['it']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ja.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ja.js new file mode 100644 index 0000000..4d0b63c --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ja.js @@ -0,0 +1,23 @@ +/* Japanese initialisation for the jQuery UI date picker plugin. */ +/* Written by Kentaro SATO (kentaro@ranvis.com). */ +jQuery(function($){ + $.datepicker.regional['ja'] = { + closeText: '閉じる', + prevText: '<前', + nextText: '次>', + currentText: '今日', + monthNames: ['1月','2月','3月','4月','5月','6月', + '7月','8月','9月','10月','11月','12月'], + monthNamesShort: ['1月','2月','3月','4月','5月','6月', + '7月','8月','9月','10月','11月','12月'], + dayNames: ['日曜日','月曜日','火曜日','水曜日','木曜日','金曜日','土曜日'], + dayNamesShort: ['日','月','火','水','木','金','土'], + dayNamesMin: ['日','月','火','水','木','金','土'], + weekHeader: '週', + dateFormat: 'yy/mm/dd', + firstDay: 0, + isRTL: false, + showMonthAfterYear: true, + yearSuffix: '年'}; + $.datepicker.setDefaults($.datepicker.regional['ja']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ka.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ka.js new file mode 100644 index 0000000..c10658d --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ka.js @@ -0,0 +1,21 @@ +/* Georgian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Lado Lomidze (lado.lomidze@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['ka'] = { + closeText: 'დახურვა', + prevText: '< წინა', + nextText: 'შემდეგი >', + currentText: 'დღეს', + monthNames: ['იანვარი','თებერვალი','მარტი','აპრილი','მაისი','ივნისი', 'ივლისი','აგვისტო','სექტემბერი','ოქტომბერი','ნოემბერი','დეკემბერი'], + monthNamesShort: ['იან','თებ','მარ','აპრ','მაი','ივნ', 'ივლ','აგვ','სექ','ოქტ','ნოე','დეკ'], + dayNames: ['კვირა','ორშაბათი','სამშაბათი','ოთხშაბათი','ხუთშაბათი','პარასკევი','შაბათი'], + dayNamesShort: ['კვ','ორშ','სამ','ოთხ','ხუთ','პარ','შაბ'], + dayNamesMin: ['კვ','ორშ','სამ','ოთხ','ხუთ','პარ','შაბ'], + weekHeader: 'კვირა', + dateFormat: 'dd-mm-yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['ka']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-kk.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-kk.js new file mode 100644 index 0000000..dcd6a65 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-kk.js @@ -0,0 +1,23 @@ +/* Kazakh (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Dmitriy Karasyov (dmitriy.karasyov@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['kk'] = { + closeText: 'Жабу', + prevText: '<Алдыңғы', + nextText: 'Келесі>', + currentText: 'Бүгін', + monthNames: ['Қаңтар','Ақпан','Наурыз','Сәуір','Мамыр','Маусым', + 'Шілде','Тамыз','Қыркүйек','Қазан','Қараша','Желтоқсан'], + monthNamesShort: ['Қаң','Ақп','Нау','Сәу','Мам','Мау', + 'Шіл','Там','Қыр','Қаз','Қар','Жел'], + dayNames: ['Жексенбі','Дүйсенбі','Сейсенбі','Сәрсенбі','Бейсенбі','Жұма','Сенбі'], + dayNamesShort: ['жкс','дсн','ссн','срс','бсн','жма','снб'], + dayNamesMin: ['Жк','Дс','Сс','Ср','Бс','Жм','Сн'], + weekHeader: 'Не', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['kk']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-km.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-km.js new file mode 100644 index 0000000..f9c4e3a --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-km.js @@ -0,0 +1,23 @@ +/* Khmer initialisation for the jQuery calendar extension. */ +/* Written by Chandara Om (chandara.teacher@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['km'] = { + closeText: 'ធ្វើ​រួច', + prevText: 'មុន', + nextText: 'បន្ទាប់', + currentText: 'ថ្ងៃ​នេះ', + monthNames: ['មករា','កុម្ភៈ','មីនា','មេសា','ឧសភា','មិថុនា', + 'កក្កដា','សីហា','កញ្ញា','តុលា','វិច្ឆិកា','ធ្នូ'], + monthNamesShort: ['មករា','កុម្ភៈ','មីនា','មេសា','ឧសភា','មិថុនា', + 'កក្កដា','សីហា','កញ្ញា','តុលា','វិច្ឆិកា','ធ្នូ'], + dayNames: ['អាទិត្យ', 'ចន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហស្បតិ៍', 'សុក្រ', 'សៅរ៍'], + dayNamesShort: ['អា', 'ច', 'អ', 'ពុ', 'ព្រហ', 'សុ', 'សៅ'], + dayNamesMin: ['អា', 'ច', 'អ', 'ពុ', 'ព្រហ', 'សុ', 'សៅ'], + weekHeader: 'សប្ដាហ៍', + dateFormat: 'dd-mm-yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['km']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ko.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ko.js new file mode 100644 index 0000000..af36f3d --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ko.js @@ -0,0 +1,23 @@ +/* Korean initialisation for the jQuery calendar extension. */ +/* Written by DaeKwon Kang (ncrash.dk@gmail.com), Edited by Genie. */ +jQuery(function($){ + $.datepicker.regional['ko'] = { + closeText: '닫기', + prevText: '이전달', + nextText: '다음달', + currentText: '오늘', + monthNames: ['1월','2월','3월','4월','5월','6월', + '7월','8월','9월','10월','11월','12월'], + monthNamesShort: ['1월','2월','3월','4월','5월','6월', + '7월','8월','9월','10월','11월','12월'], + dayNames: ['일요일','월요일','화요일','수요일','목요일','금요일','토요일'], + dayNamesShort: ['일','월','화','수','목','금','토'], + dayNamesMin: ['일','월','화','수','목','금','토'], + weekHeader: 'Wk', + dateFormat: 'yy-mm-dd', + firstDay: 0, + isRTL: false, + showMonthAfterYear: true, + yearSuffix: '년'}; + $.datepicker.setDefaults($.datepicker.regional['ko']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ky.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ky.js new file mode 100644 index 0000000..d4466b1 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ky.js @@ -0,0 +1,24 @@ +/* Kyrgyz (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Sergey Kartashov (ebishkek@yandex.ru). */ +jQuery(function($){ + $.datepicker.regional['ky'] = { + closeText: 'Жабуу', + prevText: '<Мур', + nextText: 'Кий>', + currentText: 'Бүгүн', + monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь', + 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'], + monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн', + 'Июл','Авг','Сен','Окт','Ноя','Дек'], + dayNames: ['жекшемби', 'дүйшөмбү', 'шейшемби', 'шаршемби', 'бейшемби', 'жума', 'ишемби'], + dayNamesShort: ['жек', 'дүй', 'шей', 'шар', 'бей', 'жум', 'ише'], + dayNamesMin: ['Жк','Дш','Шш','Шр','Бш','Жм','Иш'], + weekHeader: 'Жум', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: '' + }; + $.datepicker.setDefaults($.datepicker.regional['ky']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-lb.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-lb.js new file mode 100644 index 0000000..87c79d5 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-lb.js @@ -0,0 +1,23 @@ +/* Luxembourgish initialisation for the jQuery UI date picker plugin. */ +/* Written by Michel Weimerskirch */ +jQuery(function($){ + $.datepicker.regional['lb'] = { + closeText: 'Fäerdeg', + prevText: 'Zréck', + nextText: 'Weider', + currentText: 'Haut', + monthNames: ['Januar','Februar','Mäerz','Abrëll','Mee','Juni', + 'Juli','August','September','Oktober','November','Dezember'], + monthNamesShort: ['Jan', 'Feb', 'Mäe', 'Abr', 'Mee', 'Jun', + 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], + dayNames: ['Sonndeg', 'Méindeg', 'Dënschdeg', 'Mëttwoch', 'Donneschdeg', 'Freideg', 'Samschdeg'], + dayNamesShort: ['Son', 'Méi', 'Dën', 'Mët', 'Don', 'Fre', 'Sam'], + dayNamesMin: ['So','Mé','Dë','Më','Do','Fr','Sa'], + weekHeader: 'W', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['lb']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-lt.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-lt.js new file mode 100644 index 0000000..1afaaac --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-lt.js @@ -0,0 +1,23 @@ +/* Lithuanian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* @author Arturas Paleicikas */ +jQuery(function($){ + $.datepicker.regional['lt'] = { + closeText: 'Uždaryti', + prevText: '<Atgal', + nextText: 'Pirmyn>', + currentText: 'Šiandien', + monthNames: ['Sausis','Vasaris','Kovas','Balandis','Gegužė','Birželis', + 'Liepa','Rugpjūtis','Rugsėjis','Spalis','Lapkritis','Gruodis'], + monthNamesShort: ['Sau','Vas','Kov','Bal','Geg','Bir', + 'Lie','Rugp','Rugs','Spa','Lap','Gru'], + dayNames: ['sekmadienis','pirmadienis','antradienis','trečiadienis','ketvirtadienis','penktadienis','šeštadienis'], + dayNamesShort: ['sek','pir','ant','tre','ket','pen','šeš'], + dayNamesMin: ['Se','Pr','An','Tr','Ke','Pe','Še'], + weekHeader: 'Wk', + dateFormat: 'yy-mm-dd', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['lt']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-lv.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-lv.js new file mode 100644 index 0000000..28cc102 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-lv.js @@ -0,0 +1,23 @@ +/* Latvian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* @author Arturas Paleicikas */ +jQuery(function($){ + $.datepicker.regional['lv'] = { + closeText: 'Aizvērt', + prevText: 'Iepr', + nextText: 'Nāka', + currentText: 'Šodien', + monthNames: ['Janvāris','Februāris','Marts','Aprīlis','Maijs','Jūnijs', + 'Jūlijs','Augusts','Septembris','Oktobris','Novembris','Decembris'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jūn', + 'Jūl','Aug','Sep','Okt','Nov','Dec'], + dayNames: ['svētdiena','pirmdiena','otrdiena','trešdiena','ceturtdiena','piektdiena','sestdiena'], + dayNamesShort: ['svt','prm','otr','tre','ctr','pkt','sst'], + dayNamesMin: ['Sv','Pr','Ot','Tr','Ct','Pk','Ss'], + weekHeader: 'Nav', + dateFormat: 'dd-mm-yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['lv']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-mk.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-mk.js new file mode 100644 index 0000000..0285325 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-mk.js @@ -0,0 +1,23 @@ +/* Macedonian i18n for the jQuery UI date picker plugin. */ +/* Written by Stojce Slavkovski. */ +jQuery(function($){ + $.datepicker.regional['mk'] = { + closeText: 'Затвори', + prevText: '<', + nextText: '>', + currentText: 'Денес', + monthNames: ['Јануари','Февруари','Март','Април','Мај','Јуни', + 'Јули','Август','Септември','Октомври','Ноември','Декември'], + monthNamesShort: ['Јан','Фев','Мар','Апр','Мај','Јун', + 'Јул','Авг','Сеп','Окт','Ное','Дек'], + dayNames: ['Недела','Понеделник','Вторник','Среда','Четврток','Петок','Сабота'], + dayNamesShort: ['Нед','Пон','Вто','Сре','Чет','Пет','Саб'], + dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Са'], + weekHeader: 'Сед', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['mk']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ml.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ml.js new file mode 100644 index 0000000..9b8f460 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ml.js @@ -0,0 +1,23 @@ +/* Malayalam (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Saji Nediyanchath (saji89@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['ml'] = { + closeText: 'ശരി', + prevText: 'മുന്നത്തെ', + nextText: 'അടുത്തത് ', + currentText: 'ഇന്ന്', + monthNames: ['ജനുവരി','ഫെബ്രുവരി','മാര്‍ച്ച്','ഏപ്രില്‍','മേയ്','ജൂണ്‍', + 'ജൂലൈ','ആഗസ്റ്റ്','സെപ്റ്റംബര്‍','ഒക്ടോബര്‍','നവംബര്‍','ഡിസംബര്‍'], + monthNamesShort: ['ജനു', 'ഫെബ്', 'മാര്‍', 'ഏപ്രി', 'മേയ്', 'ജൂണ്‍', + 'ജൂലാ', 'ആഗ', 'സെപ്', 'ഒക്ടോ', 'നവം', 'ഡിസ'], + dayNames: ['ഞായര്‍', 'തിങ്കള്‍', 'ചൊവ്വ', 'ബുധന്‍', 'വ്യാഴം', 'വെള്ളി', 'ശനി'], + dayNamesShort: ['ഞായ', 'തിങ്ക', 'ചൊവ്വ', 'ബുധ', 'വ്യാഴം', 'വെള്ളി', 'ശനി'], + dayNamesMin: ['ഞാ','തി','ചൊ','ബു','വ്യാ','വെ','ശ'], + weekHeader: 'ആ', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['ml']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ms.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ms.js new file mode 100644 index 0000000..e70de72 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ms.js @@ -0,0 +1,23 @@ +/* Malaysian initialisation for the jQuery UI date picker plugin. */ +/* Written by Mohd Nawawi Mohamad Jamili (nawawi@ronggeng.net). */ +jQuery(function($){ + $.datepicker.regional['ms'] = { + closeText: 'Tutup', + prevText: '<Sebelum', + nextText: 'Selepas>', + currentText: 'hari ini', + monthNames: ['Januari','Februari','Mac','April','Mei','Jun', + 'Julai','Ogos','September','Oktober','November','Disember'], + monthNamesShort: ['Jan','Feb','Mac','Apr','Mei','Jun', + 'Jul','Ogo','Sep','Okt','Nov','Dis'], + dayNames: ['Ahad','Isnin','Selasa','Rabu','Khamis','Jumaat','Sabtu'], + dayNamesShort: ['Aha','Isn','Sel','Rab','kha','Jum','Sab'], + dayNamesMin: ['Ah','Is','Se','Ra','Kh','Ju','Sa'], + weekHeader: 'Mg', + dateFormat: 'dd/mm/yy', + firstDay: 0, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['ms']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-nb.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-nb.js new file mode 100644 index 0000000..845a505 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-nb.js @@ -0,0 +1,22 @@ +/* Norwegian Bokmål initialisation for the jQuery UI date picker plugin. */ +/* Written by Bjørn Johansen (post@bjornjohansen.no). */ +jQuery(function($){ + $.datepicker.regional['nb'] = { + closeText: 'Lukk', + prevText: '«Forrige', + nextText: 'Neste»', + currentText: 'I dag', + monthNames: ['januar','februar','mars','april','mai','juni','juli','august','september','oktober','november','desember'], + monthNamesShort: ['jan','feb','mar','apr','mai','jun','jul','aug','sep','okt','nov','des'], + dayNamesShort: ['søn','man','tir','ons','tor','fre','lør'], + dayNames: ['søndag','mandag','tirsdag','onsdag','torsdag','fredag','lørdag'], + dayNamesMin: ['sø','ma','ti','on','to','fr','lø'], + weekHeader: 'Uke', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: '' + }; + $.datepicker.setDefaults($.datepicker.regional['nb']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-nl-BE.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-nl-BE.js new file mode 100644 index 0000000..7b3cdf4 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-nl-BE.js @@ -0,0 +1,23 @@ +/* Dutch (Belgium) initialisation for the jQuery UI date picker plugin. */ +/* David De Sloovere @DavidDeSloovere */ +jQuery(function($){ + $.datepicker.regional['nl-BE'] = { + closeText: 'Sluiten', + prevText: '←', + nextText: '→', + currentText: 'Vandaag', + monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', + 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], + monthNamesShort: ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', + 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], + dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], + dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'], + dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], + weekHeader: 'Wk', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['nl-BE']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-nl.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-nl.js new file mode 100644 index 0000000..203f160 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-nl.js @@ -0,0 +1,23 @@ +/* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Mathias Bynens */ +jQuery(function($){ + $.datepicker.regional.nl = { + closeText: 'Sluiten', + prevText: '←', + nextText: '→', + currentText: 'Vandaag', + monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', + 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], + monthNamesShort: ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', + 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], + dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], + dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'], + dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], + weekHeader: 'Wk', + dateFormat: 'dd-mm-yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional.nl); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-nn.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-nn.js new file mode 100644 index 0000000..b55245e --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-nn.js @@ -0,0 +1,22 @@ +/* Norwegian Nynorsk initialisation for the jQuery UI date picker plugin. */ +/* Written by Bjørn Johansen (post@bjornjohansen.no). */ +jQuery(function($){ + $.datepicker.regional['nn'] = { + closeText: 'Lukk', + prevText: '«Førre', + nextText: 'Neste»', + currentText: 'I dag', + monthNames: ['januar','februar','mars','april','mai','juni','juli','august','september','oktober','november','desember'], + monthNamesShort: ['jan','feb','mar','apr','mai','jun','jul','aug','sep','okt','nov','des'], + dayNamesShort: ['sun','mån','tys','ons','tor','fre','lau'], + dayNames: ['sundag','måndag','tysdag','onsdag','torsdag','fredag','laurdag'], + dayNamesMin: ['su','må','ty','on','to','fr','la'], + weekHeader: 'Veke', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: '' + }; + $.datepicker.setDefaults($.datepicker.regional['nn']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-no.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-no.js new file mode 100644 index 0000000..d36e430 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-no.js @@ -0,0 +1,23 @@ +/* Norwegian initialisation for the jQuery UI date picker plugin. */ +/* Written by Naimdjon Takhirov (naimdjon@gmail.com). */ + +jQuery(function($){ + $.datepicker.regional['no'] = { + closeText: 'Lukk', + prevText: '«Forrige', + nextText: 'Neste»', + currentText: 'I dag', + monthNames: ['januar','februar','mars','april','mai','juni','juli','august','september','oktober','november','desember'], + monthNamesShort: ['jan','feb','mar','apr','mai','jun','jul','aug','sep','okt','nov','des'], + dayNamesShort: ['søn','man','tir','ons','tor','fre','lør'], + dayNames: ['søndag','mandag','tirsdag','onsdag','torsdag','fredag','lørdag'], + dayNamesMin: ['sø','ma','ti','on','to','fr','lø'], + weekHeader: 'Uke', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: '' + }; + $.datepicker.setDefaults($.datepicker.regional['no']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-pl.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-pl.js new file mode 100644 index 0000000..0ffc515 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-pl.js @@ -0,0 +1,23 @@ +/* Polish initialisation for the jQuery UI date picker plugin. */ +/* Written by Jacek Wysocki (jacek.wysocki@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['pl'] = { + closeText: 'Zamknij', + prevText: '<Poprzedni', + nextText: 'Następny>', + currentText: 'Dziś', + monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec', + 'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'], + monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze', + 'Lip','Sie','Wrz','Pa','Lis','Gru'], + dayNames: ['Niedziela','Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota'], + dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'], + dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'], + weekHeader: 'Tydz', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['pl']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-pt-BR.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-pt-BR.js new file mode 100644 index 0000000..521967e --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-pt-BR.js @@ -0,0 +1,23 @@ +/* Brazilian initialisation for the jQuery UI date picker plugin. */ +/* Written by Leonildo Costa Silva (leocsilva@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['pt-BR'] = { + closeText: 'Fechar', + prevText: '<Anterior', + nextText: 'Próximo>', + currentText: 'Hoje', + monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho', + 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'], + monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun', + 'Jul','Ago','Set','Out','Nov','Dez'], + dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'], + dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], + dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], + weekHeader: 'Sm', + dateFormat: 'dd/mm/yy', + firstDay: 0, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['pt-BR']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-pt.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-pt.js new file mode 100644 index 0000000..999f20e --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-pt.js @@ -0,0 +1,22 @@ +/* Portuguese initialisation for the jQuery UI date picker plugin. */ +jQuery(function($){ + $.datepicker.regional['pt'] = { + closeText: 'Fechar', + prevText: '<Anterior', + nextText: 'Seguinte', + currentText: 'Hoje', + monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho', + 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'], + monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun', + 'Jul','Ago','Set','Out','Nov','Dez'], + dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'], + dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], + dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], + weekHeader: 'Sem', + dateFormat: 'dd/mm/yy', + firstDay: 0, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['pt']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-rm.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-rm.js new file mode 100644 index 0000000..22ed216 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-rm.js @@ -0,0 +1,21 @@ +/* Romansh initialisation for the jQuery UI date picker plugin. */ +/* Written by Yvonne Gienal (yvonne.gienal@educa.ch). */ +jQuery(function($){ + $.datepicker.regional['rm'] = { + closeText: 'Serrar', + prevText: '<Suandant', + nextText: 'Precedent>', + currentText: 'Actual', + monthNames: ['Schaner','Favrer','Mars','Avrigl','Matg','Zercladur', 'Fanadur','Avust','Settember','October','November','December'], + monthNamesShort: ['Scha','Fev','Mar','Avr','Matg','Zer', 'Fan','Avu','Sett','Oct','Nov','Dec'], + dayNames: ['Dumengia','Glindesdi','Mardi','Mesemna','Gievgia','Venderdi','Sonda'], + dayNamesShort: ['Dum','Gli','Mar','Mes','Gie','Ven','Som'], + dayNamesMin: ['Du','Gl','Ma','Me','Gi','Ve','So'], + weekHeader: 'emna', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['rm']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ro.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ro.js new file mode 100644 index 0000000..a988270 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ro.js @@ -0,0 +1,26 @@ +/* Romanian initialisation for the jQuery UI date picker plugin. + * + * Written by Edmond L. (ll_edmond@walla.com) + * and Ionut G. Stan (ionut.g.stan@gmail.com) + */ +jQuery(function($){ + $.datepicker.regional['ro'] = { + closeText: 'Închide', + prevText: '« Luna precedentă', + nextText: 'Luna următoare »', + currentText: 'Azi', + monthNames: ['Ianuarie','Februarie','Martie','Aprilie','Mai','Iunie', + 'Iulie','August','Septembrie','Octombrie','Noiembrie','Decembrie'], + monthNamesShort: ['Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Iun', + 'Iul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + dayNames: ['Duminică', 'Luni', 'Marţi', 'Miercuri', 'Joi', 'Vineri', 'Sâmbătă'], + dayNamesShort: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'], + dayNamesMin: ['Du','Lu','Ma','Mi','Jo','Vi','Sâ'], + weekHeader: 'Săpt', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['ro']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ru.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ru.js new file mode 100644 index 0000000..a519714 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ru.js @@ -0,0 +1,23 @@ +/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Andrew Stromnov (stromnov@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['ru'] = { + closeText: 'Закрыть', + prevText: '<Пред', + nextText: 'След>', + currentText: 'Сегодня', + monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь', + 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'], + monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн', + 'Июл','Авг','Сен','Окт','Ноя','Дек'], + dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'], + dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'], + dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'], + weekHeader: 'Нед', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['ru']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-sk.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-sk.js new file mode 100644 index 0000000..0cb76c4 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-sk.js @@ -0,0 +1,23 @@ +/* Slovak initialisation for the jQuery UI date picker plugin. */ +/* Written by Vojtech Rinik (vojto@hmm.sk). */ +jQuery(function($){ + $.datepicker.regional['sk'] = { + closeText: 'Zavrieť', + prevText: '<Predchádzajúci', + nextText: 'Nasledujúci>', + currentText: 'Dnes', + monthNames: ['január','február','marec','apríl','máj','jún', + 'júl','august','september','október','november','december'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún', + 'Júl','Aug','Sep','Okt','Nov','Dec'], + dayNames: ['nedeľa','pondelok','utorok','streda','štvrtok','piatok','sobota'], + dayNamesShort: ['Ned','Pon','Uto','Str','Štv','Pia','Sob'], + dayNamesMin: ['Ne','Po','Ut','St','Št','Pia','So'], + weekHeader: 'Ty', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['sk']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-sl.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-sl.js new file mode 100644 index 0000000..048a47a --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-sl.js @@ -0,0 +1,24 @@ +/* Slovenian initialisation for the jQuery UI date picker plugin. */ +/* Written by Jaka Jancar (jaka@kubje.org). */ +/* c = č, s = š z = ž C = Č S = Š Z = Ž */ +jQuery(function($){ + $.datepicker.regional['sl'] = { + closeText: 'Zapri', + prevText: '<Prejšnji', + nextText: 'Naslednji>', + currentText: 'Trenutni', + monthNames: ['Januar','Februar','Marec','April','Maj','Junij', + 'Julij','Avgust','September','Oktober','November','December'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', + 'Jul','Avg','Sep','Okt','Nov','Dec'], + dayNames: ['Nedelja','Ponedeljek','Torek','Sreda','Četrtek','Petek','Sobota'], + dayNamesShort: ['Ned','Pon','Tor','Sre','Čet','Pet','Sob'], + dayNamesMin: ['Ne','Po','To','Sr','Če','Pe','So'], + weekHeader: 'Teden', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['sl']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-sq.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-sq.js new file mode 100644 index 0000000..d6086a7 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-sq.js @@ -0,0 +1,23 @@ +/* Albanian initialisation for the jQuery UI date picker plugin. */ +/* Written by Flakron Bytyqi (flakron@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['sq'] = { + closeText: 'mbylle', + prevText: '<mbrapa', + nextText: 'Përpara>', + currentText: 'sot', + monthNames: ['Janar','Shkurt','Mars','Prill','Maj','Qershor', + 'Korrik','Gusht','Shtator','Tetor','Nëntor','Dhjetor'], + monthNamesShort: ['Jan','Shk','Mar','Pri','Maj','Qer', + 'Kor','Gus','Sht','Tet','Nën','Dhj'], + dayNames: ['E Diel','E Hënë','E Martë','E Mërkurë','E Enjte','E Premte','E Shtune'], + dayNamesShort: ['Di','Hë','Ma','Më','En','Pr','Sh'], + dayNamesMin: ['Di','Hë','Ma','Më','En','Pr','Sh'], + weekHeader: 'Ja', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['sq']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-sr-SR.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-sr-SR.js new file mode 100644 index 0000000..810d21d --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-sr-SR.js @@ -0,0 +1,23 @@ +/* Serbian i18n for the jQuery UI date picker plugin. */ +/* Written by Dejan Dimić. */ +jQuery(function($){ + $.datepicker.regional['sr-SR'] = { + closeText: 'Zatvori', + prevText: '<', + nextText: '>', + currentText: 'Danas', + monthNames: ['Januar','Februar','Mart','April','Maj','Jun', + 'Jul','Avgust','Septembar','Oktobar','Novembar','Decembar'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', + 'Jul','Avg','Sep','Okt','Nov','Dec'], + dayNames: ['Nedelja','Ponedeljak','Utorak','Sreda','Četvrtak','Petak','Subota'], + dayNamesShort: ['Ned','Pon','Uto','Sre','Čet','Pet','Sub'], + dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'], + weekHeader: 'Sed', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['sr-SR']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-sr.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-sr.js new file mode 100644 index 0000000..1349a26 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-sr.js @@ -0,0 +1,23 @@ +/* Serbian i18n for the jQuery UI date picker plugin. */ +/* Written by Dejan Dimić. */ +jQuery(function($){ + $.datepicker.regional['sr'] = { + closeText: 'Затвори', + prevText: '<', + nextText: '>', + currentText: 'Данас', + monthNames: ['Јануар','Фебруар','Март','Април','Мај','Јун', + 'Јул','Август','Септембар','Октобар','Новембар','Децембар'], + monthNamesShort: ['Јан','Феб','Мар','Апр','Мај','Јун', + 'Јул','Авг','Сеп','Окт','Нов','Дец'], + dayNames: ['Недеља','Понедељак','Уторак','Среда','Четвртак','Петак','Субота'], + dayNamesShort: ['Нед','Пон','Уто','Сре','Чет','Пет','Суб'], + dayNamesMin: ['Не','По','Ут','Ср','Че','Пе','Су'], + weekHeader: 'Сед', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['sr']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-sv.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-sv.js new file mode 100644 index 0000000..cbb5ad1 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-sv.js @@ -0,0 +1,23 @@ +/* Swedish initialisation for the jQuery UI date picker plugin. */ +/* Written by Anders Ekdahl ( anders@nomadiz.se). */ +jQuery(function($){ + $.datepicker.regional['sv'] = { + closeText: 'Stäng', + prevText: '«Förra', + nextText: 'Nästa»', + currentText: 'Idag', + monthNames: ['Januari','Februari','Mars','April','Maj','Juni', + 'Juli','Augusti','September','Oktober','November','December'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', + 'Jul','Aug','Sep','Okt','Nov','Dec'], + dayNamesShort: ['Sön','Mån','Tis','Ons','Tor','Fre','Lör'], + dayNames: ['Söndag','Måndag','Tisdag','Onsdag','Torsdag','Fredag','Lördag'], + dayNamesMin: ['Sö','Må','Ti','On','To','Fr','Lö'], + weekHeader: 'Ve', + dateFormat: 'yy-mm-dd', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['sv']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ta.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ta.js new file mode 100644 index 0000000..40431ed --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-ta.js @@ -0,0 +1,23 @@ +/* Tamil (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by S A Sureshkumar (saskumar@live.com). */ +jQuery(function($){ + $.datepicker.regional['ta'] = { + closeText: 'மூடு', + prevText: 'முன்னையது', + nextText: 'அடுத்தது', + currentText: 'இன்று', + monthNames: ['தை','மாசி','பங்குனி','சித்திரை','வைகாசி','ஆனி', + 'ஆடி','ஆவணி','புரட்டாசி','ஐப்பசி','கார்த்திகை','மார்கழி'], + monthNamesShort: ['தை','மாசி','பங்','சித்','வைகா','ஆனி', + 'ஆடி','ஆவ','புர','ஐப்','கார்','மார்'], + dayNames: ['ஞாயிற்றுக்கிழமை','திங்கட்கிழமை','செவ்வாய்க்கிழமை','புதன்கிழமை','வியாழக்கிழமை','வெள்ளிக்கிழமை','சனிக்கிழமை'], + dayNamesShort: ['ஞாயிறு','திங்கள்','செவ்வாய்','புதன்','வியாழன்','வெள்ளி','சனி'], + dayNamesMin: ['ஞா','தி','செ','பு','வி','வெ','ச'], + weekHeader: 'Не', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['ta']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-th.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-th.js new file mode 100644 index 0000000..aecfd27 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-th.js @@ -0,0 +1,23 @@ +/* Thai initialisation for the jQuery UI date picker plugin. */ +/* Written by pipo (pipo@sixhead.com). */ +jQuery(function($){ + $.datepicker.regional['th'] = { + closeText: 'ปิด', + prevText: '« ย้อน', + nextText: 'ถัดไป »', + currentText: 'วันนี้', + monthNames: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน', + 'กรกฎาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'], + monthNamesShort: ['ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.', + 'ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.'], + dayNames: ['อาทิตย์','จันทร์','อังคาร','พุธ','พฤหัสบดี','ศุกร์','เสาร์'], + dayNamesShort: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'], + dayNamesMin: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'], + weekHeader: 'Wk', + dateFormat: 'dd/mm/yy', + firstDay: 0, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['th']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-tj.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-tj.js new file mode 100644 index 0000000..9a20e4d --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-tj.js @@ -0,0 +1,23 @@ +/* Tajiki (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Abdurahmon Saidov (saidovab@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['tj'] = { + closeText: 'Идома', + prevText: '<Қафо', + nextText: 'Пеш>', + currentText: 'Имрӯз', + monthNames: ['Январ','Феврал','Март','Апрел','Май','Июн', + 'Июл','Август','Сентябр','Октябр','Ноябр','Декабр'], + monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн', + 'Июл','Авг','Сен','Окт','Ноя','Дек'], + dayNames: ['якшанбе','душанбе','сешанбе','чоршанбе','панҷшанбе','ҷумъа','шанбе'], + dayNamesShort: ['якш','душ','сеш','чор','пан','ҷум','шан'], + dayNamesMin: ['Як','Дш','Сш','Чш','Пш','Ҷм','Шн'], + weekHeader: 'Хф', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['tj']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-tr.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-tr.js new file mode 100644 index 0000000..75b583a --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-tr.js @@ -0,0 +1,23 @@ +/* Turkish initialisation for the jQuery UI date picker plugin. */ +/* Written by Izzet Emre Erkan (kara@karalamalar.net). */ +jQuery(function($){ + $.datepicker.regional['tr'] = { + closeText: 'kapat', + prevText: '<geri', + nextText: 'ileri>', + currentText: 'bugün', + monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran', + 'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'], + monthNamesShort: ['Oca','Şub','Mar','Nis','May','Haz', + 'Tem','Ağu','Eyl','Eki','Kas','Ara'], + dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'], + dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], + dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], + weekHeader: 'Hf', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['tr']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-uk.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-uk.js new file mode 100644 index 0000000..2bdc82f --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-uk.js @@ -0,0 +1,24 @@ +/* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Maxim Drogobitskiy (maxdao@gmail.com). */ +/* Corrected by Igor Milla (igor.fsp.milla@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['uk'] = { + closeText: 'Закрити', + prevText: '<', + nextText: '>', + currentText: 'Сьогодні', + monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень', + 'Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'], + monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер', + 'Лип','Сер','Вер','Жов','Лис','Гру'], + dayNames: ['неділя','понеділок','вівторок','середа','четвер','п’ятниця','субота'], + dayNamesShort: ['нед','пнд','вів','срд','чтв','птн','сбт'], + dayNamesMin: ['Нд','Пн','Вт','Ср','Чт','Пт','Сб'], + weekHeader: 'Тиж', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['uk']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-vi.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-vi.js new file mode 100644 index 0000000..b49e7eb --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-vi.js @@ -0,0 +1,23 @@ +/* Vietnamese initialisation for the jQuery UI date picker plugin. */ +/* Translated by Le Thanh Huy (lthanhhuy@cit.ctu.edu.vn). */ +jQuery(function($){ + $.datepicker.regional['vi'] = { + closeText: 'Đóng', + prevText: '<Trước', + nextText: 'Tiếp>', + currentText: 'Hôm nay', + monthNames: ['Tháng Một', 'Tháng Hai', 'Tháng Ba', 'Tháng Tư', 'Tháng Năm', 'Tháng Sáu', + 'Tháng Bảy', 'Tháng Tám', 'Tháng Chín', 'Tháng Mười', 'Tháng Mười Một', 'Tháng Mười Hai'], + monthNamesShort: ['Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6', + 'Tháng 7', 'Tháng 8', 'Tháng 9', 'Tháng 10', 'Tháng 11', 'Tháng 12'], + dayNames: ['Chủ Nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'], + dayNamesShort: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], + dayNamesMin: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], + weekHeader: 'Tu', + dateFormat: 'dd/mm/yy', + firstDay: 0, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['vi']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-zh-CN.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-zh-CN.js new file mode 100644 index 0000000..d337e4a --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-zh-CN.js @@ -0,0 +1,23 @@ +/* Chinese initialisation for the jQuery UI date picker plugin. */ +/* Written by Cloudream (cloudream@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['zh-CN'] = { + closeText: '关闭', + prevText: '<上月', + nextText: '下月>', + currentText: '今天', + monthNames: ['一月','二月','三月','四月','五月','六月', + '七月','八月','九月','十月','十一月','十二月'], + monthNamesShort: ['一月','二月','三月','四月','五月','六月', + '七月','八月','九月','十月','十一月','十二月'], + dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], + dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], + dayNamesMin: ['日','一','二','三','四','五','六'], + weekHeader: '周', + dateFormat: 'yy-mm-dd', + firstDay: 1, + isRTL: false, + showMonthAfterYear: true, + yearSuffix: '年'}; + $.datepicker.setDefaults($.datepicker.regional['zh-CN']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-zh-HK.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-zh-HK.js new file mode 100644 index 0000000..ef6f4e7 --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-zh-HK.js @@ -0,0 +1,23 @@ +/* Chinese initialisation for the jQuery UI date picker plugin. */ +/* Written by SCCY (samuelcychan@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['zh-HK'] = { + closeText: '關閉', + prevText: '<上月', + nextText: '下月>', + currentText: '今天', + monthNames: ['一月','二月','三月','四月','五月','六月', + '七月','八月','九月','十月','十一月','十二月'], + monthNamesShort: ['一月','二月','三月','四月','五月','六月', + '七月','八月','九月','十月','十一月','十二月'], + dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], + dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], + dayNamesMin: ['日','一','二','三','四','五','六'], + weekHeader: '周', + dateFormat: 'dd-mm-yy', + firstDay: 0, + isRTL: false, + showMonthAfterYear: true, + yearSuffix: '年'}; + $.datepicker.setDefaults($.datepicker.regional['zh-HK']); +}); diff --git a/framework/yii/jui/assets/i18n/jquery.ui.datepicker-zh-TW.js b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-zh-TW.js new file mode 100644 index 0000000..b9105ea --- /dev/null +++ b/framework/yii/jui/assets/i18n/jquery.ui.datepicker-zh-TW.js @@ -0,0 +1,23 @@ +/* Chinese initialisation for the jQuery UI date picker plugin. */ +/* Written by Ressol (ressol@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['zh-TW'] = { + closeText: '關閉', + prevText: '<上月', + nextText: '下月>', + currentText: '今天', + monthNames: ['一月','二月','三月','四月','五月','六月', + '七月','八月','九月','十月','十一月','十二月'], + monthNamesShort: ['一月','二月','三月','四月','五月','六月', + '七月','八月','九月','十月','十一月','十二月'], + dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], + dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], + dayNamesMin: ['日','一','二','三','四','五','六'], + weekHeader: '周', + dateFormat: 'yy/mm/dd', + firstDay: 1, + isRTL: false, + showMonthAfterYear: true, + yearSuffix: '年'}; + $.datepicker.setDefaults($.datepicker.regional['zh-TW']); +}); diff --git a/framework/yii/jui/assets/jquery.ui.accordion.js b/framework/yii/jui/assets/jquery.ui.accordion.js new file mode 100644 index 0000000..bdd2d53 --- /dev/null +++ b/framework/yii/jui/assets/jquery.ui.accordion.js @@ -0,0 +1,572 @@ +/*! + * jQuery UI Accordion 1.10.3 + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/accordion/ + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +var uid = 0, + hideProps = {}, + showProps = {}; + +hideProps.height = hideProps.paddingTop = hideProps.paddingBottom = + hideProps.borderTopWidth = hideProps.borderBottomWidth = "hide"; +showProps.height = showProps.paddingTop = showProps.paddingBottom = + showProps.borderTopWidth = showProps.borderBottomWidth = "show"; + +$.widget( "ui.accordion", { + version: "1.10.3", + options: { + active: 0, + animate: {}, + collapsible: false, + event: "click", + header: "> li > :first-child,> :not(li):even", + heightStyle: "auto", + icons: { + activeHeader: "ui-icon-triangle-1-s", + header: "ui-icon-triangle-1-e" + }, + + // callbacks + activate: null, + beforeActivate: null + }, + + _create: function() { + var options = this.options; + this.prevShow = this.prevHide = $(); + this.element.addClass( "ui-accordion ui-widget ui-helper-reset" ) + // ARIA + .attr( "role", "tablist" ); + + // don't allow collapsible: false and active: false / null + if ( !options.collapsible && (options.active === false || options.active == null) ) { + options.active = 0; + } + + this._processPanels(); + // handle negative values + if ( options.active < 0 ) { + options.active += this.headers.length; + } + this._refresh(); + }, + + _getCreateEventData: function() { + return { + header: this.active, + panel: !this.active.length ? $() : this.active.next(), + content: !this.active.length ? $() : this.active.next() + }; + }, + + _createIcons: function() { + var icons = this.options.icons; + if ( icons ) { + $( "" ) + .addClass( "ui-accordion-header-icon ui-icon " + icons.header ) + .prependTo( this.headers ); + this.active.children( ".ui-accordion-header-icon" ) + .removeClass( icons.header ) + .addClass( icons.activeHeader ); + this.headers.addClass( "ui-accordion-icons" ); + } + }, + + _destroyIcons: function() { + this.headers + .removeClass( "ui-accordion-icons" ) + .children( ".ui-accordion-header-icon" ) + .remove(); + }, + + _destroy: function() { + var contents; + + // clean up main element + this.element + .removeClass( "ui-accordion ui-widget ui-helper-reset" ) + .removeAttr( "role" ); + + // clean up headers + this.headers + .removeClass( "ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top" ) + .removeAttr( "role" ) + .removeAttr( "aria-selected" ) + .removeAttr( "aria-controls" ) + .removeAttr( "tabIndex" ) + .each(function() { + if ( /^ui-accordion/.test( this.id ) ) { + this.removeAttribute( "id" ); + } + }); + this._destroyIcons(); + + // clean up content panels + contents = this.headers.next() + .css( "display", "" ) + .removeAttr( "role" ) + .removeAttr( "aria-expanded" ) + .removeAttr( "aria-hidden" ) + .removeAttr( "aria-labelledby" ) + .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled" ) + .each(function() { + if ( /^ui-accordion/.test( this.id ) ) { + this.removeAttribute( "id" ); + } + }); + if ( this.options.heightStyle !== "content" ) { + contents.css( "height", "" ); + } + }, + + _setOption: function( key, value ) { + if ( key === "active" ) { + // _activate() will handle invalid values and update this.options + this._activate( value ); + return; + } + + if ( key === "event" ) { + if ( this.options.event ) { + this._off( this.headers, this.options.event ); + } + this._setupEvents( value ); + } + + this._super( key, value ); + + // setting collapsible: false while collapsed; open first panel + if ( key === "collapsible" && !value && this.options.active === false ) { + this._activate( 0 ); + } + + if ( key === "icons" ) { + this._destroyIcons(); + if ( value ) { + this._createIcons(); + } + } + + // #5332 - opacity doesn't cascade to positioned elements in IE + // so we need to add the disabled class to the headers and panels + if ( key === "disabled" ) { + this.headers.add( this.headers.next() ) + .toggleClass( "ui-state-disabled", !!value ); + } + }, + + _keydown: function( event ) { + /*jshint maxcomplexity:15*/ + if ( event.altKey || event.ctrlKey ) { + return; + } + + var keyCode = $.ui.keyCode, + length = this.headers.length, + currentIndex = this.headers.index( event.target ), + toFocus = false; + + switch ( event.keyCode ) { + case keyCode.RIGHT: + case keyCode.DOWN: + toFocus = this.headers[ ( currentIndex + 1 ) % length ]; + break; + case keyCode.LEFT: + case keyCode.UP: + toFocus = this.headers[ ( currentIndex - 1 + length ) % length ]; + break; + case keyCode.SPACE: + case keyCode.ENTER: + this._eventHandler( event ); + break; + case keyCode.HOME: + toFocus = this.headers[ 0 ]; + break; + case keyCode.END: + toFocus = this.headers[ length - 1 ]; + break; + } + + if ( toFocus ) { + $( event.target ).attr( "tabIndex", -1 ); + $( toFocus ).attr( "tabIndex", 0 ); + toFocus.focus(); + event.preventDefault(); + } + }, + + _panelKeyDown : function( event ) { + if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) { + $( event.currentTarget ).prev().focus(); + } + }, + + refresh: function() { + var options = this.options; + this._processPanels(); + + // was collapsed or no panel + if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) { + options.active = false; + this.active = $(); + // active false only when collapsible is true + } else if ( options.active === false ) { + this._activate( 0 ); + // was active, but active panel is gone + } else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { + // all remaining panel are disabled + if ( this.headers.length === this.headers.find(".ui-state-disabled").length ) { + options.active = false; + this.active = $(); + // activate previous panel + } else { + this._activate( Math.max( 0, options.active - 1 ) ); + } + // was active, active panel still exists + } else { + // make sure active index is correct + options.active = this.headers.index( this.active ); + } + + this._destroyIcons(); + + this._refresh(); + }, + + _processPanels: function() { + this.headers = this.element.find( this.options.header ) + .addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" ); + + this.headers.next() + .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" ) + .filter(":not(.ui-accordion-content-active)") + .hide(); + }, + + _refresh: function() { + var maxHeight, + options = this.options, + heightStyle = options.heightStyle, + parent = this.element.parent(), + accordionId = this.accordionId = "ui-accordion-" + + (this.element.attr( "id" ) || ++uid); + + this.active = this._findActive( options.active ) + .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" ) + .removeClass( "ui-corner-all" ); + this.active.next() + .addClass( "ui-accordion-content-active" ) + .show(); + + this.headers + .attr( "role", "tab" ) + .each(function( i ) { + var header = $( this ), + headerId = header.attr( "id" ), + panel = header.next(), + panelId = panel.attr( "id" ); + if ( !headerId ) { + headerId = accordionId + "-header-" + i; + header.attr( "id", headerId ); + } + if ( !panelId ) { + panelId = accordionId + "-panel-" + i; + panel.attr( "id", panelId ); + } + header.attr( "aria-controls", panelId ); + panel.attr( "aria-labelledby", headerId ); + }) + .next() + .attr( "role", "tabpanel" ); + + this.headers + .not( this.active ) + .attr({ + "aria-selected": "false", + tabIndex: -1 + }) + .next() + .attr({ + "aria-expanded": "false", + "aria-hidden": "true" + }) + .hide(); + + // make sure at least one header is in the tab order + if ( !this.active.length ) { + this.headers.eq( 0 ).attr( "tabIndex", 0 ); + } else { + this.active.attr({ + "aria-selected": "true", + tabIndex: 0 + }) + .next() + .attr({ + "aria-expanded": "true", + "aria-hidden": "false" + }); + } + + this._createIcons(); + + this._setupEvents( options.event ); + + if ( heightStyle === "fill" ) { + maxHeight = parent.height(); + this.element.siblings( ":visible" ).each(function() { + var elem = $( this ), + position = elem.css( "position" ); + + if ( position === "absolute" || position === "fixed" ) { + return; + } + maxHeight -= elem.outerHeight( true ); + }); + + this.headers.each(function() { + maxHeight -= $( this ).outerHeight( true ); + }); + + this.headers.next() + .each(function() { + $( this ).height( Math.max( 0, maxHeight - + $( this ).innerHeight() + $( this ).height() ) ); + }) + .css( "overflow", "auto" ); + } else if ( heightStyle === "auto" ) { + maxHeight = 0; + this.headers.next() + .each(function() { + maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() ); + }) + .height( maxHeight ); + } + }, + + _activate: function( index ) { + var active = this._findActive( index )[ 0 ]; + + // trying to activate the already active panel + if ( active === this.active[ 0 ] ) { + return; + } + + // trying to collapse, simulate a click on the currently active header + active = active || this.active[ 0 ]; + + this._eventHandler({ + target: active, + currentTarget: active, + preventDefault: $.noop + }); + }, + + _findActive: function( selector ) { + return typeof selector === "number" ? this.headers.eq( selector ) : $(); + }, + + _setupEvents: function( event ) { + var events = { + keydown: "_keydown" + }; + if ( event ) { + $.each( event.split(" "), function( index, eventName ) { + events[ eventName ] = "_eventHandler"; + }); + } + + this._off( this.headers.add( this.headers.next() ) ); + this._on( this.headers, events ); + this._on( this.headers.next(), { keydown: "_panelKeyDown" }); + this._hoverable( this.headers ); + this._focusable( this.headers ); + }, + + _eventHandler: function( event ) { + var options = this.options, + active = this.active, + clicked = $( event.currentTarget ), + clickedIsActive = clicked[ 0 ] === active[ 0 ], + collapsing = clickedIsActive && options.collapsible, + toShow = collapsing ? $() : clicked.next(), + toHide = active.next(), + eventData = { + oldHeader: active, + oldPanel: toHide, + newHeader: collapsing ? $() : clicked, + newPanel: toShow + }; + + event.preventDefault(); + + if ( + // click on active header, but not collapsible + ( clickedIsActive && !options.collapsible ) || + // allow canceling activation + ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { + return; + } + + options.active = collapsing ? false : this.headers.index( clicked ); + + // when the call to ._toggle() comes after the class changes + // it causes a very odd bug in IE 8 (see #6720) + this.active = clickedIsActive ? $() : clicked; + this._toggle( eventData ); + + // switch classes + // corner classes on the previously active header stay after the animation + active.removeClass( "ui-accordion-header-active ui-state-active" ); + if ( options.icons ) { + active.children( ".ui-accordion-header-icon" ) + .removeClass( options.icons.activeHeader ) + .addClass( options.icons.header ); + } + + if ( !clickedIsActive ) { + clicked + .removeClass( "ui-corner-all" ) + .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" ); + if ( options.icons ) { + clicked.children( ".ui-accordion-header-icon" ) + .removeClass( options.icons.header ) + .addClass( options.icons.activeHeader ); + } + + clicked + .next() + .addClass( "ui-accordion-content-active" ); + } + }, + + _toggle: function( data ) { + var toShow = data.newPanel, + toHide = this.prevShow.length ? this.prevShow : data.oldPanel; + + // handle activating a panel during the animation for another activation + this.prevShow.add( this.prevHide ).stop( true, true ); + this.prevShow = toShow; + this.prevHide = toHide; + + if ( this.options.animate ) { + this._animate( toShow, toHide, data ); + } else { + toHide.hide(); + toShow.show(); + this._toggleComplete( data ); + } + + toHide.attr({ + "aria-expanded": "false", + "aria-hidden": "true" + }); + toHide.prev().attr( "aria-selected", "false" ); + // if we're switching panels, remove the old header from the tab order + // if we're opening from collapsed state, remove the previous header from the tab order + // if we're collapsing, then keep the collapsing header in the tab order + if ( toShow.length && toHide.length ) { + toHide.prev().attr( "tabIndex", -1 ); + } else if ( toShow.length ) { + this.headers.filter(function() { + return $( this ).attr( "tabIndex" ) === 0; + }) + .attr( "tabIndex", -1 ); + } + + toShow + .attr({ + "aria-expanded": "true", + "aria-hidden": "false" + }) + .prev() + .attr({ + "aria-selected": "true", + tabIndex: 0 + }); + }, + + _animate: function( toShow, toHide, data ) { + var total, easing, duration, + that = this, + adjust = 0, + down = toShow.length && + ( !toHide.length || ( toShow.index() < toHide.index() ) ), + animate = this.options.animate || {}, + options = down && animate.down || animate, + complete = function() { + that._toggleComplete( data ); + }; + + if ( typeof options === "number" ) { + duration = options; + } + if ( typeof options === "string" ) { + easing = options; + } + // fall back from options to animation in case of partial down settings + easing = easing || options.easing || animate.easing; + duration = duration || options.duration || animate.duration; + + if ( !toHide.length ) { + return toShow.animate( showProps, duration, easing, complete ); + } + if ( !toShow.length ) { + return toHide.animate( hideProps, duration, easing, complete ); + } + + total = toShow.show().outerHeight(); + toHide.animate( hideProps, { + duration: duration, + easing: easing, + step: function( now, fx ) { + fx.now = Math.round( now ); + } + }); + toShow + .hide() + .animate( showProps, { + duration: duration, + easing: easing, + complete: complete, + step: function( now, fx ) { + fx.now = Math.round( now ); + if ( fx.prop !== "height" ) { + adjust += fx.now; + } else if ( that.options.heightStyle !== "content" ) { + fx.now = Math.round( total - toHide.outerHeight() - adjust ); + adjust = 0; + } + } + }); + }, + + _toggleComplete: function( data ) { + var toHide = data.oldPanel; + + toHide + .removeClass( "ui-accordion-content-active" ) + .prev() + .removeClass( "ui-corner-top" ) + .addClass( "ui-corner-all" ); + + // Work around for rendering bug in IE (#5421) + if ( toHide.length ) { + toHide.parent()[0].className = toHide.parent()[0].className; + } + + this._trigger( "activate", null, data ); + } +}); + +})( jQuery ); diff --git a/framework/yii/jui/assets/jquery.ui.autocomplete.js b/framework/yii/jui/assets/jquery.ui.autocomplete.js new file mode 100644 index 0000000..ca53d2c --- /dev/null +++ b/framework/yii/jui/assets/jquery.ui.autocomplete.js @@ -0,0 +1,610 @@ +/*! + * jQuery UI Autocomplete 1.10.3 + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/autocomplete/ + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.position.js + * jquery.ui.menu.js + */ +(function( $, undefined ) { + +// used to prevent race conditions with remote data sources +var requestIndex = 0; + +$.widget( "ui.autocomplete", { + version: "1.10.3", + defaultElement: "", + options: { + appendTo: null, + autoFocus: false, + delay: 300, + minLength: 1, + position: { + my: "left top", + at: "left bottom", + collision: "none" + }, + source: null, + + // callbacks + change: null, + close: null, + focus: null, + open: null, + response: null, + search: null, + select: null + }, + + pending: 0, + + _create: function() { + // Some browsers only repeat keydown events, not keypress events, + // so we use the suppressKeyPress flag to determine if we've already + // handled the keydown event. #7269 + // Unfortunately the code for & in keypress is the same as the up arrow, + // so we use the suppressKeyPressRepeat flag to avoid handling keypress + // events when we know the keydown event was used to modify the + // search term. #7799 + var suppressKeyPress, suppressKeyPressRepeat, suppressInput, + nodeName = this.element[0].nodeName.toLowerCase(), + isTextarea = nodeName === "textarea", + isInput = nodeName === "input"; + + this.isMultiLine = + // Textareas are always multi-line + isTextarea ? true : + // Inputs are always single-line, even if inside a contentEditable element + // IE also treats inputs as contentEditable + isInput ? false : + // All other element types are determined by whether or not they're contentEditable + this.element.prop( "isContentEditable" ); + + this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ]; + this.isNewMenu = true; + + this.element + .addClass( "ui-autocomplete-input" ) + .attr( "autocomplete", "off" ); + + this._on( this.element, { + keydown: function( event ) { + /*jshint maxcomplexity:15*/ + if ( this.element.prop( "readOnly" ) ) { + suppressKeyPress = true; + suppressInput = true; + suppressKeyPressRepeat = true; + return; + } + + suppressKeyPress = false; + suppressInput = false; + suppressKeyPressRepeat = false; + var keyCode = $.ui.keyCode; + switch( event.keyCode ) { + case keyCode.PAGE_UP: + suppressKeyPress = true; + this._move( "previousPage", event ); + break; + case keyCode.PAGE_DOWN: + suppressKeyPress = true; + this._move( "nextPage", event ); + break; + case keyCode.UP: + suppressKeyPress = true; + this._keyEvent( "previous", event ); + break; + case keyCode.DOWN: + suppressKeyPress = true; + this._keyEvent( "next", event ); + break; + case keyCode.ENTER: + case keyCode.NUMPAD_ENTER: + // when menu is open and has focus + if ( this.menu.active ) { + // #6055 - Opera still allows the keypress to occur + // which causes forms to submit + suppressKeyPress = true; + event.preventDefault(); + this.menu.select( event ); + } + break; + case keyCode.TAB: + if ( this.menu.active ) { + this.menu.select( event ); + } + break; + case keyCode.ESCAPE: + if ( this.menu.element.is( ":visible" ) ) { + this._value( this.term ); + this.close( event ); + // Different browsers have different default behavior for escape + // Single press can mean undo or clear + // Double press in IE means clear the whole form + event.preventDefault(); + } + break; + default: + suppressKeyPressRepeat = true; + // search timeout should be triggered before the input value is changed + this._searchTimeout( event ); + break; + } + }, + keypress: function( event ) { + if ( suppressKeyPress ) { + suppressKeyPress = false; + if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { + event.preventDefault(); + } + return; + } + if ( suppressKeyPressRepeat ) { + return; + } + + // replicate some key handlers to allow them to repeat in Firefox and Opera + var keyCode = $.ui.keyCode; + switch( event.keyCode ) { + case keyCode.PAGE_UP: + this._move( "previousPage", event ); + break; + case keyCode.PAGE_DOWN: + this._move( "nextPage", event ); + break; + case keyCode.UP: + this._keyEvent( "previous", event ); + break; + case keyCode.DOWN: + this._keyEvent( "next", event ); + break; + } + }, + input: function( event ) { + if ( suppressInput ) { + suppressInput = false; + event.preventDefault(); + return; + } + this._searchTimeout( event ); + }, + focus: function() { + this.selectedItem = null; + this.previous = this._value(); + }, + blur: function( event ) { + if ( this.cancelBlur ) { + delete this.cancelBlur; + return; + } + + clearTimeout( this.searching ); + this.close( event ); + this._change( event ); + } + }); + + this._initSource(); + this.menu = $( "