diff --git a/code/ryzom/tools/server/www/webtt/app/controllers/comments_controller.php b/code/ryzom/tools/server/www/webtt/app/controllers/comments_controller.php new file mode 100644 index 000000000..e6ddb365e --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/controllers/comments_controller.php @@ -0,0 +1,143 @@ +Comment->recursive = 0; + $this->set('comments', $this->paginate()); + } + + function view($id = null) { + if (!$id) { + $this->Session->setFlash(__('Invalid comment', true)); + $this->redirect(array('action' => 'index')); + } + $this->set('comment', $this->Comment->read(null, $id)); + } + + function add() { + if (!empty($this->data)) { + $this->Comment->create(); + if ($this->Comment->save($this->data)) { + $this->Session->setFlash(__('The comment has been saved', true)); + $this->redirect(array('action' => 'index')); + } else { + $this->Session->setFlash(__('The comment could not be saved. Please, try again.', true)); + } + } + if (empty($this->passedArgs['identifier_id'])) + { + $this->Session->setFlash(__('You need to choose identifier to comment', true)); + $this->redirect(array('controller' => 'identifiers', 'action' => 'index')); + } + else + { + $identifier_id = $this->passedArgs['identifier_id']; + $this->set('identifier', $identifier = $this->Comment->Identifier->read(null, $identifier_id)); +// $this->data['Translation.identifier_id'] = $identifier_id; + } +// $translations = $this->Comment->Translation->find('list'); + $identifiers = $this->Comment->Identifier->find('list'); + $users = $this->Comment->User->find('list'); + $this->set(compact('translations', 'identifiers', 'users')); + } + + function edit($id = null) { + if (!$id && empty($this->data)) { + $this->Session->setFlash(__('Invalid comment', true)); + $this->redirect(array('action' => 'index')); + } + if (!empty($this->data)) { + if ($this->Comment->save($this->data)) { + $this->Session->setFlash(__('The comment has been saved', true)); + $this->redirect(array('action' => 'index')); + } else { + $this->Session->setFlash(__('The comment could not be saved. Please, try again.', true)); + } + } + if (empty($this->data)) { + $this->data = $this->Comment->read(null, $id); + } + $translations = $this->Comment->Translation->find('list'); + $identifiers = $this->Comment->Identifier->find('list'); + $users = $this->Comment->User->find('list'); + $this->set(compact('translations', 'identifiers', 'users')); + } + + function delete($id = null) { + if (!$id) { + $this->Session->setFlash(__('Invalid id for comment', true)); + $this->redirect(array('action'=>'index')); + } + if ($this->Comment->delete($id)) { + $this->Session->setFlash(__('Comment deleted', true)); + $this->redirect(array('action'=>'index')); + } + $this->Session->setFlash(__('Comment was not deleted', true)); + $this->redirect(array('action' => 'index')); + } + function admin_index() { + $this->Comment->recursive = 0; + $this->set('comments', $this->paginate()); + } + + function admin_view($id = null) { + if (!$id) { + $this->Session->setFlash(__('Invalid comment', true)); + $this->redirect(array('action' => 'index')); + } + $this->set('comment', $this->Comment->read(null, $id)); + } + + function admin_add() { + if (!empty($this->data)) { + $this->Comment->create(); + if ($this->Comment->save($this->data)) { + $this->Session->setFlash(__('The comment has been saved', true)); + $this->redirect(array('action' => 'index')); + } else { + $this->Session->setFlash(__('The comment could not be saved. Please, try again.', true)); + } + } + $translations = $this->Comment->Translation->find('list'); + $identifiers = $this->Comment->Identifier->find('list'); + $users = $this->Comment->User->find('list'); + $this->set(compact('translations', 'identifiers', 'users')); + } + + function admin_edit($id = null) { + if (!$id && empty($this->data)) { + $this->Session->setFlash(__('Invalid comment', true)); + $this->redirect(array('action' => 'index')); + } + if (!empty($this->data)) { + if ($this->Comment->save($this->data)) { + $this->Session->setFlash(__('The comment has been saved', true)); + $this->redirect(array('action' => 'index')); + } else { + $this->Session->setFlash(__('The comment could not be saved. Please, try again.', true)); + } + } + if (empty($this->data)) { + $this->data = $this->Comment->read(null, $id); + } + $translations = $this->Comment->Translation->find('list'); + $identifiers = $this->Comment->Identifier->find('list'); + $users = $this->Comment->User->find('list'); + $this->set(compact('translations', 'identifiers', 'users')); + } + + function admin_delete($id = null) { + if (!$id) { + $this->Session->setFlash(__('Invalid id for comment', true)); + $this->redirect(array('action'=>'index')); + } + if ($this->Comment->delete($id)) { + $this->Session->setFlash(__('Comment deleted', true)); + $this->redirect(array('action'=>'index')); + } + $this->Session->setFlash(__('Comment was not deleted', true)); + $this->redirect(array('action' => 'index')); + } +} diff --git a/code/ryzom/tools/server/www/webtt/app/controllers/components/path_resolver.php b/code/ryzom/tools/server/www/webtt/app/controllers/components/path_resolver.php new file mode 100644 index 000000000..2fffe0f3f --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/controllers/components/path_resolver.php @@ -0,0 +1,167 @@ +belongsTo as $childModel => $junk) + { + $names[] = $this->getAssociationsTree($model->{$childModel}); + } + return array($model->alias => $names); + } + + function node_path ($node_name, $tree) { + foreach ($tree as $name => $val) { + if ($name == $node_name) return $name; + foreach ($val as $subtree) { + $ret = $this->node_path($node_name, $subtree); + if ($ret != '') return "$name => $ret"; + } + } + } + + function findModelPath_old2($name, $assocTree, $path = null) + { +// debug($name, $assocTree, $path); +// debug($name); +// debug($assocTree); +// debug($path); + foreach ($assocTree as $model => $childs) + { + if (!isset($path)) + $path = array($model => ""); + if ($model == $name) + { +// $newPath[$childModel] = $path; +// debug($childModel); + return array($model => $model); +// return $model; + } + foreach ($childs as $childModelArray => $subTree) + { +// debug(array($childModel => $newAssocTree)); +// debug_print_backtrace(); +// if ($ret = $this->findModelPath($name, $subTree, $newPath)) + if ($ret = $this->findModelPath($name, $subTree)) + { + echo "## model: "; var_dump($model); + echo "## key subTree: "; var_dump(key($subTree)); + echo "## ret:\n"; var_dump($ret); +// var_dump(array(key($subTree) => $ret)); +// return array(key($subTree) => $ret); +// return array($model => key($subTree)); +// return array($model => $ret); + return array($model => $ret); + } + } + } +// return $path; + + } + + function t($i) + { + return str_repeat("\t",$i); + } + + function getAssociationsGraph($name, $assocTree) + { + static $graph = array(); + foreach ($assocTree as $model => $childs) + { + if ($model == $name) + return true; + foreach ($childs as $childModelArray) + { + foreach ($childModelArray as $childModel => $newAssocTree) + { + if ($ret = $this->getAssociationsGraph($name, array($childModel => $newAssocTree))) + { + $graph[$childModel][] = $model; +// var_dump($graph); + } + } + } + } +// var_dump($graph); + return $graph; + } + + function findModelPath($name, $assocTree, $path = null) + { +// debug($name, $assocTree, $path); +// debug($name); +// debug($assocTree); +// debug($path); + foreach ($assocTree as $model => $childs) + { + if (!isset($path)) + $path = array($model => ""); + foreach ($childs as $childModelArray) + { + foreach ($childModelArray as $childModel => $newAssocTree) + { +// debug(array($childModel => $newAssocTree)); +// debug_print_backtrace(); + $newPath[$childModel] = $path; + if ($name == $childModel) + { +// debug($childModel); + return $newPath; + } + else + { + if ($ret = $this->findModelPath($name, array($childModel => $newAssocTree), $newPath)) + return $ret; + } + } + } + } +// return $path; + + } + + function printPath($model) + { + if (!isset($model->belongsTo)) + return null; + $assocTree = $this->getAssociationsTree($model); + $path = $this->findModelPath('Language', $assocTree); +// $path = $this->findModelPath('User', $assocTree); +// var_dump($path); +// return 0; + $text = null; + while ($path) + { + $model = key($path); +/* foreach ($path as $model => $childs) + { + $controller = Inflector::pluralize(Inflector::underscore($model)); + } + $path = $childs;*/ + $controller = Inflector::pluralize(Inflector::underscore($model)); + $path = $path[$model]; + $new_path[$controller] = $new_path; + var_dump($new_path); + $text .= " => " . $controller; + } + return $text; + } + function beforeRender($controller) + { + if (!isset($controller->{$controller->modelClass})) + return 0; + $model = $controller->{$controller->modelClass}; + if (!isset($model->belongsTo)) + return 0; + $assocTree = $this->getAssociationsTree($model); +// var_dump($assocTree); + $path = $this->findModelPath('Language', $assocTree); + if (!$path) + $path = array('Language' => array()); +// var_dump($path); + $controller->set('assocPath', $path); + + } +} +?> \ No newline at end of file diff --git a/code/ryzom/tools/server/www/webtt/app/controllers/identifier_columns_controller.php b/code/ryzom/tools/server/www/webtt/app/controllers/identifier_columns_controller.php new file mode 100644 index 000000000..19695fa20 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/controllers/identifier_columns_controller.php @@ -0,0 +1,124 @@ +IdentifierColumn->recursive = 0; + $this->set('identifierColumns', $this->paginate()); + } + + function view($id = null) { + if (!$id) { + $this->Session->setFlash(__('Invalid identifier column', true)); + $this->redirect(array('action' => 'index')); + } + $this->set('identifierColumn', $this->IdentifierColumn->read(null, $id)); + } + + function add() { + if (!empty($this->data)) { + $this->IdentifierColumn->create(); + if ($this->IdentifierColumn->save($this->data)) { + $this->Session->setFlash(__('The identifier column has been saved', true)); + $this->redirect(array('action' => 'index')); + } else { + $this->Session->setFlash(__('The identifier column could not be saved. Please, try again.', true)); + } + } + $identifiers = $this->IdentifierColumn->Identifier->find('list'); + $this->set(compact('identifiers')); + } + + function edit($id = null) { + if (!$id && empty($this->data)) { + $this->Session->setFlash(__('Invalid identifier column', true)); + $this->redirect(array('action' => 'index')); + } + if (!empty($this->data)) { + if ($this->IdentifierColumn->save($this->data)) { + $this->Session->setFlash(__('The identifier column has been saved', true)); + $this->redirect(array('action' => 'index')); + } else { + $this->Session->setFlash(__('The identifier column could not be saved. Please, try again.', true)); + } + } + if (empty($this->data)) { + $this->data = $this->IdentifierColumn->read(null, $id); + } + $identifiers = $this->IdentifierColumn->Identifier->find('list'); + $this->set(compact('identifiers')); + } + + function delete($id = null) { + if (!$id) { + $this->Session->setFlash(__('Invalid id for identifier column', true)); + $this->redirect(array('action'=>'index')); + } + if ($this->IdentifierColumn->delete($id)) { + $this->Session->setFlash(__('Identifier column deleted', true)); + $this->redirect(array('action'=>'index')); + } + $this->Session->setFlash(__('Identifier column was not deleted', true)); + $this->redirect(array('action' => 'index')); + } + function admin_index() { + $this->IdentifierColumn->recursive = 0; + $this->set('identifierColumns', $this->paginate()); + } + + function admin_view($id = null) { + if (!$id) { + $this->Session->setFlash(__('Invalid identifier column', true)); + $this->redirect(array('action' => 'index')); + } + $this->set('identifierColumn', $this->IdentifierColumn->read(null, $id)); + } + + function admin_add() { + if (!empty($this->data)) { + $this->IdentifierColumn->create(); + if ($this->IdentifierColumn->save($this->data)) { + $this->Session->setFlash(__('The identifier column has been saved', true)); + $this->redirect(array('action' => 'index')); + } else { + $this->Session->setFlash(__('The identifier column could not be saved. Please, try again.', true)); + } + } + $identifiers = $this->IdentifierColumn->Identifier->find('list'); + $this->set(compact('identifiers')); + } + + function admin_edit($id = null) { + if (!$id && empty($this->data)) { + $this->Session->setFlash(__('Invalid identifier column', true)); + $this->redirect(array('action' => 'index')); + } + if (!empty($this->data)) { + if ($this->IdentifierColumn->save($this->data)) { + $this->Session->setFlash(__('The identifier column has been saved', true)); + $this->redirect(array('action' => 'index')); + } else { + $this->Session->setFlash(__('The identifier column could not be saved. Please, try again.', true)); + } + } + if (empty($this->data)) { + $this->data = $this->IdentifierColumn->read(null, $id); + } + $identifiers = $this->IdentifierColumn->Identifier->find('list'); + $this->set(compact('identifiers')); + } + + function admin_delete($id = null) { + if (!$id) { + $this->Session->setFlash(__('Invalid id for identifier column', true)); + $this->redirect(array('action'=>'index')); + } + if ($this->IdentifierColumn->delete($id)) { + $this->Session->setFlash(__('Identifier column deleted', true)); + $this->redirect(array('action'=>'index')); + } + $this->Session->setFlash(__('Identifier column was not deleted', true)); + $this->redirect(array('action' => 'index')); + } +} diff --git a/code/ryzom/tools/server/www/webtt/app/controllers/pages_controller.php b/code/ryzom/tools/server/www/webtt/app/controllers/pages_controller.php new file mode 100644 index 000000000..e669a9113 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/controllers/pages_controller.php @@ -0,0 +1,121 @@ +redirect('/'); + } + $page = $subpage = $title_for_layout = null; + + if (!empty($path[0])) { + $page = $path[0]; + } + if (!empty($path[1])) { + $subpage = $path[1]; + } + if (!empty($path[$count - 1])) { + $title_for_layout = Inflector::humanize($path[$count - 1]); + } + $this->set(compact('page', 'subpage', 'title_for_layout')); + $this->render(implode('/', $path)); + } + + function admin_display() { + $path = func_get_args(); + +/* if (isset($this->params['admin'])) + array_shift($path);*/ +//var_dump($path); + if (!isset($path[0]) || $path[0] != 'admin') { + //This adds admin to the beginning of the path so the pages controller will look in the 'admin' folder in pages directory + $path = array_merge((array)'admin', $path); + } +// var_dump($path); + $count = count($path); + if (!$count) { + $this->redirect('/'); + } + $page = $subpage = $title_for_layout = null; + + if (!empty($path[0])) { + $page = $path[0]; + } + if (!empty($path[1])) { + $subpage = $path[1]; + } + if (!empty($path[$count - 1])) { + $title_for_layout = Inflector::humanize($path[$count - 1]); + } + $this->set(compact('page', 'subpage', 'title_for_layout')); + $this->render(implode('/', $path)); + } + + function beforeFilter() { + parent::beforeFilter(); + $this->Auth->allow(array('display')); + } +} diff --git a/code/ryzom/tools/server/www/webtt/app/controllers/translation_files_controller.php b/code/ryzom/tools/server/www/webtt/app/controllers/translation_files_controller.php new file mode 100644 index 000000000..4af5324c1 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/controllers/translation_files_controller.php @@ -0,0 +1,128 @@ +TranslationFile->recursive = 0; + + $conditions = null; + if (isset($this->passedArgs['language_id']) && $language_id = $this->passedArgs['language_id']) + $conditions = array('TranslationFile.language_id' => $language_id); + $this->set('translationFiles', $this->paginate($conditions)); + } + + function view($id = null) { + if (!$id) { + $this->Session->setFlash(__('Invalid translation file', true)); + $this->redirect(array('action' => 'index')); + } + $this->set('translationFile', $this->TranslationFile->read(null, $id)); + } + + function add() { + if (!empty($this->data)) { + $this->TranslationFile->create(); + if ($this->TranslationFile->save($this->data)) { + $this->Session->setFlash(__('The translation file has been saved', true)); + $this->redirect(array('action' => 'index')); + } else { + $this->Session->setFlash(__('The translation file could not be saved. Please, try again.', true)); + } + } + $languages = $this->TranslationFile->Language->find('list'); + $this->set(compact('languages')); + } + + function edit($id = null) { + if (!$id && empty($this->data)) { + $this->Session->setFlash(__('Invalid translation file', true)); + $this->redirect(array('action' => 'index')); + } + if (!empty($this->data)) { + if ($this->TranslationFile->save($this->data)) { + $this->Session->setFlash(__('The translation file has been saved', true)); + $this->redirect(array('action' => 'index')); + } else { + $this->Session->setFlash(__('The translation file could not be saved. Please, try again.', true)); + } + } + if (empty($this->data)) { + $this->data = $this->TranslationFile->read(null, $id); + } + $languages = $this->TranslationFile->Language->find('list'); + $this->set(compact('languages')); + } + + function delete($id = null) { + if (!$id) { + $this->Session->setFlash(__('Invalid id for translation file', true)); + $this->redirect(array('action'=>'index')); + } + if ($this->TranslationFile->delete($id)) { + $this->Session->setFlash(__('Translation file deleted', true)); + $this->redirect(array('action'=>'index')); + } + $this->Session->setFlash(__('Translation file was not deleted', true)); + $this->redirect(array('action' => 'index')); + } + function admin_index() { + $this->TranslationFile->recursive = 0; + $this->set('translationFiles', $this->paginate()); + } + + function admin_view($id = null) { + if (!$id) { + $this->Session->setFlash(__('Invalid translation file', true)); + $this->redirect(array('action' => 'index')); + } + $this->set('translationFile', $this->TranslationFile->read(null, $id)); + } + + function admin_add() { + if (!empty($this->data)) { + $this->TranslationFile->create(); + if ($this->TranslationFile->save($this->data)) { + $this->Session->setFlash(__('The translation file has been saved', true)); + $this->redirect(array('action' => 'index')); + } else { + $this->Session->setFlash(__('The translation file could not be saved. Please, try again.', true)); + } + } + $languages = $this->TranslationFile->Language->find('list'); + $this->set(compact('languages')); + } + + function admin_edit($id = null) { + if (!$id && empty($this->data)) { + $this->Session->setFlash(__('Invalid translation file', true)); + $this->redirect(array('action' => 'index')); + } + if (!empty($this->data)) { + if ($this->TranslationFile->save($this->data)) { + $this->Session->setFlash(__('The translation file has been saved', true)); + $this->redirect(array('action' => 'index')); + } else { + $this->Session->setFlash(__('The translation file could not be saved. Please, try again.', true)); + } + } + if (empty($this->data)) { + $this->data = $this->TranslationFile->read(null, $id); + } + $languages = $this->TranslationFile->Language->find('list'); + $this->set(compact('languages')); + } + + function admin_delete($id = null) { + if (!$id) { + $this->Session->setFlash(__('Invalid id for translation file', true)); + $this->redirect(array('action'=>'index')); + } + if ($this->TranslationFile->delete($id)) { + $this->Session->setFlash(__('Translation file deleted', true)); + $this->redirect(array('action'=>'index')); + } + $this->Session->setFlash(__('Translation file was not deleted', true)); + $this->redirect(array('action' => 'index')); + } +} diff --git a/code/ryzom/tools/server/www/webtt/app/models/comment.php b/code/ryzom/tools/server/www/webtt/app/models/comment.php new file mode 100644 index 000000000..f7419d50d --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/models/comment.php @@ -0,0 +1,32 @@ + "fk"); + //The Associations below have been created with all possible keys, those that are not needed can be removed + + var $belongsTo = array( +/* 'Translation' => array( + 'className' => 'Translation', + 'foreignKey' => 'translation_id', + 'conditions' => '', + 'fields' => '', + 'order' => '' + ),*/ + 'Identifier' => array( + 'className' => 'Identifier', + 'foreignKey' => 'identifier_id', + 'conditions' => '', + 'fields' => '', + 'order' => '' + ), + 'User' => array( + 'className' => 'User', + 'foreignKey' => 'user_id', + 'conditions' => '', + 'fields' => '', + 'order' => '' + ) + ); +} diff --git a/code/ryzom/tools/server/www/webtt/app/models/identifier_column.php b/code/ryzom/tools/server/www/webtt/app/models/identifier_column.php new file mode 100644 index 000000000..c6770212b --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/models/identifier_column.php @@ -0,0 +1,35 @@ + array( + 'className' => 'Identifier', + 'foreignKey' => 'identifier_id', + 'conditions' => '', + 'fields' => '', + 'order' => '' + ) + ); + + var $hasMany = array( + 'Translation' => array( + 'className' => 'Translation', + 'foreignKey' => 'identifier_column_id', + 'dependent' => true, + 'conditions' => '', + 'fields' => '', + 'order' => '', + 'limit' => '', + 'offset' => '', + 'exclusive' => '', + 'finderQuery' => '', + 'counterQuery' => '' + ), + ); +} diff --git a/code/ryzom/tools/server/www/webtt/app/models/translation_file.php b/code/ryzom/tools/server/www/webtt/app/models/translation_file.php new file mode 100644 index 000000000..d972e88ac --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/models/translation_file.php @@ -0,0 +1,49 @@ + array( + 'className' => 'Language', + 'foreignKey' => 'language_id', + 'conditions' => '', + 'fields' => '', + 'order' => '' + ) + ); + + var $hasMany = array( + 'ImportedTranslationFile' => array( + 'className' => 'ImportedTranslationFile', + 'foreignKey' => 'translation_file_id', + 'dependent' => false, + 'conditions' => '', + 'fields' => '', + 'order' => '', + 'limit' => '', + 'offset' => '', + 'exclusive' => '', + 'finderQuery' => '', + 'counterQuery' => '' + ), + 'Identifier' => array( + 'className' => 'Identifier', + 'foreignKey' => 'translation_file_id', + 'dependent' => true, + 'conditions' => '', + 'fields' => '', + 'order' => '', + 'limit' => '', + 'offset' => '', + 'exclusive' => '', + 'finderQuery' => '', + 'counterQuery' => '' + ), + ); + +} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/file_identifiers_controller.test.php b/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/file_identifiers_controller.test.php deleted file mode 100644 index 0c7298f47..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/file_identifiers_controller.test.php +++ /dev/null @@ -1,66 +0,0 @@ -redirectUrl = $url; - } -} - -class FileIdentifiersControllerTestCase extends CakeTestCase { - var $fixtures = array('app.file_identifier', 'app.translation_file', 'app.language', 'app.identifier', 'app.translation', 'app.user', 'app.vote'); - - function startTest() { - $this->FileIdentifiers =& new TestFileIdentifiersController(); - $this->FileIdentifiers->constructClasses(); - } - - function endTest() { - unset($this->FileIdentifiers); - ClassRegistry::flush(); - } - - function testIndex() { - - } - - function testView() { - - } - - function testAdd() { - - } - - function testEdit() { - - } - - function testDelete() { - - } - - function testAdminIndex() { - - } - - function testAdminView() { - - } - - function testAdminAdd() { - - } - - function testAdminEdit() { - - } - - function testAdminDelete() { - - } - -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/identifiers_controller.test.php b/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/identifiers_controller.test.php deleted file mode 100644 index 72e3d7346..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/identifiers_controller.test.php +++ /dev/null @@ -1,66 +0,0 @@ -redirectUrl = $url; - } -} - -class IdentifiersControllerTestCase extends CakeTestCase { - var $fixtures = array('app.identifier', 'app.language', 'app.translation_file', 'app.file_identifier', 'app.translation', 'app.user', 'app.vote'); - - function startTest() { - $this->Identifiers =& new TestIdentifiersController(); - $this->Identifiers->constructClasses(); - } - - function endTest() { - unset($this->Identifiers); - ClassRegistry::flush(); - } - - function testIndex() { - - } - - function testView() { - - } - - function testAdd() { - - } - - function testEdit() { - - } - - function testDelete() { - - } - - function testAdminIndex() { - - } - - function testAdminView() { - - } - - function testAdminAdd() { - - } - - function testAdminEdit() { - - } - - function testAdminDelete() { - - } - -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/languages_controller.test.php b/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/languages_controller.test.php deleted file mode 100644 index 1cc5063e8..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/languages_controller.test.php +++ /dev/null @@ -1,66 +0,0 @@ -redirectUrl = $url; - } -} - -class LanguagesControllerTestCase extends CakeTestCase { - var $fixtures = array('app.language', 'app.identifier', 'app.translation', 'app.user', 'app.vote', 'app.translation_file'); - - function startTest() { - $this->Languages =& new TestLanguagesController(); - $this->Languages->constructClasses(); - } - - function endTest() { - unset($this->Languages); - ClassRegistry::flush(); - } - - function testIndex() { - - } - - function testView() { - - } - - function testAdd() { - - } - - function testEdit() { - - } - - function testDelete() { - - } - - function testAdminIndex() { - - } - - function testAdminView() { - - } - - function testAdminAdd() { - - } - - function testAdminEdit() { - - } - - function testAdminDelete() { - - } - -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/translation_files_controller.test.php b/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/translation_files_controller.test.php deleted file mode 100644 index 19f94096d..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/translation_files_controller.test.php +++ /dev/null @@ -1,66 +0,0 @@ -redirectUrl = $url; - } -} - -class TranslationFilesControllerTestCase extends CakeTestCase { - var $fixtures = array('app.translation_file', 'app.language', 'app.identifier', 'app.translation', 'app.user', 'app.vote', 'app.comment', 'app.file_identifier', 'app.imported_translation_file', 'app.raw_file'); - - function startTest() { - $this->TranslationFiles =& new TestTranslationFilesController(); - $this->TranslationFiles->constructClasses(); - } - - function endTest() { - unset($this->TranslationFiles); - ClassRegistry::flush(); - } - - function testIndex() { - - } - - function testView() { - - } - - function testAdd() { - - } - - function testEdit() { - - } - - function testDelete() { - - } - - function testAdminIndex() { - - } - - function testAdminView() { - - } - - function testAdminAdd() { - - } - - function testAdminEdit() { - - } - - function testAdminDelete() { - - } - -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/translations_controller.test.php b/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/translations_controller.test.php deleted file mode 100644 index aaeb1ec5a..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/translations_controller.test.php +++ /dev/null @@ -1,66 +0,0 @@ -redirectUrl = $url; - } -} - -class TranslationsControllerTestCase extends CakeTestCase { - var $fixtures = array('app.translation', 'app.identifier', 'app.translation_file', 'app.language', 'app.user', 'app.vote'); - - function startTest() { - $this->Translations =& new TestTranslationsController(); - $this->Translations->constructClasses(); - } - - function endTest() { - unset($this->Translations); - ClassRegistry::flush(); - } - - function testIndex() { - - } - - function testView() { - - } - - function testAdd() { - - } - - function testEdit() { - - } - - function testDelete() { - - } - - function testAdminIndex() { - - } - - function testAdminView() { - - } - - function testAdminAdd() { - - } - - function testAdminEdit() { - - } - - function testAdminDelete() { - - } - -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/users_controller.test.php b/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/users_controller.test.php deleted file mode 100644 index 3e9700388..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/users_controller.test.php +++ /dev/null @@ -1,66 +0,0 @@ -redirectUrl = $url; - } -} - -class UsersControllerTestCase extends CakeTestCase { - var $fixtures = array('app.user', 'app.translation', 'app.identifier', 'app.translation_file', 'app.language', 'app.vote'); - - function startTest() { - $this->Users =& new TestUsersController(); - $this->Users->constructClasses(); - } - - function endTest() { - unset($this->Users); - ClassRegistry::flush(); - } - - function testIndex() { - - } - - function testView() { - - } - - function testAdd() { - - } - - function testEdit() { - - } - - function testDelete() { - - } - - function testAdminIndex() { - - } - - function testAdminView() { - - } - - function testAdminAdd() { - - } - - function testAdminEdit() { - - } - - function testAdminDelete() { - - } - -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/votes_controller.test.php b/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/votes_controller.test.php deleted file mode 100644 index 027661fb2..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/cases/controllers/votes_controller.test.php +++ /dev/null @@ -1,66 +0,0 @@ -redirectUrl = $url; - } -} - -class VotesControllerTestCase extends CakeTestCase { - var $fixtures = array('app.vote', 'app.translation', 'app.identifier', 'app.translation_file', 'app.language', 'app.user'); - - function startTest() { - $this->Votes =& new TestVotesController(); - $this->Votes->constructClasses(); - } - - function endTest() { - unset($this->Votes); - ClassRegistry::flush(); - } - - function testIndex() { - - } - - function testView() { - - } - - function testAdd() { - - } - - function testEdit() { - - } - - function testDelete() { - - } - - function testAdminIndex() { - - } - - function testAdminView() { - - } - - function testAdminAdd() { - - } - - function testAdminEdit() { - - } - - function testAdminDelete() { - - } - -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/cases/models/file_identifier.test.php b/code/ryzom/tools/server/www/webtt/app/tests/cases/models/file_identifier.test.php deleted file mode 100644 index 0b6374de0..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/cases/models/file_identifier.test.php +++ /dev/null @@ -1,17 +0,0 @@ -FileIdentifier =& ClassRegistry::init('FileIdentifier'); - } - - function endTest() { - unset($this->FileIdentifier); - ClassRegistry::flush(); - } - -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/cases/models/identifier.test.php b/code/ryzom/tools/server/www/webtt/app/tests/cases/models/identifier.test.php deleted file mode 100644 index 45d94d4a8..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/cases/models/identifier.test.php +++ /dev/null @@ -1,17 +0,0 @@ -Identifier =& ClassRegistry::init('Identifier'); - } - - function endTest() { - unset($this->Identifier); - ClassRegistry::flush(); - } - -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/cases/models/language.test.php b/code/ryzom/tools/server/www/webtt/app/tests/cases/models/language.test.php deleted file mode 100644 index e4d2251aa..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/cases/models/language.test.php +++ /dev/null @@ -1,17 +0,0 @@ -Language =& ClassRegistry::init('Language'); - } - - function endTest() { - unset($this->Language); - ClassRegistry::flush(); - } - -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/cases/models/translation.test.php b/code/ryzom/tools/server/www/webtt/app/tests/cases/models/translation.test.php deleted file mode 100644 index 534258df9..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/cases/models/translation.test.php +++ /dev/null @@ -1,17 +0,0 @@ -Translation =& ClassRegistry::init('Translation'); - } - - function endTest() { - unset($this->Translation); - ClassRegistry::flush(); - } - -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/cases/models/translation_file.test.php b/code/ryzom/tools/server/www/webtt/app/tests/cases/models/translation_file.test.php deleted file mode 100644 index cb5d08ecd..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/cases/models/translation_file.test.php +++ /dev/null @@ -1,17 +0,0 @@ -TranslationFile =& ClassRegistry::init('TranslationFile'); - } - - function endTest() { - unset($this->TranslationFile); - ClassRegistry::flush(); - } - -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/cases/models/user.test.php b/code/ryzom/tools/server/www/webtt/app/tests/cases/models/user.test.php deleted file mode 100644 index 36660249d..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/cases/models/user.test.php +++ /dev/null @@ -1,17 +0,0 @@ -User =& ClassRegistry::init('User'); - } - - function endTest() { - unset($this->User); - ClassRegistry::flush(); - } - -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/cases/models/vote.test.php b/code/ryzom/tools/server/www/webtt/app/tests/cases/models/vote.test.php deleted file mode 100644 index 0c42bc5ec..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/cases/models/vote.test.php +++ /dev/null @@ -1,17 +0,0 @@ -Vote =& ClassRegistry::init('Vote'); - } - - function endTest() { - unset($this->Vote); - ClassRegistry::flush(); - } - -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/fixtures/file_identifier_fixture.php b/code/ryzom/tools/server/www/webtt/app/tests/fixtures/file_identifier_fixture.php deleted file mode 100644 index 6fca71e96..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/fixtures/file_identifier_fixture.php +++ /dev/null @@ -1,31 +0,0 @@ - array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), - 'translation_file_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10), - 'command' => array('type' => 'string', 'null' => true, 'default' => NULL, 'length' => 50, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), - 'translation_index' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10), - 'identifier_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10), - 'reference_string' => array('type' => 'text', 'null' => true, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), - 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), - 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), - 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)), - 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') - ); - - var $records = array( - array( - 'id' => 1, - 'translation_file_id' => 1, - 'command' => 'Lorem ipsum dolor sit amet', - 'translation_index' => 1, - 'identifier_id' => 1, - 'reference_string' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.', - 'created' => '2011-05-31 16:07:59', - 'modified' => '2011-05-31 16:07:59' - ), - ); -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/fixtures/identifier_fixture.php b/code/ryzom/tools/server/www/webtt/app/tests/fixtures/identifier_fixture.php deleted file mode 100644 index 156047ae6..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/fixtures/identifier_fixture.php +++ /dev/null @@ -1,31 +0,0 @@ - array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), - 'translation_file_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10), - 'translation_index' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10), - 'identifier' => array('type' => 'string', 'null' => true, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), - 'reference_string' => array('type' => 'text', 'null' => true, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), - 'translated' => array('type' => 'boolean', 'null' => true, 'default' => '0'), - 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), - 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), - 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)), - 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') - ); - - var $records = array( - array( - 'id' => 1, - 'translation_file_id' => 1, - 'translation_index' => 1, - 'identifier' => 'Lorem ipsum dolor sit amet', - 'reference_string' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.', - 'translated' => 1, - 'created' => '2011-05-29 19:17:37', - 'modified' => '2011-05-29 19:17:37' - ), - ); -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/fixtures/language_fixture.php b/code/ryzom/tools/server/www/webtt/app/tests/fixtures/language_fixture.php deleted file mode 100644 index 91fe7fb76..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/fixtures/language_fixture.php +++ /dev/null @@ -1,25 +0,0 @@ - array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), - 'name' => array('type' => 'string', 'null' => true, 'default' => NULL, 'length' => 50, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), - 'code' => array('type' => 'string', 'null' => true, 'default' => NULL, 'length' => 10, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), - 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), - 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), - 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)), - 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') - ); - - var $records = array( - array( - 'id' => 1, - 'name' => 'Lorem ipsum dolor sit amet', - 'code' => 'Lorem ip', - 'created' => '2011-05-31 15:48:42', - 'modified' => '2011-05-31 15:48:42' - ), - ); -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/fixtures/translation_file_fixture.php b/code/ryzom/tools/server/www/webtt/app/tests/fixtures/translation_file_fixture.php deleted file mode 100644 index bd562dbd4..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/fixtures/translation_file_fixture.php +++ /dev/null @@ -1,25 +0,0 @@ - array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), - 'language_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10), - 'filename_template' => array('type' => 'string', 'null' => true, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), - 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), - 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), - 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)), - 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') - ); - - var $records = array( - array( - 'id' => 1, - 'language_id' => 1, - 'filename_template' => 'Lorem ipsum dolor sit amet', - 'created' => '2011-07-04 13:04:11', - 'modified' => '2011-07-04 13:04:11' - ), - ); -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/fixtures/translation_fixture.php b/code/ryzom/tools/server/www/webtt/app/tests/fixtures/translation_fixture.php deleted file mode 100644 index fbe4bdaca..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/fixtures/translation_fixture.php +++ /dev/null @@ -1,27 +0,0 @@ - array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), - 'identifier_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10), - 'translation_text' => array('type' => 'text', 'null' => true, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), - 'user_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10), - 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), - 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), - 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)), - 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') - ); - - var $records = array( - array( - 'id' => 1, - 'identifier_id' => 1, - 'translation_text' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.', - 'user_id' => 1, - 'created' => '2011-05-29 19:19:41', - 'modified' => '2011-05-29 19:19:41' - ), - ); -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/fixtures/user_fixture.php b/code/ryzom/tools/server/www/webtt/app/tests/fixtures/user_fixture.php deleted file mode 100644 index 5e0adfb2d..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/fixtures/user_fixture.php +++ /dev/null @@ -1,23 +0,0 @@ - array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), - 'name' => array('type' => 'string', 'null' => true, 'default' => NULL, 'length' => 100, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), - 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), - 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), - 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)), - 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') - ); - - var $records = array( - array( - 'id' => 1, - 'name' => 'Lorem ipsum dolor sit amet', - 'created' => '2011-05-29 19:20:07', - 'modified' => '2011-05-29 19:20:07' - ), - ); -} diff --git a/code/ryzom/tools/server/www/webtt/app/tests/fixtures/vote_fixture.php b/code/ryzom/tools/server/www/webtt/app/tests/fixtures/vote_fixture.php deleted file mode 100644 index cbe5389d6..000000000 --- a/code/ryzom/tools/server/www/webtt/app/tests/fixtures/vote_fixture.php +++ /dev/null @@ -1,25 +0,0 @@ - array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), - 'translation_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10), - 'user_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10), - 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), - 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL), - 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)), - 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM') - ); - - var $records = array( - array( - 'id' => 1, - 'translation_id' => 1, - 'user_id' => 1, - 'created' => '2011-05-29 21:11:49', - 'modified' => '2011-05-29 21:11:49' - ), - ); -} diff --git a/code/ryzom/tools/server/www/webtt/app/tmp/cache/views/empty b/code/ryzom/tools/server/www/webtt/app/tmp/cache/views/empty new file mode 100755 index 000000000..e69de29bb diff --git a/code/ryzom/tools/server/www/webtt/app/tmp/logs/empty b/code/ryzom/tools/server/www/webtt/app/tmp/logs/empty new file mode 100755 index 000000000..e69de29bb diff --git a/code/ryzom/tools/server/www/webtt/app/vendors/PhraseParser.php b/code/ryzom/tools/server/www/webtt/app/vendors/PhraseParser.php new file mode 100644 index 000000000..4e63870dd --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/vendors/PhraseParser.php @@ -0,0 +1,288 @@ +################################\n"; + var_dump($str); + var_dump($arr); + echo "\n";*/ + return $arr; + } + + function addEnt(&$parsedEnt, &$entities, &$newEnt) + { + if ($this->debug) + { + echo "\t%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n"; + echo "\t%%%% newEnt %%%%%%%%% newEnt %%%%%%%%% newEnt %%%%%%%%% newEnt %%%%%\n"; + echo "\t%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n"; + var_dump($parsedEnt); + } + if (!isset($parsedEnt["diff"]) && !isset($parsedEnt["index"])) + $parsedEnt["index"] = $parsedEnt["internal_index"]; + + $parsedEnt["type"] = "phrase"; + $entities[] = $parsedEnt; + $parsedEnt =array(); + $newEnt = false; + } + + function parseFile($file) + { + $parsedEnt = array(); + $newEnt = false; + $prevStringLine = false; + $entities = array(); + + $file = $this->removeBOM($file); +// var_dump($file); + $file = $this->removeComments($file); +// var_dump($file); + $lines = explode("\n", $file); + if ($this->debug) + { + echo "
\n\n";
+		}
+		$line_no=1;
+		foreach ($lines as $line)
+		{
+			if ($this->debug)
+			{
+				echo "\n\t#################### LINE NUMBER " . $line_no++ . "\n\n";
+				var_dump($line);
+			}
+
+			$line = rtrim($line, "\r\n");
+			$parsedLine = $this->parseLine($line);
+
+			if ($this->debug)
+			{
+				echo "%%%% parsedLine\n";
+				var_dump($parsedLine);
+				echo "\n";
+			
+				echo "%%%% prevStringLine\n";
+				var_dump($prevStringLine);
+				echo "\n";
+			}
+
+			if (!$parsedLine)
+				continue;
+
+			// if line start with diff (diff files) or hash_value (translated files) and before was line with translation, then we start new ent
+
+			if ($prevStringLine && (
+					($parsedLine["type"] == "diff" && $parsedEnt) || ($parsedLine["type"] == "hash_value" && $parsedEnt)
+				))
+			{
+/*				echo "%%%% prevStringLine %%%%%\n";
+				var_dump($parsedEnt);*/
+				$newEnt = true;
+			}
+
+			if ($newEnt)
+			{
+				$this->addEnt($parsedEnt, $entities, $newEnt);
+			}
+
+			if ($parsedLine["type"] == "internal_index")
+					$parsedEnt["internal_index"] = $parsedLine["index"];
+
+			if ($parsedLine["type"] == "string")
+			{
+				$prevStringLine = true;
+
+				if ($parsedLine["body"] == "begin" || $parsedLine["body"] == "end")
+					continue;
+
+				if ($this->debug)			
+				{
+					echo "%%%% parsedEnt before %%%%%\n";
+					var_dump($parsedEnt);
+
+//					echo "%%%% parsedLine %%%%%\n";
+//					var_dump($parsedLine);
+				}
+
+				if (!$parsedLine['identifier'])
+				{
+					if ($this->debug) echo "%%%% parsedEnt ZLACZENIE \n";
+					if ($this->debug && !isset($parsedEnt['string']))
+					{
+						echo "!isset parsedEnt['string']\n";
+						var_dump($line);
+						var_dump($parsedEnt);
+						var_dump($parsedLine);
+					}
+					$parsedEnt['string'] .= $parsedLine['string'] . "\n";
+				}
+				else
+				{
+					if ($this->debug) echo "DODANIE \n";
+					$parsedEnt += $parsedLine;
+//					$parsedEnt['string'] .= "\n";
+				}
+
+				if ($this->debug)			
+				{
+					echo "%%%% parsedEnt after %%%%%\n";
+					var_dump($parsedEnt);
+				}
+			}
+			else
+				$prevStringLine = false;
+
+			if ($parsedLine["type"] == "diff")
+			{
+				$parsedEnt["diff"] = $parsedEnt["command"] = $parsedLine["command"];
+				$parsedEnt["index"] = $parsedLine["index"];
+			}
+		}
+		if ($parsedEnt)
+		{
+			$this->addEnt($parsedEnt, $entities, $newEnt);
+		}
+
+		if ($this->debug)			
+		{
+			echo "
";
+			var_dump($entities);
+			echo "
\n"; + } + return $entities; + } + + function CRLF($s) + { + $s = str_replace("\r\n", "\n", $s); + $s = str_replace("\n", "\r\n", $s); + return $s; + } + + function buildFile($entities) + { + $content = '// DIFF_VERSION 2' . "\n"; + foreach ($entities as $ent) + { + if (isset($ent['command'])) + $content .= '// ' . $ent['command'] . "\n"; + if (isset($ent['hash_value'])) + $content .= '// HASH_VALUE ' . $ent['hash_value']; +/* if (isset($ent['command'])) + $content .= '// INDEX ' . $ent['internal_index'] . "\n"; + else + $content .= '// INDEX ' . $ent['index'] . "\n";*/ + $content .= $ent['identifier'] . ' (' . $ent['arguments'] . ')' . "\n" . '{' . "\n" . $ent['string'] . "\n" . '}' . "\n"; + $content .= "\n"; + } + return $this->addBOM($this->CRLF($content)); + } +} +?> \ No newline at end of file diff --git a/code/ryzom/tools/server/www/webtt/app/vendors/SheetParser.php b/code/ryzom/tools/server/www/webtt/app/vendors/SheetParser.php new file mode 100644 index 000000000..6e1105401 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/vendors/SheetParser.php @@ -0,0 +1,183 @@ +removeBOM($file); +// $file = $this->removeComments($file); + $lines = explode("\n", $file); + if ($this->debug) + { + echo "
\n\n";
+		}
+		$line_no=1;
+		foreach ($lines as $line)
+		{
+			if ($this->debug)
+			{
+				echo "\n\t#################### LINE NUMBER " . $line_no . "\n\n";
+			}
+
+//			var_dump($line);
+			$line = rtrim($line,"\r\n");
+
+/*			var_dump(setlocale(LC_ALL,NULL));
+			var_dump(setlocale(LC_ALL,'pl_PL.UTF-8'));*/
+			// Need to set UTF-8 locale to get str_getcsv to work with UTF-8 cyryllic
+			setlocale(LC_ALL,'pl_PL.UTF-8')
+
+			$parsedLine = $this->parseLine($line);
+
+			if (!$line || mb_strpos($line, "DIFF NOT") === 0 || mb_strpos($line, "REMOVE THE") === 0)
+				continue;
+
+			if ($line_no == 1)
+			{
+				$parsedEnt["type"] = "sheet_description";
+				if ($parsedLine[0] == "DIFF_CMD")
+					$diffFile = true;
+				$parsedEnt["sheet_id_column"] = $parsedLine[2];
+			}
+			else
+			{
+				if ($diffFile)
+				{
+					$parsedEnt["diff"] = $parsedEnt["command"] = rtrim($parsedLine[0]);
+					$parsedEnt["hash_value"] = $parsedLine[1];
+					$parsedEnt["identifier"] = $parsedLine[2];
+				}
+				else
+				{
+					$parsedEnt["hash_value"] = $parsedLine[0];
+					$parsedEnt["identifier"] = $parsedLine[1];
+				}
+				$parsedEnt["type"] = "sheet";
+			}
+
+			if ($diffFile)
+				$columns = array_slice($parsedLine, 3);
+			else
+				$columns = array_slice($parsedLine, 2);
+
+			if (!isset($columnsCount))
+				$columnsCount = count($columns);
+
+			$parsedEnt["columns"] = $columns;
+
+			if ($this->debug)
+			{
+				echo "%%%% parsedEnt %%%%%\n";
+				var_dump($parsedEnt);
+			}
+
+/*			if ($parsedLine["type"] == "internal_index")
+					$parsedEnt["internal_index"] = $parsedLine["index"];
+
+			if ($parsedLine["type"] == "diff")
+			{
+				$parsedEnt["diff"] = $parsedLine["command"];
+				$parsedEnt["index"] = $parsedLine["index"];
+			}*/
+
+			$newEnt = true;
+
+			if ($newEnt)
+			{
+				if ($this->debug && 0)
+				{
+					echo "\t%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n";
+					echo "\t%%%% newEnt %%%%%%%%% newEnt %%%%%%%%% newEnt %%%%%%%%% newEnt %%%%%\n";
+					echo "\t%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n";
+					var_dump($parsedEnt);
+				}
+/*				if (!isset($parsedEnt["diff"]) && !isset($parsedEnt["index"]))
+					$parsedEnt["index"] = $parsedEnt["internal_index"];*/
+
+				$entities[] = $parsedEnt;
+				$parsedEnt =array();
+				$newEnt = false;
+			}
+			$line_no++;
+		}
+
+		if ($this->debug && 0)
+		{
+			echo "
";
+			var_dump($entities);
+			echo "
\n"; + } + return $entities; + } + + function CRLF($s) + { + $s = str_replace("\r\n", "\n", $s); + $s = str_replace("\n", "\r\n", $s); + return $s; + } + + function addBOM($str) + { + if(($bom = substr($str, 0,3)) != pack("CCC",0xef,0xbb,0xbf)) + return pack("CCC",0xef,0xbb,0xbf) . $str; + else + return $str; + } + + function buildFile($entities) + { + $content = ''; + foreach ($entities as $ent) + { + if ($ent['type'] == 'sheet_description') + { + $_columns = $ent['columns']; + $_sheet_id_column = $ent['sheet_id_column']; + + if (isset($ent['diff'])) + { + $content .= 'DIFF_CMD' . "\t" . '*HASH_VALUE' . "\t" . $_sheet_id_column . "\t"; + foreach ($ent['columns'] as $value) + { + $content .= $value . "\t"; + } + $content = mb_substr($content, 0, -1); + $content .= "\n"; + } + continue; + } + + if (isset($ent['command'])) + $content .= $ent['command'] . "\t"; + if (isset($ent['hash_value'])) + $content .= $ent['hash_value'] . "\t"; + else + $content .= '_0000000000000000' . "\t"; + $content .= $ent['identifier'] . "\t"; + foreach ($ent['columns'] as $value) + { + $content .= $value . "\t"; + } + $content = mb_substr($content, 0, -1); + $content .= "\n"; + } + return mb_convert_encoding($this->addBOM($this->CRLF($content)), 'UTF-16LE', 'UTF-8'); +// return mb_convert_encoding($this->CRLF($content), 'UTF-16LE', 'UTF-8'); + } +} +?> \ No newline at end of file diff --git a/code/ryzom/tools/server/www/webtt/app/vendors/UxtParser.php b/code/ryzom/tools/server/www/webtt/app/vendors/StringParser.php similarity index 84% rename from code/ryzom/tools/server/www/webtt/app/vendors/UxtParser.php rename to code/ryzom/tools/server/www/webtt/app/vendors/StringParser.php index 520801069..e559c0ba6 100644 --- a/code/ryzom/tools/server/www/webtt/app/vendors/UxtParser.php +++ b/code/ryzom/tools/server/www/webtt/app/vendors/StringParser.php @@ -1,5 +1,5 @@ parseLine($line); if ($this->debug) @@ -231,7 +244,7 @@ class UxtParser if ($parsedLine["type"] == "diff") { - $parsedEnt["diff"] = $parsedLine["command"]; + $parsedEnt["diff"] = $parsedEnt["command"] = $parsedLine["command"]; $parsedEnt["index"] = $parsedLine["index"]; } } @@ -251,5 +264,33 @@ class UxtParser } return $entities; } + + function CRLF($s) + { + $s = str_replace("\r\n", "\n", $s); + $s = str_replace("\n", "\r\n", $s); + return $s; + } + + + function buildFile($entities) + { + $content = ''; + foreach ($entities as $ent) + { + if (isset($ent['command'])) + $content .= '// ' . $ent['command'] . "\n"; + if (isset($ent['hash_value'])) + $content .= '// HASH_VALUE ' . $ent['hash_value']; +/* if (isset($ent['command'])) + $content .= '// INDEX ' . $ent['internal_index'] . "\n"; + else*/ + if (!isset($ent['command'])) + $content .= '// INDEX ' . $ent['index'] . "\n"; + $content .= $ent['identifier'] . "\t" . '[' . $ent['string'] . ']' . "\n"; + $content .= "\n"; + } + return $this->addBOM($this->CRLF($content)); + } } ?> \ No newline at end of file diff --git a/code/ryzom/tools/server/www/webtt/app/vendors/shells/templates/webtt/views/form.ctp b/code/ryzom/tools/server/www/webtt/app/vendors/shells/templates/webtt/views/form.ctp new file mode 100644 index 000000000..58b63a389 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/vendors/shells/templates/webtt/views/form.ctp @@ -0,0 +1,106 @@ + +
+ +
+ +
+

";?>

+ +
+ Form->create('{$modelClass}');?>\n";?> +
+ + Form->value('{$modelClass}.{$primaryKey}')); ?>";?> + + ";?> + + Form->input('{$field}');\n"; + } + } + if (!empty($associations['hasAndBelongsToMany'])) { + foreach ($associations['hasAndBelongsToMany'] as $assocName => $assocData) { + echo "\t\techo \$this->Form->input('{$assocName}');\n"; + } + } + echo "\t?>\n"; + ?> +
+ \n"; + echo "Form->end(__('Submit', true));?>\n"; + echo "
"; + ?> +
+ + +
diff --git a/code/ryzom/tools/server/www/webtt/app/vendors/shells/templates/webtt/views/home.ctp b/code/ryzom/tools/server/www/webtt/app/vendors/shells/templates/webtt/views/home.ctp new file mode 100644 index 000000000..329f684c8 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/vendors/shells/templates/webtt/views/home.ctp @@ -0,0 +1,112 @@ + +
+ +Sweet, \"" . Inflector::humanize($app) . "\" got Baked by CakePHP!\n"; +$output .=" + 0): + Debugger::checkSecurityKeys(); +endif; +?> +

+'; + __('Your tmp directory is writable.'); + echo ''; + else: + echo ''; + __('Your tmp directory is NOT writable.'); + echo ''; + endif; +?> +

+

+'; + printf(__('The %s is being used for caching. To change the config edit APP/config/core.php ', true), ''. \$settings['engine'] . 'Engine'); + echo ''; + else: + echo ''; + __('Your cache is NOT working. Please check the settings in APP/config/core.php'); + echo ''; + endif; +?> +

+

+'; + __('Your database configuration file is present.'); + \$filePresent = true; + echo ''; + else: + echo ''; + __('Your database configuration file is NOT present.'); + echo '
'; + __('Rename config/database.php.default to config/database.php'); + echo '
'; + endif; +?> +

+getDataSource('default'); +?> +

+isConnected()): + echo ''; + __('Cake is able to connect to the database.'); + echo ''; + else: + echo ''; + __('Cake is NOT able to connect to the database.'); + echo ''; + endif; +?> +

\n"; +$output .= "\n"; +$output .= "

\n"; +$output .= "

\n"; +$output .= "', APP . 'views' . DS . 'layouts' . DS . 'default.ctp.
', APP . 'webroot' . DS . 'css');\n"; +$output .= "?>\n"; +$output .= "

\n"; +?> + +
+
diff --git a/code/ryzom/tools/server/www/webtt/app/vendors/shells/templates/webtt/views/index.ctp b/code/ryzom/tools/server/www/webtt/app/vendors/shells/templates/webtt/views/index.ctp new file mode 100644 index 000000000..ef7d789d3 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/vendors/shells/templates/webtt/views/index.ctp @@ -0,0 +1,132 @@ + +
+ +
+ +
+

";?>

+ tableHeaders(array("; + + foreach($fields as $field) { + echo "\$paginator->sort('{$field}'),"; + } + echo "__('Actions', true),"; + echo "));\n"; + echo "\t\techo ''.\$tableHeaders.''; ?>\n\n"; + + //// TABLE ROWS + echo "\t\t\n"; + echo "\t>\n"; + foreach ($fields as $field) { + $isKey = false; + if (!empty($associations['belongsTo'])) { + foreach ($associations['belongsTo'] as $alias => $details) { + if ($field === $details['foreignKey'] && $field !== $primaryKey) { + $isKey = true; + echo "\t\t\n"; + break; + } + } + } + if ($isKey !== true) { + echo "\t\t\n"; + } + } + + echo "\t\t\n"; + echo "\t\n"; + + echo "\t\n"; + //// TABLE FOOTER + echo "\t'.\$tableHeaders.''; ?>\n"; + ?> +
\n\t\t\tHtml->link(\${$singularVar}['{$alias}']['{$details['displayField']}'], array('controller' => '{$details['controller']}', 'action' => 'view', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?>\n\t\t\n"; + if (empty($scaffoldForbiddenActions) || (!empty($scaffoldForbiddenActions) && !in_array($scaffoldPrefix . "view", $scaffoldForbiddenActions))) + echo "\t\t\tHtml->link(__('View', true), array('action' => 'view', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n"; + if (empty($scaffoldForbiddenActions) || (!empty($scaffoldForbiddenActions) && !in_array($scaffoldPrefix . "edit", $scaffoldForbiddenActions))) + echo "\t\t\tHtml->link(__('Edit', true), array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n"; + if (empty($scaffoldForbiddenActions) || (!empty($scaffoldForbiddenActions) && !in_array($scaffoldPrefix . "delete", $scaffoldForbiddenActions))) + echo "\t\t\tHtml->link(__('Delete', true), array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), null, sprintf(__('Are you sure you want to delete # %s?', true), \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n"; + echo "\t\t
+ + + +

+ Paginator->counter(array( + 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true) + )); + ?>";?> +

+ +
+ Paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>\n";?> + | Paginator->numbers();?>"?> | + Paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>\n";?> +
+
+
diff --git a/code/ryzom/tools/server/www/webtt/app/vendors/shells/templates/webtt/views/view.ctp b/code/ryzom/tools/server/www/webtt/app/vendors/shells/templates/webtt/views/view.ctp new file mode 100644 index 000000000..210258397 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/vendors/shells/templates/webtt/views/view.ctp @@ -0,0 +1,229 @@ + +
+ +
+ +
+ +
+
+

";?>

+
+
+ \n";?> + $details) { + if ($field === $details['foreignKey'] && $field !== $primaryKey) { + $isKey = true; + echo "\t\t\t\t
\">
\n"; + echo "\t\t\t\t
\">\n\t\t\t\t\tHtml->link(\${$singularVar}['{$alias}']['{$details['displayField']}'], array('controller' => '{$details['controller']}', 'action' => 'view', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?>\n\t\t\t\t
\n"; + break; + } + } + } + if ($isKey !== true) { + echo "\t\t\t\t
\">
\n"; + echo "\t\t\t\t
\">\n\t\t\t\t\t\n\t\t\t\t
\n"; + } + echo "\t\t\t\t\n"; + echo "\t\t\t\t
\n\n"; + } + ?> +
+
+
+
+ + +
+

+ "; ?> +

+ $details): + if (empty($details['scaffoldForbiddenActions']) || (!empty($details['scaffoldForbiddenActions']) && !in_array($scaffoldPrefix . "index", $details['scaffoldForbiddenActions']))): + + $otherSingularVar = Inflector::variable($alias); + $otherPluralHumanName = Inflector::humanize($details['controller']); + ?> + + + +
+
+ + + +
diff --git a/code/ryzom/tools/server/www/webtt/app/views/comments/add.ctp b/code/ryzom/tools/server/www/webtt/app/views/comments/add.ctp new file mode 100644 index 000000000..58a0cfde8 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/comments/add.ctp @@ -0,0 +1,118 @@ +
+ +
+ +
+

+ +
+ Form->create('Comment');?> +
+ + Form->input('translation_id'); + echo $this->Form->hidden('identifier_id', array('default' => $identifier['Identifier']['id'])); + // TODO: change user_id for authorized user + echo $this->Form->hidden('user_id', array('default' => 1)); + echo $this->Form->input('comment'); + ?> +
+
+Form->end(__('Submit', true));?> +
+
+
+

+
+
+ +
">
+
"> + + +
+ +
+
+
+ Html->link($identifier['Language']['name'], array('controller' => 'languages', 'action' => 'view', $identifier['Language']['id'])); ?> +
+ +
+
">
+
"> + + +
+ +
+
">
+
"> + + +
+ +
+
">
+
"> + + +
+ +
+
">
+
"> + + +
+ +
+
">
+
"> + + +
+ +
+
">
+
"> + + +
+ +
+
">
+
"> + + +
+ +
+
+
+
+
+ +
+
diff --git a/code/ryzom/tools/server/www/webtt/app/views/users/add.ctp b/code/ryzom/tools/server/www/webtt/app/views/comments/admin_add.ctp similarity index 50% rename from code/ryzom/tools/server/www/webtt/app/views/users/add.ctp rename to code/ryzom/tools/server/www/webtt/app/views/comments/admin_add.ctp index 4bd0cc224..4510c6f25 100644 --- a/code/ryzom/tools/server/www/webtt/app/views/users/add.ctp +++ b/code/ryzom/tools/server/www/webtt/app/views/comments/admin_add.ctp @@ -5,9 +5,9 @@
-
+
+
  • Html->link(sprintf(__('List %s', true), __('Comments', true)), array('action' => 'index'));?>
  • Translations
    -
    Votes
    +
    Identifiers
    + +
    Users
    +
    @@ -26,18 +31,22 @@
    -

    +

    -
    - Form->create('User');?> +
    + Form->create('Comment');?>
    - + Form->input('name'); + echo $this->Form->input('translation_id'); + echo $this->Form->input('identifier_id'); + echo $this->Form->input('user_id'); + echo $this->Form->input('comment'); ?>
    - Form->end(__('Submit', true));?> -
    +
    +Form->end(__('Submit', true));?> +
    diff --git a/code/ryzom/tools/server/www/webtt/app/views/comments/admin_edit.ctp b/code/ryzom/tools/server/www/webtt/app/views/comments/admin_edit.ctp new file mode 100644 index 000000000..3341db17f --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/comments/admin_edit.ctp @@ -0,0 +1,53 @@ +
    + +
    + +
    +

    + +
    + Form->create('Comment');?> +
    + Form->value('Comment.id')); ?> + Form->input('id'); + echo $this->Form->input('translation_id'); + echo $this->Form->input('identifier_id'); + echo $this->Form->input('user_id'); + echo $this->Form->input('comment'); + ?> +
    +
    +Form->end(__('Submit', true));?> +
    + +
    +
    diff --git a/code/ryzom/tools/server/www/webtt/app/views/comments/admin_index.ctp b/code/ryzom/tools/server/www/webtt/app/views/comments/admin_index.ctp new file mode 100644 index 000000000..ba9dd8769 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/comments/admin_index.ctp @@ -0,0 +1,81 @@ +
    + +
    + +
    +

    + tableHeaders(array($paginator->sort('id'),$paginator->sort('translation_id'),$paginator->sort('identifier_id'),$paginator->sort('user_id'),$paginator->sort('comment'),$paginator->sort('created'),$paginator->sort('modified'),__('Actions', true),)); + echo ''.$tableHeaders.''; ?> + + + > + + + + + + + + + + + '.$tableHeaders.''; ?> +
    + Html->link($comment['Translation']['translation_text'], array('controller' => 'translations', 'action' => 'view', $comment['Translation']['id'])); ?> + + Html->link($comment['Identifier']['identifier'], array('controller' => 'identifiers', 'action' => 'view', $comment['Identifier']['id'])); ?> + + Html->link($comment['User']['name'], array('controller' => 'users', 'action' => 'view', $comment['User']['id'])); ?> + + Html->link(__('View', true), array('action' => 'view', $comment['Comment']['id'])); ?> + Html->link(__('Edit', true), array('action' => 'edit', $comment['Comment']['id'])); ?> + Html->link(__('Delete', true), array('action' => 'delete', $comment['Comment']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $comment['Comment']['id'])); ?> +
    + + +

    + Paginator->counter(array( + 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true) + )); + ?>

    + +
    + Paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?> + | Paginator->numbers();?> | + Paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?> +
    +
    +
    diff --git a/code/ryzom/tools/server/www/webtt/app/views/comments/admin_view.ctp b/code/ryzom/tools/server/www/webtt/app/views/comments/admin_view.ctp new file mode 100644 index 000000000..f7f6d1d75 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/comments/admin_view.ctp @@ -0,0 +1,97 @@ +
    + +
    + +
    + +
    +
    +

    +
    +
    + +
    ">
    +
    "> + + +
    + +
    +
    +
    + Html->link($comment['Translation']['translation_text'], array('controller' => 'translations', 'action' => 'view', $comment['Translation']['id'])); ?> +
    + +
    +
    +
    + Html->link($comment['Identifier']['identifier'], array('controller' => 'identifiers', 'action' => 'view', $comment['Identifier']['id'])); ?> +
    + +
    +
    +
    + Html->link($comment['User']['name'], array('controller' => 'users', 'action' => 'view', $comment['User']['id'])); ?> +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    +
    +
    +
    + + +
    +
    diff --git a/code/ryzom/tools/server/www/webtt/app/views/comments/edit.ctp b/code/ryzom/tools/server/www/webtt/app/views/comments/edit.ctp new file mode 100644 index 000000000..ad7b8cbbb --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/comments/edit.ctp @@ -0,0 +1,51 @@ +
    + +
    + +
    +

    + +
    + Form->create('Comment');?> +
    + Form->value('Comment.id')); ?> + Form->input('id'); + echo $this->Form->input('translation_id'); + echo $this->Form->input('identifier_id'); + echo $this->Form->input('user_id'); + echo $this->Form->input('comment'); + ?> +
    +
    +Form->end(__('Submit', true));?> +
    + +
    +
    diff --git a/code/ryzom/tools/server/www/webtt/app/views/comments/index.ctp b/code/ryzom/tools/server/www/webtt/app/views/comments/index.ctp new file mode 100644 index 000000000..9dca44d44 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/comments/index.ctp @@ -0,0 +1,72 @@ +
    + +
    + +
    +

    + tableHeaders(array($paginator->sort('id'),$paginator->sort('identifier_id'),$paginator->sort('user_id'),$paginator->sort('comment'),$paginator->sort('created'),$paginator->sort('modified'),__('Actions', true),)); + echo ''.$tableHeaders.''; ?> + + + > + + + + + + + + + + '.$tableHeaders.''; ?> +
    + Html->link($comment['Identifier']['identifier'], array('controller' => 'identifiers', 'action' => 'view', $comment['Identifier']['id'])); ?> + + Html->link($comment['User']['name'], array('controller' => 'users', 'action' => 'view', $comment['User']['id'])); ?> + + Html->link(__('View', true), array('action' => 'view', $comment['Comment']['id'])); ?> + Html->link(__('Edit', true), array('action' => 'edit', $comment['Comment']['id'])); ?> + Html->link(__('Delete', true), array('action' => 'delete', $comment['Comment']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $comment['Comment']['id'])); ?> +
    + + +

    + Paginator->counter(array( + 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true) + )); + ?>

    + +
    + Paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?> + | Paginator->numbers();?> | + Paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?> +
    +
    +
    diff --git a/code/ryzom/tools/server/www/webtt/app/views/comments/view.ctp b/code/ryzom/tools/server/www/webtt/app/views/comments/view.ctp new file mode 100644 index 000000000..bf60e8bc0 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/comments/view.ctp @@ -0,0 +1,84 @@ +
    + +
    + +
    + +
    +
    +

    +
    +
    + +
    ">
    +
    "> + + +
    + +
    +
    +
    + Html->link($comment['Identifier']['identifier'], array('controller' => 'identifiers', 'action' => 'view', $comment['Identifier']['id'])); ?> +
    + +
    +
    +
    + Html->link($comment['User']['name'], array('controller' => 'users', 'action' => 'view', $comment['User']['id'])); ?> +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    +
    +
    +
    + + +
    +
    diff --git a/code/ryzom/tools/server/www/webtt/app/views/elements/email/html/registration.ctp b/code/ryzom/tools/server/www/webtt/app/views/elements/email/html/registration.ctp new file mode 100644 index 000000000..3e90bb9d2 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/elements/email/html/registration.ctp @@ -0,0 +1,9 @@ +Hello , +Thank you for registering to WebTT! + +Your password is: +Html->url(array('controller' => 'users', 'action' => 'confirm', $user['User']['confirm_hash'])); +$completeUrl = 'http://' . $serverName . $url; +?> +Go to this link to confirm you account: Html->link(__('Confirm', true), $completeUrl); ?> diff --git a/code/ryzom/tools/server/www/webtt/app/views/elements/email/text/registration.ctp b/code/ryzom/tools/server/www/webtt/app/views/elements/email/text/registration.ctp new file mode 100644 index 000000000..42755916d --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/elements/email/text/registration.ctp @@ -0,0 +1,9 @@ +Hello , +Thank you for registering to WebTT! + +Your password is: +Html->url(array('controller' => 'users', 'action' => 'confirm', $user['User']['confirm_hash'])); +$completeUrl = 'http://' . $serverName . $url; +?> +Go to this link to confirm you account: diff --git a/code/ryzom/tools/server/www/webtt/app/views/identifier_columns/admin_index.ctp b/code/ryzom/tools/server/www/webtt/app/views/identifier_columns/admin_index.ctp new file mode 100644 index 000000000..d0ce4f8a1 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/identifier_columns/admin_index.ctp @@ -0,0 +1,71 @@ +
    + +
    + +
    +

    + tableHeaders(array($paginator->sort('id'),$paginator->sort('identifier_id'),$paginator->sort('column_name'),$paginator->sort('reference_string'),$paginator->sort('created'),$paginator->sort('modified'),__('Actions', true),)); + echo ''.$tableHeaders.''; ?> + + + > + + + + + + + + + + '.$tableHeaders.''; ?> +
    + Html->link($identifierColumn['Identifier']['identifier'], array('controller' => 'identifiers', 'action' => 'view', $identifierColumn['Identifier']['id'])); ?> + + Html->link(__('View', true), array('action' => 'view', $identifierColumn['IdentifierColumn']['id'])); ?> + Html->link(__('Edit', true), array('action' => 'edit', $identifierColumn['IdentifierColumn']['id'])); ?> + Html->link(__('Delete', true), array('action' => 'delete', $identifierColumn['IdentifierColumn']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $identifierColumn['IdentifierColumn']['id'])); ?> +
    + + +

    + Paginator->counter(array( + 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true) + )); + ?>

    + +
    + Paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?> + | Paginator->numbers();?> | + Paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?> +
    +
    +
    diff --git a/code/ryzom/tools/server/www/webtt/app/views/identifier_columns/admin_view.ctp b/code/ryzom/tools/server/www/webtt/app/views/identifier_columns/admin_view.ctp new file mode 100644 index 000000000..f50428a1e --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/identifier_columns/admin_view.ctp @@ -0,0 +1,146 @@ +
    + +
    + +
    + +
    +
    +

    +
    +
    + +
    ">
    +
    "> + + +
    + +
    +
    +
    + Html->link($identifierColumn['Identifier']['identifier'], array('controller' => 'identifiers', 'action' => 'view', $identifierColumn['Identifier']['id'])); ?> +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    +
    +
    +
    + +
    +

    + +

    + +
    + +
    +
    diff --git a/code/ryzom/tools/server/www/webtt/app/views/identifier_columns/index.ctp b/code/ryzom/tools/server/www/webtt/app/views/identifier_columns/index.ctp new file mode 100644 index 000000000..d0ce4f8a1 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/identifier_columns/index.ctp @@ -0,0 +1,71 @@ +
    + +
    + +
    +

    + tableHeaders(array($paginator->sort('id'),$paginator->sort('identifier_id'),$paginator->sort('column_name'),$paginator->sort('reference_string'),$paginator->sort('created'),$paginator->sort('modified'),__('Actions', true),)); + echo ''.$tableHeaders.''; ?> + + + > + + + + + + + + + + '.$tableHeaders.''; ?> +
    + Html->link($identifierColumn['Identifier']['identifier'], array('controller' => 'identifiers', 'action' => 'view', $identifierColumn['Identifier']['id'])); ?> + + Html->link(__('View', true), array('action' => 'view', $identifierColumn['IdentifierColumn']['id'])); ?> + Html->link(__('Edit', true), array('action' => 'edit', $identifierColumn['IdentifierColumn']['id'])); ?> + Html->link(__('Delete', true), array('action' => 'delete', $identifierColumn['IdentifierColumn']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $identifierColumn['IdentifierColumn']['id'])); ?> +
    + + +

    + Paginator->counter(array( + 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true) + )); + ?>

    + +
    + Paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?> + | Paginator->numbers();?> | + Paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?> +
    +
    +
    diff --git a/code/ryzom/tools/server/www/webtt/app/views/identifier_columns/view.ctp b/code/ryzom/tools/server/www/webtt/app/views/identifier_columns/view.ctp new file mode 100644 index 000000000..f8b9fc85a --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/identifier_columns/view.ctp @@ -0,0 +1,146 @@ +
    + +
    + +
    + +
    +
    +

    +
    +
    + +
    ">
    +
    "> + + +
    + +
    +
    +
    + Html->link($identifierColumn['Identifier']['identifier'], array('controller' => 'identifiers', 'action' => 'view', $identifierColumn['Identifier']['id'])); ?> +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    +
    +
    +
    + +
    +

    + +

    + +
    + +
    +
    diff --git a/code/ryzom/tools/server/www/webtt/app/views/layouts/email/html/default.ctp b/code/ryzom/tools/server/www/webtt/app/views/layouts/email/html/default.ctp new file mode 100644 index 000000000..2f797c7a3 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/layouts/email/html/default.ctp @@ -0,0 +1,6 @@ + + + + + + diff --git a/code/ryzom/tools/server/www/webtt/app/views/layouts/email/text/default.ctp b/code/ryzom/tools/server/www/webtt/app/views/layouts/email/text/default.ctp new file mode 100644 index 000000000..3f290130e --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/layouts/email/text/default.ctp @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/code/ryzom/tools/server/www/webtt/app/views/pages/admin/home.ctp b/code/ryzom/tools/server/www/webtt/app/views/pages/admin/home.ctp new file mode 100644 index 000000000..9c2ebc08d --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/pages/admin/home.ctp @@ -0,0 +1,103 @@ + +
    +

    + + +
    + + + + +
    +

    + + +
    diff --git a/code/ryzom/tools/server/www/webtt/app/views/raw_files/admin_view.ctp b/code/ryzom/tools/server/www/webtt/app/views/raw_files/admin_view.ctp new file mode 100644 index 000000000..4400a58d4 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/raw_files/admin_view.ctp @@ -0,0 +1,65 @@ +
    + +
    + +
    + +
    +
    +

    +
    +
    + +
    ">
    +
    "> + +   +
    + +
    ">
    +
    "> + +   +
    + +
    ">
    +
    "> + Time->nice($rawFile['RawFile']['modified']); ?> +   +
    + +
    +
    +
    +
    + +
    +

    + +

    + +
    + +
    +
    diff --git a/code/ryzom/tools/server/www/webtt/app/views/translation_files/admin_index.ctp b/code/ryzom/tools/server/www/webtt/app/views/translation_files/admin_index.ctp new file mode 100644 index 000000000..15f7662ef --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/translation_files/admin_index.ctp @@ -0,0 +1,71 @@ +
    + +
    + +
    +

    + tableHeaders(array($paginator->sort('id'),$paginator->sort('language_id'),$paginator->sort('filename_template'),$paginator->sort('created'),$paginator->sort('modified'),__('Actions', true),)); + echo ''.$tableHeaders.''; ?> + + + > + + + + + + + + + '.$tableHeaders.''; ?> +
    + Html->link($translationFile['Language']['name'], array('controller' => 'languages', 'action' => 'view', $translationFile['Language']['id'])); ?> + + Html->link(__('View', true), array('action' => 'view', $translationFile['TranslationFile']['id'])); ?> +
    + + +

    + Paginator->counter(array( + 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true) + )); + ?>

    + +
    + Paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?> + | Paginator->numbers();?> | + Paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?> +
    +
    +
    diff --git a/code/ryzom/tools/server/www/webtt/app/views/translation_files/admin_view.ctp b/code/ryzom/tools/server/www/webtt/app/views/translation_files/admin_view.ctp new file mode 100644 index 000000000..26d64c899 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/translation_files/admin_view.ctp @@ -0,0 +1,190 @@ +
    + +
    + +
    + +
    +
    +

    +
    +
    + +
    ">
    +
    "> + + +
    + +
    +
    +
    + Html->link($translationFile['Language']['name'], array('controller' => 'languages', 'action' => 'view', $translationFile['Language']['id'])); ?> +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    +
    +
    +
    + +
    +

    + +

    + +
    + +
    +
    diff --git a/code/ryzom/tools/server/www/webtt/app/views/translation_files/index.ctp b/code/ryzom/tools/server/www/webtt/app/views/translation_files/index.ctp new file mode 100644 index 000000000..20dfa8676 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/translation_files/index.ctp @@ -0,0 +1,67 @@ +
    + +
    + +
    +

    + tableHeaders(array($paginator->sort('id'),$paginator->sort('language_id'),$paginator->sort('filename_template'),$paginator->sort('created'),$paginator->sort('modified'),__('Actions', true),)); + echo ''.$tableHeaders.''; ?> + + + > + + + + + + + + + '.$tableHeaders.''; ?> +
    + Html->link($translationFile['Language']['name'], array('controller' => 'languages', 'action' => 'view', $translationFile['Language']['id'])); ?> + + Html->link(__('View', true), array('action' => 'view', $translationFile['TranslationFile']['id'])); ?> + | Html->link(__('List Identifiers', true), array('controller' => 'identifiers', 'action' => 'index', 'translation_file_id' => $translationFile['TranslationFile']['id'])); ?> +
    + + +

    + Paginator->counter(array( + 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true) + )); + ?>

    + +
    + Paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?> + | Paginator->numbers();?> | + Paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?> +
    +
    +
    diff --git a/code/ryzom/tools/server/www/webtt/app/views/translation_files/view.ctp b/code/ryzom/tools/server/www/webtt/app/views/translation_files/view.ctp new file mode 100644 index 000000000..65cec5104 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/translation_files/view.ctp @@ -0,0 +1,136 @@ +
    + +
    + +
    + +
    +
    +

    +
    +
    + +
    ">
    +
    "> + + +
    + +
    +
    +
    + Html->link($translationFile['Language']['name'], array('controller' => 'languages', 'action' => 'view', $translationFile['Language']['id'])); ?> +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    ">
    +
    "> + + +
    + +
    +
    +
    +
    +
    + +
    +

    + +

    + +
    + +
    +
    diff --git a/code/ryzom/tools/server/www/webtt/app/views/users/edit.ctp b/code/ryzom/tools/server/www/webtt/app/views/users/edit.ctp deleted file mode 100644 index acdec0d93..000000000 --- a/code/ryzom/tools/server/www/webtt/app/views/users/edit.ctp +++ /dev/null @@ -1,44 +0,0 @@ -
    - -
    - -
    -

    - -
    - Form->create('User');?> -
    - Form->value('User.id')); ?> - Form->input('id'); - echo $this->Form->input('name'); - ?> -
    - Form->end(__('Submit', true));?> -
    - -
    -
    diff --git a/code/ryzom/tools/server/www/webtt/app/views/users/login.ctp b/code/ryzom/tools/server/www/webtt/app/views/users/login.ctp new file mode 100644 index 000000000..bf04d682d --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/users/login.ctp @@ -0,0 +1,10 @@ +Session->flash('auth'); +echo $this->Form->create('User', array('action' => 'login')); +echo $this->Form->inputs(array( +'legend' => __('Login', true), +'username', +'password' +)); +echo $this->Form->end('Login'); +?> diff --git a/code/ryzom/tools/server/www/webtt/app/views/users/register.ctp b/code/ryzom/tools/server/www/webtt/app/views/users/register.ctp new file mode 100644 index 000000000..cda035bce --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/views/users/register.ctp @@ -0,0 +1,14 @@ +Session->flash('email'); + +echo $this->Session->flash('auth'); +echo $this->Form->create('User', array('action' => 'register')); +echo $this->Form->inputs(array( +'legend' => __('Register', true), +'username', +'name', +'email', +'passwd', +)); +echo $this->Form->end('Register'); +?> diff --git a/code/ryzom/tools/server/www/webtt/app/webroot/css/labelWidth.css b/code/ryzom/tools/server/www/webtt/app/webroot/css/labelWidth.css new file mode 100644 index 000000000..d7b3569a6 --- /dev/null +++ b/code/ryzom/tools/server/www/webtt/app/webroot/css/labelWidth.css @@ -0,0 +1,9 @@ +.importedTranslationFiles div.dt, .importedTranslationFiles label { + width: 15em; +} +.identifiers div.dt, .identifiers labek { + width: 13em; +} +.fileIdentifiers div.dt, .fileIdentifiers label { + width: 17em; +} diff --git a/code/ryzom/tools/server/www/webtt/app/webroot/img/switch_minus.gif b/code/ryzom/tools/server/www/webtt/app/webroot/img/switch_minus.gif new file mode 100644 index 000000000..959a5c228 Binary files /dev/null and b/code/ryzom/tools/server/www/webtt/app/webroot/img/switch_minus.gif differ diff --git a/code/ryzom/tools/server/www/webtt/app/webroot/img/switch_plus.gif b/code/ryzom/tools/server/www/webtt/app/webroot/img/switch_plus.gif new file mode 100644 index 000000000..84ac35324 Binary files /dev/null and b/code/ryzom/tools/server/www/webtt/app/webroot/img/switch_plus.gif differ