From 965ecd953230f83966b3778d3466ea8ae1254a86 Mon Sep 17 00:00:00 2001 From: noumo Date: Thu, 1 Oct 2015 18:40:17 +0300 Subject: [PATCH 001/109] file type in catalog fields --- components/API.php | 8 +-- helpers/Upload.php | 6 +- modules/catalog/controllers/AController.php | 11 ++-- .../catalog/controllers/ItemsController.php | 60 ++++++++++++++++++- modules/catalog/media/js/fields.js | 2 +- modules/catalog/models/Category.php | 16 ++++- modules/catalog/views/a/fields.php | 2 +- 7 files changed, 87 insertions(+), 18 deletions(-) diff --git a/components/API.php b/components/API.php index 9e1ae2fd..1cfa9653 100644 --- a/components/API.php +++ b/components/API.php @@ -24,11 +24,11 @@ public function init() public static function __callStatic($method, $params) { - $name = (new \ReflectionClass(self::className()))->getShortName(); - if (!isset(self::$classes[$name])) { - self::$classes[$name] = new static(); + $name = static::className(); + if (!isset(static::$classes[$name])) { + static::$classes[$name] = new static(); } - return call_user_func_array([self::$classes[$name], 'api_' . $method], $params); + return call_user_func_array([static::$classes[$name], 'api_' . $method], $params); } /** diff --git a/helpers/Upload.php b/helpers/Upload.php index 0fa13673..235d5746 100644 --- a/helpers/Upload.php +++ b/helpers/Upload.php @@ -37,14 +37,14 @@ static function getLink($fileName) return str_replace('\\', '/', str_replace(Yii::getAlias('@webroot'), '', $fileName)); } - static function getFileName($fileInstanse, $namePostfix = true) + static function getFileName($fileInstance, $namePostfix = true) { - $baseName = str_ireplace('.'.$fileInstanse->extension, '', $fileInstanse->name); + $baseName = str_ireplace('.'.$fileInstance->extension, '', $fileInstance->name); $fileName = StringHelper::truncate(Inflector::slug($baseName), 32, ''); if($namePostfix || !$fileName) { $fileName .= ($fileName ? '-' : '') . substr(uniqid(md5(rand()), true), 0, 10); } - $fileName .= '.' . $fileInstanse->extension; + $fileName .= '.' . $fileInstance->extension; return $fileName; } diff --git a/modules/catalog/controllers/AController.php b/modules/catalog/controllers/AController.php index b37284b4..f32d23c5 100644 --- a/modules/catalog/controllers/AController.php +++ b/modules/catalog/controllers/AController.php @@ -37,15 +37,16 @@ public function actionFields($id) ){ continue; } - $options = ''; + $options = trim($temp->options); if($temp->type == 'select' || $temp->type == 'checkbox'){ - if(empty($temp->options) || !($temp->options = trim($temp->options))){ + if($options == ''){ continue; } - $options = []; - foreach(explode(',', $temp->options) as $option){ - $options[] = trim($option); + $optionsArray = []; + foreach(explode(',', $options) as $option){ + $optionsArray[] = trim($option); } + $options = $optionsArray; } $result[] = [ diff --git a/modules/catalog/controllers/ItemsController.php b/modules/catalog/controllers/ItemsController.php index d8b9b1df..1c330c30 100644 --- a/modules/catalog/controllers/ItemsController.php +++ b/modules/catalog/controllers/ItemsController.php @@ -3,6 +3,8 @@ use Yii; use yii\easyii\behaviors\StatusController; +use yii\easyii\helpers\Upload; +use yii\validators\FileValidator; use yii\web\UploadedFile; use yii\helpers\Html; @@ -15,6 +17,8 @@ class ItemsController extends Controller { + static $RESTRICTED_EXTENSIONS = ['php', 'phtml', 'php5', 'htm', 'html', 'js', 'jsp', 'sh', 'exe', 'bat', 'com']; + public function behaviors() { return [ @@ -56,7 +60,7 @@ public function actionCreate($id) } else { $model->category_id = $category->primaryKey; - $model->data = Yii::$app->request->post('Data'); + $this->parseData($model); if (isset($_FILES) && $this->module->settings['itemThumb']) { $model->image = UploadedFile::getInstance($model, 'image'); @@ -96,7 +100,7 @@ public function actionEdit($id) return ActiveForm::validate($model); } else { - $model->data = Yii::$app->request->post('Data'); + $this->parseData($model); if (isset($_FILES) && $this->module->settings['itemThumb']) { $model->image = UploadedFile::getInstance($model, 'image'); @@ -164,6 +168,21 @@ public function actionDelete($id) return $this->formatResponse(Yii::t('easyii/catalog', 'Item deleted')); } + public function actionDeleteDataFile($file) + { + foreach(Item::find()->where(['like', 'data', $file])->all() as $model) { + + foreach ($model->data as $name => $value) { + if (!is_array($value) && strpos($value, '/' . $file) !== false) { + @unlink(Yii::getAlias('@webroot') . $value); + $model->data->{$name} = ''; + } + } + $model->update(); + } + return $this->formatResponse(Yii::t('easyii', 'Deleted')); + } + public function actionUp($id, $category_id) { return $this->move($id, 'up', ['category_id' => $category_id]); @@ -214,7 +233,44 @@ private function generateForm($fields, $data = null) } $result .= '
'. $field->title .''. $options .'
'; } + elseif ($field->type === 'file') { + $result .= '
'. Html::fileInput("Data[{$field->name}]"); + if($value != ''){ + $basename = basename($value); + $result .= + '

' . + Html::a($basename, [$value], ['target' => 'blank']) . + ' ' . + Html::a('', ['/admin/catalog/items/delete-data-file', 'file' => $basename], ['class' => 'confirm-delete', 'data-reload' => 1, 'title' => Yii::t('easyii', 'Delete')]); + '

'; + } + $result .= '
'; + } } return $result; } + + private function parseData(&$model) + { + $data = Yii::$app->request->post('Data'); + + if(isset($_FILES['Data'])) + { + foreach($_FILES['Data']['name'] as $fieldName => $sourceName){ + $field = $model->category->getFieldByName($fieldName); + $validator = new FileValidator(['extensions' => $field->options ? $field->options : null]); + $uploadInstance = UploadedFile::getInstanceByName('Data['.$fieldName.']'); + if($uploadInstance && !in_array($uploadInstance->extension, self::$RESTRICTED_EXTENSIONS) && $validator->validate($uploadInstance) && ($result = Upload::file($uploadInstance, 'catalog/files', false))) { + if(!empty($model->data->{$fieldName})){ + @unlink(Yii::getAlias('@webroot') . $model->data->{$fieldName}); + } + $data[$fieldName] = $result; + } else { + $data[$fieldName] = !empty($model->data->{$fieldName}) ? $model->data->{$fieldName} : ''; + } + } + } + + $model->data = $data; + } } \ No newline at end of file diff --git a/modules/catalog/media/js/fields.js b/modules/catalog/media/js/fields.js index 36a2f7e9..7e959929 100644 --- a/modules/catalog/media/js/fields.js +++ b/modules/catalog/media/js/fields.js @@ -63,6 +63,6 @@ $(function(){ function optionsIsNeeded(type) { - return type == 'select' || type == 'checkbox'; + return type == 'select' || type == 'checkbox' || type == 'file'; } }); \ No newline at end of file diff --git a/modules/catalog/models/Category.php b/modules/catalog/models/Category.php index d096e58e..ae9f14ce 100644 --- a/modules/catalog/models/Category.php +++ b/modules/catalog/models/Category.php @@ -8,7 +8,8 @@ class Category extends \yii\easyii\components\CategoryModel 'text' => 'Text', 'boolean' => 'Boolean', 'select' => 'Select', - 'checkbox' => 'Checkbox' + 'checkbox' => 'Checkbox', + 'file' => 'File' ]; public static function tableName() @@ -60,7 +61,18 @@ public function afterDelete() } } - private function parseFields(){ + public function getFieldByName($name) + { + foreach($this->fields as $field){ + if($field->name == $name){ + return $field; + } + } + return null; + } + + private function parseFields() + { $this->fields = $this->fields !== '' ? json_decode($this->fields) : []; } } \ No newline at end of file diff --git a/modules/catalog/views/a/fields.php b/modules/catalog/views/a/fields.php index 885753ae..0e15fe1a 100644 --- a/modules/catalog/views/a/fields.php +++ b/modules/catalog/views/a/fields.php @@ -52,7 +52,7 @@ - +
From 06868c745076584a929e365e64629b9570c4c8ba Mon Sep 17 00:00:00 2001 From: noumo Date: Fri, 9 Oct 2015 20:05:53 +0300 Subject: [PATCH 002/109] add slug immutable setting --- modules/article/ArticleModule.php | 2 ++ modules/file/FileModule.php | 4 ++++ modules/gallery/GalleryModule.php | 2 ++ modules/news/NewsModule.php | 3 ++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/article/ArticleModule.php b/modules/article/ArticleModule.php index 2fa35095..fffc02df 100644 --- a/modules/article/ArticleModule.php +++ b/modules/article/ArticleModule.php @@ -13,6 +13,8 @@ class ArticleModule extends \yii\easyii\components\Module 'enableTags' => true, 'itemsInFolder' => false, + 'categorySlugImmutable' => false, + 'itemSlugImmutable' => false ]; public static $installConfig = [ diff --git a/modules/file/FileModule.php b/modules/file/FileModule.php index 72bc269f..7dc4691a 100644 --- a/modules/file/FileModule.php +++ b/modules/file/FileModule.php @@ -3,6 +3,10 @@ class FileModule extends \yii\easyii\components\Module { + public $settings = [ + 'slugImmutable' => false + ]; + public static $installConfig = [ 'title' => [ 'en' => 'Files', diff --git a/modules/gallery/GalleryModule.php b/modules/gallery/GalleryModule.php index 58025ba1..a69be0f9 100644 --- a/modules/gallery/GalleryModule.php +++ b/modules/gallery/GalleryModule.php @@ -6,6 +6,8 @@ class GalleryModule extends \yii\easyii\components\Module public $settings = [ 'categoryThumb' => true, 'itemsInFolder' => false, + 'categoryTags' => true, + 'categorySlugImmutable' => false, ]; public static $installConfig = [ diff --git a/modules/news/NewsModule.php b/modules/news/NewsModule.php index d99df788..fc045954 100644 --- a/modules/news/NewsModule.php +++ b/modules/news/NewsModule.php @@ -8,7 +8,8 @@ class NewsModule extends \yii\easyii\components\Module 'enablePhotos' => true, 'enableShort' => true, 'shortMaxLength' => 256, - 'enableTags' => true + 'enableTags' => true, + 'slugImmutable' => false ]; public static $installConfig = [ From 76bbf2ff2cab950222d8068b7c01f68ae382fdaa Mon Sep 17 00:00:00 2001 From: noumo Date: Fri, 9 Oct 2015 20:06:20 +0300 Subject: [PATCH 003/109] add fancybox asset --- assets/AdminAsset.php | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/AdminAsset.php b/assets/AdminAsset.php index fd88b9c6..c6ce531f 100644 --- a/assets/AdminAsset.php +++ b/assets/AdminAsset.php @@ -14,6 +14,7 @@ class AdminAsset extends \yii\web\AssetBundle 'yii\web\JqueryAsset', 'yii\bootstrap\BootstrapAsset', 'yii\easyii\assets\SwitcherAsset', + 'yii\easyii\assets\FancyboxAsset', ]; public $jsOptions = array( 'position' => \yii\web\View::POS_HEAD From 4c2876dcd346986c6ecde1635b8c4ce921bda60e Mon Sep 17 00:00:00 2001 From: noumo Date: Fri, 9 Oct 2015 20:11:40 +0300 Subject: [PATCH 004/109] image upload rework --- assets/photos/photos.js | 4 +- controllers/InstallController.php | 7 ++ controllers/PhotosController.php | 30 ++++--- helpers/Data.php | 2 - helpers/Image.php | 90 +++++++++++--------- helpers/Upload.php | 36 ++++++-- media/js/admin.js | 1 + messages/ru/install.php | 3 +- models/Photo.php | 20 ++++- modules/article/models/Item.php | 13 ++- modules/article/views/items/_form.php | 6 +- modules/carousel/controllers/AController.php | 18 ++-- modules/carousel/models/Carousel.php | 6 ++ modules/carousel/views/a/_form.php | 4 +- modules/catalog/models/Item.php | 10 ++- modules/catalog/views/items/_form.php | 6 +- modules/news/models/News.php | 33 +++++-- modules/news/views/a/_form.php | 6 +- views/category/_form.php | 13 ++- widgets/views/photos.php | 2 +- 20 files changed, 206 insertions(+), 104 deletions(-) diff --git a/assets/photos/photos.js b/assets/photos/photos.js index 7804282f..5a05815f 100644 --- a/assets/photos/photos.js +++ b/assets/photos/photos.js @@ -23,7 +23,7 @@ $(function(){ if(/^image\/(jpeg|png|gif)$/.test(file.type)) { var formData = new FormData(); - formData.append('Photo[image]', file); + formData.append('Photo[image_file]', file); $.ajax({ url: $this.closest('form').attr('action'), @@ -107,7 +107,7 @@ $(function(){ var fileData = $this.prop('files')[0]; var formData = new FormData(); var changeButton = $this.siblings('.change-image-button').addClass('disabled'); - formData.append('Photo[image]', fileData); + formData.append('Photo[image_file]', fileData); $.ajax({ url: $this.siblings('.change-image-button').attr('href'), dataType: 'json', diff --git a/controllers/InstallController.php b/controllers/InstallController.php index 3e04f083..8082a9ee 100644 --- a/controllers/InstallController.php +++ b/controllers/InstallController.php @@ -184,6 +184,13 @@ private function insertSettings($installForm) 'title' => Yii::t('easyii/install', 'Frontend toolbar position').' ("top" or "bottom")', 'visibility' => Setting::VISIBLE_ROOT ])->execute(); + + $db->createCommand()->insert(Setting::tableName(), [ + 'name' => 'image_max_width', + 'value' => 'top', + 'title' => Yii::t('easyii/install', 'Max image width on upload which will not resize'), + 'visibility' => Setting::VISIBLE_ALL + ])->execute(); } private function installModules() diff --git a/controllers/PhotosController.php b/controllers/PhotosController.php index 27f0a9d2..a8617733 100644 --- a/controllers/PhotosController.php +++ b/controllers/PhotosController.php @@ -2,6 +2,8 @@ namespace yii\easyii\controllers; use Yii; +use yii\easyii\components\Module; +use yii\easyii\helpers\Upload; use yii\helpers\Url; use yii\web\UploadedFile; use yii\web\Response; @@ -36,25 +38,25 @@ public function actionUpload($class, $item_id) $photo = new Photo; $photo->class = $class; $photo->item_id = $item_id; - $photo->image = UploadedFile::getInstance($photo, 'image'); + $photo->image_file = UploadedFile::getInstance($photo, 'image_file'); - if($photo->image && $photo->validate(['image'])){ - $photo->image = Image::upload($photo->image, 'photos', Photo::PHOTO_MAX_WIDTH); + if($photo->image_file && $photo->validate(['image_file'])){ + $photo->image_file = Image::upload($photo->image_file, Module::getModuleName($class)); - if($photo->image){ + if($photo->image_file){ if($photo->save()){ $success = [ 'message' => Yii::t('easyii', 'Photo uploaded'), 'photo' => [ 'id' => $photo->primaryKey, 'image' => $photo->image, - 'thumb' => Image::thumb($photo->image, Photo::PHOTO_THUMB_WIDTH, Photo::PHOTO_THUMB_HEIGHT), + 'thumb' => Image::thumb($photo->image_file, Photo::PHOTO_THUMB_WIDTH, Photo::PHOTO_THUMB_HEIGHT), 'description' => '' ] ]; } else{ - @unlink(Yii::getAlias('@webroot') . str_replace(Url::base(true), '', $photo->image)); + @unlink(Upload::getAbsolutePath($photo->image_file)); $this->error = Yii::t('easyii', 'Create error. {0}', $photo->formatErrors()); } } @@ -97,26 +99,26 @@ public function actionImage($id) if(($photo = Photo::findOne($id))) { - $oldImage = $photo->image; + $oldImage = $photo->image_file; - $photo->image = UploadedFile::getInstance($photo, 'image'); + $photo->image_file = UploadedFile::getInstance($photo, 'image_file'); - if($photo->image && $photo->validate(['image'])){ - $photo->image = Image::upload($photo->image, 'photos', Photo::PHOTO_MAX_WIDTH); - if($photo->image){ + if($photo->image_file && $photo->validate(['image_file'])){ + $photo->image_file = Image::upload($photo->image_file, 'photos'); + if($photo->image_file){ if($photo->save()){ - @unlink(Yii::getAlias('@webroot').$oldImage); + @unlink(Upload::getAbsolutePath($oldImage)); $success = [ 'message' => Yii::t('easyii', 'Photo uploaded'), 'photo' => [ 'image' => $photo->image, - 'thumb' => Image::thumb($photo->image, Photo::PHOTO_THUMB_WIDTH, Photo::PHOTO_THUMB_HEIGHT) + 'thumb' => Image::thumb($photo->image_file, Photo::PHOTO_THUMB_WIDTH, Photo::PHOTO_THUMB_HEIGHT) ] ]; } else{ - @unlink(Yii::getAlias('@webroot').$photo->image); + @unlink(Upload::getAbsolutePath($photo->image_file)); $this->error = Yii::t('easyii', 'Update error. {0}', $photo->formatErrors()); } diff --git a/helpers/Data.php b/helpers/Data.php index 1d054f30..7656c91d 100644 --- a/helpers/Data.php +++ b/helpers/Data.php @@ -2,8 +2,6 @@ namespace yii\easyii\helpers; use Yii; -use yii\helpers\Inflector; -use yii\helpers\StringHelper; class Data { diff --git a/helpers/Image.php b/helpers/Image.php index 36fe11a8..16f059f4 100644 --- a/helpers/Image.php +++ b/helpers/Image.php @@ -2,6 +2,7 @@ namespace yii\easyii\helpers; use Yii; +use yii\easyii\models\Setting; use yii\web\UploadedFile; use yii\web\HttpException; use yii\helpers\FileHelper; @@ -10,75 +11,86 @@ class Image { - public static function upload(UploadedFile $fileInstance, $dir = '', $resizeWidth = null, $resizeHeight = null, $resizeCrop = false) + public static function upload(UploadedFile $fileInstance, $dir = '') { $fileName = Upload::getUploadPath($dir) . DIRECTORY_SEPARATOR . Upload::getFileName($fileInstance); - $uploaded = $resizeWidth - ? self::copyResizedImage($fileInstance->tempName, $fileName, $resizeWidth, $resizeHeight, $resizeCrop) - : $fileInstance->saveAs($fileName); + $imageInfo = getimagesize($fileInstance->tempName); + + $maxWidth = (int)Setting::get('image_max_width'); + if($maxWidth > 0 && $imageInfo[0] > $maxWidth){ + $uploaded = self::resize($fileInstance->tempName, $fileName, Setting::get('image_max_width')); + } else { + $uploaded = $fileInstance->saveAs($fileName); + } if(!$uploaded){ - throw new HttpException(500, 'Cannot upload file "'.$fileName.'". Please check write permissions.'); + throw new HttpException(500, 'Cannot upload file "'.$fileName.'". Please check write permissions. Also check GD and Imagick extensions.'); } - return Upload::getLink($fileName); + return $dir ? $dir . '/' . basename($fileName) : basename($fileName); } - static function thumb($filename, $width = null, $height = null, $crop = true) + static function thumb($filename, $width = null, $height = null) { - if($filename && is_file(($filename = Yii::getAlias('@webroot') . $filename))) + $filename = Upload::getAbsolutePath($filename); + + if(is_file($filename)) { $info = pathinfo($filename); - $thumbName = $info['filename'] . '-' . md5( filemtime($filename) . (int)$width . (int)$height . (int)$crop ) . '.' . $info['extension']; - $thumbFile = Yii::getAlias('@webroot') . DIRECTORY_SEPARATOR . Upload::$UPLOADS_DIR . DIRECTORY_SEPARATOR . 'thumbs' . DIRECTORY_SEPARATOR . $thumbName; - $thumbWebFile = '/' . Upload::$UPLOADS_DIR . '/thumbs/' . $thumbName; + $thumbName = $info['filename'] . '-' . md5( filemtime($filename) . (int)$width . (int)$height) . '.' . $info['extension']; + $thumbFile = Upload::getUploadPath('thumbs') . DIRECTORY_SEPARATOR . $thumbName; + $thumbWebFile = Upload::getLink('thumbs/' . $thumbName); if(file_exists($thumbFile)){ return $thumbWebFile; - } - elseif(FileHelper::createDirectory(dirname($thumbFile), 0777) && self::copyResizedImage($filename, $thumbFile, $width, $height, $crop)){ + } elseif(self::crop($filename, $thumbFile, $width, $height)){ return $thumbWebFile; } } return ''; } - static function copyResizedImage($inputFile, $outputFile, $width, $height = null, $crop = true) + static function crop($inputFile, $outputFile, $width, $height) { - if (extension_loaded('gd')) + if(extension_loaded('imagick')) { - $image = new GD($inputFile); + $center = new \stojg\crop\CropBalanced($inputFile); + $croppedImage = $center->resizeAndCrop($width, $height); - if($height) { - if($width && $crop){ - $image->cropThumbnail($width, $height); - } else { - $image->resize($width, $height); - } - } else { - $image->resize($width); - } - return $image->save($outputFile); + return $croppedImage->writeimage($outputFile); } - elseif(extension_loaded('imagick')) + elseif (extension_loaded('gd')) { - $image = new \Imagick($inputFile); - - if($height && !$crop) { - $image->resizeImage($width, $height, \Imagick::FILTER_LANCZOS, 1, true); - } - else{ - $image->resizeImage($width, null, \Imagick::FILTER_LANCZOS, 1); - } + $image = new GD($inputFile); + $image->cropThumbnail($width, $height); + return $image->save($outputFile); + } + else { + return false; + } + } - if($height && $crop){ - $image->cropThumbnailImage($width, $height); - } + static function resize($inputFile, $outputFile, $width = null, $height = null) + { + if(!$width && !$height){ + throw new HttpException(500, 'Width or Height must be set on resizing.'); + } + if(extension_loaded('imagick')) + { + $image = new \Imagick($inputFile); + $image->resizeImage($width, $height, \Imagick::FILTER_CUBIC, 0.5, ($width && $height)); return $image->writeImage($outputFile); } + elseif (extension_loaded('gd')) + { + $image = new GD($inputFile); + $image->resize($width, $height); + + return $image->save($outputFile); + } else { - throw new HttpException(500, 'Please install GD or Imagick extension'); + return false; } } } \ No newline at end of file diff --git a/helpers/Upload.php b/helpers/Upload.php index 235d5746..c2ee0fe2 100644 --- a/helpers/Upload.php +++ b/helpers/Upload.php @@ -2,6 +2,7 @@ namespace yii\easyii\helpers; use Yii; +use yii\web\ServerErrorHttpException; use yii\web\UploadedFile; use \yii\web\HttpException; use yii\helpers\Inflector; @@ -23,9 +24,15 @@ public static function file(UploadedFile $fileInstance, $dir = '', $namePostfix return Upload::getLink($fileName); } - static function getUploadPath($dir) + static function getUploadPath($dir = null) { - $uploadPath = Yii::getAlias('@webroot').DIRECTORY_SEPARATOR.self::$UPLOADS_DIR.($dir ? DIRECTORY_SEPARATOR.$dir : ''); + $uploadPath = Yii::getAlias('@uploads'); + if(!$uploadPath){ + throw new ServerErrorHttpException('Alias `@uploads` is not set.'); + } + if($dir){ + $uploadPath .= DIRECTORY_SEPARATOR . $dir; + } if(!FileHelper::createDirectory($uploadPath)){ throw new HttpException(500, 'Cannot create "'.$uploadPath.'". Please check write permissions.'); } @@ -34,17 +41,32 @@ static function getUploadPath($dir) static function getLink($fileName) { - return str_replace('\\', '/', str_replace(Yii::getAlias('@webroot'), '', $fileName)); + return '/' . implode('/', array_filter([ + Yii::getAlias('@web'), + basename(Yii::getAlias('@uploads')), + str_replace('\\', '/', $fileName) + ])); + } + + static function getAbsolutePath($fileName) + { + if(!$fileName){ + return null; + } + if(strpos($fileName, Yii::getAlias('@uploads')) !== false ){ + return $fileName; + } else { + return Yii::getAlias('@uploads') . DIRECTORY_SEPARATOR . $fileName; + } } - static function getFileName($fileInstance, $namePostfix = true) + static function getFileName(UploadedFile $fileInstance, $namePostfix = true) { - $baseName = str_ireplace('.'.$fileInstance->extension, '', $fileInstance->name); - $fileName = StringHelper::truncate(Inflector::slug($baseName), 32, ''); + $fileName = StringHelper::truncate(Inflector::slug($fileInstance->baseName), 32, ''); if($namePostfix || !$fileName) { $fileName .= ($fileName ? '-' : '') . substr(uniqid(md5(rand()), true), 0, 10); } - $fileName .= '.' . $fileInstance->extension; + $fileName .= '.' . strtolower($fileInstance->extension); return $fileName; } diff --git a/media/js/admin.js b/media/js/admin.js index fec01696..ef7b55f8 100644 --- a/media/js/admin.js +++ b/media/js/admin.js @@ -75,6 +75,7 @@ $(function(){ }); window.notify = new Notify(); + $('.fancybox').fancybox(); }); var Notify = function() { diff --git a/messages/ru/install.php b/messages/ru/install.php index ec426538..c14a1ff5 100644 --- a/messages/ru/install.php +++ b/messages/ru/install.php @@ -17,5 +17,6 @@ 'Installation completed' => 'Установка завершена', 'Installation error' => 'Ошибка установки', 'Cannot connect to database. Please configure `{0}`.' => 'Ошибка при подключении к базе данных. Пожалуйста проверьте настройки `{0}`.', - 'EasyiiCMS is already installed. If you want to reinstall easyiiCMS, please drop all tables with prefix `easyii_` from your database manually.' => 'EasyiiCMS уже установлена. Если вы хотите произвести переустановку, удалите все таблицы с префиксом `easyii_` в вашей базе данных.' + 'EasyiiCMS is already installed. If you want to reinstall easyiiCMS, please drop all tables with prefix `easyii_` from your database manually.' => 'EasyiiCMS уже установлена. Если вы хотите произвести переустановку, удалите все таблицы с префиксом `easyii_` в вашей базе данных.', + 'Max image width on upload which will not resize' => 'Максимальная ширина загружаемых изображений, которые автоматически не сжимаются' ]; \ No newline at end of file diff --git a/models/Photo.php b/models/Photo.php index f7d980ff..8f2aa123 100644 --- a/models/Photo.php +++ b/models/Photo.php @@ -3,10 +3,19 @@ use Yii; use yii\easyii\behaviors\SortableModel; +use yii\easyii\helpers\Upload; +/** + * @property integer $photo_id + * @property integer $item_id + * @property string $image_file + * @property string $description + * @property string $class + * + * @property string $image +*/ class Photo extends \yii\easyii\components\ActiveRecord { - const PHOTO_MAX_WIDTH = 1900; const PHOTO_THUMB_WIDTH = 120; const PHOTO_THUMB_HEIGHT = 90; @@ -20,7 +29,7 @@ public function rules() return [ [['class', 'item_id'], 'required'], ['item_id', 'integer'], - ['image', 'image'], + ['image_file', 'image'], ['description', 'trim'] ]; } @@ -36,6 +45,11 @@ public function afterDelete() { parent::afterDelete(); - @unlink(Yii::getAlias('@webroot').$this->image); + @unlink(Upload::getAbsolutePath($this->image_file)); + } + + public function getImage() + { + return Upload::getLink($this->image_file); } } \ No newline at end of file diff --git a/modules/article/models/Item.php b/modules/article/models/Item.php index 9cffaaf8..ea911886 100644 --- a/modules/article/models/Item.php +++ b/modules/article/models/Item.php @@ -5,7 +5,9 @@ use yii\behaviors\SluggableBehavior; use yii\easyii\behaviors\SeoBehavior; use yii\easyii\behaviors\Taggable; +use yii\easyii\helpers\Upload; use yii\easyii\models\Photo; +use yii\easyii\modules\article\ArticleModule; use yii\helpers\StringHelper; class Item extends \yii\easyii\components\ActiveRecord @@ -55,7 +57,8 @@ public function behaviors() 'sluggable' => [ 'class' => SluggableBehavior::className(), 'attribute' => 'title', - 'ensureUnique' => true + 'ensureUnique' => true, + 'immutable' => ArticleModule::setting('itemSlugImmutable') ] ]; } @@ -70,11 +73,15 @@ public function getPhotos() return $this->hasMany(Photo::className(), ['item_id' => 'item_id'])->where(['class' => self::className()])->sort(); } + public function getImage() + { + return Upload::getLink($this->image_file); + } + public function beforeSave($insert) { if (parent::beforeSave($insert)) { - $settings = Yii::$app->getModule('admin')->activeModules['article']->settings; - $this->short = StringHelper::truncate($settings['enableShort'] ? $this->short : strip_tags($this->text), $settings['shortMaxLength']); + $this->short = StringHelper::truncate(ArticleModule::setting('enableShort') ? $this->short : strip_tags($this->text), ArticleModule::setting('shortMaxLength')); if(!$insert && $this->image != $this->oldAttributes['image'] && $this->oldAttributes['image']){ @unlink(Yii::getAlias('@webroot').$this->oldAttributes['image']); diff --git a/modules/article/views/items/_form.php b/modules/article/views/items/_form.php index 1450d59b..f2352fe7 100644 --- a/modules/article/views/items/_form.php +++ b/modules/article/views/items/_form.php @@ -17,11 +17,11 @@ field($model, 'title') ?> context->module->settings['articleThumb']) : ?> - image) : ?> - + image_file) : ?> + - field($model, 'image')->fileInput() ?> + field($model, 'image_file')->fileInput() ?> context->module->settings['enableShort']) : ?> diff --git a/modules/carousel/controllers/AController.php b/modules/carousel/controllers/AController.php index 770b9249..8bc95453 100644 --- a/modules/carousel/controllers/AController.php +++ b/modules/carousel/controllers/AController.php @@ -49,11 +49,11 @@ public function actionCreate() return ActiveForm::validate($model); } else{ - if(($fileInstanse = UploadedFile::getInstance($model, 'image'))) + if(($fileInstanse = UploadedFile::getInstance($model, 'image_file'))) { - $model->image = $fileInstanse; - if($model->validate(['image'])){ - $model->image = Image::upload($model->image, 'carousel'); + $model->image_file = $fileInstanse; + if($model->validate(['image_file'])){ + $model->image_file = Image::upload($model->image_file, 'carousel'); $model->status = Carousel::STATUS_ON; if($model->save()){ @@ -96,11 +96,11 @@ public function actionEdit($id) return ActiveForm::validate($model); } else{ - if(($fileInstanse = UploadedFile::getInstance($model, 'image'))) + if(($fileInstanse = UploadedFile::getInstance($model, 'image_file'))) { - $model->image = $fileInstanse; - if($model->validate(['image'])){ - $model->image = Image::upload($model->image, 'carousel'); + $model->image_file = $fileInstanse; + if($model->validate(['image_file'])){ + $model->image_file = Image::upload($model->image_file, 'carousel'); } else { $this->flash('error', Yii::t('easyii', 'Update error. {0}', $model->formatErrors())); @@ -108,7 +108,7 @@ public function actionEdit($id) } } else{ - $model->image = $model->oldAttributes['image']; + $model->image_file = $model->oldAttributes['image_file']; } if($model->save()){ diff --git a/modules/carousel/models/Carousel.php b/modules/carousel/models/Carousel.php index 840cf89e..90f8d6e3 100644 --- a/modules/carousel/models/Carousel.php +++ b/modules/carousel/models/Carousel.php @@ -4,6 +4,7 @@ use Yii; use yii\easyii\behaviors\CacheFlush; use yii\easyii\behaviors\SortableModel; +use yii\easyii\helpers\Upload; class Carousel extends \yii\easyii\components\ActiveRecord { @@ -44,6 +45,11 @@ public function behaviors() ]; } + public function getImage() + { + return Upload::getLink($this->image_file); + } + public function beforeSave($insert) { if (parent::beforeSave($insert)) { diff --git a/modules/carousel/views/a/_form.php b/modules/carousel/views/a/_form.php index 9df55e08..3f3316a9 100644 --- a/modules/carousel/views/a/_form.php +++ b/modules/carousel/views/a/_form.php @@ -7,9 +7,9 @@ 'options' => ['enctype' => 'multipart/form-data', 'class' => 'model-form'] ]); ?> image) : ?> - + -field($model, 'image')->fileInput() ?> +field($model, 'image_file')->fileInput() ?> field($model, 'link') ?> context->module->settings['enableTitle']) : ?> field($model, 'title')->textarea() ?> diff --git a/modules/catalog/models/Item.php b/modules/catalog/models/Item.php index d5500082..90b71411 100644 --- a/modules/catalog/models/Item.php +++ b/modules/catalog/models/Item.php @@ -4,7 +4,9 @@ use Yii; use yii\behaviors\SluggableBehavior; use yii\easyii\behaviors\SeoBehavior; +use yii\easyii\helpers\Upload; use yii\easyii\models\Photo; +use yii\easyii\modules\catalog\CatalogModule; class Item extends \yii\easyii\components\ActiveRecord { @@ -55,7 +57,8 @@ public function behaviors() 'sluggable' => [ 'class' => SluggableBehavior::className(), 'attribute' => 'title', - 'ensureUnique' => true + 'ensureUnique' => true, + 'immutable' => CatalogModule::setting('itemSlugImmutable') ] ]; } @@ -121,6 +124,11 @@ public function getCategory() return $this->hasOne(Category::className(), ['category_id' => 'category_id']); } + public function getImage() + { + return Upload::getLink($this->image_file); + } + public function afterDelete() { parent::afterDelete(); diff --git a/modules/catalog/views/items/_form.php b/modules/catalog/views/items/_form.php index f4a3102b..f2098d64 100644 --- a/modules/catalog/views/items/_form.php +++ b/modules/catalog/views/items/_form.php @@ -16,11 +16,11 @@ ]); ?> field($model, 'title') ?> - image) : ?> - + image_file) : ?> + - field($model, 'image')->fileInput() ?> + field($model, 'image_file')->fileInput() ?> diff --git a/modules/news/models/News.php b/modules/news/models/News.php index 54978f27..e6de4ecb 100644 --- a/modules/news/models/News.php +++ b/modules/news/models/News.php @@ -5,9 +5,25 @@ use yii\behaviors\SluggableBehavior; use yii\easyii\behaviors\SeoBehavior; use yii\easyii\behaviors\Taggable; +use yii\easyii\helpers\Upload; use yii\easyii\models\Photo; +use yii\easyii\modules\news\NewsModule; use yii\helpers\StringHelper; +/** + * @property integer $news_id + * @property string $title + * @property string $short + * @property string $text + * @property string $image_file + * @property string $slug + * @property integer $time + * @property integer $views + * @property integer $status + * + * @property string $image + */ + class News extends \yii\easyii\components\ActiveRecord { const STATUS_OFF = 0; @@ -24,7 +40,7 @@ public function rules() [['text', 'title'], 'required'], [['title', 'short', 'text'], 'trim'], ['title', 'string', 'max' => 128], - ['image', 'image'], + ['image_file', 'image'], [['views', 'time', 'status'], 'integer'], ['time', 'default', 'value' => time()], ['slug', 'match', 'pattern' => self::$SLUG_PATTERN, 'message' => Yii::t('easyii', 'Slug can contain only 0-9, a-z and "-" characters (max: 128).')], @@ -55,7 +71,8 @@ public function behaviors() 'sluggable' => [ 'class' => SluggableBehavior::className(), 'attribute' => 'title', - 'ensureUnique' => true + 'ensureUnique' => true, + 'immutable' => NewsModule::setting('slugImmutable') ], ]; } @@ -65,16 +82,18 @@ public function getPhotos() return $this->hasMany(Photo::className(), ['item_id' => 'news_id'])->where(['class' => self::className()])->sort(); } - + public function getImage() + { + return Upload::getLink($this->image_file); + } public function beforeSave($insert) { if (parent::beforeSave($insert)) { - $settings = Yii::$app->getModule('admin')->activeModules['news']->settings; - $this->short = StringHelper::truncate($settings['enableShort'] ? $this->short : strip_tags($this->text), $settings['shortMaxLength']); + $this->short = StringHelper::truncate(NewsModule::setting('enableShort') ? $this->short : strip_tags($this->text), NewsModule::setting('shortMaxLength')); - if(!$insert && $this->image != $this->oldAttributes['image'] && $this->oldAttributes['image']){ - @unlink(Yii::getAlias('@webroot').$this->oldAttributes['image']); + if(!$insert && $this->image != $this->oldAttributes['image_file'] && $this->oldAttributes['image_file']){ + @unlink(Upload::getAbsolutePath($this->oldAttributes['image_file'])); } return true; } else { diff --git a/modules/news/views/a/_form.php b/modules/news/views/a/_form.php index 22963deb..51a502f1 100644 --- a/modules/news/views/a/_form.php +++ b/modules/news/views/a/_form.php @@ -16,11 +16,11 @@ ]); ?> field($model, 'title') ?> context->module->settings['enableThumb']) : ?> - image) : ?> - + image_file) : ?> + - field($model, 'image')->fileInput() ?> + field($model, 'image_file')->fileInput() ?> context->module->settings['enableShort']) : ?> field($model, 'short')->textarea() ?> diff --git a/views/category/_form.php b/views/category/_form.php index 3e4cb4ae..357e4392 100644 --- a/views/category/_form.php +++ b/views/category/_form.php @@ -1,5 +1,6 @@ - - image) : ?> - + + image_file) : ?> + - field($model, 'image')->fileInput() ?> + field($model, 'image_file')->fileInput() ?> + + + + field($model, 'tagNames')->widget(TagsInput::className()) ?> diff --git a/widgets/views/photos.php b/widgets/views/photos.php index 53a7179b..64c5b2c6 100644 --- a/widgets/views/photos.php +++ b/widgets/views/photos.php @@ -56,7 +56,7 @@ primaryKey, Image::thumb($photo->image, Photo::PHOTO_THUMB_WIDTH, Photo::PHOTO_THUMB_HEIGHT), $photo->image, $photo->description], + [$photo->primaryKey, Image::thumb($photo->image_file, Photo::PHOTO_THUMB_WIDTH, Photo::PHOTO_THUMB_HEIGHT), $photo->image, $photo->description], $photoTemplate) ?> From ee7850e5ee552b7b6f339f53164bca5fccd403c2 Mon Sep 17 00:00:00 2001 From: noumo Date: Fri, 9 Oct 2015 20:14:05 +0300 Subject: [PATCH 005/109] Settings refactoring --- components/Module.php | 12 ++++++++++-- controllers/ModulesController.php | 1 + models/Module.php | 5 +++++ modules/article/api/Article.php | 21 +++++++++++++++++---- modules/article/api/CategoryObject.php | 3 ++- modules/feedback/api/Feedback.php | 8 ++++---- modules/feedback/models/Feedback.php | 15 ++++++--------- modules/news/api/News.php | 5 +++-- modules/shopcart/api/Shopcart.php | 6 +++--- modules/shopcart/models/Order.php | 21 +++++++++------------ 10 files changed, 60 insertions(+), 37 deletions(-) diff --git a/components/Module.php b/components/Module.php index 802c14b0..103fd352 100644 --- a/components/Module.php +++ b/components/Module.php @@ -19,6 +19,8 @@ class Module extends \yii\base\Module /** @var @todo */ public $i18n; + public static $NAME; + /** * Configuration for installation * @var array @@ -35,8 +37,8 @@ public function init() { parent::init(); - $moduleName = self::getModuleName(self::className()); - self::registerTranslations($moduleName); + static::$NAME = static::getModuleName(static::className()); + static::registerTranslations(static::$NAME); } /** @@ -83,4 +85,10 @@ public static function getModuleName($namespace) } return false; } + + public static function setting($name) + { + $settings = Yii::$app->getModule('admin')->activeModules[static::$NAME]->settings; + return $settings[$name] !== null ? $settings[$name] : null; + } } \ No newline at end of file diff --git a/controllers/ModulesController.php b/controllers/ModulesController.php index 2ec3109a..b046e6df 100644 --- a/controllers/ModulesController.php +++ b/controllers/ModulesController.php @@ -202,6 +202,7 @@ public function actionCopy($id) if(!$object->isDir()){ $fileContent = file_get_contents($file); $fileContent = str_replace($oldNameSpace, $newNameSpace, $fileContent); + $fileContent = str_replace($oldModuleClass, $newModuleClass, $fileContent); $fileContent = str_replace("Yii::t('easyii/".$module->name, "Yii::t('easyii/".$formModel->name, $fileContent); $fileContent = str_replace("'".$module->name."'", "'".$formModel->name."'", $fileContent); diff --git a/models/Module.php b/models/Module.php index 3142f3f3..c00ce44b 100644 --- a/models/Module.php +++ b/models/Module.php @@ -97,6 +97,11 @@ public function setSettings($settings) $this->settings = $newSettings; } + public function appendSettings($newSettings) + { + $this->settings = array_merge($this->settings, $newSettings); + } + public function checkExists($attribute) { if(!class_exists($this->$attribute)){ diff --git a/modules/article/api/Article.php b/modules/article/api/Article.php index 59ed9b23..4446c019 100644 --- a/modules/article/api/Article.php +++ b/modules/article/api/Article.php @@ -5,6 +5,7 @@ use yii\data\ActiveDataProvider; use yii\easyii\models\Tag; +use yii\easyii\modules\article\ArticleModule; use yii\easyii\modules\article\models\Category; use yii\easyii\modules\article\models\Item; use yii\easyii\widgets\Fancybox; @@ -46,9 +47,21 @@ public function api_tree() return Category::tree(); } - public function api_cats() + public function api_cats($options = []) { - return Category::cats(); + $result = []; + foreach(Category::cats() as $model){ + $result[] = new CategoryObject($model); + } + if(!empty($options['tags'])){ + foreach($result as $i => $item){ + if(!in_array($options['tags'], $item->tags)){ + unset($result[$i]); + } + } + } + + return $result; } public function api_items($options = []) @@ -57,7 +70,7 @@ public function api_items($options = []) $this->_items = []; $with = ['seo', 'category']; - if(Yii::$app->getModule('admin')->activeModules['article']->settings['enableTags']){ + if(ArticleModule::setting('enableTags')){ $with[] = 'tags'; } $query = Item::find()->with($with)->status(Item::STATUS_ON); @@ -98,7 +111,7 @@ public function api_last($limit = 1, $where = null) $result = []; $with = ['seo']; - if(Yii::$app->getModule('admin')->activeModules['article']->settings['enableTags']){ + if(ArticleModule::setting('enableTags')){ $with[] = 'tags'; } $query = Item::find()->with($with)->status(Item::STATUS_ON)->sortDate()->limit($limit); diff --git a/modules/article/api/CategoryObject.php b/modules/article/api/CategoryObject.php index 05a9e8f9..80bc8624 100644 --- a/modules/article/api/CategoryObject.php +++ b/modules/article/api/CategoryObject.php @@ -5,6 +5,7 @@ use yii\data\ActiveDataProvider; use yii\easyii\components\API; use yii\easyii\models\Tag; +use yii\easyii\modules\article\ArticleModule; use yii\easyii\modules\article\models\Item; use yii\helpers\Url; use yii\widgets\LinkPager; @@ -37,7 +38,7 @@ public function items($options = []) $this->_items = []; $with = ['seo']; - if(Yii::$app->getModule('admin')->activeModules['article']->settings['enableTags']){ + if(ArticleModule::settings('enableTags')){ $with[] = 'tags'; } diff --git a/modules/feedback/api/Feedback.php b/modules/feedback/api/Feedback.php index 46f0330b..dc4e9c46 100644 --- a/modules/feedback/api/Feedback.php +++ b/modules/feedback/api/Feedback.php @@ -2,6 +2,7 @@ namespace yii\easyii\modules\feedback\api; use Yii; +use yii\easyii\modules\feedback\FeedbackModule; use yii\easyii\modules\feedback\models\Feedback as FeedbackModel; use yii\helpers\Html; @@ -30,7 +31,6 @@ class Feedback extends \yii\easyii\components\API public function api_form($options = []) { $model = new FeedbackModel; - $settings = Yii::$app->getModule('admin')->activeModules['feedback']->settings; $options = array_merge($this->_defaultFormOptions, $options); ob_start(); @@ -45,12 +45,12 @@ public function api_form($options = []) echo $form->field($model, 'name'); echo $form->field($model, 'email')->input('email'); - if($settings['enablePhone']) echo $form->field($model, 'phone'); - if($settings['enableTitle']) echo $form->field($model, 'title'); + if(FeedbackModule::setting('enablePhone')) echo $form->field($model, 'phone'); + if(FeedbackModule::setting('enableTitle')) echo $form->field($model, 'title'); echo $form->field($model, 'text')->textarea(); - if($settings['enableCaptcha']) echo $form->field($model, 'reCaptcha')->widget(ReCaptcha::className()); + if(FeedbackModule::setting('enableCaptcha')) echo $form->field($model, 'reCaptcha')->widget(ReCaptcha::className()); echo Html::submitButton(Yii::t('easyii', 'Send'), ['class' => 'btn btn-primary']); ActiveForm::end(); diff --git a/modules/feedback/models/Feedback.php b/modules/feedback/models/Feedback.php index 07cfe5cd..b0072468 100644 --- a/modules/feedback/models/Feedback.php +++ b/modules/feedback/models/Feedback.php @@ -5,6 +5,7 @@ use yii\easyii\behaviors\CalculateNotice; use yii\easyii\helpers\Mail; use yii\easyii\models\Setting; +use yii\easyii\modules\feedback\FeedbackModule; use yii\easyii\validators\ReCaptchaValidator; use yii\easyii\validators\EscapeValidator; use yii\helpers\Url; @@ -34,7 +35,7 @@ public function rules() ['email', 'email'], ['phone', 'match', 'pattern' => '/^[\d\s-\+\(\)]+$/'], ['reCaptcha', ReCaptchaValidator::className(), 'when' => function($model){ - return $model->isNewRecord && Yii::$app->getModule('admin')->activeModules['feedback']->settings['enableCaptcha']; + return $model->isNewRecord && FeedbackModule::setting('enableCaptcha'); }], ]; } @@ -90,27 +91,23 @@ public function behaviors() public function mailAdmin() { - $settings = Yii::$app->getModule('admin')->activeModules['feedback']->settings; - - if(!$settings['mailAdminOnNewFeedback']){ + if(!FeedbackModule::setting('mailAdminOnNewFeedback')){ return false; } return Mail::send( Setting::get('admin_email'), - $settings['subjectOnNewFeedback'], - $settings['templateOnNewFeedback'], + FeedbackModule::setting('subjectOnNewFeedback'), + FeedbackModule::setting('templateOnNewFeedback'), ['feedback' => $this, 'link' => Url::to(['/admin/feedback/a/view', 'id' => $this->primaryKey], true)] ); } public function sendAnswer() { - $settings = Yii::$app->getModule('admin')->activeModules['feedback']->settings; - return Mail::send( $this->email, $this->answer_subject, - $settings['answerTemplate'], + FeedbackModule::setting('answerTemplate'), ['feedback' => $this], ['replyTo' => Setting::get('admin_email')] ); diff --git a/modules/news/api/News.php b/modules/news/api/News.php index df817384..e4bd7d5b 100644 --- a/modules/news/api/News.php +++ b/modules/news/api/News.php @@ -4,6 +4,7 @@ use Yii; use yii\data\ActiveDataProvider; use yii\easyii\models\Tag; +use yii\easyii\modules\news\NewsModule; use yii\easyii\widgets\Fancybox; use yii\widgets\LinkPager; @@ -34,7 +35,7 @@ public function api_items($options = []) $this->_items = []; $with = ['seo']; - if(Yii::$app->getModule('admin')->activeModules['news']->settings['enableTags']){ + if(NewsModule::setting('enableTags')){ $with[] = 'tags'; } $query = NewsModel::find()->with($with)->status(NewsModel::STATUS_ON); @@ -81,7 +82,7 @@ public function api_last($limit = 1) } $with = ['seo']; - if(Yii::$app->getModule('admin')->activeModules['news']->settings['enableTags']){ + if(NewsModule::setting('enableTags')){ $with[] = 'tags'; } diff --git a/modules/shopcart/api/Shopcart.php b/modules/shopcart/api/Shopcart.php index 334c9b2a..2ba2f446 100644 --- a/modules/shopcart/api/Shopcart.php +++ b/modules/shopcart/api/Shopcart.php @@ -5,6 +5,7 @@ use yii\easyii\modules\catalog\models\Item; use yii\easyii\modules\shopcart\models\Good; use yii\easyii\modules\shopcart\models\Order; +use yii\easyii\modules\shopcart\ShopcartModule; use yii\helpers\Html; use yii\helpers\Url; use yii\widgets\ActiveForm; @@ -57,7 +58,6 @@ public function api_form($options = []) { $model = new Order; $model->scenario = 'confirm'; - $settings = Yii::$app->getModule('admin')->activeModules['shopcart']->settings; $options = array_merge($this->_defaultFormOptions, $options); ob_start(); @@ -71,8 +71,8 @@ public function api_form($options = []) echo $form->field($model, 'name'); echo $form->field($model, 'address'); - if($settings['enableEmail']) echo $form->field($model, 'email'); - if($settings['enablePhone']) echo $form->field($model, 'phone'); + if(ShopcartModule::setting('enableEmail')) echo $form->field($model, 'email'); + if(ShopcartModule::setting('enablePhone')) echo $form->field($model, 'phone'); echo $form->field($model, 'comment')->textarea(); diff --git a/modules/shopcart/models/Order.php b/modules/shopcart/models/Order.php index ffb98d15..b42ea3c3 100644 --- a/modules/shopcart/models/Order.php +++ b/modules/shopcart/models/Order.php @@ -5,6 +5,7 @@ use yii\easyii\behaviors\CalculateNotice; use yii\easyii\helpers\Mail; use yii\easyii\models\Setting; +use yii\easyii\modules\shopcart\ShopcartModule; use yii\easyii\validators\EscapeValidator; use yii\helpers\Url; @@ -30,8 +31,8 @@ public function rules() { return [ [['name', 'address'], 'required', 'on' => 'confirm'], - ['email', 'required', 'when' => function($model){ return $model->scenario == 'confirm' && Yii::$app->getModule('admin')->activeModules['shopcart']->settings['enableEmail']; }], - ['phone', 'required', 'when' => function($model){ return $model->scenario == 'confirm' && Yii::$app->getModule('admin')->activeModules['shopcart']->settings['enablePhone']; }], + ['email', 'required', 'when' => function($model){ return $model->scenario == 'confirm' && ShopcartModule::setting('enableEmail'); }], + ['phone', 'required', 'when' => function($model){ return $model->scenario == 'confirm' && ShopcartModule::setting('enablePhone'); }], [['name', 'address', 'phone', 'comment'], 'trim'], ['email', 'email'], ['name', 'string', 'max' => 32], @@ -138,15 +139,13 @@ public function afterDelete() public function mailAdmin() { - $settings = Yii::$app->getModule('admin')->activeModules['shopcart']->settings; - - if(!$settings['mailAdminOnNewOrder']){ + if(!ShopcartModule::setting('mailAdminOnNewOrder')){ return false; } return Mail::send( Setting::get('admin_email'), - $settings['subjectOnNewOrder'], - $settings['templateOnNewOrder'], + ShopcartModule::setting('subjectOnNewOrder'), + ShopcartModule::setting('templateOnNewOrder'), [ 'order' => $this, 'link' => Url::to(['/admin/shopcart/a/view', 'id' => $this->primaryKey], true) @@ -156,15 +155,13 @@ public function mailAdmin() public function notifyUser() { - $settings = Yii::$app->getModule('admin')->activeModules['shopcart']->settings; - return Mail::send( $this->email, - $settings['subjectNotifyUser'], - $settings['templateNotifyUser'], + ShopcartModule::setting('subjectNotifyUser'), + ShopcartModule::setting('templateNotifyUser'), [ 'order' => $this, - 'link' => Url::to([$settings['frontendShopcartRoute'], 'id' => $this->primaryKey, 'token' => $this->access_token], true) + 'link' => Url::to([ShopcartModule::setting('frontendShopcartRoute'), 'id' => $this->primaryKey, 'token' => $this->access_token], true) ] ); } From 264fc455ae8d5b4c056550c7dc49f499bab6c10d Mon Sep 17 00:00:00 2001 From: noumo Date: Fri, 9 Oct 2015 20:15:20 +0300 Subject: [PATCH 006/109] settings refactor --- modules/guestbook/api/Guestbook.php | 8 ++++---- modules/guestbook/models/Guestbook.php | 21 +++++++++------------ modules/news/controllers/AController.php | 2 ++ 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/modules/guestbook/api/Guestbook.php b/modules/guestbook/api/Guestbook.php index 399383ba..8af1e386 100644 --- a/modules/guestbook/api/Guestbook.php +++ b/modules/guestbook/api/Guestbook.php @@ -3,6 +3,7 @@ use Yii; use yii\data\ActiveDataProvider; +use yii\easyii\modules\guestbook\GuestbookModule; use yii\helpers\Url; use yii\widgets\LinkPager; use yii\helpers\Html; @@ -80,7 +81,6 @@ public function api_last($limit = 1) public function api_form($options = []) { $model = new GuestbookModel; - $settings = Yii::$app->getModule('admin')->activeModules['guestbook']->settings; $options = array_merge($this->_defaultFormOptions, $options); ob_start(); @@ -94,12 +94,12 @@ public function api_form($options = []) echo $form->field($model, 'name'); - if($settings['enableTitle']) echo $form->field($model, 'title'); - if($settings['enableEmail']) echo $form->field($model, 'email'); + if(GuestbookModule::setting('enableTitle')) echo $form->field($model, 'title'); + if(GuestbookModule::setting('enableEmail')) echo $form->field($model, 'email'); echo $form->field($model, 'text')->textarea(); - if($settings['enableCaptcha']) echo $form->field($model, 'reCaptcha')->widget(ReCaptcha::className()); + if(GuestbookModule::setting('enableCaptcha')) echo $form->field($model, 'reCaptcha')->widget(ReCaptcha::className()); echo Html::submitButton(Yii::t('easyii', 'Send'), ['class' => 'btn btn-primary']); ActiveForm::end(); diff --git a/modules/guestbook/models/Guestbook.php b/modules/guestbook/models/Guestbook.php index cc4010e8..c8e719e9 100644 --- a/modules/guestbook/models/Guestbook.php +++ b/modules/guestbook/models/Guestbook.php @@ -5,6 +5,7 @@ use yii\easyii\behaviors\CalculateNotice; use yii\easyii\helpers\Mail; use yii\easyii\models\Setting; +use yii\easyii\modules\guestbook\GuestbookModule; use yii\easyii\validators\ReCaptchaValidator; use yii\easyii\validators\EscapeValidator; use yii\helpers\Url; @@ -31,7 +32,7 @@ public function rules() ['email', 'email'], ['title', 'string', 'max' => 128], ['reCaptcha', ReCaptchaValidator::className(), 'on' => 'send', 'when' => function(){ - return Yii::$app->getModule('admin')->activeModules['guestbook']->settings['enableCaptcha']; + return GuestbookModule::setting('enableCaptcha'); }], ]; } @@ -43,7 +44,7 @@ public function beforeSave($insert) $this->ip = Yii::$app->request->userIP; $this->time = time(); $this->new = 1; - $this->status = Yii::$app->getModule('admin')->activeModules['guestbook']->settings['preModerate'] ? self::STATUS_OFF : self::STATUS_ON; + $this->status = GuestbookModule::setting('preModerate') ? self::STATUS_OFF : self::STATUS_ON; } return true; } else { @@ -86,15 +87,13 @@ public function behaviors() public function mailAdmin() { - $settings = Yii::$app->getModule('admin')->activeModules['guestbook']->settings; - - if(!$settings['mailAdminOnNewPost']){ + if(!GuestbookModule::setting('mailAdminOnNewPost')){ return false; } return Mail::send( Setting::get('admin_email'), - $settings['subjectOnNewPost'], - $settings['templateOnNewPost'], + GuestbookModule::setting('subjectOnNewPost'), + GuestbookModule::setting('templateOnNewPost'), [ 'post' => $this, 'link' => Url::to(['/admin/guestbook/a/view', 'id' => $this->primaryKey], true) @@ -104,15 +103,13 @@ public function mailAdmin() public function notifyUser() { - $settings = Yii::$app->getModule('admin')->activeModules['guestbook']->settings; - return Mail::send( $this->email, - $settings['subjectNotifyUser'], - $settings['templateNotifyUser'], + GuestbookModule::setting('subjectNotifyUser'), + GuestbookModule::setting('templateNotifyUser'), [ 'post' => $this, - 'link' => Url::to([$settings['frontendGuestbookRoute']], true) + 'link' => Url::to([GuestbookModule::setting('frontendGuestbookRoute')], true) ] ); } diff --git a/modules/news/controllers/AController.php b/modules/news/controllers/AController.php index 033ae24e..81b28430 100644 --- a/modules/news/controllers/AController.php +++ b/modules/news/controllers/AController.php @@ -4,6 +4,7 @@ use Yii; use yii\data\ActiveDataProvider; use yii\easyii\behaviors\SortableDateController; +use yii\easyii\modules\news\NewsModule; use yii\widgets\ActiveForm; use yii\web\UploadedFile; @@ -30,6 +31,7 @@ public function behaviors() public function actionIndex() { + var_dump(NewsModule::setting('enableThumb')); $data = new ActiveDataProvider([ 'query' => News::find()->sortDate(), ]); From 066be795e4965f0448c2e8ddaa9069365100a9a2 Mon Sep 17 00:00:00 2001 From: noumo Date: Fri, 9 Oct 2015 20:15:37 +0300 Subject: [PATCH 007/109] add immutable --- modules/catalog/CatalogModule.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/catalog/CatalogModule.php b/modules/catalog/CatalogModule.php index 85eb52a1..38fe2ab3 100644 --- a/modules/catalog/CatalogModule.php +++ b/modules/catalog/CatalogModule.php @@ -11,6 +11,9 @@ class CatalogModule extends \yii\easyii\components\Module 'itemPhotos' => true, 'itemDescription' => true, 'itemSale' => true, + + 'categorySlugImmutable' => false, + 'itemSlugImmutable' => false ]; public static $installConfig = [ From 37e242f482472fbc23c696e14cbf88b1521ad2fc Mon Sep 17 00:00:00 2001 From: noumo Date: Fri, 9 Oct 2015 20:16:14 +0300 Subject: [PATCH 008/109] add tags --- modules/catalog/api/Catalog.php | 16 ++++++++++++++-- modules/faq/FaqModule.php | 4 ++++ modules/faq/api/Faq.php | 23 ++++++++++++++++++++--- modules/faq/api/FaqObject.php | 4 ++++ modules/faq/models/Faq.php | 6 +++++- modules/faq/views/a/_form.php | 5 +++++ modules/gallery/api/CategoryObject.php | 6 ++++++ modules/gallery/api/Gallery.php | 16 ++++++++++++++-- 8 files changed, 72 insertions(+), 8 deletions(-) diff --git a/modules/catalog/api/Catalog.php b/modules/catalog/api/Catalog.php index 43295d92..932395f8 100644 --- a/modules/catalog/api/Catalog.php +++ b/modules/catalog/api/Catalog.php @@ -46,9 +46,21 @@ public function api_tree() return Category::tree(); } - public function api_cats() + public function api_cats($options = []) { - return Category::cats(); + $result = []; + foreach(Category::cats() as $model){ + $result[] = new CategoryObject($model); + } + if(!empty($options['tags'])){ + foreach($result as $i => $item){ + if(!in_array($options['tags'], $item->tags)){ + unset($result[$i]); + } + } + } + + return $result; } public function api_items($options = []) diff --git a/modules/faq/FaqModule.php b/modules/faq/FaqModule.php index 2b91dea8..83f13927 100644 --- a/modules/faq/FaqModule.php +++ b/modules/faq/FaqModule.php @@ -5,6 +5,10 @@ class FaqModule extends \yii\easyii\components\Module { + public $settings = [ + 'enableTags' => true + ]; + public static $installConfig = [ 'title' => [ 'en' => 'FAQ', diff --git a/modules/faq/api/Faq.php b/modules/faq/api/Faq.php index 8a25d112..7878fe19 100644 --- a/modules/faq/api/Faq.php +++ b/modules/faq/api/Faq.php @@ -3,6 +3,7 @@ use Yii; use yii\easyii\helpers\Data; +use yii\easyii\modules\faq\FaqModule; use yii\easyii\modules\faq\models\Faq as FaqModel; @@ -15,14 +16,30 @@ class Faq extends \yii\easyii\components\API { - public function api_items() + public function api_items($options = []) { - return Data::cache(FaqModel::CACHE_KEY, 3600, function(){ + $items = Data::cache(FaqModel::CACHE_KEY, 3600, function(){ $items = []; - foreach(FaqModel::find()->select(['faq_id', 'question', 'answer'])->status(FaqModel::STATUS_ON)->sort()->all() as $item){ + + $query = FaqModel::find()->select(['faq_id', 'question', 'answer'])->status(FaqModel::STATUS_ON)->sort(); + if(FaqModule::setting('enableTags')){ + $query->with('tags'); + } + + foreach($query->all() as $item){ $items[] = new FaqObject($item); } return $items; }); + + if(!empty($options['tags'])){ + foreach($items as $i => $item){ + if(!in_array($options['tags'], $item->tags)){ + unset($items[$i]); + } + } + } + + return $items; } } \ No newline at end of file diff --git a/modules/faq/api/FaqObject.php b/modules/faq/api/FaqObject.php index 86fd46a9..95f69fa8 100644 --- a/modules/faq/api/FaqObject.php +++ b/modules/faq/api/FaqObject.php @@ -14,6 +14,10 @@ public function getAnswer(){ return LIVE_EDIT ? API::liveEdit($this->model->answer, $this->editLink) : $this->model->answer; } + public function getTags(){ + return $this->model->tagsArray; + } + public function getEditLink(){ return Url::to(['/admin/faq/a/edit/', 'id' => $this->id]); } diff --git a/modules/faq/models/Faq.php b/modules/faq/models/Faq.php index af70b42f..48b72b0f 100644 --- a/modules/faq/models/Faq.php +++ b/modules/faq/models/Faq.php @@ -4,6 +4,7 @@ use Yii; use yii\easyii\behaviors\CacheFlush; use yii\easyii\behaviors\SortableModel; +use yii\easyii\behaviors\Taggable; class Faq extends \yii\easyii\components\ActiveRecord { @@ -22,6 +23,7 @@ public function rules() return [ [['question','answer'], 'required'], [['question', 'answer'], 'trim'], + ['tagNames', 'safe'], ['status', 'integer'], ['status', 'default', 'value' => self::STATUS_ON], ]; @@ -32,6 +34,7 @@ public function attributeLabels() return [ 'question' => Yii::t('easyii/faq', 'Question'), 'answer' => Yii::t('easyii/faq', 'Answer'), + 'tagNames' => Yii::t('easyii', 'Tags'), ]; } @@ -39,7 +42,8 @@ public function behaviors() { return [ CacheFlush::className(), - SortableModel::className() + SortableModel::className(), + 'taggabble' => Taggable::className(), ]; } } \ No newline at end of file diff --git a/modules/faq/views/a/_form.php b/modules/faq/views/a/_form.php index bb1fbfd6..0fd3d2ab 100644 --- a/modules/faq/views/a/_form.php +++ b/modules/faq/views/a/_form.php @@ -1,4 +1,5 @@ +context->module->settings['enableTags']) : ?> + field($model, 'tagNames')->widget(TagsInput::className()) ?> + + 'btn btn-primary']) ?> \ No newline at end of file diff --git a/modules/gallery/api/CategoryObject.php b/modules/gallery/api/CategoryObject.php index b7dc90ff..959b6426 100644 --- a/modules/gallery/api/CategoryObject.php +++ b/modules/gallery/api/CategoryObject.php @@ -14,6 +14,8 @@ class CategoryObject extends \yii\easyii\components\ApiObject public $image; public $tree; public $depth; + public $parent; + public $children; private $_adp; private $_photos; @@ -22,6 +24,10 @@ public function getTitle(){ return LIVE_EDIT ? API::liveEdit($this->model->title, $this->editLink) : $this->model->title; } + public function getTags(){ + return $this->model->tagsArray; + } + public function pages($options = []){ return $this->_adp ? LinkPager::widget(array_merge($options, ['pagination' => $this->_adp->pagination])) : ''; } diff --git a/modules/gallery/api/Gallery.php b/modules/gallery/api/Gallery.php index 3d4404d7..761181b1 100644 --- a/modules/gallery/api/Gallery.php +++ b/modules/gallery/api/Gallery.php @@ -40,9 +40,21 @@ public function api_tree() return Category::tree(); } - public function api_cats() + public function api_cats($options = []) { - return Category::cats(); + $result = []; + foreach(Category::cats() as $model){ + $result[] = new CategoryObject($model); + } + if(!empty($options['tags'])){ + foreach($result as $i => $item){ + if(!in_array($options['tags'], $item->tags)){ + unset($result[$i]); + } + } + } + + return $result; } From 3ea8f826ca8440473ba2088b7f4eecda69d6bc46 Mon Sep 17 00:00:00 2001 From: noumo Date: Fri, 9 Oct 2015 20:17:08 +0300 Subject: [PATCH 009/109] minor improves --- components/CategoryModel.php | 55 ++++++++++++++++++++++++++++++------ helpers/Migration.php | 17 +++++++++++ 2 files changed, 64 insertions(+), 8 deletions(-) create mode 100644 helpers/Migration.php diff --git a/components/CategoryModel.php b/components/CategoryModel.php index 25f37251..7a364adf 100644 --- a/components/CategoryModel.php +++ b/components/CategoryModel.php @@ -6,6 +6,9 @@ use yii\easyii\behaviors\CacheFlush; use yii\easyii\behaviors\SeoBehavior; use creocoder\nestedsets\NestedSetsBehavior; +use yii\easyii\behaviors\Taggable; +use yii\easyii\helpers\Upload; +use yii\easyii\models\SeoText; /** * Base CategoryModel. Shared by categories @@ -17,6 +20,12 @@ class CategoryModel extends \yii\easyii\components\ActiveRecord const STATUS_OFF = 0; const STATUS_ON = 1; + static $FLAT; + static $TREE; + + public $parent; + public $children; + public function rules() { return [ @@ -26,7 +35,8 @@ public function rules() ['image', 'image'], ['slug', 'match', 'pattern' => self::$SLUG_PATTERN, 'message' => Yii::t('easyii', 'Slug can contain only 0-9, a-z and "-" characters (max: 128).')], ['slug', 'default', 'value' => null], - ['status', 'integer'], + ['tagNames', 'safe'], + [['status', 'depth', 'tree', 'lgt', 'rgt'], 'integer'], ['status', 'default', 'value' => self::STATUS_ON] ]; } @@ -37,21 +47,25 @@ public function attributeLabels() 'title' => Yii::t('easyii', 'Title'), 'image' => Yii::t('easyii', 'Image'), 'slug' => Yii::t('easyii', 'Slug'), + 'tagNames' => Yii::t('easyii', 'Tags'), ]; } public function behaviors() { + $moduleSettings = Yii::$app->getModule('admin')->activeModules[Module::getModuleName(static::className())]->settings; return [ 'cacheflush' => [ 'class' => CacheFlush::className(), 'key' => [static::tableName().'_tree', static::tableName().'_flat'] ], 'seoBehavior' => SeoBehavior::className(), + 'taggabble' => Taggable::className(), 'sluggable' => [ 'class' => SluggableBehavior::className(), 'attribute' => 'title', - 'ensureUnique' => true + 'ensureUnique' => true, + 'immutable' => !empty($moduleSettings['categorySlugImmutable']) ? $moduleSettings['categorySlugImmutable'] : false ], 'tree' => [ 'class' => NestedSetsBehavior::className(), @@ -81,6 +95,11 @@ public function afterDelete() } } + public function getImage() + { + return Upload::getLink($this->image_file); + } + /** * @return ActiveQueryNS */ @@ -115,12 +134,25 @@ public static function cats() $cache = Yii::$app->cache; $key = static::tableName().'_flat'; - $flat = $cache->get($key); - if(!$flat){ - $flat = static::generateFlat(); - $cache->set($key, $flat, 3600); + if(!static::$FLAT) { + $flat = $cache->get($key); + if (!$flat) { + $flat = static::generateFlat(); + $cache->set($key, $flat, 3600); + } + foreach($flat as $id => $cat){ + $model = new static([ + 'category_id' => $id, + 'parent' => $cat->parent, + 'children' => $cat->children + ]); + $model->load((array)$cat, ''); + $model->populateRelation('seo', new SeoText($cat->seo)); + $model->setTagNames($cat->tags); + static::$FLAT[] = $model; + } } - return $flat; + return static::$FLAT; } /** @@ -177,7 +209,7 @@ public static function generateTree() */ public static function generateFlat() { - $collection = static::find()->with('seo')->sort()->asArray()->all(); + $collection = static::find()->with(['seo', 'tags'])->sort()->asArray()->all(); $flat = []; if (count($collection) > 0) { @@ -219,6 +251,13 @@ public static function generateFlat() $node->children[] = $temp->category_id; } } + if(is_array($node->tags) && count($node->tags)){ + $tags = []; + foreach($node->tags as $tag){ + $tags[] = $tag['name']; + } + $node->tags = $tags; + } } return $flat; diff --git a/helpers/Migration.php b/helpers/Migration.php new file mode 100644 index 00000000..ebb92bd6 --- /dev/null +++ b/helpers/Migration.php @@ -0,0 +1,17 @@ + $moduleName]))) + { + $module->appendSettings($settings); + $module->save(); + } + } +} \ No newline at end of file From c1489d0a2ff3f76f18cc30b074ef0eb95d869714 Mon Sep 17 00:00:00 2001 From: noumo Date: Sat, 10 Oct 2015 02:12:49 +0300 Subject: [PATCH 010/109] upload and image refactor --- components/ApiObject.php | 19 +++++++++---- components/CategoryController.php | 20 ++++++------- components/CategoryModel.php | 12 ++++---- controllers/InstallController.php | 2 +- controllers/PhotosController.php | 6 ++-- controllers/RedactorController.php | 2 +- helpers/Image.php | 27 ++++++++++-------- helpers/Upload.php | 7 ++++- models/Photo.php | 2 +- modules/article/api/CategoryObject.php | 2 +- modules/article/api/PhotoObject.php | 1 - .../article/controllers/ItemsController.php | 20 ++++++------- modules/article/models/Item.php | 8 +++--- modules/carousel/api/CarouselObject.php | 1 - modules/carousel/models/Carousel.php | 6 ++-- modules/carousel/views/a/_form.php | 2 +- modules/catalog/api/ItemObject.php | 1 - modules/catalog/api/PhotoObject.php | 1 - .../catalog/controllers/ItemsController.php | 28 +++++++++---------- modules/catalog/models/Item.php | 8 +++--- modules/file/controllers/AController.php | 4 +-- .../file/controllers/DownloadController.php | 3 +- modules/file/models/File.php | 10 +++++-- modules/file/views/a/_form.php | 2 +- modules/gallery/api/CategoryObject.php | 1 - modules/gallery/api/PhotoObject.php | 1 - modules/news/api/NewsObject.php | 1 - modules/news/api/PhotoObject.php | 1 - modules/news/controllers/AController.php | 21 +++++++------- modules/news/models/News.php | 8 +++--- 30 files changed, 122 insertions(+), 105 deletions(-) diff --git a/components/ApiObject.php b/components/ApiObject.php index 03593720..6e2fa1eb 100644 --- a/components/ApiObject.php +++ b/components/ApiObject.php @@ -49,12 +49,21 @@ public function getId(){ * @param bool $crop if false image will be resize instead of cropping * @return string */ - public function thumb($width = null, $height = null, $crop = true) + public function thumb($width = null, $height = null) { - if($this->image && ($width || $height)){ - return Image::thumb($this->image, $width, $height, $crop); - } - return ''; + return !empty($this->model->image_file) ? Image::thumb($this->model->image_file, $width, $height) : ''; + } + + /** + * Returns web path to image. + * @param int|null $width + * @param int|null $height + * @param bool $crop if false image will be resize instead of cropping + * @return string + */ + public function getImage() + { + return !empty($this->model->image_file) ? $this->model->image : ''; } /** diff --git a/components/CategoryController.php b/components/CategoryController.php index 79d0107c..b57bb297 100644 --- a/components/CategoryController.php +++ b/components/CategoryController.php @@ -54,11 +54,11 @@ public function actionCreate($parent = null) } else{ if(isset($_FILES) && $this->module->settings['categoryThumb']){ - $model->image = UploadedFile::getInstance($model, 'image'); - if($model->image && $model->validate(['image'])){ - $model->image = Image::upload($model->image, $this->moduleName); + $model->image_file = UploadedFile::getInstance($model, 'image_file'); + if($model->image_file && $model->validate(['image_file'])){ + $model->image_file = Image::upload($model->image_file, $this->moduleName); } else { - $model->image = ''; + $model->image_file = ''; } } @@ -113,11 +113,11 @@ public function actionEdit($id) } else{ if(isset($_FILES) && $this->module->settings['categoryThumb']){ - $model->image = UploadedFile::getInstance($model, 'image'); - if($model->image && $model->validate(['image'])){ - $model->image = Image::upload($model->image, $this->moduleName); + $model->image_file = UploadedFile::getInstance($model, 'image_file'); + if($model->image_file && $model->validate(['image_file'])){ + $model->image_file = Image::upload($model->image_file, $this->moduleName); }else{ - $model->image = $model->oldAttributes['image']; + $model->image_file = $model->oldAttributes['image_file']; } } if($model->save()){ @@ -150,8 +150,8 @@ public function actionClearImage($id) if($model === null){ $this->flash('error', Yii::t('easyii', 'Not found')); } - elseif($model->image){ - $model->image = ''; + elseif($model->image_file){ + $model->image_file = ''; if($model->update()){ $this->flash('success', Yii::t('easyii', 'Image cleared')); } else { diff --git a/components/CategoryModel.php b/components/CategoryModel.php index 7a364adf..f7a856eb 100644 --- a/components/CategoryModel.php +++ b/components/CategoryModel.php @@ -32,7 +32,7 @@ public function rules() ['title', 'required'], ['title', 'trim'], ['title', 'string', 'max' => 128], - ['image', 'image'], + ['image_file', 'image'], ['slug', 'match', 'pattern' => self::$SLUG_PATTERN, 'message' => Yii::t('easyii', 'Slug can contain only 0-9, a-z and "-" characters (max: 128).')], ['slug', 'default', 'value' => null], ['tagNames', 'safe'], @@ -45,7 +45,7 @@ public function attributeLabels() { return [ 'title' => Yii::t('easyii', 'Title'), - 'image' => Yii::t('easyii', 'Image'), + 'image_file' => Yii::t('easyii', 'Image'), 'slug' => Yii::t('easyii', 'Slug'), 'tagNames' => Yii::t('easyii', 'Tags'), ]; @@ -77,8 +77,8 @@ public function behaviors() public function beforeSave($insert) { if (parent::beforeSave($insert)) { - if(!$insert && $this->image != $this->oldAttributes['image'] && $this->oldAttributes['image']){ - @unlink(Yii::getAlias('@webroot').$this->oldAttributes['image']); + if(!$insert && $this->image_file != $this->oldAttributes['image_file'] && $this->oldAttributes['image_file']){ + Upload::delete($this->oldAttributes['image_file']); } return true; } else { @@ -90,8 +90,8 @@ public function afterDelete() { parent::afterDelete(); - if($this->image) { - @unlink(Yii::getAlias('@webroot') . $this->image); + if($this->image_file) { + Upload::delete($this->image_file); } } diff --git a/controllers/InstallController.php b/controllers/InstallController.php index 8082a9ee..33ef4c5c 100644 --- a/controllers/InstallController.php +++ b/controllers/InstallController.php @@ -108,7 +108,7 @@ private function showError($text) private function createUploadsDir() { - $uploadsDir = Yii::getAlias('@webroot') . DIRECTORY_SEPARATOR . 'uploads'; + $uploadsDir = Yii::getAlias('@uploads'); $uploadsDirExists = file_exists($uploadsDir); if(($uploadsDirExists && !is_writable($uploadsDir)) || (!$uploadsDirExists && !mkdir($uploadsDir, 0777))){ throw new ServerErrorHttpException('Cannot create uploads folder at `'.$uploadsDir.'` Please check write permissions.'); diff --git a/controllers/PhotosController.php b/controllers/PhotosController.php index a8617733..638574e3 100644 --- a/controllers/PhotosController.php +++ b/controllers/PhotosController.php @@ -56,7 +56,7 @@ public function actionUpload($class, $item_id) ]; } else{ - @unlink(Upload::getAbsolutePath($photo->image_file)); + Upload::delete($photo->image_file); $this->error = Yii::t('easyii', 'Create error. {0}', $photo->formatErrors()); } } @@ -107,7 +107,7 @@ public function actionImage($id) $photo->image_file = Image::upload($photo->image_file, 'photos'); if($photo->image_file){ if($photo->save()){ - @unlink(Upload::getAbsolutePath($oldImage)); + Upload::delete($oldImage); $success = [ 'message' => Yii::t('easyii', 'Photo uploaded'), @@ -118,7 +118,7 @@ public function actionImage($id) ]; } else{ - @unlink(Upload::getAbsolutePath($photo->image_file)); + Upload::delete($photo->image_file); $this->error = Yii::t('easyii', 'Update error. {0}', $photo->formatErrors()); } diff --git a/controllers/RedactorController.php b/controllers/RedactorController.php index 2e425c1b..83407b3a 100644 --- a/controllers/RedactorController.php +++ b/controllers/RedactorController.php @@ -15,7 +15,7 @@ class RedactorController extends \yii\easyii\components\Controller { public $controllerNamespace = 'yii\redactor\controllers'; public $defaultRoute = 'upload'; - public $uploadDir = '@webroot/uploads'; + public $uploadDir = '@uploads'; public $uploadUrl = '/uploads'; public function behaviors() diff --git a/helpers/Image.php b/helpers/Image.php index 16f059f4..bc6495dd 100644 --- a/helpers/Image.php +++ b/helpers/Image.php @@ -34,20 +34,23 @@ public static function upload(UploadedFile $fileInstance, $dir = '') static function thumb($filename, $width = null, $height = null) { $filename = Upload::getAbsolutePath($filename); + if(!is_file($filename)) { + return ''; + } - if(is_file($filename)) - { - $info = pathinfo($filename); - $thumbName = $info['filename'] . '-' . md5( filemtime($filename) . (int)$width . (int)$height) . '.' . $info['extension']; - $thumbFile = Upload::getUploadPath('thumbs') . DIRECTORY_SEPARATOR . $thumbName; - $thumbWebFile = Upload::getLink('thumbs/' . $thumbName); - if(file_exists($thumbFile)){ - return $thumbWebFile; - } elseif(self::crop($filename, $thumbFile, $width, $height)){ - return $thumbWebFile; - } + $info = pathinfo($filename); + $thumbName = $info['filename'] . '-' . md5( filemtime($filename) . (int)$width . (int)$height) . '.' . $info['extension']; + $thumbFile = Upload::getUploadPath('thumbs') . DIRECTORY_SEPARATOR . $thumbName; + $thumbWebFile = Upload::getLink('thumbs/' . $thumbName); + if(file_exists($thumbFile)){ + return $thumbWebFile; + } + if($width && $height){ + $success = self::crop($filename, $thumbFile, $width, $height); + } else { + $success = self::resize($filename, $thumbFile, $width, $height); } - return ''; + return $success ? $thumbWebFile : ''; } static function crop($inputFile, $outputFile, $width, $height) diff --git a/helpers/Upload.php b/helpers/Upload.php index c2ee0fe2..e2ca19b5 100644 --- a/helpers/Upload.php +++ b/helpers/Upload.php @@ -21,7 +21,7 @@ public static function file(UploadedFile $fileInstance, $dir = '', $namePostfix if(!$fileInstance->saveAs($fileName)){ throw new HttpException(500, 'Cannot upload file "'.$fileName.'". Please check write permissions.'); } - return Upload::getLink($fileName); + return $dir ? $dir . '/' . basename($fileName) : basename($fileName); } static function getUploadPath($dir = null) @@ -60,6 +60,11 @@ static function getAbsolutePath($fileName) } } + static function delete($fileName) + { + @unlink(self::getAbsolutePath($fileName)); + } + static function getFileName(UploadedFile $fileInstance, $namePostfix = true) { $fileName = StringHelper::truncate(Inflector::slug($fileInstance->baseName), 32, ''); diff --git a/models/Photo.php b/models/Photo.php index 8f2aa123..a6dde4e8 100644 --- a/models/Photo.php +++ b/models/Photo.php @@ -45,7 +45,7 @@ public function afterDelete() { parent::afterDelete(); - @unlink(Upload::getAbsolutePath($this->image_file)); + Upload::delete($this->image_file); } public function getImage() diff --git a/modules/article/api/CategoryObject.php b/modules/article/api/CategoryObject.php index 80bc8624..8f7d21b4 100644 --- a/modules/article/api/CategoryObject.php +++ b/modules/article/api/CategoryObject.php @@ -38,7 +38,7 @@ public function items($options = []) $this->_items = []; $with = ['seo']; - if(ArticleModule::settings('enableTags')){ + if(ArticleModule::setting('enableTags')){ $with[] = 'tags'; } diff --git a/modules/article/api/PhotoObject.php b/modules/article/api/PhotoObject.php index 08a6cc71..159b833e 100644 --- a/modules/article/api/PhotoObject.php +++ b/modules/article/api/PhotoObject.php @@ -8,7 +8,6 @@ class PhotoObject extends \yii\easyii\components\ApiObject { - public $image; public $description; public function box($width, $height){ diff --git a/modules/article/controllers/ItemsController.php b/modules/article/controllers/ItemsController.php index 6c6f9f09..f8f68b4d 100644 --- a/modules/article/controllers/ItemsController.php +++ b/modules/article/controllers/ItemsController.php @@ -57,11 +57,11 @@ public function actionCreate($id) $model->category_id = $category->primaryKey; if (isset($_FILES) && $this->module->settings['articleThumb']) { - $model->image = UploadedFile::getInstance($model, 'image'); - if ($model->image && $model->validate(['image'])) { - $model->image = Image::upload($model->image, 'article'); + $model->image_file = UploadedFile::getInstance($model, 'image_file'); + if ($model->image_file && $model->validate(['image_file'])) { + $model->image_file = Image::upload($model->image_file, 'article'); } else { - $model->image = ''; + $model->image_file = ''; } } @@ -95,11 +95,11 @@ public function actionEdit($id) } else { if (isset($_FILES) && $this->module->settings['articleThumb']) { - $model->image = UploadedFile::getInstance($model, 'image'); - if ($model->image && $model->validate(['image'])) { - $model->image = Image::upload($model->image, 'article'); + $model->image_file = UploadedFile::getInstance($model, 'image_file'); + if ($model->image_file && $model->validate(['image_file'])) { + $model->image_file = Image::upload($model->image_file, 'article'); } else { - $model->image = $model->oldAttributes['image']; + $model->image_file = $model->oldAttributes['image_file']; } } @@ -137,8 +137,8 @@ public function actionClearImage($id) if($model === null){ $this->flash('error', Yii::t('easyii', 'Not found')); } - elseif($model->image){ - $model->image = ''; + elseif($model->image_file){ + $model->image_file = ''; if($model->update()){ $this->flash('success', Yii::t('easyii', 'Image cleared')); } else { diff --git a/modules/article/models/Item.php b/modules/article/models/Item.php index ea911886..8f1a9f6b 100644 --- a/modules/article/models/Item.php +++ b/modules/article/models/Item.php @@ -83,8 +83,8 @@ public function beforeSave($insert) if (parent::beforeSave($insert)) { $this->short = StringHelper::truncate(ArticleModule::setting('enableShort') ? $this->short : strip_tags($this->text), ArticleModule::setting('shortMaxLength')); - if(!$insert && $this->image != $this->oldAttributes['image'] && $this->oldAttributes['image']){ - @unlink(Yii::getAlias('@webroot').$this->oldAttributes['image']); + if(!$insert && $this->image_file != $this->oldAttributes['image_file'] && $this->oldAttributes['image_file']){ + Upload::delete($this->oldAttributes['image_file']); } return true; @@ -97,8 +97,8 @@ public function afterDelete() { parent::afterDelete(); - if($this->image){ - @unlink(Yii::getAlias('@webroot').$this->image); + if($this->image_file){ + Upload::delete($this->image_file); } foreach($this->getPhotos()->all() as $photo){ diff --git a/modules/carousel/api/CarouselObject.php b/modules/carousel/api/CarouselObject.php index 12534ee5..7d89bd7c 100644 --- a/modules/carousel/api/CarouselObject.php +++ b/modules/carousel/api/CarouselObject.php @@ -3,7 +3,6 @@ class CarouselObject extends \yii\easyii\components\ApiObject { - public $image; public $link; public $title; public $text; diff --git a/modules/carousel/models/Carousel.php b/modules/carousel/models/Carousel.php index 90f8d6e3..8c1fdbb1 100644 --- a/modules/carousel/models/Carousel.php +++ b/modules/carousel/models/Carousel.php @@ -53,8 +53,8 @@ public function getImage() public function beforeSave($insert) { if (parent::beforeSave($insert)) { - if(!$insert && $this->image != $this->oldAttributes['image'] && $this->oldAttributes['image']){ - @unlink(Yii::getAlias('@webroot').$this->oldAttributes['image']); + if(!$insert && $this->image_file != $this->oldAttributes['image_file'] && $this->oldAttributes['image_file']){ + Upload::delete($this->oldAttributes['image_file']); } return true; } else { @@ -66,6 +66,6 @@ public function afterDelete() { parent::afterDelete(); - @unlink(Yii::getAlias('@webroot').$this->image); + Upload::delete($this->image_file); } } \ No newline at end of file diff --git a/modules/carousel/views/a/_form.php b/modules/carousel/views/a/_form.php index 3f3316a9..18bf4386 100644 --- a/modules/carousel/views/a/_form.php +++ b/modules/carousel/views/a/_form.php @@ -6,7 +6,7 @@ 'enableClientValidation' => true, 'options' => ['enctype' => 'multipart/form-data', 'class' => 'model-form'] ]); ?> -image) : ?> +image_file) : ?> field($model, 'image_file')->fileInput() ?> diff --git a/modules/catalog/api/ItemObject.php b/modules/catalog/api/ItemObject.php index 70056b61..d183a30c 100644 --- a/modules/catalog/api/ItemObject.php +++ b/modules/catalog/api/ItemObject.php @@ -10,7 +10,6 @@ class ItemObject extends \yii\easyii\components\ApiObject { public $slug; - public $image; public $data; public $category_id; public $available; diff --git a/modules/catalog/api/PhotoObject.php b/modules/catalog/api/PhotoObject.php index b2e44059..4fd789ac 100644 --- a/modules/catalog/api/PhotoObject.php +++ b/modules/catalog/api/PhotoObject.php @@ -8,7 +8,6 @@ class PhotoObject extends \yii\easyii\components\ApiObject { - public $image; public $description; public function box($width, $height){ diff --git a/modules/catalog/controllers/ItemsController.php b/modules/catalog/controllers/ItemsController.php index 1c330c30..57a8cb99 100644 --- a/modules/catalog/controllers/ItemsController.php +++ b/modules/catalog/controllers/ItemsController.php @@ -63,11 +63,11 @@ public function actionCreate($id) $this->parseData($model); if (isset($_FILES) && $this->module->settings['itemThumb']) { - $model->image = UploadedFile::getInstance($model, 'image'); - if ($model->image && $model->validate(['image'])) { - $model->image = Image::upload($model->image, 'catalog'); + $model->image_file = UploadedFile::getInstance($model, 'image_file'); + if ($model->image_file && $model->validate(['image_file'])) { + $model->image_file = Image::upload($model->image_file, 'catalog'); } else { - $model->image = ''; + $model->image_file = ''; } } if ($model->save()) { @@ -103,11 +103,11 @@ public function actionEdit($id) $this->parseData($model); if (isset($_FILES) && $this->module->settings['itemThumb']) { - $model->image = UploadedFile::getInstance($model, 'image'); - if ($model->image && $model->validate(['image'])) { - $model->image = Image::upload($model->image, 'catalog'); + $model->image_file = UploadedFile::getInstance($model, 'image_file'); + if ($model->image_file && $model->validate(['image_file'])) { + $model->image_file = Image::upload($model->image_file, 'catalog'); } else { - $model->image = $model->oldAttributes['image']; + $model->image_file = $model->oldAttributes['image_file']; } } @@ -146,10 +146,10 @@ public function actionClearImage($id) if($model === null){ $this->flash('error', Yii::t('easyii', 'Not found')); } - elseif($model->image){ - $model->image = ''; + elseif($model->image_file){ + $model->image_file = ''; if($model->update()){ - @unlink(Yii::getAlias('@webroot').$model->image); + Upload::delete($model->image_file); $this->flash('success', Yii::t('easyii', 'Image cleared')); } else { $this->flash('error', Yii::t('easyii', 'Update error. {0}', $model->formatErrors())); @@ -174,7 +174,7 @@ public function actionDeleteDataFile($file) foreach ($model->data as $name => $value) { if (!is_array($value) && strpos($value, '/' . $file) !== false) { - @unlink(Yii::getAlias('@webroot') . $value); + Upload::delete($value); $model->data->{$name} = ''; } } @@ -260,9 +260,9 @@ private function parseData(&$model) $field = $model->category->getFieldByName($fieldName); $validator = new FileValidator(['extensions' => $field->options ? $field->options : null]); $uploadInstance = UploadedFile::getInstanceByName('Data['.$fieldName.']'); - if($uploadInstance && !in_array($uploadInstance->extension, self::$RESTRICTED_EXTENSIONS) && $validator->validate($uploadInstance) && ($result = Upload::file($uploadInstance, 'catalog/files', false))) { + if($uploadInstance && !in_array($uploadInstance->extension, self::$RESTRICTED_EXTENSIONS) && $validator->validate($uploadInstance) && ($result = Upload::file($uploadInstance, 'catalog', false))) { if(!empty($model->data->{$fieldName})){ - @unlink(Yii::getAlias('@webroot') . $model->data->{$fieldName}); + Upload::delete($model->data->{$fieldName}); } $data[$fieldName] = $result; } else { diff --git a/modules/catalog/models/Item.php b/modules/catalog/models/Item.php index 90b71411..4262b718 100644 --- a/modules/catalog/models/Item.php +++ b/modules/catalog/models/Item.php @@ -72,8 +72,8 @@ public function beforeSave($insert) $this->data = json_encode($this->data); - if(!$insert && $this->image != $this->oldAttributes['image'] && $this->oldAttributes['image']){ - @unlink(Yii::getAlias('@webroot').$this->oldAttributes['image']); + if(!$insert && $this->image_file != $this->oldAttributes['image_file'] && $this->oldAttributes['image_file']){ + Upload::delete($this->oldAttributes['image_file']); } return true; @@ -137,8 +137,8 @@ public function afterDelete() $photo->delete(); } - if($this->image) { - @unlink(Yii::getAlias('@webroot') . $this->image); + if($this->image_file) { + Upload::delete($this->image_file); } ItemData::deleteAll(['item_id' => $this->primaryKey]); diff --git a/modules/file/controllers/AController.php b/modules/file/controllers/AController.php index fb7cbea6..a59dc985 100644 --- a/modules/file/controllers/AController.php +++ b/modules/file/controllers/AController.php @@ -47,7 +47,7 @@ public function actionCreate($slug = null) { $model->file = $fileInstanse; if($model->validate(['file'])){ - $model->file = Upload::file($fileInstanse, 'files', false); + $model->file = Upload::file($fileInstanse, 'file', false); $model->size = $fileInstanse->size; if($model->save()){ @@ -96,7 +96,7 @@ public function actionEdit($id) { $model->file = $fileInstanse; if($model->validate(['file'])){ - $model->file = Upload::file($fileInstanse, 'files', false); + $model->file = Upload::file($fileInstanse, 'file', false); $model->size = $fileInstanse->size; $model->time = time(); } diff --git a/modules/file/controllers/DownloadController.php b/modules/file/controllers/DownloadController.php index 83722772..2e189942 100644 --- a/modules/file/controllers/DownloadController.php +++ b/modules/file/controllers/DownloadController.php @@ -2,6 +2,7 @@ namespace yii\easyii\modules\file\controllers; use Yii; +use yii\easyii\helpers\Upload; use yii\easyii\modules\file\models\File; class DownloadController extends \yii\web\Controller @@ -11,7 +12,7 @@ public function actionIndex($id) $model = File::findOne($id); if($model){ $model->updateCounters(['downloads' => 1]); - Yii::$app->response->sendFile(Yii::getAlias('@webroot'). DIRECTORY_SEPARATOR .$model->file); + Yii::$app->response->sendFile(Upload::getAbsolutePath($model->file)); } else{ throw new \yii\web\NotFoundHttpException(Yii::t('easyii/file/api', 'File not found')); diff --git a/modules/file/models/File.php b/modules/file/models/File.php index 332bf86b..a2cb430d 100644 --- a/modules/file/models/File.php +++ b/modules/file/models/File.php @@ -5,6 +5,7 @@ use yii\behaviors\SluggableBehavior; use yii\easyii\behaviors\SeoBehavior; use yii\easyii\behaviors\SortableModel; +use yii\easyii\helpers\Upload; class File extends \yii\easyii\components\ActiveRecord { @@ -49,11 +50,16 @@ public function behaviors() ]; } + public function getLink() + { + return Upload::getLink($this->file); + } + public function beforeSave($insert) { if (parent::beforeSave($insert)) { if(!$insert && $this->file !== $this->oldAttributes['file']){ - @unlink(Yii::getAlias('@webroot').$this->oldAttributes['file']); + Upload::delete($this->oldAttributes['file']); } return true; } else { @@ -65,6 +71,6 @@ public function afterDelete() { parent::afterDelete(); - @unlink(Yii::getAlias('@webroot').$this->file); + Upload::delete($this->file); } } \ No newline at end of file diff --git a/modules/file/views/a/_form.php b/modules/file/views/a/_form.php index f5f42687..5c4ca94b 100644 --- a/modules/file/views/a/_form.php +++ b/modules/file/views/a/_form.php @@ -10,7 +10,7 @@ field($model, 'title') ?> field($model, 'file')->fileInput() ?> isNewRecord) : ?> -
file) ?> (formatter->asShortSize($model->size, 2) ?>)
+
file) ?> (formatter->asShortSize($model->size, 2) ?>)

diff --git a/modules/gallery/api/CategoryObject.php b/modules/gallery/api/CategoryObject.php index 959b6426..29cd33b6 100644 --- a/modules/gallery/api/CategoryObject.php +++ b/modules/gallery/api/CategoryObject.php @@ -11,7 +11,6 @@ class CategoryObject extends \yii\easyii\components\ApiObject { public $slug; - public $image; public $tree; public $depth; public $parent; diff --git a/modules/gallery/api/PhotoObject.php b/modules/gallery/api/PhotoObject.php index 94b34c2a..ef0b7dc1 100644 --- a/modules/gallery/api/PhotoObject.php +++ b/modules/gallery/api/PhotoObject.php @@ -8,7 +8,6 @@ class PhotoObject extends \yii\easyii\components\ApiObject { - public $image; public $description; public $rel; diff --git a/modules/news/api/NewsObject.php b/modules/news/api/NewsObject.php index c84e9987..b5e546bf 100644 --- a/modules/news/api/NewsObject.php +++ b/modules/news/api/NewsObject.php @@ -10,7 +10,6 @@ class NewsObject extends \yii\easyii\components\ApiObject { public $slug; - public $image; public $views; public $time; diff --git a/modules/news/api/PhotoObject.php b/modules/news/api/PhotoObject.php index eb4a6962..98bfc702 100644 --- a/modules/news/api/PhotoObject.php +++ b/modules/news/api/PhotoObject.php @@ -8,7 +8,6 @@ class PhotoObject extends \yii\easyii\components\ApiObject { - public $image; public $description; public function box($width, $height){ diff --git a/modules/news/controllers/AController.php b/modules/news/controllers/AController.php index 81b28430..64455518 100644 --- a/modules/news/controllers/AController.php +++ b/modules/news/controllers/AController.php @@ -4,6 +4,7 @@ use Yii; use yii\data\ActiveDataProvider; use yii\easyii\behaviors\SortableDateController; +use yii\easyii\helpers\Upload; use yii\easyii\modules\news\NewsModule; use yii\widgets\ActiveForm; use yii\web\UploadedFile; @@ -53,12 +54,12 @@ public function actionCreate() } else{ if(isset($_FILES) && $this->module->settings['enableThumb']){ - $model->image = UploadedFile::getInstance($model, 'image'); - if($model->image && $model->validate(['image'])){ - $model->image = Image::upload($model->image, 'news'); + $model->image_file = UploadedFile::getInstance($model, 'image_file'); + if($model->image_file && $model->validate(['image_file'])){ + $model->image_file = Image::upload($model->image_file, 'news'); } else{ - $model->image = ''; + $model->image_file = ''; } } if($model->save()){ @@ -94,12 +95,12 @@ public function actionEdit($id) } else{ if(isset($_FILES) && $this->module->settings['enableThumb']){ - $model->image = UploadedFile::getInstance($model, 'image'); - if($model->image && $model->validate(['image'])){ - $model->image = Image::upload($model->image, 'news'); + $model->image_file = UploadedFile::getInstance($model, 'image_file'); + if($model->image_file && $model->validate(['image_file'])){ + $model->image_file = Image::upload($model->image_file, 'news'); } else{ - $model->image = $model->oldAttributes['image']; + $model->image_file = $model->oldAttributes['image_file']; } } @@ -148,9 +149,9 @@ public function actionClearImage($id) $this->flash('error', Yii::t('easyii', 'Not found')); } else{ - $model->image = ''; + $model->image_file = ''; if($model->update()){ - @unlink(Yii::getAlias('@webroot').$model->image); + Upload::delete($model->image_file); $this->flash('success', Yii::t('easyii', 'Image cleared')); } else { $this->flash('error', Yii::t('easyii', 'Update error. {0}', $model->formatErrors())); diff --git a/modules/news/models/News.php b/modules/news/models/News.php index e6de4ecb..0eb612ae 100644 --- a/modules/news/models/News.php +++ b/modules/news/models/News.php @@ -92,8 +92,8 @@ public function beforeSave($insert) if (parent::beforeSave($insert)) { $this->short = StringHelper::truncate(NewsModule::setting('enableShort') ? $this->short : strip_tags($this->text), NewsModule::setting('shortMaxLength')); - if(!$insert && $this->image != $this->oldAttributes['image_file'] && $this->oldAttributes['image_file']){ - @unlink(Upload::getAbsolutePath($this->oldAttributes['image_file'])); + if(!$insert && $this->image_file != $this->oldAttributes['image_file'] && $this->oldAttributes['image_file']){ + Upload::delete($this->oldAttributes['image_file']); } return true; } else { @@ -105,8 +105,8 @@ public function afterDelete() { parent::afterDelete(); - if($this->image){ - @unlink(Yii::getAlias('@webroot').$this->image); + if($this->image_file){ + Upload::delete($this->image_file); } foreach($this->getPhotos()->all() as $photo){ From a450529127c1abbcf47efd0a869fd4e298bc8918 Mon Sep 17 00:00:00 2001 From: noumo Date: Tue, 13 Oct 2015 02:13:13 +0300 Subject: [PATCH 011/109] images and behaviors refactor --- CHANGELOG.md | 12 ++ behaviors/CommonActions.php | 143 ++++++++++++++++++ behaviors/ImageFile.php | 89 +++++++++++ behaviors/SortableController.php | 51 ------- behaviors/SortableDateController.php | 53 ------- behaviors/StatusController.php | 28 ---- components/CategoryController.php | 46 ++---- components/CategoryModel.php | 34 +---- composer.json | 4 +- controllers/AdminsController.php | 18 ++- controllers/ModulesController.php | 22 +-- controllers/PhotosController.php | 17 +-- controllers/SettingsController.php | 18 ++- controllers/SystemController.php | 12 ++ helpers/Upload.php | 12 +- .../article/controllers/ItemsController.php | 57 +------ modules/article/models/Item.php | 26 ++-- modules/carousel/controllers/AController.php | 68 ++------- modules/carousel/models/Carousel.php | 34 +---- .../catalog/controllers/ItemsController.php | 55 +------ modules/catalog/models/Item.php | 23 +-- modules/faq/controllers/AController.php | 23 +-- modules/feedback/controllers/AController.php | 18 ++- modules/file/controllers/AController.php | 15 +- modules/guestbook/controllers/AController.php | 11 +- modules/news/controllers/AController.php | 61 +------- modules/news/models/News.php | 24 ++- modules/news/views/a/_form.php | 14 +- modules/page/controllers/AController.php | 18 ++- modules/shopcart/controllers/AController.php | 18 ++- .../shopcart/controllers/GoodsController.php | 17 ++- modules/shopcart/messages/ru/admin.php | 2 + modules/subscribe/controllers/AController.php | 18 ++- modules/text/controllers/AController.php | 18 ++- 34 files changed, 480 insertions(+), 599 deletions(-) create mode 100644 behaviors/CommonActions.php create mode 100644 behaviors/ImageFile.php delete mode 100644 behaviors/SortableController.php delete mode 100644 behaviors/SortableDateController.php delete mode 100644 behaviors/StatusController.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 930e5f60..715113d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ #Changelog +###0.8.1 +* File type in catalog fields added +* Tags added to FAQ +* Tags added to gallery albums +* Added immutable setting to all sluggable behaviors + +//todo +insert new module settings +insert system setting max_image_width +rename all image to image_file + + ###0.8.0 * Articles module added * FAQ module added diff --git a/behaviors/CommonActions.php b/behaviors/CommonActions.php new file mode 100644 index 00000000..96f2a6d9 --- /dev/null +++ b/behaviors/CommonActions.php @@ -0,0 +1,143 @@ +model; + + if(($model = $modelClass::findOne($id))){ + $model->status = $status; + $model->update(); + } else { + $this->error = Yii::t('easyii', 'Not found'); + } + + return $this->owner->formatResponse(Yii::t('easyii', 'Status successfully changed')); + } + + public function clearImage($id) + { + $modelClass = $this->model; + $model = $modelClass::findOne($id); + + if($model === null){ + $this->owner->flash('error', Yii::t('easyii', 'Not found')); + } + elseif($model->image_file){ + $model->image_file = ''; + if($model->update()){ + $this->owner->flash('success', Yii::t('easyii', 'Image cleared')); + } else { + $this->owner->flash('error', Yii::t('easyii', 'Update error. {0}', $model->formatErrors())); + } + } + return $this->owner->back(); + } + + public function deleteModel($id, $successMessage = 'Deleted') + { + $modelClass = $this->model; + if(($model = $modelClass::findOne($id))){ + $model->delete(); + } else { + $this->owner->error = Yii::t('easyii', 'Not found'); + } + return $this->owner->formatResponse($successMessage); + } + + public function moveByTime($id, $direction, $condition = []) + { + $modelClass = $this->model; + $success = ''; + if(($model = $modelClass::findOne($id))){ + if($direction === 'up'){ + $eq = '>'; + $orderDir = 'ASC'; + } else { + $eq = '<'; + $orderDir = 'DESC'; + } + + $query = $modelClass::find()->orderBy('time '.$orderDir)->limit(1); + + $where = [$eq, 'time', $model->time]; + if(count($condition)){ + $where = ['and', $where]; + foreach($condition as $key => $value){ + $where[] = [$key => $value]; + } + } + $modelSwap = $query->where($where)->one(); + + if(!empty($modelSwap)) + { + $newOrderNum = $modelSwap->time; + + $modelSwap->time = $model->time; + $modelSwap->update(); + + $model->time = $newOrderNum; + $model->update(); + + $success = ['swap_id' => $modelSwap->primaryKey]; + } + } + else{ + $this->owner->error = Yii::t('easyii', 'Not found'); + } + + return $this->owner->formatResponse($success); + } + + public function moveByNum($id, $direction, $condition = []) + { + $modelClass = $this->model; + $success = ''; + if (($model = $modelClass::findOne($id))) { + if ($direction === 'up') { + $eq = '>'; + $orderDir = 'ASC'; + } else { + $eq = '<'; + $orderDir = 'DESC'; + } + + $query = $modelClass::find()->orderBy('order_num ' . $orderDir)->limit(1); + + $where = [$eq, 'order_num', $model->order_num]; + if (count($condition)) { + $where = ['and', $where]; + foreach ($condition as $key => $value) { + $where[] = [$key => $value]; + } + } + $modelSwap = $query->where($where)->one(); + + if (!empty($modelSwap)) { + $newOrderNum = $modelSwap->order_num; + + $modelSwap->order_num = $model->order_num; + $modelSwap->update(); + + $model->order_num = $newOrderNum; + $model->update(); + + $success = ['swap_id' => $modelSwap->primaryKey]; + } + } else { + $this->owner->error = Yii::t('easyii', 'Not found'); + } + + return $this->owner->formatResponse($success); + } +} \ No newline at end of file diff --git a/behaviors/ImageFile.php b/behaviors/ImageFile.php new file mode 100644 index 00000000..687eafe0 --- /dev/null +++ b/behaviors/ImageFile.php @@ -0,0 +1,89 @@ + 'beforeValidate', + ActiveRecord::EVENT_BEFORE_UPDATE => 'beforeUpdate', + ActiveRecord::EVENT_BEFORE_INSERT => 'beforeInsert', + ActiveRecord::EVENT_AFTER_DELETE => 'afterDelete', + ]; + } + + public function beforeValidate() + { + if(!empty($_FILES)){ + $this->owner->image_file = UploadedFile::getInstance($this->owner, 'image_file'); + } + } + + public function beforeInsert() + { + $model = $this->owner; + if ($model->image_file instanceof UploadedFile) { + $model->image_file = Image::upload($model->image_file, Module::getModuleName(get_class($model))); + if(!$model->image_file) { + $model->image_file = !$model->isNewRecord ? '' : $model->oldAttributes['image_file']; + } + } + } + + public function beforeUpdate() + { + if(!empty($_FILES)){ + $model = $this->owner; + + $model->image_file = UploadedFile::getInstance($model, 'image_file'); + if($model->image_file && $model->validate(['image_file'])){ + $model->image_file = Image::upload($model->image_file, Module::getModuleName(get_class($model))); + if($model->oldAttributes['image_file']){ + Upload::delete($model->oldAttributes['image_file']); + } + } + else{ + $model->image_file = $model->oldAttributes['image_file']; + } + } + } + + public function afterDelete() + { + if($this->owner->image_file){ + Upload::delete($this->owner->image_file); + } + } + + public function getImage() + { + return Upload::getLink($this->owner->image_file); + } + + public function getSeoText() + { + if(!$this->_model) + { + $this->_model = $this->owner->seo; + if(!$this->_model){ + $this->_model = new SeoText([ + 'class' => get_class($this->owner), + 'item_id' => $this->owner->primaryKey + ]); + } + } + + return $this->_model; + } +} \ No newline at end of file diff --git a/behaviors/SortableController.php b/behaviors/SortableController.php deleted file mode 100644 index 5e50024a..00000000 --- a/behaviors/SortableController.php +++ /dev/null @@ -1,51 +0,0 @@ -model; - $success = ''; - if (($model = $modelClass::findOne($id))) { - if ($direction === 'up') { - $eq = '>'; - $orderDir = 'ASC'; - } else { - $eq = '<'; - $orderDir = 'DESC'; - } - - $query = $modelClass::find()->orderBy('order_num ' . $orderDir)->limit(1); - - $where = [$eq, 'order_num', $model->order_num]; - if (count($condition)) { - $where = ['and', $where]; - foreach ($condition as $key => $value) { - $where[] = [$key => $value]; - } - } - $modelSwap = $query->where($where)->one(); - - if (!empty($modelSwap)) { - $newOrderNum = $modelSwap->order_num; - - $modelSwap->order_num = $model->order_num; - $modelSwap->update(); - - $model->order_num = $newOrderNum; - $model->update(); - - $success = ['swap_id' => $modelSwap->primaryKey]; - } - } else { - $this->owner->error = Yii::t('easyii', 'Not found'); - } - - return $this->owner->formatResponse($success); - } -} \ No newline at end of file diff --git a/behaviors/SortableDateController.php b/behaviors/SortableDateController.php deleted file mode 100644 index 0d681f50..00000000 --- a/behaviors/SortableDateController.php +++ /dev/null @@ -1,53 +0,0 @@ -model; - $success = ''; - if(($model = $modelClass::findOne($id))){ - if($direction === 'up'){ - $eq = '>'; - $orderDir = 'ASC'; - } else { - $eq = '<'; - $orderDir = 'DESC'; - } - - $query = $modelClass::find()->orderBy('time '.$orderDir)->limit(1); - - $where = [$eq, 'time', $model->time]; - if(count($condition)){ - $where = ['and', $where]; - foreach($condition as $key => $value){ - $where[] = [$key => $value]; - } - } - $modelSwap = $query->where($where)->one(); - - if(!empty($modelSwap)) - { - $newOrderNum = $modelSwap->time; - - $modelSwap->time = $model->time; - $modelSwap->update(); - - $model->time = $newOrderNum; - $model->update(); - - $success = ['swap_id' => $modelSwap->primaryKey]; - } - } - else{ - $this->owner->error = Yii::t('easyii', 'Not found'); - } - - return $this->owner->formatResponse($success); - } -} \ No newline at end of file diff --git a/behaviors/StatusController.php b/behaviors/StatusController.php deleted file mode 100644 index 0d4f1c46..00000000 --- a/behaviors/StatusController.php +++ /dev/null @@ -1,28 +0,0 @@ -model; - - if(($model = $modelClass::findOne($id))){ - $model->status = $status; - $model->update(); - } - else{ - $this->error = Yii::t('easyii', 'Not found'); - } - - return $this->owner->formatResponse(Yii::t('easyii', 'Status successfully changed')); - } -} \ No newline at end of file diff --git a/components/CategoryController.php b/components/CategoryController.php index b57bb297..528bb854 100644 --- a/components/CategoryController.php +++ b/components/CategoryController.php @@ -2,10 +2,9 @@ namespace yii\easyii\components; use Yii; +use yii\easyii\behaviors\CommonActions; use yii\easyii\behaviors\SortableModel; use yii\widgets\ActiveForm; -use yii\web\UploadedFile; -use yii\easyii\helpers\Image; /** * Category controller component @@ -22,6 +21,16 @@ class CategoryController extends Controller /** @var string */ public $viewRoute = '/items'; + public function behaviors() + { + return [ + [ + 'class' => CommonActions::className(), + 'model' => $this->categoryClass, + ], + ]; + } + /** * Categories list * @@ -53,15 +62,6 @@ public function actionCreate($parent = null) return ActiveForm::validate($model); } else{ - if(isset($_FILES) && $this->module->settings['categoryThumb']){ - $model->image_file = UploadedFile::getInstance($model, 'image_file'); - if($model->image_file && $model->validate(['image_file'])){ - $model->image_file = Image::upload($model->image_file, $this->moduleName); - } else { - $model->image_file = ''; - } - } - $model->status = $class::STATUS_ON; $parent = (int)Yii::$app->request->post('parent', null); @@ -112,14 +112,6 @@ public function actionEdit($id) return ActiveForm::validate($model); } else{ - if(isset($_FILES) && $this->module->settings['categoryThumb']){ - $model->image_file = UploadedFile::getInstance($model, 'image_file'); - if($model->image_file && $model->validate(['image_file'])){ - $model->image_file = Image::upload($model->image_file, $this->moduleName); - }else{ - $model->image_file = $model->oldAttributes['image_file']; - } - } if($model->save()){ $this->flash('success', Yii::t('easyii', 'Category updated')); } @@ -144,21 +136,7 @@ public function actionEdit($id) */ public function actionClearImage($id) { - $class = $this->categoryClass; - $model = $class::findOne($id); - - if($model === null){ - $this->flash('error', Yii::t('easyii', 'Not found')); - } - elseif($model->image_file){ - $model->image_file = ''; - if($model->update()){ - $this->flash('success', Yii::t('easyii', 'Image cleared')); - } else { - $this->flash('error', Yii::t('easyii', 'Update error. {0}', $model->formatErrors())); - } - } - return $this->back(); + return $this->clearImage($id); } /** diff --git a/components/CategoryModel.php b/components/CategoryModel.php index f7a856eb..25b93f0f 100644 --- a/components/CategoryModel.php +++ b/components/CategoryModel.php @@ -4,10 +4,10 @@ use Yii; use yii\behaviors\SluggableBehavior; use yii\easyii\behaviors\CacheFlush; +use yii\easyii\behaviors\ImageFile; use yii\easyii\behaviors\SeoBehavior; use creocoder\nestedsets\NestedSetsBehavior; use yii\easyii\behaviors\Taggable; -use yii\easyii\helpers\Upload; use yii\easyii\models\SeoText; /** @@ -33,10 +33,10 @@ public function rules() ['title', 'trim'], ['title', 'string', 'max' => 128], ['image_file', 'image'], - ['slug', 'match', 'pattern' => self::$SLUG_PATTERN, 'message' => Yii::t('easyii', 'Slug can contain only 0-9, a-z and "-" characters (max: 128).')], + ['slug', 'match', 'pattern' => static::$SLUG_PATTERN, 'message' => Yii::t('easyii', 'Slug can contain only 0-9, a-z and "-" characters (max: 128).')], ['slug', 'default', 'value' => null], ['tagNames', 'safe'], - [['status', 'depth', 'tree', 'lgt', 'rgt'], 'integer'], + [['status', 'depth', 'tree', 'lft', 'rgt'], 'integer'], ['status', 'default', 'value' => self::STATUS_ON] ]; } @@ -54,7 +54,7 @@ public function attributeLabels() public function behaviors() { $moduleSettings = Yii::$app->getModule('admin')->activeModules[Module::getModuleName(static::className())]->settings; - return [ + $behaviors = [ 'cacheflush' => [ 'class' => CacheFlush::className(), 'key' => [static::tableName().'_tree', static::tableName().'_flat'] @@ -72,32 +72,12 @@ public function behaviors() 'treeAttribute' => 'tree' ] ]; - } - public function beforeSave($insert) - { - if (parent::beforeSave($insert)) { - if(!$insert && $this->image_file != $this->oldAttributes['image_file'] && $this->oldAttributes['image_file']){ - Upload::delete($this->oldAttributes['image_file']); - } - return true; - } else { - return false; + if($moduleSettings['categoryThumb']){ + $behaviors['imageFileBehavior'] = ImageFile::className(); } - } - public function afterDelete() - { - parent::afterDelete(); - - if($this->image_file) { - Upload::delete($this->image_file); - } - } - - public function getImage() - { - return Upload::getLink($this->image_file); + return $behaviors; } /** diff --git a/composer.json b/composer.json index af37ae9f..4867729c 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,9 @@ "bower-asset/fancybox": "*", "bower-asset/jquery.switcher": "*", "bower-asset/eonasdan-bootstrap-datetimepicker": "^4.7@dev", - "2amigos/yii2-selectize-widget": "~1.0" + "2amigos/yii2-selectize-widget": "~1.0", + "vova07/yii2-imperavi-widget": "*", + "stojg/crop": "*" }, "autoload": { "psr-4": { diff --git a/controllers/AdminsController.php b/controllers/AdminsController.php index d8b6e6f0..cb4ce019 100644 --- a/controllers/AdminsController.php +++ b/controllers/AdminsController.php @@ -3,6 +3,7 @@ use Yii; use yii\data\ActiveDataProvider; +use yii\easyii\behaviors\CommonActions; use yii\widgets\ActiveForm; use yii\easyii\models\Admin; @@ -10,6 +11,16 @@ class AdminsController extends \yii\easyii\components\Controller { public $rootActions = 'all'; + public function behaviors() + { + return [ + [ + 'class' => CommonActions::className(), + 'model' => Admin::className(), + ], + ]; + } + public function actionIndex() { $data = new ActiveDataProvider([ @@ -83,11 +94,6 @@ public function actionEdit($id) public function actionDelete($id) { - if(($model = Admin::findOne($id))){ - $model->delete(); - } else { - $this->error = Yii::t('easyii', 'Not found'); - } - return $this->formatResponse(Yii::t('easyii', 'Admin deleted')); + return $this->deleteModel($id, Yii::t('easyii', 'Admin deleted')); } } \ No newline at end of file diff --git a/controllers/ModulesController.php b/controllers/ModulesController.php index b046e6df..5c0a6efb 100644 --- a/controllers/ModulesController.php +++ b/controllers/ModulesController.php @@ -3,13 +3,12 @@ use Yii; use yii\data\ActiveDataProvider; +use yii\easyii\behaviors\CommonActions; use yii\easyii\models\CopyModuleForm; use yii\helpers\FileHelper; use yii\widgets\ActiveForm; use yii\easyii\models\Module; -use yii\easyii\behaviors\SortableController; -use yii\easyii\behaviors\StatusController; class ModulesController extends \yii\easyii\components\Controller { @@ -19,13 +18,9 @@ public function behaviors() { return [ [ - 'class' => SortableController::className(), - 'model' => Module::className() + 'class' => CommonActions::className(), + 'model' => Module::className(), ], - [ - 'class' => StatusController::className(), - 'model' => Module::className() - ] ]; } @@ -263,22 +258,17 @@ public function actionCopy($id) public function actionDelete($id) { - if(($model = Module::findOne($id))){ - $model->delete(); - } else { - $this->error = Yii::t('easyii', 'Not found'); - } - return $this->formatResponse(Yii::t('easyii', 'Module deleted')); + return $this->deleteModel($id, Yii::t('easyii', 'Module deleted')); } public function actionUp($id) { - return $this->move($id, 'up'); + return $this->moveByNum($id, 'up'); } public function actionDown($id) { - return $this->move($id, 'down'); + return $this->moveByNum($id, 'down'); } public function actionOn($id) diff --git a/controllers/PhotosController.php b/controllers/PhotosController.php index 638574e3..c23d268f 100644 --- a/controllers/PhotosController.php +++ b/controllers/PhotosController.php @@ -2,16 +2,14 @@ namespace yii\easyii\controllers; use Yii; +use yii\easyii\behaviors\CommonActions; use yii\easyii\components\Module; use yii\easyii\helpers\Upload; -use yii\helpers\Url; use yii\web\UploadedFile; use yii\web\Response; - use yii\easyii\helpers\Image; use yii\easyii\components\Controller; use yii\easyii\models\Photo; -use yii\easyii\behaviors\SortableController; class PhotosController extends Controller { @@ -25,7 +23,7 @@ public function behaviors() ], ], [ - 'class' => SortableController::className(), + 'class' => CommonActions::className(), 'model' => Photo::className(), ] ]; @@ -141,21 +139,16 @@ public function actionImage($id) public function actionDelete($id) { - if(($model = Photo::findOne($id))){ - $model->delete(); - } else { - $this->error = Yii::t('easyii', 'Not found'); - } - return $this->formatResponse(Yii::t('easyii', 'Photo deleted')); + return $this->deleteModel($id, Yii::t('easyii', 'Photo deleted')); } public function actionUp($id, $class, $item_id) { - return $this->move($id, 'up', ['class' => $class, 'item_id' => $item_id]); + return $this->moveByNum($id, 'up', ['class' => $class, 'item_id' => $item_id]); } public function actionDown($id, $class, $item_id) { - return $this->move($id, 'down', ['class' => $class, 'item_id' => $item_id]); + return $this->moveByNum($id, 'down', ['class' => $class, 'item_id' => $item_id]); } } \ No newline at end of file diff --git a/controllers/SettingsController.php b/controllers/SettingsController.php index 4faf0edc..92f07909 100644 --- a/controllers/SettingsController.php +++ b/controllers/SettingsController.php @@ -3,6 +3,7 @@ use Yii; use yii\data\ActiveDataProvider; +use yii\easyii\behaviors\CommonActions; use yii\widgets\ActiveForm; use yii\easyii\models\Setting; @@ -10,6 +11,16 @@ class SettingsController extends \yii\easyii\components\Controller { public $rootActions = ['create', 'delete']; + public function behaviors() + { + return [ + [ + 'class' => CommonActions::className(), + 'model' => Setting::className(), + ], + ]; + } + public function actionIndex() { $data = new ActiveDataProvider([ @@ -82,11 +93,6 @@ public function actionEdit($id) public function actionDelete($id) { - if(($model = Setting::findOne($id))){ - $model->delete(); - } else { - $this->error = Yii::t('easyii', 'Not found'); - } - return $this->formatResponse(Yii::t('easyii', 'Setting deleted')); + return $this->deleteModel($id, Yii::t('easyii', 'Setting deleted')); } } \ No newline at end of file diff --git a/controllers/SystemController.php b/controllers/SystemController.php index 8afe59e1..bb445c62 100644 --- a/controllers/SystemController.php +++ b/controllers/SystemController.php @@ -65,4 +65,16 @@ private function deleteDir($directory) } return rmdir($directory); } + + public function actionTest() + { + foreach(\yii\easyii\modules\news\models\News::find()->all() as $photo){ + $pieces = explode('/', $photo->image_file); + $count = count($pieces); + if($count > 2){ + $new = $pieces[$count - 2] . '/' . $pieces[$count - 1]; + \yii\easyii\modules\news\models\News::updateAll(['image_file' => $new], ['news_id' => $photo->news_id]); + } + } + } } \ No newline at end of file diff --git a/helpers/Upload.php b/helpers/Upload.php index e2ca19b5..2f2c9621 100644 --- a/helpers/Upload.php +++ b/helpers/Upload.php @@ -41,6 +41,9 @@ static function getUploadPath($dir = null) static function getLink($fileName) { + if(!$fileName){ + return ''; + } return '/' . implode('/', array_filter([ Yii::getAlias('@web'), basename(Yii::getAlias('@uploads')), @@ -51,7 +54,7 @@ static function getLink($fileName) static function getAbsolutePath($fileName) { if(!$fileName){ - return null; + return ''; } if(strpos($fileName, Yii::getAlias('@uploads')) !== false ){ return $fileName; @@ -62,7 +65,12 @@ static function getAbsolutePath($fileName) static function delete($fileName) { - @unlink(self::getAbsolutePath($fileName)); + if($fileName) { + $filePath = self::getAbsolutePath($fileName); + if(is_file($filePath)){ + @unlink($filePath); + } + } } static function getFileName(UploadedFile $fileInstance, $namePostfix = true) diff --git a/modules/article/controllers/ItemsController.php b/modules/article/controllers/ItemsController.php index f8f68b4d..8530e6c2 100644 --- a/modules/article/controllers/ItemsController.php +++ b/modules/article/controllers/ItemsController.php @@ -2,14 +2,10 @@ namespace yii\easyii\modules\article\controllers; use Yii; -use yii\easyii\behaviors\SortableDateController; -use yii\easyii\behaviors\StatusController; -use yii\web\UploadedFile; - +use yii\easyii\behaviors\CommonActions; use yii\easyii\components\Controller; use yii\easyii\modules\article\models\Category; use yii\easyii\modules\article\models\Item; -use yii\easyii\helpers\Image; use yii\widgets\ActiveForm; class ItemsController extends Controller @@ -18,13 +14,9 @@ public function behaviors() { return [ [ - 'class' => SortableDateController::className(), + 'class' => CommonActions::className(), 'model' => Item::className(), ], - [ - 'class' => StatusController::className(), - 'model' => Item::className() - ] ]; } @@ -39,7 +31,6 @@ public function actionIndex($id) ]); } - public function actionCreate($id) { if(!($category = Category::findOne($id))){ @@ -56,15 +47,6 @@ public function actionCreate($id) else { $model->category_id = $category->primaryKey; - if (isset($_FILES) && $this->module->settings['articleThumb']) { - $model->image_file = UploadedFile::getInstance($model, 'image_file'); - if ($model->image_file && $model->validate(['image_file'])) { - $model->image_file = Image::upload($model->image_file, 'article'); - } else { - $model->image_file = ''; - } - } - if ($model->save()) { $this->flash('success', Yii::t('easyii/article', 'Article created')); return $this->redirect(['/admin/'.$this->module->id.'/items/edit', 'id' => $model->primaryKey]); @@ -94,15 +76,6 @@ public function actionEdit($id) return ActiveForm::validate($model); } else { - if (isset($_FILES) && $this->module->settings['articleThumb']) { - $model->image_file = UploadedFile::getInstance($model, 'image_file'); - if ($model->image_file && $model->validate(['image_file'])) { - $model->image_file = Image::upload($model->image_file, 'article'); - } else { - $model->image_file = $model->oldAttributes['image_file']; - } - } - if ($model->save()) { $this->flash('success', Yii::t('easyii/article', 'Article updated')); return $this->redirect(['/admin/'.$this->module->id.'/items/edit', 'id' => $model->primaryKey]); @@ -132,40 +105,22 @@ public function actionPhotos($id) public function actionClearImage($id) { - $model = Item::findOne($id); - - if($model === null){ - $this->flash('error', Yii::t('easyii', 'Not found')); - } - elseif($model->image_file){ - $model->image_file = ''; - if($model->update()){ - $this->flash('success', Yii::t('easyii', 'Image cleared')); - } else { - $this->flash('error', Yii::t('easyii', 'Update error. {0}', $model->formatErrors())); - } - } - return $this->back(); + return $this->clearImage($id); } public function actionDelete($id) { - if(($model = Item::findOne($id))){ - $model->delete(); - } else { - $this->error = Yii::t('easyii', 'Not found'); - } - return $this->formatResponse(Yii::t('easyii/article', 'Article deleted')); + return $this->deleteModel($id, Yii::t('easyii/article', 'Article deleted')); } public function actionUp($id, $category_id) { - return $this->move($id, 'up', ['category_id' => $category_id]); + return $this->moveByTime($id, 'up', ['category_id' => $category_id]); } public function actionDown($id, $category_id) { - return $this->move($id, 'down', ['category_id' => $category_id]); + return $this->moveByTime($id, 'down', ['category_id' => $category_id]); } public function actionOn($id) diff --git a/modules/article/models/Item.php b/modules/article/models/Item.php index 8f1a9f6b..3e59d053 100644 --- a/modules/article/models/Item.php +++ b/modules/article/models/Item.php @@ -3,9 +3,9 @@ use Yii; use yii\behaviors\SluggableBehavior; +use yii\easyii\behaviors\ImageFile; use yii\easyii\behaviors\SeoBehavior; use yii\easyii\behaviors\Taggable; -use yii\easyii\helpers\Upload; use yii\easyii\models\Photo; use yii\easyii\modules\article\ArticleModule; use yii\helpers\StringHelper; @@ -26,7 +26,7 @@ public function rules() [['text', 'title'], 'required'], [['title', 'short', 'text'], 'trim'], ['title', 'string', 'max' => 128], - ['image', 'image'], + ['image_file', 'image'], [['category_id', 'views', 'time', 'status'], 'integer'], ['time', 'default', 'value' => time()], ['slug', 'match', 'pattern' => self::$SLUG_PATTERN, 'message' => Yii::t('easyii', 'Slug can contain only 0-9, a-z and "-" characters (max: 128).')], @@ -42,7 +42,7 @@ public function attributeLabels() 'title' => Yii::t('easyii', 'Title'), 'text' => Yii::t('easyii', 'Text'), 'short' => Yii::t('easyii/article', 'Short'), - 'image' => Yii::t('easyii', 'Image'), + 'image_file' => Yii::t('easyii', 'Image'), 'time' => Yii::t('easyii', 'Date'), 'slug' => Yii::t('easyii', 'Slug'), 'tagNames' => Yii::t('easyii', 'Tags'), @@ -51,7 +51,7 @@ public function attributeLabels() public function behaviors() { - return [ + $behaviors = [ 'seoBehavior' => SeoBehavior::className(), 'taggabble' => Taggable::className(), 'sluggable' => [ @@ -61,6 +61,11 @@ public function behaviors() 'immutable' => ArticleModule::setting('itemSlugImmutable') ] ]; + if(ArticleModule::setting('articleThumb')){ + $behaviors['imageFileBehavior'] = ImageFile::className(); + } + + return $behaviors; } public function getCategory() @@ -73,20 +78,11 @@ public function getPhotos() return $this->hasMany(Photo::className(), ['item_id' => 'item_id'])->where(['class' => self::className()])->sort(); } - public function getImage() - { - return Upload::getLink($this->image_file); - } - public function beforeSave($insert) { if (parent::beforeSave($insert)) { $this->short = StringHelper::truncate(ArticleModule::setting('enableShort') ? $this->short : strip_tags($this->text), ArticleModule::setting('shortMaxLength')); - if(!$insert && $this->image_file != $this->oldAttributes['image_file'] && $this->oldAttributes['image_file']){ - Upload::delete($this->oldAttributes['image_file']); - } - return true; } else { return false; @@ -97,10 +93,6 @@ public function afterDelete() { parent::afterDelete(); - if($this->image_file){ - Upload::delete($this->image_file); - } - foreach($this->getPhotos()->all() as $photo){ $photo->delete(); } diff --git a/modules/carousel/controllers/AController.php b/modules/carousel/controllers/AController.php index 8bc95453..4cbdc8b8 100644 --- a/modules/carousel/controllers/AController.php +++ b/modules/carousel/controllers/AController.php @@ -3,15 +3,10 @@ use Yii; use yii\data\ActiveDataProvider; +use yii\easyii\behaviors\CommonActions; use yii\widgets\ActiveForm; -use yii\web\UploadedFile; - use yii\easyii\components\Controller; use yii\easyii\modules\carousel\models\Carousel; -use yii\easyii\helpers\Image; -use yii\easyii\behaviors\SortableController; -use yii\easyii\behaviors\StatusController; - class AController extends Controller { @@ -19,13 +14,9 @@ public function behaviors() { return [ [ - 'class' => SortableController::className(), - 'model' => Carousel::className() + 'class' => CommonActions::className(), + 'model' => Carousel::className(), ], - [ - 'class' => StatusController::className(), - 'model' => Carousel::className() - ] ]; } @@ -42,6 +33,7 @@ public function actionIndex() public function actionCreate() { $model = new Carousel; + $model->scenario = 'create'; if ($model->load(Yii::$app->request->post())) { if(Yii::$app->request->isAjax){ @@ -49,27 +41,13 @@ public function actionCreate() return ActiveForm::validate($model); } else{ - if(($fileInstanse = UploadedFile::getInstance($model, 'image_file'))) - { - $model->image_file = $fileInstanse; - if($model->validate(['image_file'])){ - $model->image_file = Image::upload($model->image_file, 'carousel'); - $model->status = Carousel::STATUS_ON; - - if($model->save()){ - $this->flash('success', Yii::t('easyii/carousel', 'Carousel created')); - return $this->redirect(['/admin/'.$this->module->id]); - } - else{ - $this->flash('error', Yii::t('easyii', 'Create error. {0}', $model->formatErrors())); - } - } - else { - $this->flash('error', Yii::t('easyii', 'Create error. {0}', $model->formatErrors())); - } + $model->status = Carousel::STATUS_ON; + if($model->save()){ + $this->flash('success', Yii::t('easyii/carousel', 'Carousel created')); + return $this->redirect(['/admin/'.$this->module->id]); } - else { - $this->flash('error', Yii::t('yii', '{attribute} cannot be blank.', ['attribute' => $model->getAttributeLabel('image')])); + else{ + $this->flash('error', Yii::t('easyii', 'Create error. {0}', $model->formatErrors())); } return $this->refresh(); } @@ -96,21 +74,6 @@ public function actionEdit($id) return ActiveForm::validate($model); } else{ - if(($fileInstanse = UploadedFile::getInstance($model, 'image_file'))) - { - $model->image_file = $fileInstanse; - if($model->validate(['image_file'])){ - $model->image_file = Image::upload($model->image_file, 'carousel'); - } - else { - $this->flash('error', Yii::t('easyii', 'Update error. {0}', $model->formatErrors())); - return $this->refresh(); - } - } - else{ - $model->image_file = $model->oldAttributes['image_file']; - } - if($model->save()){ $this->flash('success', Yii::t('easyii/carousel', 'Carousel updated')); } @@ -129,22 +92,17 @@ public function actionEdit($id) public function actionDelete($id) { - if(($model = Carousel::findOne($id))){ - $model->delete(); - } else { - $this->error = Yii::t('easyii', 'Not found'); - } - return $this->formatResponse(Yii::t('easyii/carousel', 'Carousel item deleted')); + return $this->deleteModel($id, Yii::t('easyii/carousel', 'Carousel item deleted')); } public function actionUp($id) { - return $this->move($id, 'up'); + return $this->moveByNum($id, 'up'); } public function actionDown($id) { - return $this->move($id, 'down'); + return $this->moveByNum($id, 'down'); } public function actionOn($id) diff --git a/modules/carousel/models/Carousel.php b/modules/carousel/models/Carousel.php index 8c1fdbb1..c5de285c 100644 --- a/modules/carousel/models/Carousel.php +++ b/modules/carousel/models/Carousel.php @@ -3,8 +3,8 @@ use Yii; use yii\easyii\behaviors\CacheFlush; +use yii\easyii\behaviors\ImageFile; use yii\easyii\behaviors\SortableModel; -use yii\easyii\helpers\Upload; class Carousel extends \yii\easyii\components\ActiveRecord { @@ -20,7 +20,8 @@ public static function tableName() public function rules() { return [ - ['image', 'image'], + ['image_file', 'required', 'on' => 'create'], + ['image_file', 'image'], [['title', 'text', 'link'], 'trim'], ['status', 'integer'], ['status', 'default', 'value' => self::STATUS_ON], @@ -30,7 +31,7 @@ public function rules() public function attributeLabels() { return [ - 'image' => Yii::t('easyii', 'Image'), + 'image_file' => Yii::t('easyii', 'Image'), 'link' => Yii::t('easyii', 'Link'), 'title' => Yii::t('easyii', 'Title'), 'text' => Yii::t('easyii', 'Text'), @@ -41,31 +42,8 @@ public function behaviors() { return [ CacheFlush::className(), - SortableModel::className() + SortableModel::className(), + ImageFile::className() ]; } - - public function getImage() - { - return Upload::getLink($this->image_file); - } - - public function beforeSave($insert) - { - if (parent::beforeSave($insert)) { - if(!$insert && $this->image_file != $this->oldAttributes['image_file'] && $this->oldAttributes['image_file']){ - Upload::delete($this->oldAttributes['image_file']); - } - return true; - } else { - return false; - } - } - - public function afterDelete() - { - parent::afterDelete(); - - Upload::delete($this->image_file); - } } \ No newline at end of file diff --git a/modules/catalog/controllers/ItemsController.php b/modules/catalog/controllers/ItemsController.php index 57a8cb99..52c07113 100644 --- a/modules/catalog/controllers/ItemsController.php +++ b/modules/catalog/controllers/ItemsController.php @@ -2,17 +2,14 @@ namespace yii\easyii\modules\catalog\controllers; use Yii; -use yii\easyii\behaviors\StatusController; +use yii\easyii\behaviors\CommonActions; use yii\easyii\helpers\Upload; use yii\validators\FileValidator; use yii\web\UploadedFile; use yii\helpers\Html; - use yii\easyii\components\Controller; use yii\easyii\modules\catalog\models\Category; use yii\easyii\modules\catalog\models\Item; -use yii\easyii\helpers\Image; -use yii\easyii\behaviors\SortableDateController; use yii\widgets\ActiveForm; class ItemsController extends Controller @@ -23,13 +20,9 @@ public function behaviors() { return [ [ - 'class' => SortableDateController::className(), + 'class' => CommonActions::className(), 'model' => Item::className(), ], - [ - 'class' => StatusController::className(), - 'model' => Item::className() - ] ]; } @@ -62,14 +55,6 @@ public function actionCreate($id) $model->category_id = $category->primaryKey; $this->parseData($model); - if (isset($_FILES) && $this->module->settings['itemThumb']) { - $model->image_file = UploadedFile::getInstance($model, 'image_file'); - if ($model->image_file && $model->validate(['image_file'])) { - $model->image_file = Image::upload($model->image_file, 'catalog'); - } else { - $model->image_file = ''; - } - } if ($model->save()) { $this->flash('success', Yii::t('easyii/catalog', 'Item created')); return $this->redirect(['/admin/'.$this->module->id.'/items/edit/', 'id' => $model->primaryKey]); @@ -102,15 +87,6 @@ public function actionEdit($id) else { $this->parseData($model); - if (isset($_FILES) && $this->module->settings['itemThumb']) { - $model->image_file = UploadedFile::getInstance($model, 'image_file'); - if ($model->image_file && $model->validate(['image_file'])) { - $model->image_file = Image::upload($model->image_file, 'catalog'); - } else { - $model->image_file = $model->oldAttributes['image_file']; - } - } - if ($model->save()) { $this->flash('success', Yii::t('easyii/catalog', 'Item updated')); return $this->redirect(['/admin/'.$this->module->id.'/items/edit', 'id' => $model->primaryKey]); @@ -141,31 +117,12 @@ public function actionPhotos($id) public function actionClearImage($id) { - $model = Item::findOne($id); - - if($model === null){ - $this->flash('error', Yii::t('easyii', 'Not found')); - } - elseif($model->image_file){ - $model->image_file = ''; - if($model->update()){ - Upload::delete($model->image_file); - $this->flash('success', Yii::t('easyii', 'Image cleared')); - } else { - $this->flash('error', Yii::t('easyii', 'Update error. {0}', $model->formatErrors())); - } - } - return $this->back(); + return $this->clearImage($id); } public function actionDelete($id) { - if(($model = Item::findOne($id))){ - $model->delete(); - } else { - $this->error = Yii::t('easyii', 'Not found'); - } - return $this->formatResponse(Yii::t('easyii/catalog', 'Item deleted')); + return $this->deleteModel($id, Yii::t('easyii/catalog', 'Item deleted')); } public function actionDeleteDataFile($file) @@ -185,12 +142,12 @@ public function actionDeleteDataFile($file) public function actionUp($id, $category_id) { - return $this->move($id, 'up', ['category_id' => $category_id]); + return $this->moveByTime($id, 'up', ['category_id' => $category_id]); } public function actionDown($id, $category_id) { - return $this->move($id, 'down', ['category_id' => $category_id]); + return $this->moveByTime($id, 'down', ['category_id' => $category_id]); } public function actionOn($id) diff --git a/modules/catalog/models/Item.php b/modules/catalog/models/Item.php index 4262b718..c18d0eaa 100644 --- a/modules/catalog/models/Item.php +++ b/modules/catalog/models/Item.php @@ -3,8 +3,8 @@ use Yii; use yii\behaviors\SluggableBehavior; +use yii\easyii\behaviors\ImageFile; use yii\easyii\behaviors\SeoBehavior; -use yii\easyii\helpers\Upload; use yii\easyii\models\Photo; use yii\easyii\modules\catalog\CatalogModule; @@ -52,7 +52,7 @@ public function attributeLabels() public function behaviors() { - return [ + $behaviors = [ 'seoBehavior' => SeoBehavior::className(), 'sluggable' => [ 'class' => SluggableBehavior::className(), @@ -61,6 +61,10 @@ public function behaviors() 'immutable' => CatalogModule::setting('itemSlugImmutable') ] ]; + if(CatalogModule::setting('itemThumb')){ + $behaviors['imageFileBehavior'] = ImageFile::className(); + } + return $behaviors; } public function beforeSave($insert) @@ -69,13 +73,7 @@ public function beforeSave($insert) if(!$this->data || (!is_object($this->data) && !is_array($this->data))){ $this->data = new \stdClass(); } - $this->data = json_encode($this->data); - - if(!$insert && $this->image_file != $this->oldAttributes['image_file'] && $this->oldAttributes['image_file']){ - Upload::delete($this->oldAttributes['image_file']); - } - return true; } else { return false; @@ -124,11 +122,6 @@ public function getCategory() return $this->hasOne(Category::className(), ['category_id' => 'category_id']); } - public function getImage() - { - return Upload::getLink($this->image_file); - } - public function afterDelete() { parent::afterDelete(); @@ -137,10 +130,6 @@ public function afterDelete() $photo->delete(); } - if($this->image_file) { - Upload::delete($this->image_file); - } - ItemData::deleteAll(['item_id' => $this->primaryKey]); } diff --git a/modules/faq/controllers/AController.php b/modules/faq/controllers/AController.php index 278fafad..cf4085f5 100644 --- a/modules/faq/controllers/AController.php +++ b/modules/faq/controllers/AController.php @@ -3,12 +3,10 @@ use Yii; use yii\data\ActiveDataProvider; +use yii\easyii\behaviors\CommonActions; use yii\widgets\ActiveForm; - use yii\easyii\components\Controller; use yii\easyii\modules\faq\models\Faq; -use yii\easyii\behaviors\SortableController; -use yii\easyii\behaviors\StatusController; class AController extends Controller { @@ -16,13 +14,9 @@ public function behaviors() { return [ [ - 'class' => SortableController::className(), - 'model' => Faq::className() + 'class' => CommonActions::className(), + 'model' => Faq::className(), ], - [ - 'class' => StatusController::className(), - 'model' => Faq::className() - ] ]; } @@ -98,22 +92,17 @@ public function actionEdit($id) public function actionDelete($id) { - if(($model = Faq::findOne($id))){ - $model->delete(); - } else { - $this->error = Yii::t('easyii', 'Not found'); - } - return $this->formatResponse(Yii::t('easyii/faq', 'Entry deleted')); + return $this->deleteModel($id, Yii::t('easyii/faq', 'Entry deleted')); } public function actionUp($id) { - return $this->move($id, 'up'); + return $this->moveByNum($id, 'up'); } public function actionDown($id) { - return $this->move($id, 'down'); + return $this->moveByNum($id, 'down'); } public function actionOn($id) diff --git a/modules/feedback/controllers/AController.php b/modules/feedback/controllers/AController.php index 1c19a9e8..b3c16f85 100644 --- a/modules/feedback/controllers/AController.php +++ b/modules/feedback/controllers/AController.php @@ -4,6 +4,7 @@ use Yii; use yii\data\ActiveDataProvider; +use yii\easyii\behaviors\CommonActions; use yii\easyii\components\Controller; use yii\easyii\models\Setting; use yii\easyii\modules\feedback\models\Feedback; @@ -13,6 +14,16 @@ class AController extends Controller public $new = 0; public $noAnswer = 0; + public function behaviors() + { + return [ + [ + 'class' => CommonActions::className(), + 'model' => Feedback::className(), + ], + ]; + } + public function init() { parent::init(); @@ -124,11 +135,6 @@ public function actionSetAnswer($id) public function actionDelete($id) { - if(($model = Feedback::findOne($id))){ - $model->delete(); - } else { - $this->error = Yii::t('easyii', 'Not found'); - } - return $this->formatResponse(Yii::t('easyii/feedback', 'Feedback deleted')); + return $this->deleteModel($id, Yii::t('easyii/feedback', 'Feedback deleted')); } } \ No newline at end of file diff --git a/modules/file/controllers/AController.php b/modules/file/controllers/AController.php index a59dc985..bf15c659 100644 --- a/modules/file/controllers/AController.php +++ b/modules/file/controllers/AController.php @@ -3,13 +3,13 @@ use Yii; use yii\data\ActiveDataProvider; +use yii\easyii\behaviors\CommonActions; use yii\widgets\ActiveForm; use yii\web\UploadedFile; use yii\easyii\components\Controller; use yii\easyii\modules\file\models\File; use yii\easyii\helpers\Upload; -use yii\easyii\behaviors\SortableController; class AController extends Controller { @@ -17,7 +17,7 @@ public function behaviors() { return [ [ - 'class' => SortableController::className(), + 'class' => CommonActions::className(), 'model' => File::className() ], ]; @@ -127,21 +127,16 @@ public function actionEdit($id) public function actionDelete($id) { - if(($model = File::findOne($id))){ - $model->delete(); - } else { - $this->error = Yii::t('easyii', 'Not found'); - } - return $this->formatResponse(Yii::t('easyii/file', 'File deleted')); + return $this->deleteModel($id, Yii::t('easyii/file', 'File deleted')); } public function actionUp($id) { - return $this->move($id, 'up'); + return $this->moveByNum($id, 'up'); } public function actionDown($id) { - return $this->move($id, 'down'); + return $this->moveByNum($id, 'down'); } } \ No newline at end of file diff --git a/modules/guestbook/controllers/AController.php b/modules/guestbook/controllers/AController.php index def22d18..3ad6ef24 100644 --- a/modules/guestbook/controllers/AController.php +++ b/modules/guestbook/controllers/AController.php @@ -4,7 +4,7 @@ use Yii; use yii\data\ActiveDataProvider; -use yii\easyii\behaviors\StatusController; +use yii\easyii\behaviors\CommonActions; use yii\easyii\components\Controller; use yii\easyii\modules\guestbook\models\Guestbook; @@ -17,7 +17,7 @@ public function behaviors() { return [ [ - 'class' => StatusController::className(), + 'class' => CommonActions::className(), 'model' => Guestbook::className() ] ]; @@ -90,12 +90,7 @@ public function actionView($id) public function actionDelete($id) { - if(($model = Guestbook::findOne($id))){ - $model->delete(); - } else { - $this->error = Yii::t('easyii', 'Not found'); - } - return $this->formatResponse(Yii::t('easyii/guestbook', 'Entry deleted')); + return $this->deleteModel($id, Yii::t('easyii/guestbook', 'Entry deleted')); } public function actionViewall() diff --git a/modules/news/controllers/AController.php b/modules/news/controllers/AController.php index 64455518..5976418e 100644 --- a/modules/news/controllers/AController.php +++ b/modules/news/controllers/AController.php @@ -3,16 +3,10 @@ use Yii; use yii\data\ActiveDataProvider; -use yii\easyii\behaviors\SortableDateController; -use yii\easyii\helpers\Upload; -use yii\easyii\modules\news\NewsModule; +use yii\easyii\behaviors\CommonActions; use yii\widgets\ActiveForm; -use yii\web\UploadedFile; - use yii\easyii\components\Controller; use yii\easyii\modules\news\models\News; -use yii\easyii\helpers\Image; -use yii\easyii\behaviors\StatusController; class AController extends Controller { @@ -20,19 +14,14 @@ public function behaviors() { return [ [ - 'class' => SortableDateController::className(), + 'class' => CommonActions::className(), 'model' => News::className(), ], - [ - 'class' => StatusController::className(), - 'model' => News::className() - ] ]; } public function actionIndex() { - var_dump(NewsModule::setting('enableThumb')); $data = new ActiveDataProvider([ 'query' => News::find()->sortDate(), ]); @@ -53,15 +42,6 @@ public function actionCreate() return ActiveForm::validate($model); } else{ - if(isset($_FILES) && $this->module->settings['enableThumb']){ - $model->image_file = UploadedFile::getInstance($model, 'image_file'); - if($model->image_file && $model->validate(['image_file'])){ - $model->image_file = Image::upload($model->image_file, 'news'); - } - else{ - $model->image_file = ''; - } - } if($model->save()){ $this->flash('success', Yii::t('easyii/news', 'News created')); return $this->redirect(['/admin/'.$this->module->id]); @@ -94,16 +74,6 @@ public function actionEdit($id) return ActiveForm::validate($model); } else{ - if(isset($_FILES) && $this->module->settings['enableThumb']){ - $model->image_file = UploadedFile::getInstance($model, 'image_file'); - if($model->image_file && $model->validate(['image_file'])){ - $model->image_file = Image::upload($model->image_file, 'news'); - } - else{ - $model->image_file = $model->oldAttributes['image_file']; - } - } - if($model->save()){ $this->flash('success', Yii::t('easyii/news', 'News updated')); } @@ -133,41 +103,22 @@ public function actionPhotos($id) public function actionDelete($id) { - if(($model = News::findOne($id))){ - $model->delete(); - } else { - $this->error = Yii::t('easyii', 'Not found'); - } - return $this->formatResponse(Yii::t('easyii/news', 'News deleted')); + return $this->deleteModel($id, Yii::t('easyii/news', 'News deleted')); } public function actionClearImage($id) { - $model = News::findOne($id); - - if($model === null){ - $this->flash('error', Yii::t('easyii', 'Not found')); - } - else{ - $model->image_file = ''; - if($model->update()){ - Upload::delete($model->image_file); - $this->flash('success', Yii::t('easyii', 'Image cleared')); - } else { - $this->flash('error', Yii::t('easyii', 'Update error. {0}', $model->formatErrors())); - } - } - return $this->back(); + return $this->clearImage($id); } public function actionUp($id) { - return $this->move($id, 'up'); + return $this->moveByTime($id, 'up'); } public function actionDown($id) { - return $this->move($id, 'down'); + return $this->moveByTime($id, 'down'); } public function actionOn($id) diff --git a/modules/news/models/News.php b/modules/news/models/News.php index 0eb612ae..efb74d26 100644 --- a/modules/news/models/News.php +++ b/modules/news/models/News.php @@ -3,9 +3,9 @@ use Yii; use yii\behaviors\SluggableBehavior; +use yii\easyii\behaviors\ImageFile; use yii\easyii\behaviors\SeoBehavior; use yii\easyii\behaviors\Taggable; -use yii\easyii\helpers\Upload; use yii\easyii\models\Photo; use yii\easyii\modules\news\NewsModule; use yii\helpers\StringHelper; @@ -56,7 +56,7 @@ public function attributeLabels() 'title' => Yii::t('easyii', 'Title'), 'text' => Yii::t('easyii', 'Text'), 'short' => Yii::t('easyii/news', 'Short'), - 'image' => Yii::t('easyii', 'Image'), + 'image_file' => Yii::t('easyii', 'Image'), 'time' => Yii::t('easyii', 'Date'), 'slug' => Yii::t('easyii', 'Slug'), 'tagNames' => Yii::t('easyii', 'Tags'), @@ -65,7 +65,7 @@ public function attributeLabels() public function behaviors() { - return [ + $behaviors = [ 'seoBehavior' => SeoBehavior::className(), 'taggabble' => Taggable::className(), 'sluggable' => [ @@ -75,6 +75,12 @@ public function behaviors() 'immutable' => NewsModule::setting('slugImmutable') ], ]; + + if(NewsModule::setting('enableThumb')){ + $behaviors['imageFileBehavior'] = ImageFile::className(); + } + + return $behaviors; } public function getPhotos() @@ -82,19 +88,11 @@ public function getPhotos() return $this->hasMany(Photo::className(), ['item_id' => 'news_id'])->where(['class' => self::className()])->sort(); } - public function getImage() - { - return Upload::getLink($this->image_file); - } - public function beforeSave($insert) { if (parent::beforeSave($insert)) { $this->short = StringHelper::truncate(NewsModule::setting('enableShort') ? $this->short : strip_tags($this->text), NewsModule::setting('shortMaxLength')); - if(!$insert && $this->image_file != $this->oldAttributes['image_file'] && $this->oldAttributes['image_file']){ - Upload::delete($this->oldAttributes['image_file']); - } return true; } else { return false; @@ -105,10 +103,6 @@ public function afterDelete() { parent::afterDelete(); - if($this->image_file){ - Upload::delete($this->image_file); - } - foreach($this->getPhotos()->all() as $photo){ $photo->delete(); } diff --git a/modules/news/views/a/_form.php b/modules/news/views/a/_form.php index 51a502f1..8a64d811 100644 --- a/modules/news/views/a/_form.php +++ b/modules/news/views/a/_form.php @@ -1,4 +1,5 @@ context->module->settings['enableShort']) : ?> field($model, 'short')->textarea() ?> -field($model, 'text')->widget(Redactor::className(),[ - 'options' => [ + +field($model, 'content')->widget(Widget::className(), [ + 'settings' => [ + 'lang' => 'ru', 'minHeight' => 400, - 'imageUpload' => Url::to(['/admin/redactor/upload', 'dir' => 'news']), - 'fileUpload' => Url::to(['/admin/redactor/upload', 'dir' => 'news']), - 'plugins' => ['fullscreen'] + 'plugins' => [ + 'clips', + 'fullscreen' + ] ] ]) ?> diff --git a/modules/page/controllers/AController.php b/modules/page/controllers/AController.php index abf30add..d1c872bd 100644 --- a/modules/page/controllers/AController.php +++ b/modules/page/controllers/AController.php @@ -3,6 +3,7 @@ use Yii; use yii\data\ActiveDataProvider; +use yii\easyii\behaviors\CommonActions; use yii\widgets\ActiveForm; use yii\easyii\components\Controller; @@ -12,6 +13,16 @@ class AController extends Controller { public $rootActions = ['create', 'delete']; + public function behaviors() + { + return [ + [ + 'class' => CommonActions::className(), + 'model' => Page::className(), + ], + ]; + } + public function actionIndex() { $data = new ActiveDataProvider([ @@ -84,11 +95,6 @@ public function actionEdit($id) public function actionDelete($id) { - if(($model = Page::findOne($id))){ - $model->delete(); - } else { - $this->error = Yii::t('easyii', 'Not found'); - } - return $this->formatResponse(Yii::t('easyii/page', 'Page deleted')); + return $this->deleteModel($id, Yii::t('easyii/page', 'Page deleted')); } } \ No newline at end of file diff --git a/modules/shopcart/controllers/AController.php b/modules/shopcart/controllers/AController.php index a8548343..b6a27a8e 100644 --- a/modules/shopcart/controllers/AController.php +++ b/modules/shopcart/controllers/AController.php @@ -4,6 +4,7 @@ use Yii; use yii\data\ActiveDataProvider; +use yii\easyii\behaviors\CommonActions; use yii\easyii\components\Controller; use yii\easyii\modules\shopcart\models\Good; use yii\easyii\modules\shopcart\models\Order; @@ -14,6 +15,16 @@ class AController extends Controller public $processed = 0; public $sent = 0; + public function behaviors() + { + return [ + [ + 'class' => CommonActions::className(), + 'model' => Order::className(), + ], + ]; + } + public function init() { parent::init(); @@ -131,11 +142,6 @@ public function actionView($id) public function actionDelete($id) { - if(($model = Order::findOne($id))){ - $model->delete(); - } else { - $this->error = Yii::t('easyii', 'Not found'); - } - return $this->formatResponse(Yii::t('easyii/shopcart', 'Order deleted')); + return $this->deleteModel($id, Yii::t('easyii/shopcart', 'Order deleted')); } } \ No newline at end of file diff --git a/modules/shopcart/controllers/GoodsController.php b/modules/shopcart/controllers/GoodsController.php index df03decb..0afe677f 100644 --- a/modules/shopcart/controllers/GoodsController.php +++ b/modules/shopcart/controllers/GoodsController.php @@ -3,18 +3,23 @@ use Yii; +use yii\easyii\behaviors\CommonActions; use yii\easyii\components\Controller; use yii\easyii\modules\shopcart\models\Good; class GoodsController extends Controller { + public function behaviors() + { + return [ + [ + 'class' => CommonActions::className(), + 'model' => Good::className(), + ], + ]; + } public function actionDelete($id) { - if(($model = Good::findOne($id))){ - $model->delete(); - } else { - $this->error = Yii::t('easyii', 'Not found'); - } - return $this->formatResponse(Yii::t('easyii/shopcart', 'Order deleted')); + return $this->deleteModel($id, Yii::t('easyii/shopcart', 'Item deleted')); } } \ No newline at end of file diff --git a/modules/shopcart/messages/ru/admin.php b/modules/shopcart/messages/ru/admin.php index 3fbc4b04..a08f9338 100644 --- a/modules/shopcart/messages/ru/admin.php +++ b/modules/shopcart/messages/ru/admin.php @@ -3,6 +3,8 @@ 'Orders' => 'Заказы', 'Order' => 'Заказ', 'Order updated' => 'Заказ обновлен', + 'Order deleted' => 'Заказ удален', + 'Item deleted' => 'Вложение удалено', 'Blank' => 'Незаполнен', 'Pending' => 'Ожидает', 'Processed' => 'В обработке', diff --git a/modules/subscribe/controllers/AController.php b/modules/subscribe/controllers/AController.php index aa14dd1e..e3f30b0c 100644 --- a/modules/subscribe/controllers/AController.php +++ b/modules/subscribe/controllers/AController.php @@ -3,6 +3,7 @@ use Yii; use yii\data\ActiveDataProvider; +use yii\easyii\behaviors\CommonActions; use yii\helpers\Url; use yii\widgets\ActiveForm; @@ -13,6 +14,16 @@ class AController extends Controller { + public function behaviors() + { + return [ + [ + 'class' => CommonActions::className(), + 'model' => Subscriber::className(), + ], + ]; + } + public function actionIndex() { $data = new ActiveDataProvider([ @@ -79,12 +90,7 @@ public function actionCreate() public function actionDelete($id) { - if(($model = Subscriber::findOne($id))){ - $model->delete(); - } else { - $this->error = Yii::t('easyii', 'Not found'); - } - return $this->formatResponse(Yii::t('easyii/subscribe', 'Subscriber deleted')); + return $this->deleteModel($id, Yii::t('easyii/subscribe', 'Subscriber deleted')); } private function send($model) diff --git a/modules/text/controllers/AController.php b/modules/text/controllers/AController.php index 6572aec4..ad5f23a0 100644 --- a/modules/text/controllers/AController.php +++ b/modules/text/controllers/AController.php @@ -3,6 +3,7 @@ use Yii; use yii\data\ActiveDataProvider; +use yii\easyii\behaviors\CommonActions; use yii\widgets\ActiveForm; use yii\easyii\components\Controller; @@ -12,6 +13,16 @@ class AController extends Controller { public $rootActions = ['create', 'delete']; + public function behaviors() + { + return [ + [ + 'class' => CommonActions::className(), + 'model' => Text::className(), + ], + ]; + } + public function actionIndex() { $data = new ActiveDataProvider([ @@ -85,11 +96,6 @@ public function actionEdit($id) public function actionDelete($id) { - if(($model = Text::findOne($id))){ - $model->delete(); - } else { - $this->error = Yii::t('easyii', 'Not found'); - } - return $this->formatResponse(Yii::t('easyii/text', 'Text deleted')); + return $this->deleteModel($id, Yii::t('easyii/text', 'Text deleted')); } } \ No newline at end of file From d2875824452b6446fdefab98e40c9252b5de37d0 Mon Sep 17 00:00:00 2001 From: noumo Date: Tue, 13 Oct 2015 03:22:15 +0300 Subject: [PATCH 012/109] new redactor widget and upload small refactoring --- CHANGELOG.md | 2 + assets/RedactorAsset.php | 21 - assets/redactor/lang/ar.js | 75 - assets/redactor/lang/az.js | 74 - assets/redactor/lang/ba.js | 78 - assets/redactor/lang/bg.js | 76 - assets/redactor/lang/by.js | 76 - assets/redactor/lang/ca.js | 74 - assets/redactor/lang/cs.js | 86 - assets/redactor/lang/da.js | 75 - assets/redactor/lang/de.js | 79 - assets/redactor/lang/el.js | 74 - assets/redactor/lang/eo.js | 75 - assets/redactor/lang/es.js | 74 - assets/redactor/lang/es_ar.js | 75 - assets/redactor/lang/fa.js | 75 - assets/redactor/lang/fi.js | 74 - assets/redactor/lang/fr.js | 74 - assets/redactor/lang/ge.js | 74 - assets/redactor/lang/he.js | 74 - assets/redactor/lang/hr.js | 73 - assets/redactor/lang/hu.js | 76 - assets/redactor/lang/id.js | 75 - assets/redactor/lang/it.js | 77 - assets/redactor/lang/ja.js | 75 - assets/redactor/lang/ko.js | 75 - assets/redactor/lang/lt.js | 74 - assets/redactor/lang/lv.js | 74 - assets/redactor/lang/mk.js | 74 - assets/redactor/lang/nl.js | 79 - assets/redactor/lang/no_NB.js | 74 - assets/redactor/lang/pl.js | 75 - assets/redactor/lang/pt_br.js | 82 - assets/redactor/lang/pt_pt.js | 74 - assets/redactor/lang/ro.js | 75 - assets/redactor/lang/ru.js | 75 - assets/redactor/lang/sk.js | 75 - assets/redactor/lang/sl.js | 78 - assets/redactor/lang/sq.js | 78 - assets/redactor/lang/sr-cir.js | 78 - assets/redactor/lang/sr-lat.js | 78 - assets/redactor/lang/sv.js | 76 - assets/redactor/lang/th.js | 74 - assets/redactor/lang/tr.js | 75 - assets/redactor/lang/ua.js | 76 - assets/redactor/lang/vi.js | 74 - assets/redactor/lang/zh_cn.js | 75 - assets/redactor/lang/zh_tw.js | 75 - assets/redactor/plugins/clips/clips.css | 6 - assets/redactor/plugins/clips/clips.js | 61 - assets/redactor/plugins/clips/index.html | 80 - assets/redactor/plugins/counter/counter.js | 41 - .../plugins/definedlinks/definedlinks.js | 50 - .../plugins/filemanager/filemanager.js | 59 - .../redactor/plugins/fontcolor/fontcolor.js | 73 - assets/redactor/plugins/fontcolor/index.html | 55 - .../redactor/plugins/fontfamily/fontfamily.js | 32 - assets/redactor/plugins/fontsize/fontsize.js | 31 - assets/redactor/plugins/fontsize/index.html | 55 - .../redactor/plugins/fullscreen/fullscreen.js | 118 - assets/redactor/plugins/fullscreen/index.html | 55 - assets/redactor/plugins/limiter/limiter.js | 38 - .../redactor/plugins/textdirection/index.html | 55 - .../plugins/textdirection/textdirection.js | 28 - .../plugins/textexpander/textexpander.js | 57 - assets/redactor/plugins/video/video.js | 70 - assets/redactor/redactor-font.eot | Bin 6224 -> 0 bytes assets/redactor/redactor-iframe.css | 203 - assets/redactor/redactor.css | 981 -- assets/redactor/redactor.js | 8298 ----------------- assets/redactor/redactor.min.css | 1 - assets/redactor/redactor.min.js | 1 - behaviors/ImageFile.php | 2 +- controllers/InstallController.php | 11 +- controllers/RedactorController.php | 135 +- helpers/Image.php | 2 +- helpers/Upload.php | 12 +- messages/ru/install.php | 3 +- models/Photo.php | 2 +- models/Setting.php | 13 + modules/article/views/items/_form.php | 15 +- modules/catalog/views/items/_form.php | 15 +- modules/faq/views/a/_form.php | 32 +- modules/file/models/File.php | 2 +- modules/news/views/a/_form.php | 16 +- modules/page/views/a/_form.php | 15 +- modules/subscribe/views/a/_form.php | 13 +- widgets/Redactor.php | 92 - 88 files changed, 129 insertions(+), 14203 deletions(-) delete mode 100644 assets/RedactorAsset.php delete mode 100644 assets/redactor/lang/ar.js delete mode 100644 assets/redactor/lang/az.js delete mode 100644 assets/redactor/lang/ba.js delete mode 100644 assets/redactor/lang/bg.js delete mode 100644 assets/redactor/lang/by.js delete mode 100644 assets/redactor/lang/ca.js delete mode 100644 assets/redactor/lang/cs.js delete mode 100644 assets/redactor/lang/da.js delete mode 100644 assets/redactor/lang/de.js delete mode 100644 assets/redactor/lang/el.js delete mode 100644 assets/redactor/lang/eo.js delete mode 100644 assets/redactor/lang/es.js delete mode 100644 assets/redactor/lang/es_ar.js delete mode 100644 assets/redactor/lang/fa.js delete mode 100644 assets/redactor/lang/fi.js delete mode 100644 assets/redactor/lang/fr.js delete mode 100644 assets/redactor/lang/ge.js delete mode 100644 assets/redactor/lang/he.js delete mode 100644 assets/redactor/lang/hr.js delete mode 100644 assets/redactor/lang/hu.js delete mode 100644 assets/redactor/lang/id.js delete mode 100644 assets/redactor/lang/it.js delete mode 100644 assets/redactor/lang/ja.js delete mode 100644 assets/redactor/lang/ko.js delete mode 100644 assets/redactor/lang/lt.js delete mode 100644 assets/redactor/lang/lv.js delete mode 100644 assets/redactor/lang/mk.js delete mode 100644 assets/redactor/lang/nl.js delete mode 100644 assets/redactor/lang/no_NB.js delete mode 100644 assets/redactor/lang/pl.js delete mode 100644 assets/redactor/lang/pt_br.js delete mode 100644 assets/redactor/lang/pt_pt.js delete mode 100644 assets/redactor/lang/ro.js delete mode 100644 assets/redactor/lang/ru.js delete mode 100644 assets/redactor/lang/sk.js delete mode 100644 assets/redactor/lang/sl.js delete mode 100644 assets/redactor/lang/sq.js delete mode 100644 assets/redactor/lang/sr-cir.js delete mode 100644 assets/redactor/lang/sr-lat.js delete mode 100644 assets/redactor/lang/sv.js delete mode 100644 assets/redactor/lang/th.js delete mode 100644 assets/redactor/lang/tr.js delete mode 100644 assets/redactor/lang/ua.js delete mode 100644 assets/redactor/lang/vi.js delete mode 100644 assets/redactor/lang/zh_cn.js delete mode 100644 assets/redactor/lang/zh_tw.js delete mode 100644 assets/redactor/plugins/clips/clips.css delete mode 100644 assets/redactor/plugins/clips/clips.js delete mode 100644 assets/redactor/plugins/clips/index.html delete mode 100644 assets/redactor/plugins/counter/counter.js delete mode 100644 assets/redactor/plugins/definedlinks/definedlinks.js delete mode 100644 assets/redactor/plugins/filemanager/filemanager.js delete mode 100644 assets/redactor/plugins/fontcolor/fontcolor.js delete mode 100644 assets/redactor/plugins/fontcolor/index.html delete mode 100644 assets/redactor/plugins/fontfamily/fontfamily.js delete mode 100644 assets/redactor/plugins/fontsize/fontsize.js delete mode 100644 assets/redactor/plugins/fontsize/index.html delete mode 100644 assets/redactor/plugins/fullscreen/fullscreen.js delete mode 100644 assets/redactor/plugins/fullscreen/index.html delete mode 100644 assets/redactor/plugins/limiter/limiter.js delete mode 100644 assets/redactor/plugins/textdirection/index.html delete mode 100644 assets/redactor/plugins/textdirection/textdirection.js delete mode 100644 assets/redactor/plugins/textexpander/textexpander.js delete mode 100644 assets/redactor/plugins/video/video.js delete mode 100644 assets/redactor/redactor-font.eot delete mode 100644 assets/redactor/redactor-iframe.css delete mode 100644 assets/redactor/redactor.css delete mode 100644 assets/redactor/redactor.js delete mode 100644 assets/redactor/redactor.min.css delete mode 100644 assets/redactor/redactor.min.js delete mode 100644 widgets/Redactor.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 715113d4..0f03347d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,12 @@ * Tags added to FAQ * Tags added to gallery albums * Added immutable setting to all sluggable behaviors +* Now using vova07 redactor widget //todo insert new module settings insert system setting max_image_width +insert system setting redactor_plugins rename all image to image_file diff --git a/assets/RedactorAsset.php b/assets/RedactorAsset.php deleted file mode 100644 index 317bdcf6..00000000 --- a/assets/RedactorAsset.php +++ /dev/null @@ -1,21 +0,0 @@ -js[] = 'redactor.js'; - $this->css[] = 'redactor.css'; - } else { - $this->js[] = 'redactor.min.js'; - $this->css[] = 'redactor.min.css'; - } - } - -} \ No newline at end of file diff --git a/assets/redactor/lang/ar.js b/assets/redactor/lang/ar.js deleted file mode 100644 index e8e3da1d..00000000 --- a/assets/redactor/lang/ar.js +++ /dev/null @@ -1,75 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['ar'] = { - html: 'كود HTML', - video: 'فيديو', - image: 'صورة', - table: 'جدول', - link: 'رابط', - link_insert: 'أضف / حرر رابط', - link_edit: 'Edit link', - unlink: 'إزالة الرابط', - formatting: 'التنسيق', - paragraph: 'فقرة', - quote: 'اقتباس', - code: 'كود', - header1: 'ترويسة 1', - header2: 'ترويسة 2', - header3: 'ترويسة 3', - header4: 'ترويسة 4', - header5: '5 ترويسة', - bold: 'غليظ', - italic: 'مائل', - fontcolor: 'لون الخط', - backcolor: 'لون الخلفية', - unorderedlist: 'قائمة منقطة', - orderedlist: 'قائمة رقمية', - outdent: 'أزل المسافة البادئة', - indent: 'أضف المسافة البادئة', - cancel: 'تراجع', - insert: 'أدخل', - save: 'احفظ', - _delete: 'أحذف', - insert_table: 'أدخل جدول', - insert_row_above: 'أضف صف فوق', - insert_row_below: 'أضف صف تحت', - insert_column_left: 'أضف عمود يسارا', - insert_column_right: 'أضف عمود يمينا', - delete_column: 'احذف العمود', - delete_row: 'احذف الصف', - delete_table: 'احذف الجدول', - rows: 'الصفوف', - columns: 'الأعمدة', - add_head: 'أضف ترويسة', - delete_head: 'حذف ترويسة', - title: 'ترويسة', - image_position: 'الوضعية', - none: 'بدون', - left: 'يسار', - right: 'يمين', - image_web_link: 'رابط الصورة', - text: 'نص', - mailto: 'بريد الكتروني', - web: 'رابط', - video_html_code: 'كود الفيديو', - file: 'أضف ملف جديد', - upload: 'رفع', - download: 'تحميل', - choose: 'اختار', - or_choose: 'أو اختار', - drop_file_here: 'اسحب الملف هنا', - align_left: 'محاذاة الى اليسار', - align_center: 'محاذاة الى الوسط', - align_right: 'محاذاة الى اليمين', - align_justify: 'محاذاة كاملة', - horizontalrule: 'أضف خط عمودي', - fullscreen: 'الشاشة الكاملة', - deleted: 'خط في الوسط', - anchor: 'مرساة', - link_new_tab: 'Open link in new tab', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); \ No newline at end of file diff --git a/assets/redactor/lang/az.js b/assets/redactor/lang/az.js deleted file mode 100644 index bf892617..00000000 --- a/assets/redactor/lang/az.js +++ /dev/null @@ -1,74 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['az'] = { - html: 'HTML', - video: 'Video əlavə...', - image: 'Şəkil əlavə...', - table: 'Cədvəl', - link: 'Link', - link_insert: 'Link əlavə...', - link_edit: 'Edit link', - unlink: 'Linki sil', - formatting: 'Format', - paragraph: 'Paraqraf', - quote: 'Sitat', - code: 'Kod', - header1: 'Başlıq 1', - header2: 'Başlıq 2', - header3: 'Başlıq 3', - header4: 'Başlıq 4', - header5: 'Başlıq 5', - bold: 'Qalın', - italic: 'Kursiv', - fontcolor: 'Yazı Rəngi', - backcolor: 'Fon rəngi', - unorderedlist: 'Sırasız List', - orderedlist: 'Sıralı List', - outdent: 'Abzası geri al', - indent: 'Abzas', - cancel: 'Ləğv et', - insert: 'Əlavə et', - save: 'Yadda saxla', - _delete: 'Sil', - insert_table: 'Cədvəl əlavə et...', - insert_row_above: 'Yuxarıya sətir əlavə et', - insert_row_below: 'Aşağıya sətir əlavə et', - insert_column_left: 'Sola sütun əlavə et', - insert_column_right: 'Sağa sütun əlavə et', - delete_column: 'Sütunu sil', - delete_row: 'Sətiri sil', - delete_table: 'Cədvəli sil', - rows: 'Sətirlər', - columns: 'Sütunlar', - add_head: 'Başlıq əlavə et', - delete_head: 'Başlığı sil', - title: 'Başlıq', - image_position: 'Mövqe', - none: 'Heç biri', - left: 'Sol', - right: 'Sağ', - image_web_link: 'Şəklin Veb Link', - text: 'Yazı', - mailto: 'E-poçt', - web: 'URL', - video_html_code: 'Video Embed Kodu', - file: 'Fayl əlavə et...', - upload: 'Yüklə', - download: 'Endir', - choose: 'Seç', - or_choose: 'Vəya seç', - drop_file_here: 'Faylı buraya at', - align_left: 'Yazıyı sola yanaşdır', - align_center: 'Yazıyı ortala', - align_right: 'Yazıyı sağa yanaşdır', - align_justify: 'Yazının kənarlarını düzləşdir', - horizontalrule: 'Üfuqi xətt əlavə et', - deleted: 'Silindi', - anchor: 'Anchor', - link_new_tab: 'Linki yeni tabda aç', - underline: 'Altıxətli', - alignment: 'Düzləndirmə', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); \ No newline at end of file diff --git a/assets/redactor/lang/ba.js b/assets/redactor/lang/ba.js deleted file mode 100644 index 977a393b..00000000 --- a/assets/redactor/lang/ba.js +++ /dev/null @@ -1,78 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['ba'] = { - html: 'HTML', - video: 'Ubaci video', - image: 'Ubaci fotografiju', - table: 'Tabela', - link: 'Veza', - link_insert: 'Ubaci vezu ...', - link_edit: 'Edit link', - unlink: 'Ukloni vezu', - formatting: 'Stilovi', - paragraph: 'Paragraf', - quote: 'Citat', - code: 'Izvorni kod', - header1: 'Zaglavlje 1', - header2: 'Zaglavlje 2', - header3: 'Zaglavlje 3', - header4: 'Zaglavlje 4', - header5: 'Zaglavlje 5', - bold: 'Podebljaj', - italic: 'Nakosi', - fontcolor: 'Boja slova', - backcolor: 'Boja pozadine', - unorderedlist: 'Nesortirana lista', - orderedlist: 'Sortirana lista', - outdent: 'Izvuci', - indent: 'Uvuci', - redo: 'Korak naprijed', - undo: 'Korak nazad', - cut: 'Izreži', - cancel: 'Odustani', - insert: 'Ubaci', - save: 'Sačuvaj', - _delete: 'Izbriši', - insert_table: 'Ubaci tabelu', - insert_row_above: 'Dodaj red iznad', - insert_row_below: 'Dodaj red ispod', - insert_column_left: 'Dodaj kolonu lijevo', - insert_column_right: 'Dodaj kolonu desno', - delete_column: 'Izbriši kolonu', - delete_row: 'Izbriši red', - delete_table: 'Izbriši tabelu', - rows: 'Red', - columns: 'Kolona', - add_head: 'Dodaj zaglavlje', - delete_head: 'Ukloni zaglavlje', - title: 'Naslov', - image_position: 'Pozicija', - none: 'Bez', - left: 'Lijevo', - right: 'Desno', - image_web_link: 'Web adresa fotografije', - text: 'Tekst', - mailto: 'Email', - web: 'Web adresa', - video_html_code: 'Video kod', - file: 'Datoteka', - upload: 'Pošalji', - download: 'Preuzmi', - choose: 'Odaberi', - or_choose: 'Ili odaberi', - drop_file_here: 'Prevuci datoteku ovdje', - align_left: 'Poravnaj lijevo', - align_center: 'Centriraj', - align_right: 'Poravnaj desno', - align_justify: 'Od ruba do ruba', - horizontalrule: 'Ubaci horizontalnu liniju', - fullscreen: 'Prikaz preko čitavog ekrana', - deleted: 'Izbrisano', - anchor: 'Sidro', - link_new_tab: 'Open link in new tab', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/bg.js b/assets/redactor/lang/bg.js deleted file mode 100644 index 8c7695b6..00000000 --- a/assets/redactor/lang/bg.js +++ /dev/null @@ -1,76 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['bg'] = { - html: 'HTML', - video: 'Видео', - image: 'Изображение', - table: 'Таблица', - link: 'Връзка', - link_insert: 'Вкарай връзка ...', - link_edit: 'Edit link', - unlink: 'Премахни връзка', - formatting: 'Стилове', - paragraph: 'Параграф', - quote: 'Цитат', - code: 'Код', - header1: 'Заглавие 1', - header2: 'Заглавие 2', - header3: 'Заглавие 3', - header4: 'Заглавие 4', - header5: 'Заглавие 5', - bold: 'Удебели', - italic: 'Наклони', - fontcolor: 'Цвят на текста', - backcolor: 'Цвят на фона', - unorderedlist: 'Неподреден списък', - orderedlist: 'Подреден списък', - outdent: 'Вкарай навътре', - indent: 'Изкарай навън', - cancel: 'Отказ', - insert: 'Вкарай', - save: 'Запази', - _delete: 'Премахни', - insert_table: 'Вкарай таблица', - insert_row_above: 'Добави ред отгоре', - insert_row_below: 'Добави ред отдолу', - insert_column_left: 'Добави колона отляво', - insert_column_right: 'Добави колона отдясно', - delete_column: 'Премахни колоната', - delete_row: 'Премахни реда', - delete_table: 'Премахни таблицата', - rows: 'Редове', - columns: 'Колони', - add_head: 'Добави заглавен ред', - delete_head: 'Премахни заглавен ред', - title: 'Заглавие', - image_view: 'Виж изображението', - image_position: 'Позиция', - left: 'Ляво', - right: 'Дясно', - image_web_link: 'Уеб връзка', - text: 'Текст', - mailto: 'Имейл', - web: 'Адрес', - video_html_code: 'Код за вграждане на видео', - file: 'Файл', - upload: 'Качи', - download: 'Свали', - choose: 'Избор', - or_choose: 'Или избери', - drop_file_here: 'Провлачете файлове тук', - align_left: 'Подравни в ляво', - align_center: 'Центрирай', - align_right: 'Подравни в дясно', - align_justify: 'Подравни двустранно', - horizontalrule: 'Хоризонтална линия', - fullscreen: 'Цял екран', - deleted: 'Зачеркни', - none: 'Няма', - anchor: 'Котва', - link_new_tab: 'Отваряне в нов таб', - underline: 'Подчертай', - alignment: 'Подравняване', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/by.js b/assets/redactor/lang/by.js deleted file mode 100644 index 8f88e195..00000000 --- a/assets/redactor/lang/by.js +++ /dev/null @@ -1,76 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['by'] = { - html: 'Код', - video: 'Відэа', - image: 'Малюнак', - table: 'Табліца', - link: 'Спасылка', - link_insert: 'Уставіць спасылку ...', - link_edit: 'Edit link', - unlink: 'Выдаліць спасылку', - formatting: 'Стылі', - paragraph: 'Звычайны тэкст', - quote: 'Цытата', - code: 'Код', - header1: 'Загаловак 1', - header2: 'Загаловак 2', - header3: 'Загаловак 3', - header4: 'Загаловак 4', - header5: 'Загаловак 5', - bold: 'Паўтлусты', - italic: 'Нахільны', - fontcolor: 'Колер тэксту', - backcolor: 'Заліванне тэксту', - unorderedlist: 'Звычайны спіс', - orderedlist: 'Нумараваны спіс', - outdent: 'Паменьшыць водступ', - indent: 'Павялічыць водступ', - cancel: 'Адмяніць', - insert: 'Уставіць', - save: 'Захаваць', - _delete: 'Выдаліць', - insert_table: 'Уставіць табліцу', - insert_row_above: 'Дадаць радок зверху', - insert_row_below: 'Дадаць радок знізу', - insert_column_left: 'Дадаць слупок злева', - insert_column_right: 'Дадаць слупок справа', - delete_column: 'Выдаліць слупок', - delete_row: 'Выдаліць радок', - delete_table: 'Выдаліць табліцу', - rows: 'Радкі', - columns: 'Стаўбцы', - add_head: 'Дадаць загаловак', - delete_head: 'Выдаліць загаловак', - title: 'Падказка', - image_view: 'Запампаваць малюнак', - image_position: 'Абцяканне тэкстам', - none: 'Няма', - left: 'Злева', - right: 'Справа', - image_web_link: 'Спасылка на малюнак', - text: 'Тэкст', - mailto: 'Эл. пошта ', - web: 'URL', - video_html_code: 'Код відэа роліка', - file: 'Файл', - upload: 'Загрузіць', - download: 'Запампаваць', - choose: 'Выбраць', - or_choose: 'Ці іншае', - drop_file_here: 'Перацягніце файл сюды', - align_left: 'Па левым краі', - align_center: 'Па цэнтры', - align_right: 'Па правым краі', - align_justify: 'Выраўнаваць тэкст па шырыні', - horizontalrule: 'Гарызантальная лінейка', - fullscreen: 'Ва ўвесь экран', - deleted: 'Закрэслены', - anchor: 'Anchor', - link_new_tab: 'Open link in new tab', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); \ No newline at end of file diff --git a/assets/redactor/lang/ca.js b/assets/redactor/lang/ca.js deleted file mode 100644 index 4ca4631c..00000000 --- a/assets/redactor/lang/ca.js +++ /dev/null @@ -1,74 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['ca'] = { - html: 'HTML', - video: 'Inserta Vídeo...', - image: 'Inserta Imatge...', - table: 'Taula', - link: 'Enllaç', - link_insert: 'Inserta Enllaç ...', - link_edit: 'Edit link', - unlink: 'Elimina enllaç', - formatting: 'Formateja', - paragraph: 'Paràgraf', - quote: 'Cita', - code: 'Codi', - header1: 'Capçalera 1', - header2: 'Capçalera 2', - header3: 'Capçalera 3', - header4: 'Capçalera 4', - header5: 'Capçalera 5', - bold: 'Negreta', - italic: 'Cursiva', - fontcolor: 'Color de la lletra', - backcolor: 'Color del fons', - unorderedlist: 'Llista sense ordenar', - orderedlist: 'Llista ordenada', - outdent: 'Treure indentació', - indent: 'Indentar', - cancel: 'Cancel·lar', - insert: 'Insertar', - save: 'Desar', - _delete: 'Eliminar', - insert_table: 'Insertar Taula...', - insert_row_above: 'Insertar fila superior', - insert_row_below: 'Insertar fila inferior', - insert_column_left: 'Insertar columna a l\'esquerra', - insert_column_right: 'Insertar columna a la dreta', - delete_column: 'Eliminar Columna', - delete_row: 'Eliminar Fila', - delete_table: 'Eliminar Taula', - rows: 'Files', - columns: 'Columnes', - add_head: 'Incloure capçalera', - delete_head: 'Eliminar capçalera', - title: 'Títol', - image_position: 'Posició', - none: 'Cap', - left: 'Esquerra', - right: 'Dreta', - image_web_link: 'Enllaç web a imatge', - text: 'Text', - mailto: 'Direcció de correu', - web: 'URL', - video_html_code: 'Codi de vídeo inserit', - file: 'Insertar Fitxer...', - upload: 'Pujar', - download: 'Descarregar', - choose: 'Escull', - or_choose: 'O escull', - drop_file_here: 'Arrosega el fitxer fins aquí', - align_left: 'Alinear a l\'esquerra', - align_center: 'Alinear al centre', - align_right: 'Alinear a la dreta', - align_justify: 'Justificar', - horizontalrule: 'Insertar línia horitzontal', - deleted: 'Eliminar', - anchor: 'Àncora', - link_new_tab: 'Obrir enllaç en una nova pestanya', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/cs.js b/assets/redactor/lang/cs.js deleted file mode 100644 index c45d5997..00000000 --- a/assets/redactor/lang/cs.js +++ /dev/null @@ -1,86 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['cs'] = { - html: 'HTML', - video: 'Video', - image: 'Obrázek', - table: 'Tabulka', - link: 'Odkaz', - link_insert: 'Vložit odkaz ...', - link_edit: 'Upravit odkaz', - unlink: 'Odstranit odkaz', - formatting: 'Styly', - paragraph: 'Odstavec', - quote: 'Citace', - code: 'Kód', - header1: 'Nadpis 1', - header2: 'Nadpis 2', - header3: 'Nadpis 3', - header4: 'Nadpis 4', - header5: 'Nadpis 5', - format: 'Formát', - bold: 'Tučné', - italic: 'Kurzíva', - superscript: 'Horní index', - strikethrough: 'Přeškrtnuté', - fontcolor: 'Barva písma', - backcolor: 'Barva pozadí', - removeformat: 'Odstranit formátování', - cleanformatting: 'Odstranit styly', - lists: 'Seznamy', - unorderedlist: 'Seznam s odrážkami', - orderedlist: 'Číslovaný seznam', - outdent: 'Zmenšit odsazení', - indent: 'Zvětšit odsazení', - redo: 'Vpřed', - undo: 'Zpět', - cut: 'Vyjmout', - cancel: 'Zrušit', - insert: 'Vložit', - save: 'Uložit', - _delete: 'Smazat', - insert_table: 'Vložit tabulku', - insert_row_above: 'Přidat řádek nahoru', - insert_row_below: 'Přidat řádek dolu', - insert_column_left: 'Přidat sloupec vlevo', - insert_column_right: 'Přidat sloupec vpravo', - delete_column: 'Smazat sloupec', - delete_row: 'Smazat řádek', - delete_table: 'Smazat tabulku', - rows: 'Řádky', - columns: 'Sloupce', - add_head: 'Přidat záhlaví', - delete_head: 'Smazat záhlaví', - title: 'Titulek', - image_view: 'Zobrazit obrázek', - image_position: 'Zarovnání', - none: 'Žádné', - left: 'Vlevo', - right: 'Vpravo', - image_web_link: 'Odkaz na obrázek', - text: 'Text', - mailto: 'Email', - web: 'URL adresa', - video_html_code: 'Zkopírujte kód pro vložení videa do stránky', - file: 'Soubor', - upload: 'Nahrát', - download: 'Stáhnout', - choose: 'Vybrat', - or_choose: 'nebo', - drop_file_here: 'Přetáhněte soubor do tohoto okna', - align_left: 'Zarovnat vlevo', - align_center: 'Zarovnat na střed', - align_right: 'Zarovnat vpravo', - align_justify: 'Zarovnat do bloku', - horizontalrule: 'Vodorovná čára', - fullscreen: 'Celá obrazovka', - deleted: 'Přeškrtnuté', - none: 'Žádná', - anchor: 'Záložka', - link_new_tab: 'Otevírat odkaz v novém okně', - underline: 'Podtržené', - alignment: 'Zarovnání', - filename: 'Název (volitelné)', - edit: 'Upravit', - center: 'Center' -}; -})( jQuery ); \ No newline at end of file diff --git a/assets/redactor/lang/da.js b/assets/redactor/lang/da.js deleted file mode 100644 index 7b5451ce..00000000 --- a/assets/redactor/lang/da.js +++ /dev/null @@ -1,75 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['da'] = { - html: 'HTML', - video: 'Indsæt Video...', - image: 'Indsæt Billede...', - table: 'Tabel', - link: 'Hyperlink', - link_insert: 'Indsæt Hyperlink ...', - link_edit: 'Edit link', - unlink: 'Fjern Hyperlink', - formatting: 'Formatering', - paragraph: 'Paragraf', - quote: 'Citat', - code: 'Kode', - header1: 'Overskrift 1', - header2: 'Overskrift 2', - header3: 'Overskrift 3', - header4: 'Overskrift 4', - header5: 'Overskrift 5', - bold: 'Fed', - italic: 'Kursiv', - fontcolor: 'Skriftfarve', - backcolor: 'Baggrundsfarve', - unorderedlist: 'Opstilling Med Punkttegn', - orderedlist: 'Opstilling Med Tal', - outdent: 'Formindsk Indrykning', - indent: 'Forøg Indrykning', - cancel: 'Fortryd', - insert: 'Indsæt', - save: 'Gem', - _delete: 'Slet', - insert_table: 'Indsæt Tabel...', - insert_row_above: 'Indsæt Række Over', - insert_row_below: 'Indsæt Række Under', - insert_column_left: 'Indsæt Kolonne Venstre', - insert_column_right: 'Indsæt Kolonne Højre', - delete_column: 'Slet Kolonne', - delete_row: 'Slet Række', - delete_table: 'Slet Tabel', - rows: 'Rækker', - columns: 'Kolonner', - add_head: 'Indsæt Hoved', - delete_head: 'Slet Hoved', - title: 'Titel', - image_position: 'Placering', - none: 'Ingen', - left: 'Venstre', - right: 'Højre', - image_web_link: 'Billede Web Hyperlink', - text: 'Tekst', - mailto: 'Email', - web: 'URL', - video_html_code: 'Video Indlejringskode', - file: 'Indsæt Fil...', - upload: 'Upload', - download: 'Download', - choose: 'Vælg', - or_choose: 'Eller vælg', - drop_file_here: 'Træk fil her', - align_left: 'Venstrejuster', - align_center: 'Centrer', - align_right: 'Højrejuster', - align_justify: 'Juster', - horizontalrule: 'Indsæt Vandret Linje', - fullscreen: 'Fuldskærm', - deleted: 'Slettet', - anchor: 'Anchor', - link_new_tab: 'Open link in new tab', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); \ No newline at end of file diff --git a/assets/redactor/lang/de.js b/assets/redactor/lang/de.js deleted file mode 100644 index e274b629..00000000 --- a/assets/redactor/lang/de.js +++ /dev/null @@ -1,79 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['de'] = { - html: 'HTML', - video: 'Video', - image: 'Bilder', - table: 'Tabelle', - link: 'Link', - link_insert: 'Link einfügen ...', - link_edit: 'Link bearbeiten', - unlink: 'Link entfernen', - formatting: 'Formatvorlagen', - paragraph: 'Absatz', - quote: 'Zitat', - code: 'Code', - header1: 'Überschrift 1', - header2: 'Überschrift 2', - header3: 'Überschrift 3', - header4: 'Überschrift 4', - header5: 'Überschrift 5', - bold: 'Fett', - italic: 'Kursiv', - fontcolor: 'Schriftfarbe', - backcolor: 'Texthervorhebungsfarbe', - unorderedlist: 'Aufzählungszeichen', - orderedlist: 'Nummerierung', - outdent: 'Einzug verkleinern', - indent: 'Einzug vergrößern', - redo: 'Wiederholen', - undo: 'Rückgängig', - cut: 'Ausschneiden', - cancel: 'Abbrechen', - insert: 'Einfügen', - save: 'Speichern', - _delete: 'Löschen', - insert_table: 'Tabelle einfügen', - insert_row_above: 'Zeile oberhalb einfügen', - insert_row_below: 'Zeile unterhalb einfügen', - insert_column_left: 'Spalte links einfügen', - insert_column_right: 'Spalte rechts einfügen', - delete_column: 'Spalte löschen', - delete_row: 'Zeile löschen', - delete_table: 'Tabelle löschen', - rows: 'Zeilen', - columns: 'Spalten', - add_head: 'Titel einfügen', - delete_head: 'Titel entfernen', - title: 'Title', - image_view: 'Bilder', - image_position: 'Textumbruch', - none: 'Keine', - left: 'Links', - right: 'Rechts', - image_web_link: 'Bilder-Link', - text: 'Text', - mailto: 'Email', - web: 'URL', - video_html_code: 'Video-Einbettungscode', - file: 'Datei', - upload: 'Hochladen', - download: 'Download', - choose: 'Auswählen', - or_choose: 'Oder, wählen Sie eine Datei aus', - drop_file_here: 'Ziehen Sie eine Datei hier hin', - align_left: 'Linksbündig', - align_center: 'Mitte', - align_right: 'Rechtsbündig', - align_justify: 'Blocksatz', - horizontalrule: 'Horizontale Linie', - fullscreen: 'Vollbild', - deleted: 'Durchgestrichen', - anchor: 'Anker', - link_new_tab: 'Link in neuem Tab öffnen', - underline: 'Unterstrichen', - alignment: 'Ausrichtung', - filename: 'Name (optional)', - edit: 'Bearbeiten', - center: 'Center' -}; -})( jQuery ); \ No newline at end of file diff --git a/assets/redactor/lang/el.js b/assets/redactor/lang/el.js deleted file mode 100644 index c24fdc13..00000000 --- a/assets/redactor/lang/el.js +++ /dev/null @@ -1,74 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['el'] = { - html: 'HTML', - video: 'Εισαγωγή βίντεο...', - image: 'Εισαγωγή εικόνας...', - table: 'Πίνακας', - link: 'Σύνδεσμος', - link_insert: 'Εισαγωγή συνδέσμου...', - link_edit: 'Edit link', - unlink: 'Ακύρωση συνδέσμου', - formatting: 'Μορφοποίηση', - paragraph: 'Παράγραφος', - quote: 'Παράθεση', - code: 'Κώδικας', - header1: 'Κεφαλίδα 1', - header2: 'Κεφαλίδα 2', - header3: 'Κεφαλίδα 3', - header4: 'Κεφαλίδα 4', - header5: 'Κεφαλίδα 5', - bold: 'Έντονα', - italic: 'Πλάγια', - fontcolor: 'Χρώμα γραμματοσειράς', - backcolor: 'Χρώμα επισήμανσης κειμένου', - unorderedlist: 'Κουκκίδες', - orderedlist: 'Αρίθμηση', - outdent: 'Μείωση εσοχής', - indent: 'Αύξηση εσοχής', - cancel: 'Ακύρωση', - insert: 'Εισαγωγή', - save: 'Αποθήκευση', - _delete: 'Διαγραφή', - insert_table: 'Εισαγωγή πίνακα...', - insert_row_above: 'Προσθήκη σειράς επάνω', - insert_row_below: 'Προσθήκη σειράς κάτω', - insert_column_left: 'Προσθήκη στήλης αριστερά', - insert_column_right: 'Προσθήκη στήλης δεξιά', - delete_column: 'Διαγραφή στήλης', - delete_row: 'Διαγραφή σειράς', - delete_table: 'Διαγραφή πίνακα', - rows: 'Γραμμές', - columns: 'Στήλες', - add_head: 'Προσθήκη κεφαλίδας', - delete_head: 'Διαγραφή κεφαλίδας', - title: 'Τίτλος', - image_position: 'Θέση', - none: 'Καμία', - left: 'Αριστερά', - right: 'Δεξιά', - image_web_link: 'Υπερσύνδεσμος εικόνας', - text: 'Κείμενο', - mailto: 'Email', - web: 'URL', - video_html_code: 'Video Embed Code', - file: 'Εισαγωγή αρχείου...', - upload: 'Upload', - download: 'Download', - choose: 'Επέλεξε', - or_choose: 'ή επέλεξε', - drop_file_here: 'Σύρατε αρχεία εδώ', - align_left: 'Στοίχιση αριστερά', - align_center: 'Στοίχιση στο κέντρο', - align_right: 'Στοίχιση δεξιά', - align_justify: 'Πλήρησ στοίχηση', - horizontalrule: 'Εισαγωγή οριζόντιας γραμμής', - deleted: 'Διαγράφτηκε', - anchor: 'Anchor', - link_new_tab: 'Open link in new tab', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/eo.js b/assets/redactor/lang/eo.js deleted file mode 100644 index 7532276c..00000000 --- a/assets/redactor/lang/eo.js +++ /dev/null @@ -1,75 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['eo'] = { - html: 'HTML', // substantive - video: 'Enŝovu videon...', // imperative - image: 'Enŝovu bildon...', // imperative - table: 'Tabelo', // substantive - link: 'Ligu', // imperative - link_insert: 'Enŝovu ligilon ...', // imperative - link_edit: 'Edit link', - unlink: 'Malligu', // imperative - formatting: 'Tekstaranĝo', // substantive - paragraph: 'Paragrafo', // substantive - quote: 'Citaĵo', // substantive - code: 'Kodo', // substantive - header1: 'Kapo 1', // substantive - header2: 'Kapo 2', // substantive - header3: 'Kapo 3', // substantive - header4: 'Kapo 4', // substantive - header5: 'Kapo 5', // substantive - bold: 'Grasa', // adjective - italic: 'Kursiva', // adjective - fontcolor: 'Tipara koloro', // substantive - backcolor: 'Fona koloro', // substantive - unorderedlist: 'Malorda listo', // substantive - orderedlist: 'Orda listo', // substantive - outdent: 'Malkrommarĝenu', // imperative - indent: 'Krommarĝenu', // imperative - cancel: 'Rezignu', // imperative - insert: 'Enŝovu', // imperative - save: 'Konservu', // imperative - _delete: 'Forigu', // imperative - insert_table: 'Enŝovu tabelon...', // imperative - insert_row_above: 'Enŝovu vicon supren', // imperative - insert_row_below: 'Enŝovu vicon malsupren', // imperative - insert_column_left: 'Enŝovu kolumnon maldekstren', // imperative - insert_column_right: 'Enŝovu kolumnon dekstren', // imperative - delete_column: 'Forigu kolumnon', // imperative - delete_row: 'Forigu vicon', // imperative - delete_table: 'Forigu tabelon', // imperative - rows: 'Vicoj', // substantive (plural) - columns: 'Kolumnoj', // substantive (plural) - add_head: 'Enŝovu kapon', // imperative - delete_head: 'Forigu kapon', // imperative - title: 'Titolo', // substantive - image_position: 'Bildloko', // substantive - none: 'Neniu', // determiner - left: 'Maldekstra', // adjective - right: 'Dekstra', // adjective - image_web_link: 'Bilda hiperligilo', // substantive - text: 'Teksto', // substantive - mailto: 'Retpoŝto', // substantive - web: 'URL', // substantive - video_html_code: 'Videa enkorpigita kodo', // substantive - file: 'Enŝovu dosieron...', // imperative - upload: 'Alŝutu', // imperative - download: 'Elŝutu', // imperative - choose: 'Elektu', // imperative - or_choose: 'Aŭ elektu', // imperative - drop_file_here: 'Demetu dosieron ĉi tien', // imperative - align_left: 'Ĝisrandigu maldekstren', // imperative - align_center: 'Centrigu', // imperative - align_right: 'Ĝisrandigu dekstren', // imperative - align_justify: 'Ĝisrandigu', // imperative - horizontalrule: 'Enŝovu horizontalan linion', // imperative - fullscreen: 'Plenekrana', // adjective - deleted: 'Foriga', // adjective - anchor: 'Ankro', // substantive - link_new_tab: 'Malfermu hiperligilon en novan langeton', // imperative - underline: 'Substrekita', // adjective - alignment: 'Ĝisrandigo', // substantive - filename: 'Dosiernomo (fakultativa)', // substantive - edit: 'Redaktu', // imperative - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/es.js b/assets/redactor/lang/es.js deleted file mode 100644 index cbf3b61c..00000000 --- a/assets/redactor/lang/es.js +++ /dev/null @@ -1,74 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['es'] = { - html: 'HTML', - video: 'Insertar video...', - image: 'Insertar imagen...', - table: 'Tabla', - link: 'Enlace', - link_insert: 'Insertar enlace ...', - link_edit: 'Editar enlace', - unlink: 'Desenlazar', - formatting: 'Estilos', - paragraph: 'Texto normal', - quote: 'Cita', - code: 'Código', - header1: 'Cabecera 1', - header2: 'Cabecera 2', - header3: 'Cabecera 3', - header4: 'Cabecera 4', - header5: 'Cabecera 5', - bold: 'Negrita', - italic: 'Itálica', - fontcolor: 'Color de fuente', - backcolor: 'Color de fondo', - unorderedlist: 'Lista desordenada', - orderedlist: 'Lista ordenada', - outdent: 'Disminuir sangrado', - indent: 'Aumentar sangrado', - cancel: 'Cancelar', - insert: 'Insertar', - save: 'Guardar', - _delete: 'Borrar', - insert_table: 'Insertar tabla...', - insert_row_above: 'Añadir fila encima', - insert_row_below: 'Añadir fila debajo', - insert_column_left: 'Añadir columna a la izquierda', - insert_column_right: 'Añadir column a la derecha', - delete_column: 'Borrar columna', - delete_row: 'Borrar fila', - delete_table: 'Borrar tabla', - rows: 'Filas', - columns: 'Columnas', - add_head: 'Añadir cabecera', - delete_head: 'Borrar cabecera', - title: 'Título', - image_position: 'Posición', - none: 'Ninguna', - left: 'Izquierda', - right: 'Derecha', - image_web_link: 'Enlace web de la imágen', - text: 'Texto', - mailto: 'Email', - web: 'URL', - video_html_code: 'Código de inserción de video', - file: 'Insertar archivo...', - upload: 'Cargar', - download: 'Descargar', - choose: 'Elegir', - or_choose: 'O elegir', - drop_file_here: 'Arrastra y suelta el archivo aqui', - align_left: 'Alinear texto a la izquierda', - align_center: 'Centrar texto', - align_right: 'Alinear texto a la derecha', - align_justify: 'Justificar texto', - horizontalrule: 'Insertar línea horizontal', - deleted: 'Borrado', - anchor: 'Anchor', - link_new_tab: 'Abrir enlace en una nueva pestaña', - underline: 'Subrayado', - alignment: 'Alineación', - filename: 'Nombre (opcional)', - edit: 'Editar', - center: 'Center' -}; -})( jQuery ); \ No newline at end of file diff --git a/assets/redactor/lang/es_ar.js b/assets/redactor/lang/es_ar.js deleted file mode 100644 index 90bafe6a..00000000 --- a/assets/redactor/lang/es_ar.js +++ /dev/null @@ -1,75 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['es_ar'] = { - html: 'HTML', - video: 'Video', - image: 'Imágen', - table: 'Tabla', - link: 'Enlace', - link_insert: 'Insertar enlace ...', - link_edit: 'Edit link', - unlink: 'Eliminar enlace', - formatting: 'Estilos', - paragraph: 'Párrafo', - quote: 'Comillas', - code: 'Código', - header1: 'Cabecera 1', - header2: 'Cabecera 2', - header3: 'Cabecera 3', - header4: 'Cabecera 4', - header5: 'Cabecera 5', - bold: 'Negrita', - italic: 'Itálica', - fontcolor: 'Color fuente', - backcolor: 'Color fondo', - unorderedlist: 'Lista sin orden', - orderedlist: 'Lista ordenada', - outdent: 'Disminuir sangría', - indent: 'Aumentar sangría', - cancel: 'Cancelar', - insert: 'Agregar', - save: 'Guardar', - _delete: 'Eliminar', - insert_table: 'Agregar tabla', - insert_row_above: 'Agregar fila arriba', - insert_row_below: 'Agregar fila debajo', - insert_column_left: 'Agregar columna a la izquierda', - insert_column_right: 'Agregar column a la derecha', - delete_column: 'Eliminar columna', - delete_row: 'Eliminar fila', - delete_table: 'Eliminar tabla', - rows: 'Filas', - columns: 'Columnas', - add_head: 'Agregar encabezado', - delete_head: 'Eliminar encabezado', - title: 'Título', - image_position: 'Posición', - none: 'ninguna', - left: 'izquierda', - right: 'derecha', - image_web_link: 'Enlace de imagen web', - text: 'Texto', - mailto: 'Email', - web: 'URL', - video_html_code: 'Código embebido del video', - file: 'Archivo', - upload: 'Cargar', - download: 'Descargar', - choose: 'Seleccionar', - or_choose: 'O seleccionar', - drop_file_here: 'Soltar el archivo aquí', - align_left: 'Alinear a la izquierda', - align_center: 'Alinear al centro', - align_right: 'Alinear a la derecha', - align_justify: 'Justificar', - horizontalrule: 'Trazo horizontal', - fullscreen: 'Pantalla completa', - deleted: 'Eliminado', - anchor: 'Anclaje', - link_new_tab: 'Abrir enlace en otra pestaña', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/fa.js b/assets/redactor/lang/fa.js deleted file mode 100644 index e627455f..00000000 --- a/assets/redactor/lang/fa.js +++ /dev/null @@ -1,75 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['fa'] = { - html: 'اچ تی ام ال', - video: 'درج ویدیو...', - image: 'درج تصویر', - table: 'جدول', - link: 'پیوند', - link_insert: 'درج پیوند ...', - link_edit: 'Edit link', - unlink: 'از بین بردن پیوند', - formatting: 'فالب بندی', - paragraph: 'پراگراف', - quote: 'نقل قول', - code: 'کد', - header1: 'سرامد 1', - header2: 'سرامد 2', - header3: 'سرامد 3', - header4: 'سرامد 4', - header5: 'سرامد 5', - bold: 'درشت', - italic: 'خمیده', - fontcolor: 'رنگ قلم', - backcolor: 'رنگ ضمینه', - unorderedlist: 'فهرست نامرتب', - orderedlist: 'فهرست مرتب شده', - outdent: 'بیرو رفتگی', - indent: 'تو رفتگی', - cancel: 'انصراف', - insert: 'درج', - save: 'ذخیره', - _delete: 'حذف', - insert_table: 'درج جدول ..', - insert_row_above: 'سطر جدید در بالا', - insert_row_below: 'سطر جدید در پائین', - insert_column_left: 'ستون جدید در سمت چپ', - insert_column_right: 'ستون جدید در سمت راست', - delete_column: 'حذف ستون', - delete_row: 'حذف سطر', - delete_table: 'حذف جدول', - rows: 'سطرها', - columns: 'ستونها', - add_head: 'درج سر ستون ', - delete_head: 'حذف سرستون', - title: 'عنوان', - image_position: 'موقعیت', - none: 'هیچیک', - left: 'چپ', - right: 'راست', - image_web_link: 'آدرس تصویر در اینترنت', - text: 'متن', - mailto: 'ایمیل', - web: 'آدرس', - video_html_code: 'کد نمایش ویدئو', - file: 'درج فایل ....', - upload: 'بارگزاری', - download: 'بارگیری', - choose: 'انتخاب کنید', - or_choose: 'یا انتخاب کنید', - drop_file_here: 'این فایل ها حذف شوند', - align_left: 'چپ جین', - align_center: 'وسط چین', - align_right: 'راست چین', - align_justify: 'کشیده', - horizontalrule: 'درج خط جدا کننده', - fullscreen: 'نمایش کامل', - deleted: 'حذف شده', - anchor: 'قلاب', - link_new_tab: 'Open link in new tab', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/fi.js b/assets/redactor/lang/fi.js deleted file mode 100644 index 6b4bb7fe..00000000 --- a/assets/redactor/lang/fi.js +++ /dev/null @@ -1,74 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['fi'] = { - html: 'HTML', - video: 'Lisää video', - image: 'Lisää kuva', - table: 'Taulukko', - link: 'Linkki', - link_insert: 'Lisää linkki', - link_edit: 'Muokkaa linkkiä', - unlink: 'Poista linkki', - formatting: 'Tyylit', - paragraph: 'Normaaliteksti', - quote: 'Lainaus', - code: 'Koodi', - header1: 'Otsikko 1', - header2: 'Otsikko 2', - header3: 'Otsikko 3', - header4: 'Otsikko 4', - header5: 'Otsikko 5', - bold: 'Lihavointi', - italic: 'Kursivointi', - fontcolor: 'Tekstin väri', - backcolor: 'Taustaväri', - unorderedlist: 'Luettelo luettelomerkein', - orderedlist: 'Numeroitu luettelo', - outdent: 'Vähennä sisennystä', - indent: 'Lisää sisennystä', - cancel: 'Peru', - insert: 'Lisää', - save: 'Tallenna', - _delete: 'Poista', - insert_table: 'Lisää taulukko', - insert_row_above: 'Lisää rivi ylle', - insert_row_below: 'Lisää rivi alle', - insert_column_left: 'Lisää sarake vasemmalle', - insert_column_right: 'Lisää sarake oikealle', - delete_column: 'Poista sarake', - delete_row: 'Poista rivi', - delete_table: 'Poista taulukko', - rows: 'Rivit', - columns: 'Sarakkeet', - add_head: 'Lisää otsikkorivi', - delete_head: 'Poista otsikkorivi', - title: 'Kuvateksti', - image_position: 'Kuvan sijainti', - none: 'oletus', - left: 'vasen', - right: 'oikea', - image_web_link: 'Kuvan URL-osoite', - text: 'Teksti', - mailto: 'Sähköposti', - web: 'URL-osoite', - video_html_code: 'Videon upotuskoodi', - file: 'Lisää tiedosto', - upload: 'Lähetä', - download: 'Lataa', - choose: 'Valitse', - or_choose: 'tai valitse', - drop_file_here: 'Vedä ja pudota kuva tähän', - align_left: 'Tasaa vasemmalle', - align_center: 'Keskitä', - align_right: 'Tasaa oikealle', - align_justify: 'Tasaa molemmat reunat', - horizontalrule: 'Lisää vaakaviiva', - deleted: 'Poistettu', - anchor: 'Ankkuri', - link_new_tab: 'Avaa linkki uudessa välilehdessä', - underline: 'Alleviivaa', - alignment: 'Tasaus', - filename: 'Nimi (valinnainen)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/fr.js b/assets/redactor/lang/fr.js deleted file mode 100644 index 396b223a..00000000 --- a/assets/redactor/lang/fr.js +++ /dev/null @@ -1,74 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['fr'] = { - html: 'Code HTML', - video: 'Insérer une vidéo...', - image: 'Insérer une image...', - table: 'Tableau', - link: 'Lien', - link_insert: 'Insérer un lien...', - link_edit: 'Modifier le lien', - unlink: 'Supprimer le lien', - formatting: 'Styles', - paragraph: 'Paragraphe', - quote: 'Citation', - code: 'Code', - header1: 'Titre 1', - header2: 'Titre 2', - header3: 'Titre 3', - header4: 'Titre 4', - header5: 'Titre 5', - bold: 'Gras', - italic: 'Italique', - fontcolor: 'Couleur du texte', - backcolor: 'Couleur d\'arrière plan du texte', - unorderedlist: 'Liste à puces', - orderedlist: 'Liste numérotée', - outdent: 'Diminuer le retrait', - indent: 'Augmenter le retrait', - cancel: 'Annuler', - insert: 'Insérer', - save: 'Enregistrer', - _delete: 'Supprimer', - insert_table: 'Insérer un tableau...', - insert_row_above: 'Ajouter une rangée au-dessus', - insert_row_below: 'Ajouter une rangée en-dessous', - insert_column_left: 'Ajouter une colonne à gauche', - insert_column_right: 'Ajouter une colonne à droite', - delete_column: 'Supprimer la colonne', - delete_row: 'Supprimer la rangée', - delete_table: 'Supprimer le tableau', - rows: 'Rangées', - columns: 'Colonnes', - add_head: 'Ajouter un en-tête', - delete_head: 'Supprimer l\'en-tête', - title: 'Titre', - image_position: 'Position', - none: 'Aucun', - left: 'Gauche', - right: 'Droite', - image_web_link: 'Adresse URL de l\'image', - text: 'Texte', - mailto: 'Courriel', - web: 'Adresse URL', - video_html_code: 'Code d\'intégration du video', - file: 'Insérer un fichier...', - upload: 'Téléverser', - download: 'Télécharger', - choose: 'Choisir', - or_choose: 'Ou choisissez', - drop_file_here: 'Déposez le fichier ici', - align_left: 'Aligner à gauche', - align_center: 'Aligner au centre', - align_right: 'Aligner à droite', - align_justify: 'Justifier', - horizontalrule: 'Insérer une ligne horizontale', - deleted: 'Supprimé', - anchor: 'Ancre', - link_new_tab: 'Ouvrir le lien dans un nouvel onglet', - underline: 'Souligner', - alignment: 'Alignement', - filename: 'Nom de fichier (optionnel)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); \ No newline at end of file diff --git a/assets/redactor/lang/ge.js b/assets/redactor/lang/ge.js deleted file mode 100644 index 88fcddf2..00000000 --- a/assets/redactor/lang/ge.js +++ /dev/null @@ -1,74 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['ge'] = { - html: 'HTML კოდი', - video: 'ვიდეოს ჩასმა', - image: 'სურათის ჩასმა', - table: 'ცხრილი', - link: 'ბმული', - link_insert: 'ბმულის ჩასმა', - link_edit: 'ბმულის რედაქტირება', - unlink: 'ბმულის გაუქმება', - formatting: 'ტექსტის ფორმატირება', - paragraph: 'პარაგრაფი', - quote: 'ციტატა', - code: 'კოდი', - header1: 'სათაური 1', - header2: 'სათაური 2', - header3: 'სათაური 3', - header4: 'სათაური 4', - header5: 'სათაური 5', - bold: 'მსხვილი', - italic: 'დახრილი', - fontcolor: 'ტექსტის ფერი', - backcolor: 'ფონის ფერი', - unorderedlist: 'დაუნომრავი სია', - orderedlist: 'დანომრილი სია', - outdent: 'ტექსტის გამოწევა', - indent: 'ტექსტის შეწევა', - cancel: 'გაუქმება', - insert: 'ჩასმა', - save: 'შენახვა', - _delete: 'წაშლა', - insert_table: 'ცხრილის ჩასმა', - insert_row_above: 'რიგის ზემოდან დამატება', - insert_row_below: 'რიგის ქვემოდან დამატება', - insert_column_left: 'სვეტის მარცხნიდან დამატება', - insert_column_right: 'სვეტის მარჯვნიდან დამატება', - delete_column: 'სვეტის წაშლა', - delete_row: 'რიგის წაშლა', - delete_table: 'ცხრილის წაშლა', - rows: 'რიგი', - columns: 'სვეტი', - add_head: 'სათაურის დამატება', - delete_head: 'სათაურის წაშლა', - title: 'სათაური', - image_position: 'მდებარეობა', - none: 'არსად', - left: 'მარცხნივ', - right: 'მარჯვნივ', - image_web_link: 'სურათის ვებ-მისამართი', - text: 'ტექსტი', - mailto: 'ელ. მისამართი', - web: 'მისამართი', - video_html_code: 'ვიდეოს HTML Embed კოდი', - file: 'ფაილის ჩასმა', - upload: 'ატვირთვა', - download: 'ჩამოტვირთვა', - choose: 'არჩევა', - or_choose: 'ან აირჩიეთ', - drop_file_here: 'ჩააგდეთ ფაილი აქ', - align_left: 'მარცხენა მხრიდან', - align_center: 'ცენტრში', - align_right: 'მარჯვენა მხრიდან', - align_justify: 'ორივე მხრიდან', - horizontalrule: 'ჰორიზონტალური ხაზის ჩასმა', - deleted: 'ხაზგადასმული', - anchor: 'ბმული', - link_new_tab: 'ახალ ფანჯარაში გასხნა', - underline: 'ხაზგასმული', - alignment: 'ტექსტის გასწორება', - filename: 'სახელი (არასავალდებულო)', - edit: 'რედაქტირება', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/he.js b/assets/redactor/lang/he.js deleted file mode 100644 index 7fc1939d..00000000 --- a/assets/redactor/lang/he.js +++ /dev/null @@ -1,74 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['he'] = { - html: 'HTML', - video: 'הכנס וידאו...', - image: 'הכנס תמונה...', - table: 'טבלה', - link: 'קישור', - link_insert: 'הכנס קישור', - link_edit: 'Edit link', - unlink: 'הסרת קישור', - formatting: 'עיצוב', - paragraph: 'פסקה', - quote: 'ציטוט', - code: 'קוד', - header1: 'כותרת 1', - header2: 'כותרת 2', - header3: 'כותרת 3', - header4: 'כותרת 4', - header5: 'כותרת 5', - bold: 'מודגש', - italic: 'מוטה', - fontcolor: 'צבע גופן', - backcolor: 'צבע רקע', - unorderedlist: 'רשימת תבליטים', - orderedlist: 'רשימה ממוספרת', - outdent: 'הזחה החוצה', - indent: 'הזחה פנימה', - cancel: 'ביטול', - insert: 'הכנס', - save: 'שמור', - _delete: 'מחק', - insert_table: 'הכנס טבלה...', - insert_row_above: 'הוסף שורה מעל', - insert_row_below: 'הוסף שורה מתחת', - insert_column_left: 'הוסף עמודה משמאל', - insert_column_right: 'הוסף עמודה מימין', - delete_column: 'מחק עמודה', - delete_row: 'מחק שורה', - delete_table: 'מחק טבלה', - rows: 'שורות', - columns: 'עמודות', - add_head: 'הוסף Head', - delete_head: 'מחק Head', - title: 'כותרת', - image_position: 'מיקום', - none: 'ריק', - left: 'שמאל', - right: 'ימין', - image_web_link: 'קישור תמונה', - text: 'טקסט', - mailto: 'דואר אלקטרוני', - web: 'URL', - video_html_code: 'קוד הטבעת וידאו', - file: 'הכנס קובץ...', - upload: 'טען', - download: 'הורד', - choose: 'בחר', - or_choose: 'או בחר', - drop_file_here: 'שחרר קובץ כאן', - align_left: 'ישר טקסט לשמאל', - align_center: 'מרכז טקסט', - align_right: 'ישר טקסט לימין', - align_justify: 'ישור דו צידי', - horizontalrule: 'הכנס קו הפרדה אופקי', - deleted: 'נמחק', - anchor: 'עוגן', - link_new_tab: 'פתח קישור בלשונית חדשה', - underline: 'קו תחתון', - alignment: 'יישור', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/hr.js b/assets/redactor/lang/hr.js deleted file mode 100644 index 4cea6b19..00000000 --- a/assets/redactor/lang/hr.js +++ /dev/null @@ -1,73 +0,0 @@ -(function ($) { - $.Redactor.opts.langs['hr'] = { - html: 'HTML', - video: 'Umetni video', - image: 'Umetni sliku', - table: 'Tablica', - link: 'Poveznica', - link_insert: 'Umetni poveznicu', - unlink: 'Ukloni poveznicu', - formatting: 'Uređivanje', - paragraph: 'Paragraf', - quote: 'Umetni citat', - code: 'Izvorni kôd', - header1: 'Zaglavlje 1', - header2: 'Zaglavlje 2', - header3: 'Zaglavlje 3', - header4: 'Zaglavlje 4', - header5: 'Zaglavlje 5', - bold: 'Podebljaj', - italic: 'Nakosi', - fontcolor: 'Boja slova', - backcolor: 'Boja pozadine', - unorderedlist: 'Nesortirana lista', - orderedlist: 'Sortirana lista', - outdent: 'Izvuci', - indent: 'Uvuci', - cancel: 'Odustani', - insert: 'Umetni', - save: 'Spremi', - _delete: 'Izbriši', - insert_table: 'Umetni tablicu', - insert_row_above: 'Dodaj redak iznad', - insert_row_below: 'Dodaj redak ispod', - insert_column_left: 'Dodaj stupac lijevo', - insert_column_right: 'Dodaj stupac desno', - delete_column: 'Ukloni stupac', - delete_row: 'Ukloni redak', - delete_table: 'Ukloni tablicu', - rows: 'Redaka', - columns: 'Stupaca', - add_head: 'Dodaj zaglavlje', - delete_head: 'Ukloni zaglavlje', - title: 'Naslov', - image_position: 'Poravnanje', - none: 'Nema', - left: 'lijevo', - right: 'desno', - image_web_link: 'Internet adresa slike', - text: 'Tekst', - mailto: 'Email', - web: 'Internet adresa', - video_html_code: 'Video kôd', - file: 'Umetni datoteku', - upload: 'Pošalji datoteku', - download: 'Preuzmi datoteku', - choose: 'Odaberi', - or_choose: 'ili ru-RUčno odaberi', - drop_file_here: 'Povuci datoteku ovdje', - align_left: 'Poravnaj lijevo', - align_center: 'Centriraj', - align_right: 'Poravnaj desno', - align_justify: 'Od ruba do ruba', - horizontalrule: 'Umetni horizontalnu crtu', - deleted: 'Precrtaj', - anchor: 'Sidro', - link_new_tab: 'Otvori u novom prozoru', - underline: 'Podvuci', - alignment: 'Poravnanje', - filename: 'Naziv (neobavezno)', - edit: 'Edit', - center: 'Center' - }; -})(jQuery); \ No newline at end of file diff --git a/assets/redactor/lang/hu.js b/assets/redactor/lang/hu.js deleted file mode 100644 index fbab73fe..00000000 --- a/assets/redactor/lang/hu.js +++ /dev/null @@ -1,76 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['hu'] = { - html: 'HTML', - video: 'Videó', - image: 'Kép', - table: 'Tábla', - link: 'Link', - link_insert: 'Link beszúrás ...', - link_edit: 'Edit link', - unlink: 'Link megszüntetés', - formatting: 'Stílusok', - paragraph: 'Bekezdés', - quote: 'Idézet', - code: 'Kód', - header1: 'Címsor 1', - header2: 'Címsor 2', - header3: 'Címsor 3', - header4: 'Címsor 4', - header5: 'Címsor 5', - bold: 'Félkövér', - italic: 'Dőlt', - fontcolor: 'Szöveg szine', - backcolor: 'Szöveg hátterének szine', - unorderedlist: 'Nem számozott lista', - orderedlist: 'Számozott lista', - outdent: 'Outdent', - indent: 'Indent', - cancel: 'Mégsem', - insert: 'Beszurás', - save: 'Mentés', - _delete: 'Törlés', - insert_table: 'Táblázat beszúrása', - insert_row_above: 'Sor beszúrása az aktuális sor fölé', - insert_row_below: 'Sor beszúrása ez alá', - insert_column_left: 'Oszlop beszúrása ettöl balra', - insert_column_right: 'Oszlop hozzáadása ettöl jobbra', - delete_column: 'Oszlop törlése', - delete_row: 'Sor törlése', - delete_table: 'Táblázat törlése', - rows: 'Sorok', - columns: 'Oszlopok', - add_head: 'Fejrész hozzáadása', - delete_head: 'Fejrész törlése', - title: 'Felira', - image_view: 'Kép megnézése', - image_position: 'Pozició', - none: 'nincs', - left: 'bal', - right: 'jobb', - image_web_link: 'Link a képre', - text: 'Szöveg', - mailto: 'Email', - web: 'URL', - video_html_code: 'Videó embed code', - file: 'File', - upload: 'Feltöltés', - download: 'Letöltés', - choose: 'Válassz', - or_choose: 'Vagy válassz', - drop_file_here: 'Ide dobd a file-t', - align_left: 'Balra igazítás', - align_center: 'Középre igazítás', - align_right: 'Jobbra igazítás', - align_justify: 'Sorkizárt', - horizontalrule: 'Horizontális vonal', - fullscreen: 'Teljes képernyős', - deleted: 'Törölt', - anchor: 'Horgony', - link_new_tab: 'Open link in new tab', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/id.js b/assets/redactor/lang/id.js deleted file mode 100644 index d67b1468..00000000 --- a/assets/redactor/lang/id.js +++ /dev/null @@ -1,75 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['id'] = { - html: 'HTML', - video: 'Sisipkan Video...', - image: 'Sisipkan Gambar...', - table: 'Tabel', - link: 'Tautan', - link_insert: 'Sisipkan Tautan ...', - link_edit: 'Edit link', - unlink: 'Hapus Tautan', - formatting: 'Format', - paragraph: 'Paragraf', - quote: 'Kutipan', - code: 'Kode', - header1: 'Header 1', - header2: 'Header 2', - header3: 'Header 3', - header4: 'Header 4', - header5: 'Header 5', - bold: 'Tebal', - italic: 'Miring', - fontcolor: 'Warna Huruf', - backcolor: 'Warna Latar', - unorderedlist: 'Daftar tak berurutan', - orderedlist: 'Daftar berurutan', - outdent: 'Tulisan diluar', - indent: 'Tulisan masuk', - cancel: 'Batal', - insert: 'Sisipkan', - save: 'Simpan', - _delete: 'Hapus', - insert_table: 'Sisipkan Tabel...', - insert_row_above: 'Tambahkan Baris di atas', - insert_row_below: 'Tambahkan Baris di bawah', - insert_column_left: 'Tambahkan Kolom di kiri', - insert_column_right: 'Tambahkan Kolom di kanan', - delete_column: 'Hapus Kolom', - delete_row: 'Hapus Baris', - delete_table: 'Hapus Tabel', - rows: 'Baris', - columns: 'Kolom', - add_head: 'Tambahkan Head', - delete_head: 'Hapus Head', - title: 'Judul', - image_position: 'Posisi', - none: 'Kosong', - left: 'Kiri', - right: 'Kanan', - image_web_link: 'Tautan Gambar Web', - text: 'Teks', - mailto: 'Email', - web: 'URL', - video_html_code: 'Kode pelekatan video', - file: 'Sisipkan Berkas...', - upload: 'Unggah', - download: 'Unduh', - choose: 'Pilih', - or_choose: 'Atau pilih', - drop_file_here: 'Letakkan berkas disini', - align_left: 'Rata Kiri', - align_center: 'Rata Tengah', - align_right: 'Rata Kanan', - align_justify: 'Rata Kiri dan Kanan', - horizontalrule: 'Sisipkan garis horizontal', - fullscreen: 'Layar penuh', - deleted: 'Coret', - anchor: 'Jangkar', - link_new_tab: 'Open link in new tab', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/it.js b/assets/redactor/lang/it.js deleted file mode 100644 index 2f857646..00000000 --- a/assets/redactor/lang/it.js +++ /dev/null @@ -1,77 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['it'] = { - html: 'HTML', - video: 'Video', - image: 'Immagine', - table: 'Tabella', - link: 'Collegamento', - link_insert: 'Inserisci un collegamento ...', - link_edit: 'Modifica link', - unlink: 'Rimuovi il collegamento', - formatting: 'Stili', - paragraph: 'Paragrafo', - quote: 'Citazione', - code: 'Codice', - header1: 'H1', - header2: 'H2', - header3: 'H3', - header4: 'H4', - header5: 'H5', - bold: 'Grassetto', - italic: 'Corsivo', - superscript: 'Apice', - strikethrough: 'Barrato', - fontcolor: 'Colore del font', - backcolor: 'Colore di sfondo', - unorderedlist: 'Elenco puntato', - orderedlist: 'Elenco numerato', - outdent: 'Rimuovi rientro', - indent: 'Aumenta rientro', - cancel: 'Annulla', - insert: 'Inserisci', - save: 'Salva', - _delete: 'rimuovi', - insert_table: 'Inserisci tabella', - insert_row_above: 'Inserisci una riga sopra', - insert_row_below: 'Inserisci una riga sotto', - insert_column_left: 'Aggiungi una colonna a sinistra', - insert_column_right: 'Aggiungi una colonna a destra', - delete_column: 'Cancella colonna', - delete_row: 'Cancella riga', - delete_table: 'Cancella tabella', - rows: 'Righe', - columns: 'Colonne', - add_head: 'Aggiungi head', - delete_head: 'Cancella head', - title: 'Titolo', - image_position: 'Posizione', - none: 'Nessuno', - left: 'Sinistra', - right: 'Destra', - image_web_link: 'URL immagine', - text: 'Testo', - mailto: 'Email', - web: 'URL', - video_html_code: 'Codice da incorporare', - file: 'File', - upload: 'Upload', - download: 'Download', - choose: 'Scegli', - or_choose: 'O Scegli', - drop_file_here: 'Trascina il file qui', - align_left: 'Allinea a sinistra', - align_center: 'Allinea al centro', - align_right: 'Allinea a destra', - align_justify: 'Giustifica', - horizontalrule: 'Riga orizzonatale', - fullscreen: 'Schermo intero', - deleted: 'Cancellato', - anchor: 'Ancora', - link_new_tab: 'Apri link in una nuova tab', - underline: 'Sottolineato', - alignment: 'Allineamento', - filename: 'Nome (opzionale)', - edit: 'Modifica', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/ja.js b/assets/redactor/lang/ja.js deleted file mode 100644 index 42fe92b5..00000000 --- a/assets/redactor/lang/ja.js +++ /dev/null @@ -1,75 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['ja'] = { - html: 'HTML', - video: 'ビデオ', - image: 'イメージ', - table: 'テーブル', - link: 'リンク', - link_insert: 'リンクの挿入 ...', - link_edit: 'Edit link', - unlink: 'リンクを外す', - formatting: 'スタイル', - paragraph: '段落', - quote: '引用', - code: 'コード', - header1: 'ヘッダー 1', - header2: 'ヘッダー 2', - header3: 'ヘッダー 3', - header4: 'ヘッダー 4', - header5: 'ヘッダー 5', - bold: '太字', - italic: 'イタリック', - fontcolor: 'フォント色', - backcolor: '背景色', - unorderedlist: '番号なしリスト', - orderedlist: '番号つきリスト', - outdent: '字上げ(逆インデント)', - indent: '字下げ(インデント)', - cancel: 'キャンセル', - insert: '挿入', - save: '保存', - _delete: '削除', - insert_table: 'テーブルの挿入', - insert_row_above: '列を上に追加', - insert_row_below: '列を下に追加', - insert_column_left: '行を左に追加', - insert_column_right: '行を右に追加', - delete_column: '行を削除', - delete_row: '列を削除', - delete_table: 'テーブルを削除', - rows: '列', - columns: '行', - add_head: 'テーブルヘッダの追加', - delete_head: 'テーブルヘッダの削除', - title: 'タイトル', - image_position: 'イメージの位置', - none: '無し', - left: '左', - right: '右', - image_web_link: 'イメージへのリンク', - text: 'テキスト', - mailto: 'メール', - web: 'URL', - video_html_code: 'ビデオ埋め込みコード', - file: 'ファイル', - upload: 'アップロード', - download: 'ダウンロード', - choose: '選択', - or_choose: 'または選択', - drop_file_here: 'ファイルをここにドロップ', - align_left: '左揃え', - align_center: '中央揃え', - align_right: '右揃え', - align_justify: '均等割り付け', - horizontalrule: '水平線', - fullscreen: '全画面', - deleted: '打消し', - anchor: 'アンカー', - link_new_tab: '新しいタブでリンクを開く', - underline: 'アンダーライン', - alignment: '行揃え', - filename: '名前(オプション)', - edit: '編集', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/ko.js b/assets/redactor/lang/ko.js deleted file mode 100644 index f6ca3a3c..00000000 --- a/assets/redactor/lang/ko.js +++ /dev/null @@ -1,75 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['ko'] = { - html: 'HTML', - video: '비디오', - image: '이미지', - table: '표', - link: '링크', - link_insert: '링크 삽입', - link_edit: '링크 편집', - unlink: '링크 삭제', - formatting: '스타일', - paragraph: '단락', - quote: '인용', - code: '코드', - header1: '헤더 1', - header2: '헤더 2', - header3: '헤더 3', - header4: '헤더 4', - header5: '헤더 5', - bold: '굵게', - italic: '기울임꼴', - fontcolor: '글자색', - backcolor: '배경색', - unorderedlist: '글머리기호', - orderedlist: '번호매기기', - outdent: '내어쓰기', - indent: '들여쓰기', - cancel: '취소', - insert: '삽입', - save: '저장', - _delete: '삭제', - insert_table: '표 삽입', - insert_row_above: '열을 위에 추가', - insert_row_below: '열을 아래에 추가', - insert_column_left: '행을 왼쪽에 추가', - insert_column_right: '행을 오른쪽에 추가', - delete_column: '컬럼 삭제', - delete_row: '행 삭제', - delete_table: '표 삭제', - rows: '행', - columns: '열', - add_head: '표 헤더 추가', - delete_head: '표 헤더 체거', - title: '제목', - image_position: '이미지 위치', - none: '없음', - left: '왼쪽', - right: '오른쪽', - image_web_link: '이미지 링크', - text: '텍스트', - mailto: '메일', - web: 'URL', - video_html_code: '비디오 삽입(embed) 코드', - file: '파일', - upload: '업로드', - download: '다운로드', - choose: '선택', - or_choose: '또는 선택', - drop_file_here: '파일을 여기에 떨굼', - align_left: '왼쪽정렬', - align_center: '가운데정렬', - align_right: '오른쪽정렬', - align_justify: '가지런히정렬', - horizontalrule: '수평선', - fullscreen: '전체화면', - deleted: '취소선', - anchor: '링크', - link_new_tab: '새로운 탭에서 링크 열기', - underline: '밑줄', - alignment: '정렬', - filename: '파일명 (선택)', - edit: '편집', - center: 'Center' -}; -})( jQuery ); \ No newline at end of file diff --git a/assets/redactor/lang/lt.js b/assets/redactor/lang/lt.js deleted file mode 100644 index d664887e..00000000 --- a/assets/redactor/lang/lt.js +++ /dev/null @@ -1,74 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['lt'] = { - html: 'HTML', - video: 'Įkelti video...', - image: 'Įkelti paveiksliuką...', - table: 'Lentelė', - link: 'Nuoroda', - link_insert: 'Įtraukti nuorodą ...', - link_edit: 'Edit link', - unlink: 'Panaikinti nuorodą', - formatting: 'Formatavimas', - paragraph: 'Paragrafas', - quote: 'Citata', - code: 'Išnaša', - header1: 'Antraštė 1', - header2: 'Antraštė 2', - header3: 'Antraštė 3', - header4: 'Antraštė 4', - header5: 'Antraštė 5', - bold: 'Ryškus', - italic: 'Pasviras', - fontcolor: 'Teksto spalva', - backcolor: 'Fono spalva', - unorderedlist: 'Sąrašas', - orderedlist: 'Numeruotas sąrašas', - outdent: 'Pritraukti', - indent: 'Atitraukti', - cancel: 'Atšaukti', - insert: 'Įterpti', - save: 'Išsaugoti', - _delete: 'Ištrinti', - insert_table: 'Įtraukti lentelę...', - insert_row_above: 'Įterpti eilutę virš', - insert_row_below: 'Įterpti eilutę po', - insert_column_left: 'Įterpti stulpelį kairiau', - insert_column_right: 'Įterpti stulpelį dešiniau', - delete_column: 'Ištrinti stulpelį', - delete_row: 'Ištrinti eilutę', - delete_table: 'Ištrinti lentelę', - rows: 'Eilutės', - columns: 'Stulpeliai', - add_head: 'Įterpti rubriką', - delete_head: 'Ištrinti rubriką', - title: 'Pavadinimas', - image_position: 'Pozicija', - none: 'Nėra', - left: 'Kairė', - right: 'Dešinė', - image_web_link: 'Nuoroda į paveiksliuką', - text: 'Tekstas', - mailto: 'El. paštas', - web: 'Nuoroda', - video_html_code: 'Video įterpimo kodas', - file: 'Įterpti bylą...', - upload: 'Įkelti', - download: 'Parsisiųsti', - choose: 'Pasirinkti', - or_choose: 'Arba pasirinkti', - drop_file_here: 'Mesti failą čia', - align_left: 'Lygiuoti iš kairės', - align_center: 'Centruoti', - align_right: 'Lygiuoti iš dešinės', - align_justify: 'Išlyginti eilutes', - horizontalrule: 'Įterpti horizontalią liniją', - deleted: 'Ištrinta', - anchor: 'Žymė', - link_new_tab: 'Atidaryti nuorodą naujame lange', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/lv.js b/assets/redactor/lang/lv.js deleted file mode 100644 index 85330973..00000000 --- a/assets/redactor/lang/lv.js +++ /dev/null @@ -1,74 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['lv'] = { - html: 'HTML кods', - video: 'Video', - image: 'Attēls', - table: 'Tabula', - link: 'Saite', - link_insert: 'Iekļaut saiti ...', - link_edit: 'Edit link', - unlink: 'Noņemt saiti', - formatting: 'Stili', - paragraph: 'Vienkāršs teksts', - quote: 'Citāts', - code: 'Kods', - header1: 'Virsraksts 1', - header2: 'Virsraksts 2', - header3: 'Virsraksts 3', - header4: 'Virsraksts 4', - header5: 'Virsraksts 5', - bold: 'Pustrekns', - italic: 'Slīps', - fontcolor: 'Teksta krāsa', - backcolor: 'Fona krāsa', - unorderedlist: 'Parasts saraksts', - orderedlist: 'Numurēts saraksts', - outdent: 'Samazināt atkāpi', - indent: 'Palielināt atkāpi', - cancel: 'Atcelt', - insert: 'Iespraust', - save: 'Saglabāt', - _delete: 'Dzēst', - insert_table: 'Iespraust tabulu', - insert_row_above: 'Pievienot rindu no augšas', - insert_row_below: 'Pievienot rindu no apakšas', - insert_column_left: 'Pievienot stabiņu no kreisās puses', - insert_column_right: 'Pievienot stabiņu no labās puses', - delete_column: 'Dzēst stabiņu', - delete_row: 'Dzēst rindu', - delete_table: 'Dzēst tabulu', - rows: 'Rindas', - columns: 'Stabiņi', - add_head: 'Pievienot virsrakstu', - delete_head: 'Dzēst virsrakstu', - title: 'Uzvedne', - image_position: 'Аttēla apliece', - none: 'nav', - left: 'pa kreisi', - right: 'pa labi', - image_web_link: 'vai saite uz attēlu', - text: 'Teksts', - mailto: 'E-pasts', - web: 'URL', - video_html_code: 'Videoklipu kods', - file: 'Fails', - upload: 'Augšupielāde', - download: 'Lejupielāde', - choose: 'Izvēlieties', - or_choose: 'Vai izvēlieties', - drop_file_here: 'Vilkt failu uz šejieni', - align_left: 'Izlīdzināt pa labi', - align_center: 'Izlīdzināt pa kreisi', - align_right: 'Izlīdzināt pret centru', - align_justify: 'Izlīdzināt malas', - horizontalrule: 'Horizontāla līnija', - fullscreen: 'Pa visu ekrānu', - anchor: 'Anchor', - link_new_tab: 'Open link in new tab', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); \ No newline at end of file diff --git a/assets/redactor/lang/mk.js b/assets/redactor/lang/mk.js deleted file mode 100644 index dbddc97c..00000000 --- a/assets/redactor/lang/mk.js +++ /dev/null @@ -1,74 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['mk'] = { - html: 'HTML', - video: 'Внеси видео...', - image: 'Внеси слика...', - table: 'Табела', - link: 'Линк', - link_insert: 'Внеси линк ...', - link_edit: 'Edit link', - unlink: 'Избриши линк', - formatting: 'Форматирање', - paragraph: 'Параграф', - quote: 'Цитат', - code: 'Код', - header1: 'Заглавие 1', - header2: 'Заглавие 2', - header3: 'Заглавие 3', - header4: 'Заглавие 4', - header5: 'Заглавие 5', - bold: 'Болдирано', - italic: 'Италик', - fontcolor: 'Боја на фонт', - backcolor: 'Боја на позадина', - unorderedlist: 'Неподредена листа', - orderedlist: 'Подредена листа', - outdent: 'Нанадвор', - indent: 'Навнатре', - cancel: 'Откажи', - insert: 'Внеси', - save: 'Зачувај', - _delete: 'Избриши', - insert_table: 'Внеси табела...', - insert_row_above: 'Додај ред над', - insert_row_below: 'Додај ред под', - insert_column_left: 'Додај колона лево', - insert_column_right: 'Додај колона десно', - delete_column: 'Избриши колона', - delete_row: 'Избриши ред', - delete_table: 'Избриши табела', - rows: 'Редови', - columns: 'Колони', - add_head: 'Додај наслов', - delete_head: 'Избриши наслов', - title: 'Наслов', - image_position: 'Позиција', - none: 'Не позиционирај', - left: 'Лево', - right: 'Десно', - image_web_link: 'Слика од линк', - text: 'Текст', - mailto: 'Е-маил', - web: 'URL', - video_html_code: 'Код за видео', - file: 'Внеси фајл...', - upload: 'Качи на сервер', - download: 'Симни', - choose: 'Одбери', - or_choose: 'Или одбери', - drop_file_here: 'Спушти фајл тука', - align_left: 'Порамни текст на лево', - align_center: 'Центрирај текст', - align_right: 'Порамни текст на десно', - align_justify: 'Израмни текси', - horizontalrule: 'Внеси хоризонтална линија', - deleted: 'Избришано', - anchor: 'Локален линк', - link_new_tab: 'Отвори линк во нов таб', - underline: 'Подвлечи', - alignment: 'Порамнување', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/nl.js b/assets/redactor/lang/nl.js deleted file mode 100644 index ffba8c27..00000000 --- a/assets/redactor/lang/nl.js +++ /dev/null @@ -1,79 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['nl'] = { - html: 'HTML', - video: 'Video', - image: 'Afbeelding', - table: 'Tabel', - link: 'Link', - link_insert: 'Link invoegen...', - link_edit: 'Edit link', - unlink: 'Link ontkoppelen', - formatting: 'Stijlen', - paragraph: 'Paragraaf', - quote: 'Citaat', - code: 'Code', - header1: 'Kop 1', - header2: 'Kop 2', - header3: 'Kop 3', - header4: 'Kop 4', - header5: 'Kop 5', - bold: 'Vet', - italic: 'Cursief', - fontcolor: 'Tekstkleur', - backcolor: 'Achtergrondkleur', - unorderedlist: 'Ongeordende lijst', - orderedlist: 'Geordende lijst', - outdent: 'Uitspringen', - indent: 'Inspringen', - redo: 'Opnieuw maken', - undo: 'Ongedaan maken', - cut: 'Knippen', - cancel: 'Annuleren', - insert: 'Invoegen', - save: 'Opslaan', - _delete: 'Verwijderen', - insert_table: 'Tabel invoegen', - insert_row_above: 'Rij hierboven invoegen', - insert_row_below: 'Rij hieronder invoegen', - insert_column_left: 'Kolom links toevoegen', - insert_column_right: 'Kolom rechts toevoegen', - delete_column: 'Verwijder kolom', - delete_row: 'Verwijder rij', - delete_table: 'Verwijder tabel', - rows: 'Rijen', - columns: 'Kolommen', - add_head: 'Titel toevoegen', - delete_head: 'Titel verwijderen', - title: 'Titel', - image_position: 'Positie', - none: 'geen', - left: 'links', - right: 'rechts', - image_web_link: 'Afbeelding link', - text: 'Tekst', - mailto: 'Email', - web: 'URL', - video_html_code: 'Video embed code', - file: 'Bestand', - upload: 'Uploaden', - download: 'Downloaden', - choose: 'Kies', - or_choose: 'Of kies', - drop_file_here: 'Sleep bestand hier', - align_left: 'Links uitlijnen', - align_center: 'Centreren', - align_right: 'Rechts uitlijnen', - align_justify: 'Uitvullen', - horizontalrule: 'Horizontale lijn', - fullscreen: 'Volledig scherm', - deleted: 'Verwijderd', - anchor: 'Anker', - link_new_tab: 'Open link in nieuw tabblad', - underline: 'Onderstrepen', - alignment: 'Uitlijning', - filename: 'Naam (optioneel)', - edit: 'Bewerk', - center: 'Center' -}; -})( jQuery ); - diff --git a/assets/redactor/lang/no_NB.js b/assets/redactor/lang/no_NB.js deleted file mode 100644 index fd2e2b20..00000000 --- a/assets/redactor/lang/no_NB.js +++ /dev/null @@ -1,74 +0,0 @@ -(function ($) { - $.Redactor.opts.langs['no_NB'] = { - html: 'HTML', - video: 'Sett inn video...', - image: 'Sett inn bilde...', - table: 'Tabell', - link: 'Link', - link_insert: 'Sett inn link...', - link_edit: 'Rediger link', - unlink: 'Fjern link', - formatting: 'Formatering', - paragraph: 'Avsnitt', - quote: 'Sitat', - code: 'Kode', - header1: 'Overskrift 1', - header2: 'Overskrift 2', - header3: 'Overskrift 3', - header4: 'Overskrift 4', - header5: 'Overskrift 5', - bold: 'Fet', - italic: 'Kursiv', - fontcolor: 'Tekstfarge', - backcolor: 'Bakgrunsfarge', - unorderedlist: 'Usortert liste', - orderedlist: 'Sortert liste', - outdent: 'Redusere innrykk', - indent: 'Innrykk', - cancel: 'Avbryt', - insert: 'Sett inn', - save: 'Lagre', - _delete: 'Slett', - insert_table: 'Sett inn tabell...', - insert_row_above: 'Legg til rad over', - insert_row_below: 'Legg til rad under', - insert_column_left: 'Legg til kolonne venstre', - insert_column_right: 'Legg til kolonne høyre', - delete_column: 'Slett kolonne', - delete_row: 'Slett rad', - delete_table: 'Slett tabell', - rows: 'Rader', - columns: 'Kolonner', - add_head: 'Legg til tabellhode', - delete_head: 'Slett tabellhode', - title: 'Tittel', - image_position: 'Plassering', - none: 'Ingen', - left: 'venstre', - right: 'Høyre', - image_web_link: 'Bildelink', - text: 'Tekst', - mailto: 'E-Post', - web: 'URL', - video_html_code: 'Kode for innbyggingsvideo', - file: 'Sett inn fil...', - upload: 'Last opp', - download: 'Last ned', - choose: 'Velg', - or_choose: 'Eller velg', - drop_file_here: 'Slipp filen her', - align_left: 'Venstrejuster', - align_center: 'Midtjuster', - align_right: 'Høyrejuster', - align_justify: 'Balansert', - horizontalrule: 'Sett inn horisontal linje', - deleted: 'Slettet', - anchor: 'Anker', - link_new_tab: 'Åpne link i ny fane', - underline: 'Understreking', - alignment: 'Justering', - filename: 'Filnavn (valgfritt)', - edit: 'Edit', - center: 'Center' - }; -})(jQuery); \ No newline at end of file diff --git a/assets/redactor/lang/pl.js b/assets/redactor/lang/pl.js deleted file mode 100644 index af7a35a4..00000000 --- a/assets/redactor/lang/pl.js +++ /dev/null @@ -1,75 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['pl'] = { - html: 'Źródło', - video: 'Wideo', - image: 'Obrazek', - table: 'Tabela', - link: 'Link', - link_insert: 'Wstaw link ...', - link_edit: 'Edit link', - unlink: 'Usuń link', - formatting: 'Style', - paragraph: 'Zwykły tekst', - quote: 'Cytat', - code: 'Kod źródłowy', - header1: 'Nagłówek 1', - header2: 'Nagłówek 2', - header3: 'Nagłówek 3', - header4: 'Nagłówek 4', - header5: 'Nagłówek 5', - bold: 'Pogrubiony', - italic: 'Pochylony', - fontcolor: 'Kolor tekstu', - backcolor: 'Kolor tła', - unorderedlist: 'Wypunktowanie', - orderedlist: 'Numeracja', - outdent: 'Zwiększ wcięcie', - indent: 'Zmniejsz wcięcie', - cancel: 'Anuluj', - insert: 'Wstaw', - save: 'Zachowaj', - _delete: 'Usuń', - insert_table: 'Wstaw tabele', - insert_row_above: 'Dodaj wiersz na górze', - insert_row_below: 'Dodaj wiersz na dole', - insert_column_left: 'Dodaj kolumnę po lewej', - insert_column_right: 'Dodaj kolumnę po prawej', - delete_column: 'Usuń kolumnę', - delete_row: 'Usuń wiersz', - delete_table: 'Usuń tabele', - rows: 'Wiersze', - columns: 'Kolumny', - add_head: 'Dodaj nagłówek', - delete_head: 'Usuń nagłówek', - title: 'Wskazówka', - image_position: 'Obramowanie', - none: 'nie ma', - left: 'od lewej', - right: 'od prawej', - image_web_link: 'albo link do obrazku', - text: 'Tekst', - mailto: 'Poczta e-mail', - web: 'URL', - video_html_code: 'Kod źródłowy pliku wideo', - file: 'Plik', - upload: 'Wgraj na serwer', - download: 'Pobierz', - choose: 'Wybierz z listy', - or_choose: 'lub wybierz', - drop_file_here: 'Przenieś plik tutaj', - align_left: 'Tekst do lewej', - align_center: 'Wyśrodkuj', - align_right: 'Tekst do prawej', - align_justify: 'Wyjustuj', - horizontalrule: 'Linia pozioma', - fullscreen: 'Pełny ekran', - deleted: 'Usunięty', - anchor: 'Kotwica', - link_new_tab: 'Otwórz link w nowym oknie', - underline: 'Pokdreślony', - alignment: 'Wyrównanie', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); \ No newline at end of file diff --git a/assets/redactor/lang/pt_br.js b/assets/redactor/lang/pt_br.js deleted file mode 100644 index e987143c..00000000 --- a/assets/redactor/lang/pt_br.js +++ /dev/null @@ -1,82 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['pt_br'] = { - html: 'Ver HTML', - video: 'Vídeo', - image: 'Imagem', - table: 'Tabela', - link: 'Link', - link_insert: 'Inserir link...', - link_edit: 'Edit link', - unlink: 'Remover link', - formatting: 'Estilos', - paragraph: 'Parágrafo', - quote: 'Citação', - code: 'Código', - header1: 'Título 1', - header2: 'Título 2', - header3: 'Título 3', - header4: 'Título 4', - header5: 'Título 5', - bold: 'Negrito', - italic: 'Itálico', - fontcolor: 'Cor da fonte', - backcolor: 'Cor do fundo', - unorderedlist: 'Lista não ordenada', - orderedlist: 'Lista ordenada', - outdent: 'Remover identação', - indent: 'Identar', - cancel: 'Cancelar', - insert: 'Inserir', - save: 'Salvar', - _delete: 'Remover', - insert_table: 'Inserir tabela', - add_cell: 'Adicionar coluna', - delete_cell: 'Remover coluna', - add_row: 'Adicionar linha', - delete_row: 'Remover linha', - thead: 'Cabeçalho', - delete_table: 'Remover tabela', - insert_row_above: 'Adicionar linha acima', - insert_row_below: 'Adicionar linha abaixo', - insert_column_left: 'Adicionar coluna à esquerda', - insert_column_right: 'Adicionar coluna da direita', - delete_column: 'Remover Coluna', - delete_row: 'Remover linha', - delete_table: 'Remover tabela', - rows: 'Linhas', - columns: 'Colunas', - add_head: 'Adicionar cabeçalho', - delete_head: 'Remover cabeçalho', - title: 'Título', - image_position: 'Posição', - none: 'Nenhum', - left: 'Esquerda', - right: 'Direita', - image_web_link: 'Link para uma imagem', - text: 'Texto', - mailto: 'Email', - web: 'URL', - video_html_code: 'Código de incorporação', - file: 'Arquivo', - upload: 'Upload', - download: 'Download', - choose: 'Escolha', - or_choose: 'Ou escolha', - drop_file_here: 'Arraste um arquivo até aqui', - align_left: 'Alinhar a esquerda', - align_center: 'Centralizar', - align_right: 'Alinhar a direita', - align_justify: 'Justificar', - horizontalrule: 'Linha horizontal', - fullscreen: 'Tela cheia', - deleted: 'Removido', - anchor: 'Ânchora', - link_new_tab: 'Abrir link em nova janela/aba', - underline: 'Underline', - alignment: 'Alinhamento', - filename: 'Nome (opcional)', - edit: 'Editar', - center: 'Center' -}; -})( jQuery ); - diff --git a/assets/redactor/lang/pt_pt.js b/assets/redactor/lang/pt_pt.js deleted file mode 100644 index a3e54d13..00000000 --- a/assets/redactor/lang/pt_pt.js +++ /dev/null @@ -1,74 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['pt_pt'] = { - html: 'HTML', - video: 'Inserir Video...', - image: 'Inserir Imagem...', - table: 'Tabela', - link: 'Hiperligação', - link_insert: 'Inserir Hiperligação ...', - link_edit: 'Edit link', - unlink: 'Remover Hiperligação', - formatting: 'Formatação', - paragraph: 'Parágrafo', - quote: 'Citar', - code: 'Código', - header1: 'Cabeçalho 1', - header2: 'Cabeçalho 2', - header3: 'Cabeçalho 3', - header4: 'Cabeçalho 4', - header5: 'Cabeçalho 5', - bold: 'Negrito', - italic: 'Itálico', - fontcolor: 'Cor da Fonte', - backcolor: 'Cor de Fundo', - unorderedlist: 'Lista Não Ordenada', - orderedlist: 'Lista Ordenada', - outdent: 'Remover Identação', - indent: 'Identar', - cancel: 'Cancelar', - insert: 'Inserir', - save: 'Guardar', - _delete: 'Eliminar', - insert_table: 'Inserir Tabela...', - insert_row_above: 'Adicionar Linha Acima', - insert_row_below: 'Adicionar Linha Abaixo', - insert_column_left: 'Adicionar Coluna à Esquerda', - insert_column_right: 'Adicionar Coluna à Direita', - delete_column: 'Eliminar Coluna', - delete_row: 'Eliminar Linha', - delete_table: 'Eliminar Tabela', - rows: 'Linhas', - columns: 'Colunas', - add_head: 'Adicionar Cabeçalho', - delete_head: 'Eliminar Cabeçalho', - title: 'Título', - image_position: 'Posição', - none: 'Nenhum', - left: 'Esquerda', - right: 'Direita', - image_web_link: 'Url de Imagem', - text: 'Texto', - mailto: 'Email', - web: 'URL', - video_html_code: 'Código de Incorporação de Vídeo', - file: 'Inserir Ficheiro...', - upload: 'Upload', - download: 'Download', - choose: 'Escolha', - or_choose: 'Ou escolha', - drop_file_here: 'Largue o ficheiro aqui', - align_left: 'Alinhar à esquerda', - align_center: 'Centrar', - align_right: 'Alinhar à direita', - align_justify: 'Justificar', - horizontalrule: 'Inserir Linha Horizontal', - deleted: 'Eliminado', - anchor: 'Âncora', - link_new_tab: 'Abrir hiperligação em novo separador', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/ro.js b/assets/redactor/lang/ro.js deleted file mode 100644 index f17b56a1..00000000 --- a/assets/redactor/lang/ro.js +++ /dev/null @@ -1,75 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['ro'] = { - html: 'HTML', - video: 'Adauga video...', - image: 'Adauga imagine...', - table: 'Tabel', - link: 'Legatura web', - link_insert: 'Adauga legatura web...', - link_edit: 'Edit link', - unlink: 'Elimina legatura web', - formatting: 'Formatare', - paragraph: 'Paragraf', - quote: 'Citat', - code: 'Cod', - header1: 'Titlu 1', - header2: 'Titlu 2', - header3: 'Titlu 3', - header4: 'Titlu 4', - header5: 'Titlu 5', - bold: 'Aldin (Bold)', - italic: 'Cursiv (Italic)', - fontcolor: 'Culoare font', - backcolor: 'Culoare de fundal', - unorderedlist: 'Lista neordonata', - orderedlist: 'Lista ordonata', - outdent: 'Redu indentarea', - indent: 'Mareste indentarea', - cancel: 'Renunta', - insert: 'Adauga', - save: 'Salveaza', - _delete: 'Sterge', - insert_table: 'Adauga tabel...', - insert_row_above: 'Adauga linie deasupra', - insert_row_below: 'Adauga linie dedesupt', - insert_column_left: 'Adauga coloana la stanga', - insert_column_right: 'Adauga coloana la dreapta', - delete_column: 'Sterge coloana', - delete_row: 'Sterge linie', - delete_table: 'Sterge tabela', - rows: 'Linii', - columns: 'Coloane', - add_head: 'Adauga cap tabel', - delete_head: 'Sterge cap tabel', - title: 'Titlu', - image_position: 'Pozitie', - none: 'None', - left: 'Stanga', - right: 'Dreapta', - image_web_link: 'Legatura web imagine', - text: 'Text', - mailto: 'Adresa email', - web: 'Legatura web', - video_html_code: 'Cod adaugare video', - file: 'Adauga fisier...', - upload: 'Incarca', - download: 'Descarca', - choose: 'Alege', - or_choose: 'sau alege din computer', - drop_file_here: 'Trage fisierele aici', - align_left: 'Aliniere la stanga', - align_center: 'Centrat', - align_right: 'Aliniere la dreapta', - align_justify: 'Aliniere la margini', - horizontalrule: 'Adauga rigla orizontala', - fullscreen: 'Afisare pe tot ecranul', - deleted: 'Taiat (Sters)', - anchor: 'Ancora', - link_new_tab: 'Open link in new tab', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/ru.js b/assets/redactor/lang/ru.js deleted file mode 100644 index ed3980f0..00000000 --- a/assets/redactor/lang/ru.js +++ /dev/null @@ -1,75 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['ru'] = { - html: 'Код', - video: 'Видео', - image: 'Изображение', - table: 'Таблица', - link: 'Ссылка', - link_insert: 'Вставить ссылку ...', - link_edit: 'Изменить ссылку', - unlink: 'Удалить ссылку', - formatting: 'Форматирование', - paragraph: 'Обычный текст', - quote: 'Цитата', - code: 'Код', - header1: 'Заголовок 1', - header2: 'Заголовок 2', - header3: 'Заголовок 3', - header4: 'Заголовок 4', - header5: 'Заголовок 5', - bold: 'Полужирный', - italic: 'Наклонный', - fontcolor: 'Цвет текста', - backcolor: 'Заливка текста', - unorderedlist: 'Обычный список', - orderedlist: 'Нумерованный список', - outdent: 'Уменьшить отступ', - indent: 'Увеличить отступ', - cancel: 'Отменить', - insert: 'Вставить', - save: 'Сохранить', - _delete: 'Удалить', - insert_table: 'Вставить таблицу', - insert_row_above: 'Добавить строку сверху', - insert_row_below: 'Добавить строку снизу', - insert_column_left: 'Добавить столбец слева', - insert_column_right: 'Добавить столбец справа', - delete_column: 'Удалить столбец', - delete_row: 'Удалить строку', - delete_table: 'Удалить таблицу', - rows: 'Строки', - columns: 'Столбцы', - add_head: 'Добавить заголовок', - delete_head: 'Удалить заголовок', - title: 'Подсказка', - image_position: 'Обтекание текстом', - none: 'Нет', - left: 'Cлева', - right: 'Cправа', - image_web_link: 'Cсылка на изображение', - text: 'Текст', - mailto: 'Эл. почта', - web: 'URL', - video_html_code: 'Код видео ролика', - file: 'Файл', - upload: 'Загрузить', - download: 'Скачать', - choose: 'Выбрать', - or_choose: 'Или выберите', - drop_file_here: 'Перетащите файл сюда', - align_left: 'По левому краю', - align_center: 'По центру', - align_right: 'По правому краю', - align_justify: 'Выровнять текст по ширине', - horizontalrule: 'Горизонтальная линейка', - fullscreen: 'Во весь экран', - deleted: 'Зачеркнутый', - anchor: 'Якорь', - link_new_tab: 'Открывать в новой вкладке', - underline: 'Подчеркнутый', - alignment: 'Выравнивание', - filename: 'Название (необязательно)', - edit: 'Ред.', - center: 'По центру' -}; -})( jQuery ); diff --git a/assets/redactor/lang/sk.js b/assets/redactor/lang/sk.js deleted file mode 100644 index 675ee0c7..00000000 --- a/assets/redactor/lang/sk.js +++ /dev/null @@ -1,75 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['sk'] = { - html: 'HTML', - video: 'Video', - image: 'Obrázok', - table: 'Tabulka', - link: 'Odkaz', - link_insert: 'Vložiť odkaz ...', - link_edit: 'Edit link', - unlink: 'Odstrániť odkaz', - formatting: 'Štýl', - paragraph: 'Odstavec', - quote: 'Citácia', - code: 'Kód', - header1: 'Nadpis 1', - header2: 'Nadpis 2', - header3: 'Nadpis 3', - header4: 'Nadpis 4', - header5: 'Nadpis 5', - bold: 'Tučné', - italic: 'Kurzíva', - fontcolor: 'Farba písma', - backcolor: 'Farba pozadia', - unorderedlist: 'Zoznam s odrážkami', - orderedlist: 'Číslovaný zoznam', - outdent: 'Zmenšiť odsadenie', - indent: 'Zväčšiť odsadenie', - cancel: 'Zrušiť', - insert: 'Vložiť', - save: 'Uložiť', - _delete: 'Smazať', - insert_table: 'Vložiť tabulku', - insert_row_above: 'Pridať riadok hore', - insert_row_below: 'Pridať riadok dole', - insert_column_left: 'Pridať stĺpec vľavo', - insert_column_right: 'Pridať stľpec vpravo', - delete_column: 'Zmazať stľpec', - delete_row: 'Zmazať riadok', - delete_table: 'Zmazať tabulku', - rows: 'Riadky', - columns: 'Stľpce', - add_head: 'Pridať záhlavie', - delete_head: 'Zmazať záhlavie', - title: 'Titulok', - image_position: 'Pozícia', - none: 'žiadny', - left: 'vľavo', - right: 'vpravo', - image_web_link: 'Odkaz na obrázok', - text: 'Text', - mailto: 'Email', - web: 'URL', - video_html_code: 'Kód pre vloženie videa na stránku', - file: 'Súbor', - upload: 'Nahrát', - download: 'Stiahnúť', - choose: 'Vybrať', - or_choose: 'alebo', - drop_file_here: 'Pretiahnite súbor sem', - align_left: 'Zarovnať vľavo', - align_center: 'Zarovnať na stred', - align_right: 'Zarovnať vpravo', - align_justify: 'Zarovnať do bloku', - horizontalrule: 'Vodorovná čiara', - fullscreen: 'Celá obrazovka', - deleted: 'Prečiarknuté', - anchor: 'Záložka', - link_new_tab: 'Open link in new tab', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/sl.js b/assets/redactor/lang/sl.js deleted file mode 100644 index 13050ef3..00000000 --- a/assets/redactor/lang/sl.js +++ /dev/null @@ -1,78 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['sl'] = { - html: 'HTML', - video: 'Video', - image: 'Slika', - table: 'Tabela', - link: 'Povezava', - link_insert: 'Vstavi povezavo...', - link_edit: 'Edit link', - unlink: 'Odstrani povezavo', - formatting: 'Stili', - paragraph: 'Odstavek', - quote: 'Citat', - code: 'HTML koda', - header1: 'Naslov 1', - header2: 'Naslov 2', - header3: 'Naslov 3', - header4: 'Naslov 4', - header5: 'Naslov 5', - bold: 'Odebeljeno', - italic: 'Poševno', - fontcolor: 'Barva pisave', - backcolor: 'Barva ozadja', - unorderedlist: 'Nesortirana lista', - orderedlist: 'Sortirana lista', - outdent: 'Pomik levo', - indent: 'Pomik desno', - redo: 'Naprej', - undo: 'Nazaj', - cut: 'Izreži', - cancel: 'Prekini', - insert: 'Vstavi', - save: 'Shrani', - _delete: 'Izbriši', - insert_table: 'Vstavi tabelo', - insert_row_above: 'Dodaj vrstico nad', - insert_row_below: 'Dodaj vrstico pod', - insert_column_left: 'Dodaj stolpec levo', - insert_column_right: 'Dodaj stolpec desno', - delete_column: 'Izbriši stolpec', - delete_row: 'Izbriši vrstivo', - delete_table: 'Izbriši tabelo', - rows: 'Vrstic', - columns: 'Stolpcev', - add_head: 'Dodaj naslov', - delete_head: 'Odstrani naslov', - title: 'Naslov', - image_position: 'Poravnava', - none: 'brez', - left: 'levo', - right: 'desno', - image_web_link: 'Povezava do slike', - text: 'Besedilo', - mailto: 'Email', - web: 'WEB povezava', - video_html_code: 'Koda videa', - file: 'Datoteka', - upload: 'Pošalji', - download: 'Prenesi', - choose: 'Izberi', - or_choose: 'ali izberi', - drop_file_here: 'Povleci datoteko sem', - align_left: 'Poravnaj levo', - align_center: 'Centriraj', - align_right: 'Poravnaj desno', - align_justify: 'Od roba do roba', - horizontalrule: 'Horizontalna crta', - fullscreen: 'Čez cel ekran', - deleted: 'Izbrisano', - anchor: 'Sidro', - link_new_tab: 'Odpri povezavo v novem oknu/tabu', - underline: 'Podčrtano', - alignment: 'Poravnava', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/sq.js b/assets/redactor/lang/sq.js deleted file mode 100644 index 6a39a175..00000000 --- a/assets/redactor/lang/sq.js +++ /dev/null @@ -1,78 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['sq'] = { - html: 'HTML', - video: 'Video', - image: 'Fotografi', - table: 'Tabelë', - link: 'Link', - link_insert: 'Lidh linq ...', - link_edit: 'Edit link', - unlink: 'Hiq linkun', - formatting: 'Stilet', - paragraph: 'Paragraf', - quote: 'Kuotë', - code: 'Kod', - header1: 'Header 1', - header2: 'Header 2', - header3: 'Header 3', - header4: 'Header 4', - header5: 'Header 5', - bold: 'Te trasha / Bold', - italic: 'Kursive / Italic', - fontcolor: 'Ngjyra e shkronjave', - backcolor: 'Ngjyra e mbrapavisë së shkronjave', - unorderedlist: 'Liste pa renditje', - orderedlist: 'Liste me renditje', - outdent: 'Outdent', - indent: 'Indent', - redo: 'Ribëj', - undo: 'Zhbëj', - cut: 'Cut', - cancel: 'Anulo', - insert: 'Insert', - save: 'Ruaje', - _delete: 'Fshije', - insert_table: 'Shto tabelë', - insert_row_above: 'Shto rresht sipër', - insert_row_below: 'Shto rresht përfundi', - insert_column_left: 'Shto kolonë majtas', - insert_column_right: 'Shto kolonë djathtas', - delete_column: 'Fshije kolonën', - delete_row: 'Fshije rreshtin', - delete_table: 'Fshije tabelën', - rows: 'Rreshta', - columns: 'Kolona', - add_head: 'Shto titujt e tabelës', - delete_head: 'Fshije titujt e tabelës', - title: 'Titulli', - image_position: 'Pozita', - none: 'Normale', - left: 'Majtas', - right: 'Djathtas', - image_web_link: 'Linku i fotografisë në internet', - text: 'Teksti', - mailto: 'Email', - web: 'URL', - video_html_code: 'Video embed code', - file: 'Fajll', - upload: 'Ngarko', - download: 'Shkarko', - choose: 'Zgjedh', - or_choose: 'Ose zgjedh', - drop_file_here: 'Gjuaje fajllin këtu', - align_left: 'Rreshtoje majtas', - align_center: 'Rreshtoje në mes', - align_right: 'Rreshtoje djathtas', - align_justify: 'Rreshtoje të gjithin njejt', - horizontalrule: 'Vizë horizontale', - fullscreen: 'Pamje e plotë', - deleted: 'E fshirë', - anchor: 'Anchor', - link_new_tab: 'Open link in new tab', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/sr-cir.js b/assets/redactor/lang/sr-cir.js deleted file mode 100644 index 64520a81..00000000 --- a/assets/redactor/lang/sr-cir.js +++ /dev/null @@ -1,78 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['sr-cir'] = { - html: 'ХТМЛ', - video: 'Убаци видео', - image: 'Убаци фотографију', - table: 'Табела', - link: 'Веза', - link_insert: 'Убаци везу ...', - link_edit: 'Edit link', - unlink: 'Уклони везу', - formatting: 'Стилови', - paragraph: 'Параграф', - quote: 'Цитат', - code: 'Изворни код', - header1: 'Заглавље 1', - header2: 'Заглавље 2', - header3: 'Заглавље 3', - header4: 'Заглавље 4', - header5: 'Заглавље 5', - bold: 'Подебљај', - italic: 'Накоси', - fontcolor: 'Боја слова', - backcolor: 'Боја позадине', - unorderedlist: 'Несортирана листа', - orderedlist: 'Сортирана листа', - outdent: 'Извуци', - indent: 'Увуци', - redo: 'Корак напред', - undo: 'Корак назад', - cut: 'Изрежи', - cancel: 'Одустани', - insert: 'Убаци', - save: 'Сачувај', - _delete: 'Избриши', - insert_table: 'Убаци табелу', - insert_row_above: 'Додај ред изнад', - insert_row_below: 'Додај ред испод', - insert_column_left: 'Додај колону лево', - insert_column_right: 'Додај колону десно', - delete_column: 'Избриши колону', - delete_row: 'Избриши ред', - delete_table: 'Избриши табелу', - rows: 'Ред', - columns: 'Колона', - add_head: 'Додај заглавље', - delete_head: 'Уклони заглавље', - title: 'Наслов', - image_position: 'Позиција', - none: 'Без', - left: 'Лево', - right: 'Десно', - image_web_link: 'Веб адреса фотографије', - text: 'Текст', - mailto: 'Емаил', - web: 'Веб адреса', - video_html_code: 'Видео код', - file: 'Датотека', - upload: 'Пошаљи', - download: 'Преузми', - choose: 'Одабери', - or_choose: 'Или одабери', - drop_file_here: 'Превуци датотеку овде', - align_left: 'Поравнај лево', - align_center: 'Центрирај', - align_right: 'Поравнај десно', - align_justify: 'Од руба до руба', - horizontalrule: 'Убаци хоризонталну линију', - fullscreen: 'Прикажи преко читавог екрана', - deleted: 'Избрисано', - anchor: 'Сидро', - link_new_tab: 'Open link in new tab', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/sr-lat.js b/assets/redactor/lang/sr-lat.js deleted file mode 100644 index fc216e60..00000000 --- a/assets/redactor/lang/sr-lat.js +++ /dev/null @@ -1,78 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['sr-lat'] = { - html: 'HTML', - video: 'Ubaci video', - image: 'Ubaci fotografiju', - table: 'Tabela', - link: 'Veza', - link_insert: 'Ubaci vezu ...', - link_edit: 'Edit link', - unlink: 'Ukloni vezu', - formatting: 'Stilovi', - paragraph: 'Paragraf', - quote: 'Citat', - code: 'Izvorni kod', - header1: 'Zaglavlje 1', - header2: 'Zaglavlje 2', - header3: 'Zaglavlje 3', - header4: 'Zaglavlje 4', - header5: 'Zaglavlje 5', - bold: 'Podebljaj', - italic: 'Nakosi', - fontcolor: 'Boja slova', - backcolor: 'Boja pozadine', - unorderedlist: 'Nesortirana lista', - orderedlist: 'Sortirana lista', - outdent: 'Izvuci', - indent: 'Uvuci', - redo: 'Korak napred', - undo: 'Korak nazad', - cut: 'Izreži', - cancel: 'Odustani', - insert: 'Ubaci', - save: 'Sačuvaj', - _delete: 'Izbriši', - insert_table: 'Ubaci tabelu', - insert_row_above: 'Dodaj red iznad', - insert_row_below: 'Dodaj red ispod', - insert_column_left: 'Dodaj kolonu levo', - insert_column_right: 'Dodaj kolonu desno', - delete_column: 'Izbriši kolonu', - delete_row: 'Izbriši red', - delete_table: 'Izbriši tabelu', - rows: 'Red', - columns: 'Kolona', - add_head: 'Dodaj zaglavlje', - delete_head: 'Ukloni zaglavlje', - title: 'Naslov', - image_position: 'Pozicija', - none: 'Bez', - left: 'Levo', - right: 'Desno', - image_web_link: 'Web adresa fotografije', - text: 'Tekst', - mailto: 'Email', - web: 'Web adresa', - video_html_code: 'Video kod', - file: 'Datoteka', - upload: 'Pošalji', - download: 'Preuzmi', - choose: 'Odaberi', - or_choose: 'Ili odaberi', - drop_file_here: 'Prevuci datoteku ovde', - align_left: 'Poravnaj levo', - align_center: 'Centriraj', - align_right: 'Poravnaj desno', - align_justify: 'Od ruba do ruba', - horizontalrule: 'Ubaci horizontalnu liniju', - fullscreen: 'Prikaz preko čitavog ekrana', - deleted: 'Izbrisano', - anchor: 'Sidro', - link_new_tab: 'Open link in new tab', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/sv.js b/assets/redactor/lang/sv.js deleted file mode 100644 index 50712af4..00000000 --- a/assets/redactor/lang/sv.js +++ /dev/null @@ -1,76 +0,0 @@ -(function ($) { - $.Redactor.opts.langs['sv'] = { - _delete: 'Tag Bort', - add_head: 'Lägg Till Tabellhuvud', - align_center: 'Centerjustera', - align_justify: 'Marginaljustering', - align_left: 'Vänsterjustera', - align_right: 'Högerjustera', - alignment: 'Justering', - anchor: 'Ankare', - backcolor: 'Bakgrundsfärg', - bold: 'Fet', - cancel: 'Ångra', - choose: 'Välj', - code: 'Kod', - columns: 'Kolumner', - delete_column: 'Tag Bort Kolumn', - delete_head: 'Tag Bort Tabellhuvud', - delete_row: 'Tag Bort Rad', - delete_table: 'Tag Bort Tabell', - deleted: 'Överstruken', - download: 'Nedladdning', - drop_file_here: 'Släpp Fil Här', - edit: 'Ändra', - file: 'Infoga Fil...', - filename: 'Namn (valfritt)', - fontcolor: 'Typsnittsfärg', - formatting: 'Formatering', - fullscreen: 'Fullskärm', - header1: 'Rubrik 1', - header2: 'Rubrik 2', - header3: 'Rubrik 3', - header4: 'Rubrik 4', - header5: 'Rubrik 5', - horizontalrule: 'Infoga Horisontell Linje', - html: 'HTML', - image: 'Infoga Bild...', - image_position: 'Position', - image_web_link: 'Bildlänk', - indent: 'Öka indentering', - insert: 'Infoga', - insert_column_left: 'Lägg Till Vänsterkolumn', - insert_column_right: 'Lägg Till Högerkolumn', - insert_row_above: 'Lägg Till Rad Ovanför', - insert_row_below: 'Lägg Till Rad Under', - insert_table: 'Infoga Tabell...', - italic: 'Kursiv', - left: 'Vänster', - link: 'Länk', - link_edit: 'Ändra länk', - link_insert: 'Infoga Länk...', - link_new_tab: 'Öppna länk i ny flik', - mailto: 'E-post', - none: 'Ingen', - or_choose: 'Eller Välj', - orderedlist: 'Ordnad Lista', - outdent: 'Minska Indentering', - paragraph: 'Paragraf', - quote: 'Citat', - right: 'Höger', - rows: 'Rader', - save: 'Spara', - table: 'Tabell', - text: 'Text', - title: 'Titel', - underline: 'Understryk', - unlink: 'Tag Bort Länk', - unorderedlist: 'Oordnad Lista', - upload: 'Uppladdning', - video: 'Infoga Video...', - video_html_code: 'Kod För Inbäddad Video', - web: 'Webbadress', - center: 'Center' - }; -})( jQuery ); - diff --git a/assets/redactor/lang/th.js b/assets/redactor/lang/th.js deleted file mode 100644 index fd9f42cc..00000000 --- a/assets/redactor/lang/th.js +++ /dev/null @@ -1,74 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['th'] = { - html: 'HTML', - video: 'ใส่วีดีโอ...', - image: 'แนบรูป...', - table: 'ตาราง', - link: 'ลิงค์', - link_insert: 'ใส่ลิงค์ ...', - link_edit: 'Edit link', - unlink: 'ลบลิงค์', - formatting: 'รูปแบบ', - paragraph: 'ย่อหน้า', - quote: 'ข้อความ', - code: 'โค้ด', - header1: 'หัวข้อ 1', - header2: 'หัวข้อ 2', - header3: 'หัวข้อ 3', - header4: 'หัวข้อ 4', - header5: 'หัวข้อ 5', - bold: 'ตัวหน้า', - italic: 'ตัวเอียง', - fontcolor: 'สีตัวอักษร', - backcolor: 'สีพื้นหลัง', - unorderedlist: 'รายการแบบไม่มีลำดับ', - orderedlist: 'รายการแบบมีลำดับ', - outdent: 'เลื่อนออก', - indent: 'เลื่อนเข้า', - cancel: 'ยกเลิก', - insert: 'แนบ', - save: 'บันทึก', - _delete: 'ลบ', - insert_table: 'ใส่ตาราง...', - insert_row_above: 'แทรกแถวใหม่ด้านบน', - insert_row_below: 'แทรกแถวใหม่ด้านล่าง', - insert_column_left: 'แทรกคอลัมน์ทางซ้าย', - insert_column_right: 'แทรกคอลัมน์ทางขวา', - delete_column: 'ลบคอลัมน์', - delete_row: 'ลบแถว', - delete_table: 'ลบตาราง', - rows: 'แถว', - columns: 'คอลัมน์', - add_head: 'ใส่หัวข้อ', - delete_head: 'ลบหัวข้อ', - title: 'หัวเรื่อง', - image_position: 'ตำแหน่งรูป', - none: 'ปรกติ', - left: 'ซ้าย', - right: 'ขวา', - image_web_link: 'ลิงค์รูปภาพ', - text: 'ตัวอักษร', - mailto: 'อีเมล', - web: 'เว็บไซต์', - video_html_code: 'โค้ดวีดีโอ', - file: 'แนบไฟล์...', - upload: 'อัพโหลด', - download: 'ดาวน์โหลด', - choose: 'เลือก', - or_choose: 'หรือเลือกไฟล์', - drop_file_here: 'ลากไฟล์มาวางที่นี่', - align_left: 'จัดตัวอักษรชิดซ้าย', - align_center: 'จัดตัวอักษรกึ่งกลาง', - align_right: 'จัดตัวอักษรชิดขวา', - align_justify: 'จัดตัวอักษรแบบพอดีกรอบ', - horizontalrule: 'ใส่เส้นแบ่งหน้า', - deleted: 'ขีดออก', - anchor: 'เชื่อมโยง', - link_new_tab: 'เปิดลิงค์ในแทปใหม่', - underline: 'เส้นใต้', - alignment: 'การจัดวาง', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/tr.js b/assets/redactor/lang/tr.js deleted file mode 100644 index 4cce63db..00000000 --- a/assets/redactor/lang/tr.js +++ /dev/null @@ -1,75 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['tr'] = { - html: 'HTML', - video: 'Video', - image: 'Görsel', - table: 'Tablo', - link: 'Bağlantı', - link_insert: 'Bağlantı Ekle ...', - link_edit: 'Bağlantıyı Düzenle', - unlink: 'Bağlantı Kaldır', - formatting: 'Biçimlendirme', - paragraph: 'Paragraf', - quote: 'Alıntı', - code: 'Kod', - header1: 'Başlık 1', - header2: 'Başlık 2', - header3: 'Başlık 3', - header4: 'Başlık 4', - header5: 'Başlık 5', - bold: 'Kalın', - italic: 'Eğik', - fontcolor: 'Yazı rengi', - backcolor: 'Arkaplan rengi', - unorderedlist: 'Sırasız liste', - orderedlist: 'Sıralı liste', - outdent: 'Girintiyi azalt', - indent: 'Girintiyi artır', - cancel: 'İptal', - insert: 'Ekle', - save: 'Kaydet', - _delete: 'Sil', - insert_table: 'Tablo ekle', - insert_row_above: 'Üste satır ekle', - insert_row_below: 'Alta satır ekle', - insert_column_left: 'Sola sütun ekle', - insert_column_right: 'Sağa sütun ekle', - delete_column: 'Sütun sil', - delete_row: 'Satır sil', - delete_table: 'Tablo sil', - rows: 'Satırlar', - columns: 'Sütunlar', - add_head: 'Başlık ekle', - delete_head: 'Başlık sil', - title: 'Başlık', - image_position: 'Pozisyon', - none: 'hiçbiri', - left: 'sol', - right: 'sağ', - image_web_link: 'Görselin web bağlantısı', - text: 'Metin', - mailto: 'E-Posta', - web: 'URL', - video_html_code: 'Video embed kodu', - file: 'Dosya', - upload: 'Yükle', - download: 'İndir', - choose: 'Seç', - or_choose: 'Veya seç', - drop_file_here: 'Dosyayı buraya bırak', - align_left: 'Sola hizala', - align_center: 'Ortala', - align_right: 'Sağa hizala', - align_justify: 'Satır uzunluğuna ayarla', - horizontalrule: 'Yatay çizgi', - fullscreen: 'Tam ekran', - deleted: 'Silindi', - anchor: 'Çapa', - link_new_tab: 'Bağlantıyı yeni pencerede aç', - underline: 'Altı çizili', - alignment: 'Hizalama', - filename: 'Dosya Adı (isteğe bağlı)', - edit: 'Düzenle', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/ua.js b/assets/redactor/lang/ua.js deleted file mode 100644 index 157fe578..00000000 --- a/assets/redactor/lang/ua.js +++ /dev/null @@ -1,76 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['ua'] = { - html: 'Код', - video: 'Відео', - image: 'Зображення', - table: 'Таблиця', - link: 'Посилання', - link_insert: 'Вставити посилання ...', - link_edit: 'Edit link', - unlink: 'Видалити посилання', - formatting: 'Стилі', - paragraph: 'Звичайний текст', - quote: 'Цитата', - code: 'Код', - header1: 'Заголовок 1', - header2: 'Заголовок 2', - header3: 'Заголовок 3', - header4: 'Заголовок 4', - header5: 'Заголовок 5', - bold: 'Жирний', - italic: 'Похилий', - fontcolor: 'Колір тексту', - backcolor: 'Заливка тексту', - unorderedlist: 'Звичайний список', - orderedlist: 'Нумерований список', - outdent: 'Зменшити відступ', - indent: 'Збільшити відступ', - cancel: 'Скасувати', - insert: 'Вставити', - save: 'Зберегти', - _delete: 'Видалити', - insert_table: 'Вставити таблицю', - insert_row_above: 'Додати рядок зверху', - insert_row_below: 'Додати рядок знизу', - insert_column_left: 'Додати стовпець ліворуч', - insert_column_right: 'Додати стовпець праворуч', - delete_column: 'Видалити стовпець', - delete_row: 'Видалити рядок', - delete_table: 'Видалити таблицю', - rows: 'Рядки', - columns: 'Стовпці', - add_head: 'Додати заголовок', - delete_head: 'Видалити заголовок', - title: 'Підказка', - image_view: 'Завантажити зображення', - image_position: 'Обтікання текстом', - none: 'ні', - left: 'ліворуч', - right: 'праворуч', - image_web_link: 'Посилання на зображення', - text: 'Текст', - mailto: 'Ел. пошта', - web: 'URL', - video_html_code: 'Код відео ролика', - file: 'Файл', - upload: 'Завантажити', - download: 'Завантажити', - choose: 'Вибрати', - or_choose: 'Або виберіть', - drop_file_here: 'Перетягніть файл сюди', - align_left: 'По лівому краю', - align_center: 'По центру', - align_right: 'По правому краю', - align_justify: 'Вирівняти текст по ширині', - horizontalrule: 'Горизонтальная лінійка', - fullscreen: 'На весь екран', - deleted: 'Закреслений', - anchor: 'Anchor', - link_new_tab: 'Open link in new tab', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); \ No newline at end of file diff --git a/assets/redactor/lang/vi.js b/assets/redactor/lang/vi.js deleted file mode 100644 index 0dc45e42..00000000 --- a/assets/redactor/lang/vi.js +++ /dev/null @@ -1,74 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['vi'] = { - html: 'Xem HTML', - video: 'Chèn Video...', - image: 'Chèn hình ảnh...', - table: 'Tạo bảng', - link: 'Đường dẫn', - link_insert: 'Thêm đường dẫn ...', - link_edit: 'Edit link', - unlink: 'Loại bỏ đường dẫn', - formatting: 'Định dạng văn bản', - paragraph: 'Đoạn văn', - quote: 'Trích dẫn', - code: 'Chèn mã', - header1: 'Tiêu đề 1', - header2: 'Tiêu đề 2', - header3: 'Tiêu đề 3', - header4: 'Tiêu đề 4', - header5: 'Tiêu đề 5', - bold: 'In đậm', - italic: 'In nghiêng', - fontcolor: 'Màu chữ', - backcolor: 'Đánh dấu đoạn văn', - unorderedlist: 'Sắp xếp theo danh sách', - orderedlist: 'Sắp xếp theo thứ tự', - outdent: 'Bỏ thụt đầu dòng', - indent: 'Thụt đầu dòng', - cancel: 'Hủy bỏ', - insert: 'Chèn', - save: 'Lưu lại', - _delete: 'Xóa', - insert_table: 'Chèn bảng...', - insert_row_above: 'Thêm hàng bên trên', - insert_row_below: 'Thêm hàng bên dưới', - insert_column_left: 'Thêm cột trái', - insert_column_right: 'Thêm cột phải', - delete_column: 'Xóa cột', - delete_row: 'Xóa hàng', - delete_table: 'Xóa bảng', - rows: 'Hàng', - columns: 'Cột', - add_head: 'Thêm tiêu đề bảng', - delete_head: 'Xóa tiêu đề bảng', - title: 'Tiêu đề', - image_position: 'Vị trí', - none: 'Không thay đổi', - left: 'Trái', - right: 'Phải', - image_web_link: 'Đường dẫn link ảnh', - text: 'Văn bản', - mailto: 'Email', - web: 'Đường dẫn', - video_html_code: 'Mã nhúng video', - file: 'Tập tin đính kèm...', - upload: 'Tải lên', - download: 'Tải xuống', - choose: 'Lựa Chọn', - or_choose: 'Chọn từ máy tính', - drop_file_here: 'Kéo thả hình ảnh vào đây', - align_left: 'Căn trái', - align_center: 'Căn giữa', - align_right: 'Căn phải', - align_justify: 'Dàn đều trang', - horizontalrule: 'Chèn thanh ngang', - deleted: 'Xóa', - anchor: 'Liên kết', - link_new_tab: 'Open link in new tab', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/zh_cn.js b/assets/redactor/lang/zh_cn.js deleted file mode 100644 index 663347e0..00000000 --- a/assets/redactor/lang/zh_cn.js +++ /dev/null @@ -1,75 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['zh_cn'] = { - html: 'HTML代码', - video: '视频', - image: '图片', - table: '表格', - link: '链接', - link_insert: '插入链接', - link_edit: 'Edit link', - unlink: '取消链接', - formatting: '样式', - paragraph: '段落', - quote: '引用', - code: '代码', - header1: '一级标题', - header2: '二级标题', - header3: '三级标题', - header4: '四级标题', - header5: 'Header 5', - bold: '粗体', - italic: '斜体', - fontcolor: '字体颜色', - backcolor: '背景颜色', - unorderedlist: '项目编号', - orderedlist: '数字编号', - outdent: '减少缩进', - indent: '增加缩进', - cancel: '取消', - insert: '插入', - save: '保存', - _delete: '删除', - insert_table: '插入表格', - insert_row_above: '在上方插入', - insert_row_below: '在下方插入', - insert_column_left: '在左侧插入', - insert_column_right: '在右侧插入', - delete_column: '删除整列', - delete_row: '删除整行', - delete_table: '删除表格', - rows: '行', - columns: '列', - add_head: '添加标题', - delete_head: '删除标题', - title: '标题', - image_position: '位置', - none: '无', - left: '左', - right: '右', - image_web_link: '图片网页链接', - text: '文本', - mailto: '邮箱', - web: '网址', - video_html_code: '视频嵌入代码', - file: '文件', - upload: '上传', - download: '下载', - choose: '选择', - or_choose: '或选择', - drop_file_here: '将文件拖拽至此区域', - align_left: '左对齐', - align_center: '居中', - align_right: '右对齐', - align_justify: '两端对齐', - horizontalrule: '水平线', - fullscreen: '全屏', - deleted: '删除', - anchor: '锚点', - link_new_tab: 'Open link in new tab', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); diff --git a/assets/redactor/lang/zh_tw.js b/assets/redactor/lang/zh_tw.js deleted file mode 100644 index 413bfdf9..00000000 --- a/assets/redactor/lang/zh_tw.js +++ /dev/null @@ -1,75 +0,0 @@ -(function ($) { -$.Redactor.opts.langs['zh_tw'] = { - html: 'HTML', - video: '插入影片', - image: '插入圖片', - table: '表格', - link: '連結', - link_insert: '插入連結', - link_edit: 'Edit link', - unlink: '移除連結', - formatting: '樣式', - paragraph: '段落', - quote: '引用', - code: '原始碼', - header1: '標題 1', - header2: '標題 2', - header3: '標題 3', - header4: '標題 4', - header5: '標題 5', - bold: '將文字變成粗體', - italic: '將文字變成斜體', - fontcolor: '選擇文字顏色', - backcolor: '選擇文字底色', - unorderedlist: '項目列表', - orderedlist: '編號列表', - outdent: '減少縮排', - indent: '增加縮排', - cancel: '取消', - insert: '插入', - save: '儲存', - _delete: '刪除', - insert_table: '插入表格', - insert_row_above: '加入上方橫列', - insert_row_below: '加入下方橫列', - insert_column_left: '加入左方直欄', - insert_column_right: '加入右方直欄', - delete_column: '刪除整欄', - delete_row: '刪除整列', - delete_table: '刪除表格', - rows: '橫列', - columns: '直欄', - add_head: '加入表格標題', - delete_head: '刪除表格標題', - title: '標題', - image_position: '位置', - none: '無', - left: '靠左', - right: '靠右', - image_web_link: '連結', - text: '內文', - mailto: 'Email', - web: '網址', - video_html_code: '嵌入影片的原始碼', - file: '插入文件', - upload: '上傳', - download: '下載', - choose: '選擇', - or_choose: '或選擇', - drop_file_here: '將文件拖曳至此', - align_left: '將文字對齊至左側', - align_center: '將文字置中', - align_right: '將文字對齊至右側', - align_justify: '對齊至兩側', - horizontalrule: '插入水平線', - fullscreen: '全銀幕', - deleted: '刪除線', - anchor: '錨點', - link_new_tab: 'Open link in new tab', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit', - center: 'Center' -}; -})( jQuery ); \ No newline at end of file diff --git a/assets/redactor/plugins/clips/clips.css b/assets/redactor/plugins/clips/clips.css deleted file mode 100644 index 6287ad05..00000000 --- a/assets/redactor/plugins/clips/clips.css +++ /dev/null @@ -1,6 +0,0 @@ -.label-red { - color: #fff; - background: #c92020; - padding: 0 7px; - border-radius: 4px; -} \ No newline at end of file diff --git a/assets/redactor/plugins/clips/clips.js b/assets/redactor/plugins/clips/clips.js deleted file mode 100644 index 52eaee65..00000000 --- a/assets/redactor/plugins/clips/clips.js +++ /dev/null @@ -1,61 +0,0 @@ -if (!RedactorPlugins) var RedactorPlugins = {}; - -RedactorPlugins.clips = function() -{ - return { - init: function() - { - var items = [ - ['Lorem ipsum...', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'], - ['Red label', 'Label'] - ]; - - this.clips.template = $('