diff --git a/web/bashgid_images/aHR0cDovL2Ntcy5pbmRpZ29pbnRlcmFjdGl2ZS5ydS9maWxlcy91ZmEvXy5qcGc=.jpg b/web/bashgid_images/aHR0cDovL2Ntcy5pbmRpZ29pbnRlcmFjdGl2ZS5ydS9maWxlcy91ZmEvXy5qcGc=.jpg new file mode 100644 index 0000000..95b0f02 Binary files /dev/null and b/web/bashgid_images/aHR0cDovL2Ntcy5pbmRpZ29pbnRlcmFjdGl2ZS5ydS9maWxlcy91ZmEvXy5qcGc=.jpg differ diff --git a/web/bashgid_images/aHR0cDovL2Ntcy5pbmRpZ29pbnRlcmFjdGl2ZS5ydS9maWxlcy91ZmEvXzIuanBn.jpg b/web/bashgid_images/aHR0cDovL2Ntcy5pbmRpZ29pbnRlcmFjdGl2ZS5ydS9maWxlcy91ZmEvXzIuanBn.jpg new file mode 100644 index 0000000..43816f1 Binary files /dev/null and b/web/bashgid_images/aHR0cDovL2Ntcy5pbmRpZ29pbnRlcmFjdGl2ZS5ydS9maWxlcy91ZmEvXzIuanBn.jpg differ diff --git a/web/bashgid_images/aHR0cDovL3Bob3RvLmJzcHUucnUvMzIvMS5qcGc=.jpg b/web/bashgid_images/aHR0cDovL3Bob3RvLmJzcHUucnUvMzIvMS5qcGc=.jpg new file mode 100644 index 0000000..15dd111 Binary files /dev/null and b/web/bashgid_images/aHR0cDovL3Bob3RvLmJzcHUucnUvMzIvMS5qcGc=.jpg differ diff --git a/web/bashgid_images/aHR0cDovL3Bob3RvLmJzcHUucnUvMzIvMi5qcGc=.jpg b/web/bashgid_images/aHR0cDovL3Bob3RvLmJzcHUucnUvMzIvMi5qcGc=.jpg new file mode 100644 index 0000000..df539fe Binary files /dev/null and b/web/bashgid_images/aHR0cDovL3Bob3RvLmJzcHUucnUvMzIvMi5qcGc=.jpg differ diff --git a/web/bashgid_images/aHR0cDovL3Bya29tbS51Z2F0dS5zdS9tZWRpYS91cGxvYWRzL2ltZy9nYWxsZXJ5LzE2LkpQRw==.jpg b/web/bashgid_images/aHR0cDovL3Bya29tbS51Z2F0dS5zdS9tZWRpYS91cGxvYWRzL2ltZy9nYWxsZXJ5LzE2LkpQRw==.jpg new file mode 100644 index 0000000..c805a12 Binary files /dev/null and b/web/bashgid_images/aHR0cDovL3Bya29tbS51Z2F0dS5zdS9tZWRpYS91cGxvYWRzL2ltZy9nYWxsZXJ5LzE2LkpQRw==.jpg differ diff --git a/web/bashgid_images/aHR0cDovL3Bya29tbS51Z2F0dS5zdS9tZWRpYS91cGxvYWRzL2ltZy9nYWxsZXJ5LzIuanBn.jpg b/web/bashgid_images/aHR0cDovL3Bya29tbS51Z2F0dS5zdS9tZWRpYS91cGxvYWRzL2ltZy9nYWxsZXJ5LzIuanBn.jpg new file mode 100644 index 0000000..da8d740 Binary files /dev/null and b/web/bashgid_images/aHR0cDovL3Bya29tbS51Z2F0dS5zdS9tZWRpYS91cGxvYWRzL2ltZy9nYWxsZXJ5LzIuanBn.jpg differ diff --git a/web/bashgid_images/aHR0cDovL3Bya29tbS51Z2F0dS5zdS9tZWRpYS91cGxvYWRzL2ltZy9nYWxsZXJ5LzIzLkpQRw==.jpg b/web/bashgid_images/aHR0cDovL3Bya29tbS51Z2F0dS5zdS9tZWRpYS91cGxvYWRzL2ltZy9nYWxsZXJ5LzIzLkpQRw==.jpg new file mode 100644 index 0000000..7880b9c Binary files /dev/null and b/web/bashgid_images/aHR0cDovL3Bya29tbS51Z2F0dS5zdS9tZWRpYS91cGxvYWRzL2ltZy9nYWxsZXJ5LzIzLkpQRw==.jpg differ diff --git a/web/bashgid_images/aHR0cDovL3d3dy5haXJwb3J0dWZhLnJ1L2Fzc2V0cy9nYWxsZXJ5LzE0Mi80Ni5KUEc=.jpg b/web/bashgid_images/aHR0cDovL3d3dy5haXJwb3J0dWZhLnJ1L2Fzc2V0cy9nYWxsZXJ5LzE0Mi80Ni5KUEc=.jpg new file mode 100644 index 0000000..f743d94 Binary files /dev/null and b/web/bashgid_images/aHR0cDovL3d3dy5haXJwb3J0dWZhLnJ1L2Fzc2V0cy9nYWxsZXJ5LzE0Mi80Ni5KUEc=.jpg differ diff --git a/web/bashgid_images/aHR0cDovL3d3dy5haXJwb3J0dWZhLnJ1L2Fzc2V0cy9nYWxsZXJ5LzE0My80Ny5qcGc=.jpg b/web/bashgid_images/aHR0cDovL3d3dy5haXJwb3J0dWZhLnJ1L2Fzc2V0cy9nYWxsZXJ5LzE0My80Ny5qcGc=.jpg new file mode 100644 index 0000000..e7de757 Binary files /dev/null and b/web/bashgid_images/aHR0cDovL3d3dy5haXJwb3J0dWZhLnJ1L2Fzc2V0cy9nYWxsZXJ5LzE0My80Ny5qcGc=.jpg differ diff --git a/web/bashgid_images/aHR0cDovL3d3dy5iYXNoZWR1LnJ1L3NpdGVzL2RlZmF1bHQvZmlsZXMvbWVkaWFnYWxsZXJ5X2ltYWdlL3pkYW5pYV91bml2ZXJzaXRldGFfMS5qcGc=.jpg b/web/bashgid_images/aHR0cDovL3d3dy5iYXNoZWR1LnJ1L3NpdGVzL2RlZmF1bHQvZmlsZXMvbWVkaWFnYWxsZXJ5X2ltYWdlL3pkYW5pYV91bml2ZXJzaXRldGFfMS5qcGc=.jpg new file mode 100644 index 0000000..dfa50d9 Binary files /dev/null and b/web/bashgid_images/aHR0cDovL3d3dy5iYXNoZWR1LnJ1L3NpdGVzL2RlZmF1bHQvZmlsZXMvbWVkaWFnYWxsZXJ5X2ltYWdlL3pkYW5pYV91bml2ZXJzaXRldGFfMS5qcGc=.jpg differ diff --git a/web/bashgid_images/aHR0cDovL3d3dy5iYXNoZWR1LnJ1L3NpdGVzL2RlZmF1bHQvZmlsZXMvbWVkaWFnYWxsZXJ5X2ltYWdlL3pkYW5pYV91bml2ZXJzaXRldGFfMTAuanBn.jpg b/web/bashgid_images/aHR0cDovL3d3dy5iYXNoZWR1LnJ1L3NpdGVzL2RlZmF1bHQvZmlsZXMvbWVkaWFnYWxsZXJ5X2ltYWdlL3pkYW5pYV91bml2ZXJzaXRldGFfMTAuanBn.jpg new file mode 100644 index 0000000..ad358e7 Binary files /dev/null and b/web/bashgid_images/aHR0cDovL3d3dy5iYXNoZWR1LnJ1L3NpdGVzL2RlZmF1bHQvZmlsZXMvbWVkaWFnYWxsZXJ5X2ltYWdlL3pkYW5pYV91bml2ZXJzaXRldGFfMTAuanBn.jpg differ diff --git a/web/bashgid_images/aHR0cDovL3d3dy5iYXNoZWR1LnJ1L3NpdGVzL2RlZmF1bHQvZmlsZXMvbWVkaWFnYWxsZXJ5X2ltYWdlL3pkYW5pYV91bml2ZXJzaXRldGFfNi5qcGc=.jpg b/web/bashgid_images/aHR0cDovL3d3dy5iYXNoZWR1LnJ1L3NpdGVzL2RlZmF1bHQvZmlsZXMvbWVkaWFnYWxsZXJ5X2ltYWdlL3pkYW5pYV91bml2ZXJzaXRldGFfNi5qcGc=.jpg new file mode 100644 index 0000000..dae28ee Binary files /dev/null and b/web/bashgid_images/aHR0cDovL3d3dy5iYXNoZWR1LnJ1L3NpdGVzL2RlZmF1bHQvZmlsZXMvbWVkaWFnYWxsZXJ5X2ltYWdlL3pkYW5pYV91bml2ZXJzaXRldGFfNi5qcGc=.jpg differ diff --git a/web/bashgid_images/aHR0cDovL3d3dy5ic2F1LnJ1L3VwbG9hZC9pYmxvY2svN2RhLzdkYTcyYzE0YjVlYmJjYzJlNmM0Y2JkZGYyYTNiMWI0LmpwZWc=.jpg b/web/bashgid_images/aHR0cDovL3d3dy5ic2F1LnJ1L3VwbG9hZC9pYmxvY2svN2RhLzdkYTcyYzE0YjVlYmJjYzJlNmM0Y2JkZGYyYTNiMWI0LmpwZWc=.jpg new file mode 100644 index 0000000..57cd9d4 Binary files /dev/null and b/web/bashgid_images/aHR0cDovL3d3dy5ic2F1LnJ1L3VwbG9hZC9pYmxvY2svN2RhLzdkYTcyYzE0YjVlYmJjYzJlNmM0Y2JkZGYyYTNiMWI0LmpwZWc=.jpg differ diff --git a/web/bashgid_images/aHR0cDovL3d3dy5ic2F1LnJ1L3VwbG9hZC9pYmxvY2svNjg3LzY4N2U0YjhkYzkyOTgyYzhhODI3YmFmYmVlOWU5OTgwLmpwZWc=.jpg b/web/bashgid_images/aHR0cDovL3d3dy5ic2F1LnJ1L3VwbG9hZC9pYmxvY2svNjg3LzY4N2U0YjhkYzkyOTgyYzhhODI3YmFmYmVlOWU5OTgwLmpwZWc=.jpg new file mode 100644 index 0000000..52440e1 Binary files /dev/null and b/web/bashgid_images/aHR0cDovL3d3dy5ic2F1LnJ1L3VwbG9hZC9pYmxvY2svNjg3LzY4N2U0YjhkYzkyOTgyYzhhODI3YmFmYmVlOWU5OTgwLmpwZWc=.jpg differ diff --git a/web/bashgid_images/aHR0cDovL3d3dy5ic2F1LnJ1L3VwbG9hZC9pYmxvY2svYmYwL2JmMGJiNGViOWVjZDkwODZhMWVhMGMwNmQzYTAxMmYxLmpwZw==.jpg b/web/bashgid_images/aHR0cDovL3d3dy5ic2F1LnJ1L3VwbG9hZC9pYmxvY2svYmYwL2JmMGJiNGViOWVjZDkwODZhMWVhMGMwNmQzYTAxMmYxLmpwZw==.jpg new file mode 100644 index 0000000..2062031 Binary files /dev/null and b/web/bashgid_images/aHR0cDovL3d3dy5ic2F1LnJ1L3VwbG9hZC9pYmxvY2svYmYwL2JmMGJiNGViOWVjZDkwODZhMWVhMGMwNmQzYTAxMmYxLmpwZw==.jpg differ diff --git a/web/bashgid_images/aHR0cDovL3d3dy5na2Jhc2hrb3J0b3N0YW4ucnUvdXBsb2FkL3Jlc2l6ZV9jYWNoZS9pYmxvY2svYjkzLzEwMjRfNzY4XzIvYjkzMmFjMDNiNWMwZjEzYWU0OTZjYWEzMjdlYzI1YmEuanBn.jpg b/web/bashgid_images/aHR0cDovL3d3dy5na2Jhc2hrb3J0b3N0YW4ucnUvdXBsb2FkL3Jlc2l6ZV9jYWNoZS9pYmxvY2svYjkzLzEwMjRfNzY4XzIvYjkzMmFjMDNiNWMwZjEzYWU0OTZjYWEzMjdlYzI1YmEuanBn.jpg new file mode 100644 index 0000000..f36d331 Binary files /dev/null and b/web/bashgid_images/aHR0cDovL3d3dy5na2Jhc2hrb3J0b3N0YW4ucnUvdXBsb2FkL3Jlc2l6ZV9jYWNoZS9pYmxvY2svYjkzLzEwMjRfNzY4XzIvYjkzMmFjMDNiNWMwZjEzYWU0OTZjYWEzMjdlYzI1YmEuanBn.jpg differ diff --git a/web/bashgid_images/aHR0cDovL3d3dy5na2Jhc2hrb3J0b3N0YW4ucnUvdXBsb2FkL3Jlc2l6ZV9jYWNoZS9pYmxvY2svZjhhLzEwMjRfNzY4XzIvZjhhYjU0OWExMTE2MzNlN2M5MDNhMzE2YTZlMjQ4Y2UuanBn.jpg b/web/bashgid_images/aHR0cDovL3d3dy5na2Jhc2hrb3J0b3N0YW4ucnUvdXBsb2FkL3Jlc2l6ZV9jYWNoZS9pYmxvY2svZjhhLzEwMjRfNzY4XzIvZjhhYjU0OWExMTE2MzNlN2M5MDNhMzE2YTZlMjQ4Y2UuanBn.jpg new file mode 100644 index 0000000..88baad5 Binary files /dev/null and b/web/bashgid_images/aHR0cDovL3d3dy5na2Jhc2hrb3J0b3N0YW4ucnUvdXBsb2FkL3Jlc2l6ZV9jYWNoZS9pYmxvY2svZjhhLzEwMjRfNzY4XzIvZjhhYjU0OWExMTE2MzNlN2M5MDNhMzE2YTZlMjQ4Y2UuanBn.jpg differ diff --git a/web/bashgid_images/aHR0cDovL3d3dy5oaXVmYS5jb20vYXNzZXRzL3Bob3RvL2hvbGlkYXktaW5uLXVmYS9ob2xpZGF5LWlubi11ZmEtcGhvdG8tMDEuanBn.jpg b/web/bashgid_images/aHR0cDovL3d3dy5oaXVmYS5jb20vYXNzZXRzL3Bob3RvL2hvbGlkYXktaW5uLXVmYS9ob2xpZGF5LWlubi11ZmEtcGhvdG8tMDEuanBn.jpg new file mode 100644 index 0000000..26b640b Binary files /dev/null and b/web/bashgid_images/aHR0cDovL3d3dy5oaXVmYS5jb20vYXNzZXRzL3Bob3RvL2hvbGlkYXktaW5uLXVmYS9ob2xpZGF5LWlubi11ZmEtcGhvdG8tMDEuanBn.jpg differ diff --git a/web/bashgid_images/aHR0cDovL3d3dy5oaXVmYS5jb20vYXNzZXRzL3Bob3RvL2hvbGlkYXktaW5uLXVmYS9ob2xpZGF5LWlubi11ZmEtcGhvdG8tMDYuanBn.jpg b/web/bashgid_images/aHR0cDovL3d3dy5oaXVmYS5jb20vYXNzZXRzL3Bob3RvL2hvbGlkYXktaW5uLXVmYS9ob2xpZGF5LWlubi11ZmEtcGhvdG8tMDYuanBn.jpg new file mode 100644 index 0000000..009ce64 Binary files /dev/null and b/web/bashgid_images/aHR0cDovL3d3dy5oaXVmYS5jb20vYXNzZXRzL3Bob3RvL2hvbGlkYXktaW5uLXVmYS9ob2xpZGF5LWlubi11ZmEtcGhvdG8tMDYuanBn.jpg differ diff --git a/web/bashgid_images/aHR0cDovL3d3dy5zbXUucnVzb2lsLm5ldC9wYWdlcy8xMTQyNi9VR05UVS5KUEc=.jpg b/web/bashgid_images/aHR0cDovL3d3dy5zbXUucnVzb2lsLm5ldC9wYWdlcy8xMTQyNi9VR05UVS5KUEc=.jpg new file mode 100644 index 0000000..9872143 Binary files /dev/null and b/web/bashgid_images/aHR0cDovL3d3dy5zbXUucnVzb2lsLm5ldC9wYWdlcy8xMTQyNi9VR05UVS5KUEc=.jpg differ diff --git a/web/index.php b/web/index.php index d512b7c..ed6ac50 100644 --- a/web/index.php +++ b/web/index.php @@ -1,7 +1,15 @@ - file:/C:/Workplace/Apache2.4/htdocs/bashgid/protected/controllers/ChannelController.php file:/C:/Workplace/Apache2.4/htdocs/bashgid/protected/controllers/PhotoController.php file:/C:/Workplace/Apache2.4/htdocs/bashgid/protected/controllers/PhotoAlbumRelationController.php - file:/C:/Workplace/Apache2.4/htdocs/bashgid/protected/controllers/VideoController.php - file:/C:/Workplace/Apache2.4/htdocs/bashgid/protected/controllers/VideoChannelRelationController.php - file:/C:/Workplace/Apache2.4/htdocs/bashgid/protected/controllers/ArticleController.php - file:/C:/Workplace/Apache2.4/htdocs/bashgid/protected/controllers/ArticleJournalRelationController.php - file:/C:/Workplace/Apache2.4/htdocs/bashgid/protected/controllers/JournalController.php - file:/C:/Workplace/Apache2.4/htdocs/bashgid/protected/controllers/AlbumController.php - file:/C:/Workplace/Apache2.4/htdocs/bashgid/protected/controllers/ChannelArticleRelationController.php - file:/C:/Workplace/Apache2.4/htdocs/bashgid/protected/controllers/AlbumArticleRelationController.php - file:/C:/Workplace/Apache2.4/htdocs/bashgid/protected/models/Photo.php diff --git a/web/protected/controllers/PhotoAlbumRelationController.php b/web/protected/controllers/PhotoAlbumRelationController.php index 7a62efa..31cccb9 100644 --- a/web/protected/controllers/PhotoAlbumRelationController.php +++ b/web/protected/controllers/PhotoAlbumRelationController.php @@ -142,6 +142,11 @@ class PhotoAlbumRelationController extends Controller { public function actionJson() { $dataArray = PhotoAlbumRelation::model()->findAll(); + + foreach ($dataArray as &$data) + { + $data->imageUrl = "http://bashgid.hallyu.ru/bashgid_images/" . base64_encode($data->imageUrl) . ".jpg"; + } $this->layout = false; header('Content-type: application/json'); diff --git a/web/protected/controllers/PhotoController.php b/web/protected/controllers/PhotoController.php index 2ffab20..b8bbc6e 100644 --- a/web/protected/controllers/PhotoController.php +++ b/web/protected/controllers/PhotoController.php @@ -148,6 +148,11 @@ class PhotoController extends Controller { public function actionJson() { $dataArray = Photo::model()->findAll(); + + foreach ($dataArray as &$data) + { + $data->imageUrl = "http://bashgid.hallyu.ru/bashgid_images/" . base64_encode($data->imageUrl) . ".jpg"; + } $this->layout = false; header('Content-type: application/json'); diff --git a/web/protected/controllers/TranslationController.php b/web/protected/controllers/TranslationController.php new file mode 100644 index 0000000..d16829a --- /dev/null +++ b/web/protected/controllers/TranslationController.php @@ -0,0 +1,179 @@ + array('index', 'view', 'create', 'update', 'admin', 'delete'), + 'users' => array('@'), + ), + array('allow', + 'actions' => array('json'), + 'users' => array('*'), + ), + array('deny', // deny all users + 'users' => array('*'), + ), + ); + } + + /** + * Displays a particular model. + * @param integer $id the ID of the model to be displayed + */ + public function actionView($id) + { + $this->render('view',array( + 'model'=>$this->loadModel($id), + )); + } + + /** + * Creates a new model. + * If creation is successful, the browser will be redirected to the 'view' page. + */ + public function actionCreate() + { + $model=new Translation; + + // Uncomment the following line if AJAX validation is needed + // $this->performAjaxValidation($model); + + if(isset($_POST['Translation'])) + { + $model->attributes=$_POST['Translation']; + if($model->save()) + $this->redirect(array('view','id'=>$model->id)); + } + + $this->render('create',array( + 'model'=>$model, + )); + } + + /** + * Updates a particular model. + * If update is successful, the browser will be redirected to the 'view' page. + * @param integer $id the ID of the model to be updated + */ + public function actionUpdate($id) + { + $model=$this->loadModel($id); + + // Uncomment the following line if AJAX validation is needed + // $this->performAjaxValidation($model); + + if(isset($_POST['Translation'])) + { + $model->attributes=$_POST['Translation']; + if($model->save()) + $this->redirect(array('view','id'=>$model->id)); + } + + $this->render('update',array( + 'model'=>$model, + )); + } + + /** + * Deletes a particular model. + * If deletion is successful, the browser will be redirected to the 'admin' page. + * @param integer $id the ID of the model to be deleted + */ + public function actionDelete($id) + { + $this->loadModel($id)->delete(); + + // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser + if(!isset($_GET['ajax'])) + $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin')); + } + + /** + * Lists all models. + */ + public function actionIndex() + { + $dataProvider=new CActiveDataProvider('Translation'); + $this->render('index',array( + 'dataProvider'=>$dataProvider, + )); + } + + /** + * Manages all models. + */ + public function actionAdmin() + { + $model=new Translation('search'); + $model->unsetAttributes(); // clear any default values + if(isset($_GET['Translation'])) + $model->attributes=$_GET['Translation']; + + $this->render('admin',array( + 'model'=>$model, + )); + } + + public function actionJson() + { + $dataArray = Translation::model()->findAll(); + + $this->layout = false; + header('Content-type: application/json'); + echo CJavaScript::jsonEncode($dataArray); + Yii::app()->end(); + } + + /** + * Returns the data model based on the primary key given in the GET variable. + * If the data model is not found, an HTTP exception will be raised. + * @param integer $id the ID of the model to be loaded + * @return Translation the loaded model + * @throws CHttpException + */ + public function loadModel($id) + { + $model=Translation::model()->findByPk($id); + if($model===null) + throw new CHttpException(404,'The requested page does not exist.'); + return $model; + } + + /** + * Performs the AJAX validation. + * @param Translation $model the model to be validated + */ + protected function performAjaxValidation($model) + { + if(isset($_POST['ajax']) && $_POST['ajax']==='translation-form') + { + echo CActiveForm::validate($model); + Yii::app()->end(); + } + } +} diff --git a/web/protected/models/Translation.php b/web/protected/models/Translation.php new file mode 100644 index 0000000..69c7d99 --- /dev/null +++ b/web/protected/models/Translation.php @@ -0,0 +1,102 @@ +'search'), + ); + } + + /** + * @return array relational rules. + */ + public function relations() + { + // NOTE: you may need to adjust the relation name and the related + // class name for the relations automatically generated below. + return array( + ); + } + + /** + * @return array customized attribute labels (name=>label) + */ + public function attributeLabels() + { + return array( + 'id' => 'ID', + 'name' => 'Name', + 'textEn' => 'Text En', + 'textRu' => 'Text Ru', + 'textZh' => 'Text Zh', + ); + } + + /** + * Retrieves a list of models based on the current search/filter conditions. + * + * Typical usecase: + * - Initialize the model fields with values from filter form. + * - Execute this method to get CActiveDataProvider instance which will filter + * models according to data in model fields. + * - Pass data provider to CGridView, CListView or any similar widget. + * + * @return CActiveDataProvider the data provider that can return the models + * based on the search/filter conditions. + */ + public function search() + { + // @todo Please modify the following code to remove attributes that should not be searched. + + $criteria=new CDbCriteria; + + $criteria->compare('id',$this->id); + $criteria->compare('name',$this->name,true); + $criteria->compare('textEn',$this->textEn,true); + $criteria->compare('textRu',$this->textRu,true); + $criteria->compare('textZh',$this->textZh,true); + + return new CActiveDataProvider($this, array( + 'criteria'=>$criteria, + )); + } + + /** + * Returns the static model of the specified AR class. + * Please note that you should have this exact method in all your CActiveRecord descendants! + * @param string $className active record class name. + * @return Translation the static model class + */ + public static function model($className=__CLASS__) + { + return parent::model($className); + } +} diff --git a/web/protected/views/site/index.php b/web/protected/views/site/index.php index b11ab80..4bbf427 100644 --- a/web/protected/views/site/index.php +++ b/web/protected/views/site/index.php @@ -24,6 +24,7 @@ $this->widget('zii.widgets.CMenu',array( array('label' => 'Manage Channel in Article', 'url' => array('channelArticleRelation/admin')), array('label' => 'Journal', 'url' => array('journal/admin')), array('label' => 'Manage Article in Journal', 'url' => array('articleJournalRelation/admin')), + array('label' => 'Translation', 'url' => array('translation/admin')), ), )); diff --git a/web/protected/views/translation/_form.php b/web/protected/views/translation/_form.php new file mode 100644 index 0000000..fb6c02c --- /dev/null +++ b/web/protected/views/translation/_form.php @@ -0,0 +1,52 @@ + + +
+ +beginWidget('CActiveForm', array( + 'id'=>'translation-form', + // Please note: When you enable ajax validation, make sure the corresponding + // controller action is handling ajax validation correctly. + // There is a call to performAjaxValidation() commented in generated controller code. + // See class documentation of CActiveForm for details on this. + 'enableAjaxValidation'=>false, +)); ?> + +

Fields with * are required.

+ + errorSummary($model); ?> + +
+ labelEx($model,'name'); ?> + textArea($model,'name',array('rows'=>6, 'cols'=>50)); ?> + error($model,'name'); ?> +
+ +
+ labelEx($model,'textEn'); ?> + textArea($model,'textEn',array('rows'=>6, 'cols'=>50)); ?> + error($model,'textEn'); ?> +
+ +
+ labelEx($model,'textRu'); ?> + textArea($model,'textRu',array('rows'=>6, 'cols'=>50)); ?> + error($model,'textRu'); ?> +
+ +
+ labelEx($model,'textZh'); ?> + textArea($model,'textZh',array('rows'=>6, 'cols'=>50)); ?> + error($model,'textZh'); ?> +
+ +
+ isNewRecord ? 'Create' : 'Save'); ?> +
+ +endWidget(); ?> + +
\ No newline at end of file diff --git a/web/protected/views/translation/_search.php b/web/protected/views/translation/_search.php new file mode 100644 index 0000000..e4dcb27 --- /dev/null +++ b/web/protected/views/translation/_search.php @@ -0,0 +1,45 @@ + + +
+ +beginWidget('CActiveForm', array( + 'action'=>Yii::app()->createUrl($this->route), + 'method'=>'get', +)); ?> + +
+ label($model,'id'); ?> + textField($model,'id'); ?> +
+ +
+ label($model,'name'); ?> + textArea($model,'name',array('rows'=>6, 'cols'=>50)); ?> +
+ +
+ label($model,'textEn'); ?> + textArea($model,'textEn',array('rows'=>6, 'cols'=>50)); ?> +
+ +
+ label($model,'textRu'); ?> + textArea($model,'textRu',array('rows'=>6, 'cols'=>50)); ?> +
+ +
+ label($model,'textZh'); ?> + textArea($model,'textZh',array('rows'=>6, 'cols'=>50)); ?> +
+ +
+ +
+ +endWidget(); ?> + +
\ No newline at end of file diff --git a/web/protected/views/translation/_view.php b/web/protected/views/translation/_view.php new file mode 100644 index 0000000..43ef113 --- /dev/null +++ b/web/protected/views/translation/_view.php @@ -0,0 +1,29 @@ + + +
+ + getAttributeLabel('id')); ?>: + id), array('view', 'id'=>$data->id)); ?> +
+ + getAttributeLabel('name')); ?>: + name); ?> +
+ + getAttributeLabel('textEn')); ?>: + textEn); ?> +
+ + getAttributeLabel('textRu')); ?>: + textRu); ?> +
+ + getAttributeLabel('textZh')); ?>: + textZh); ?> +
+ + +
\ No newline at end of file diff --git a/web/protected/views/translation/admin.php b/web/protected/views/translation/admin.php new file mode 100644 index 0000000..629469a --- /dev/null +++ b/web/protected/views/translation/admin.php @@ -0,0 +1,57 @@ +breadcrumbs=array( + 'Translations'=>array('index'), + 'Manage', +); + +$this->menu=array( + array('label'=>'List Translation', 'url'=>array('index')), + array('label'=>'Create Translation', 'url'=>array('create')), +); + +Yii::app()->clientScript->registerScript('search', " +$('.search-button').click(function(){ + $('.search-form').toggle(); + return false; +}); +$('.search-form form').submit(function(){ + $('#translation-grid').yiiGridView('update', { + data: $(this).serialize() + }); + return false; +}); +"); +?> + +

Manage Translations

+ +

+You may optionally enter a comparison operator (<, <=, >, >=, <> +or =) at the beginning of each of your search values to specify how the comparison should be done. +

+ +'search-button')); ?> + + +widget('zii.widgets.grid.CGridView', array( + 'id'=>'translation-grid', + 'dataProvider'=>$model->search(), + 'filter'=>$model, + 'columns'=>array( + 'id', + 'name', + 'textEn', + 'textRu', + 'textZh', + array( + 'class'=>'CButtonColumn', + ), + ), +)); ?> diff --git a/web/protected/views/translation/create.php b/web/protected/views/translation/create.php new file mode 100644 index 0000000..7e616bb --- /dev/null +++ b/web/protected/views/translation/create.php @@ -0,0 +1,18 @@ +breadcrumbs=array( + 'Translations'=>array('index'), + 'Create', +); + +$this->menu=array( + array('label'=>'List Translation', 'url'=>array('index')), + array('label'=>'Manage Translation', 'url'=>array('admin')), +); +?> + +

Create Translation

+ +renderPartial('_form', array('model'=>$model)); ?> \ No newline at end of file diff --git a/web/protected/views/translation/index.php b/web/protected/views/translation/index.php new file mode 100644 index 0000000..5285cff --- /dev/null +++ b/web/protected/views/translation/index.php @@ -0,0 +1,20 @@ +breadcrumbs=array( + 'Translations', +); + +$this->menu=array( + array('label'=>'Create Translation', 'url'=>array('create')), + array('label'=>'Manage Translation', 'url'=>array('admin')), +); +?> + +

Translations

+ +widget('zii.widgets.CListView', array( + 'dataProvider'=>$dataProvider, + 'itemView'=>'_view', +)); ?> diff --git a/web/protected/views/translation/update.php b/web/protected/views/translation/update.php new file mode 100644 index 0000000..76eb8d5 --- /dev/null +++ b/web/protected/views/translation/update.php @@ -0,0 +1,21 @@ +breadcrumbs=array( + 'Translations'=>array('index'), + $model->name=>array('view','id'=>$model->id), + 'Update', +); + +$this->menu=array( + array('label'=>'List Translation', 'url'=>array('index')), + array('label'=>'Create Translation', 'url'=>array('create')), + array('label'=>'View Translation', 'url'=>array('view', 'id'=>$model->id)), + array('label'=>'Manage Translation', 'url'=>array('admin')), +); +?> + +

Update Translation id; ?>

+ +renderPartial('_form', array('model'=>$model)); ?> \ No newline at end of file diff --git a/web/protected/views/translation/view.php b/web/protected/views/translation/view.php new file mode 100644 index 0000000..17539e8 --- /dev/null +++ b/web/protected/views/translation/view.php @@ -0,0 +1,30 @@ +breadcrumbs=array( + 'Translations'=>array('index'), + $model->name, +); + +$this->menu=array( + array('label'=>'List Translation', 'url'=>array('index')), + array('label'=>'Create Translation', 'url'=>array('create')), + array('label'=>'Update Translation', 'url'=>array('update', 'id'=>$model->id)), + array('label'=>'Delete Translation', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')), + array('label'=>'Manage Translation', 'url'=>array('admin')), +); +?> + +

View Translation #id; ?>

+ +widget('zii.widgets.CDetailView', array( + 'data'=>$model, + 'attributes'=>array( + 'id', + 'name', + 'textEn', + 'textRu', + 'textZh', + ), +)); ?>